Fixes #1. - New `logto: {status, responseTimeMs, error?}` field in /health response - Configurable via LOGTO_HEALTH_URL env (default: auth.lacompagniemaximus.com OIDC discovery endpoint) - 3s timeout via AbortController; /health stays HTTP 200 even if Logto is down - getCpuPercent converted to async (setTimeout-based delay) so the 500ms CPU sample and the Logto fetch run concurrently via Promise.all; total latency stays max(500ms, <=3000ms) instead of the sum - Commit project CLAUDE.md (previously untracked) with the new field documented Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
831 B
831 B
VPS Health API
API sante minimaliste pour le VPS. ~127 lignes, Node 22 + HTTP natif.
Endpoints
GET /health— CPU, memoire, disque, uptime, logto ({status, responseTimeMs, error?})GET /defenseurs— contenu de status.json (rapports defenseurs)
Auth
- Bearer token via env
HEALTH_TOKEN - Fail-closed : si
HEALTH_TOKENnon configure, toutes les requetes sont refusees
Config
- Port :
3001(envPORT) LOGTO_HEALTH_URL: URL du.well-known/openid-configuration(default auth.lacompagniemaximus.com)- Bind-mount :
/data/defenseurs/status.jsonread-only
Deploy
Coolify auto-rebuild depuis push Forgejo. Aucune action manuelle requise.
Gotchas
- Pas d'Express — HTTP natif Node.js uniquement
- Le
status.jsonest ecrit par le Sergent defenseurs, pas par cette API (read-only)