---
# https://github.com/nextcloud/helm/blob/main/charts/nextcloud/values.yaml

image:
  repository: nextcloud
  tag: "stable" #https://hub.docker.com/_/nextcloud/tags?page=1&name=28.
  flavor: apache
#  pullSecrets: regcred

ingress:
  enabled: true
  annotations:
    kubernetes.io/ingress.class: "traefik"
    traefik.ingress.kubernetes.io/router.entrypoints: websecure
    traefik.ingress.kubernetes.io/router.tls: "true"
    traefik.ingress.kubernetes.io/custom-response-headers: "Access-Control-Allow-Origin:*||Access-Control-Allow-Methods:GET,POST,OPTIONS||Access-Control-Allow-Headers:DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range||Access-Control-Expose-Headers:Content-Length,Content-Range"
    cert-manager.io/cluster-issuer: letsencrypt-production

  tls: # < placing a host in the TLS config will determine what ends up in the cert's subjectAltNames
    - secretName: xai-corp-production-tls-xaibox
      hosts:
        - xaibox.xai-corp.net

nextcloud:
#  image: xaicorp/nextcloud
  host: xaibox.xai-corp.net
#  datadir: /opt/nextcloud_data

  #database users
  username: nextcloud_admin
  password: '1nd80h%!0CH3189H1G'

#  defaultConfigs:
#    autoconfig\.php: true
#  phpConfigs:
#    memory.ini: |-

  configs:
#    installed.config.php: |-
#      <?php
#      $CONFIG = [
#        'overwriteprotocol' => 'https',
#      ];
    installed.config.php: |-
      <?php
      $CONFIG = [
        'instanceid' => 'ocdt5et0qmad',
        'passwordsalt' => 'r9q0q/rh+zVick0gTc/0T2/37oNwQo',
        'secret' => 'Rwl+It4J/0GK/6VL51sCiZ2ajpOwAPsnO61v6iN7TGmdSpAQ',
        'trusted_domains' => [
          0 => 'localhost',
          1 => 'xaibox.xai-corp.net',
        ],
        'overwriteprotocol' => 'https',
      ];
#    config.extra.php: |-
#      <?php
#      $CONFIG = array (
#        'htaccess.RewriteBase' => '/',
#        'memcache.local' => '\\OC\\Memcache\\APCu',
#        'apps_paths' =>
#        array (
#          0 =>
#          array (
#            'path' => '/var/www/html/apps',
#            'url' => '/apps',
#            'writable' => false,
#          ),
#          1 =>
#          array (
#            'path' => '/var/www/html/custom_apps',
#            'url' => '/custom_apps',
#            'writable' => true,
#          ),
#        ),
#        'passwordsalt' => 'NvqZk5+08qEUyqoPaviiSJLlkNUfe8',
#        'secret' => 'KLDLyvB1UbXhV4KVD1Rp9tY3hI9IBN3HNG9qc2XWmR6jGWaK',
#        'trusted_domains' =>
#        array (
#          0 => 'xaibox.xai-corp.net',
#        ),
#        'datadirectory' => '/var/www/html/data',
#        'dbtype' => 'mysql',
#        'version' => '25.0.1.1',
#        'overwrite.cli.url' => 'http://localhost',
#        'dbname' => 'nextcloud',
#        'dbhost' => 'mariadb.mariadb:3306',
#        'dbport' => '',
#        'dbtableprefix' => 'oc_',
#        'mysql.utf8mb4' => true,
#        'dbuser' => 'nextcloud',
#        'dbpassword' => 'xh891hx1hc89f239hibndnxc1i',
#        'instanceid' => 'ocs4oenczl28',
#        'config_is_read_only' => false,
#      );
#      <?php
#      $CONFIG = [
#        'installed' => true,
#        'instanceid' => 'ocxziwl6co38',
#        'passwordsalt' => 'FKWh+oXeNAm2EPHg6mz+9xE48gunGb',
#        'secret' => 'yC3EEMk31oZpas8U65awdT5rxR40+8uP5NEkD82S3iLNNWqr',
#        'trusted_domains' => [
#          0 => 'dkhost.xai-corp.net:8083',
#          1 => 'dkhost:8083',
#          2 => 'tasks.xaibox_app:8083',
#          3 => 'xaibox.xai-corp.net',
#          4 => 'localhost',
#        ],
#        'htaccess.RewriteBase' => '/',
#        'memcache.local' => '\\OC\\Memcache\\APCu',
#        'apps_paths' => [
#          0 => [
#            'path' => '/var/www/html/apps',
#            'url' => '/apps',
#            'writable' => false,
#          ],
#          1 => [
#            'path' => '/var/www/html/custom_apps',
#            'url' => '/custom_apps',
#            'writable' => true,
#          ],
#        ],
#        'datadirectory' => '/var/www/html/data',
#        'dbtype' => 'mysql',
#        'dbname' => 'nextcloud',
#        'dbhost' => 'mariadb.mariadb',
#        'dbport' => '3306',
#        'dbtableprefix' => 'oc_',
#        'mysql.utf8mb4' => true,
#        'dbuser' => 'nextcloud',
#        'dbpassword' => 'xh891hx1hc89f239hibndnxc1i',
#
#        'version' => '21.0.9.1',
#        'overwrite.cli.url' => 'http://localhost',
#        'log_type' => 'owncloud',
#        'logfile' => 'nextcloud.log'
#      ];

  extraVars:
    PHP_MEMORY_LIMIT: -1
#    ServerName: xaibox.xai-corp.net
#
#  extraVolumes:
#    - name: extra-data
#      persistentVolumeClaim:
#        claimName: nextcloud-data-0
#    - name: extra-apps
#      persistentVolumeClaim:
#        claimName: nextcloud-apps-0

#  volumeMounts:
#    - name: extra-data
#      mountPath: /opt/nextcloud
#    - name: extra-apps
#      mountPath: /apps

persistence:
  enabled: true
  existingClaim: nextcloud-main-0
#  nextcloudData:
#    enabled: true
#    existingClaim: nextcloud-data-0

readinessProbe:
  initialDelaySeconds: 30

startupProbe:
  enabled: true
  initialDelaySeconds: 90

internalDatabase:
  enabled: false
externalDatabase:
  enabled: true
  type: mysql
  host: "mariadb.mariadb:3306"
  database: nextcloud2022
  user: root
  password: q4890qhhfgq9pfg3q4uyg33

redis:
  enabled: true
  architecture: standalone

cronjob:
  enabled: true

extraSidecarContainers: []
  #  - name: nextcloud-logger
  #    image: busybox
  #    command: [/bin/sh, -c, 'while ! test -f "/run/nextcloud/data/nextcloud.log"; do sleep 1; done; tail -n+1 -f /run/nextcloud/data/nextcloud.log']
  #    volumeMounts:
  #    - name: nextcloud-data
#      mountPath: /run/nextcloud/data
