silo
An S3 storage manager for Urbit. silo is a frontend-only app: it is served as a glob by docket and talks to the %storage agent that ships with %landscape.
The glob is hosted over Ames by ~donmec-sallud. To install, run |install ~donmec-sallud %silo in dojo. shelf.iko.soy lists all the apps ~donmec-sallud offers.
Desk
desk/ contains only the docket file, the (empty) bill and the kelvin. The desk you install also needs the marks for these files. nix build produces a complete desk by layering desk/ on top of urbit's base-dev (pinned to 408k-2) and landscape's desk-dev. The result is in ./result.
The app icon is inlined into desk/desk.docket-0 as a base64 data: URI of ui/src/assets/favicon.svg. If you change the icon, regenerate it with:
echo "data:image/svg+xml;base64,$(base64 < ui/src/assets/favicon.svg | tr -d '\n')"
UI
silo is built using React, TypeScript and Tailwind CSS. Vite bundles the app for distribution and provides a dev server.
Getting started
Run nix develop (or install Node 22, see ui/.nvmrc), then npm install inside ui/.
To develop you need a running ship to point to. Create ui/.env.local (it isn't committed) containing VITE_SHIP_URL={URL}, where {URL} is your ship's URL (the default is http://localhost:8080). Then run npm run dev and open /apps/silo/. The dev server proxies everything except the interface to the ship, so you see live data, and hot-reloads code changes.
Building with Nix
| Command | Output |
|---|---|
nix build | the desk to install |
nix build .#glob | the glob folder to upload through docket's globulator |
The frontend build is reproducible: the same source produces byte-identical files across rebuilds and across platforms (checked on aarch64- and x86_64-darwin). npm dependencies come from ui/package-lock.json and toolchain versions are pinned in flake.lock. The glob hash then depends only on the source and on the file types your browser reports during upload, so use the same browser each time.
Publishing
On ~donmec-sallud:
- The first time, create and mount the desk in dojo:
|new-desk %silothen|mount %silo. - Build the desk and sync it into the pier, then commit it:
Runnix build rsync -rL --delete --chmod=u+w result/ ~/donmec-sallud/silo/|commit %siloin dojo. The first time, also run|install our %silo. Docket will reportawaiting manual glob for %silo desk. - Build the glob with
nix build .#glob -o result-glob. Openhttps://{ship-url}/docket/upload, select thesilodesk and theresult-globfolder, then press "glob!". Docket hashes the glob and writes the newglob-ames+[~donmec-sallud 0v...]line into the desk'sdesk.docket-0. - Copy that line from
~/donmec-sallud/silo/desk.docket-0intodesk/desk.docket-0in this repo and commit it.
Step 4 matters. If you later commit a desk whose glob hash differs from the one ~donmec-sallud is hosting, docket drops the hosted glob and you have to upload it again. You only need to re-upload when the UI changes.
Changes from the previous setup
- Nix flake.
flake.nixreplaces the manual globbing steps and the GitHub Actions workflow (removed). The workflow built the UI, globbed it on a throwaway fakezod, uploaded it to DigitalOcean Spaces and deployed to~nocsyx-lassul. - Glob hosting. The docket now points to
glob-ames+[~donmec-sallud ...]instead ofglob-httpon DigitalOcean Spaces. - Reproducible minification.
ui/vite.config.tsminifies with terser instead of esbuild. esbuild 0.14 (the version vite 2 requires) assigns minified names nondeterministically in some code, so two builds of the same source could produce different globs. That was fixed in esbuild 0.15.8, which vite 2 can't use. - App icon. The docket file previously had no
image. The icon is now inlined as adata:URI, so it needs no hosting. - Node version.
ui/.nvmrcnow says Node 22, matching the Nix build. It was 18.16.0.