backup failure notifier via healthchecks.io (opt-in) - #15
Merged
Conversation
ping a healthchecks.io-style URL on /start (after pre-flight), success (bare URL, after the off-box block), and /fail (via an EXIT trap) when BACKUP_HEALTHCHECK_URL is set — default-off, backwards-compatible like BACKUP_REMOTE. passive dead-man's switch: the service alerts on both code-level failures and total no-shows (cron didn't fire / box is off). curl errors are non-fatal so a notifier outage can't fail a good backup, and the URL is treated as a credential — never echoed to logs. 7 offline tests + DEPLOY.md §9.2 setup walkthrough.
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.
scripts/backup_db.sh's failure modes were silent — a stuck docker daemon, a credentialed-out R2 token, or a missed cron tick just sat in backup.log until tailed. The script now pings a healthchecks.io-style URL on /start (after pre-flight), the bare URL on success (after the off-box block, if any), and /fail via an EXIT trap when BACKUP_HEALTHCHECK_URL is set (default off, backwards-compatible like BACKUP_REMOTE) — a passive dead-man's switch, so the service alerts on both code-level failures and total no-shows where nothing pings at all. curl errors are non-fatal so a notifier outage can't fail an otherwise-good backup, and the URL is treated as a credential that never lands in logs. 7 new offline tests + a DEPLOY.md §9.2 setup walkthrough; offline suite 255 passed / 40 skipped.