mirror of
https://github.com/YunoHost-Apps/moodle_ynh.git
synced 2024-09-03 19:46:23 +02:00
parent
bf415bbf37
commit
b2abcd9cef
7 changed files with 39 additions and 27 deletions
|
@ -1,5 +1,5 @@
|
|||
SOURCE_URL=https://github.com/moodle/moodle/archive/v3.11.0.zip
|
||||
SOURCE_SUM=03f878da9f4aeb10c0222d5f9addce7f6c64b216881221bcbac2fec8e34bde5a
|
||||
SOURCE_URL=https://github.com/moodle/moodle/archive/v3.11.1.zip
|
||||
SOURCE_SUM=571f1a59ae6af515932618ba757e98aeae7b9d2c5b10931f9b5296b24b222dfe
|
||||
SOURCE_SUM_PRG=sha256sum
|
||||
SOURCE_FORMAT=zip
|
||||
SOURCE_IN_SUBDIR=true
|
||||
|
|
|
@ -421,6 +421,7 @@ chdir = __FINALPATH__
|
|||
; Common values to change to increase file upload limit
|
||||
php_admin_value[upload_max_filesize] = 1G
|
||||
php_admin_value[post_max_size] = 1G
|
||||
php_value[max_input_vars] = 1G
|
||||
; php_admin_flag[mail.add_x_header] = Off
|
||||
|
||||
; Other common parameters
|
||||
|
|
|
@ -73,4 +73,4 @@ ynh_psql_dump_db --database="$db_name" > db.sql
|
|||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_print_info --message="Backup script completed for Moodle. (YunoHost will then actually copy those files to the archive)."
|
||||
ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."
|
||||
|
|
|
@ -36,8 +36,6 @@ ynh_script_progression --message="Validating installation parameters..." --weigh
|
|||
|
||||
final_path=/var/www/$app
|
||||
test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
|
||||
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
|
||||
|
@ -50,7 +48,6 @@ 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=data_path --value=$data_path
|
||||
|
||||
#=================================================
|
||||
# STANDARD MODIFICATIONS
|
||||
|
@ -114,13 +111,18 @@ ynh_add_fpm_config --package="$extra_php_dependencies"
|
|||
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC SETUP
|
||||
#=================================================
|
||||
# SECURE FILES AND DIRECTORIES
|
||||
# CREATE DATA DIRECTORY
|
||||
#=================================================
|
||||
ynh_script_progression --message="Creating a data directory..." --weight=1
|
||||
|
||||
data_path=/home/yunohost.app/$app
|
||||
ynh_app_setting_set --app=$app --key=data_path --value=$data_path
|
||||
|
||||
mkdir -p $data_path
|
||||
chown -R $app:www-data $data_path
|
||||
|
||||
chmod 750 "$data_path"
|
||||
chmod -R o-rwx "$data_path"
|
||||
chown -R $app:www-data "$data_path"
|
||||
|
||||
#=================================================
|
||||
# SETUP APPLICATION
|
||||
|
@ -158,6 +160,8 @@ ynh_exec_as $app php$phpversion "$final_path/admin/cli/purge_caches.php"
|
|||
ynh_script_progression --message="Adding cron job..." --weight=2
|
||||
|
||||
ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app"
|
||||
chown root: "/etc/cron.d/$app"
|
||||
chmod 644 "/etc/cron.d/$app"
|
||||
|
||||
#=================================================
|
||||
# SETUP SSOWAT
|
||||
|
@ -181,4 +185,4 @@ ynh_systemd_action --service_name=nginx --action=reload
|
|||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Installation of Moodle completed" --last
|
||||
ynh_script_progression --message="Installation of $app completed" --last
|
||||
|
|
|
@ -74,9 +74,6 @@ ynh_script_progression --message="Removing various files..." --weight=2
|
|||
# Remove a cron file
|
||||
ynh_secure_remove --file="/etc/cron.d/$app"
|
||||
|
||||
# Remove a directory securely
|
||||
ynh_secure_remove --file="$data_path"
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
|
@ -91,4 +88,4 @@ ynh_system_user_delete --username=$app
|
|||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Removal of Moodle completed" --last
|
||||
ynh_script_progression --message="Removal of $app completed" --last
|
||||
|
|
|
@ -36,12 +36,10 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
|||
#=================================================
|
||||
ynh_script_progression --message="Validating restoration parameters..." --weight=1
|
||||
|
||||
ynh_webpath_available --domain="$domain" --path_url="$path_url" \
|
||||
ynh_webpath_available --domain=$domain --path_url=$path_url \
|
||||
|| ynh_die --message="Path not available: ${domain}${path_url}"
|
||||
test ! -d "$final_path" \
|
||||
test ! -d $final_path \
|
||||
|| ynh_die --message="There is already a directory: $final_path "
|
||||
test ! -d "$data_path" \
|
||||
|| ynh_die --message="There is already a directory: $data_path "
|
||||
|
||||
#=================================================
|
||||
# STANDARD RESTORATION STEPS
|
||||
|
@ -63,17 +61,27 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
|
|||
#=================================================
|
||||
# RESTORE THE APP MAIN DIR
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring Moodle main directory..." --weight=1
|
||||
ynh_script_progression --message="Restoring the app main directory..." --weight=1
|
||||
|
||||
ynh_restore_file --origin_path=$final_path
|
||||
|
||||
ynh_restore_file --origin_path=$data_path --not_mandatory
|
||||
ynh_restore_file --origin_path="$final_path"
|
||||
|
||||
# Restore permissions on app files
|
||||
chmod 750 "$final_path"
|
||||
chmod -R o-rwx "$final_path"
|
||||
chown -R $app:www-data "$final_path"
|
||||
chown -R $app:www-data $data_path
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE DATA DIRECTORY
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the data directory..." --weight=1
|
||||
|
||||
ynh_restore_file --origin_path="$data_path" --not_mandatory
|
||||
|
||||
mkdir -p $data_path
|
||||
|
||||
chmod 750 "$data_path"
|
||||
chmod -R o-rwx "$data_path"
|
||||
chown -R $app:www-data "$data_path"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE PHP-FPM CONFIGURATION
|
||||
|
@ -127,4 +135,4 @@ ynh_systemd_action --service_name=nginx --action=reload
|
|||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Restoration completed for Moodle" --last
|
||||
ynh_script_progression --message="Restoration completed for $app" --last
|
||||
|
|
|
@ -163,6 +163,8 @@ ynh_exec_as $app php${phpversion} "$final_path/admin/cli/purge_caches.php"
|
|||
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"
|
||||
|
||||
chown -R $app:www-data "$final_path"
|
||||
|
||||
|
@ -177,4 +179,4 @@ ynh_systemd_action --service_name=nginx --action=reload
|
|||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Upgrade of Moodle completed" --last
|
||||
ynh_script_progression --message="Upgrade of $app completed" --last
|
||||
|
|
Loading…
Add table
Reference in a new issue