From 85bd37fa79a3d1795f28a67da5f42bdfdddf4038 Mon Sep 17 00:00:00 2001 From: Igor Pecovnik Date: Sun, 29 Dec 2024 21:46:53 +0100 Subject: [PATCH] Transmission: add docker subnet to the whitelist, so reverse proxy can connect to the web interface --- tools/modules/functions/set_runtime_variables.sh | 9 ++++++++- tools/modules/software/module_transmission.sh | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/tools/modules/functions/set_runtime_variables.sh b/tools/modules/functions/set_runtime_variables.sh index 05031e16..e4d5ab31 100644 --- a/tools/modules/functions/set_runtime_variables.sh +++ b/tools/modules/functions/set_runtime_variables.sh @@ -60,7 +60,14 @@ function set_runtime_variables() { DEFAULT_ADAPTER=$(ip -4 route ls | grep default | tail -1 | grep -Po '(?<=dev )(\S+)') LOCALIPADD=$(ip -4 addr show dev $DEFAULT_ADAPTER | awk '/inet/ {print $2}' | cut -d'/' -f1) LOCALSUBNET=$(echo ${LOCALIPADD} | cut -d"." -f1-3).0/24 - LOCALWHITELIST=$(echo ${LOCALIPADD} | cut -d"." -f1-3)".*" # for transmission + + # create local lan and docker lan whitelist for transmission + TRANSMISSION_WHITELIST=$(echo ${LOCALIPADD} | cut -d"." -f1-3)".*" + local docker_subnet=$(docker network inspect lsio 2> /dev/null | grep Subnet | xargs | cut -d" " -f2 | cut -d"/" -f1 | cut -d"." -f1-2) + if [[ -n "${docker_subnet}" ]]; then + TRANSMISSION_WHITELIST+=",${docker_subnet}.*.*" + fi + BACKTITLE="Contribute: https://github.com/armbian/configng" TITLE="Armbian configuration utility" [[ -z "${DEFAULT_ADAPTER// /}" ]] && DEFAULT_ADAPTER="lo" diff --git a/tools/modules/software/module_transmission.sh b/tools/modules/software/module_transmission.sh index 264612be..50e5f1ea 100644 --- a/tools/modules/software/module_transmission.sh +++ b/tools/modules/software/module_transmission.sh @@ -41,7 +41,7 @@ function module_transmission () { -e TZ="$(cat /etc/timezone)" \ -e USER="${TRANSMISSION_USER}" \ -e PASS="${TRANSMISSION_PASS}" \ - -e WHITELIST="${LOCALWHITELIST}" \ + -e WHITELIST="${TRANSMISSION_WHITELIST}" \ -p 9091:9091 \ -p 51413:51413 \ -p 51413:51413/udp \