From 87fdabcd50b3c092aafedc40ab2f6fc2302a508a Mon Sep 17 00:00:00 2001 From: "Gan, Jimmy" Date: Sun, 22 Feb 2026 18:30:34 +0800 Subject: [PATCH] Fix OpenClaw: auto-include gateway token in dashboard link --- dashboard/backend/config.py | 3 +++ dashboard/backend/routers/system.py | 7 ++++++- dashboard/frontend/src/routes/OpenClaw.svelte | 18 +++++++++++++++++- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/dashboard/backend/config.py b/dashboard/backend/config.py index 024608e..fdc5dca 100644 --- a/dashboard/backend/config.py +++ b/dashboard/backend/config.py @@ -34,3 +34,6 @@ WEBAUTHN_ORIGIN = os.environ.get("WEBAUTHN_ORIGIN", "https://nas.jimmygan.com") # CORS CORS_ORIGINS = os.environ.get("CORS_ORIGINS", "https://nas.jimmygan.com").split(",") + +# OpenClaw +OPENCLAW_GATEWAY_TOKEN = os.environ.get("OPENCLAW_GATEWAY_TOKEN", "") diff --git a/dashboard/backend/routers/system.py b/dashboard/backend/routers/system.py index 4e55b27..fa566ce 100644 --- a/dashboard/backend/routers/system.py +++ b/dashboard/backend/routers/system.py @@ -5,7 +5,7 @@ import platform import time import httpx from fastapi import APIRouter, Query -from config import TELEGRAM_BOT_TOKEN, TELEGRAM_CHAT_ID, VOLUME_ROOT +from config import TELEGRAM_BOT_TOKEN, TELEGRAM_CHAT_ID, VOLUME_ROOT, OPENCLAW_GATEWAY_TOKEN router = APIRouter() @@ -110,3 +110,8 @@ def _classify(method, path, status, user): return "noise" # Info — everything else return "info" + + +@router.get("/openclaw-token") +def openclaw_token(): + return {"token": OPENCLAW_GATEWAY_TOKEN} diff --git a/dashboard/frontend/src/routes/OpenClaw.svelte b/dashboard/frontend/src/routes/OpenClaw.svelte index b719e3a..25a8e6d 100644 --- a/dashboard/frontend/src/routes/OpenClaw.svelte +++ b/dashboard/frontend/src/routes/OpenClaw.svelte @@ -1,7 +1,23 @@
@@ -22,7 +38,7 @@ OpenClaw's security settings prevent it from being embedded inside the dashboard. Click below to launch the assistant securely in a new tab.