From 912f538ca60d1b16cedaa0c0baca4547511adc9f Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 26 Jan 2021 09:17:31 +0100 Subject: [PATCH] Update install --- scripts/install | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/scripts/install b/scripts/install index 42ca451..7b2ba22 100644 --- a/scripts/install +++ b/scripts/install @@ -120,27 +120,21 @@ ynh_replace_string "^\$enabled = false;" "\$enabled = true;" "$final_path/script ynh_replace_string "__admin__" "$admin" ../conf/admin.sql ynh_replace_string "__admin_pwd__" "$admin_password" ../conf/admin.sql -# Set the app as temporarily public for curl call -ynh_print_info "Configuring SSOwat..." -ynh_app_setting_set $app skipped_uris "/" -# Reload SSOwat config -yunohost app ssowatconf +#================================================= +# SETUP APPLICATION WITH CURL +#================================================= -# Reload Nginx -systemctl reload nginx +# Set the app as temporarily public for cURL call +ynh_permission_update --permission "main" --add "visitors" -# Installation with curl -ynh_print_info "Finalizing installation..." +# Reload NGINX +ynh_systemd_action --service_name=nginx --action=reload + +ynh_script_progression --message="Finalizing installation..." ynh_local_curl "/scripts/setup.php" "command=setup" -# Remove the public access -if [ $is_public -eq 0 ] -then - ynh_app_setting_delete $app skipped_uris -fi - #Add the admin account to the database ynh_mysql_connect_as "$db_name" "$db_pwd" "$db_name" < "../conf/admin.sql" #Disable setup for security @@ -167,10 +161,10 @@ chown -R $app: $final_path #================================================= ynh_script_progression --message="Configuring permissions..." -# Make app public if necessary -if [ $is_public -eq 1 ] +# Make app public if necessary or protect it +if [ $is_public -eq 0 ] then - ynh_permission_update --permission="main" --add="visitors" + ynh_permission_update --permission "main" --remove "visitors" fi #================================================= @@ -178,7 +172,7 @@ fi #================================================= ynh_script_progression --message="Reloading nginx web server..." -systemctl reload nginx +ynh_systemd_action --service_name=nginx --action=reload #================================================= # SEND A README FOR THE ADMIN