mastodon-ops
Installation
SKILL.md
When to Use
Load for anything touching your-instance.example: posting latency, container memory/OOM, Sidekiq queues, PostgreSQL tuning, relay ingestion, backups/maintenance jobs.
Layout
- Stack lives in
~/dmv-community/, run as systemd user unitsdmv-*(web, db, redis, streaming, sidekiq variants) over podman containersdmv-*. Env files under~/dmv-community/config/(e.g.db.envhasPOSTGRES_USER/POSTGRES_DB,redis.envhasREDIS_PASSWORD); source them withset -a; . file; set +abefore psql/redis-cli. - DB data is a podman named volume (
dmv-postgres-data) on the shared btrfs/var/home— same pool as the desktop, GoToSocial (the largest writer on it), other services, and backups. Before 2026-10-28 16:00 request logs appeared twice (dmv-web+podmanlines); after that units useStandardOutput=null, so only the journald-driver copy exists. Keep deduping by request ID when spanning that boundary. - Change log and open items:
~/dmv-community/TUNING-2026-10-28.md(pre-change copies intuning/2026-10-28/before/). Repo copies of units live in~/dmv-community/systemd/; re-sync them after editing~/.config/systemd/user/(they drifted once). - Restart cascade: web, streaming and all Sidekiq units have
Requires=dmv-redis.service(and db), sosystemctl --user restart dmv-redisrestarts the whole app tier (~39 s to local 200). Use it on purpose to batch unit changes into one outage; never restart redis/db casually. - Daily
dmv-backup.timer(04:17 ET) runsscripts/daily-backup.sh: fresh custom-format pg_dump +pg_restore --listvalidation plus application/systemd/Cloudflared config go to the external ext4 disk (UUIDe3388b5a-797c-49ba-af29-37e703de2dd2) underdmv-community-backups/, with encrypted restic snapshots (14 daily/8 weekly/12 monthly).ExecStartPostthen runsscripts/offsite-backup.sh, copying the latest snapshot to the separately encrypted Koofr restic reporclone:koofr:dmv-community-backups/resticvia rclone's native backend, before the Uptime Kuma heartbeat. Local/Koofr passwords are in~/.config/dmv-backup/{restic-password,koofr-restic-password}and InfisicalDMV_RESTIC_PASSWORD/DMV_KOOFR_RESTIC_PASSWORD; Koofr app credentials areKOOFR_USER/KOOFR_APP_PASSWORD. DigitalOcean Spaces media is intentionally excluded by Jason's preference; do not mirror or snapshot the bucket. Restore runbook:DISASTER-RECOVERY.md. Weekly checks validate both repos; monthly checks sample 5% local + 1% Koofr data.scripts/verify-koofr-backup.shchecks Koofr metadata and byte-compares restored config samples.dmv-maintenance.timerruns at 03:17 ET.- Monitoring backup freshness:
~/.hermes/scripts/dmv_health_check.sh(cron job "DMV.Community Daily Health Report", 08:00 ET) reportsbackup_age_hours. It MUST resolve the external disk by UUID withfindmnt --first-only -rn -S UUID=<uuid>— the same waydaily-backup.shdoes — and scan$MOUNT/dmv-community-backups/database, never a hardcoded mount path: udisks mount points under/run/media/jason/vary per session, and~dmv-community/backups/is a LEGACY pre-migration dir holding only stale dumps (reading it silently reports a stale dump age while backups are healthy). The monitor also emitsbackup_mount=mounted|unmountedso a missing disk degrades loudly. When a DEGRADED backup-age report arrives, verify against the external disk'sdatabase/dir and the backup log in~/dmv-community/backups/logs/before touching the timer.
- Monitoring backup freshness: