You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(backup): take nightly backups and restore a whole server - #3397
Related issue: #2313
Validation tasks: changes #1225 C1 (a Back Up Server row in Scheduled Tasks); changes #1228 C1 (a Backups link in the Server sidebar)
Silo has no backups. docs/release-versioning.md tells administrators to take
and verify one before every upgrade, but Silo gives them no tool for it, and
the runtime image has no PostgreSQL client. A household that loses its disk,
makes a bad change, or hits a failed upgrade has nothing to recover from
unless it set up pg_dump itself.
This is the first of six pull requests for #2313. It adds nightly backups,
on by default and keeping the 7 newest, a Backups page in the admin, and an
offline silo backup restore command that replaces a whole server's database
without destroying the current one first.
Approach
What a backup holds: a pg_dump (custom format, zstd) from one
exported snapshot, plus the files Silo can't fetch again: uploaded artwork,
collection and library images, overlay images, branding, avatars and
downloaded subtitles.
Logs and intro fingerprints are left out by default. manifest.json is
written last and records sizes, checksums, a count of core tables, the
applied migration versions, and a check value of SECRET_KEY. A folder
without a manifest is incomplete and gets swept.
Where: the server's operational store, under backups/<server-id>/<id>/. Every API server must share it.
Coordination: one PostgreSQL advisory lock, held on a connection outside
the pool, covers backup, delete, rotation and the sweep. A backup_status
row, written only by the lock holder, tells every server what is running and
how the last run ended. Rotation never deletes the newest copy without
warnings. Every API server fires the nightly trigger; a successful nightly
records its slot there, and another server firing for the same slot skips,
so one night takes one backup.
Full restore (silo backup restore, Silo stopped everywhere): it
validates everything first, restores into a new database, verifies it, and
then swaps databases. Files it overwrites are kept, and a journal lets --recover finish or undo an interrupted swap. It refuses a backup with a
migration this binary doesn't have, and clears the install's Redis
database afterwards. --into restores somewhere else and leaves the live
install alone. silo backup verify is a restore drill against an empty
database.
Admin page: settings (on or off, start time, copies to keep, what's
included), the list of saved backups with status and download, "Back up
now", and the command for a full restore.
Image: the runtime image gains postgresql-client-18.
Later pull requests add selective restore, accounts, uploads, S3 with
encryption, and the backup before migrations. The design and its invariants
are in docs/architecture/backups.md; the API is in docs/backups-api.md.
Apple and Android need no change: this is admin-only, on the web.
Validation
Go: gofmt, build, go vet, and changed-line golangci-lint against the previous pull request: pass.
Web: tsc -b, eslint and prettier on changed files, and vitest: pass.
verify-route-inventory was not run (it needs Linux with cgo); this pull request adds no legacy routes.
Database tests against PostgreSQL 18: this pull request's 8 contract tests pass, including a full backup → restore round trip that compares tables, files and a decrypted setting.
Each test that runs pg_dump uses a database of its own, so other packages' schema changes can't break a dump.
Run on a development server with a production-size catalog (84 GB database): a backup took about 8 minutes and wrote 15 GB; rotation and the status page behaved as documented.
Migrations:backup_status, and two columns added to it. All only add.
Disk use: on a local destination, backups share the database's disk.
The task checks for 1.5 times the previous backup plus 1 GB free before it
starts. On a large catalog a copy is many gigabytes; shared development's
is about 15 GB.
Connections: a running backup or delete holds one extra PostgreSQL
connection outside the pool, and pg_dump holds another.
Image size: the runtime image grows by the PostgreSQL client.
Checklist
I read and can explain the complete diff.
This pull request addresses one concern.
Each test this pull request adds meets "Decide what to test" in CONTRIBUTING.md.
The Evidence section shows every change a user can see, or says there is none.
AI Disclosure
Harness: T3 Code with Claude Code
Tool(s): Claude Code with subagents; OpenAI Codex CLI for independent review
Model(s): claude-opus-5-5; gpt-6.1-sol (review)
Involvement: Fully AI-generated. The maintainer tested the backups work it came from on a development server; the diff awaits human review.
Adversarial review: gpt-6.1-sol reviewed the backups work read-only in repeated rounds; every finding was fixed or answered before this branch was cut.
Add nightly backup system with full-server restore via silo backup
Adds a backup Service in internal/backup that runs pg_dump and a blob tar nightly at the admin-configured time, keeps a configurable number of copies, and writes backups to a local blob-store destination with owner-only permissions.
Adds restore tooling: silo backup restore / verify CLI subcommands (backup_command.go), an HMAC-authenticated restore journal for crash recovery, a database-rename swap mode, credential and policy carry-over from the live server, signing-key rotation, and post-restore Redis flush.
Backups and restores are serialized by a PostgreSQL advisory lock, with run status persisted in a new singleton backup_status table (migration).
Adds admin API endpoints under /api/v2/admin/backups (list, start, delete, capabilities, signed download links) and an admin Backups UI page with schedule and retention settings.
Manifests are MAC-authenticated with a key derived from SECRET_KEY; key rotation must keep old keys for old backups (see secret-encryption.md).
Risk: the Docker images now install postgresql-client-18 and require pg_dump/pg_restore not older than the server; check tools.go if builds or deployments pin different PostgreSQL versions. Storage-transition copying now excludes the backups namespace (service.go).
The Evidence section says Evidence: (publishing), which is not a published evidence link or attached captures. This PR adds visible admin UI; please attach or publish:
The new Backups page and navigation (web/src/pages/AdminBackups.tsx, web/src/lib/adminNavigation.ts): before-and-after desktop and phone-width web captures of the admin context, with the after showing the page and its settings/list states. Include the surface and build or commit for each capture.
The new backup workflow (web/src/pages/AdminBackups.tsx, web/src/pages/admin-backups/BackupTable.tsx): a short recording of the multi-step interaction, such as starting a backup and opening its download links.
Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness.
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.
No actionable comments were generated in the recent review.
Walkthrough
The pull request adds server backup creation, listing, retention, restore, verification, and recovery. It adds scheduled and administrator-triggered controls, signed backup downloads, an admin page, PostgreSQL 18 client tooling, and related database, storage, test, and documentation changes.
Changes: Backup and restore platform
Layer / File(s)
Summary
Runtime prerequisites and service wiring .github/workflows/*, Dockerfile*, cmd/silo/*, DEVELOPMENT.md
The runtime images and CI install PostgreSQL 18 client tools. Silo adds backup, restore, verify, recovery, and secret-check commands. The server wires the backup service and scheduled task into startup.
Backup creation, storage, and scheduling internal/backup/*, internal/config/*, internal/secret/*, internal/branding/*
The backup service captures database snapshots and referenced blobs, writes a manifest, and supports listing, deletion, status, locking, scheduling, rotation, and incomplete-folder sweeping.
Restore validation, database swap, and recovery internal/backup/*, cmd/silo/backup_*
Restore validates manifests, checksums, archives, migrations, and key checks. Separate restore and verification use target or scratch databases. Live restore uses a journaled database swap with rollback and recovery. The CLI handles Redis cleanup and operator instructions.
Admin API and signed downloads internal/apiv2/*, internal/api/*, internal/artworkurl/*
The v2 API adds backup capabilities, listing, start, delete, download-link creation, and signed object streaming. Router wiring and tests cover administrator access and signature scope.
The web application adds the Backups route, settings, status and retention views, warning details, download and deletion actions, and restore-command guidance.
Database, storage, and documentation support internal/database/*, internal/blobstore/*, internal/storagetransition/*, migrations/sql/*, docs/*, scripts/ci/db-contracts.txt
Database changes add backup status tracking and migration-version discovery. Storage transitions exclude the backup namespace. Documentation, deployment prerequisites, and database contracts describe and support backup and restore behavior.
Backups could expose a database client-key passphrase to local process readers when DATABASE_URL contains sslpassword. Address or consciously accept this before merging; the restore behavior for account passwords is documented and intended.
Security architecture risk: Moderate · up to 9de9c
A successful restore can make an obsolete password valid again and undo account disabling. Exploitation depends on a privileged operator restoring an older backup, but someone who knows an affected account’s old password could then regain its restored permissions. Offline restore requirements and transactional recovery reduce the exposure without preventing this outcome.
Retained concerns
Medium · security · observed: A successful full restore replaces current account authentication and authority state with the backup’s users rows. Someone who knows a password changed after that backup can authenticate again when the restored account and login policy permit it; subsequent disabling or permission reductions can also be undone. Carrying current API keys and omitting old sessions do not prevent creation of a fresh session using the restored password.
Security review details
Security Blast Radius
inferred — The independently exploitable unit is an account whose obsolete password becomes valid after an operator restores the affected deployment. The attacker gains that account’s restored authority, not arbitrary database privileges. If the account is an administrator, that authority can extend to whole-server backup management and download-link creation. No cross-deployment compromise is established.
Security Findings and Attack Paths
observed — The retained password-revival finding is supported by a static path: a password replacement updates users; a later full restore retains the older users snapshot instead of carrying current account authentication state; local authentication checks that restored hash and can issue a new session. The attacker needs the obsolete password and a successful intervening restore, but need not invoke restore or reuse an old session.
Trust Boundaries and Controls
observed — CarryCredentials is an internal restore helper despite its exported Go name; its production callers are restore orchestration, not an unauthenticated HTTP mutation route. Offline privileges, omitted sessions/reset tokens, current bearer-credential carrying, and local-login policy checks are meaningful controls. They do not preserve a password change or disabling decision when the users row itself is restored. The documented password-restoration policy confirms this is intentional rather than removing the security consequence.
Resilience and Maintainability Implications
observed — Transactional credential carrying and journaled swap recovery address partial replacement and repeat recovery. They preserve the original database on pre-commit failure, whereas successful completion deliberately adopts the restored account state. Recovery atomicity and preservation of current authentication authority are therefore separate guarantees.
Hardening Proposals
proposed — Define an explicit account-authority recovery policy: preserve current authentication and revocation state for securely matched accounts during swap restore, or require recovery enrollment before restored accounts can accept external password logins. Treat restoring application data and reactivating historical account authority as distinct decisions.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 74.63% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Title check
The title "feat(backup): take nightly backups and restore a whole server" matches the main change. The changeset adds nightly PostgreSQL backups, a backup admin API and UI, and an offline full-server …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
The pull request description directly matches the changeset. It describes nightly PostgreSQL backups, the admin Backups page and API, offline restore and verification commands, PostgreSQL client insta…
Full details: Title check
Explanation
The title "feat(backup): take nightly backups and restore a whole server" matches the main change. The changeset adds nightly PostgreSQL backups, a backup admin API and UI, and an offline full-server restore command. The title is short and specific, and it uses the conventional commit prefix. It does not mention the verify command, the admin page, or the PostgreSQL client image change, but the author does not need to cover every detail.
Full details: Description check
Explanation
The pull request description directly matches the changeset. It describes nightly PostgreSQL backups, the admin Backups page and API, offline restore and verification commands, PostgreSQL client installation, migrations, tests, validation, and risks.
Full details: Docstring Coverage
Explanation
Docstring coverage is 74.63% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 201 functions across 60 files. (2 skipped: 2 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Finishing Touches
Generate docstrings
Commit to this branch
Create a new PR
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Tip
🎯 Customize your risk assessments
Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.
✅ Automatic approvals, with your rules
Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: cb590cd4-4c18-4297-a8a5-188d75a953e7
Commits
Reviewing files that changed from the base of the PR and between 7b5e2a1 and 9de9c80.
Files selected for processing: 6
docs/architecture/backups.md
internal/backup/backup_postgres_test.go
internal/backup/credentials.go
internal/backup/restore.go
internal/backup/snapshot.go
scripts/ci/db-contracts.txt
Files skipped from review as they are similar to previous changes: 1
internal/backup/restore.go
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.
coderabbitaiBot
added
api-v2
API v2 / Huma migration program (epic #135); long-running, stacked by phase
evidence-required
Needs before-and-after evidence before the Evidence check passes
impact: data-loss
User data deleted, corrupted, or unrecoverable
impact: usability
Core flow broken or severely blocked
javascript
Pull requests that update javascript code
needs-review
Needs maintainer review to resolve uncertain classification, scope, or changed evidence.
stacked
Base is another open PR; merge in stack order named in the body
labels
Nov 2, 2026
A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
Files not fully reviewed because their changes were unavailable: 2
contracts/api/v2/openapi.json
web/src/api/v2/schema.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
Minor UI changes: this PR adds a Backups link to the shared Configure > Server sidebar and registers a visible Back Up Server row in Scheduled Tasks. These affect the admin paths used by #1228 C1 and #1225 C1; the tested workflows remain available. The plugin updater path is unchanged, so this does not address #3237. Please re-check these cases after merge.
A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.
Reviewing changes in Silo
Include the related issue, expected behavior, and validation steps in the PR description.
For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
Follow this repository's AGENTS.md and CONTRIBUTING.md.
Request another review with @kody start-review in a PR comment.
React with 👍 or 👎 to give feedback on individual suggestions.
Review settingsReview Options
The following review options are enabled or disabled:
Options
Enabled
Bug
✅
Performance
✅
Security
✅
Business Logic
❌
⚠️ 4 Kody Rule(s) were not evaluated
These rules declare that they need repository context beyond this diff, and the review could not retrieve it, so they were not judged on this pull request:
Preserve optional store capabilities through production wrappers
Detach mandatory cleanup from request cancellation and bound its lifetime
Preserve durable media identity and share identity-evidence precedence
Bound decoder throughput trades and share direct-play eligibility
Files skipped from review as they are similar to previous changes: 1
docs/architecture/backups.md
Files not fully reviewed because their changes were unavailable: 2
contracts/api/v2/openapi.json
web/src/api/v2/schema.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
Adds the backup subsystem: nightly and manual backups of the database
(pg_dump), the files Silo stores, and a manifest signed with SECRET_KEY,
written to the operational store with rotation and a sweep of incomplete
folders under a cluster-wide lock; the Backups page and its v2 API; and
`silo backup restore|verify` for a full restore, either swapping the live
database with a MAC-chained journal for recovery or restoring into a
separate database, keeping the live server's credentials, server-specific
settings, and stricter switches.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
"Kept 1 security switches" now reads "Kept 1 security switch". A swap
that wrote no files (a database-only restore, such as the before-upgrade
copy) no longer names an overwritten-files folder or a step that copies
files back; it keeps only the database steps.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…he list
A backup missing more than 10,000 files listed only the first 10,000 and
the page counted those. The list now carries missing_blobs_total, and the
page says how many were missing and that the first 10,000 are listed.
The Backups page stopped reading the list once nothing ran, so a nightly
backup, or one another server started, did not appear until a reload. It
now reads it every 30 seconds while the page is visible.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
main added page_sections.web_only. A full restore brings back the backup's
value like the section's other presentation switches.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A full restore kept only metadata_ai.enabled at the stricter of the backup
and the live value, so a backup with metadata_ai.on_view on brought back
translation when a viewer opens a title that the admin had turned off.
on_view, the AI service tier, and the per-user transcription quota and its
window are now stricter-of settings: a restore never turns on, or widens,
what spends on an outside AI provider.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
While a backup runs, the Backups page polls the listing every 3 seconds,
and each listing read and parsed every backup's manifest from the
destination: on S3, one GET per backup per poll.
A completed manifest is never rewritten, so the service now keeps the
manifests the listing read and checked, keyed by destination and location,
and reads one again only when the listing reports another size,
modification time, or ETag. Failed and tampered reads are not kept, so a
manifest that becomes readable shows on the next poll; entries of folders
no longer listed are dropped, and the cache holds at most 32 MiB.
Rotation, the sweep, and a backup's own checks still read every manifest.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Changed-line lint (goconst) flagged the setting keys and values the
stricter-of rows repeat in their tests.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…st a verified backup
Profiles are keyed by account and id, so the allowed-libraries lookup now
matches both; another account's profile with the same id could hide a
narrowed library list. The page's full-restore command names the newest
verified backup, since it restores without --accept-lost-credentials.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The reason will be displayed to describe this comment to others. Learn more.
Restore hint misidentifies an older verified backup as the newest
Revises an earlier Kody suggestion on web/src/pages/AdminBackups.tsx:125 (2026-11-05 14:53 UTC).
An administrator could restore older data than intended when a newer backup is unverified. Identify the selected backup by its timestamp and explain that newer unverified copies were skipped.
Prompt for LLM
File web/src/pages/admin-backups/BackupSettings.tsx, lines 159-160:
**Revises an earlier Kody suggestion** on `web/src/pages/AdminBackups.tsx:125` (2026-11-05 14:53 UTC).
Restore hint misidentifies an older verified backup as the newest
When a newer backup is unverified, the command selects an older verified copy, but this hint calls it the newest; an administrator can consequently replace the server with older data than intended. Identify the selected backup by its timestamp and explain that newer unverified copies were skipped.
A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
Security: Drop carried identities when a profile PIN changes
Required conditions: a same-deployment full restore uses a snapshot from before a primary-profile PIN rotation, and an attacker retains an unscoped live API key or linked external identity plus the old PIN. This query records only whether pin_hash is nonempty, so different PINs compare equal and the current identity is carried while the profile rolls back. The attacker can authenticate, verify the restored PIN, mint a fresh profile token, and regain household-manager authority to loosen child restrictions. Fresh evidence beyond the earlier PIN-presence fix is that changes between two nonempty hashes remain invisible. Compare the PIN credential/revision, or drop identities on any change.
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
api-v2API v2 / Huma migration program (epic #135); long-running, stacked by phaseenhancementNew feature or requestevidence-requiredNeeds before-and-after evidence before the Evidence check passesgoPull requests that update go codeimpact: data-lossUser data deleted, corrupted, or unrecoverableimpact: usabilityCore flow broken or severely blockedjavascriptPull requests that update javascript codeneeds-reviewNeeds maintainer review to resolve uncertain classification, scope, or changed evidence.priority: P2Limited scope, workaround exists, or polishsize/XXXL3000+ added + deleted lines (all files); change volume, not priority.stackedBase is another open PR; merge in stack order named in the body
2 participants
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.
Problem
Related issue: #2313
Validation tasks: changes #1225 C1 (a Back Up Server row in Scheduled Tasks); changes #1228 C1 (a Backups link in the Server sidebar)
Silo has no backups.
docs/release-versioning.mdtells administrators to takeand verify one before every upgrade, but Silo gives them no tool for it, and
the runtime image has no PostgreSQL client. A household that loses its disk,
makes a bad change, or hits a failed upgrade has nothing to recover from
unless it set up
pg_dumpitself.This is the first of six pull requests for #2313. It adds nightly backups,
on by default and keeping the 7 newest, a Backups page in the admin, and an
offline
silo backup restorecommand that replaces a whole server's databasewithout destroying the current one first.
Approach
pg_dump(custom format, zstd) from oneexported snapshot, plus the files Silo can't fetch again: uploaded artwork,
collection and library images, overlay images, branding, avatars and
downloaded subtitles.
Logs and intro fingerprints are left out by default.
manifest.jsoniswritten last and records sizes, checksums, a count of core tables, the
applied migration versions, and a check value of
SECRET_KEY. A folderwithout a manifest is incomplete and gets swept.
backups/<server-id>/<id>/. Every API server must share it.the pool, covers backup, delete, rotation and the sweep. A
backup_statusrow, written only by the lock holder, tells every server what is running and
how the last run ended. Rotation never deletes the newest copy without
warnings. Every API server fires the nightly trigger; a successful nightly
records its slot there, and another server firing for the same slot skips,
so one night takes one backup.
silo backup restore, Silo stopped everywhere): itvalidates everything first, restores into a new database, verifies it, and
then swaps databases. Files it overwrites are kept, and a journal lets
--recoverfinish or undo an interrupted swap. It refuses a backup with amigration this binary doesn't have, and clears the install's Redis
database afterwards.
--intorestores somewhere else and leaves the liveinstall alone.
silo backup verifyis a restore drill against an emptydatabase.
included), the list of saved backups with status and download, "Back up
now", and the command for a full restore.
postgresql-client-18.Later pull requests add selective restore, accounts, uploads, S3 with
encryption, and the backup before migrations. The design and its invariants
are in
docs/architecture/backups.md; the API is indocs/backups-api.md.Apple and Android need no change: this is admin-only, on the web.
Validation
go vet, and changed-line golangci-lint against the previous pull request: pass.verify-apiv2-openapi,-web-types,-fixtures,-contract(additive only),verify-migrations,verify-migration-ledger,verify-size-ratchet,verify-local-paths,verify-settings-bindings: pass.tsc -b, eslint and prettier on changed files, and vitest: pass.verify-route-inventorywas not run (it needs Linux with cgo); this pull request adds no legacy routes.pg_dumpuses a database of its own, so other packages' schema changes can't break a dump.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/pr-3397/
Risks
backup_status, and two columns added to it. All only add.The task checks for 1.5 times the previous backup plus 1 GB free before it
starts. On a large catalog a copy is many gigabytes; shared development's
is about 15 GB.
connection outside the pool, and
pg_dumpholds another.Checklist
AI Disclosure
🤖 Generated with Claude Code
Note
Add nightly backup system with full-server restore via
silo backupServicein internal/backup that runspg_dumpand a blob tar nightly at the admin-configured time, keeps a configurable number of copies, and writes backups to a local blob-store destination with owner-only permissions.silo backup restore/verifyCLI subcommands (backup_command.go), an HMAC-authenticated restore journal for crash recovery, a database-rename swap mode, credential and policy carry-over from the live server, signing-key rotation, and post-restore Redis flush.backup_statustable (migration)./api/v2/admin/backups(list, start, delete, capabilities, signed download links) and an admin Backups UI page with schedule and retention settings.SECRET_KEY; key rotation must keep old keys for old backups (see secret-encryption.md).postgresql-client-18and requirepg_dump/pg_restorenot older than the server; check tools.go if builds or deployments pin different PostgreSQL versions. Storage-transition copying now excludes the backups namespace (service.go).Macroscope summarized d078884.