backdrop-ops / backdropcms.org

Issue tracker for the BackdropCMS.org website
https://backdropcms.org
25 stars 21 forks source link

Permissions check for all backdropcms.org properties. #991

Closed jenlampton closed 1 year ago

jenlampton commented 1 year ago

It is theoretically possible that a file could be created within home/repo/config/live-active that has the owner and group of the shell user, making the file no longer web-writable, which can cause failures on the production site. However, this should never happen, as all config files should either be created by install or update actions (by the web server) or be added first into home/repo/config/staging and then a config-sync will write them to home/repo/config/live-active (also done by the web server). If w do ever encounter this problem, we should investigate how it happened and see if we can prevent that :)

Shell user information:

Our permissions should be set up as follows:

The parent directories should not be web writable, so both owner and group should be only the shell user. Within those directories, we have three locations that need to be writable by the web server, so these need to have the group www-data instead of the shell user. (Owner should still be the shell user.)

Notes:

Review all sites to confirm they are set up properly:

larsdesigns commented 1 year ago

Would this be the correct documentation for configuring the permissions? https://docs.backdropcms.org/documentation/file-permissions-and-ownership

larsdesigns commented 1 year ago

@jenlampton, Perhaps we should update the documentation at https://docs.backdropcms.org/documentation/file-permissions-and-ownership to include information for the config and private files directory?

jenlampton commented 1 year ago

@larsdesigns there is nothing in those docs about config. So, they are incomplete.

edit; Jynx!

jenlampton commented 1 year ago

The events site was fine, but all the others needed a little adjusting.

bugfolder commented 1 year ago

I'm reopening this because the file permissions on b.org are not correct in their present state. In particular, there are subdirectories of www/files/civicrm/templates_c/... that are not writeable by the www-data user, and that is causing CiviCRM to tantrum (as of 2023-04-25).

One can see examples (at least right now) by running this on the server:

ls -la ~/repo/www/files/civicrm/templates_c/en_US
jenlampton commented 1 year ago

I've updated the permissions on the whole civicrm directory to be writable by the www-data user. Is there a way to test the civi tantrum to see if this change resolves those issues?

bugfolder commented 1 year ago

Yes, hang on...

bugfolder commented 1 year ago

I've been DMing with @cellear, who uncovered the tantrum. He reports it working now!

cellear commented 1 year ago

Looks like it worked:

image
jenlampton commented 1 year ago

Phew!