From 8366a5fa240d9bf1f5d973cdf1a249b0c09a1c8d Mon Sep 17 00:00:00 2001 From: Florent Date: Thu, 30 Dec 2021 20:14:13 +0100 Subject: [PATCH] Pre-upgrade script for chown + fixes --- check_process | 14 +++++++------- scripts/restore | 4 +++- scripts/upgrade | 4 ++++ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/check_process b/check_process index 87a0cef..89a9335 100644 --- a/check_process +++ b/check_process @@ -1,4 +1,8 @@ ; Test complet + ; pre-upgrade + if [ "$FROM_COMMIT" == "04e1730ff642a2e48dfb533b2136fe90f9eaf133" ]; then + chmod -R o-rwx /var/www/garradin + fi ; Manifest domain="domain.tld" path="/path" @@ -12,8 +16,7 @@ setup_public=1 upgrade=1 upgrade=1 from_commit=7205455e0a806a49c48c6d2f005d80d1b74a3355 - upgrade=1 from_commit=fc55308f7521310d5c339139339896bb59bd73cd - upgrade=1 from_commit=e5dd30afa6a618344c9e7b927839d4e9ac8bfc56 + upgrade=1 from_commit=04e1730ff642a2e48dfb533b2136fe90f9eaf133 backup_restore=1 multi_instance=1 change_url=1 @@ -24,9 +27,6 @@ Notification=none ; commit=7205455e0a806a49c48c6d2f005d80d1b74a3355 name=Previous version manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666& - ; commit=fc55308f7521310d5c339139339896bb59bd73cd - name=Version 0.9.5 - manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666& - ; commit=e5dd30afa6a618344c9e7b927839d4e9ac8bfc56 - name=Version 1.0.3~ynh2 + ; commit=04e1730ff642a2e48dfb533b2136fe90f9eaf133 + name=Version 1.0.6~ynh1 manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666& diff --git a/scripts/restore b/scripts/restore index d702b05..a4dfe8a 100644 --- a/scripts/restore +++ b/scripts/restore @@ -71,7 +71,9 @@ find "$final_path" -type d -exec chmod 550 {} + find "$final_path" -type f -exec chmod 440 {} + find "$final_path/data" -type d -exec chmod 770 {} + find "$final_path/data" -type f -exec chmod 660 {} + -chmod 660 "$final_path/config.local.php" +chmod 440 "$final_path/config.local.php" +chmod 440 "$final_path/config.local.yunohost.php" +chmod 660 "$final_path/config.local.user.php" #================================================= # RESTORE THE PHP-FPM CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index 5e9f4b2..dedde73 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -259,6 +259,10 @@ fi #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=5 +if ynh_compare_current_package_version --comparison lt --version 1.1.15~ynh1; then + ynh_add_config --template="config.local.user.php" --destination="$final_path/config.local.user.php" +fi + ynh_add_config --template="config.local.php" --destination="$final_path/config.local.php" ynh_add_config --template="config.local.yunohost.php" --destination="$final_path/config.local.yunohost.php" # NOTE: Don't overwrite config.local.user.php