Gateway ให้บริการ Control UI บนเบราว์เซอร์ ขนาดเล็ก (Vite + Lit) จากพอร์ตเดียวกับ Gateway WebSocket:Documentation Index
Fetch the complete documentation index at: https://docs.openclaw.ai/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)
Webhook
เมื่อhooks.enabled=true Gateway จะเปิดเผย endpoint webhook ขนาดเล็กบนเซิร์ฟเวอร์ HTTP เดียวกันด้วย
ดู การกำหนดค่า Gateway → hooks สำหรับ auth + payload
การกำหนดค่า (เปิดตามค่าเริ่มต้น)
Control UI เปิดใช้งานตามค่าเริ่มต้น เมื่อมี assets อยู่ (dist/control-ui)
คุณสามารถควบคุมได้ผ่านการกำหนดค่า:
การเข้าถึงผ่าน Tailscale
Serve แบบรวมในตัว (แนะนำ)
ให้ Gateway อยู่บน loopback และให้ Tailscale Serve ทำหน้าที่ proxy:https://<magicdns>/(หรือgateway.controlUi.basePathที่คุณกำหนดค่าไว้)
Bind กับ tailnet + token
http://<tailscale-ip>:18789/(หรือgateway.controlUi.basePathที่คุณกำหนดค่าไว้)
อินเทอร์เน็ตสาธารณะ (Funnel)
หมายเหตุด้านความปลอดภัย
- Gateway auth เป็นสิ่งจำเป็นตามค่าเริ่มต้น (token, password, trusted-proxy หรือ Tailscale Serve identity headers เมื่อเปิดใช้งาน)
- การ bind แบบ non-loopback ยัง ต้องใช้ gateway auth ในทางปฏิบัติหมายถึง token/password auth หรือ reverse proxy ที่รับรู้ตัวตนพร้อม
gateway.auth.mode: "trusted-proxy" - wizard จะสร้าง shared-secret auth ตามค่าเริ่มต้น และโดยปกติจะสร้าง gateway token (แม้บน loopback)
- ในโหมด shared-secret UI จะส่ง
connect.params.auth.tokenหรือconnect.params.auth.password - เมื่อ
gateway.tls.enabled: trueตัวช่วย dashboard และสถานะในเครื่องจะแสดง URL dashboard แบบhttps://และ URL WebSocket แบบwss:// - ในโหมดที่มี identity เช่น Tailscale Serve หรือ
trusted-proxyการตรวจสอบ WebSocket auth จะผ่านจาก request headers แทน - สำหรับการนำ Control UI ไปใช้แบบ non-loopback ให้ตั้งค่า
gateway.controlUi.allowedOriginsอย่างชัดเจน (origin แบบเต็ม) หากไม่มีค่านี้ การเริ่มต้น gateway จะถูกปฏิเสธตามค่าเริ่มต้น gateway.controlUi.dangerouslyAllowHostHeaderOriginFallback=trueเปิดใช้งาน โหมด fallback ของ origin จาก Host-header แต่เป็นการลดระดับความปลอดภัยที่อันตราย- เมื่อใช้ Serve, Tailscale identity headers สามารถตอบสนอง Control UI/WebSocket auth
ได้เมื่อ
gateway.auth.allowTailscaleเป็นtrue(ไม่ต้องใช้ token/password) endpoint ของ HTTP API ไม่ใช้ Tailscale identity headers เหล่านั้น แต่จะทำตาม โหมด HTTP auth ปกติของ gateway แทน ตั้งค่าgateway.auth.allowTailscale: falseเพื่อบังคับให้ใช้ credentials อย่างชัดเจน ดู Tailscale และ ความปลอดภัย โฟลว์แบบไม่ใช้ token นี้ถือว่าโฮสต์ gateway เชื่อถือได้ gateway.tailscale.mode: "funnel"ต้องใช้gateway.auth.mode: "password"(shared password)
การ build UI
Gateway ให้บริการไฟล์ static จากdist/control-ui build ไฟล์เหล่านี้ด้วย: