feat(store): backups in plain folders, written once (P15 section 9, D-91, D-92)
A backup is a folder holding one folder per set of books, made only of files that are written once: the journal and the access log as immutable segments, an index of stored files and the stored files under their hash, the vault and keys by content hash, and a manifest, written last, that makes a backup complete. It is built beside the git form for now. Accounting reasoning: the journal is append-only and a stored file never changes, so what the store's lock must fix is one look (its length, that its last line is the head, the vault and keys); the rest is read after it. A destination is written only when its newest whole manifest is a point on the live journal (byte-identical prefix); otherwise nothing is written. Two writers cannot corrupt it: pieces are named by what is in them, the manifest number is taken by exclusive create, the loser looks again. A passphrase (D-92) seals every piece with XChaCha20-Poly1305 in 1 MiB chunks, the key derived by Argon2id at the owner passphrase's own cost (64 MiB, 3 passes, 1 lane); names are made from the key and say nothing; the derived key is kept in the book's local/ folder, owner-only. "Save a backup..." is a zip of the same form (.wbbackup). New dependencies: none new to the tree. chacha20poly1305, zeroize and zip (deflate only) were already used by ledger-vault, the viewer and the packages; ledger-store now names them. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
836543694c
commit
9f4529b078
12 files changed
+3827
No files matched your search
@@ -25,6 +25,14 @@ hex = "0.4"
|
||||
getrandom = { version = "0.2", features = ["std"] }
|
||||
subtle = "2"
|
||||
argon2 = "0.6"
|
||||
# A backup protected by a passphrase is sealed as the TIN vault is
|
||||
# (XChaCha20-Poly1305, already in the tree); its key is kept off the
|
||||
# page when this program is done with it (D-92).
|
||||
chacha20poly1305 = "0.11"
|
||||
zeroize = "1"
|
||||
# "Save a backup..." is one file: a zip of the backup's folder form (the
|
||||
# crate the viewer and the packages already use, deflate only).
|
||||
zip = { version = "9.0.1", default-features = false, features = ["deflate"] }
|
||||
|
||||
[target.'cfg(unix)'.dependencies]
|
||||
libc = "0.2"
|
||||
|
||||
Reference in new issue
Block a user