mirror of
https://github.com/YunoHost-Apps/moodle_ynh.git
synced 2024-09-03 19:46:23 +02:00
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 <yunohost@yunohost.org> * 4.0.2 (#71) * 4.0.2 * Auto-update README Co-authored-by: yunohost-bot <yunohost@yunohost.org> * 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 <yunohost@yunohost.org> * 4.0.3 (#74) * 4.0.3 * Auto-update README Co-authored-by: yunohost-bot <yunohost@yunohost.org> * 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 <yunohost@yunohost.org> Co-authored-by: yalh76 <yalh@yahoo.com> Co-authored-by: yunohost-bot <yunohost@yunohost.org>
This commit is contained in:
parent
bf35ed547c
commit
1f995ff7f3
9 changed files with 47 additions and 23 deletions
|
@ -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/
|
||||
|
||||
|
|
|
@ -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/
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
4
conf/extra_php-fpm.conf
Normal file
4
conf/extra_php-fpm.conf
Normal file
|
@ -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
|
|
@ -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.<br>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.<br>medium: Low usage, few people or/and publicly accessible. Low RAM footprint, medium processor footprint when used.<br>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.<br>medium: Low usage, few people or/and publicly accessible. Low RAM footprint, medium processor footprint when used.<br>high: High usage, frequently visited website. High RAM footprint, but lower on processor usage and quickly responding."
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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" ]
|
||||
|
|
|
@ -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)
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue