From d1fe24b038fddc55f461ded2ae25cbdfafc78ce4 Mon Sep 17 00:00:00 2001 From: TechieNK Date: Thu, 4 Jul 2024 21:14:08 +0530 Subject: [PATCH 1/4] making sure that various directories are writeable, via the new function make_dir_writable() --- _sources/scripts/run-all.sh | 7 +++++++ _sources/scripts/update-images-permissions.sh | 11 +++++++++++ 2 files changed, 18 insertions(+) create mode 100644 _sources/scripts/update-images-permissions.sh diff --git a/_sources/scripts/run-all.sh b/_sources/scripts/run-all.sh index 429971d3..026ee838 100755 --- a/_sources/scripts/run-all.sh +++ b/_sources/scripts/run-all.sh @@ -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 @@ -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 & diff --git a/_sources/scripts/update-images-permissions.sh b/_sources/scripts/update-images-permissions.sh new file mode 100644 index 00000000..17847a19 --- /dev/null +++ b/_sources/scripts/update-images-permissions.sh @@ -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" \ No newline at end of file From 13af220372fa6d55050e14a54c56a0ed52ed27ad Mon Sep 17 00:00:00 2001 From: TechieNK Date: Fri, 5 Jul 2024 19:13:31 +0530 Subject: [PATCH 2/4] Move image permissions update code to run-all.sh --- _sources/scripts/run-all.sh | 8 +++++++- _sources/scripts/update-images-permissions.sh | 11 ----------- 2 files changed, 7 insertions(+), 12 deletions(-) delete mode 100644 _sources/scripts/update-images-permissions.sh diff --git a/_sources/scripts/run-all.sh b/_sources/scripts/run-all.sh index 026ee838..ce32502f 100755 --- a/_sources/scripts/run-all.sh +++ b/_sources/scripts/run-all.sh @@ -80,7 +80,13 @@ 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 & +sleep 0.01 +printf "\n\n===== update-images-permissions.sh =====\n\n\n" + +. /functions.sh + +echo "Checking permissions of images in Mediawiki volume dir $MW_VOLUME/images..." +make_dir_writable "$MW_VOLUME/images" ########## Run maintenance scripts ########## echo "Checking for LocalSettings..." diff --git a/_sources/scripts/update-images-permissions.sh b/_sources/scripts/update-images-permissions.sh deleted file mode 100644 index 17847a19..00000000 --- a/_sources/scripts/update-images-permissions.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/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" \ No newline at end of file From a9fa9fca8a7715a9ef83310543cdabc84a327064 Mon Sep 17 00:00:00 2001 From: TechieNK Date: Sat, 6 Jul 2024 14:06:00 +0530 Subject: [PATCH 3/4] Move image permissions update code to run-all.sh --- _sources/scripts/run-all.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/_sources/scripts/run-all.sh b/_sources/scripts/run-all.sh index ce32502f..b1f21f9e 100755 --- a/_sources/scripts/run-all.sh +++ b/_sources/scripts/run-all.sh @@ -80,12 +80,8 @@ 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. -sleep 0.01 -printf "\n\n===== update-images-permissions.sh =====\n\n\n" -. /functions.sh - -echo "Checking permissions of images in Mediawiki volume dir $MW_VOLUME/images..." +echo "Checking permissions of images in MediaWiki volume dir $MW_VOLUME/images..." make_dir_writable "$MW_VOLUME/images" ########## Run maintenance scripts ########## From 07fb3e9357c24259a1c0931b43fa189ad9d627be Mon Sep 17 00:00:00 2001 From: TechieNK Date: Sun, 7 Jul 2024 23:26:51 +0530 Subject: [PATCH 4/4] Move image permissions update code to update-images-permissions script --- _sources/scripts/run-all.sh | 6 ++---- _sources/scripts/update-images-permissions.sh | 11 +++++++++++ 2 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 _sources/scripts/update-images-permissions.sh diff --git a/_sources/scripts/run-all.sh b/_sources/scripts/run-all.sh index b1f21f9e..1e47024f 100755 --- a/_sources/scripts/run-all.sh +++ b/_sources/scripts/run-all.sh @@ -80,9 +80,7 @@ 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. - -echo "Checking permissions of images in MediaWiki volume dir $MW_VOLUME/images..." -make_dir_writable "$MW_VOLUME/images" +/update-images-permissions.sh & ########## Run maintenance scripts ########## echo "Checking for LocalSettings..." @@ -109,7 +107,7 @@ else chmod -R g=rwX $MW_VOLUME/sitemap fi -echo "Checking permissions of Mediawiki volume dir $MW_VOLUME except $MW_VOLUME/images..." +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 diff --git a/_sources/scripts/update-images-permissions.sh b/_sources/scripts/update-images-permissions.sh new file mode 100644 index 00000000..4933867f --- /dev/null +++ b/_sources/scripts/update-images-permissions.sh @@ -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" \ No newline at end of file