Install

Build seawall from source, upgrade it in place or remove it.

Build and install

The repository isn't public yet. These steps work for people with access to it.

The build needs git, a C compiler, an SSH key with access to the repository and rustup, which installs the Rust toolchain the repository pins. seawall init needs Docker Engine and Compose. ~/.local/bin must be on your PATH.

sudo apt install git build-essential
git clone [email protected]:Iverik/seawall.git ~/repos/seawall
cd ~/repos/seawall
cargo build --release --locked
mkdir -p ~/.local/bin
install -m 755 target/release/seawall ~/.local/bin/

Tab completion covers stack, container and game names in bash, zsh and fish.

seawall completions --install         # shows the line it adds
seawall completions --install --yes   # adds it after a backup

seawall about prints the version with its commit and build date. It also shows the config file and the host name.

Upgrade

cd ~/repos/seawall
git pull
cargo build --release --locked
install -m 755 target/release/seawall ~/.local/bin/
seawall init
seawall backup image --yes

Run seawall init after an upgrade. It shows a step when one of seawall's own systemd units differs from the version you run. seawall init --yes replaces it and keeps the old one in ~/backups/systemd/.

With data backups set up, backup image --yes builds this version's restic image on each runtime now, so the night's backup has nothing to fetch.

Uninstall

sudo systemctl disable --now $(systemctl list-unit-files --no-legend 'seawall-*.timer' | cut -d' ' -f1)
sudo systemctl disable seawall-docker-rebind.service
sudo rm -r /etc/systemd/system/seawall-* /usr/local/libexec/seawall-* /etc/seawall /var/lib/seawall
sudo rm /etc/audit/rules.d/6?-seawall-*.rules /var/lib/node_exporter/textfile/seawall-*.prom
sudo rm -f /etc/apt/apt.conf.d/52seawall-* /etc/apt/preferences.d/52seawall-*
sudo augenrules --load
sudo systemctl daemon-reload
rm ~/.local/bin/seawall
rm -r ~/.config/seawall ~/.local/state/seawall

This removes seawall, its timers, its root files, its audit rules, its config and its state. Stacks keep running, the ones init set up among them. Backups in ~/backups/ stay. So do these files, which other software uses once init has written them:

  • /etc/apt/sources.list.d/crowdsec.sources and /etc/apt/keyrings/crowdsec.asc, for the CrowdSec bouncer package.
  • /etc/sysctl.d/60-seawall-cis.conf and /etc/ssh/sshd_config.d/05-seawall-cis.conf, when host fix wrote them.

These stay too, until you remove them:

  • /etc/update-motd.d/60-seawall, a root script run at each login. It exits at once when the binary is gone.
  • The link /etc/systemd/system/docker.service.wants/seawall-backup-egress.service and the rule that service put in DOCKER-USER, when the data backup was set up. The rule stays in iptables until you delete it or the host reboots.
  • The apt holds that seawall-upgrade-rollback.service places on Docker or bouncer packages. apt-mark showhold lists them.

Development

scripts/check.sh is the gate before a push. It runs formatting, Clippy, the tests, cargo deny and the generated docs, and needs gitleaks in /usr/local/bin at the sha256 the script pins, cargo-vet, a systemd user manager and 12 GiB of free memory (it waits up to 60 minutes for that). A release build needs none of it.

scripts/check.sh