Skip to content

feat(selfhost): warn loudly at boot when SQLite has no acknowledged backup - #1488

Merged
JSONbored merged 1 commit into
mainfrom
claude/sqlite-backup-advisory
Jun 26, 2026
Merged

feat(selfhost): warn loudly at boot when SQLite has no acknowledged backup#1488
JSONbored merged 1 commit into
mainfrom
claude/sqlite-backup-advisory

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

A single SQLite file with no backup is a data-loss SPOF — yet /ready still answers 200, so an operator can run with zero durability believing they're healthy.

At boot the container now logs a loud selfhost_backup_advisory warning when on the SQLite backend without BACKUP_ACKNOWLEDGED=true, pointing to the Litestream sidecar setup. Wire a backup, then set BACKUP_ACKNOWLEDGED=true to silence it. Postgres backends skip the warning (back up Postgres instead). The advisory is a pure, tested helper (sqliteBackupAdvisory) in health.ts; the bootstrap wiring is in the codecov-ignored server.ts; the docs §6 backup section is hardened to call this out.

Validation

  • npm run typecheck; npm run test:coverage — full suite green; helper 100% covered (SQLite+no-ack → warn; acknowledged → null; Postgres → null).

Roadmap item #8 (data safety). Note: actively verifying Litestream replication from the container would couple to Litestream's metrics endpoint; the loud boot advisory + docs is the honest, dependency-free guardrail.

…ackup

A single SQLite file with no backup is a data-loss SPOF, yet /ready still answers
200 — so an operator can run with zero durability believing they're healthy. At
boot the container now logs a loud selfhost_backup_advisory warning when on SQLite
without BACKUP_ACKNOWLEDGED=true, pointing to the Litestream setup. Set it after
wiring a backup to silence it; Postgres backends skip the warning. The advisory
logic is a pure, tested helper; the docs §6 backup section is hardened.
@dosubot dosubot Bot added the size:S label Jun 26, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.44%. Comparing base (95fe9a4) to head (cda8ee7).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1488   +/-   ##
=======================================
  Coverage   95.44%   95.44%           
=======================================
  Files         194      194           
  Lines       21078    21080    +2     
  Branches     7625     7626    +1     
=======================================
+ Hits        20118    20120    +2     
  Misses        383      383           
  Partials      577      577           
Files with missing lines Coverage Δ
src/selfhost/health.ts 94.11% <100.00%> (+0.78%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JSONbored
JSONbored merged commit e39566a into main Jun 26, 2026
19 checks passed
@JSONbored
JSONbored deleted the claude/sqlite-backup-advisory branch June 26, 2026 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant