pithos/hosted
Local Dev 92260d177e Pithos: link the Theseus ID after signing in; an account console
In Theseus, Pithos now links the person's Theseus ID to their hosted account
by itself, once, right after signing in to Silent Mode (or on the first look
at an account already signed in): one consent prompt, then Pithos is listed
under Settings › Theseus ID. On a Theseus without the add-on API it does
nothing, so the add-on can ship before the Theseus release that carries it.

The gateway serves /console on its own origin: sign in with the Theseus ID
and see the account's state, sign-up, usage and Theseus ID, with a console
session that cannot reach files. Three fixed files under a CSP that allows
only this origin.

The bundled copy in TheseusNavigator/bundled-addons/pithos is rebuilt from
Pithos/ with no version bump; the release that ships it bumps the version.
2026-10-06 20:43:14 +02:00
..
console Pithos: link the Theseus ID after signing in; an account console 2026-10-06 20:43:14 +02:00
deploy Pithos: run your drives on Silent Mode with your own Sia account 2026-10-04 01:33:20 +02:00
test Pithos: link the Theseus ID after signing in; an account console 2026-10-06 20:43:14 +02:00
theseus-id pithos-hosted: link a Theseus ID; a console session that cannot read data 2026-10-06 20:34:52 +02:00
auth.js pithos-hosted: link a Theseus ID; a console session that cannot read data 2026-10-06 20:34:52 +02:00
electrum.js Pithos: run your drives on Silent Mode with your own Sia account 2026-10-04 01:33:20 +02:00
gate.js Pithos hosting: fixes from an independent review 2026-10-04 03:15:42 +02:00
main.js Pithos: run your drives on Silent Mode with your own Sia account 2026-10-04 01:33:20 +02:00
package-lock.json pithos-hosted: public folders by name, as pages, at navigate.st/s3 2026-10-04 16:10:11 +02:00
package.json pithos-hosted: tests for signatures, rules and the sign-up gate 2026-10-04 01:34:25 +02:00
README.md Pithos: document hosting on Silent Mode and the gateway 2026-10-04 01:44:23 +02:00
rules.js Pithos: run your drives on Silent Mode with your own Sia account 2026-10-04 01:33:20 +02:00
server.js Pithos: link the Theseus ID after signing in; an account console 2026-10-06 20:43:14 +02:00
sigv4.js Pithos: run your drives on Silent Mode with your own Sia account 2026-10-04 01:33:20 +02:00
store.js Pithos: run your drives on Silent Mode with your own Sia account 2026-10-04 01:33:20 +02:00
supervisor.js pithos-hosted: public folders by name, as pages, at navigate.st/s3 2026-10-04 16:10:11 +02:00

pithos-hosted

The server half of Pithos's On Silent Mode: one s3d per person, each on that person's own Sia account, behind a gateway that adds sign-in, per-folder access and traffic limits. The client half (encryption, moving drives) is in ../core/hosted.js and ../core/hosted-routes.js.

What it serves

Path Who What
/hosted/v1/challenge, /hosted/v1/session anyone Ed25519 sign-in; first sign-in needs a sign-up proof
/hosted/v1/me, /rules, /data/... session account, access rules, moving the s3d data folder in and out
/api/... session the owner's Pithos API, forwarded to their s3d's control server (an allowlist; object routes are refused so nothing bypasses client-side encryption)
/p/<account>/<drive>/<path> anyone files under a public rule
/l/<token> anyone one file under a share link, until it expires
everything else S3 keys path-style S3. Owner keys go straight to their s3d, which checks the signature; keys minted for other people are verified here, held to their folder and rights, and re-signed with the owner's key

s3d processes listen on loopback only (portBase + 2 * slot). Each one starts on the account's first request and is stopped after idleMinutes, leftovers flushed to Sia first; at most maxRunning run at once.

State is files under root: users/<id>/ (account, s3d.yml, data, rules, usage), sessions.json (token hashes), gate.json, keys.json, grants.json, links.json. Back up that folder and you have backed up the service.

Sign-up gate

gate in the config enables any of:

  • bns: { api }: the user signs pithos-hosted signup <account id> with the wallet that owns a BNS name; api is a BNS gateway answering /api/name/<name> with the owner. One slot per name.
  • deposit: { address, minSats, confirmations, electrum: { host, port, tls } }: a BCH payment to address carrying OP_RETURN pithos:<account id>. One slot per transaction. Refunds are an operator decision.
  • invites: ["code", ...]: one use each.

perIpPerDay limits sign-ups per client address (set trustProxy behind nginx so X-Forwarded-For is used).

Running it

cd /opt/pithos && npm install --omit=dev --omit=optional
cd hosted && npm install --omit=dev
cp deploy/pithos-hosted.example.json /etc/pithos-hosted.json   # edit it
node main.js --config /etc/pithos-hosted.json

deploy/ has a systemd unit and an nginx site for s3.silentmode.st (streamed bodies, Host passed through: s3d checks signatures against the host the client signed). The s3d binary must be the version Pithos pins (core/binary.js), the same on both sides of a move.

Stopping the service flushes every running s3d first, so give systemd time (TimeoutStopSec=300).

Tests

npm test here covers SigV4 verification, rules and the sign-up gate. The full path (move up, encrypt, share, grant, move back) needs a real s3d; it was exercised against a mock indexer during development.

Not yet

  • Signed streaming uploads (STREAMING-AWS4-HMAC-SHA256-PAYLOAD) from shared keys are refused; owner keys are unaffected.
  • Shared keys and links reach readable copies only. Sharing encrypted files with a person (wrapping the folder key to theirs) is the next step.
  • No quotas here: storage is each person's own Sia account. Paid storage is Hestia, a separate product.