Skip to content

feat(backup): keep backups in an S3 bucket, encrypted - #3401

Merged
Quick104 merged 4 commits into
mainfrom
feat/backups-5-s3
Nov 5, 2026
Merged

Quick104 merged 4 commits into
mainfrom
feat/backups-5-s3

Conversation

@Quick104

@Quick104 Quick104 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: #2313
Validation tasks: changes #1197 C1; changes #1235 C1 and C2 (restoring accounts from an encrypted bucket backup or upload is one more path into the same account restore; the admin account-creation and notification flows those cases tested are unchanged, so a re-check after merge is enough)

Backups kept on the server's own disk survive a bad upgrade or a mistake, but
not a failed disk. Admins need to keep them off the server, and a backup in
someone else's storage holds password hashes and watch history, so it must
be encrypted. This adds an S3 destination for backups, whatever storage the
server's artwork uses, and encrypts every backup kept in a bucket.

Stacked on #3400.

Approach

  • Where: a bucket used only for backups (backup.s3.*, with its own
    credentials and a connection test). When a private bucket is configured,
    the existing destination also keeps backups there. One destination at a
    time; switching leaves earlier copies where they are.
  • Encryption: every object in a bucket is age-encrypted with a passphrase
    derived from SECRET_KEY (HKDF, its own label), using scrypt at 2^10 to
    write. Uploads must name a work factor of 2^15 or lower. manifest.json
    stays readable and records the key's check value, never the key. Reads
    check the stored SHA-256 before releasing plaintext. Uploaded restore sets
    are encrypted at rest in a bucket too.
  • Key confirmation: before backups go to a bucket, the admin confirms
    they keep a copy of SECRET_KEY off the server. The page shows a check
    value that silo secret check reproduces, and never shows the key. If
    SECRET_KEY changes, bucket backups pause until the new key is confirmed.
  • Command line: silo backup decrypt, and s3:// sources for
    silo backup restore and verify, with credentials from SILO_BACKUP_S3_*.
    Downloads go to a private working folder with a space check and are
    removed on interrupt. The manifest's MAC is checked before anything is
    fetched, and decrypt refuses an object whose manifest doesn't verify.
    A copy restored with --into gets no backup bucket settings, because it
    keeps the original server's id and would rotate away the original's backups.
    A --blobs-into key prefix must be empty.
  • Untrusted buckets: every listing pages and stops at a cap, and skips
    folders it doesn't need to read, so a bucket full of junk keys can't
    exhaust memory. Every destination deletes a backup's manifest first, and a
    folder whose manifest lists missing objects counts as incomplete.
  • Encrypted uploads: the web dialog uploads an .age restore set and
    lets the server decide. The server reads a file made with its own
    SECRET_KEY and rejects any other with the decrypt command.

Validation

  • Go: gofmt, build, go vet, and changed-line golangci-lint against feat(backup): restore from a backup uploaded from another server #3400's branch: 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, verify-route-inventory: pass.
  • Web: tsc -b, eslint and prettier on changed files, and vitest: pass.
  • Database tests against PostgreSQL 18 with its client tools: the touched packages and every pin in scripts/ci/db-contracts.txt pass, including an encrypted round trip against a fake S3 server and the command line reading from it.
  • On a development sandbox that keeps artwork in S3: the base branch has nowhere to keep backups. With this branch, backups went to the private bucket and then to a separate backup bucket. Every object except manifest.json starts with the age header, the restore set downloads decrypted, and silo backup verify restored a backup straight from the bucket into a scratch database.
  • Against a real S3-compatible bucket: a 15 GB backup was written with every object starting with the age header and only the manifest readable, and a preview decrypted it in 19 s.

Evidence

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

Risks

  • Key loss: losing SECRET_KEY now also loses every backup kept in a
    bucket. docs/architecture/secret-encryption.md says so, and the
    confirmation step asks for an off-server copy.
  • Dependency: adds filippo.io/age v1.3.2.
  • Speed: writing to S3 is slower than local disk. On shared development a
    15 GB backup took 44 minutes against about 8 locally.

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 encrypted backup system with S3 destination, selective restore, and admin UI

  • Adds a full backup subsystem: nightly and manual backups with age encryption, a dedicated S3 destination (see s3destination.go), retention rotation, and a scheduled backup task gated by the backup-enabled setting.
  • Adds selective restore: admins preview a restore set (settings, plugins, libraries, collections, users, home sections) and run a restore as a cancellable admin job with per-item outcomes. Restored values that would widen access keep the stricter live values, and route settings are guarded so a live credential is never sent to a changed endpoint.
  • Adds per-profile backup data types (watch history, ratings, favorites, collections, dismissals, preferences, notifications) behind a shared userdata contract, plus a separate profile export/import feature at your-data.
  • Adds backup upload via multipart S3 parts with temp-space and file-count checks, an S3 setup flow with key acknowledgment, and admin backup pages (list, restore chooser/review/report, uploads) under /admin/backups.
  • Risk: new database migrations create backup_status, backup_uploads, backup_restore_items, backup_restore_followups, and restored-account mapping tables; check migrations/sql for the full list. Docker images now install postgresql-client-18, and the artwork signer refuses keys in the backups namespace, so existing signed URLs for those keys stop verifying.

