Improve Jupyter token security , enhance startup robustness
Browse filesFiles changed (4)
- .env.example+2-9
- README.md+3-3
- env-builder.js+2-30
- start.sh+17-15
247 unmodified lines24824925025125225325425532 unmodified lines288289290291292293294295296297298299300301247 unmodified linesGATEWAY_TOKEN=your_gateway_token_here# [OPTIONAL] JupyterLab terminal token for /terminal/# Defaults to "huggingface" if unset. Set a strong token for private deployments.JUPYTER_TOKEN=huggingface# (Optional) Password auth β simpler alternative to token for casual users# If set, users can log in with this password instead of the token32 unmodified lines# Default: huggingclaw-backupBACKUP_DATASET_NAME=huggingclaw-backup# Git commit identity for workspace syncsWORKSPACE_GIT_USER=openclaw@example.comWORKSPACE_GIT_NAME=OpenClaw Bot# ββ OPTIONAL: Background Services ββ# Keep-alive ping interval (seconds). Default: 300. Set 0 to disable.KEEP_ALIVE_INTERVAL=300# Workspace auto-sync interval (seconds). Default: 180.SYNC_INTERVAL=180247 unmodified lines24824925025125225325425532 unmodified lines288289290291292293294247 unmodified linesGATEWAY_TOKEN=your_gateway_token_here# [OPTIONAL] JupyterLab terminal token for /terminal/# Set a strong token for private deployments. Must NOT be "huggingface".JUPYTER_TOKEN=run: openssl rand -hex 32# (Optional) Password auth β simpler alternative to token for casual users# If set, users can log in with this password instead of the token32 unmodified lines# Default: huggingclaw-backupBACKUP_DATASET_NAME=huggingclaw-backup# ββ OPTIONAL: Background Services ββ# Workspace auto-sync interval (seconds). Default: 180.SYNC_INTERVAL=180
103 unmodified lines104105106107108109110255 unmodified lines366367368369370371372373374375376377103 unmodified lines> [!TIP]> HuggingClaw is completely flexible! You only need these three secrets to get started. You can set other secrets later.Optional: set `DEV_MODE=true` (Variable) to enable JupyterLab support and install Jupyter dependencies at build time. You can also set `JUPYTER_TOKEN` as a Secret to replace the default terminal token (`huggingface`). If you want to pin a specific OpenClaw release instead of `latest`, add `OPENCLAW_VERSION` under **Variables** in your Space settings. For Docker Spaces, HF passes Variables as build args during image build, so these should be Variables, not Secrets (except tokens).### Step 3: Deploy & Run255 unmodified lines| :--- | :--- | :--- | :--- || `/` | HuggingClaw dashboard | `7861` | Public HF Spaces entrypoint || `/app/` | OpenClaw Control UI | `7860` | Mounted behind the local reverse proxy || `/terminal/` | JupyterLab terminal (DEV_MODE only) | `8888` | Available only when `DEV_MODE=true`; token login uses `JUPYTER_TOKEN` (default `huggingface`) |When enabled, the terminal notebook root is `/home/node`, so you can inspect HuggingClaw files, logs, workspace state, and runtime scripts from the browser.> [!IMPORTANT]> For real deployments, set a strong `JUPYTER_TOKEN` secret. The `huggingface` default exists only to match the duplicateable Hugging Face JupyterLab template.## π Merge Comparison103 unmodified lines104105106107108109110255 unmodified lines366367368369370371372373374375376377103 unmodified lines> [!TIP]> HuggingClaw is completely flexible! You only need these three secrets to get started. You can set other secrets later.Optional: set `DEV_MODE=true` (Variable) to enable JupyterLab support and install Jupyter dependencies at build time. You can also set `JUPYTER_TOKEN` as a Secret to set a strong terminal token (must not be `huggingface`). If you want to pin a specific OpenClaw release instead of `latest`, add `OPENCLAW_VERSION` under **Variables** in your Space settings. For Docker Spaces, HF passes Variables as build args during image build, so these should be Variables, not Secrets (except tokens).### Step 3: Deploy & Run255 unmodified lines| :--- | :--- | :--- | :--- || `/` | HuggingClaw dashboard | `7861` | Public HF Spaces entrypoint || `/app/` | OpenClaw Control UI | `7860` | Mounted behind the local reverse proxy || `/terminal/` | JupyterLab terminal (DEV_MODE only) | `8888` | Available only when `DEV_MODE=true`; token login uses `JUPYTER_TOKEN` (set a strong value) |When enabled, the terminal notebook root is `/home/node`, so you can inspect HuggingClaw files, logs, workspace state, and runtime scripts from the browser.> [!IMPORTANT]> For real deployments, set a strong `JUPYTER_TOKEN` secret. Do not use `huggingface`; generate a strong token with `openssl rand -hex 32`.## π Merge Comparison
850 unmodified lines851852853854855856857858859860861862863864865866867868869870871872102 unmodified lines975976977978979980981982983984985986987988989990991992993994995996997998850 unmodified lines"g": "Core","icon": "β‘","k": "JUPYTER_TOKEN","lbl": "Jupyter access token","type": "password","ph": "huggingface","common": 1,"tag": "credential"},{"g": "Core","icon": "β‘","k": "KEEP_ALIVE_INTERVAL","lbl": "Keep-alive ping interval (seconds)","type": "number","ph": "300","common": 1,"tag": "advanced"},{"g": "Core","icon": "β‘",102 unmodified lines"ph": "/home/node","tag": "advanced"},{"g": "Backup","icon": "πΎ","k": "WORKSPACE_GIT_USER","lbl": "Workspace git author email","type": "text","ph": "openclaw@example.com","tag": "optional"},{"g": "Backup","icon": "πΎ","k": "WORKSPACE_GIT_NAME","lbl": "Workspace git author name","type": "text","ph": "OpenClaw Bot","tag": "optional"},{"g": "Provider Keys","icon": "π",850 unmodified lines851852853854855856857858859860861862102 unmodified lines965966967968969970850 unmodified lines"g": "Core","icon": "β‘","k": "JUPYTER_TOKEN","lbl": "Jupyter access token (Must NOT be 'huggingface'. Run: openssl rand -hex 32)","type": "password","ph": "change_this_to_a_strong_token","common": 1,"tag": "credential"},{"g": "Core","icon": "β‘",102 unmodified lines"ph": "/home/node","tag": "advanced"},{"g": "Provider Keys","icon": "π",
510 unmodified lines511512513514515516517518519520521522523259 unmodified lines783784785786787788789793 unmodified lines15831584158515861587158822 unmodified lines1611161216131614161516161617161816191620162116221623162416251626510 unmodified linesBROWSER_EXECUTABLE_PATH=""for candidate in /usr/bin/chromium /usr/bin/chromium-browser /snap/bin/chromium; doif [ -x "$candidate" ]; then# Reject snap stubs β they silently fail in Dockerif file "$candidate" 2>/dev/null | grep -q "ELF"; thenBROWSER_EXECUTABLE_PATH="$candidate"breakelif head -1 "$candidate" 2>/dev/null | grep -qv "snap\|exec"; thenBROWSER_EXECUTABLE_PATH="$candidate"breakfifidone259 unmodified linesif [ -n "${CLOUDFLARE_PROXY_URL:-}" ]; thenecho "Proxy : ${CLOUDFLARE_PROXY_URL}"fiRUNTIME_JUPYTER_ENABLED="$DEV_MODE_ENABLED"# Add user bin to PATH for jupyter-lab (installed in Dockerfile when DEV_MODE=true)export PATH="$HOME/.local/bin:$PATH"793 unmodified linesecho "WhatsApp Guardian started (PID: $GUARDIAN_PID)"}while true; do# Check health-server process - restart if died unexpectedlyif [ -n "${HEALTH_PID:-}" ] && ! kill -0 "$HEALTH_PID" 2>/dev/null; then22 unmodified linesif [ "${AUTO_DOCTOR:-false}" = "true" ]; thenopenclaw doctor --fix || truefi# ββ Silence D-Bus errors for headless Chromium ββif [ -z "${DBUS_SESSION_BUS_ADDRESS:-}" ]; thenif command -v dbus-launch >/dev/null 2>&1; theneval "$(dbus-launch --sh-syntax 2>/dev/null)" || trueexport DBUS_SESSION_BUS_ADDRESS="${DBUS_SESSION_BUS_ADDRESS:-disabled:}"elseexport DBUS_SESSION_BUS_ADDRESS="disabled:"fifiecho "Launching OpenClaw gateway on port 7860..."GATEWAY_ARGS=(gateway run --port 7860 --bind lan)510 unmodified lines511512513514515516517518519259 unmodified lines779780781782783784785786787788789790791793 unmodified lines158515861587158815891590159115921593159415951596159715981599160022 unmodified lines162316241625162616271628510 unmodified linesBROWSER_EXECUTABLE_PATH=""for candidate in /usr/bin/chromium /usr/bin/chromium-browser /snap/bin/chromium; doif [ -x "$candidate" ]; thenif file "$candidate" 2>/dev/null | grep -q "ELF"; thenBROWSER_EXECUTABLE_PATH="$candidate"breakfifidone259 unmodified linesif [ -n "${CLOUDFLARE_PROXY_URL:-}" ]; thenecho "Proxy : ${CLOUDFLARE_PROXY_URL}"fi# HUGGINGCLAW_JUPYTER_ENABLED env var se override allow karo# (env-builder "Enable Jupyter terminal" toggle yahi set karta hai)if hc_is_true "${HUGGINGCLAW_JUPYTER_ENABLED:-false}"; thenRUNTIME_JUPYTER_ENABLED=trueelseRUNTIME_JUPYTER_ENABLED="$DEV_MODE_ENABLED"fi# Add user bin to PATH for jupyter-lab (installed in Dockerfile when DEV_MODE=true)export PATH="$HOME/.local/bin:$PATH"793 unmodified linesecho "WhatsApp Guardian started (PID: $GUARDIAN_PID)"}# ββ Start D-Bus session (once, before gateway loop) ββif [ -z "${DBUS_SESSION_BUS_ADDRESS:-}" ]; thenif command -v dbus-launch >/dev/null 2>&1; theneval "$(dbus-launch --sh-syntax 2>/dev/null)" || trueexport DBUS_SESSION_BUS_ADDRESS="${DBUS_SESSION_BUS_ADDRESS:-disabled:}"elseexport DBUS_SESSION_BUS_ADDRESS="disabled:"fifiwhile true; do# Check health-server process - restart if died unexpectedlyif [ -n "${HEALTH_PID:-}" ] && ! kill -0 "$HEALTH_PID" 2>/dev/null; then22 unmodified linesif [ "${AUTO_DOCTOR:-false}" = "true" ]; thenopenclaw doctor --fix || truefiecho "Launching OpenClaw gateway on port 7860..."GATEWAY_ARGS=(gateway run --port 7860 --bind lan)
.env.example+2-9
README.md+3-3
env-builder.js+2-30
start.sh+17-15