apiVersion: external-secrets.io/v1beta1
kind: SecretStore
metadata:
  name: dmz-infisical
  namespace: hf-mautic
  annotations:
    argocd.argoproj.io/sync-wave: "1"
spec:
  provider:
    infisical:
      hostAPI: http://infisical-infisical-standalone-infisical.platform-infisical.svc.cluster.local:8080
      auth:
        universalAuthCredentials:
          clientId:
            name: infisical-universal-auth
            key: clientId
          clientSecret:
            name: infisical-universal-auth
            key: clientSecret
      secretsScope:
        projectSlug: platform-kubernetes-pqmd
        environmentSlug: prod
        secretsPath: /tenants/pidoka/mautic
---
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
  name: mautic-secret
  namespace: hf-mautic
  annotations:
    argocd.argoproj.io/sync-wave: "2"
spec:
  refreshInterval: 1h
  secretStoreRef:
    name: dmz-infisical
    kind: SecretStore
  target:
    name: mautic-secret
    creationPolicy: Owner
    deletionPolicy: Retain
  data:
    - secretKey: MAUTIC_DB_HOST
      remoteRef:
        key: MAUTIC_DB_HOST
        conversionStrategy: Default
        decodingStrategy: None
        metadataPolicy: None
    - secretKey: MAUTIC_DB_PORT
      remoteRef:
        key: MAUTIC_DB_PORT
        conversionStrategy: Default
        decodingStrategy: None
        metadataPolicy: None
    - secretKey: MAUTIC_DB_DATABASE
      remoteRef:
        key: MAUTIC_DB_DATABASE
        conversionStrategy: Default
        decodingStrategy: None
        metadataPolicy: None
    - secretKey: MAUTIC_DB_USER
      remoteRef:
        key: MAUTIC_DB_USER
        conversionStrategy: Default
        decodingStrategy: None
        metadataPolicy: None
    - secretKey: MAUTIC_DB_PASSWORD
      remoteRef:
        key: MAUTIC_DB_PASSWORD
        conversionStrategy: Default
        decodingStrategy: None
        metadataPolicy: None
    - secretKey: MARIADB_DATABASE
      remoteRef:
        key: MARIADB_DATABASE
        conversionStrategy: Default
        decodingStrategy: None
        metadataPolicy: None
    - secretKey: MARIADB_USER
      remoteRef:
        key: MARIADB_USER
        conversionStrategy: Default
        decodingStrategy: None
        metadataPolicy: None
    - secretKey: MARIADB_PASSWORD
      remoteRef:
        key: MARIADB_PASSWORD
        conversionStrategy: Default
        decodingStrategy: None
        metadataPolicy: None
    - secretKey: MARIADB_ROOT_PASSWORD
      remoteRef:
        key: MARIADB_ROOT_PASSWORD
        conversionStrategy: Default
        decodingStrategy: None
        metadataPolicy: None
    - secretKey: MAUTIC_SITE_URL
      remoteRef:
        key: MAUTIC_SITE_URL
        conversionStrategy: Default
        decodingStrategy: None
        metadataPolicy: None
    - secretKey: MAUTIC_TRUSTED_PROXIES
      remoteRef:
        key: MAUTIC_TRUSTED_PROXIES
        conversionStrategy: Default
        decodingStrategy: None
        metadataPolicy: None
    - secretKey: MAUTIC_SECRET_KEY
      remoteRef:
        key: MAUTIC_SECRET_KEY
        conversionStrategy: Default
        decodingStrategy: None
        metadataPolicy: None
