Administration panel vs the CLI - permissions

I just installed Grav along with Administration Panel plugin. I am a new user, and is just running the default configuration with no additional stuff (beyond those admin depend on). My host is a vanilla Ubuntu 18.04 LTS and I have full access to the CLI (Command Line Interface), including sudo.

My main reason for exploring Grav is the claim that Grav was built with the command line in mind, while at the same time having a pretty spiffy Admin GUI plugin. I was hoping that Grav would let me switch between the CLI and GUI without much hassle. But so far, this works less smooth than it should.

My CLI user is named “joe”, and the web server group is named “www-data”.

I set the ownership and permissions for a regular page like this:

-rw-rw-r--   joe        www-data

This of course let me use nano to edit it from the CLI when logged in to the CLI as “joe”. Saving it after editing works fine, and the file permissions remain unchanged.

Opening this file for editing in the GUI also works fine because the web server runs with the permissions of the web server group. But after saving it from the GUI, ownership and permissions now look like this:

-rw-r--r--   www-data   www-data

I.e. ownership has changed from “joe” to “www-data” and there is no longer write access for the group. To edit it from the CLI, I first need to restore those.

This not only happens when editing pages. I can set up permission to do this as logged in on the CLI:

bin/grav cache

However, if I clear the cache just once from the GUI, ownership and permissions of the cache is changed, and I cannot use the CLI again to clear the cache without restoring those.

I hope this is not how things are supposed to be, and that there are some settings I’ve overlooked that stops Grav from changing ownership and permissions to files when used from the GUI.

Any help will be appreciated.

Hello all,
I’m facing the same issue. When I work directly in the directories, files get created with proper USER:www-data ownership. But working from the admin, whether creating or modifying pages, gives back www-data:www-data. And that is true for all files and directories accessed. umask is 0002 so I assume another setting is involved – but which one?

I’m on localhost, v1.6.26 - Admin v1.9.15 and v1.7.0-rc.12 - Admin v1.10.0-rc.12. I have to use the permission-fixing script systematically after a new unzipping of files in the root directory to display my site.

Permission/ownership issues have always been frustrating. It seems I just NEVER can get it right first time around. Just when I was under the impression I had a reasonably good grasp of the subject, this situation happens…
This does not prevent me from working but I hope someone who knows comes by to set us straight.