Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run composer as nginx user to avoid permissions conflict. #400

Merged
merged 6 commits into from
Aug 21, 2024

Conversation

DonRichards
Copy link
Member

Addressing issues in #306

This runs the 3 compose commands in the Makefile as the nginx user. By doing so the installed modules have the correct permissions and the settings.php file have its owner permissions changed.

After running make starter_dev this is a report of the settings file

File Information for: web/sites/default/settings.php
------------------------
File Type: regular file
Permissions: -r--r--r-- (Numeric: 444)
Owner: nginx
Group: nginx
Owner Permissions: 4 (4=read, 2=write, 1=execute)
Group Permissions: 4 (4=read, 2=write, 1=execute)
Other Permissions: 4 (4=read, 2=write, 1=execute)
Is Executable: Yes
Is marked as 'Archive': No
------------------------
Modified: 2024-07-25 13:42:40.254382786 +0000
Last Accessed: 2024-07-25 13:42:41.479146012 +0000

To test (from a clean repo)

  1. Run make start_dev on flesh isle-dc (without codebase)
  2. Once complete check who owns the /var/www/drupal/vendor directory(likely root)
  3. Check that the /var/www/drupal/web/sites/default/settings.php is set to archive (read only)
  4. Run make clean
  5. Run make start_dev on flesh isle-dc (without codebase) again
  6. Once complete check who owns the /var/www/drupal/vendor directory(likely nginx)
  7. Check that the /var/www/drupal/web/sites/default/settings.php is set to archive (-r--r--r-- but no archive flag)

@DonRichards DonRichards changed the title Draft: Run composer as nginx user to avoid permissions conflict. Run composer as nginx user to avoid permissions conflict. Jul 26, 2024
@aOelschlager aOelschlager self-requested a review July 31, 2024 17:20
Copy link
Contributor

@aOelschlager aOelschlager left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just tested this and I got the same error that the make (ubuntu-latest) test is getting when running make starter.

@DonRichards
Copy link
Member Author

Looking at the failed tests chmod: /dev/stdin: Operation not permitted
I'm guessing the files have the wrong permissions to begin with. I could add a fix ownership command before it starts with "starter".

Copy link
Contributor

@aOelschlager aOelschlager left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this and it works for me now with make starter. The make (ubuntu-latest) test is failing on make production though.

@aOelschlager aOelschlager merged commit dc8ed0c into development Aug 21, 2024
1 check failed
@aOelschlager aOelschlager deleted the composer_nginx_user branch August 21, 2024 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants