1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/wordpress_ynh.git synced 2024-09-03 20:36:10 +02:00

Merge pull request #178 from YunoHost-Apps/6.0

6.0.1
This commit is contained in:
Éric Gaspar 2022-08-29 22:47:59 +02:00 committed by GitHub
commit 186012b7d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 126 additions and 211 deletions

View file

@ -19,7 +19,8 @@ WordPress is open source software you can use to create a beautiful website, blo
With this package, you can even activate the [multisite](https://wordpress.org/support/article/glossary/#multisite) option. With this package, you can even activate the [multisite](https://wordpress.org/support/article/glossary/#multisite) option.
**Shipped version:** 5.9.3~ynh2 **Shipped version:** 6.0.1~ynh1
## Screenshots ## Screenshots

View file

@ -19,7 +19,8 @@ WordPress est un logiciel libre que vous pouvez utiliser pour créer un site ou
Avec ce package, vous pouvez même activer l'option [multisite](https://codex.wordpress.org/Glossary#Multisite). Avec ce package, vous pouvez même activer l'option [multisite](https://codex.wordpress.org/Glossary#Multisite).
**Version incluse :** 5.9.3~ynh2 **Version incluse :** 6.0.1~ynh1
## Captures d'écran ## Captures d'écran

117
YEP.md
View file

@ -1,117 +0,0 @@
#### [Level 0](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-0)
[YEP 1.1 - Nommer son app et son dépot](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-11)
`Validated`
[YEP 1.2 - Inscrire l'app sur un "répertoire" connu](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-12)
`Validated`
#### [Level 1](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-1)
[YEP 2.2 - Utiliser bash pour les scripts principaux](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-22)
`Validated`
[YEP 2.5 - Copier correctement des fichiers](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-25)
`Don't know`
[YEP 2.7 - Donner des permissions suffisantes aux instructions bash](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-27)
`Validated`
[YEP 2.15 - Suivre les instructions d'installation de l'application](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-215)
`Validated`
#### [Level 2](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-2)
[YEP 1.5 - Mettre à jour régulièrement le statut de l'app](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-11)
`Validated`
[YEP 2.18.2 - Gérer l'installation à la racine dun nom de domaine](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-2182)
`Validated` - *Automatically verified.*
[YEP 2.18.3 - Gérer l'installation sur un sous-domaine](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-2183)
`Validated` - *Automatically verified.*
[YEP 2.18.4 - Gérer l'installation sur un chemin /path](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-2184)
`Validated` - *Automatically verified.*
[YEP 4.6 - Gère le multi-instance](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-11)
`Validated` - *Automatically verified.*
#### [Level 3](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-3)
[YEP 2.3 - Sauvegarder les réponses lors de l'installation](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-23)
`Validated`
#### [Level 4](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-4)
[YEP 4.1 - Lier au ldap](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-41)
`Validated`
[YEP 4.2 - Lier l'authentification au sso](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-42)
`Validated`
#### [Level 5](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-5)
[YEP 1.3 - Indiquer la licence associée au paquet](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-13)
`Validated`
[YEP 2.1 - Respecter le format du manifeste](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-21)
`Validated` - *Automatically verified.*
[YEP 2.12 - Utiliser les commandes pratiques (helpers)](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-212)
`Validated`
[YEP 2.18.1 - Lancer le script d'installation d'une webapp correctement](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-2181)
`Validated`
#### [Level 6](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-6)
[YEP 1.4 - Informer sur l'intention de maintenir un paquet](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-14)
`Validated`
[YEP 1.6 - Se tenir informé sur l'évolution du packaging d'apps](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-16)
`Validated`
[YEP 1.7 - Ajouter l'app à l'organisation YunoHost-Apps](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-17)
`Validated` - *Automatically verified.*
[YEP 1.8 - Publier des demandes de test](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-18)
`Validated`
[YEP 1.9 - Documenter l'app](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-19)
`Validated`
[YEP 1.10 - Garder un historique de version propre](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-110)
`Don't know`
[YEP 2.9 - Enlever toutes traces de l'app lors de la suppression](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-29)
`Validated`
[YEP 3.3 - Faciliter le contrôle de l'intégrité des sources](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-33)
`Validated`
[YEP 3.5 - Suivre les recommendations de la documentation de l'app](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-35)
`Partially validated`
[YEP 3.6 - Mettre à jour les versions contenant des CVE](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-36)
`Validated`
[YEP 4.3 - Fournir un script de sauvegarde YunoHost fonctionnel](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-43)
`Validated` - *Automatically verified.*
[YEP 4.4 - Fournir un script de restauration YunoHost fonctionnel](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-44)
`Validated` - *Automatically verified.*
#### [Level 7](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-7)
[YEP 2.6 - Annuler l'action si les valeurs d'entrées sont incorrectes](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-26)
`Validated`
[YEP 3.2 - Ouvrir un port correctement](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-32)
`Not applicable`
#### [Level 8](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-8)
[YEP 2.4 - Détecter et gérer les erreurs](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-24)
`Validated`
[YEP 2.8 - Modifier correctement une configuration système](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-28)
`Validated`
[YEP 2.16 - Vérifier la disponibilité des dépendances sur ARM, x86 et x64](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-216)
`Not yet validated` - *Automatically verified.*
[YEP 2.18.5 - Gérer la tuile YunoHost pour faciliter la navigation entre les applications](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-2185)
`Validated`
[YEP 3.4 - Isoler l'app](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-34)
`Partially validated`
[YEP 4.5 - Utiliser les hooks](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-45)
`Not applicable`
#### [Level 9](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-9)
[YEP 2.10 - Configurer les logs de l'application](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-210)
`Not applicable`
[YEP 2.11 - Utiliser une variable plutôt que l'app id directement](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-211)
`Validated`
[YEP 2.13 - Traduire le paquet en anglais](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-213)
`Not yet validated`
[YEP 2.14 - Remplir correctement un fichier de conf](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-214)
`Not yet validated`
[YEP 2.17 - Prendre en compte la version d'origine lors des mises à jour](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-217)
`Validated`
[YEP 4.2.1 - Déconnexion](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-421)
`Don't know`
#### Other YEP
[YEP 3.1 - Ne pas demander ou stocker de mot de passe LDAP](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-31)
`Validated`
[YEP 4.7 - Ajouter un module à la CLI](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-47)
`Not applicable`
[YEP 4.8 - Ajouter un module à l'admin web](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-48)
`Not applicable`
State of each YEP can be one of these: `Validated`, `Partially validated`, `Not yet validated`, `Not applicable`, `Don't know`.

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://wordpress.org/wordpress-5.9.3.tar.gz SOURCE_URL=https://wordpress.org/wordpress-6.0.1.tar.gz
SOURCE_SUM=70cbea5d72decfb129f4cc8e6c3d0175ea64bec68e97961b6db0377278a52a56 SOURCE_SUM=f678596804aa89d7cdc9280862938464eab25aeaebfefa91ae175e15aa3ef054
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
ARCH_FORMAT=tar.gz ARCH_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true

View file

@ -2,50 +2,49 @@
/** /**
* The base configuration for WordPress * The base configuration for WordPress
* *
* The wp-config.php creation script uses this file during the * The wp-config.php creation script uses this file during the installation.
* installation. You don't have to use the web site, you can * You don't have to use the web site, you can copy this file to "wp-config.php"
* copy this file to "wp-config.php" and fill in the values. * and fill in the values.
* *
* This file contains the following configurations: * This file contains the following configurations:
* *
* * MySQL settings * * Database settings
* * Secret keys * * Secret keys
* * Database table prefix * * Database table prefix
* * ABSPATH * * ABSPATH
* *
* @link https://codex.wordpress.org/Editing_wp-config.php * @link https://wordpress.org/support/article/editing-wp-config-php/
* *
* @package WordPress * @package WordPress
*/ */
/** Disable the wordress cron because it's managed by the system */ // ** Database settings - You can get this info from your web host ** //
define('DISABLE_WP_CRON', true);
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */ /** The name of the database for WordPress */
define('DB_NAME', '__DB_USER__'); define( 'DB_NAME', '__DB_NAME__' );
/** MySQL database username */ /** Database username */
define( 'DB_USER', '__DB_USER__' ); define( 'DB_USER', '__DB_USER__' );
/** MySQL database password */ /** Database password */
define( 'DB_PASSWORD', '__DB_PWD__' ); define( 'DB_PASSWORD', '__DB_PWD__' );
/** MySQL hostname */ /** Database hostname */
define( 'DB_HOST', 'localhost' ); define( 'DB_HOST', 'localhost' );
/** Database Charset to use in creating database tables. */ /** Database charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8' ); define( 'DB_CHARSET', 'utf8' );
/** The Database Collate type. Don't change this if in doubt. */ /** The database collate type. Don't change this if in doubt. */
define( 'DB_COLLATE', '' ); define( 'DB_COLLATE', '' );
/**#@+ /**#@+
* Authentication Unique Keys and Salts. * Authentication unique keys and salts.
* *
* Change these to different unique phrases! * Change these to different unique phrases! You can generate these using
* You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service} * the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}.
* You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again. *
* You can change these at any point in time to invalidate all existing cookies.
* This will force all users to have to log in again.
* *
* @since 2.6.0 * @since 2.6.0
*/ */
@ -61,7 +60,7 @@ define('NONCE_SALT', 'KEY8');
/**#@-*/ /**#@-*/
/** /**
* WordPress Database Table prefix. * WordPress database table prefix.
* *
* You can have multiple installations in one database if you give each * You can have multiple installations in one database if you give each
* a unique prefix. Only numbers, letters, and underscores please! * a unique prefix. Only numbers, letters, and underscores please!
@ -76,20 +75,22 @@ $table_prefix = 'wp_';
* in their development environments. * in their development environments.
* *
* For information on other constants that can be used for debugging, * For information on other constants that can be used for debugging,
* visit the Codex. * visit the documentation.
* *
* @link https://codex.wordpress.org/Debugging_in_WordPress * @link https://wordpress.org/support/article/debugging-in-wordpress/
*/ */
define( 'WP_DEBUG', false ); define( 'WP_DEBUG', false );
/* That's all, stop editing! Happy blogging. */ /* Add any custom values between this line and the "stop editing" line. */
/* That's all, stop editing! Happy publishing. */
/** Absolute path to the WordPress directory. */ /** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') ) if ( ! defined( 'ABSPATH' ) ) {
define('ABSPATH', dirname(__FILE__) . '/'); define( 'ABSPATH', __DIR__ . '/' );
}
/** Sets up WordPress vars and included files. */ /** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php'); require_once ABSPATH . 'wp-settings.php';
// Force https redirect
//--PUBLIC--define('FORCE_SSL_ADMIN', true);

View file

@ -1,4 +1,4 @@
version = "0.1" version = "1.0"
name = "Wordpress configuration panel" name = "Wordpress configuration panel"
[main] [main]

View file

@ -6,13 +6,14 @@
"en": "Create a beautiful blog or website easily", "en": "Create a beautiful blog or website easily",
"fr": "Logiciel de création de blog ou de site Web" "fr": "Logiciel de création de blog ou de site Web"
}, },
"version": "5.9.3~ynh2", "version": "6.0.1~ynh1",
"url": "https://wordpress.org/", "url": "https://wordpress.org/",
"upstream": { "upstream": {
"license": "GPL-2.0", "license": "GPL-2.0",
"website": "https://wordpress.org/", "website": "https://wordpress.org/",
"admindoc": "https://codex.wordpress.org/", "admindoc": "https://codex.wordpress.org/",
"code": "https://core.trac.wordpress.org/browser " "code": "https://core.trac.wordpress.org/browser",
"cpe": "cpe:2.3:a:wordpress:wordpress"
}, },
"license": "GPL-2.0", "license": "GPL-2.0",
"maintainer": { "maintainer": {
@ -24,12 +25,12 @@
"email": "maniackc_dev@crudelis.fr" "email": "maniackc_dev@crudelis.fr"
}], }],
"requirements": { "requirements": {
"yunohost": ">= 4.3.0" "yunohost": ">= 11.0.9"
}, },
"multi_instance": true, "multi_instance": true,
"services": [ "services": [
"nginx", "nginx",
"php7.3-fpm", "php8.0-fpm",
"mysql" "mysql"
], ],
"arguments": { "arguments": {

View file

@ -4,9 +4,9 @@
# COMMON VARIABLES # COMMON VARIABLES
#================================================= #=================================================
YNH_PHP_VERSION="7.3" YNH_PHP_VERSION="8.0"
extra_php_dependencies="php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-soap php${YNH_PHP_VERSION}-ssh2 php${YNH_PHP_VERSION}-tokenizer php${YNH_PHP_VERSION}-ldap" pkg_dependencies="php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-soap php${YNH_PHP_VERSION}-ssh2 php${YNH_PHP_VERSION}-tokenizer php${YNH_PHP_VERSION}-ldap"
#================================================= #=================================================
# EXPERIMENTAL HELPERS # EXPERIMENTAL HELPERS

View file

@ -59,6 +59,13 @@ ynh_app_setting_set --app=$app --key=overwrite_nginx --value=1
ynh_app_setting_set --app=$app --key=overwrite_phpfpm --value=1 ynh_app_setting_set --app=$app --key=overwrite_phpfpm --value=1
ynh_app_setting_set --app=$app --key=admin_mail_html --value=1 ynh_app_setting_set --app=$app --key=admin_mail_html --value=1
#=================================================
# INSTALL DEPENDENCIES
#=================================================
ynh_script_progression --message="Installing dependencies..." --weight=5
ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
# STANDARD MODIFICATIONS # STANDARD MODIFICATIONS
#================================================= #=================================================
@ -72,7 +79,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
#================================================= #=================================================
# CREATE A MYSQL DATABASE # CREATE A MYSQL DATABASE
#================================================= #=================================================
ynh_script_progression --message="Creating a MySQL database..." ynh_script_progression --message="Creating a MySQL database..." --weight=2
db_name=$(ynh_sanitize_dbid --db_name=$app) db_name=$(ynh_sanitize_dbid --db_name=$app)
db_user=$db_name db_user=$db_name
@ -109,7 +116,7 @@ else
usage=high usage=high
fi fi
# Create a dedicated PHP-FPM config # Create a dedicated PHP-FPM config
ynh_add_fpm_config --usage=$usage --footprint=medium --package="$extra_php_dependencies" ynh_add_fpm_config --usage=$usage --footprint=medium
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#================================================= #=================================================
@ -117,12 +124,11 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#================================================= #=================================================
# CONFIGURE WP-CONFIG # CONFIGURE WP-CONFIG
#================================================= #=================================================
ynh_script_progression --message="Configuring WordPress..." ynh_script_progression --message="Configuring WordPress..." --weight=1
cp ../conf/wp-config.php $final_path/wp-config.php
# Change variables in Wordpress configuration # Change variables in Wordpress configuration
ynh_replace_string --match_string="__DB_USER__" --replace_string=$db_name --target_file=$final_path/wp-config.php dir=__DIR__
ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file=$final_path/wp-config.php ynh_add_config --template="../conf/wp-config.php" --destination="$final_path/wp-config.php"
for i in 1 2 3 4 5 6 7 8 for i in 1 2 3 4 5 6 7 8
do do

View file

@ -31,10 +31,18 @@ ynh_script_progression --message="Removing the MySQL database..." --weight=2
# Remove a database if it exists, along with the associated user # Remove a database if it exists, along with the associated user
ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name
#=================================================
# REMOVE DEPENDENCIES
#=================================================
ynh_script_progression --message="Removing dependencies..." --weight=4
# Remove metapackage and its dependencies
ynh_remove_app_dependencies
#================================================= #=================================================
# REMOVE APP MAIN DIR # REMOVE APP MAIN DIR
#================================================= #=================================================
ynh_script_progression --message="Removing app main directory..." ynh_script_progression --message="Removing app main directory..." --weight=2
# Remove the app directory securely # Remove the app directory securely
ynh_secure_remove --file="$final_path" ynh_secure_remove --file="$final_path"
@ -42,7 +50,7 @@ ynh_secure_remove --file="$final_path"
#================================================= #=================================================
# REMOVE NGINX CONFIGURATION # REMOVE NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Removing NGINX web server configuration..." ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1
# Remove the dedicated NGINX config # Remove the dedicated NGINX config
ynh_remove_nginx_config ynh_remove_nginx_config
@ -68,7 +76,7 @@ ynh_remove_fail2ban_config
#================================================= #=================================================
# REMOVE VARIOUS FILES # REMOVE VARIOUS FILES
#================================================= #=================================================
ynh_script_progression --message="Removing various files..." ynh_script_progression --message="Removing various files..." --weight=1
# Remove a cron file # Remove a cron file
ynh_secure_remove --file="/etc/cron.d/$app" ynh_secure_remove --file="/etc/cron.d/$app"

View file

@ -38,7 +38,7 @@ fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage)
#================================================= #=================================================
# CHECK IF THE APP CAN BE RESTORED # CHECK IF THE APP CAN BE RESTORED
#================================================= #=================================================
ynh_script_progression --message="Validating restoration parameters..." ynh_script_progression --message="Validating restoration parameters..." --weight=1
test ! -d $final_path \ test ! -d $final_path \
|| ynh_die --message="There is already a directory: $final_path " || ynh_die --message="There is already a directory: $final_path "
@ -46,19 +46,12 @@ test ! -d $final_path \
#================================================= #=================================================
# ACTIVATE MAINTENANCE MODE # ACTIVATE MAINTENANCE MODE
#================================================= #=================================================
ynh_script_progression --message="Activating maintenance mode..." ynh_script_progression --message="Activating maintenance mode..." --weight=1
ynh_maintenance_mode_ON ynh_maintenance_mode_ON
#================================================= #=================================================
# STANDARD RESTORATION STEPS # STANDARD RESTORATION STEPS
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the NGINX web server configuration..."
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#================================================= #=================================================
# RECREATE THE DEDICATED USER # RECREATE THE DEDICATED USER
#================================================= #=================================================
@ -70,7 +63,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
#================================================= #=================================================
# RESTORE THE APP MAIN DIR # RESTORE THE APP MAIN DIR
#================================================= #=================================================
ynh_script_progression --message="Restoring the app main directory..." ynh_script_progression --message="Restoring the app main directory..." --weight=5
ynh_restore_file --origin_path="$final_path" ynh_restore_file --origin_path="$final_path"
@ -88,17 +81,6 @@ setfacl -Rm d:g:www-data:rwX "$final_path/wp-content/temp"
chmod 400 "$final_path/wp-config.php" chmod 400 "$final_path/wp-config.php"
chown $app:$app "$final_path/wp-config.php" chown $app:$app "$final_path/wp-config.php"
#=================================================
# RESTORE THE PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the PHP-FPM configuration..."
# Restore the file first, so it can have a backup if different
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
# Recreate a dedicated php-fpm config
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --package="$extra_php_dependencies"
#================================================= #=================================================
# RESTORE FAIL2BAN CONFIGURATION # RESTORE FAIL2BAN CONFIGURATION
#================================================= #=================================================
@ -108,6 +90,32 @@ ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf"
ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf" ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf"
ynh_systemd_action --action=restart --service_name=fail2ban ynh_systemd_action --action=restart --service_name=fail2ban
#=================================================
# REINSTALL DEPENDENCIES
#=================================================
ynh_script_progression --message="Reinstalling dependencies..." --weight=5
# Define and install dependencies
ynh_install_app_dependencies $pkg_dependencies
#=================================================
# RESTORE THE PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=2
# Restore the file first, so it can have a backup if different
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
# Recreate a dedicated php-fpm config
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=2
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#================================================= #=================================================
# RESTORE THE MYSQL DATABASE # RESTORE THE MYSQL DATABASE
#================================================= #=================================================
@ -120,7 +128,7 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./
#================================================= #=================================================
# RESTORE VARIOUS FILES # RESTORE VARIOUS FILES
#================================================= #=================================================
ynh_script_progression --message="Restoring various files..." ynh_script_progression --message="Restoring various files..." --weight=1
ynh_restore_file --origin_path="/etc/cron.d/$app" ynh_restore_file --origin_path="/etc/cron.d/$app"

View file

@ -36,7 +36,6 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#================================================= #=================================================
# CHECK VERSION # CHECK VERSION
#================================================= #=================================================
ynh_script_progression --message="Checking version..."
upgrade_type=$(ynh_check_app_version_changed) upgrade_type=$(ynh_check_app_version_changed)
@ -195,6 +194,13 @@ then
ynh_add_nginx_config ynh_add_nginx_config
fi fi
#=================================================
# UPGRADE DEPENDENCIES
#=================================================
ynh_script_progression --message="Upgrading dependencies..." --weight=5
ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
# PHP-FPM CONFIGURATION # PHP-FPM CONFIGURATION
#================================================= #=================================================
@ -204,7 +210,7 @@ if [ $overwrite_phpfpm -eq 1 ]
then then
ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=4 ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=4
# Create a dedicated PHP-FPM config # Create a dedicated PHP-FPM config
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --package="$extra_php_dependencies" ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint
fi fi
#================================================= #=================================================