diff --git a/README.md b/README.md index fff618e..0a1a67f 100644 --- a/README.md +++ b/README.md @@ -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. -**Shipped version:** 5.9.3~ynh2 +**Shipped version:** 6.0.1~ynh1 + ## Screenshots @@ -61,7 +62,7 @@ Furthermore, you might take a look at the [Hardening Wordpress Guide](https://wo * Official app website: * Official admin documentation: -* Upstream app code repository: +* Upstream app code repository: * YunoHost documentation for this app: * Report a bug: diff --git a/README_fr.md b/README_fr.md index 1687550..71ca6b9 100644 --- a/README_fr.md +++ b/README_fr.md @@ -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). -**Version incluse :** 5.9.3~ynh2 +**Version incluse :** 6.0.1~ynh1 + ## Captures d'écran @@ -61,7 +62,7 @@ Par ailleurs, vous pourriez avoir besoin de regarder [ce guide](https://wordpres * Site officiel de l'app : * Documentation officielle de l'admin : -* Dépôt de code officiel de l'app : +* Dépôt de code officiel de l'app : * Documentation YunoHost pour cette app : * Signaler un bug : diff --git a/YEP.md b/YEP.md deleted file mode 100644 index 1ed6cc4..0000000 --- a/YEP.md +++ /dev/null @@ -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 d’un 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`. diff --git a/conf/app.src b/conf/app.src index b92b923..5b815df 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://wordpress.org/wordpress-5.9.3.tar.gz -SOURCE_SUM=70cbea5d72decfb129f4cc8e6c3d0175ea64bec68e97961b6db0377278a52a56 +SOURCE_URL=https://wordpress.org/wordpress-6.0.1.tar.gz +SOURCE_SUM=f678596804aa89d7cdc9280862938464eab25aeaebfefa91ae175e15aa3ef054 SOURCE_SUM_PRG=sha256sum ARCH_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/wp-config.php b/conf/wp-config.php index 12c8c7e..1419cb6 100644 --- a/conf/wp-config.php +++ b/conf/wp-config.php @@ -2,71 +2,70 @@ /** * The base configuration for WordPress * - * The wp-config.php creation script uses this file during the - * installation. You don't have to use the web site, you can - * copy this file to "wp-config.php" and fill in the values. + * The wp-config.php creation script uses this file during the installation. + * You don't have to use the web site, you can copy this file to "wp-config.php" + * and fill in the values. * * This file contains the following configurations: * - * * MySQL settings + * * Database settings * * Secret keys * * Database table prefix * * ABSPATH * - * @link https://codex.wordpress.org/Editing_wp-config.php + * @link https://wordpress.org/support/article/editing-wp-config-php/ * * @package WordPress -*/ + */ -/** Disable the wordress cron because it's managed by the system */ -define('DISABLE_WP_CRON', true); - -// ** MySQL settings - You can get this info from your web host ** // +// ** Database settings - You can get this info from your web host ** // /** The name of the database for WordPress */ -define('DB_NAME', '__DB_USER__'); +define( 'DB_NAME', '__DB_NAME__' ); -/** MySQL database username */ -define('DB_USER', '__DB_USER__'); +/** Database username */ +define( 'DB_USER', '__DB_USER__' ); -/** MySQL database password */ -define('DB_PASSWORD', '__DB_PWD__'); +/** Database password */ +define( 'DB_PASSWORD', '__DB_PWD__' ); -/** MySQL hostname */ -define('DB_HOST', 'localhost'); +/** Database hostname */ +define( 'DB_HOST', 'localhost' ); -/** Database Charset to use in creating database tables. */ -define('DB_CHARSET', 'utf8'); +/** Database charset to use in creating database tables. */ +define( 'DB_CHARSET', 'utf8' ); -/** The Database Collate type. Don't change this if in doubt. */ -define('DB_COLLATE', ''); +/** The database collate type. Don't change this if in doubt. */ +define( 'DB_COLLATE', '' ); /**#@+ - * Authentication Unique Keys and Salts. + * Authentication unique keys and salts. * - * Change these to different unique phrases! - * You can generate these using 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. + * Change these to different unique phrases! You can generate these using + * 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. * * @since 2.6.0 -*/ -define('AUTH_KEY', 'KEY1'); -define('SECURE_AUTH_KEY', 'KEY2'); -define('LOGGED_IN_KEY', 'KEY3'); -define('NONCE_KEY', 'KEY4'); -define('AUTH_SALT', 'KEY5'); -define('SECURE_AUTH_SALT', 'KEY6'); -define('LOGGED_IN_SALT', 'KEY7'); -define('NONCE_SALT', 'KEY8'); + */ +define( 'AUTH_KEY', 'KEY1' ); +define( 'SECURE_AUTH_KEY', 'KEY2' ); +define( 'LOGGED_IN_KEY', 'KEY3' ); +define( 'NONCE_KEY', 'KEY4' ); +define( 'AUTH_SALT', 'KEY5' ); +define( 'SECURE_AUTH_SALT', 'KEY6' ); +define( 'LOGGED_IN_SALT', 'KEY7' ); +define( 'NONCE_SALT', 'KEY8' ); /**#@-*/ /** - * WordPress Database Table prefix. + * WordPress database table prefix. * * You can have multiple installations in one database if you give each * a unique prefix. Only numbers, letters, and underscores please! -*/ -$table_prefix = 'wp_'; + */ +$table_prefix = 'wp_'; /** * For developers: WordPress debugging mode. @@ -76,20 +75,22 @@ $table_prefix = 'wp_'; * in their development environments. * * 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 -*/ -define('WP_DEBUG', false); + * @link https://wordpress.org/support/article/debugging-in-wordpress/ + */ +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. */ -if ( !defined('ABSPATH') ) - define('ABSPATH', dirname(__FILE__) . '/'); +if ( ! defined( 'ABSPATH' ) ) { + define( 'ABSPATH', __DIR__ . '/' ); +} /** Sets up WordPress vars and included files. */ -require_once(ABSPATH . 'wp-settings.php'); - -// Force https redirect -//--PUBLIC--define('FORCE_SSL_ADMIN', true); +require_once ABSPATH . 'wp-settings.php'; diff --git a/config_panel.toml.example b/config_panel.toml.example index 07f014d..5104992 100644 --- a/config_panel.toml.example +++ b/config_panel.toml.example @@ -1,4 +1,4 @@ -version = "0.1" +version = "1.0" name = "Wordpress configuration panel" [main] diff --git a/manifest.json b/manifest.json index eb1ac09..edf27f3 100644 --- a/manifest.json +++ b/manifest.json @@ -6,13 +6,14 @@ "en": "Create a beautiful blog or website easily", "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/", "upstream": { "license": "GPL-2.0", "website": "https://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", "maintainer": { @@ -24,12 +25,12 @@ "email": "maniackc_dev@crudelis.fr" }], "requirements": { - "yunohost": ">= 4.3.0" + "yunohost": ">= 11.0.9" }, "multi_instance": true, "services": [ "nginx", - "php7.3-fpm", + "php8.0-fpm", "mysql" ], "arguments": { diff --git a/scripts/_common.sh b/scripts/_common.sh index 4404f4b..4c9ef61 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,9 +4,9 @@ # 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 diff --git a/scripts/install b/scripts/install index 0e5f1ca..55f9189 100644 --- a/scripts/install +++ b/scripts/install @@ -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=admin_mail_html --value=1 +#================================================= +# INSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Installing dependencies..." --weight=5 + +ynh_install_app_dependencies $pkg_dependencies + #================================================= # STANDARD MODIFICATIONS #================================================= @@ -72,7 +79,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # 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_user=$db_name @@ -109,7 +116,7 @@ else usage=high fi # 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) #================================================= @@ -117,12 +124,11 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # 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 -ynh_replace_string --match_string="__DB_USER__" --replace_string=$db_name --target_file=$final_path/wp-config.php -ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file=$final_path/wp-config.php +dir=__DIR__ +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 do diff --git a/scripts/remove b/scripts/remove index 7b77c2c..64f0739 100755 --- a/scripts/remove +++ b/scripts/remove @@ -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 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 #================================================= -ynh_script_progression --message="Removing app main directory..." +ynh_script_progression --message="Removing app main directory..." --weight=2 # Remove the app directory securely ynh_secure_remove --file="$final_path" @@ -42,7 +50,7 @@ ynh_secure_remove --file="$final_path" #================================================= # 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 ynh_remove_nginx_config @@ -68,7 +76,7 @@ ynh_remove_fail2ban_config #================================================= # REMOVE VARIOUS FILES #================================================= -ynh_script_progression --message="Removing various files..." +ynh_script_progression --message="Removing various files..." --weight=1 # Remove a cron file ynh_secure_remove --file="/etc/cron.d/$app" diff --git a/scripts/restore b/scripts/restore index 8e26dde..b25d172 100644 --- a/scripts/restore +++ b/scripts/restore @@ -38,7 +38,7 @@ fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) #================================================= # 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 \ || ynh_die --message="There is already a directory: $final_path " @@ -46,19 +46,12 @@ test ! -d $final_path \ #================================================= # ACTIVATE MAINTENANCE MODE #================================================= -ynh_script_progression --message="Activating maintenance mode..." +ynh_script_progression --message="Activating maintenance mode..." --weight=1 ynh_maintenance_mode_ON #================================================= # 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 #================================================= @@ -70,7 +63,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # 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" @@ -88,17 +81,6 @@ setfacl -Rm d:g:www-data:rwX "$final_path/wp-content/temp" chmod 400 "$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 #================================================= @@ -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_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 #================================================= @@ -120,7 +128,7 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./ #================================================= # 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" diff --git a/scripts/upgrade b/scripts/upgrade index 0e773d2..128cb03 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -36,7 +36,6 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # CHECK VERSION #================================================= -ynh_script_progression --message="Checking version..." upgrade_type=$(ynh_check_app_version_changed) @@ -195,6 +194,13 @@ then ynh_add_nginx_config fi +#================================================= +# UPGRADE DEPENDENCIES +#================================================= +ynh_script_progression --message="Upgrading dependencies..." --weight=5 + +ynh_install_app_dependencies $pkg_dependencies + #================================================= # PHP-FPM CONFIGURATION #================================================= @@ -204,7 +210,7 @@ if [ $overwrite_phpfpm -eq 1 ] then ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=4 # 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 #=================================================