tao-shen commited on
Commit
90ba944
Β·
1 Parent(s): 98cdf74

fix: move inject-token to runtime entrypoint (build-time injection ignored by OpenClaw)

Browse files
Files changed (2) hide show
  1. Dockerfile +1 -2
  2. scripts/entrypoint.sh +7 -0
Dockerfile CHANGED
@@ -51,8 +51,7 @@ RUN echo "[build][layer2] Clone + install + build..." && START=$(date +%s) \
51
  # ── Layer 3 (node): Scripts + Config + Token 注ε…₯ ─────────────────────────────
52
  COPY --chown=node:node scripts /home/node/scripts
53
  COPY --chown=node:node openclaw.json /home/node/scripts/openclaw.json.default
54
- RUN chmod +x /home/node/scripts/entrypoint.sh /home/node/scripts/sync_hf.py /home/node/scripts/inject-token.sh \
55
- && OPENCLAW_APP_DIR=/app/openclaw bash /home/node/scripts/inject-token.sh
56
 
57
  ENV NODE_ENV=production
58
  ENV OPENCLAW_BUNDLED_PLUGINS_DIR=/app/openclaw/empty-bundled-plugins
 
51
  # ── Layer 3 (node): Scripts + Config + Token 注ε…₯ ─────────────────────────────
52
  COPY --chown=node:node scripts /home/node/scripts
53
  COPY --chown=node:node openclaw.json /home/node/scripts/openclaw.json.default
54
+ RUN chmod +x /home/node/scripts/entrypoint.sh /home/node/scripts/sync_hf.py /home/node/scripts/inject-token.sh
 
55
 
56
  ENV NODE_ENV=production
57
  ENV OPENCLAW_BUNDLED_PLUGINS_DIR=/app/openclaw/empty-bundled-plugins
scripts/entrypoint.sh CHANGED
@@ -48,6 +48,13 @@ touch /home/node/logs/app.log
48
  ENTRYPOINT_END=$(date +%s)
49
  echo "[TIMER] Entrypoint (before sync_hf.py): $((ENTRYPOINT_END - BOOT_START))s"
50
 
 
 
 
 
 
 
 
51
  # ── Start OpenClaw via sync_hf.py (don't wait for DNS β€” it runs in bg) ─────
52
  echo "[entrypoint] Starting OpenClaw via sync_hf.py..."
53
  echo "[entrypoint] DNS resolution running in background (PID $DNS_PID), app will use it when ready"
 
48
  ENTRYPOINT_END=$(date +%s)
49
  echo "[TIMER] Entrypoint (before sync_hf.py): $((ENTRYPOINT_END - BOOT_START))s"
50
 
51
+ # ── Inject auto-token into Control UI (must happen at runtime, not build) ────
52
+ INJECT_START=$(date +%s)
53
+ if [ -x /home/node/scripts/inject-token.sh ]; then
54
+ OPENCLAW_APP_DIR=/app/openclaw bash /home/node/scripts/inject-token.sh
55
+ fi
56
+ echo "[TIMER] Token inject: $(($(date +%s) - INJECT_START))s"
57
+
58
  # ── Start OpenClaw via sync_hf.py (don't wait for DNS β€” it runs in bg) ─────
59
  echo "[entrypoint] Starting OpenClaw via sync_hf.py..."
60
  echo "[entrypoint] DNS resolution running in background (PID $DNS_PID), app will use it when ready"