Skip to content

Commit

Permalink
Transmission: add docker subnet to the whitelist, so reverse proxy ca…
Browse files Browse the repository at this point in the history
…n connect to the web interface
  • Loading branch information
igorpecovnik committed Dec 30, 2024
1 parent 3a3c630 commit 85bd37f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion tools/modules/functions/set_runtime_variables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion tools/modules/software/module_transmission.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down

0 comments on commit 85bd37f

Please sign in to comment.