From c06de60ee1dc10b8c81189ba1e90bb9377a90c0e Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 5 Dec 2021 12:16:14 +0100 Subject: [PATCH 1/9] Set config-panel to last version --- config_panel.toml | 1 - scripts/config | 8 +------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index 4781511..19adf43 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -1,5 +1,4 @@ version = "1.0" -name = "Leed configuration panel" [main] name = "Leed configuration" diff --git a/scripts/config b/scripts/config index 1298891..3316229 100644 --- a/scripts/config +++ b/scripts/config @@ -145,10 +145,4 @@ apply_config() { #================================================= # GENERIC FINALIZATION #================================================= -# SELECT THE ACTION FOLLOWING THE GIVEN ARGUMENT -#================================================= - -case $1 in - show) show_config;; - apply) apply_config;; -esac +ynh_app_config_run $1 From e60a52abd4d621179b6aa90dde9d7500731559b8 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 25 Jan 2022 00:20:31 +0100 Subject: [PATCH 2/9] We don't need YEP.md nor CHANGELOG.md ... --- CHANGELOG.md | 53 ----------------------- YEP.md | 117 --------------------------------------------------- 2 files changed, 170 deletions(-) delete mode 100644 CHANGELOG.md delete mode 100644 YEP.md diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 53fa643..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,53 +0,0 @@ -Changelog -========= - -## Unreleased -- Nothing for now... - -## [1.8.3~ynh7](https://github.com/YunoHost-Apps/leed_ynh/pull/18) - 2019-03-12 - -#### Changed -- [Normalization from example_ynh](https://github.com/YunoHost-Apps/leed_ynh/commit/1418b13ff9c3d2f1849ad21b5c645609e3bea863) - - -## [1.8.3~ynh6](https://github.com/YunoHost-Apps/leed_ynh/pull/17) - 2019-02-03 - -#### Added -- [Add progression bar](https://github.com/YunoHost-Apps/leed_ynh/commit/9085643892836479b8c33bba6f5054512e4d441f) -* [Changelog & ahtml email](https://github.com/YunoHost-Apps/leed_ynh/commit/298f9ebf5767be9c6e163708cc69121a67aca1ed) - -#### Changed -- [Update php and nginx conf files to php7](https://github.com/YunoHost-Apps/leed_ynh/commit/1b1b0a4b906edb03a38262f9a63d9d72742480cd) - - -## [1.8.3~ynh5](https://github.com/YunoHost-Apps/leed_ynh/pull/16) - 2019-01-21 - -#### Added -- [Advertise config-panel and actions](https://github.com/YunoHost-Apps/leed_ynh/commit/c725a8e6b529d2e595022f860de58bd091390a0b) - -#### Changed -- [Update to last standart](https://github.com/YunoHost-Apps/leed_ynh/commit/92d36df30a9ea32a6c9e8a0dfa1f406fe7a49be3) - - -## [1.8.3~ynh4](https://github.com/YunoHost-Apps/leed_ynh/pull/15) - 2018-09-30 - -#### Added -* [Add Panel-config and actions](https://github.com/YunoHost-Apps/leed_ynh/commit/83253f60ff31f0ac7a4fe29e80e79c0cebbd3ad1) - - -## [1.8.3~ynh4](https://github.com/YunoHost-Apps/leed_ynh/pull/14) - 2018-08-05 - -#### Fixed -- [Fix fail2ban helper](https://github.com/YunoHost-Apps/leed_ynh/commit/c4b966ff2a977b8c0923d4f8ad403d86454883cb) - - -## [1.8.3~ynh4](https://github.com/YunoHost-Apps/leed_ynh/pull/13) - 2018-07-16 - -#### Changed -- [Upgrade helpers](https://github.com/YunoHost-Apps/leed_ynh/commit/5cb8744ee1145971518328b242edd68b7ec1310c) - - -## [1.8.3~ynh3](https://github.com/YunoHost-Apps/leed_ynh/pull/11) - 2018-03-14 - -#### Changed -- [Update helpers](https://github.com/YunoHost-Apps/leed_ynh/commit/1952ec18681135ecd13d32e53ecf86684ad1ff29) diff --git a/YEP.md b/YEP.md deleted file mode 100644 index 5bf13c5..0000000 --- a/YEP.md +++ /dev/null @@ -1,117 +0,0 @@ -#### [Level 0](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-0) -[YEP 1.1 - Nommer son app et son dépot](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-11) -`Validated` -[YEP 1.2 - Inscrire l'app sur un "répertoire" connu](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-12) -`Validated` - -#### [Level 1](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-1) -[YEP 2.2 - Utiliser bash pour les scripts principaux](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-22) -`Validated` -[YEP 2.5 - Copier correctement des fichiers](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-25) -`Don't know` -[YEP 2.7 - Donner des permissions suffisantes aux instructions bash](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-27) -`Validated` -[YEP 2.15 - Suivre les instructions d'installation de l'application](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-215) -`Validated` - -#### [Level 2](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-2) -[YEP 1.5 - Mettre à jour régulièrement le statut de l'app](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-11) -`Validated` -[YEP 2.18.2 - Gérer l'installation à la racine d’un nom de domaine](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-2182) -`Validated` - *Automatically verified.* -[YEP 2.18.3 - Gérer l'installation sur un sous-domaine](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-2183) -`Validated` - *Automatically verified.* -[YEP 2.18.4 - Gérer l'installation sur un chemin /path](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-2184) -`Validated` - *Automatically verified.* -[YEP 4.6 - Gère le multi-instance](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-11) -`Validated` - *Automatically verified.* - -#### [Level 3](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-3) -[YEP 2.3 - Sauvegarder les réponses lors de l'installation](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-23) -`Validated` - -#### [Level 4](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-4) -[YEP 4.1 - Lier au ldap](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-41) -`Validated` -[YEP 4.2 - Lier l'authentification au sso](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-42) -`Validated` - -#### [Level 5](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-5) -[YEP 1.3 - Indiquer la licence associée au paquet](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-13) -`Validated` -[YEP 2.1 - Respecter le format du manifeste](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-21) -`Validated` - *Automatically verified.* -[YEP 2.12 - Utiliser les commandes pratiques (helpers)](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-212) -`Validated` -[YEP 2.18.1 - Lancer le script d'installation d'une webapp correctement](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-2181) -`Validated` - -#### [Level 6](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-6) -[YEP 1.4 - Informer sur l'intention de maintenir un paquet](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-14) -`Validated` -[YEP 1.6 - Se tenir informé sur l'évolution du packaging d'apps](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-16) -`Validated` -[YEP 1.7 - Ajouter l'app à l'organisation YunoHost-Apps](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-17) -`Validated` - *Automatically verified.* -[YEP 1.8 - Publier des demandes de test](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-18) -`Validated` -[YEP 1.9 - Documenter l'app](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-19) -`Validated` -[YEP 1.10 - Garder un historique de version propre](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-110) -`Don't know` -[YEP 2.9 - Enlever toutes traces de l'app lors de la suppression](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-29) -`Validated` -[YEP 3.3 - Faciliter le contrôle de l'intégrité des sources](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-33) -`Validated` -[YEP 3.5 - Suivre les recommendations de la documentation de l'app](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-35) -`Validated` -[YEP 3.6 - Mettre à jour les versions contenant des CVE](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-36) -`Validated` -[YEP 4.3 - Fournir un script de sauvegarde YunoHost fonctionnel](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-43) -`Validated` - *Automatically verified.* -[YEP 4.4 - Fournir un script de restauration YunoHost fonctionnel](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-44) -`Validated` - *Automatically verified.* - -#### [Level 7](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-7) -[YEP 2.6 - Annuler l'action si les valeurs d'entrées sont incorrectes](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-26) -`Validated` -[YEP 3.2 - Ouvrir un port correctement](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-32) -`Not applicable` - -#### [Level 8](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-8) -[YEP 2.4 - Détecter et gérer les erreurs](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-24) -`Validated` -[YEP 2.8 - Modifier correctement une configuration système](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-28) -`Validated` -[YEP 2.16 - Vérifier la disponibilité des dépendances sur ARM, x86 et x64](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-216) -`Not yet validated` - *Automatically verified.* -[YEP 2.18.5 - Gérer la tuile YunoHost pour faciliter la navigation entre les applications](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-2185) -`Validated` -[YEP 3.4 - Isoler l'app](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-34) -`Partially validated` -[YEP 4.5 - Utiliser les hooks](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-45) -`Not applicable` - -#### [Level 9](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-9) -[YEP 2.10 - Configurer les logs de l'application](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-210) -`Not applicable` -[YEP 2.11 - Utiliser une variable plutôt que l'app id directement](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-211) -`Validated` -[YEP 2.13 - Traduire le paquet en anglais](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-213) -`Not yet validated` -[YEP 2.14 - Remplir correctement un fichier de conf](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-214) -`Not yet validated` -[YEP 2.17 - Prendre en compte la version d'origine lors des mises à jour](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-217) -`Validated` -[YEP 4.2.1 - Déconnexion](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-421) -`Don't know` - -#### Other YEP -[YEP 3.1 - Ne pas demander ou stocker de mot de passe LDAP](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-31) -`Validated` -[YEP 4.7 - Ajouter un module à la CLI](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-47) -`Not applicable` -[YEP 4.8 - Ajouter un module à l'admin web](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-48) -`Not applicable` - -State of each YEP can be one of these: `Validated`, `Partially validated`, `Not yet validated`, `Not applicable`, `Don't know`. From 0cf45245ebabecf631ff361e7ebdaa5a186d41de Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 25 Jan 2022 00:23:21 +0100 Subject: [PATCH 3/9] Drop config panel --- config_panel.toml | 61 -------------- scripts/actions/public_private | 84 ------------------- scripts/config | 148 --------------------------------- 3 files changed, 293 deletions(-) delete mode 100644 config_panel.toml delete mode 100755 scripts/actions/public_private delete mode 100644 scripts/config diff --git a/config_panel.toml b/config_panel.toml deleted file mode 100644 index 19adf43..0000000 --- a/config_panel.toml +++ /dev/null @@ -1,61 +0,0 @@ -version = "1.0" - -[main] -name = "Leed configuration" - - [main.is_public] - name = "Public access" - - [main.is_public.is_public] - ask = "Is it a public website?" - type = "boolean" - default = true - help = "A public Leed will be accessible for third party apps.
By turning on 'anonymous readers' in Leed configuration, you can made your feeds public." - - - [main.overwrite_files] - name = "Overwriting config files" - - [main.overwrite_files.overwrite_nginx] - ask = "Overwrite the nginx config file?" - type = "boolean" - default = true - help = "If the file is overwritten, a backup will be created." - - [main.overwrite_files.overwrite_phpfpm] - ask = "Overwrite the php-fpm config file?" - type = "boolean" - default = true - help = "If the file is overwritten, a backup will be created." - - - [main.global_config] - name = "Global configuration" - - [main.global_config.email_type] - ask = "Send HTML email to admin?" - type = "boolean" - default = true - help = "Allow app scripts to send HTML mails instead of plain text." - - - [main.php_fpm_config] - name = "PHP-FPM configuration" - - [main.php_fpm_config.footprint] - ask = "Memory footprint of the service?" - choices = ["low", "medium", "high", "specific"] - default = "low" - help = "low <= 20Mb per pool. medium between 20Mb and 40Mb per pool. high > 40Mb per pool.
Use specific to set a value with the following option." - - [main.php_fpm_config.free_footprint] - ask = "Memory footprint of the service?" - type = "number" - default = "0" - help = "Free field to specify exactly the footprint in Mb if you don't want to use one of the three previous values." - - [main.php_fpm_config.usage] - ask = "Expected usage of the service?" - choices = ["low", "medium", "high"] - default = "low" - help = "low: Personal usage, behind the sso. No RAM footprint when not used, but the impact on the processor can be high if many users are using the service.
medium: Low usage, few people or/and publicly accessible. Low RAM footprint, medium processor footprint when used.
high: High usage, frequently visited website. High RAM footprint, but lower on processor usage and quickly responding." diff --git a/scripts/actions/public_private b/scripts/actions/public_private deleted file mode 100755 index 2385e25..0000000 --- a/scripts/actions/public_private +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/bash - -#================================================= -# GENERIC STARTING -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - -source scripts/_common.sh -source /usr/share/yunohost/helpers - -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - -#================================================= -# RETRIEVE ARGUMENTS -#================================================= - -# Get is_public -is_public=${YNH_ACTION_IS_PUBLIC} - -app=${YNH_APP_INSTANCE_NAME:-$YNH_APP_ID} - -#================================================= -# CHECK IF ARGUMENTS ARE CORRECT -#================================================= - -#================================================= -# CHECK IF AN ACTION HAS TO BE DONE -#================================================= - -is_public_old=$(ynh_app_setting_get --app=$app --key=is_public) - -if [ $is_public -eq $is_public_old ] -then - ynh_die --message="is_public is already set as $is_public." --ret_code=0 -fi - -#================================================= -# SPECIFIC ACTION -#================================================= -# MOVE TO PUBLIC OR PRIVATE -#================================================= - -if [ $is_public -eq 0 ]; then - public_private="private" -else - public_private="public" -fi -ynh_script_progression --message="Moving the application to $public_private..." --weight=3 - -if [ $is_public -eq 0 ] -then - ynh_app_setting_delete --app=$app --key=unprotected_uris - # Set the action.php script public for the cron task - ynh_app_setting_set --app=$app --key=skipped_uris --value="/action.php" -else - ynh_app_setting_delete --app=$app --key=skipped_uris - ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" -fi - -ynh_script_progression --message="Upgrading SSOwat configuration..." -# Regen ssowat configuration -yunohost app ssowatconf - -# Update the config of the app -ynh_app_setting_set --app=$app --key=is_public --value=$is_public - -#================================================= -# RELOAD NGINX -#================================================= -ynh_script_progression --message="Reloading nginx web server..." - -ynh_systemd_action --service_name=nginx --action=reload - -#================================================= -# END OF SCRIPT -#================================================= - -ynh_script_progression --message="Execution completed" --last diff --git a/scripts/config b/scripts/config deleted file mode 100644 index 3316229..0000000 --- a/scripts/config +++ /dev/null @@ -1,148 +0,0 @@ -#!/bin/bash - -#================================================= -# GENERIC STARTING -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - -source _common.sh -source /usr/share/yunohost/helpers - -#================================================= -# RETRIEVE ARGUMENTS -#================================================= - -app=${YNH_APP_INSTANCE_NAME:-$YNH_APP_ID} - -final_path=$(ynh_app_setting_get --app=$app --key=final_path) - -#================================================= -# LOAD VALUES -#================================================= - -# Load the real value from the app config or elsewhere. -# Then get the value from the form. -# If the form has a value for a variable, take the value from the form, -# Otherwise, keep the value from the app config. - -# is_public -old_is_public="$(ynh_app_setting_get --app=$app --key=is_public)" -is_public="${YNH_CONFIG_MAIN_IS_PUBLIC_IS_PUBLIC:-$old_is_public}" - -# Overwrite nginx configuration -old_overwrite_nginx="$(ynh_app_setting_get --app=$app --key=overwrite_nginx)" -overwrite_nginx="${YNH_CONFIG_MAIN_OVERWRITE_FILES_OVERWRITE_NGINX:-$old_overwrite_nginx}" - -# Overwrite php-fpm configuration -old_overwrite_phpfpm="$(ynh_app_setting_get --app=$app --key=overwrite_phpfpm)" -overwrite_phpfpm="${YNH_CONFIG_MAIN_OVERWRITE_FILES_OVERWRITE_PHPFPM:-$old_overwrite_phpfpm}" - - -# Type of admin mail configuration -old_admin_mail_html="$(ynh_app_setting_get --app=$app --key=admin_mail_html)" -admin_mail_html="${YNH_CONFIG_MAIN_GLOBAL_CONFIG_EMAIL_TYPE:-$old_admin_mail_html}" - - -# Footprint for php-fpm -old_fpm_footprint="$(ynh_app_setting_get --app=$app --key=fpm_footprint)" -fpm_footprint="${YNH_CONFIG_MAIN_PHP_FPM_CONFIG_FOOTPRINT:-$old_fpm_footprint}" - -# Free footprint value for php-fpm -# Check if fpm_footprint is an integer -if [ "$fpm_footprint" -eq "$fpm_footprint" ] 2> /dev/null -then - # If fpm_footprint is an integer, that's a numeric value for the footprint - old_free_footprint=$fpm_footprint - fpm_footprint=specific -else - old_free_footprint=0 -fi -free_footprint="${YNH_CONFIG_MAIN_PHP_FPM_CONFIG_FREE_FOOTPRINT:-$old_free_footprint}" - -# Usage for php-fpm -old_fpm_usage="$(ynh_app_setting_get --app=$app --key=fpm_usage)" -fpm_usage="${YNH_CONFIG_MAIN_PHP_FPM_CONFIG_USAGE:-$old_fpm_usage}" - -#================================================= -# SHOW_CONFIG FUNCTION FOR 'SHOW' COMMAND -#================================================= - -show_config() { - # here you are supposed to read some config file/database/other then print the values - # ynh_return "YNH_CONFIG_${PANEL_ID}_${SECTION_ID}_${OPTION_ID}=value" - - ynh_return "YNH_CONFIG_MAIN_IS_PUBLIC_IS_PUBLIC=$is_public" - - ynh_return "YNH_CONFIG_MAIN_OVERWRITE_FILES_OVERWRITE_NGINX=$overwrite_nginx" - ynh_return "YNH_CONFIG_MAIN_OVERWRITE_FILES_OVERWRITE_PHPFPM=$overwrite_phpfpm" - - ynh_return "YNH_CONFIG_MAIN_GLOBAL_CONFIG_EMAIL_TYPE=$admin_mail_html" - - ynh_return "YNH_CONFIG_MAIN_PHP_FPM_CONFIG_FOOTPRINT=$fpm_footprint" - ynh_return "YNH_CONFIG_MAIN_PHP_FPM_CONFIG_FREE_FOOTPRINT=$free_footprint" - ynh_return "YNH_CONFIG_MAIN_PHP_FPM_CONFIG_USAGE=$fpm_usage" -} - -#================================================= -# MODIFY THE CONFIGURATION -#================================================= - -apply_config() { - - #================================================= - # MODIFY PUBLIC ACCESSIBILITY - #================================================= - - # Change public accessibility - if [ "$is_public" != "$old_is_public" ] - then - if [ "$is_public" = "1" ] - then - yunohost app action run $app public_private --args is_public=1 - else - yunohost app action run $app public_private --args is_public=0 - fi - fi - - #================================================= - # MODIFY OVERWRITTING SETTINGS - #================================================= - - # Set overwrite_nginx - ynh_app_setting_set --app=$app --key=overwrite_nginx --value="$overwrite_nginx" - # Set overwrite_phpfpm - ynh_app_setting_set --app=$app --key=overwrite_phpfpm --value="$overwrite_phpfpm" - - #================================================= - # MODIFY EMAIL SETTING - #================================================= - - # Set admin_mail_html - ynh_app_setting_set --app=$app --key=admin_mail_html --value="$admin_mail_html" - - #================================================= - # RECONFIGURE PHP-FPM - #================================================= - - if [ "$fpm_usage" != "$old_fpm_usage" ] || [ "$fpm_footprint" != "$old_fpm_footprint" ] || [ "$free_footprint" != "$old_free_footprint" ] - then - # If fpm_footprint is set to 'specific', use $free_footprint value. - if [ "$fpm_footprint" = "specific" ] - then - fpm_footprint=$free_footprint - fi - - if [ "$fpm_footprint" != "0" ] - then - ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint - else - ynh_print_err --message="When selecting 'specific', you have to set a footprint value into the field below." - fi - fi -} - -#================================================= -# GENERIC FINALIZATION -#================================================= -ynh_app_config_run $1 From 34ceafbe882b398fe1f11c09094a1418821ad12b Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 19 Oct 2022 21:30:44 +0000 Subject: [PATCH 4/9] Auto-update README --- README.md | 19 +++++++++---------- README_fr.md | 25 ++++++++++++++----------- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 5d3c172..1a98387 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ It shall NOT be edited by hand. # Leed for YunoHost -[![Integration level](https://dash.yunohost.org/integration/leed.svg)](https://dash.yunohost.org/appci/app/leed) ![](https://ci-apps.yunohost.org/ci/badges/leed.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/leed.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/leed.svg)](https://dash.yunohost.org/appci/app/leed) ![Working status](https://ci-apps.yunohost.org/ci/badges/leed.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/leed.maintain.svg) [![Install Leed with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=leed) *[Lire ce readme en français.](./README_fr.md)* @@ -20,28 +20,27 @@ Leed (short for Light Feed) is a minimalist RSS/ATOM aggregator which offers fas **Shipped version:** 1.9.0~ynh3 - - ## Screenshots -![](./doc/screenshots/leed1.jpg) +![Screenshot of Leed](./doc/screenshots/leed1.jpg) ## Documentation and resources -* Official app website: http://leed.idleman.fr/ -* Upstream app code repository: http://git.idleman.fr/LeedRSS/Leed -* YunoHost documentation for this app: https://yunohost.org/app_leed -* Report a bug: https://github.com/YunoHost-Apps/leed_ynh/issues +* Official app website: +* Upstream app code repository: +* YunoHost documentation for this app: +* Report a bug: ## Developer info Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/leed_ynh/tree/testing). To try the testing branch, please proceed like that. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/leed_ynh/tree/testing --debug or sudo yunohost app upgrade leed -u https://github.com/YunoHost-Apps/leed_ynh/tree/testing --debug ``` -**More info regarding app packaging:** https://yunohost.org/packaging_apps \ No newline at end of file +**More info regarding app packaging:** diff --git a/README_fr.md b/README_fr.md index 13e2958..64b836b 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,10 +1,14 @@ + + # Leed pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/leed.svg)](https://dash.yunohost.org/appci/app/leed) ![](https://ci-apps.yunohost.org/ci/badges/leed.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/leed.maintain.svg) +[![Niveau d'intégration](https://dash.yunohost.org/integration/leed.svg)](https://dash.yunohost.org/appci/app/leed) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/leed.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/leed.maintain.svg) [![Installer Leed avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=leed) *[Read this readme in english.](./README.md)* -*[Lire ce readme en français.](./README_fr.md)* > *Ce package vous permet d'installer Leed 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.* @@ -15,28 +19,27 @@ Leed (contraction de Light Feed) est un agrégateur RSS/ATOM minimaliste qui per **Version incluse :** 1.9.0~ynh3 - - ## Captures d'écran -![](./doc/screenshots/leed1.jpg) +![Capture d'écran de Leed](./doc/screenshots/leed1.jpg) ## Documentations et ressources -* Site officiel de l'app : http://leed.idleman.fr/ -* Dépôt de code officiel de l'app : http://git.idleman.fr/LeedRSS/Leed -* Documentation YunoHost pour cette app : https://yunohost.org/app_leed -* Signaler un bug : https://github.com/YunoHost-Apps/leed_ynh/issues +* Site officiel de l'app : +* Dépôt de code officiel de l'app : +* Documentation YunoHost pour cette app : +* Signaler un bug : ## Informations pour les développeurs Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/leed_ynh/tree/testing). Pour essayer la branche testing, procédez comme suit. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/leed_ynh/tree/testing --debug ou sudo yunohost app upgrade leed -u https://github.com/YunoHost-Apps/leed_ynh/tree/testing --debug ``` -**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps \ No newline at end of file +**Plus d'infos sur le packaging d'applications :** From c100fd54da9b43c2c942ceacc258e020e983d4b6 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 20 Oct 2022 00:14:07 +0200 Subject: [PATCH 5/9] Upgrade to 1.11.0~ynh1 --- .github/workflows/updater.sh | 49 +++-------- .github/workflows/updater.yml | 49 +++++++++++ check_process | 28 ++----- conf/app.src | 5 +- conf/nginx.conf | 5 +- doc/DISCLAIMER.md | 0 doc/DISCLAIMER_fr.md | 0 manifest.json | 148 +++++++++++++++++----------------- scripts/_common.sh | 13 ++- scripts/backup | 5 +- scripts/change_url | 12 +-- scripts/install | 44 ++++++---- scripts/remove | 18 +++-- scripts/restore | 54 ++++++++----- scripts/upgrade | 45 ++++++----- 15 files changed, 272 insertions(+), 203 deletions(-) create mode 100644 .github/workflows/updater.yml create mode 100644 doc/DISCLAIMER.md create mode 100644 doc/DISCLAIMER_fr.md diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh index 89f6e64..94bb411 100755 --- a/.github/workflows/updater.sh +++ b/.github/workflows/updater.sh @@ -9,9 +9,6 @@ # Since each app is different, maintainers can adapt its contents so as to perform # automatic actions when a new upstream release is detected. -# Remove this exit command when you are ready to run this Action -#exit 1 - #================================================= # FETCHING LATEST RELEASE AND ITS ASSETS #================================================= @@ -21,58 +18,43 @@ current_version=$(cat manifest.json | jq -j '.version|split("~")[0]') repo=$(cat manifest.json | jq -j '.upstream.code|split("https://github.com/")[1]') # Some jq magic is needed, because the latest upstream release is not always the latest version (e.g. security patches for older versions) version=$(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '.[] | select( .prerelease != true ) | .tag_name' | sort -V | tail -1) -assets=($(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '[ .[] | select(.tag_name=="'$version'").assets[].browser_download_url ] | join(" ") | @sh' | tr -d "'")) +assets="https://github.com/$repo/archive/refs/tags/$version.tar.gz" # Later down the script, we assume the version has only digits and dots # Sometimes the release name starts with a "v", so let's filter it out. -# You may need more tweaks here if the upstream repository has different naming conventions. +# You may need more tweaks here if the upstream repository has different naming conventions. if [[ ${version:0:1} == "v" || ${version:0:1} == "V" ]]; then - version=${version:1} + version=${version:1} fi # Setting up the environment variables echo "Current version: $current_version" echo "Latest release from upstream: $version" echo "VERSION=$version" >> $GITHUB_ENV +echo "REPO=$repo" >> $GITHUB_ENV # For the time being, let's assume the script will fail echo "PROCEED=false" >> $GITHUB_ENV # Proceed only if the retrieved version is greater than the current one if ! dpkg --compare-versions "$current_version" "lt" "$version" ; then - echo "::warning ::No new version available" - exit 0 + echo "::warning ::No new version available" + exit 0 # Proceed only if a PR for this new version does not already exist elif git ls-remote -q --exit-code --heads https://github.com/$GITHUB_REPOSITORY.git ci-auto-update-v$version ; then - echo "::warning ::A branch already exists for this update" - exit 0 + echo "::warning ::A branch already exists for this update" + exit 0 fi -# Each release can hold multiple assets (e.g. binaries for different architectures, source code, etc.) -echo "${#assets[@]} available asset(s)" - #================================================= # UPDATE SOURCE FILES #================================================= -# Here we use the $assets variable to get the resources published in the upstream release. -# Here is an example for Grav, it has to be adapted in accordance with how the upstream releases look like. - -# Let's loop over the array of assets URLs -for asset_url in ${assets[@]}; do +# Let's download source tarball +asset_url=$assets echo "Handling asset at $asset_url" -# Assign the asset to a source file in conf/ directory -# Here we base the source file name upon a unique keyword in the assets url (admin vs. update) -# Leave $src empty to ignore the asset -case $asset_url in - "v"*".tar.gz") - src="app" - ;; -esac - -# If $src is not empty, let's process the asset -if [ ! -z "$src" ]; then +src="app" # Create the temporary directory tempdir="$(mktemp -d)" @@ -97,18 +79,13 @@ cat < conf/$src.src SOURCE_URL=$asset_url SOURCE_SUM=$checksum SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz +SOURCE_FORMAT=$extension SOURCE_IN_SUBDIR=true +SOURCE_FILENAME= SOURCE_EXTRACT=true EOT echo "... conf/$src.src updated" -else -echo "... asset ignored" -fi - -done - #================================================= # SPECIFIC UPDATE STEPS #================================================= diff --git a/.github/workflows/updater.yml b/.github/workflows/updater.yml new file mode 100644 index 0000000..fb72ba0 --- /dev/null +++ b/.github/workflows/updater.yml @@ -0,0 +1,49 @@ +# This workflow allows GitHub Actions to automagically update your app whenever a new upstream release is detected. +# You need to enable Actions in your repository settings, and fetch this Action from the YunoHost-Apps organization. +# This file should be enough by itself, but feel free to tune it to your needs. +# It calls updater.sh, which is where you should put the app-specific update steps. +name: Check for new upstream releases +on: + # Allow to manually trigger the workflow + workflow_dispatch: + # Run it every day at 6:00 UTC + schedule: + - cron: '0 6 * * *' +jobs: + updater: + runs-on: ubuntu-latest + steps: + - name: Fetch the source code + uses: actions/checkout@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Run the updater script + id: run_updater + run: | + # Setting up Git user + git config --global user.name 'yunohost-bot' + git config --global user.email 'yunohost-bot@users.noreply.github.com' + # Run the updater script + /bin/bash .github/workflows/updater.sh + - name: Commit changes + id: commit + if: ${{ env.PROCEED == 'true' }} + run: | + git commit -am "Upgrade to v$VERSION" + - name: Create Pull Request + id: cpr + if: ${{ env.PROCEED == 'true' }} + uses: peter-evans/create-pull-request@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: Update to version ${{ env.VERSION }} + committer: 'yunohost-bot ' + author: 'yunohost-bot ' + signoff: false + base: testing + branch: ci-auto-update-v${{ env.VERSION }} + delete-branch: true + title: 'Upgrade to version ${{ env.VERSION }}' + body: | + Upgrade to v${{ env.VERSION }} + draft: false diff --git a/check_process b/check_process index a8960f0..64dacc0 100644 --- a/check_process +++ b/check_process @@ -1,22 +1,13 @@ ;; Test complet ; Manifest domain="domain.tld" - path="/leed" - admin="john" - password="pass" - language="fr" - market=1 + path="/path" is_public=1 + language="fr" + admin="john" + password="1Strong-Password" ; Actions is_public=0|1 - ; Config_panel - main.is_public.is_public=0|1 - main.overwrite_files.overwrite_nginx=0|1 - main.overwrite_files.overwrite_phpfpm=0|1 - main.global_config.email_type=0|1 - main.php_fpm_config.footprint=low|medium|high - main.php_fpm_config.free_footprint=20 - main.php_fpm_config.usage=low|medium|high ; Checks pkg_linter=1 setup_sub_dir=1 @@ -25,21 +16,12 @@ setup_private=1 setup_public=1 upgrade=1 - # upgrade=1 from_commit=8b622d430db9ab860aee156a32086507669243fd # 1.8.3~ynh10 upgrade=1 from_commit=ea31e4850ded0939c1b0d024db8f45325fcebac1 backup_restore=1 multi_instance=1 port_already_use=0 change_url=1 - actions=0 - config_panel=0 ;;; Options Email= -Notification=change -;;; Upgrade options - ; commit=8b622d430db9ab860aee156a32086507669243fd - name=MAJ 1.8.2 - manifest_arg=domain=DOMAIN&path=PATH&admin=USER&password=pass&language=fr&market=1&is_public=1& - ; commit=ea31e4850ded0939c1b0d024db8f45325fcebac1 - name=1.8.3~ynh10 +Notification=none diff --git a/conf/app.src b/conf/app.src index f3251ab..d70f7a6 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,6 +1,7 @@ -SOURCE_URL=https://github.com/LeedRSS/Leed/archive/v1.9.0.tar.gz -SOURCE_SUM=e8a9c4586234169e2dd96e6c6e90e140a2336950c3b259947b70b0b0b6ff903c +SOURCE_URL=https://github.com/LeedRSS/Leed/archive/refs/tags/v1.11.0.tar.gz +SOURCE_SUM=3a3f6e2201f7cc0ee10a4f610b0cf1ace18166a6d21e37ab1ae5283920500c87 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true +SOURCE_FILENAME= SOURCE_EXTRACT=true diff --git a/conf/nginx.conf b/conf/nginx.conf index 51c7570..d9fdc4e 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -2,10 +2,13 @@ location __PATH__/ { # Path to source - alias __FINALPATH__/ ; + alias __FINALPATH__/; index index.php; + # Common parameter to increase upload size limit in conjunction with dedicated php-fpm file + #client_max_body_size 50M; + try_files $uri $uri/ index.php; location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md new file mode 100644 index 0000000..e69de29 diff --git a/doc/DISCLAIMER_fr.md b/doc/DISCLAIMER_fr.md new file mode 100644 index 0000000..e69de29 diff --git a/manifest.json b/manifest.json index 5a213bb..81d957a 100644 --- a/manifest.json +++ b/manifest.json @@ -1,75 +1,79 @@ { - "name": "Leed", - "id": "leed", - "packaging_format": 1, - "description": { - "en": "Minimalistic RSS feed aggregator which allows quick and non-intrusive reading of feeds", - "fr": "Agrégateur RSS minimaliste qui permet la consultation de flux RSS de manière rapide et non intrusive" - }, - "version": "1.9.0~ynh3", - "url": "http://leed.idleman.fr/", - "upstream": { - "license": "AGPL-3.0", - "website": "http://leed.idleman.fr/", - "code": "http://git.idleman.fr/LeedRSS/Leed" + "name": "Leed", + "id": "leed", + "packaging_format": 1, + "description": { + "en": "Minimalistic RSS feed aggregator which allows quick and non-intrusive reading of feeds", + "fr": "Agrégateur RSS minimaliste qui permet la consultation de flux RSS de manière rapide et non intrusive" }, - "license": "AGPL-3.0", - "maintainer": { - "name": "", - "email": "" - }, - "previous_maintainers": [{ - "name": "Maniack Crudelis", - "email": "maniackc_dev@crudelis.fr" - }], - "requirements": { - "yunohost": ">= 4.3.0" - }, - "multi_instance": true, - "services": [ - "nginx", - "php7.3-fpm", - "mysql" - ], - "arguments": { - "install" : [ - { - "name": "domain", - "type": "domain" - }, - { - "name": "path", - "type": "path", - "example": "/leed", - "default": "/leed" - }, - { - "name": "admin", - "type": "user" - }, - { - "name": "is_public", - "type": "boolean", - "default": false, - "help": { - "en": "A public Leed will be accessible for third party apps. By turning on 'anonymous readers' in Leed configuration, you can made your feeds public.", - "fr": "Un Leed public sera accessible pour les applications tierces. En autorisant 'la lecture anonyme' dans la configuration de Leed, vous pouvez rendre vos flux publics." - } - }, - { - "name": "language", - "type": "string", - "ask": { - "en": "Choose your agregator's language", - "fr": "Choisissez la langue de votre agrégateur" - }, - "choices" : ["en", "fr", "es"], - "default" : "en" - }, - { - "name": "password", - "type": "password" - } - ] - } + "version": "1.11.0~ynh1", + "upstream": { + "license": "AGPL-3.0", + "code": "https://github.com/LeedRSS/Leed" + }, + "license": "AGPL-3.0", + "maintainer": { + "name": "", + "email": "" + }, + "previous_maintainers": [ + { + "name": "Maniack Crudelis", + "email": "maniackc_dev@crudelis.fr" + } + ], + "requirements": { + "yunohost": ">= 4.3.0" + }, + "multi_instance": true, + "services": [ + "nginx", + "php7.3-fpm", + "mysql" + ], + "arguments": { + "install": [ + { + "name": "domain", + "type": "domain" + }, + { + "name": "path", + "type": "path", + "example": "/leed", + "default": "/leed" + }, + { + "name": "is_public", + "type": "boolean", + "default": false, + "help": { + "en": "A public Leed will be accessible for third party apps. By turning on 'anonymous readers' in Leed configuration, you can made your feeds public.", + "fr": "Un Leed public sera accessible pour les applications tierces. En autorisant 'la lecture anonyme' dans la configuration de Leed, vous pouvez rendre vos flux publics." + } + }, + { + "name": "language", + "type": "string", + "ask": { + "en": "Choose your agregator's language", + "fr": "Choisissez la langue de votre agrégateur" + }, + "choices": [ + "en", + "fr", + "es" + ], + "default": "en" + }, + { + "name": "admin", + "type": "user" + }, + { + "name": "password", + "type": "password" + } + ] + } } diff --git a/scripts/_common.sh b/scripts/_common.sh index 96ffe33..ed43057 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -3,11 +3,16 @@ #================================================= # COMMON VARIABLES #================================================= +# PHP APP SPECIFIC +#================================================= -YNH_PHP_VERSION="7.3" +php_dependencies="php$YNH_DEFAULT_PHP_VERSION-fpm" + +# dependencies used by the app (must be on a single line) +pkg_dependencies="$php_dependencies" #================================================= -# FUTUR OFFICIAL HELPERS +# PERSONAL HELPERS #================================================= #================================================= @@ -444,3 +449,7 @@ ynh_check_ram () { echo $ram fi } + +#================================================= +# FUTURE OFFICIAL HELPERS +#================================================= \ No newline at end of file diff --git a/scripts/backup b/scripts/backup index a999cf3..850f2ad 100644 --- a/scripts/backup +++ b/scripts/backup @@ -14,13 +14,16 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= +ynh_clean_setup () { + true +} # Exit if an error occurs during the execution of the script ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_print_info --message="Loading installation settings..." +ynh_print_info --message="Loading settings..." app=$YNH_APP_INSTANCE_NAME diff --git a/scripts/change_url b/scripts/change_url index dbb52f2..597a076 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -24,7 +24,7 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=2 +ynh_script_progression --message="Loading settings..." --weight=2 # Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get --app=$app --key=final_path) @@ -41,7 +41,7 @@ ynh_maintenance_mode_ON #================================================= # BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." +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 @@ -76,7 +76,7 @@ fi #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression --message="Updating NGINX web server configuration..." +ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf @@ -120,7 +120,7 @@ ynh_replace_string --match_string="https://$old_domain${old_path}" --replace_str #================================================= # UPDATE THE DATABASE #================================================= -ynh_script_progression --message="Updating the database..." +ynh_script_progression --message="Updating the database..." --weight=1 ynh_mysql_execute_as_root --sql="UPDATE leed_configuration SET value='$domain_path/' WHERE value LIKE '%${old_domain}%'" --database=$app @@ -129,14 +129,14 @@ ynh_mysql_execute_as_root --sql="UPDATE leed_configuration SET value='$domain_pa #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload #================================================= # DEACTIVE MAINTENANCE MODE #================================================= -ynh_script_progression --message="Disabling maintenance mode..." +ynh_script_progression --message="Disabling maintenance mode..." --weight=1 path_url=$old_path domain=$old_domain diff --git a/scripts/install b/scripts/install index 5c6280c..4857e1d 100644 --- a/scripts/install +++ b/scripts/install @@ -13,6 +13,9 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= +ynh_clean_setup () { + true +} # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -22,10 +25,10 @@ ynh_abort_if_errors domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH -admin=$YNH_APP_ARG_ADMIN is_public=$YNH_APP_ARG_IS_PUBLIC language=$YNH_APP_ARG_LANGUAGE -user_pwd=$YNH_APP_ARG_PASSWORD +admin=$YNH_APP_ARG_ADMIN +password=$YNH_APP_ARG_PASSWORD app=$YNH_APP_INSTANCE_NAME @@ -47,26 +50,33 @@ ynh_script_progression --message="Storing installation settings..." --weight=2 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=language --value=$language +ynh_app_setting_set --app=$app --key=admin --value=$admin ynh_app_setting_set --app=$app --key=overwrite_nginx --value=1 ynh_app_setting_set --app=$app --key=overwrite_phpfpm --value=1 ynh_app_setting_set --app=$app --key=admin_mail_html --value=1 #================================================= # STANDARD MODIFICATIONS +#================================================= +# INSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Installing dependencies..." --weight=1 + +ynh_install_app_dependencies $pkg_dependencies + #================================================= # CREATE DEDICATED USER #================================================= ynh_script_progression --message="Configuring system user..." --weight=2 # Create a system user -ynh_system_user_create --username=$app --home_dir=$final_path +ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # CREATE A MYSQL DATABASE #================================================= -ynh_script_progression --message="Creating a MySQL database..." +ynh_script_progression --message="Creating a MySQL database..." --weight=1 db_name=$(ynh_sanitize_dbid --db_name=$app) db_user=$db_name @@ -86,14 +96,6 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Configuring NGINX web server..." --weight=2 - -# Create a dedicated NGINX config -ynh_add_nginx_config - #================================================= # PHP-FPM CONFIGURATION #================================================= @@ -103,6 +105,14 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 ynh_add_fpm_config --usage=low --footprint=low phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +#================================================= +# NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Configuring NGINX web server..." --weight=2 + +# Create a dedicated NGINX config +ynh_add_nginx_config + #================================================= # SPECIFIC SETUP #================================================= @@ -116,7 +126,7 @@ ynh_permission_update --permission="main" --add="visitors" # Installation with curl ynh_script_progression --message="Finalizing installation..." -ynh_local_curl "/install.php?installButton" "install_changeLngLeed=$language" "root=$domain$path_url" "mysqlHost=localhost" "mysqlLogin=$db_name" "mysqlMdp=$db_pwd" "mysqlBase=$db_name" "mysqlPrefix=leed_" "login=$admin" "password=$user_pwd" +ynh_local_curl "/install.php?installButton" "install_changeLngLeed=$language" "root=$domain$path_url" "mysqlHost=localhost" "mysqlLogin=$db_user" "mysqlMdp=$db_pwd" "mysqlBase=$db_name" "mysqlPrefix=leed_" "login=$admin" "password=$password" # Remove the public access ynh_permission_update --permission="main" --remove="visitors" @@ -125,7 +135,7 @@ ynh_permission_update --permission="main" --remove="visitors" # RETRIEVE SYNCHRONISATION CODE #================================================= -code_sync=$(mysql -h localhost -u $db_name -p$db_pwd -s $db_name -e 'SELECT value FROM leed_configuration WHERE `key`="synchronisationCode"' | sed -n 1p) +code_sync=$(mysql -h localhost -u $db_user -p$db_pwd -s $db_name -e 'SELECT value FROM leed_configuration WHERE `key`="synchronisationCode"' | sed -n 1p) #================================================= # SETUP CRON FILE FOR SYNCHRONISATION @@ -152,6 +162,8 @@ ynh_script_progression --message="Configuring permissions..." --weight=2 # 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" fi @@ -169,7 +181,7 @@ ynh_systemd_action --service_name=nginx --action=reload # Get main domain and buid the url of the admin panel of the app. admin_panel="https://$(grep portal_domain /etc/ssowat/conf.json | cut -d'"' -f4)/yunohost/admin/#/apps/$app" -echo "Please take note of your password for this application: '$user_pwd'. +echo "Please take note of your password for this application: '$password'. You can configure this app easily by using the experimental __URL_TAG1__config-panel feature__URL_TAG2__$admin_panel/config-panel__URL_TAG3__. You can also find some specific actions for this app by using the experimental __URL_TAG1__action feature__URL_TAG2__$admin_panel/actions__URL_TAG3__. diff --git a/scripts/remove b/scripts/remove index 42e8c1f..10ed4c5 100644 --- a/scripts/remove +++ b/scripts/remove @@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=2 +ynh_script_progression --message="Loading settings..." --weight=2 app=$YNH_APP_INSTANCE_NAME @@ -26,7 +26,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= # REMOVE THE MYSQL DATABASE #================================================= -ynh_script_progression --message="Removing the MySQL database..." +ynh_script_progression --message="Removing the MySQL database..." --weight=1 # Remove a database if it exists, along with the associated user ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name @@ -34,7 +34,7 @@ ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory..." +ynh_script_progression --message="Removing app main directory..." --weight=1 # Remove the app directory securely ynh_secure_remove --file="$final_path" @@ -50,11 +50,19 @@ ynh_remove_nginx_config #================================================= # REMOVE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Removing PHP-FPM configuration..." +ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=1 # Remove the dedicated PHP-FPM config ynh_remove_fpm_config +#================================================= +# REMOVE DEPENDENCIES +#================================================= +ynh_script_progression --message="Removing dependencies..." --weight=1 + +# Remove metapackage and its dependencies +ynh_remove_app_dependencies + #================================================= # REMOVE FAIL2BAN CONFIGURATION #================================================= @@ -68,7 +76,7 @@ ynh_remove_fail2ban_config #================================================= # REMOVE VARIOUS FILES #================================================= -ynh_script_progression --message="Removing various files..." +ynh_script_progression --message="Removing various files..." --weight=1 # Remove a cron file ynh_secure_remove --file="/etc/cron.d/$app" diff --git a/scripts/restore b/scripts/restore index 151572f..aa59466 100644 --- a/scripts/restore +++ b/scripts/restore @@ -14,13 +14,16 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= +ynh_clean_setup () { + true +} # Exit if an error occurs during the execution of the script ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=2 +ynh_script_progression --message="Loading settings..." --weight=2 app=$YNH_APP_INSTANCE_NAME @@ -35,9 +38,10 @@ admin=$(ynh_app_setting_get --app=$app --key=admin) #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= -ynh_script_progression --message="Validating restoration parameters..." +ynh_script_progression --message="Validating restoration parameters..." --weight=1 -test ! -d $final_path || ynh_die --message="There is already a directory: $final_path " +test ! -d $final_path \ + || ynh_die --message="There is already a directory: $final_path " #================================================= # ACTIVATE MAINTENANCE MODE @@ -48,25 +52,18 @@ ynh_maintenance_mode_ON #================================================= # STANDARD RESTORATION STEPS -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX configuration..." - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - #================================================= # RECREATE THE DEDICATED USER #================================================= ynh_script_progression --message="Recreating the dedicated system user..." --weight=2 # Create the dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir=$final_path +ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring the app main directory..." +ynh_script_progression --message="Restoring the app main directory..." --weight=1 ynh_restore_file --origin_path="$final_path" @@ -74,13 +71,6 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" -#================================================= -# RESTORE THE PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the PHP-FPM configuration..." - -ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" - #================================================= # RESTORE FAIL2BAN CONFIGURATION #================================================= @@ -92,6 +82,28 @@ ynh_systemd_action --action=restart --service_name=fail2ban #================================================= # SPECIFIC RESTORATION +#================================================= +# REINSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Reinstalling dependencies..." --weight=1 + +# Define and install dependencies +ynh_install_app_dependencies $pkg_dependencies + +#================================================= +# RESTORE THE PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=1 + +ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" + +#================================================= +# RESTORE THE NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1 + +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" + #================================================= # RESTORE THE MYSQL DATABASE #================================================= @@ -104,7 +116,7 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./ #================================================= # RESTORE VARIOUS FILES #================================================= -ynh_script_progression --message="Restoring various files..." +ynh_script_progression --message="Restoring various files..." --weight=1 ynh_restore_file --origin_path="/etc/cron.d/$app" @@ -113,7 +125,7 @@ ynh_restore_file --origin_path="/etc/cron.d/$app" #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." +ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --weight=1 ynh_systemd_action --service_name=php$phpversion-fpm --action=reload ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index a374c99..801f387 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=3 +ynh_script_progression --message="Loading settings..." --weight=3 app=$YNH_APP_INSTANCE_NAME @@ -20,8 +20,10 @@ 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) final_path=$(ynh_app_setting_get --app=$app --key=final_path) -db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) db_name=$(ynh_app_setting_get --app=$app --key=db_name) +db_user=$db_name +db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) overwrite_nginx=$(ynh_app_setting_get --app=$app --key=overwrite_nginx) overwrite_phpfpm=$(ynh_app_setting_get --app=$app --key=overwrite_phpfpm) @@ -29,11 +31,11 @@ admin_mail_html=$(ynh_app_setting_get --app=$app --key=admin_mail_html) fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # CHECK VERSION #================================================= +ynh_script_progression --message="Checking version..." --weight=1 upgrade_type=$(ynh_check_app_version_changed) @@ -54,7 +56,7 @@ ynh_abort_if_errors #================================================= # ACTIVATE MAINTENANCE MODE #================================================= -ynh_script_progression --message="Activating maintenance mode..." +ynh_script_progression --message="Activating maintenance mode..." --weight=1 ynh_maintenance_mode_ON @@ -63,7 +65,7 @@ ynh_maintenance_mode_ON #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= -ynh_script_progression --message="Ensuring downward compatibility..." +ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 # If final_path doesn't exist, create it if [ -z "$final_path" ]; then @@ -129,10 +131,10 @@ fi #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." +ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 # Create a dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir=$final_path +ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -151,16 +153,11 @@ chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" #================================================= -# NGINX CONFIGURATION +# UPGRADE DEPENDENCIES #================================================= +ynh_script_progression --message="Upgrading dependencies..." --weight=1 -# Overwrite the nginx configuration only if it's allowed -if [ $overwrite_nginx -eq 1 ] -then - ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2 - # Create a dedicated NGINX config - ynh_add_nginx_config -fi +ynh_install_app_dependencies $pkg_dependencies #================================================= # PHP-FPM CONFIGURATION @@ -174,18 +171,30 @@ then ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint fi +#================================================= +# NGINX CONFIGURATION +#================================================= + +# Overwrite the nginx configuration only if it's allowed +if [ $overwrite_nginx -eq 1 ] +then + ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2 + # Create a dedicated NGINX config + ynh_add_nginx_config +fi + #================================================= # SPECIFIC UPGRADE #================================================= # RETRIEVE SYNCHRONISATION CODE #================================================= -code_sync=$(mysql -h localhost -u $db_name -p$db_pwd -s $db_name -e 'SELECT value FROM leed_configuration WHERE `key`="synchronisationCode"' | sed -n 1p) +code_sync=$(mysql -h localhost -u $db_user -p$db_pwd -s $db_name -e 'SELECT value FROM leed_configuration WHERE `key`="synchronisationCode"' | sed -n 1p) #================================================= # SETUP CRON FILE FOR SYNCHRONISATION #================================================= -ynh_script_progression --message="Setting up a cron file..." +ynh_script_progression --message="Setting up a cron file..." --weight=1 ynh_add_config --template="../conf/cron_leed" --destination="/etc/cron.d/$app" @@ -220,7 +229,7 @@ ynh_systemd_action --service_name=nginx --action=reload #================================================= # DEACTIVE MAINTENANCE MODE #================================================= -ynh_script_progression --message="Disabling maintenance mode..." +ynh_script_progression --message="Disabling maintenance mode..." --weight=1 ynh_maintenance_mode_OFF From 6d94d3a72f401ae2104cb8a0e34cad608687505d Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 19 Oct 2022 22:14:13 +0000 Subject: [PATCH 6/9] Auto-update README --- README.md | 5 ++--- README_fr.md | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 1a98387..b82c6ac 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Leed (short for Light Feed) is a minimalist RSS/ATOM aggregator which offers fast RSS consultation and non-intrusive features. -**Shipped version:** 1.9.0~ynh3 +**Shipped version:** 1.11.0~ynh1 ## Screenshots @@ -26,8 +26,7 @@ Leed (short for Light Feed) is a minimalist RSS/ATOM aggregator which offers fas ## Documentation and resources -* Official app website: -* Upstream app code repository: +* Upstream app code repository: * YunoHost documentation for this app: * Report a bug: diff --git a/README_fr.md b/README_fr.md index 64b836b..c159cca 100644 --- a/README_fr.md +++ b/README_fr.md @@ -17,7 +17,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Leed (contraction de Light Feed) est un agrégateur RSS/ATOM minimaliste qui permet la consultation de flux RSS de manière rapide et non intrusive. -**Version incluse :** 1.9.0~ynh3 +**Version incluse :** 1.11.0~ynh1 ## Captures d'écran @@ -25,8 +25,7 @@ Leed (contraction de Light Feed) est un agrégateur RSS/ATOM minimaliste qui per ## Documentations et ressources -* Site officiel de l'app : -* Dépôt de code officiel de l'app : +* Dépôt de code officiel de l'app : * Documentation YunoHost pour cette app : * Signaler un bug : From 0cbdaf05a06146d3b40f4ff4e86d0da57949e2ef Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 20 Oct 2022 00:17:46 +0200 Subject: [PATCH 7/9] Update check_process --- check_process | 2 ++ 1 file changed, 2 insertions(+) diff --git a/check_process b/check_process index 64dacc0..39c19db 100644 --- a/check_process +++ b/check_process @@ -18,6 +18,8 @@ upgrade=1 # 1.8.3~ynh10 upgrade=1 from_commit=ea31e4850ded0939c1b0d024db8f45325fcebac1 + # 1.9.0~ynh3 + upgrade=1 from_commit=6c6531b9c43692a07264eaeb01b2d967c09ac0ba backup_restore=1 multi_instance=1 port_already_use=0 From 9ba59e511b3cdc6870581997b4c0b57ee4b0da3e Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 20 Oct 2022 00:44:25 +0200 Subject: [PATCH 8/9] Update manifest.json --- manifest.json | 1 + 1 file changed, 1 insertion(+) diff --git a/manifest.json b/manifest.json index 81d957a..9d97b5c 100644 --- a/manifest.json +++ b/manifest.json @@ -7,6 +7,7 @@ "fr": "Agrégateur RSS minimaliste qui permet la consultation de flux RSS de manière rapide et non intrusive" }, "version": "1.11.0~ynh1", + "url": "https://github.com/LeedRSS/Leed", "upstream": { "license": "AGPL-3.0", "code": "https://github.com/LeedRSS/Leed" From 3d0c0833165b0a608115a96349c64ed06d8c68a8 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 20 Oct 2022 01:51:16 +0200 Subject: [PATCH 9/9] Create CHANGELOG.md --- CHANGELOG.md | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..53fa643 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,53 @@ +Changelog +========= + +## Unreleased +- Nothing for now... + +## [1.8.3~ynh7](https://github.com/YunoHost-Apps/leed_ynh/pull/18) - 2019-03-12 + +#### Changed +- [Normalization from example_ynh](https://github.com/YunoHost-Apps/leed_ynh/commit/1418b13ff9c3d2f1849ad21b5c645609e3bea863) + + +## [1.8.3~ynh6](https://github.com/YunoHost-Apps/leed_ynh/pull/17) - 2019-02-03 + +#### Added +- [Add progression bar](https://github.com/YunoHost-Apps/leed_ynh/commit/9085643892836479b8c33bba6f5054512e4d441f) +* [Changelog & ahtml email](https://github.com/YunoHost-Apps/leed_ynh/commit/298f9ebf5767be9c6e163708cc69121a67aca1ed) + +#### Changed +- [Update php and nginx conf files to php7](https://github.com/YunoHost-Apps/leed_ynh/commit/1b1b0a4b906edb03a38262f9a63d9d72742480cd) + + +## [1.8.3~ynh5](https://github.com/YunoHost-Apps/leed_ynh/pull/16) - 2019-01-21 + +#### Added +- [Advertise config-panel and actions](https://github.com/YunoHost-Apps/leed_ynh/commit/c725a8e6b529d2e595022f860de58bd091390a0b) + +#### Changed +- [Update to last standart](https://github.com/YunoHost-Apps/leed_ynh/commit/92d36df30a9ea32a6c9e8a0dfa1f406fe7a49be3) + + +## [1.8.3~ynh4](https://github.com/YunoHost-Apps/leed_ynh/pull/15) - 2018-09-30 + +#### Added +* [Add Panel-config and actions](https://github.com/YunoHost-Apps/leed_ynh/commit/83253f60ff31f0ac7a4fe29e80e79c0cebbd3ad1) + + +## [1.8.3~ynh4](https://github.com/YunoHost-Apps/leed_ynh/pull/14) - 2018-08-05 + +#### Fixed +- [Fix fail2ban helper](https://github.com/YunoHost-Apps/leed_ynh/commit/c4b966ff2a977b8c0923d4f8ad403d86454883cb) + + +## [1.8.3~ynh4](https://github.com/YunoHost-Apps/leed_ynh/pull/13) - 2018-07-16 + +#### Changed +- [Upgrade helpers](https://github.com/YunoHost-Apps/leed_ynh/commit/5cb8744ee1145971518328b242edd68b7ec1310c) + + +## [1.8.3~ynh3](https://github.com/YunoHost-Apps/leed_ynh/pull/11) - 2018-03-14 + +#### Changed +- [Update helpers](https://github.com/YunoHost-Apps/leed_ynh/commit/1952ec18681135ecd13d32e53ecf86684ad1ff29)