1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/dolibarr_ynh.git synced 2024-09-03 18:35:53 +02:00
This commit is contained in:
Éric Gaspar 2023-10-02 12:44:23 +02:00
parent 984bd027c3
commit debbeb08e1
4 changed files with 8 additions and 76 deletions

View file

@ -67,11 +67,6 @@ ynh_script_progression --message="Configuring PHP-FPM" --weight=2
# Create a dedicated php-fpm config
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Configuring NGINX web server..." --weight=1
# Create a dedicated nginx config
ynh_add_nginx_config

View file

@ -17,34 +17,12 @@ ynh_script_progression --message="Removing NGINX web server configuration..." --
# Remove the dedicated nginx config
ynh_remove_nginx_config
#=================================================
# REMOVE PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=1
# Remove the dedicated php-fpm config
ynh_remove_fpm_config
# Delete old static pool.d conf
old_php_version=7.0
if [ -f /etc/php/$old_php_version/fpm/pool.d/$app.conf ]; then
ynh_secure_remove --file=/etc/php/$old_php_version/fpm/pool.d/$app.conf
fi
#=================================================
# REMOVE LOGROTATE CONFIGURATION
#=================================================
ynh_script_progression --message="Removing logrotate configuration..." --weight=1
# Remove the app-specific logrotate config
ynh_remove_logrotate
#=================================================
# SPECIFIC REMOVE
#=================================================
# REMOVE APP FOLDERS
#=================================================
# Remove a directory securely
ynh_secure_remove --file="/etc/$app"

View file

@ -17,6 +17,13 @@ ynh_script_progression --message="Restoring the app main directory..." --weight=
ynh_restore_file --origin_path="$install_dir"
#=================================================
# RESTORE THE MYSQL DATABASE
#=================================================
ynh_script_progression --message="Restoring the MySQL database..." --weight=27
ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql
#=================================================
# RESTORE THE PHP-FPM CONFIGURATION
#=================================================
@ -26,26 +33,10 @@ ynh_print_info --message="Reconfiguring PHP-FPM..."
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
# Recreate a dedicated php-fpm config
ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# RESTORE THE MYSQL DATABASE
#=================================================
ynh_script_progression --message="Restoring the MySQL database..." --weight=27
ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql
#=================================================
# RESTORE THE LOGROTATE CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
#=================================================

View file

@ -40,46 +40,14 @@ if [ -z "${fpm_usage:-}" ]; then
ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage
fi
# Delete existing ini configuration file (backward compatibility)
if [ -f /etc/php/$YNH_PHP_VERSION/fpm/conf.d/20-$app.ini ]; then
ynh_secure_remove --file=/etc/php/$YNH_PHP_VERSION/fpm/conf.d/20-$app.ini
fi
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1
ynh_backup_if_checksum_is_different --file="/etc/nginx/conf.d/$domain.d/$app.conf"
# Delete current NGINX configuration to be able to check if .well-known is already served.
ynh_remove_nginx_config
ynh_app_setting_delete --app=$app --key="checksum__etc_nginx_conf.d_$domain.d_$app.conf"
# Wait untils NGINX has fully reloaded
ynh_systemd_action --service_name=nginx --action=reload --line_match="Reloaded" --log_path="systemd"
# Create a dedicated nginx config
ynh_add_nginx_config
#=================================================
# PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2
# If php has changed, remove the old fpm config file
# if [ "$phpversion" != $YNH_PHP_VERSION ]
# then
# ynh_backup_if_checksum_is_different --file="/etc/php/$phpversion/fpm/pool.d/$app.conf"
# ynh_secure_remove --file="/etc/php/$phpversion/fpm/pool.d/$app.conf"
# if [ -f /etc/php/$phpversion/fpm/conf.d/20-$app.ini ]; then
# ynh_secure_remove --file="/etc/php/$phpversion/fpm/conf.d/20-$app.ini"
# fi
# ynh_systemd_action --service_name="php${phpversion}-fpm" --action=reload
# phpversion="$YNH_PHP_VERSION"
# fi
# Recreate a dedicated PHP-FPM config
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint