From 4b8d76b7b0035f49f5a837fda00df6febe9caaeb Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 19 Mar 2021 23:28:49 +0100 Subject: [PATCH] Cleaning up --- manifest.json | 22 +--------------------- scripts/install | 3 +-- scripts/upgrade | 17 +++++++---------- 3 files changed, 9 insertions(+), 33 deletions(-) diff --git a/manifest.json b/manifest.json index 4727dd0..4b7e237 100755 --- a/manifest.json +++ b/manifest.json @@ -13,7 +13,7 @@ "name": "Eric Forgeot" }, "requirements": { - "yunohost": ">= 3.8.1" + "yunohost": ">= 4.1.7" }, "multi_instance": true, "services": [ @@ -25,38 +25,22 @@ { "name": "domain", "type": "domain", - "ask": { - "en": "Choose a domain name for Lionwiki", - "fr": "Choisissez un nom de domaine pour Lionwiki" - }, "example": "domain.org" }, { "name": "path", "type": "path", - "ask": { - "en": "Choose a path for Lionwiki", - "fr": "Choisissez un chemin pour Lionwiki" - }, "example": "/lionwiki", "default": "/lionwiki" }, { "name": "admin", "type": "user", - "ask": { - "en": "Choose an admin user", - "fr": "Choisissez l'administrateur" - }, "example": "johndoe" }, { "name": "is_public", "type": "boolean", - "ask": { - "en": "Is it a public application?", - "fr": "Est-ce une application publique ?" - }, "help": { "en": "If it's not public, only SSO registered users will be able to user it.", "fr": "Si ce n'est pas public, seuls les utilisateurs enregistrés sur le SSO pourront l'utiliser." @@ -76,10 +60,6 @@ { "name": "password", "type": "password", - "ask": { - "en": "Set the password for edition", - "fr": "Définissez le mot de passe pour l'édition" - }, "help": { "en": "Define a password which will be used for wiki edition and administration.", "fr": "Veuillez définir un mot de passe qui sera valable pour l'édition des pages de ce wiki ainsi que pour l'administration." diff --git a/scripts/install b/scripts/install index 738fde9..db02e8b 100755 --- a/scripts/install +++ b/scripts/install @@ -54,7 +54,6 @@ ynh_script_progression --message="Storing installation settings..." --weight=1 ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=admin --value=$admin -ynh_app_setting_set --app=$app --key=is_public --value=$is_public ynh_app_setting_set --app=$app --key=language --value=$language #================================================= @@ -203,7 +202,7 @@ find $final_path/templates/minimaxing/minimaxing.css -type f -print0 | xargs -0 #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring SSOwat..." --weight=1 +ynh_script_progression --message="Configuring permissions..." --weight=1 # Make app public if necessary or protect it if [ $is_public -eq 1 ] diff --git a/scripts/upgrade b/scripts/upgrade index 73b3273..3248c95 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -19,7 +19,6 @@ 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) -is_public=$(ynh_app_setting_get --app=$app --key=is_public) final_path=$(ynh_app_setting_get --app=$app --key=final_path) language=$(ynh_app_setting_get --app=$app --key=language) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) @@ -35,21 +34,19 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 -# Fix is_public as a boolean value -if [ "$is_public" = "Yes" ]; then - ynh_app_setting_set --app=$app --key=is_public --value=1 - is_public=1 -elif [ "$is_public" = "No" ]; then - ynh_app_setting_set --app=$app --key=is_public --value=0 - is_public=0 -fi - # If final_path doesn't exist, create it if [ -z "$final_path" ]; then final_path=/var/www/$app ynh_app_setting_set --app=$app --key=final_path --value=$final_path fi +# 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 #=================================================