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) (#69)

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

Co-authored-by: yalh76 <yalh@yahoo.com>
Co-authored-by: yunohost-bot <yunohost@yunohost.org>
This commit is contained in:
Éric Gaspar 2022-07-06 06:43:15 +02:00 committed by GitHub
parent 51dc524df3
commit de249fb16b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 24 additions and 7 deletions

View file

@ -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. Moodle is widely used around the world by universities, schools, companies and all manner of organisations and individuals.
**Shipped version:** 4.0.1~ynh2 **Shipped version:** 4.0.1~ynh3
**Demo:** https://sandbox.moodledemo.net/ **Demo:** https://sandbox.moodledemo.net/

View file

@ -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. 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.1~ynh2 **Version incluse :** 4.0.1~ynh3
**Démo :** https://sandbox.moodledemo.net/ **Démo :** https://sandbox.moodledemo.net/

View file

@ -6,7 +6,7 @@
"en": "Online learning platform", "en": "Online learning platform",
"fr": "Plateforme d'apprentissage en ligne" "fr": "Plateforme d'apprentissage en ligne"
}, },
"version": "4.0.1~ynh2", "version": "4.0.1~ynh3",
"url": "https://moodle.org/", "url": "https://moodle.org/",
"upstream": { "upstream": {
"license": "GPL-3.0-or-later", "license": "GPL-3.0-or-later",

View file

@ -108,12 +108,16 @@ domain=${new_domain%/}
path=${new_path%/} path=${new_path%/}
dir="__DIR__" dir="__DIR__"
ynh_backup_if_checksum_is_different --file="$final_path/config.php"
if [ "$new_path" == "/" ]; then if [ "$new_path" == "/" ]; then
ynh_add_config --template="../conf/config-domain.php" --destination="$final_path/config.php" ynh_add_config --template="../conf/config-domain.php" --destination="$final_path/config.php"
else else
ynh_add_config --template="../conf/config-path.php" --destination="$final_path/config.php" ynh_add_config --template="../conf/config-path.php" --destination="$final_path/config.php"
fi fi
ynh_store_file_checksum --file="$final_path/config.php"
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================

View file

@ -20,7 +20,7 @@ ynh_abort_if_errors
#================================================= #=================================================
# LOAD SETTINGS # LOAD SETTINGS
#================================================= #=================================================
ynh_script_progression --message="Loading settings..." --weight=1 ynh_script_progression --message="Loading installation settings..." --weight=1
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
@ -59,7 +59,6 @@ ynh_script_progression --message="Restoring the app main directory..." --weight=
ynh_restore_file --origin_path="$final_path" ynh_restore_file --origin_path="$final_path"
# Restore permissions on app files
chmod 750 "$final_path" chmod 750 "$final_path"
chmod -R o-rwx "$final_path" chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path" chown -R $app:www-data "$final_path"

View file

@ -109,9 +109,23 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
then then
ynh_script_progression --message="Upgrading source files..." --weight=6 ynh_script_progression --message="Upgrading source files..." --weight=6
# Create a temporary directory
tmpdir="$(mktemp -d)"
# Backup the config file in the temp dir
cp -a "$final_path/config.php" "$tmpdir/config.php"
# Remove the app directory securely
ynh_secure_remove --file="$final_path"
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path" --keep="$final_path/config.php" ynh_setup_source --dest_dir="$final_path"
#php${phpversion} $final_path/admin/cli/upgrade.php
# Copy the admin saved settings from tmp directory to final path
cp -a "$tmpdir/config.php" "$final_path/config.php"
# Remove the tmp directory securely
ynh_secure_remove --file="$tmpdir"
fi fi
chmod 750 "$final_path" chmod 750 "$final_path"