Skip to content

feat: Download a backup of the gallery - #81

Merged
mrtncode merged 3 commits into
mrtncode:mainfrom
SirTerrific:pr-backup
Aug 12, 2026
Merged

feat: Download a backup of the gallery#81
mrtncode merged 3 commits into
mrtncode:mainfrom
SirTerrific:pr-backup

Conversation

@SirTerrific

Copy link
Copy Markdown
Contributor

The README asks people to back up before updating but gives them no way to do it, so the only option is copying docker volumes by hand.

GET /api/backup returns a zip holding the uploads and the database, with a button for it in settings.

Two details worth the review:

  • The database goes through sqlite's own backup API, not a file copy, so the archive holds a consistent snapshot even if the app is being used while the backup is taken. A plain copy of a live sqlite file can land mid-write.
  • The archive is built in a temp directory removed by after_this_request, whether the response succeeded or not — one test asserts nothing is left behind.

2 tests added, 27 pass. Frontend typechecks and builds.

Independent of #72#80. Note it adds its own Backup card in settings while #80 adds a Library card; if you take both, they are two adjacent cards — happy to merge them into one on whichever lands second.

🤖 Generated with Claude Code

The README tells people to back up before updating without giving them a way to
do it, which leaves copying docker volumes by hand as the only option.

`GET /api/backup` returns a zip holding the uploads and the database, and
settings has a button for it. The database goes through sqlite's own backup API
rather than a file copy, so the archive holds a consistent snapshot even if the
app is being used while it is taken.

The archive is built in a temporary directory that is removed once the response
has been sent, whether or not it succeeded.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@mrtncode
mrtncode merged commit 0adceaf into mrtncode:main Aug 12, 2026
2 checks passed
@mrtncode

Copy link
Copy Markdown
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants