Persist settings.json across deploys via a data volume
All checks were successful
Deploy / deploy (push) Successful in 21s

The previous commit made Settings-saved API keys override .env, but the
key still never survived: settings.json was written to the container
filesystem, and every deploy runs `up -d --build`, which recreates the
container and discards it. Saving a rotated SABnzbd key and restarting
therefore still fell back to the stale .env value.

SETTINGS_FILE is now configurable and pointed at /data/settings.json on
a ./data bind mount, so runtime settings live on the host. The deploy
rsync also excludes data/ — it runs --delete and would otherwise wipe
the directory for not being in the repo, reintroducing the same bug.

This affected everything the Settings page writes, not just API keys:
timezone and a UI-changed login password were being reverted on every
deploy too.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Barely Removable 2026-08-26 09:34:46 -07:00
parent 20f348eb9e
commit 600a48da93
4 changed files with 31 additions and 5 deletions

View file

@ -17,13 +17,15 @@ jobs:
# at /mnt/user/appdata/greendale on the host, bind-mounted into this
# container at the same path (see runner container.options) so
# `docker compose`'s relative paths resolve against the real host
# directory rather than an ephemeral one. `.env` is server-only and
# must survive every deploy.
# directory rather than an ephemeral one. `.env` and `data/` are
# server-only state and must survive every deploy — without the
# excludes, --delete removes them because they aren't in the repo.
- name: Sync source to deploy path
run: |
rsync -a --delete \
--exclude='.git' \
--exclude='.env' \
--exclude='data' \
./ /mnt/user/appdata/greendale/
- name: Rebuild and restart