From 4e519ee3a1eda894d7a7711da24f2ddd81f8617f Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 15 Mar 2021 11:40:34 +0100 Subject: [PATCH] new permissions --- README_fr.md | 2 +- manifest.json | 14 +------------- scripts/install | 7 ++----- scripts/upgrade | 17 +++++++---------- 4 files changed, 11 insertions(+), 29 deletions(-) diff --git a/README_fr.md b/README_fr.md index 379f5b4..0b54714 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,7 +1,7 @@ # WemaWema pour YunoHost [![Integration level](https://dash.yunohost.org/integration/wemawema.svg)](https://dash.yunohost.org/appci/app/wemawema) ![](https://ci-apps.yunohost.org/ci/badges/wemawema.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/wemawema.maintain.svg) -[![Installer WemaWema avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=wemawema) +[![Installer WemaWema avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=wemawema) *[Read this readme in english.](./README.md)* diff --git a/manifest.json b/manifest.json index 4d93b78..0c7d8a4 100644 --- a/manifest.json +++ b/manifest.json @@ -15,7 +15,7 @@ "url": "https://fiat-tux.fr" }, "requirements": { - "yunohost": ">> 3.8.1" + "yunohost": ">> 4.1.7" }, "multi_instance": true, "services": [ @@ -26,29 +26,17 @@ { "name": "domain", "type": "domain", - "ask": { - "en": "Choose a domain name for WemaWema", - "fr": "Choisissez un nom de domaine pour WemaWema" - }, "example": "domain.org" }, { "name": "path", "type": "path", - "ask": { - "en": "Choose a path for WemaWema", - "fr": "Choisissez un chemin pour WemaWema" - }, "example": "/wemawema", "default": "/wemawema" }, { "name": "is_public", "type": "boolean", - "ask": { - "en": "Is it a public application?", - "fr": "Est-ce une application publique ?" - }, "help": { "en": "If enabled, WemaWema will be accessible by people who do not have an account. This can be changed later via the webadmin.", "fr": "Si cette case est cochée, WemaWema 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 190a1dd..bfaf8d2 100755 --- a/scripts/install +++ b/scripts/install @@ -44,7 +44,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=is_public --value=$is_public #================================================= # STANDARD MODIFICATIONS @@ -77,14 +76,12 @@ chown -R www-data: $final_path #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring SSOwat..." --weight=2 +ynh_script_progression --message="Configuring permissions..." --weight=2 # Make app public if necessary or protect it if [ $is_public -eq 1 ] then - # Everyone can access the app. - # The "main" permission is automatically created before the install script. - ynh_permission_update --permission "main" --add "visitors" + ynh_permission_update --permission="main" --add="visitors" fi #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 60916a3..91f795c 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -18,7 +18,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) #================================================= @@ -32,21 +31,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 is_public 1 - is_public=1 -elif [ "$is_public" = "No" ]; then - ynh_app_setting_set $app is_public 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 final_path $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 #=================================================