From af450e055934f5e9b5c46126d2688ce025fefe96 Mon Sep 17 00:00:00 2001 From: lapineige Date: Sat, 1 Oct 2022 16:15:39 +0200 Subject: [PATCH] Testing : implement logrotate / fix php-redis dependency blockign other apps (#151) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Apply last example_ynh (#117) * Apply last example_ynh * Cleanup backup * Create DISCLAIMER.md * Create DISCLAIMER_fr.md * Auto-update README * Add files via upload * Fix heading size * Auto-update README * Fix heading size * Auto-update README * Fix charset * Auto-update README * Update check_process * 2.4.3 (#125) * Upgrade to 2.4.2~ynh1 * Fix craue_config_setting * Upgrade to 2.4.3~ynh1 * Upgrade to 2.4.3~ynh1 * Auto-update README Co-authored-by: yalh76 Co-authored-by: Yunohost-Bot <> * Specify PHP version in every calls (#132) * Specify PHP version in every calls * Switch (back) to php7.4 * Add PHP-xml dependency for DOM extension Co-authored-by: lapineige * Auto-update README * Fix php version reference (#136) * Auto-update README * Use YNH_PHP_VERSION * Proper YNH_PHP_VERSION syntax * Proper YNH_PHP_VERSION syntax : typo * YNH_PHP_VERSION: fix missing change * Fix phpversion → YNH_PHP_VERSION * Upgrade to 2.5 (#134) * Upgrade to 2.5 * Auto-update README * Upgrade to 2.5 Co-authored-by: yunohost-bot * Merge master (2.4.3/php7.4) into testing (2.5) (#137) * Testing (#124) * Apply last example_ynh (#117) * Apply last example_ynh * Cleanup backup * Create DISCLAIMER.md * Create DISCLAIMER_fr.md * Auto-update README * Add files via upload * Fix heading size * Auto-update README * Fix heading size * Auto-update README * Fix charset * Auto-update README * Update check_process Co-authored-by: lapineige Co-authored-by: Yunohost-Bot <> * Testing: update to 2.4.3 (#128) * Apply last example_ynh (#117) * Apply last example_ynh * Cleanup backup * Create DISCLAIMER.md * Create DISCLAIMER_fr.md * Auto-update README * Add files via upload * Fix heading size * Auto-update README * Fix heading size * Auto-update README * Fix charset * Auto-update README * Update check_process * 2.4.3 (#125) * Upgrade to 2.4.2~ynh1 * Fix craue_config_setting * Upgrade to 2.4.3~ynh1 * Upgrade to 2.4.3~ynh1 * Auto-update README Co-authored-by: yalh76 Co-authored-by: Yunohost-Bot <> * Specify PHP version in every calls (#132) * Specify PHP version in every calls * Switch (back) to php7.4 * Add PHP-xml dependency for DOM extension Co-authored-by: lapineige * Auto-update README * Fix php version reference (#136) * Auto-update README * Use YNH_PHP_VERSION * Proper YNH_PHP_VERSION syntax * Proper YNH_PHP_VERSION syntax : typo * YNH_PHP_VERSION: fix missing change * Fix phpversion → YNH_PHP_VERSION Co-authored-by: yalh76 Co-authored-by: Yunohost-Bot <> Co-authored-by: tituspijean Co-authored-by: yunohost-bot Co-authored-by: yalh76 Co-authored-by: tituspijean Co-authored-by: yunohost-bot * 2.5 (#138) * Upgrade to 2.5 * Auto-update README * Upgrade to 2.5 Co-authored-by: yunohost-bot * Auto-update README * Fix PHP dependencies (#142) * Switch version to 2.5.0~ynh2 * Auto-update README * 2.5.1 (#146) * v2.5.1 * Auto-update README * v2.5.1 Co-authored-by: yunohost-bot * fix version number * Auto-update README * fix php7.4-redis conflicting with php-redis (#145) * Auto-update README * Typo in version number (2.5.1, not 2.5.2) * Auto-update README * Setup logrotate (#144) * Setup logrotate * Setup logrotate * Setup logrotate * Setup logrotate * Setup logrotate * bum version number * Auto-update README Co-authored-by: yunohost-bot * Auto-update README * Specify PHP version for Redis (#155) * Specify PHP version for Redis Now available in Bullseye * Auto-update README * Bump requirement to YNH11 for php${version}-redis * Auto-update README Co-authored-by: yunohost-bot Co-authored-by: yalh76 Co-authored-by: Yunohost-Bot <> Co-authored-by: tituspijean Co-authored-by: yunohost-bot Co-authored-by: JimboJoe --- README.md | 3 ++- README_fr.md | 3 ++- manifest.json | 4 ++-- scripts/_common.sh | 2 +- scripts/backup | 6 ++++++ scripts/install | 10 ++++++++++ scripts/remove | 8 ++++++++ scripts/restore | 7 +++++++ scripts/upgrade | 6 ++++++ 9 files changed, 44 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b7d6298..5c47210 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,8 @@ It extracts content so that you can read it when you have time. It provides a web interface, browser (Firefox / Chrome / Opera) add-ons, mobile apps (Android / iOS / Windows Phone) and even on e-reader (PocketBook / Kobo). -**Shipped version:** 2.5.1~ynh2 +**Shipped version:** 2.5.1~ynh3 + **Demo:** https://demo.yunohost.org/wallabag/ diff --git a/README_fr.md b/README_fr.md index 14646fa..a6a05bb 100644 --- a/README_fr.md +++ b/README_fr.md @@ -20,7 +20,8 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Sont disponibles une interface web, des add-ons pour navigateurs (Firefox / Chrome / Opera), des applications pour mobile (Android / iOS / Windows Phone) et même sur liseuse (PocketBook / Kobo). -**Version incluse :** 2.5.1~ynh2 +**Version incluse :** 2.5.1~ynh3 + **Démo :** https://demo.yunohost.org/wallabag/ diff --git a/manifest.json b/manifest.json index fafbbb8..4943cea 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "A self hostable read-it-later app", "fr": "Une application de lecture-plus-tard auto-hébergeable" }, - "version": "2.5.1~ynh2", + "version": "2.5.1~ynh3", "url": "https://www.wallabag.org", "upstream": { "license": "MIT", @@ -20,7 +20,7 @@ "name": "lapineige" }, "requirements": { - "yunohost": ">= 4.3.0" + "yunohost": ">= 11.0" }, "multi_instance": true, "services": [ diff --git a/scripts/_common.sh b/scripts/_common.sh index 3a57c12..ad0074c 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -7,7 +7,7 @@ YNH_PHP_VERSION="7.4" # dependencies used by the app -pkg_dependencies="php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-tidy php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-gettext php-redis php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-intl" +pkg_dependencies="php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-tidy php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-gettext php${YNH_PHP_VERSION}-redis php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-intl" #================================================= diff --git a/scripts/backup b/scripts/backup index 7c696c7..703fbd6 100644 --- a/scripts/backup +++ b/scripts/backup @@ -55,6 +55,12 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" +#================================================= +# BACKUP LOGROTATE +#================================================= + +ynh_backup --src_path="/etc/logrotate.d/$app" + #================================================= # BACKUP FAIL2BAN CONFIGURATION #================================================= diff --git a/scripts/install b/scripts/install index 5590651..218363f 100644 --- a/scripts/install +++ b/scripts/install @@ -158,6 +158,16 @@ ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_fil set_permissions +#================================================= +# SETUP LOGROTATE +#================================================= + +ynh_script_progression --message="Configuring log rotation..." +# Use logrotate to manage application logfile(s) +touch "$final_path/var/logs/prod.log" +ynh_use_logrotate "$final_path/var/logs/prod.log" +chown $app:www-data "$final_path/var/logs/prod.log" + #================================================= # SETUP FAIL2BAN #================================================= diff --git a/scripts/remove b/scripts/remove index 542c8a4..608fdf6 100644 --- a/scripts/remove +++ b/scripts/remove @@ -23,6 +23,14 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= # STANDARD REMOVE +#================================================= +# REMOVE LOGROTATE CONFIGURATION +#================================================= +ynh_script_progression --message="Removing logrotate configuration..." + +# Remove the app-specific logrotate config +ynh_remove_logrotate + #================================================= # REMOVE THE MYSQL DATABASE #================================================= diff --git a/scripts/restore b/scripts/restore index 17a42dc..333f8dc 100644 --- a/scripts/restore +++ b/scripts/restore @@ -78,6 +78,13 @@ ynh_script_progression --message="Restoring the PHP-FPM configuration..." ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" +#================================================= +# RESTORE THE LOGROTATE CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring the logrotate configuration..." + +ynh_restore_file --origin_path="/etc/logrotate.d/$app" + #================================================= # RESTORE FAIL2BAN CONFIGURATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 27eff97..3ce5a5e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -186,6 +186,12 @@ ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_fil #================================================= # GENERIC FINALIZATION +#================================================= +# SETUP LOGROTATE +#================================================= + +ynh_use_logrotate --non-append + #================================================= # SECURE FILES AND DIRECTORIES #=================================================