feat(selfhost): warn loudly at boot when SQLite has no acknowledged backup - #1488
Merged
Conversation
…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.
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. 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
🚀 New features to boost your workflow:
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
A single SQLite file with no backup is a data-loss SPOF — yet
/readystill answers200, so an operator can run with zero durability believing they're healthy.At boot the container now logs a loud
selfhost_backup_advisorywarning when on the SQLite backend withoutBACKUP_ACKNOWLEDGED=true, pointing to the Litestream sidecar setup. Wire a backup, then setBACKUP_ACKNOWLEDGED=trueto silence it. Postgres backends skip the warning (back up Postgres instead). The advisory is a pure, tested helper (sqliteBackupAdvisory) inhealth.ts; the bootstrap wiring is in the codecov-ignoredserver.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.