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 units dmv-* (web, db, redis, streaming, sidekiq variants) over podman containers dmv-*. Env files under ~/dmv-community/config/ (e.g. db.env has POSTGRES_USER/POSTGRES_DB, redis.env has REDIS_PASSWORD); source them with set -a; . file; set +a before 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 + podman lines); after that units use StandardOutput=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 in tuning/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), so systemctl --user restart dmv-redis restarts 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) runs scripts/daily-backup.sh: fresh custom-format pg_dump + pg_restore --list validation plus application/systemd/Cloudflared config go to the external ext4 disk (UUID e3388b5a-797c-49ba-af29-37e703de2dd2) under dmv-community-backups/, with encrypted restic snapshots (14 daily/8 weekly/12 monthly). ExecStartPost then runs scripts/offsite-backup.sh, copying the latest snapshot to the separately encrypted Koofr restic repo rclone:koofr:dmv-community-backups/restic via rclone's native backend, before the Uptime Kuma heartbeat. Local/Koofr passwords are in ~/.config/dmv-backup/{restic-password,koofr-restic-password} and Infisical DMV_RESTIC_PASSWORD/DMV_KOOFR_RESTIC_PASSWORD; Koofr app credentials are KOOFR_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.sh checks Koofr metadata and byte-compares restored config samples. dmv-maintenance.timer runs at 03:17 ET.
    • Monitoring backup freshness: ~/.hermes/scripts/dmv_health_check.sh (cron job "DMV.Community Daily Health Report", 08:00 ET) reports backup_age_hours. It MUST resolve the external disk by UUID with findmnt --first-only -rn -S UUID=<uuid> — the same way daily-backup.sh does — 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 emits backup_mount=mounted|unmounted so a missing disk degrades loudly. When a DEGRADED backup-age report arrives, verify against the external disk's database/ dir and the backup log in ~/dmv-community/backups/logs/ before touching the timer.

Version upgrades

Installs
1
GitHub Stars
11
First Seen
14 days ago