Skip to content

feat(dashboard): add --allowed-host flag for reverse proxy support#20884

Closed
tobalsan wants to merge 1 commit into
NousResearch:mainfrom
tobalsan:feat/dashboard-allowed-host
Closed

feat(dashboard): add --allowed-host flag for reverse proxy support#20884
tobalsan wants to merge 1 commit into
NousResearch:mainfrom
tobalsan:feat/dashboard-allowed-host

Conversation

@tobalsan

@tobalsan tobalsan commented May 6, 2026

Copy link
Copy Markdown

Problem

The dashboard's Host header validation (anti-DNS-rebinding, GHSA-ppp5-vxwm-4cf7) rejects any request whose Host doesn't match the bound interface. This makes it impossible to run behind a reverse proxy like Tailscale Serve that rewrites the Host header to the proxy's hostname.

Solution

Add a repeatable --allowed-host CLI flag that registers extra accepted Host header values:

hermes dashboard --no-open --allowed-host machine.tailnet.ts.net

Changes:

  • web_server.py: _is_accepted_host() gains an extra_hosts parameter, checked before existing logic. Stored on app.state by start_server().
  • main.py: New --allowed-host arg on the dashboard subparser, threaded through to start_server().

No changes to existing behavior — the flag is additive and defaults to empty.

Allows the dashboard to accept extra Host header values via a repeatable
--allowed-host CLI flag. This enables running the dashboard behind
Tailscale Serve (or any reverse proxy) without binding to 0.0.0.0.

Usage:
  hermes dashboard --no-open --allowed-host host.tailnet.ts.net

The dashboard stays on 127.0.0.1 -- Tailscale Serve proxies to it over
loopback, so WebSockets work unchanged.
@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard labels May 6, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #20136 which adds the same allowed_hosts capability via config (dashboard.allowed_hosts) plus trusted_proxy_hosts for WebSocket peers. This PR implements a subset as a CLI flag only. Consider closing in favor of #20136 or coordinating.

@tobalsan

tobalsan commented May 6, 2026

Copy link
Copy Markdown
Author

Closed as it's a duplicate of #20136

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants