Repository navigation
feat(backup): export everything to one file sealed with the owner's passphrase - #199
Merged
Merged
Conversation
…assphrase backup.export copies the database (VACUUM INTO) and every crew's folder in workspaces_root into a zip, leaving out what Botloft writes again on every start, and seals it: Argon2id turns the passphrase into a key and XChaCha20-Poly1305 in the STREAM construction encrypts it in 64 KiB chunks. Nothing is readable without the passphrase, which is never kept. The app will offer Save as for the file. Spec 14.2.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First part of backups (the owner's plan: a local file first, the same file to the cloud later).
backup.export {passphrase}writes<home>\exports\botloft-YYYY-MM-DD-HHMM.botloft, keeping only the newest. It returns{path, size, manifest}; the app (next part) offers Save as.What goes in
VACUUM INTO).workspaces_root, archived crews included: each bot's memory and rules, attachments,shared.manifest.jsonwith the crews and their bots.What stays out
.botloftand.claude/settings.json.Seal
BOTLOFTBAK, version, Argon2id salt and costs (64 MiB, 3 passes), nonce, then the zip in 64 KiB chunks of XChaCha20-Poly1305 in the STREAM construction.reasonthe app can word:short_passphrase,wrong_passphrase,not_a_backup,newer_backup.New dependencies:
argon2,chacha20poly1305(stream) andzip(deflate only).Spec: new 14.2.
Tests:
tests/backup_export.rs: the file is unreadable without the passphrase; memory, shared files and rules are inside; regenerated files are not; the manifest is there.Next: import (staged, applied on restart, the old data kept aside) and the screen in Settings.