1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/hubzilla_ynh.git synced 2024-09-03 19:26:21 +02:00

Merge pull request #76 from YunoHost-Apps/testing

[autopatch] Autopatch to migrate to new permission system
This commit is contained in:
Alexandre Aubin 2021-06-06 19:37:59 +02:00 committed by GitHub
commit 8ad57cef7e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 13 deletions

View file

@ -246,7 +246,8 @@ ynh_add_fail2ban_config --logpath="$final_path/php.log" --failregex="^.*auth\.ph
#================================================= #=================================================
# As Hubzilla is social network and have its own permission there is no need to keep Hubzilla behind SSO # As Hubzilla is social network and have its own permission there is no need to keep Hubzilla behind SSO
ynh_script_progression --message="Configuring SSOwat..." ynh_script_progression --message="Configuring SSOwat..."
ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" ynh_permission_update --permission="main" --add="visitors"
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX

View file

@ -125,9 +125,6 @@ ynh_restore_file "/etc/fail2ban/jail.d/$app.conf"
ynh_restore_file "/etc/fail2ban/filter.d/$app.conf" ynh_restore_file "/etc/fail2ban/filter.d/$app.conf"
ynh_systemd_action --action=restart --service_name=fail2ban ynh_systemd_action --action=restart --service_name=fail2ban
# Make app public
ynh_app_setting_set $app skipped_uris "/"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
#================================================= #=================================================

View file

@ -49,6 +49,16 @@ ynh_clean_setup () {
# Exit if an error occurs during the execution of the script # Exit if an error occurs during the execution of the script
ynh_abort_if_errors 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 # STANDARD UPGRADE STEPS
#================================================= #=================================================
@ -56,8 +66,6 @@ ynh_abort_if_errors
#================================================= #=================================================
ynh_print_info "Upgrading source files..." ynh_print_info "Upgrading source files..."
# If final_path doesn't exist, create it # If final_path doesn't exist, create it
if [ -z "$final_path" ]; then if [ -z "$final_path" ]; then
final_path=/var/www/$app final_path=/var/www/$app
@ -215,13 +223,6 @@ if [ "$is_version_less_then_five" -eq 1 ] && [ -f "$final_path/util/z6convert.ph
popd popd
fi fi
#=================================================
# SETUP SSOWAT
#=================================================
# As Hubzilla is social network and have its own permission there is no need to keep Hubzilla behind SSO
ynh_script_progression --message="Upgrading SSOwat configuration..."
ynh_app_setting_set --app=$app --key=unprotected_uris --value="/"
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================