Web host restoration
This procedure restores the web host from Ansible and the normal external sources. It does not describe the Ubuntu-to-Debian migration itself.
The following data has normal recovery sources and does not require a separate host backup:
- Production static site: deployed from CI into
/var/www/web-static - Beta static site: deployed from CI into
/var/www/web-beta - Firmware selector: cloned from Git and managed by the
firmware_selectorrole - Stable, testing and RC firmware: recreated from GitHub releases
- Maintainer SSH keys and website deployment keys: restored by Ansible variables
- Fastd secret and mesh configuration: preserved or recreated by
fastd_client
1. Install and prepare the replacement host
Section titled “1. Install and prepare the replacement host”- Install the target operating system and configure the host for Ansible SSH access.
- Configure the public IPv4 address and default route using the provider’s normal instance setup.
- Update DNS only after the replacement host is ready.
- Obtain a final copy of the encrypted Ansible Vault secrets and verify that
the local inventory still points to
web-ffsh.
Do not copy host files manually unless a step below explicitly requires it. Ansible is the source of truth for packages, users, keys, nginx, Fastd and mesh configuration.
2. Run Ansible
Section titled “2. Run Ansible”Run the web play in check mode first:
ansible-playbook --vault-id=fastd_key@prompt setup.yml \ --limit services_web --checkIf the check is valid, apply the web host:
ansible-playbook --vault-id=fastd_key@prompt setup.yml \ --limit services_webBefore continuing, verify:
- SSH root access and maintainer keys
beta-deployandwebsite-deployusers- Fastd listens on UDP port
10000 bat0and its configured addresses exist- nginx passes
nginx -t - Certbot certificates and renewal timer exist
3. Restore website content
Section titled “3. Restore website content”The static websites are restored through their existing CI deployments:
- Production: trigger the production deployment workflow for
/var/www/web-static. - Beta: trigger the beta deployment workflow for
/var/www/web-beta. - Firmware selector: apply the
firmware_selectorrole and verify/var/www/firmware-selector.
The production and beta deployment users and authorized public keys are
created by the website role. The matching private keys remain CI secrets.
TODO: Add the exact repository names and workflow names once confirmed.
4. Restore firmware
Section titled “4. Restore firmware”The role installs /root/firmware-release.sh. It downloads releases from
ffsh/site and maintains the following layout:
stable: promoted firmwaretesting: the published release selected for testingrc: symlink totestingorstable
Restore stable firmware in one of these ways:
# Restore the latest stable release from GitHub/root/firmware-release.sh publish latest
# Restore a specific release/root/firmware-release.sh publish <release-tag>The firmware release helper downloads and verifies the configured release
assets and updates testing and rc. The exact stable promotion step is:
/root/firmware-release.sh promoteBefore promotion:
- Verify that
testing/.release-versioncontains the intended release. - Verify firmware listings and downloads for the target release.
- Perform the manual firmware-signature check required for stable promotion.
- Preserve the intended
testingandrcsymlinks after promotion.
TODO: Add the manual signature command or checklist used for stable firmware.
5. Restore TLS
Section titled “5. Restore TLS”The normal recovery is certificate renewal or reissuance. Before changing certificate names or domains, record the certificate inventory:
certbot certificatesFor a new host with no existing certificates:
- Deploy nginx configuration through Ansible.
- Set
website_auto_issue_tls=truefor initial certificate issuance. - Run the web role.
- Verify nginx and the renewal timer.
Certbot certificate names must match the primary vhost name. The website role
passes --cert-name explicitly and places the primary domain first in the
domain list. If an old run created www.freifunk-suedholstein.de instead,
first verify the new primary certificate exists:
certbot certificatesls -l /etc/letsencrypt/live/freifunk-suedholstein.deAfter verification, remove only the unintended alias-named certificate:
certbot delete --cert-name www.freifunk-suedholstein.deBefore removing this option, run a dry-run:
certbot renew --dry-run --nginx --no-random-sleep-on-renewnginx -tsystemctl status certbot.timerTODO: Document the saved renewal authenticator and installer behavior for each certificate after renewal is tested end to end.
6. Restore Fastd and the mesh
Section titled “6. Restore Fastd and the mesh”Apply the shared client role:
ansible-playbook --vault-id=fastd_key@prompt setup.yml \ --limit services_web --tags fastd-clientThe role preserves an existing secret or generates one only for a new host. The generated identity is acceptable while the gateways accept any Fastd key.
Verify:
systemctl status fastd@ffshss -lunp 'sport = :10000'ip -brief addressbatctl meshif bat0 ifbatctl meshif bat0 gw_mode7. Final verification
Section titled “7. Final verification”nginx -t- Main and beta sites load
- Firmware selector loads
- Firmware files and the
stable,testing, andrclayout are usable - Certbot renewal dry-run succeeds
- Fastd is active and UDP port
10000is bound - node_exporter is reachable only on localhost and remains proxied at
/stats/ - Fail2ban has the default
sshdjail - unattended-upgrades timers are active
- Certificate expiry and renewal metrics appear in Prometheus and Grafana