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

fix: DEV-2107: Make setup-base.sh not create self-referencing link #73

Merged
merged 1 commit into from
Oct 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions scripts/setup-base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,17 @@ for SITE in `ls -d web/sites/*/`; do
mkdir -p $PERSISTENT_FILES_DIR/$SITE/private

if [ -n "$ENV_UNIX_GROUP_WEBSERVER" ]; then
sudo chown -R :$ENV_UNIX_GROUP_WEBSERVER $PERSISTENT_FILES_DIR/$SITE/
# When a custom group is set, ensure sub-directory and files are always
# webserver writable via the setgid bit. This makes the right group to be
# propagated down.
sudo chmod 2775 $PERSISTENT_FILES_DIR/$SITE/public
sudo chmod 2775 $PERSISTENT_FILES_DIR/$SITE/public/translations
sudo chmod 2775 $PERSISTENT_FILES_DIR/$SITE/private
if [[ $(id -u) -eq 0 || $(command -v sudo) ]]; then
# Note: this group may not exist on the host OS (MacOS), so the command
# fails. Just ignore the error; chmods are still done and things work OK.
sudo chown -R :$ENV_UNIX_GROUP_WEBSERVER $PERSISTENT_FILES_DIR/$SITE/
# When a custom group is set, ensure sub-directory and files are always
# webserver writable via the setgid bit. This makes the right group to be
# propagated down.
sudo chmod 2775 $PERSISTENT_FILES_DIR/$SITE/public
sudo chmod 2775 $PERSISTENT_FILES_DIR/$SITE/public/translations
sudo chmod 2775 $PERSISTENT_FILES_DIR/$SITE/private
fi
fi

# Move files for existing dev-installations.
Expand All @@ -57,6 +61,8 @@ for SITE in `ls -d web/sites/*/`; do

# Link public files directory to persistent files.
mkdir -p web/sites/$SITE
os_compat_link_directory ../../../$PERSISTENT_FILES_DIR/$SITE/public web/sites/$SITE/files
if [[ ! -L web/sites/$SITE/files ]]; then
os_compat_link_directory ../../../$PERSISTENT_FILES_DIR/$SITE/public web/sites/$SITE/files
fi
done

Loading