Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sql addition #393

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions mailu/templates/_database.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,17 @@
{{- end -}}
{{- end -}}

{{/* Return the database URI appendix for Mailu */}}
{{- define "mailu.database.appendix" -}}
{{- if .Values.mariadb.enabled -}}
{{- "" | quote }}
{{- else if .Values.postgresql.enabled -}}
{{- "" | quote }}
{{- else }}
{{- .Values.externalDatabase.appendix | quote }}
{{- end -}}
{{- end -}}

{{/* Return the name of the secret for the external database */}}
{{- define "mailu.database.external.secretName" -}}
{{ include "common.secrets.name" (dict "existingSecret" .Values.externalDatabase.existingSecret "defaultNameSuffix" "externaldb" "context" .) }}
Expand Down
1 change: 1 addition & 0 deletions mailu/templates/envvars-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ data:
DB_NAME: {{ include "mailu.database.name" . }}
# DB_PW => via secret
DB_USER: {{ include "mailu.database.username" . }}
DB_APPENDIX: {{ include "mailu.database.appendix" . }}
DEBUG_ASSETS: ""
DEBUG: "false"
DEBUG_PROFILER: "false"
Expand Down
3 changes: 3 additions & 0 deletions mailu/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,9 @@ externalDatabase:
## @param externalDatabase.existingSecretPasswordKey Key in the secret containing the database password
existingSecretPasswordKey: "password"

## @param externalDatabase.appendix String appended to the SQLAlchemy URI
appendix: ""

externalRedis:
## @param externalRedis.enabled Set to true to use an external Redis instance (ignored if `redis.enabled` is true)
enabled: false
Expand Down
1 change: 1 addition & 0 deletions utils/check_env_vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"DB_PW": (False, "Managed by Helm chart"),
"DB_HOST": (False, "Managed by Helm chart"),
"DB_NAME": (False, "Managed by Helm chart"),
"DB_APPENDIX": (False, "Managed by Helm chart"),
"SQLITE_DATABASE_FILE": ("", ""),
"SQLALCHEMY_DATABASE_URI": ("", ""),
"SQLALCHEMY_TRACK_MODIFICATIONS": ("", ""),
Expand Down
Loading