Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.

Conversation

adamzimmermann
Copy link
Contributor

@adamzimmermann adamzimmermann commented Jan 16, 2020

The site install process was creating sites/mysite/files/styles and sites/mysite/files/media-icons and setting their ownership to the user who ran the site install, which was root in my case.

This fixes the ownership on those directories so image styles can be generated without an error (original impetus for this change).

After testing this I realized that we need to make this not perform the action on hidden files. .htaccess is being changed and it should not be. Fix for that to follow.

Current: -rwxrwx--- 1 www-data root 543 Jan 16 21:54 .htaccess
Correct: -r--r--r-- 1 root root 543 Jan 16 03:35 .htaccess

I have thus far been unable to find a way to do this with the tools available.

@adamzimmermann adamzimmermann added bug Something isn't working help wanted Extra attention is needed labels Jan 16, 2020
@adamzimmermann adamzimmermann self-assigned this Jan 16, 2020
tasks/main.yml Outdated
mode: 0770
recurse: yes
become: "{{ deploydrupal_files_become }}"
when: deploydrupal_site_install_config
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess this only occurs when installing with config since that is how the media module will be installed? What if someone is installing with a profile other than minimal?

Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we can remove the other similar instance of this and then ditch the when on this task so that it runs every time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess this only occurs when installing with config since that is how the media module will be installed? What if someone is installing with a profile other than minimal?

I'm not sure where you are going with this. Let's discuss on the coffee zoom.

I wonder if we can remove the other similar instance of this and then ditch the when on this task so that it runs every time.

Let's discuss this on coffee zoom too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Discussed and decided to use an array of subdirectory names to avoid altering other files.

@adamzimmermann
Copy link
Contributor Author

root@drupal:/var/lib/tugboat/web/sites/mysite/files# ls -la
total 4
drwxrwx--- 4 www-data root  56 Jan 17 18:49 .
dr-xr-xr-x 3 root     root  39 Jan 17 18:48 ..
-r--r--r-- 1 root     root 543 Jan 17 18:49 .htaccess
drwxrwx--- 3 www-data root  21 Jan 17 18:49 media-icons
drwxrwx--- 2 www-data root   6 Jan 17 18:49 styles

The latest approach seems to be working well.

@adamzimmermann
Copy link
Contributor Author

@markdorison I added back the step to set the files directory permissions, as I figured we should set the parent directory permissions and not just the sub-directories that we specify.

@adamzimmermann adamzimmermann merged commit d8a40e3 into master Jan 17, 2020
@markdorison markdorison deleted the file-directory-permissions branch June 17, 2020 13:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants