§ 05 · OFFLINE INSTALL · DAY TWO
Operating it
An installed site with no alerting, no update channel, and two things that expire on a schedule.
Always use the wrapper
A fresh sudo resets the environment and drops the DOCKER_HOST export that the install scripts set, so a hand-written sudo docker compose talks to a Docker socket that does not exist on these boxes.
sudo bash /opt/hivecfm-offline/scripts/hivecfm-compose.sh ps
sudo bash /opt/hivecfm-offline/scripts/hivecfm-compose.sh logs --tail 50 core
# start existing containers without replacing anything
sudo bash /opt/hivecfm-offline/scripts/hivecfm-compose.sh up -d --no-recreate --pull neverThe wrapper re-derives the runtime from site.json and re-exports DOCKER_HOST=unix:///run/podman/podman.sock and DOCKER_API_VERSION=1.41 itself. That is the whole Docker-to-Podman switch, and it is why the equivalent long form has to carry the environment explicitly:
sudo env DOCKER_HOST=unix:///run/podman/podman.sock DOCKER_API_VERSION=1.41 \
docker compose -p hivecfm-offline \
--env-file /opt/hivecfm-offline/compose/release.env \
-f /opt/hivecfm-offline/compose/compose.yaml psThe rootful socket at /run/podman/podman.sock must stay root-only. Never expose it over TCP and never grant untrusted users access to it.
Routine checks
sudo podman ps
sudo systemctl status hivecfm-offline-stack.service
sudo python3 /opt/hivecfm-offline/scripts/offline-health.py
sudo journalctl -u hivecfm-offline-stack.service --since todayhivecfm-offline-stack.service exists only in Podman mode. Stage 07 creates the unit, enables it, and installs the nginx ordering drop-in inside a Podman-only branch. On a docker install that command fails, and nginx can start before the containers do. Under docker, check systemctl is-enabled docker containerd instead and rely on the restart: unless-stopped policy on each service.
The health timer runs every two minutes and writes local JSON. There is no external alert destination, by design: nothing pages anyone, and nothing emails. Somebody has to look. Assign that during handover along with certificate expiry, disk usage, backup recoverability, time drift and API key expiry.
One more nginx note: nothing in the kit disables Ubuntu’s stock sites-enabled/default, so the distro default vhost keeps binding port 80 as default_server. Report it as a finding; do not silently remove it.
Encrypted backup and the restore drill
Mount the separate backup media first. The script guards on the mount, and a drill onto the same disk proves nothing.
findmnt /mnt/hivecfm-backup
sudo bash scripts/09-backup-and-restore-test.shWhat it does: briefly stops the application services, dumps all five databases plus role definitions, captures the Valkey RDB, the persistent file volumes and the deployment configuration, restarts the applications, then encrypts the archive with AES-256-CBC using PBKDF2 at 200,000 iterations and authenticates the ciphertext and its metadata with HMAC-SHA256, encrypt-then-MAC.
The restore drill verifies that authentication before decrypting anything, restores into a separate network-disabled container, and compares per-table row counts. It does not touch the live databases.
Keep both files. The .enc is the archive; the .enc.json is the authenticated envelope, and without it the archive cannot be validated.
Three things about this backup that need to be in your operational plan.
The archive includes secrets/ and pki/, so one backup plus its recovery key is total site compromise. The recovery key currently lives at /opt/hivecfm-offline/secrets/backup-recovery.key, on the host it protects: keep a separately controlled copy, because losing it makes the media permanently unusable.
And there is a real failure mode in the script. The application restart sits inside the inner finally. If docker compose up --wait raises — a slow start on a loaded box is enough — the exception propagates past the tar, the encryption and the evidence write, straight to the outer finally that removes the working directory. A complete, valid dump set is deleted. If a backup run fails during restart, assume you have no backup from that run and check evidence/latest-offline-backup.json for a fresh entry before believing otherwise.
A drill is not disaster recovery. A real restore needs a planned outage, matching image versions, configuration and volumes restored with ownership preserved, the role and database dumps replayed, and then the application and reboot acceptance repeated. Never run a fresh bootstrap over restored data. Have a tested site-specific recovery procedure before production handover, because the kit does not ship one.
Reboot verification
sudo bash scripts/10-reboot-and-verify.sh --reboot-now
# reconnect after the VM comes back
sudo bash scripts/10-reboot-and-verify.sh --verify-after-rebootAs written, the verify branch asserts that a pre-reboot boot_id was recorded, asserts it changed, and runs the health probe. That is all.
Post-reboot acceptance can pass having verified nothing. offline-health.py opens /run/lock/hivecfm-offline-backup.lock and, if the lock is held, prints a deferral message and exits 0 without writing any evidence. Stage 10 then records its marker. Meanwhile the acceptance checklist requires that mount, stack, HTTPS and application checks all passed after the reboot, and the script runs none of the application checks.
Close the gate on the evidence, not the exit code. Run these two yourself and confirm the timestamp is later than the reboot:
sudo python3 /opt/hivecfm-offline/scripts/test-offline-applications.py
sudo jq -r '.status, .timestamp' /opt/hivecfm-offline/evidence/offline-health.json
findmnt /opt/hivecfm-offlineTwo dated time bombs
Both are detected by the health timer, and the timer has nowhere to report. Put both dates in a calendar at handover.
Day ~351: the certificate deadlock. The site server certificate is issued for 365 days. Stage 04 regenerates it only if not (pki/'server.crt').exists(), but it runs openssl x509 -checkend 1209600 unconditionally. So inside the last 14 days of validity, the only stage that could issue a new certificate aborts on the expiring one. The remedy appears in no script and no document in the kit:
sudo rm /opt/hivecfm-offline/pki/server.crt /opt/hivecfm-offline/pki/server.key
sudo bash /srv/hivecfm-offline-kit/scripts/04-configure-runtime.sh
sudo nginx -t && sudo systemctl reload nginx
sudo openssl x509 -enddate -noout -in /opt/hivecfm-offline/pki/server.crtThe reload is not optional. nginx loads the certificate into memory at config load, so stage 04 alone writes a new certificate to disk while the site keeps presenting the expiring one.
That is a TLS identity change on a live customer site. Plan it, announce it, and do it deliberately rather than discovering it at day 365.
Day 90: the n8n API key. init-n8n.py mints the Core-to-n8n key with a 90-day expiry, guarded by if "n8n_api" not in v. Re-running stage 06 therefore mints nothing. Renewal means deleting the n8n_api entry from generated-secrets.json by hand and then re-running the stage, through a controlled maintenance procedure.
Never delete or rewrite /opt/hivecfm-offline/secrets/generated-secrets.json wholesale. config/init-db.sql is mounted into the Postgres entrypoint directory and executes only on a first-time empty data directory. Regenerate the secrets file and stage 04 writes env files full of passwords the database has never seen, and stages 04, 05 and 06 will not detect it.
Never do these
The kit forbids each of these explicitly, and every one of them is somebody’s instinct under pressure.
| Do not | Because |
|---|---|
apt update against public repositories | There is no route, and it corrupts the local-only package state |
podman pull, npm, pip as a repair shortcut | Same. A missing capability means a new bundle version, prepared on a connected host |
podman system prune --volumes | Destroys the data volumes that hold the site |
| Delete the installation directory to troubleshoot | Same |
Delete .state/*.done markers | Forces a first-install script onto an existing site |
| Re-run stage 02 on a host that already has its marker | It overwrites its own pristine config backups |
Paste generated-secrets.json into a support ticket | It is every credential for the site |
For support, collect the failing stage name, a redacted log excerpt, the runtime version and the relevant evidence JSON. Never include generated secrets, private keys, database dumps, authentication headers or complete runtime environment files.
What the kit has no answer for
Name these at handover rather than discovering them later. A search across the whole repo returns zero hits for uninstall, rollback and CVE.
- No uninstall and no rollback. After a stage-02 refusal there is no supported reset path, since prune and marker deletion are both forbidden.
- No patch channel. Fixing a CVE means preparing, scanning and carrying an entire new 5 GB bundle. There is no delta mechanism and no advisory feed.
- No log rotation for
/opt/hivecfm-offline/logs/*.log. Container logs are capped at 10 MB across 5 files; the host stage logs are unbounded appends. - No licence terms file. There is no
LICENSEin the repo, and nothing states what the customer may do with 5 GB of shipped binaries.
Offline updates follow the same path as the original install: prepare a replacement bundle on a connected staging system, verify upstream identities, collect the complete new package and image closure, scan it under your organization’s process, test it on an isolated clone, and carry it through the same approved transfer. Back up first and retain the previous bundle.