From 1ad222621192e7e3e34959f4efe91f80d2483f69 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 8 Feb 2022 13:44:14 +0100 Subject: [PATCH 1/8] 1.7.8.3 --- conf/app.src | 4 ++-- manifest.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/app.src b/conf/app.src index 642fb9c..2858c70 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/PrestaShop/PrestaShop/releases/download/1.7.8.1/prestashop_1.7.8.1.zip -SOURCE_SUM=fd375b9aa3452f83a65a03403fa2c38fd6c3bc50ae058ed0467b5a37fd51e7e9 +SOURCE_URL=https://github.com/PrestaShop/PrestaShop/releases/download/1.7.8.3/prestashop_1.7.8.3.zip +SOURCE_SUM=9be5c1bbb12705574f780a86230a0f2c0f459e29f26d44fba4957250650a12ec SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=false diff --git a/manifest.json b/manifest.json index 3434ebe..a3f06de 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Create a E-commerce Website", "fr": "Créer un site ecommerce" }, - "version": "1.7.8.1~ynh1", + "version": "1.7.8.3~ynh1", "url": "https://www.prestashop.com/", "upstream": { "license": "OSL-3.0", From 672ec94ea713aafe3a1f6dc2e0d6f30a54a80b19 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Tue, 8 Feb 2022 12:44:20 +0000 Subject: [PATCH 2/8] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 67f8907..76f5062 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in PrestaShop is an Open Source e-commerce web application, committed to providing the best shopping cart experience for both merchants and customers. It is written in PHP, is highly customizable, supports all the major payment services, is translated in many languages and localized for many countries, has a fully responsive design (both front and back office), etc. -**Shipped version:** 1.7.8.1~ynh1 +**Shipped version:** 1.7.8.3~ynh1 **Demo:** https://demo.prestashop.com/#/en/front diff --git a/README_fr.md b/README_fr.md index d895e29..076b072 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour PrestaShop is an Open Source e-commerce web application, committed to providing the best shopping cart experience for both merchants and customers. It is written in PHP, is highly customizable, supports all the major payment services, is translated in many languages and localized for many countries, has a fully responsive design (both front and back office), etc. -**Version incluse :** 1.7.8.1~ynh1 +**Version incluse :** 1.7.8.3~ynh1 **Démo :** https://demo.prestashop.com/#/en/front From 21bf051a92ee0b3db69b5620d3c2df12b743364a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 8 Feb 2022 13:45:05 +0100 Subject: [PATCH 3/8] Update remove --- scripts/remove | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/remove b/scripts/remove index d602496..dfde978 100644 --- a/scripts/remove +++ b/scripts/remove @@ -30,14 +30,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=1 - -# Remove metapackage and its dependencies -ynh_remove_app_dependencies - #================================================= # REMOVE APP MAIN DIR #================================================= @@ -62,6 +54,14 @@ ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=1 # Remove the dedicated PHP-FPM config ynh_remove_fpm_config +#================================================= +# REMOVE DEPENDENCIES +#================================================= +ynh_script_progression --message="Removing dependencies..." --weight=1 + +# Remove metapackage and its dependencies +ynh_remove_app_dependencies + #================================================= # GENERIC FINALIZATION #================================================= From a2057eb91cda3763f74cfdd1772bd8716dc41d1d Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 8 Feb 2022 14:17:41 +0100 Subject: [PATCH 4/8] Fix --- scripts/install | 1 + scripts/upgrade | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index adc677c..680ad2f 100644 --- a/scripts/install +++ b/scripts/install @@ -23,6 +23,7 @@ ynh_abort_if_errors domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH is_public=$YNH_APP_ARG_IS_PUBLIC +phpversion=$YNH_PHP_VERSION app=$YNH_APP_INSTANCE_NAME diff --git a/scripts/upgrade b/scripts/upgrade index 8c0a35a..e76b8fa 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -21,6 +21,7 @@ path_url=$(ynh_app_setting_get --app=$app --key=path) admin=$(ynh_app_setting_get --app=$app --key=admin) final_path=$(ynh_app_setting_get --app=$app --key=final_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) +phpversion=$YNH_PHP_VERSION #================================================= # CHECK VERSION @@ -86,7 +87,7 @@ then ynh_script_progression --message="Upgrading source files..." --weight=3 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" + ynh_setup_source --dest_dir="$final_path" --keep="$final_path/img $final_path/override" fi chmod 750 "$final_path" @@ -116,6 +117,13 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1 # Create a dedicated PHP-FPM config ynh_add_fpm_config +#================================================= +# PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Upgrading database..." --weight=1 + +php$phpversion $final_path/install/upgrade/upgrade.php + #================================================= # RELOAD NGINX #================================================= From eaef54986738b9ebf467def93bff46d954674f5b Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 8 Feb 2022 14:26:06 +0100 Subject: [PATCH 5/8] Create change_url --- scripts/change_url | 105 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 scripts/change_url diff --git a/scripts/change_url b/scripts/change_url new file mode 100644 index 0000000..ff06606 --- /dev/null +++ b/scripts/change_url @@ -0,0 +1,105 @@ +#!/bin/bash + +#================================================= +# GENERIC STARTING +#================================================= +# IMPORT GENERIC HELPERS +#================================================= + +source _common.sh +source /usr/share/yunohost/helpers + +#================================================= +# RETRIEVE ARGUMENTS +#================================================= + +old_domain=$YNH_APP_OLD_DOMAIN +old_path=$YNH_APP_OLD_PATH + +new_domain=$YNH_APP_NEW_DOMAIN +new_path=$YNH_APP_NEW_PATH + +app=$YNH_APP_INSTANCE_NAME + +#================================================= +# LOAD SETTINGS +#================================================= +ynh_script_progression --message="Loading installation settings..." --weight=1 + +# Needed for helper "ynh_add_nginx_config" +final_path=$(ynh_app_setting_get --app=$app --key=final_path) + +#================================================= +# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP +#================================================= +ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=1 + +# Backup the current version of the app +ynh_backup_before_upgrade +ynh_clean_setup () { + # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location. + ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" + + # Restore it if the upgrade fails + ynh_restore_upgradebackup +} +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors + +#================================================= +# CHECK WHICH PARTS SHOULD BE CHANGED +#================================================= + +change_domain=0 +if [ "$old_domain" != "$new_domain" ] +then + change_domain=1 +fi + +change_path=0 +if [ "$old_path" != "$new_path" ] +then + change_path=1 +fi + +#================================================= +# MODIFY URL IN NGINX CONF +#================================================= +ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 + +nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf + +# Change the path in the NGINX config file +if [ $change_path -eq 1 ] +then + # Make a backup of the original NGINX config file if modified + ynh_backup_if_checksum_is_different --file="$nginx_conf_path" + # Set global variables for NGINX helper + domain="$old_domain" + path_url="$new_path" + # Create a dedicated NGINX config + ynh_add_nginx_config +fi + +# Change the domain for NGINX +if [ $change_domain -eq 1 ] +then + # Delete file checksum for the old conf file location + ynh_delete_file_checksum --file="$nginx_conf_path" + mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf + # Store file checksum for the new config file location + ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" +fi + +#================================================= +# RELOAD NGINX +#================================================= +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 + +ynh_systemd_action --service_name=nginx --action=reload + +#================================================= +# END OF SCRIPT +#================================================= + +ynh_script_progression --message="Change of URL completed for $app" --last From f20227e297bf9803abf37f6e1dfde6d225cfe88c Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 8 Feb 2022 15:13:17 +0100 Subject: [PATCH 6/8] Update upgrade --- scripts/upgrade | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index e76b8fa..9ab1a4b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -122,7 +122,9 @@ ynh_add_fpm_config #================================================= ynh_script_progression --message="Upgrading database..." --weight=1 -php$phpversion $final_path/install/upgrade/upgrade.php +pushd $final_path + php$phpversion ./install/upgrade/upgrade.php +popd #================================================= # RELOAD NGINX From feb21c6cd0a17be9d3233f9d9119904eecc30976 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 8 Feb 2022 15:13:26 +0100 Subject: [PATCH 7/8] Update check_process --- check_process | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_process b/check_process index cb66926..a94739b 100644 --- a/check_process +++ b/check_process @@ -14,7 +14,7 @@ #upgrade=1 from_commit=CommitHash backup_restore=1 multi_instance=1 - change_url=0 + change_url=1 ;;; Options Email= Notification=none From 804d0290114642ba857704f43ed26a28a740a572 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 8 Feb 2022 16:15:51 +0100 Subject: [PATCH 8/8] Update upgrade --- scripts/upgrade | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 9ab1a4b..3adfc4c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -120,11 +120,11 @@ ynh_add_fpm_config #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading database..." --weight=1 +# ynh_script_progression --message="Upgrading database..." --weight=1 -pushd $final_path - php$phpversion ./install/upgrade/upgrade.php -popd +# pushd $final_path +# php$phpversion ./install/upgrade/upgrade.php +# popd #================================================= # RELOAD NGINX