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

Bug: Wrong 0777 permission on web/app folder on every deploy #1400

Closed
5 tasks done
cfaria opened this issue Jul 1, 2022 · 2 comments · Fixed by #1403
Closed
5 tasks done

Bug: Wrong 0777 permission on web/app folder on every deploy #1400

cfaria opened this issue Jul 1, 2022 · 2 comments · Fixed by #1403
Labels

Comments

@cfaria
Copy link

cfaria commented Jul 1, 2022

Terms

Description

What's wrong?

Every time I deploy, either to Kinsta, custom server or Trellis managed server, the web/app folder from bedrock gets permissions 0777.

If I override the project_shared_children var in my trellis/group_vars/production/main.yml file to share some files and folders across deploys, then I get the web/app folder chmod 0777 and the web folder also with 0777.

Maybe I'm wrong, but I think applying 0777 to a folder is too permisive and this should be changed to 0755

This is the disourse topic related to this issue I've opened almost a year ago. I don't know how no one have seen this before. Maybe I'm the only one that has the problem.

https://discourse.roots.io/t/deploy-places-web-and-app-folder-777/21087

What have you tried?

I think this line is the culprit, as if I change it in my trellis install then the web and web/app folders get 0755 as I think they should...

If I don't override the project_shared_children var then only the web/app folder has 0777.
If I override the project_shared_children var then web and web/app folder both two have 0777.

Using the mode option in project_shared_children doesn't work as this is related to the parent folder:

# mode: '0755' // <- optional, use an octal number starting with 0 or quote it, defaults to `'0755'` if `directory` or `'0644'` if `file`

What insights have you gained?

Maybe all our websites are a bit exposed to attackers.

Possible solutions

Change this line

to 0755

Temporary workarounds

Change this line

to 0755

Steps To Reproduce

Just deploy using trellis and see the permissions of web/app on bedrock.

Captura de pantalla 2022-07-01 a las 14 44 15

I you override the project_shared_children var in your trellis/group_vars/production/main.yml file with something like this:

project_shared_children:
  - path: web/app/uploads
    src: uploads
  - path: web/robots.txt
    src: robots.txt

...then you'll get web and web/app folder with 0777.

Expected Behavior

web/app folder to be 0755

Actual Behavior

web/app folder is 0777

Relevant Log Output

No response

Versions

Trellis v1.15.0 - OSX 10.15.7

@cfaria cfaria added the bug label Jul 1, 2022
@cfaria
Copy link
Author

cfaria commented Jul 1, 2022

I've found this is the commit that places the 0777 mode to shared folders (Trellis v1.6.0):

aff51a5

I have some sites with Trellis v1.4.0 (I know...) and the deploys don't have that problem, so I guess a revert or setting that line to 0755 would do the fix.

@swalkinshaw
Copy link
Member

Thanks for tracking down that commit @cfaria. Judging from the permissions on the actual release dir, I think this should match and be 0755 as well. I'll do a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants