YunoHost-Apps / grav_ynh

Grav, a flat-file CMS packaged for YunoHost
https://getgrav.org/
GNU General Public License v3.0
16 stars 12 forks source link

Grav admin doesn't respect yunohost permissions #164

Open eauchat opened 2 months ago

eauchat commented 2 months ago

Describe the bug

This is a minor issue, so feel free to close it. By default grav seems to recommend using the following way to set permissions:

find . -type f -exec chmod 664 {} \;
find ./bin -type f -exec chmod 775 {} \;
find . -type d -exec chmod 775 {} \;
find . -type d -exec chmod +s {} \;

Grav_ynh's approach is to be more restrictive, which works and looks nice to me:

find "$install_dir" -type f -exec chmod 640 {} \;
find "$install_dir/bin" -type f -exec chmod 750 {} \;
find "$install_dir" -type d -exec chmod 750 {} \;
find "$install_dir" -type d -exec chmod +s {} \;

It all works like a charm until one starts using grav admin. The admin saves in the following way:

-rw-r--r-- someNewFile
drwxr-sr-x someNewDir

So if I translate it right it means 644 for files and 755 for directories.

It's not creating issues with site functionalities, but it would be cleaner if one could instruct the admin to set permissions like done on install. I didn't find a way to do that though, but don't know grav admin so well and there might be a functionality to do so.

Anyway just wanted to post about it for the record and in case someone has some reflections on this, but as said in the beginning, if it's not really fixable, the issue can be closed.

Context

tituspijean commented 2 months ago

Let's add here the discussion we had on files permissions: https://github.com/YunoHost-Apps/grav_ynh/pull/163#issuecomment-2062232124