feat(bookstack): Add autogenerated app_key (#2194)

This commit is contained in:
Stavros Kois 2022-03-17 08:09:31 +02:00 committed by GitHub
parent 55b09eb958
commit ca47f26dda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 48 additions and 11 deletions

View File

@ -27,7 +27,7 @@ name: bookstack
sources:
- https://www.bookstackapp.com/
- https://hub.docker.com/r/linuxserver/bookstack
version: 1.0.3
version: 1.1.0
annotations:
truecharts.org/catagories: |
- media

View File

@ -75,7 +75,19 @@ questions:
- value: "OnDelete"
description: "(Legacy) OnDelete: ignore .spec.template changes"
# Include{controllerExpert}
- variable: env
group: "Container Configuration"
label: "Image Environment"
schema:
additional_attrs: true
type: dict
attrs:
- variable: APP_URL
label: "APP_URL"
description: "Application URL eg. https://bookstack.mydomain.com"
schema:
type: string
default: ""
# Include{containerConfig}
- variable: service

View File

@ -0,0 +1,20 @@
{{/* Define the secrets */}}
{{- define "bookstack.secrets" -}}
---
apiVersion: v1
kind: Secret
type: Opaque
metadata:
name: bookstack-secrets
{{- $bookstackprevious := lookup "v1" "Secret" .Release.Namespace "bookstack-secrets" }}
{{- $app_key := "" }}
data:
{{- if $bookstackprevious}}
APP_KEY: {{ index $bookstackprevious.data "APP_KEY" }}
{{- else }}
{{- $app_key := randAlphaNum 32 }}
APP_KEY: {{ $app_key | b64enc }}
{{- end }}
{{- end -}}

View File

@ -1 +1,8 @@
{{ include "common.all" . }}
{{/* Make sure all variables are set properly */}}
{{- include "common.setup" . }}
{{/* Render secrets for bookstack */}}
{{- include "bookstack.secrets" . }}
{{/* Render the templates */}}
{{ include "common.postSetup" . }}

View File

@ -3,11 +3,9 @@ image:
pullPolicy: IfNotPresent
tag: v22.02.20220226@sha256:835888c1a466075efd5326a1c52d182c0c37558f60e34fa2a8dd54def8d22e45
# -- environment variables. See more environment variables in the [bookstack documentation](https://hub.docker.com/r/linuxserver/bookstack)
# @default -- See below
env:
DB_USER: bookstack
DB_DATABASE: bookstack
DB_USER: "{{ .Values.mariadb.mariadbUsername }}"
DB_DATABASE: "{{ .Values.mariadb.mariadbDatabase }}"
securityContext:
readOnlyRootFilesystem: false
@ -17,8 +15,6 @@ podSecurityContext:
runAsUser: 0
runAsGroup: 0
# -- Configures service settings for the chart.
# @default -- See values.yaml
service:
main:
ports:
@ -26,8 +22,6 @@ service:
port: 10112
targetPort: 80
# -- Configure persistence settings for the chart under this key.
# @default -- See values.yaml
persistence:
varrun:
enabled: true
@ -44,6 +38,10 @@ envValueFrom:
secretKeyRef:
name: mariadbcreds
key: mariadb-password
APP_KEY:
secretKeyRef:
name: bookstack-secrets
key: APP_KEY
mariadb:
enabled: true