Repository navigation
feat(backup): import a backup, swapped in on the next start - #200
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.
backup.stage opens a backup with the passphrase into <home>/restore and checks its manifest and database; backup.confirm marks it, and on the next start, before the database opens, the daemon unpacks it, moves the current database and the whole workspaces_root aside (never deleted), and puts the backup's in place. backup.cancel drops it. A marker is cleared first, so a failing backup is not tried forever. 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.
Second part of backups, stacked on #199: this diff includes its commit until it merges.
Two steps, so nothing changes while Botloft runs.
Stage
backup.stage {path, passphrase}opens the file into<home>\restore\staged.zip.Confirm or cancel
backup.confirmmarks the backup, and the app restarts Botloft.backup.canceldrops it.Swap on start, before the database opens:
restore\unpacked, refusing entries that would land outside it.botloft.db(with-waland-shm) goes to<home>\before-restore\<time>, and the wholeworkspaces_rootto<workspaces_root>-before-restore-<time>. Nothing is deleted.Spec: 14.2.
Test:
tests/backup_restore.rs, exporting from one test daemon and restoring into another folder:Next: the screen in Settings.