From b34de6639e8a5f8e83b7127f83ecfcaf9ced005a Mon Sep 17 00:00:00 2001 From: Gerhard Burger Date: Sun, 26 Oct 2025 15:40:49 +0100 Subject: [PATCH 1/6] Fix non-free sources - Don't delete after use - Use trixie instead of bookworm - deb822 style --- install/sabnzbd-install.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/install/sabnzbd-install.sh b/install/sabnzbd-install.sh index 1036a8a34c2..fc5834313b1 100644 --- a/install/sabnzbd-install.sh +++ b/install/sabnzbd-install.sh @@ -24,12 +24,15 @@ setup_uv msg_ok "Setup uv" msg_info "Setup Unrar" -cat </etc/apt/sources.list.d/non-free.list -deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware +cat </etc/apt/sources.list.d/non-free.sources +Types: deb +URIs: http://deb.debian.org/debian/ +Suites: trixie +Components: non-free +Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg EOF $STD apt update $STD apt install -y unrar -rm /etc/apt/sources.list.d/non-free.list msg_ok "Setup Unrar" msg_info "Installing SABnzbd" From aa05ca2c42ee97f618aaa8eafa12a094089c0918 Mon Sep 17 00:00:00 2001 From: Gerhard Burger Date: Sun, 26 Oct 2025 15:44:16 +0100 Subject: [PATCH 2/6] Add par2cmdline-turbo to sabnzbd --- ct/sabnzbd.sh | 4 ++++ install/sabnzbd-install.sh | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/ct/sabnzbd.sh b/ct/sabnzbd.sh index 41956a28415..928cf1a95b9 100644 --- a/ct/sabnzbd.sh +++ b/ct/sabnzbd.sh @@ -24,6 +24,10 @@ function update_script() { check_container_storage check_container_resources + if par2 --version | grep -q "par2cmdline-turbo"; then + fetch_and_deploy_gh_release "par2cmdline-turbo" "animetosho/par2cmdline-turbo" "prebuild" "latest" "/usr/bin/" "*-linux-amd64.zip" + fi + if [[ ! -d /opt/sabnzbd ]]; then msg_error "No ${APP} Installation Found!" exit diff --git a/install/sabnzbd-install.sh b/install/sabnzbd-install.sh index fc5834313b1..cd2ea2b93a2 100644 --- a/install/sabnzbd-install.sh +++ b/install/sabnzbd-install.sh @@ -46,6 +46,12 @@ $STD uv pip install -r /opt/sabnzbd/requirements.txt --python=/opt/sabnzbd/venv/ echo "${RELEASE}" >/opt/${APPLICATION}_version.txt msg_ok "Installed SABnzbd" +read -r -p "Would you like to install par2cmdline-turbo? " prompt +if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then + mv /usr/bin/par2 /usr/bin/par2.old + fetch_and_deploy_gh_release "par2cmdline-turbo" "animetosho/par2cmdline-turbo" "prebuild" "latest" "/usr/bin/" "*-linux-amd64.zip" +fi + msg_info "Creating Service" cat </etc/systemd/system/sabnzbd.service [Unit] From 52e5ebbbb0d3d9d9c90376d5315a731946aeeb21 Mon Sep 17 00:00:00 2001 From: Gerhard Burger Date: Sun, 26 Oct 2025 19:33:30 +0100 Subject: [PATCH 3/6] Remove duplicate setup_uv --- ct/sabnzbd.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/ct/sabnzbd.sh b/ct/sabnzbd.sh index 928cf1a95b9..b6e7bca546f 100644 --- a/ct/sabnzbd.sh +++ b/ct/sabnzbd.sh @@ -32,7 +32,6 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - setup_uv RELEASE=$(curl -fsSL https://api.github.com/repos/sabnzbd/sabnzbd/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') if [[ -f /opt/${APP}_version.txt ]] && [[ "${RELEASE}" == "$(cat /opt/${APP}_version.txt)" ]]; then msg_ok "No update required. ${APP} is already at ${RELEASE}" From f5b5aefe775313827cf8e141becb4cf810740168 Mon Sep 17 00:00:00 2001 From: Gerhard Burger Date: Sun, 26 Oct 2025 19:34:11 +0100 Subject: [PATCH 4/6] Remove duplicated msg around setup_uv --- install/sabnzbd-install.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/install/sabnzbd-install.sh b/install/sabnzbd-install.sh index cd2ea2b93a2..bc9acfc70b4 100644 --- a/install/sabnzbd-install.sh +++ b/install/sabnzbd-install.sh @@ -19,9 +19,7 @@ $STD apt install -y \ p7zip-full msg_ok "Installed Dependencies" -msg_info "Setup uv" setup_uv -msg_ok "Setup uv" msg_info "Setup Unrar" cat </etc/apt/sources.list.d/non-free.sources From b28321b9d25b58d773190697659b13c81ca32ce3 Mon Sep 17 00:00:00 2001 From: Gerhard Burger Date: Tue, 28 Oct 2025 13:29:45 +0100 Subject: [PATCH 5/6] Update sabnzbd to use fetch_and_deploy --- ct/sabnzbd.sh | 47 +++++++++++++++++--------------------- install/sabnzbd-install.sh | 10 ++------ 2 files changed, 23 insertions(+), 34 deletions(-) diff --git a/ct/sabnzbd.sh b/ct/sabnzbd.sh index b6e7bca546f..5b2c35de981 100644 --- a/ct/sabnzbd.sh +++ b/ct/sabnzbd.sh @@ -32,35 +32,30 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - RELEASE=$(curl -fsSL https://api.github.com/repos/sabnzbd/sabnzbd/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') - if [[ -f /opt/${APP}_version.txt ]] && [[ "${RELEASE}" == "$(cat /opt/${APP}_version.txt)" ]]; then - msg_ok "No update required. ${APP} is already at ${RELEASE}" - exit - fi - setup_uv - msg_info "Updating $APP to ${RELEASE}" - systemctl stop sabnzbd - cp -r /opt/sabnzbd /opt/sabnzbd_backup_$(date +%s) - temp_file=$(mktemp) - curl -fsSL "https://github.com/sabnzbd/sabnzbd/releases/download/${RELEASE}/SABnzbd-${RELEASE}-src.tar.gz" -o "$temp_file" - tar -xzf "$temp_file" -C /opt/sabnzbd --strip-components=1 - rm -f "$temp_file" - if [[ ! -d /opt/sabnzbd/venv ]]; then - msg_info "Migrating SABnzbd to uv virtual environment" - $STD uv venv /opt/sabnzbd/venv - msg_ok "Created uv venv at /opt/sabnzbd/venv" + if check_for_gh_release "sabnzbd-org" "sabnzbd/sabnzbd"; then + PYTHON_VERSION="3.13" setup_uv + systemctl stop sabnzbd + cp -r /opt/sabnzbd /opt/sabnzbd_backup_$(date +%s) + fetch_and_deploy_gh_release "sabnzbd-org" "sabnzbd/sabnzbd" "prebuild" "latest" "/opt/sabnzbd" "SABnzbd-*-src.tar.gz" + - if grep -q "ExecStart=python3 SABnzbd.py" /etc/systemd/system/sabnzbd.service; then - sed -i "s|ExecStart=python3 SABnzbd.py|ExecStart=/opt/sabnzbd/venv/bin/python SABnzbd.py|" /etc/systemd/system/sabnzbd.service - systemctl daemon-reload - msg_ok "Updated SABnzbd service to use uv venv" + if [[ ! -d /opt/sabnzbd/venv ]]; then + msg_info "Migrating SABnzbd to uv virtual environment" + $STD uv venv /opt/sabnzbd/venv + msg_ok "Created uv venv at /opt/sabnzbd/venv" + + if grep -q "ExecStart=python3 SABnzbd.py" /etc/systemd/system/sabnzbd.service; then + sed -i "s|ExecStart=python3 SABnzbd.py|ExecStart=/opt/sabnzbd/venv/bin/python SABnzbd.py|" /etc/systemd/system/sabnzbd.service + systemctl daemon-reload + msg_ok "Updated SABnzbd service to use uv venv" + fi fi + $STD uv pip install --upgrade pip --python=/opt/sabnzbd/venv/bin/python + $STD uv pip install -r /opt/sabnzbd/requirements.txt --python=/opt/sabnzbd/venv/bin/python + + systemctl start sabnzbd + msg_ok "Updated Successfully" fi - $STD uv pip install --upgrade pip --python=/opt/sabnzbd/venv/bin/python - $STD uv pip install -r /opt/sabnzbd/requirements.txt --python=/opt/sabnzbd/venv/bin/python - echo "${RELEASE}" >/opt/${APP}_version.txt - systemctl start sabnzbd - msg_ok "Updated ${APP} to ${RELEASE}" exit } diff --git a/install/sabnzbd-install.sh b/install/sabnzbd-install.sh index bc9acfc70b4..d248f19a449 100644 --- a/install/sabnzbd-install.sh +++ b/install/sabnzbd-install.sh @@ -19,7 +19,7 @@ $STD apt install -y \ p7zip-full msg_ok "Installed Dependencies" -setup_uv +PYTHON_VERSION="3.13" setup_uv msg_info "Setup Unrar" cat </etc/apt/sources.list.d/non-free.sources @@ -34,14 +34,9 @@ $STD apt install -y unrar msg_ok "Setup Unrar" msg_info "Installing SABnzbd" -RELEASE=$(curl -fsSL https://api.github.com/repos/sabnzbd/sabnzbd/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') -mkdir -p /opt/sabnzbd +fetch_and_deploy_gh_release "sabnzbd-org" "sabnzbd/sabnzbd" "prebuild" "latest" "/opt/sabnzbd" "SABnzbd-*-src.tar.gz" $STD uv venv /opt/sabnzbd/venv -temp_file=$(mktemp) -curl -fsSL "https://github.com/sabnzbd/sabnzbd/releases/download/${RELEASE}/SABnzbd-${RELEASE}-src.tar.gz" -o "$temp_file" -tar -xzf "$temp_file" -C /opt/sabnzbd --strip-components=1 $STD uv pip install -r /opt/sabnzbd/requirements.txt --python=/opt/sabnzbd/venv/bin/python -echo "${RELEASE}" >/opt/${APPLICATION}_version.txt msg_ok "Installed SABnzbd" read -r -p "Would you like to install par2cmdline-turbo? " prompt @@ -72,7 +67,6 @@ motd_ssh customize msg_info "Cleaning up" -rm -f "$temp_file" $STD apt -y autoremove $STD apt -y autoclean $STD apt -y clean From 0c7c56bd776a768283921bd3abea10bb489a837d Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 28 Oct 2025 15:49:20 +0100 Subject: [PATCH 6/6] switch fetch_deploy outside of msg Added virtual environment setup and package installation for SABnzbd. --- install/sabnzbd-install.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install/sabnzbd-install.sh b/install/sabnzbd-install.sh index d248f19a449..baa868c5439 100644 --- a/install/sabnzbd-install.sh +++ b/install/sabnzbd-install.sh @@ -33,8 +33,9 @@ $STD apt update $STD apt install -y unrar msg_ok "Setup Unrar" -msg_info "Installing SABnzbd" fetch_and_deploy_gh_release "sabnzbd-org" "sabnzbd/sabnzbd" "prebuild" "latest" "/opt/sabnzbd" "SABnzbd-*-src.tar.gz" + +msg_info "Installing SABnzbd" $STD uv venv /opt/sabnzbd/venv $STD uv pip install -r /opt/sabnzbd/requirements.txt --python=/opt/sabnzbd/venv/bin/python msg_ok "Installed SABnzbd"