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 #=================================================