Skip to content

Health check: only alert when down, and stay quiet when powered off - #24

Merged
OpenSource-For-Freedom merged 1 commit into
mainfrom
fix/health-quiet-when-up
Aug 15, 2026
Merged

Health check: only alert when down, and stay quiet when powered off#24
OpenSource-For-Freedom merged 1 commit into
mainfrom
fix/health-quiet-when-up

Conversation

@OpenSource-For-Freedom

Copy link
Copy Markdown
Owner

Follow-up to #23, addressing both things you asked for plus three fixes to the Legion step.

1. Only posts when DOWN

State Scheduled behaviour
Healthy silent
Reachable but lossy silent (unless alert_lossy chosen on a manual run)
Unreachable posts

An alert channel is only useful if a message in it means something needs attention.

2. Quiet when the droplet is deliberately off

The check now asks DigitalOcean whether the box is meant to be running before deciding anything is wrong. Powering it down on purpose used to mean a stream of red alerts that were not faults. Now it says so once, in grey, and stops.

The DO token is optional, and an unreachable API returns None rather than a guess. That direction is deliberate: DigitalOcean being unreachable must never suppress a real outage alert.

Add DIGITALOCEAN_ACCESS_TOKEN to repo secrets to enable it. Without it, everything still works, just without power-off detection.

3. Three fixes to the Legion step

  • wraith_security does not resolve. The owner is Wraith-security (hyphen, capital W). As written the workflow fails at startup.
  • @v1 is a mutable tag. Pinned to the full SHA 0f79230..., matching ci.yml. A tag can be repointed by whoever controls the action, which is exactly the attack the step exists to contain, and this job holds a webhook.
  • Moved before checkout. After it, the checkout runs unmonitored, and that is the step pulling remote content.

Tested against the live server and the real webhook

healthy/lossy       "reachable (1/2), --alert-lossy not set: not posting"
DOWN                posted to Discord (you should see it)
droplet gate        active -> proceeds; API failure -> proceeds, never suppresses
leak check          0 occurrences of fake webhook/token in output
compile + YAML      valid

Only DOWN posts now. A healthy server is silent, and a merely lossy one is
silent too unless --alert-lossy is passed. Routine traffic in an alert
channel is how people stop reading it, and then the message that mattered
is missed as well.

The check now asks DigitalOcean whether the droplet is meant to be running
before deciding anything is wrong. Powering it down on purpose used to
produce red alerts that were not faults. If it is off, it says so once, in
grey, and stops. The DO token is optional and an unreachable API returns
None rather than a guess, so it can never suppress a real outage alert.

Legion step, three fixes to the hand-added version: owner is
Wraith-security not wraith_security (the latter does not resolve and the
workflow fails at startup); pinned to a full commit SHA rather than @v1,
since a tag can be repointed and this job holds a webhook; and moved
before checkout, because after it the checkout itself runs unmonitored
and that is the step pulling remote content.
@OpenSource-For-Freedom
OpenSource-For-Freedom merged commit 9793de5 into main Aug 15, 2026
6 checks passed
@OpenSource-For-Freedom
OpenSource-For-Freedom deleted the fix/health-quiet-when-up branch August 15, 2026 18:08
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