Skip to content

feat(backup): export everything to one file sealed with the owner's passphrase - #199

Merged
httpsphl merged 1 commit into
mainfrom
feat/backup-export
Oct 5, 2026
Merged

httpsphl merged 1 commit into
mainfrom
feat/backup-export

Conversation

@httpsphl

@httpsphl httpsphl commented Oct 5, 2026

Copy link
Copy Markdown
Owner

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

  • A consistent copy of the database (VACUUM INTO).
  • Every crew's folder in workspaces_root, archived crews included: each bot's memory and rules, attachments, shared.
  • A manifest.json with the crews and their bots.

What stays out

  • What Botloft writes again on every start: .botloft and .claude/settings.json.
  • Secrets, logs and the bots' browser profiles.
  • Work folders the owner chose outside Botloft. The manifest lists them.

Seal

  • Layout: 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.
  • A wrong passphrase, a cut file or reordered chunks do not open.
  • The passphrase needs at least 8 characters and is never stored or logged.
  • Errors carry a reason the app can word: short_passphrase, wrong_passphrase, not_a_backup, newer_backup.

New dependencies: argon2, chacha20poly1305 (stream) and zip (deflate only).

Spec: new 14.2.

Tests:

  • Seal round trip at chunk edges; wrong passphrase, cut file and not-a-backup are refused.
  • 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.

…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.
@httpsphl
httpsphl enabled auto-merge October 5, 2026 17:37
@httpsphl
httpsphl merged commit 53611db into main Oct 5, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant