Traefik keeps its role and its acme.json. Routes for the native services (Forgejo, Garage, the dashboard, the XMPP certificate) are written from Nix; the app containers keep declaring theirs as labels, which Traefik reads through Podman's socket as it did through Docker's. The asxpio runner uses the NixOS module and starts jobs through Podman; the interop runner is its own unit because it connects with a UUID and token instead of registering. Tried on the rehearsal pair: Forgejo and Garage through Traefik, a label-routed container, anonymous reads of the public bucket only, and a workflow with a nix-latest and an ubuntu-latest job. A restored Forgejo database still holds production's queued jobs, schedules and Actions secrets. The test runner tried to take a queued production job and was stopped only by the different secret key. migration/rehearsal-sanitize-forgejo.sh removes all of that and must run before a runner meets restored data. Assisted-by: Claude:fable-5-2
54 lines
1.8 KiB
Nix
54 lines
1.8 KiB
Nix
# asxpio-services on a throwaway server; see ./ops.nix.
|
|
{ lib, ... }:
|
|
{
|
|
networking.hostName = "rehearsal-services";
|
|
sops.defaultSopsFile = ../../secrets/rehearsal-services.yaml;
|
|
asxpio.sshFrom = [ "*" ];
|
|
|
|
# Same script and schedule, into repositories on its own disk
|
|
asxpio.backup.repositories = lib.mkForce {
|
|
hel1 = "/var/backups/test-repo-hel1";
|
|
fsn1 = "/var/backups/test-repo-fsn1";
|
|
};
|
|
systemd.network.networks."10-public".address = lib.mkForce [ "2a01:4f9:c01d:6f9::1/64" ];
|
|
|
|
asxpio.publicIPv4 = "2.29.197.9";
|
|
|
|
# A 4 GB server
|
|
services.minecraft-server.jvmOpts = lib.mkForce "-Xmx2G -Xms1G";
|
|
|
|
# A restored world brings its plugins and their credentials along.
|
|
# Those that talk to the outside (the Discord bot logs in with the
|
|
# production token and edits the real server's slash commands) are
|
|
# put aside before every start.
|
|
systemd.services.minecraft-server.preStart = lib.mkBefore ''
|
|
mkdir -p plugins/disabled-on-rehearsal
|
|
for p in DiscordSRV ServerBackup AutoUpdateGeyser; do
|
|
for f in plugins/$p*.jar; do
|
|
[ ! -e "$f" ] || mv "$f" plugins/disabled-on-rehearsal/
|
|
done
|
|
done
|
|
'';
|
|
|
|
# With production data restored these would act as production: a second
|
|
# asxp.io XMPP server and Telegram session. Start them by hand, and
|
|
# only with test data.
|
|
virtualisation.oci-containers.containers = lib.genAttrs [ "xmpp-ejabberd" "xmpp-apushd" "xmpp-tackygram" ] (_: {
|
|
autoStart = false;
|
|
});
|
|
|
|
# This runner would take real jobs of another project
|
|
systemd.services.forgejo-runner-interop.wantedBy = lib.mkForce [ ];
|
|
|
|
asxpio.wireguard.peers = [
|
|
{
|
|
name = "asxpio-ops";
|
|
publicKey = "Zuufncq9a9UZGvgRBjattzuoomJtWREjFeoB0POt620=";
|
|
endpoint = "62.238.40.174:60101"; # rehearsal-ops
|
|
allowedIPs = [
|
|
"10.20.0.0/24"
|
|
"fd69:69:69::/64"
|
|
];
|
|
}
|
|
];
|
|
}
|