Skip to content
Merged
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
12 changes: 10 additions & 2 deletions charts/countly/templates/external-secret-common.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- if eq (.Values.secrets.mode | default "values") "externalSecret" }}
{{- if not .Values.secrets.common.existingSecret }}
{{- $commonRemote := .Values.secrets.externalSecret.remoteRefs.common | default dict -}}
{{- $commonUsesExternal := or $commonRemote.encryptionReportsKey $commonRemote.webSessionSecret $commonRemote.passwordSecret $commonRemote.mailConfigAuthUser $commonRemote.mailConfigAuthPass -}}
{{- $commonUsesExternal := or $commonRemote.encryptionReportsKey $commonRemote.webSessionSecret $commonRemote.passwordSecret $commonRemote.jwtSecret $commonRemote.mailConfigAuthUser $commonRemote.mailConfigAuthPass -}}
{{- if $commonUsesExternal }}
apiVersion: external-secrets.io/v1
kind: ExternalSecret
Expand All @@ -21,7 +21,7 @@ spec:
target:
name: {{ include "countly.fullname" . }}-common
creationPolicy: Owner
{{- $hasCommonTemplateData := or (not $commonRemote.encryptionReportsKey) (not $commonRemote.webSessionSecret) (not $commonRemote.passwordSecret) (and .Values.secrets.common.mailConfigAuthUser (not $commonRemote.mailConfigAuthUser)) (and .Values.secrets.common.mailConfigAuthPass (not $commonRemote.mailConfigAuthPass)) }}
{{- $hasCommonTemplateData := or (not $commonRemote.encryptionReportsKey) (not $commonRemote.webSessionSecret) (not $commonRemote.passwordSecret) (and .Values.secrets.common.jwtSecret (not $commonRemote.jwtSecret)) (and .Values.secrets.common.mailConfigAuthUser (not $commonRemote.mailConfigAuthUser)) (and .Values.secrets.common.mailConfigAuthPass (not $commonRemote.mailConfigAuthPass)) }}
{{- if $hasCommonTemplateData }}
template:
engineVersion: v2
Expand All @@ -36,6 +36,9 @@ spec:
{{- if not .Values.secrets.externalSecret.remoteRefs.common.passwordSecret }}
COUNTLY_CONFIG__PASSWORDSECRET: {{ .Values.secrets.common.passwordSecret | quote }}
{{- end }}
{{- if and .Values.secrets.common.jwtSecret (not .Values.secrets.externalSecret.remoteRefs.common.jwtSecret) }}
COUNTLY_CONFIG__API_JWT_SECRET: {{ .Values.secrets.common.jwtSecret | quote }}
{{- end }}
{{- if and .Values.secrets.common.mailConfigAuthUser (not .Values.secrets.externalSecret.remoteRefs.common.mailConfigAuthUser) }}
COUNTLY_CONFIG__MAIL_CONFIG_AUTH_USER: {{ .Values.secrets.common.mailConfigAuthUser | quote }}
{{- end }}
Expand All @@ -59,6 +62,11 @@ spec:
remoteRef:
key: {{ required "secrets.externalSecret.remoteRefs.common.passwordSecret is required" .Values.secrets.externalSecret.remoteRefs.common.passwordSecret }}
{{- end }}
{{- if .Values.secrets.externalSecret.remoteRefs.common.jwtSecret }}
- secretKey: COUNTLY_CONFIG__API_JWT_SECRET
remoteRef:
key: {{ required "secrets.externalSecret.remoteRefs.common.jwtSecret is required" .Values.secrets.externalSecret.remoteRefs.common.jwtSecret }}
{{- end }}
{{- if .Values.secrets.externalSecret.remoteRefs.common.mailConfigAuthUser }}
- secretKey: COUNTLY_CONFIG__MAIL_CONFIG_AUTH_USER
remoteRef:
Expand Down
3 changes: 3 additions & 0 deletions charts/countly/templates/secret-common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ data:
COUNTLY_CONFIG__ENCRYPTION_REPORTS_KEY: {{ include "countly.secret.value" (dict "secretName" $secretName "key" "COUNTLY_CONFIG__ENCRYPTION_REPORTS_KEY" "value" .Values.secrets.common.encryptionReportsKey "namespace" .Release.Namespace) }}
COUNTLY_CONFIG__WEB_SESSION_SECRET: {{ include "countly.secret.value" (dict "secretName" $secretName "key" "COUNTLY_CONFIG__WEB_SESSION_SECRET" "value" .Values.secrets.common.webSessionSecret "namespace" .Release.Namespace) }}
COUNTLY_CONFIG__PASSWORDSECRET: {{ include "countly.secret.value" (dict "secretName" $secretName "key" "COUNTLY_CONFIG__PASSWORDSECRET" "value" .Values.secrets.common.passwordSecret "namespace" .Release.Namespace) }}
{{- if or .Values.secrets.common.jwtSecret (and $existing (hasKey $existing.data "COUNTLY_CONFIG__API_JWT_SECRET")) }}
COUNTLY_CONFIG__API_JWT_SECRET: {{ include "countly.secret.value" (dict "secretName" $secretName "key" "COUNTLY_CONFIG__API_JWT_SECRET" "value" .Values.secrets.common.jwtSecret "namespace" .Release.Namespace) }}
{{- end }}
Comment thread
kanwarujjaval marked this conversation as resolved.
{{- if or .Values.secrets.common.mailConfigAuthUser (and $existing (hasKey $existing.data "COUNTLY_CONFIG__MAIL_CONFIG_AUTH_USER")) }}
COUNTLY_CONFIG__MAIL_CONFIG_AUTH_USER: {{ include "countly.secret.value" (dict "secretName" $secretName "key" "COUNTLY_CONFIG__MAIL_CONFIG_AUTH_USER" "value" .Values.secrets.common.mailConfigAuthUser "namespace" .Release.Namespace) }}
{{- end }}
Expand Down
3 changes: 3 additions & 0 deletions charts/countly/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@
"passwordSecret": {
"type": "string"
},
"jwtSecret": {
"type": "string"
},
"mailConfigAuthUser": {
"type": "string"
},
Expand Down
3 changes: 3 additions & 0 deletions charts/countly/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,8 @@ secrets:
webSessionSecret: ""
# -- Internal password hashing secret
passwordSecret: ""
# -- JWT signing secret for /v2 auth (min 32 chars recommended)
jwtSecret: ""
# -- Optional SMTP auth username
mailConfigAuthUser: ""
# -- Optional SMTP auth password
Expand Down Expand Up @@ -528,6 +530,7 @@ secrets:
encryptionReportsKey: ""
webSessionSecret: ""
passwordSecret: ""
jwtSecret: ""
# Optional SMTP auth refs when using External Secrets.
# Example:
# mailConfigAuthUser: "my-smtp-auth-user-secret"
Expand Down
2 changes: 2 additions & 0 deletions environments/reference/countly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,7 @@ secrets:
encryptionReportsKey: "" # REQUIRED: min 8 chars
webSessionSecret: "" # REQUIRED: min 8 chars
passwordSecret: "" # REQUIRED: min 8 chars
jwtSecret: "" # Optional: required only for /v2 auth (min 32 chars recommended)

