steid

@jamesgill /

steid/README.md
Markdown31.1 KBRendered·Source·Blame·History·Raw
1# Steid
2
3Steid is a version control server that is entirely yours. One tenant, one binary, one
4database, one owner. It is built to be stable, secure, fast and simple, and to do
5nothing else.
6
7**Who it is for.** Anyone who wants their code on a server they control: a solo
8developer, a small team, a company that will not put its source on a shared platform.
9Steid Cloud runs it for you on hardware nobody else touches.
10
11**What it is not.** Not a GitHub clone, not a social network, not a portfolio, not a
12platform. No marketplace, no discover feed, no plugins, no growth loops. Fewer things,
13all of them finished.
14
15The four pillars are promises, not adjectives:
16
171. **Stable.** Upgrades roll back. Backups restore, and are proven to restore.
18 Migrations never lock you out. A new version number should be dull news.
192. **Secure.** Single tenant is the security model: your data shares a process and a
20 disk with nobody. **Private by default** — a new repository is visible to nobody
21 until you say otherwise. Signed webhooks, expiring tokens, no third-party scripts on
22 any page. Scoped tokens are committed, not yet shipped — see
23 [where it is going]#where-it-is-going.
243. **Performant.** One binary, SQLite, git on local disk, server-rendered pages. No page
25 waits on a network call to something else.
264. **Simple.** One binary, one config, one command to back up, one to restore.
27 Everything you can do has one obvious way to do it.
28
29It runs as a single binary with a SQLite database, shells out to `git` for everything
30git-shaped, and is small enough to host on the cheapest VPS you can find.
31
32## What works today
33
34Honestly and only:
35
36- **Identity and sessions.** One user. The instance is claimed on first run with a setup
37 token, then you sign in with a password. There is no registration — see
38 [limitations]#current-limitations.
39- **Organisations.** Every handle at `/{handle}` is one — a person's is the personal
40 organisation created with their account, and `/orgs/new` makes the other kind. An
41 instance may hold several; you own the ones you create.
42- **A home page.** One organisation is what the instance is *for*, and `/` lands there
43 for everyone, signed in or not. It is chosen in the setup wizard, moved from
44 `/{handle}/settings`, or set at boot with `STEID_OWNER_ORG`. An instance that never
45 chose falls back to its only user. Members and roles are not built yet, so an
46 organisation today means "this instance is Acme's", not "these five people are".
47- **Setup in three screens** — claim the instance, say who it is for, and a last screen
48 naming the home page and where to make the first repository. `/auth/setup?token=…`
49 prefills the token, so a claim link can carry it.
50- **The owner's home page at `/{handle}`**, listing the repositories on the instance.
51- **Repositories.** Created through the browser, or imported by cloning a URL. Stored as
52 bare repos on disk and records in SQLite. **Private by default**, public if you say
53 so, renameable, pinnable,
54 archivable, deletable, with a default branch you choose.
55- **Clone and push over HTTPS**, through `git http-backend`, authenticated with personal
56 access tokens over HTTP Basic. Private repositories require a token to clone; public
57 ones are anonymous.
58- **Personal access tokens** — issue with an expiry (30 days, 90, a year, or never), see
59 when each was last used, revoke, at `/{handle}/settings/tokens`.
60- **Browsing** — file tree with a per-file **last-commit column**, file contents with
61 syntax highlighting, commit log, a commit and its **highlighted diff**, a three-dot
62 comparison of two revisions, blame, branches and tags, and the README rendered on the
63 repository page with `#12` and bare shas linked to the issue and commit they name.
64- **A file's own history** at `/{handle}/repos/{name}/log/{rev}/-/{path}`, which
65 **follows renames**, so a file's past does not stop where its name changed.
66- **Markdown files render as documents**, with `?view=source` for the text; headings get
67 ids, so a link to `notes.md#usage` lands on the section it names. Submodule rows link
68 to their upstream at the sha they are pinned to, and symlink rows say where they point.
69- **Code search** over a revision, at `/{handle}/repos/{name}/search`.
70- **Archive download** — `zip` and `tar.gz` of any revision, and of every tag.
71- **Issues** — open, comment, edit, close and reopen, with labels from a palette of
72 eight colours, and filtering by label and state.
73- **Pull requests** — branch to branch inside one repository, with a Conversation, the
74 commits and the changed files under their own tabs, the same labels the issues wear,
75 and a merge box that says whether the branches actually merge before it offers a
76 button. Merge as a merge commit, a fast-forward or a squash, optionally deleting the
77 source branch afterwards; a merge fires the same webhooks a push does, and
78 `Closes #4` in the title or body closes issue 4 and says so on it.
79- **Webhooks** — a signed JSON POST per push, with a delivery log you can page through,
80 redeliver an attempt from, and switch a hook off in.
81- **Atom feeds** — a repository's commits and its issues, and the owner's push activity
82 across repositories, linked from the pages they belong to and autodiscovered.
83- **Every long list pages**, with `?page=N`, clamped to the nearest page that exists
84 rather than refused.
85- **A JSON API** — `/api/me`, `/api/users/{handle}`, `/api/users/{handle}/repos`. Not a
86 separate product; every use case gets a second surface where that makes sense, which is
87 what keeps the use-case layer honest.
88
89Writing (markdown posts), multi-user (members, invitations, registration) and SSH
90transport are **not built yet**. The plan for them is in [`plans/ROADMAP.md`]plans/ROADMAP.md.
91
92## Where it is going
93
94An instance today has exactly one user. The owner half of **owner and members** has
95landed — the owner is a person or an organisation, chosen at setup — and **members** are
96next: the people it works with, with graded permissions. Outsiders will be able to
97**register to file issues and comment**, under strict rate limits and narrow scopes, so
98an instance can take bug reports without becoming a place anyone can do anything. An
99**invisible mode** will put a whole instance behind sign-in, so a business can run its
100Steid unreachable to anonymous visitors.
101
102## Requirements
103
104- Linux, x86_64 or aarch64, with systemd. The releases are built against glibc 2.31, so
105 Debian 11 and Ubuntu 20.04 or newer.
106- **`git` on `PATH`.** Not optional: Steid runs `git init --bare` to create a repository
107 and `git http-backend` to serve every clone and push. One `apt-get install git`.
108 **git 2.38 or newer to merge a pull request from the web** — that is when `git
109 merge-tree --write-tree` arrived, which is how a merge is computed without a working
110 tree; everything else works on any git, and where it is older the merge box says so
111 instead of offering a button. Debian 12 and Ubuntu 22.04 and newer are fine.
112- **A TLS-terminating reverse proxy, and a domain name for it.** Also not optional.
113 Steid speaks plain HTTP — the web framework it is built on (Topcoat 0.5) has no TLS
114 support at all: no rustls, no ACME, no HTTPS listener. And because git authenticates
115 with HTTP Basic, an instance served over plain HTTP leaks your access token to every
116 hop on the network, on every push. The installer sets Caddy up for you.
117- About 100 MB of disk before any repositories, plus whatever you push.
118
119## Install
120
121### One command
122
123```sh
124curl -fsSL https://releases.steid.dev/install.sh | sh -s -- --domain git.example.com
125```
126
127Point the domain's DNS at the machine first, and make sure ports 80 and 443 are open —
128Caddy needs both to obtain a certificate.
129
130Releases live at `https://releases.steid.dev` — the tarball for your architecture and
131its SHA-256 under `/v<version>/`, and this script at the root. `jpgill.dev` mirrors the
132same files at the path it has served since 0.4.0, so older links still work. Installing
133from your own mirror is one variable: `STEID_RELEASE_BASE_URL=https://…` with the same
134`/v<version>/steid-<version>-<target>.tar.gz` layout under it.
135
136That does the following, and nothing else:
137
1381. installs `git`, `curl` and `ca-certificates`
1392. downloads the release tarball for your architecture and **verifies its SHA-256**
1403. unpacks it to `/opt/steid` — the binary with its `assets/` directory beside it
1414. creates a `steid` system user and `/var/lib/steid` for state, owned by it
1425. writes `/etc/steid/steid.env`, and a systemd unit that listens on `127.0.0.1:3000`
1436. installs Caddy and writes a Caddyfile that terminates TLS for your domain and proxies
144 to that loopback port
1457. starts both
146
147Re-run it with a newer `--version` to upgrade. It is idempotent: it replaces the binary
148and assets, leaves `/var/lib/steid` alone, and will not overwrite `/etc/steid/steid.env`
149once it exists — with one exception, `--operator-token`, which is the only setting a
150later run rewrites and only when you pass it.
151
152Options: `--version`, `--port`, `--flavour musl|gnu` (`gnu` is what is built),
153`--owner-email`/`--owner-handle`/`--owner-org`/`--owner-org-name` (below),
154`--operator-token` (see
155[Operator surface]#operator-surface), and `--no-caddy` if you are bringing your own
156proxy. `sh install.sh --help` lists them.
157
158### Scripted install: come up already owned
159
160A fresh instance has no owner, and until someone claims it the setup page is open to
161whoever reaches it first. That is fine when you are watching the install; it is not fine
162when a machine builds itself at three in the morning. Give the installer an owner and
163there is no window at all:
164
165```sh
166sh install.sh --domain git.example.com \
167 --owner-email you@example.com --owner-handle you
168```
169
170It writes `STEID_OWNER_EMAIL` and `STEID_OWNER_HANDLE` into `/etc/steid/steid.env`, and
171the first boot that finds the instance unclaimed creates that owner before serving a
172single request. No setup token is printed, and `/auth/setup` is closed because there is
173nothing left to claim.
174
175Add `--owner-org acme --owner-org-name "Acme Inc"` and the same boot creates the
176organisation, makes that owner its owner, and lands the root of the instance on
177`/acme` — so a provisioned machine arrives as the company's Steid with no wizard at
178all. Without them the root lands on the owner's own page, which is what a one-person
179instance wants.
180
181**That owner has no password**, because there was nobody to choose one: Steid hashes 32
182random bytes it generates at boot and throws away, so every sign-in attempt is refused
183like any other wrong password. The way in is a one-time link minted on the machine:
184
185```sh
186/opt/steid/steid reset-password you
187```
188
189Both flags or neither — half of an owner is a refusal from the installer, and from Steid
190itself at startup, rather than an instance that quietly comes up unclaimed. A handle that
191is reserved or malformed, or a bad email address, also stops the boot with one line
192saying which. They are written only when `/etc/steid/steid.env` is first created, and
193Steid ignores them once an owner exists, so they can stay in the file for the life of the
194instance.
195
196**On piping a URL into a shell.** It is a real trust decision, and "it's convenient" is
197not an answer to it. Download and read it first if you would rather:
198
199```sh
200curl -fsSL https://releases.steid.dev/install.sh -o install.sh
201less install.sh
202sudo sh install.sh --domain git.example.com
203```
204
205Or do it by hand — the manual path below is the same steps, written out.
206
207### Manually
208
209Every command as root, on Debian or Ubuntu. Adjust paths and package manager to taste;
210nothing here is specific to a distribution except `apt-get`.
211
212```sh
213# 1. Prerequisites. git is mandatory — Steid shells out to it for everything.
214apt-get update
215apt-get install -y git curl ca-certificates
216
217# 2. Fetch and verify the release for your architecture.
218VERSION=0.8.1
219TARGET=x86_64-unknown-linux-gnu # or aarch64-unknown-linux-gnu
220BASE=https://releases.steid.dev
221curl -fsSLO "$BASE/v$VERSION/steid-$VERSION-$TARGET.tar.gz"
222curl -fsSLO "$BASE/v$VERSION/steid-$VERSION-$TARGET.tar.gz.sha256"
223sha256sum -c "steid-$VERSION-$TARGET.tar.gz.sha256"
224tar -xzf "steid-$VERSION-$TARGET.tar.gz"
225
226# 3. Install. `assets/` MUST end up beside the binary: at startup Steid walks up
227# from its own executable looking for `assets/manifest.toml`, and exits if it
228# is not there. Moving the binary on its own gives you a program that will not
229# boot.
230mkdir -p /opt/steid
231cp "steid-$VERSION-$TARGET/steid" /opt/steid/steid
232cp -r "steid-$VERSION-$TARGET/assets" /opt/steid/assets
233chmod 755 /opt/steid/steid
234
235# 4. A user to run as, and one directory for all state.
236useradd --system --home-dir /var/lib/steid --shell /usr/sbin/nologin steid
237mkdir -p /var/lib/steid/repos
238chown -R steid:steid /var/lib/steid
239chmod 750 /var/lib/steid
240
241# 5. Configuration.
242mkdir -p /etc/steid
243cat > /etc/steid/steid.env <<'EOF'
244STEID_DATABASE_URL=sqlite:/var/lib/steid/steid.db?mode=rwc
245STEID_DATA_DIR=/var/lib/steid/repos
246HOST=127.0.0.1
247PORT=3000
248EOF
249chmod 640 /etc/steid/steid.env
250chown root:steid /etc/steid/steid.env
251
252# 6. The service. deploy/steid.service in this repo is the file to copy.
253cp deploy/steid.service /etc/systemd/system/steid.service
254systemctl daemon-reload
255systemctl enable --now steid
256
257# 7. The proxy. deploy/Caddyfile is a working starting point — change the
258# hostname on its first line to yours.
259apt-get install -y caddy # or follow https://caddyserver.com/docs/install
260cp deploy/Caddyfile /etc/caddy/Caddyfile
261$EDITOR /etc/caddy/Caddyfile
262systemctl reload caddy
263```
264
265There is **no migration step**. Steid runs its migrations itself on every boot.
266
267## First run: claiming the instance
268
269A fresh instance has no owner. On startup it prints a setup token to its log:
270
271```
272 This steid has no owner yet. Claim it at /auth/setup with:
273
274 <token>
275```
276
277Two things about that token that will bite you otherwise:
278
279- It is printed **only while the instance is unclaimed**. Once you have claimed it, it is
280 never shown again — because it no longer exists.
281- It lives **in memory only**. Every restart mints a new one, and the one in an older log
282 line is dead.
283
284So read it from the current run's journal:
285
286```sh
287journalctl -u steid --no-pager | tail -n 30
288```
289
290Then open `https://git.example.com/auth/setup`, paste it in, and choose your handle and
291password. After that, `/auth/login`.
292
293**Passwords must be at least 12 characters.** That is the only rule — no required digit
294or symbol, because length is the part that measurably helps and composition rules mostly
295make people write theirs down. The same rule applies to a password reset and to changing
296one in settings; accounts created before it keep working until their owner changes them.
297
298### Or have no claim at all
299
300An unattended install can skip this section entirely: `install.sh --owner-email …
301--owner-handle …` creates the owner at first boot, so there is no token, no setup page
302and no window. See [Scripted install]#scripted-install-come-up-already-owned.
303
304### Or set the token yourself
305
306If reading a log line during the first minute of a scripted install is awkward, set the
307token instead and skip the race:
308
309```sh
310STEID_SETUP_TOKEN=$(head -c 32 /dev/urandom | base64)
311```
312
313It is only consulted while the instance is unclaimed, it is never printed, and Steid
314**refuses to start** if it is weak — at least 32 characters, no whitespace, and at least
315eight distinct characters, so `abababab…` is rejected rather than accepted.
316
317## Using it
318
3191. Create a repository at `/{handle}/repos/new`. Public or private.
3202. Issue a personal access token at `/{handle}/settings/tokens`. It is shown once.
3213. Push:
322
323```sh
324git remote add origin https://git.example.com/me/repos/my-project.git
325git push -u origin main
326```
327
328Git will ask for a username and password. The token goes in the **password** field; the
329username is ignored (a token pasted as the username with an empty password also works,
330because people do that).
331
332You only type it once. Git's credential helper stores it and answers every later push —
333which is the whole reason pushing to GitHub feels like it needs no credentials. Use the
334one that keeps secrets in your operating system's keystore:
335
336```sh
337git config --global credential.helper osxkeychain # macOS (usually already set)
338git config --global credential.helper manager # Windows
339git config --global credential.helper libsecret # Linux
340```
341
342**Not `credential.helper store`.** It writes the token in clear text to
343`~/.git-credentials`, and a token is a password that never expires. Steid keeps only a
344hash of it precisely so that a stolen database contains nothing anyone can present;
345storing the plaintext on your laptop hands back what that was protecting.
346
347**Do not put the token in the remote URL** (`https://user:token@host/...`) either. It
348goes into `.git/config` in clear text and shows up in `git remote -v`, in shell history,
349and in any log that records the URL.
350
351Cloning a public repository needs no credentials at all.
352
353## Configuration
354
355Environment variables, read from `/etc/steid/steid.env` by the systemd unit.
356
357| Variable | Default | What it is |
358|---|---|---|
359| `STEID_DATABASE_URL` | `sqlite:steid.db?mode=rwc` | SQLite connection string. The directory must be writable, not just the file — SQLite writes `-wal` and `-shm` siblings. |
360| `STEID_DATA_DIR` | `./data` | Where bare repositories live, as `{data_dir}/{handle}/{name}.git`. |
361| `STEID_INSECURE_COOKIES` | unset (false) | **Never set this in production.** It strips `Secure` from the session cookie so it survives plain-HTTP localhost, and exists only for local development. |
362| `HOST` | `127.0.0.1` in the shipped unit | Bind address. Read by the framework, so deliberately *not* `STEID_`-prefixed. Keep it on loopback; the proxy is the way in. |
363| `PORT` | `3000` | Likewise not `STEID_`-prefixed. |
364| `STEID_TRUSTED_PROXY` | unset (false) | Whether to believe `X-Forwarded-For` / `X-Real-IP` when telling one rate-limited caller from another. `install.sh` sets it `true`, because that install puts Caddy in front. Leave it off for anything serving Steid straight to the internet — see [Operator surface]#operator-surface. |
365| `STEID_OPERATOR_TOKEN` | unset | A bearer token for the operator surface. Unset means that surface does not exist. |
366| `STEID_OWNER_EMAIL` | unset | With `STEID_OWNER_HANDLE`, the owner to create at first boot — see [Scripted install]#scripted-install-come-up-already-owned. Set one without the other and Steid refuses to start. |
367| `STEID_OWNER_HANDLE` | unset | The handle for that owner. Reserved or malformed, and Steid refuses to start rather than serving unclaimed. |
368
369Restart after editing: `systemctl restart steid`.
370
371## Operator surface
372
373Two JSON routes for driving an instance without a browser — a control plane provisioning
374a machine, a monitoring poll, a scripted install. No session, no cookie, no HTML.
375Authenticated by `STEID_OPERATOR_TOKEN` as a bearer token, compared in constant time.
376**With no token configured the surface does not exist**: those calls answer as if
377unauthenticated, and nothing advertises that a token could be set.
378
379Set it at install time so the instance never serves with the surface off:
380
381```sh
382sh install.sh --domain git.example.com \
383 --operator-token "$(openssl rand -hex 32)"
384```
385
386The installer writes it into `/etc/steid/steid.env` before Steid is started, and never
387prints it. This is the one line a later run will rewrite — pass the flag again to rotate
388the token; omit it and the existing line is left alone like every other setting in that
389file. Editing the line by hand works just as well; restart afterwards.
390
391### `GET /api/instance`
392
393Unauthenticated, it answers the one fact that is safe to tell anybody — and the one a
394provisioner needs, so it can wait for a machine to finish booting before handing its owner
395a claim link:
396
397```sh
398$ curl -s https://steid.example.com/api/instance
399{"claimed":false}
400```
401
402With the operator token it adds what the machine is and how big it has become:
403
404```sh
405$ curl -s -H "Authorization: Bearer $STEID_OPERATOR_TOKEN" \
406 https://steid.example.com/api/instance
407{"claimed":true,"version":"0.7.0","git_version":"2.47","merge_supported":true,
408 "repositories":3,"users":1,"uptime_seconds":8421,
409 "disk":{"data_dir_bytes":12884901888,"filesystem_total_bytes":21474836480,
410 "filesystem_free_bytes":8589934592}}
411```
412
413A wrong or missing token is not an error — it is the public answer. `git_version` is
414absent where git could not be run at all, which is the same case that leaves
415`merge_supported` false.
416
417`disk` is the data directory walked — everything under it, whatever it is — plus the
418total and the free space of the filesystem it sits on, so "12 GB of 20 used" is
419arithmetic rather than a second call. Free is what is free to the `steid` user, not
420counting the reserve a filesystem keeps for root. The walk is cached for a minute, so
421polling this every few seconds costs one walk a minute; the whole group is absent where
422the directory could not be read, rather than reported as zero. **It is never on the
423unauthenticated answer**, which stays `{"claimed": …}` and nothing else.
424
425The unauthenticated form is rate limited to 60 calls a minute per caller (600 across
426everyone), which is about one poll a second. The authenticated form is not: a caller
427holding the token has already proved it is the control plane.
428
429### `POST /api/setup`
430
431The claim form, headless. Same rules as the page at `/auth/setup`: the setup token is
432checked before anything is written, a claimed instance cannot be claimed again, and the
433password must be at least 12 characters.
434
435```sh
436$ curl -s -X POST https://steid.example.com/api/setup \
437 -H 'content-type: application/json' \
438 -d '{"setup_token":"…","email":"you@example.com","handle":"you","password":"…"}'
439{"handle":"you"}
440```
441
442201 on success, and **no session** — a control plane is not signing in, so sign in through
443the browser afterwards like anyone else. A password short of the minimum is refused like
444everything else here — the same opaque `404`, with the reason in the server log — because
445a response that named the password would tell a stranger guessing tokens that they had
446guessed one. Every failure is the same `404` with the same
447body, whether the token was wrong or the instance was already claimed: telling those two
448apart would say whether there is still something worth guessing. It shares the sign-in
449rate limit — 10 attempts a minute per caller, 60 across everyone — because it is the same
450secret being attacked.
451
452Pair it with `STEID_SETUP_TOKEN` (see [Or set the token yourself]#or-set-the-token-yourself)
453so the whole install is scriptable: the token goes into the environment, the machine boots,
454`GET /api/instance` says `{"claimed":false}`, and one POST claims it.
455
456### `STEID_TRUSTED_PROXY`
457
458The rate limiters have to tell one caller from another, and the web framework Steid is
459built on (Topcoat 0.5) discards the peer address when it accepts a connection — a handler
460sees request headers and nothing else. So the only thing available is
461`X-Forwarded-For`.
462
463Behind a proxy that is sound: the proxy *appends* the address it accepted the connection
464from, so the rightmost entry is the one the client cannot forge. Exposed directly, nothing
465appends anything, and a caller can invent a fresh header per request to buy itself a fresh
466budget every time.
467
468`STEID_TRUSTED_PROXY` says which situation you are in, and defaults to the safe answer.
469Left off, no header is read at all and every caller shares one window — a forged header
470buys nothing, at the cost of one flood exhausting the shared budget for a minute. Turn it
471on only when something in front of Steid is appending the header; `install.sh` does,
472because it installs Caddy.
473
474## Backup and restore
475
476The entire backup surface is **two paths**:
477
478- `/var/lib/steid/steid.db` — the SQLite database (users, repositories, tokens, sessions)
479- `/var/lib/steid/repos` — the bare git repositories
480
481Which is to say: back up `/var/lib/steid`. `rsync` is enough.
482
483```sh
484systemctl stop steid
485rsync -a /var/lib/steid/ backup-host:/backups/steid/
486systemctl start steid
487```
488
489Stopping first is the honest version: SQLite in WAL mode leaves `-wal` and `-shm` files,
490and copying them while a write is in flight can capture a torn state. If you would rather
491not stop the service, snapshot the database properly and copy the repositories live —
492they are only written during a push:
493
494```sh
495sqlite3 /var/lib/steid/steid.db ".backup '/tmp/steid-backup.db'"
496rsync -a /tmp/steid-backup.db /var/lib/steid/repos backup-host:/backups/steid/
497```
498
499To restore: install Steid as above, stop it, drop both paths back into `/var/lib/steid`,
500`chown -R steid:steid /var/lib/steid`, start it. Migrations run on boot, so a database
501from an older version is brought forward automatically.
502
503### `steid backup` and `steid restore`
504
505Steid can also do both itself, into one file:
506
507```sh
508steid backup /var/backups/steid # a directory: it picks the name
509steid restore /var/backups/steid-0.7.0-20260926T101500Z.tar.gz
510```
511
512The archive holds a manifest, a consistent copy of the database (SQLite's own
513`VACUUM INTO`, so the service may keep running) and the whole data directory. `install.sh
514--backups daily` runs the first of these on a timer.
515
516**`steid restore` refuses an instance that already holds a user or a repository**, so
517pointing it at the wrong machine cannot replace somebody's site with somebody else's.
518That refusal is the default and is not going away.
519
520```sh
521systemctl stop steid
522steid restore --replace /var/backups/steid-0.7.0-20260926T101500Z.tar.gz
523systemctl start steid
524```
525
526`--replace` is the explicit consent to do it anyway: it replaces everything this instance
527holds — database and data directory — with the archive's, whoever is in it. **Stop Steid
528first**; nothing checks, because the data directory is being moved out from under a
529process that serves out of it.
530
531Nothing is deleted. The archive is extracted beside the live tree and swapped in only
532once the whole extraction has succeeded, and what was there is moved to
533`/var/lib/steid/repos/.replaced-<timestamp>/` — repositories and a copy of the old
534database together. It is as large as the instance was and **nothing will ever remove
535it**; the restore prints the path, and deleting it once you have checked the restore is
536yours to do.
537
538## Building from source
539
540```sh
541cargo install topcoat-cli --version 0.5.0 --locked
542topcoat asset bundle --release
543```
544
545**`cargo build --release` on its own is not enough.** It produces a binary that will not
546boot: `AssetBundle::load()` walks up from the executable looking for
547`assets/manifest.toml`, and `build.rs` does not write one. `topcoat asset bundle` runs
548`cargo build` itself and then writes the bundle to `target/assets`. The binary at
549`target/release/steid` needs that directory beside it.
550
551Requires rustc ≥ 1.95 — Topcoat 0.5 demands it, and on an older toolchain `cargo add
552topcoat` silently resolves to an empty `v0.0.0` placeholder instead of failing.
553
554For development, `topcoat dev` does the bundling for you, and a local `.env` with
555`STEID_INSECURE_COOKIES=true` is needed for the session cookie to survive plain-HTTP
556localhost.
557
558### Cutting a release
559
560```sh
561./release.sh --target x86_64-unknown-linux-gnu
562```
563
564Produces `dist/steid-<version>-<target>.tar.gz` and a `.sha256` beside it. The tarball
565extracts to a self-contained directory: the binary, `assets/`, and this README. Building
566a Linux artefact on macOS needs a container (the script uses Docker) or a cross
567toolchain; `--native` builds for the host instead, which is useful for checking the
568artefact layout and not for releasing.
569
570A container image also exists — see [`Dockerfile`]Dockerfile — but the supported
571artefact is the plain binary.
572
573## Current limitations
574
575Deliberately blunt. Steid is early.
576
577- **Single user.** One account, claimed on first run. No members, roles, invitations or
578 registration yet. Issues exist, but only the owner may open or comment on one, which
579 is the same assumption showing.
580- **No TLS of its own.** A reverse proxy is mandatory, not recommended — see
581 [requirements]#requirements.
582- **No encryption at rest.** The database and repositories are plain files. Anyone with
583 the disk has everything. Token *values* are hashed, and passwords are Argon2, but
584 repository contents are not encrypted.
585- **Rate limiting covers `/auth/login`, `/auth/setup`, token authentication on the git
586 routes, archive downloads and code search** — 10 attempts a minute per client for the
587 first two, 60 for git authentication, 10 archives and 20 searches, each with a global
588 backstop. An anonymous clone of a public repository is not limited at all.
589- **Rate limiting keys on forwarded headers, because Topcoat 0.5 does not expose the
590 peer address at all.** Behind a reverse proxy — the supported deployment — that works.
591 Exposed directly to the internet with no proxy, a caller can vary the header and get a
592 fresh budget each time, leaving only the global cap. Run it behind the proxy.
593- **Nothing sweeps expired tokens and nothing warns before one expires.** A token that
594 has expired authenticates exactly like one that never existed, and the tokens page is
595 where you find out.
596- **No CI/CD**, no code review, no SSH transport, no federation. Pull requests exist but
597 are bare: no assignees, reviewers or milestones, and only the owner may open or merge
598 one — the single-user assumption again.
599- **No writing yet** — posts and markdown are the next milestone.
600- **Light mode is half-checked.** The repository landing page, a tree and a blob were
601 looked at and were fine; the owner's home page, the settings pages and the log were not. Either
602 way there is no way for a visitor to choose — the layout is hardcoded dark.
603- **Not battle-tested.** It has not run under load, has not been audited, and has been
604 deployed by approximately one person. Do not put anything irreplaceable in it that is
605 not also somewhere else.
606
607More, in unflattering detail, in [`plans/current.md`]plans/current.md.
608
609## Project layout
610
611`plans/` is the source of truth for intent, not the code:
612
613| File | Holds |
614|---|---|
615| [`plans/ROADMAP.md`]plans/ROADMAP.md | vision, stack, the milestone ladder |
616| [`plans/current.md`]plans/current.md | the active milestone, and every known gap |
617| [`plans/progress.md`]plans/progress.md | what shipped, and the decisions worth not rediscovering |
618| [`plans/architecture.md`]plans/architecture.md | layer rules and conventions |
619| [`plans/decisions/`]plans/decisions/ | ADRs |
620
621The code is a single crate in three layers — `domain`, `application`, `infrastructure` —
622with dependencies pointing inward. Every use case takes an `Actor` and authorizes before
623any side effect.
624
625## Licence
626
627Copyright (C) 2026 James Gill.
628
629Steid is free software under the **GNU Affero General Public License v3.0** — see
630[LICENSE]LICENSE. You may use, modify and redistribute it, including commercially.
631
632The reason for AGPL rather than a permissive licence is section 13: if you modify Steid
633and offer it to others **over a network**, you must make your modified source available
634to those users. Running an unmodified copy — which is what self-hosting is — carries no
635such obligation. In other words: host it for yourself freely, fork it privately for
636yourself freely, but a modified public service has to share what it changed.
637
638Worth being straightforward about what this does *not* do: it does not stop anyone
639running Steid as a commercial hosted service. AGPL is a copyleft licence, not a
640non-compete.
641