Macroscope summarized 86774f4.

@silo-triage silo-triage Bot added the size/XXXL 3000+ added + deleted lines (all files); change volume, not priority. label Nov 2, 2026
@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
Walkthrough

This change adds S3 backup destinations and age-encrypted backup objects, with key confirmation required for encrypted backup and upload operations. It adds admin S3 test and key-acknowledgment endpoints, web controls, and CLI support for local or S3 restore, verification, and decryption.

Changes: Encrypted S3 backup and destination handling

Layer / File(s) Summary
Destination selection and encrypted storage
internal/backup/*, internal/secret/*, internal/s3client/*, internal/blobstore/*, internal/config/*, internal/catalog/*, cmd/silo/backup_wiring.go, go.mod
The backup service supports the default operational store and a separately configured S3 destination. Bucket-backed objects are encrypted, use .age names, and require a confirmed key check. Multipart sizing, paginated listings, and manifest-aware deletion are added.
Restore, verification, and decryption
cmd/silo/backup_command.go, internal/backup/restore.go, internal/backup/decrypt.go, internal/backup/downloads.go, internal/backup/selective.go, cmd/silo/*test.go, internal/backup/*test.go
The CLI reads local or S3 sources for restore and verification, and adds decrypt for local or S3 objects. Restore fetches encrypted objects into a private temporary directory. Decryption and restore-set downloads check manifest data and stored-byte checksums.
Encrypted restore uploads
internal/backup/upload.go, web/src/pages/admin-backups/uploadModel.ts, web/src/pages/admin-backups/UploadBackupDialog.tsx, related tests
Bucket-backed upload parts are encrypted. Upload completion decrypts data for validation and hashes the uploaded bytes. The web uploader recognizes age files and provides key-related guidance.
S3 administration and backup interface
internal/api/*, internal/apiv2/*, contracts/api/v2/*, web/src/api/v2/*, web/src/hooks/queries/admin/backups.ts, web/src/pages/AdminBackups.tsx, web/src/pages/admin-backups/*
The admin API adds S3 connectivity testing and key acknowledgment. The page adds destination selection, S3 setup and key-confirmation dialogs, and encrypted restore/download controls. API schemas and documentation describe the new fields, endpoints, and states.

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

Change: Feature

Suggested labels: go, javascript, api-v2, dependencies, needs-review, impact: security, impact: data-loss, impact: usability, impact: compat, evidence-required

Merge Risk: Moderate · previous review 9902e

Backup health reporting can be fooled by a tampered manifest in the bucket, so missing-backup warnings may be hidden. The S3 client can also follow a redirect from HTTPS to plain HTTP. Fix the manifest success accounting before merge. The redirect check and the API doc corrections are small follow-ups.

Security architecture risk: Moderate · up to 9902e

Encryption and administrator-only controls substantially limit exposure. However, remote storage can influence backup-success warnings without authenticating its manifests, and backup traffic inherits a transport policy that permits plaintext HTTP and HTTPS downgrades. Recovery also depends on preserving the original server key.

Retained concerns

  • Medium · security · observed: Remote storage metadata can become trusted backup-success state without manifest authentication. A bucket writer can supply a structurally valid encrypted manifest naming another key, with matching object names and sizes, so MAC verification returns unauthenticated without error. Listing nevertheless advances LastSuccessAt and marks the destination successful, suppressing backup warnings. Timestamp trust existed locally before this PR; remote bucket reachability and the destination-warning decision expand its security significance.
  • Medium · security · observed: The new backup storage boundary inherits optional transport confidentiality. Explicit HTTP endpoints are accepted, and the existing shared redirect policy permits method-preserving HTTPS-to-HTTP redirects. A network observer on an HTTP hop can see plaintext manifests, object identifiers, ciphertext, and signed request material. Encrypted payloads remain protected; an HTTPS downgrade requires a redirect from the contacted endpoint, not merely an unauthenticated network attacker.
Security review details

Security Blast Radius

  • inferred — The relevant data scope is the configured server's backed-up database and files, including sensitive account data, rather than one requesting user's records. Manifest manipulation requires write access to the relevant backup prefix or equivalent control of storage responses. S3 authority is bounded by the configured credential's actual permissions, which were not supplied; no cross-installation or broader IAM authority was established.

Security Findings and Attack Paths

  • observed — A different key-check value bypasses MAC verification without producing a tampering error. With matching listed object sizes, that manifest reaches the success aggregates even though its row is marked unverified. A forged recent or future completion time can suppress the recent-backup warning, and manifest presence suppresses the new destination warning. This does not establish a restore bypass: wrong-key encrypted reads are rejected, and unverified copies cannot replace the newest verified clean copy in retention protection.
  • observed — The two retained transport findings describe related paths through the new backup integration: explicitly configured HTTP and permitted downgrade redirects. HTTP acceptance is documented configuration behavior, not an administrator-authorization bypass. The shared redirect condition predates this PR; its application to backup requests is new. Ciphertext protection limits impact, and the evidence does not prove that captured signatures reveal the secret access key or grant arbitrary S3 operations.

Trust Boundaries and Controls

  • observed — Bucket upload creation and each part write require current key confirmation; parts are encrypted before storage. The API's administrator boundary remains in place. Connection testing reuses a stored secret only when the supplied endpoint and access key match the stored account, limiting redirection of stored signing authority through the test operation.

Resilience and Maintainability Implications

  • observed — Upload completion freezes parts under the subsystem lock and writes outcomes through the lock-owning session. Read failures reopen the upload for retry; interrupted checking is recoverable by later completion, and repeated completion preserves a completed upload. Upload records do not pin an archive-key identity, while encrypted parts are read using the current service key, making preservation of that key important for resuming sessions after restart.

Hardening Proposals

  • proposed — Use authenticated folder state for backup-success aggregates and destination-success decisions, while continuing to display unverified archives separately for operator-directed recovery.
  • proposed — Reject HTTPS-to-HTTP redirects independently of any explicit support for HTTP endpoints on trusted networks. Make insecure endpoint selection conspicuous rather than silently treating encryption at rest as transport protection.
Pre-merge checks: Passed 4 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Docstring Coverage Inconclusive Docstring coverage is 78.91% 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): keep backups in an S3 bucket, encrypted" matches the main change. The changeset adds an S3 backup destination, age encryption of bucket objects, key confirmation, and CLI decr…
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 description states the PR adds an S3 backup destination with age encryption keyed from SECRET_KEY, key confirmation, s3:// sources for restore and verify, and a decrypt subcommand. The changeset i…
Full details: Title check

Explanation

The title "feat(backup): keep backups in an S3 bucket, encrypted" matches the main change. The changeset adds an S3 backup destination, age encryption of bucket objects, key confirmation, and CLI decrypt/s3:// support. It is specific and conventional-commit formatted, and a teammate scanning history would understand the primary change.

Full details: Description check

Explanation

The description states the PR adds an S3 backup destination with age encryption keyed from SECRET_KEY, key confirmation, s3:// sources for restore and verify, and a decrypt subcommand. The changeset implements each of these. The description names specific files and validation steps that match the changed files, so it is clearly related to the changeset.

Full details: Docstring Coverage

Explanation

Docstring coverage is 78.91% 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 128 functions across 62 files. (4 skipped: 3 unsupported, 1 too large.)

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
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: 1bb6322c-a9cb-49e9-b0b6-33869a7c6e9c
Commits

Reviewing files that changed from the base of the PR and between 6ea31c0 and 9902e0f.

Files ignored due to path filters: 1

  • go.sum is excluded by !**/*.sum
