diff --git a/grampsweb/Chart.yaml b/grampsweb/Chart.yaml index d4379b6..b74a240 100644 --- a/grampsweb/Chart.yaml +++ b/grampsweb/Chart.yaml @@ -3,7 +3,7 @@ name: grampsweb description: A Helm chart for gramps web icon: https://raw.githubusercontent.com/gramps-project/Gramps.js/main/images/icon512.png type: application -version: 0.1.15 +version: 0.1.16 # renovate: image=ghcr.io/gramps-project/grampsweb appVersion: "24.7.1" maintainers: diff --git a/grampsweb/README.adoc b/grampsweb/README.adoc index d4b5a1e..c5fa4c7 100644 --- a/grampsweb/README.adoc +++ b/grampsweb/README.adoc @@ -2,7 +2,7 @@ = grampsweb -image::https://img.shields.io/badge/Version-0.1.15-informational?style=flat-square[Version: 0.1.15] +image::https://img.shields.io/badge/Version-0.1.16-informational?style=flat-square[Version: 0.1.16] image::https://img.shields.io/badge/Version-application-informational?style=flat-square[Type: application] image::https://img.shields.io/badge/AppVersion-24.7.1-informational?style=flat-square[AppVersion: 24.7.1] == Maintainers diff --git a/grampsweb/templates/deployment.yaml b/grampsweb/templates/deployment.yaml index f3e15ae..9dde6ed 100644 --- a/grampsweb/templates/deployment.yaml +++ b/grampsweb/templates/deployment.yaml @@ -36,6 +36,31 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default (printf "v%s" .Chart.AppVersion) }}" imagePullPolicy: {{ .Values.image.pullPolicy }} + command: + - sh + - -c + - |- + set -e + + # create random flask secret key + if [ ! -s /app/secret/secret ] + then + mkdir -p /app/secret + python3 -c "import secrets;print(secrets.token_urlsafe(32))" | tr -d "\n" > /app/secret/secret + fi + # use the secret key if none is set (will be overridden by config file if present) + if [ -z "$GRAMPSWEB_SECRET_KEY" ] + then + export GRAMPSWEB_SECRET_KEY=$(cat /app/secret/secret) + fi + + # Run migrations for user database, if any + cd /app/src/ + python3 -m gramps_webapi --config /app/config/config.cfg user migrate + cd /app/ + + gunicorn -w ${GUNICORN_NUM_WORKERS:-8} -b 0.0.0.0:5000 gramps_webapi.wsgi:app --timeout 120 --limit-request-line 8190 + envFrom: - secretRef: name: {{ include "grampsweb.fullname" . }}