Config capture
Keep the host's config in a Git repository, each secret sealed to your age key.
Set it up
seawall cloud init --repo ~/host-config --recipient age1... # the plan
seawall cloud init --repo ~/host-config --recipient age1... \
--remote [email protected]:you/host-config.git --yes
cloud init makes a config repo seawall keeps, in a new or empty folder. Each secret is sealed to your age public key, so only your private key opens it. Keep that key off the host. With --remote each capture is pushed to a private GitHub repo with a deploy key.
It installs a capture every day at 05:20 UTC (timers.capture) and a drift check at 17:20 UTC (timers.drift).
Capture and drift
seawall cloud status
seawall cloud capture
seawall cloud drift
seawall cloud log
cloud status shows the last capture and drift check and whether the repo is pushed. cloud capture runs the capture now. It commits and pushes. cloud drift lists what the host has that the repo's last commit doesn't. cloud log lists recent commits. cloud sync covers new /etc files, captures now and checks drift again.
cloud.host_files lists the host files the capture keeps. Folders must be under /etc, and folders that hold keys or passwords are refused. By default it keeps the files seawall writes, the firewall rules among them. seawall init --only facts applies a change. A restore shows each host file's diff, asks before writing it and writes it after init.
Restore
seawall restore --from [email protected]:me/host-config.git --check
seawall restore --from [email protected]:me/host-config.git --commit <id> --age-key ~/owner.key --yes
seawall restore puts a host back from the config repo at a commit you name. It confirms each setting that widens what runs, refuses a commit with a link or a submodule, then restores seawall.toml, runs init and restores each stack. Without --yes it prints the plan. --check also lists what needs confirming, without your key.