Web
Gateway(网关) 在与 Gateway(网关) WebSocket 相同的端口上提供一个小型的 浏览器控制 UI (Vite + Lit):
- 默认值:
http://<host>:18789/ - 使用
gateway.tls.enabled: true时:https://<host>:18789/ - 可选前缀:设置
gateway.controlUi.basePath(例如/openclaw)
功能位于 Control UI 中。本页的其余部分重点介绍绑定模式、安全和面向 Web 的表面。
Webhooks
Section titled “Webhooks”当 hooks.enabled=trueGateway(网关)Gateway(网关) 时,Gateway(网关) 还会在同一 HTTP 服务器上公开一个小型的 Webhook 端点。
请参阅 Gateway(网关) configuration → hooks 以了解身份验证和有效负载。
Admin HTTP RPC
Section titled “Admin HTTP RPC”Admin HTTP RPC 在 RPCGateway(网关)POST /api/v1/admin/rpc 公开选定的 Gateway(网关) 控制平面方法。
它默认处于关闭状态,仅在启用 admin-http-rpcRPC 插件时注册。
请参阅 Admin HTTP RPC 以了解身份验证模型、允许的方法以及 WebSocket 比较。
Config (default-on)
Section titled “Config (default-on)”当资产存在时(dist/control-ui),Control UI 默认启用。
您可以通过配置控制它:
{ gateway: { controlUi: { enabled: true, basePath: "/openclaw" }, // basePath optional },}Tailscale access
Section titled “Tailscale access”Integrated Serve (recommended)
Section titled “Integrated Serve (recommended)”将 Gateway(网关) 保持在环回接口上,并让 Tailscale Serve 代理它:
{ gateway: { bind: "loopback", tailscale: { mode: "serve" }, },}Then start the gateway:
openclaw gatewayOpen:
https://<magicdns>/(or your configuredgateway.controlUi.basePath)
Tailnet bind + token
Section titled “Tailnet bind + token”{ gateway: { bind: "tailnet", controlUi: { enabled: true }, auth: { mode: "token", token: "your-token" }, },}Then start the gateway (this non-loopback example uses shared-secret token auth):
openclaw gatewayOpen:
http://<tailscale-ip>:18789/(or your configuredgateway.controlUi.basePath)
Public internet (Funnel)
Section titled “Public internet (Funnel)”{ gateway: { bind: "loopback", tailscale: { mode: "funnel" }, auth: { mode: "password" }, // or OPENCLAW_GATEWAY_PASSWORD },}Security notes
Section titled “Security notes”- 默认情况下需要 Gateway(网关) 身份验证(令牌、密码、受信任代理,或启用时的 Tailscale Serve 标头)。
- 非环回绑定仍然 需要 gateway 身份验证。实际上,这意味着令牌/密码身份验证或带有
gateway.auth.mode: "trusted-proxy"的感知身份的反向代理。 - The wizard creates shared-secret auth by default and usually generates a gateway token (even on loopback).
- In shared-secret mode, the UI sends
connect.params.auth.tokenorconnect.params.auth.password. - 当
gateway.tls.enabled: true时,本地仪表盘和状态辅助程序会渲染https://仪表盘 URL 和wss://WebSocket URL。 - 在 Tailscale Serve 或
trusted-proxy等带有身份的模式中, WebSocket 身份验证检查改为从请求头中获取满足。 - 对于非环回的公共控制 UI 部署,请显式设置
gateway.controlUi.allowedOrigins(完整源)。环回、RFC1918/link-local、.local、.ts.net和 Tailscale CGNAT 主机的私有同源局域网/Tailnet 加载会被接受。 gateway.controlUi.dangerouslyAllowHostHeaderOriginFallback=true启用 Host-header origin 回退模式,但这是一个危险的安全降级。- 使用 Serve 时,当
gateway.auth.allowTailscale为true时(不需要令牌/密码), Tailscale 身份标头可以满足控制 UI/WebSocket 身份验证。 HTTP API 端点不使用那些 Tailscale 身份标头;它们改为遵循 网关的正常 HTTP 身份验证模式。设置gateway.auth.allowTailscale: false以要求显式凭证。请参阅 Tailscale 和 安全。此 无令牌流程假定网关主机是受信任的。 gateway.tailscale.mode: "funnel"需要gateway.auth.mode: "password"(共享密码)。
Gateway(网关) 从 dist/control-ui 提供静态文件。使用以下命令构建它们:
pnpm ui:build