226bbe1bf7
Record live monitor.php cron config in HOSTING.md and close todo 05. Move optional */5 heartbeat task to todo/13. Co-authored-by: Cursor <cursoragent@cursor.com>
57 lines
2.2 KiB
Markdown
57 lines
2.2 KiB
Markdown
# 03 — Monitoring Pull (Phase 1)
|
|
|
|
**Priorität:** high
|
|
**Status:** erledigt (2026-06-12)
|
|
**Abhängigkeiten:** 01, 02, 05
|
|
**Siehe auch:** [`../MONITORING.md`](../MONITORING.md)
|
|
|
|
## Ziel
|
|
|
|
`monitor.php` auf dem Webspace: externe HTTPS-/SSL-Checks, Retry, E-Mail-Alarm.
|
|
|
|
## Checkliste
|
|
|
|
### Implementierung
|
|
|
|
- [x] `config/` — lädt `.env` (oder `config.php` außerhalb `httpdocs`) — `bootstrap.php` → `private/server.env`
|
|
- [x] `public/monitor.php` — CLI/Cron-tauglich, kein Browser-Output nötig
|
|
- [x] URL-Liste aus MONITORING.md Mindestliste konfigurierbar (`config/targets.php`)
|
|
- [x] Pro URL: HTTP-Status, Timeout ~10s, optional erwarteter Code (200, 301, 401)
|
|
- [x] SSL-Ablauf: Warnung wenn < 14 Tage (`warn` in JSON, kein Mail-Alarm)
|
|
- [x] Retry: bei Fehler 2 Min warten, zweiter Versuch — Alarm nur wenn beide scheitern
|
|
- [x] Ergebnisse nach `data/last-checks.json` schreiben (für Landing Page) — `private/data/` auf Webspace
|
|
- [x] Bei Alarm: E-Mail an `ALERT_EMAIL` via SMTP
|
|
- [x] Review-Reminder (90 Tage, `last_reviewed_at` + Hash-Auto-Reset) — Plan-Ergänzung, in `monitor-lib.php`
|
|
- [ ] Optional: Telegram wenn `TELEGRAM_*` gesetzt — bewusst Phase 2
|
|
|
|
### Mindest-URLs (Start)
|
|
|
|
- [x] `https://schwenk.online`
|
|
- [x] `https://gitea.schwenk.online`
|
|
- [x] `https://pics.schwenk.online`
|
|
- [x] `https://medis.schwenk.online`
|
|
- [x] `https://portainer.schwenk.online` — `expect` `[200, 401]` (liefert aktuell 200)
|
|
- [x] Eine `bsc-gp.de`-Subdomain (z. B. score) — `https://score.bsc-gp.de`
|
|
- [x] `https://vfb.red`
|
|
|
|
### Sicherheit
|
|
|
|
- [x] `data/` nicht öffentlich (`.htaccess` oder außerhalb Document Root) — `private/data/`
|
|
- [x] Keine Secrets in `last-checks.json`
|
|
|
|
## Akzeptanzkriterien
|
|
|
|
- [x] Manueller Aufruf / „Jetzt ausführen“ in Plesk läuft fehlerfrei
|
|
- [x] Simulierter Down (falsche URL) löst Mail nach Retry aus
|
|
- [x] `last-checks.json` aktualisiert sich
|
|
|
|
## Notizen
|
|
|
|
- Plesk-Cron: `httpdocs/monitor.php`, `*/10 * * * *`, „Nur Fehler“ — erledigt (Todo 05, 2026-06-12)
|
|
- Browser-Aufruf `https://0012.de/monitor.php` → leere Seite (HTTP 200) ist korrekt
|
|
- SSL-`warn` auf boka-Hosts nach LE short→long-lived-Wechsel: bekannt, kein Handlungsbedarf auf 0012.de
|
|
|
|
## Geschätzter Aufwand
|
|
|
|
~1h (laut MONITORING.md Phase 1)
|