From 01cec65568b2e8f4b3c1b036a8b3ba8758eb0747 Mon Sep 17 00:00:00 2001 From: Ian Neubert Date: Sat, 23 May 2015 09:06:08 -0700 Subject: [PATCH 01/12] Renamed files in repo that end up as start.sh inside container to start.sh in the repo too. Updated all piaconfigs to force tun0 --- Dockerfile | 4 ++-- piaconfig/AU Melbourne.ovpn | 2 +- piaconfig/AU Sydney.ovpn | 2 +- piaconfig/CA North York.ovpn | 2 +- piaconfig/CA Toronto.ovpn | 2 +- piaconfig/France.ovpn | 2 +- piaconfig/Germany.ovpn | 2 +- piaconfig/Hong Kong.ovpn | 2 +- piaconfig/Israel.ovpn | 2 +- piaconfig/Japan.ovpn | 2 +- piaconfig/Mexico.ovpn | 2 +- piaconfig/Netherlands.ovpn | 2 +- piaconfig/Romania.ovpn | 2 +- piaconfig/Russia.ovpn | 2 +- piaconfig/Singapore.ovpn | 2 +- piaconfig/Sweden.ovpn | 2 +- piaconfig/Switzerland.ovpn | 2 +- piaconfig/UK London.ovpn | 2 +- piaconfig/UK Southampton.ovpn | 2 +- piaconfig/US California.ovpn | 2 +- piaconfig/US East.ovpn | 2 +- piaconfig/US Florida.ovpn | 2 +- piaconfig/US Midwest.ovpn | 2 +- piaconfig/US Seattle.ovpn | 2 +- piaconfig/US Silicon Valley.ovpn | 2 +- piaconfig/US Texas.ovpn | 2 +- piaconfig/US West.ovpn | 2 +- runOpenVpn.sh => start.sh | 0 transmission/{run.sh => start.sh} | 0 29 files changed, 28 insertions(+), 28 deletions(-) rename runOpenVpn.sh => start.sh (100%) rename transmission/{run.sh => start.sh} (100%) diff --git a/Dockerfile b/Dockerfile index e749218..d5a6c73 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,10 +23,10 @@ ADD piaconfig/crl.pem /etc/openvpn/crl.pem ADD transmission/defaultSettings.tmpl /etc/transmission-daemon/settings.tmpl ADD transmission/updateTransmissionPort.sh /etc/transmission-daemon/updatePort.sh ADD transmission/periodicUpdates.sh /etc/transmission-daemon/periodicUpdates.sh -ADD transmission/run.sh /etc/transmission-daemon/start.sh +ADD transmission/start.sh /etc/transmission-daemon/start.sh ADD transmission/runUpdates.sh /etc/transmission-daemon/startPortUpdates.sh ADD transmission/down.sh /etc/transmission-daemon/stop.sh -ADD runOpenVpn.sh /etc/openvpn/start.sh +ADD start.sh /etc/openvpn/start.sh ENV PIA_USERNAME=**None** \ PIA_PASSWORD=**None** \ diff --git a/piaconfig/AU Melbourne.ovpn b/piaconfig/AU Melbourne.ovpn index b2be48e..a32dffa 100644 --- a/piaconfig/AU Melbourne.ovpn +++ b/piaconfig/AU Melbourne.ovpn @@ -1,5 +1,5 @@ client -dev tun +dev tun0 proto udp remote aus-melbourne.privateinternetaccess.com 1194 resolv-retry infinite diff --git a/piaconfig/AU Sydney.ovpn b/piaconfig/AU Sydney.ovpn index 5106144..04fb526 100644 --- a/piaconfig/AU Sydney.ovpn +++ b/piaconfig/AU Sydney.ovpn @@ -1,5 +1,5 @@ client -dev tun +dev tun0 proto udp remote aus.privateinternetaccess.com 1194 resolv-retry infinite diff --git a/piaconfig/CA North York.ovpn b/piaconfig/CA North York.ovpn index 80853f2..491482e 100644 --- a/piaconfig/CA North York.ovpn +++ b/piaconfig/CA North York.ovpn @@ -1,5 +1,5 @@ client -dev tun +dev tun0 proto udp remote ca.privateinternetaccess.com 1194 resolv-retry infinite diff --git a/piaconfig/CA Toronto.ovpn b/piaconfig/CA Toronto.ovpn index 7baeb4b..b52fa62 100644 --- a/piaconfig/CA Toronto.ovpn +++ b/piaconfig/CA Toronto.ovpn @@ -1,5 +1,5 @@ client -dev tun +dev tun0 proto udp remote ca-toronto.privateinternetaccess.com 1194 resolv-retry infinite diff --git a/piaconfig/France.ovpn b/piaconfig/France.ovpn index 140c3e9..b311bf0 100644 --- a/piaconfig/France.ovpn +++ b/piaconfig/France.ovpn @@ -1,5 +1,5 @@ client -dev tun +dev tun0 proto udp remote france.privateinternetaccess.com 1194 resolv-retry infinite diff --git a/piaconfig/Germany.ovpn b/piaconfig/Germany.ovpn index fa1cce7..c496a73 100644 --- a/piaconfig/Germany.ovpn +++ b/piaconfig/Germany.ovpn @@ -1,5 +1,5 @@ client -dev tun +dev tun0 proto udp remote germany.privateinternetaccess.com 1194 resolv-retry infinite diff --git a/piaconfig/Hong Kong.ovpn b/piaconfig/Hong Kong.ovpn index 299f984..328cfbf 100644 --- a/piaconfig/Hong Kong.ovpn +++ b/piaconfig/Hong Kong.ovpn @@ -1,5 +1,5 @@ client -dev tun +dev tun0 proto udp remote hk.privateinternetaccess.com 1194 resolv-retry infinite diff --git a/piaconfig/Israel.ovpn b/piaconfig/Israel.ovpn index bcf0d76..7a617e3 100644 --- a/piaconfig/Israel.ovpn +++ b/piaconfig/Israel.ovpn @@ -1,5 +1,5 @@ client -dev tun +dev tun0 proto udp remote israel.privateinternetaccess.com 1194 resolv-retry infinite diff --git a/piaconfig/Japan.ovpn b/piaconfig/Japan.ovpn index 2a1d44e..e3a8c1b 100644 --- a/piaconfig/Japan.ovpn +++ b/piaconfig/Japan.ovpn @@ -1,5 +1,5 @@ client -dev tun +dev tun0 proto udp remote japan.privateinternetaccess.com 1194 resolv-retry infinite diff --git a/piaconfig/Mexico.ovpn b/piaconfig/Mexico.ovpn index 7199dd3..e2498dd 100644 --- a/piaconfig/Mexico.ovpn +++ b/piaconfig/Mexico.ovpn @@ -1,5 +1,5 @@ client -dev tun +dev tun0 proto udp remote mexico.privateinternetaccess.com 1194 resolv-retry infinite diff --git a/piaconfig/Netherlands.ovpn b/piaconfig/Netherlands.ovpn index 7293b2a..4875fca 100644 --- a/piaconfig/Netherlands.ovpn +++ b/piaconfig/Netherlands.ovpn @@ -1,5 +1,5 @@ client -dev tun +dev tun0 proto udp remote nl.privateinternetaccess.com 1194 resolv-retry infinite diff --git a/piaconfig/Romania.ovpn b/piaconfig/Romania.ovpn index 15e4d3f..5da65fd 100644 --- a/piaconfig/Romania.ovpn +++ b/piaconfig/Romania.ovpn @@ -1,5 +1,5 @@ client -dev tun +dev tun0 proto udp remote ro.privateinternetaccess.com 1194 resolv-retry infinite diff --git a/piaconfig/Russia.ovpn b/piaconfig/Russia.ovpn index 1e885d6..106f565 100644 --- a/piaconfig/Russia.ovpn +++ b/piaconfig/Russia.ovpn @@ -1,5 +1,5 @@ client -dev tun +dev tun0 proto udp remote russia.privateinternetaccess.com 1194 resolv-retry infinite diff --git a/piaconfig/Singapore.ovpn b/piaconfig/Singapore.ovpn index 15f14ff..5cd195b 100644 --- a/piaconfig/Singapore.ovpn +++ b/piaconfig/Singapore.ovpn @@ -1,5 +1,5 @@ client -dev tun +dev tun0 proto udp remote sg.privateinternetaccess.com 1194 resolv-retry infinite diff --git a/piaconfig/Sweden.ovpn b/piaconfig/Sweden.ovpn index cd8a963..9129a59 100644 --- a/piaconfig/Sweden.ovpn +++ b/piaconfig/Sweden.ovpn @@ -1,5 +1,5 @@ client -dev tun +dev tun0 proto udp remote sweden.privateinternetaccess.com 1194 resolv-retry infinite diff --git a/piaconfig/Switzerland.ovpn b/piaconfig/Switzerland.ovpn index 98bcef0..8113f20 100644 --- a/piaconfig/Switzerland.ovpn +++ b/piaconfig/Switzerland.ovpn @@ -1,5 +1,5 @@ client -dev tun +dev tun0 proto udp remote swiss.privateinternetaccess.com 1194 resolv-retry infinite diff --git a/piaconfig/UK London.ovpn b/piaconfig/UK London.ovpn index ed5ceb5..1c43b4d 100644 --- a/piaconfig/UK London.ovpn +++ b/piaconfig/UK London.ovpn @@ -1,5 +1,5 @@ client -dev tun +dev tun0 proto udp remote uk-london.privateinternetaccess.com 1194 resolv-retry infinite diff --git a/piaconfig/UK Southampton.ovpn b/piaconfig/UK Southampton.ovpn index e0c426a..a668641 100644 --- a/piaconfig/UK Southampton.ovpn +++ b/piaconfig/UK Southampton.ovpn @@ -1,5 +1,5 @@ client -dev tun +dev tun0 proto udp remote uk-southampton.privateinternetaccess.com 1194 resolv-retry infinite diff --git a/piaconfig/US California.ovpn b/piaconfig/US California.ovpn index 907d10c..1b72cbb 100644 --- a/piaconfig/US California.ovpn +++ b/piaconfig/US California.ovpn @@ -1,5 +1,5 @@ client -dev tun +dev tun0 proto udp remote us-california.privateinternetaccess.com 1194 resolv-retry infinite diff --git a/piaconfig/US East.ovpn b/piaconfig/US East.ovpn index c67929f..368eacd 100644 --- a/piaconfig/US East.ovpn +++ b/piaconfig/US East.ovpn @@ -1,5 +1,5 @@ client -dev tun +dev tun0 proto udp remote us-east.privateinternetaccess.com 1194 resolv-retry infinite diff --git a/piaconfig/US Florida.ovpn b/piaconfig/US Florida.ovpn index b593738..2af9e4e 100644 --- a/piaconfig/US Florida.ovpn +++ b/piaconfig/US Florida.ovpn @@ -1,5 +1,5 @@ client -dev tun +dev tun0 proto udp remote us-florida.privateinternetaccess.com 1194 resolv-retry infinite diff --git a/piaconfig/US Midwest.ovpn b/piaconfig/US Midwest.ovpn index ac68135..446357f 100644 --- a/piaconfig/US Midwest.ovpn +++ b/piaconfig/US Midwest.ovpn @@ -1,5 +1,5 @@ client -dev tun +dev tun0 proto udp remote us-midwest.privateinternetaccess.com 1194 resolv-retry infinite diff --git a/piaconfig/US Seattle.ovpn b/piaconfig/US Seattle.ovpn index 127dc4e..c428b8e 100644 --- a/piaconfig/US Seattle.ovpn +++ b/piaconfig/US Seattle.ovpn @@ -1,5 +1,5 @@ client -dev tun +dev tun0 proto udp remote us-seattle.privateinternetaccess.com 1194 resolv-retry infinite diff --git a/piaconfig/US Silicon Valley.ovpn b/piaconfig/US Silicon Valley.ovpn index 92eb68c..71fdb84 100644 --- a/piaconfig/US Silicon Valley.ovpn +++ b/piaconfig/US Silicon Valley.ovpn @@ -1,5 +1,5 @@ client -dev tun +dev tun0 proto udp remote us-siliconvalley.privateinternetaccess.com 1194 resolv-retry infinite diff --git a/piaconfig/US Texas.ovpn b/piaconfig/US Texas.ovpn index 289a73e..470cb08 100644 --- a/piaconfig/US Texas.ovpn +++ b/piaconfig/US Texas.ovpn @@ -1,5 +1,5 @@ client -dev tun +dev tun0 proto udp remote us-texas.privateinternetaccess.com 1194 resolv-retry infinite diff --git a/piaconfig/US West.ovpn b/piaconfig/US West.ovpn index d09b1e8..a674271 100644 --- a/piaconfig/US West.ovpn +++ b/piaconfig/US West.ovpn @@ -1,5 +1,5 @@ client -dev tun +dev tun0 proto udp remote us-west.privateinternetaccess.com 1194 resolv-retry infinite diff --git a/runOpenVpn.sh b/start.sh similarity index 100% rename from runOpenVpn.sh rename to start.sh diff --git a/transmission/run.sh b/transmission/start.sh similarity index 100% rename from transmission/run.sh rename to transmission/start.sh From ceab19795ba1971507ae1cd7eec483b6f6285174 Mon Sep 17 00:00:00 2001 From: Ian Neubert Date: Sat, 23 May 2015 09:30:58 -0700 Subject: [PATCH 02/12] Find IP of tun0 during transmission start up and set the configuration to bind to it. Closes #11 --- Dockerfile | 1 - start.sh | 6 +++--- transmission/defaultSettings.tmpl | 2 +- transmission/start.sh | 5 +++++ 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index d5a6c73..bc31bea 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,7 +37,6 @@ ENV PIA_USERNAME=**None** \ "TRANSMISSION_ALT_SPEED_TIME_ENABLED=false" \ "TRANSMISSION_ALT_SPEED_TIME_END=1020" \ "TRANSMISSION_ALT_SPEED_UP=50" \ - "TRANSMISSION_BIND_ADDRESS_IPV4=0.0.0.0" \ "TRANSMISSION_BIND_ADDRESS_IPV6=::" \ "TRANSMISSION_BLOCKLIST_ENABLED=false" \ "TRANSMISSION_BLOCKLIST_URL=http://www.example.com/blocklist" \ diff --git a/start.sh b/start.sh index 8909c2a..80f447f 100755 --- a/start.sh +++ b/start.sh @@ -38,13 +38,13 @@ fi echo $TRANSMISSION_RPC_USERNAME > /config/transmission-credentials.txt echo $TRANSMISSION_RPC_PASSWORD >> /config/transmission-credentials.txt - +# setup transmission configuration if [ ! -z ${KEEP_TRANSMISSION_STATE} ] then mkdir -p /data/transmission-data/ - dockerize -template /etc/transmission-daemon/settings.tmpl:/data/transmission-data/settings.json true + dockerize -template /etc/transmission-daemon/settings.tmpl:/data/transmission-data/settings.json /bin/true else - dockerize -template /etc/transmission-daemon/settings.tmpl:/etc/transmission-daemon/settings.json true + dockerize -template /etc/transmission-daemon/settings.tmpl:/etc/transmission-daemon/settings.json /bin/true fi exec openvpn --config "$OPEN_VPN_CONFIG" diff --git a/transmission/defaultSettings.tmpl b/transmission/defaultSettings.tmpl index 3f3b11c..a4de625 100644 --- a/transmission/defaultSettings.tmpl +++ b/transmission/defaultSettings.tmpl @@ -6,7 +6,7 @@ "alt-speed-time-enabled": {{ .Env.TRANSMISSION_ALT_SPEED_TIME_ENABLED }}, "alt-speed-time-end": {{ .Env.TRANSMISSION_ALT_SPEED_TIME_END }}, "alt-speed-up": {{ .Env.TRANSMISSION_ALT_SPEED_UP }}, - "bind-address-ipv4": "{{ .Env.TRANSMISSION_BIND_ADDRESS_IPV4 }}", + "bind-address-ipv4": "!!BINDIPV4!!", "bind-address-ipv6": "{{ .Env.TRANSMISSION_BIND_ADDRESS_IPV6 }}", "blocklist-enabled": {{ .Env.TRANSMISSION_BLOCKLIST_ENABLED }}, "blocklist-url": "{{ .Env.TRANSMISSION_BLOCKLIST_URL }}", diff --git a/transmission/start.sh b/transmission/start.sh index 59a25f9..75f9547 100755 --- a/transmission/start.sh +++ b/transmission/start.sh @@ -9,6 +9,11 @@ else exec /usr/bin/transmission-daemon -g /etc/transmission-daemon/ & fi +# determine IP of tun0, and bind to it +export TRANSMISSION_BIND_ADDRESS_IPV4=$(ifconfig tun0 | sed -n '2 p' | awk '{print $2}' | cut -d: -f2) +echo "BINDING TRANSMISSION to $TRANSMISSION_BIND_ADDRESS_IPV4" +perl -p -i -e 's/!!BINDIPV4!!/$ENV{"TRANSMISSION_BIND_ADDRESS_IPV4"}/' /etc/transmission-daemon/settings.json + exec /etc/transmission-daemon/startPortUpdates.sh & echo "STARTED PORT UPDATER" From 1d0e5845919ed5094e778b6a8c0cc9d953dd5fe4 Mon Sep 17 00:00:00 2001 From: Kristian Haugene Date: Sun, 24 May 2015 18:32:08 +0200 Subject: [PATCH 03/12] standardize on sh --- transmission/down.sh | 2 +- transmission/periodicUpdates.sh | 2 +- transmission/updateTransmissionPort.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/transmission/down.sh b/transmission/down.sh index 0f9c4f4..36f6f51 100755 --- a/transmission/down.sh +++ b/transmission/down.sh @@ -1,3 +1,3 @@ -#! /bin/bash +#! /bin/sh kill $(ps aux | grep transmission-daemon | grep -v grep | awk '{print $2}') diff --git a/transmission/periodicUpdates.sh b/transmission/periodicUpdates.sh index ffcd37a..2325b27 100755 --- a/transmission/periodicUpdates.sh +++ b/transmission/periodicUpdates.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh while [ 1 ] do diff --git a/transmission/updateTransmissionPort.sh b/transmission/updateTransmissionPort.sh index f798ff1..fac3e21 100755 --- a/transmission/updateTransmissionPort.sh +++ b/transmission/updateTransmissionPort.sh @@ -1,4 +1,4 @@ -#/bin/bash +#! /bin/sh # Settings PIA_PASSWD_FILE=/config/pia-credentials.txt From 0d918b22f9a072b633738bcd2f8997401a73d287 Mon Sep 17 00:00:00 2001 From: Kristian Haugene Date: Sun, 24 May 2015 19:05:05 +0200 Subject: [PATCH 04/12] set fixed transmission-daemon home, move dockerize settings.json till we know tun0 ip --- Dockerfile | 1 + README.md | 5 ----- start.sh | 9 --------- transmission/start.sh | 23 ++++++++++------------- transmission/updateTransmissionPort.sh | 7 ------- 5 files changed, 11 insertions(+), 34 deletions(-) diff --git a/Dockerfile b/Dockerfile index bc31bea..22609e5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,6 +6,7 @@ FROM ubuntu:14.04 MAINTAINER Kristian Haugene VOLUME /data +VOLUME /config # Update packages and install software RUN apt-get update \ diff --git a/README.md b/README.md index f7f0521..fdf3766 100644 --- a/README.md +++ b/README.md @@ -44,11 +44,6 @@ NB: Instructions on how to use your own Transmission settings, and how to connec |`OPEN_VPN_CONFIG` | Sets the PIA endpoint to connect to. | `OPEN_VPN_CONFIG=UK Southampton`| |`RESOLV_OVERRIDE` | The value of this variable will be written to `/etc/resolv.conf`. | `RESOLV_OVERRIDE=nameserver 8.8.8.8\nnameserver 8.8.4.4\n`| -## Storage options -| Variable | Function | Example | -|----------|----------|-------| -|`KEEP_TRANSMISSION_STATE`|If set, persists transmission data to your /data mount point. Keeps state between restarts. Delete the folder to disable this later. |`KEEP_TRANSMISSION_STATE=YES`| - ## Transmission configuration options You may override transmission options by setting the appropriate environment variable. diff --git a/start.sh b/start.sh index 80f447f..f0eaeb0 100755 --- a/start.sh +++ b/start.sh @@ -38,13 +38,4 @@ fi echo $TRANSMISSION_RPC_USERNAME > /config/transmission-credentials.txt echo $TRANSMISSION_RPC_PASSWORD >> /config/transmission-credentials.txt -# setup transmission configuration -if [ ! -z ${KEEP_TRANSMISSION_STATE} ] -then - mkdir -p /data/transmission-data/ - dockerize -template /etc/transmission-daemon/settings.tmpl:/data/transmission-data/settings.json /bin/true -else - dockerize -template /etc/transmission-daemon/settings.tmpl:/etc/transmission-daemon/settings.json /bin/true -fi - exec openvpn --config "$OPEN_VPN_CONFIG" diff --git a/transmission/start.sh b/transmission/start.sh index 75f9547..fa488e6 100755 --- a/transmission/start.sh +++ b/transmission/start.sh @@ -1,19 +1,16 @@ #!/bin/sh -if [ -f /data/transmission-data/settings.json ] -then - echo "STARTING TRANSMISSION: Using transmission-data subdirectory to your /data mount point to store state." - exec /usr/bin/transmission-daemon -g /data/transmission-data/ & -else - echo "STARTING TRANSMISSION: Storing state in container only." - exec /usr/bin/transmission-daemon -g /etc/transmission-daemon/ & -fi +tun0ip=$(ifconfig tun0 | sed -n '2 p' | awk '{print $2}' | cut -d: -f2) +echo "Updating TRANSMISSION_BIND_ADDRESS_IPV4 to tun0 ip: ${tun0ip}" +export TRANSMISSION_BIND_ADDRESS_IPV4=${tun0ip} -# determine IP of tun0, and bind to it -export TRANSMISSION_BIND_ADDRESS_IPV4=$(ifconfig tun0 | sed -n '2 p' | awk '{print $2}' | cut -d: -f2) -echo "BINDING TRANSMISSION to $TRANSMISSION_BIND_ADDRESS_IPV4" -perl -p -i -e 's/!!BINDIPV4!!/$ENV{"TRANSMISSION_BIND_ADDRESS_IPV4"}/' /etc/transmission-daemon/settings.json +echo "Generating transmission settings.json from env variables" +dockerize -template /etc/transmission-daemon/settings.tmpl:/etc/transmission-daemon/settings.json /bin/true +echo "STARTING TRANSMISSION" +exec /usr/bin/transmission-daemon -g /etc/transmission-daemon/ & + +echo "STARTING PORT UPDATER" exec /etc/transmission-daemon/startPortUpdates.sh & -echo "STARTED PORT UPDATER" +echo "Transmission startup script complete." diff --git a/transmission/updateTransmissionPort.sh b/transmission/updateTransmissionPort.sh index fac3e21..d1038fc 100755 --- a/transmission/updateTransmissionPort.sh +++ b/transmission/updateTransmissionPort.sh @@ -13,13 +13,6 @@ pia_client_id_file=/etc/transmission-daemon/pia_client_id transmission_settings_file=/etc/transmission-daemon/settings.json port_assignment_url=https://www.privateinternetaccess.com/vpninfo/port_forward_assignment -if [ -f /data/transmission-data/settings.json ]; -then - transmission_settings_file=/data/transmission-data/settings.json -else - transmission_settings_file=/etc/transmission-daemon/settings.json -fi - # # First get a port from PIA # From 8a3a0b30e962389659a2f334e403710e8e7661ba Mon Sep 17 00:00:00 2001 From: Kristian Haugene Date: Sun, 24 May 2015 20:40:25 +0200 Subject: [PATCH 05/12] persist env variables on startup. conform to /bin/sh --- Dockerfile | 2 + start.sh | 3 + transmission/defaultSettings.tmpl | 2 +- transmission/environment-variables.tmpl | 74 +++++++++++++++++++++++++ transmission/start.sh | 3 + transmission/updateTransmissionPort.sh | 6 +- 6 files changed, 86 insertions(+), 4 deletions(-) create mode 100644 transmission/environment-variables.tmpl diff --git a/Dockerfile b/Dockerfile index 22609e5..9ab6cb3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,6 +27,7 @@ ADD transmission/periodicUpdates.sh /etc/transmission-daemon/periodicUpdates.sh ADD transmission/start.sh /etc/transmission-daemon/start.sh ADD transmission/runUpdates.sh /etc/transmission-daemon/startPortUpdates.sh ADD transmission/down.sh /etc/transmission-daemon/stop.sh +ADD transmission/environment-variables.tmpl /etc/transmission-daemon/environment-variables.tmpl ADD start.sh /etc/openvpn/start.sh ENV PIA_USERNAME=**None** \ @@ -38,6 +39,7 @@ ENV PIA_USERNAME=**None** \ "TRANSMISSION_ALT_SPEED_TIME_ENABLED=false" \ "TRANSMISSION_ALT_SPEED_TIME_END=1020" \ "TRANSMISSION_ALT_SPEED_UP=50" \ + "TRANSMISSION_BIND_ADDRESS_IPV4=0.0.0.0" \ "TRANSMISSION_BIND_ADDRESS_IPV6=::" \ "TRANSMISSION_BLOCKLIST_ENABLED=false" \ "TRANSMISSION_BLOCKLIST_URL=http://www.example.com/blocklist" \ diff --git a/start.sh b/start.sh index f0eaeb0..211c1b3 100755 --- a/start.sh +++ b/start.sh @@ -38,4 +38,7 @@ fi echo $TRANSMISSION_RPC_USERNAME > /config/transmission-credentials.txt echo $TRANSMISSION_RPC_PASSWORD >> /config/transmission-credentials.txt +# Persist transmission settings for use by transmission-daemon +dockerize -template /etc/transmission-daemon/environment-variables.tmpl:/etc/transmission-daemon/environment-variables.sh /bin/true + exec openvpn --config "$OPEN_VPN_CONFIG" diff --git a/transmission/defaultSettings.tmpl b/transmission/defaultSettings.tmpl index a4de625..3f3b11c 100644 --- a/transmission/defaultSettings.tmpl +++ b/transmission/defaultSettings.tmpl @@ -6,7 +6,7 @@ "alt-speed-time-enabled": {{ .Env.TRANSMISSION_ALT_SPEED_TIME_ENABLED }}, "alt-speed-time-end": {{ .Env.TRANSMISSION_ALT_SPEED_TIME_END }}, "alt-speed-up": {{ .Env.TRANSMISSION_ALT_SPEED_UP }}, - "bind-address-ipv4": "!!BINDIPV4!!", + "bind-address-ipv4": "{{ .Env.TRANSMISSION_BIND_ADDRESS_IPV4 }}", "bind-address-ipv6": "{{ .Env.TRANSMISSION_BIND_ADDRESS_IPV6 }}", "blocklist-enabled": {{ .Env.TRANSMISSION_BLOCKLIST_ENABLED }}, "blocklist-url": "{{ .Env.TRANSMISSION_BLOCKLIST_URL }}", diff --git a/transmission/environment-variables.tmpl b/transmission/environment-variables.tmpl new file mode 100644 index 0000000..5959f7e --- /dev/null +++ b/transmission/environment-variables.tmpl @@ -0,0 +1,74 @@ +#! /bin/sh + +export TRANSMISSION_ALT_SPEED_DOWN={{ .Env.TRANSMISSION_ALT_SPEED_DOWN }} +export TRANSMISSION_ALT_SPEED_ENABLED={{ .Env.TRANSMISSION_ALT_SPEED_ENABLED }} +export TRANSMISSION_ALT_SPEED_TIME_BEGIN={{ .Env.TRANSMISSION_ALT_SPEED_TIME_BEGIN }} +export TRANSMISSION_ALT_SPEED_TIME_DAY={{ .Env.TRANSMISSION_ALT_SPEED_TIME_DAY }} +export TRANSMISSION_ALT_SPEED_TIME_ENABLED={{ .Env.TRANSMISSION_ALT_SPEED_TIME_ENABLED }} +export TRANSMISSION_ALT_SPEED_TIME_END={{ .Env.TRANSMISSION_ALT_SPEED_TIME_END }} +export TRANSMISSION_ALT_SPEED_UP={{ .Env.TRANSMISSION_ALT_SPEED_UP }} +export TRANSMISSION_BIND_ADDRESS_IPV4={{ .Env.TRANSMISSION_BIND_ADDRESS_IPV4 }} +export TRANSMISSION_BIND_ADDRESS_IPV6={{ .Env.TRANSMISSION_BIND_ADDRESS_IPV6 }} +export TRANSMISSION_BLOCKLIST_ENABLED={{ .Env.TRANSMISSION_BLOCKLIST_ENABLED }} +export TRANSMISSION_BLOCKLIST_URL={{ .Env.TRANSMISSION_BLOCKLIST_URL }} +export TRANSMISSION_CACHE_SIZE_MB={{ .Env.TRANSMISSION_CACHE_SIZE_MB }} +export TRANSMISSION_DHT_ENABLED={{ .Env.TRANSMISSION_DHT_ENABLED }} +export TRANSMISSION_DOWNLOAD_DIR={{ .Env.TRANSMISSION_DOWNLOAD_DIR }} +export TRANSMISSION_DOWNLOAD_LIMIT={{ .Env.TRANSMISSION_DOWNLOAD_LIMIT }} +export TRANSMISSION_DOWNLOAD_LIMIT_ENABLED={{ .Env.TRANSMISSION_DOWNLOAD_LIMIT_ENABLED }} +export TRANSMISSION_DOWNLOAD_QUEUE_ENABLED={{ .Env.TRANSMISSION_DOWNLOAD_QUEUE_ENABLED }} +export TRANSMISSION_DOWNLOAD_QUEUE_SIZE={{ .Env.TRANSMISSION_DOWNLOAD_QUEUE_SIZE }} +export TRANSMISSION_ENCRYPTION={{ .Env.TRANSMISSION_ENCRYPTION }} +export TRANSMISSION_IDLE_SEEDING_LIMIT={{ .Env.TRANSMISSION_IDLE_SEEDING_LIMIT }} +export TRANSMISSION_IDLE_SEEDING_LIMIT_ENABLED={{ .Env.TRANSMISSION_IDLE_SEEDING_LIMIT_ENABLED }} +export TRANSMISSION_INCOMPLETE_DIR={{ .Env.TRANSMISSION_INCOMPLETE_DIR }} +export TRANSMISSION_INCOMPLETE_DIR_ENABLED={{ .Env.TRANSMISSION_INCOMPLETE_DIR_ENABLED }} +export TRANSMISSION_LPD_ENABLED={{ .Env.TRANSMISSION_LPD_ENABLED }} +export TRANSMISSION_MAX_PEERS_GLOBAL={{ .Env.TRANSMISSION_MAX_PEERS_GLOBAL }} +export TRANSMISSION_MESSAGE_LEVEL={{ .Env.TRANSMISSION_MESSAGE_LEVEL }} +export TRANSMISSION_PEER_CONGESTION_ALGORITHM={{ .Env.TRANSMISSION_PEER_CONGESTION_ALGORITHM }} +export TRANSMISSION_PEER_ID_TTL_HOURS={{ .Env.TRANSMISSION_PEER_ID_TTL_HOURS }} +export TRANSMISSION_PEER_LIMIT_GLOBAL={{ .Env.TRANSMISSION_PEER_LIMIT_GLOBAL }} +export TRANSMISSION_PEER_LIMIT_PER_TORRENT={{ .Env.TRANSMISSION_PEER_LIMIT_PER_TORRENT }} +export TRANSMISSION_PEER_PORT={{ .Env.TRANSMISSION_PEER_PORT }} +export TRANSMISSION_PEER_PORT_RANDOM_HIGH={{ .Env.TRANSMISSION_PEER_PORT_RANDOM_HIGH }} +export TRANSMISSION_PEER_PORT_RANDOM_LOW={{ .Env.TRANSMISSION_PEER_PORT_RANDOM_LOW }} +export TRANSMISSION_PEER_PORT_RANDOM_ON_START={{ .Env.TRANSMISSION_PEER_PORT_RANDOM_ON_START }} +export TRANSMISSION_PEER_SOCKET_TOS={{ .Env.TRANSMISSION_PEER_SOCKET_TOS }} +export TRANSMISSION_PEX_ENABLED={{ .Env.TRANSMISSION_PEX_ENABLED }} +export TRANSMISSION_PORT_FORWARDING_ENABLED={{ .Env.TRANSMISSION_PORT_FORWARDING_ENABLED }} +export TRANSMISSION_PREALLOCATION={{ .Env.TRANSMISSION_PREALLOCATION }} +export TRANSMISSION_PREFETCH_ENABLED={{ .Env.TRANSMISSION_PREFETCH_ENABLED }} +export TRANSMISSION_QUEUE_STALLED_ENABLED={{ .Env.TRANSMISSION_QUEUE_STALLED_ENABLED }} +export TRANSMISSION_QUEUE_STALLED_MINUTES={{ .Env.TRANSMISSION_QUEUE_STALLED_MINUTES }} +export TRANSMISSION_RATIO_LIMIT={{ .Env.TRANSMISSION_RATIO_LIMIT }} +export TRANSMISSION_RATIO_LIMIT_ENABLED={{ .Env.TRANSMISSION_RATIO_LIMIT_ENABLED }} +export TRANSMISSION_RENAME_PARTIAL_FILES={{ .Env.TRANSMISSION_RENAME_PARTIAL_FILES }} +export TRANSMISSION_RPC_AUTHENTICATION_REQUIRED={{ .Env.TRANSMISSION_RPC_AUTHENTICATION_REQUIRED }} +export TRANSMISSION_RPC_BIND_ADDRESS={{ .Env.TRANSMISSION_RPC_BIND_ADDRESS }} +export TRANSMISSION_RPC_ENABLED={{ .Env.TRANSMISSION_RPC_ENABLED }} +export TRANSMISSION_RPC_PASSWORD={{ .Env.TRANSMISSION_RPC_PASSWORD }} +export TRANSMISSION_RPC_PORT={{ .Env.TRANSMISSION_RPC_PORT }} +export TRANSMISSION_RPC_URL={{ .Env.TRANSMISSION_RPC_URL }} +export TRANSMISSION_RPC_USERNAME={{ .Env.TRANSMISSION_RPC_USERNAME }} +export TRANSMISSION_RPC_WHITELIST={{ .Env.TRANSMISSION_RPC_WHITELIST }} +export TRANSMISSION_RPC_WHITELIST_ENABLED={{ .Env.TRANSMISSION_RPC_WHITELIST_ENABLED }} +export TRANSMISSION_SCRAPE_PAUSED_TORRENTS_ENABLED={{ .Env.TRANSMISSION_SCRAPE_PAUSED_TORRENTS_ENABLED }} +export TRANSMISSION_SCRIPT_TORRENT_DONE_ENABLED={{ .Env.TRANSMISSION_SCRIPT_TORRENT_DONE_ENABLED }} +export TRANSMISSION_SCRIPT_TORRENT_DONE_FILENAME={{ .Env.TRANSMISSION_SCRIPT_TORRENT_DONE_FILENAME }} +export TRANSMISSION_SEED_QUEUE_ENABLED={{ .Env.TRANSMISSION_SEED_QUEUE_ENABLED }} +export TRANSMISSION_SEED_QUEUE_SIZE={{ .Env.TRANSMISSION_SEED_QUEUE_SIZE }} +export TRANSMISSION_SPEED_LIMIT_DOWN={{ .Env.TRANSMISSION_SPEED_LIMIT_DOWN }} +export TRANSMISSION_SPEED_LIMIT_DOWN_ENABLED={{ .Env.TRANSMISSION_SPEED_LIMIT_DOWN_ENABLED }} +export TRANSMISSION_SPEED_LIMIT_UP={{ .Env.TRANSMISSION_SPEED_LIMIT_UP }} +export TRANSMISSION_SPEED_LIMIT_UP_ENABLED={{ .Env.TRANSMISSION_SPEED_LIMIT_UP_ENABLED }} +export TRANSMISSION_START_ADDED_TORRENTS={{ .Env.TRANSMISSION_START_ADDED_TORRENTS }} +export TRANSMISSION_TRASH_ORIGINAL_TORRENT_FILES={{ .Env.TRANSMISSION_TRASH_ORIGINAL_TORRENT_FILES }} +export TRANSMISSION_UMASK={{ .Env.TRANSMISSION_UMASK }} +export TRANSMISSION_UPLOAD_LIMIT={{ .Env.TRANSMISSION_UPLOAD_LIMIT }} +export TRANSMISSION_UPLOAD_LIMIT_ENABLED={{ .Env.TRANSMISSION_UPLOAD_LIMIT_ENABLED }} +export TRANSMISSION_UPLOAD_SLOTS_PER_TORRENT={{ .Env.TRANSMISSION_UPLOAD_SLOTS_PER_TORRENT }} +export TRANSMISSION_UTP_ENABLED={{ .Env.TRANSMISSION_UTP_ENABLED }} +export TRANSMISSION_WATCH_DIR={{ .Env.TRANSMISSION_WATCH_DIR }} +export TRANSMISSION_WATCH_DIR_ENABLED={{ .Env.TRANSMISSION_WATCH_DIR_ENABLED }} + diff --git a/transmission/start.sh b/transmission/start.sh index fa488e6..40875e2 100755 --- a/transmission/start.sh +++ b/transmission/start.sh @@ -1,5 +1,8 @@ #!/bin/sh +# Source our persisted env variables from container startup +. /etc/transmission-daemon/environment-variables.sh + tun0ip=$(ifconfig tun0 | sed -n '2 p' | awk '{print $2}' | cut -d: -f2) echo "Updating TRANSMISSION_BIND_ADDRESS_IPV4 to tun0 ip: ${tun0ip}" export TRANSMISSION_BIND_ADDRESS_IPV4=${tun0ip} diff --git a/transmission/updateTransmissionPort.sh b/transmission/updateTransmissionPort.sh index d1038fc..dae3703 100755 --- a/transmission/updateTransmissionPort.sh +++ b/transmission/updateTransmissionPort.sh @@ -22,7 +22,7 @@ new_client_id() { } pia_client_id="$(cat $pia_client_id_file 2>/dev/null)" -if [[ -z "$pia_client_id" ]]; then +if [ -z ${pia_client_id} ]; then echo "Generating new client id for PIA" pia_client_id=$(new_client_id) fi @@ -39,7 +39,7 @@ echo "Got new port $new_port from pia" # Check if transmission remote is set up with authentication auth_enabled=$(grep 'rpc-authentication-required\"' $transmission_settings_file | grep -oE 'true|false') -if [[ "true" = "$auth_enabled" ]] +if [ "true" = "$auth_enabled" ] then echo "transmission auth required" myauth="--auth $transmission_username:$transmission_passwd" @@ -50,7 +50,7 @@ fi # get current listening port transmission_peer_port=$(transmission-remote $myauth -si | grep Listenport | grep -oE '[0-9]+') -if [[ "$new_port" != "$transmission_peer_port" ]] +if [ "$new_port" != "$transmission_peer_port" ] then transmission-remote $myauth -p "$new_port" echo "Checking port..." From a800a8b929f8e5b9d1c11439f943d5940bda7b30 Mon Sep 17 00:00:00 2001 From: Kristian Haugene Date: Sun, 24 May 2015 21:09:00 +0200 Subject: [PATCH 06/12] Update README.md --- README.md | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index fdf3766..7f1a13d 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Private Internet Access OpenVPN - Transmission === This Docker container lets you run Transmission with WebUI while connecting to PIA VPN. It updates Transmission hourly with assigned open port from PIA. Please read the instructions below. -# Run container from Docker registry +## Run container from Docker registry The container is available from the Docker registry and this is the simplest way to get it. To run the container use this command: ``` @@ -30,21 +30,19 @@ As you can see, the container expects a data volume to be mounted. It is used fo The only mandatory configuration is to set two environment variables for your PIA username and password. You must set the environment variables `PIA_USERNAME` and `PIA_PASSWORD` to your login credentials. The container will connect to the Private Internet Access VPN servers in Netherlands by default. -NB: Instructions on how to use your own Transmission settings, and how to connect to the WebUI, is further down in the README. - -## Required environment options +### Required environment options | Variable | Function | Example | |----------|----------|-------| |`PIA_USERNAME`|Your login username for PIA|`PIA_USERNAME=asdf`| |`PIA_PASSWORD`|Your login password for PIA|`PIA_PASSWORD=asdf`| -## Network configuration options +### Network configuration options | Variable | Function | Example | |----------|----------|-------| |`OPEN_VPN_CONFIG` | Sets the PIA endpoint to connect to. | `OPEN_VPN_CONFIG=UK Southampton`| |`RESOLV_OVERRIDE` | The value of this variable will be written to `/etc/resolv.conf`. | `RESOLV_OVERRIDE=nameserver 8.8.8.8\nnameserver 8.8.4.4\n`| -## Transmission configuration options +### Transmission configuration options You may override transmission options by setting the appropriate environment variable. @@ -59,7 +57,9 @@ The environment variables are the same name as used in the transmission settings As you can see the variables are prefixed with `TRANSMISSION_`, the variable is capitalized, and `-` is converted to `_`. -# Building the container yourself +PS: `TRANSMISSION_BIND_ADDRESS_IPV4` will be overridden to the IP assigned to tunnel interface by PIA. This is to prevent leaking of the host IP. + +## Building the container yourself To build this container, clone the repository and cd into it. ### Build it: @@ -79,7 +79,7 @@ $ docker run --privileged -d \ As described in the "Run container from Docker registry" section, this will start a container with default settings. This means that you should have the folders "completed, incomplete and watch" in /your/storage/path, and pia-credentials.txt in /your/config/path. -### Access the WebUI +## Access the WebUI But what's going on? My http://my-host:9091 isn't responding? This is because the VPN is active, and since docker is running in a different ip range than your client the response to your request will be treated as "non-local" traffic and therefore be routed out through the VPN interface. @@ -108,7 +108,7 @@ http { Your Transmission WebUI should now be avaliable at "your.host.ip.addr:8080/transmission/web/". Change the port in the docker run command if 8080 is not suitable for you. -### What if I want to run the container interactively. +## What if I want to run the container interactively. If you want do have access inside the container while running you have two choices. To have a look inside an already running container, use docker exec to get a terminal inside the container. ``` @@ -124,3 +124,7 @@ $ docker run --privileged -it transmission-openvpn bash ``` From there you can start the service yourself, or do whatever (probably developer-related) you came to do. + +## Controlling Transmission remotely +The container exposes /config as a volume. This is the directory where the supplied transmission and PIA credentials will be stored. If you have transmission authentication enabled and want scripts in another container to access and control the transmission-daemon, this can be a handy way to access the credentials. +For example, another container may pause or restrict transmission speeds while the server is streaming video. From fa7fbca87ac807e31c114fc8df90206d758bc8aa Mon Sep 17 00:00:00 2001 From: Kristian Haugene Date: Sun, 24 May 2015 21:10:25 +0200 Subject: [PATCH 07/12] bump version --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 9ab6cb3..51abb2a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # Transmission and OpenVPN # -# Version 1.0 +# Version 1.1 FROM ubuntu:14.04 MAINTAINER Kristian Haugene From 553dbf628cb3d9b5333b68c7d7f0d5157f8a59ed Mon Sep 17 00:00:00 2001 From: Kristian Haugene Date: Sun, 24 May 2015 21:54:23 +0200 Subject: [PATCH 08/12] use same script names inside and outside container. cleaner adding them as well --- Dockerfile | 8 +------- transmission/{defaultSettings.tmpl => settings.tmpl} | 0 transmission/{runUpdates.sh => startPortUpdates.sh} | 0 transmission/{down.sh => stop.sh} | 0 transmission/{updateTransmissionPort.sh => updatePort.sh} | 0 5 files changed, 1 insertion(+), 7 deletions(-) rename transmission/{defaultSettings.tmpl => settings.tmpl} (100%) rename transmission/{runUpdates.sh => startPortUpdates.sh} (100%) rename transmission/{down.sh => stop.sh} (100%) rename transmission/{updateTransmissionPort.sh => updatePort.sh} (100%) diff --git a/Dockerfile b/Dockerfile index 51abb2a..10937e1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,13 +21,7 @@ RUN apt-get update \ ADD piaconfig/* /etc/openvpn/ ADD piaconfig/ca.crt /etc/openvpn/ca.crt ADD piaconfig/crl.pem /etc/openvpn/crl.pem -ADD transmission/defaultSettings.tmpl /etc/transmission-daemon/settings.tmpl -ADD transmission/updateTransmissionPort.sh /etc/transmission-daemon/updatePort.sh -ADD transmission/periodicUpdates.sh /etc/transmission-daemon/periodicUpdates.sh -ADD transmission/start.sh /etc/transmission-daemon/start.sh -ADD transmission/runUpdates.sh /etc/transmission-daemon/startPortUpdates.sh -ADD transmission/down.sh /etc/transmission-daemon/stop.sh -ADD transmission/environment-variables.tmpl /etc/transmission-daemon/environment-variables.tmpl +ADD transmission/* /etc/transmission-daemon/ ADD start.sh /etc/openvpn/start.sh ENV PIA_USERNAME=**None** \ diff --git a/transmission/defaultSettings.tmpl b/transmission/settings.tmpl similarity index 100% rename from transmission/defaultSettings.tmpl rename to transmission/settings.tmpl diff --git a/transmission/runUpdates.sh b/transmission/startPortUpdates.sh similarity index 100% rename from transmission/runUpdates.sh rename to transmission/startPortUpdates.sh diff --git a/transmission/down.sh b/transmission/stop.sh similarity index 100% rename from transmission/down.sh rename to transmission/stop.sh diff --git a/transmission/updateTransmissionPort.sh b/transmission/updatePort.sh similarity index 100% rename from transmission/updateTransmissionPort.sh rename to transmission/updatePort.sh From b6ab2b943d9af798720be9d5bfa649ed2b53245e Mon Sep 17 00:00:00 2001 From: Kristian Haugene Date: Sun, 24 May 2015 22:01:46 +0200 Subject: [PATCH 09/12] covered by wildcard add --- Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 10937e1..ddfdf69 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,8 +19,6 @@ RUN apt-get update \ # Add configuration and scripts ADD piaconfig/* /etc/openvpn/ -ADD piaconfig/ca.crt /etc/openvpn/ca.crt -ADD piaconfig/crl.pem /etc/openvpn/crl.pem ADD transmission/* /etc/transmission-daemon/ ADD start.sh /etc/openvpn/start.sh From 2aa1796e0866d91721ffd7f7586e3fd284523f1d Mon Sep 17 00:00:00 2001 From: Kristian Haugene Date: Sun, 24 May 2015 22:07:30 +0200 Subject: [PATCH 10/12] all openvpn script and config in openvpn folder --- Dockerfile | 3 +-- {piaconfig => openvpn}/AU Melbourne.ovpn | 0 {piaconfig => openvpn}/AU Sydney.ovpn | 0 {piaconfig => openvpn}/CA North York.ovpn | 0 {piaconfig => openvpn}/CA Toronto.ovpn | 0 {piaconfig => openvpn}/France.ovpn | 0 {piaconfig => openvpn}/Germany.ovpn | 0 {piaconfig => openvpn}/Hong Kong.ovpn | 0 {piaconfig => openvpn}/Israel.ovpn | 0 {piaconfig => openvpn}/Japan.ovpn | 0 {piaconfig => openvpn}/Mexico.ovpn | 0 {piaconfig => openvpn}/Netherlands.ovpn | 0 {piaconfig => openvpn}/Romania.ovpn | 0 {piaconfig => openvpn}/Russia.ovpn | 0 {piaconfig => openvpn}/Singapore.ovpn | 0 {piaconfig => openvpn}/Sweden.ovpn | 0 {piaconfig => openvpn}/Switzerland.ovpn | 0 {piaconfig => openvpn}/UK London.ovpn | 0 {piaconfig => openvpn}/UK Southampton.ovpn | 0 {piaconfig => openvpn}/US California.ovpn | 0 {piaconfig => openvpn}/US East.ovpn | 0 {piaconfig => openvpn}/US Florida.ovpn | 0 {piaconfig => openvpn}/US Midwest.ovpn | 0 {piaconfig => openvpn}/US Seattle.ovpn | 0 {piaconfig => openvpn}/US Silicon Valley.ovpn | 0 {piaconfig => openvpn}/US Texas.ovpn | 0 {piaconfig => openvpn}/US West.ovpn | 0 {piaconfig => openvpn}/ca.crt | 0 {piaconfig => openvpn}/crl.pem | 0 start.sh => openvpn/start.sh | 0 30 files changed, 1 insertion(+), 2 deletions(-) rename {piaconfig => openvpn}/AU Melbourne.ovpn (100%) rename {piaconfig => openvpn}/AU Sydney.ovpn (100%) rename {piaconfig => openvpn}/CA North York.ovpn (100%) rename {piaconfig => openvpn}/CA Toronto.ovpn (100%) rename {piaconfig => openvpn}/France.ovpn (100%) rename {piaconfig => openvpn}/Germany.ovpn (100%) rename {piaconfig => openvpn}/Hong Kong.ovpn (100%) rename {piaconfig => openvpn}/Israel.ovpn (100%) rename {piaconfig => openvpn}/Japan.ovpn (100%) rename {piaconfig => openvpn}/Mexico.ovpn (100%) rename {piaconfig => openvpn}/Netherlands.ovpn (100%) rename {piaconfig => openvpn}/Romania.ovpn (100%) rename {piaconfig => openvpn}/Russia.ovpn (100%) rename {piaconfig => openvpn}/Singapore.ovpn (100%) rename {piaconfig => openvpn}/Sweden.ovpn (100%) rename {piaconfig => openvpn}/Switzerland.ovpn (100%) rename {piaconfig => openvpn}/UK London.ovpn (100%) rename {piaconfig => openvpn}/UK Southampton.ovpn (100%) rename {piaconfig => openvpn}/US California.ovpn (100%) rename {piaconfig => openvpn}/US East.ovpn (100%) rename {piaconfig => openvpn}/US Florida.ovpn (100%) rename {piaconfig => openvpn}/US Midwest.ovpn (100%) rename {piaconfig => openvpn}/US Seattle.ovpn (100%) rename {piaconfig => openvpn}/US Silicon Valley.ovpn (100%) rename {piaconfig => openvpn}/US Texas.ovpn (100%) rename {piaconfig => openvpn}/US West.ovpn (100%) rename {piaconfig => openvpn}/ca.crt (100%) rename {piaconfig => openvpn}/crl.pem (100%) rename start.sh => openvpn/start.sh (100%) diff --git a/Dockerfile b/Dockerfile index ddfdf69..a3c1a76 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,9 +18,8 @@ RUN apt-get update \ && curl -L https://github.com/jwilder/dockerize/releases/download/v0.0.2/dockerize-linux-amd64-v0.0.2.tar.gz | tar -C /usr/local/bin -xzv # Add configuration and scripts -ADD piaconfig/* /etc/openvpn/ +ADD openvpn/* /etc/openvpn/ ADD transmission/* /etc/transmission-daemon/ -ADD start.sh /etc/openvpn/start.sh ENV PIA_USERNAME=**None** \ PIA_PASSWORD=**None** \ diff --git a/piaconfig/AU Melbourne.ovpn b/openvpn/AU Melbourne.ovpn similarity index 100% rename from piaconfig/AU Melbourne.ovpn rename to openvpn/AU Melbourne.ovpn diff --git a/piaconfig/AU Sydney.ovpn b/openvpn/AU Sydney.ovpn similarity index 100% rename from piaconfig/AU Sydney.ovpn rename to openvpn/AU Sydney.ovpn diff --git a/piaconfig/CA North York.ovpn b/openvpn/CA North York.ovpn similarity index 100% rename from piaconfig/CA North York.ovpn rename to openvpn/CA North York.ovpn diff --git a/piaconfig/CA Toronto.ovpn b/openvpn/CA Toronto.ovpn similarity index 100% rename from piaconfig/CA Toronto.ovpn rename to openvpn/CA Toronto.ovpn diff --git a/piaconfig/France.ovpn b/openvpn/France.ovpn similarity index 100% rename from piaconfig/France.ovpn rename to openvpn/France.ovpn diff --git a/piaconfig/Germany.ovpn b/openvpn/Germany.ovpn similarity index 100% rename from piaconfig/Germany.ovpn rename to openvpn/Germany.ovpn diff --git a/piaconfig/Hong Kong.ovpn b/openvpn/Hong Kong.ovpn similarity index 100% rename from piaconfig/Hong Kong.ovpn rename to openvpn/Hong Kong.ovpn diff --git a/piaconfig/Israel.ovpn b/openvpn/Israel.ovpn similarity index 100% rename from piaconfig/Israel.ovpn rename to openvpn/Israel.ovpn diff --git a/piaconfig/Japan.ovpn b/openvpn/Japan.ovpn similarity index 100% rename from piaconfig/Japan.ovpn rename to openvpn/Japan.ovpn diff --git a/piaconfig/Mexico.ovpn b/openvpn/Mexico.ovpn similarity index 100% rename from piaconfig/Mexico.ovpn rename to openvpn/Mexico.ovpn diff --git a/piaconfig/Netherlands.ovpn b/openvpn/Netherlands.ovpn similarity index 100% rename from piaconfig/Netherlands.ovpn rename to openvpn/Netherlands.ovpn diff --git a/piaconfig/Romania.ovpn b/openvpn/Romania.ovpn similarity index 100% rename from piaconfig/Romania.ovpn rename to openvpn/Romania.ovpn diff --git a/piaconfig/Russia.ovpn b/openvpn/Russia.ovpn similarity index 100% rename from piaconfig/Russia.ovpn rename to openvpn/Russia.ovpn diff --git a/piaconfig/Singapore.ovpn b/openvpn/Singapore.ovpn similarity index 100% rename from piaconfig/Singapore.ovpn rename to openvpn/Singapore.ovpn diff --git a/piaconfig/Sweden.ovpn b/openvpn/Sweden.ovpn similarity index 100% rename from piaconfig/Sweden.ovpn rename to openvpn/Sweden.ovpn diff --git a/piaconfig/Switzerland.ovpn b/openvpn/Switzerland.ovpn similarity index 100% rename from piaconfig/Switzerland.ovpn rename to openvpn/Switzerland.ovpn diff --git a/piaconfig/UK London.ovpn b/openvpn/UK London.ovpn similarity index 100% rename from piaconfig/UK London.ovpn rename to openvpn/UK London.ovpn diff --git a/piaconfig/UK Southampton.ovpn b/openvpn/UK Southampton.ovpn similarity index 100% rename from piaconfig/UK Southampton.ovpn rename to openvpn/UK Southampton.ovpn diff --git a/piaconfig/US California.ovpn b/openvpn/US California.ovpn similarity index 100% rename from piaconfig/US California.ovpn rename to openvpn/US California.ovpn diff --git a/piaconfig/US East.ovpn b/openvpn/US East.ovpn similarity index 100% rename from piaconfig/US East.ovpn rename to openvpn/US East.ovpn diff --git a/piaconfig/US Florida.ovpn b/openvpn/US Florida.ovpn similarity index 100% rename from piaconfig/US Florida.ovpn rename to openvpn/US Florida.ovpn diff --git a/piaconfig/US Midwest.ovpn b/openvpn/US Midwest.ovpn similarity index 100% rename from piaconfig/US Midwest.ovpn rename to openvpn/US Midwest.ovpn diff --git a/piaconfig/US Seattle.ovpn b/openvpn/US Seattle.ovpn similarity index 100% rename from piaconfig/US Seattle.ovpn rename to openvpn/US Seattle.ovpn diff --git a/piaconfig/US Silicon Valley.ovpn b/openvpn/US Silicon Valley.ovpn similarity index 100% rename from piaconfig/US Silicon Valley.ovpn rename to openvpn/US Silicon Valley.ovpn diff --git a/piaconfig/US Texas.ovpn b/openvpn/US Texas.ovpn similarity index 100% rename from piaconfig/US Texas.ovpn rename to openvpn/US Texas.ovpn diff --git a/piaconfig/US West.ovpn b/openvpn/US West.ovpn similarity index 100% rename from piaconfig/US West.ovpn rename to openvpn/US West.ovpn diff --git a/piaconfig/ca.crt b/openvpn/ca.crt similarity index 100% rename from piaconfig/ca.crt rename to openvpn/ca.crt diff --git a/piaconfig/crl.pem b/openvpn/crl.pem similarity index 100% rename from piaconfig/crl.pem rename to openvpn/crl.pem diff --git a/start.sh b/openvpn/start.sh similarity index 100% rename from start.sh rename to openvpn/start.sh From d2035237a255b3b11b0df2c20e8878890d7925ed Mon Sep 17 00:00:00 2001 From: Kristian Haugene Date: Mon, 25 May 2015 13:18:53 +0200 Subject: [PATCH 11/12] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a3c1a76..6258774 100644 --- a/Dockerfile +++ b/Dockerfile @@ -96,6 +96,6 @@ ENV PIA_USERNAME=**None** \ "TRANSMISSION_WATCH_DIR_ENABLED=true" \ RESOLV_OVERRIDE=**None** -# Expose port and run. Use baseimage-docker's init system +# Expose port and run EXPOSE 9091 CMD ["/etc/openvpn/start.sh"] From 63cfc08e9936cd17276f9b3378382b30902dbd20 Mon Sep 17 00:00:00 2001 From: Kristian Haugene Date: Mon, 25 May 2015 13:26:23 +0200 Subject: [PATCH 12/12] cleanup some legacy intermediate script --- transmission/start.sh | 2 +- transmission/startPortUpdates.sh | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) delete mode 100755 transmission/startPortUpdates.sh diff --git a/transmission/start.sh b/transmission/start.sh index 40875e2..8c5e76f 100755 --- a/transmission/start.sh +++ b/transmission/start.sh @@ -14,6 +14,6 @@ echo "STARTING TRANSMISSION" exec /usr/bin/transmission-daemon -g /etc/transmission-daemon/ & echo "STARTING PORT UPDATER" -exec /etc/transmission-daemon/startPortUpdates.sh & +exec /etc/transmission-daemon/periodicUpdates.sh & echo "Transmission startup script complete." diff --git a/transmission/startPortUpdates.sh b/transmission/startPortUpdates.sh deleted file mode 100755 index 5e9a023..0000000 --- a/transmission/startPortUpdates.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -exec /etc/transmission-daemon/periodicUpdates.sh