FileFlows icon indicating copy to clipboard operation
FileFlows copied to clipboard

Sugestion: Allow the FileFlows Server/Node to be run as a specific user in Docker

Open rickiewars opened this issue 3 years ago • 0 comments

At the moment it's not yet possible out of the box to run Fileflows as an user other than root. I've made a temporary entrypoint script to enable me to get around this limitation. Basically, my script does the following:

  • It changes ownership of /app to :
  • It adds user of and group of
  • It executes /app/docker-entrypoint.sh as the created user.

I would propose the following to easily change the user running FileFlows by implementing the following in the entrypoint script:

  • Check if the enviornment variables PUID and PGID have been set. If not, just run FileFlows normally as root.
  • Optionally you may want to assume that PGID=$PUID if PGID is not set, just a suggestion.
  • Add the new group: groupadd -g $PGID fileflows
  • Add the new user: useradd -u $PUID -g $PGID fileflows
  • Change the ownership of the /app directory to the new user: chown -R fileflows:fileflows /app
  • Run FileFlows as the new user:
    • Node: su -c "/dotnet/dotnet FileFlows.Node.dll --docker true" fileflows
    • Server: su -c "/dotnet/dotnet FileFlows.Server.dll --urls=http://*:5000 --docker" fileflows

Make sure that the new user has read and execute access to the /dotnet/dotnet executable. Don't give the user more rights than it needs to advoid security risks.

rickiewars avatar Jul 21 '22 21:07 rickiewars