fix(docker): redirect /monitor to the dashboard UI (#2091, point 7) - #2157
Merged
Conversation
…t 7) Pre-0.9 docs pointed at /monitor for the dashboard, which now lives at /dashboard. /monitor is the monitoring API prefix with no page of its own, so a browser landed on a bare 401 with no pointer to the real UI. Redirect the exact path /monitor -> /dashboard and allow it in the auth gate's exact-match public_paths. The /monitor/* API routes - including /monitor/ws and the destructive admin actions - stay gated; making the prefix public would expose them unauthenticated. Tests pin both halves and were mutation-checked: widening the gate to the /monitor prefix fails the gated-route and websocket tests, and dropping /monitor from public_paths fails the redirect test. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Follow-up to #2094, which closed the
/half of point 7 in #2091. This closes the/monitorhalf.Problem
Pre-0.9 docs pointed at
/monitorfor the dashboard. The UI actually lives at/dashboard(server.py:276);/monitoris the monitoring API prefix (monitor_routes.py:12) with no page of its own. A browser hitting the documented URL got a bare{"detail": "Authentication required"}and no pointer to the real UI.Change
GET /monitor→ 307/dashboard, and"/monitor"added to the auth gate's exact-matchpublic_paths./monitor/*stays gated. Making the prefix public would expose request logs, browser state,/monitor/ws, and the destructive admin actions (actions/cleanup,actions/kill_browser,stats/reset) with no credential.Tests
test_legacy_compat.py: the redirect, a parametrized gate check over 8/monitor/*routes, and a websocket gate check. The pre-existing placeholder (which accepted 401 or a redirect) is now tightened to require the redirect.Mutation-checked both ways:
/monitorto_UI_PREFIXES(the unsafe fix) → 9 failures, incl. the websocket test/monitorfrompublic_paths→ redirect test failsFull docker security suite: 319 passed, 1 xfailed.