From a495c271fcfd8ac5fbd60238ec5560532e57a1b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Wed, 28 Oct 2026 11:40:48 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20docs:=20backup=20manifest=20MAC?= =?UTF-8?q?=20in=20conventions;=20CLI=20section=20matches=20the=20binary?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/architecture.md | 9 +++++---- docs/conventions.md | 5 +++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/architecture.md b/docs/architecture.md index 6beec52..65f1368 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -233,10 +233,11 @@ credentials (S3 secret sealed) are Restart settings. ## 11. CLI -`in admin backup --out DIR`, `in admin backup-verify SET`, `in admin restore --from SET --data-dir NEW`, -`in admin export --user --out DIR` (plain tree with real names), `in admin fsck` (every row has -its blob, every blob has a row, sizes and hashes match; `--repair-thumbs`), `in admin audit-purge ---older-than-days N`. +A bare `in` (or `in serve`) runs the server. Backups are written by the server's backup worker. +`in restore --from SET` replaces the database with a verified set (server stopped; needs the same `in.key`). +`in export --member --out DIR` writes a plain tree with real names. `in fsck [--hash]` checks +that every row has its blob and every blob has a row (sizes, and hashes with `--hash`); it changes nothing. +`in quota recompute` recomputes used bytes. --- diff --git a/docs/conventions.md b/docs/conventions.md index 12c49e4..eed1b03 100644 --- a/docs/conventions.md +++ b/docs/conventions.md @@ -61,8 +61,9 @@ tokens, passwords, cookies, or secrets. - Constraints live in the schema (`NOT NULL`, `CHECK`, `UNIQUE`, `REFERENCES ... ON DELETE ...`), not only in Rust. - Backups: `snapshot_to(path)` with `VACUUM INTO` on the writer, then checkpoint the copy so it is one self-contained file, then fsync. `admin backup --out DIR` writes the snapshot, the blob tree (where the app - has one) and a `manifest.json` with a sha256 per file. `admin backup-verify SET` checks hashes, - `integrity_check` and contiguous migrations. Never copy a live DB file. + has one), a `manifest.json` with a sha256 per file and a `manifest.mac`: HMAC-SHA256 of the manifest bytes + under a subkey of the instance key, which lives outside the backup. Verify and restore check the MAC first + (constant time), then hashes, `integrity_check` and contiguous migrations. Never copy a live DB file. ## 5. HTTP and pages