1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/moodle_ynh.git synced 2024-09-03 19:46:23 +02:00
This commit is contained in:
ericgaspar 2021-08-18 12:44:01 +02:00
parent 639cac82f8
commit 38a2b2964f
No known key found for this signature in database
GPG key ID: 574F281483054D44
5 changed files with 5 additions and 22 deletions

View file

@ -3,7 +3,6 @@
domain="domain.tld" domain="domain.tld"
path="/path" path="/path"
admin="john" admin="john"
language="fr"
site_name="Moodle" site_name="Moodle"
is_public=1 is_public=1
; Checks ; Checks

View file

@ -60,16 +60,6 @@
"name": "is_public", "name": "is_public",
"type": "boolean", "type": "boolean",
"default": true "default": true
},
{
"name": "language",
"type": "string",
"ask": {
"en": "Choose the application language",
"fr": "Choisissez la langue de l'application"
},
"choices": ["en", "fr"],
"default": "fr"
} }
] ]
} }

View file

@ -26,9 +26,12 @@ app=$YNH_APP_INSTANCE_NAME
#================================================= #=================================================
ynh_script_progression --message="Loading installation settings..." --weight=1 ynh_script_progression --message="Loading installation settings..." --weight=1
# Needed for helper "ynh_add_nginx_config"
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
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
db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
#================================================= #=================================================
# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP # BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP

View file

@ -24,7 +24,6 @@ domain=$YNH_APP_ARG_DOMAIN
path_url=$YNH_APP_ARG_PATH path_url=$YNH_APP_ARG_PATH
admin=$YNH_APP_ARG_ADMIN admin=$YNH_APP_ARG_ADMIN
is_public=$YNH_APP_ARG_IS_PUBLIC is_public=$YNH_APP_ARG_IS_PUBLIC
language=$YNH_APP_ARG_LANGUAGE
site_name=$YNH_APP_ARG_SITE_NAME site_name=$YNH_APP_ARG_SITE_NAME
email=$(ynh_user_get_info --username=$admin --key=mail) email=$(ynh_user_get_info --username=$admin --key=mail)
password=$(ynh_string_random --length=30) password=$(ynh_string_random --length=30)
@ -50,7 +49,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=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url 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=admin --value=$admin
ynh_app_setting_set --app=$app --key=language --value=$language
ynh_app_setting_set --app=$app --key=site_name --value=$site_name ynh_app_setting_set --app=$app --key=site_name --value=$site_name
#================================================= #=================================================
@ -129,7 +127,7 @@ chown -R $app:www-data "$data_path"
#================================================= #=================================================
ynh_script_progression --message="Setting up the application..." --weight=19 ynh_script_progression --message="Setting up the application..." --weight=19
php${phpversion} "$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" --lang="$language" --adminuser="$admin" --adminpass="$password" --adminemail="$email" --fullname="$site_name" --shortname="$site_name" --non-interactive --agree-license php${phpversion} "$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="$site_name" --shortname="$site_name" --non-interactive --agree-license
# Calculate and store the config file checksum into the app settings # Calculate and store the config file checksum into the app settings
ynh_store_file_checksum "$final_path/config.php" ynh_store_file_checksum "$final_path/config.php"

View file

@ -22,7 +22,6 @@ admin=$(ynh_app_setting_get --app=$app --key=admin)
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
data_path=$(ynh_app_setting_get --app=$app --key=data_path) data_path=$(ynh_app_setting_get --app=$app --key=data_path)
db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_name=$(ynh_app_setting_get --app=$app --key=db_name)
language=$(ynh_app_setting_get --app=$app --key=language)
site_name=$(ynh_app_setting_get --app=$app --key=site_name) site_name=$(ynh_app_setting_get --app=$app --key=site_name)
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
@ -56,12 +55,6 @@ if [ -z "$admin" ]; then
ynh_die --message="This app can't be upgraded from a very old version of the package. Please remove and reinstall Moodle" ynh_die --message="This app can't be upgraded from a very old version of the package. Please remove and reinstall Moodle"
fi fi
# If the language is not defined
if [ -z "$language" ]; then
language="fr"
ynh_app_setting_set --app=$app --key=language --value=$language
fi
# If the site_name is not defined # If the site_name is not defined
if [ -z "$site_name" ]; then if [ -z "$site_name" ]; then
site_name="YunoHost" site_name="YunoHost"