diff --git a/scripts/install b/scripts/install index d1fe1ce..fed6e32 100755 --- a/scripts/install +++ b/scripts/install @@ -52,7 +52,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=admin --value=$admin -ynh_app_setting_set --app=$app --key=is_public --value=$is_public ynh_app_setting_set --app=$app --key=language --value=$language #================================================= @@ -125,7 +124,7 @@ chown -R $app: $final_path # Set the app as temporarily public for curl call ynh_script_progression --message="Configuring SSOwat..." --weight=1 -ynh_app_setting_set --app=$app --key=skipped_uris --value="/" + # Reload SSOwat config yunohost app ssowatconf @@ -137,7 +136,7 @@ ynh_script_progression --message="Finalizing installation..." --weight=2 ynh_local_curl "/signIn" "username=$admin" "password=$password" "repeatPassword=$password" # Remove the public access -ynh_app_setting_delete --app=$app --key=skipped_uris + #================================================= # STORE THE CONFIG FILE CHECKSUM @@ -156,13 +155,12 @@ ynh_replace_string --match_string="isMediaPathModified = true" --replace_string= #================================================= ynh_script_progression --message="Configuring SSOwat..." --weight=1 + + # Make app public if necessary -if [ $is_public -eq 1 ] +if [ "$is_public" -eq 1 ] then - # unprotected_uris allows SSO credentials to be passed anyway. - ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" - # protect the admin panel - ynh_app_setting_set --app=$app --key=protected_uris --value="/admin" + ynh_permission_update --permission="main" --add="visitors" fi #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 23a587a..cc31531 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -63,6 +63,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 + #================================================= # CHECK THE PATH #=================================================