fix(dashboard): restore reverse-proxy WS access and action-status polling in --insecure mode#34307
Open
Kailigithub wants to merge 1 commit into
Open
Conversation
…ling in --insecure mode
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.
Fix two regressions that landed in v0.14.0 which together render the dashboard unusable when fronted by a reverse proxy in
--insecuremode.Changes
1. Restore
/api/actions/{name}/statuspolling in--insecuremodeThe SPA polls this endpoint every ~2 seconds to drive the post-update progress modal. In v0.14.0 it started returning 401 through reverse proxies because the endpoint was not covered by the session-token middleware interceptor —
POST /api/hermes/update(the kickoff) carried the header correctly, but the status poller did not.Fix: add
/api/actions/{name}/statustoPUBLIC_API_PATHSinhermes_cli/dashboard_auth/public_paths.py. The response is read-only and only exposes~/.hermes/logs/<action>.log, which the operator already has shell access to.2. Restore WebSocket access from reverse-proxy IPs in
--insecuremodeIn
--insecuremode_ws_client_is_allowed()was locking all WS endpoints (/api/ws,/api/events,/api/pty) to loopback IPs only. The operator chose--insecureprecisely because they're terminating auth at the proxy layer (SSO, mTLS, basic auth, etc.), and the WS arrives from the proxy's IP, not127.0.0.1. The existing?token=constant-time check in_ws_auth_okis the same protection used on every authed HTTP endpoint, which is not similarly IP-restricted.Fix: in
_ws_client_is_allowed(), respect theallow_publicflag (--insecuremode) and skip the IP check when it is set, relying on the?token=check as the sole auth gate for WS in that mode.Both changes are minimal and targeted — no architecture changes, no new dependencies.
Closes #34227