Skip to content

The remote site

The standby VM of chapter 14 exists to take over for another household’s server. This chapter prepares that household’s side: one Ubuntu server that runs every application, a NAS that only keeps backups, a network split into zones, and a site-to-site VPN that lets the two houses see exactly one machine of each other.

This chapter is a proposal until the remote owner agrees to it. It is their network and their data. Their standing rules stay in force: no open port, remote access by VPN, updates on stable versions, and a discussion before any network change. Each part below ends with a point where they confirm before the next one starts. Parts 0 to 5 and 7 happen at their site, with you assisting. Part 6 is the only one that touches your network.

If the remote site is already in its target shape, do steps 13.1 and 13.2, then go to part 6.

Machine at the remote site Today Target
The studio PC with the GPU Windows with WSL2, runs the AI services Ubuntu Server 26.04, the only application server: Immich, EspoCRM, InvoiceNinja, FreshRSS, Ollama, docling, the Cloudflare tunnel, the network agent, the portal, syslog-ng, Portainer
The QNAP NAS Runs every application, keeps the backups, receives the public traffic Backups only, with snapshots and the existing nightly copy to OneDrive
Raspberry Pi 4 NGINX Proxy Manager (internal access), UPS monitor for the rack Unchanged, plus a backup upstream towards your standby VM, booting from an SSD
Raspberry Pi 5 Home Assistant Unchanged, backups to the NAS
UDM Pro Routing, firewall, VPN A Servers VLAN, zones with named flows, the site-to-site link
Network at the remote site Subnet Holds
Management 10.6.1.0/24 Gateway, switches, access points
Trusted 10.6.2.0/24 Personal devices, studio equipment
IoT 10.6.3.0/24 Home automation, cameras, Home Assistant
Guest 10.6.4.0/24 Visitors
Servers (new) 10.6.5.0/24 (example) The server, the NAS, the Raspberry Pi 4

None of these overlaps your 10.0.0.0/16, which the VPN requires.

Why. Three answers shape everything after them, and they are the remote owner’s to give.

Question Why it matters Default if they agree
Does the studio PC run Windows-only studio software (the video mixer’s control software first)? Under Ubuntu it no longer runs on that machine The PC becomes a server. The studio uses its Companion Pi or another computer
Which disks are in the studio PC? The photo library must fit for the NAS to be backups only Library on the server, mirrored if two disks. Otherwise it stays on the NAS and another local backup target is needed
May the business data (EspoCRM, InvoiceNinja) be copied to another household? The standby copies it every 15 minutes Yes, in an isolated VLAN with an encrypted history. They can exclude it and keep only Immich

Smaller ones, with their defaults: the compose files live in a private GitHub repository on their account with you as collaborator, the maintenance window is one Sunday morning a month, the NAS and the Pi 4 move to the Servers VLAN in part 7, the network agent keeps its nmap scan, no second VPN profile towards your gateway at the start, and alerts go to a Telegram group with both of you.

Then write the real values where this guide uses examples. On your Mac:

Terminal window
cd $INFRA && $EDITOR vm/standby/ansible/inventory.yml vm/standby/ansible/overrides.yml

Set the server’s address (twice in the inventory), the UPS line, and in overrides.yml the public status address and the database lines confirmed in step 13.2.

Verify. A dated note in 1Password, item Remote site decisions, lists each answer. grep -c "10.6.5.10" vm/standby/ansible/inventory.yml prints 0 if the address changed, 2 if the example was confirmed.

Rollback. Nothing has changed yet.

Why. The kit reloads databases by container name, user and database name. A wrong name is the difference between a working failover and an empty CRM. Sizes decide the disk of the standby VM.

Remote site In Portainer (or over SSH on a machine that can reach the Docker host), note for each application: stack name, container names, image and exact version, database container, database name and user, data folders and their sizes. The commands, where a shell is available:

