Added fallback and more explicit warning message (#2020)

* Added fallback and more explicit warning message
This commit is contained in:
Patrick Kishino 2021-10-21 15:46:30 +09:00 committed by GitHub
parent 317a0a78ad
commit 86eb6a8727
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 34 deletions

View File

@ -9,31 +9,28 @@ services:
restart: always
ports:
- "9091:9091"
- "8888:8888"
dns:
- 8.8.8.8
- 8.8.4.4
# - "8888:8888" # proxy support
volumes:
- /etc/localtime:/etc/localtime:ro
- /your/storage/path/:/data
- /your/storage/path/:/data # where transmission will store the data
- /your/config/path/:/config # where transmission-home is stored
environment:
- OPENVPN_PROVIDER=PIA
- OPENVPN_USERNAME=username
- OPENVPN_PASSWORD=password
- OPENVPN_OPTS=--inactive 3600 --ping 10 --ping-exit 60
- LOCAL_NETWORK=192.168.0.0/24
proxy:
image: haugene/transmission-openvpn-proxy
links:
- transmission
ports:
- 8080:8080
volumes:
- /etc/localtime:/etc/localtime:ro
# proxy:
# image: haugene/transmission-openvpn-proxy
# links:
# - transmission
# ports:
# - 8080:8080
# volumes:
# - /etc/localtime:/etc/localtime:ro
rss:
image: haugene/transmission-rss
links:
- transmission
environment:
- RSS_URL=http://.../xxxxx.rss
# rss:
# image: haugene/transmission-rss
# links:
# - transmission
# environment:
# - RSS_URL=http://.../xxxxx.rss

View File

@ -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
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.
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.
The variables are named after the transmission config they target but are prefixed with `TRANSMISSION_`, capitalized, and `-` is converted to `_`.

View File

@ -42,6 +42,7 @@ services:
- NET_ADMIN
volumes:
- '/your/storage/path/:/data'
- '/your/config/path/:/config'
environment:
- OPENVPN_PROVIDER=PIA
- OPENVPN_CONFIG=france

View File

@ -17,21 +17,17 @@ if [ -n "$PUID" ] && [ ! "$(id -u root)" -eq "$PUID" ]; then
chown ${RUN_AS}:${RUN_AS} /dev/stdout
fi
echo "TRANSMISSION_HOME is set to: ${TRANSMISSION_HOME}"
if [[ "${TRANSMISSION_HOME%/*}" != "/config" ]]; then
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
#If migration is enabled, attempt to move transmission-home
if [[ "$TRANSMISSION_HOME_MIGRATE" = true ]]; then
TRANSMISSION_HOME_SUBNAME=${TRANSMISSION_HOME##*/}
echo "Attempting to migrate old TRANSMISSION_HOME from /data/$TRANSMISSION_HOME_SUBNAME to /config/$TRANSMISSION_HOME_SUBNAME "
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
#Old default transmission-home exists, use as fallback
if [ -d "/data/transmission-home" ]; then
TRANSMISSION_HOME="/data/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 "We will fallback to this directory as long as the folder exists. Please consider moving it to /config"
fi
# Make sure directories exist before chown and chmod