Skip to main content

The one-origin estate

Almost every deployed project in the estate is a sub-path on one origin: /<name> on the production origin, served by a single Caddy instance from a generated Caddyfile in the vps-deploy repo. www and the bare IP both redirect to the apex. The exceptions hold what the rest must not reach: since 2026-10-22 Ward is at ward.<domain> (its UI at the root, its API at /ward-api), next to the imbatranimOS desktop, Postern's webmail and Satchel's messenger, each on a host of its own. Ward's docs stay at /ward/docs on the apex.

This is the most load-bearing fact about Ward. It is not a preference — it is the estate as it already exists — and it rules several designs in and several out before anyone proposes them.

What it gave, and what replaced it​

Ward's first design leaned on it: an access cookie at Path=/ reached every app with no redirect dance, no CORS and no token relay, and each app asked Ward about it through /introspect with an app key. That contract was retired on 2026-10-13. Apps now keep their own sessions and sign people in through OpenID Connect (Sign in with Ward), and Ward's cookies stay under /ward-api. A code flow does not need one origin, which is what let Ward itself move to another host by changing the issuer each app is configured with.

What it costs​

There is no isolation between apps. Same origin is one security context: any app's frontend JavaScript can call any other app's API with the user's credentials attached, and an XSS in the most trivial static site in the estate reaches atrium's API. Sub-paths do not sandbox.

Accepted for the apex, not for Ward

Narrow cookie paths kept Ward's own credentials out of other apps' requests, but they are not a boundary against script on the same origin: an XSS in any app on the apex could call Ward's console API while the owner was signed in to it. That is why Ward has its own host since 2026-10-22. For the apps still on the apex the trade stands, taken knowingly; see decisions.

The literal-matching trap​

Caddy's path matching is literal, and handle_path /ward/* requires the character after /ward to be /. So:

PairDisjoint?Why
/ward and /ward-apiYesThe next character is -, not /
/ward and /ward/docsNo/ward/* matches every path under /ward/docs

Both shapes exist in the estate, which is why the second one is not left to care. A project's docs live at /<project>/docs by convention, nested inside the app's own prefix, and are reachable only because the docs route is written above the app route in the generated file. That ordering is pinned by the construct that emits it and checked by the synthesizer, which refuses to render a file where a route is shadowed. The rule and its enforcement are written up in vps-deploy/docs/docs-route-convention.md.

The same trap is why the /ward ↔ /ward-api pair carries a comment in the stack: a rename that made them nest would break every app in the estate silently, and only the checker would catch it.

What it means for the cookies​

Three cookies, each scoped as narrowly as its readers allow.

CookiePathWhy that path
access token (ward_session)/ward-apiOnly Ward's own pages read it (GET /session, /account/*). Until 2026-10-13 it sat at / so every app received it; Ward now expires that old copy whenever it sets or clears the session.
refresh token (ward_refresh)/ward-api/refreshIt must reach nothing but the endpoints that spend or read it: /refresh, /refresh/logout and the OIDC login step. A refresh token at Path=/ would be handed to every app on the origin.
console session/ward-api/consoleThe console is superuser-only; its credential should not travel with ordinary requests.

The narrow paths are doing real work. They are also the part of the system most likely to be wrong in a way local testing cannot reveal, because handle_path strips a prefix that no dev server strips — the caveat recorded in Status.

The ?next= allowlist​

Apps no longer send people to Ward's login with ?next=; they start an OpenID Connect authorization, and Ward only ever redirects to an app's registered redirect URIs. ?next= remains for Ward's own pages, and an unchecked next would still be an open redirect on the estate's sign-in page, so it is allowlisted to Ward's own pages (first segment exactly account, console, register or verify), not merely checked for being relative. The root, /ward-api and anything else are refused. A value that does not match is dropped and the person lands on /account.