Merge pull request #936 from truenas/fix-nextcloud-secret

NAS-119496 / 23.10 / fix nextcloud secret and update
This commit is contained in:
Stavros Kois
2022-12-26 18:41:45 +02:00
committed by GitHub
58 changed files with 56 additions and 38 deletions

View File

@@ -1,13 +0,0 @@
apiVersion: v1
kind: Secret
metadata:
name: db-details
data:
db-user: postgres
{{- if .Release.IsInstall }}
db-password: {{ randAlphaNum 15 | b64enc | quote }}
{{ else }}
# `index` function is necessary because the property name contains a dash.
# Otherwise (...).data.db_password would have worked too.
db-password: {{ index (lookup "v1" "Secret" .Release.Namespace "db-details").data "db-password" }}
{{ end }}

View File

@@ -1,5 +1,5 @@
apiVersion: v2
appVersion: 25.0.1
appVersion: 25.0.2
dependencies:
- name: common
repository: file://../../../library/common/2207.0.0
@@ -19,4 +19,4 @@ sources:
- https://github.com/nextcloud/docker
- https://github.com/nextcloud/helm
upstream_version: 2.3.2
version: 1.6.14
version: 1.6.15

View File

@@ -1,10 +1,10 @@
image:
pullPolicy: IfNotPresent
repository: nextcloud
tag: 25.0.1
tag: 25.0.2
nginx:
image:
pullPolicy: IfNotPresent
repository: nginx
tag: 1.21.3
tag: 1.23.3
useServiceNameForHost: false

View File

@@ -0,0 +1,22 @@
{{- $secretName := "db-details" }}
apiVersion: v1
kind: Secret
metadata:
name: {{ $secretName }}
data:
{{/*
Lookup for the user shouldn't be needed in normal circumstances
But there was a typo before that resulted to a db-user with weird
characters. So to keep that user for existing installations we retrieve
it from the existing secret.
*/}}
{{ with (lookup "v1" "Secret" .Release.Namespace $secretName)}}
db-user: {{ index .data "db-user" }}
{{ else }}
db-user: {{ (include "postgres.DatabaseName" .Values ) | b64enc }}
{{ end }}
{{ with (lookup "v1" "Secret" .Release.Namespace $secretName) }}
db-password: {{ index .data "db-password" }}
{{ else }}
db-password: {{ randAlphaNum 15 | b64enc }}
{{ end }}

View File

@@ -12,7 +12,7 @@ environmentVariables: []
image:
pullPolicy: IfNotPresent
repository: nextcloud
tag: 25.0.1
tag: 25.0.2
ixChartContext: {}
nextcloud:
datadir: /var/www/html/data
@@ -23,7 +23,7 @@ nginx:
image:
pullPolicy: IfNotPresent
repository: nginx
tag: 1.21.3
tag: 1.23.3
postgresAppVolumeMounts:
postgres-backup:
emptyDir: true

View File

@@ -1,13 +0,0 @@
apiVersion: v1
kind: Secret
metadata:
name: db-details
data:
db-user: postgres
{{- if .Release.IsInstall }}
db-password: {{ randAlphaNum 15 | b64enc | quote }}
{{ else }}
# `index` function is necessary because the property name contains a dash.
# Otherwise (...).data.db_password would have worked too.
db-password: {{ index (lookup "v1" "Secret" .Release.Namespace "db-details").data "db-password" }}
{{ end }}

View File

@@ -1,5 +1,5 @@
apiVersion: v2
appVersion: 25.0.1
appVersion: 25.0.2
dependencies:
- name: common
repository: file://../../../library/common/2207.0.0
@@ -19,4 +19,4 @@ sources:
- https://github.com/nextcloud/docker
- https://github.com/nextcloud/helm
upstream_version: 2.3.2
version: 1.6.14
version: 1.6.15

View File

@@ -1,10 +1,10 @@
image:
pullPolicy: IfNotPresent
repository: nextcloud
tag: 25.0.1
tag: 25.0.2
nginx:
image:
pullPolicy: IfNotPresent
repository: nginx
tag: 1.21.3
tag: 1.23.3
useServiceNameForHost: false

View File

@@ -0,0 +1,22 @@
{{- $secretName := "db-details" }}
apiVersion: v1
kind: Secret
metadata:
name: {{ $secretName }}
data:
{{/*
Lookup for the user shouldn't be needed in normal circumstances
But there was a typo before that resulted to a db-user with weird
characters. So to keep that user for existing installations we retrieve
it from the existing secret.
*/}}
{{ with (lookup "v1" "Secret" .Release.Namespace $secretName)}}
db-user: {{ index .data "db-user" }}
{{ else }}
db-user: {{ (include "postgres.DatabaseName" .Values ) | b64enc }}
{{ end }}
{{ with (lookup "v1" "Secret" .Release.Namespace $secretName) }}
db-password: {{ index .data "db-password" }}
{{ else }}
db-password: {{ randAlphaNum 15 | b64enc }}
{{ end }}

View File

@@ -12,7 +12,7 @@ environmentVariables: []
image:
pullPolicy: IfNotPresent
repository: nextcloud
tag: 25.0.1
tag: 25.0.2
ixChartContext: {}
nextcloud:
datadir: /var/www/html/data
@@ -23,7 +23,7 @@ nginx:
image:
pullPolicy: IfNotPresent
repository: nginx
tag: 1.21.3
tag: 1.23.3
postgresAppVolumeMounts:
postgres-backup:
emptyDir: true