mirror of
https://github.com/haugene/docker-transmission-openvpn.git
synced 2025-08-06 14:27:25 +02:00
Added fallback and more explicit warning message (#2020)
* Added fallback and more explicit warning message
This commit is contained in:
parent
317a0a78ad
commit
86eb6a8727
@ -9,31 +9,28 @@ services:
|
|||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- "9091:9091"
|
- "9091:9091"
|
||||||
- "8888:8888"
|
# - "8888:8888" # proxy support
|
||||||
dns:
|
|
||||||
- 8.8.8.8
|
|
||||||
- 8.8.4.4
|
|
||||||
volumes:
|
volumes:
|
||||||
- /etc/localtime:/etc/localtime:ro
|
- /your/storage/path/:/data # where transmission will store the data
|
||||||
- /your/storage/path/:/data
|
- /your/config/path/:/config # where transmission-home is stored
|
||||||
environment:
|
environment:
|
||||||
- OPENVPN_PROVIDER=PIA
|
- OPENVPN_PROVIDER=PIA
|
||||||
- OPENVPN_USERNAME=username
|
- OPENVPN_USERNAME=username
|
||||||
- OPENVPN_PASSWORD=password
|
- OPENVPN_PASSWORD=password
|
||||||
- OPENVPN_OPTS=--inactive 3600 --ping 10 --ping-exit 60
|
- OPENVPN_OPTS=--inactive 3600 --ping 10 --ping-exit 60
|
||||||
- LOCAL_NETWORK=192.168.0.0/24
|
- LOCAL_NETWORK=192.168.0.0/24
|
||||||
proxy:
|
# proxy:
|
||||||
image: haugene/transmission-openvpn-proxy
|
# image: haugene/transmission-openvpn-proxy
|
||||||
links:
|
# links:
|
||||||
- transmission
|
# - transmission
|
||||||
ports:
|
# ports:
|
||||||
- 8080:8080
|
# - 8080:8080
|
||||||
volumes:
|
# volumes:
|
||||||
- /etc/localtime:/etc/localtime:ro
|
# - /etc/localtime:/etc/localtime:ro
|
||||||
|
|
||||||
rss:
|
# rss:
|
||||||
image: haugene/transmission-rss
|
# image: haugene/transmission-rss
|
||||||
links:
|
# links:
|
||||||
- transmission
|
# - transmission
|
||||||
environment:
|
# environment:
|
||||||
- RSS_URL=http://.../xxxxx.rss
|
# - RSS_URL=http://.../xxxxx.rss
|
||||||
|
@ -87,8 +87,10 @@ In previous versions of this container the settings were not persistent but was
|
|||||||
This had the benefit of being very explicit and reproducable but you had to provide Transmission config as environment variables if you
|
This had the benefit of being very explicit and reproducable but you had to provide Transmission config as environment variables if you
|
||||||
wanted them to stay that way between container restarts. This felt cumbersome to many.
|
wanted them to stay that way between container restarts. This felt cumbersome to many.
|
||||||
|
|
||||||
As of version 3.0 this is no longer true. Settings are now persisted in the `/config/transmission-home` folder in the container and as
|
As of version 5.0 this is no longer true. Settings are now persisted in the `/config/transmission-home` folder in the container and as
|
||||||
long as you mount `/config` you should be able to configure Transmission using the UI as you normally would.
|
long as you mount `/config` you should be able to configure Transmission using the UI as you normally would.
|
||||||
|
if you are using the container from earlier versions and have not changed the location of transmission-home to /config, you will see a warning message that the default has changed.
|
||||||
|
You can manually move the folder to your /config volume directory after stopping the container and adding the /config mount to your container setup (compose/run etc).
|
||||||
|
|
||||||
You may still override Transmission options by setting environment variables if that's your thing.
|
You may still override Transmission options by setting environment variables if that's your thing.
|
||||||
The variables are named after the transmission config they target but are prefixed with `TRANSMISSION_`, capitalized, and `-` is converted to `_`.
|
The variables are named after the transmission config they target but are prefixed with `TRANSMISSION_`, capitalized, and `-` is converted to `_`.
|
||||||
|
@ -42,6 +42,7 @@ services:
|
|||||||
- NET_ADMIN
|
- NET_ADMIN
|
||||||
volumes:
|
volumes:
|
||||||
- '/your/storage/path/:/data'
|
- '/your/storage/path/:/data'
|
||||||
|
- '/your/config/path/:/config'
|
||||||
environment:
|
environment:
|
||||||
- OPENVPN_PROVIDER=PIA
|
- OPENVPN_PROVIDER=PIA
|
||||||
- OPENVPN_CONFIG=france
|
- OPENVPN_CONFIG=france
|
||||||
|
@ -17,21 +17,17 @@ if [ -n "$PUID" ] && [ ! "$(id -u root)" -eq "$PUID" ]; then
|
|||||||
chown ${RUN_AS}:${RUN_AS} /dev/stdout
|
chown ${RUN_AS}:${RUN_AS} /dev/stdout
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "TRANSMISSION_HOME is set to: ${TRANSMISSION_HOME}"
|
||||||
if [[ "${TRANSMISSION_HOME%/*}" != "/config" ]]; then
|
if [[ "${TRANSMISSION_HOME%/*}" != "/config" ]]; then
|
||||||
echo "WARNING: TRANSMISSION_HOME mountpoint is not on default /config, this is not recommended."
|
echo "WARNING: TRANSMISSION_HOME mountpoint is not on default /config, this is not recommended."
|
||||||
|
echo "This warning will be displayed as long as TRANSMISSION_HOME is not set to /config mount."
|
||||||
|
echo "If you would like to migrate your existing TRANSMISSION_HOME, please stop the container, add volume /config and move the transmission-home directory there."
|
||||||
fi
|
fi
|
||||||
|
#Old default transmission-home exists, use as fallback
|
||||||
#If migration is enabled, attempt to move transmission-home
|
if [ -d "/data/transmission-home" ]; then
|
||||||
if [[ "$TRANSMISSION_HOME_MIGRATE" = true ]]; then
|
TRANSMISSION_HOME="/data/transmission-home"
|
||||||
TRANSMISSION_HOME_SUBNAME=${TRANSMISSION_HOME##*/}
|
echo "WARNING: Deprecated. Found old default transmission-home folder in the /data mount, setting this as TRANSMISSION_HOME. This might break in future versions."
|
||||||
echo "Attempting to migrate old TRANSMISSION_HOME from /data/$TRANSMISSION_HOME_SUBNAME to /config/$TRANSMISSION_HOME_SUBNAME "
|
echo "We will fallback to this directory as long as the folder exists. Please consider moving it to /config"
|
||||||
if [ -d "/data/$TRANSMISSION_HOME_SUBNAME" ] && [ ! -d "/config/$TRANSMISSION_HOME_SUBNAME" ]; then
|
|
||||||
mv "/data/$TRANSMISSION_HOME_SUBNAME" "/config/$TRANSMISSION_HOME_SUBNAME"
|
|
||||||
TRANSMISSION_HOME="/config/$TRANSMISSION_HOME_SUBNAME"
|
|
||||||
TRANSMISSION_HOME_MIGRATE=false
|
|
||||||
else
|
|
||||||
echo "Could not migrate, please check for existing folder in /config or missing folder in /data"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Make sure directories exist before chown and chmod
|
# Make sure directories exist before chown and chmod
|
||||||
|
Loading…
Reference in New Issue
Block a user