Files
chart/library/ix-dev/community/joplin/templates/_configuration.tpl
Stavros Kois a4177f09dc NAS-123672 / 24.04 / add joplin to community apps (#1471)
* add `joplin` to `community` apps

* add storage and service

* add more boilerplat

* add some test values

* add values

* update readme

* add basic ui

* add initialmeta

* add todo

* render config

* use 1001

* fix probes

* reduce permissiosn

* fix portal

* remove todo

* bump common

* simplify probe header

* add deafult creds

* remove redundant values

* update wording
2023-08-30 14:19:06 +03:00

30 lines
987 B
Smarty

{{- define "joplin.configuration" -}}
{{- $fullname := (include "ix.v1.common.lib.chart.names.fullname" $) -}}
{{- $dbHost := (printf "%s-postgres" $fullname) -}}
{{- $dbUser := "joplin" -}}
{{- $dbName := "joplin" -}}
{{- $dbPass := randAlphaNum 32 -}}
{{- with (lookup "v1" "Secret" .Release.Namespace (printf "%s-postgres-creds" $fullname)) -}}
{{- $dbPass = ((index .data "POSTGRES_PASSWORD") | b64dec) -}}
{{- end -}}
{{/* Temporary set dynamic db details on values,
so we can print them on the notes */}}
{{- $_ := set .Values "joplinDbPass" $dbPass -}}
{{- $_ := set .Values "joplinDbHost" $dbHost -}}
{{- $dbURL := (printf "postgres://%s:%s@%s:5432/%s?sslmode=disable" $dbUser $dbPass $dbHost $dbName) }}
secret:
postgres-creds:
enabled: true
data:
POSTGRES_USER: {{ $dbUser }}
POSTGRES_DB: {{ $dbName }}
POSTGRES_PASSWORD: {{ $dbPass }}
POSTGRES_HOST: {{ $dbHost }}
POSTGRES_URL: {{ $dbURL }}
{{- end -}}