File tree Expand file tree Collapse file tree 5 files changed +42
-5
lines changed Expand file tree Collapse file tree 5 files changed +42
-5
lines changed Original file line number Diff line number Diff line change 8181 secretKeyRef :
8282 name : {{ template "fullname" . }}
8383 key : mercure-jwt-secret
84+ - name : JWT_SECRET_KEY
85+ valueFrom :
86+ secretKeyRef :
87+ name : {{ template "fullname" . }}
88+ key : jwt-secret-key
89+ - name : JWT_PUBLIC_KEY
90+ valueFrom :
91+ secretKeyRef :
92+ name : {{ template "fullname" . }}
93+ key : jwt-public-key
94+ - name : JWT_PASSPHRASE
95+ valueFrom :
96+ secretKeyRef :
97+ name : {{ template "fullname" . }}
98+ key : jwt-passphrase
8499 resources :
85100{{ toYaml .Values.resources | indent 12 }}
86101 {{- if .Values.nodeSelector }}
Original file line number Diff line number Diff line change @@ -12,9 +12,12 @@ metadata:
1212type : Opaque
1313data :
1414 {{ if .Values.postgresql.enabled }}
15- database-url : {{ printf "pgsql://%s:%s@%s/%s?serverVersion=9.6 " .Values.postgresql.postgresqlUsername .Values.postgresql.postgresqlPassword $postgresqlServiceName .Values.postgresql.postgresqlDatabase | b64enc | quote }}
15+ database-url : {{ printf "pgsql://%s:%s@%s/%s?serverVersion=10 " .Values.postgresql.postgresqlUsername .Values.postgresql.postgresqlPassword $postgresqlServiceName .Values.postgresql.postgresqlDatabase | b64enc | quote }}
1616 {{ else }}
1717 database-url : {{ .Values.postgresql.url | b64enc | quote }}
1818 {{ end }}
1919 secret : {{ .Values.php.secret | default (randAlphaNum 40) | b64enc | quote }}
2020 mercure-jwt-secret : {{ .Values.php.mercure.jwtSecret | b64enc | quote }}
21+ jwt-secret-key : {{ .Values.php.jwt.secretKey | b64enc | quote }}
22+ jwt-public-key : {{ .Values.php.jwt.publicKey | b64enc | quote }}
23+ jwt-passphrase : {{ .Values.php.jwt.passphrase | b64enc | quote }}
Original file line number Diff line number Diff line change 99 replicaCount : 1
1010 mercure :
1111 jwtSecret : " "
12+ jwt :
13+ secretKey : " "
14+ publicKey : " "
15+ passphrase : " "
1216 env : prod
1317 debug : ' 0'
1418 secret : " "
@@ -50,7 +54,7 @@ varnish:
5054postgresql :
5155 enabled : true
5256 # If bringing your own PostgreSQL, the full uri to use
53- # url: pgsql://api-platform:!ChangeMe!@example.com/api?serverVersion=10.1
57+ # url: pgsql://api-platform:!ChangeMe!@example.com/api?serverVersion=10
5458 postgresqlUsername : " api-platform"
5559 postgresqlPassword : " "
5660 postgresqlDatabase : " api"
@@ -59,9 +63,9 @@ postgresql:
5963 persistence :
6064 enabled : false
6165 pullPolicy : IfNotPresent
62- # image:
63- # repository: postgres
64- # tag: alpine
66+ image :
67+ repository : bitnami/postgresql
68+ tag : 10
6569
6670mercure :
6771 enabled : true
Original file line number Diff line number Diff line change @@ -23,6 +23,18 @@ if [[ -z $MERCURE_JWT_KEY ]]; then
2323 export MERCURE_JWT_SECRET
2424fi
2525
26+ # Generate random passphrase and keys for JWT signing if not set
27+ if [ -z " $JWT_PASSPHRASE " ]; then
28+ JWT_PASSPHRASE=$( < /dev/urandom tr -dc ' a-zA-Z0-9' | fold -w 32 | head -n 1)
29+ export JWT_PASSPHRASE
30+ fi
31+ if [ -z " $JWT_SECRET_KEY " ]; then
32+ JWT_SECRET_KEY=$( openssl genpkey -pass file:<( echo " $JWT_PASSPHRASE " ) -aes256 -algorithm rsa -pkeyopt rsa_keygen_bits:4096)
33+ export JWT_SECRET_KEY
34+ JWT_PUBLIC_KEY=$( openssl pkey -in <( echo " $JWT_SECRET_KEY " ) -passin file:<( echo " $JWT_PASSPHRASE " ) -pubout)
35+ export JWT_PUBLIC_KEY
36+ fi
37+
2638# Generate random database password if not set
2739if [[ -z $DATABASE_PASSWORD ]]; then
2840 export DATABASE_PASSWORD=$( cat /dev/urandom | tr -dc ' a-zA-Z0-9' | fold -w 32 | head -n 1)
Original file line number Diff line number Diff line change @@ -62,6 +62,9 @@ helm upgrade --install --reset-values --force --namespace=$NAMESPACE --recreate-
6262 --set php.trustedHosts=$TRUSTED_HOSTS \
6363 --set php.repository=$PHP_REPOSITORY ,php.tag=$TAG \
6464 --set php.mercure.jwtSecret=$MERCURE_JWT_SECRET \
65+ --set php.jwt.secretKey=" $JWT_SECRET_KEY " \
66+ --set php.jwt.publicKey=" $JWT_PUBLIC_KEY " \
67+ --set php.jwt.passphrase=" $JWT_PASSPHRASE " \
6568 --set nginx.repository=$NGINX_REPOSITORY ,nginx.tag=$TAG \
6669 --set varnish.repository=$VARNISH_REPOSITORY ,varnish.tag=$TAG \
6770 --set blackfire.blackfire.server_id=$BLACKFIRE_SERVER_ID \
You can’t perform that action at this time.
0 commit comments