Pithos browser app plan: pithos.silentmode.st, sign-in only, remember allowed

app.pithos.sia would still be served from the shared navigate.st origin
outside Theseus, so the app gets its own name on silentmode.st.
This commit is contained in:
Local Dev 2026-10-05 02:11:32 +02:00
parent 8742e104a2
commit ab3568a6fb

View file

@ -1,6 +1,6 @@
# Pithos in the browser (plan) # Pithos in the browser (plan)
Status: plan, 2026-10-05. Nothing built yet. Status: plan, 2026-10-05. Nothing built yet. Decided: `https://pithos.silentmode.st`, sign-in only, "Remember on this device" allowed.
## Goal ## Goal
@ -14,8 +14,15 @@ hands over to the local Pithos ("Open my Pithos", port 47621).
## Where it lives: its own origin ## Where it lives: its own origin
**`https://s3.silentmode.st/app`**, served by the hosted gateway. **`https://pithos.silentmode.st`**: a vhost of its own that serves the app
files and forwards `/hosted/v1/*`, `/api/*` and the S3 paths to the hosted
gateway (127.0.0.1:8720), so the page and the API share one origin.
- Not `app.pithos.sia` either: outside Theseus BNS names are paths of
navigate.st (and BNS folds subdomains into the parent name's folder), so
the origin would still be navigate.st. Per-name origins on navigate.st
(`<name>.navigate.st`, wildcard certificate) would fix that for every BNS
site; a separate project.
- Not on `navigate.st/bns/pithos.sia/app`: every BNS site served through - Not on `navigate.st/bns/pithos.sia/app`: every BNS site served through
navigate.st shares the origin `navigate.st`, so any other `.sia`/`.bch` site navigate.st shares the origin `navigate.st`, so any other `.sia`/`.bch` site
could open the app's window (same origin) and read the keys out of it, or could open the app's window (same origin) and read the keys out of it, or
@ -25,7 +32,7 @@ hands over to the local Pithos ("Open my Pithos", port 47621).
- `pithos.sia/app` keeps its meaning: in Theseus it is the full app (the - `pithos.sia/app` keeps its meaning: in Theseus it is the full app (the
add-on answers it); in any other browser the website's app-address hint add-on answers it); in any other browser the website's app-address hint
gets a third button, "Open in the browser app", linking to gets a third button, "Open in the browser app", linking to
`https://s3.silentmode.st/app`. `https://pithos.silentmode.st`.
- Strict CSP (`default-src 'self'`, `connect-src 'self'`, no inline script, - Strict CSP (`default-src 'self'`, `connect-src 'self'`, no inline script,
`frame-ancestors 'none'`), no third-party scripts, files served by the `frame-ancestors 'none'`), no third-party scripts, files served by the
gateway from `Pithos/web/` (versioned with Pithos). gateway from `Pithos/web/` (versioned with Pithos).
@ -56,9 +63,10 @@ Two kinds of key, both loaded from a file (drag and drop or picker) or pasted:
gateway. gateway.
Keys live **in memory only** by default; closing the tab signs out. Keys live **in memory only** by default; closing the tab signs out.
Optional "Remember on this device": the key file is wrapped with a "Remember on this device" (allowed): the key file is wrapped with a
passphrase (PBKDF2-SHA256 600k + AES-GCM, as Save credentials… does) in passphrase (PBKDF2-SHA256 600k + AES-GCM, as Save credentials… does) in
IndexedDB on the gateway origin. Sign out wipes it and calls IndexedDB on the pithos.silentmode.st origin; the next visit asks for the
passphrase only. Sign out wipes it and calls
`DELETE` on the session. `DELETE` on the session.
## Crypto in the page ## Crypto in the page
@ -92,13 +100,18 @@ in `Pithos/web/lib/`, sharing test vectors with the Node versions.
Later: the docked music player, offline cache, PWA install. Later: the docked music player, offline cache, PWA install.
## Gateway changes (Pithos/hosted) ## Server changes
- Serve `GET /app`, `/app/*` (static files, strict CSP, long cache with - DNS `pithos.silentmode.st` → the VPS; certificate; an Angie vhost that
versioned names), before the S3/auth routing. serves `Pithos/web/` at `/` (strict CSP, versioned file names, long cache)
- Nothing else: same origin, so no CORS. The S3 path rules stay as they are and proxies `/hosted/v1/`, `/api/` and S3 requests to 127.0.0.1:8720.
(owner keys raw-proxied to s3d; grant keys checked by `rules.js`). - The gateway must accept that Host for SigV4: the page signs requests for
- Rate limits already in place for sign-in apply. host `pithos.silentmode.st`; owner keys go raw to s3d, which checks the
signature over the Host it receives, so the vhost passes `Host` through
unchanged and `publicUrl`-based checks (challenge message) need the second
name (the challenge text names the URL the client signed in at).
- No CORS: same origin. Path rules unchanged (owner keys raw-proxied to s3d;
grant keys checked by `rules.js`). Sign-in rate limits apply.
## Phases ## Phases
@ -111,8 +124,8 @@ Later: the docked music player, offline cache, PWA install.
## Open questions ## Open questions
- Is `s3.silentmode.st/app` the address, or a dedicated `pithos.silentmode.st` - Decided 2026-10-05: `pithos.silentmode.st`; sign-in only (accounts are
(same design, another certificate and vhost)? made in Pithos); "Remember on this device" allowed (passphrase-wrapped).
- Should the browser app also sign up new accounts (BNS signature / invite), - Still open: does s3d accept SigV4 for a Host other than the one it was set
or only sign in to accounts made in Pithos? up with? (It checks the signature over whatever Host arrives, so it should;
- "Remember on this device": allow it, or always ask for the key file? verify in phase 2.)