apiVersion: v1
kind: Secret
metadata:
  name: {{ include "mikrotik-portal.fullname" . }}-secrets
  labels:
    {{- include "mikrotik-portal.labels" . | nindent 4 }}
type: Opaque
stringData:
  JWT_SECRET_KEY: {{ .Values.secrets.jwtSecretKey | quote }}
  CREDENTIAL_ENCRYPTION_KEY: {{ .Values.secrets.credentialEncryptionKey | quote }}
  FIRST_ADMIN_EMAIL: {{ .Values.secrets.firstAdminEmail | quote }}
  FIRST_ADMIN_PASSWORD: {{ .Values.secrets.firstAdminPassword | quote }}
  DB_PASSWORD: {{ .Values.secrets.dbPassword | quote }}
  DB_APP_PASSWORD: {{ .Values.secrets.dbAppPassword | quote }}
  POLLER_DATABASE_URL: {{ printf "postgres://poller_user:%s@%s-postgres:%d/%s" .Values.secrets.dbPollerPassword (include "mikrotik-portal.fullname" .) (int .Values.postgres.service.port) .Values.postgres.auth.database | quote }}
