Commit graph

11 commits

Author SHA1 Message Date
Local Dev
77a29d2ce8 Pithos 0.3.5: s3d stays up, one view at a time, user buckets, a viewer
- s3d kept stopping: Pithos stopped it whenever the extension restarted
  (every update, every Theseus quit) and never started it again. Start
  and Stop now record what the user wants (pithos-prefs.json beside
  s3d.yml); Pithos starts s3d with Theseus and when opened, and retries a
  crash up to three times in ten minutes, logging why it skips. The
  Buckets page also redraws when s3d starts or stops; it used to keep
  saying "not running".
- One view at a time: "Full page" opens Pithos in a tab and closes the
  left panel; the tab has "Back to sidebar", which reopens the panel.
- Every new user gets a bucket of their own, named after them (lowercase,
  hyphens) or as typed in the New user dialog.
- Buckets show as folder tiles. New folders are kept while empty with the
  usual "<name>/" marker object.
- A viewer: images, audio (mp3 and friends), video and text open inside
  Pithos, with Share and Download. The Theseus panel uses 10-minute,
  reusable, inline view links so players can make range requests.
- The Access dialog says what s3d cannot do: per-folder public access and
  write rights for others are not supported, only whole-bucket public read.
2026-10-04 00:05:49 +02:00
Local Dev
a91d2c64b4 Pithos 0.3.4: show the Sia account, label it, switch and restore accounts
"Acting as" read like a choice of Sia account; it picks an S3 user on
this s3d, and every user shares the one Sia account the s3d is connected
to. So:

- The picker is "S3 user", with a tooltip saying all users share one Sia
  account; Buckets explains what a bucket is.
- Buckets and the Overview show "Sia account: <label> (indexer)". Pithos
  cannot see the account's email, so the Sia connection page lets the
  user label it (kept in pithos.json beside the s3d data).
- "Switch Sia account" stops s3d and moves its data (connection, users,
  keys, buckets, upload buffer) into previous-account-<stamp>/ next to
  s3d.yml, never deleting it; the guide then connects another account.
  It warns about uploads still waiting for Sia and offers a flush, and
  refuses while another s3d serves the config.
- "Earlier Sia accounts" lists those folders with Restore, which sets the
  current account aside the same way and swaps the old one back.

Also: a fresh connect now records which indexer it used, and a "not
connected" check is re-run after 30 s so a login made outside Pithos
shows up.
2026-10-03 22:57:46 +02:00
Local Dev
735482d3b6 Pithos 0.3.3: fix SignatureDoesNotMatch when opening a bucket
The SigV4 encoder kept '/' unescaped in object paths by swapping in a
"never matches" regex (/$^/) for query values, but that regex matches the
empty string, so every empty query value went out as "/": prefix= became
prefix=/ and ?policy became ?policy=/. The request then no longer matched
what was signed, and listing any bucket or reading its policy failed
against s3d. Bucket listing and creation carry no query, so they worked.

Verified end to end against s3d (list, folders, upload, download, public
policy, folder delete) and against the aws cli; two regression tests.
2026-10-03 22:12:44 +02:00
Local Dev
c09872122a Pithos 0.3.2: save access keys to an encrypted file
Wherever a key pair is shown (the guide's last step, the key dialog) a
"Save credentials" button writes it to a .pithoskey file, and Users &
keys gains "Open saved credentials" to read one back.

- With a password (any host): PBKDF2-SHA256, 600k iterations, AES-256-GCM,
  done in the page with WebCrypto.
- With the Theseus vault (default in Theseus): AES-256-GCM under a key the
  add-on derives from the vault (pithos/credentials/v1, now fixed), so
  there is no extra password; a locked vault raises the PIN prompt first.
  The add-on saves through a native dialog, since the sidebar page has no
  download path.

Only the user name and date stay readable, to tell files apart.
2026-10-03 22:10:00 +02:00
Local Dev
46912a74dd Pithos 0.3.1: plain Next on the account step, confirmed by a checkbox
The account step's button read "I have an account — Next", folding a confirmation into navigation. It is a plain Next now, enabled by an explicit "I have created my Sia Storage account and I am signed in" checkbox (or by choosing your own indexer). Pithos cannot see the sia.storage tab to detect the sign-in itself, and the Connect step proves it anyway: approving needs a signed-in account.
2026-10-03 21:25:24 +02:00
Local Dev
8cd8091bfb Pithos: open from the left edge in Theseus
Registers its panel with side: "left", so Theseus shows it in the quick-links strip beside the web apps instead of the right sidebar. Theseus builds without left panels ignore the field and keep it on the right.
2026-10-03 20:48:54 +02:00
Local Dev
cacbdd571f Pithos 0.3.0: PIN gate and a recovery phrase from the Theseus vault
In Theseus, Pithos now opens only with the vault unlocked: it asks
Theseus for the unlock (api.vault.requestUnlock), and Theseus shows its
own PIN prompt, falling back to the master password after three wrong
tries. Pithos never sees either. When the vault locks (Settings > Lock
now) Pithos locks within a few seconds; the add-on watches from the main
process because a hidden panel's timers run about once a minute.

The guide's phrase step gains "Use my Theseus vault" (the default when a
vault exists): the add-on derives the 12-word phrase from the vault
(purpose path pithos/sia-recovery/v1, first 16 bytes as BIP-39 entropy)
and hands it straight to s3d, so there is nothing to write down and the
vault backup restores storage access. The path is now fixed; changing it
would cut users off from their data.

