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

Merge pull request #12 from YunoHost-Apps/testing

Testing
This commit is contained in:
Kayou 2020-03-24 18:52:14 +01:00 committed by GitHub
commit f90b3c3b53
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 30 deletions

View file

@ -1,12 +1,8 @@
# See here for more informations
# https://github.com/YunoHost/package_check#syntax-check_process-file
# Move this file from check_process.default to check_process when you have filled it.
;; Test complet
; Manifest
domain="domain.tld" (DOMAIN)
path="/path" (PATH)
admin="john" (USER)
is_public=1 (PUBLIC|public=1|private=0)
; Checks
pkg_linter=1
@ -15,25 +11,14 @@
setup_nourl=0
setup_private=1
setup_public=1
upgrade=0
backup_restore=0
upgrade=1
backup_restore=1
multi_instance=1
incorrect_path=1
port_already_use=0
change_url=0
change_url=1
;;; Levels
Level 1=auto
Level 2=auto
Level 3=auto
# Level 4:
Level 4=0
# Level 5:
# If the level 5 (Package linter) is forced to 1. Please add justifications here.
Level 5=auto
Level 6=auto
Level 7=auto
Level 8=0
Level 9=0
Level 10=0
;;; Options
Email=
Notification=none

View file

@ -49,14 +49,6 @@
"fr": "Administrateur du site (doit être un utilisateur YunoHost existant)"
},
"example": "johndoe"
},
{
"name": "password",
"type": "password",
"ask": {
"en": "Choose a password for the administrator",
"fr": "Choisissez un mot de passe pour l'administrateur"
}
},
{
"name": "is_public",

View file

@ -25,7 +25,6 @@ ynh_abort_if_errors
domain=$YNH_APP_ARG_DOMAIN
path_url=$YNH_APP_ARG_PATH
admin=$YNH_APP_ARG_ADMIN
password=$YNH_APP_ARG_PASSWORD
is_public=$YNH_APP_ARG_IS_PUBLIC
app=$YNH_APP_INSTANCE_NAME
@ -51,7 +50,6 @@ ynh_script_progression --message="Storing installation settings..."
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=password --value=$password
ynh_app_setting_set --app=$app --key=is_public --value=$is_public
#=================================================
@ -128,6 +126,7 @@ chown -R "$app": "$final_path"
ynh_script_progression --message="Configuring the application..." --weight=190
email=$(ynh_user_get_info $admin mail)
password=$(ynh_string_random --length=30)
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
@ -148,6 +147,9 @@ ynh_psql_execute_as_root --database=$db_name --sql="UPDATE public.mdl_config_plu
ynh_psql_execute_as_root --database=$db_name --sql="UPDATE public.mdl_config_plugins SET value='onlogin' WHERE plugin='auth_ldap' AND (name='field_updatelocal_firstname' OR name='field_updatelocal_lastname' OR name='field_updatelocal_email');"
ynh_psql_execute_as_root --database=$db_name --sql="UPDATE public.mdl_config_plugins SET value='locked' WHERE plugin='auth_ldap' AND (name='field_lock_firstname' OR name='field_lock_lastname' OR name='field_lock_email');"
# 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$YNH_PHP_VERSION "$final_path/admin/cli/purge_caches.php"
#=================================================

View file

@ -148,6 +148,9 @@ ynh_psql_execute_as_root --database=$db_name --sql="UPDATE public.mdl_config_plu
ynh_psql_execute_as_root --database=$db_name --sql="UPDATE public.mdl_config_plugins SET value='onlogin' WHERE plugin='auth_ldap' AND (name='field_updatelocal_firstname' OR name='field_updatelocal_lastname' OR name='field_updatelocal_email');"
ynh_psql_execute_as_root --database=$db_name --sql="UPDATE public.mdl_config_plugins SET value='locked' WHERE plugin='auth_ldap' AND (name='field_lock_firstname' OR name='field_lock_lastname' OR name='field_lock_email');"
# 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$YNH_PHP_VERSION "$final_path/admin/cli/purge_caches.php"
#=================================================