mirror of
https://github.com/YunoHost-Apps/dolibarr_ynh.git
synced 2024-09-03 18:35:53 +02:00
cleaning
This commit is contained in:
parent
984bd027c3
commit
debbeb08e1
4 changed files with 8 additions and 76 deletions
|
@ -67,11 +67,6 @@ ynh_script_progression --message="Configuring PHP-FPM" --weight=2
|
||||||
# Create a dedicated php-fpm config
|
# Create a dedicated php-fpm config
|
||||||
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint
|
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
|
# Create a dedicated nginx config
|
||||||
ynh_add_nginx_config
|
ynh_add_nginx_config
|
||||||
|
|
||||||
|
|
|
@ -17,34 +17,12 @@ ynh_script_progression --message="Removing NGINX web server configuration..." --
|
||||||
# Remove the dedicated nginx config
|
# Remove the dedicated nginx config
|
||||||
ynh_remove_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
|
# Remove the dedicated php-fpm config
|
||||||
ynh_remove_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
|
# Remove the app-specific logrotate config
|
||||||
ynh_remove_logrotate
|
ynh_remove_logrotate
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SPECIFIC REMOVE
|
|
||||||
#=================================================
|
|
||||||
# REMOVE APP FOLDERS
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
# Remove a directory securely
|
# Remove a directory securely
|
||||||
ynh_secure_remove --file="/etc/$app"
|
ynh_secure_remove --file="/etc/$app"
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,13 @@ ynh_script_progression --message="Restoring the app main directory..." --weight=
|
||||||
|
|
||||||
ynh_restore_file --origin_path="$install_dir"
|
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
|
# 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"
|
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 --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint
|
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# RESTORE THE NGINX CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
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"
|
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -40,46 +40,14 @@ if [ -z "${fpm_usage:-}" ]; then
|
||||||
ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage
|
ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage
|
||||||
fi
|
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
|
# NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1
|
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
|
# Create a dedicated nginx config
|
||||||
ynh_add_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
|
# Recreate a dedicated PHP-FPM config
|
||||||
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint
|
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue