_configuration.tpl 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. {{- define "roundcube.configuration" -}}
  2. {{- $fullname := (include "ix.v1.common.lib.chart.names.fullname" $) -}}
  3. {{- $dbHost := (printf "%s-postgres" $fullname) -}}
  4. {{- $dbUser := "roundcube" -}}
  5. {{- $dbName := "roundcube" -}}
  6. {{- $dbPass := (randAlphaNum 32) -}}
  7. {{- with (lookup "v1" "Secret" .Release.Namespace (printf "%s-postgres-creds" $fullname)) -}}
  8. {{- $dbPass = ((index .data "POSTGRES_PASSWORD") | b64dec) -}}
  9. {{- end -}}
  10. {{/* Temporary set dynamic db details on values,
  11. so we can print them on the notes */}}
  12. {{- $_ := set .Values "roundcubeDbPass" $dbPass -}}
  13. {{- $_ := set .Values "roundcubeDbHost" $dbHost -}}
  14. {{- $dbURL := (printf "postgres://%s:%s@%s:5432/%s?sslmode=disable" $dbUser $dbPass $dbHost $dbName) }}
  15. secret:
  16. postgres-creds:
  17. enabled: true
  18. data:
  19. POSTGRES_USER: {{ $dbUser }}
  20. POSTGRES_DB: {{ $dbName }}
  21. POSTGRES_PASSWORD: {{ $dbPass }}
  22. POSTGRES_HOST: {{ $dbHost }}
  23. POSTGRES_URL: {{ $dbURL }}
  24. roundcube-creds:
  25. enabled: true
  26. data:
  27. ROUNDCUBEMAIL_DB_TYPE: pgsql
  28. ROUNDCUBEMAIL_DB_HOST: {{ $dbHost }}
  29. ROUNDCUBEMAIL_DB_PORT: "5432"
  30. ROUNDCUBEMAIL_DB_USER: {{ $dbUser }}
  31. ROUNDCUBEMAIL_DB_PASSWORD: {{ $dbPass }}
  32. ROUNDCUBEMAIL_DB_NAME: {{ $dbName }}
  33. configmap:
  34. roundcube-config:
  35. enabled: true
  36. data:
  37. ROUNDCUBEMAIL_SKIN: {{ .Values.roundcubeConfig.skin }}
  38. {{/* IMAP */}}
  39. ROUNDCUBEMAIL_DEFAULT_HOST: {{ .Values.roundcubeConfig.defaultHost | quote }}
  40. ROUNDCUBEMAIL_DEFAULT_PORT: {{ .Values.roundcubeConfig.defaultPort | quote }}
  41. {{/* SMTP */}}
  42. ROUNDCUBEMAIL_SMTP_SERVER: {{ .Values.roundcubeConfig.smtpServer | quote }}
  43. ROUNDCUBEMAIL_SMTP_PORT: {{ .Values.roundcubeConfig.smtpPort | quote }}
  44. ROUNDCUBEMAIL_PLUGINS: {{ join "," .Values.roundcubeConfig.plugins | quote }}
  45. ROUNDCUBEMAIL_ASPELL_PACKAGES: {{ join "," .Values.roundcubeConfig.aspellDicts | quote }}
  46. ROUNDCUBEMAIL_UPLOAD_MAX_FILESIZE: {{ printf "%vM" .Values.roundcubeConfig.uploadMaxSize | quote }}
  47. {{- end -}}