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

Name admin password explicitly and save it in settings

This commit is contained in:
Luke Murphy 2019-08-07 12:50:25 +02:00
parent 2f18c35226
commit 771dd015df
2 changed files with 3 additions and 4 deletions

View file

@ -18,6 +18,7 @@ app=$YNH_APP_INSTANCE_NAME
domain=$YNH_APP_ARG_DOMAIN 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
admin_password=$YNH_APP_ARG_PASSWORD
is_public=$YNH_APP_ARG_IS_PUBLIC is_public=$YNH_APP_ARG_IS_PUBLIC
language=$YNH_APP_ARG_LANGUAGE language=$YNH_APP_ARG_LANGUAGE
password=$YNH_APP_ARG_PASSWORD password=$YNH_APP_ARG_PASSWORD
@ -50,6 +51,7 @@ 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=admin_password --value=$admin_password
ynh_app_setting_set --app=$app --key=is_public --value=$is_public ynh_app_setting_set --app=$app --key=is_public --value=$is_public
ynh_app_setting_set --app=$app --key=language --value=$language ynh_app_setting_set --app=$app --key=language --value=$language
ynh_app_setting_set --app=$app --key=wiki_name --value=$wiki_name ynh_app_setting_set --app=$app --key=wiki_name --value=$wiki_name
@ -148,7 +150,7 @@ php $final_path/maintenance/install.php --conf $final_path \
--dbname $db_name \ --dbname $db_name \
--dbprefix "mdk_" \ --dbprefix "mdk_" \
--lang $language \ --lang $language \
--pass $password \ --pass $admin_password \
$wiki_name $admin $wiki_name $admin
#================================================= #=================================================
@ -158,7 +160,6 @@ cp ../conf/LocalSettings.php $final_path/LocalSettings.php
ynh_replace_string --match_string="__WIKI_NAME__" --replace_string="$wiki_name" --target_file="$final_path/LocalSettings.php" ynh_replace_string --match_string="__WIKI_NAME__" --replace_string="$wiki_name" --target_file="$final_path/LocalSettings.php"
ynh_replace_string --match_string="__ADMIN__" --replace_string="$admin" --target_file="$final_path/LocalSettings.php" ynh_replace_string --match_string="__ADMIN__" --replace_string="$admin" --target_file="$final_path/LocalSettings.php"
ynh_replace_string --match_string="__PASSWORD__" --replace_string="$password" --target_file="$final_path/LocalSettings.php"
if [ $path_url = "/" ]; then if [ $path_url = "/" ]; then
# MediaWiki expects a "" for the root URL which is typically assumed to be # MediaWiki expects a "" for the root URL which is typically assumed to be

View file

@ -15,7 +15,6 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get $app domain) domain=$(ynh_app_setting_get $app domain)
path_url=$(ynh_app_setting_get $app path) path_url=$(ynh_app_setting_get $app path)
admin=$(ynh_app_setting_get $app admin) admin=$(ynh_app_setting_get $app admin)
password=$(ynh_app_setting_get $app password)
is_public=$(ynh_app_setting_get $app is_public) is_public=$(ynh_app_setting_get $app is_public)
final_path=$(ynh_app_setting_get $app final_path) final_path=$(ynh_app_setting_get $app final_path)
language=$(ynh_app_setting_get $app language) language=$(ynh_app_setting_get $app language)
@ -130,7 +129,6 @@ cp ../conf/LocalSettings.php $final_path/LocalSettings.php
ynh_replace_string "__WIKI_NAME__" "YunoWiki" "$final_path/LocalSettings.php" ynh_replace_string "__WIKI_NAME__" "YunoWiki" "$final_path/LocalSettings.php"
ynh_replace_string "__ADMIN__" "$admin" "$final_path/LocalSettings.php" ynh_replace_string "__ADMIN__" "$admin" "$final_path/LocalSettings.php"
ynh_replace_string "__PASSWORD__" "$password" "$final_path/LocalSettings.php"
if [ $path_url = "/" ]; then if [ $path_url = "/" ]; then
# MediaWiki expects a "" for the root URL which is typically assumed to be # MediaWiki expects a "" for the root URL which is typically assumed to be