mirror of
https://github.com/YunoHost-Apps/mediawiki_ynh.git
synced 2024-09-03 19:46:05 +02:00
Indent with spaces.
This commit is contained in:
parent
1719f7c9dc
commit
579809e9be
3 changed files with 63 additions and 63 deletions
|
@ -27,24 +27,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="$install_dir/LocalSettings.php"
|
ynh_replace_string --match_string="\$wgServer = \"https://$old_domain\";" --replace_string="\$wgServer = \"https://$new_domain\";" --target_file="$install_dir/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="$install_dir/LocalSettings.php"
|
ynh_replace_string --match_string="\$wgScriptPath = \"$old_scriptpath\";" --replace_string="\$wgScriptPath = \"$new_scriptpath\";" --target_file="$install_dir/LocalSettings.php"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -24,15 +24,15 @@ ynh_app_setting_set --app=$app --key=create_account --value=$create_account
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Setting up source files..." --weight=4
|
ynh_script_progression --message="Setting up source files..." --weight=4
|
||||||
|
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
# Download, check integrity, uncompress and patch the source from app.src
|
||||||
ynh_setup_source --dest_dir="$install_dir"
|
ynh_setup_source --dest_dir="$install_dir"
|
||||||
ynh_setup_source --dest_dir="$install_dir/extensions/LDAPAuthentication2" --source_id="ldap_authentication2"
|
ynh_setup_source --dest_dir="$install_dir/extensions/LDAPAuthentication2" --source_id="ldap_authentication2"
|
||||||
ynh_setup_source --dest_dir="$install_dir/extensions/LDAPProvider" --source_id="ldap_provider"
|
ynh_setup_source --dest_dir="$install_dir/extensions/LDAPProvider" --source_id="ldap_provider"
|
||||||
ynh_setup_source --dest_dir="$install_dir/extensions/PluggableAuth" --source_id="pluggable_auth"
|
ynh_setup_source --dest_dir="$install_dir/extensions/PluggableAuth" --source_id="pluggable_auth"
|
||||||
|
|
||||||
# ynh_setup_source --dest_dir="$install_dir/extensions/LDAPGroups" --source_id="ldap_groups"
|
# ynh_setup_source --dest_dir="$install_dir/extensions/LDAPGroups" --source_id="ldap_groups"
|
||||||
# ynh_setup_source --dest_dir="$install_dir/extensions/LDAPUserInfo" --source_id="ldap_userinfo"
|
# ynh_setup_source --dest_dir="$install_dir/extensions/LDAPUserInfo" --source_id="ldap_userinfo"
|
||||||
# ynh_setup_source --dest_dir="$install_dir/extensions/LDAPAuthorization" --source_id="ldap_authorization"
|
# ynh_setup_source --dest_dir="$install_dir/extensions/LDAPAuthorization" --source_id="ldap_authorization"
|
||||||
|
|
||||||
chmod -R o-rwx "$install_dir"
|
chmod -R o-rwx "$install_dir"
|
||||||
chown -R $app:www-data "$install_dir"
|
chown -R $app:www-data "$install_dir"
|
||||||
|
@ -61,21 +61,21 @@ ynh_add_nginx_config
|
||||||
ynh_script_progression --message="Installing and configuring Mediawiki..." --weight=14
|
ynh_script_progression --message="Installing and configuring Mediawiki..." --weight=14
|
||||||
|
|
||||||
if [ "$path" = "/" ]; then
|
if [ "$path" = "/" ]; then
|
||||||
scriptpath=""
|
scriptpath=""
|
||||||
else
|
else
|
||||||
scriptpath=$path
|
scriptpath=$path
|
||||||
fi
|
fi
|
||||||
|
|
||||||
"php$phpversion" "$install_dir/maintenance/install.php" --conf "$install_dir" \
|
"php$phpversion" "$install_dir/maintenance/install.php" --conf "$install_dir" \
|
||||||
--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 "$password" \
|
--pass "$password" \
|
||||||
"$wiki_name" "$admin"
|
"$wiki_name" "$admin"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# ADD A CONFIGURATION
|
# ADD A CONFIGURATION
|
||||||
|
@ -83,13 +83,13 @@ fi
|
||||||
ynh_script_progression --message="Adding a configuration file..."
|
ynh_script_progression --message="Adding a configuration file..."
|
||||||
|
|
||||||
if [ "$path" = "/" ]; then
|
if [ "$path" = "/" ]; 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
|
||||||
mediawiki_path=""
|
mediawiki_path=""
|
||||||
else
|
else
|
||||||
mediawiki_path="$path"
|
mediawiki_path="$path"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ynh_add_config --template="../conf/LocalSettings.php" --destination="$install_dir/LocalSettings.php"
|
ynh_add_config --template="../conf/LocalSettings.php" --destination="$install_dir/LocalSettings.php"
|
||||||
|
|
|
@ -24,28 +24,28 @@ ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
||||||
|
|
||||||
# If fpm_footprint doesn't exist, create it
|
# If fpm_footprint doesn't exist, create it
|
||||||
if [ -z "${fpm_footprint:-}" ]; then
|
if [ -z "${fpm_footprint:-}" ]; then
|
||||||
fpm_footprint=low
|
fpm_footprint=low
|
||||||
ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint
|
ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If fpm_usage doesn't exist, create it
|
# If fpm_usage doesn't exist, create it
|
||||||
if [ -z "${fpm_usage:-}" ]; then
|
if [ -z "${fpm_usage:-}" ]; then
|
||||||
fpm_usage=low
|
fpm_usage=low
|
||||||
ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage
|
ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If create_account doesn't exist, create it
|
# If create_account doesn't exist, create it
|
||||||
if [ -z "${create_account:-}" ]; then
|
if [ -z "${create_account:-}" ]; then
|
||||||
create_account=false
|
create_account=false
|
||||||
ynh_app_setting_set --app=$app --key=create_account --value=$create_account
|
ynh_app_setting_set --app=$app --key=create_account --value=$create_account
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 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
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -54,17 +54,17 @@ fi
|
||||||
|
|
||||||
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||||
then
|
then
|
||||||
ynh_script_progression --message="Upgrading source files..." --weight=4
|
ynh_script_progression --message="Upgrading source files..." --weight=4
|
||||||
|
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
# Download, check integrity, uncompress and patch the source from app.src
|
||||||
ynh_setup_source --dest_dir="$install_dir"
|
ynh_setup_source --dest_dir="$install_dir"
|
||||||
ynh_setup_source --dest_dir="$install_dir/extensions/LDAPAuthentication2" --source_id="ldap_authentication2"
|
ynh_setup_source --dest_dir="$install_dir/extensions/LDAPAuthentication2" --source_id="ldap_authentication2"
|
||||||
ynh_setup_source --dest_dir="$install_dir/extensions/LDAPProvider" --source_id="ldap_provider"
|
ynh_setup_source --dest_dir="$install_dir/extensions/LDAPProvider" --source_id="ldap_provider"
|
||||||
ynh_setup_source --dest_dir="$install_dir/extensions/PluggableAuth" --source_id="pluggable_auth"
|
ynh_setup_source --dest_dir="$install_dir/extensions/PluggableAuth" --source_id="pluggable_auth"
|
||||||
|
|
||||||
# ynh_setup_source --dest_dir="$install_dir/extensions/LDAPGroups" --source_id="ldap_groups"
|
# ynh_setup_source --dest_dir="$install_dir/extensions/LDAPGroups" --source_id="ldap_groups"
|
||||||
# ynh_setup_source --dest_dir="$install_dir/extensions/LDAPUserInfo" --source_id="ldap_userinfo"
|
# ynh_setup_source --dest_dir="$install_dir/extensions/LDAPUserInfo" --source_id="ldap_userinfo"
|
||||||
# ynh_setup_source --dest_dir="$install_dir/extensions/LDAPAuthorization" --source_id="ldap_authorization"
|
# ynh_setup_source --dest_dir="$install_dir/extensions/LDAPAuthorization" --source_id="ldap_authorization"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -95,20 +95,20 @@ ynh_add_nginx_config
|
||||||
ynh_script_progression --message="Updating a configuration file..." --weight=4
|
ynh_script_progression --message="Updating a configuration file..." --weight=4
|
||||||
|
|
||||||
if [ "$path" = "/" ]; then
|
if [ "$path" = "/" ]; 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 specified
|
# this as well and make sure to ensure an "" in all cases where "/" is specified
|
||||||
mediawiki_path=""
|
mediawiki_path=""
|
||||||
else
|
else
|
||||||
mediawiki_path="$path"
|
mediawiki_path="$path"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 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=password | awk '{print length}')
|
password_length=$(ynh_app_setting_get --app=$app --key=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;" >> "$install_dir/LocalSettings.php"
|
echo "\$wgPasswordPolicy['policies']['default']['MinimalPasswordLength'] = 10;" >> "$install_dir/LocalSettings.php"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
"php$phpversion" "$install_dir/maintenance/update.php"
|
"php$phpversion" "$install_dir/maintenance/update.php"
|
||||||
|
|
Loading…
Reference in a new issue