Terminal window
docker ps --format 'table {{.Names}}\t{{.Image}}\t{{.Status}}'
docker inspect -f '{{.Name}} {{range .Mounts}}{{.Source}} -> {{.Destination}}; {{end}}' $(docker ps -q)
docker exec immich_postgres psql -U postgres -lqt | cut -d'|' -f1
for c in espocrm-mariadb invoiceninja-mariadb freshrss-mariadb; do
docker exec $c sh -c 'mariadb -uroot -p"$MARIADB_ROOT_PASSWORD" -e "show databases"'
done
du -sh /share/Container/immich /share/Container/espocrm /share/Container/invoiceninja /share/Container/freshrss 2>/dev/null
for i in $(docker ps --format '{{.Image}}'); do
docker manifest inspect $i 2>/dev/null | grep -q arm64 && echo "arm64 ok $i" || echo "NO arm64 $i"
done

The container names in the second and third lines are the kit’s examples, and the folder paths are a guess at the NAS’s layout: replace them with what the first two commands show.

Verify. You hold a table with one row per application. Every image the standby must run reports arm64 ok (your Mac is an ARM machine). The total size, times 1.5, is at most the standby VM’s disk (256 GB in chapter 5). If it is more, grow the disk now (chapter 5, “Growing a disk later”) or agree to leave an application out.

Rollback. None needed.

Why. The same compose files must exist on the server and on the standby, with pinned versions. A Git repository is the one place both read from, and it gives every change a history and a way back.

Remote site Create a private repository (for example stack) on the remote owner’s GitHub account, with you as collaborator, laid out as the kit expects:

compose.yml every application, image versions pinned, no `latest`
compose.failover.yml the kit's labels (ws.failover) and the edge stack with ws-status
compose.primary.yml what exists only on the server: GPU reservations, Ollama, the agent
compose.standby.yml what differs on the standby: CPU machine learning, no Ollama
.env.example variable names without values

The kit’s compose/ folder holds a commented example of each (labels.example.yml, edge.example.yml, primary-gpu.example.yml, compose.standby.example.yml). Unpack the kit to read them:

Terminal window
cd ~ && shasum -a 256 -c <(sed "s| .*| $INFRA/vm/standby/kit/warm-standby-2.2.0.zip|" $INFRA/vm/standby/kit/warm-standby-2.2.0.zip.sha256) \
&& unzip -q -o $INFRA/vm/standby/kit/warm-standby-2.2.0.zip -d ~ && ls ~/warm-standby-2.2.0/compose

Two rules for these files: the database containers carry the same names on both sides, and nothing is labelled except what serves users (ws.failover: app) and the public entry (ws.failover: ingress). Databases, Redis and ws-status carry no label and run all the time on both sides.

Verify. docker compose -f compose.yml -f compose.failover.yml -f compose.primary.yml config --quiet returns nothing on a machine with the .env filled in, and grep -rn "latest\|:release" compose*.yml finds nothing.

Rollback. Delete the repository.

Confirm with the remote owner before part 1: the decisions, the inventory, and the split of responsibilities (they own the server, the applications and their network. You own the standby VM and the kit. A failover alert reaches them first. A return to their server needs both of you).

Why. Data moves in part 4. Before that, one copy exists that no step of this guide touches.

Remote site With an external disk attached to the NAS or to a computer that mounts its shares:

  1. Copy the whole Immich data folder (library, upload, profile are the critical ones).
  2. Dump every database and copy the dumps:
Terminal window
docker exec -t immich_postgres pg_dumpall --clean --if-exists --username=postgres | gzip > immich-$(date +%F).sql.gz
for app in espocrm invoiceninja freshrss; do
docker exec $app-mariadb sh -c 'mariadb-dump -uroot -p"$MARIADB_ROOT_PASSWORD" --single-transaction --routines --all-databases' | gzip > $app-$(date +%F).sql.gz
done

Verify. On the external disk: gunzip -t *.sql.gz reports nothing, zcat immich-*.sql.gz | grep -c "CREATE TABLE" is in the hundreds, and one photo opened from the copy displays.

