From ff7212ab9eae968ef4077fe01e5134d95b3b99e3 Mon Sep 17 00:00:00 2001 From: Jake Pullen Date: Thu, 10 Sep 2026 13:11:27 +0100 Subject: [PATCH] deploy: keep app data in /opt/bike_admin/data (ReadWritePaths) Match the live volundr unit: drop StateDirectory=/var/lib/bike_admin in favour of ReadWritePaths=/opt/bike_admin/data. systemd requires the ReadWritePaths target to exist before the service starts, so the unit documents the one-time install -d prerequisite. --- deploy/bike_admin.service | 4 ++++ deploy/env.production.example | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/deploy/bike_admin.service b/deploy/bike_admin.service index 3a1ce98..fc320f0 100644 --- a/deploy/bike_admin.service +++ b/deploy/bike_admin.service @@ -21,6 +21,10 @@ NoNewPrivileges=true PrivateTmp=true ProtectSystem=full ProtectHome=true +# App data lives next to the checkout at /opt/bike_admin/data (created by the +# app on startup). systemd requires the ReadWritePaths target to exist before +# it starts the service, so pre-create it with: +# sudo install -d -o bike -g bike /opt/bike_admin/data ReadWritePaths=/opt/bike_admin/data [Install] diff --git a/deploy/env.production.example b/deploy/env.production.example index ac2cd12..e762e11 100644 --- a/deploy/env.production.example +++ b/deploy/env.production.example @@ -22,4 +22,4 @@ BIKE_ADMIN_BIND_PORT=8000 # BIKE_ADMIN_SERVICE_DUE_SOON_MILES=200 # service "book soon" lead time # BIKE_ADMIN_RENEWAL_DUE_SOON_DAYS=60 # MOT/insurance "due soon" lead time # BIKE_ADMIN_RENEWAL_MONTHS=12 # MOT/insurance validity (months) -# BIKE_ADMIN_DATA_DIR=/opt/bike_admin/data +# BIKE_ADMIN_DATA_DIR=/opt/bike_admin/data # (defaults to /data; matches the systemd unit)