From 623e7bae2dbae1bc9d7ceaa947ec49f56b57fa05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 28 Mar 2022 17:43:45 +0200 Subject: [PATCH 1/2] Testing (#63) * Upgrade to v.3.9.2 * Update app.src * Update README.md * Small typos * Cleaning up * Upgrade to 3.10.0 * Fix small typo * Set badge in SVG * Fix typo (#30) "setuping" -> "setting up" * Upgrade to 3.10.1 (#31) * Upgrade to 3.10.1 * Update manifest.json * Update install * Update install * small fixes (#33) * Upgrade to 3.10.2 (#35) * Upgrade to 3.10.2 * Remove ask (#36) * Protect final_path * Revert "Protect final_path" This reverts commit f764d11977f255a7b0ec64e84cab50c6efba7107. * Add change url (#38) * Update change_url * 3.10.3 (#37) * Upgrade to version 3.10.3 * Add README_fr * Small fixes * Fix badges * Remove not yet working script * Fix links * [autopatch] Update issue and PR templates (#41) Co-authored-by: Yunohost-Bot <> * Add templates * 3.10.4 (#42) * 3.10.4 * Cleaning up * Set rights (#45) * Set rights * Fix (#47) * Update upgrade * Update upgrade * Update upgrade * Update upgrade * Update doc/DISCLAIMER_fr.md Co-authored-by: Alexandre Aubin * Auto-update README * apply exemple for data dir (#48) * Update install * 3.11.1 (#50) * 3.11.1 * Update php-fpm.conf * 3.11.2 (#51) * 3.11.2 * Update php-fpm.conf * Add config file (#54) * Update upgrade * Fix * Update change_url * Update nginx.conf * Update change_url * Update change_url * Update upgrade * Update change_url * Update change_url * Update change_url * Update change_url * Update change_url * Update change_url * fix * fix * Update change_url * Update change_url * Update change_url * Update change_url * Update change_url * Update change_url * Update change_url * Fix * Update change_url * Update change_url * Update change_url * Update nginx.conf * Update nginx.conf * Update nginx.conf * Update nginx.conf * Update restore * Update manifest.json * 4.3 * 3.11.4 (#57) * 3.11.4 * 3.11.5 (#58) * 3.11.5 * Auto-update README Co-authored-by: Yunohost-Bot <> * 3.11.6 (#61) * 3.11.6 * Update config-path.php Co-authored-by: Benjamin Hartmann <42138517+benjaminwolkchen@users.noreply.github.com> Co-authored-by: YunoHost Bot Co-authored-by: Alexandre Aubin Co-authored-by: Yunohost-Bot <> --- README.md | 2 +- README_fr.md | 2 +- conf/app.src | 4 ++-- conf/config-domain.php | 2 +- conf/config-path.php | 2 +- conf/nginx.conf | 1 - manifest.json | 2 +- scripts/change_url | 7 +------ scripts/config | 4 ++-- scripts/install | 2 -- 10 files changed, 10 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 699180a..d29da05 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Online learning platform -**Shipped version:** 3.11.5~ynh1 +**Shipped version:** 3.11.6~ynh1 **Demo:** https://sandbox.moodledemo.net/ diff --git a/README_fr.md b/README_fr.md index 248fdfd..8b3123f 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Plateforme d'apprentissage en ligne -**Version incluse :** 3.11.5~ynh1 +**Version incluse :** 3.11.6~ynh1 **Démo :** https://sandbox.moodledemo.net/ diff --git a/conf/app.src b/conf/app.src index c045988..e9a0493 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/moodle/moodle/archive/v3.11.5.zip -SOURCE_SUM=993c6ef90710cbfd60764c4ebdde1547fbdab409dceab79f1aef0aef70812a9e +SOURCE_URL=https://github.com/moodle/moodle/archive/v3.11.6.zip +SOURCE_SUM=eaade75ef2ddb223abe7ca89c61d2579ef183bdedaee0241307b0a7992bb6b45 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true diff --git a/conf/config-domain.php b/conf/config-domain.php index 63e132d..7ea0f92 100644 --- a/conf/config-domain.php +++ b/conf/config-domain.php @@ -8,7 +8,7 @@ $CFG->dbtype = 'pgsql'; $CFG->dblibrary = 'native'; $CFG->dbhost = 'localhost'; $CFG->dbname = '__DB_NAME__'; -$CFG->dbuser = '__DB_NAME__'; +$CFG->dbuser = '__DB_USER__'; $CFG->dbpass = '__DB_PWD__'; $CFG->prefix = 'mdl_'; $CFG->dboptions = array( diff --git a/conf/config-path.php b/conf/config-path.php index 1980bf3..768e7d0 100644 --- a/conf/config-path.php +++ b/conf/config-path.php @@ -8,7 +8,7 @@ $CFG->dbtype = 'pgsql'; $CFG->dblibrary = 'native'; $CFG->dbhost = 'localhost'; $CFG->dbname = '__DB_NAME__'; -$CFG->dbuser = '__DB_NAME__'; +$CFG->dbuser = '__DB_USER__'; $CFG->dbpass = '__DB_PWD__'; $CFG->prefix = 'mdl_'; $CFG->dboptions = array( diff --git a/conf/nginx.conf b/conf/nginx.conf index bce5fb3..c27948a 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -13,7 +13,6 @@ location __PATH__/ { location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; - fastcgi_index index.php; include fastcgi_params; fastcgi_param REMOTE_USER $remote_user; diff --git a/manifest.json b/manifest.json index d827b72..886521c 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Online learning platform", "fr": "Plateforme d'apprentissage en ligne" }, - "version": "3.11.5~ynh1", + "version": "3.11.6~ynh1", "url": "https://moodle.org/", "upstream": { "license": "GPL-3.0-or-later", diff --git a/scripts/change_url b/scripts/change_url index 8fd855b..5687b92 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -29,6 +29,7 @@ ynh_script_progression --message="Loading installation settings..." --weight=1 final_path=$(ynh_app_setting_get --app=$app --key=final_path) data_path=$(ynh_app_setting_get --app=$app --key=data_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) +db_user=$db_name db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) #================================================= @@ -102,12 +103,6 @@ domain=${new_domain%/} path=${new_path%/} dir="__DIR__" -# if [ "$new_path" == "/" ]; then -# ynh_replace_string --match_string="\$CFG->wwwroot = .*" --replace_string="\$CFG->wwwroot = \'https:\/\/${new_domain%\/}\';" --target_file="$final_path/config.php" -# else -# ynh_replace_string --match_string="\$CFG->wwwroot = .*" --replace_string="\$CFG->wwwroot = \'https:\/\/${new_domain}${new_path%\/}\';" --target_file="$final_path/config.php" -# fi - if [ "$new_path" == "/" ]; then ynh_add_config --template="../conf/config-domain.php" --destination="$final_path/config.php" else diff --git a/scripts/config b/scripts/config index 3440bd2..8a9110c 100644 --- a/scripts/config +++ b/scripts/config @@ -57,7 +57,7 @@ set__fpm_footprint() { } set__free_footprint() { - if [ "$fpm_footprint" = "specific" ] + if [ "$fpm_footprint" == "specific" ] then ynh_app_setting_set --app=$app --key=fpm_footprint --value="$free_footprint" fi @@ -72,7 +72,7 @@ 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 [ "$fpm_footprint" == "specific" ] then fpm_footprint=$free_footprint fi diff --git a/scripts/install b/scripts/install index 893f8d4..42587d2 100644 --- a/scripts/install +++ b/scripts/install @@ -72,8 +72,6 @@ db_user=$db_name ynh_app_setting_set --app=$app --key=db_name --value=$db_name ynh_psql_setup_db --db_user=$db_user --db_name=$db_name -db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) - #================================================= # CREATE DEDICATED USER #================================================= From f99d929476f632221f9cb886bc5e46e18ffa3b0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 11 May 2022 20:39:13 +0200 Subject: [PATCH 2/2] 4.0.0 (#62) * 3.11.5 * Auto-update README * 3.11.6 * Auto-update README * Fix * Update config-path.php * Update manifest.json * remove language * Revert "remove language" This reverts commit a598ca0465a662bcb652718c5b8656d2ffecb755. * Fix * Update upgrade * Update check_process * Fix * Update install * Fix * Update install * Fix * Update install * Update upgrade * 100M * Fix * fix * Update _common.sh * Fix * remove de * Update fr.src * remove translation * fix * Update upgrade * Update change_url * Update config-path.php * Update _common.sh * 4.0.0 * Auto-update README * 7.4 * Update restore * Update upgrade Co-authored-by: Yunohost-Bot <> Co-authored-by: yunohost-bot --- README.md | 2 +- README_fr.md | 2 +- conf/app.src | 4 ++-- manifest.json | 4 ++-- scripts/_common.sh | 4 +--- scripts/restore | 20 ++++++++++---------- scripts/upgrade | 4 ++++ 7 files changed, 21 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index d29da05..be139ad 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Online learning platform -**Shipped version:** 3.11.6~ynh1 +**Shipped version:** 4.0.0~ynh1 **Demo:** https://sandbox.moodledemo.net/ diff --git a/README_fr.md b/README_fr.md index 8b3123f..e268b26 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Plateforme d'apprentissage en ligne -**Version incluse :** 3.11.6~ynh1 +**Version incluse :** 4.0.0~ynh1 **Démo :** https://sandbox.moodledemo.net/ diff --git a/conf/app.src b/conf/app.src index e9a0493..0ec6331 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/moodle/moodle/archive/v3.11.6.zip -SOURCE_SUM=eaade75ef2ddb223abe7ca89c61d2579ef183bdedaee0241307b0a7992bb6b45 +SOURCE_URL=https://github.com/moodle/moodle/archive/v4.0.0.zip +SOURCE_SUM=a8ab07a4b0fb5286b42658381df4db8746b8bb44a96234df1b69d2841ed81a07 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 886521c..1ae438e 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Online learning platform", "fr": "Plateforme d'apprentissage en ligne" }, - "version": "3.11.6~ynh1", + "version": "4.0.0~ynh1", "url": "https://moodle.org/", "upstream": { "license": "GPL-3.0-or-later", @@ -26,7 +26,7 @@ "multi_instance": true, "services": [ "nginx", - "php7.3-fpm" + "php7.4-fpm" ], "arguments": { "install" : [ diff --git a/scripts/_common.sh b/scripts/_common.sh index f158759..20fd74b 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,9 +5,7 @@ #================================================= # dependencies used by the app -pkg_dependencies="postgresql" - -YNH_PHP_VERSION="7.3" +YNH_PHP_VERSION="7.4" 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" diff --git a/scripts/restore b/scripts/restore index 7e66aaa..c8793f7 100644 --- a/scripts/restore +++ b/scripts/restore @@ -83,16 +83,6 @@ chmod 750 "$data_path" chmod -R o-rwx "$data_path" chown -R $app:www-data "$data_path" -#================================================= -# RESTORE THE PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring PHP-FPM configuration..." --weight=1 - -ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" - -# Recreate a dedicated php-fpm config -ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$phpversion - #================================================= # SPECIFIC RESTORATION #================================================= @@ -103,6 +93,16 @@ ynh_script_progression --message="Reinstalling dependencies..." --weight=3 # Define and install dependencies ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies +#================================================= +# RESTORE THE PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring PHP-FPM configuration..." --weight=1 + +ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" + +# Recreate a dedicated php-fpm config +ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$phpversion + #================================================= # RESTORE THE POSTGRESQL DATABASE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index c15d324..266ca11 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -106,6 +106,10 @@ then #php${phpversion} $final_path/admin/cli/upgrade.php fi +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" + #================================================= # NGINX CONFIGURATION #=================================================