carlok — zsh — 88×30

cat _posts/2026-10-26-matrix-podman-stack-is-public-a-private-matrix-server-for-podman-where-the-bot-accounts-are-configuration.md

matrix-podman-stack is public: a private Matrix server for Podman, where the bot accounts are configuration

matrix-podman-stack is now public: Synapse and its Postgres, Element Web, an optional mautrix-telegram bridge with a second Postgres, optional Prometheus and Grafana, and the helper scripts that provision the chat’s automation accounts. It is built for a small private group of humans and bots rather than for federation — no federation, no TURN, no bridge besides Telegram — and every container publishes on 127.0.0.1 only, because nginx stays on the host and terminates TLS there. Images are pinned (Synapse v1.163.2, Element v1.12.32, Postgres 16.9-bookworm, mautrix-telegram v0.2610.0), and the optional parts are compose profiles: telegram, monitoring, bus, object, vectors, llm. The stack itself landed as #1.

The part that is not boilerplate is the bot handling. Registration is off, and bots.yaml decides who exists — either an explicit list of localparts with display names or a prefix and a count that generates bot1, bot2, … — then create-bots.sh creates the Matrix users, applies Synapse’s admin override_ratelimit per bot, rotates their passwords through the admin API so tokens can be refreshed, and writes the BOT_<LOCALPART>_ACCESS_TOKEN values to a file it chmod 600s and never prints. BOT_IGNORE_MATRIX_IDS is filled in from the same run so two bots cannot answer each other forever, and the example matrix-nio bot ships with an opt-in master/worker mode — !discuss <topic> in a room holding both — bounded by a turn cap, a stop marker, a cooldown and event dedupe, where a human message resets the thread (c013e7d).

State is bind mounts under DATA_DIR and nothing else — no named or anonymous volumes — so it survives podman compose down -v and an image upgrade, and verify-data-persistence.sh proves that by creating a room and a media upload, tearing the stack down with -v and checking they are still there. Two other scripts were written to be quotable rather than reassuring: collect-resource-stats.sh takes the podman stats snapshot the README’s sizing table came from on 25 October — core only fits 2 vCPU / 4 GiB, everything except llm wants 4 / 8, and Ollama is sized from the model, not from the idle daemon — and install-systemd-service.sh generates a user unit for boot, because Podman’s own podman-restart.service restarts every container on the host, not this stack. The repository also arrived with a pytest suite and coverage gate wired into CI (32d02f7) and the standard community files (#2), plus two first-day fixes for the Synapse metrics scrape and for who re-renders the bus config (4c2c111).