diff --git a/README.md b/README.md index 3871c8d..307dc7f 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to ## Overview Free and open-source content management framework. -**Shipped version:** 8.8.1 +**Shipped version:** 8.8.4 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 0fb7e87..11c0fc2 100644 --- a/README_fr.md +++ b/README_fr.md @@ -11,7 +11,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour ## Vue d'ensemble Framework de gestion de contenu libre et open-source. -**Version incluse:** 8.8.1 +**Version incluse:** 8.8.4 ## Captures d'écran diff --git a/check_process b/check_process index 27e721c..5050ccd 100644 --- a/check_process +++ b/check_process @@ -15,7 +15,8 @@ setup_private=1 setup_public=1 upgrade=1 - upgrade=1 from_commit=f0af5b7a8e58615fe8ad73e3c1d6fe8d1369f061 + # 8.7.1 + # upgrade=1 from_commit=f0af5b7a8e58615fe8ad73e3c1d6fe8d1369f061 backup_restore=1 multi_instance=1 # This test is no longer necessary since the version 2.7 (PR: https://github.com/YunoHost/yunohost/pull/304), you can still do it if your app could be installed with this version. diff --git a/conf/nginx.conf b/conf/nginx.conf index 93d374c..dd58121 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -58,7 +58,7 @@ location __PATH__/ { location ~ '[^/]\.php$|^/update.php' { fastcgi_split_path_info ^(.+?\.php)(/.*)$; - fastcgi_pass unix:/var/run/php/php7.2-fpm-__NAME__.sock; + fastcgi_pass unix:/var/run/php/php7.3-fpm-__NAME__.sock; fastcgi_index index.php; include fastcgi_params; diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf index a7b230f..4b682a3 100644 --- a/conf/php-fpm.conf +++ b/conf/php-fpm.conf @@ -33,7 +33,7 @@ group = __USER__ ; (IPv6 and IPv4-mapped) on a specific port; ; '/path/to/unix/socket' - to listen on a unix socket. ; Note: This value is mandatory. -listen = /var/run/php/php7.2-fpm-__NAMETOCHANGE__.sock +listen = /var/run/php/php7.3-fpm-__NAMETOCHANGE__.sock ; Set listen(2) backlog. ; Default Value: 511 (-1 on FreeBSD and OpenBSD) diff --git a/manifest.json b/manifest.json index 55c630f..cd5f170 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "A content management framework written in PHP", "fr": "Un système de gestion de contenu écrit en PHP" }, - "version": "8.8.1~ynh1", + "version": "8.8.4~ynh1", "url": "https://www.drupal.org", "license": "GPL-2.0-or-later", "maintainer": { diff --git a/scripts/_common.sh b/scripts/_common.sh index 4ef113c..e03392b 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -7,7 +7,7 @@ # dependencies used by the app pkg_dependencies="curl" -extra_pkg_dependencies="php7.2-fpm php7.2-cli php7.2-gd php7.2-mysql php7.2-xml php7.2-ldap php7.2-mbstring php7.2-json php7.2-simplexml php7.2-curl" +extra_pkg_dependencies="php7.3-fpm php7.3-cli php7.3-gd php7.3-mysql php7.3-xml php7.3-ldap php7.3-mbstring php7.3-json php7.3-simplexml php7.3-curl" #================================================= # PERSONAL HELPERS diff --git a/scripts/backup b/scripts/backup index 015da10..688b099 100644 --- a/scripts/backup +++ b/scripts/backup @@ -53,7 +53,7 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= ynh_print_info --message="Backing up php-fpm configuration..." -ynh_backup --src_path="/etc/php/7.2/fpm/pool.d/$app.conf" +ynh_backup --src_path="/etc/php/7.3/fpm/pool.d/$app.conf" #================================================= # BACKUP THE MYSQL DATABASE diff --git a/scripts/change_url b/scripts/change_url index b8abe7f..aef7dc5 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -106,12 +106,13 @@ fi #================================================= ynh_print_info --message="Updating Drush alias..." -cp -f "../conf/example.site.yml" "$final_path/drush/sites/$app.site.yml" +drush_aliasconfig="$final_path/drush/sites/$app.site.yml" +cp -f "../conf/example.site.yml" "$drush_aliasconfig" -ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="$final_path/drush/sites/$app.site.yml" -ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/drush/sites/$app.site.yml" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/drush/sites/$app.site.yml" -ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="$final_path/drush/sites/$app.site.yml" +ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="$drush_aliasconfig" +ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$drush_aliasconfig" +ynh_replace_string --match_string="__DOMAIN__" --replace_string="$new_domain" --target_file="$drush_aliasconfig" +ynh_replace_string --match_string="__PATH_URL__" --replace_string="$new_path" --target_file="$drush_aliasconfig" #================================================= # GENERIC FINALISATION diff --git a/scripts/install b/scripts/install index 333658b..00bb993 100644 --- a/scripts/install +++ b/scripts/install @@ -65,6 +65,17 @@ ynh_app_setting_set --app=$app --key=install_profil --value=$install_profil #================================================= # STANDARD MODIFICATIONS +#================================================= +# INSTALL PHP7.3 +#================================================= + +if [ "$(lsb_release --codename --short)" = "buster" ]; then + pkg_dependencies="$pkg_dependencies $extra_pkg_dependencies" +else + ynh_print_info --message="Installing PHP7.3..." + ynh_install_php --phpversion="7.3" --package="$extra_pkg_dependencies" +fi + #================================================= # INSTALL DEPENDENCIES #================================================= @@ -72,13 +83,6 @@ ynh_print_info --message="Installing dependencies..." ynh_install_app_dependencies $pkg_dependencies -#================================================= -# INSTALL PHP -#================================================= -ynh_print_info --message="Installing PHP..." - -ynh_install_php --phpversion="7.2" --package="$extra_pkg_dependencies" - #================================================= # CREATE A MYSQL DATABASE #================================================= @@ -117,7 +121,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # SPECIFIC SETUP #================================================= -# ADD SWAPP +# ADD SWAP #================================================= ynh_print_info --message="Adding swap..." @@ -129,13 +133,13 @@ ynh_add_swap --size=512 ynh_print_info --message="Creating Drush alias..." mkdir -p "$final_path/drush/sites/" +drush_aliasconfig="$final_path/drush/sites/$app.site.yml" +cp -f "../conf/example.site.yml" "$drush_aliasconfig" -cp -f "../conf/example.site.yml" "$final_path/drush/sites/$app.site.yml" - -ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="$final_path/drush/sites/$app.site.yml" -ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/drush/sites/$app.site.yml" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/drush/sites/$app.site.yml" -ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="$final_path/drush/sites/$app.site.yml" +ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="$drush_aliasconfig" +ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$drush_aliasconfig" +ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$drush_aliasconfig" +ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="$drush_aliasconfig" #================================================= # INSTALL COMPOSER @@ -147,7 +151,7 @@ mkdir -p "$final_path/.composer" cp -f "../conf/composer.json" "$final_path/composer.json" ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/composer.json" -ynh_install_composer --phpversion="7.2" --workdir="$final_path" +ynh_install_composer --phpversion="7.3" --workdir="$final_path" export PATH="$final_path/vendor/bin:$PATH" @@ -158,16 +162,18 @@ ynh_print_info --message="Installing Drupal..." chown -R $app: $final_path -pushd "$final_path" - update-alternatives --set php /usr/bin/php7.2 +update-alternatives --set php /usr/bin/php7.3 + +pushd "$final_path" sudo -u $app env PATH=$PATH drush site:install $install_profil --account-name=$admin --account-pass=$password --account-mail=$admin_mail --db-url=mysql://$db_user:$db_pwd@localhost/$db_name --site-name="$app" --locale=$language --yes - update-alternatives --set php /usr/bin/php7.0 popd +update-alternatives --set php /usr/bin/php7.0 + #================================================= -# SET THE CRON FILE +# SETUP THE CRON FILE #================================================= -ynh_print_info --message="Setting the cron file..." +ynh_print_info --message="Setuping the cron file..." cp ../conf/cron /etc/cron.d/$app @@ -190,7 +196,7 @@ ynh_store_file_checksum --file="$final_path/$app/sites/default/settings.php" ynh_print_info --message="Configuring php-fpm..." # Create a dedicated php-fpm config -ynh_add_fpm_config --phpversion="7.2" +ynh_add_fpm_config --phpversion="7.3" #================================================= # SECURE FILES AND DIRECTORIES diff --git a/scripts/remove b/scripts/remove index d20c553..79d2db6 100644 --- a/scripts/remove +++ b/scripts/remove @@ -20,7 +20,6 @@ ynh_print_info --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) -port=$(ynh_app_setting_get --app=$app --key=port) db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_user=$db_name final_path=$(ynh_app_setting_get --app=$app --key=final_path) @@ -43,6 +42,14 @@ ynh_print_info --message="Removing php-fpm configuration..." # Remove the dedicated php-fpm config ynh_remove_fpm_config +#================================================= +# REMOVE PHP +#================================================= + +if [ "$(lsb_release --codename --short)" != "buster" ]; then + ynh_print_info --message="Removing php..." + ynh_remove_php +fi #================================================= # REMOVE DEPENDENCIES #================================================= @@ -50,7 +57,6 @@ ynh_print_info --message="Removing dependencies..." # Remove metapackage and its dependencies ynh_remove_app_dependencies -ynh_remove_php #================================================= # REMOVE APP MAIN DIR @@ -69,7 +75,7 @@ ynh_print_info --message="Removing nginx web server configuration..." ynh_remove_nginx_config #================================================= -# REMOVE SWAPP +# REMOVE SWAP #================================================= ynh_print_info --message="Removing swap..." diff --git a/scripts/restore b/scripts/restore index 530ab41..ef098fa 100644 --- a/scripts/restore +++ b/scripts/restore @@ -81,6 +81,17 @@ chown -R $app: $final_path #================================================= # SPECIFIC RESTORATION +#================================================= +# REINSTALL PHP7.3 +#================================================= + +if [ "$(lsb_release --codename --short)" = "buster" ]; then + pkg_dependencies="$pkg_dependencies $extra_pkg_dependencies" +else + ynh_print_info --message="Reinstalling PHP7.3..." + ynh_install_php --phpversion="7.3" --package="$extra_pkg_dependencies" +fi + #================================================= # REINSTALL DEPENDENCIES #================================================= @@ -88,7 +99,6 @@ ynh_print_info --message="Reinstalling dependencies..." # Define and install dependencies ynh_install_app_dependencies $pkg_dependencies -ynh_install_php --phpversion="7.2" --package="$extra_pkg_dependencies" #================================================= # RESTORE THE MYSQL DATABASE @@ -104,7 +114,7 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./ #================================================= ynh_print_info --message="Restoring PHP-FPM configuration..." -ynh_restore_file --origin_path="/etc/php/7.2/fpm/pool.d/$app.conf" +ynh_restore_file --origin_path="/etc/php/7.3/fpm/pool.d/$app.conf" #================================================= # RESTORE THE CRON FILE @@ -113,7 +123,7 @@ ynh_restore_file --origin_path="/etc/php/7.2/fpm/pool.d/$app.conf" ynh_restore_file --origin_path="/etc/cron.d/$app" #================================================= -# ADD SWAPP +# ADD SWAP #================================================= ynh_print_info --message="Adding swap..." @@ -126,7 +136,7 @@ ynh_add_swap --size=512 #================================================= ynh_print_info --message="Reloading nginx web server and php-fpm..." -ynh_systemd_action --service_name=php7.2-fpm --action=reload +ynh_systemd_action --service_name=php7.3-fpm --action=reload ynh_systemd_action --service_name=nginx --action=reload #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index f5b73af..4de149f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -85,13 +85,30 @@ ynh_print_info --message="Upgrading nginx web server configuration..." # Create a dedicated nginx config ynh_add_nginx_config +#================================================= +# UPGRADE PHP7.3 +#================================================= + +if [ "$(lsb_release --codename --short)" = "buster" ]; then + pkg_dependencies="$pkg_dependencies $extra_pkg_dependencies" +else + if [ "$(ynh_app_setting_get --app=$app --key=php_version)" != "7.3" ]; then + ynh_print_info --message="Upgrading PHP7.3..." + ynh_remove_fpm_config + ynh_remove_app_dependencies + ynh_remove_php + ynh_install_php --phpversion="7.3" --package="$extra_pkg_dependencies" + else + ynh_install_php --phpversion="7.3" --package="$extra_pkg_dependencies" + fi +fi + #================================================= # UPGRADE DEPENDENCIES #================================================= ynh_print_info --message="Upgrading dependencies..." ynh_install_app_dependencies $pkg_dependencies -ynh_install_php --phpversion="7.2" --package="$extra_pkg_dependencies" #================================================= # CREATE DEDICATED USER @@ -107,12 +124,12 @@ ynh_system_user_create --username=$app --home_dir="$final_path" ynh_print_info --message="Upgrading php-fpm configuration..." # Create a dedicated php-fpm config -ynh_add_fpm_config --phpversion="7.2" +ynh_add_fpm_config --phpversion="7.3" #================================================= # SPECIFIC UPGRADE #================================================= -# ADD SWAPP +# ADD SWAP #================================================= ynh_print_info --message="Adding swap..." @@ -123,8 +140,8 @@ ynh_add_swap --size=512 #================================================= ynh_print_info --message="Upgrading Composer..." -update-alternatives --set php /usr/bin/php7.2 -ynh_install_composer --phpversion="7.2" --workdir="$final_path" +update-alternatives --set php /usr/bin/php7.3 +ynh_install_composer --phpversion="7.3" --workdir="$final_path" update-alternatives --set php /usr/bin/php7.0 #================================================= @@ -141,17 +158,19 @@ export PATH="$final_path/vendor/bin:$PATH" #sudo -u $app env PATH=$PATH drush @$app.prod l10n-update-refresh #sudo -u $app env PATH=$PATH drush @$app.prod l10n-update +update-alternatives --set php /usr/bin/php7.3 + pushd "$final_path" - update-alternatives --set php /usr/bin/php7.2 sudo -u $app env PATH=$PATH drush @$app.prod state:set system.maintenance_mode 1 --input-format=integer - sudo -u $app env PATH=$PATH php7.2 composer.phar update drupal/core webflo/drupal-core-require-dev --with-dependencies - sudo -u $app env PATH=$PATH php7.2 composer.phar update --with-dependencies + sudo -u $app env PATH=$PATH php7.3 composer.phar update drupal/core webflo/drupal-core-require-dev --with-dependencies + sudo -u $app env PATH=$PATH php7.3 composer.phar update --with-dependencies sudo -u $app env PATH=$PATH drush @$app.prod -y updatedb sudo -u $app env PATH=$PATH drush @$app.prod cache:rebuild sudo -u $app env PATH=$PATH drush @$app.prod state:set system.maintenance_mode 0 --input-format=integer - update-alternatives --set php /usr/bin/php7.0 popd +update-alternatives --set php /usr/bin/php7.0 + #================================================= # STORE THE CONFIG FILE CHECKSUM #================================================= @@ -161,9 +180,9 @@ ynh_print_info --message="Storing the config file checksum..." ynh_store_file_checksum --file="$final_path/$app/sites/default/settings.php" #================================================= -# SET THE CRON FILE +# SETUP THE CRON FILE #================================================= -ynh_print_info --message="Setting the cron file" +ynh_print_info --message="Setuping the cron file" cp -f ../conf/cron /etc/cron.d/$app