Add option to disable setting of default permissions

This commit is contained in:
dcrdev
2018-06-26 19:41:16 +01:00
parent da0efcdfd3
commit 1abc76f066
4 changed files with 25 additions and 6 deletions

View File

@@ -8,6 +8,7 @@
#ENABLE_UFW=false #ENABLE_UFW=false
#UFW_ALLOW_GW_NET=false #UFW_ALLOW_GW_NET=false
#UFW_EXTRA_PORTS= #UFW_EXTRA_PORTS=
#GLOBAL_APPLY_PERMISSIONS=true
#TRANSMISSION_ALT_SPEED_DOWN=50 #TRANSMISSION_ALT_SPEED_DOWN=50
#TRANSMISSION_ALT_SPEED_ENABLED=false #TRANSMISSION_ALT_SPEED_ENABLED=false
#TRANSMISSION_ALT_SPEED_TIME_BEGIN=540 #TRANSMISSION_ALT_SPEED_TIME_BEGIN=540

View File

@@ -39,6 +39,7 @@ ADD tinyproxy /opt/tinyproxy/
ENV OPENVPN_USERNAME=**None** \ ENV OPENVPN_USERNAME=**None** \
OPENVPN_PASSWORD=**None** \ OPENVPN_PASSWORD=**None** \
OPENVPN_PROVIDER=**None** \ OPENVPN_PROVIDER=**None** \
GLOBAL_APPLY_PERMISSIONS=true \
TRANSMISSION_ALT_SPEED_DOWN=50 \ TRANSMISSION_ALT_SPEED_DOWN=50 \
TRANSMISSION_ALT_SPEED_ENABLED=false \ TRANSMISSION_ALT_SPEED_ENABLED=false \
TRANSMISSION_ALT_SPEED_TIME_BEGIN=540 \ TRANSMISSION_ALT_SPEED_TIME_BEGIN=540 \

View File

@@ -151,6 +151,13 @@ If TRANSMISSION_PEER_PORT_RANDOM_ON_START is enabled then it allows traffic to t
|`UFW_ALLOW_GW_NET` | Allows the gateway network through the firewall. Off defaults to only allowing the gateway. | `UFW_ALLOW_GW_NET=true`| |`UFW_ALLOW_GW_NET` | Allows the gateway network through the firewall. Off defaults to only allowing the gateway. | `UFW_ALLOW_GW_NET=true`|
|`UFW_EXTRA_PORTS` | Allows the comma separated list of ports through the firewall. Respsects UFW_ALLOW_GW_NET. | `UFW_EXTRA_PORTS=9910,23561,443`| |`UFW_EXTRA_PORTS` | Allows the comma separated list of ports through the firewall. Respsects UFW_ALLOW_GW_NET. | `UFW_EXTRA_PORTS=9910,23561,443`|
### Permission configuration options
By default the startup script applies a default set of permissions and ownership on the transmission download, watch and incomplete directories. The GLOBAL_APPLY_PERMISSIONS directive can be used to disable this functionality.
| Variable | Function | Example |
|----------|----------|-------|
|`GLOBAL_APPLY_PERMISSIONS` | Disable setting of default permissions | `GLOBAL_APPLY_PERMISSIONS=false`|
### Alternative web UIs ### Alternative web UIs
You can override the default web UI by setting the ```TRANSMISSION_WEB_HOME``` environment variable. If set, Transmission will look there for the Web Interface files, such as the javascript, html, and graphics files. You can override the default web UI by setting the ```TRANSMISSION_WEB_HOME``` environment variable. If set, Transmission will look there for the Web Interface files, such as the javascript, html, and graphics files.

View File

@@ -4,6 +4,16 @@
RUN_AS=root RUN_AS=root
TEMP_TRAN_DOWNLOAD_DIR=${TRANSMISSION_DOWNLOAD_DIR}
TEMP_TRAN_INCOMPLETE_DIR=${TRANSMISSION_INCOMPLETE_DIR}
TEMP_TRAN_WATCH_DIR=${TRANSMISSION_WATCH_DIR}
if ! [ "$GLOBAL_APPLY_PERMISSIONS" = true ] ; then
unset TEMP_TRAN_DOWNLOAD_DIR
unset TEMP_TRAN_INCOMPLETE_DIR
unset TEMP_TRAN_WATCH_DIR
fi
if [ -n "$PUID" ] && [ ! "$(id -u root)" -eq "$PUID" ]; then if [ -n "$PUID" ] && [ ! "$(id -u root)" -eq "$PUID" ]; then
RUN_AS=abc RUN_AS=abc
if [ ! "$(id -u ${RUN_AS})" -eq "$PUID" ]; then usermod -o -u "$PUID" ${RUN_AS} ; fi if [ ! "$(id -u ${RUN_AS})" -eq "$PUID" ]; then usermod -o -u "$PUID" ${RUN_AS} ; fi
@@ -13,17 +23,17 @@ if [ -n "$PUID" ] && [ ! "$(id -u root)" -eq "$PUID" ]; then
chown -R ${RUN_AS}:${RUN_AS} \ chown -R ${RUN_AS}:${RUN_AS} \
/config \ /config \
${TRANSMISSION_HOME} \ ${TRANSMISSION_HOME} \
${TRANSMISSION_DOWNLOAD_DIR} \ ${TEMP_TRAN_DOWNLOAD_DIR} \
${TRANSMISSION_INCOMPLETE_DIR} \ ${TEMP_TRAN_INCOMPLETE_DIR} \
${TRANSMISSION_WATCH_DIR} ${TEMP_TRAN_WATCH_DIR}
echo "Setting permission for files (644) and directories (755)" echo "Setting permission for files (644) and directories (755)"
chmod -R go=rX,u=rwX \ chmod -R go=rX,u=rwX \
/config \ /config \
${TRANSMISSION_HOME} \ ${TRANSMISSION_HOME} \
${TRANSMISSION_DOWNLOAD_DIR} \ ${TEMP_TRAN_DOWNLOAD_DIR} \
${TRANSMISSION_INCOMPLETE_DIR} \ ${TEMP_TRAN_INCOMPLETE_DIR} \
${TRANSMISSION_WATCH_DIR} ${TEMP_TRAN_WATCH_DIR}
fi fi
echo " echo "