From 1f995ff7f38cb5b5f2bd066e01e363f88aca8f5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 28 Dec 2022 09:05:05 +0100 Subject: [PATCH 1/4] Testing (#78) * Upgrade (#68) * Apply example_ynh * Fix melange-de-versions https://forum.yunohost.org/t/melange-de-versions-de-moodle-detectees/19985 * Update manifest.json * Auto-update README Co-authored-by: yunohost-bot * 4.0.2 (#71) * 4.0.2 * Auto-update README Co-authored-by: yunohost-bot * Auto-update README * Bullseye (#73) * Update manifest.json * Auto-update README * Update upgrade * Fix * Auto-update README * Auto-update README Co-authored-by: yunohost-bot * 4.0.3 (#74) * 4.0.3 * Auto-update README Co-authored-by: yunohost-bot * 4.0.4 * Auto-update README * 4.1.0 (#77) * 4.1.0 * Auto-update README * fix PHP * Update config_panel.toml * Update config_panel.toml Co-authored-by: yunohost-bot Co-authored-by: yalh76 Co-authored-by: yunohost-bot --- README.md | 2 +- README_fr.md | 2 +- conf/app.src | 4 ++-- conf/extra_php-fpm.conf | 4 ++++ config_panel.toml | 17 +++++++++++------ manifest.json | 2 +- scripts/config | 14 +++++++------- scripts/install | 8 +++++++- scripts/upgrade | 17 +++++++++++++---- 9 files changed, 47 insertions(+), 23 deletions(-) create mode 100644 conf/extra_php-fpm.conf diff --git a/README.md b/README.md index 2fd59b2..c25c18f 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Moodle is widely used around the world by universities, schools, companies and all manner of organisations and individuals. -**Shipped version:** 4.0.4~ynh1 +**Shipped version:** 4.1.0~ynh1 **Demo:** https://sandbox.moodledemo.net/ diff --git a/README_fr.md b/README_fr.md index db5dd5e..aaa945a 100644 --- a/README_fr.md +++ b/README_fr.md @@ -20,7 +20,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Moodle est largement utilisé dans le monde entier par les universités, les écoles, les entreprises et toutes sortes d'organisations et d'individus. -**Version incluse :** 4.0.4~ynh1 +**Version incluse :** 4.1.0~ynh1 **Démo :** https://sandbox.moodledemo.net/ diff --git a/conf/app.src b/conf/app.src index 033aac6..0a63b22 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/moodle/moodle/archive/v4.0.4.zip -SOURCE_SUM=f1a14cd9a03568f1f6beb61479ef696de61bcf986d63f48f5b29f9c0a18cb597 +SOURCE_URL=https://github.com/moodle/moodle/archive/v4.1.0.zip +SOURCE_SUM=1f7ae1e72e1d7e3b01ae3199ee78dd7b100f21ab3447457ea170ac1a8f96cf20 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true diff --git a/conf/extra_php-fpm.conf b/conf/extra_php-fpm.conf new file mode 100644 index 0000000..0c90ab6 --- /dev/null +++ b/conf/extra_php-fpm.conf @@ -0,0 +1,4 @@ +; Additional php.ini defines, specific to this pool of workers. + +php_admin_value[upload_max_filesize] = 1G +php_admin_value[post_max_size] = 1G \ No newline at end of file diff --git a/config_panel.toml b/config_panel.toml index d6d68fe..dc274e5 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -7,19 +7,24 @@ name = "Moodle configuration" name = "PHP-FPM configuration" [main.php_fpm_config.fpm_footprint] - ask = "Memory footprint of the service?" - choices = ["low", "medium", "high", "specific"] + ask = "Memory footprint" + type = "select" + choices.low = "Low, <= 20Mb per pool" + choices.medium = "Medium, between 20Mb and 40Mb per pool" + choices.high = "High, > 40Mb per pool" + choices.specific = "Use specific value" 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] + [main.php_fpm_config.fpm_free_footprint] + visible = "fpm_footprint == 'specific'" 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.fpm_usage] - ask = "Expected usage of the service?" + ask = "Expected usage" + type = "select" 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." + 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/manifest.json b/manifest.json index 2adecc9..f33d8ea 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Online learning platform", "fr": "Plateforme d'apprentissage en ligne" }, - "version": "4.0.4~ynh1", + "version": "4.1.0~ynh1", "url": "https://moodle.org/", "upstream": { "license": "GPL-3.0-or-later", diff --git a/scripts/config b/scripts/config index 8a9110c..91c2de7 100644 --- a/scripts/config +++ b/scripts/config @@ -56,10 +56,10 @@ set__fpm_footprint() { fi } -set__free_footprint() { - if [ "$fpm_footprint" == "specific" ] +set__fpm_free_footprint() { + if [ "$fpm_footprint" = "specific" ] then - ynh_app_setting_set --app=$app --key=fpm_footprint --value="$free_footprint" + ynh_app_setting_set --app=$app --key=fpm_footprint --value="$fpm_free_footprint" fi } @@ -70,11 +70,11 @@ set__free_footprint() { ynh_app_config_validate() { _ynh_app_config_validate - if [ "${changed[fpm_usage]}" == "true" ] || [ "${changed[fpm_footprint]}" == "true" ] || [ "${changed[free_footprint]}" == "true" ]; then - # If fpm_footprint is set to 'specific', use $free_footprint value. - if [ "$fpm_footprint" == "specific" ] + if [ "${changed[fpm_usage]}" == "true" ] || [ "${changed[fpm_footprint]}" == "true" ] || [ "${changed[fpm_free_footprint]}" == "true" ]; then + # If fpm_footprint is set to 'specific', use $fpm_free_footprint value. + if [ "$fpm_footprint" = "specific" ] then - fpm_footprint=$free_footprint + fpm_footprint=$fpm_free_footprint fi if [ "$fpm_footprint" == "0" ] diff --git a/scripts/install b/scripts/install index 0493dce..aa31aec 100644 --- a/scripts/install +++ b/scripts/install @@ -30,6 +30,9 @@ app=$YNH_APP_INSTANCE_NAME email=$(ynh_user_get_info --username=$admin --key=mail) password=$(ynh_string_random --length=30) +fpm_footprint="low" +fpm_free_footprint=0 +fpm_usage="low" #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS @@ -51,6 +54,9 @@ 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=site_name --value=$site_name +ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint +ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint +ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage #================================================= # STANDARD MODIFICATIONS @@ -99,7 +105,7 @@ chown -R $app:www-data "$final_path" ynh_script_progression --message="Configuring PHP-FPM..." --weight=1 # Create a dedicated PHP-FPM config -ynh_add_fpm_config --usage=low --footprint=low +ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 2bfcf9e..3568b06 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -24,7 +24,9 @@ datadir=$(ynh_app_setting_get --app=$app --key=datadir) db_name=$(ynh_app_setting_get --app=$app --key=db_name) site_name=$(ynh_app_setting_get --app=$app --key=site_name) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) + fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) +fpm_free_footprint=$(ynh_app_setting_get --app=$app --key=fpm_free_footprint) fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) #================================================= @@ -76,16 +78,23 @@ fi # If fpm_footprint doesn't exist, create it if [ -z "$fpm_footprint" ]; then - fpm_footprint=low - ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint + fpm_footprint=low + ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint +fi + +# If fpm_free_footprint doesn't exist, create it +if [ -z "$fpm_free_footprint" ]; then + fpm_free_footprint=0 + ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint fi # If fpm_usage doesn't exist, create it if [ -z "$fpm_usage" ]; then - fpm_usage=low - ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage + fpm_usage=low + ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage fi + # If datadir doesn't exist, create it if [ -z "$datadir" ]; then datadir=$(ynh_app_setting_get --app=$app --key=data_path) From 309dcf40def64af9707d09cf3fb24ffc7964d39d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 2 Feb 2023 15:51:54 +0100 Subject: [PATCH 2/4] 4.1.1 --- conf/app.src | 4 ++-- manifest.json | 4 ++-- scripts/_common.sh | 6 ++++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/conf/app.src b/conf/app.src index 0a63b22..06a7e96 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/moodle/moodle/archive/v4.1.0.zip -SOURCE_SUM=1f7ae1e72e1d7e3b01ae3199ee78dd7b100f21ab3447457ea170ac1a8f96cf20 +SOURCE_URL=https://github.com/moodle/moodle/archive/v4.1.1.zip +SOURCE_SUM=6f4650e20e42ac9bac70f85d2db02c36682456ad5a39715464a59abcfe536b3d SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index f33d8ea..4f575e4 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Online learning platform", "fr": "Plateforme d'apprentissage en ligne" }, - "version": "4.1.0~ynh1", + "version": "4.1.1~ynh1", "url": "https://moodle.org/", "upstream": { "license": "GPL-3.0-or-later", @@ -26,7 +26,7 @@ "multi_instance": true, "services": [ "nginx", - "php7.4-fpm" + "php8.0-fpm" ], "arguments": { "install": [ diff --git a/scripts/_common.sh b/scripts/_common.sh index 83078b9..e7494e5 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,10 +4,12 @@ # COMMON VARIABLES #================================================= -YNH_PHP_VERSION="7.4" +YNH_PHP_VERSION="8.0" # dependencies used by the app -pkg_dependencies="postgresql php${YNH_PHP_VERSION}-common php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-xmlrpc php${YNH_PHP_VERSION}-soap php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-pgsql php${YNH_PHP_VERSION}-ldap" +php_dependencies="php${YNH_PHP_VERSION}-common php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-xmlrpc php${YNH_PHP_VERSION}-soap php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-pgsql php${YNH_PHP_VERSION}-ldap" + +pkg_dependencies="postgresql $php_dependencies" #================================================= # PERSONAL HELPERS From b5b400ebb20f38b4ce8b1432d5f0605035c63c61 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 2 Feb 2023 14:51:59 +0000 Subject: [PATCH 3/4] Auto-update README --- README.md | 4 ++-- README_fr.md | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index c25c18f..7af9f71 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ It shall NOT be edited by hand. # Moodle for YunoHost -[![Integration level](https://dash.yunohost.org/integration/moodle.svg)](https://dash.yunohost.org/appci/app/moodle) ![Working status](https://ci-apps.yunohost.org/ci/badges/moodle.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/moodle.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/moodle.svg)](https://dash.yunohost.org/appci/app/moodle) ![Working status](https://ci-apps.yunohost.org/ci/badges/moodle.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/moodle.maintain.svg) [![Install Moodle with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=moodle) *[Lire ce readme en français.](./README_fr.md)* @@ -20,7 +20,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Moodle is widely used around the world by universities, schools, companies and all manner of organisations and individuals. -**Shipped version:** 4.1.0~ynh1 +**Shipped version:** 4.1.1~ynh1 **Demo:** https://sandbox.moodledemo.net/ diff --git a/README_fr.md b/README_fr.md index aaa945a..03b04ba 100644 --- a/README_fr.md +++ b/README_fr.md @@ -5,28 +5,28 @@ It shall NOT be edited by hand. # Moodle pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/moodle.svg)](https://dash.yunohost.org/appci/app/moodle) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/moodle.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/moodle.maintain.svg) +[![Niveau d’intégration](https://dash.yunohost.org/integration/moodle.svg)](https://dash.yunohost.org/appci/app/moodle) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/moodle.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/moodle.maintain.svg) [![Installer Moodle avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=moodle) *[Read this readme in english.](./README.md)* -> *Ce package vous permet d'installer Moodle 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.* +> *Ce package vous permet d’installer Moodle 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.* -## Vue d'ensemble +## Vue d’ensemble [Moodle](https://moodle.org) est une plateforme d'apprentissage conçue pour fournir aux éducateurs, administrateurs et apprenants un système unique robuste, sécurisé et intégré pour créer des environnements d'apprentissage personnalisés. Moodle est largement utilisé dans le monde entier par les universités, les écoles, les entreprises et toutes sortes d'organisations et d'individus. -**Version incluse :** 4.1.0~ynh1 +**Version incluse :** 4.1.1~ynh1 **Démo :** https://sandbox.moodledemo.net/ -## Captures d'écran +## Captures d’écran -![Capture d'écran de Moodle](./doc/screenshots/Moodle_2.0_on_Firefox_4.0.png) +![Capture d’écran de Moodle](./doc/screenshots/Moodle_2.0_on_Firefox_4.0.png) ## Avertissements / informations importantes @@ -34,9 +34,9 @@ Moodle est largement utilisé dans le monde entier par les universités, les éc ## Documentations et ressources -* Site officiel de l'app : -* Documentation officielle de l'admin : -* Dépôt de code officiel de l'app : +* Site officiel de l’app : +* Documentation officielle de l’admin : +* Dépôt de code officiel de l’app : * Documentation YunoHost pour cette app : * Signaler un bug : @@ -52,4 +52,4 @@ ou sudo yunohost app upgrade moodle -u https://github.com/YunoHost-Apps/moodle_ynh/tree/testing --debug ``` -**Plus d'infos sur le packaging d'applications :** +**Plus d’infos sur le packaging d’applications :** \ No newline at end of file From a7f7b657263922e688a7f72a2a16806f9bd497fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 2 Feb 2023 15:52:15 +0100 Subject: [PATCH 4/4] Revert "4.1.1" This reverts commit 309dcf40def64af9707d09cf3fb24ffc7964d39d. --- conf/app.src | 4 ++-- manifest.json | 4 ++-- scripts/_common.sh | 6 ++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/conf/app.src b/conf/app.src index 06a7e96..0a63b22 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/moodle/moodle/archive/v4.1.1.zip -SOURCE_SUM=6f4650e20e42ac9bac70f85d2db02c36682456ad5a39715464a59abcfe536b3d +SOURCE_URL=https://github.com/moodle/moodle/archive/v4.1.0.zip +SOURCE_SUM=1f7ae1e72e1d7e3b01ae3199ee78dd7b100f21ab3447457ea170ac1a8f96cf20 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 4f575e4..f33d8ea 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Online learning platform", "fr": "Plateforme d'apprentissage en ligne" }, - "version": "4.1.1~ynh1", + "version": "4.1.0~ynh1", "url": "https://moodle.org/", "upstream": { "license": "GPL-3.0-or-later", @@ -26,7 +26,7 @@ "multi_instance": true, "services": [ "nginx", - "php8.0-fpm" + "php7.4-fpm" ], "arguments": { "install": [ diff --git a/scripts/_common.sh b/scripts/_common.sh index e7494e5..83078b9 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,12 +4,10 @@ # COMMON VARIABLES #================================================= -YNH_PHP_VERSION="8.0" +YNH_PHP_VERSION="7.4" # dependencies used by the app -php_dependencies="php${YNH_PHP_VERSION}-common php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-xmlrpc php${YNH_PHP_VERSION}-soap php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-pgsql php${YNH_PHP_VERSION}-ldap" - -pkg_dependencies="postgresql $php_dependencies" +pkg_dependencies="postgresql php${YNH_PHP_VERSION}-common php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-xmlrpc php${YNH_PHP_VERSION}-soap php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-pgsql php${YNH_PHP_VERSION}-ldap" #================================================= # PERSONAL HELPERS