tao-shen Claude Opus 4.6 commited on
Commit
a18f6b8
·
1 Parent(s): 8814392

config: set hardcoded gateway token "huggingclaw" as default

Browse files
Files changed (2) hide show
  1. openclaw.json +1 -0
  2. scripts/sync_hf.py +4 -3
openclaw.json CHANGED
@@ -3,6 +3,7 @@
3
  "mode": "local",
4
  "bind": "lan",
5
  "port": 7860,
 
6
  "trustedProxies": [
7
  "0.0.0.0/0"
8
  ],
 
3
  "mode": "local",
4
  "bind": "lan",
5
  "port": 7860,
6
+ "auth": { "token": "huggingclaw" },
7
  "trustedProxies": [
8
  "0.0.0.0/0"
9
  ],
scripts/sync_hf.py CHANGED
@@ -342,9 +342,9 @@ class OpenClawFullSync:
342
  try:
343
  with open(config_path, "r") as f:
344
  cfg = json.load(f)
345
- # Remove auth block (no password/token — device auth only)
346
  if "gateway" in cfg:
347
- cfg["gateway"].pop("auth", None)
348
  if OPENAI_API_KEY and "models" in cfg and "providers" in cfg["models"] and "openai" in cfg["models"]["providers"]:
349
  cfg["models"]["providers"]["openai"]["apiKey"] = OPENAI_API_KEY
350
  if OPENAI_BASE_URL:
@@ -427,13 +427,14 @@ class OpenClawFullSync:
427
  "mode": "local",
428
  "bind": "lan",
429
  "port": 7860,
 
430
  "trustedProxies": ["0.0.0.0/0"],
431
  "controlUi": {
432
  "allowInsecureAuth": True,
433
  "allowedOrigins": allowed_origins
434
  }
435
  }
436
- print(f"[SYNC] Set gateway config (auth=device-only, origins={len(allowed_origins)})")
437
 
438
  # Ensure agents defaults
439
  data.setdefault("agents", {}).setdefault("defaults", {}).setdefault("model", {})
 
342
  try:
343
  with open(config_path, "r") as f:
344
  cfg = json.load(f)
345
+ # Ensure default token
346
  if "gateway" in cfg:
347
+ cfg["gateway"]["auth"] = {"token": "huggingclaw"}
348
  if OPENAI_API_KEY and "models" in cfg and "providers" in cfg["models"] and "openai" in cfg["models"]["providers"]:
349
  cfg["models"]["providers"]["openai"]["apiKey"] = OPENAI_API_KEY
350
  if OPENAI_BASE_URL:
 
427
  "mode": "local",
428
  "bind": "lan",
429
  "port": 7860,
430
+ "auth": {"token": "huggingclaw"},
431
  "trustedProxies": ["0.0.0.0/0"],
432
  "controlUi": {
433
  "allowInsecureAuth": True,
434
  "allowedOrigins": allowed_origins
435
  }
436
  }
437
+ print(f"[SYNC] Set gateway config (auth=token:huggingclaw, origins={len(allowed_origins)})")
438
 
439
  # Ensure agents defaults
440
  data.setdefault("agents", {}).setdefault("defaults", {}).setdefault("model", {})