From d1cb975ccac940bfbc9d44ce396ac62fc17a0777 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 9 Oct 2021 20:08:47 +0200 Subject: [PATCH] Fix --- manifest.json | 5 +---- scripts/install | 3 --- scripts/restore | 3 --- scripts/upgrade | 39 +++++++++++++++++---------------------- 4 files changed, 18 insertions(+), 32 deletions(-) diff --git a/manifest.json b/manifest.json index 29ab636..f357972 100644 --- a/manifest.json +++ b/manifest.json @@ -11,8 +11,6 @@ "upstream": { "license": "BSD-2-Clause", "website": "https://github.com/silverwind/droppy", - "demo": "https://demo.example.com", - "admindoc": "https://yunohost.org/packaging_apps", "code": "https://github.com/silverwind/droppy" }, "license": "BSD-2-Clause", @@ -30,8 +28,7 @@ "install" : [ { "name": "domain", - "type": "domain", - "example": "domain.org" + "type": "domain" }, { "name": "path", diff --git a/scripts/install b/scripts/install index 8647b7a..7bb7bc7 100644 --- a/scripts/install +++ b/scripts/install @@ -13,9 +13,6 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { - ynh_clean_check_starting -} # Exit if an error occurs during the execution of the script ynh_abort_if_errors diff --git a/scripts/restore b/scripts/restore index e9cc1d9..88403bb 100644 --- a/scripts/restore +++ b/scripts/restore @@ -13,9 +13,6 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { - ynh_clean_check_starting -} # Exit if an error occurs during the execution of the script ynh_abort_if_errors diff --git a/scripts/upgrade b/scripts/upgrade index e022933..ee1d44b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -24,22 +24,9 @@ port=$(ynh_app_setting_get --app=$app --key=port) #================================================= # CHECK VERSION #================================================= -ynh_script_progression --message="Checking version..." --weight=1 upgrade_type=$(ynh_check_app_version_changed) -#================================================= -# ENSURE DOWNWARD COMPATIBILITY -#================================================= -ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 - -# Cleaning legacy permissions -if ynh_legacy_permissions_exists; then - ynh_legacy_permissions_delete_all - - ynh_app_setting_delete --app=$app --key=is_public -fi - #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= @@ -54,6 +41,18 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors +#================================================= +# ENSURE DOWNWARD COMPATIBILITY +#================================================= +ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 + +# Cleaning legacy permissions +if ynh_legacy_permissions_exists; then + ynh_legacy_permissions_delete_all + + ynh_app_setting_delete --app=$app --key=is_public +fi + #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -79,11 +78,16 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=10 + cp -a "$final_path/config/config.json" "$tmpdir/config.json" # Remove the app directory securely ynh_secure_remove --file=$final_path # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir=$final_path + cp -a "$tmpdir/config.json" "$final_path/config/config.json" + + # Remove the tmp directory securely + ynh_secure_remove --file="$tmpdir" fi #================================================= @@ -116,13 +120,6 @@ then popd fi -#================================================= -# MODIFY A CONFIG FILE -#================================================= -ynh_script_progression --message="Modifying a config file..." --weight=2 - -ynh_add_config --template="../conf/config.json.example" --destination="$final_path/config/config.json" - #================================================= # SETUP SYSTEMD #================================================= @@ -136,8 +133,6 @@ ynh_add_systemd_config chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" -chmod 600 $final_path/config/config.json -chown $app:$app $final_path/config/config.json #================================================= # INTEGRATE SERVICE IN YUNOHOST