apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ .Chart.Name }}
data:
  application.yml: |-
    server.max-http-header-size: 32KB
    ceph.http-endpoint: {{ .Values.ceph.host }}
    s3: {{ .Values.s3 | toYaml | nindent 6 }}
    form-submission-validation.url: http://form-submission-validation:8080
    bpms.url: http://bpms:8080
    {{- if eq .Values.global.deploymentMode "development" }}
    management.endpoints.web.exposure.include: '*'
    {{- else }}
    management.endpoints.web.exposure.include: 'health, prometheus'
    {{- end }}
    platform.security.csrf.enabled: {{ .Values.platform.security.csrf.enabled }}

    digital-documents:
      max-file-size: {{ .Values.digitalDocuments.maxFileSize }}
      max-total-file-size: {{ .Values.digitalDocuments.maxTotalFileSize }}

    data-platform:
      kafka:
        enabled: true
        bootstrap: {{ .Values.kafka.service }}
        topic-properties:
          num-partitions: {{ .Values.kafka.numPartitions }}
          replication-factor: {{ .Values.global.kafkaOperator.replicationFactor }}
        ssl:
          enabled: {{ .Values.kafka.sslEnabled }}
          keystore-certificate: {{ .Values.kafka.sslUserCertificate }}
          keystore-key: {{ .Values.kafka.sslUserKey }}
          truststore-certificate: {{ .Values.kafka.sslClusterCertificate }}
          keystore-type: {{ .Values.kafka.sslCertType }}
          truststore-type: {{ .Values.kafka.sslCertType }}
        error-handler:
          initial-interval: {{ .Values.kafka.errorHandlerInitialInterval }}
          max-elapsed-time: {{ .Values.kafka.errorHandlerMaxElapsedTime }}
          multiplier: {{ .Values.kafka.errorHandlerMultiplier }}
