Closes #23 - Ensure TRANSMISSION_HOME is on a persistent volume to store torrent resume info

This commit is contained in:
Doug Daniels 2015-08-12 23:57:47 -05:00
parent fa0a0d6e0e
commit 8d43c09bfb
4 changed files with 10 additions and 4 deletions

View File

@ -94,6 +94,7 @@ ENV PIA_USERNAME=**None** \
"TRANSMISSION_UTP_ENABLED=true" \ "TRANSMISSION_UTP_ENABLED=true" \
"TRANSMISSION_WATCH_DIR=/data/watch" \ "TRANSMISSION_WATCH_DIR=/data/watch" \
"TRANSMISSION_WATCH_DIR_ENABLED=true" \ "TRANSMISSION_WATCH_DIR_ENABLED=true" \
"TRANSMISSION_HOME=/data/transmission-home" \
RESOLV_OVERRIDE=**None** RESOLV_OVERRIDE=**None**
# Expose port and run # Expose port and run

View File

@ -1,5 +1,5 @@
#! /bin/sh #! /bin/sh
export TRANSMISSION_HOME={{ .Env.TRANSMISSION_HOME }}
export TRANSMISSION_ALT_SPEED_DOWN={{ .Env.TRANSMISSION_ALT_SPEED_DOWN }} export TRANSMISSION_ALT_SPEED_DOWN={{ .Env.TRANSMISSION_ALT_SPEED_DOWN }}
export TRANSMISSION_ALT_SPEED_ENABLED={{ .Env.TRANSMISSION_ALT_SPEED_ENABLED }} 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_BEGIN={{ .Env.TRANSMISSION_ALT_SPEED_TIME_BEGIN }}

View File

@ -8,10 +8,12 @@ echo "Updating TRANSMISSION_BIND_ADDRESS_IPV4 to tun0 ip: ${tun0ip}"
export TRANSMISSION_BIND_ADDRESS_IPV4=${tun0ip} export TRANSMISSION_BIND_ADDRESS_IPV4=${tun0ip}
echo "Generating transmission settings.json from env variables" echo "Generating transmission settings.json from env variables"
dockerize -template /etc/transmission-daemon/settings.tmpl:/etc/transmission-daemon/settings.json /bin/true # Ensure TRANSMISSION_HOME is created
mkdir -p ${TRANSMISSION_HOME}
dockerize -template /etc/transmission-daemon/settings.tmpl:${TRANSMISSION_HOME}/settings.json /bin/true
echo "STARTING TRANSMISSION" echo "STARTING TRANSMISSION"
exec /usr/bin/transmission-daemon -g /etc/transmission-daemon/ & exec /usr/bin/transmission-daemon -g ${TRANSMISSION_HOME} &
echo "STARTING PORT UPDATER" echo "STARTING PORT UPDATER"
exec /etc/transmission-daemon/periodicUpdates.sh & exec /etc/transmission-daemon/periodicUpdates.sh &

View File

@ -1,5 +1,8 @@
#! /bin/sh #! /bin/sh
# Source our persisted env variables from container startup
. /etc/transmission-daemon/environment-variables.sh
# Settings # Settings
PIA_PASSWD_FILE=/config/pia-credentials.txt PIA_PASSWD_FILE=/config/pia-credentials.txt
TRANSMISSION_PASSWD_FILE=/config/transmission-credentials.txt TRANSMISSION_PASSWD_FILE=/config/transmission-credentials.txt
@ -10,7 +13,7 @@ transmission_username=$(head -1 $TRANSMISSION_PASSWD_FILE)
transmission_passwd=$(tail -1 $TRANSMISSION_PASSWD_FILE) transmission_passwd=$(tail -1 $TRANSMISSION_PASSWD_FILE)
local_vpn_ip=$(ip addr show tun0 | grep inet | awk '{ print $2 }') local_vpn_ip=$(ip addr show tun0 | grep inet | awk '{ print $2 }')
pia_client_id_file=/etc/transmission-daemon/pia_client_id pia_client_id_file=/etc/transmission-daemon/pia_client_id
transmission_settings_file=/etc/transmission-daemon/settings.json transmission_settings_file=${TRANSMISSION_HOME}/settings.json
port_assignment_url=https://www.privateinternetaccess.com/vpninfo/port_forward_assignment port_assignment_url=https://www.privateinternetaccess.com/vpninfo/port_forward_assignment
# #