Rollback. None needed. Keep the disk unplugged until part 5 is validated.

Why. Today servers and personal devices share one network, so an infected laptop reaches the NAS, Portainer and the databases directly. Zones replace “everything allowed inside” with named flows. No existing machine moves in this step.

Remote UniFi

  1. Settings > Networks > New Virtual Network: Servers, VLAN 5, 10.6.5.0/24.
  2. Settings > Policy Engine > Zones: create Servers (network Servers), IoT (network IoT), Management (network Management). Move Guest to the built-in Hotspot zone in part 7.
  3. Policies, in this order. The custom zones block each other by default once created: check the zone matrix before relying on it, and add the explicit blocks if a cell shows Allow All.
From To Flow Action
Internal (Trusted) Servers, the Pi 4 TCP 443 (NGINX Proxy Manager) Allow
Internal, the admin computer only Servers TCP 22, and the NAS shares if used Allow
Internal, the admin computer only Management Any Allow
Servers, the server Internal, the Companion Pi TCP 3493 (UPS) Allow
Servers, the agent’s address only Management, Internal, IoT Any (its nmap scan and the APIs it reads) Allow
Servers, the Pi 4 IoT, Home Assistant TCP 8123, if Home Assistant is published by the proxy Allow
IoT, Home Assistant Servers, the Pi 4 TCP 3493 Allow
Gateway Servers, the server UDP 514 (syslog) Allow
Hotspot Every internal zone Any Block
Internal Servers, everything else Any Block

Verify. A test laptop placed in the Servers VLAN gets a 10.6.5.x address, reaches the internet, and reaches nothing in Trusted except the flows of the table: nc -zv -G 2 <a Trusted device> 445 times out.

Rollback. Delete the policies, the zones, then the network.

Confirm with the remote owner before part 3.

Remote site

  • The list of studio software is checked (step 13.1, first question).
  • The names of the installed Ollama models are noted (ollama list). They download again.
  • Any file that exists only on this PC is copied elsewhere.
  • In the BIOS: Restore on AC power loss: Power On.
  • The disks are noted: Get-PhysicalDisk | Format-Table FriendlyName,MediaType,Size in PowerShell.
  • An image of the Windows disk is kept, or Ubuntu goes on another disk. This is the rollback of the whole part.

Verify. Each box is ticked, and the image or the spare disk exists.

Why. Windows with WSL2 does not start its Linux side until someone logs in: on 2026-11-11 that cost 31 hours after a Windows update. Ubuntu Server starts by itself.

Remote site

  1. Ubuntu Server 26.04 LTS, minimal installation, Install OpenSSH server ticked, import the remote owner’s SSH key. No desktop.
  2. System and databases on the fastest SSD. Data in /srv on a separate volume, mirrored if two disks allow it.
  3. In UniFi, set the server’s switch port to the Servers network and give it a fixed address (10.6.5.10 in this guide).
  4. Folders shared with the kit:
Terminal window
sudo mkdir -p /opt/stack /srv/apps /srv/db && sudo chown $USER: /opt/stack

/srv/apps/<application> holds synchronised data, /srv/db/<application> holds database files, which are never copied as files.

Verify. ssh <admin>@10.6.5.10 'lsb_release -ds; ip -4 -br addr | grep 10.6.5.10; df -h /srv | tail -1' shows Ubuntu 26.04, the address and the data volume.

Rollback. Boot the Windows image or disk again.

13.8 Hardening, Docker and the GPU by playbook

Section titled “13.8 Hardening, Docker and the GPU by playbook”

Why. The kit’s playbook sets up SSH by key only, automatic security updates without automatic restarts, Docker from Docker’s own repository, the NVIDIA driver with the container toolkit, and the UPS client. Running it now, without the kit’s own part, gives the server its base before any application moves. Chapter 14 runs the full playbook later and finds these parts already in order.

On a computer inside the remote site that reaches the server by SSH (the remote owner’s admin computer, or your laptop on their network), with the kit unpacked (step 13.3):

Terminal window
python3 -m pip install --user "ansible-core==2.18.*"
cd ~/warm-standby-2.2.0/ansible
cp $INFRA/vm/standby/ansible/{inventory.yml,server-base.yml,overrides.yml} .
export REMOTE_ADMIN=<their admin user on the server>
printf 'vault_nut_monitor_password: "%s"\n' "<the UPS monitor password, from the remote owner>" > group_vars/all/vault.yml
ansible-playbook server-base.yml -e @overrides.yml -e "ansible_ssh_common_args=''" --ask-become-pass --check --diff
ansible-playbook server-base.yml -e @overrides.yml -e "ansible_ssh_common_args=''" --ask-become-pass
rm group_vars/all/vault.yml

The first run shows what would change and changes nothing. Read it, then run the second. The playbook never restarts the machine: if it reports a pending restart, restart by hand now, while nothing runs on the server.

Ubuntu 26.04 ships sudo-rs in place of sudo. The playbook and the kit use plain rules only. If a sudo step fails with a parsing error, the classic binary is available as sudo.ws.

Verify.

Terminal window
ssh <admin>@10.6.5.10 'docker run --rm hello-world | grep -c "Hello from Docker"; nvidia-smi --query-gpu=name --format=csv,noheader; \
docker run --rm --gpus all ubuntu nvidia-smi -L; upsc apc1500@10.6.2.162 ups.status; sudo sshd -T | grep -E "^passwordauthentication|^permitrootlogin"'

1, the GPU’s name twice, OL (on line power), then passwordauthentication no and permitrootlogin no.

Rollback. The playbook installs packages and writes configuration files only. sudo rm /etc/ssh/sshd_config.d/10-warm-standby.conf && sudo systemctl reload ssh restores password logins if you are locked out at the console.

Why. Ollama, docling and Immich’s machine learning already run on this PC today. Bringing only those back proves the GPU path while every application is still on the NAS.

Remote site Clone the stack repository into /opt/stack, fill .env, and start only those services:

Terminal window
cd /opt/stack && git clone git@github.com:<owner>/stack.git . && cp .env.example .env && $EDITOR .env
docker compose -f compose.yml -f compose.failover.yml -f compose.primary.yml up -d ollama docling immich-machine-learning
docker exec ollama ollama pull <each model noted in step 13.6>

Portainer goes on the server too, published through the Pi 4’s proxy only. The Docker socket is never mounted into a container that the public can reach.

Verify. Immich, still on the NAS, has its machine-learning URL pointed at http://10.6.5.10:3003 and a smart search returns results. docker exec ollama ollama run <model> "Say OK" answers, and nvidia-smi shows the process on the GPU.

Rollback. Point Immich’s machine-learning URL back to its previous value.

Confirm with the remote owner before part 4.

Plan a window with no photo uploads: anything that reaches the NAS after the final dump is lost. Keep each application at the same version on the server as on the NAS. Upgrades come later, one at a time.

Why. Immich’s own procedure: the database travels as a dump, never as files, and it is reloaded before the application starts, so the application never sees a half-filled database.

Remote site

  1. On the NAS, stop the Immich stack except its database. Take the final dump (step 13.4, first command), then stop the database.
  2. On the server, mount the NAS share read-only and copy the files. The NAS keeps its rule of no SSH: the server pulls over SMB.
Terminal window
sudo mkdir -p /mnt/nas /srv/apps/immich && sudo mount -t cifs //<nas>/<share> /mnt/nas -o ro,username=<account>,vers=3
sudo rsync -aH --info=progress2 /mnt/nas/immich/ /srv/apps/immich/
sudo rsync -aHc --dry-run --itemize-changes /mnt/nas/immich/library/ /srv/apps/immich/library/ | head # no line: identical
  1. Reload the database into a fresh container, then start the rest:
