From 7c5091b17dda6d0f54ba935e24610f032d623764 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 10 May 2026 15:33:00 +0000 Subject: [PATCH 1/2] Fix LSIO_NON_ROOT_USER unbound variable and remove duplicate QB_BIN detection Agent-Logs-Url: https://github.com/alexbelgium/hassio-addons/sessions/f0c93dc8-1fcc-4cad-b9c3-ef3443b14db9 Co-authored-by: alexbelgium <44178713+alexbelgium@users.noreply.github.com> --- qbittorrent/CHANGELOG.md | 3 +++ qbittorrent/config.yaml | 2 +- .../etc/s6-overlay/s6-rc.d/svc-qbittorrent/run | 16 +--------------- 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/qbittorrent/CHANGELOG.md b/qbittorrent/CHANGELOG.md index ef1dc986d2..9d3cb1ce57 100644 --- a/qbittorrent/CHANGELOG.md +++ b/qbittorrent/CHANGELOG.md @@ -1,4 +1,7 @@ +## 5.2.0-4 (2026-05-10) +- Fix "unbound variable" crash: use \`${LSIO_NON_ROOT_USER:-}\` so the variable is safely empty when unset; remove duplicate QB_BIN detection block + ## 5.2.0-3 (2026-05-10) - Fix qBittorrent restart loop: remove s6-notifyoncheck (notification-fd 3 EBADF when not running under s6-rc), discover binary path dynamically across LSIO image layouts, remove `/dev/stdout` redirect that fails on some ARM runtimes, align with upstream LSIO run script (WebUI address from config, LSIO_NON_ROOT_USER) - Fix Dockerfile: add missing `-i` flag to `sed '11,13d'` so default config lines are actually removed at build time diff --git a/qbittorrent/config.yaml b/qbittorrent/config.yaml index 78eca23a9f..5903974890 100644 --- a/qbittorrent/config.yaml +++ b/qbittorrent/config.yaml @@ -143,4 +143,4 @@ schema: slug: qbittorrent udev: true url: https://github.com/alexbelgium/hassio-addons -version: "5.2.0-3" +version: "5.2.0-4" diff --git a/qbittorrent/rootfs/etc/s6-overlay/s6-rc.d/svc-qbittorrent/run b/qbittorrent/rootfs/etc/s6-overlay/s6-rc.d/svc-qbittorrent/run index 5d51f2e215..6f56069fa9 100644 --- a/qbittorrent/rootfs/etc/s6-overlay/s6-rc.d/svc-qbittorrent/run +++ b/qbittorrent/rootfs/etc/s6-overlay/s6-rc.d/svc-qbittorrent/run @@ -56,20 +56,6 @@ if [[ -z "${QB_BIN}" ]]; then exit 1 fi -# Find qbittorrent-nox binary across different LSIO image layouts -QB_BIN="" -for candidate in /app/qbittorrent-nox /usr/bin/qbittorrent-nox /usr/local/bin/qbittorrent-nox; do - if [[ -x "${candidate}" ]]; then - QB_BIN="${candidate}" - break - fi -done - -if [[ -z "${QB_BIN}" ]]; then - bashio::log.fatal "qbittorrent-nox binary not found" - exit 1 -fi - bashio::log.info "Starting qBittorrent..." # Suppress output in silent mode by redirecting the current shell's stdout/stderr @@ -79,7 +65,7 @@ if bashio::config.true 'silent'; then exec >/dev/null 2>&1 fi -if [[ -z ${LSIO_NON_ROOT_USER} ]]; then +if [[ -z ${LSIO_NON_ROOT_USER:-} ]]; then exec s6-setuidgid abc "${QB_BIN}" --webui-port="${WEBUI_PORT}" else exec "${QB_BIN}" --webui-port="${WEBUI_PORT}" From 9bca5bf467741ca087878710c1330c616c710aac Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Sun, 10 May 2026 17:36:23 +0200 Subject: [PATCH 2/2] Add WEBUI_PORT variable with default value --- qbittorrent/rootfs/etc/s6-overlay/s6-rc.d/svc-qbittorrent/run | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qbittorrent/rootfs/etc/s6-overlay/s6-rc.d/svc-qbittorrent/run b/qbittorrent/rootfs/etc/s6-overlay/s6-rc.d/svc-qbittorrent/run index 6f56069fa9..ab84736533 100644 --- a/qbittorrent/rootfs/etc/s6-overlay/s6-rc.d/svc-qbittorrent/run +++ b/qbittorrent/rootfs/etc/s6-overlay/s6-rc.d/svc-qbittorrent/run @@ -1,6 +1,8 @@ #!/usr/bin/with-contenv bashio # shellcheck shell=bash +set +u + WEBUI_PORT=${WEBUI_PORT:-8080} export PATH="/usr/local/sbin:/usr/local/bin:${PATH}"