Backups sind nun möglich #issue/27 #34

Merged
lrsauvette merged 1 commit from issue/27 into develop 2026-07-31 22:32:32 +00:00
Owner
No description provided.
Adds a round-trippable backup of the entire app data directory to
a single .zip file, exposed in the existing 'Import / Export'
section of the Einstellungen page.

Backup layout (inside the .zip):
- manifest.json     format version, app identifier, UTC timestamp
- data/             every JSON key from the JsonStore
- antraege/         Antrag attachment directories
- vorlagen/         user-added ODT templates

Import replaces the three subdirectories in-place — anything not
present in the archive is deleted — so the user-visible state is
fully recreated. A destructive red confirm dialog gates the
import, and the success snackbar reminds the user to restart
the app.

Safety:
- formatVersion check on import so future schema changes can
  refuse old backups cleanly (with no data loss, since the
  delete-then-write only happens after the manifest validates).
- Path-traversal check: a resolved output path must live inside
  the intended subdirectory (data/, antraege/, vorlagen/);
  anything that escapes is rejected with a BackupException.
- Files with a top-level segment outside the three allowed
  directories are silently ignored.

Platform: export/import require a real filesystem, so the two
buttons display an unsupported-platform snackbar on web/Android/
iOS (the existing CSV export uses the same guard).

Tests (8 new): export counts, full roundtrip preserves data and
deletes leftovers, missing-file error, missing-manifest error,
wrong-format-version error, files outside allowed dirs ignored,
path-traversal inside allowed dirs rejected.
lrsauvette merged commit 043062437e into develop 2026-07-31 22:32:32 +00:00
lrsauvette deleted branch issue/27 2026-07-31 22:32:37 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lrsauvette/sv-helfer!34
No description provided.