Needs the vault-derive capability. On a Theseus without requestUnlock it
runs ungated, as before.
2026-10-03 20:42:21 +02:00
Local Dev
b9f7e08ae4 Pithos: guided "Get started" setup that opens the approval page itself
First run now lands on a step-by-step guide instead of the overview:
create a Sia Storage account (link out, Pithos never sees the password),
install s3d, choose or generate the recovery phrase, connect, start the
gateway and create the first access key, with Back/Next on every step.
The connect step opens the indexer's approval page on its own and moves
on as soon as the approval lands; where a browser blocks the pop-up it
says so and makes the button the primary action.

Hosts without node-pty (the Theseus add-on) now fetch the one platform
package they need from the npm registry on first login, pinned to its
published sha512 integrity, so the approval link can be read there too.
The console-window login stays only as the fallback when that fails.
A retry after a failed connect with an existing phrase goes back to the
phrase step: the phrase is not kept, and a blank one would make s3d
generate a new one.
2026-10-03 20:23:42 +02:00
Local Dev
c5d6488b7d Pithos 0.2.0: live in the Theseus sidebar, no loopback address
In Theseus the console opened as a tab at http://127.0.0.1:<port>, a raw
local address in the URL bar. It is now a left-sidebar panel instead,
loading the add-on's own ui/index.html: API calls, uploads and live
events cross the add-on IPC bridge and the add-on forwards them to the
control server with an internal session. Downloads go to Theseus's
download manager through single-use 60-second links. The panel can widen
to full window or open as a tab.

The core gains internalSession() and downloadUrl() for that; web and
desktop hosts keep talking HTTP as before. Grids now shrink to fit, so
narrow hosts never scroll sideways.
2026-10-03 19:34:53 +02:00
Local Dev
b1b46ceea2 Pithos: document the extension update channel
The Theseus add-on ships updates on its own signed channel at navigate.st/bns/theseus.x/extensions/pithos/, so a Pithos fix never needs a Theseus release. 0.1.0 is the first entry.
2026-10-03 19:20:40 +02:00
Local Dev
6b8eeaf82b Pithos: a control panel for s3d, the Sia S3 gateway
s3d is driven entirely by a CLI and a two-route admin API, which keeps
Sia storage out of reach for anyone who does not live in a terminal.
Pithos wraps it: install the pinned s3d release (checksum verified),
start/stop and logs, indexer login, users and access keys, a bucket and
object browser with share links and public-read policies, and the
upload pipeline stats.

One control server (core/) serves one UI (ui/), and three hosts run it:
a web console, an Electron desktop window and a Theseus add-on, so a
feature lands everywhere at once. The server binds loopback, rejects
foreign Host headers, and signs views in with a one-time secret that
becomes a SameSite=Strict cookie. s3d login reads the recovery phrase
with term.ReadPassword, so it is driven through a pty, with a console
window fallback where the pty module is not shipped.
2026-10-03 19:02:50 +02:00