0
Closed

Default permissions for uploaded files

ovidiu 1 month ago updated 1 month ago 9

It seems that by default, filerun applies 644 permissions to uploaded files. 

Is there a way to change this so uploaded files have 660 permissions? 

I can't find a GUI or config way to change this behavior.

Closed

FileRun does not apply any file permissions whatsoever. Files created by FileRun get the file permissions from PHP, which gets them from the higher up application, either the HTTP server or the CGI/FastCGI/FPM application. You should look into "umask" for your higher level application.

I have umask un config.php in customizables folder:

<?php 

umask(012);

$config['path']['trash'] = '/user-files/trash/';

$config['path']['thumbnail_cache'] = '/user-files/thumbnails/';

php?>

thanks, that was exactly the advice I would have expected from the developer, especially seeing that I did search and its not documented:

umask(007);

was exactly what I needed! Thanks again!

OK; sorry to have kept info from you. I am running filerun via the docker image supplied by you. Does this help you help me fix this? Can I pass some ENV variable or the likes to your docker image to have it behave the way I like?

for example, I know I can chose my ID and name like this inside docker-compose.yml:

environment:
APACHE_RUN_USER: ovi
APACHE_RUN_USER_ID: 1000
APACHE_RUN_GROUP: ovi
APACHE_RUN_GROUP_ID: 1000

You would better use the right system user, to take the right ownership of the files, rather than modify file permissions. You can them make appropriate changes via the system user and its group, rather than on the files the system user manages.

I thought that was what I did:

environment:
APACHE_RUN_USER: ovi
APACHE_RUN_USER_ID: 1000
APACHE_RUN_GROUP: ovi
APACHE_RUN_GROUP_ID: 1000

user ovi with ID 1000 and group ovi with ID 1000 own the underlying folder mounted into this docker image. The system permissions are exactly as I like them, except that when filerun creates files/folders it didn't behave the way the underlying system was set up. With this umask edit, everything created/uploaded via filerun looks exactly like the underlying filesystem.

Not sure if I am too clueless about these issues but to me it looks exactly right now.