Skip to content

feat(tra-988): /srv/trakrf runtime layout — decouple demo box from the git working tree#492

Merged
mikestankavich merged 5 commits into
mainfrom
tra-988-srv-trakrf
Jun 13, 2026
Merged

feat(tra-988): /srv/trakrf runtime layout — decouple demo box from the git working tree#492
mikestankavich merged 5 commits into
mainfrom
tra-988-srv-trakrf

Conversation

@mikestankavich

Copy link
Copy Markdown
Contributor

Closes TRA-988.

Why

The demo-box services bind-mount config straight out of the git working tree (%h/platform/deploy/edge/...) and the quadlet unit symlinks point there too. On 2026-06-13 a routine branch switch removed those tracked files from disk, mosquitto couldn't restart (statfs .../mosquitto.conf: no such file or directory), and the quadlet symlinks dangled. A routine git op must never be able to pull live config out from under the running stack.

What

Move the runtime copy of config + quadlets + scripts + units to /srv/trakrf; the repo stays the source of truth and install.sh becomes an idempotent deploy step. Branch switches/pulls/resets on the checkout now have zero effect on the running box.

  • Repo reorg: deploy/edge/{mosquitto,traefik}/config/…; secrets consolidated under secrets/ (gitignored); new scripts/ + systemd/.
  • Quadlets bind-mount from /srv/trakrf (config/…, secrets/…) instead of the working tree. Cloudflared power-loss hardening (fix(tra-898): cloudflared survives power-loss boot race #491) preserved.
  • install.sh rsyncs config/+quadlets/+scripts/+systemd//srv/trakrf, links the rootless units, enables the backup timer. Never touches secrets/ (hand-seeded once).
  • Backups: daily pg_dump | gzip/srv/trakrf/backups/ (keep 14, Persistent=true) via a systemd --user timer. DB stays on the timescale_data named volume.
  • Runbook (README.md) rewritten: /srv/trakrf layout, fresh bring-up, reversible existing-box migration + rollback, backups, restore. db-init.sh/smoke-test.sh read /srv/trakrf/secrets/.env.

Migration

Reversible, no hardware needed — old deploy/edge tree retained as instant rollback; services cut over one at a time with health checks (see README "Migrating an existing box"). Migration on the live box is performed separately.

Out of scope (separate tickets)

Unclean-shutdown broker watchdog (home N5105, plug-pull-tested), clean-shutdown via power button, pinning off the floating :preview tag.

🤖 Generated with Claude Code

@github-actions

Copy link
Copy Markdown

🚀 Preview Deployment Update

✅ This PR has been successfully merged into the preview branch.

The preview environment will update shortly at: https://app.preview.trakrf.id

@mikestankavich mikestankavich merged commit afda886 into main Jun 13, 2026
14 checks passed
@mikestankavich mikestankavich deleted the tra-988-srv-trakrf branch June 13, 2026 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant