From 375a977fcff0d3c23f7bef4709a8aa7f68d5a55b Mon Sep 17 00:00:00 2001 From: marsante Date: Sun, 4 Aug 2024 09:54:20 +0200 Subject: [PATCH 1/3] update-fix: debien-bash-installer --- installer/debian-bash-installer.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/installer/debian-bash-installer.sh b/installer/debian-bash-installer.sh index ded974e8..97415234 100755 --- a/installer/debian-bash-installer.sh +++ b/installer/debian-bash-installer.sh @@ -219,7 +219,8 @@ msehrInstall() { mkdir -p "$msehrPath"/public_html version=$(echo "$vRelease" | cut -f2 -d "v") mv -f /tmp/MedShakeEHR-base-"$version"/* "$msehrPath" - + echo "$msehrPath + " > "$msehrPath"/public_html/MEDSHAKEEHRPATH chown www-data:www-data -R "$msehrPath" chmod 755 "$msehrPath" "$msehrPath"/public_html @@ -227,9 +228,7 @@ msehrInstall() { su www-data -s/bin/bash -c 'composer install --no-interaction --no-cache -o' cd "$msehrPath"/public_html || exit su www-data -s/bin/bash -c 'composer install --no-interaction --no-cache -o' - echo "$msehrPath - " > "$msehrPath"/public_html/MEDSHAKEEHRPATH - su www-data -s/bin/bash -c "php $msehrPath/public_html/install.php -N -s localhost -d $msehrDbName -u $mysqlUser -p $mysqlUserPswd -r https -D $msehrDom" + su www-data -s/bin/bash -c "php $msehrPath/public_html/install.php -N -s localhost -d $msehrDbName -u $mysqlUser -p $mysqlUserPswd -r https -D $msehrDom -o localhost" selectRemoveInstallFiles } @@ -285,7 +284,7 @@ msehrDom=msehr.local msehrDbName=medshakeehr selectVersion=1 selectRemove=1 -msehrDep="apache2 composer curl ghostscript git imagemagick mariadb-server ntp pdftk-java php php-bcmath php-curl php-gd php-imagick php-imap php-intl php-mysql php-soap php-xml php-yaml php-zip" +msehrDep="apache2 composer curl ghostscript git imagemagick mariadb-server ntp pdftk-java php php-bcmath php-curl php-gd php-gnupg php-imagick php-imap php-intl php-mysql php-soap php-xml php-yaml php-zip" extraDicom="orthanc" clear From 2cbf68ac367694af874cc1c46dfea247646f894e Mon Sep 17 00:00:00 2001 From: marsante Date: Sun, 4 Aug 2024 10:04:04 +0200 Subject: [PATCH 2/3] update: vagrantfile --- Vagrantfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index 3e644e9c..10b6473e 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,5 +1,5 @@ Vagrant.configure("2") do |config| - config.vm.box = "generic/debian11" + config.vm.box = "debian/bookworm64va" config.vm.define "msehr" config.vm.hostname = "msehr.local" config.vm.network "private_network", ip: "192.168.56.4" From 127116588d7ad2ef34316e4833da6211a7dc4e4d Mon Sep 17 00:00:00 2001 From: marsante Date: Sun, 4 Aug 2024 12:03:40 +0200 Subject: [PATCH 3/3] fix: docker msehr.uprade.php permissions --- tools/docker/msehr.upgrade.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tools/docker/msehr.upgrade.php b/tools/docker/msehr.upgrade.php index 6eb18a91..66d44165 100755 --- a/tools/docker/msehr.upgrade.php +++ b/tools/docker/msehr.upgrade.php @@ -93,6 +93,21 @@ $moveCommand = "cp -r -f $extractDir/* /var/www/html/"; exec($moveCommand); + // Set www-data if script executed by root + if (posix_getuid() === 0) { // Check if the user is root + // Get the UID of the www-data user + $uid = posix_getpwnam('www-data')['uid']; + $gid = posix_getgrnam('www-data')['gid']; + + // Set the correct ownership for the files and subdirectories + $dirIterator = new RecursiveDirectoryIterator('/var/www/html/'); + $iterator = new RecursiveIteratorIterator($dirIterator); + foreach ($iterator as $fileInfo) { + chown($fileInfo->getPathname(), $uid); + chgrp($fileInfo->getPathname(), $gid); + } + } + // Print a success message echo "La copie c'est bien déroulée, connectez vous à votre compte administrateur pour appliquer la mise à jour.\n";