Commit graph iac/nixos/hosts/asxpio-ops/garage.nix
Author SHA1 Message Date
998ce26478
ops: no more app containers on Postgres and Garage
All checks were successful
nixos / nixos (push) Successful in 24s
asxpio, datacenterbingo, blog and czsk run on asxpio-services now and
reach Postgres and Garage over the private network; vhpbot, the last
container, uses neither. So Postgres no longer admits Podman's networks,
the firewall no longer opens 5432 and 3900 to them, and the container
plumbing for the Docker-era storage stack goes: the postgres/garage host
aliases and the empty storage network.

Assisted-by: Claude:opus-5-5
2026-11-17 14:21:00 +04:00
f1baa4025c
nixos: rotate Forgejo's internal token and JWT secrets, Grafana's key
Some checks failed
nixos / nixos (push) Failing after 57s
Forgejo's INTERNAL_TOKEN, JWT_SECRET and LFS_JWT_SECRET sat in the old
repository history for a year; Grafana ran on its public default
secret_key. New values, generated by Forgejo and openssl, straight into
sops. SECRET_KEY stays: changing it would break 2FA.

sops-nix does not restart anything when a secret changes. The secrets
now name the unit that reads them (Forgejo, Grafana, postgres-roles,
garage-bootstrap), so a changed value takes effect on the deploy.

Assisted-by: Claude:opus-5-5
2026-11-17 10:38:32 +04:00
cbf14b4b99
nixos: monitoring as native services
Every host runs node_exporter, cAdvisor (now against Podman), Alloy and
the security-metrics script, on its private address. Each service
declares its own expected ports, users and privileged containers next
to its definition, so the security baseline follows the config instead
of a separate inventory list.

On ops: Prometheus, Loki, Grafana, the blackbox prober and the Postgres
exporter, with the same scrape jobs, probes, retention, dashboards and
33 alert rules. Two rules matched container-era names and now match the
native ones: Forgejo's log is unit forgejo.service, Grafana's route is
grafana@file.

Grafana keeps its default secret_key on production, because its
database was written with it; rotating it is a separate step.

Prometheus, Grafana and Alloy come from nixos-unstable: their data is
from newer versions than 26.05 ships.

LLMNR and mDNS are off: the baseline flagged them as public listeners.

Tried on the rehearsal pair: all 28 scrape targets up, logs from both
hosts in Loki, Grafana WireGuard-only, no unexpected port, user or
container on either host.

Assisted-by: Claude:opus-5-5
2026-11-17 04:48:56 +04:00
be68c5adef
nixos: describe both servers as NixOS systems
Start of the move from Ansible to NixOS. Services run as native NixOS
services where nixpkgs has a module and as Podman containers otherwise;
there is no Docker.

Shared: users with their Debian UIDs, SSH with the Ansible role's crypto
settings, nftables firewall, WireGuard (ops is the hub), sops-nix
secrets per host, the restic backup script with its schedule and
retention, mail on unit failure.

asxpio-services: Xray, SillyTavern, Minecraft (Paper) and the ACME
forwarder natively; XMPP stays in containers because the server is a
custom build.

asxpio-ops: Postgres, Garage and Forgejo natively. Roles, buckets, keys
and grants move here from the storage repo's init scripts.

Services that own data wait for /var/lib/.data-in-place, so an install
never creates empty state where a restore is about to land.
migration/*-data.sh move the Debian-era data into the new layout.

hosts/rehearsal turns the two hosts into a test pair with its own keys
and dummy secrets. Everything here ran there, Postgres, Garage, Forgejo,
Minecraft and SillyTavern on a restored copy of production data. Three
differences from the containers showed up and are handled: Garage
rejects a 0440 credential file, Geyser needs libcrypto and netlink,
SillyTavern ignores the module's listen flags.

Production is untouched: both servers still run Debian under Ansible.

Assisted-by: Claude:fable-5-2
2026-11-16 22:59:59 +04:00