Skip to content

仪表盘(Dashboard / Control UI)

Gateway 仪表盘是浏览器 Control UI,默认在 / 路径提供服务(通过 gateway.controlUi.basePath 覆盖)。

快速打开(本地 Gateway):

关键参考:

认证通过 WebSocket 握手中的 connect.params.auth(token 或密码)强制执行。详见 Gateway 配置 中的 gateway.auth

安全注意:Control UI 是管理员界面(聊天、配置、exec 批准)。不要将其公开暴露在互联网上。UI 在 sessionStorage 中保存当前浏览器标签会话和所选网关 URL 的仪表盘 URL token,并在加载后从 URL 中清除。优先使用 localhost、Tailscale Serve 或 SSH 隧道。

快速路径(推荐)

  • 引导完成后,CLI 自动打开仪表盘并打印干净的(无 token 化的)链接。
  • 随时重新打开:openclaw dashboard(复制链接,如果可能则打开浏览器,无头环境显示 SSH 提示)。
  • 若 UI 提示认证,将 gateway.auth.token(或 OPENCLAW_GATEWAY_TOKEN)中的 token 粘贴到 Control UI 设置中。

Token 基础知识(本地与远程)

  • 本地:打开 http://127.0.0.1:18789/
  • Token 来源gateway.auth.token(或 OPENCLAW_GATEWAY_TOKEN);openclaw dashboard 可以通过 URL 片段传递 token 用于一次性引导,Control UI 将其保存在 sessionStorage 中(针对当前浏览器标签会话和所选网关 URL)而非 localStorage。
  • gateway.auth.token 由 SecretRef 管理,openclaw dashboard 按设计打印/复制/打开无 token 化的 URL,避免在 shell 日志、剪贴板历史或浏览器启动参数中暴露外部管理的 token。
  • 非本地访问:使用 Tailscale Serve(若 gateway.auth.allowTailscale: true 则 Control UI/WebSocket 无 token,但 HTTP API 仍需 token/密码)、带 token 的 tailnet 绑定或 SSH 隧道。见 Web 接口

遇到"unauthorized"或 1008 错误时

  • 确认 gateway 可访问(本地:openclaw status;远程:SSH 隧道 ssh -N -L 18789:127.0.0.1:18789 user@host 然后打开 http://127.0.0.1:18789/)。
  • 对于 AUTH_TOKEN_MISMATCH,客户端可能在 Gateway 返回重试提示时用缓存的设备 token 进行一次可信重试。若重试后认证仍失败,需手动解决 token 漂移。
  • Token 漂移修复步骤,请按照 Token 漂移恢复清单 操作。
  • 从网关主机检索或提供 token:
    • 明文配置:openclaw config get gateway.auth.token
    • SecretRef 管理的配置:解析外部 secret 提供商,或在此 shell 中导出 OPENCLAW_GATEWAY_TOKEN,然后重新运行 openclaw dashboard
    • 未配置 token:openclaw doctor --generate-gateway-token
  • 在仪表盘设置中,将 token 粘贴到认证字段,然后连接。