Skip to content

Commit 1f9a03f

Browse files
SiMaHeroliverguenther
authored andcommitted
Add option to provide admin user password as an external secret (#176)
1 parent 6695a1e commit 1f9a03f

3 files changed

Lines changed: 13 additions & 1 deletion

File tree

.changeset/dry-ducks-pull.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@openproject/helm-charts": minor
3+
---
4+
5+
Allow passing existing secret for admin user

charts/openproject/templates/secret_core.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ stringData:
7373
{{- if .Values.postgresql.options.sslMinProtocolVersion }}
7474
OPENPROJECT_DB_SSL_MIN_PROTOCOL_VERSION: {{ .Values.postgresql.options.sslMinProtocolVersion | toString }}
7575
{{- end }}
76-
OPENPROJECT_SEED_ADMIN_USER_PASSWORD: {{ .Values.openproject.admin_user.password | quote }}
76+
{{ $secret := (lookup "v1" "Secret" .Release.Namespace (default "_" .Values.openproject.admin_user.secret)) | default (dict "data" dict) -}}
77+
OPENPROJECT_SEED_ADMIN_USER_PASSWORD: {{ default .Values.openproject.admin_user.password (get $secret.data .Values.openproject.admin_user.secretKeys.password | b64dec) | quote }}
7778
OPENPROJECT_SEED_ADMIN_USER_PASSWORD_RESET: {{ .Values.openproject.admin_user.password_reset | quote }}
7879
OPENPROJECT_SEED_ADMIN_USER_NAME: {{ .Values.openproject.admin_user.name | quote }}
7980
OPENPROJECT_SEED_ADMIN_USER_MAIL: {{ .Values.openproject.admin_user.mail | quote }}

charts/openproject/values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,12 @@ openproject:
345345
password_reset: "true"
346346
name: "OpenProject Admin"
347347
mail: "admin@example.net"
348+
349+
secret: ""
350+
351+
## In case your secret does not use the default key in the secret, you can adjust it here
352+
secretKeys:
353+
password: ""
348354
# Uncomment if you want to lock the user after creation
349355
# Relevant for automated deployments that seed LDAP or SSO
350356
# locked: true

0 commit comments

Comments
 (0)