fix: support proxied dashboard chat sessions#21104
Open
hejun041 wants to merge 2 commits into
Open
Conversation
Remove systemd restart directives unsupported by older systemd releases. Trust local reverse proxy headers for the dashboard and allow proxied WebSocket requests when the upstream Host header matches the bound dashboard host. Update the TUI build freshness check to use the actual @hermes/ink build artifact so embedded chat startup does not rebuild on every PTY connection.
Collaborator
Author
|
Added a follow-up commit Additional validation:
|
This was referenced May 9, 2026
4 tasks
19 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
entry-exports.js)/sessionspageDetails
RestartMaxDelaySec/RestartStepsfrom the generated gateway systemd unit so it works on older systemd versions (e.g. systemd 245).proxy_headers=Trueandforwarded_allow_ips="127.0.0.1,::1"so local reverse proxies can pass through the original client/host information without trusting arbitrary remote forwarded headers./api/ptyWebSocket handshakes from a trusted local reverse proxy when the forwarded/Host header still matches the dashboard bind host, while preserving the DNS-rebinding guard for non-loopback clients._hermes_ink_bundle_stale()to checkui-tui/packages/hermes-ink/dist/entry-exports.jsinstead of the removedink-bundle.js, avoiding needless rebuilds during dashboard chat connection startup./api/sessionsprojects to the latest live tip even when an intermediate compression anchor itself has a parent, and sorts dashboard sessions by last activity.Test Plan
venv/bin/python -m pytest tests/hermes_cli/test_gateway.py tests/hermes_cli/test_tui_npm_install.py tests/hermes_cli/test_web_server_host_header.py tests/hermes_cli/test_web_server.py::TestPtyWebSocket -q -o 'addopts='venv/bin/python -m pytest tests/test_hermes_state.py::TestListSessionsRich tests/test_hermes_state.py::TestCompressionChainProjection tests/hermes_cli/test_web_server.py::TestPtyWebSocket tests/hermes_cli/test_web_server_host_header.py -q -o 'addopts='/api/ptyWebSocket handshake returnedHTTP/1.1 101 Switching Protocols./api/sessions?limit=20&offset=0check confirmed a repeatedly-compressed active session now appears in the first page.Note
The TUI artifact freshness change overlaps with existing PRs called out in review (#20951, #20686, #21098). The systemd/reverse-proxy/session-list fixes are independent.