apiVersion: v1
kind: ConfigMap
metadata:
  name: stackspin-n8n-values
  namespace: stackspout
data:
  values.yaml: |
    # https://github.com/8gears/n8n-helm-chart/blob/master/values.yaml
    n8n:
      encryption_key: "${encryption_key}"

    commonLabels:
      stackspin.net/backupSet: "n8n"
    podLabels:
      stackspin.net/backupSet: "n8n"
    podAnnotations:
      backup.velero.io/backup-volumes: "data"

    persistence:
      enabled: true
      type: existing
      existingClaim: "n8n-data"

    ingress:
      enabled: true
      annotations:
        kubernetes.io/tls-acme: "true"
      hosts:
        - host: "${n8n_domain}"
          paths: [ "/" ]
      tls:
        - secretName: n8n-tls
          hosts:
            - "${n8n_domain}"

    config:
      database:
        type: sqlite
      host: "${n8n_domain}"
      port: 443
      protocol: https
      generic:
        timezone: "Europe/Berlin"

    # TODO Adjust n8n Mailing config
    #    mailer:
    #      enabled: "${outgoing_mail_enabled}"
    #      host: "${outgoing_mail_smtp_host}"
    #      port: "${outgoing_mail_smtp_port}"
    #      username: "${outgoing_mail_smtp_user}"
    #      password: "${outgoing_mail_smtp_password}"
    #      fromemail: "${outgoing_mail_from_address}"
    # TODO Adjust n8n OpenID Connect Single Sign-On Configuration
    #    - name: Stackspin
    #      key: "${client_id}"
    #      secret: "${client_secret}"
    #      autoDiscoverUrl: 'https://${hydra_domain}/.well-known/openid-configuration'