Skip to content

Commit

Permalink
fix(vendor): give group access to vendor (#73)
Browse files Browse the repository at this point in the history
* fix(vendor): give group access to vendor

Grant read and execute on directories

* Update drupal-fix-permissions.sh.erb

* also check for .env file
  • Loading branch information
minorOffense authored Jun 12, 2019
1 parent 6df29c0 commit 691cfa0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions templates/drupal-fix-permissions.sh.erb
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ if [ -d "${drupal_path}/../vendor" ]; then

printf "Changing ownership of "vendor" directories in "${drupal_path}/../vendor" \n"
chown -R ${drupal_user}:${httpd_group} ${drupal_path}/../vendor
find ${drupal_path}/../vendor -type d ! -name . -exec chmod g=rx '{}' \;
chmod g=rx ${drupal_path}/../vendor

if [ -d "${drupal_path}/../vendor/bin" ]; then
printf "Changing permissions of "vendor/bin" directories in "${drupal_path}/../vendor/bin" to "u+x"...\n"
Expand All @@ -146,6 +148,17 @@ if [ -d "${drupal_path}/../bin" ]; then
restorecon -RF ${drupal_path}/../bin
fi

# Load environment file.
if [ -f "${drupal_path}/../load.environment.php" ]; then
printf "Changing permissions of "load.environment.php" in "${drupal_path}/../" to "rw-r-----"...\n"
chmod 640 ${drupal_path}/../load.environment.php
chown ${drupal_user}:${httpd_group} ${drupal_path}/../load.environment.php
if [ -f "${drupal_path}/../.env" ]; then
chmod 640 ${drupal_path}/../.env
chown ${drupal_user}:${httpd_group} ${drupal_path}/../.env
fi
fi

# Configuration directories.
if [ "$dversion" -eq 8 ] && [ -d "${drupal_path}/../config" ]; then
chown -R ${drupal_user}:${httpd_group} ${drupal_path}/../config
Expand Down

0 comments on commit 691cfa0

Please sign in to comment.