From 7ff7a6be9402b4a0cb7ddff0c4b084149a8acbbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 30 Mar 2023 21:33:22 +0200 Subject: [PATCH] Testing (#83) * 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 * Auto-update README * 4.1.1 * Auto-update README * Update extra_php-fpm.conf * Update extra_php-fpm.conf * Auto-update README * Update manifest.json * Update extra_php-fpm.conf * Update _common.sh * Version 2 (#80) * v2 * Fix * Auto-update README * fix * Fix * Update tests.toml * Update manifest.toml * Update _common.sh * Update upgrade * Update upgrade * Update manifest.toml * fix * upgrade: remove unused code --------- Co-authored-by: yunohost-bot Co-authored-by: Alexandre Aubin * Update manifest.toml * cleaning * Auto-update README * Update manifest.toml * Auto-update README --------- Co-authored-by: yalh76 Co-authored-by: yunohost-bot Co-authored-by: Alexandre Aubin --- README.md | 2 +- README_fr.md | 2 +- conf/app.src | 7 ------- manifest.toml | 12 ++++++++++-- scripts/install | 2 +- scripts/remove | 18 ++++-------------- scripts/restore | 29 +++++++++-------------------- scripts/upgrade | 23 ++++++----------------- 8 files changed, 32 insertions(+), 63 deletions(-) delete mode 100644 conf/app.src diff --git a/README.md b/README.md index eb7cfff..7bf193e 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,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.1~ynh2 +**Shipped version:** 4.1.2~ynh1 **Demo:** https://sandbox.moodledemo.net/ diff --git a/README_fr.md b/README_fr.md index f9dae08..83df6a3 100644 --- a/README_fr.md +++ b/README_fr.md @@ -21,7 +21,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po 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.1~ynh2 +**Version incluse :** 4.1.2~ynh1 **Démo :** https://sandbox.moodledemo.net/ diff --git a/conf/app.src b/conf/app.src deleted file mode 100644 index 06a7e96..0000000 --- a/conf/app.src +++ /dev/null @@ -1,7 +0,0 @@ -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 -SOURCE_FILENAME=moodle.zip -SOURCE_EXTRACT=true diff --git a/manifest.toml b/manifest.toml index 43d217e..c5d7cfa 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Moodle" description.en = "Online learning platform" description.fr = "Plateforme d'apprentissage en ligne" -version = "4.1.1~ynh2" +version = "4.1.2~ynh1" maintainers = ["Anmol Sharma"] @@ -17,7 +17,7 @@ admindoc = "https://docs.moodle.org/400/en/Main_page" code = "https://github.com/moodle/moodle" [integration] -yunohost = ">= 11.1.12" +yunohost = ">= 11.1.15" architectures = "all" multi_instance = true ldap = true @@ -49,6 +49,14 @@ ram.runtime = "50M" example = "moodle" [resources] + + [resources.sources] + + [resources.sources.main] + url = "https://github.com/moodle/moodle/archive/v4.1.2.zip" + sha256 = "395523c8a81203636dfe74e8daaa9f98dc5268576728ef01d7fcc5a1753cc13a" + autoupdate.strategy = "latest_github_tag" + [resources.system_user] [resources.install_dir] diff --git a/scripts/install b/scripts/install index 3c8570e..4659de6 100644 --- a/scripts/install +++ b/scripts/install @@ -15,6 +15,7 @@ source /usr/share/yunohost/helpers 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" @@ -23,7 +24,6 @@ fpm_usage="low" # STORE SETTINGS FROM MANIFEST #================================================= -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 diff --git a/scripts/remove b/scripts/remove index ac048ae..a469898 100644 --- a/scripts/remove +++ b/scripts/remove @@ -10,28 +10,18 @@ source _common.sh source /usr/share/yunohost/helpers #================================================= -# REMOVE NGINX CONFIGURATION +# REMOVE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 +# REMOVE SYSTEMD SERVICE +#================================================= +ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 # Remove the dedicated NGINX config ynh_remove_nginx_config -#================================================= -# REMOVE PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=20 - # Remove the dedicated PHP-FPM config ynh_remove_fpm_config -#================================================= -# SPECIFIC REMOVE -#================================================= -# REMOVE VARIOUS FILES -#================================================= -ynh_script_progression --message="Removing various files..." --weight=2 - # Remove a cron file ynh_secure_remove --file="/etc/cron.d/$app" diff --git a/scripts/restore b/scripts/restore index 7327a7b..d52fdae 100644 --- a/scripts/restore +++ b/scripts/restore @@ -29,34 +29,23 @@ ynh_restore_file --origin_path="$data_dir" --not_mandatory chown -R $app:www-data "$data_dir" -#================================================= -# 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 NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX configuration..." --weight=1 - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - #================================================= # RESTORE THE POSTGRESQL DATABASE #================================================= -ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=47 +ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=10 ynh_psql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql #================================================= -# RESTORE VARIOUS FILES +# RESTORE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Restoring various files..." --weight=3 +# RESTORE THE PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 + +ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" + +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/cron.d/$app" chown root: "/etc/cron.d/$app" diff --git a/scripts/upgrade b/scripts/upgrade index ee92795..153752e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,7 +12,6 @@ source /usr/share/yunohost/helpers #================================================= # CHECK VERSION #================================================= -ynh_script_progression --message="Checking version..." upgrade_type=$(ynh_check_app_version_changed) @@ -83,21 +82,20 @@ chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" #================================================= -# PHP-FPM CONFIGURATION +# REAPPLY SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1 +ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 # Create a dedicated PHP-FPM config ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1 - # Create a dedicated NGINX config ynh_add_nginx_config +ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" +chown root: "/etc/cron.d/$app" +chmod 644 "/etc/cron.d/$app" + #================================================= # SPECIFIC UPGRADE #================================================= @@ -124,15 +122,6 @@ chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" -#================================================= -# ADD CRON JOB -#================================================= -ynh_script_progression --message="Adding cron job..." --weight=4 - -ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" -chown root: "/etc/cron.d/$app" -chmod 644 "/etc/cron.d/$app" - #================================================= # END OF SCRIPT #=================================================