fixing switch for keeping transmission state. also persist transmission rpc username and password for port updates if authentication is enabled.

This commit is contained in:
Kristian Haugene 2015-05-10 22:15:25 +02:00
parent 629e8d0fac
commit f7a7c2d4b4
4 changed files with 17 additions and 14 deletions

View File

@ -77,7 +77,7 @@ ENV PIA_USERNAME=**None** \
"TRANSMISSION_RPC_AUTHENTICATION_REQUIRED=false" \
"TRANSMISSION_RPC_BIND_ADDRESS=0.0.0.0" \
"TRANSMISSION_RPC_ENABLED=true" \
"TRANSMISSION_RPC_PASSWORD={425745bf3914984c2abcc013276f40e8fa5d84ecC5.df8oF" \
"TRANSMISSION_RPC_PASSWORD=password" \
"TRANSMISSION_RPC_PORT=9091" \
"TRANSMISSION_RPC_URL=/transmission/" \
"TRANSMISSION_RPC_USERNAME=username" \

View File

@ -34,4 +34,17 @@ else
echo $PIA_PASSWORD >> /config/pia-credentials.txt
fi
# add transmission credentials from env vars
echo $TRANSMISSION_RPC_USERNAME > /config/transmission-credentials.txt
echo $TRANSMISSION_RPC_PASSWORD >> /config/transmission-credentials.txt
if [ ! -z ${KEEP_TRANSMISSION_STATE} ]
then
mkdir -p /data/transmission-data/
dockerize -template /etc/transmission-daemon/settings.tmpl:/data/transmission-data/settings.json true
else
dockerize -template /etc/transmission-daemon/settings.tmpl:/etc/transmission-daemon/settings.json true
fi
exec openvpn --config "$OPEN_VPN_CONFIG"

View File

@ -1,21 +1,11 @@
#!/bin/sh
if [ ! -z "${KEEP_TRANSMISSION_STATE}" ]
if [ -f /data/transmission-data/settings.json ]
then
echo "STARTING TRANSMISSION: Using transmission-data subdirectory to your /data mount point to store state."
# Initialize settings from environment variables
dockerize -template /etc/transmission-daemon/settings.tmpl:/data/transmission-data/settings.json \
true
exec /usr/bin/transmission-daemon -g /data/transmission-data/ &
else
echo "STARTING TRANSMISSION: Storing state in container only."
# Initialize settings from environment variables
dockerize -template /etc/transmission-daemon/settings.tmpl:/etc/transmission-daemon/settings.json \
true
exec /usr/bin/transmission-daemon -g /etc/transmission-daemon/ &
fi

View File

@ -13,9 +13,9 @@ 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 /config/transmission/settings.json ];
if [ -f /data/transmission-data/settings.json ];
then
transmission_settings_file=/config/transmission/settings.json
transmission_settings_file=/data/transmission-data/settings.json
else
transmission_settings_file=/etc/transmission-daemon/settings.json
fi