diff --git a/scripts/change_url b/scripts/change_url index 2b56942..c0b0d98 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -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 #================================================= diff --git a/scripts/install b/scripts/install index ad94c8c..6dae103 100644 --- a/scripts/install +++ b/scripts/install @@ -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" diff --git a/scripts/upgrade b/scripts/upgrade index f258818..8d6968b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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"