Files selected for processing: 13

  • contracts/api/v2/openapi.json
  • docs/architecture/backups.md
  • docs/backups-api.md
  • internal/apiv2/admin_backups.go
  • internal/backup/listing.go
  • internal/backup/manifest.go
  • internal/backup/manifest_test.go
  • internal/backup/rotation.go
  • internal/backup/s3destination_test.go
  • internal/backup/service.go
  • web/src/api/v2/schema.ts
  • web/src/pages/admin-backups/BackupTable.tsx
  • web/src/pages/admin-backups/backupPresentation.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.

@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:24:50.823887Z 1c775de New commits
🔒 Security Review ✅ Completed 2026-11-05T16:31:28.105378Z 1c775de New commits

Security findings

Advisory findings (6)

ℹ️ 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.

@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: 4b8c4ac278

ℹ️ 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/service.go Resolved
@silo-triage silo-triage Bot added enhancement New feature or request priority: P2 Limited scope, workaround exists, or polish 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: 4b8c4ac278

ℹ️ 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/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: 9cce3de354

ℹ️ 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/manifest.go Resolved
@macroscopeapp

macroscopeapp Bot commented Nov 2, 2026

Copy link
Copy Markdown

Major validation impact: this PR adds encryption/decryption to uploaded restore parts, and that reader is used again during selective restore. PR #3400 mapped this path to:

