---
apiVersion: v1
kind: Secret
metadata:
  name: harbor-config
  namespace: dev
stringData:
  #Config documentation: https://goharbor.io/docs/latest/install-config/configure-user-settings-cli/#configure-users-settings-using-an-environment-variable
  CONFIG_OVERWRITE_JSON: |-
    {
      "self_registration": false,
      "auth_mode": "ldap_auth",
      "ldap_url": "ldap://openldap.networking.svc.cluster.local:389",
      "ldap_verify_cert": true,
      "ldap_timeout": 5,
      "ldap_base_dn": "${LDAP_BASE_DN}",
      "ldap_filter": "objectClass=person",
      "ldap_scope": 2,
      "ldap_search_dn": "cn=admin,${LDAP_BASE_DN}",
      "ldap_search_password": "${SECRET_DEFAULT_PASSWORD}",
      "ldap_uid": "uid",
      "ldap_group_admin_dn": "cn=Admins,ou=Groups,${LDAP_BASE_DN}",
      "ldap_group_attribute_name": "cn",
      "ldap_group_base_dn": "ou=Groups,${LDAP_BASE_DN}",
      "ldap_group_search_filter": "objectClass=groupOfUniqueNames",
      "ldap_group_search_scope": 2,
      "ldap_group_membership_attribute": "memberOf",
      "email_host": "${SECRET_SMTP_SERVER}",
      "email_port": ${SECRET_SMTP_PORT},
      "email_username": "${SECRET_SMTP_USERNAME}",
      "email_password": "${SECRET_SMTP_PASSWORD}",
      "email_insecure": false,
      "email_ssl": false,
      "email_from": "Harbor <harbor@${SECRET_DOMAIN}>"
    }
