網路(閘道)
閘道從與閘道 WebSocket 相同的埠提供小型瀏覽器 Control UI(Vite + Lit):- 預設:
http://<host>:18789/ - 選用前綴:設定
gateway.controlUi.basePath(例如/openclaw)
Webhooks
當hooks.enabled=true 時,閘道也會在相同的 HTTP 伺服器上公開小型 webhook 端點。
請參閱 閘道設定 → hooks 以取得驗證 + 裝載。
設定(預設啟用)
當資產存在時(dist/control-ui),Control UI 預設啟用。
您可以透過設定控制它:
Tailscale 存取
整合 Serve(建議)
將閘道保持在環迴上,讓 Tailscale Serve 代理它:https://<magicdns>/(或您配置的gateway.controlUi.basePath)
Tailnet 綁定 + 令牌
http://<tailscale-ip>:18789/(或您配置的gateway.controlUi.basePath)
公開網際網路(Funnel)
安全備註
- 預設需要閘道驗證(令牌/密碼或 Tailscale 身分標頭)。
- 非環迴綁定仍需要共用令牌/密碼(
gateway.auth或環境)。 - 精靈預設產生閘道令牌(即使在環迴上)。
- UI 傳送
connect.params.auth.token或connect.params.auth.password。 - 針對非環迴 Control UI 部署,明確設定
gateway.controlUi.allowedOrigins(完整來源)。沒有它,閘道啟動預設會被拒絕。 gateway.controlUi.dangerouslyAllowHostHeaderOriginFallback=true啟用主機標頭來源回退模式,但是是危險的安全降級。- 使用 Serve,Tailscale 身分標頭可以在
gateway.auth.allowTailscale為true時滿足 Control UI/WebSocket 驗證(不需要令牌/密碼)。HTTP API 端點仍需要令牌/密碼。設定gateway.auth.allowTailscale: false以需要明確認證。請參閱 Tailscale 和 安全。此無令牌流程假設閘道主機是可信的。 gateway.tailscale.mode: "funnel"需要gateway.auth.mode: "password"(共用密碼)。
構建 UI
閘道從dist/control-ui 提供靜態檔案。使用以下方式構建它們: