mirror of
https://github.com/truecharts/charts.git
synced 2026-07-16 17:11:21 -03:00
feat(recipes): move SECRET_KEY to autogenerated remembered secret (#1559)
* feat(recipes): move `SECRET_KEY` to autogenerated remembered secret * bump major
This commit is contained in:
@@ -2,7 +2,7 @@ apiVersion: v2
|
||||
appVersion: "1.0.2"
|
||||
description: Recipes is a Django application to manage, tag and search recipes using either built in models or external storage providers hosting PDF's, Images or other files.
|
||||
name: recipes
|
||||
version: 4.0.18
|
||||
version: 5.0.0
|
||||
kubeVersion: ">=1.16.0-0"
|
||||
keywords:
|
||||
- recipes
|
||||
|
||||
@@ -73,18 +73,6 @@ questions:
|
||||
- value: "OnDelete"
|
||||
description: "(Legacy) OnDelete: ignore .spec.template changes"
|
||||
# Include{controllerExpert}
|
||||
- variable: secret
|
||||
group: "Container Configuration"
|
||||
label: "Image Secrets"
|
||||
schema:
|
||||
type: dict
|
||||
attrs:
|
||||
- variable: SECRET_KEY
|
||||
label: "SECRET_KEY"
|
||||
description: "Sets the SECRET_KEY env var"
|
||||
schema:
|
||||
type: string
|
||||
default: "changeme"
|
||||
- variable: env
|
||||
group: "Container Configuration"
|
||||
label: "Image Environment"
|
||||
|
||||
20
charts/stable/recipes/templates/_sercrets.tpl
Normal file
20
charts/stable/recipes/templates/_sercrets.tpl
Normal file
@@ -0,0 +1,20 @@
|
||||
{{/* Define the secrets */}}
|
||||
{{- define "recipes.secrets" -}}
|
||||
---
|
||||
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
type: Opaque
|
||||
metadata:
|
||||
name: recipes-secrets
|
||||
{{- $recipesprevious := lookup "v1" "Secret" .Release.Namespace "recipes-secrets" }}
|
||||
{{- $secret_key := "" }}
|
||||
data:
|
||||
{{- if $recipesprevious}}
|
||||
SECRET_KEY: {{ index $recipesprevious.data "SECRET_KEY" }}
|
||||
{{- else }}
|
||||
{{- $secret_key := randAlphaNum 50 }}
|
||||
SECRET_KEY: {{ $secret_key | b64enc | quote }}
|
||||
{{- end }}
|
||||
|
||||
{{- end -}}
|
||||
@@ -14,5 +14,8 @@ persistence:
|
||||
{{- end -}}
|
||||
{{- $_ := mergeOverwrite .Values (include "recipes.harcodedValues" . | fromYaml) -}}
|
||||
|
||||
{{/* Render secrets for recipes */}}
|
||||
{{- include "recipes.secrets" . }}
|
||||
|
||||
{{/* Render the templates */}}
|
||||
{{ include "common.postSetup" . }}
|
||||
|
||||
@@ -23,16 +23,15 @@ podSecurityContext:
|
||||
# -- environment variables. See [project docs](https://raw.githubusercontent.com/vabene1111/recipes/master/.env.template) for more details.
|
||||
# @default -- See below
|
||||
env:
|
||||
TIMEZONE: UTC
|
||||
DEBUG: 0
|
||||
ALLOWED_HOSTS: "*"
|
||||
SECRET_KEY: "changeme"
|
||||
GUNICORN_MEDIA: 0
|
||||
FRACTION_PREF_DEFAULT: 0
|
||||
COMMENT_PREF_DEFAULT: 1
|
||||
SHOPPING_MIN_AUTOSYNC_INTERVAL: 5
|
||||
|
||||
envTpl:
|
||||
TIMEZONE: "{{ .Values.env.TZ }}"
|
||||
DB_ENGINE: "django.db.backends.postgresql"
|
||||
POSTGRES_DB: "{{ .Values.postgresql.postgresqlDatabase }}"
|
||||
POSTGRES_USER: "{{ .Values.postgresql.postgresqlUsername }}"
|
||||
@@ -47,6 +46,10 @@ envValueFrom:
|
||||
secretKeyRef:
|
||||
name: dbcreds
|
||||
key: plainhost
|
||||
SECRET_KEY:
|
||||
secretKeyRef:
|
||||
name: recipes-secrets
|
||||
key: SECRET_KEY
|
||||
|
||||
additionalContainers:
|
||||
nginx:
|
||||
|
||||
Reference in New Issue
Block a user