mirror of
https://ghproxy.com/https://github.com/truecharts/charts.git
synced 2026-07-17 12:50:22 +08:00
fix(monica): only b64enc the key once (#1930)
* fix(monica): only b64enc the key once * Restore description * Update _appkey.tpl Co-authored-by: Kjeld Schouten-Lebbing <kjeld@schouten-lebbing.nl>
This commit is contained in:
@@ -22,7 +22,7 @@ name: monica
|
||||
sources:
|
||||
- https://github.com/monicahq/monica
|
||||
- https://hub.docker.com/_/monica
|
||||
version: 0.0.43
|
||||
version: 0.0.44
|
||||
annotations:
|
||||
truecharts.org/catagories: |
|
||||
- crm
|
||||
|
||||
@@ -1,23 +1,22 @@
|
||||
{{/*
|
||||
This template generates a random password and ensures it persists across updates/edits to the chart
|
||||
This template generates a random appkey and ensures it persists across updates/edits to the chart
|
||||
*/}}
|
||||
{{- define "monica.appkey" -}}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
type: Opaque
|
||||
metadata:
|
||||
name: appkey
|
||||
labels:
|
||||
{{- include "common.labels" . | nindent 4 }}
|
||||
name: appkey
|
||||
{{- $keyprevious := lookup "v1" "Secret" .Release.Namespace "appkey" }}
|
||||
{{- $appkey := "" }}
|
||||
data:
|
||||
{{- if $keyprevious }}
|
||||
{{- $appkey = ( index $keyprevious.data "appkey" ) | b64dec }}
|
||||
{{- if $keyprevious }}
|
||||
appkey: {{ ( index $keyprevious.data "appkey" ) }}
|
||||
{{- else }}
|
||||
{{- $appkey = randAlphaNum 32 | b64enc }}
|
||||
appkey: {{ $appkey | b64enc | quote }}
|
||||
{{- end }}
|
||||
type: Opaque
|
||||
{{- else }}
|
||||
{{- $appkey = randAlphaNum 32 }}
|
||||
appkey: {{ $appkey | b64enc }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
@@ -4,6 +4,5 @@
|
||||
{{/* Render appkey for monica */}}
|
||||
{{- include "monica.appkey" . }}
|
||||
|
||||
|
||||
{{/* Render the templates */}}
|
||||
{{ include "common.postSetup" . }}
|
||||
|
||||
Reference in New Issue
Block a user