clickhouse:
existingSecret: ""
Expand Down Expand Up @@ -498,6 +499,7 @@ secrets:
encryptionReportsKey: ""
webSessionSecret: ""
passwordSecret: ""
jwtSecret: ""
clickhouse:
url: ""
username: ""
Expand Down
2 changes: 2 additions & 0 deletions environments/reference/credentials-countly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ secrets:
encryptionReportsKey: "" # REQUIRED: min 8 chars
webSessionSecret: "" # REQUIRED: min 8 chars
passwordSecret: "" # REQUIRED: min 8 chars
jwtSecret: "" # Optional: required only for /v2 auth (min 32 chars recommended)
mailConfigAuthUser: "" # Optional: SMTP auth user
mailConfigAuthPass: "" # Optional: SMTP auth password
clickhouse:
Expand All @@ -30,6 +31,7 @@ secrets:
# encryptionReportsKey: "acme-countly-encryption-reports-key"
# webSessionSecret: "acme-countly-web-session-secret"
# passwordSecret: "acme-countly-password-secret"
# jwtSecret: "acme-countly-jwt-secret"
# # Example SMTP auth refs:
# mailConfigAuthUser: "my-smtp-auth-user-secret"
# mailConfigAuthPass: "my-smtp-auth-pass-secret"
Expand Down
1 change: 1 addition & 0 deletions environments/reference/external-secrets.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# encryptionReportsKey: "acme-countly-encryption-reports-key"
# webSessionSecret: "acme-countly-web-session-secret"
# passwordSecret: "acme-countly-password-secret"
# jwtSecret: "acme-countly-jwt-secret"
# # Example SMTP auth refs:
# mailConfigAuthUser: "my-smtp-auth-user-secret"
# mailConfigAuthPass: "my-smtp-auth-pass-secret"
Expand Down
1 change: 1 addition & 0 deletions environments/reference/secrets.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ secrets:
encryptionReportsKey: "CHANGEME-min-8-chars"
webSessionSecret: "CHANGEME-min-8-chars"
passwordSecret: "CHANGEME-min-8-chars"
jwtSecret: "CHANGEME-min-32-chars-for-v2-auth"
clickhouse:
password: "CHANGEME-match-clickhouse-chart"
mongodb:
Expand Down
Loading