All checks were successful
nixos / nixos (push) Successful in 44s
Found by rehearsing the ops conversion on a fresh test server with last night's backup: - After a reboot the app containers stayed stopped. Docker restarted them; Podman does so only through podman-restart.service, which it ships but does not enable. Enable it; on ops it waits for the app networks, Postgres and Garage. - ops-data.sh: a fresh NixOS has no /opt, so moving the app directories failed; and NixOS creates an empty /var/lib/forgejo/repositories at boot, so the repositories were moved into it, one level too deep. Every part now creates its target, replaces what is empty and skips what already moved, so an interrupted run can be resumed. - `forgejo admin regenerate hooks` is gone in Forgejo 17, which gives git its own hooks on every push; a push to a restored repository works with the old hook files in place. Drop the call. - The rehearsal ops host does not push XMPP certificates: there is no services host behind 10.10.0.20 on the test network. Assisted-by: Claude:opus-5-5
53 lines
1.9 KiB
Nix
53 lines
1.9 KiB
Nix
# The app stacks (asxpio, datacenterbingo, blog, czsk, vhpbot) deploy
|
|
# themselves from their own repositories: CI copies a compose file and a
|
|
# .env to /opt/<app> and runs `docker compose up -d` as user deploy.
|
|
#
|
|
# Their compose files still expect the Docker-era storage stack: a
|
|
# network named "storage" and the hosts "postgres" and "garage" on it.
|
|
# Postgres and Garage are native services now, so every container on
|
|
# this host resolves those two names to the host, and the network exists
|
|
# empty. Nothing in the app repositories has to change for the move;
|
|
# dropping the storage network from their compose files is a later
|
|
# clean-up.
|
|
{ config, pkgs, ... }:
|
|
let
|
|
hosts = pkgs.writeText "container-hosts" ''
|
|
10.10.0.10 postgres garage
|
|
'';
|
|
in
|
|
{
|
|
virtualisation.containers.containersConf.settings.containers.base_hosts_file = "${hosts}";
|
|
# The API service (the socket the Docker CLI and Traefik use) reads it
|
|
# at start only
|
|
systemd.services.podman.restartTriggers = [ hosts ];
|
|
|
|
# After a reboot the apps come back once their networks, database and
|
|
# object store are there
|
|
systemd.services.podman-restart = {
|
|
after = [
|
|
"podman-network-traefik.service"
|
|
"podman-network-storage.service"
|
|
"postgresql.service"
|
|
"garage.service"
|
|
];
|
|
wants = [
|
|
"podman-network-traefik.service"
|
|
"podman-network-storage.service"
|
|
];
|
|
};
|
|
|
|
# `docker compose up --build` (vhpbot-prod builds on the host) starts
|
|
# BuildKit in a privileged container
|
|
asxpio.security.containers."buildx_buildkit_.*" = [ "privileged" ];
|
|
|
|
systemd.services.podman-network-storage = {
|
|
description = "Podman network storage (empty; see apps.nix)";
|
|
wantedBy = [ "multi-user.target" ];
|
|
path = [ config.virtualisation.podman.package ];
|
|
serviceConfig = {
|
|
Type = "oneshot";
|
|
RemainAfterExit = true;
|
|
};
|
|
script = "podman network exists storage || podman network create storage";
|
|
};
|
|
}
|