From a2cbadcc34b1cbdf5bca73acbebad4b59199d95d Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 25 Feb 2021 15:32:58 +0100 Subject: [PATCH 1/6] Set new permission --- manifest.json | 2 +- scripts/install | 11 ++++++----- scripts/upgrade | 26 ++++++++++++-------------- 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/manifest.json b/manifest.json index 98ee918..cfb74fe 100644 --- a/manifest.json +++ b/manifest.json @@ -14,7 +14,7 @@ "email": "pierre@kayou.io" }, "requirements": { - "yunohost": ">= 3.5" + "yunohost": ">= 3.8.1" }, "multi_instance": true, "services": [ diff --git a/scripts/install b/scripts/install index d1fe1ce..73e48b7 100755 --- a/scripts/install +++ b/scripts/install @@ -154,15 +154,16 @@ ynh_replace_string --match_string="isMediaPathModified = true" --replace_string= #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring SSOwat..." --weight=1 +ynh_script_progression --message="Configuring permissions..." --weight=1 # Make app public if necessary if [ $is_public -eq 1 ] then - # unprotected_uris allows SSO credentials to be passed anyway. - ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" - # protect the admin panel - ynh_app_setting_set --app=$app --key=protected_uris --value="/admin" + # Everyone can access the app. + # The "main" permission is automatically created before the install script. + ynh_permission_update --permission="main" --add="visitors" + # Only the admin can access the admin panel of the app (if the app has an admin panel) + ynh_permission_create --permission="admin" --url="/admin" --allowed=$admin fi #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 23a587a..a0e9846 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -49,6 +49,18 @@ if [ -z "$final_path" ]; then ynh_app_setting_set --app=$app --key=final_path --value=$final_path fi +# Cleaning legacy permissions +if ynh_legacy_permissions_exists; then + ynh_legacy_permissions_delete_all + + ynh_app_setting_delete --app=$app --key=is_public +fi + +if ! ynh_permission_exists --permission="admin"; then + # Create the required permissions + ynh_permission_create --permission="admin" --url="/admin" --allowed=$admin +fi + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= @@ -142,20 +154,6 @@ ynh_replace_string --match_string="isMediaPathModified = true" --replace_string= # Set permissions on app files chown -R $app: $final_path -#================================================= -# SETUP SSOWAT -#================================================= -ynh_script_progression --message="Upgrading SSOwat configuration..." --weight=1 - -# Make app public if necessary -if [ $is_public -eq 1 ] -then - # unprotected_uris allows SSO credentials to be passed anyway - ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" - # protect the admin panel - ynh_app_setting_set --app=$app --key=protected_uris --value="/admin" -fi - #================================================= # RELOAD NGINX #================================================= From f0b6f6137f527017a8e87083366a88ad9d724409 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 1 May 2021 08:45:30 +0200 Subject: [PATCH 2/6] Fix --- README.md | 8 ++++---- README_fr.md | 20 +++++++------------- check_process | 4 ---- manifest.json | 24 ++---------------------- scripts/_common.sh | 4 +++- scripts/change_url | 16 ++++++++++++++++ scripts/install | 16 +++++----------- scripts/remove | 4 ++-- scripts/upgrade | 22 ---------------------- 9 files changed, 39 insertions(+), 79 deletions(-) diff --git a/README.md b/README.md index bc4f1ad..2911eea 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # PrettyNoemieCMS for YunoHost [![Integration level](https://dash.yunohost.org/integration/prettynoemiecms.svg)](https://dash.yunohost.org/appci/app/prettynoemiecms) ![](https://ci-apps.yunohost.org/ci/badges/prettynoemiecms.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/prettynoemiecms.maintain.svg) -[![Install PrettyNoemieCMS with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=prettynoemiecms) +[![Install PrettyNoemieCMS with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=prettynoemiecms) *[Lire ce readme en français.](./README_fr.md)* > *This package allow you to install PrettyNoemieCMS quickly and simply on a YunoHost server. -If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.* +If you don't have YunoHost, please see [here](https://yunohost.org/install) to know how to install and enjoy it.* ## Overview PrettyNoemieCMS offers its users an ergonomic solution, simple and elegant to build in no time responsive windows sites with modern design. @@ -45,8 +45,8 @@ Can the app be used by multiple users? **No** #### Supported architectures -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/prettynoemiecms%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/prettynoemiecms/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/prettynoemiecms%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/prettynoemiecms/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/prettynoemiecms.svg)](https://ci-apps.yunohost.org/ci/apps/prettynoemiecms/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/prettynoemiecms.svg)](https://ci-apps-arm.yunohost.org/ci/apps/prettynoemiecms/) ## Links diff --git a/README_fr.md b/README_fr.md index 7c12c49..dd17c2a 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,12 +1,12 @@ # PrettyNoemieCMS pour YunoHost [![Integration level](https://dash.yunohost.org/integration/prettynoemiecms.svg)](https://dash.yunohost.org/appci/app/prettynoemiecms) -[![Install prettynoemiecms with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=prettynoemiecms) +[![Install prettynoemiecms with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=prettynoemiecms) *[Read this readme in english.](./README.md)* > *Ce package vous permet d'installer prettynoemiecms rapidement et simplement sur un serveur Yunohost. -Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.* +Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/install) pour savoir comment l'installer et en profiter.* ## Vue d'ensemble CMS offrant à ses utilisateurs une solution ergonomique, simple et élégante pour construire en un rien de temps des sites vitrines responsives au design moderne. @@ -40,17 +40,13 @@ Comment configurer cette application: via le panneau d'administration à : `votr #### Support multi-utilisateurs -L'authentification LDAP et HTTP est-elle prise en charge? **NON** -L'application peut-elle être utilisée par plusieurs utilisateurs? **NON** +L'authentification LDAP et HTTP est-elle prise en charge? **Non** +L'application peut-elle être utilisée par plusieurs utilisateurs? **Non** #### Supported architectures -* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/prettynoemiecms%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/prettynoemiecms/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/prettynoemiecms%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/prettynoemiecms/) -* Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/ci/logs/prettynoemiecms%20%28Apps%29.svg)](https://ci-stretch.nohost.me/ci/apps/prettynoemiecms/) - -**Plus d'informations sur la page de documentation:** -https://yunohost.org/packaging_apps +* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/prettynoemiecms.svg)](https://ci-apps.yunohost.org/ci/apps/prettynoemiecms/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/prettynoemiecms.svg)](https://ci-apps-arm.yunohost.org/ci/apps/prettynoemiecms/) ## Liens @@ -61,10 +57,8 @@ https://yunohost.org/packaging_apps --- -Informations pour les développeurs ----------------- +# Informations pour les développeurs -**Seulement si vous voulez utiliser une branche de test pour le codage, au lieu de fusionner directement dans la banche principale.** Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/prettynoemiecms_ynh/tree/testing). Pour essayer la branche testing, procédez comme suit. diff --git a/check_process b/check_process index 5b3a35a..d134373 100644 --- a/check_process +++ b/check_process @@ -16,11 +16,7 @@ upgrade=1 backup_restore=1 multi_instance=1 - incorrect_path=1 - port_already_use=0 change_url=1 -;;; Levels - Level 5=auto ;;; Options Email= Notification=none diff --git a/manifest.json b/manifest.json index cfb74fe..7b771e9 100644 --- a/manifest.json +++ b/manifest.json @@ -14,50 +14,34 @@ "email": "pierre@kayou.io" }, "requirements": { - "yunohost": ">= 3.8.1" + "yunohost": ">= 4.1.7" }, "multi_instance": true, "services": [ "nginx", - "php7.0-fpm" + "php7.3-fpm" ], "arguments": { "install" : [ { "name": "domain", "type": "domain", - "ask": { - "en": "Choose a domain name for prettynoemiecms", - "fr": "Choisissez un nom de domaine pour prettynoemiecms" - }, "example": "example.com" }, { "name": "path", "type": "path", - "ask": { - "en": "Choose a path for prettynoemiecms", - "fr": "Choisissez un chemin pour prettynoemiecms" - }, "example": "/prettynoemiecms", "default": "/prettynoemiecms" }, { "name": "admin", "type": "user", - "ask": { - "en": "Choose an admin user", - "fr": "Choisissez l’administrateur" - }, "example": "johndoe" }, { "name": "is_public", "type": "boolean", - "ask": { - "en": "Is it a public application?", - "fr": "Est-ce une application publique ?" - }, "default": true }, { @@ -73,10 +57,6 @@ { "name": "password", "type": "password", - "ask": { - "en": "Set the administrator password", - "fr": "Définissez le mot de passe administrateur" - }, "help": { "en": "Use the help field to add an information for the admin about this question.", "fr": "Utilisez le champ aide pour ajouter une information à l'intention de l'administrateur à propos de cette question." diff --git a/scripts/_common.sh b/scripts/_common.sh index c939af4..d8a5c04 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,8 +4,10 @@ # COMMON VARIABLES #================================================= +YNH_PHP_VERSION="7.3" + # dependencies used by the app -pkg_dependencies="php7.0-cli php7.0-common php7.0-intl php7.0-json git" +pkg_dependencies="php{YNH_PHP_VERSION}-cli php{YNH_PHP_VERSION}-common php{YNH_PHP_VERSION}-intl php{YNH_PHP_VERSION}-json git" #================================================= # PERSONAL HELPERS diff --git a/scripts/change_url b/scripts/change_url index a6607c9..6a603c6 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -29,6 +29,22 @@ 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 #================================================= diff --git a/scripts/install b/scripts/install index 73e48b7..4617556 100755 --- a/scripts/install +++ b/scripts/install @@ -52,7 +52,6 @@ ynh_script_progression --message="Storing installation settings..." --weight=1 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 -ynh_app_setting_set --app=$app --key=is_public --value=$is_public ynh_app_setting_set --app=$app --key=language --value=$language #================================================= @@ -92,7 +91,7 @@ ynh_system_user_create --username=$app #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring php-fpm..." --weight=1 +ynh_script_progression --message="Configuring PHP-FPM." --weight=1 # Create a dedicated php-fpm config ynh_add_fpm_config @@ -123,13 +122,10 @@ chown -R $app: $final_path # SETUP APPLICATION WITH CURL #================================================= -# Set the app as temporarily public for curl call -ynh_script_progression --message="Configuring SSOwat..." --weight=1 -ynh_app_setting_set --app=$app --key=skipped_uris --value="/" -# Reload SSOwat config -yunohost app ssowatconf +# Set the app as temporarily public for cURL call +ynh_permission_update --permission="main" --add="visitors" -# Reload Nginx +# Reload NGINX ynh_systemd_action --service_name=nginx --action=reload # Installation with curl @@ -137,7 +133,7 @@ ynh_script_progression --message="Finalizing installation..." --weight=2 ynh_local_curl "/signIn" "username=$admin" "password=$password" "repeatPassword=$password" # Remove the public access -ynh_app_setting_delete --app=$app --key=skipped_uris +ynh_permission_update --permission="main" --remove="visitors" #================================================= # STORE THE CONFIG FILE CHECKSUM @@ -159,8 +155,6 @@ ynh_script_progression --message="Configuring permissions..." --weight=1 # Make app public if necessary if [ $is_public -eq 1 ] then - # Everyone can access the app. - # The "main" permission is automatically created before the install script. ynh_permission_update --permission="main" --add="visitors" # Only the admin can access the admin panel of the app (if the app has an admin panel) ynh_permission_create --permission="admin" --url="/admin" --allowed=$admin diff --git a/scripts/remove b/scripts/remove index 846fd75..0612b15 100755 --- a/scripts/remove +++ b/scripts/remove @@ -41,7 +41,7 @@ ynh_secure_remove --file="$final_path" #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing nginx web server configuration..." --weight=1 +ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 # Remove the dedicated nginx config ynh_remove_nginx_config @@ -49,7 +49,7 @@ ynh_remove_nginx_config #================================================= # REMOVE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Removing php-fpm configuration..." --weight=1 +ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=1 # Remove the dedicated php-fpm config ynh_remove_fpm_config diff --git a/scripts/upgrade b/scripts/upgrade index a0e9846..5b33825 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -19,7 +19,6 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) admin=$(ynh_app_setting_get --app=$app --key=admin) -is_public=$(ynh_app_setting_get --app=$app --key=is_public) final_path=$(ynh_app_setting_get --app=$app --key=final_path) language=$(ynh_app_setting_get --app=$app --key=language) @@ -34,15 +33,6 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 -# Fix is_public as a boolean value -if [ "$is_public" = "Yes" ]; then - ynh_app_setting_set --app=$app --key=is_public --value=1 - is_public=1 -elif [ "$is_public" = "No" ]; then - ynh_app_setting_set --app=$app --key=is_public --value=0 - is_public=0 -fi - # If final_path doesn't exist, create it if [ -z "$final_path" ]; then final_path=/var/www/$app @@ -75,18 +65,6 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors -#================================================= -# CHECK THE PATH -#================================================= - -# Normalize the URL path syntax -# N.B. : this is for app installations before YunoHost 2.7 -# where this value might be something like /foo/ or foo/ -# instead of /foo .... -# If nobody installed your app before 2.7, then you may -# safely remove this line -path_url=$(ynh_normalize_url_path --path_url=$path_url) - #================================================= # STANDARD UPGRADE STEPS #================================================= From f870387b88104388887d4bb0424afb6500f45214 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 1 May 2021 08:52:00 +0200 Subject: [PATCH 3/6] Fix --- scripts/_common.sh | 2 +- scripts/backup | 7 ++++--- scripts/change_url | 7 +++---- scripts/install | 4 ++-- scripts/restore | 7 ++++--- scripts/upgrade | 7 ++++--- 6 files changed, 18 insertions(+), 16 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index d8a5c04..b118cc0 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -36,7 +36,7 @@ ynh_composer_exec () { # Manage arguments with getopts ynh_handle_getopts_args "$@" workdir="${workdir:-$final_path}" - phpversion="${phpversion:-7.0}" + phpversion="${phpversion:-7.3}" COMPOSER_HOME="$workdir/.composer" \ php${phpversion} "$workdir/composer.phar" $commands \ diff --git a/scripts/backup b/scripts/backup index 708c009..7215afc 100755 --- a/scripts/backup +++ b/scripts/backup @@ -29,6 +29,7 @@ app=$YNH_APP_INSTANCE_NAME final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # STANDARD BACKUP STEPS @@ -42,16 +43,16 @@ ynh_backup --src_path="$final_path" #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Backing up nginx web server configuration..." --weight=1 +ynh_script_progression --message="Backing up NGINX web server configuration..." --weight=1 ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # BACKUP THE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Backing up php-fpm configuration..." --weight=1 +ynh_script_progression --message="Backing up PHP-FPM configuration..." --weight=1 -ynh_backup --src_path="/etc/php/7.0/fpm/pool.d/$app.conf" +ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" #================================================= # END OF SCRIPT diff --git a/scripts/change_url b/scripts/change_url index 6a603c6..7ad7b44 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -66,7 +66,7 @@ fi #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression --message="Updating nginx web server configuration..." --weight=1 +ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf @@ -92,14 +92,13 @@ then ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" fi - #================================================= # SPECIFIC MODIFICATIONS #================================================= # MOVE FOLDER IF NECESSARY #================================================= -# Change the domain for nginx +# Change the domain for NGINX if [ $change_domain -eq 1 ] then # Delete file checksum for the old conf file location @@ -114,7 +113,7 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/install b/scripts/install index 4617556..0e41bd2 100755 --- a/scripts/install +++ b/scripts/install @@ -75,7 +75,7 @@ ynh_setup_source --dest_dir="$final_path" #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring nginx web server..." --weight=1 +ynh_script_progression --message="Configuring NGINX web server..." --weight=1 # Create a dedicated nginx config ynh_add_nginx_config @@ -163,7 +163,7 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/restore b/scripts/restore index 5f59a0f..3b05602 100755 --- a/scripts/restore +++ b/scripts/restore @@ -30,6 +30,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) #================================================= # CHECK IF THE APP CAN BE RESTORED @@ -75,7 +76,7 @@ chown -R $app: $final_path # RESTORE THE PHP-FPM CONFIGURATION #================================================= -ynh_restore_file --origin_path="/etc/php/7.0/fpm/pool.d/$app.conf" +ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" #================================================= # SPECIFIC RESTORATION @@ -92,9 +93,9 @@ ynh_install_app_dependencies $pkg_dependencies #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -ynh_script_progression --message="Reloading nginx web server and php-fpm..." --weight=1 +ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --weight=1 -ynh_systemd_action --service_name=php7.0-fpm --action=reload +ynh_systemd_action --service_name=php$phpversion-fpm --action=reload ynh_systemd_action --service_name=nginx --action=reload #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 5b33825..ebbbbed 100755 --- 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) language=$(ynh_app_setting_get --app=$app --key=language) +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # CHECK VERSION @@ -82,7 +83,7 @@ fi #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=1 +ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1 # Create a dedicated nginx config ynh_add_nginx_config @@ -105,7 +106,7 @@ ynh_system_user_create --username=$app #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading php-fpm configuration..." --weight=1 +ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1 # Create a dedicated php-fpm config ynh_add_fpm_config @@ -135,7 +136,7 @@ chown -R $app: $final_path #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload From 2cc753eabbd6d95022ca3cd1833e4c730c33d2d8 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 1 May 2021 12:12:35 +0200 Subject: [PATCH 4/6] Fix --- scripts/_common.sh | 4 +++- scripts/install | 7 ++++--- scripts/restore | 3 +++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index b118cc0..3db6f6b 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -7,7 +7,9 @@ YNH_PHP_VERSION="7.3" # dependencies used by the app -pkg_dependencies="php{YNH_PHP_VERSION}-cli php{YNH_PHP_VERSION}-common php{YNH_PHP_VERSION}-intl php{YNH_PHP_VERSION}-json git" +extra_php_dependencies="php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-common php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-json" + +pkg_dependencies="git" #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index 0e41bd2..941caec 100755 --- a/scripts/install +++ b/scripts/install @@ -91,10 +91,11 @@ ynh_system_user_create --username=$app #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring PHP-FPM." --weight=1 +ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 -# Create a dedicated php-fpm config -ynh_add_fpm_config +# Create a dedicated PHP-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/restore b/scripts/restore index 3b05602..b238d5e 100755 --- a/scripts/restore +++ b/scripts/restore @@ -75,9 +75,12 @@ chown -R $app: $final_path #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= +ynh_script_progression --message="Reconfiguring PHP-FPM..." --weight=2 ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" +ynh_add_fpm_config --package="$extra_php_dependencies" + #================================================= # SPECIFIC RESTORATION #================================================= From e2ce5d9d678d0a87d45f8c5d64108333b126637f Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 1 May 2021 14:35:20 +0200 Subject: [PATCH 5/6] Fix linter warnings --- manifest.json | 4 ---- scripts/backup | 12 +++++++----- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/manifest.json b/manifest.json index 7b771e9..38f17c7 100644 --- a/manifest.json +++ b/manifest.json @@ -57,10 +57,6 @@ { "name": "password", "type": "password", - "help": { - "en": "Use the help field to add an information for the admin about this question.", - "fr": "Utilisez le champ aide pour ajouter une information à l'intention de l'administrateur à propos de cette question." - }, "example": "Choose a password" } ] diff --git a/scripts/backup b/scripts/backup index 7215afc..19b80dd 100755 --- a/scripts/backup +++ b/scripts/backup @@ -23,7 +23,7 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +ynh_print_info --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME @@ -31,26 +31,28 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +#================================================= +# DECLARE DATA AND CONF FILES TO BACKUP +#================================================= +ynh_print_info --message="Declaring files to be backed up..." + #================================================= # STANDARD BACKUP STEPS #================================================= # BACKUP THE APP MAIN DIR #================================================= -ynh_script_progression --message="Backing up the main app directory..." --weight=1 ynh_backup --src_path="$final_path" #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Backing up NGINX web server configuration..." --weight=1 ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # BACKUP THE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Backing up PHP-FPM configuration..." --weight=1 ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" @@ -58,4 +60,4 @@ ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" # END OF SCRIPT #================================================= -ynh_script_progression --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." --last +ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." From 3e883a779d04f398323f241633ca69a66b763937 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 1 May 2021 14:37:01 +0200 Subject: [PATCH 6/6] Update check_process --- check_process | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/check_process b/check_process index d134373..bd0ec4a 100644 --- a/check_process +++ b/check_process @@ -14,9 +14,14 @@ setup_private=1 setup_public=1 upgrade=1 + upgrade=1 from_commit=a2309f4c622bab3b728e765b125245ebf55f3f59 backup_restore=1 multi_instance=1 change_url=1 ;;; Options Email= Notification=none +;;; Upgrade options + ; commit=a2309f4c622bab3b728e765b125245ebf55f3f59 + name=Merge pull request #13 from YunoHost-Apps/testing + manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666& \ No newline at end of file