Those recorded passes predate this encrypted-part path and do not demonstrate it. The PR should explain why this previously validated flow changes, and these cases need re-validation after merge.

Validation tasks: none is inaccurate. Suggested line:

Validation tasks: changes #1197 C1; changes #1235 C1 and C2

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

Posted via Macroscope — v1 validation impact

@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: 202c10c4-2a52-40f6-a6c9-c1d533d53304
Commits

Reviewing files that changed from the base of the PR and between b9bbab4 and 9cce3de.

Files ignored due to path filters: 1
  • go.sum is excluded by !**/*.sum
Files selected for processing: 66
  • cmd/silo/backup_command.go
  • cmd/silo/backup_command_test.go
  • cmd/silo/backup_interrupt_test.go
  • cmd/silo/backup_wiring.go
  • cmd/silo/main_test.go
  • contracts/api/v2/breaking-approvals.json
  • contracts/api/v2/openapi.json
  • docs/architecture/backups.md
  • docs/architecture/blob-storage.md
  • docs/architecture/secret-encryption.md
  • docs/backups-api.md
  • go.mod
  • internal/api/handlers/admin.go
  • internal/api/handlers/admin_backup_destination_test.go
  • internal/api/router.go
  • internal/api/testdata/media_routes.txt
  • internal/apiv2/admin_backup_s3.go
  • internal/apiv2/admin_backup_uploads.go
  • internal/apiv2/admin_backups.go
  • internal/apiv2/admin_backups_test.go
  • internal/backup/backup_postgres_test.go
  • internal/backup/destination.go
  • internal/backup/downloads.go
  • internal/backup/dump.go
  • internal/backup/encryption.go
  • internal/backup/encryption_test.go
  • internal/backup/listing.go
  • internal/backup/lock.go
  • internal/backup/manifest.go
  • internal/backup/manifest_test.go
  • internal/backup/restore.go
  • internal/backup/s3destination.go
  • internal/backup/s3destination_test.go
  • internal/backup/selective.go
  • internal/backup/selective_apply_test.go
  • internal/backup/service.go
  • internal/backup/settings.go
  • internal/backup/status_test.go
  • internal/backup/stored.go
  • internal/backup/upload.go
  • internal/backup/upload_postgres_test.go
  • internal/blobstore/s3.go
  • internal/catalog/encrypted_settings_repo.go
  • internal/catalog/encrypted_settings_repo_test.go
  • internal/config/admin_settings.go
  • internal/contractledger/ledger_test.go
  • internal/s3client/client.go
  • internal/s3client/s3test/server.go
  • internal/secret/cipher.go
  • internal/secret/cipher_test.go
  • scripts/ci/db-contracts.txt
  • 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/pages/AdminBackups.tsx
  • web/src/pages/admin-backups/BackupS3Dialogs.tsx
  • web/src/pages/admin-backups/BackupSettings.tsx
  • web/src/pages/admin-backups/BackupTable.tsx
  • web/src/pages/admin-backups/UploadBackupDialog.tsx
  • web/src/pages/admin-backups/backupPresentation.test.ts
  • web/src/pages/admin-backups/backupPresentation.ts
  • web/src/pages/admin-backups/s3SetupModel.test.ts
  • web/src/pages/admin-backups/s3SetupModel.ts
  • web/src/pages/admin-backups/uploadModel.test.ts
  • web/src/pages/admin-backups/uploadModel.ts
Files with no reviewable changes: 2
  • internal/backup/selective_apply_test.go
  • internal/backup/stored.go

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

Comment thread docs/architecture/backups.md Resolved
Comment thread internal/backup/destination.go Resolved
Comment thread web/src/api/v2/adminBackups.ts Resolved
Comment thread web/src/api/v2/adminBackups.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 Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a751c0ec11

ℹ️ 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/destination.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: adb2acade1

ℹ️ 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/s3destination.go Resolved
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

1 similar comment
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@coderabbitai coderabbitai Bot added api-v2 API v2 / Huma migration program (epic #135); long-running, stacked by phase dependencies Pull requests that update a dependency file evidence-required Needs before-and-after evidence before the Evidence check passes go Pull requests that update go code impact: compat Breaks a supported client or server path impact: data-loss User data deleted, corrupted, or unrecoverable impact: security Auth, privacy, or permission boundary 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. labels Nov 3, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

Comment thread internal/backup/rotation.go Resolved
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@Quick104
Quick104 force-pushed the feat/backups-4-upload branch from 3667e7b to 7c04a12 Compare November 4, 2026 17:10

@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: 614b99b1a3

ℹ️ 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/manifest.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: 614b99b1a3

ℹ️ 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/s3destination.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: 1b35d70938

ℹ️ 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/listing_bounded.go Resolved
@Quick104
Quick104 force-pushed the feat/backups-4-upload branch from 9d42e81 to 671c47c Compare November 5, 2026 06:26

@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: 8631c818b2

ℹ️ 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/s3destination.go Resolved
@Quick104
Quick104 force-pushed the feat/backups-4-upload branch from 671c47c to b6f6b1a Compare November 5, 2026 15:19
@Quick104
Quick104 force-pushed the feat/backups-4-upload branch from b6f6b1a to 5d3212d Compare November 5, 2026 16:18
Base automatically changed from feat/backups-4-upload to main November 5, 2026 16:19
Quick104 and others added 4 commits November 5, 2026 11:19
Adds a dedicated S3 bucket as a backup destination, and encrypts every
backup object written to a bucket (the dedicated one or the private
operational bucket) with age under a key derived from SECRET_KEY, once the
admin confirms they keep a copy of the key. `silo backup restore|verify`
read s3:// folders, `silo backup decrypt` decrypts one object, listings of
a bucket are bounded, and folders are deleted manifest first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A restore set encrypted with another server's SECRET_KEY was refused with
the page's advice and decrypt command, then the server's message saying
the same. The dialog now shows the server's message alone for that
rejection, and keeps the page's line, with the server's detail under it,
for the others.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The manifest MAC covers the manifest's JSON encoding, and `encrypted`,
added with encrypted destinations, always encoded, as false for an
unencrypted backup. A manifest written by a build from before it therefore
re-encoded with "encrypted":false, its MAC no longer matched, and every
such backup was refused as tampered: downloads, previews, and full and
selective restores, with no flag to accept it.

`encrypted` is now omitted when false, the only manifest field added since
the first build (the restore set summary and the rest already were).
Unencrypted manifests that builds since then signed with "encrypted":false
must keep verifying too, so the check also tries that encoding when the
manifest's own does not verify. Manifests signed by both kinds of earlier
build, byte for byte, now verify (TestManifestsOfEarlierBuildsStillVerify).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ting reads

The bucket connection test now reads its probe back before deleting it,
so credentials that can write but not read fail the test instead of
taking backups nobody can restore. One listing reads at most 256 MiB of
manifests; past that the remaining folders are unreadable and kept, so a
destination full of large manifests cannot take the process's memory.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@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 16af467 into main Nov 5, 2026
17 checks passed
@Quick104
Quick104 deleted the feat/backups-5-s3 branch November 5, 2026 16:22

@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: 1c775dec4f

ℹ️ 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.

// Manifests are kept while the listing is built. A destination
// holding many large ones, or one a writer filled, must not take
// the process's memory: the rest are unknown, never swept.
if read += manifestObject.Size; read > maxListedManifestBytes {

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: Budget manifests by bytes actually read

Required conditions: backups use S3 and the compatible endpoint is malicious or compromised, or a bucket writer can race listing against reads. This cap trusts the endpoint’s reported Size, but each later GET accepts up to 16 MiB without reconciling actual bytes. Fresh evidence beyond the earlier aggregate-manifest report is that the fix itself relies on attacker-controlled metadata: an endpoint can advertise zero-byte manifests while returning large valid encrypted:true manifests with another key check, which are retained as unverified. With 2,000 folders, scheduled backups or admin listing can retain gigabytes and OOM. Charge the budget from bytes actually read and reject negative or mismatched sizes.

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 dependencies Pull requests that update a dependency file 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: compat Breaks a supported client or server path impact: data-loss User data deleted, corrupted, or unrecoverable impact: security Auth, privacy, or permission boundary 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.

1 participant