From 899e73c5748a5db4837dedad6c03669ca9e56a98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 16 Mar 2021 08:34:49 +0100 Subject: [PATCH] Testing (#16) * Small fixes --- manifest.json | 16 ++-------------- scripts/install | 3 +-- scripts/upgrade | 17 +++++++---------- 3 files changed, 10 insertions(+), 26 deletions(-) diff --git a/manifest.json b/manifest.json index d1ac0aa..0871e45 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "2048 game clone in 3D", "fr": "Clone du jeu 2048 en 3D" }, - "version": "1.0~ynh4", + "version": "1.0~ynh5", "url": "https://github.com/Kshitij-Banerjee/Cubiks-2048/", "license": "MIT", "maintainer": { @@ -14,7 +14,7 @@ "email": "" }, "requirements": { - "yunohost": ">= 4.0.0" + "yunohost": ">= 4.1.7" }, "multi_instance": true, "services": [ @@ -25,29 +25,17 @@ { "name": "domain", "type": "domain", - "ask": { - "en": "Choose a domain for Cubiks 2048", - "fr": "Choisissez un nom de domaine pour Cubiks 2048" - }, "example": "domain.org" }, { "name": "path", "type": "path", - "ask": { - "en": "Choose a path for Cubiks 2048", - "fr": "Choisissez un chemin pour Cubiks 2048" - }, "example": "/cubiks-2048", "default": "/cubiks-2048" }, { "name": "is_public", "type": "boolean", - "ask": { - "en": "Is it a public game?", - "fr": "Est-ce un jeu public ?" - }, "help": { "en": "If enabled, Cubiks 2048 will be accessible by people who doesn’t have an account. This can be changed later via the webadmin.", "fr": "Si cette case est cochée, Cubiks 2048 sera accessible aux personnes n’ayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin." diff --git a/scripts/install b/scripts/install index 702eff3..3562d6a 100755 --- a/scripts/install +++ b/scripts/install @@ -45,7 +45,6 @@ ynh_script_progression --message="Storing installation settings..." --weight=2 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=is_public --value=$is_public #================================================= # STANDARD MODIFICATIONS @@ -79,7 +78,7 @@ chown -R root: $final_path #================================================= # 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 [ $is_public -eq 0 ] || ynh_permission_update --permission="main" --add="visitors" diff --git a/scripts/upgrade b/scripts/upgrade index 8dbc35e..2ef3a47 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -17,7 +17,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) -is_public=$(ynh_app_setting_get --app=$app --key=is_public) final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= @@ -31,21 +30,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 #=================================================