somratpro Claude Sonnet 4.5 commited on
Commit
d8ef5a6
·
1 Parent(s): 5d10651

fix: default JUPYTER_ENABLED to true, remove baked DEV_MODE from image

Browse files

Dockerfile: remove ENV DEV_MODE=false baked at build time — was causing
start.sh auto-enable check to fail (DEV_MODE non-empty → condition skipped).
DEV_MODE is now unset at runtime by default; HF Space Variable overrides
still work normally.

health-server.js: simplify JUPYTER_ENABLED logic — true by default, only
false when DEV_MODE=false or HUGGINGCLAW_JUPYTER_ENABLED=false is explicitly
set by the user.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

Files changed (2) hide show
  1. Dockerfile +3 -1
  2. health-server.js +4 -6
Dockerfile CHANGED
@@ -15,7 +15,9 @@ FROM ghcr.io/openclaw/openclaw:${OPENCLAW_VERSION} AS openclaw
15
  FROM node:22-slim
16
  ARG OPENCLAW_VERSION=latest
17
  ARG DEV_MODE=false
18
- ENV DEV_MODE=${DEV_MODE}
 
 
19
 
20
  # Install system dependencies (+ optional JupyterLab deps in DEV_MODE)
21
  RUN apt-get update && apt-get install -y \
 
15
  FROM node:22-slim
16
  ARG OPENCLAW_VERSION=latest
17
  ARG DEV_MODE=false
18
+ # DEV_MODE intentionally not baked into runtime ENV — defaults to unset so
19
+ # start.sh can auto-enable terminal when GATEWAY_TOKEN is present. Users can
20
+ # override by setting DEV_MODE=false as an HF Space Variable to opt out.
21
 
22
  # Install system dependencies (+ optional JupyterLab deps in DEV_MODE)
23
  RUN apt-get update && apt-get install -y \
health-server.js CHANGED
@@ -22,12 +22,10 @@ const JUPYTER_HOST = "127.0.0.1";
22
  const JUPYTER_BASE = normalizeBase(process.env.JUPYTER_BASE, "/terminal");
23
  const GATEWAY_TOKEN = (process.env.GATEWAY_TOKEN || "").trim();
24
  const DEV_MODE_ENABLED = isTrue(process.env.DEV_MODE);
25
- // Jupyter enabled by default. Only disabled when explicitly set to false via
26
- // DEV_MODE=false or HUGGINGCLAW_JUPYTER_ENABLED=false.
27
- const JUPYTER_EXPLICITLY_DISABLED = /^(false|0|no|off)$/i.test(
28
- String(process.env.HUGGINGCLAW_JUPYTER_ENABLED || process.env.DEV_MODE || "").trim()
29
- );
30
- const JUPYTER_ENABLED = !JUPYTER_EXPLICITLY_DISABLED;
31
  const startTime = Date.now();
32
  const LLM_MODEL = process.env.LLM_MODEL || "Not Set";
33
  const TELEGRAM_ENABLED = !!process.env.TELEGRAM_BOT_TOKEN;
 
22
  const JUPYTER_BASE = normalizeBase(process.env.JUPYTER_BASE, "/terminal");
23
  const GATEWAY_TOKEN = (process.env.GATEWAY_TOKEN || "").trim();
24
  const DEV_MODE_ENABLED = isTrue(process.env.DEV_MODE);
25
+ // Default true. Only false when DEV_MODE=false or HUGGINGCLAW_JUPYTER_ENABLED=false is explicitly set.
26
+ const JUPYTER_ENABLED =
27
+ !/^(false|0|no|off)$/i.test(String(process.env.DEV_MODE || "").trim()) &&
28
+ !/^(false|0|no|off)$/i.test(String(process.env.HUGGINGCLAW_JUPYTER_ENABLED || "").trim());
 
 
29
  const startTime = Date.now();
30
  const LLM_MODEL = process.env.LLM_MODEL || "Not Set";
31
  const TELEGRAM_ENABLED = !!process.env.TELEGRAM_BOT_TOKEN;