From b539ab4b60386d251461f96241e0b6d568b4757e Mon Sep 17 00:00:00 2001 From: larswnd <67687738+larswnd@users.noreply.github.com> Date: Wed, 26 Feb 2025 20:07:22 +0100 Subject: [PATCH 1/3] feat(entrypoint): Add optional UMASK support - Added support for the UMASK environment variable in entrypoint.sh - If UMASK is set, the script applies it before executing the main process - Ensures flexibility without forcing a default umask - Maintains existing behavior for PUID and PGID handling --- entrypoint.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index a68c531..0a34996 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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 \ No newline at end of file +fi From 1f84d1135417eadbcfe5c632d352481ca45da75c Mon Sep 17 00:00:00 2001 From: larswnd <67687738+larswnd@users.noreply.github.com> Date: Wed, 26 Feb 2025 20:08:58 +0100 Subject: [PATCH 2/3] remove empty line at EOF From 361e0d64af0cd2116cf7db2f51b8571bf1445c2d Mon Sep 17 00:00:00 2001 From: larswnd <67687738+larswnd@users.noreply.github.com> Date: Wed, 26 Feb 2025 20:11:28 +0100 Subject: [PATCH 3/3] docs(docker-compose): Add UMASK environment variable description - Added a comment for the UMASK environment variable in docker-compose.yml - Clarified the purpose of UMASK: to set default file permissions for newly created files in the container - Explained the format and behavior of UMASK (e.g., 0022 for user read/write, others read-only) --- docker-compose.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.yaml b/docker-compose.yaml index c8be331..cbf6a79 100755 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -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.