mirror of
https://github.com/YunoHost-Apps/moodle_ynh.git
synced 2024-09-03 19:46:23 +02:00
parent
cf02fa533e
commit
499ac857a9
9 changed files with 62 additions and 71 deletions
|
@ -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.
|
||||
|
||||
**Shipped version:** 3.10.1
|
||||
**Shipped version:** 3.10.2
|
||||
|
||||
## Screenshots
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
SOURCE_URL=https://github.com/moodle/moodle/archive/v3.10.1.zip
|
||||
SOURCE_SUM=e61c53ce6e972e18e9ef34ad4406654dacc9b627059f7fb1437d6db0a801c308
|
||||
SOURCE_URL=https://github.com/moodle/moodle/archive/v3.10.2.zip
|
||||
SOURCE_SUM=6c54328ca6c40fb5cb4eb66a449b3c5fe7fe03bb04ab21df1156ba3c9c2ed1c6
|
||||
SOURCE_SUM_PRG=sha256sum
|
||||
SOURCE_FORMAT=zip
|
||||
SOURCE_IN_SUBDIR=true
|
||||
|
|
|
@ -1 +1 @@
|
|||
*/15 * * * * __APP__ /usr/bin/php__PHPVERSION__ -f __FINAL_PATH__/admin/cli/cron.php
|
||||
*/15 * * * * __USER__ /usr/bin/php__PHPVERSION__ -f __FINALPATH__/admin/cli/cron.php
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"en": "Online learning platform",
|
||||
"fr": "Plateforme d'apprentissage en ligne"
|
||||
},
|
||||
"version": "3.10.1~ynh1",
|
||||
"version": "3.10.2~ynh1",
|
||||
"url": "https://moodle.org/",
|
||||
"license": "GPL-3.0-or-later",
|
||||
"maintainer": {
|
||||
|
|
|
@ -23,11 +23,11 @@ ynh_print_info --message="Loading installation settings..."
|
|||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
final_path=$(ynh_app_setting_get --app="$app" --key=final_path)
|
||||
data_path=$(ynh_app_setting_get --app="$app" --key=data_path)
|
||||
domain=$(ynh_app_setting_get --app="$app" --key=domain)
|
||||
db_name=$(ynh_app_setting_get --app="$app" --key=db_name)
|
||||
phpversion=$(ynh_app_setting_get --app="$app" --key=phpversion)
|
||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||
data_path=$(ynh_app_setting_get --app=$app --key=data_path)
|
||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||
|
||||
#=================================================
|
||||
# DECLARE DATA AND CONF FILES TO BACKUP
|
||||
|
|
|
@ -40,16 +40,16 @@ data_path=/home/yunohost.app/$app
|
|||
test ! -e "$data_path" || ynh_die --message="This path already contains a folder"
|
||||
|
||||
# Register (book) web path
|
||||
ynh_webpath_register --app="$app" --domain="$domain" --path_url="$path_url"
|
||||
ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
|
||||
|
||||
#=================================================
|
||||
# STORE SETTINGS FROM MANIFEST
|
||||
#=================================================
|
||||
ynh_script_progression --message="Storing installation settings..." --weight=1
|
||||
|
||||
ynh_app_setting_set --app="$app" --key=domain --value="$domain"
|
||||
ynh_app_setting_set --app="$app" --key=path --value="$path_url"
|
||||
ynh_app_setting_set --app="$app" --key=admin --value="$admin"
|
||||
ynh_app_setting_set --app=$app --key=domain --value=$domain
|
||||
ynh_app_setting_set --app=$app --key=path --value=$path_url
|
||||
ynh_app_setting_set --app=$app --key=admin --value=$admin
|
||||
|
||||
#=================================================
|
||||
# STANDARD MODIFICATIONS
|
||||
|
@ -58,7 +58,7 @@ ynh_app_setting_set --app="$app" --key=admin --value="$admin"
|
|||
#=================================================
|
||||
ynh_script_progression --message="Installing dependencies..." --weight=1
|
||||
|
||||
ynh_install_app_dependencies "$pkg_dependencies"
|
||||
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
|
||||
|
||||
#=================================================
|
||||
# CREATE POSTGRESQL DATABASE
|
||||
|
@ -67,19 +67,19 @@ ynh_script_progression --message="Creating a PostgreSQL database..." --weight=4
|
|||
|
||||
ynh_psql_test_if_first_run
|
||||
|
||||
db_name=$(ynh_sanitize_dbid --db_name="$app")
|
||||
db_name=$(ynh_sanitize_dbid --db_name=$app)
|
||||
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"
|
||||
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" psqlpwd)
|
||||
db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
|
||||
|
||||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Setting up source files..." --weight=6
|
||||
|
||||
ynh_app_setting_set --app="$app" --key=final_path --value="$final_path"
|
||||
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source --dest_dir="$final_path"
|
||||
|
||||
|
@ -97,7 +97,7 @@ ynh_add_nginx_config
|
|||
ynh_script_progression --message="Configuring system user..." --weight=2
|
||||
|
||||
# Create a system user
|
||||
ynh_system_user_create --username="$app"
|
||||
ynh_system_user_create --username=$app
|
||||
|
||||
#=================================================
|
||||
# PHP-FPM CONFIGURATION
|
||||
|
@ -106,7 +106,7 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=1
|
|||
|
||||
# Create a dedicated php-fpm config
|
||||
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)
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC SETUP
|
||||
|
@ -114,10 +114,10 @@ phpversion=$(ynh_app_setting_get --app="$app" --key=phpversion)
|
|||
# SECURE FILES AND DIRECTORIES
|
||||
#=================================================
|
||||
|
||||
ynh_app_setting_set --app="$app" --key=data_path --value="$data_path"
|
||||
mkdir -p "$data_path"
|
||||
chown -R $app: "$data_path"
|
||||
chown -R $app: "$final_path"
|
||||
ynh_app_setting_set --app=$app --key=data_path --value=$data_path
|
||||
mkdir -p $data_path
|
||||
chown -R $app: $data_path
|
||||
chown -R $app: $final_path
|
||||
|
||||
#=================================================
|
||||
# SETUP APPLICATION
|
||||
|
@ -147,18 +147,14 @@ ynh_psql_execute_as_root --database="$db_name" --sql="UPDATE public.mdl_config_p
|
|||
# The admin is an ldap user
|
||||
ynh_psql_execute_as_root --database="$db_name" --sql="UPDATE public.mdl_user SET auth='ldap' WHERE username='$admin';"
|
||||
|
||||
exec_as $app php${phpversion} "$final_path/admin/cli/purge_caches.php"
|
||||
exec_as $app php$phpversion "$final_path/admin/cli/purge_caches.php"
|
||||
|
||||
#=================================================
|
||||
# ADD CRON JOB
|
||||
#=================================================
|
||||
ynh_script_progression --message="Adding cron job..." --weight=2
|
||||
|
||||
# Set up poller
|
||||
cp "../conf/cron" "/etc/cron.d/$app"
|
||||
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="/etc/cron.d/$app"
|
||||
ynh_replace_string --match_string="__FINAL_PATH__" --replace_string="$final_path" --target_file="/etc/cron.d/$app"
|
||||
ynh_replace_string --match_string="__PHPVERSION__" --replace_string="$phpversion" --target_file="/etc/cron.d/$app"
|
||||
ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app"
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
|
@ -168,8 +164,8 @@ ynh_replace_string --match_string="__PHPVERSION__" --replace_string="$phpversion
|
|||
ynh_script_progression --message="Securing files and directories..." --weight=1
|
||||
|
||||
# Set permissions to app files
|
||||
chown -R $app: "$data_path"
|
||||
chown -R $app: "$final_path"
|
||||
chown -R $app: $data_path
|
||||
chown -R $app: $final_path
|
||||
|
||||
#=================================================
|
||||
# SETUP SSOWAT
|
||||
|
|
|
@ -16,11 +16,11 @@ ynh_script_progression --message="Loading installation settings..." --weight=1
|
|||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
domain=$(ynh_app_setting_get --app="$app" --key=domain)
|
||||
db_name=$(ynh_app_setting_get --app="$app" --key=db_name)
|
||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||
db_user=$db_name
|
||||
final_path=$(ynh_app_setting_get --app="$app" --key=final_path)
|
||||
data_path=$(ynh_app_setting_get --app="$app" --key=data_path)
|
||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||
data_path=$(ynh_app_setting_get --app=$app --key=data_path)
|
||||
|
||||
#=================================================
|
||||
# STANDARD REMOVE
|
||||
|
@ -30,7 +30,7 @@ data_path=$(ynh_app_setting_get --app="$app" --key=data_path)
|
|||
ynh_script_progression --message="Removing the PostgreSQL database..." --weight=1
|
||||
|
||||
# Remove a database if it exists, along with the associated user
|
||||
ynh_psql_remove_db --db_user="$db_user" --db_name="$db_name"
|
||||
ynh_psql_remove_db --db_user=$db_user --db_name=$db_name
|
||||
|
||||
#=================================================
|
||||
# REMOVE DEPENDENCIES
|
||||
|
|
|
@ -23,13 +23,13 @@ ynh_script_progression --message="Loading settings..." --weight=1
|
|||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
domain=$(ynh_app_setting_get --app="$app" --key=domain)
|
||||
path_url=$(ynh_app_setting_get --app="$app" --key=path)
|
||||
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)
|
||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||
path_url=$(ynh_app_setting_get --app=$app --key=path)
|
||||
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
|
||||
phpversion=$(ynh_app_setting_get --app="$app" --key=phpversion)
|
||||
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||
|
||||
#=================================================
|
||||
# CHECK IF THE APP CAN BE RESTORED
|
||||
|
@ -57,9 +57,9 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
|||
#=================================================
|
||||
ynh_script_progression --message="Restoring Moodle main directory..." --weight=1
|
||||
|
||||
ynh_restore_file --origin_path="$final_path"
|
||||
ynh_restore_file --origin_path=$final_path
|
||||
|
||||
ynh_restore_file --origin_path="$data_path"
|
||||
ynh_restore_file --origin_path=$data_path
|
||||
|
||||
#=================================================
|
||||
# RECREATE THE DEDICATED USER
|
||||
|
@ -75,8 +75,8 @@ ynh_system_user_create --username=$app
|
|||
ynh_script_progression --message="Restoring user rights..."
|
||||
|
||||
# Restore permissions on app files
|
||||
chown -R $app: "$final_path"
|
||||
chown -R $app: "$data_path"
|
||||
chown -R $app: $final_path
|
||||
chown -R $app: $data_path
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE PHP-FPM CONFIGURATION
|
||||
|
@ -96,7 +96,7 @@ ynh_add_fpm_config --package="$extra_php_dependencies"
|
|||
ynh_script_progression --message="Reinstalling dependencies..." --weight=3
|
||||
|
||||
# Define and install dependencies
|
||||
ynh_install_app_dependencies "$pkg_dependencies"
|
||||
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE POSTGRESQL DATABASE
|
||||
|
@ -105,9 +105,9 @@ ynh_script_progression --message="Restoring the PostgreSQL database..." --weight
|
|||
|
||||
ynh_psql_test_if_first_run
|
||||
|
||||
db_pwd=$(ynh_app_setting_get --app="$app" --key=psqlpwd)
|
||||
ynh_psql_setup_db --db_user="$db_user" --db_name="$db_name" --db_pwd="$db_pwd"
|
||||
ynh_psql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" < ./db.sql
|
||||
db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
|
||||
ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
|
||||
ynh_psql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE CRON FILE
|
||||
|
|
|
@ -16,13 +16,12 @@ ynh_script_progression --message="Loading installation settings..." --weight=1
|
|||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
domain=$(ynh_app_setting_get --app="$app" --key=domain)
|
||||
path_url=$(ynh_app_setting_get --app="$app" --key=path)
|
||||
admin=$(ynh_app_setting_get --app="$app" --key=admin)
|
||||
is_public=$(ynh_app_setting_get --app="$app" --key=is_public)
|
||||
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)
|
||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||
path_url=$(ynh_app_setting_get --app=$app --key=path)
|
||||
admin=$(ynh_app_setting_get --app=$app --key=admin)
|
||||
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)
|
||||
|
||||
#=================================================
|
||||
# CHECK VERSION
|
||||
|
@ -88,7 +87,7 @@ ynh_add_nginx_config
|
|||
#=================================================
|
||||
ynh_script_progression --message="Upgrading dependencies..." --weight=1
|
||||
|
||||
ynh_install_app_dependencies $pkg_dependencies
|
||||
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
|
@ -105,7 +104,7 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1
|
|||
|
||||
# Create a dedicated PHP-FPM config
|
||||
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)
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC UPGRADE
|
||||
|
@ -126,8 +125,8 @@ ynh_store_file_checksum --file="$final_path/config.php"
|
|||
#=================================================
|
||||
|
||||
# Set permissions on app files
|
||||
chown -R $app: "$data_path"
|
||||
chown -R $app: "$final_path"
|
||||
chown -R $app: $data_path
|
||||
chown -R $app: $final_path
|
||||
|
||||
#=================================================
|
||||
# ACTIVATE LDAP SUPPORT
|
||||
|
@ -154,11 +153,7 @@ exec_as $app php${phpversion} "$final_path/admin/cli/purge_caches.php"
|
|||
#=================================================
|
||||
ynh_script_progression --message="Adding cron job..." --weight=4
|
||||
|
||||
# Set up poller
|
||||
cp "../conf/cron" "/etc/cron.d/$app"
|
||||
ynh_replace_string "__APP__" "$app" "/etc/cron.d/$app"
|
||||
ynh_replace_string "__FINAL_PATH__" "$final_path" "/etc/cron.d/$app"
|
||||
ynh_replace_string "__PHPVERSION__" "$phpversion" "/etc/cron.d/$app"
|
||||
ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app"
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
|
@ -168,8 +163,8 @@ ynh_replace_string "__PHPVERSION__" "$phpversion" "/etc/cron.d/$app"
|
|||
ynh_script_progression --message="Securing files and directories..." --weight=1
|
||||
|
||||
# Set permissions on app files
|
||||
chown -R $app: "$data_path"
|
||||
chown -R $app: "$final_path"
|
||||
chown -R $app: $data_path
|
||||
chown -R $app: $final_path
|
||||
|
||||
#=================================================
|
||||
# RELOAD NGINX
|
||||
|
|
Loading…
Add table
Reference in a new issue