Stirling-PDF icon indicating copy to clipboard operation
Stirling-PDF copied to clipboard

Add option to modify the user

Open Myzel394 opened this issue 1 year ago • 3 comments

Currently, the PUID and GUID is set hardcoded to 1000:1000:

ENV DOCKER_ENABLE_SECURITY=false \
    VERSION_TAG=$VERSION_TAG \
    JAVA_TOOL_OPTIONS="$JAVA_TOOL_OPTIONS -XX:MaxRAMPercentage=75" \
    HOME=/home/stirlingpdfuser \
    PUID=1000 \
    PGID=1000 \
    UMASK=022

Please add an option to make them editable. I'm not a Docker expert, but wouldn't this actually be enough?:

ENV DOCKER_ENABLE_SECURITY=false \
    VERSION_TAG=$VERSION_TAG \
    JAVA_TOOL_OPTIONS="$JAVA_TOOL_OPTIONS -XX:MaxRAMPercentage=75" \
    HOME=/home/stirlingpdfuser \
    PUID=${PUID:-1000} \
    PGID=${GUID:-1000} \
    UMASK=022

Myzel394 avatar Mar 19 '24 20:03 Myzel394

I believe user provided env variables already override these without code change

Can you confirm?

Frooodle avatar Mar 19 '24 21:03 Frooodle

Okay so I can confirm this partially. When changing the PUID and GUID env variable like:

    environment:
        - PUID=3000
        - GUID=3000

the server seems to start correctly and run flawlessly. It can also access the folders (with the folder's ownership set to 3000:3000). However, when I call whoami using:

docker exec -it stirling whoami

it says: root :/

Overriding the user like:

    user: "3000:3000"

will result in the server throwing errors on startup.

Myzel394 avatar Mar 20 '24 19:03 Myzel394

Yeah right now due to volume mapping permission issues the app itself runs as user but docker runs as root

let me check on the user: 3000:3000 part

Frooodle avatar Mar 20 '24 21:03 Frooodle