feat: add OpenClaw-style dashboard authentication#19959
Open
asarlashmit wants to merge 2 commits into
Open
Conversation
- Add configurable dashboard auth modes for none, token, password, trusted-proxy, and Tailscale identity headers - Protect dashboard HTTP APIs, plugin routes, and WebSocket endpoints through a shared DashboardAuthManager - Add CLI/config/env wiring for dashboard auth and preserve local unauthenticated default UX - Refuse non-localhost dashboard binds without robust auth unless explicitly --insecure - Add React AuthGate plus sessionStorage-based token/password session handling and URL-fragment bootstrap - Add Docker Compose smoke coverage for dashboard auth modes - Cover token precedence, session expiry/logout, rate limiting, HTTP/WebSocket auth, and Ollama Cloud auth regression tests
df7e335 to
ac691c1
Compare
15 tasks
9 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
This PR adds OpenClaw-style authentication to the Hermes web dashboard while preserving the current localhost-first default behavior.
Features added
DashboardAuthManagerwith auth modes:nonefor the existing local-only unauthenticated UXtokenfor bearer/header token authenticationpasswordfor password login with ephemeral dashboard sessionstrusted-proxyfor reverse-proxy identity headerstailscalefor Tailscale identity headershermes dashboard --auth {none,token,password,trusted-proxy,tailscale}--auth-token--auth-password--auth-password-hashdashboard.auth.*defaults in configHERMES_DASHBOARD_AUTH_MODE,HERMES_DASHBOARD_TOKEN,HERMES_DASHBOARD_PASSWORD, andHERMES_DASHBOARD_PASSWORD_HASHhermes dashboardstill binds to127.0.0.1:9119none--host 0.0.0.0refuse to start unless robust auth is enabled--insecureremains available as an explicit override/api/pty/api/ws/api/pub/api/eventsAuthGatefor token/password login#token=...) instead of query stringCode changes
hermes_cli/dashboard_auth.pyhermes_cli/web_server.py--insecureis passed.#token=fragments.hermes_cli/main.pyhermes dashboardauth flags and merges CLI overrides with persistent config.hermes_cli/config.pydashboard.authconfig tree.web/src/components/AuthGate.tsx,web/src/lib/dashboardAuth.ts, and related web client filesdocker/dashboard-auth/*Security notes