#@ load("@ytt:data", "data")
#@ host = data.values.application.subdomain + "." + data.values.cluster.domain
---
strategy:
  type: Recreate

redis-cluster:
  enabled: false

postgresql-ha:
  enabled: false

persistence:
  enabled: true
  create: false
  mount: true
  claimName: forgejo-git-storage

ingress:
  enabled: true
  hosts:
    - host: #@ host
      paths:
        - path: /
          pathType: Prefix
  tls:
    - secretName: forgejo-tls
      hosts:
        - #@ host
  annotations:
    cert-manager.io/cluster-issuer: #@ data.values.cluster.tls.issuer

service:
  ssh:
    type: ClusterIP

gitea:
  admin:
    existingSecret: forgejo-admin-secret

  additionalConfigFromEnvs:
    - name: FORGEJO__DATABASE__PASSWD
      valueFrom:
        secretKeyRef:
          name: forgejo-cnpg-app
          key: password

  config:
    database:
      DB_TYPE: postgres
      HOST: forgejo-cnpg-rw.forgejo.svc:5432
      NAME: forgejo
      USER: forgejo
      SCHEMA: public
      SSL_MODE: disable
    session:
      PROVIDER: memory
    cache:
      ADAPTER: memory
    queue:
      TYPE: level
    server:
      DOMAIN: #@ host
      ROOT_URL: #@ "https://{}/".format(host)
      SSH_PORT: #@ data.values.forgejo.sshPort
    service:
      DISABLE_REGISTRATION: true
    actions:
      ENABLED: true
