diff --git a/manifest.json b/manifest.json index c578ce2..0f3bf0d 100644 --- a/manifest.json +++ b/manifest.json @@ -21,7 +21,7 @@ "email": "jean-baptiste@holcroft.fr" }], "requirements": { - "yunohost": ">= 3.8.1" + "yunohost": ">= 4.1" }, "multi_instance": true, "services": [ diff --git a/scripts/experimental_helper.sh b/scripts/experimental_helper.sh index dc680bf..9c71494 100644 --- a/scripts/experimental_helper.sh +++ b/scripts/experimental_helper.sh @@ -124,3 +124,9 @@ ynh_remove_uwsgi_service () { ynh_secure_remove --file="/etc/systemd/system/uwsgi-app@$app.service.d" fi } + +ynh_restore_uwsgi_service () { + ynh_check_global_uwsgi_config + systemctl enable "uwsgi-app@$app" --quiet + yunohost service add "uwsgi-app@$app" --log "/var/log/uwsgi/$app/$app.log" +} diff --git a/scripts/install b/scripts/install index 0ba638a..090abd6 100644 --- a/scripts/install +++ b/scripts/install @@ -133,7 +133,7 @@ set_permissions ynh_script_progression --message="Configuring permissions" # accessible by everyone (authentification is done by firefox accounts) -ynh_app_setting_set --app=$app --key=skipped_uris --value="/" +ynh_permission_update --permission=main --add=visitors --protected=true --show_tile=true #================================================= # RELOAD Services diff --git a/scripts/restore b/scripts/restore index 39f4023..56004b5 100644 --- a/scripts/restore +++ b/scripts/restore @@ -83,9 +83,7 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./ ynh_script_progression --message="Reloading services..." --weight=3 -ynh_check_global_uwsgi_config -systemctl enable "uwsgi-app@$app" --quiet -yunohost service add "uwsgi-app@$app" --log "/var/log/uwsgi/$app/$app.log" +ynh_restore_uwsgi_service #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index 69a52c1..6736e53 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -155,10 +155,17 @@ ynh_script_progression --message="Securing files and directories..." set_permissions #================================================= -# SETUP SSOWAT +# Migrate legacy permissions to new system #================================================= -ynh_app_setting_set --app=$app --key=skipped_uris --value="/" +ynh_script_progression --message="Set permissions..." +if ynh_legacy_permissions_exists +then + ynh_legacy_permissions_delete_all + ynh_app_setting_delete --app=$app --key=is_public +fi +ynh_permission_update --permission=main --add=visitors --protected=true --show_tile=true + ynh_script_progression --message="Restarting $app services..." --weight=3 ynh_systemd_action --service_name "uwsgi-app@$app.service" \