Mount point changed to /config (#1974)

This changes the default mountpoint for transmission-home to /config
This commit is contained in:
Patrick Kishino 2021-10-16 12:34:12 +09:00 committed by GitHub
parent 7793e9d23b
commit 317a0a78ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 11 deletions

View File

@ -47,7 +47,7 @@ ENV OPENVPN_USERNAME=**None** \
OPENVPN_PASSWORD=**None** \
OPENVPN_PROVIDER=**None** \
GLOBAL_APPLY_PERMISSIONS=true \
TRANSMISSION_HOME=/data/transmission-home \
TRANSMISSION_HOME=/config/transmission-home \
TRANSMISSION_RPC_PORT=9091 \
TRANSMISSION_DOWNLOAD_DIR=/data/completed \
TRANSMISSION_INCOMPLETE_DIR=/data/incomplete \

View File

@ -87,8 +87,8 @@ 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 `/data/transmission-home` folder in the container and as
long as you mount `/data` you should be able to configure Transmission using the UI as you normally would.
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
long as you mount `/config` you should be able to configure Transmission using the UI as you normally would.
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

@ -19,8 +19,8 @@
## How do I enable authentication in the web ui
You can do this either by setting the appropriate fields in `settings.json` which is
found in TRANSMISSION_HOME which defaults to `/data/transmission-home` so it will be available
on your host where you mount the `/data` volume. Remember that Transmission overwrites the config
found in TRANSMISSION_HOME which defaults to `/config/transmission-home` so it will be available
on your host where you mount the `/config` volume. Remember that Transmission overwrites the config
when it shuts down, so do this when the container is not running.
Or you can set it using the convenience environment variables. They will then override the settings

View File

@ -17,6 +17,23 @@ if [ -n "$PUID" ] && [ ! "$(id -u root)" -eq "$PUID" ]; then
chown ${RUN_AS}:${RUN_AS} /dev/stdout
fi
if [[ "${TRANSMISSION_HOME%/*}" != "/config" ]]; then
echo "WARNING: TRANSMISSION_HOME mountpoint is not on default /config, this is not recommended."
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
fi
# Make sure directories exist before chown and chmod
mkdir -p /config \
"${TRANSMISSION_HOME}" \
@ -24,15 +41,13 @@ if [ -n "$PUID" ] && [ ! "$(id -u root)" -eq "$PUID" ]; then
"${TRANSMISSION_INCOMPLETE_DIR}" \
"${TRANSMISSION_WATCH_DIR}"
echo "Enforcing ownership on transmission config directories"
echo "Enforcing ownership on transmission config directory"
chown -R ${RUN_AS}:${RUN_AS} \
/config \
"${TRANSMISSION_HOME}"
/config
echo "Applying permissions to transmission config directories"
echo "Applying permissions to transmission config directory"
chmod -R go=rX,u=rwX \
/config \
"${TRANSMISSION_HOME}"
/config
if [ "$GLOBAL_APPLY_PERMISSIONS" = true ] ; then
echo "Setting owner for transmission paths to ${PUID}:${PGID}"