fix(dashboard): trust configured public URL host - #42344
Conversation
|
Clean review — no issues found. What's good:
One observation (not a blocker): |
3bcc441 to
c453467
Compare
|
Thanks for the review. I agreed with the env-only observation and reworked the PR accordingly: it no longer introduces |
|
Thanks for the focused reverse-proxy fix. Current main still rejects the configured public hostname for both HTTP and WebSocket handshakes: Problems
Suggested changes
Automated hermes-sweeper review. |
|
Tested this PR's intended design in a real Tailscale Serve deployment and ported commit Current-main port notes:
Verification on that resolved current-main port: I also applied the sweeper's requested documentation update locally. The needed wording changes are:
This PR is the right upstream shape for Tailscale Serve: it reuses the existing validated |
Summary
dashboard.public_url/HERMES_DASHBOARD_PUBLIC_URLas the canonical trusted reverse-proxy dashboard hostWhy
Trusted reverse proxies such as Tailscale Serve can keep the dashboard bound to
127.0.0.1while preserving the browser-facing Host header. In that deployment, requests arrive asdashboard.tailnet.example.ts.neteven though the server is bound to loopback, so the current Host guard rejects legitimate dashboard traffic withInvalid Host header.dashboard.public_urlalready declares the browser-facing dashboard URL for OAuth redirects. This patch reuses its hostname for the dashboard Host/Origin guard instead of adding a second env-only allowlist. Matching remains exact; wildcards and suffixes likedashboard.example.evil.exampleare still rejected.Tests
uv run --with pytest --with pytest-timeout pytest tests/hermes_cli/test_web_server_host_header.py -quv run --with pytest --with pytest-timeout pytest tests/hermes_cli/test_web_server_host_header.py tests/hermes_cli/test_dashboard_auth_prefix.py tests/hermes_cli/test_dashboard_auth_ws_auth.py tests/hermes_cli/test_dashboard_auth_gate.py -quv run ruff check hermes_cli/web_server.py hermes_cli/config.py tests/hermes_cli/test_web_server_host_header.py