1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/moodle_ynh.git synced 2024-09-03 19:46:23 +02:00
* 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>

* 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 <yunohost@yunohost.org>
Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org>

* Update manifest.toml

* cleaning

* Auto-update README

* Update manifest.toml

* Auto-update README

---------

Co-authored-by: yalh76 <yalh@yahoo.com>
Co-authored-by: yunohost-bot <yunohost@yunohost.org>
Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org>
This commit is contained in:
Éric Gaspar 2023-03-30 21:33:22 +02:00 committed by GitHub
parent 567c5eb640
commit 7ff7a6be94
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 32 additions and 63 deletions

View file

@ -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/

View file

@ -21,7 +21,7 @@ Si vous navez 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/

View file

@ -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

View file

@ -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]

View file

@ -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

View file

@ -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"

View file

@ -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"

View file

@ -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
#=================================================