_configuration.tpl 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. {{- define "twofauth.configuration" -}}
  2. {{- $fullname := (include "ix.v1.common.lib.chart.names.fullname" $) -}}
  3. {{- $appKey := (randAlphaNum 32) -}}
  4. {{- with (lookup "v1" "Secret" .Release.Namespace (printf "%s-twofauth-creds" $fullname)) -}}
  5. {{- $appKey = ((index .data "APP_KEY") | b64dec) -}}
  6. {{- end }}
  7. secret:
  8. twofauth-creds:
  9. enabled: true
  10. data:
  11. APP_KEY: {{ $appKey }}
  12. configmap:
  13. twofauth-config:
  14. enabled: true
  15. data:
  16. # When this is set to production, it initialize automatically
  17. # Because it waits for user input in the console.
  18. APP_ENV: local
  19. # It is symlinked to /2fauth/database.sqlite
  20. DB_DATABASE: /srv/database/database.sqlite
  21. APP_NAME: {{ .Values.twofauthConfig.appName }}
  22. APP_URL: {{ .Values.twofauthConfig.appUrl }}
  23. SITE_OWNER: {{ .Values.twofauthConfig.siteOwnerEmail }}
  24. AUTHENTICATION_GUARD: {{ .Values.twofauthConfig.authenticationGuard }}
  25. {{- if eq .Values.twofauthConfig.authenticationGuard "reverse-proxy-guard" }}
  26. AUTH_PROXY_HEADER_FOR_USER: {{ .Values.twofauthConfig.authProxyHeaderUser }}
  27. AUTH_PROXY_HEADER_FOR_EMAIL: {{ .Values.twofauthConfig.authProxyHeaderEmail }}
  28. {{- end }}
  29. WEBAUTHN_USER_VERIFICATION: {{ .Values.twofauthConfig.webauthnUserVerification }}
  30. {{- with .Values.twofauthConfig.trustedProxies }}
  31. TRUSTED_PROXIES: {{ join "," . | quote }}
  32. {{- end -}}
  33. {{- end -}}