From 1d653ed2185bbdeb91fa6f6594738b720417a184 Mon Sep 17 00:00:00 2001 From: thespad Date: Tue, 8 Oct 2024 11:08:25 +0100 Subject: [PATCH] Read webui bind address from config if present --- Dockerfile | 1 + Dockerfile.aarch64 | 1 + root/etc/s6-overlay/s6-rc.d/svc-qbittorrent/run | 7 ++++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f2e9df2..370eeab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,6 +21,7 @@ XDG_DATA_HOME="/config" RUN \ echo "**** install packages ****" && \ apk add -U --update --no-cache \ + grep \ icu-libs \ p7zip \ python3 \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 389eb88..3cc4616 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -21,6 +21,7 @@ XDG_DATA_HOME="/config" RUN \ echo "**** install packages ****" && \ apk add -U --update --no-cache \ + grep \ icu-libs \ p7zip \ python3 \ diff --git a/root/etc/s6-overlay/s6-rc.d/svc-qbittorrent/run b/root/etc/s6-overlay/s6-rc.d/svc-qbittorrent/run index a1fffe6..a03e7fb 100755 --- a/root/etc/s6-overlay/s6-rc.d/svc-qbittorrent/run +++ b/root/etc/s6-overlay/s6-rc.d/svc-qbittorrent/run @@ -6,6 +6,11 @@ if [[ -n "${TORRENTING_PORT}" ]]; then TORRENTING_PORT_ARG="--torrenting-port=${TORRENTING_PORT}" fi +WEBUI_ADDRESS=$(grep -Po "^WebUI\\\Address=\K(.*)" /config/qBittorrent/qBittorrent.conf) +if [[ -z ${WEBUI_ADDRESS} ]] || [[ ${WEBUI_ADDRESS} == "*" ]]; then + WEBUI_ADDRESS="localhost" +fi + exec \ - s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost ${WEBUI_PORT}" \ + s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z ${WEBUI_ADDRESS} ${WEBUI_PORT}" \ s6-setuidgid abc /app/qbittorrent-nox --webui-port="${WEBUI_PORT}" ${TORRENTING_PORT_ARG}