Spaces:
Sleeping
Sleeping
Hard Reset: Clear persistent config conflicts and force networking vars
Browse files- 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
|
| 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 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
ENTRYPOINT []
|
| 19 |
|
| 20 |
-
#
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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"]
|