Backup manifest MAC in conventions
Browse files at this commita495c271fcfd8ac5fbd60238ec5560532e57a1b1Parent: dd97953- docs
- backup manifest MAC in conventions
- CLI section matches the binary
2 changed files +8 -6
- docs/architecture.md +5 -4
- docs/conventions.md +3 -2
docs/architecture.mdmodified+5 -4
| @@ -233,10 +233,11 @@ credentials (S3 secret sealed) are Restart settings. | |||
| 233 | 233 | ||
| 234 | ## 11. CLI | 234 | ## 11. CLI |
| 235 | 235 | ||
| 236 | -`in admin backup --out DIR`, `in admin backup-verify SET`, `in admin restore --from SET --data-dir NEW`, | 236 | +A bare `in` (or `in serve`) runs the server. Backups are written by the server's backup worker. |
| 237 | -`in admin export --user <sub|email> --out DIR` (plain tree with real names), `in admin fsck` (every row has | 237 | +`in restore --from SET` replaces the database with a verified set (server stopped; needs the same `in.key`). |
| 238 | -its blob, every blob has a row, sizes and hashes match; `--repair-thumbs`), `in admin audit-purge | 238 | +`in export --member <sub|email> --out DIR` writes a plain tree with real names. `in fsck [--hash]` checks |
| 239 | ---older-than-days N`. | 239 | +that every row has its blob and every blob has a row (sizes, and hashes with `--hash`); it changes nothing. |
| 240 | +`in quota recompute` recomputes used bytes. | ||
| 240 | 241 | ||
| 241 | --- | 242 | --- |
| 242 | 243 | ||
docs/conventions.mdmodified+3 -2
| @@ -61,8 +61,9 @@ tokens, passwords, cookies, or secrets. | |||
| 61 | - Constraints live in the schema (`NOT NULL`, `CHECK`, `UNIQUE`, `REFERENCES ... ON DELETE ...`), not only in Rust. | 61 | - Constraints live in the schema (`NOT NULL`, `CHECK`, `UNIQUE`, `REFERENCES ... ON DELETE ...`), not only in Rust. |
| 62 | - Backups: `snapshot_to(path)` with `VACUUM INTO` on the writer, then checkpoint the copy so it is one | 62 | - Backups: `snapshot_to(path)` with `VACUUM INTO` on the writer, then checkpoint the copy so it is one |
| 63 | self-contained file, then fsync. `admin backup --out DIR` writes the snapshot, the blob tree (where the app | 63 | self-contained file, then fsync. `admin backup --out DIR` writes the snapshot, the blob tree (where the app |
| 64 | - has one) and a `manifest.json` with a sha256 per file. `admin backup-verify SET` checks hashes, | 64 | + has one), a `manifest.json` with a sha256 per file and a `manifest.mac`: HMAC-SHA256 of the manifest bytes |
| 65 | - `integrity_check` and contiguous migrations. Never copy a live DB file. | 65 | + under a subkey of the instance key, which lives outside the backup. Verify and restore check the MAC first |
| 66 | + (constant time), then hashes, `integrity_check` and contiguous migrations. Never copy a live DB file. | ||
| 66 | 67 | ||
| 67 | ## 5. HTTP and pages | 68 | ## 5. HTTP and pages |
| 68 | 69 | ||