Stirling-Tools / Stirling-PDF

#1 Locally hosted web application that allows you to perform various operations on PDF files
MIT License
39.97k stars 3.14k forks source link

[Bug]: Running Stirling-PDF in docker with --user (rootless) #1516

Open quentinus95 opened 2 months ago

quentinus95 commented 2 months ago

The Problem

Hello, I'm reopening a new issue as #508 was closed while not solved.

Quoting the previous ticket:

I would like to know if it could be possible to allow using the user Docker directive, instead of only the environment variables.

Current configuration requires running the container as root, and then trust that it will switch to the specified UID/GID. This presents a security risk.

Could it be possible to allow the container to run as a non root? It was possible before version 0.13.

To be clear as maybe the previous ticket was not precise enough: the current way requiring PUID and PGID is not fitting those requirements, because it does not allow to run this container rootless.

To run the container without root permissions, the following command should work:

docker run -it --user 2000 frooodle/s-pdf:latest

Running this command with the two environment variables does not work either.

openFile(logs/invalid-auths.log,true) call failed. java.io.FileNotFoundException: logs/invalid-auths.log (Permission denied)

Could it be possible to allow this container to run rootless?

Big thanks!

Version of Stirling-PDF

latest

Last Working Version of Stirling-PDF

0.13

jobritz commented 2 months ago

Not sure if this helps you but have you considered using podman? I'm using stirling pdf with a non root user and it works fine