koopa-admin-log/scripts/login-health/README.md
2026-09-19 00:48:42 +02:00

81 lines
2.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# login-health — status on SSH login (koopa)
SSH login shows a short **pre-collected** snapshot: Forgejo, GOA (`goa-regio-ng`), Caddy edge, host Tor, rest of inventory.
Inventory: `configs/ports.md` + this scripts arrays (not `host/overview/`).
## New / changed services
Same package:
1. `koopa-login-health.sh``EXPECT_CONTAINERS`, `PROBES`, critical vs optional
2. `configs/ports.md`
3. Deploy → `~/.local/bin/koopa-login-health` on koopa (no git commit on koopa)
4. `koopa-login-health collect`
Workflow: `koopa-services-health`.
## Design: no probes at login
| Path | What |
|------|------|
| **user timer** (5 min + after boot) | `collect` — podman, Caddy, Tor, loopback HTTP → snapshot |
| **SSH / bashrc** | `show` only — cat snapshot |
State: `~/.local/state/koopa-login-health/` (`status.compact` / `.verbose` / `.meta`).
Stale if older than `KOOPA_HEALTH_STALE_SEC` (default 900).
## Login must never break
`KOOPA_HEALTH_FROM_LOGIN=1` → exit 0 · `timeout 2s` · `|| true` · `bash -n` on install.
Skip: `KOOPA_SKIP_HEALTH=1 ssh koopa`
## What you see
```text
koopa health koopa Sat, 19 Sep 2026 …
git.hacktivism.ch = Forgejo :9024/:9200 · edge Caddy :9000/:9001
OK all critical checks passed (… ok)
overall: OK ok=… warn=0 fail=0
```
## Checks (collect only)
| Area | What |
|------|------|
| Edge | `caddy.service`, proxy sockets |
| Tor | host `tor.service` (ORPort 8080 / ControlPort 9051) — WARN if down |
| Listen | critical + optional ports |
| Podman | `goa-regio-ng`, forgejo, optional apps |
| HTTP | loopback backends (2s curl) |
| Git SSH | TCP `:9200` |
**Critical** (FAIL): `goa-regio-ng`, `koopa-forgejo`, edge/ports **90109012**, **9024**, **9200**.
**Optional** (WARN): castopod, bonfire, lemmy, decidim, prime, bt, paivana, tops, nym.
GOA = single CTR `goa-regio-ng` (pasta **90109015**). Landings **90139015** host-side (`~/goa-landing-deploy`).
Legacy `taler-hacktivism*` / `koopa-tor-relay` are not expected.
Read-only. No restarts, no secrets.
## Install (koopa as `hernani`)
```bash
cd ~/src/koopa/koopa-admin-log
./scripts/login-health/install-login-health.sh
sudo loginctl enable-linger hernani
```
## Manual
```bash
koopa-login-health
koopa-login-health show -v
koopa-login-health collect
systemctl --user status koopa-login-health.timer
```
## Related
- `configs/ports.md` · `host/tor/README.md` (host Tor)
- units: `configs/systemd/user/koopa-login-health.{service,timer}`