Files
chart/community/joplin/1.1.14/templates/_portal.tpl
2025-02-24 08:07:09 +00:00

26 lines
657 B
Smarty

{{- define "joplin.portal" -}}
{{ $prot := "http" }}
{{ if hasPrefix "https://" .Values.joplinConfig.baseUrl }}
{{ $prot = "https" }}
{{ end }}
{{ $host := "$node_ip" }}
{{ $port := .Values.joplinNetwork.webPort }}
{{ with .Values.joplinConfig.baseUrl }}
{{ $host = . | trimPrefix "http://" | trimPrefix "https://" | trimSuffix "/" }}
{{ if contains ":" $host }}
{{ $port = (split ":" $host)._1 }}
{{ $host = (split ":" $host)._0 }}
{{ end }}
{{ end }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: portal
data:
port: {{ $port | quote }}
path: "/"
protocol: {{ $prot }}
host: {{ $host }}
{{- end -}}