1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/moodle_ynh.git synced 2024-09-03 19:46:23 +02:00

data_root -> data_path

This commit is contained in:
Kay0u 2020-03-24 15:27:09 +01:00
parent fe3080eeae
commit f5febd6fec
No known key found for this signature in database
GPG key ID: 7FF262C033518333
4 changed files with 15 additions and 15 deletions

View file

@ -26,7 +26,7 @@ ynh_script_progression --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
data_root=$(ynh_app_setting_get --app=$app --key=data_root)
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)
@ -39,7 +39,7 @@ ynh_script_progression --message="Backing up the main app directory..."
ynh_backup --src_path="$final_path"
ynh_backup --src_path="$data_root"
ynh_backup --src_path="$data_path"
#=================================================
# BACKUP THE NGINX CONFIGURATION

View file

@ -37,8 +37,8 @@ ynh_script_progression --message="Validating installation parameters..."
final_path=/var/www/$app
test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
data_root=/home/yunohost.app/$app
test ! -e "$data_root" || 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
@ -117,9 +117,9 @@ ynh_add_fpm_config --phpversion="7.3"
# SECURE FILES AND DIRECTORIES
#=================================================
ynh_app_setting_set --app=$app --key=data_root --value=$data_root
mkdir -p $data_root
chown -R "$app": "$data_root"
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"
#=================================================
@ -129,7 +129,7 @@ ynh_script_progression --message="Configuring the application..." --weight=190
email=$(ynh_user_get_info $admin mail)
exec_as "$app" php$YNH_PHP_VERSION "$final_path/admin/cli/install.php" --wwwroot="https://$domain${path_url%/}" --dataroot=$data_root --dbtype='pgsql' --dbname=$db_name --dbuser=$db_name --dbpass=$db_pwd --adminuser=$admin --adminpass=$password --adminemail=$email --fullname="YunoHost" --shortname="YNH" --non-interactive --agree-license
exec_as "$app" php$YNH_PHP_VERSION "$final_path/admin/cli/install.php" --wwwroot="https://$domain${path_url%/}" --dataroot=$data_path --dbtype='pgsql' --dbname=$db_name --dbuser=$db_name --dbpass=$db_pwd --adminuser=$admin --adminpass=$password --adminemail=$email --fullname="YunoHost" --shortname="YNH" --non-interactive --agree-license
# Calculate and store the config file checksum into the app settings
ynh_store_file_checksum "$final_path/config.php"

View file

@ -21,7 +21,7 @@ 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)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
data_root=$(ynh_app_setting_get --app=$app --key=data_root)
data_path=$(ynh_app_setting_get --app=$app --key=data_path)
#=================================================
# STANDARD REMOVE
@ -76,7 +76,7 @@ ynh_remove_php "7.3"
ynh_secure_remove --file="/etc/cron.d/$app"
# Remove a directory securely
ynh_secure_remove --file="$data_root"
ynh_secure_remove --file="$data_path"
#=================================================
# GENERIC FINALIZATION

View file

@ -28,7 +28,7 @@ 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_root=$(ynh_app_setting_get --app=$app --key=data_root)
data_path=$(ynh_app_setting_get --app=$app --key=data_path)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
#=================================================
@ -40,8 +40,8 @@ ynh_webpath_available --domain=$domain --path_url=$path_url \
|| ynh_die --message="Path not available: ${domain}${path_url}"
test ! -d $final_path \
|| ynh_die --message="There is already a directory: $final_path "
test ! -d $data_root \
|| ynh_die --message="There is already a directory: $data_root "
test ! -d $data_path \
|| ynh_die --message="There is already a directory: $data_path "
#=================================================
# STANDARD RESTORATION STEPS
@ -58,7 +58,7 @@ ynh_script_progression --message="Restoring the app main directory..."
ynh_restore_file --origin_path="$final_path"
ynh_restore_file --origin_path="$data_root"
ynh_restore_file --origin_path="$data_path"
#=================================================
# RECREATE THE DEDICATED USER
@ -74,7 +74,7 @@ ynh_system_user_create --username=$app
# Restore permissions on app files
chown -R $app: $final_path
chown -R $app: $data_root
chown -R $app: $data_path
#=================================================
# RESTORE THE PHP-FPM CONFIGURATION