Add status_alerts table and status_alert_after_hours setting

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
patrickandClaude Sonnet 5.5 committed 2026-10-29 20:30:51 -04:00
1 parent 3ac7111371
commit d6480ef1b9
2 files changed
+34

No files matched your search

+4
View File
@@ -41,6 +41,8 @@ class Config:
ntfy_url: str = ""
ntfy_token: str = ""
ntfy_timeout_seconds: float = 10.0
# Notify when a host has needed a reboot or updates for this long; 0 disables.
status_alert_after_hours: float = 24.0
def load(path: str | None = None) -> Config:
@@ -72,6 +74,8 @@ def load(path: str | None = None) -> Config:
raise SystemExit(f"{path}: stale_after_hours must be positive and finite")
if not math.isfinite(cfg.ntfy_timeout_seconds) or cfg.ntfy_timeout_seconds <= 0:
raise SystemExit(f"{path}: ntfy_timeout_seconds must be positive and finite")
if not math.isfinite(cfg.status_alert_after_hours) or cfg.status_alert_after_hours < 0:
raise SystemExit(f"{path}: status_alert_after_hours must be zero or positive and finite")
if any(ord(c) < 32 or ord(c) == 127 for c in cfg.ntfy_url + cfg.ntfy_token):
raise SystemExit(f"{path}: ntfy settings must not contain control characters")
if cfg.ntfy_url: