Konstantinos Antoniou.

← Projects

Syndicate: A Two-Site Home Lab Run Like Production

Syndicate is the home lab I have been building since 2018, and it taught me more than any course did. It spans two physical sites and about twenty devices, and I run it by one test that I borrowed from production: what happens when a job runs unattended at 3am, or fails halfway through?

The diagram above is the whole picture. The rest of this page is the part the diagram cannot show: the rules I follow, the decisions I made and what each one cost me, and what has broken along the way.

What is in it

Two sites joined by a site-to-site VPN. Syndicate is home and the primary site. Cafe-Exohi is the café I used to run, where I built the network myself with separate main, guest and isolated point-of-sale subnets. MikroTik routers and access points cover both.

  • Compute: one Proxmox hypervisor running most of the lab as VMs, reachable out-of-band through a Pi-KVM, plus a few dedicated machines.
  • Services: Nextcloud, this WordPress site, n8n automation, Vault with an internal PKI, Zabbix, and a NAS. One VM, docker-01, hosts most of the containers.
  • Identity and exposure: Authentik provides single sign-on. Public web services reach the internet through Cloudflare Tunnel instead of port-forwards.
  • Delivery: GitLab CI/CD and Ansible, with the source split across three repositories: provisioning and scripts, pipelines, and Docker Compose stacks.
  • Observability: Zabbix for hosts and network gear, Grafana Cloud with Alloy for logs and metrics, and per-script alerts through a message broker.

By the numbers

  • 2 sites, about 20 devices: 14 Linux hosts and 7 MikroTik routers and access points.
  • About 40 maintenance scripts in one repository, nearly 300 commits since August 2025.
  • 29 Cloudflare KV namespaces, one per script, so every script resolves its own secrets.
  • 13 documented backup jobs, each with a page covering what it protects, where the copies go, how I verify it ran, and how to restore it.
  • Around 90 pages of runbooks and references in Confluence.

The rules I follow

  • Every script is idempotent. Re-running it never duplicates state or clobbers config.
  • Every script starts with set -Euo pipefail and has a usage note at the top.
  • Config values such as paths, hostnames and subnets are parameters with environment overrides, never hard-coded.
  • Failures are explicit and per item. One bad host must not abort the other thirteen, and nothing is silently swallowed.
  • Anything destructive has a dry-run flag.
  • No secret is ever committed or left in a script.

Decisions, and what each one cost

Secrets: a three-line bootstrap file, and everything else in Cloudflare KV

Each script has a bootstrap file on its host, readable only by root, holding exactly three values and nothing else:

API_TOKEN=
KV_NAMESPACE_ID=
ACCOUNT_ID=

Those three unlock one namespace. The real secrets, such as webhook URLs, credentials and backup passphrases, are fetched from Cloudflare KV at runtime and never sit in a file in the repo. A rotation is one write to KV, not a change on every host.

The cost is that this is deliberately best-effort. If KV is unreachable, a script logs a warning and falls back to whatever its local environment has. There is one documented exception, the Vault unseal script, where there is no sane fallback and a missing key is a hard failure. Renaming a key has no atomic operation either: it is get, put, delete, per namespace, after I have checked the consuming script for the key name it really uses.

Alerting: one broker, and the day I deleted half of it

Every script publishes its alerts to RabbitMQ, and a consumer formats and delivers each one to Discord, Telegram or Gmail. The scripts never talk to those services directly, so a channel can be switched on or off across the whole fleet in one place, and no script needs a webhook credential.

This is the third shape of that broker. In the second version I gave every script its own virtual host and a shovel to relay messages, which came to about six broker objects per script across 20 scripts and two extra plugins just to move a message one hop. Worse, the shovels authenticated as the broker admin, so the admin password sat in 20 places. I stripped it back out. Isolation now comes from a permission rule per script user: write-only on its own exchange, nothing else, plus a connection cap. I verified that one script cannot publish as another.

What I knowingly gave up: a leaked script credential now lives in the same virtual host as the rest. What I also accept: the broker is a hard dependency with no fallback, so an outage means a lost alert, not a delayed one. That is why I also run Zabbix and Grafana Cloud, which do not depend on it.

Delivery: Ansible ships scripts, and I kept it narrow on purpose

Only one Ansible role runs routinely: it delivers scripts, shared libraries, systemd units and the bootstrap files to every host, always overwriting, because the scripts contain nothing worth protecting from being replaced. I leave the firewall role out of routine runs because it starts with a reset, which briefly drops the firewall and wipes any rule not in Ansible. That is too heavy for a comment-only change, so I run it deliberately. Systemd units are handled one instance at a time, so one failing instance is reported on its own instead of hiding the rest.

Backups: one collection point, three replicas, and an honest weakness

Each service writes its own backup to the NAS, and three independent jobs then replicate that one tree: a local USB drive, the workstation disks, and an encrypted offsite copy. Docker volumes, stack config, MikroTik configs and the RabbitMQ definitions also go straight to Cloudflare R2, so they survive losing the NAS or the whole site.

The weakness is that the NAS is a shared dependency: if it is down, every job’s destination check fails. I also keep a clear line between a mirror, which survives hardware failure but copies an accidental delete on the next run, and a backup with history. The pages say which is which.

Things that broke

Backups that had quietly stopped

When I audited every backup job for the first time, the offsite copy had not completed in five weeks, and the router configurations had never been scheduled at all. I found five separate root causes: cron’s minimal PATH, an environment file named differently from the one Ansible deployed, a notification failure aborting a job under set -e before it finished, the Nextcloud built-in backup, and an expiring Google Drive token. Three are fixed and verified. The lesson I took is that a backup job that reports success is not a backup until I have restored from it.

A proxy that kept talking to an address that was gone

In September an outage traced back to nginx: it had resolved an upstream container’s address once and kept using it after the container came back with a different one. Every new proxy block now uses a variable in proxy_pass and its own resolver, so the name is looked up again instead of being frozen.

An update that waited for someone to press a key

After a monitoring-agent package update, dpkg stopped at a config-file prompt. An unattended run has no terminal to answer it, so the prompt blocked dpkg, and every later apt call queued behind the lock. One host sat blocked for almost a day. The fix was to run apt non-interactively and keep the local config, add a lock so overlapping runs fail fast, and fix my own cleanup, which had read the exit code of tail instead of dpkg. The script also no longer reboots hosts like Vault on its own, because some machines need a person after a restart.

What I would still fix

  • One hypervisor runs most of the lab. Losing it is a bad day, which is why the disaster-recovery pages exist.
  • The NAS is a single collection point for backups, with the replication caveat above.
  • The alert broker has no fallback path by design. I traded that for simplicity and cover it with two independent monitors.
  • CCTV at both sites is not yet part of monitoring.

Stack

MikroTik RouterOS, Proxmox VE, Debian, Docker and Compose, Ansible, GitLab CI, Terraform, HashiCorp Vault, Authentik, Cloudflare (Tunnel, Cloudflare KV, R2), RabbitMQ, Grafana Cloud with Alloy and Loki, Zabbix, n8n, ZeroTier and WireGuard, Nextcloud, Bash and Python.