Skip to content

Commit

Permalink
Merge pull request cosmo-workspace#779 from jlandowner/refactor/logging
Browse files Browse the repository at this point in the history
Add fixed secretKeys on chart values
  • Loading branch information
oruharo authored Jul 21, 2023
2 parents f3ab0ac + 417adb1 commit 171f75e
Show file tree
Hide file tree
Showing 18 changed files with 1,272 additions and 41 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ clear-snapshots: ## Clear snapshots
ingressroute.yaml: helm config/crd/traefik/traefik.io_ingressroutes.yaml
config/crd/traefik/traefik.io_ingressroutes.yaml:
mkdir -p config/crd/traefik
$(HELM) dependency update ./charts/cosmo-traefik
tar -xvf ./charts/cosmo-traefik/charts/traefik-*.tgz -O traefik/crds/traefik.io_ingressroutes.yaml > config/crd/traefik/traefik.io_ingressroutes.yaml
$(HELM) dependency update ./charts/cosmo
tar -xvf ./charts/cosmo/charts/traefik-*.tgz -O traefik/crds/traefik.io_ingressroutes.yaml > config/crd/traefik/traefik.io_ingressroutes.yaml

.PHONY: go-test.env
go-test.env:
Expand Down
14 changes: 13 additions & 1 deletion charts/cosmo/templates/auth-env-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,22 @@ metadata:
namespace: "{{ .Release.Namespace }}"
data:
COOKIE_DOMAIN: "{{ include "cosmo.domain" . | b64enc }}"
SIGNIN_URL: {{ include "cosmo.dashboard.signinUrl" . | b64enc | quote }}
# fetch current secret and get values
{{- $currentData := (lookup "v1" "Secret" .Release.Namespace "cosmo-auth-env").data | default dict }}
# currentData={{ $currentData }}
{{- if .Values.dashboard.session.secretKeys.COOKIE_HASHKEY }}
COOKIE_HASHKEY: {{ .Values.dashboard.session.secretKeys.COOKIE_HASHKEY }}
{{- else }}
COOKIE_HASHKEY: {{ (get $currentData "COOKIE_HASHKEY") | default (randAlphaNum 64 | b64enc) | quote }}
{{- end }}
{{- if .Values.dashboard.session.secretKeys.COOKIE_BLOCKKEY }}
COOKIE_BLOCKKEY: {{ .Values.dashboard.session.secretKeys.COOKIE_BLOCKKEY }}
{{- else }}
COOKIE_BLOCKKEY: {{ (get $currentData "COOKIE_BLOCKKEY") | default (randAlphaNum 32 | b64enc) | quote }}
{{- end }}
{{- if .Values.dashboard.session.secretKeys.COOKIE_SESSION_NAME }}
COOKIE_SESSION_NAME: {{ .Values.dashboard.session.secretKeys.COOKIE_SESSION_NAME }}
{{- else }}
COOKIE_SESSION_NAME: {{ (get $currentData "COOKIE_SESSION_NAME") | default (randAlphaNum 10 | b64enc) | quote }}
SIGNIN_URL: {{ include "cosmo.dashboard.signinUrl" . | b64enc | quote }}
{{- end }}
Loading

0 comments on commit 171f75e

Please sign in to comment.