From 9e4e1f212a1965a465d12c04bdc91fb4681b7a6f Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Mon, 15 Mar 2021 00:28:03 +0100 Subject: [PATCH 1/5] [autopatch] Autopatch to migrate to new permission system --- scripts/install | 3 ++- scripts/upgrade | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 11d001d..c75e6ad 100755 --- a/scripts/install +++ b/scripts/install @@ -245,8 +245,9 @@ ynh_add_fail2ban_config --logpath="$final_path/php.log" --failregex="^.*auth\.ph # SETUP SSOWAT #================================================= ynh_script_progression --message="Configuring SSOwat..." +ynh_permission_update --permission="main" --add="visitors" # As Zap is social network and have its own permission there is no need to keep Zap behind SSO -ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" + #================================================= # RELOAD NGINX diff --git a/scripts/upgrade b/scripts/upgrade index 59b2638..af50054 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -49,6 +49,16 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors +#================================================= +# Migrate legacy permissions to new system +#================================================= +if ynh_legacy_permissions_exists +then + ynh_legacy_permissions_delete_all + + ynh_app_setting_delete --app=$app --key=is_public +fi + #================================================= # STANDARD UPGRADE STEPS From e017c342f9bd809d39439de24e0aa522bf09cfb6 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sun, 6 Jun 2021 19:40:20 +0200 Subject: [PATCH 2/5] Fix linter warning, no need for sudo --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 62e4233..b21e9bf 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -38,7 +38,7 @@ ynh_smart_mktemp () { ynh_die "Insufficient free space to continue..." fi - echo "$(sudo mktemp --directory --tmpdir="$tmpdir")" + echo "$(mktemp --directory --tmpdir="$tmpdir")" } #================================================= # FUTURE OFFICIAL HELPERS From 651890efe0d37218988564ed454617db29b68650 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sun, 6 Jun 2021 19:41:38 +0200 Subject: [PATCH 3/5] New permission system --- scripts/upgrade | 7 ------- 1 file changed, 7 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index af50054..8bd4596 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -218,13 +218,6 @@ if [ $database -eq 2 ]; then ynh_install_app_dependencies $pkg_dependencies fi -#================================================= -# SETUP SSOWAT -#================================================= -# As Zap is social network and have its own permission there is no need to keep Zap behind SSO -ynh_script_progression --message="Upgrading SSOwat configuration..." -ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" - #================================================= # RELOAD NGINX #================================================= From f3adb527d5b6bd860f0abb941e7fbe4ac4f9e519 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sun, 6 Jun 2021 19:42:17 +0200 Subject: [PATCH 4/5] New permission system --- scripts/restore | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/restore b/scripts/restore index 5f8af87..49c0376 100755 --- a/scripts/restore +++ b/scripts/restore @@ -125,9 +125,6 @@ ynh_restore_file "/etc/fail2ban/jail.d/$app.conf" ynh_restore_file "/etc/fail2ban/filter.d/$app.conf" ynh_systemd_action --action=restart --service_name=fail2ban -# Make app public -ynh_app_setting_set $app skipped_uris "/" - #================================================= # GENERIC FINALIZATION #================================================= From 839e43c6b1634b45d65e67bee780c699f74ef3ec Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sun, 6 Jun 2021 19:44:30 +0200 Subject: [PATCH 5/5] Bump yunohost requirement to 4.1, remove unecessary ask strings --- manifest.json | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/manifest.json b/manifest.json index bc99930..120fc66 100644 --- a/manifest.json +++ b/manifest.json @@ -12,7 +12,7 @@ "name": "" }, "requirements": { - "yunohost": ">= 4.0.0" + "yunohost": ">= 4.1.0" }, "multi_instance": true, "services": [ @@ -26,18 +26,14 @@ { "name": "domain", "type": "domain", - "ask": { - "en": "Choose a domain for your ZAP hub. ZAP must run in the root of this domain. It means no other app can be accessed/run from this domain. We advise to use a dedicated subdomain such as zap.domain.tld", - "fr": "Indiquez un domain pour ZAP. ZAP doit être installé à la racine du domaine. Cela implique qu'aucune autre app ne pourra être installée ou accessible sur ce domain. Nous conseillons un sous-domaine dédié par exemple zap.domain.tld." + "help": { + "en": "ZAP must run in the root of this domain. It means no other app can be accessed/run from this domain. We advise to use a dedicated subdomain such as zap.domain.tld", + "fr": "ZAP doit être installé à la racine du domaine. Cela implique qu'aucune autre app ne pourra être installée ou accessible sur ce domain. Nous conseillons un sous-domaine dédié par exemple zap.domain.tld." } }, { "name": "admin", - "type": "user", - "ask": { - "en": "Choose the ZAP administrator (must be an existing YunoHost user)", - "fr": "Choisissez l'administrateur de ZAP (doit être un utilisateur YunoHost existant)" - } + "type": "user" }, { "name": "database",