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"
|
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.
|
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
|
name: recipes
|
||||||
version: 4.0.18
|
version: 5.0.0
|
||||||
kubeVersion: ">=1.16.0-0"
|
kubeVersion: ">=1.16.0-0"
|
||||||
keywords:
|
keywords:
|
||||||
- recipes
|
- recipes
|
||||||
|
|||||||
@@ -73,18 +73,6 @@ questions:
|
|||||||
- value: "OnDelete"
|
- value: "OnDelete"
|
||||||
description: "(Legacy) OnDelete: ignore .spec.template changes"
|
description: "(Legacy) OnDelete: ignore .spec.template changes"
|
||||||
# Include{controllerExpert}
|
# 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
|
- variable: env
|
||||||
group: "Container Configuration"
|
group: "Container Configuration"
|
||||||
label: "Image Environment"
|
label: "Image Environment"
|
||||||
|
|||||||
@@ -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 -}}
|
{{- end -}}
|
||||||
{{- $_ := mergeOverwrite .Values (include "recipes.harcodedValues" . | fromYaml) -}}
|
{{- $_ := mergeOverwrite .Values (include "recipes.harcodedValues" . | fromYaml) -}}
|
||||||
|
|
||||||
|
{{/* Render secrets for recipes */}}
|
||||||
|
{{- include "recipes.secrets" . }}
|
||||||
|
|
||||||
{{/* Render the templates */}}
|
{{/* Render the templates */}}
|
||||||
{{ include "common.postSetup" . }}
|
{{ 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.
|
# -- environment variables. See [project docs](https://raw.githubusercontent.com/vabene1111/recipes/master/.env.template) for more details.
|
||||||
# @default -- See below
|
# @default -- See below
|
||||||
env:
|
env:
|
||||||
TIMEZONE: UTC
|
|
||||||
DEBUG: 0
|
DEBUG: 0
|
||||||
ALLOWED_HOSTS: "*"
|
ALLOWED_HOSTS: "*"
|
||||||
SECRET_KEY: "changeme"
|
|
||||||
GUNICORN_MEDIA: 0
|
GUNICORN_MEDIA: 0
|
||||||
FRACTION_PREF_DEFAULT: 0
|
FRACTION_PREF_DEFAULT: 0
|
||||||
COMMENT_PREF_DEFAULT: 1
|
COMMENT_PREF_DEFAULT: 1
|
||||||
SHOPPING_MIN_AUTOSYNC_INTERVAL: 5
|
SHOPPING_MIN_AUTOSYNC_INTERVAL: 5
|
||||||
|
|
||||||
envTpl:
|
envTpl:
|
||||||
|
TIMEZONE: "{{ .Values.env.TZ }}"
|
||||||
DB_ENGINE: "django.db.backends.postgresql"
|
DB_ENGINE: "django.db.backends.postgresql"
|
||||||
POSTGRES_DB: "{{ .Values.postgresql.postgresqlDatabase }}"
|
POSTGRES_DB: "{{ .Values.postgresql.postgresqlDatabase }}"
|
||||||
POSTGRES_USER: "{{ .Values.postgresql.postgresqlUsername }}"
|
POSTGRES_USER: "{{ .Values.postgresql.postgresqlUsername }}"
|
||||||
@@ -47,6 +46,10 @@ envValueFrom:
|
|||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: dbcreds
|
name: dbcreds
|
||||||
key: plainhost
|
key: plainhost
|
||||||
|
SECRET_KEY:
|
||||||
|
secretKeyRef:
|
||||||
|
name: recipes-secrets
|
||||||
|
key: SECRET_KEY
|
||||||
|
|
||||||
additionalContainers:
|
additionalContainers:
|
||||||
nginx:
|
nginx:
|
||||||
|
|||||||
Reference in New Issue
Block a user