From 14fbfdf71160fec101e7ddf7272a297475ee8dbb Mon Sep 17 00:00:00 2001 From: MickLesk <47820557+MickLesk@users.noreply.github.com> Date: Thu, 17 Sep 2026 10:09:41 +0200 Subject: [PATCH] suggestarr: keep the data where the app actually reads it The env file sets CONFIG_DIR=/opt/suggestarr_data and the service passes it through, but SuggestArr never reads that variable. Its database manager builds the path from the application directory: DB_PATH = os.path.join(BASE_DIR, 'config', 'config_files', 'requests.db') so config.yaml, requests.db and secret.key live under /opt/suggestarr, which the update wipes with CLEAN_INSTALL. Every update came back as a fresh install. Make config/config_files a symlink to /opt/suggestarr_data and lay it down again after each deploy, since the deploy replaces it with a real directory. Existing installs have their files copied across first, with cp -an so anything already in the data directory wins. CONFIG_DIR stays in the env file: it is inert today and costs nothing if upstream starts reading it. --- ct/suggestarr.sh | 11 +++++++++++ install/suggestarr-install.sh | 4 +++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ct/suggestarr.sh b/ct/suggestarr.sh index 6cad3c2d0..ac0fb497a 100644 --- a/ct/suggestarr.sh +++ b/ct/suggestarr.sh @@ -37,8 +37,19 @@ function update_script() { systemctl stop suggestarr msg_ok "Stopped Service" + mkdir -p /opt/suggestarr_data + if [[ -d /opt/suggestarr/config/config_files && ! -L /opt/suggestarr/config/config_files ]]; then + msg_info "Migrating Configuration" + cp -an /opt/suggestarr/config/config_files/. /opt/suggestarr_data/ 2>/dev/null || true + msg_ok "Migrated Configuration to /opt/suggestarr_data" + fi + CLEAN_INSTALL=1 fetch_and_deploy_gh_release "suggestarr" "giuseppe99barchetta/SuggestArr" "tarball" + mkdir -p /opt/suggestarr/config + rm -rf /opt/suggestarr/config/config_files + ln -sfn /opt/suggestarr_data /opt/suggestarr/config/config_files + msg_info "Building Frontend" cd /opt/suggestarr/client $STD npm install diff --git a/install/suggestarr-install.sh b/install/suggestarr-install.sh index ccc8de8d1..cd972196e 100644 --- a/install/suggestarr-install.sh +++ b/install/suggestarr-install.sh @@ -38,7 +38,9 @@ $STD uv pip install --python /opt/suggestarr/.venv -r /opt/suggestarr/api_servic msg_ok "Set up Python Environment" msg_info "Configuring SuggestArr" -mkdir -p /opt/suggestarr_data +mkdir -p /opt/suggestarr_data /opt/suggestarr/config +rm -rf /opt/suggestarr/config/config_files +ln -sfn /opt/suggestarr_data /opt/suggestarr/config/config_files cat </opt/suggestarr.env SUGGESTARR_PORT=5000 LOG_LEVEL=info