78 lines
2.8 KiB
Markdown
78 lines
2.8 KiB
Markdown
# 2026-07-18 — Monitoring-HTML öffentlich: Caddy / www (Infra)
|
||
|
||
## Symptom
|
||
|
||
Öffentliche URLs liefern **Merchant-JSON code 21** (HTTP 404), kein sticky-bar HTML:
|
||
|
||
- `https://taler.hacktivism.ch/monitoring/`
|
||
- `https://bank.hacktivism.ch/monitoring/`
|
||
- `https://exchange.hacktivism.ch/monitoring/`
|
||
- `https://taler.hacktivism.ch/taler-monitoring-surface/`
|
||
- `https://taler.hacktivism.ch/taler-monitoring-aptdeploy/`
|
||
- `https://taler.hacktivism.ch/taler-monitoring-mattermost/`
|
||
- `https://taler.hacktivism.ch/taler-monitoring-mail/`
|
||
|
||
(jeweils auch ohne trailing slash und `*_err/` wo vorhanden)
|
||
|
||
## Nicht die Suite
|
||
|
||
Standalone-Repo **taler-monitoring** (aktuell z. B. **v1.7.1**, `~/src/taler-monitoring`):
|
||
|
||
| Ort | Status |
|
||
|-----|--------|
|
||
| Staging `~/monitoring-sites-staging/…/*/index.html` | **vorhanden** (sticky-bar) |
|
||
| Host-agent Timer | aktiv; meldet Deploy/monpages-Fehler (`STRICT_EXIT=1` ab v1.7.1) |
|
||
| Live `/var/www/monitoring-sites` | unvollständig / veraltet; **nicht** schreibbar für `hernani` |
|
||
| Live `/etc/caddy/Caddyfile` | **keine** `handle /monitoring*` (Stand 2026-07-18) |
|
||
| Vorbereitet | `~/koopa-caddy/Caddyfile` (Handles vor `reverse_proxy`) |
|
||
|
||
Caddy läuft als System-Unit (`User=caddy`, **`ProtectHome=true`**) → Staging unter `/home/hernani` ist für Caddy **nicht** lesbar. Auslieferung muss über **`/var/www/monitoring-sites`**.
|
||
|
||
## Root-Fix (einmal)
|
||
|
||
```bash
|
||
sudo ~/koopa-caddy/apply-monitoring-live.sh
|
||
```
|
||
|
||
Das Script:
|
||
|
||
1. `rsync` Staging → `/var/www/monitoring-sites/`
|
||
2. Ownership/ACL: `hernani` schreibbar, Gruppe `caddy`
|
||
3. Installiert vorbereitete Caddyfile → `/etc/caddy/Caddyfile`, `caddy validate`, `systemctl reload caddy`
|
||
4. Smoke-curl der Monitoring-URLs (darf **nicht** code 21 sein)
|
||
|
||
Danach sollten Host-Agent-Läufe selbst nach www rsyncen (wenn ACL greift).
|
||
|
||
## Verifikation
|
||
|
||
```bash
|
||
curl -sS -o /dev/null -w "%{http_code}\n" https://taler.hacktivism.ch/monitoring/
|
||
# expect 200 + HTML with sticky-bar, not JSON code 21
|
||
|
||
grep -c "handle /monitoring" /etc/caddy/Caddyfile
|
||
# expect > 0
|
||
|
||
test -w /var/www/monitoring-sites && echo www_writable
|
||
```
|
||
|
||
## Suite vs. Ops
|
||
|
||
| Repo | Rolle |
|
||
|------|--------|
|
||
| [taler-monitoring](https://git.hacktivism.ch/hernani/taler-monitoring) | Checks, HTML-Generator, host-agent |
|
||
| **koopa-admin-log** (dieses Repo) | Caddy-Spiegel, Apply-Skript-Hinweise, Issues |
|
||
| `~/koopa-caddy/` | Live-Apply-Quelle auf dem Host (nicht Secrets) |
|
||
|
||
Siehe Issue **I-09** in `ISSUES.md`.
|
||
|
||
## Follow-up — empty Caddy 404 after apply (v1.7.2)
|
||
|
||
After apply, Caddy returned **empty HTTP 404** (Server: Caddy).
|
||
|
||
**Cause:** `root * …/monitoring` + `handle /monitoring/` → looks for `…/monitoring/monitoring/`.
|
||
|
||
**Fix:** `root * …/{host}` + `handle /monitoring*` in `~/koopa-caddy/Caddyfile`. Re-apply:
|
||
|
||
```bash
|
||
sudo ~/koopa-caddy/apply-monitoring-live.sh
|
||
```
|