Merge pull request #56 from larswnd/patch-1

Add UMASK Environment Variable Support and Documentation to docker-compose.yml
This commit is contained in:
Xoconoch
2025-02-27 20:08:26 -06:00
committed by GitHub
2 changed files with 7 additions and 1 deletions

View File

@@ -12,3 +12,4 @@ services:
environment:
- PUID=1000 # Replace with your desired user ID | Remove both if you want to run as root (not recommended, might result in unreadable files)
- PGID=1000 # Replace with your desired group ID | The user must have write permissions in the volume mapped to /app/downloads
- UMASK=0022 # Optional: Sets the default file permissions for newly created files within the container.

View File

@@ -1,6 +1,11 @@
#!/bin/bash
set -e
# Set umask if UMASK variable is provided
if [ -n "${UMASK}" ]; then
umask "${UMASK}"
fi
# Check if both PUID and PGID are not set
if [ -z "${PUID}" ] && [ -z "${PGID}" ]; then
# Run as root directly
@@ -42,4 +47,4 @@ else
# Run as specified user
exec gosu "${USER_NAME}" "$@"
fi
fi
fi