Spaces:
Paused
Paused
Codex commited on
Commit Β·
14fd0fa
1
Parent(s): b617e46
Fix sync robustness, devdata activation, alias cleanup, and timing-safe auth compare
Browse filesFiles changed (7)
- .env.example+3
- README.md+1
- env-builder.js+9-26
- health-server.js+5-8
- jupyter-devdata-sync.py+36-13
- openclaw-sync.py+110-20
- start.sh+6-7
315 unmodified lines316317318319320321315 unmodified lines# Wait for openclaw.json to stay valid and unchanged before syncing. Default: 3.OPENCLAW_CONFIG_SETTLE_SECONDS=3# Webhooks: Standard POST notifications for lifecycle events# WEBHOOK_URL=https://your-webhook-endpoint.com/log315 unmodified lines316317318319320321322323324315 unmodified lines# Wait for openclaw.json to stay valid and unchanged before syncing. Default: 3.OPENCLAW_CONFIG_SETTLE_SECONDS=3# Minimum gap between sessions-triggered immediate syncs (seconds). Default: 30.SESSIONS_MIN_SYNC_GAP=30# Webhooks: Standard POST notifications for lifecycle events# WEBHOOK_URL=https://your-webhook-endpoint.com/log
176 unmodified lines177178179180181182176 unmodified lines| `SYNC_INTERVAL` | `180` | Full backup frequency in seconds || `OPENCLAW_CONFIG_WATCH_INTERVAL` | `1` | How often to check `openclaw.json` for immediate settings sync || `OPENCLAW_CONFIG_SETTLE_SECONDS` | `3` | How long `openclaw.json` must stay valid and unchanged before syncing |## π¦ Ephemeral Package Re-install *(Optional)*176 unmodified lines177178179180181182183176 unmodified lines| `SYNC_INTERVAL` | `180` | Full backup frequency in seconds || `OPENCLAW_CONFIG_WATCH_INTERVAL` | `1` | How often to check `openclaw.json` for immediate settings sync || `OPENCLAW_CONFIG_SETTLE_SECONDS` | `3` | How long `openclaw.json` must stay valid and unchanged before syncing || `SESSIONS_MIN_SYNC_GAP` | `30` | Minimum seconds between session-triggered immediate syncs |## π¦ Ephemeral Package Re-install *(Optional)*
971 unmodified lines97297397497597697721 unmodified lines99910001001100210031004100510061007100810091010101110121013228 unmodified lines12421243124412451246124712481249125012511252125312541255125618 unmodified lines12751276127712781279128012811282128312841285128612871288971 unmodified lines"ph": "3","tag": "advanced"},{"g": "Runtime","icon": "βοΈ",21 unmodified lines"common": 0,"tag": "credential"},{"g": "Provider Keys","icon": "π","k": "GOOGLE_API_KEY","lbl": "Google AI Studio","type": "password","common": 0,"tag": "credential"},{"g": "Provider Keys","icon": "π",228 unmodified lines"common": 0,"tag": "credential"},{"g": "Provider Keys","icon": "π","k": "CLOUDFLARE_API_TOKEN","lbl": "Cloudflare API token","type": "password","common": 0,"tag": "credential"},{"g": "Rotation Pools","icon": "π",18 unmodified lines"type": "text","tag": "advanced"},{"g": "Rotation Pools","icon": "π","k": "GOOGLE_API_KEYS","lbl": "Google pool","type": "text","tag": "advanced"},{"g": "Rotation Pools","icon": "π",971 unmodified lines97297397497597697797897998098198298398498598621 unmodified lines100810091010101110121013228 unmodified lines12421243124412451246124718 unmodified lines126612671268126912701271971 unmodified lines"ph": "3","tag": "advanced"},{"g": "Runtime","icon": "βοΈ","k": "SESSIONS_MIN_SYNC_GAP","lbl": "Sessions min sync gap (seconds)","type": "number","ph": "30","tag": "advanced"},{"g": "Runtime","icon": "βοΈ",21 unmodified lines"common": 0,"tag": "credential"},{"g": "Provider Keys","icon": "π",228 unmodified lines"common": 0,"tag": "credential"},{"g": "Rotation Pools","icon": "π",18 unmodified lines"type": "text","tag": "advanced"},{"g": "Rotation Pools","icon": "π",
2 unmodified lines345678249 unmodified lines2582592602612622632642652662672682692702712 unmodified linesconst https = require("https");const fs = require("fs");const net = require("net");function isTrue(value) {return /^(true|1|yes|on)$/i.test(String(value || "").trim());249 unmodified lines// Constant-time comparison β prevent timing attacks on token checkfunction safeEqual(a, b) {if (typeof a !== "string" || typeof b !== "string") return false;// Pad both to the same length so the loop always takes constant time,// preventing token length from being leaked via early-return timing.const len = Math.max(a.length, b.length, 1);const pa = a.padEnd(len, "\0");const pb = b.padEnd(len, "\0");let d = a.length === b.length ? 0 : 1; // length mismatch β always failfor (let i = 0; i < len; i++) d |= pa.charCodeAt(i) ^ pb.charCodeAt(i);return d === 0;}function isEnvBuilderAuthed(req) {2 unmodified lines3456789249 unmodified lines2592602612622632642652662672682 unmodified linesconst https = require("https");const fs = require("fs");const net = require("net");const { timingSafeEqual } = require("crypto");function isTrue(value) {return /^(true|1|yes|on)$/i.test(String(value || "").trim());249 unmodified lines// Constant-time comparison β prevent timing attacks on token checkfunction safeEqual(a, b) {if (typeof a !== "string" || typeof b !== "string") return false;const ba = Buffer.from(a);const bb = Buffer.from(b);if (ba.length !== bb.length) return false;return timingSafeEqual(ba, bb);}function isEnvBuilderAuthed(req) {
60 unmodified lines6162636465666729 unmodified lines97989910010110210310410510610710810911011111211311411511611711860 unmodified linesdef enabled():dev = is_true(os.environ.get("DEV_MODE", ""))separate_dataset = DATASET_NAME != BACKUP_DATASET_NAMEif ENABLE and dev and HF_TOKEN and not separate_dataset:print("DevData sync disabled: DEVDATA_DATASET_NAME must be separate from BACKUP_DATASET_NAME.")29 unmodified linesSECRET_FILENAME_PATTERNS = {".env", # dotenv files β almost always contain API keys".env.*", # .env.local, .env.production, etc."*secret*", # any file/dir whose name contains "secret""*secrets*","*_secret*","*-secret*","*key*", # private keys, API key files"*_key*","*-key*","*token*", # token files"*_token*","*-token*","*.pem", # TLS/SSH private keys"*.key", # generic key files"*.p12", # PKCS#12 bundles"*.pfx","credentials", # common credential file names"credentials.*",".netrc", # stores plaintext passwords".htpasswd",}60 unmodified lines616263646566676869707129 unmodified lines10110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014160 unmodified linesdef enabled():jupyter_override = os.environ.get("HUGGINGCLAW_JUPYTER_ENABLED", "")if jupyter_override.strip():dev = is_true(jupyter_override)else:dev = is_true(os.environ.get("DEV_MODE", ""))separate_dataset = DATASET_NAME != BACKUP_DATASET_NAMEif ENABLE and dev and HF_TOKEN and not separate_dataset:print("DevData sync disabled: DEVDATA_DATASET_NAME must be separate from BACKUP_DATASET_NAME.")29 unmodified linesSECRET_FILENAME_PATTERNS = {".env", # dotenv files β almost always contain API keys".env.*", # .env.local, .env.production, etc."id_rsa","id_dsa","id_ecdsa","id_ed25519","authorized_keys","known_hosts","secret","secrets","secret.*","*.secret","*_secret","*_secret.*","*-secret","*-secret.*","token","token.*","*.token","*_token","*_token.*","*-token","*-token.*","api_token","access_token","refresh_token","credentials", # common credential file names"credentials.*","auth.json","auth.yaml","auth.yml","auth.toml","auth.ini","*.pem", # TLS/SSH private keys"*.key", # generic key files"*.p12", # PKCS#12 bundles"*.pfx",".netrc", # stores plaintext passwords".htpasswd",}
49 unmodified lines50515253545526 unmodified lines82838485868726 unmodified lines11411511611711811922 unmodified lines1421431441451461471481491501 unmodified line152153154155156157158159160161162163164165166167168169170171172173174175401 unmodified lines57757857958058158258358458558658758858959059159259359459519 unmodified lines6156166176186196206216 unmodified lines62862963063163263363463563663763850 unmodified lines6896906916926936946956966976986996 unmodified lines70670770870971071171271371471571671771871949 unmodified lines0.0,float(os.environ.get("OPENCLAW_CONFIG_SETTLE_SECONDS", "3")),)HF_TOKEN = os.environ.get("HF_TOKEN", "").strip()HF_USERNAME = os.environ.get("HF_USERNAME", "").strip()SPACE_AUTHOR_NAME = os.environ.get("SPACE_AUTHOR_NAME", "").strip()26 unmodified linesHF_API = HfApi(token=HF_TOKEN) if HF_TOKEN else NoneSTOP_EVENT = threading.Event()_REPO_ID_CACHE: str | None = NoneWorkspaceMarker: TypeAlias = tuple[int, int, int, str]26 unmodified lineslast_exc: Exception | None = Nonefor attempt in range(1, attempts + 1):try:if source_path.is_dir():shutil.copytree(source_path, backup_path)return22 unmodified linesstaging_dir = STATE_DIR / ".openclaw-staging"if staging_dir.exists():shutil.rmtree(staging_dir, ignore_errors=True)staging_dir.mkdir(parents=True, exist_ok=True)skipped_entries: list[tuple[str, Exception]] = []for source_path in OPENCLAW_HOME.iterdir():if source_path.name in EXCLUDED_STATE_NAMES:continue1 unmodified linebackup_path = staging_dir / source_path.nametry:copy_state_entry_with_retry(source_path, backup_path)except Exception as entry_exc:skipped_entries.append((source_path.name, entry_exc))# If any top-level state entries could not be copied, keep the# previous known-good snapshot instead of replacing it with a partial# backup. We'll retry next pass.if skipped_entries:for name, entry_exc in skipped_entries:print(f"Warning: skipping state entry {name}: {entry_exc}")print("Warning: OpenClaw state snapshot incomplete; keeping previous backup and retrying next sync.")shutil.rmtree(staging_dir, ignore_errors=True)else:# Atomically swap staging β real backup dirif OPENCLAW_STATE_BACKUP_DIR.exists():shutil.rmtree(OPENCLAW_STATE_BACKUP_DIR, ignore_errors=True)staging_dir.rename(OPENCLAW_STATE_BACKUP_DIR)except Exception as exc:# Clean up staging on failure so it doesn't interfere next timestaging_dir = STATE_DIR / ".openclaw-staging"401 unmodified linesnewest_mtime = 0metadata_hasher = hashlib.sha256()for profile_dir in sorted(SESSIONS_ROOT.iterdir()):if not profile_dir.is_dir():continuesessions_dir = profile_dir / "sessions"marker = metadata_marker(sessions_dir)file_count += marker[0]total_size += marker[1]newest_mtime = max(newest_mtime, marker[2])metadata_hasher.update(profile_dir.name.encode("utf-8"))metadata_hasher.update(b"\0")metadata_hasher.update(marker[3].encode("ascii"))metadata_hasher.update(b"\0")return (file_count, total_size, newest_mtime, metadata_hasher.hexdigest())19 unmodified linesreturn ("stopped", current_marker)def wait_for_sync_trigger(config_marker: tuple[int, int, int]) -> tuple[str, tuple[int, int, int]]:deadline = time.monotonic() + max(0, INTERVAL)# BUG FIX: also watch sessions directory so new/updated sessions# trigger an immediate sync instead of waiting the full interval.6 unmodified linesif current_config_marker != config_marker:return wait_for_config_settle(current_config_marker)# Sessions changed -> trigger sync immediately (no settle needed;# session files are written atomically by OpenClaw).current_sessions_marker = sessions_marker()if current_sessions_marker != last_sessions_marker:return ("sessions", current_config_marker)remaining = deadline - time.monotonic()if remaining <= 0:50 unmodified linesprint("Initial workspace fingerprint captured.")config_marker = file_marker(OPENCLAW_CONFIG_FILE)while not STOP_EVENT.is_set():try:sync_started_config_marker = file_marker(OPENCLAW_CONFIG_FILE)last_fingerprint, last_marker = sync_once(last_fingerprint, last_marker)config_marker = file_marker(OPENCLAW_CONFIG_FILE)if config_marker != sync_started_config_marker:6 unmodified lineswrite_status("error", f"Sync failed: {exc}")print(f"Workspace sync failed: {exc}")config_marker = file_marker(OPENCLAW_CONFIG_FILE)trigger, config_marker = wait_for_sync_trigger(config_marker)if trigger == "stopped":breakif trigger == "settled":print("OpenClaw config changed and settled; syncing immediately.")if trigger == "sessions":print("Session files changed; syncing immediately.")return 049 unmodified lines5051525354555626 unmodified lines8384858687888926 unmodified lines11611711811912012112212312412512622 unmodified lines1491501511521531541551561571581591601611 unmodified line163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199401 unmodified lines60160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766819 unmodified lines6886896906916926936946956966976 unmodified lines70470570670770870971071171271371471571671771850 unmodified lines7697707717727737747757767777787797807817827837846 unmodified lines79179279379479579679779879980080180280380480580680780880949 unmodified lines0.0,float(os.environ.get("OPENCLAW_CONFIG_SETTLE_SECONDS", "3")),)SESSIONS_MIN_SYNC_GAP = int(os.environ.get("SESSIONS_MIN_SYNC_GAP", "30"))HF_TOKEN = os.environ.get("HF_TOKEN", "").strip()HF_USERNAME = os.environ.get("HF_USERNAME", "").strip()SPACE_AUTHOR_NAME = os.environ.get("SPACE_AUTHOR_NAME", "").strip()26 unmodified linesHF_API = HfApi(token=HF_TOKEN) if HF_TOKEN else NoneSTOP_EVENT = threading.Event()_REPO_ID_CACHE: str | None = None_SESSIONS_FILE_DIGEST_CACHE: dict[str, tuple[int, int, int, str]] = {}WorkspaceMarker: TypeAlias = tuple[int, int, int, str]26 unmodified lineslast_exc: Exception | None = Nonefor attempt in range(1, attempts + 1):try:if backup_path.exists():if backup_path.is_dir():shutil.rmtree(backup_path, ignore_errors=True)else:backup_path.unlink(missing_ok=True)if source_path.is_dir():shutil.copytree(source_path, backup_path)return22 unmodified linesstaging_dir = STATE_DIR / ".openclaw-staging"if staging_dir.exists():shutil.rmtree(staging_dir, ignore_errors=True)if OPENCLAW_STATE_BACKUP_DIR.exists():shutil.copytree(OPENCLAW_STATE_BACKUP_DIR, staging_dir)else:staging_dir.mkdir(parents=True, exist_ok=True)skipped_entries: list[tuple[str, Exception]] = []copied_entry_names: set[str] = set()for source_path in OPENCLAW_HOME.iterdir():if source_path.name in EXCLUDED_STATE_NAMES:continue1 unmodified linebackup_path = staging_dir / source_path.nametry:copy_state_entry_with_retry(source_path, backup_path)copied_entry_names.add(source_path.name)except Exception as entry_exc:skipped_entries.append((source_path.name, entry_exc))# If staging was seeded from a previous backup, remove entries that no# longer exist in OPENCLAW_HOME so the backup remains a true mirror of# current state (except entries intentionally excluded from sync).for staged_path in list(staging_dir.iterdir()):if staged_path.name in EXCLUDED_STATE_NAMES:continueif staged_path.name in copied_entry_names:continueif staged_path.exists():if staged_path.is_dir():shutil.rmtree(staged_path, ignore_errors=True)else:staged_path.unlink(missing_ok=True)# If any top-level state entries could not be copied, keep the last# known-good version for only those entries (staging was seeded from# previous backup). This preserves forward progress for the rest.if skipped_entries:for name, entry_exc in skipped_entries:print(f"Warning: keeping previous state entry {name}: {entry_exc}")print("Warning: OpenClaw state snapshot had copy failures; updated remaining state entries.")# Atomically swap staging β real backup dirif OPENCLAW_STATE_BACKUP_DIR.exists():shutil.rmtree(OPENCLAW_STATE_BACKUP_DIR, ignore_errors=True)staging_dir.rename(OPENCLAW_STATE_BACKUP_DIR)except Exception as exc:# Clean up staging on failure so it doesn't interfere next timestaging_dir = STATE_DIR / ".openclaw-staging"401 unmodified linesnewest_mtime = 0metadata_hasher = hashlib.sha256()global _SESSIONS_FILE_DIGEST_CACHEnext_cache: dict[str, tuple[int, int, int, str]] = {}for profile_dir in sorted(SESSIONS_ROOT.iterdir()):if not profile_dir.is_dir():continuesessions_dir = profile_dir / "sessions"if not sessions_dir.exists():continue# Use content fingerprinting for sessions so we detect changes even# when file size + mtime metadata appear unchanged across quick writes.# (Some tooling can rewrite files in-place with preserved timestamps.)marker = metadata_marker(sessions_dir)digest = hashlib.sha256()for path in sorted(p for p in sessions_dir.rglob("*") if p.is_file()):rel = path.relative_to(sessions_dir).as_posix()try:stat = path.stat()except OSError:continuesize = int(stat.st_size)mtime_ns = int(stat.st_mtime_ns)ctime_ns = int(stat.st_ctime_ns)cache_key = f"{profile_dir.name}\0{rel}"digest.update(rel.encode("utf-8"))digest.update(b"\0")digest.update(str(size).encode("ascii"))digest.update(b"\0")digest.update(str(mtime_ns).encode("ascii"))digest.update(b"\0")digest.update(str(ctime_ns).encode("ascii"))digest.update(b"\0")cached = _SESSIONS_FILE_DIGEST_CACHE.get(cache_key)if (cached is not Noneand cached[0] == sizeand cached[1] == mtime_nsand cached[2] == ctime_ns):file_digest = cached[3]else:file_hasher = hashlib.sha256()try:with path.open("rb") as handle:for chunk in iter(lambda: handle.read(1024 * 1024), b""):file_hasher.update(chunk)except (FileNotFoundError, IsADirectoryError, NotADirectoryError):continuefile_digest = file_hasher.hexdigest()next_cache[cache_key] = (size, mtime_ns, ctime_ns, file_digest)digest.update(file_digest.encode("ascii"))digest.update(b"\0")file_count += marker[0]total_size += marker[1]newest_mtime = max(newest_mtime, marker[2])metadata_hasher.update(profile_dir.name.encode("utf-8"))metadata_hasher.update(b"\0")metadata_hasher.update(digest.hexdigest().encode("ascii"))metadata_hasher.update(b"\0")_SESSIONS_FILE_DIGEST_CACHE = next_cachereturn (file_count, total_size, newest_mtime, metadata_hasher.hexdigest())19 unmodified linesreturn ("stopped", current_marker)def wait_for_sync_trigger(config_marker: tuple[int, int, int],last_sessions_sync_time: float = 0.0,) -> tuple[str, tuple[int, int, int]]:deadline = time.monotonic() + max(0, INTERVAL)# BUG FIX: also watch sessions directory so new/updated sessions# trigger an immediate sync instead of waiting the full interval.6 unmodified linesif current_config_marker != config_marker:return wait_for_config_settle(current_config_marker)sessions_gap_elapsed = (time.monotonic() - last_sessions_sync_time >= SESSIONS_MIN_SYNC_GAP)if sessions_gap_elapsed:# Sessions changed -> trigger sync immediately (no settle needed;# session files are written atomically by OpenClaw).current_sessions_marker = sessions_marker()if current_sessions_marker != last_sessions_marker:return ("sessions", current_config_marker)remaining = deadline - time.monotonic()if remaining <= 0:50 unmodified linesprint("Initial workspace fingerprint captured.")config_marker = file_marker(OPENCLAW_CONFIG_FILE)last_sessions_sync_time = 0.0sync_trigger = "startup"while not STOP_EVENT.is_set():try:sync_started_config_marker = file_marker(OPENCLAW_CONFIG_FILE)last_fingerprint, last_marker = sync_once(last_fingerprint, last_marker)if sync_trigger == "sessions":last_sessions_sync_time = time.monotonic()config_marker = file_marker(OPENCLAW_CONFIG_FILE)if config_marker != sync_started_config_marker:6 unmodified lineswrite_status("error", f"Sync failed: {exc}")print(f"Workspace sync failed: {exc}")config_marker = file_marker(OPENCLAW_CONFIG_FILE)STOP_EVENT.wait(min(30, SESSIONS_MIN_SYNC_GAP))trigger, config_marker = wait_for_sync_trigger(config_marker,last_sessions_sync_time=last_sessions_sync_time,)if trigger == "stopped":breakif trigger == "settled":print("OpenClaw config changed and settled; syncing immediately.")if trigger == "sessions":print("Session files changed; syncing immediately.")sync_trigger = triggerreturn 0
98 unmodified lines99100101102103104145 unmodified lines25025125225325425525627 unmodified lines28428528628728828929029129229329428 unmodified lines32332432532632732832998 unmodified linesDEV_MODE_ENABLED=true: # auto-enable is silent; set DEV_MODE=false to opt outfiSYNC_INTERVAL="$(trim_var "${SYNC_INTERVAL:-180}")"DEVDATA_DATASET_NAME="$(trim_var "${DEVDATA_DATASET_NAME:-huggingclaw-devdata}")"DEVDATA_SYNC_INTERVAL="$(trim_var "${DEVDATA_SYNC_INTERVAL:-180}")"145 unmodified linespromote_first_pool_key "ANTHROPIC_API_KEY" "ANTHROPIC_API_KEYS"promote_first_pool_key "OPENAI_API_KEY" "OPENAI_API_KEYS"promote_first_pool_key "GEMINI_API_KEY" "GEMINI_API_KEYS"promote_first_pool_key "GEMINI_API_KEY" "GOOGLE_API_KEYS"promote_first_pool_key "DEEPSEEK_API_KEY" "DEEPSEEK_API_KEYS"promote_first_pool_key "OPENROUTER_API_KEY" "OPENROUTER_API_KEYS"promote_first_pool_key "KILOCODE_API_KEY" "KILOCODE_API_KEYS"27 unmodified linesfipromote_first_pool_key "HUGGINGFACE_HUB_TOKEN" "HUGGINGFACE_HUB_TOKENS"# Compatibility aliases for Google provider secrets some users already have.if [ -z "${GEMINI_API_KEY:-}" ] && [ -n "${GOOGLE_API_KEY:-}" ]; thenexport GEMINI_API_KEY="$GOOGLE_API_KEY"fi# ββ Setup directories ββmkdir -p /home/node/.openclaw/agents/main/sessionsmkdir -p /home/node/.openclaw/credentials28 unmodified linesecho "HF_TOKEN not set β running without dataset persistence."fiCLOUDFLARE_WORKERS_TOKEN="${CLOUDFLARE_WORKERS_TOKEN:-${CLOUDFLARE_API_TOKEN:-}}"export CLOUDFLARE_WORKERS_TOKENCF_PROXY_ENV_FILE="/tmp/huggingclaw-cloudflare-proxy.env"if [ -n "${CLOUDFLARE_WORKERS_TOKEN:-}" ] || [ -n "${CLOUDFLARE_PROXY_URL:-}" ]; then98 unmodified lines99100101102103104105106107108109145 unmodified lines25525625725825926027 unmodified lines28828929029129229328 unmodified lines32232332432532632732898 unmodified linesDEV_MODE_ENABLED=true: # auto-enable is silent; set DEV_MODE=false to opt outfiif [ "$DEV_MODE_ENABLED" = "true" ]; thenexport DEV_MODE=trueelseexport DEV_MODE=falsefiSYNC_INTERVAL="$(trim_var "${SYNC_INTERVAL:-180}")"DEVDATA_DATASET_NAME="$(trim_var "${DEVDATA_DATASET_NAME:-huggingclaw-devdata}")"DEVDATA_SYNC_INTERVAL="$(trim_var "${DEVDATA_SYNC_INTERVAL:-180}")"145 unmodified linespromote_first_pool_key "ANTHROPIC_API_KEY" "ANTHROPIC_API_KEYS"promote_first_pool_key "OPENAI_API_KEY" "OPENAI_API_KEYS"promote_first_pool_key "GEMINI_API_KEY" "GEMINI_API_KEYS"promote_first_pool_key "DEEPSEEK_API_KEY" "DEEPSEEK_API_KEYS"promote_first_pool_key "OPENROUTER_API_KEY" "OPENROUTER_API_KEYS"promote_first_pool_key "KILOCODE_API_KEY" "KILOCODE_API_KEYS"27 unmodified linesfipromote_first_pool_key "HUGGINGFACE_HUB_TOKEN" "HUGGINGFACE_HUB_TOKENS"# ββ Setup directories ββmkdir -p /home/node/.openclaw/agents/main/sessionsmkdir -p /home/node/.openclaw/credentials28 unmodified linesecho "HF_TOKEN not set β running without dataset persistence."fiCLOUDFLARE_WORKERS_TOKEN="${CLOUDFLARE_WORKERS_TOKEN:-}"export CLOUDFLARE_WORKERS_TOKENCF_PROXY_ENV_FILE="/tmp/huggingclaw-cloudflare-proxy.env"if [ -n "${CLOUDFLARE_WORKERS_TOKEN:-}" ] || [ -n "${CLOUDFLARE_PROXY_URL:-}" ]; then
.env.example+3
README.md+1
env-builder.js+9-26
health-server.js+5-8
jupyter-devdata-sync.py+36-13
openclaw-sync.py+110-20
start.sh+6-7