With the Webapp off, `hermes dashboard` behind its sign-in gate answered 403 to every write its own
page made through a plain-HTTP reverse proxy that forwards with the upstream's Host and no
dashboard.public_url: the browser sends no Fetch Metadata to a plain-HTTP origin, and the
cookie-origin check carried for the Webapp compared the page's Origin with the server's own URL.
Main admitted those writes, and sign-out through /auth/logout stayed a plain public path.
The check, and the sign-out's place in it, now belong to the gateway's Webapp listener only: the
surface policy gains own_origin_cookie_writes, true for the Webapp and false for the dashboard and
`hermes serve`, and the gate asks for it before refusing a cookie write. The Webapp's refusal names
webapp.public_url. Tests that pinned the check on the dashboard now run on the Webapp surface, and
the dashboard's parity is pinned in test_dashboard_auth_middleware.
The gateway's Webapp listener read dashboard.public_url, the setting that describes `hermes
dashboard` behind a reverse proxy, to decide whether to require sign-in on a loopback bind, which
outside hostname to accept and where to send sign-in callbacks. So a user with a proxied dashboard
got a Webapp that demanded sign-in and accepted the dashboard's hostname, and with no sign-in
provider the gateway exited outright; and the Web Access pane had to rewrite dashboard.public_url
to publish the Webapp, breaking the dashboard it belonged to.
The Webapp now has webapp.public_url: an optional http(s) address with no credentials, query or
fragment (anything else keeps the Webapp off, like the other webapp settings). On the Webapp
listener it alone engages sign-in on a loopback bind, is the one outside hostname accepted, and is
the base of the sign-in and MCP OAuth callbacks and of the Origin check for browsers without Fetch
Metadata; dashboard.public_url never applies there. The listener records its own URL on the app
state and the shared resolver returns it; `hermes dashboard` declares none and reads
dashboard.public_url exactly as before. When the Webapp's URL needs sign-in and no provider is
registered, the gateway's reason names webapp.public_url. The key is in DEFAULT_CONFIG and the
configuration docs.
Ported from BearHuddleston's #93508.
SameSite=Lax keeps cross-site pages from sending the sign-in cookie, but a same-site sibling
(another port or subdomain) still sends it. A write that carries the cookie now has to come from
the dashboard's own origin: the browser's Sec-Fetch-Site decides when present, otherwise Origin
must match. Native clients and bearer tokens are unaffected.
Co-authored-by: emozilla <emozilla@nousresearch.com>
Carried from BearHuddleston's #93508 onto main. The Webapp relay and the
profile-incarnation fence stay out: carried code follows main's
named-profile rule and refuses a missing or deleted profile home.
- Webapp routes: one-use launch tickets, window handoff, and gateway
WebSocket tickets minted for the signed-in browser
- Browser surface policy and the SPA document policy
- A host terminal for the browser that survives reconnects
- Staged browser uploads and file tickets; file.attach takes a staged upload
- hermes sessions adopt
- Webapp bundle build helpers and the renderer freshness check
- Regenerated gateway contracts
Co-authored-by: emozilla <emozilla@nousresearch.com>