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
19 lines
762 B
Nix
19 lines
762 B
Nix
# SillyTavern, on the WireGuard address only. State: /var/lib/SillyTavern
|
|
# (data/, extensions/).
|
|
{ config, unstable, ... }:
|
|
{
|
|
services.sillytavern = {
|
|
enable = true;
|
|
package = unstable.sillytavern; # 26.05 has 1.18, the data is from 1.19
|
|
configFile = "${./sillytavern.yaml}";
|
|
# Port 8000, the WireGuard address and the whitelist (WireGuard only)
|
|
# are in the config file; the module's flags do not reach the server
|
|
};
|
|
asxpio.waitForData = [ "sillytavern" ];
|
|
asxpio.security.ports = [ "tcp/8000/MainThread" ];
|
|
systemd.services.sillytavern = {
|
|
after = [ "wireguard-${config.asxpio.wireguard.interface}.service" ];
|
|
wants = [ "wireguard-${config.asxpio.wireguard.interface}.service" ];
|
|
serviceConfig.RestartSec = 5;
|
|
};
|
|
}
|