1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/my_webapp_ynh.git synced 2024-09-03 19:46:26 +02:00

Drop 'overwrite' nginx/phpfpm conf settings

This commit is contained in:
Alexandre Aubin 2021-05-24 19:05:33 +02:00
parent a6a44ad39e
commit 2c1ecd06de
4 changed files with 6 additions and 55 deletions

View file

@ -18,22 +18,6 @@ name = "My webapp configuration"
optional = true
help = "If a password already exist, it will not be replaced."
[main.overwrite_files]
name = "Overwriting config files"
[main.overwrite_files.overwrite_nginx]
ask = "Overwrite the NGINX config file?"
type = "boolean"
default = false
help = "If the file is overwritten, a backup will be created."
[main.overwrite_files.overwrite_phpfpm]
ask = "Overwrite the PHP-FPM config file?"
type = "boolean"
default = true
help = "If the file is overwritten, a backup will be created."
[main.php_fpm_config]
name = "PHP-FPM configuration"

View file

@ -45,15 +45,6 @@ else
fi
# Overwrite NGINX configuration
old_overwrite_nginx="$(ynh_app_setting_get --app=$app --key=overwrite_nginx)"
overwrite_nginx="${YNH_CONFIG_MAIN_OVERWRITE_FILES_OVERWRITE_NGINX:-$old_overwrite_nginx}"
# Overwrite PHP-FPM configuration
old_overwrite_phpfpm="$(ynh_app_setting_get --app=$app --key=overwrite_phpfpm)"
overwrite_phpfpm="${YNH_CONFIG_MAIN_OVERWRITE_FILES_OVERWRITE_PHPFPM:-$old_overwrite_phpfpm}"
# Footprint for PHP-FPM
old_fpm_footprint="$(ynh_app_setting_get --app=$app --key=fpm_footprint)"
fpm_footprint="${YNH_CONFIG_MAIN_PHP_FPM_CONFIG_FOOTPRINT:-$old_fpm_footprint}"

View file

@ -53,8 +53,6 @@ ynh_app_setting_set --app=$app --key=with_mysql --value=$with_mysql
ynh_app_setting_set --app=$app --key=with_sftp --value=$with_sftp
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
ynh_app_setting_set --app=$app --key=overwrite_nginx --value=0
ynh_app_setting_set --app=$app --key=overwrite_phpfpm --value=1
ynh_app_setting_set --app=$app --key=admin_mail_html --value=1
#=================================================

View file

@ -24,8 +24,6 @@ with_mysql=$(ynh_app_setting_get --app=$app --key=with_mysql)
with_sftp=$(ynh_app_setting_get --app=$app --key=with_sftp)
password=$(ynh_app_setting_get --app=$app --key=password)
overwrite_nginx=$(ynh_app_setting_get --app=$app --key=overwrite_nginx)
overwrite_phpfpm=$(ynh_app_setting_get --app=$app --key=overwrite_phpfpm)
admin_mail_html=$(ynh_app_setting_get --app=$app --key=admin_mail_html)
fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint)
@ -61,18 +59,6 @@ if [ -z "$final_path" ]; then
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
fi
# If overwrite_nginx doesn't exist, create it
if [ -z "$overwrite_nginx" ]; then
overwrite_nginx=0
ynh_app_setting_set --app=$app --key=overwrite_nginx --value=$overwrite_nginx
fi
# If overwrite_phpfpm doesn't exist, create it
if [ -z "$overwrite_phpfpm" ]; then
overwrite_phpfpm=1
ynh_app_setting_set --app=$app --key=overwrite_phpfpm --value=$overwrite_phpfpm
fi
# If admin_mail_html doesn't exist, create it
if [ -z "$admin_mail_html" ]; then
admin_mail_html=1
@ -131,14 +117,10 @@ ynh_maintenance_mode_ON
# NGINX CONFIGURATION
#=================================================
# Overwrite the NGINX configuration only if it's allowed
if [ $overwrite_nginx -eq 1 ]
then
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2
# Create a dedicated NGINX config
ynh_add_nginx_config
fi
# Create a dedicated NGINX config
ynh_add_nginx_config
#=================================================
# CREATE DEDICATED USER
@ -168,14 +150,10 @@ usermod -g "$app" "$app"
# PHP-FPM CONFIGURATION
#=================================================
# Overwrite the PHP-FPM configuration only if it's allowed
if [ $overwrite_phpfpm -eq 1 ]
then
ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2
ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2
# Create a dedicated PHP-FPM config
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint
fi
# Create a dedicated PHP-FPM config
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint
#=================================================
# SPECIFIC UPGRADE