Repository navigation
Description
Bug Description
HERMES_DASHBOARD_PUBLIC_URL does not appear to be respected by the dashboard self-hosted OIDC login flow in Docker on Hermes 0.16.0. The documentation says this variable should override dashboard.public_url for OAuth callback construction behind reverse proxies, but Hermes still generated an http:// callback URL until I set dashboard.public_url directly in config.yaml.
Steps to Reproduce
- Run Hermes Agent 0.16.0 in Docker Compose with the dashboard enabled and self-hosted OIDC configured behind a reverse proxy.
- Set
HERMES_DASHBOARD_PUBLIC_URL=https://hermes.domain.comin the container environment, and configure the OIDC provider callback URL ashttps://hermes.domain.com/auth/callback. - Open the dashboard and click Sign in with Self-Hosted OIDC.
- Observe that the request fails before reaching the provider login page, and Hermes reports a generated callback URL of
http://hermes.domain.com/auth/callback. - Edit
/opt/data/config.yamland setdashboard.public_url: 'https://hermes.domain.com', restart Hermes, and retry login. - Observe that login works after setting the value in
config.yaml.
I first suspected a reverse proxy header issue, but directly calling Hermes with Host: hermes.domain.com and X-Forwarded-Proto: https still produced the same http://hermes.domain.com/auth/callback redirect URI. That suggests the issue is inside Hermes’ callback URL generation rather than in the proxy layer.
As a workaround, setting dashboard.public_url: 'https://hermes.domain.com' directly in /opt/data/config.yaml fixed the OIDC login flow immediately. Based on the docs, this workaround should not be necessary when HERMES_DASHBOARD_PUBLIC_URL is already set.
Expected Behavior
Hermes should honor HERMES_DASHBOARD_PUBLIC_URL=https://hermes.domain.com and generate the OIDC callback as https://hermes.domain.com/auth/callback, because the docs state that this environment variable overrides dashboard.public_url for OAuth callback construction behind reverse proxies.
Actual Behavior
Hermes generated http://hermes.domain.com/auth/callback during /auth/login?provider=self-hosted, which caused the OIDC provider to reject the redirect URI before showing the login page. The issue disappeared only after manually setting dashboard.public_url in /opt/data/config.yaml.
Affected Component
Other
Messaging Platform (if gateway-related)
No response
Debug Report
Hermes `/api/status` showed that auth was enabled and the self-hosted provider was loaded.
HTTP/1.1 503 Service Unavailable
{"detail":"Provider unreachable: redirect_uri may only use http:// for localhost/127.0.0.1, got 'http://hermes.domain.com/auth/callback'"}
{"ts":"2026-06-09T09:42:25.469868+00:00","event":"login_failure","provider":"self-hosted","reason":"provider_unreachable","ip":"192.168.XXX.XXX"}Operating System
Docker v5.1.4 on Ubuntu 24.04
Python Version
3.13.5
Hermes Version
v0.16.0 (2026.6.5)
Additional Logs / Traceback (optional)
Root Cause Analysis (optional)
No response
Proposed Fix (optional)
No response
Are you willing to submit a PR for this?
- I'd like to fix this myself and submit a PR
Activity
harjothkhara commentedon Jun 9, 2026
I tried to reproduce this against current
mainand couldn't — the OIDC callback path does honorHERMES_DASHBOARD_PUBLIC_URL, so I think the root cause is environmental rather than in Hermes' URL generation. Walking through it:/auth/loginbuilds the redirect_uri via_redirect_uri(request)→resolve_public_url()(hermes_cli/dashboard_auth/prefix.py), whose precedence is env var first, thendashboard.public_url, then request reconstruction.HERMES_DASHBOARD_PUBLIC_URL=https://hermes.domain.comset,resolve_public_url()returnshttps://hermes.domain.comand the redirect_uri becomeshttps://hermes.domain.com/auth/callback. There's also already a regression test asserting the env var wins over config.The override landed in
a890389b6, which is included in your v0.16.0, so you did have it. The telling detail is that settingdashboard.public_urlinconfig.yamlfixed it — that goes through the same normaliser as the env var, so if config worked, the env value must have been seen as empty/invalid at runtime. Two common causes:env_filethe container didn't load, or in a different service in the compose file)."https://hermes.domain.com"(literal quotes) or a trailing newline from a mounted secret would be treated as unset and fall through to config.Could you run
printenv HERMES_DASHBOARD_PUBLIC_URLinside the running container and paste the exact output (including any surrounding quotes)? That'll tell us which of the two it is. Happy to dig further once we see it.benbarclay commentedon Jun 10, 2026
Thanks for the detailed report — the note that hitting Hermes directly with
Host:+X-Forwarded-Proto: httpsstill producedhttp://was the key clue, because it rules out the proxy and points inside Hermes.On current
main(and the latest release),HERMES_DASHBOARD_PUBLIC_URLis honored by the OAuth callback construction (resolve_public_url()→ tier-1 override), and I verified the Docker image passes the env var through to the dashboard process correctly (s6-overlay imports the full container environment; both the dashboard and gateway run scripts usewith-contenv+s6-setuidgid, which preserve it). So this isn't an image/env-passthrough bug.The most likely cause: the value is being silently rejected for not having a scheme.
resolve_public_url()runs the value through a validator that requires a fullhttp(s)://hostand returns empty for anything else — and empty is treated as "unset", so Hermes falls back to reconstructing the callback URL from request headers (which behind your proxy yieldshttp://). A value likeHERMES_DASHBOARD_PUBLIC_URL=hermes.domain.com(nohttps://) would reproduce your symptom exactly, and would also explain why settingdashboard.public_urlin config.yaml fixed it — presumably you wrote it there with the scheme.Could you confirm the exact value you set?
If it's missing the
https://prefix, that's the bug.Either way, the silent-discard behaviour is a footgun, so I've opened #43214 to emit a clear
WARNINGwhenever a non-emptyHERMES_DASHBOARD_PUBLIC_URL/dashboard.public_urlis rejected as malformed — so this diagnoses itself next time instead of failing quietly. Leaving this issue open until we confirm the value on your side.fix(dashboard-auth): warn when public_url override is silently reject…
fix(dashboard-auth): warn when public_url override is silently reject…
fix(dashboard-auth): warn when public_url override is silently reject…
fix(dashboard-auth): warn when public_url override is silently reject…
fix(dashboard-auth): warn when public_url override is silently reject…
fix(dashboard-auth): warn when public_url override is silently reject…
fix(dashboard-auth): warn when public_url override is silently reject…
teknium1 commentedon Jul 14, 2026
Thanks for the detailed report. This is an automated hermes-sweeper review; current
mainalready implements the requested override behavior.hermes_cli/dashboard_auth/prefix.py:223-226resolvesHERMES_DASHBOARD_PUBLIC_URLbefore config or request reconstruction.hermes_cli/dashboard_auth/routes.py:89-96builds the callback directly as<public_url>/auth/callback.tests/hermes_cli/test_dashboard_auth_prefix.py:323-337verifies the exact env-driven HTTPS callback path, and:347-360verifies env precedence overdashboard.public_url.7df3aa34b17819c790098c391a88ea0ab0827f4d(referenced in the discussion) adds an explicit warning when a malformed override is rejected instead of silently falling back to proxy-header reconstruction.The implementation originated in
a890389b69575916dfaf3980556f31f7f25c9871and the diagnostic follow-up is contained inv2026.6.19.fix(dashboard-auth): warn when public_url override is silently reject…
fix(dashboard-auth): warn when public_url override is silently reject…
fix(dashboard-auth): warn when public_url override is silently reject…
fix(dashboard-auth): warn when public_url override is silently reject…