Gateway 会从与 Gateway WebSocket 相同的端口提供一个小型 浏览器控制 UI(Vite + Lit):Documentation Index
Fetch the complete documentation index at: https://openclaw.zhcndoc.com/llms.txt
Use this file to discover all available pages before exploring further.
- 默认:
http://<host>:18789/ - 当
gateway.tls.enabled: true时:https://<host>:18789/ - 可选前缀:设置
gateway.controlUi.basePath(例如/openclaw)
Webhooks
当hooks.enabled=true 时,Gateway 还会在同一个 HTTP 服务器上暴露一个小型 webhook 端点。
有关认证和载荷,请参见 Gateway 配置 → hooks。
配置(默认开启)
当资源文件存在时(dist/control-ui),Control UI 会默认启用。
你可以通过配置进行控制:
Tailscale 访问
集成 Serve(推荐)
让 Gateway 仅绑定在 loopback 上,并由 Tailscale Serve 代理它:https://<magicdns>/(或你配置的gateway.controlUi.basePath)
Tailnet 绑定 + token
http://<tailscale-ip>:18789/(或你配置的gateway.controlUi.basePath)
公网(Funnel)
安全说明
- 默认需要 Gateway 认证(token、password、trusted-proxy,或在启用时使用 Tailscale Serve 身份头)。
- 非 loopback 绑定仍然需要 Gateway 认证。实际上,这意味着 token/password 认证,或使用带有
gateway.auth.mode: "trusted-proxy"的、感知身份的反向代理。 - 向导默认会创建共享密钥认证,并且通常会生成一个 gateway token(即使在 loopback 上也是如此)。
- 在共享密钥模式下,UI 会发送
connect.params.auth.token或connect.params.auth.password。 - 当
gateway.tls.enabled: true时,本地仪表盘和状态辅助功能会渲染https://仪表盘 URL 和wss://WebSocket URL。 - 在如 Tailscale Serve 或
trusted-proxy这类带身份信息的模式中, WebSocket 认证检查会改为从请求头中满足。 - 对于非 loopback 的 Control UI 部署,请显式设置
gateway.controlUi.allowedOrigins(完整来源)。如果不设置,默认会拒绝启动 gateway。 gateway.controlUi.dangerouslyAllowHostHeaderOriginFallback=true会启用 Host-header origin 回退模式,但这是一个危险的安全降级。- 使用 Serve 时,当
gateway.auth.allowTailscale为true时,Tailscale 身份头可以满足 Control UI/WebSocket 认证 (无需 token/password)。 HTTP API 端点不会使用这些 Tailscale 身份头;它们会遵循 gateway 的常规 HTTP 认证模式。将gateway.auth.allowTailscale: false设为需要显式凭据。参见 Tailscale 和 Security。这种 无 token 流程假设 gateway 主机是可信的。 gateway.tailscale.mode: "funnel"需要gateway.auth.mode: "password"(共享密码)。
构建 UI
Gateway 会从dist/control-ui 提供静态文件。使用以下命令构建它们: