From c8a72c8ffc0680454dd8e970c66e67e27ef5302d Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 17 Feb 2021 10:44:01 +0100 Subject: [PATCH] Update install --- scripts/install | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/install b/scripts/install index 2902c96..63de718 100644 --- a/scripts/install +++ b/scripts/install @@ -65,8 +65,9 @@ ynh_install_app_dependencies "$pkg_dependencies" ynh_script_progression --message="Creating a MySQL database..." db_name=$(ynh_sanitize_dbid --db_name=$app) +db_user=$db_name ynh_app_setting_set --app=$app --key=db_name --value=$db_name -ynh_mysql_setup_db --db_user=$db_name --db_name=$db_name +ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -138,7 +139,7 @@ ynh_secure_remove --file="$tmpdir" ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 # Create a dedicated PHP-FPM config -ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION +ynh_add_fpm_config phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= @@ -146,11 +147,10 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= ynh_script_progression --message="Installing Piwigo with cURL..." --weight=5 -ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" -# Reload SSOwat config -yunohost app ssowatconf +# Set the app as temporarily public for cURL call +ynh_permission_update --permission="main" --add="visitors" -# Reload Nginx +# Reload NGINX ynh_systemd_action --service_name=nginx --action=reload # Generate random password for admin @@ -163,10 +163,10 @@ else applanguage="en_UK" fi -# Configure piwigo via curl +# Configure Piwigo via cURL mail="$(ynh_user_get_info --username=$admin --key=mail)" -# Installation with curl +# Installation with cURL ynh_local_curl "/install.php?language=$applanguage" "install=true" "dbuser=$db_name" "dbpasswd=$db_pwd" "dbname=$db_name" "admin_name=$admin" "admin_pass1=$adm_pwd" "admin_pass2=$adm_pwd" "admin_mail=$mail" #================================================= @@ -234,9 +234,9 @@ ynh_add_fail2ban_config --logpath="/var/log/${app}FailedLogins.log" --failregex= ynh_script_progression --message="Configuring permissions..." # Make app public if necessary -if [ $is_public -eq 1 ] +if [ $is_public -eq 0 ] then - ynh_permission_update --permission="main" --add="visitors" + ynh_permission_update --permission="main" --remove="visitors" fi #=================================================