feat(sync): default SYNC_BASE_PATH to /var/lib/romm/sync

Move the sync staging folder out of ROMM_BASE_PATH so it lives on a
dedicated writable mount. This lets the container run with a read-only
root filesystem without losing in-flight save uploads, and keeps
app-owned state separate from the user-curated library volume.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Georges-Antoine Assi
2026-05-17 09:28:39 -04:00
parent 016cc1ce52
commit 10d3eb2079
4 changed files with 13 additions and 11 deletions

View File

@@ -88,7 +88,7 @@ wait_for_gunicorn_socket() {
fi
}
# Function that runs our main process and creates a corresponding PID file
# Runs our main process and creates a corresponding PID file
start_bin_gunicorn() {
# cleanup potentially leftover socket
rm /tmp/gunicorn.sock -f
@@ -248,16 +248,17 @@ start_bin_watcher() {
start_bin_sync_watcher() {
info_log "Starting sync folder watcher"
local sync_base_path="${SYNC_BASE_PATH:-/var/lib/romm/sync}"
if [[ ${OTEL_SDK_DISABLED:-false} == "true" ]]; then
watchfiles \
--target-type command \
"python3 sync_watcher.py" \
/romm/sync &
"${sync_base_path}" &
else
watchfiles \
--target-type command \
"opentelemetry-instrument --service_name '${OTEL_SERVICE_NAME_PREFIX-}sync_watcher' python3 sync_watcher.py" \
/romm/sync &
"${sync_base_path}" &
fi
SYNC_WATCHER_PID=$!
echo "${SYNC_WATCHER_PID}" >/tmp/sync_watcher.pid