Terminal window
cd /opt/stack && C="-f compose.yml -f compose.failover.yml -f compose.primary.yml"
docker compose $C create immich-server immich-machine-learning immich_postgres immich_redis
docker start immich_postgres && sleep 15
gunzip --stdout /mnt/nas/immich-final.sql.gz \
| sed "s/SELECT pg_catalog.set_config('search_path', '', false);/SELECT pg_catalog.set_config('search_path', 'public, pg_catalog', true);/g" \
| docker exec -i immich_postgres psql --dbname=postgres --username=postgres
docker compose $C up -d immich-server immich-machine-learning immich_redis

Verify. At http://10.6.5.10:2283: the photo count in Administration > Server stats equals the NAS’s last value, a search works, a photo uploaded from a phone appears, and an old shared link opens once the proxy points here (step 13.13).

Rollback. Start the stack on the NAS again. It stays stopped and intact for two weeks.

Why. Same method for the three MariaDB applications, with their tiredofit/db-backup containers, which keep writing nightly dumps.

Remote site For each app in turn:

Terminal window
app=espocrm # then invoiceninja, freshrss
# NAS: stop the application container, keep the database, final dump, stop the database
docker exec $app-mariadb sh -c 'mariadb-dump -uroot -p"$MARIADB_ROOT_PASSWORD" --single-transaction --routines --databases '"$app" | gzip > $app-final.sql.gz
# server: files, then the database, then the application
sudo rsync -aH /mnt/nas/$app/ /srv/apps/$app/
cd /opt/stack && docker compose $C up -d $app-mariadb && sleep 20
gunzip -c /mnt/nas/$app-final.sql.gz | docker exec -i $app-mariadb sh -c 'mariadb -uroot -p"$MARIADB_ROOT_PASSWORD"'
docker compose $C up -d $app $app-db-backup

InvoiceNinja’s database is named ninja in the kit’s examples: use the name found in step 13.2. The backup containers write to /srv/apps/_backups.

Verify. Log in to each application and open a recent record (a contact, an invoice, a feed). The next morning, ls -lt /srv/apps/_backups/*/ | head shows dumps dated today.

Rollback. Start the application’s stack on the NAS again.

13.12 The public entry, the agent, the portal, the logs

Section titled “13.12 The public entry, the agent, the portal, the logs”

Why. The tunnel moves off the machine that keeps the backups, into a Docker network that reaches only Immich’s public proxy. The agent follows its applications.

Remote site

  1. Stop the cloudflare-immich stack on the NAS. On the server: docker compose $C up -d cloudflared immich-public-proxy ws-status. Same tunnel, same token, so the public address does not change.
  2. The network agent, with its config.py revised: PORTAINER_BASE_URL, the Portainer environment and stack numbers, NAS_AGENT_BASE, SCAN_SUBNETS (add 10.6.5.0/24), and the expected ports of the server, which no longer shows Windows ports. Its builds now run on the server.
  3. The portal and syslog-ng. Then in UniFi, Settings > CyberSecure > Traffic Logging > Activity Logging (Syslog): server 10.6.5.10.
  4. Move the vault key out of the shared folder and out of Portainer’s stack variables: a root-only file on the server, mounted read-only into the agent.

Verify. curl -sI https://photos.example.org | head -1 answers 200 or 302 from outside the site, the agent’s next digest shows no new alert, and its backup check passes the next morning.

Rollback. Stop the tunnel on the server and start cloudflare-immich on the NAS.

Remote site In NGINX Proxy Manager on the Pi 4, edit each proxy host: forward to 10.6.5.10 and the application’s port in place of the NAS. Chapter 14 adds the backup upstream.

Verify. Each internal name opens its application over the VPN, served by the server: docker logs --since 1m immich-server | tail -2 on the server shows the request.

Rollback. Point the hosts back at the NAS.

Confirm with the remote owner before part 5, after a few days of normal use.

Why. A backup that the server pushes can be destroyed by whoever takes the server. The NAS pulls, and keeps snapshots that the server cannot delete.

Remote NAS

  1. HBS 3: a sync job that pulls /srv/apps from the server each night with a read-only account, and /srv/apps/_backups into the existing container-backups share, same folder layout, finished before 05:15. The eight OneDrive jobs and the agent’s 05:30 check then continue unchanged. Whether HBS 3 can pull in this direction must be confirmed on the device. If it cannot, the server exports /srv/apps read-only and the NAS mounts it.
  2. Storage & Snapshots: daily snapshots of the backup volume, kept 30 days.
  3. It also receives Home Assistant’s automatic backups, the proxy’s configuration export and the UniFi backups.
  4. Hardening: the admin account disabled in favour of a named administrator with two-step verification, UPnP and automatic router configuration off, myQNAPcloud off, Telnet, SSH, FTP and the multimedia applications off, SMB 1 off, IP and account access protection on, QuFirewall accepting only the Servers VLAN and the admin computer, firmware on the recommended version.
  5. After the two weeks: delete the stopped stacks, then stop Container Station.

Verify. One file restored from a snapshot opens. The next day’s OneDrive copy succeeds and the agent’s backup check is green. nc -zv -G 2 <nas> 22 is refused.

Rollback. The old stacks exist until the two weeks are over.

Confirm with the remote owner before part 6.

Build the standby VM first (chapter 14, part A) so that 10.0.6.2 exists to test against, then come back here.

Why. The standby pulls its copy through this tunnel and the two sites watch each other through it. Each side shares one network only: their Servers VLAN, your Standby VLAN. The two gateways belong to different UI accounts, so the tunnel is a manual IPsec one.

Generate the shared key once and keep it in 1Password, then give it to the remote owner over a channel you both trust:

Terminal window
op item create --vault Infrastructure --category password --title "Site-to-site VPN remote site" \
--generate-password='letters,digits,48' >/dev/null
op read "op://Infrastructure/Site-to-site VPN remote site/password" | pbcopy

UniFi (yours) Settings > VPN > Site-to-Site VPN > Create New:

Field Value
VPN type IPsec
Name remote-site
Pre-shared key The key above
Local IP Your WAN address
Remote IP / Host The remote site’s public address or dynamic DNS name
VPN method Route based
Remote networks 10.6.5.0/24
Advanced Manual: IKEv2, AES-256, SHA-256, DH group 14, PFS on

Remote UniFi The same, mirrored: your public address or dynamic DNS name as remote, remote network 10.0.6.0/24, the same key and the same advanced settings.

If either site has no fixed public address, both ends use a dynamic DNS name (Settings > Internet > WAN > Dynamic DNS).

Verify. On both gateways the tunnel shows Connected. Nothing passes yet, which the next two steps arrange on purpose.

Rollback. Delete the tunnel on both sides.

Why. UniFi’s VPN zone allows everything towards the other zones by default. The block goes in first, then the three named flows.

Remote UniFi Settings > Policy Engine > Policy Table, in this order:

Name Source Destination Ports Action
Standby to server VPN, IP 10.0.6.2 Servers, IP 10.6.5.10 TCP 22, 8099 Allow
Server to standby Servers, IP 10.6.5.10 VPN, IP 10.0.6.2 TCP 8099 Allow
Proxy to standby Servers, the Pi 4’s IP VPN, IP 10.0.6.2 TCP 2283 and each application’s port Allow
Remote house to all, block VPN, IP 10.0.6.0/24 Internal, Servers, IoT, Management, Gateway (one policy per zone) Any Block
All to remote house, block Internal, Servers, IoT, Management (one policy per zone) VPN, IP 10.0.6.0/24 Any Block

Until the Pi 4 moves to the Servers VLAN (part 7), its source zone is Internal.

Verify. Step 13.18.

Rollback. Pause the two block policies.

Why. The same on your side. Chapter 10 already closed the Standby zone towards your other zones (B1 to B5). These add the tunnel.

UniFi Settings > Policy Engine > Policy Table, placed above V2 of step 10.7:

# Name Source Destination Ports Action
T1 Standby to remote server Standby, IP 10.0.6.2 VPN, IP 10.6.5.10 TCP 22, 8099 Allow
T2 Remote server to standby VPN, IP 10.6.5.10 Standby, IP 10.0.6.2 TCP 8099 Allow
T3 Remote proxy to standby VPN, the Pi 4’s IP Standby, IP 10.0.6.2 TCP 2283 and each application’s port Allow
T4 Remote site to all, block VPN, IP 10.6.0.0/16 Internal, IoT, Surveillance, Neighbor, Standby, Work, Gateway (one policy per zone) Any Block
T5 All to remote site, block Internal, IoT, Surveillance, Neighbor, Standby, Work (one policy per zone) VPN, IP 10.6.0.0/16 Any Block

T1 to T3 sit above T4 and T5. The admin VPN policies of step 10.11 (V4, V5) name 192.168.3.0/24 and are not affected.

Verify. Step 13.18.

Rollback. Pause T4 and T5, then delete T1 to T3.

Mac

Terminal window
ssh standby 'nc -zv -w 3 10.6.5.10 22; nc -zv -w 3 10.6.5.10 443; nc -zv -w 3 10.6.2.1 443; nc -zv -w 3 10.6.5.1 443'
nc -zv -G 3 10.6.5.10 22

Verify. From the standby: port 22 on the remote server succeeds, and the three others time out (another port on the server, their Trusted gateway, their Servers gateway). From the Mac: timeout, because your own network has no road to the remote site. Ask the remote owner to run the mirror from their server: nc -zv -w 3 10.0.6.2 22 and nc -zv -w 3 10.0.5.3 22 both time out (port 8099 opens when the kit runs).

Rollback. Pause the policies of steps 13.16 and 13.17.

Now continue with chapter 14, part B, and return for part 7 when the failover drill has passed.

Remote site, each one reversible by its address reservation or setting:

  • Guest network moved to the Hotspot zone.
  • NAS and Pi 4 moved to the Servers VLAN. Update the proxy’s address in policies T3 and “Proxy to standby”.
  • The Pi 4 boots from an SSD, and the proxy’s configuration is exported to the NAS on a schedule.
  • Every credential that lived on the NAS is renewed, then the agent’s vault key (rotate_key).
  • The agent verifies certificates: each service’s self-signed certificate is pinned in place of verify=False.
  • Accounts at least privilege: a read-only local UniFi account for the agent, a revocable Portainer token of its own, a NAS account that reads health and writes only in the syslog folder.
  • New agent checks: the kit’s module snippets/agent/standby_status.py (it reads status.json on both machines and adds a “Standby” line to the digest), Immich’s nightly dump added to BACKUP_JOBS, the new block policies added to REQUIRED_BLOCK_POLICIES, a check that the NAS runs no container.
  • The standby VM is not added to their Portainer: its containers are stopped on purpose and would raise alerts.

Verify. The agent’s audit runs with no new alert, and the digest carries the “Standby” line.

Topic Agreed way
A change A branch, automatic checks, a review by the other person, a tagged version, a try on a test VM, then the maintenance window
Maintenance on the server On the standby first: sudo ws-ctl pause 120. Afterwards: sudo ws-ctl resume
Application update At the remote site first, then sudo ws-ctl refresh on the standby
Incidents The Telegram group. Each failover, data loss and quarterly drill gets a line in a shared log: date, cause, duration, data lost, actions
Service targets Immich, the public share, EspoCRM, InvoiceNinja, FreshRSS: at most 15 minutes of data lost, about 7 minutes of interruption. Both sites lost: 24 hours of data, restored by hand from OneDrive and the standby’s history
Ownership of the copy The data on your Mac remains the remote owner’s. They decide what is copied and can withdraw an application at any time

The remote site has one server that runs everything, a NAS that only keeps backups, a network where each flow is named, and a tunnel through which your standby VM and their server see each other on two ports. Chapter 14 puts the kit on both ends.