From 88cd1ba5b760719ba772beb2153b573a46e59458 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Wed, 17 Apr 2024 22:17:59 +0200 Subject: [PATCH 1/6] Actually disable in-app backup, do not backup backups nor cache --- conf/scheduler.yaml | 4 ++++ doc/POST_UPGRADE.d/1.7.45~ynh3.md | 5 +++++ scripts/backup | 5 ++++- scripts/install | 7 ++++++- scripts/upgrade | 7 +++++++ 5 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 conf/scheduler.yaml create mode 100644 doc/POST_UPGRADE.d/1.7.45~ynh3.md diff --git a/conf/scheduler.yaml b/conf/scheduler.yaml new file mode 100644 index 0000000..e5ab333 --- /dev/null +++ b/conf/scheduler.yaml @@ -0,0 +1,4 @@ +status: + cache-purge: disabled + cache-clear: disabled + default-site-backup: disabled diff --git a/doc/POST_UPGRADE.d/1.7.45~ynh3.md b/doc/POST_UPGRADE.d/1.7.45~ynh3.md new file mode 100644 index 0000000..d918037 --- /dev/null +++ b/doc/POST_UPGRADE.d/1.7.45~ynh3.md @@ -0,0 +1,5 @@ +Before v1.7.45~ynh3 of this package, an upstream quirk made the app generate a backup daily, despite the default configuration suggesting it to be disabled. + +Starting this version, if you had not already altered the Scheduler configuration, this is fixed. + +The backups directory is also not backed up by YunoHost anymore, as it was superfluous. diff --git a/scripts/backup b/scripts/backup index d4ae004..9cef39e 100644 --- a/scripts/backup +++ b/scripts/backup @@ -19,7 +19,10 @@ ynh_print_info --message="Declaring files to be backed up..." # BACKUP THE APP MAIN DIR #================================================= -ynh_backup --src_path="$install_dir" +# Backup install_dir except backup and cache directory +for f in $(ls "$install_dir" -I backup -I cache); do + ynh_backup --src_path="${install_dir}/$f" +done #================================================= # BACKUP THE NGINX CONFIGURATION diff --git a/scripts/install b/scripts/install index d8523de..76408f0 100644 --- a/scripts/install +++ b/scripts/install @@ -58,7 +58,12 @@ ynh_script_progression --message="Adding a configuration file..." --weight=1 ynh_exec_as $app mkdir -p "$install_dir/user/config/plugins/login-ldap" ynh_exec_as $app touch "$install_dir/user/accounts/admin.yaml" -# Setting up config +# Setting up scheduler config +ynh_add_config --template="../conf/scheduler.yaml" --destination="$install_dir/user/config/scheduler.yaml" +chown $app:$app "$install_dir/user/config/scheduler.yaml" +chmod 640 "$install_dir/user/config/scheduler.yaml" + +# Setting up LDAP config ynh_add_config --template="../conf/login-ldap.yaml" --destination="$install_dir/user/config/plugins/login-ldap.yaml" chown $app:$app "$install_dir/user/config/plugins/login-ldap.yaml" chmod 640 "$install_dir/user/config/plugins/login-ldap.yaml" diff --git a/scripts/upgrade b/scripts/upgrade index 06f6a74..251bd6d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -29,6 +29,13 @@ if [ -z "${with_sftp:-}" ] || [ -z "${password:-}" ]; then ynh_app_setting_set --app=$app --key=password --value=$(ynh_string_random) fi +# Setup the scheduler config if it is missing from user directory +if [ ! -f "$install_dir/user/config/scheduler.yaml" ]; then + ynh_add_config --template="../conf/scheduler.yaml" --destination="$install_dir/user/config/scheduler.yaml" + chown $app:$app "$install_dir/user/config/scheduler.yaml" + chmod 640 "$install_dir/user/config/scheduler.yaml"] +fi + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= From 2f91f01aa5bfe1c9abd8092bd760cc7341ff02d5 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Wed, 17 Apr 2024 22:19:12 +0200 Subject: [PATCH 2/6] Bump package version --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index bb249f4..8091d08 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Grav" description.en = "Modern open source flat-file CMS" description.fr = "CMS moderne basé sur des fichiers plats" -version = "1.7.45~ynh2" +version = "1.7.45~ynh3" maintainers = ["tituspijean"] From 2b587f91fd310132f372119e61594e5d81cfbc6c Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 17 Apr 2024 20:19:19 +0000 Subject: [PATCH 3/6] Auto-update READMEs --- README.md | 2 +- README_eu.md | 2 +- README_fr.md | 2 +- README_gl.md | 2 +- README_zh_Hans.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 147a868..4297632 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ It shall NOT be edited by hand. Grav is a modern open source flat-file CMS. -**Shipped version:** 1.7.45~ynh2 +**Shipped version:** 1.7.45~ynh3 **Demo:** diff --git a/README_eu.md b/README_eu.md index 21a025c..03c65ae 100644 --- a/README_eu.md +++ b/README_eu.md @@ -19,7 +19,7 @@ EZ editatu eskuz. Grav is a modern open source flat-file CMS. -**Paketatutako bertsioa:** 1.7.45~ynh2 +**Paketatutako bertsioa:** 1.7.45~ynh3 **Demoa:** diff --git a/README_fr.md b/README_fr.md index ec5d37c..666725f 100644 --- a/README_fr.md +++ b/README_fr.md @@ -19,7 +19,7 @@ Il NE doit PAS être modifié à la main. Un CMS moderne basé sur des fichiers plats -**Version incluse :** 1.7.45~ynh2 +**Version incluse :** 1.7.45~ynh3 **Démo :** diff --git a/README_gl.md b/README_gl.md index 7af13cd..4d4c30c 100644 --- a/README_gl.md +++ b/README_gl.md @@ -19,7 +19,7 @@ NON debe editarse manualmente. Grav is a modern open source flat-file CMS. -**Versión proporcionada:** 1.7.45~ynh2 +**Versión proporcionada:** 1.7.45~ynh3 **Demo:** diff --git a/README_zh_Hans.md b/README_zh_Hans.md index 7a264dc..efa6c45 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -19,7 +19,7 @@ Grav is a modern open source flat-file CMS. -**分发版本:** 1.7.45~ynh2 +**分发版本:** 1.7.45~ynh3 **演示:** From 68edebace10aabac9ccaa171353f522d54c0d92c Mon Sep 17 00:00:00 2001 From: tituspijean Date: Wed, 17 Apr 2024 22:24:57 +0200 Subject: [PATCH 4/6] Create backup directory upon restore --- scripts/restore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/restore b/scripts/restore index edc753a..50ef812 100644 --- a/scripts/restore +++ b/scripts/restore @@ -17,6 +17,9 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$install_dir" +# Grav will complain about missing backup directory, let's create it +mkdir -p "$install_dir/backup" + chown -R $app:www-data "$install_dir" find "$install_dir" -type f -exec chmod 640 {} \; find "$install_dir/bin" -type f -exec chmod 750 {} \; From 7260734af6402c44754139f1fac9a467ec18db91 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Thu, 18 Apr 2024 18:20:53 +0200 Subject: [PATCH 5/6] Enable cache clear and purge by scheduler --- conf/scheduler.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/scheduler.yaml b/conf/scheduler.yaml index e5ab333..48c4b58 100644 --- a/conf/scheduler.yaml +++ b/conf/scheduler.yaml @@ -1,4 +1,4 @@ status: - cache-purge: disabled - cache-clear: disabled + cache-purge: enabled + cache-clear: enabled default-site-backup: disabled From b941f6dcacf3e237763f0cfdcdf9214c34c5c463 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Thu, 18 Apr 2024 18:25:19 +0200 Subject: [PATCH 6/6] Update ADMIN.md --- doc/ADMIN.md | 3 +++ doc/ADMIN_fr.md | 3 +++ 2 files changed, 6 insertions(+) diff --git a/doc/ADMIN.md b/doc/ADMIN.md index af9fb1c..ee77704 100644 --- a/doc/ADMIN.md +++ b/doc/ADMIN.md @@ -8,3 +8,6 @@ 2. `sudo -u __APP__ php__PHPVERSION__ bin/grav ...` or `sudo -u __APP__ php__PHPVERSION__bin/gpm ...` * You can install plugins through the admin panel, or through the GPM. * If installing Grav at the root of a domain, bear in mind that paths starting by `/yunohost` are reserved. +* Grav's automated daily self-backups are disabled by default +* Grav's self-backups are not backed up by YunoHost +* Daily cache purge and clear are enabled by default diff --git a/doc/ADMIN_fr.md b/doc/ADMIN_fr.md index 47f8978..6ae7992 100644 --- a/doc/ADMIN_fr.md +++ b/doc/ADMIN_fr.md @@ -8,3 +8,6 @@ 2. `sudo -u __APP__ php__PHPVERSION__ bin/grav ...` ou `sudo -u __APP__ php__PHPVERSION__ bin/gpm ...` * Vous pouvez installer les extensions soit via le panneau d'administration, soit via GPM. * Si vous installez Grav à la racine d'un domaine, sachez que les chemins d'accès commençant par `/yunohost` sont réservés. +* Les auto-sauvegardes quotidiennes automatiques de Grav sont désactivées par défaut +* Les auto-sauvegardes de Grav ne sont pas contenues dans les sauvegardes générées par YunoHost +* Le nettoyage et la purge quotidienne du cache sont activés par défaut