mirror of
https://github.com/truenas/charts.git
synced 2026-05-11 19:16:17 +08:00
* add `planka` to `community` train * lock file * add initial tempaltes * add service * fix url * update portal * test * metadata * questions * typo * add validation * typo * fix logic * switch to uri type * update description * bump common
34 lines
1.0 KiB
Smarty
34 lines
1.0 KiB
Smarty
{{- define "planka.portal" -}}
|
|
---
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: portal
|
|
data:
|
|
{{- $protocol := "http" -}}
|
|
{{- if hasPrefix "https://" .Values.plankaConfig.baseURL -}}
|
|
{{- $protocol = "https" -}}
|
|
{{- end -}}
|
|
{{- $host := "$node_ip" -}}
|
|
{{- $port := .Values.plankaNetwork.webPort -}}
|
|
{{- with .Values.plankaConfig.baseURL -}} {{/* Trim protocol and trailing slash */}}
|
|
{{- $host = (. | trimPrefix "https://" | trimPrefix "http://" | trimSuffix "/") -}}
|
|
{{- $host = mustRegexReplaceAll "(.*):[0-9]+" $host "${1}" -}}
|
|
{{- $tempPort := . | trimPrefix $protocol | trimPrefix "://" | trimPrefix $host | trimPrefix ":" -}}
|
|
{{- if $tempPort -}}
|
|
{{- $port = $tempPort -}}
|
|
{{- end -}}
|
|
{{- if not $tempPort -}}
|
|
{{- if eq $protocol "https" -}}
|
|
{{- $port = "443" -}}
|
|
{{- else -}}
|
|
{{- $port = "80" -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
{{- end }}
|
|
path: "/"
|
|
port: {{ $port | quote }}
|
|
protocol: {{ $protocol }}
|
|
host: {{ $host }}
|
|
{{- end -}}
|