diff --git a/conf/nginx.conf b/conf/nginx.conf index 2ffae27c..8002a299 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -10,7 +10,7 @@ location __PATH__/ { client_max_body_size 20m; client_body_buffer_size 128k; - index index.php; + index index.php; charset utf-8; diff --git a/manifest.json b/manifest.json index 68d0f035..6fa162ac 100644 --- a/manifest.json +++ b/manifest.json @@ -23,8 +23,7 @@ "services": [ "nginx", "php8.0-fpm", - "mysql", - "postgresql" + "mysql" ], "previous_maintainers": { "name": "Andrew Manning", diff --git a/scripts/install b/scripts/install index b5bdf4c0..3b168222 100755 --- a/scripts/install +++ b/scripts/install @@ -151,6 +151,7 @@ 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_user --db_name=$db_name + ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" < $final_path/install/schema_mysql.sql #================================================= diff --git a/scripts/restore b/scripts/restore index 075b6a0e..5bfb2ed0 100644 --- a/scripts/restore +++ b/scripts/restore @@ -95,7 +95,7 @@ ynh_script_progression --message="Restoring PHP-FPM configuration..." --weight=1 ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" -# Recreate a dedicated php-fpm config +# Recreate a dedicated PHP-FPM config ynh_add_fpm_config #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 2c40b9be..48925f61 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." +ynh_script_progression --message="Loading installation settings..." --weight=1 app=$YNH_APP_INSTANCE_NAME @@ -27,7 +27,7 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." +ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1 # Backup the current version of the app ynh_backup_before_upgrade @@ -65,7 +65,7 @@ fi #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." +ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 # Create a dedicated user (if not existing) ynh_system_user_create --username=$app --home_dir="$final_path" @@ -75,7 +75,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Upgrading source files..." +ynh_script_progression --message="Upgrading source files..." --weight=5 if [ `cd $final_path && git rev-parse --is-inside-work-tree` ]; then pushd "$final_path" @@ -143,7 +143,7 @@ chown -R $app:www-data "$final_path" #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." +ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config @@ -172,7 +172,7 @@ ynh_store_file_checksum --file="$final_path/.htconfig.php" #================================================= # SETUP LOGROTATE #================================================= -ynh_script_progression --message="Upgrading logrotate configuration..." +ynh_script_progression --message="Upgrading logrotate configuration..." --weight=1 # Use logrotate to manage app-specific logfile(s) ynh_use_logrotate --non-append @@ -180,14 +180,14 @@ ynh_use_logrotate --non-append #================================================= # UPGRADE FAIL2BAN #================================================= -ynh_script_progression --message="Re-configure Fail2Ban..." +ynh_script_progression --message="Re-configure Fail2Ban..." --weight=1 ynh_add_fail2ban_config --logpath="$final_path/php.log" --failregex="^.*auth\.php.*failed login attempt.*from IP .*$" --max_retry="5" #================================================= # UPGRADE CRON #================================================= -ynh_script_progression --message="Re-configure CRON..." +ynh_script_progression --message="Re-configure CRON..." --weight=1 # Set up cron job ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" @@ -197,7 +197,7 @@ chmod 644 "/etc/cron.d/$app" #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload @@ -205,4 +205,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of $app completed" +ynh_script_progression --message="Upgrade of $app completed" --last