Repository navigation
Description
Bug
When CHAT_UI_URL is set to an HTTPS URL without an explicit port — exactly as documented at Remote Dashboard Access — onboard unconditionally overrides the port with the internal dashboard port (18789).
Root cause: src/lib/onboard.ts line ~4002:
parsed.port = String(effectivePort);This produces:
"allowedOrigins": [
"http://127.0.0.1:18789",
"https://brev-host.brevlab.com:18789"
]But when the dashboard is accessed through a reverse proxy (Brev Cloudflare Tunnel, nginx, Caddy, etc.), the browser sends origin https://brev-host.brevlab.com (port 443) — which doesn't match, causing:
origin not allowed (open the Control UI from the gateway host or allow it in gateway.controlUi.allowedOrigins)
The docs say to do exactly this:
set
CHAT_UI_URLto the origin the browser will use before running setup:
export CHAT_UI_URL="https://openclaw0-<id>.brevlab.com"
Repro
CHAT_UI_URL="https://brev-host.brevlab.com" nemoclaw onboard --non-interactive- Access dashboard via Brev tunnel:
https://brev-host.brevlab.com/chat?session=main - CORS error: "origin not allowed"
Workaround
Manually add the portless origin via kubectl:
docker exec openshell-cluster-nemoclaw kubectl exec my-assistant -n openshell -- python3 -c "
import json
path = '/sandbox/.openclaw/openclaw.json'
with open(path) as f:
config = json.load(f)
config['gateway']['controlUi']['allowedOrigins'].append('https://brev-host.brevlab.com')
with open(path, 'w') as f:
json.dump(config, f, indent=2)
"Then: nemoclaw my-assistant connect --probe-only
Suggested fix
In scripts/generate-openclaw-config.py (line ~197), when the user-provided CHAT_UI_URL had no explicit port, include both the original origin and the port-annotated origin in allowedOrigins. Safe (same host) and covers both direct and proxied access.
Affected platforms
Any reverse proxy: Brev (Cloudflare Tunnel), nginx, Caddy, Tailscale Funnel, etc.
Activity
senthilr-nv commentedon May 4, 2026
Prior art: This is the remaining gap from the #795 / #20 lineage. PR #812 (merged Apr 3) baked
CHAT_UI_URLinto the Docker build, and PR #2440 (merged Apr 24) injectedNEMOCLAW_DASHBOARD_PORTinto the sandbox env. Both fixed the plumbing, but the port override atonboard.ts:4002still produces a port-annotated origin that doesn't match when access comes through a reverse proxy (Brev Cloudflare Tunnel, nginx, etc.).fix(onboard): include portless origin in allowedOrigins for reverse-p…
fix(onboard): include portless origin in allowedOrigins for reverse-p…
fix(onboard): include portless origin in allowedOrigins for reverse-p…
fix(onboard): include portless origin in allowedOrigins for reverse-p…
fix(onboard): include portless origin in allowedOrigins for reverse-p…
fix(onboard): include portless origin in allowedOrigins for reverse-p…