From 928e0e239305fdea49c10e30c6c6ccff2add59b6 Mon Sep 17 00:00:00 2001 From: Sebastian Gumprich Date: Wed, 15 Sep 2021 22:09:57 +0200 Subject: [PATCH] fix config checksum creation --- scripts/backup | 3 --- scripts/install | 7 +++++++ scripts/restore | 1 - scripts/upgrade | 5 +++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/scripts/backup b/scripts/backup index 73cf595..fd931cd 100755 --- a/scripts/backup +++ b/scripts/backup @@ -14,9 +14,6 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { - true -} # Exit if an error occurs during the execution of the script ynh_abort_if_errors diff --git a/scripts/install b/scripts/install index ec26ee6..86548c7 100755 --- a/scripts/install +++ b/scripts/install @@ -143,6 +143,13 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" +#================================================= +# STORE THE CHECKSUM OF THE CONFIG FILE +#================================================= + +# Calculate and store the config file checksum into the app settings +ynh_store_file_checksum --file="$final_path/.env" + #================================================= # ADD A CRON JOB #================================================= diff --git a/scripts/restore b/scripts/restore index d852441..1226e8d 100755 --- a/scripts/restore +++ b/scripts/restore @@ -70,7 +70,6 @@ ynh_restore_file --origin_path="$final_path" chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" -chmod -R 755 $final_path/storage #================================================= # RESTORE THE PHP-FPM CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index 6502074..7a7b878 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -19,8 +19,9 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) admin=$(ynh_app_setting_get --app=$app --key=admin) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) language=$(ynh_app_setting_get --app=$app --key=language) +is_public=$YNH_APP_ARG_IS_PUBLIC + db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) db_user=$db_name @@ -88,7 +89,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= config="$final_path/.env" -ynh_backup_if_checksum_is_different --file="$final_path/CONFIG_FILE" +ynh_backup_if_checksum_is_different --file="$final_path/.env" if [ "$upgrade_type" == "UPGRADE_APP" ] then