From 7a493d320b7a41b08ca78c1b785365239a23ed62 Mon Sep 17 00:00:00 2001
From: Mark <mark@openappstack.net>
Date: Fri, 20 Dec 2019 14:02:50 +0100
Subject: [PATCH] Allow to disable sociallogin without failing

---
 templates/nextcloud-config.yaml | 2 +-
 values-local.yaml.example       | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/templates/nextcloud-config.yaml b/templates/nextcloud-config.yaml
index 07aa4867..dd143590 100644
--- a/templates/nextcloud-config.yaml
+++ b/templates/nextcloud-config.yaml
@@ -30,7 +30,7 @@ data:
       "apps": {
         "sociallogin": {
           "auto_create_groups": "1",
-           "custom_oidc_providers": "[{\"name\":\"oas\",\"title\":\"OpenAppStack\",\"authorizeUrl\":\"https:\\\/\\\/{{ .Values.sociallogin.server_name }}\\\/oauth2\\\/auth\",\"tokenUrl\":\"https:\\\/\\\/{{ .Values.sociallogin.server_name}}\\\/oauth2\\\/token\",\"userInfoUrl\":\"https:\\\/\\\/{{ .Values.sociallogin.server_name }}\\\/userinfo\",\"logoutUrl\":\"\",\"clientId\":\"{{ .Values.sociallogin.client_id }}\",\"clientSecret\":\"{{ .Values.sociallogin.client_secret }}\",\"scope\":\"openid profile email openappstack_roles\",\"groupsClaim\":\"{{ .Values.sociallogin.groups_claim }}\",\"style\":\"\",\"defaultGroup\":\"\",\"groupMapping\":{\"admin\":\"admin\"}}]",
+           "custom_oidc_providers": "[{\"name\":\"oas\",\"title\":\"OpenAppStack\",\"authorizeUrl\":\"https:\\\/\\\/{{ .Values.sociallogin.server_name }}\\\/oauth2\\\/auth\",\"tokenUrl\":\"https:\\\/\\\/{{ .Values.sociallogin.server_name}}\\\/oauth2\\\/token\",\"userInfoUrl\":\"https:\\\/\\\/{{ .Values.sociallogin.server_name }}\\\/userinfo\",\"logoutUrl\":\"\",\"clientId\":\"{{ .Values.sociallogin.client_id }}\",\"clientSecret\":\"{{ .Values.sociallogin.client_secret | default "" }}\",\"scope\":\"openid profile email openappstack_roles\",\"groupsClaim\":\"{{ .Values.sociallogin.groups_claim }}\",\"style\":\"\",\"defaultGroup\":\"\",\"groupMapping\":{\"admin\":\"admin\"}}]",
            "update_profile_on_login": "1"
         }
       }
diff --git a/values-local.yaml.example b/values-local.yaml.example
index 2930669b..73243a3f 100644
--- a/values-local.yaml.example
+++ b/values-local.yaml.example
@@ -43,6 +43,15 @@ rabbitmq:
   rabbitmq:
     password: Set a password for rabbitmq here
 
+# apps controls which apps will be installed and enabled in nextcloud
+apps:
+  - name: sociallogin
+    # apps[0].enabled needs to be set to true if you want to enable login via an external
+    # oauth server. In that case you need to configure all the values in `sociallogin`
+    enabled: false
+  - name: onlyoffice
+    enabled: true
+
 # sociallogin enables login via oAuth/Open-ID Connect
 sociallogin:
   # sociallogin.server_name is the FQDN of you oAuth server. The oAuth server needs to
-- 
GitLab