Skip to content

feat(backup): take nightly backups and restore a whole server - #3397

Merged
Quick104 merged 8 commits into
mainfrom
feat/backups-1-core
Nov 5, 2026
Merged

Quick104 merged 8 commits into
mainfrom
feat/backups-1-core

Conversation

@Quick104

@Quick104 Quick104 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

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.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.
  • Contract and repository checks: verify-apiv2-openapi, -web-types, -fixtures, -contract (additive only), verify-migrations, verify-migration-ledger, verify-size-ratchet, verify-local-paths, verify-settings-bindings: 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.

Evidence

Evidence: https://evidence.siloserver.org/r/silo-server/pr-3397/

Risks

  • 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.

🤖 Generated with Claude Code

Note

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).

Macroscope summarized d078884.

@silo-triage silo-triage Bot added the size/XXXL 3000+ added + deleted lines (all files); change volume, not priority. label Nov 2, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-05T16:18:00.925835Z d078884 New commits
🔒 Security Review ✅ Completed 2026-11-05T16:22:24.721164Z d078884 New commits

Security findings

Advisory findings (39)

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@silo-kody

silo-kody Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

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 settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@macroscopeapp

macroscopeapp Bot commented Nov 2, 2026

Copy link
Copy Markdown

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.

Posted via Macroscope — Visible change evidence

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

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.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review

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.
Admin backup interface
web/src/pages/AdminBackups.tsx, web/src/pages/admin-backups/*, web/src/api/v2/*, web/src/hooks/queries/*, web/src/lib/*, web/src/App.tsx
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.

Estimated code review effort: 5 (Critical) | ~120 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Administrator
  participant AdminBackupAPI
  participant BackupService
  participant BackupDestination
  Administrator->>AdminBackupAPI: request manual backup
  AdminBackupAPI->>BackupService: start backup
  BackupService->>BackupDestination: write dump and blob archive
  BackupService->>BackupDestination: write manifest
Loading

Suggested labels: stacked, needs-review, javascript, api-v2, impact: usability, impact: data-loss, evidence-required

Merge Risk: Moderate · previous review 9de9c

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: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning 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 Passed checks: 4 passed

Check name Status Explanation
Title check Passed 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 Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed 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.

@silo-triage silo-triage Bot added enhancement New feature or request go Pull requests that update go code priority: P2 Limited scope, workaround exists, or polish labels Nov 2, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 83870b6949

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/backup/restore.go Resolved
Comment thread cmd/silo/main.go Fixed
Comment thread cmd/silo/backup_command.go Resolved
Comment thread internal/apiv2/admin_backups.go Resolved
@coderabbitai coderabbitai Bot 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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ Codex Security Review · Automatically triggered

Here are some automated security review suggestions for this pull request.

Reviewed commit: 83870b6949

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security 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.

Comment thread internal/backup/snapshot.go Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4


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: 1b34869c-09c9-4ea4-a9d3-8ce13b3081c5
Commits

Reviewing files that changed from the base of the PR and between 257390b and 83870b6.

Files selected for processing: 80
  • .github/workflows/trusted-linux-ci.yml
  • DEVELOPMENT.md
  • Dockerfile
  • Dockerfile.dev
  • cmd/silo/backup_command.go
  • cmd/silo/backup_redis.go
  • cmd/silo/backup_redis_test.go
  • cmd/silo/backup_wiring.go
  • cmd/silo/main.go
  • contracts/api/v2/openapi.json
  • docs/README.md
  • docs/admin-api.md
  • docs/admin-tasks-api.md
  • docs/architecture/backups.md
  • docs/architecture/blob-storage.md
  • docs/architecture/secret-encryption.md
  • docs/backups-api.md
  • internal/api/router.go
  • internal/api/testdata/media_routes.txt
  • internal/apiv2/admin_backups.go
  • internal/apiv2/admin_backups_test.go
  • internal/apiv2/document.go
  • internal/apiv2/router.go
  • internal/artworkurl/artworkurl.go
  • internal/backup/backup_postgres_test.go
  • internal/backup/backuptest/backuptest.go
  • internal/backup/blobs.go
  • internal/backup/destination.go
  • internal/backup/doc.go
  • internal/backup/downloads.go
  • internal/backup/dump.go
  • internal/backup/journal.go
  • internal/backup/journal_test.go
  • internal/backup/layout.go
  • internal/backup/listing.go
  • internal/backup/lock.go
  • internal/backup/lock_postgres_test.go
  • internal/backup/main_test.go
  • internal/backup/manifest.go
  • internal/backup/manifest_test.go
  • internal/backup/restore.go
  • internal/backup/restore_pg.go
  • internal/backup/rotation.go
  • internal/backup/rotation_test.go
  • internal/backup/service.go
  • internal/backup/settings.go
  • internal/backup/snapshot.go
  • internal/backup/status.go
  • internal/backup/status_test.go
  • internal/backup/storeconfig.go
  • internal/backup/swap.go
  • internal/backup/swap_test.go
  • internal/backup/task.go
  • internal/backup/tools.go
  • internal/branding/assets.go
  • internal/config/admin_settings.go
  • internal/contractledger/ledger_test.go
  • internal/database/migrate.go
  • internal/metadata/artwork_reconcile.go
  • internal/secret/cipher.go
  • internal/secret/cipher_test.go
  • migrations/sql/20261031152156_backup_status.sql
  • migrations/sql/20261101011703_backup_status_last_success.sql
  • scripts/ci/db-contracts.txt
  • web/src/App.tsx
  • web/src/api/v2/adminBackups.ts
  • web/src/api/v2/operations.ts
  • web/src/api/v2/schema.ts
  • web/src/hooks/queries/admin/backups.ts
  • web/src/hooks/queries/keys.ts
  • web/src/lib/adminNavigation.ts
  • web/src/lib/documentTitle.ts
  • web/src/pages/AdminBackups.tsx
  • web/src/pages/admin-backups/BackupSettings.tsx
  • web/src/pages/admin-backups/BackupTable.tsx
  • web/src/pages/admin-backups/BackupWarningDetails.tsx
  • web/src/pages/admin-backups/Disclosure.tsx
  • web/src/pages/admin-backups/backupPresentation.test.ts
  • web/src/pages/admin-backups/backupPresentation.ts
  • web/src/pages/admin-backups/warningDetails.ts
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.

Comment thread internal/apiv2/admin_backups.go Resolved
Comment thread internal/backup/service.go Resolved
Comment thread internal/backup/tools.go Resolved
Comment thread web/src/hooks/queries/admin/backups.ts Resolved
@macroscopeapp

macroscopeapp Bot commented Nov 2, 2026

Copy link
Copy Markdown

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.

Task Case Surface Validated build Reason
silo-server #1225 C1 Web admin 1669 · 5ec82048 The new task adds a Scheduled Tasks row; plugin updater behavior and #3237 are unchanged.
silo-server #1228 C1 Web admin 1144 · 74158b4a Backups appears in the active Server sidebar while configuring Appearance.

Suggested PR body line: Validation tasks: changes #1225 C1; changes #1228 C1

Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed.

Posted via Macroscope — v1 validation impact

@silo-kody

silo-kody Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

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 settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8b3d777eb2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/backup/restore.go Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ Codex Security Review · Automatically triggered

Here are some automated security review suggestions for this pull request.

Reviewed commit: 8b3d777eb2

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security 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.

Comment thread internal/backup/destination.go Resolved
@silo-kody

silo-kody Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

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 settings
Review 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

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


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: 9896c89b-33ef-4b1c-ab30-0bcb5c5b26a2
Commits

Reviewing files that changed from the base of the PR and between 83870b6 and 7bf3b9f.

Files selected for processing: 20
  • cmd/silo/backup_command.go
  • contracts/api/v2/openapi.json
  • docs/admin-api.md
  • docs/architecture/backups.md
  • internal/apiv2/admin_backups.go
  • internal/backup/backup_postgres_test.go
  • internal/backup/destination.go
  • internal/backup/destination_test.go
  • internal/backup/restore.go
  • internal/backup/restore_pg.go
  • internal/backup/service.go
  • internal/backup/storeconfig.go
  • internal/backup/swap_test.go
  • internal/backup/tools.go
  • internal/backup/tools_test.go
  • scripts/ci/db-contracts.txt
  • web/src/api/v2/schema.ts
  • web/src/hooks/queries/admin/backups.ts
  • web/src/pages/admin-backups/BackupSettings.tsx
  • web/src/pages/admin-backups/BackupWarningDetails.tsx
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.

Comment thread web/src/hooks/queries/admin/backups.ts Resolved
@silo-kody

silo-kody Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

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 settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@silo-kody

silo-kody Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

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 settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

Comment thread web/src/hooks/queries/admin/backups.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ Codex Security Review · Automatically triggered

Here are some automated security review suggestions for this pull request.

Reviewed commit: a88bc5aa59

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security 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.

Comment thread internal/backup/settings_classes.go Resolved
@Quick104
Quick104 force-pushed the feat/backups-1-core branch from a88bc5a to e95fa0f Compare November 5, 2026 14:51
@silo-kody

silo-kody Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

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 settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

Comment thread web/src/pages/AdminBackups.tsx Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e95fa0fdd8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Quick104 and others added 8 commits November 5, 2026 11:08
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]>
@Quick104
Quick104 force-pushed the feat/backups-1-core branch from 5985f25 to d078884 Compare November 5, 2026 16:11
@silo-kody

silo-kody Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

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 settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@Quick104
Quick104 merged commit eb9ff65 into main Nov 5, 2026
17 checks passed
@Quick104
Quick104 deleted the feat/backups-1-core branch November 5, 2026 16:13
Comment on lines +159 to +160
case "folder":
return "The command uses the newest backup. ";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kody code-review Bug critical

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.

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ Codex Security Review · Automatically triggered

Here are some automated security review suggestions for this pull request.

Reviewed commit: d07888422d

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security 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.


func readProfileLimits(ctx context.Context, tx pgx.Tx, userID int) (map[string]profileLimits, error) {
rows, err := tx.Query(ctx, `
SELECT p.id, coalesce(p.pin_hash, '') <> '', p.is_primary, p.is_child, coalesce(p.max_content_rating, ''), p.max_advisory_age::int,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ Codex Security Review · Automatically triggered

P2 Badge 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.

Useful? React with 👍 / 👎.

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

Labels

api-v2 API v2 / Huma migration program (epic #135); long-running, stacked by phase enhancement New feature or request evidence-required Needs before-and-after evidence before the Evidence check passes go Pull requests that update go code 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. priority: P2 Limited scope, workaround exists, or polish size/XXXL 3000+ added + deleted lines (all files); change volume, not priority. stacked Base is another open PR; merge in stack order named in the body

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants