MaxSainz2000 commited on
Commit
499c0dc
·
verified ·
1 Parent(s): 93dcab1

Hard Reset: Clear persistent config conflicts and force networking vars

Browse files
Files changed (1) hide show
  1. Dockerfile +23 -8
Dockerfile CHANGED
@@ -3,9 +3,9 @@ FROM moltbot/moltbot:latest
3
  # Switch to root to install python and access /root
4
  USER root
5
 
6
- # Install Python3 and Pip
7
  RUN apt-get update && \
8
- apt-get install -y python3 python3-pip && \
9
  rm -rf /var/lib/apt/lists/*
10
 
11
  # Install Supabase client
@@ -14,11 +14,26 @@ RUN pip3 install supabase --break-system-packages
14
  # Copy the sync script
15
  COPY sync_memory.py /app/sync_memory.py
16
 
17
- # Reset entrypoint to ensure we can run our shell command
 
 
 
 
 
 
 
 
 
 
 
18
  ENTRYPOINT []
19
 
20
- # Networking and Security Fixes:
21
- # 1. MOLTBOT_GATEWAY_TOKEN: Uses your WEB_UI_TOKEN secret for authentication.
22
- # 2. MOLTBOT_ALLOW_ORIGINS: Set to '*' to allow connections from the Hugging Face domain.
23
- # 3. BIND: Explicitly binding to 0.0.0.0 via '--bind lan' to allow external health checks.
24
- CMD ["/bin/sh", "-c", "python3 -u /app/sync_memory.py & export MOLTBOT_GATEWAY_TOKEN=$WEB_UI_TOKEN; export CLAWDBOT_GATEWAY_TOKEN=$WEB_UI_TOKEN; export OPENCLAW_GATEWAY_TOKEN=$WEB_UI_TOKEN; export MOLTBOT_ALLOW_ORIGINS='*'; node dist/index.js gateway --port 7860 --bind lan --allow-unconfigured"]
 
 
 
 
 
3
  # Switch to root to install python and access /root
4
  USER root
5
 
6
+ # Install Python3, Pip, and Sed
7
  RUN apt-get update && \
8
+ apt-get install -y python3 python3-pip sed && \
9
  rm -rf /var/lib/apt/lists/*
10
 
11
  # Install Supabase client
 
14
  # Copy the sync script
15
  COPY sync_memory.py /app/sync_memory.py
16
 
17
+ # Force-set environment variables for "Hard Reset"
18
+ ENV MOLTBOT_GATEWAY_TOKEN=WebuitokenPassword12345
19
+ ENV CLAWDBOT_GATEWAY_TOKEN=WebuitokenPassword12345
20
+ ENV OPENCLAW_GATEWAY_TOKEN=WebuitokenPassword12345
21
+ ENV MOLTBOT_GATEWAY_ALLOW_ORIGINS=*
22
+ ENV CLAWDBOT_GATEWAY_ALLOW_ORIGINS=*
23
+ ENV MOLTBOT_GATEWAY_BIND=0.0.0.0
24
+
25
+ # Ensure the port is exposed
26
+ EXPOSE 7860
27
+
28
+ # Reset entrypoint
29
  ENTRYPOINT []
30
 
31
+ # Startup command with 'Sed' hack to clear conflicting persistent settings
32
+ CMD ["/bin/sh", "-c", "python3 -u /app/sync_memory.py & \
33
+ echo 'Performing Hard Reset on persistent config...'; \
34
+ if [ -d '/root/.molt' ]; then \
35
+ find /root/.molt -name '*.json' -exec sed -i '/\"token\":/d' {} +; \
36
+ find /root/.molt -name '*.json' -exec sed -i '/\"password\":/d' {} +; \
37
+ find /root/.molt -name '*.json' -exec sed -i '/\"bind\":/d' {} +; \
38
+ fi; \
39
+ node dist/index.js gateway --port 7860 --bind lan --allow-unconfigured"]