Add config validation and dashboard

Add YAML config loading with validation, env overrides for secrets, and
a web dashboard exposing health, stats, and recent events.
This commit is contained in:
2026-08-03 12:12:12 -04:00
parent 3f48912ad7
commit 4e1d7cd94a
29 changed files with 2344 additions and 55 deletions
+27 -11
View File
@@ -14,15 +14,19 @@ server:
# Mettre "0.0.0.0:9090" pour exposer réseau, "127.0.0.1:9090" pour localhost
listen: "127.0.0.1:9090"
# Secret partagé pour validation HMAC-SHA256 des webhooks (optionnel)
# Si défini, tous les webhooks doivent inclure le header X-Hub-Signature-256
# Peut aussi être passé via variable d'environnement NTFY_HMAC_SECRET
# hmac_secret: "mon-secret-partage"
# ── Defaults ──────────────────────────────────────────
# Appliqués à toutes les sources sauf override explicite
defaults:
priority: 3 # 1=min, 2=low, 3=default, 4=high, 5=urgent
tags: ["loudspeaker"] # Tags/emojis Ntfy
priority: 3 # 1=min, 2=low, 3=default, 4=high, 5=urgent
tags: ["loudspeaker"] # Tags/emojis Ntfy
# ── Sources ───────────────────────────────────────────
sources:
# ═══════════════════════════════════════════════════
# GITEA — webhooks depuis git.dracodev.net
# ═══════════════════════════════════════════════════
@@ -54,7 +58,7 @@ sources:
topic: alerts
state_map:
down: { priority: 5, tags: ["rotating_light", "x"] }
up: { priority: 1, tags: ["white_check_mark"] }
up: { priority: 1, tags: ["white_check_mark"] }
# ═══════════════════════════════════════════════════
# DOCKER — surveillance des conteneurs
@@ -79,13 +83,13 @@ sources:
# ═══════════════════════════════════════════════════
http_poll:
- name: "Health endpoints"
interval: 60 # secondes entre chaque check
interval: 60 # secondes entre chaque check
checks:
- url: https://obsigate.dracodev.net/health
- url: https://og.dracodev.net/health
topic: alerts
priority: 5 # priorité si DOWN
priority: 5 # priorité si DOWN
expect_status: 200
timeout: 10 # secondes
timeout: 10 # secondes
- url: https://flowdeck.dracodev.net/health
topic: alerts
@@ -99,6 +103,18 @@ sources:
expect_status: 200
timeout: 10
- url: http://raspi.8gb.home:3001/ping
topic: alerts
priority: 5 # Uptime Kuma lui-même — critique
expect_status: 200
timeout: 10
- url: http://raspi.8gb.home:9119/api/status
topic: alerts
priority: 5
expect_status: 200
timeout: 10
# ═══════════════════════════════════════════════════
# CRON — reçoit des notifs depuis des scripts shell
# ═══════════════════════════════════════════════════
@@ -122,7 +138,7 @@ sources:
# ── Déduplication ──────────────────────────────────────
dedup:
enabled: true
ttl_seconds: 300 # 5 minutes — durée du cache de déduplication
ttl_seconds: 300 # 5 minutes — durée du cache de déduplication
rate_limit:
max_per_minute: 10 # max notifications/minute par topic
max_per_source: 30 # max notifications/minute toute source confondue
max_per_minute: 10 # max notifications/minute par topic
max_per_source: 30 # max notifications/minute toute source confondue