From c8a764154cd60ef94e2de2c38c990d86ac680888 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Sun, 7 Feb 2021 17:05:09 +0100 Subject: [PATCH 1/5] Add the cron job --- scripts/backup | 10 ++++++++-- scripts/install | 6 ++++++ scripts/remove | 6 ++++++ scripts/restore | 6 ++++++ scripts/upgrade | 6 ++++++ 5 files changed, 32 insertions(+), 2 deletions(-) diff --git a/scripts/backup b/scripts/backup index aeba9fc..553bb8f 100644 --- a/scripts/backup +++ b/scripts/backup @@ -45,13 +45,19 @@ ynh_backup --src_path="$final_path" # BACKUP THE NGINX CONFIGURATION #================================================= -ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" +ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # BACKUP THE PHP-FPM CONFIGURATION #================================================= -ynh_backup "/etc/php/${phpversion}/fpm/pool.d/$app.conf" +ynh_backup --src_path="/etc/php/${phpversion}/fpm/pool.d/$app.conf" + +#================================================= +# BACKUP CRON +#================================================= + +ynh_backup --src_path="/etc/cron.d/$app" #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index 85f383a..a29c0c0 100644 --- a/scripts/install +++ b/scripts/install @@ -118,6 +118,12 @@ ynh_replace_string "__ADMIN__" "$admin" "$final_path/user/plugins/login-ldap/log ynh_replace_string "__APP__" "$app" "$final_path/user/plugins/login-ldap/login-ldap.yaml" exec_as $app cp "$final_path/user/plugins/login-ldap/login-ldap.yaml" "$final_path/user/config/plugins/login-ldap.yaml" +#================================================= +# CREATE A CRON TASK +#================================================= + +echo "* * * * * $app php$phpversion $final_path/bin/grav scheduler 1>> /dev/null 2>&1" > /etc/cron.d/$app + #================================================= # SETUP PERMISSIONS #================================================= diff --git a/scripts/remove b/scripts/remove index 6ef4967..4999b4f 100644 --- a/scripts/remove +++ b/scripts/remove @@ -31,6 +31,12 @@ ynh_script_progression --message="Removing dependencies..." --weight=2 # Remove metapackage and its dependencies ynh_remove_app_dependencies +#================================================= +# REMOVE THE CRON +#================================================= + +ynh_secure_remove --file="/etc/cron.d/$app" + #================================================= # REMOVE APP MAIN DIR #================================================= diff --git a/scripts/restore b/scripts/restore index b7f6c90..d41e85a 100644 --- a/scripts/restore +++ b/scripts/restore @@ -79,6 +79,12 @@ find $final_path/bin -type f -exec chmod 775 {} \; find $final_path -type d -exec chmod 775 {} \; find $final_path -type d -exec chmod +s {} \; +#================================================= +# RESTORE THE CRON +#================================================= + +ynh_restore_file --origin_path="/etc/cron.d/$app" + #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 39bdcf2..f6b041a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -183,6 +183,12 @@ ynh_replace_string "__ADMIN__" "$admin" "$final_path/user/plugins/login-ldap/log ynh_replace_string "__APP__" "$app" "$final_path/user/plugins/login-ldap/login-ldap.yaml" exec_as $app cp "$final_path/user/plugins/login-ldap/login-ldap.yaml" "$final_path/user/config/plugins/login-ldap.yaml" +#================================================= +# CREATE A CRON TASK +#================================================= + +echo "* * * * * $app php$phpversion $final_path/bin/grav scheduler 1>> /dev/null 2>&1" > /etc/cron.d/$app + #================================================= # SETUP PERMISSIONS #================================================= From 896b40b2e4140c765c74549a0b5cc66b13ff92b7 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Thu, 11 Feb 2021 09:01:06 +0100 Subject: [PATCH 2/5] Fix $phpversion to ${YNH_PHP_VERSION} --- scripts/install | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index a29c0c0..4de5fcc 100644 --- a/scripts/install +++ b/scripts/install @@ -122,7 +122,7 @@ exec_as $app cp "$final_path/user/plugins/login-ldap/login-ldap.yaml" "$final_pa # CREATE A CRON TASK #================================================= -echo "* * * * * $app php$phpversion $final_path/bin/grav scheduler 1>> /dev/null 2>&1" > /etc/cron.d/$app +echo "* * * * * $app php${YNH_PHP_VERSION} $final_path/bin/grav scheduler 1>> /dev/null 2>&1" > /etc/cron.d/$app #================================================= # SETUP PERMISSIONS diff --git a/scripts/upgrade b/scripts/upgrade index f6b041a..4d78042 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -187,7 +187,7 @@ exec_as $app cp "$final_path/user/plugins/login-ldap/login-ldap.yaml" "$final_pa # CREATE A CRON TASK #================================================= -echo "* * * * * $app php$phpversion $final_path/bin/grav scheduler 1>> /dev/null 2>&1" > /etc/cron.d/$app +echo "* * * * * $app php${YNH_PHP_VERSION} $final_path/bin/grav scheduler 1>> /dev/null 2>&1" > /etc/cron.d/$app #================================================= # SETUP PERMISSIONS From 914aaf753a576b93901225509b7aa9419586bde1 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Thu, 18 Feb 2021 08:52:09 +0100 Subject: [PATCH 3/5] Upgrade to v1.7.6 --- 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 a6b06c9..c2eaa60 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.5** +Provided version: **1.7.6** ## Screenshots diff --git a/conf/app-upgrade.src b/conf/app-upgrade.src index d211999..d65725c 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.5/grav-update-v1.7.5.zip -SOURCE_SUM=7A6F1A509E699448BF85516D3588263AF0679B69170810D90EFD6C5FC53BC3DA +SOURCE_URL=https://github.com/getgrav/grav/releases/download/1.7.6/grav-update-v1.7.6.zip +SOURCE_SUM=2EBFDF0B7E3FAED83157FC6AD4A2A70E92188FF37B54AF1F6955F840097ADD59 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true diff --git a/conf/app.src b/conf/app.src index 81d0b49..53f96ca 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/getgrav/grav/releases/download/1.7.5/grav-admin-v1.7.5.zip -SOURCE_SUM=3A53CBCACFB7C80838D83EBD8A534FEE80D4E99382CE377881112354314B3A3E +SOURCE_URL=https://github.com/getgrav/grav/releases/download/1.7.6/grav-admin-v1.7.6.zip +SOURCE_SUM=2CBC8E11706AE149DBF91E556376F63271BF9ABB8AB2A774C524E85109C0BF82 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 9b9f546..86c266f 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.5~ynh1", + "version": "1.7.6~ynh1", "url": "https://www.getgrav.org/", "license": "MIT-0", "maintainer": [ From 907bef80a4371ce1833d06e5164f6b5e1d57d980 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 18 Feb 2021 17:05:55 +0100 Subject: [PATCH 4/5] Update check_process --- check_process | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/check_process b/check_process index 0059407..5a24131 100644 --- a/check_process +++ b/check_process @@ -26,7 +26,7 @@ setup_private=1 setup_public=1 upgrade=1 - upgrade=1 from_commit=2909df6045ffab5378623c9fc05c9a69eac35a2e + upgrade=1 from_commit=84ab41360f76783e8f1e292439bbdbfe30bd44ac backup_restore=1 multi_instance=1 port_already_use=0 (66) @@ -37,6 +37,6 @@ Email=tituspijean@outlook.com Notification=none ;;; Upgrade options - ; commit=2909df6045ffab5378623c9fc05c9a69eac35a2e - name=Upgrade to v1.6.26, YNH v3.7 permissions system, PHP version handling… + ; commit=84ab41360f76783e8f1e292439bbdbfe30bd44ac + name=Upgrade to v1.6.27 and YNH 4.0.7, README improvements (#44) manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr_FR&is_public=1& \ No newline at end of file From bdec9879c160cf9e2d6a7159444d6a2db54997e5 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 18 Feb 2021 17:54:32 +0100 Subject: [PATCH 5/5] Update check_process --- check_process | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/check_process b/check_process index 5a24131..ff9494c 100644 --- a/check_process +++ b/check_process @@ -26,7 +26,7 @@ setup_private=1 setup_public=1 upgrade=1 - upgrade=1 from_commit=84ab41360f76783e8f1e292439bbdbfe30bd44ac + upgrade=1 from_commit=12e86653bc6c91208b3abaf4243a7ebb996cada6 backup_restore=1 multi_instance=1 port_already_use=0 (66) @@ -37,6 +37,6 @@ Email=tituspijean@outlook.com Notification=none ;;; Upgrade options - ; commit=84ab41360f76783e8f1e292439bbdbfe30bd44ac - name=Upgrade to v1.6.27 and YNH 4.0.7, README improvements (#44) + ; commit=12e86653bc6c91208b3abaf4243a7ebb996cada6 + name=Upgrade to v1.7.5 manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr_FR&is_public=1& \ No newline at end of file