From 8472da0efe94267f176b65ec96efb679c9ac082d Mon Sep 17 00:00:00 2001 From: tituspijean Date: Mon, 5 Apr 2021 13:57:11 +0200 Subject: [PATCH 1/7] bin/gpm has to be run from $final_path --- scripts/install | 4 +++- scripts/upgrade | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 6f16a83..97ab339 100644 --- a/scripts/install +++ b/scripts/install @@ -106,7 +106,9 @@ find "$final_path" -type d -exec chmod +s {} \; #================================================= ynh_script_progression --message="Installing and configuring LDAP plugin..." --weight=1 -exec_as $app php${YNH_PHP_VERSION} "$final_path/bin/gpm" install login-ldap --all-yes --no-interaction +pushd "$final_path" + exec_as $app php${YNH_PHP_VERSION} bin/gpm install login-ldap --no-interaction +popd exec_as $app mkdir -p "$final_path/user/config/plugins/login-ldap" exec_as $app touch "$final_path/user/accounts/admin.yaml" diff --git a/scripts/upgrade b/scripts/upgrade index f33ef7a..baa857d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -142,14 +142,18 @@ find "$final_path" -type d -exec chmod +s {} \; #================================================= ynh_script_progression --message="Updating all plugins..." --weight=1 -yes N | ynh_exec_warn_less exec_as $app php${YNH_PHP_VERSION} $final_path/bin/gpm update --all-yes --no-interaction +pushd "$final_path" + yes N | ynh_exec_warn_less exec_as $app php${YNH_PHP_VERSION} bin/gpm update --all-yes --no-interaction +popd #================================================= # INSTALL LDAP PLUGIN #================================================= ynh_script_progression --message="Installing and configuring LDAP plugin..." --weight=3 -exec_as $app php${YNH_PHP_VERSION} "$final_path/bin/gpm" install login-ldap --all-yes --no-interaction +pushd "$final_path" + exec_as $app php${YNH_PHP_VERSION} bin/gpm install login-ldap --no-interaction +popd exec_as $app mkdir -p "$final_path/user/config/plugins/login-ldap" exec_as $app touch "$final_path/user/accounts/admin.yaml" From 54a0d7d48884f767646a787b697a179de5775709 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Mon, 5 Apr 2021 14:35:40 +0200 Subject: [PATCH 2/7] Bring back the ask strings for language --- manifest.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/manifest.json b/manifest.json index 778d756..35b1d38 100644 --- a/manifest.json +++ b/manifest.json @@ -63,6 +63,10 @@ { "name": "language", "type": "string", + "ask": { + "en": "Choose the application language", + "fr": "Choisissez la langue de l'application" + }, "choices": ["en_EN", "fr_FR"], "default": "fr_FR" } From 26e3ee6e055f184da1fd212c686af7207a908c28 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Tue, 6 Apr 2021 22:02:26 +0200 Subject: [PATCH 3/7] Upgrade to v1.7.10 --- README.md | 2 +- conf/app-upgrade.src | 4 ++-- conf/app.src | 4 ++-- manifest.json | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 1d412df..7841ced 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to ## Overview Grav is a modern open source flat-file CMS. -Provided version: **1.7.7** +Provided version: **1.7.10** ## Screenshots diff --git a/conf/app-upgrade.src b/conf/app-upgrade.src index 20a216d..14ec458 100644 --- a/conf/app-upgrade.src +++ b/conf/app-upgrade.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/getgrav/grav/releases/download/1.7.7/grav-update-v1.7.7.zip -SOURCE_SUM=3BCBBA56DBC0212A5740F862D25A5A864479D8A4CDF531563A64C51EF4670F7D +SOURCE_URL=https://github.com/getgrav/grav/releases/download/1.7.10/grav-update-v1.7.10.zip +SOURCE_SUM=C7726AE7784BB4495AC9897651626C75CA3F2D7E69F9C1EE1632BB71B6F77FF4 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true diff --git a/conf/app.src b/conf/app.src index bb87bab..0f81747 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/getgrav/grav/releases/download/1.7.7/grav-admin-v1.7.7.zip -SOURCE_SUM=357E084885AEE04032E8E7F90B719434A4DE2588A2C3035140D210C0C7AE204F +SOURCE_URL=https://github.com/getgrav/grav/releases/download/1.7.10/grav-admin-v1.7.10.zip +SOURCE_SUM=8A461CE915182F11E4F09A9C68B2690599D738FACE19F6B846E1D91E43BCF027 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 35b1d38..109c59c 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "A modern open source flat-file CMS", "fr": "Un CMS moderne basé sur des fichiers plats" }, - "version": "1.7.7~ynh1", + "version": "1.7.10~ynh1", "url": "https://www.getgrav.org/", "license": "MIT-0", "maintainer": [ From eb595bbb9751ca386922c99057e54dd5a76a2e5a Mon Sep 17 00:00:00 2001 From: tituspijean Date: Tue, 6 Apr 2021 22:43:07 +0200 Subject: [PATCH 4/7] Handle failing plugin upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index baa857d..455d007 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -143,7 +143,7 @@ find "$final_path" -type d -exec chmod +s {} \; ynh_script_progression --message="Updating all plugins..." --weight=1 pushd "$final_path" - yes N | ynh_exec_warn_less exec_as $app php${YNH_PHP_VERSION} bin/gpm update --all-yes --no-interaction + yes N | ynh_exec_warn_less exec_as $app php${YNH_PHP_VERSION} bin/gpm update --all-yes --no-interaction || ynh_print_warn --message="Automatic plugin upgrade has failed, you can upgrade them from your Grav admin panel." popd #================================================= From 63505e06e3b6f347a6bda8bd9a6f12584d701192 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Wed, 7 Apr 2021 18:36:09 +0200 Subject: [PATCH 5/7] Silence yes "broken pipe" --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 455d007..8384e76 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -143,7 +143,7 @@ find "$final_path" -type d -exec chmod +s {} \; ynh_script_progression --message="Updating all plugins..." --weight=1 pushd "$final_path" - yes N | ynh_exec_warn_less exec_as $app php${YNH_PHP_VERSION} bin/gpm update --all-yes --no-interaction || ynh_print_warn --message="Automatic plugin upgrade has failed, you can upgrade them from your Grav admin panel." + ynh_exec_warn_less yes N | ynh_exec_warn_less exec_as $app php${YNH_PHP_VERSION} bin/gpm update --all-yes --no-interaction || ynh_print_warn --message="Automatic plugin upgrade has failed, you can upgrade them from your Grav admin panel." popd #================================================= From 5606ee2b8b307a9be0a46367815fdcd5a3e02c13 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Wed, 7 Apr 2021 18:40:42 +0200 Subject: [PATCH 6/7] Permissions in upgrade should be for downward compatibility --- scripts/upgrade | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 8384e76..da87e9a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -55,6 +55,18 @@ if ynh_legacy_permissions_exists; then ynh_app_setting_delete --app=$app --key=is_public fi +# Giving admin permission to the specified used +if ! ynh_permission_exists --permission "admin" +then + ynh_permission_create --permission "admin" --allowed "$admin" +fi + +# Creating user permission +if ! ynh_permission_exists --permission "user" +then + ynh_permission_create --permission "user" +fi + # If fpm_footprint doesn't exist, create it if [ -z "$fpm_footprint" ]; then fpm_footprint=medium @@ -167,25 +179,6 @@ chmod 640 "$final_path/user/config/plugins/login-ldap.yaml" echo "* * * * * $app php${YNH_PHP_VERSION} $final_path/bin/grav scheduler 1>> /dev/null 2>&1" > /etc/cron.d/$app -#================================================= -# SETUP PERMISSIONS -#================================================= -ynh_script_progression --message="Configuring permissions..." --weight=1 - -# Giving admin permission to the specified used -if ! ynh_permission_exists --permission "admin" -then - ynh_permission_create --permission "admin" --allowed "$admin" -else - ynh_permission_update --permission "admin" --add "$admin" -fi - -# Creating user permission -if ! ynh_permission_exists --permission "user" -then - ynh_permission_create --permission "user" -fi - #================================================= # RELOAD NGINX AND PHP-FPM #================================================= From a29fef2a5d4c3e98276271a6087c09b9ed771c58 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Tue, 13 Apr 2021 19:01:31 +0200 Subject: [PATCH 7/7] Change SHA256 sums for v1.7.10 Source files were silently changed by Grav's team to update the admin plugin... --- conf/app-upgrade.src | 2 +- conf/app.src | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/app-upgrade.src b/conf/app-upgrade.src index 14ec458..a473a67 100644 --- a/conf/app-upgrade.src +++ b/conf/app-upgrade.src @@ -1,5 +1,5 @@ SOURCE_URL=https://github.com/getgrav/grav/releases/download/1.7.10/grav-update-v1.7.10.zip -SOURCE_SUM=C7726AE7784BB4495AC9897651626C75CA3F2D7E69F9C1EE1632BB71B6F77FF4 +SOURCE_SUM=91F704B33C8BA8FBB5A0981DE70B92CD52BD8F833B3AFB53F98BF66CE04C2123 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true diff --git a/conf/app.src b/conf/app.src index 0f81747..932f757 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ SOURCE_URL=https://github.com/getgrav/grav/releases/download/1.7.10/grav-admin-v1.7.10.zip -SOURCE_SUM=8A461CE915182F11E4F09A9C68B2690599D738FACE19F6B846E1D91E43BCF027 +SOURCE_SUM=0FF6ADD05384DDA0ED07551674A70E3F3FF9117AE6B2D16E1BCE0CACD348C4D8 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true