From 4bc9a89e22fc773aee38508622e1f65df6a2d6d4 Mon Sep 17 00:00:00 2001 From: Garret Hicks Date: Sun, 22 Oct 2017 00:18:12 -0700 Subject: [PATCH 1/4] add combustion --- Dockerfile | 4 ++++ Dockerfile.armhf | 4 ++++ transmission/environment-variables.tmpl | 1 + transmission/start.sh | 5 +++++ 4 files changed, 14 insertions(+) diff --git a/Dockerfile b/Dockerfile index 48b36149d..9fe196733 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,6 +15,9 @@ RUN apt-get update \ && add-apt-repository ppa:transmissionbt/ppa \ && apt-get update \ && apt-get install -y sudo transmission-cli transmission-common transmission-daemon curl rar unrar zip unzip wget \ + && wget -O - https://github.com/Secretmapper/combustion/archive/release.zip \ + && unzip release.zip ; rm *.zip \ + && mkdir /usr/bin/transmission-daemon/combustion ; mv combustion-release/* /usr/bin/transmission-daemon/combustion \ && wget -O - https://swupdate.openvpn.net/repos/repo-public.gpg|apt-key add - \ && echo "deb http://build.openvpn.net/debian/openvpn/stable xenial main" > /etc/apt/sources.list.d/openvpn-aptrepo.list \ && apt-get update \ @@ -107,6 +110,7 @@ ENV OPENVPN_USERNAME=**None** \ TRANSMISSION_WATCH_DIR_ENABLED=true \ TRANSMISSION_HOME=/data/transmission-home \ ENABLE_UFW=false \ + ENABLE_COMBUSTION_UI=false \ PUID=\ PGID=\ TRANSMISSION_WEB_HOME= diff --git a/Dockerfile.armhf b/Dockerfile.armhf index a403d421b..fb02e04e5 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -11,6 +11,9 @@ VOLUME /config # Update packages and install software RUN apt-get update \ && apt-get install -y transmission-cli transmission-common transmission-daemon \ + && wget -O - https://github.com/Secretmapper/combustion/archive/release.zip \ + && unzip release.zip ; rm *.zip \ + && mkdir /usr/bin/transmission-daemon/combustion ; mv combustion-release/* /usr/bin/transmission-daemon/combustion \ && apt-get install -y openvpn curl ufw \ && curl -sLO https://archive.raspbian.org/raspbian/pool/main/d/dumb-init/dumb-init_1.0.3-1_armhf.deb \ && dpkg -i dumb-init_*.deb \ @@ -101,6 +104,7 @@ ENV OPENVPN_USERNAME=**None** \ TRANSMISSION_WATCH_DIR_ENABLED=true \ TRANSMISSION_HOME=/data/transmission-home \ ENABLE_UFW=false \ + ENABLE_COMBUSTION_UI=false \ PUID=\ PGID=\ TRANSMISSION_WEB_HOME= diff --git a/transmission/environment-variables.tmpl b/transmission/environment-variables.tmpl index faa88a523..cfe5d1283 100644 --- a/transmission/environment-variables.tmpl +++ b/transmission/environment-variables.tmpl @@ -74,6 +74,7 @@ export TRANSMISSION_WATCH_DIR_ENABLED={{ .Env.TRANSMISSION_WATCH_DIR_ENABLED }} export OPENVPN_PROVIDER={{ .Env.OPENVPN_PROVIDER }} export ENABLE_UFW={{ .Env.ENABLE_UFW }} +export ENABLE_COMBUSTION_UI={{ .Env.ENABLE_COMBUSTION_UI }} export PUID={{ .Env.PUID }} export PGID={{ .Env.PGID }} diff --git a/transmission/start.sh b/transmission/start.sh index 237a6c504..59d169bca 100755 --- a/transmission/start.sh +++ b/transmission/start.sh @@ -19,6 +19,11 @@ if [ ! -e "/dev/random" ]; then ln -s /dev/urandom /dev/random fi +if [ "true" = "$ENABLE_UFW" ]; then + echo "Using Combustin UI, overriding TRANSMISSION_WEB_HOME" + export TRANSMISSION_WEB_HOME=//usr/bin/transmission-daemon/combustion +fi + . /etc/transmission/userSetup.sh echo "STARTING TRANSMISSION" From 70aef00546df7fa41a3f51f50ec21bf34d8bfa49 Mon Sep 17 00:00:00 2001 From: Garret Hicks Date: Sun, 22 Oct 2017 09:20:36 -0700 Subject: [PATCH 2/4] docs and some more tweaks --- Dockerfile | 6 +++--- README.md | 5 +++++ transmission/start.sh | 10 +++++----- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9fe196733..397109bd9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,9 +15,9 @@ RUN apt-get update \ && add-apt-repository ppa:transmissionbt/ppa \ && apt-get update \ && apt-get install -y sudo transmission-cli transmission-common transmission-daemon curl rar unrar zip unzip wget \ - && wget -O - https://github.com/Secretmapper/combustion/archive/release.zip \ - && unzip release.zip ; rm *.zip \ - && mkdir /usr/bin/transmission-daemon/combustion ; mv combustion-release/* /usr/bin/transmission-daemon/combustion \ + && wget -O /tmp/release.zip https://github.com/Secretmapper/combustion/archive/release.zip \ + && unzip -d /tmp /tmp/release.zip ; rm /tmp/*.zip \ + && mkdir /usr/bin/transmission-combustion/ ; mv /tmp/combustion-release/* /usr/bin/transmission-combustion/ \ && wget -O - https://swupdate.openvpn.net/repos/repo-public.gpg|apt-key add - \ && echo "deb http://build.openvpn.net/debian/openvpn/stable xenial main" > /etc/apt/sources.list.d/openvpn-aptrepo.list \ && apt-get update \ diff --git a/README.md b/README.md index a838ea673..4ddd5aa6d 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,11 @@ If TRANSMISSION_PEER_PORT_RANDOM_ON_START is enabled then it allows traffic to t |----------|----------|-------| |`ENABLE_UFW` | Enables the firewall | `ENABLE_UFW=true`| +### Alternative web UIs +You can override the default web UI by setting the ```TRANSMISSION_WEB_HOME``` environment variable. If set, Transmission will look there for the Web Interface files, such as the javascript, html, and graphics files. + +[Combustion UI](https://github.com/Secretmapper/combustion) comes bundled with the container. You can enable it by setting ```ENABLE_COMBUSTION_UI=true```. Note that this will override the ```TRANSMISSION_WEB_HOME``` variable if set. + ### Transmission configuration options You may override transmission options by setting the appropriate environment variable. diff --git a/transmission/start.sh b/transmission/start.sh index 59d169bca..e8fb5d87b 100755 --- a/transmission/start.sh +++ b/transmission/start.sh @@ -8,6 +8,11 @@ echo "Updating TRANSMISSION_BIND_ADDRESS_IPV4 to the ip of $1 : $4" export TRANSMISSION_BIND_ADDRESS_IPV4=$4 +if [ "true" = "$ENABLE_COMBUSTION_UI" ]; then + echo "Using Combustion UI, overriding TRANSMISSION_WEB_HOME" + export TRANSMISSION_WEB_HOME=/usr/bin/transmission-combustion +fi + echo "Generating transmission settings.json from env variables" # Ensure TRANSMISSION_HOME is created mkdir -p ${TRANSMISSION_HOME} @@ -19,11 +24,6 @@ if [ ! -e "/dev/random" ]; then ln -s /dev/urandom /dev/random fi -if [ "true" = "$ENABLE_UFW" ]; then - echo "Using Combustin UI, overriding TRANSMISSION_WEB_HOME" - export TRANSMISSION_WEB_HOME=//usr/bin/transmission-daemon/combustion -fi - . /etc/transmission/userSetup.sh echo "STARTING TRANSMISSION" From 3a97317f8612c5989cfe3b8de42f861c1b75122d Mon Sep 17 00:00:00 2001 From: Garret Hicks Date: Sun, 22 Oct 2017 09:27:01 -0700 Subject: [PATCH 3/4] add table of config options for custom web uis --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 4ddd5aa6d..74e2c54c6 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,11 @@ You can override the default web UI by setting the ```TRANSMISSION_WEB_HOME``` e [Combustion UI](https://github.com/Secretmapper/combustion) comes bundled with the container. You can enable it by setting ```ENABLE_COMBUSTION_UI=true```. Note that this will override the ```TRANSMISSION_WEB_HOME``` variable if set. +| Variable | Function | Example | +|----------|----------|-------| +|`TRANSMISSION_WEB_HOME` | Set Transmission web home | `TRANSMISSION_WEB_HOME=/path/to/web/ui`| +|`ENABLE_COMBUSTION_UI` | Use the bundled Combustion web UI | `ENABLE_COMBUSTION_UI=true`| + ### Transmission configuration options You may override transmission options by setting the appropriate environment variable. From 93ab8dcb9563ac3823e0d7569a7e9989058ecc86 Mon Sep 17 00:00:00 2001 From: Garret Hicks Date: Sun, 22 Oct 2017 09:31:30 -0700 Subject: [PATCH 4/4] apply changes from Dockerfile to Dockerfile.armhf --- Dockerfile.armhf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile.armhf b/Dockerfile.armhf index fb02e04e5..9df34a259 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -11,9 +11,9 @@ VOLUME /config # Update packages and install software RUN apt-get update \ && apt-get install -y transmission-cli transmission-common transmission-daemon \ - && wget -O - https://github.com/Secretmapper/combustion/archive/release.zip \ - && unzip release.zip ; rm *.zip \ - && mkdir /usr/bin/transmission-daemon/combustion ; mv combustion-release/* /usr/bin/transmission-daemon/combustion \ + && wget -O /tmp/release.zip https://github.com/Secretmapper/combustion/archive/release.zip \ + && unzip -d /tmp /tmp/release.zip ; rm /tmp/*.zip \ + && mkdir /usr/bin/transmission-combustion/ ; mv /tmp/combustion-release/* /usr/bin/transmission-combustion/ \ && apt-get install -y openvpn curl ufw \ && curl -sLO https://archive.raspbian.org/raspbian/pool/main/d/dumb-init/dumb-init_1.0.3-1_armhf.deb \ && dpkg -i dumb-init_*.deb \