Commit Graph

10 Commits

Author SHA1 Message Date
emozilla
22103f58a8 fix(dashboard): a gated dashboard behind a proxy takes its own page's cookie writes as on main
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.
2026-10-25 03:22:40 -07:00
emozilla
76a8d7695c fix(webapp): give the Webapp its own public URL and stop reading the dashboard's
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.
2026-10-25 03:22:23 -07:00
Bear Huddleston
d9f1a3f6df fix(dashboard): refuse cookie-authenticated writes from another origin
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>
2026-10-25 03:22:17 -07:00
Bear Huddleston
b5eb5ee7a8 feat(webapp): carry the browser-hosted Desktop's server pieces from #93508
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>
2026-10-25 03:22:14 -07:00
hinotoi-agent
fb5bba80dc fix(security): ignore spoofed XFF for dashboard login limits
Signed-off-by: hinotoi-agent <paperlantern.agent@gmail.com>
(cherry picked from commit bf4041e054d41b9705ec29fa7f09a00b68c932d8)
2026-10-05 12:23:21 -04:00
Teknium
7443080d5a refactor(hermes_cli): dashboard_auth docstring/comment compaction (keep WHY); native_flow pending lookup helper; prefix warn-once helper; commands registry repack 2026-09-03 00:07:25 -07:00
Teknium
c04eb54f9b refactor(hermes_cli): AST-neutral layout compaction of dashboard_auth + commands_platforms 2026-09-02 21:01:32 -07:00
Teknium
a3d7a0c25b refactor(hermes_cli): compact dashboard_auth package (registry/native_flow/audit/prefix/docs) 2026-09-02 20:33:40 -07:00
Teknium
28f098540b refactor(hermes_cli): dashboard_auth routes/middleware share one provider-scan helper; compact cookies 2026-09-02 20:10:27 -07:00
Teknium
f0f7f55f76 refactor(web): dashboard_auth/web_routers/kanban dedupe + _common helpers (resume — verified partial work) 2026-09-02 13:30:05 -07:00