apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ template "harbor.core" . }}
  labels:
{{ include "harbor.labels" . | indent 4 }}
data:
  app.conf: |+
    appname = Harbor
    runmode = dev
    enablegzip = true

    [dev]
    httpport = 8080
  DATABASE_TYPE: "postgresql"
  POSTGRESQL_HOST: "{{ template "harbor.database.host" . }}"
  POSTGRESQL_PORT: "{{ template "harbor.database.port" . }}"
  POSTGRESQL_USERNAME: "{{ template "harbor.database.username" . }}"
  POSTGRESQL_DATABASE: "{{ template "harbor.database.coreDatabase" . }}"
  POSTGRESQL_SSLMODE: "{{ template "harbor.database.sslmode" . }}"
  POSTGRESQL_MAX_IDLE_CONNS: "{{ .Values.database.maxIdleConns }}"
  POSTGRESQL_MAX_OPEN_CONNS: "{{ .Values.database.maxOpenConns }}"
  EXT_ENDPOINT: "{{ template "harbor.externalURL" . }}"
  CORE_URL: "http://{{ template "harbor.core" . }}"
  JOBSERVICE_URL: "http://{{ template "harbor.fullname" . }}-jobservice"
  REGISTRY_URL: "http://{{ template "harbor.registry" . }}:5000"
  TOKEN_SERVICE_URL: "http://{{ template "harbor.core" . }}/service/token"
  WITH_NOTARY: "{{ .Values.notary.enabled }}"
  NOTARY_URL: "http://{{ template "harbor.notary-server" . }}:4443"
  CFG_EXPIRATION: "5"
  ADMIRAL_URL: "NA"
  WITH_CLAIR: "{{ .Values.clair.enabled }}"
  CLAIR_DB_HOST: "{{ template "harbor.database.host" . }}"
  CLAIR_DB_PORT: "{{ template "harbor.database.port" . }}"
  CLAIR_DB_USERNAME: "{{ template "harbor.database.username" . }}"
  CLAIR_DB: "{{ template "harbor.database.clairDatabase" . }}"
  CLAIR_DB_SSLMODE: "{{ template "harbor.database.sslmode" . }}"
  CLAIR_URL: "http://{{ template "harbor.fullname" . }}-clair:6060"
  REGISTRY_STORAGE_PROVIDER_NAME: "{{ .Values.persistence.imageChartStorage.type }}"
  WITH_CHARTMUSEUM: "{{ .Values.chartmuseum.enabled }}"
  CHART_REPOSITORY_URL: "http://{{ template "harbor.chartmuseum" . }}"
  LOG_LEVEL: "{{ .Values.logLevel }}"
  CONFIG_PATH: "/etc/core/app.conf"
  SYNC_REGISTRY: "false"
  CHART_CACHE_DRIVER: "redis"
  _REDIS_URL: "{{ template "harbor.redisForCore" . }}"
  _REDIS_URL_REG: "{{ template "harbor.redisForGC" . }}"
  PORTAL_URL: "http://{{ template "harbor.portal" . }}"
  REGISTRYCTL_URL: "http://{{ template "harbor.registry" . }}:8080"
  CLAIR_HEALTH_CHECK_SERVER_URL: "http://{{ template "harbor.clair" . }}:6061"
  {{- if .Values.uaaSecretName }}
  UAA_CA_ROOT: "/etc/core/ca/auth-ca.crt"
  {{- end }}
  {{- if has "core" .Values.proxy.components }}
  HTTP_PROXY: "{{ .Values.proxy.httpProxy }}"
  HTTPS_PROXY: "{{ .Values.proxy.httpsProxy }}"
  NO_PROXY: "{{ template "harbor.noProxy" . }}"
  {{- end }}