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

spaces -> tabs

This commit is contained in:
Salamandar 2021-05-19 18:18:33 +02:00 committed by Salamandar
parent 275c89d1f0
commit c6d1719ac1
3 changed files with 42 additions and 42 deletions

View file

@ -102,24 +102,24 @@ ynh_script_progression --message="Setting the new URL..." --weight=1
if [ $change_domain -eq 1 ]
then
ynh_replace_string --match_string="\$wgServer = \"https://$old_domain\";" --replace_string="\$wgServer = \"https://$new_domain\";" --target_file="$final_path/LocalSettings.php"
ynh_replace_string --match_string="\$wgServer = \"https://$old_domain\";" --replace_string="\$wgServer = \"https://$new_domain\";" --target_file="$final_path/LocalSettings.php"
fi
if [ $change_path -eq 1 ]
then
if [ "$old_path" = "/" ]; then
old_scriptpath=""
else
old_scriptpath=$old_path
fi
if [ "$old_path" = "/" ]; then
old_scriptpath=""
else
old_scriptpath=$old_path
fi
if [ "$new_path" = "/" ]; then
new_scriptpath=""
else
new_scriptpath=$new_path
fi
if [ "$new_path" = "/" ]; then
new_scriptpath=""
else
new_scriptpath=$new_path
fi
ynh_replace_string --match_string="\$wgScriptPath = \"$old_scriptpath\";" --replace_string="\$wgScriptPath = \"$new_scriptpath\";" --target_file="$final_path/LocalSettings.php"
ynh_replace_string --match_string="\$wgScriptPath = \"$old_scriptpath\";" --replace_string="\$wgScriptPath = \"$new_scriptpath\";" --target_file="$final_path/LocalSettings.php"
fi
#=================================================

View file

@ -14,7 +14,7 @@ source /usr/share/yunohost/helpers
#=================================================
ynh_clean_setup () {
true
true
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
@ -132,21 +132,21 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#=================================================
ynh_script_progression --message="Installing and configuring Mediawiki..." --weight=14
if [ "$path_url" = "/" ]; then
scriptpath=""
scriptpath=""
else
scriptpath=$path_url
scriptpath=$path_url
fi
"php$phpversion" "$final_path/maintenance/install.php" --conf "$final_path" \
--server "https://$domain" \
--scriptpath "$scriptpath" \
--dbuser "$db_name" \
--dbpass "$db_pwd" \
--dbname "$db_name" \
--dbprefix "mdk_" \
--lang "$language" \
--pass "$admin_password" \
"$wiki_name" "$admin"
--server "https://$domain" \
--scriptpath "$scriptpath" \
--dbuser "$db_name" \
--dbpass "$db_pwd" \
--dbname "$db_name" \
--dbprefix "mdk_" \
--lang "$language" \
--pass "$admin_password" \
"$wiki_name" "$admin"
#=================================================
# REPLACE CONFIGURATION SETTINGS
@ -157,13 +157,13 @@ ynh_replace_string --target_file="$final_path/LocalSettings.php" --match_string=
ynh_replace_string --target_file="$final_path/LocalSettings.php" --match_string="__ADMIN__" --replace_string="$admin"
if [ "$path_url" = "/" ]; then
# MediaWiki expects a "" for the root URL which is typically assumed to be
# "/" by other application packages. Therefore, we assume end-users will do
# this as well and make sure to ensure an "" in all cases where "/" is
# specified
ynh_replace_string --target_file="$final_path/LocalSettings.php" --match_string="__PATH__" --replace_string=""
# MediaWiki expects a "" for the root URL which is typically assumed to be
# "/" by other application packages. Therefore, we assume end-users will do
# this as well and make sure to ensure an "" in all cases where "/" is
# specified
ynh_replace_string --target_file="$final_path/LocalSettings.php" --match_string="__PATH__" --replace_string=""
else
ynh_replace_string --target_file="$final_path/LocalSettings.php" --match_string="__PATH__" --replace_string="$path_url"
ynh_replace_string --target_file="$final_path/LocalSettings.php" --match_string="__PATH__" --replace_string="$path_url"
fi
ynh_replace_string --target_file="$final_path/LocalSettings.php" --match_string="__DOMAIN__" --replace_string="$domain"

View file

@ -146,9 +146,9 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
# Removed in dec. 2020
ldap_user=$(ynh_app_setting_get --app=$app --key=ldap_user)
if [[ -n "$ldap_user" ]]; then
yunohost user delete "$ldap_user"
ynh_app_setting_delete --app=$app --key=ldap_user
ynh_app_setting_delete --app=$app --key=ldap_password
yunohost user delete "$ldap_user"
ynh_app_setting_delete --app=$app --key=ldap_user
ynh_app_setting_delete --app=$app --key=ldap_password
fi
#=================================================
@ -168,13 +168,13 @@ ynh_replace_string --target_file="$final_path/LocalSettings.php" --match_string=
ynh_replace_string --target_file="$final_path/LocalSettings.php" --match_string="__ADMIN__" --replace_string="$admin"
if [ "$path_url" = "/" ]; then
# MediaWiki expects a "" for the root URL which is typically assumed to be
# "/" by other application packages. Therefore, we assume end-users will do
# this as well and make sure to ensure an "" in all cases where "/" is
# specified
ynh_replace_string --target_file="$final_path/LocalSettings.php" --match_string="__PATH__" --replace_string=""
# MediaWiki expects a "" for the root URL which is typically assumed to be
# "/" by other application packages. Therefore, we assume end-users will do
# this as well and make sure to ensure an "" in all cases where "/" is
# specified
ynh_replace_string --target_file="$final_path/LocalSettings.php" --match_string="__PATH__" --replace_string=""
else
ynh_replace_string --target_file="$final_path/LocalSettings.php" --match_string="__PATH__" --replace_string="$path_url"
ynh_replace_string --target_file="$final_path/LocalSettings.php" --match_string="__PATH__" --replace_string="$path_url"
fi
ynh_replace_string --target_file="$final_path/LocalSettings.php" --match_string="__DOMAIN__" --replace_string="$domain"
@ -190,9 +190,9 @@ ynh_replace_string --target_file="$final_path/LocalSettings.php" --match_string=
# Check for admin password being too short for the new mediawiki requirements
password_length=$(ynh_app_setting_get --app=$app --key=admin_password | awk '{print length}')
if (( password_length < 10 )); then
ynh_print_warn -m "The current admin password is $password_length long. Mediawiki now requires a 10 chars minimum password."
ynh_print_warn -m "We are adapting the minimum length, but that would be great to change the admin password."
echo "\$wgPasswordPolicy['policies']['default']['MinimalPasswordLength'] = 10;" >> "$final_path/LocalSettings.php"
ynh_print_warn -m "The current admin password is $password_length long. Mediawiki now requires a 10 chars minimum password."
ynh_print_warn -m "We are adapting the minimum length, but that would be great to change the admin password."
echo "\$wgPasswordPolicy['policies']['default']['MinimalPasswordLength'] = 10;" >> "$final_path/LocalSettings.php"
fi
"php$phpversion" "$final_path/maintenance/update.php"