diff --git a/conf/nginx.conf b/conf/nginx.conf index 99858c5..bf94072 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -22,7 +22,7 @@ location __PATH__/ { fastcgi_param SCRIPT_FILENAME $request_filename; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param REMOTE_USER $remote_user; - fastcgi_pass unix:/var/run/php__PHPVERSION__-fpm-__NAME__.sock; + fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; fastcgi_intercept_errors on; } diff --git a/scripts/_common.sh b/scripts/_common.sh index f4fd644..c4fe893 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -7,7 +7,7 @@ YNH_PHP_VERSION="7.3" # dependencies used by the app -pkg_dependencies="php$YNH_DEFAULT_PHP_VERSION-cli php$YNH_DEFAULT_PHP_VERSION-mysql php$YNH_DEFAULT_PHP_VERSION-json php$YNH_DEFAULT_PHP_VERSION-gd php$YNH_DEFAULT_PHP_VERSION-tidy php$YNH_DEFAULT_PHP_VERSION-curl php$YNH_DEFAULT_PHP_VERSION-gettext php$YNH_DEFAULT_PHP_VERSION-redis" +extra_php_dependencies="php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-tidy php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-gettext php${YNH_PHP_VERSION}-redis" #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index 3b9ef15..79bc401 100644 --- a/scripts/install +++ b/scripts/install @@ -47,15 +47,6 @@ ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=admin --value=$admin -#================================================= -# STANDARD MODIFICATIONS -#================================================= -# INSTALL DEPENDENCIES -#================================================= -ynh_script_progression --message="Installing dependencies..." --weight=12 - -ynh_install_app_dependencies $pkg_dependencies - #================================================= # CREATE A MYSQL DATABASE #================================================= @@ -97,7 +88,8 @@ ynh_add_nginx_config ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 # Create a dedicated php-fpm config -ynh_add_fpm_config +ynh_add_fpm_config --package="$extra_php_dependencies" +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # SPECIFIC SETUP diff --git a/scripts/remove b/scripts/remove index 5e48f41..195457f 100644 --- a/scripts/remove +++ b/scripts/remove @@ -31,14 +31,6 @@ ynh_script_progression --message="Removing the MySQL database" --weight=2 # Remove a database if it exists, along with the associated user ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name -#================================================= -# REMOVE DEPENDENCIES -#================================================= -ynh_script_progression --message="Removing dependencies" --weight=9 - -# Remove metapackage and its dependencies -ynh_remove_app_dependencies - #================================================= # REMOVE APP MAIN DIR #================================================= diff --git a/scripts/restore b/scripts/restore index 27c5321..267f2b6 100644 --- a/scripts/restore +++ b/scripts/restore @@ -26,6 +26,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_user=$db_name phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) @@ -84,19 +85,12 @@ ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weig ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" -#================================================= -# SPECIFIC RESTORATION -#================================================= -# REINSTALL DEPENDENCIES -#================================================= -ynh_script_progression --message="Reinstalling dependencies..." --weight=15 - -# Define and install dependencies -ynh_install_app_dependencies $pkg_dependencies +ynh_add_fpm_config --package="$extra_php_dependencies" #================================================= # RESTORE FAIL2BAN CONFIGURATION #================================================= + ynh_restore_file "/etc/fail2ban/jail.d/$app.conf" ynh_restore_file "/etc/fail2ban/filter.d/$app.conf" diff --git a/scripts/upgrade b/scripts/upgrade index 5d83bd7..d20bd3d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -54,8 +54,8 @@ if [ -z "$path_url" ]; then ynh_app_setting_set --app=$app --key=path --value=$path_url fi -# Cleaning legacy permissions -if ynh_legacy_permissions_exists; then +if ynh_legacy_permissions_exists +then ynh_legacy_permissions_delete_all ynh_app_setting_delete --app=$app --key=is_public @@ -104,7 +104,7 @@ fi #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading nginx web server configuration..." +ynh_script_progression --message="Upgrading NGINX web server configuration..." # Create a dedicated nginx config ynh_add_nginx_config @@ -122,7 +122,7 @@ ynh_install_app_dependencies $pkg_dependencies ynh_script_progression --message="Upgrading php-fpm configuration..." # Create a dedicated php-fpm config -ynh_add_fpm_config +ynh_add_fpm_config --package="$extra_php_dependencies" # Set-up fail2ban # Create the log file is not already existing @@ -197,7 +197,7 @@ ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_fil #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload