nixos: drop the rehearsal pair and other migration leftovers
All checks were successful
nixos / nixos (push) Successful in 1m3s
All checks were successful
nixos / nixos (push) Successful in 1m3s
The test pair served the move to NixOS, which is done. Its overlays, dummy secrets and sops recipients go; the rules for testing on a copy of production stay in nixos/README.md, and git log finds the overlay if it is needed again. Options that existed only for it (alert address, Loki bucket, extra cert-push keys) are inlined, and comments still pointing at Ansible or MIGRATION.md are corrected. The tofu README now spells out the state bucket bootstrap: the bucket is a resource in the state it holds, so a new project needs one local apply first. The bucket gets prevent_destroy for the same reason. Assisted-by: Claude:opus-5-5
This commit is contained in:
parent
aebc919435
commit
2635b887c7
21 changed files with 56 additions and 380 deletions
|
|
@ -41,7 +41,7 @@ jobs:
|
||||||
- name: Evaluate
|
- name: Evaluate
|
||||||
working-directory: nixos
|
working-directory: nixos
|
||||||
run: |
|
run: |
|
||||||
for host in asxpio-ops asxpio-services rehearsal-ops rehearsal-services; do
|
for host in asxpio-ops asxpio-services; do
|
||||||
nix eval --raw ".#nixosConfigurations.$host.config.system.build.toplevel.drvPath"
|
nix eval --raw ".#nixosConfigurations.$host.config.system.build.toplevel.drvPath"
|
||||||
echo
|
echo
|
||||||
done
|
done
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,6 @@ bash /tmp/ops-data.sh /restore
|
||||||
## Keeping this true
|
## Keeping this true
|
||||||
|
|
||||||
After a change to what is backed up, and at least twice a year, restore
|
After a change to what is backed up, and at least twice a year, restore
|
||||||
the latest snapshot of each host onto a rehearsal server (`nixos/README.md`)
|
the latest snapshot of each host onto a throwaway server (`nixos/README.md`,
|
||||||
and walk through this page. Last walk-through: 2026-11-17, both hosts
|
"Testing on a copy of production") and walk through this page. Last walk-through: 2026-11-17, both hosts
|
||||||
(the ops runbook on a fresh server with that night's backup).
|
(the ops runbook on a fresh server with that night's backup).
|
||||||
|
|
|
||||||
|
|
@ -4,16 +4,8 @@ keys:
|
||||||
- &admin age19xvmm6j3h2u6mc3w6k65ufry4p5aa5lwu96p55h3e42p9wfzwc0qp2w7pk
|
- &admin age19xvmm6j3h2u6mc3w6k65ufry4p5aa5lwu96p55h3e42p9wfzwc0qp2w7pk
|
||||||
- &asxpio_ops age1jxcl9cwk64wak2gyzf22vm3dpj80wtl76c7krywlrj7jjxftscrskrg3tf
|
- &asxpio_ops age1jxcl9cwk64wak2gyzf22vm3dpj80wtl76c7krywlrj7jjxftscrskrg3tf
|
||||||
- &asxpio_services age15ws8alg3ftsgmzvqxft09556g87s4n8c8v39nmvhaz6k50gp4e7se8acmg
|
- &asxpio_services age15ws8alg3ftsgmzvqxft09556g87s4n8c8v39nmvhaz6k50gp4e7se8acmg
|
||||||
# Throwaway servers: replace with the new host's key, then
|
|
||||||
# sops updatekeys secrets/rehearsal-*.yaml
|
|
||||||
- &rehearsal_ops age138t70j9mf3su6krnt2ygxdy4xwm2wpyrgjjhk7rlzpr3tkdhcuyqdywfjl
|
|
||||||
- &rehearsal_services age1au6f8m6l245ddrunqf2a62xprnlevn9yrducynlay2tgknfxeeusj94j5l
|
|
||||||
creation_rules:
|
creation_rules:
|
||||||
- path_regex: secrets/asxpio-ops\.yaml$
|
- path_regex: secrets/asxpio-ops\.yaml$
|
||||||
key_groups: [{ age: [*admin, *asxpio_ops] }]
|
key_groups: [{ age: [*admin, *asxpio_ops] }]
|
||||||
- path_regex: secrets/asxpio-services\.yaml$
|
- path_regex: secrets/asxpio-services\.yaml$
|
||||||
key_groups: [{ age: [*admin, *asxpio_services] }]
|
key_groups: [{ age: [*admin, *asxpio_services] }]
|
||||||
- path_regex: secrets/rehearsal-ops\.yaml$
|
|
||||||
key_groups: [{ age: [*admin, *rehearsal_ops] }]
|
|
||||||
- path_regex: secrets/rehearsal-services\.yaml$
|
|
||||||
key_groups: [{ age: [*admin, *rehearsal_services] }]
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@ modules/alert.nix mail when a unit fails
|
||||||
modules/monitoring-agent.nix node, container and security metrics, logs to Loki
|
modules/monitoring-agent.nix node, container and security metrics, logs to Loki
|
||||||
hosts/asxpio-ops/ Traefik, Forgejo, Postgres, Garage, monitoring, app stacks
|
hosts/asxpio-ops/ Traefik, Forgejo, Postgres, Garage, monitoring, app stacks
|
||||||
hosts/asxpio-services/ runners, Minecraft, XMPP, Xray, SillyTavern, one file each
|
hosts/asxpio-services/ runners, Minecraft, XMPP, Xray, SillyTavern, one file each
|
||||||
hosts/rehearsal/ overrides that turn the two hosts into a test pair
|
|
||||||
secrets/*.yaml sops-encrypted, one file per host
|
secrets/*.yaml sops-encrypted, one file per host
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -52,7 +51,7 @@ generation in the boot menu (Hetzner console). Package updates come from
|
||||||
Renovate (`flake.lock` weekly, pinned images and versions as they are
|
Renovate (`flake.lock` weekly, pinned images and versions as they are
|
||||||
released); by hand: `nix flake update`, commit `flake.lock`.
|
released); by hand: `nix flake update`, commit `flake.lock`.
|
||||||
|
|
||||||
Try anything risky on the rehearsal pair first (below).
|
Try anything risky on a throwaway server first (below).
|
||||||
|
|
||||||
## Building the servers from scratch
|
## Building the servers from scratch
|
||||||
|
|
||||||
|
|
@ -161,57 +160,34 @@ and never backs up an empty host over a full one. After restoring or
|
||||||
moving the data: `touch /var/lib/.data-in-place`, then start the units
|
moving the data: `touch /var/lib/.data-in-place`, then start the units
|
||||||
or reboot.
|
or reboot.
|
||||||
|
|
||||||
## Rehearsal
|
## Testing on a copy of production
|
||||||
|
|
||||||
`.#rehearsal-ops` and `.#rehearsal-services` are the two hosts' own
|
The test pair used for the migration (`.#rehearsal-ops`,
|
||||||
configurations plus `hosts/rehearsal/`: other keys and addresses, dummy
|
`.#rehearsal-services`: other keys and addresses, dummy secrets, backups
|
||||||
secrets, SSH open to the world, backups into local directories, and
|
into local directories) was removed after it; `git log --
|
||||||
anything that would act as production (the XMPP server) started by hand
|
nixos/hosts/rehearsal` finds it to bring back. A throwaway server is
|
||||||
only. **Every change is tried there first**, and the pair should be able
|
created like a real one (above, in the `personal` project), then gets
|
||||||
to do everything production does before a production host is converted.
|
that night's snapshot restored (RESTORE.md, "A whole host").
|
||||||
|
|
||||||
Two servers on a private network with the production addresses:
|
A restored copy carries production credentials:
|
||||||
|
|
||||||
```sh
|
- Anything that would use them outward stays off: XMPP and the Telegram
|
||||||
hcloud network create --name rehearsal --ip-range 10.10.0.0/20
|
gateway, mail (Forgejo, Grafana, crawler), the bucket replica,
|
||||||
hcloud network add-subnet rehearsal --type cloud --network-zone eu-central --ip-range 10.10.0.0/23
|
certificate pushes, the CI runners, Minecraft's outward plugins
|
||||||
tofu -chdir=../tofu output -json user_data | jq -r '."asxpio-ops"' > /tmp/ops.yaml
|
(DiscordSRV, ServerBackup, AutoUpdateGeyser).
|
||||||
tofu -chdir=../tofu output -json user_data | jq -r '."asxpio-services"' > /tmp/services.yaml
|
- Before any runner meets Forgejo's data, delete production's queued
|
||||||
hcloud server create --name rehearsal-ops --type cx23 --image debian-13 --location hel1 \
|
jobs, schedules, Actions secrets, runners and webhooks (the removed
|
||||||
--ssh-key <your key> --network rehearsal --user-data-from-file /tmp/ops.yaml
|
`hosts/rehearsal/sanitize-forgejo.sh` does that).
|
||||||
hcloud server create --name rehearsal-services --type cx23 --image debian-13 --location hel1 \
|
|
||||||
--ssh-key <your key> --network rehearsal --user-data-from-file /tmp/services.yaml
|
|
||||||
```
|
|
||||||
|
|
||||||
Then, per server: put its age recipient in `.sops.yaml` (`&rehearsal_*`)
|
|
||||||
and `sops updatekeys secrets/rehearsal-<role>.yaml`; put its addresses in
|
|
||||||
`hosts/rehearsal/<role>.nix` (and ops's public key in services' file,
|
|
||||||
the other way round for WireGuard); `nixos-rebuild switch --flake
|
|
||||||
.#rehearsal-<role> --target-host root@<ip> --build-host root@<ip>`;
|
|
||||||
reboot once.
|
|
||||||
|
|
||||||
With test data: `touch /var/lib/.data-in-place`. With a restored copy
|
|
||||||
of production: restore that night's snapshot to `/` (RESTORE.md, "A whole
|
|
||||||
host"), and mind what the copy carries:
|
|
||||||
|
|
||||||
- Production credentials. Anything that would use them outward stays
|
|
||||||
off in `hosts/rehearsal/`: XMPP and the Telegram gateway, mail
|
|
||||||
(Forgejo, Grafana, crawler), the bucket replica, certificate pushes,
|
|
||||||
the interop runner, Minecraft's outward plugins (DiscordSRV,
|
|
||||||
ServerBackup, AutoUpdateGeyser).
|
|
||||||
- On ops, run `hosts/rehearsal/sanitize-forgejo.sh` before any runner
|
|
||||||
meets the data: it removes production's queued jobs, schedules,
|
|
||||||
Actions secrets, runners and webhooks.
|
|
||||||
- Start app containers by hand only, with mail pointed at nothing and
|
- Start app containers by hand only, with mail pointed at nothing and
|
||||||
`INDEXNOW_KEY` empty; never vhpbot or asxpio-monitor.
|
`INDEXNOW_KEY` empty; never vhpbot or asxpio-monitor.
|
||||||
- Limit SSH to your address with a Hetzner firewall, keep backup
|
- Limit SSH to your address with a Hetzner firewall, keep backup
|
||||||
credentials in `/run` only, and delete the servers when done.
|
credentials in `/run` only, and delete the server when done.
|
||||||
|
|
||||||
## How the first boot works, and its limits
|
## How the first boot works, and its limits
|
||||||
|
|
||||||
- nixos-infect is pinned by commit and checksum in
|
- nixos-infect is pinned by commit and checksum in
|
||||||
`../tofu/servers.tofu`; it replaces the operating system, so bump it
|
`../tofu/servers.tofu`; it replaces the operating system, so bump it
|
||||||
deliberately and rehearse.
|
deliberately and try it on a throwaway server.
|
||||||
- It keeps the Debian image's partitions (`modules/hetzner.nix` matches
|
- It keeps the Debian image's partitions (`modules/hetzner.nix` matches
|
||||||
them) and moves the old system to `/old-root`.
|
them) and moves the old system to `/old-root`.
|
||||||
- `bootstrap.nix` in the cloud-init corrects three things for the first
|
- `bootstrap.nix` in the cloud-init corrects three things for the first
|
||||||
|
|
|
||||||
|
|
@ -62,17 +62,6 @@
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
asxpio-ops = mkHost [ ./hosts/asxpio-ops ];
|
asxpio-ops = mkHost [ ./hosts/asxpio-ops ];
|
||||||
asxpio-services = mkHost [ ./hosts/asxpio-services ];
|
asxpio-services = mkHost [ ./hosts/asxpio-services ];
|
||||||
|
|
||||||
# Both hosts on throwaway servers, with their own keys and
|
|
||||||
# addresses: everything is tried there first.
|
|
||||||
rehearsal-ops = mkHost [
|
|
||||||
./hosts/asxpio-ops
|
|
||||||
./hosts/rehearsal/ops.nix
|
|
||||||
];
|
|
||||||
rehearsal-services = mkHost [
|
|
||||||
./hosts/asxpio-services
|
|
||||||
./hosts/rehearsal/services.nix
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
# asxpio-ops: Traefik, Forgejo, storage, the app stacks.
|
# asxpio-ops: Traefik, Forgejo, storage, the app stacks.
|
||||||
# Services are added here as they move over from ../../ansible (see
|
|
||||||
# MIGRATION.md at the repo root); until then this is the base system only.
|
|
||||||
{ lib, ... }:
|
{ lib, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
|
@ -9,13 +7,12 @@
|
||||||
./forgejo.nix
|
./forgejo.nix
|
||||||
./garage.nix
|
./garage.nix
|
||||||
./monitoring
|
./monitoring
|
||||||
./options.nix
|
|
||||||
./postgres.nix
|
./postgres.nix
|
||||||
./traefik.nix
|
./traefik.nix
|
||||||
./xmpp-cert-sync.nix
|
./xmpp-cert-sync.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
networking.hostName = lib.mkDefault "asxpio-ops";
|
networking.hostName = "asxpio-ops";
|
||||||
networking.domain = "asxp.io";
|
networking.domain = "asxp.io";
|
||||||
asxpio.privateIPv4 = "10.10.0.10";
|
asxpio.privateIPv4 = "10.10.0.10";
|
||||||
system.stateVersion = "26.05";
|
system.stateVersion = "26.05";
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
# Managed by Ansible (role monitoring).
|
|
||||||
apiVersion: 1
|
apiVersion: 1
|
||||||
groups:
|
groups:
|
||||||
- orgId: 1
|
- orgId: 1
|
||||||
|
|
|
||||||
|
|
@ -315,7 +315,7 @@ in
|
||||||
storage_config.aws = {
|
storage_config.aws = {
|
||||||
endpoint = "hel1.your-objectstorage.com";
|
endpoint = "hel1.your-objectstorage.com";
|
||||||
region = "hel1";
|
region = "hel1";
|
||||||
bucketnames = config.asxpio.lokiBucket;
|
bucketnames = "asxpio-loki-main";
|
||||||
access_key_id = "\${S3_ACCESS_KEY}";
|
access_key_id = "\${S3_ACCESS_KEY}";
|
||||||
secret_access_key = "\${S3_SECRET_KEY}";
|
secret_access_key = "\${S3_SECRET_KEY}";
|
||||||
};
|
};
|
||||||
|
|
@ -426,7 +426,7 @@ in
|
||||||
uid = "email-me";
|
uid = "email-me";
|
||||||
type = "email";
|
type = "email";
|
||||||
settings = {
|
settings = {
|
||||||
addresses = config.asxpio.alertEmail;
|
addresses = "me@asxp.io";
|
||||||
singleEmail = true;
|
singleEmail = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
# Values the rehearsal host overrides.
|
|
||||||
{ lib, ... }:
|
|
||||||
{
|
|
||||||
options.asxpio = {
|
|
||||||
alertEmail = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
default = "me@asxp.io";
|
|
||||||
description = "Where Grafana sends alerts.";
|
|
||||||
};
|
|
||||||
lokiBucket = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
default = "asxpio-loki-main";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
# asxpio-services: CI runners, Minecraft, XMPP, Xray, SillyTavern.
|
# asxpio-services: CI runners, Minecraft, XMPP, Xray, SillyTavern.
|
||||||
# Services are added here as they move over from ../../ansible (see
|
|
||||||
# MIGRATION.md at the repo root); until then this is the base system only.
|
|
||||||
{ lib, ... }:
|
{ lib, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
|
@ -16,7 +14,7 @@
|
||||||
|
|
||||||
asxpio.publicIPv4 = lib.mkDefault "46.62.228.216";
|
asxpio.publicIPv4 = lib.mkDefault "46.62.228.216";
|
||||||
|
|
||||||
networking.hostName = lib.mkDefault "asxpio-services";
|
networking.hostName = "asxpio-services";
|
||||||
networking.domain = "asxp.io";
|
networking.domain = "asxp.io";
|
||||||
asxpio.privateIPv4 = "10.10.0.20";
|
asxpio.privateIPv4 = "10.10.0.20";
|
||||||
system.stateVersion = "26.05";
|
system.stateVersion = "26.05";
|
||||||
|
|
|
||||||
|
|
@ -26,13 +26,7 @@ in
|
||||||
description = "Public half of xmpp_cert_sync/ssh_key in the ops secrets.";
|
description = "Public half of xmpp_cert_sync/ssh_key in the ops secrets.";
|
||||||
};
|
};
|
||||||
|
|
||||||
options.asxpio.xmppCertSyncKeysExtra = lib.mkOption {
|
|
||||||
type = lib.types.listOf lib.types.str;
|
|
||||||
default = [ ];
|
|
||||||
description = "Further keys allowed to push certificates (e.g. during a migration).";
|
|
||||||
};
|
|
||||||
|
|
||||||
config.users.users.root.openssh.authorizedKeys.keys = map (
|
config.users.users.root.openssh.authorizedKeys.keys = map (
|
||||||
key: ''restrict,from="10.10.0.10",command="${lib.getExe install}" ${key} xmpp-cert-sync''
|
key: ''restrict,from="10.10.0.10",command="${lib.getExe install}" ${key} xmpp-cert-sync''
|
||||||
) ([ config.asxpio.xmppCertSyncKey ] ++ config.asxpio.xmppCertSyncKeysExtra);
|
) [ config.asxpio.xmppCertSyncKey ];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ key_pub=$(openssl pkey -in "$tmp" -pubout | sha256sum)
|
||||||
chmod 0644 "$tmp"
|
chmod 0644 "$tmp"
|
||||||
mv "$tmp" "$dir/$name.pem"
|
mv "$tmp" "$dir/$name.pem"
|
||||||
trap - EXIT
|
trap - EXIT
|
||||||
# Not running during a restore or on a rehearsal host: ejabberd reads the
|
# Not running during a restore: ejabberd reads the
|
||||||
# file at its next start
|
# file at its next start
|
||||||
if podman container exists xmpp-ejabberd; then
|
if podman container exists xmpp-ejabberd; then
|
||||||
podman exec xmpp-ejabberd ejabberdctl reload_config
|
podman exec xmpp-ejabberd ejabberdctl reload_config
|
||||||
|
|
|
||||||
|
|
@ -1,74 +0,0 @@
|
||||||
# asxpio-ops on a throwaway server: the same system with its own keys,
|
|
||||||
# its own addresses and SSH open to the world. Pairs with ./services.nix
|
|
||||||
# on a private network with the production addresses (10.10.0.10/.20).
|
|
||||||
{ lib, ... }:
|
|
||||||
{
|
|
||||||
networking.hostName = "rehearsal-ops";
|
|
||||||
sops.defaultSopsFile = ../../secrets/rehearsal-ops.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:c015:f949::1/64" ];
|
|
||||||
|
|
||||||
# A restored copy of production must not mail anyone, sync mirrors or
|
|
||||||
# call webhooks
|
|
||||||
services.forgejo.settings = {
|
|
||||||
mailer.ENABLED = false;
|
|
||||||
service.ENABLE_NOTIFY_MAIL = lib.mkForce false;
|
|
||||||
mirror.ENABLED = false;
|
|
||||||
webhook.ALLOWED_HOST_LIST = "loopback";
|
|
||||||
"cron.update_mirrors".ENABLED = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# The names point at production, so no challenge can succeed here:
|
|
||||||
# ask the staging CA, and expect Traefik's self-signed certificate
|
|
||||||
asxpio.letsencryptCA = "https://acme-staging-v02.api.letsencrypt.org/directory";
|
|
||||||
|
|
||||||
# No alert mail from a test pair
|
|
||||||
asxpio.alertEmail = "nobody@example.invalid";
|
|
||||||
services.grafana.settings.smtp.enabled = lib.mkForce false;
|
|
||||||
systemd.timers.crawler-alert.enable = false;
|
|
||||||
# No services host behind 10.10.0.20 on the test network
|
|
||||||
systemd.paths.xmpp-cert-sync.enable = false;
|
|
||||||
systemd.timers.xmpp-cert-sync.enable = false;
|
|
||||||
systemd.timers.crawler-weekly.enable = false;
|
|
||||||
services.loki.configuration = {
|
|
||||||
# No Object Storage keys here: everything on local disk
|
|
||||||
schema_config.configs = lib.mkForce [
|
|
||||||
{
|
|
||||||
from = "2026-11-01";
|
|
||||||
store = "tsdb";
|
|
||||||
object_store = "filesystem";
|
|
||||||
schema = "v13";
|
|
||||||
index = {
|
|
||||||
prefix = "index_";
|
|
||||||
period = "24h";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
compactor.delete_request_store = lib.mkForce "filesystem";
|
|
||||||
};
|
|
||||||
|
|
||||||
asxpio.wireguard.peers = [
|
|
||||||
{
|
|
||||||
name = "asxpio-services";
|
|
||||||
publicKey = "DwCNEfzgV1fU2ZPwEwkxun/s8vMZYrzdp74ZDrrSTD4=";
|
|
||||||
allowedIPs = [
|
|
||||||
"10.20.0.20/32"
|
|
||||||
"fd69:69:69::20/128"
|
|
||||||
];
|
|
||||||
}
|
|
||||||
{
|
|
||||||
name = "laptop";
|
|
||||||
publicKey = "iTY+NChSd8pcm/vke8s8EqsxjwEJpBEc07PfEg1Q0zQ=";
|
|
||||||
allowedIPs = [
|
|
||||||
"10.20.0.2/32"
|
|
||||||
"fd69:69:69::2/128"
|
|
||||||
];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
@ -1,33 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
# REHEARSAL HOSTS ONLY. Run after restoring production's Forgejo data and
|
|
||||||
# before any runner is started against it.
|
|
||||||
#
|
|
||||||
# A restored database still has production's queued jobs, its schedules
|
|
||||||
# and its Actions secrets (deploy keys, registry tokens). A runner would
|
|
||||||
# pick the jobs up and deploy to production from the test server. This
|
|
||||||
# cancels what is queued, removes the schedules and deletes every secret.
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
case "$(hostname)" in
|
|
||||||
rehearsal-*) ;;
|
|
||||||
*) echo "refusing: $(hostname) is not a rehearsal host" >&2; exit 1 ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
db=/var/lib/forgejo/data/forgejo.db
|
|
||||||
systemctl stop forgejo.service
|
|
||||||
sqlite3 "$db" <<'SQL'
|
|
||||||
BEGIN;
|
|
||||||
DELETE FROM secret;
|
|
||||||
-- 3 = cancelled; 5 waiting, 6 running, 7 blocked
|
|
||||||
UPDATE action_run_job SET status = 3 WHERE status IN (5, 6, 7);
|
|
||||||
UPDATE action_run SET status = 3 WHERE status IN (5, 6, 7);
|
|
||||||
UPDATE action_task SET status = 3 WHERE status IN (5, 6, 7);
|
|
||||||
DELETE FROM action_schedule_spec;
|
|
||||||
DELETE FROM action_schedule;
|
|
||||||
DELETE FROM action_runner;
|
|
||||||
DELETE FROM webhook;
|
|
||||||
DELETE FROM push_mirror;
|
|
||||||
COMMIT;
|
|
||||||
SQL
|
|
||||||
systemctl start forgejo.service
|
|
||||||
echo "sanitized: no secrets, no queued jobs, no schedules, no runners, no webhooks"
|
|
||||||
|
|
@ -1,61 +0,0 @@
|
||||||
# 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";
|
|
||||||
asxpio.xmppCertSyncKeysExtra = [ ];
|
|
||||||
asxpio.xmppCertSyncKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHXhvaO3Dhkw3QuMUHycoPU12Vx8bKWk2PCFoULvnTAf";
|
|
||||||
|
|
||||||
# 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;
|
|
||||||
});
|
|
||||||
|
|
||||||
# Dummy keys; and nothing here may write to the production buckets
|
|
||||||
systemd.timers.s3-replicate.enable = false;
|
|
||||||
|
|
||||||
# This runner would take real jobs of another project
|
|
||||||
systemd.services.forgejo-runner-interop.wantedBy = lib.mkForce [ ];
|
|
||||||
# Production's runner UUID: a rehearsal needs a runner of its own
|
|
||||||
systemd.services.forgejo-runner-asxpio.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"
|
|
||||||
];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
Run every minute by security-metrics.timer; writes a node_exporter
|
Run every minute by security-metrics.timer; writes a node_exporter
|
||||||
textfile. What is expected (peers, hosts, users, ports, containers) comes
|
textfile. What is expected (peers, hosts, users, ports, containers) comes
|
||||||
from /etc/security-metrics.json, written by Ansible: anything else is
|
from /etc/security-metrics.json (monitoring-agent.nix): anything else is
|
||||||
exported with known="false" and Grafana alerts on that.
|
exported with known="false" and Grafana alerts on that.
|
||||||
|
|
||||||
Never reads `wg show <if> dump`: it prints private and preshared keys.
|
Never reads `wg show <if> dump`: it prints private and preshared keys.
|
||||||
|
|
|
||||||
|
|
@ -1,65 +0,0 @@
|
||||||
wireguard:
|
|
||||||
private_key: ENC[AES256_GCM,data:+3PtBGDBPf+n7NDPOipmHHKDe/doHVGIPd7bnp8fhqifVdjxbYDQoDRYYxw=,iv:8bsXcGVOTechmWNVl8P9ZigAqhP1b+IKAFAuHxJ+dN4=,tag:B2ysVrViv0eGVzom0zIncg==,type:str]
|
|
||||||
psk:
|
|
||||||
asxpio-services: ENC[AES256_GCM,data:kEkyRP87uH9rxCvm+ny+TZ5H3k6522egipIKtC7QuiS+qiLTexQ21O81FN4=,iv:fGo9wsRuy3LfKOhZDuShZaoCATMR6GAn18UPtwGjXUQ=,tag:i0dWMtt+LL/iN8qFUCKUIQ==,type:str]
|
|
||||||
laptop: ENC[AES256_GCM,data:4UoNNtwYBGQ30mrKnWZDnxVc5IIwd8IJnxTUdT1WSobq5+S8zuvG0hLGM6w=,iv:GcTfX7HSipNmWc1osWmuPF1A/4X/6zgvzsgd28INxFY=,tag:Is+4ylonzAuYSHUYkd4zlA==,type:str]
|
|
||||||
restic:
|
|
||||||
password: ENC[AES256_GCM,data:KbutI62YpvVH2/D1Sru6,iv:JSQXHnFuJBZQQJqQg0OV9JdxZqEeU37wg2oylrmJn7I=,tag:wRJQ6lZtmZbRdcDlOnHHvA==,type:str]
|
|
||||||
s3:
|
|
||||||
access_key: ENC[AES256_GCM,data:jS5lAcnkXEWY2NEcrgz/,iv:Aj3JB0Vl9Fl48fILIsatQqMmUg4gJlVBjaHclNzxnsA=,tag:MJ7EkWodP4r65cgJL5PkKw==,type:str]
|
|
||||||
secret_key: ENC[AES256_GCM,data:SBcQ+wDpts+ZoXaWFV/v,iv:yzdX7ZBrwHxjlIGlmBf5L5xGaA6z2JTfAiA+/cl9vN0=,tag:ggQ1Q2KhsViGLddn3f+QSQ==,type:str]
|
|
||||||
alert:
|
|
||||||
smtp_user: ENC[AES256_GCM,data:zC/uLUsNtcjcgeRqxX7dKuHZ20sYXC5qDg==,iv:BORb+IZ0liuuSkJ/SEKH1ODAdPP0Krk1dgzs3s1+Qg8=,tag:mlkcvX3/N3qfi60T7CTIzA==,type:str]
|
|
||||||
smtp_password: ENC[AES256_GCM,data:tm0lKVPNReWzHM6CSRWQ,iv:cQRbeAPcIRfdefsGhqz9kRTs49T0aPEPlJbCspw7s7E=,tag:DSR/D7t2lLb6DRCYH2GeKg==,type:str]
|
|
||||||
recipient: ENC[AES256_GCM,data:MwSUWfKT7v5oNQKTGm6ZboZJ5uwt/A==,iv:ZAos4tQzsuj6slfXkLnVCERKctnC+wtxEvw9l3jCcds=,tag:oUtprN6MdGJTNO8W/fqUVQ==,type:str]
|
|
||||||
postgres:
|
|
||||||
asxpio_password: ENC[AES256_GCM,data:2xhZDqQWrJhV4o4+VYpiRVpiiiznDtYrTMIRoNrmEVs=,iv:jGi3vyOg/WBMvIIfIQVoJxXJxc7eXP5Yz7zSwValO/M=,tag:XkpVl0QcbCLSgXAZ76I2cw==,type:str]
|
|
||||||
bingo_password: ENC[AES256_GCM,data:MO+8VUINZMyQz30UCXIlx84Vniyv6dvBEslliFAYYoE=,iv:wFV0rx7bw5hvEQuyhXv80mSReCSXC77uMPhbxc82Qa8=,tag:yNbXFNj+9SJeZcaSO6rZlg==,type:str]
|
|
||||||
garage:
|
|
||||||
asxpio_access_key: ENC[AES256_GCM,data:3mtBNKwG+utyLSimWhxc7BAxvC9ogI7VfDSoJrcVLB0=,iv:/zgX/pc0BPCApVJD/09SF32qCTm+IB2Mk5ydOMv6Z/s=,tag:0PjNNj1Ae+4a1GOZTDIOqg==,type:str]
|
|
||||||
asxpio_secret_key: ENC[AES256_GCM,data:z6rLprWXshsH3XnK28uEqfPDaGJamW9gQbb5rMuCtVY=,iv:0nBmvsFgGZr45lySAgjoAgf+KhYSCxAgS467ei53108=,tag:i9WY9rj35/iil/Q6W30YdQ==,type:str]
|
|
||||||
bingo_access_key: ENC[AES256_GCM,data:Y0ZQsK/KumX+ir7FC3DlbdV7UN1t4vzHtzfAnosgVfo=,iv:i0s8YVTOhhRixaSmJVIF5P24rF1gU/8fjoR7RHn5/f8=,tag:hMB6DN3HkpvSZhwZQr28CA==,type:str]
|
|
||||||
bingo_secret_key: ENC[AES256_GCM,data:yKKXyOxi/sr5Nqqg8pGA8x0XXrdjDaePFxqb3WP3Ss4=,iv:KiNIGHsE/hYs28j7tZMLRWt24QkbrbvSKn2KnD3i+J8=,tag:hMAzSR87RqT65yikriRsAA==,type:str]
|
|
||||||
public_access_key: ENC[AES256_GCM,data:sT73xqcg2ZLiYMqd1fasyapxqBQ6HGq/jdIk2JbRkq4=,iv:ypQyuz+O4FGZbvDobml+vr2z0MDvEcrDooTjKD6uqk0=,tag:nAZm76/JLTHMbDlU0BXnqA==,type:str]
|
|
||||||
public_secret_key: ENC[AES256_GCM,data:4B6J7wpJLBYSM+H4z3WatO24la8UYbxRYutzrcUmB9Y=,iv:Y9KHJsf3N/+yGeELw2I4ejNR0oeS8e/TLWJbUa0qbRE=,tag:sL6ODhQHSsQQv/uRNqk3Lg==,type:str]
|
|
||||||
rpc_secret: ENC[AES256_GCM,data:Uelv13vsPHYFhr/f60MKY7zR9HODi8EJZ6zsEyNLG3nEXzVOlWRqyCxZIsFeoM/S0o0EfyMH2dC+/6hLKzJifw==,iv:mGM2OK3De27FT4xX9lvXPK601NLZADcbot8MqbultoY=,tag:YxztR/ZpQUU5b/H1alWClA==,type:str]
|
|
||||||
forgejo:
|
|
||||||
secret_key: ENC[AES256_GCM,data:w/GkpP/8X6YG11Sfy5f3BoeN1CJycEuQfI8LWgjk1WA=,iv:RQMkjF2m+SIcAuumzJWd+Oi7d3v0I0ZhV6Vsdk2wVlU=,tag:7fjbTi7tftry0pNU6swpjA==,type:str]
|
|
||||||
jwt_secret: ENC[AES256_GCM,data:MdztCbG0J76qPgkDzUxwnYccmC3cHTSi07x4+Mo436r/eLO88UFuUpbwFQ==,iv:bKPLDSnKh9g1sIwn7sJS+ULSzwOCSpnyGRgWqQADrIg=,tag:aWndLj+pWTmcPIIkZkQiUw==,type:str]
|
|
||||||
lfs_jwt_secret: ENC[AES256_GCM,data:dTFtLBp2IwQT47ttq1c/BCMdOfFmucOma3h8EDjg0JINWa29p6MOiVqaPw==,iv:z4Z4dgpEtGttxEO/J3bINTtwNaQTBTgdm7yUs/DyDJk=,tag:AWhAEUrPiJp+eA10qPmGVw==,type:str]
|
|
||||||
smtp_user: ENC[AES256_GCM,data:nDb2aHuzpGrI1oLXUfN28BzpZxa6RDhcXfVWrKkZajw=,iv:UPbztzd4DskSGxsgaewiOOtKL3Fl2ixVBuVkesPdRwM=,tag:gLvl0Gauf1zTSoiIfKHveQ==,type:str]
|
|
||||||
smtp_password: ENC[AES256_GCM,data:Z+grwJY+laJ7gXofpqO8evyVlSXCRgEkgGHGpoo5/W4=,iv:FIlHHxofd7ZautCtHAe+xiCyWUy5eT9w4/PtljWwpw8=,tag:Lo7M38k/rzLpZe6r4K+aRg==,type:str]
|
|
||||||
metrics_token: ENC[AES256_GCM,data:6pp3/k6wi+UraWlWft6ns16OjvX0cWUo0EegsNY1LmQ=,iv:qKtM9Gz4ozjXLi8HnJf3w5i3FE9r1889VBYBUFLpz7A=,tag:BKGmncQcQaiUJIetsfYlWQ==,type:str]
|
|
||||||
internal_token: ENC[AES256_GCM,data:yFi0mqzutad4X0yVKA1u7oE3SB2na3+eN7DF9AI4LpBpIKD0nDf8c4CCbBvEbLRP56zuRW+NteGSvFgAALdlOB+HIvb+1zAn8DRRjZu+M/U=,iv:falRgW4WLk6PB9ICTAjffbmxRsUKRZiBjxnq20cNTcU=,tag:SuuSxYe+eOqxBAexh2oMNA==,type:str]
|
|
||||||
traefik:
|
|
||||||
letsencrypt_email: ENC[AES256_GCM,data:3tZhdsKwE0m5LMAqh453Oz/+lzhN/MErWg==,iv:yP29+EnYDadPZbYcXVL5XTYW4Uqf4zODzWpLI1r+ub4=,tag:d33uL83/bA9eHUD056XPhA==,type:str]
|
|
||||||
xmpp_cert_sync:
|
|
||||||
ssh_key: ENC[AES256_GCM,data:mV4yXFb9cvsOEoti2Rpl8QZiT8IMLMlGpGoeUfEOwquygLEEc/Ctc22x+Zjl8U3iEZik9ZDYtew6UkIjd2bkqyGjvz+uY7iFBrEIJTK0GxJl7t8xXQ6B2lc1fFZPWJDi9uHxbjDsqPwwVVFpt2tDQpJ43VHy7p6OOehQgIHiFDjyAGbpFD+IMN+3Z5TZWEfjlu5cFvJPQufJYanKhSclRR23NOyn1EUYZd6aXckz9x169o+1x8e3b0niZjkVdjgjdIfAENjiC0+GDFzEDvWib3P1j8gAdUW5YSA3ekPmmXraamIUDcv+ofRb1zu40Rcpk7Rc7DX0zHH2cNeB3SUEFKEBOJnM1h7p9yMzvYly2FxOAmMPGP76H5/xYEf3gxBD+mHMTygjmZnhFyqX52V0ML46wlrq9n4epa+xigh/IIbNLmz6Hk3z2X/b/tiEmSf0aIiIajvtCn8uYvuDYi8CIMAD+1gODjB3WJdKpKR3xLBF5Vi5XgDPrN8LbtpwYTxlqDCccW3VWB0ZdUZHjieDyOckOcvgvafUymtRQgopszfVUd4=,iv:paNOYweMsWHCV/Rg61K4/VxQCkcSU1/TBQjYCnzTe3M=,tag:LHagTSw5Jq7nQVIHEVfviQ==,type:str]
|
|
||||||
monitoring:
|
|
||||||
grafana_admin_password: ENC[AES256_GCM,data:RKCJOitUrbMT9+rPvF1iTHfDA8tjYTvid4k5SNpKNobmjXD9Qd13JQ==,iv:iXSZ1SAbDRkWMd0eorCkY79B2atzKjGwK9QnCWQ+TXQ=,tag:5QSbonnUCqthqc9EBXOJmA==,type:str]
|
|
||||||
hcloud_ro_token: ENC[AES256_GCM,data:nxiFpPD/QUn0jgFdCjrLtXlT/KG4zkBRMwpgxFCwjcEwz8b1tk93Sw==,iv:ioKZ7eX9G5AxVrdQyNySKfQ/e9dr640MhPoXbz0JaCc=,tag:t6HYdXkS0lExvIz+YhnL/Q==,type:str]
|
|
||||||
grafana_secret_key: ENC[AES256_GCM,data:tK99AS/MgNhZoweGXpVMwSLjjM8+zQPTj05gOXiJYBqwlsxJK6feGQ==,iv:yxLmezKIVt4vqwVwsBd1ztvLCgkriISFN4Db8QPs++c=,tag:0xPwFYMlQkZNTlCZRya+YA==,type:str]
|
|
||||||
sops:
|
|
||||||
age:
|
|
||||||
- enc: |
|
|
||||||
-----BEGIN AGE ENCRYPTED FILE-----
|
|
||||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBreDl5dVA3K3R6LzEzVkVX
|
|
||||||
VkVaY3dacjU2OFFWLzdFdmxOVGR1OVpNdWw4CnFNN2tVNDdkM2ZWQTE5TGFKbGlL
|
|
||||||
VUxEZ01sNk5RL3AzWG4wdnk5dVNtSW8KLS0tIGhkT2ZIYTZ1b0ZtTUpKTTd1aW9m
|
|
||||||
NjVhUkI5QnZOSWxWL3VjWmJGbDFGRzgKdRmEd3BbVeSMbzuj+alpEe+812FVresO
|
|
||||||
EtyvWrmeui2FMUP5wAJRKaCo2uoDlCsNMGlMYUABSE8VGvp8EtHyOg==
|
|
||||||
-----END AGE ENCRYPTED FILE-----
|
|
||||||
recipient: age19xvmm6j3h2u6mc3w6k65ufry4p5aa5lwu96p55h3e42p9wfzwc0qp2w7pk
|
|
||||||
- enc: |
|
|
||||||
-----BEGIN AGE ENCRYPTED FILE-----
|
|
||||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBrVUc2eUppeTVaTmRTVFJy
|
|
||||||
L0xMVVRSanIraWJKTC9tazdDN3JMTUNDTUZnCnFLRXRMZ2RYRkJ4MUdWUGZrTGN2
|
|
||||||
MDlrbEVQR2dld25Kayt6T3RoQlU5Z0UKLS0tIHVlOTZEVGUyY2ZnMmhGbE9LQWNP
|
|
||||||
aU8xUm5tdW9WNUxFaGI1K2tUbjJFREkK0aHOJ+uQUSx/XbhSo3QdWWdXFxH8QW2x
|
|
||||||
rk/NS8GmCAjgxzv7dochfGLLH5pimVe7gniKW9FgonLMdRR1MR4WWw==
|
|
||||||
-----END AGE ENCRYPTED FILE-----
|
|
||||||
recipient: age138t70j9mf3su6krnt2ygxdy4xwm2wpyrgjjhk7rlzpr3tkdhcuyqdywfjl
|
|
||||||
lastmodified: "2026-11-17T00:40:51Z"
|
|
||||||
mac: ENC[AES256_GCM,data:GfJBC73iJcXVroSEXbRhYPE0CrHANiPccWe5fCGx9ZzgeaBStCLDfSk2mkLmWsn/M87UzSTxus95Y09JojGmSwhgnoMfrVc26T/WuiyfJj4r4J7K83E/HR6XsIckc1xBcc6I9dbbvHRIhPj23hjz9jTbt5oa0/f5Rhj5I5u6NYE=,iv:gWwtV2tMWdmssSQ9iH54FTntNb4jDuzZNOrlge9qi5k=,tag:VIDg7swKFuB5KAGNyjaiWA==,type:str]
|
|
||||||
unencrypted_suffix: _unencrypted
|
|
||||||
version: 3.13.3
|
|
||||||
|
|
@ -1,42 +0,0 @@
|
||||||
wireguard:
|
|
||||||
private_key: ENC[AES256_GCM,data:cnprcM/YYHqjFXi10VevcRWr/X6IJ/n+W/s219nKLKWioFrJrKxiyy+Avy4=,iv:cfb2wftlCrNEXheeSbBzBQFTrBRW90W7cJ7NA+Y48j4=,tag:rUzhF7dR3JX2hVrNG6Cuzg==,type:str]
|
|
||||||
psk:
|
|
||||||
asxpio-ops: ENC[AES256_GCM,data:aQxf1iS3dwy3gK/WGJQCMKGhICbTi6NKSM+pxYqg6OkzQrSIR2YPMmoWYnQ=,iv:3IUW0DVOrnfW/SZhYM3BVq4fUm2KNwoBVx0n/DlMyPM=,tag:TCglE8molI8WA1DEFEt3Zg==,type:str]
|
|
||||||
xray:
|
|
||||||
config: ENC[AES256_GCM,data:eYP+HL3aPTZAsvHNNAk19YeQfyzFDWwSeTLNkvBfFseyHLIUJpvgQ5MxB3eCBvDA3jbOQ9zZnDuDqeSpsfdm/QDlssCbkQQyU+A6+iS82+xOIkvDcns9g0paUFugfLOJa1p1agLMiqgi3Kz+0VMap2Nw2kwaGAreXrKngMZ1DAa5zE/WdyD+eD4zRmUG9Z9cvTkAga9KndEadpDRJLMr6VmauwpqDKgjqttJmvEnqg+4x6/A,iv:/1jU8vkraPgAALRrQkSTJy73E9qsKPLDLaMIMnSpq5Q=,tag:htJ3UZd7MySUEzRyfMDbZQ==,type:str]
|
|
||||||
restic:
|
|
||||||
password: ENC[AES256_GCM,data:jgeMSNlqyJWYoCYtqHfg,iv:puPQYTYk/fs+WoQs8VYZeIb9bX/3s2wyl8yn/815Aa0=,tag:Mu6xBfQzM4W5IY4I8uz+fw==,type:str]
|
|
||||||
s3:
|
|
||||||
access_key: ENC[AES256_GCM,data:AJYd7gM6Vg6Ewe1EhBWS,iv:F0y9p7FppQG3cfgZufcfcAEWwMEcXDyS5n+OQWw4Sho=,tag:f/fRchi7tOEg3HZeE8v++Q==,type:str]
|
|
||||||
secret_key: ENC[AES256_GCM,data:1o4xUAk9lCTKyjgA6yp6,iv:bZjPL3lZ0bGqQ4oft/urwIFjYTfgDf/2Qs5PeD53hxA=,tag:BRUOpHBAaZC5u5KRfHGYIA==,type:str]
|
|
||||||
alert:
|
|
||||||
smtp_user: ENC[AES256_GCM,data:GjrmbNdhQW4OxGZopwxImouX3+OlI9ITVA==,iv:L6M50N2ueJ6TvErr8OCRSwsIiMR4tvROfWqeqpRjGSA=,tag:V69vqNgUQ9Ht6P0Q/p+BIA==,type:str]
|
|
||||||
smtp_password: ENC[AES256_GCM,data:9vaW7csqXSzf4dG1mjQa,iv:tr5tftd+7bor27BRD3DL7iOhQeb8gMrGgUsC4DZ271M=,tag:tchVoYgKwXuuWI1yDGi/Rw==,type:str]
|
|
||||||
recipient: ENC[AES256_GCM,data:JarmuqFMM3C2K2ctzYtTyEk2V9m+RA==,iv:MGZDIvkoISphn4FEmYynoQXkN4oTOoBztNJB77jLrtU=,tag:CNH8FxBKRKIhGONjFI/wsQ==,type:str]
|
|
||||||
runner:
|
|
||||||
token: ENC[AES256_GCM,data:tzn3NaRCT+Dm3JaRPiht9zRyzU1OssLKDTaUk3JcDK7CbR8G6aB3VA==,iv:7czzYJOTQNMpRgt61fKTEsclU1HsbbpQA24kDDPjttY=,tag:ZHdAmTXidprSdfJxFEnrdw==,type:str]
|
|
||||||
interop_token: ENC[AES256_GCM,data:ul8ureU=,iv:ZxSJTSQWzaxmYkfRGgYbvtxCe3HSCbmh383e1XfAi5c=,tag:vG2AhibHpHWkMl6kNVmk4A==,type:str]
|
|
||||||
sops:
|
|
||||||
age:
|
|
||||||
- enc: |
|
|
||||||
-----BEGIN AGE ENCRYPTED FILE-----
|
|
||||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBFbXU5c280OHU3ckFsQVNF
|
|
||||||
dFRVZ2RRcFhtdzF0MmVoVUR5NDdJRmZ6L1FvClQ2SWpHMlZPVzZlK3o2MTRNcFRT
|
|
||||||
OGxoT3RMV2FyVkNFczBIZ1lxd2dFMDQKLS0tIDlad1FqK3ZaTSt2VU1qV1BjQWFi
|
|
||||||
b2thTVpXTjlQVENhaU13alM2M3orM0EKKOJKCj+7E179iinCfMmnmlevsq+MBYzi
|
|
||||||
S69orRnYRk2EIeiLs7Pu6zfPOT3ni4NTuAxlYohuyJdUz5GefT0p/Q==
|
|
||||||
-----END AGE ENCRYPTED FILE-----
|
|
||||||
recipient: age19xvmm6j3h2u6mc3w6k65ufry4p5aa5lwu96p55h3e42p9wfzwc0qp2w7pk
|
|
||||||
- enc: |
|
|
||||||
-----BEGIN AGE ENCRYPTED FILE-----
|
|
||||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBycXBqb0dNZlJxS2x0ME9I
|
|
||||||
dnJ0dWpickdQcHdreDIzL1RmdDZTekxRVWtvCjlrWkFaYUZpWHlpcjhYd2dPR09r
|
|
||||||
SUJoTEI2YVdyV0p6RnhtaGZFRDg2N0EKLS0tICtwckRQaWtnNFBlQzZUM0ROM0hz
|
|
||||||
WU5KOVpkR1JVLzNzWXdkdTJPN1hLLzAK0OZbTcXa2fLqJcKMKFQVOoCUT9SLeEzS
|
|
||||||
TAGv1m7E3iWqIfMypX6bGD1TIFEBbVbwN9EzOXMqYRdo6e70vf3CUQ==
|
|
||||||
-----END AGE ENCRYPTED FILE-----
|
|
||||||
recipient: age1au6f8m6l245ddrunqf2a62xprnlevn9yrducynlay2tgknfxeeusj94j5l
|
|
||||||
lastmodified: "2026-11-17T00:40:51Z"
|
|
||||||
mac: ENC[AES256_GCM,data:zIvQ90qP1C+IkMaTnw9EKWHxNZYAi3IeRcNlB8wNk4D3ITWnLzd44CSkNlT6D/S399wBbdxodiUBt2Hd/8Tyk9l3Cuz+Qbz6YQ1k1Tk9AIDMrq8ktQJbi+/InHSjC6DkHBWFlRmw6ir/QWMsCZqXP4QW7R7JFU6NHO4T5Y67KCg=,iv:fuPmBtukuhw7c09jIJ1Gv1amHKTEAyYcWE0/7n7FtqY=,tag:EDtcov4LOIfRtSM6ihV8ZA==,type:str]
|
|
||||||
unencrypted_suffix: _unencrypted
|
|
||||||
version: 3.13.3
|
|
||||||
|
|
@ -89,10 +89,24 @@ tofu plan
|
||||||
tofu apply
|
tofu apply
|
||||||
```
|
```
|
||||||
|
|
||||||
In a new project the state bucket does not exist yet: comment out the
|
### First run: the state bucket
|
||||||
`backend "s3"` block in `providers.tofu` for the first apply, restore it,
|
|
||||||
then `tofu init -migrate-state`.
|
|
||||||
|
|
||||||
|
The state bucket `asxpio-tofu-main` is itself a resource here
|
||||||
|
(`s3.tofu`), so in a new project `tofu init` fails: the backend points at
|
||||||
|
a bucket that doesn't exist yet. Bootstrap it once with local state:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 1. comment out the backend "s3" block in providers.tofu
|
||||||
|
tofu init
|
||||||
|
tofu apply -target=minio_s3_bucket.state_main # just the bucket
|
||||||
|
# 2. restore the backend block
|
||||||
|
tofu init -migrate-state # copies local state into the bucket
|
||||||
|
rm terraform.tfstate* # S3 holds it now
|
||||||
|
tofu apply # everything else
|
||||||
|
```
|
||||||
|
|
||||||
|
The bucket holds the state that manages it, so it carries
|
||||||
|
`prevent_destroy`: a plan that would delete it fails instead.
|
||||||
|
|
||||||
## Files
|
## Files
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,11 @@ resource "minio_s3_bucket" "state_main" {
|
||||||
provider = minio.hel1
|
provider = minio.hel1
|
||||||
bucket = "asxpio-tofu-main"
|
bucket = "asxpio-tofu-main"
|
||||||
acl = "private"
|
acl = "private"
|
||||||
|
|
||||||
|
# Holds the state that manages it
|
||||||
|
lifecycle {
|
||||||
|
prevent_destroy = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "minio_s3_bucket" "state_repl" {
|
resource "minio_s3_bucket" "state_repl" {
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue