fix: allow dashboard websockets for explicit bound hosts#32357
Conversation
|
Related to #20136 (WebSocket proxy peer/origin validation with config-based allowed_hosts). This PR takes a narrower approach: accept WS peers matching the explicitly bound non-loopback host. #20136 adds a full config-based allowlist. Both address the same class of issue (WS rejected behind reverse proxy/Tailscale). |
|
Thanks for the pointer — that overlap is real. This PR was intentionally kept narrow because it came out of a specific production deployment issue with Hermes Dashboard behind Tailscale Serve on a tailnet-only host. In that setup we saw This change was meant as the smallest fix for that case:
So I agree If the broader |
|
Landed in PR #35386 (merge commit 234ac00), now on |
Summary
Why
When the Dashboard is intentionally bound to a tailnet hostname/IP and served through Tailscale Serve, WebSocket upgrades can arrive from the bound non-loopback address. The existing peer check only allowed loopback clients, so
/api/events,/api/ws, and/api/ptycould disconnect even though Host/Origin validation had already accepted the dashboard boundary.Test Plan
venv/bin/python -m py_compile hermes_cli/web_server.py tests/hermes_cli/test_web_server_host_header.pyvenv/bin/python -m pytest tests/hermes_cli/test_web_server_host_header.py -q -o 'addopts='13 passed, 1 warningSecurity notes