Smaller things from setting up single sign-on
Authentik trusts X-Forwarded-For headers from every private address range out of the box. That makes sense behind a reverse proxy. Ours has none in front of it, so any device on the home network could have claimed to be any other address. The trusted range is now loopback only, and the agent tested it by sending a forged header and checking it was ignored.
A fresh Authentik leaves its initial setup page open to anyone who can reach it until someone completes it, so the first-time setup was done straight after the first start, before anything else.
Certificates are picked up by Authentik from a folder: each subfolder with a certificate and key becomes a keypair. A staging folder inside that folder would also be picked up, so new files are staged elsewhere and moved in, and the worker restarted to rescan.
The VMs are built from the Arch cloud image, and its signing key isn’t in pacman’s keyring or anywhere Arch publishes keys by default. Its fingerprint is published in a README on Arch’s own GitLab, which is a different site from the mirror the image comes from. The build script checks against that, which is better than trusting a key that came from the same place as the file it’s supposed to vouch for. Also from the build: a VM created with cloud-init powers off at its first reboot instead of restarting. Start it again by hand once; after that it reboots normally.
Two shell details from the backups. podman unshare tar ignores your umask, so the archives need a chmod 600 afterwards. And sudo chmod 600 /some/dir/* doesn’t do what it looks like when you can’t read that folder yourself, because your own shell expands the * before sudo ever runs. Wrapping it in sudo sh -c '…' lets root expand it. It’s an old trap, and it still works.