1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/moodle_ynh.git synced 2024-09-03 19:46:23 +02:00
* Upgrade to 3.10.0
This commit is contained in:
Éric Gaspar 2020-11-30 21:43:05 +01:00 committed by GitHub
parent 34f8f02712
commit 946f233c6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 43 additions and 46 deletions

View file

@ -1,4 +1,4 @@
# Moodle app for YunoHost # Moodle for YunoHost
[![Integration level](https://dash.yunohost.org/integration/moodle.svg)](https://dash.yunohost.org/appci/app/moodle) ![](https://ci-apps.yunohost.org/ci/badges/moodle.status.svg) ![](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) ![](https://ci-apps.yunohost.org/ci/badges/moodle.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/moodle.maintain.svg)
[![Install Moodle with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=moodle) [![Install Moodle with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=moodle)
@ -11,7 +11,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. Moodle is widely used around the world by universities, schools, companies and all manner of organisations and individuals.
**Shipped version:** 3.9.0 **Shipped version:** 3.10.0
## Screenshots ## Screenshots
@ -50,8 +50,7 @@ How to configure this app: by an admin panel.
--- ---
Developer info ## Developer info
----------------
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/moodle_ynh/tree/testing). Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/moodle_ynh/tree/testing).

View file

@ -19,7 +19,6 @@
port_already_use=0 port_already_use=0
change_url=0 change_url=0
;;; Levels ;;; Levels
# If the level 5 (Package linter) is forced to 1. Please add justifications here.
Level 5=auto Level 5=auto
;;; Options ;;; Options
Email= Email=

View file

@ -1,6 +1,6 @@
SOURCE_URL=https://download.moodle.org/stable39/moodle-3.9.zip SOURCE_URL=https://github.com/moodle/moodle/archive/v3.10.0.zip
SOURCE_SUM=b976f3c9446a98c0b15d0467ec83cfe25fa32d30f4f56eb4e98f2efe96f6f24ed4039667cdcbb47cc767e91ada2cd484f4b4c2660ce57479b9f361c6bbf54b3c SOURCE_SUM=c80cfa811acda62363cccdd876bf001e802ceccb1f261846c9e59c6a66f6b125
SOURCE_SUM_PRG=sha512sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=zip SOURCE_FORMAT=zip
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=moodle.zip SOURCE_FILENAME=moodle.zip

View file

@ -7,7 +7,7 @@ about: Create a report to help us debug, it would be nice to fill the template a
**How to post a meaningful bug report** **How to post a meaningful bug report**
1. *Read this whole template first.* 1. *Read this whole template first.*
2. *Determine if you are on the right place:* 2. *Determine if you are on the right place:*
- *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change url...), you are on the right place!* - *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!*
- *Otherwise, the issue may be due to Moodle itself. Refer to its documentation or repository for help.* - *Otherwise, the issue may be due to Moodle itself. Refer to its documentation or repository for help.*
- *If you have a doubt, post here, we will figure it out together.* - *If you have a doubt, post here, we will figure it out together.*
3. *Delete the italic comments as you write over them below, and remove this guide.* 3. *Delete the italic comments as you write over them below, and remove this guide.*
@ -34,8 +34,8 @@ about: Create a report to help us debug, it would be nice to fill the template a
- *If you used the webadmin, please perform the equivalent command from the CLI first.* - *If you used the webadmin, please perform the equivalent command from the CLI first.*
- *If the error occurs in your browser, explain what you did:* - *If the error occurs in your browser, explain what you did:*
1. *Go to '...'* 1. *Go to '...'*
2. *Click on '....'* 2. *Click on '...'*
3. *Scroll down to '....'* 3. *Scroll down to '...'*
4. *See error* 4. *See error*
**Expected behavior** **Expected behavior**

View file

@ -3,10 +3,10 @@
"id": "moodle", "id": "moodle",
"packaging_format": 1, "packaging_format": 1,
"description": { "description": {
"en": "An online learning platform", "en": "Online learning platform",
"fr": "Une plateforme d'apprentissage en ligne" "fr": "Plateforme d'apprentissage en ligne"
}, },
"version": "3.9.0~ynh1", "version": "3.10.0~ynh1",
"url": "https://moodle.org/", "url": "https://moodle.org/",
"license": "GPL-3.0-or-later", "license": "GPL-3.0-or-later",
"maintainer": { "maintainer": {
@ -14,7 +14,7 @@
"email": "anmol@datamol.org" "email": "anmol@datamol.org"
}, },
"requirements": { "requirements": {
"yunohost": ">= 3.5" "yunohost": ">= 4.0.0"
}, },
"multi_instance": true, "multi_instance": true,
"services": [ "services": [

View file

@ -9,7 +9,7 @@ pkg_dependencies="postgresql"
YNH_PHP_VERSION="7.3" YNH_PHP_VERSION="7.3"
extra_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-json php$YNH_PHP_VERSION-pgsql php$YNH_PHP_VERSION-ldap" extra_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}-json php${YNH_PHP_VERSION}-pgsql php${YNH_PHP_VERSION}-ldap"
#================================================= #=================================================
# PERSONAL HELPERS # PERSONAL HELPERS

View file

@ -6,7 +6,6 @@
# IMPORT GENERIC HELPERS # IMPORT GENERIC HELPERS
#================================================= #=================================================
#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
@ -74,4 +73,4 @@ ynh_psql_dump_db --database="$db_name" > db.sql
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." ynh_print_info --message="Backup script completed for Moodle. (YunoHost will then actually copy those files to the archive)."

View file

@ -87,9 +87,9 @@ ynh_setup_source --dest_dir="$final_path"
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Configuring nginx web server..." --weight=2 ynh_script_progression --message="Configuring NGINX web server..." --weight=2
# Create a dedicated nginx config # Create a dedicated NGINX config
ynh_add_nginx_config ynh_add_nginx_config
#================================================= #=================================================
@ -103,7 +103,7 @@ ynh_system_user_create --username="$app"
#================================================= #=================================================
# PHP-FPM CONFIGURATION # PHP-FPM CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Configuring php-fpm..." --weight=1 ynh_script_progression --message="Configuring PHP-FPM..." --weight=1
# Create a dedicated php-fpm config # Create a dedicated php-fpm config
ynh_add_fpm_config --package="$extra_php_dependencies" ynh_add_fpm_config --package="$extra_php_dependencies"
@ -133,7 +133,7 @@ ynh_store_file_checksum "$final_path/config.php"
#================================================= #=================================================
# ACTIVATE LDAP SUPPORT # ACTIVATE LDAP SUPPORT
#================================================= #=================================================
ynh_script_progression --message="Activate ldap support..." ynh_script_progression --message="Activate LDAP support..."
ynh_psql_execute_as_root --database="$db_name" --sql="UPDATE public.mdl_config SET value='ldap,email' WHERE name='auth';" ynh_psql_execute_as_root --database="$db_name" --sql="UPDATE public.mdl_config SET value='ldap,email' WHERE name='auth';"
ynh_psql_execute_as_root --database="$db_name" --sql="UPDATE public.mdl_config_plugins SET value='ldap://127.0.0.1/' WHERE plugin='auth_ldap' AND name='host_url';" ynh_psql_execute_as_root --database="$db_name" --sql="UPDATE public.mdl_config_plugins SET value='ldap://127.0.0.1/' WHERE plugin='auth_ldap' AND name='host_url';"
@ -157,9 +157,9 @@ ynh_script_progression --message="Adding cron job..."
# Set up poller # Set up poller
cp "../conf/cron" "/etc/cron.d/$app" cp "../conf/cron" "/etc/cron.d/$app"
ynh_replace_string "__APP__" "$app" "/etc/cron.d/$app" ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="/etc/cron.d/$app"
ynh_replace_string "__FINAL_PATH__" "$final_path" "/etc/cron.d/$app" ynh_replace_string --match_string="__FINAL_PATH__" --replace_string="$final_path" --target_file="/etc/cron.d/$app"
ynh_replace_string "__PHPVERSION__" "$phpversion" "/etc/cron.d/$app" ynh_replace_string --match_string="__PHPVERSION__" --replace_string="$phpversion" --target_file="/etc/cron.d/$app"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
@ -187,7 +187,7 @@ fi
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================
ynh_script_progression --message="Reloading nginx web server..." --weight=1 ynh_script_progression --message="Reloading NGINX web server..." --weight=1
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload
@ -195,4 +195,4 @@ ynh_systemd_action --service_name=nginx --action=reload
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Installation of $app completed" --last ynh_script_progression --message="Installation of Moodle completed" --last

View file

@ -43,7 +43,7 @@ ynh_remove_app_dependencies
#================================================= #=================================================
# REMOVE APP MAIN DIR # REMOVE APP MAIN DIR
#================================================= #=================================================
ynh_script_progression --message="Removing app main directory..." ynh_script_progression --message="Removing Moodle main directory..."
# Remove the app directory securely # Remove the app directory securely
ynh_secure_remove --file="$final_path" ynh_secure_remove --file="$final_path"
@ -51,15 +51,15 @@ ynh_secure_remove --file="$final_path"
#================================================= #=================================================
# REMOVE NGINX CONFIGURATION # REMOVE NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Removing nginx web server configuration..." ynh_script_progression --message="Removing NGINX web server configuration..."
# Remove the dedicated nginx config # Remove the dedicated NGINX config
ynh_remove_nginx_config ynh_remove_nginx_config
#================================================= #=================================================
# REMOVE PHP-FPM CONFIGURATION # REMOVE PHP-FPM CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Removing php-fpm configuration..." --weight=20 ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=20
# Remove the dedicated php-fpm config # Remove the dedicated php-fpm config
ynh_remove_fpm_config ynh_remove_fpm_config
@ -91,4 +91,4 @@ ynh_system_user_delete --username="$app"
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Removal of $app completed" --last ynh_script_progression --message="Removal of Moodle completed" --last

View file

@ -48,14 +48,14 @@ test ! -d "$data_path" \
#================================================= #=================================================
# RESTORE THE NGINX CONFIGURATION # RESTORE THE NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Restoring the nginx configuration..." ynh_script_progression --message="Restoring the NGINX configuration..."
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#================================================= #=================================================
# RESTORE THE APP MAIN DIR # RESTORE THE APP MAIN DIR
#================================================= #=================================================
ynh_script_progression --message="Restoring the app main directory..." ynh_script_progression --message="Restoring Moodle main directory..."
ynh_restore_file --origin_path="$final_path" ynh_restore_file --origin_path="$final_path"
@ -85,7 +85,7 @@ ynh_script_progression --message="Restoring PHP-FPM configuration..."
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
# Recreate a dedicated php-fpm config # Recreate a dedicated PHP-FPM config
ynh_add_fpm_config --package="$extra_php_dependencies" ynh_add_fpm_config --package="$extra_php_dependencies"
#================================================= #=================================================
@ -121,13 +121,13 @@ ynh_restore_file --origin_path="/etc/cron.d/$app"
#================================================= #=================================================
# RELOAD NGINX AND PHP-FPM # 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..."
ynh_systemd_action --service_name=php"$phpversion"-fpm --action=reload ynh_systemd_action --service_name=php$phpversion-fpm --action=reload
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Restoration completed for $app" --last ynh_script_progression --message="Restoration completed for Moodle" --last

View file

@ -38,13 +38,13 @@ ynh_script_progression --message="Ensuring downward compatibility..."
# If the admin is not defined, We can't upgrade this app # If the admin is not defined, We can't upgrade this app
if [ -z "$admin" ]; then if [ -z "$admin" ]; then
ynh_die --message="This app can't be upgraded from a very old version of the package. Please remove and reinstall Moodle_ynh" ynh_die --message="This app can't be upgraded from a very old version of the package. Please remove and reinstall moodle_ynh"
fi fi
#================================================= #=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#================================================= #=================================================
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=30 ynh_script_progression --message="Backing up Moodle before upgrading (may take a while)..." --weight=30
# Backup the current version of the app # Backup the current version of the app
ynh_backup_before_upgrade ynh_backup_before_upgrade
@ -72,7 +72,7 @@ fi
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Upgrading nginx web server configuration..." ynh_script_progression --message="Upgrading NGINX web server configuration..."
# Create a dedicated nginx config # Create a dedicated nginx config
ynh_add_nginx_config ynh_add_nginx_config
@ -95,9 +95,9 @@ ynh_system_user_create --username="$app"
#================================================= #=================================================
# PHP-FPM CONFIGURATION # PHP-FPM CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Upgrading php-fpm configuration..." ynh_script_progression --message="Upgrading PHP-FPM configuration..."
# Create a dedicated php-fpm config # Create a dedicated PHP-FPM config
ynh_add_fpm_config --package="$extra_php_dependencies" ynh_add_fpm_config --package="$extra_php_dependencies"
phpversion=$(ynh_app_setting_get --app="$app" --key=phpversion) phpversion=$(ynh_app_setting_get --app="$app" --key=phpversion)
@ -126,7 +126,7 @@ chown -R "$app": "$final_path"
#================================================= #=================================================
# ACTIVATE LDAP SUPPORT # ACTIVATE LDAP SUPPORT
#================================================= #=================================================
ynh_script_progression --message="Activate ldap support..." ynh_script_progression --message="Activate LDAP support..."
ynh_psql_execute_as_root --database="$db_name" --sql="UPDATE public.mdl_config SET value='ldap,email' WHERE name='auth';" ynh_psql_execute_as_root --database="$db_name" --sql="UPDATE public.mdl_config SET value='ldap,email' WHERE name='auth';"
ynh_psql_execute_as_root --database="$db_name" --sql="UPDATE public.mdl_config_plugins SET value='ldap://127.0.0.1/' WHERE plugin='auth_ldap' AND name='host_url';" ynh_psql_execute_as_root --database="$db_name" --sql="UPDATE public.mdl_config_plugins SET value='ldap://127.0.0.1/' WHERE plugin='auth_ldap' AND name='host_url';"
@ -180,7 +180,7 @@ fi
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================
ynh_script_progression --message="Reloading nginx web server..." ynh_script_progression --message="Reloading NGINX web server..."
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload
@ -188,4 +188,4 @@ ynh_systemd_action --service_name=nginx --action=reload
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Upgrade of $app completed" --last ynh_script_progression --message="Upgrade of Moodle completed" --last