Skip to content

Backup NAS — Cooper

Last Updated: 2026-04-25 Status: ✅ Active Purpose: Backup target. Receives backups from Lotus. Minimal services to reduce unnecessary disk spin-up.

Hardware specs: inventory.md → Cooper


Access

Method Detail
Web UI http://192.168.1.60
SSH ssh root@192.168.1.60

Array Configuration

Parity 1× 3.6TB
Disk 1 3.6TB
Disk 2 3.6TB
Usable storage ~7.2TB
Cache pool 1× 512GB SSD (2.5" SATA, bay 4)

Cooper now has an SSD cache pool, enabling Docker appdata to run off faster storage. All array data remains on spinning hard drives.


Docker Containers

Container Status Purpose
unraid-simple-monitoring-api ✅ Running Exposes basic monitoring endpoint
SWAG ✅ Running Standby reverse proxy — mirrors Lotus SWAG config
immich-postgres-replica ✅ Running Streaming replica of Lotus Immich PostgreSQL

SWAG — Standby Reverse Proxy

Cooper runs a second SWAG instance configured identically to the primary on Lotus. It acts as a hot spare reverse proxy — if Lotus goes down, a failover script automatically updates Cloudflare DNS to point to Cooper's SWAG within ~10 minutes.

Lotus (primary) Cooper (standby)
Tailscale hostname swag swag-cooper
Tailscale IP 100.106.140.33 100.126.183.94
Cloudflare DNS *.djchome.uk points here normally *.djchome.uk points here on failover

Config Sync

SWAG config files are rsync'd from Lotus to Cooper hourly via a Lotus User Script (swag-sync-to-cooper). This keeps nginx proxy configs and SSL certificates in sync without manual intervention.

⚠️ Tailscale State Directory Exclusion

The rsync job must exclude the Tailscale state directory inside SWAG's appdata:

/mnt/cache/appdata/swag/.tailscale_state/

If this directory is copied across, both SWAG instances will share the same Tailscale node ID, causing a conflict — the primary Lotus instance will be kicked off the Tailnet and will lose external connectivity.

See Lessons Learned for full details.

Note: If Cooper's SWAG ever needs to re-authenticate with Tailscale (e.g. after clearing .tailscale_state), the browser auth flow may hang. Use a pre-generated Tailscale auth key instead: add TAILSCALE_AUTHKEY=tskey-auth-xxxxx as a container environment variable.

Automatic Failover Script

A script (swag-failover) runs every 5 minutes on Cooper via User Scripts. It:

  1. Checks whether Lotus SWAG (100.106.140.33) is reachable on HTTPS
  2. After 2 consecutive failures (~10 minutes of downtime), updates the Cloudflare *.djchome.uk wildcard A record to point to Cooper (100.126.183.94)
  3. When Lotus recovers, automatically fails back and restores the DNS record

State and logs are stored at /mnt/cache/appdata/swag-failover/:

File Purpose
state primary or failover
failures Consecutive failure counter
failover.log Timestamped event log

Cloudflare record details: - Zone ID: d2e47a211146c145dc79f28a46800b4e - Record ID: a3fe4772cf198a5ac7af9aec1d1e7f38 - The API token for DNS updates is stored inside the failover script on Cooper


Immich PostgreSQL — Streaming Replica

Cooper runs a read-only PostgreSQL replica of the Immich database on Lotus. This provides data protection for photos — if Lotus's database is lost or corrupted, Cooper has a continuously-updated copy.

Container immich-postgres-replica
Image ghcr.io/immich-app/postgres:16-vectorchord0.3.0-pgvectors0.3.0
Data path /mnt/cache/appdata/immich_postgresql
Primary 192.168.1.80:5452 (via socat relay on Lotus — see Primary NAS doc)
Replication user replicator

Replication config lives in /mnt/cache/appdata/immich_postgresql/postgresql.auto.conf and standby.signal. The replica connects to Lotus on port 5452 (the socat relay), not port 5432 directly.

If replication breaks

  1. Check container logs: docker logs immich-postgres-replica --tail 50
  2. Verify Lotus socat relay is running: docker ps | grep immich-pg-relay on Lotus
  3. Check connectivity: bash -c 'echo > /dev/tcp/192.168.1.80/5452' && echo OK from Cooper
  4. If the replica has diverged too far, re-run pg_basebackup and restart the container

Backup Role

Cooper is the destination for backups from Lotus:

Source Method What's backed up
Lotus LuckyBackup Data shares
Lotus Appdata Backup plugin Docker appdata

Cooper also sends its own Docker appdata to Lotus via Appdata Backup.


Planned: Local Documentation Mirror

Cooper is the planned host for the local docs mirror. Once configured:

  • docs.djchome.uk will resolve to Cooper on the home network (via split DNS)
  • Cooper will sync from GitHub and serve the MkDocs site locally
  • Gabriela can use the same URL whether at home or away

See TODO.md for setup tasks.


Recovery

See Backup NAS Recovery for restore procedures.


Notes

  • SSD cache pool added April 2026 — Docker appdata now runs off cache rather than spinning disks
  • Static HTML docs site would be read-only and fine on spinning disks