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 ] if [ $change_domain -eq 1 ]
then 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 fi
if [ $change_path -eq 1 ] if [ $change_path -eq 1 ]
then then
if [ "$old_path" = "/" ]; then if [ "$old_path" = "/" ]; then
old_scriptpath="" old_scriptpath=""
else else
old_scriptpath=$old_path old_scriptpath=$old_path
fi fi
if [ "$new_path" = "/" ]; then if [ "$new_path" = "/" ]; then
new_scriptpath="" new_scriptpath=""
else else
new_scriptpath=$new_path new_scriptpath=$new_path
fi 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 fi
#================================================= #=================================================

View file

@ -14,7 +14,7 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
ynh_clean_setup () { ynh_clean_setup () {
true true
} }
# Exit if an error occurs during the execution of the script # Exit if an error occurs during the execution of the script
ynh_abort_if_errors 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 ynh_script_progression --message="Installing and configuring Mediawiki..." --weight=14
if [ "$path_url" = "/" ]; then if [ "$path_url" = "/" ]; then
scriptpath="" scriptpath=""
else else
scriptpath=$path_url scriptpath=$path_url
fi fi
"php$phpversion" "$final_path/maintenance/install.php" --conf "$final_path" \ "php$phpversion" "$final_path/maintenance/install.php" --conf "$final_path" \
--server "https://$domain" \ --server "https://$domain" \
--scriptpath "$scriptpath" \ --scriptpath "$scriptpath" \
--dbuser "$db_name" \ --dbuser "$db_name" \
--dbpass "$db_pwd" \ --dbpass "$db_pwd" \
--dbname "$db_name" \ --dbname "$db_name" \
--dbprefix "mdk_" \ --dbprefix "mdk_" \
--lang "$language" \ --lang "$language" \
--pass "$admin_password" \ --pass "$admin_password" \
"$wiki_name" "$admin" "$wiki_name" "$admin"
#================================================= #=================================================
# REPLACE CONFIGURATION SETTINGS # 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" ynh_replace_string --target_file="$final_path/LocalSettings.php" --match_string="__ADMIN__" --replace_string="$admin"
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
# "/" by other application packages. Therefore, we assume end-users will do # "/" 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 # this as well and make sure to ensure an "" in all cases where "/" is
# specified # specified
ynh_replace_string --target_file="$final_path/LocalSettings.php" --match_string="__PATH__" --replace_string="" ynh_replace_string --target_file="$final_path/LocalSettings.php" --match_string="__PATH__" --replace_string=""
else 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 fi
ynh_replace_string --target_file="$final_path/LocalSettings.php" --match_string="__DOMAIN__" --replace_string="$domain" 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 # Removed in dec. 2020
ldap_user=$(ynh_app_setting_get --app=$app --key=ldap_user) ldap_user=$(ynh_app_setting_get --app=$app --key=ldap_user)
if [[ -n "$ldap_user" ]]; then if [[ -n "$ldap_user" ]]; then
yunohost user delete "$ldap_user" yunohost user delete "$ldap_user"
ynh_app_setting_delete --app=$app --key=ldap_user ynh_app_setting_delete --app=$app --key=ldap_user
ynh_app_setting_delete --app=$app --key=ldap_password ynh_app_setting_delete --app=$app --key=ldap_password
fi 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" ynh_replace_string --target_file="$final_path/LocalSettings.php" --match_string="__ADMIN__" --replace_string="$admin"
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
# "/" by other application packages. Therefore, we assume end-users will do # "/" 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 # this as well and make sure to ensure an "" in all cases where "/" is
# specified # specified
ynh_replace_string --target_file="$final_path/LocalSettings.php" --match_string="__PATH__" --replace_string="" ynh_replace_string --target_file="$final_path/LocalSettings.php" --match_string="__PATH__" --replace_string=""
else 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 fi
ynh_replace_string --target_file="$final_path/LocalSettings.php" --match_string="__DOMAIN__" --replace_string="$domain" 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 # 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}') password_length=$(ynh_app_setting_get --app=$app --key=admin_password | awk '{print length}')
if (( password_length < 10 )); then 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 "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." 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" echo "\$wgPasswordPolicy['policies']['default']['MinimalPasswordLength'] = 10;" >> "$final_path/LocalSettings.php"
fi fi
"php$phpversion" "$final_path/maintenance/update.php" "php$phpversion" "$final_path/maintenance/update.php"