Skip to content

Commit

Permalink
Ensure that various directories are writeable (#413)
Browse files Browse the repository at this point in the history
* making sure that various directories are writeable, via the new function make_dir_writable()

* Move image permissions update code to run-all.sh

* Move image permissions update code to run-all.sh

* Move image permissions update code to update-images-permissions script
  • Loading branch information
naresh-kumar-babu authored Jul 7, 2024
1 parent 07e785b commit 22041ad
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
7 changes: 7 additions & 0 deletions _sources/scripts/run-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ check_mount_points
sleep 1
cd "$MW_HOME" || exit

# Check and update permissions of wiki images in background.
# It can take a long time and should not block Apache from starting.
/update-images-permissions.sh &

########## Run maintenance scripts ##########
echo "Checking for LocalSettings..."
if [ -e "$MW_VOLUME/config/LocalSettings.php" ] || [ -e "$MW_VOLUME/config/CommonSettings.php" ]; then
Expand All @@ -103,6 +107,9 @@ else
chmod -R g=rwX $MW_VOLUME/sitemap
fi

echo "Checking permissions of MediaWiki volume dir $MW_VOLUME except $MW_VOLUME/images..."
make_dir_writable "$MW_VOLUME" -not '(' -path "$MW_VOLUME/images" -prune ')'

# Running php-fpm
/run-php-fpm.sh &

Expand Down
11 changes: 11 additions & 0 deletions _sources/scripts/update-images-permissions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

sleep 0.01
printf "\n\n===== update-images-permissions.sh =====\n\n\n"

set -x

. /functions.sh

echo "Checking permissions of images in MediaWiki volume dir $MW_VOLUME/images..."
make_dir_writable "$MW_VOLUME/images"

0 comments on commit 22041ad

Please sign in to comment.