From 9be09c076d4ff83442464d95a52e97f2668ba754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 15 Mar 2021 22:39:25 +0100 Subject: [PATCH] Testing (#8) * Fix linter warning --- manifest.json | 18 +++--------------- scripts/install | 1 - scripts/upgrade | 17 +++++++---------- 3 files changed, 10 insertions(+), 26 deletions(-) diff --git a/manifest.json b/manifest.json index 2b6c25b..2c61f2e 100644 --- a/manifest.json +++ b/manifest.json @@ -6,48 +6,36 @@ "en": "Système de gestion de contenu (CMS) for simple website", "fr": "Content management system (CMS) pour un site simple" }, - "version": "0.8.16~ynh3", + "version": "0.8.16~ynh4", "url": "https://datenstrom.se/yellow/", "license": "GPL-2.0-only", "maintainer": { "name": "eric_G" }, "requirements": { - "yunohost": ">> 4.0.0" + "yunohost": ">> 4.1.7" }, "multi_instance": true, "services": [ "nginx", - "php7.0-fpm" + "php7.3-fpm" ], "arguments": { "install" : [ { "name": "domain", "type": "domain", - "ask": { - "en": "Choose a domain name for Yellow", - "fr": "Choisissez un nom de domaine pour Yellow" - }, "example": "example.com" }, { "name": "path", "type": "path", - "ask": { - "en": "Choose a path for Yellow", - "fr": "Choisissez un chemin pour Yellow" - }, "example": "/example", "default": "/yellow" }, { "name": "is_public", "type": "boolean", - "ask": { - "en": "Is it a public application?", - "fr": "Est-ce une application publique ?" - }, "help": { "en": "If enabled, Yellow 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, Yellow 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 7375c06..c31a459 100644 --- 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 #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE diff --git a/scripts/upgrade b/scripts/upgrade index 9fb082a..a54c3fc 100644 --- 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) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) @@ -33,21 +32,19 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=2 -# 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 #=================================================