feat(web_server): allow remote WebSocket connection via HERMES_DASHBOARD_ALLOW_REMOTE_WS - #33099
feat(web_server): allow remote WebSocket connection via HERMES_DASHBOARD_ALLOW_REMOTE_WS#330990BVer wants to merge 1 commit into
Conversation
3e978ad to
071b5ea
Compare
…ARD_ALLOW_REMOTE_WS
071b5ea to
c0a5674
Compare
|
Competing with #32614 (fix(dashboard): allow websocket clients for public binds) which takes a different approach — respecting the existing public bind/--insecure flag rather than adding a new env var. Also related: #25072 (broader 3-bug fix), #32953 (TRUST_LAN env var approach). The area is saturated with open PRs addressing the same regression from #30741 loopback hardening. |
|
Hi @alt-glitch, thank you for pointing out the other PRs addressing this regression! While respecting the existing The Tradeoff with
|
|
Superseded by the fix already on main. --insecure + a non-loopback --host bind now allows remote WebSocket peers directly in ws_client_is_allowed() (via app.state.bound_host), so a separate HERMES_DASHBOARD_ALLOW_REMOTE_WS env var is not needed. We also avoid adding new HERMES* env vars for non-secret behavioral config as a matter of policy — the operator intent is expressed through --insecure. Closing as redundant; thanks for the contribution. |
Description
Recently, WebSocket client validation in the dashboard was hardened to loopback-only hosts. While this enhances security, it blocks normal dashboard operations in containerized (Docker bridge networks) or proxied (Caddy, Nginx, Cloudflare Tunnel) setups since the client IP appears as a gateway/non-loopback IP.
This PR introduces an optional environment variable
HERMES_DASHBOARD_ALLOW_REMOTE_WS. If enabled, it allows WebSocket connections from non-loopback hosts. By default (unset), it remains loopback-only to maintain the hardened security baseline.Proposed Changes
hermes_cli/web_server.py: Updated_ws_client_is_allowedto checkenv_var_enabled('HERMES_DASHBOARD_ALLOW_REMOTE_WS')and returnTrueif enabled.hermes_cli/config.py: RegisteredHERMES_DASHBOARD_ALLOW_REMOTE_WSinOPTIONAL_ENV_VARSfor UI and configuration visibility.tests/hermes_cli/test_web_server.py: Added a dedicated unit testtest_ws_client_is_allowed_bypasses_loopback_when_remote_ws_enabled.