Compare commits

...

1 Commits

Author SHA1 Message Date
Philipp Rothmann 5ee0547315 add shellscript 2022-08-04 18:29:38 +02:00
1 changed files with 55 additions and 0 deletions

55
configure_nextcloud.sh Executable file
View File

@ -0,0 +1,55 @@
#!/bin/bash
set -eu
app_name=$1
domain=$2
secret=$3
sub_occ(){
abra app run --user www-data $app_name app /var/www/html/occ "$@"
}
# Install apps
sub_occ app:install calendar || true
sub_occ app:install sociallogin || true
sub_occ app:install onlyoffice || true
# Disable Dashboard
sub_occ app:disable dashboard || true
# Configure SSO
sub_occ config:app:set sociallogin custom_providers --value="
{
\"custom_oidc\": [
{
\"name\": \"authentik\",
\"title\": \"Login\",
\"authorizeUrl\": \"https://$domain/application/o/authorize/\",
\"tokenUrl\": \"https://$domain/application/o/token/\",
\"displayNameClaim\": \"preferred_username\",
\"userInfoUrl\": \"https://$domain/application/o/userinfo/\",
\"logoutUrl\": \"https://$domain/application/o/nextcloud/end-session/\",
\"clientId\": \"nextcloud\",
\"clientSecret\": \"$secret\",
\"scope\": \"openid profile email nextcloud\",
\"groupsClaim\": \"nextcloud_groups\",
\"style\": \"openid\",
\"defaultGroup\": \"\",
\"groupMapping\": {
\"admin\": \"admin\"
}
}
]
}"
sub_occ config:app:set sociallogin update_profile_on_login --value 1
sub_occ config:app:set sociallogin auto_create_groups --value 1
sub_occ config:app:set sociallogin hide_default_login --value 1
sub_occ config:system:set allow_user_to_change_display_name --value=false
sub_occ config:system:set lost_password_link --value=disabled
sub_occ config:system:set social_login_auto_redirect --value=true
abra app run --user www-data $app_name app cat config/config.php