diff --git a/library/ix-dev/enterprise/syncthing/Chart.yaml b/library/ix-dev/enterprise/syncthing/Chart.yaml index 8e27920fdf..581e561bf7 100644 --- a/library/ix-dev/enterprise/syncthing/Chart.yaml +++ b/library/ix-dev/enterprise/syncthing/Chart.yaml @@ -3,7 +3,7 @@ description: Syncthing is a continuous file synchronization program. annotations: title: Syncthing type: application -version: 1.0.6 +version: 1.0.7 apiVersion: v2 appVersion: '1.23.3' kubeVersion: '>=1.16.0-0' diff --git a/library/ix-dev/enterprise/syncthing/templates/_configure.tpl b/library/ix-dev/enterprise/syncthing/templates/_configure.tpl index 8bc27338f1..989e3710c3 100644 --- a/library/ix-dev/enterprise/syncthing/templates/_configure.tpl +++ b/library/ix-dev/enterprise/syncthing/templates/_configure.tpl @@ -49,5 +49,46 @@ configmap: setConfig defaults folder sync-ownership set -- 1 setConfig defaults folder send-xattrs set -- 1 setConfig defaults folder sync-xattrs set -- 1 - + syncthing-truenas-logo: + enabled: true + data: + logo-horizontal.svg: | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{- end -}} diff --git a/library/ix-dev/enterprise/syncthing/templates/_persistence.tpl b/library/ix-dev/enterprise/syncthing/templates/_persistence.tpl new file mode 100644 index 0000000000..48f862e341 --- /dev/null +++ b/library/ix-dev/enterprise/syncthing/templates/_persistence.tpl @@ -0,0 +1,73 @@ +{{- define "syncthing.persistence" -}} +persistence: + home: + enabled: true + type: {{ .Values.syncthingStorage.home.type }} + datasetName: {{ .Values.syncthingStorage.home.datasetName | default "" }} + hostPath: {{ .Values.syncthingStorage.home.hostPath | default "" }} + targetSelector: + syncthing: + syncthing: + mountPath: /var/syncthing + 01-certs: + mountPath: /var/syncthing + configure: + enabled: true + type: configmap + objectName: syncthing-configure + defaultMode: "0770" + targetSelector: + syncthing: + syncthing: + mountPath: /configure.sh + subPath: configure.sh + truenas-logo: + enabled: true + type: configmap + objectName: syncthing-truenas-logo + defaultMode: "0770" + targetSelector: + syncthing: + syncthing: + mountPath: /var/truenas/assets/gui/default/assets/img/logo-horizontal.svg + subPath: logo-horizontal.svg + + {{- if not .Values.syncthingStorage.additionalStorages -}} + {{- fail "Syncthing - Expected at least one additional storage defined" -}} + {{- end -}} + + {{- range $idx, $storage := .Values.syncthingStorage.additionalStorages }} + {{ printf "sync-%v" (int $idx) }}: + enabled: true + type: {{ $storage.type }} + datasetName: {{ $storage.datasetName | default "" }} + hostPath: {{ $storage.hostPath | default "" }} + targetSelector: + syncthing: + syncthing: + mountPath: {{ $storage.mountPath }} + {{- end }} + + {{- if .Values.syncthingNetwork.certificateID }} + certs: + enabled: true + type: secret + objectName: syncthing-cert + defaultMode: "0600" + items: + - key: tls.key + path: https-key.pem + - key: tls.crt + path: https-cert.pem + targetSelector: + syncthing: + 01-certs: + mountPath: /certs + readOnly: true + +scaleCertificate: + syncthing-cert: + enabled: true + id: {{ .Values.syncthingNetwork.certificateID }} + {{- end -}} +{{- end -}} diff --git a/library/ix-dev/enterprise/syncthing/templates/_service.tpl b/library/ix-dev/enterprise/syncthing/templates/_service.tpl new file mode 100644 index 0000000000..c977aa413a --- /dev/null +++ b/library/ix-dev/enterprise/syncthing/templates/_service.tpl @@ -0,0 +1,47 @@ +{{- define "syncthing.service" -}} +service: + syncthing-web: + enabled: true + primary: true + type: NodePort + targetSelector: syncthing + ports: + webui: + enabled: true + primary: true + port: {{ .Values.syncthingNetwork.webPort }} + nodePort: {{ .Values.syncthingNetwork.webPort }} + targetSelector: syncthing + syncthing-discovery: + # Only enable this service if local discovery is enabled + enabled: {{ .Values.syncthingConfig.localDiscovery }} + type: NodePort + targetSelector: syncthing + ports: + discovery: + enabled: true + port: {{ .Values.syncthingNetwork.localDiscoveryPort }} + nodePort: {{ .Values.syncthingNetwork.localDiscoveryPort }} + targetPort: 21017 + protocol: udp + targetSelector: syncthing + syncthing-transfer: + enabled: true + type: NodePort + targetSelector: syncthing + ports: + tcp: + enabled: true + primary: true + port: {{ .Values.syncthingNetwork.tcpPort }} + nodePort: {{ .Values.syncthingNetwork.tcpPort }} + targetPort: 22000 + targetSelector: syncthing + quic: + enabled: true + port: {{ .Values.syncthingNetwork.quicPort }} + nodePort: {{ .Values.syncthingNetwork.quicPort }} + targetPort: 22000 + protocol: udp + targetSelector: syncthing +{{- end -}} diff --git a/library/ix-dev/enterprise/syncthing/templates/_syncthing.tpl b/library/ix-dev/enterprise/syncthing/templates/_syncthing.tpl index b0ae4e57dc..a15113cd20 100644 --- a/library/ix-dev/enterprise/syncthing/templates/_syncthing.tpl +++ b/library/ix-dev/enterprise/syncthing/templates/_syncthing.tpl @@ -33,6 +33,8 @@ workload: env: PCAP: cap_chown,cap_dac_override,cap_fowner+ep STGUIADDRESS: "0.0.0.0:{{ .Values.syncthingNetwork.webPort }}" + # Set a custom override for the GUI assets + STGUIASSETS: /var/truenas/assets/gui # Disable automatic upgrades STNOUPGRADE: "true" fixedEnv: @@ -66,113 +68,4 @@ workload: initContainers: {{- include "syncthing.certContainer" $ | nindent 8 -}} {{- end }} -{{/* Service */}} -service: - syncthing-web: - enabled: true - primary: true - type: NodePort - targetSelector: syncthing - ports: - webui: - enabled: true - primary: true - port: {{ .Values.syncthingNetwork.webPort }} - nodePort: {{ .Values.syncthingNetwork.webPort }} - targetSelector: syncthing - syncthing-discovery: - # Only enable this service if local discovery is enabled - enabled: {{ .Values.syncthingConfig.localDiscovery }} - type: NodePort - targetSelector: syncthing - ports: - discovery: - enabled: true - port: {{ .Values.syncthingNetwork.localDiscoveryPort }} - nodePort: {{ .Values.syncthingNetwork.localDiscoveryPort }} - targetPort: 21017 - protocol: udp - targetSelector: syncthing - syncthing-transfer: - enabled: true - type: NodePort - targetSelector: syncthing - ports: - tcp: - enabled: true - primary: true - port: {{ .Values.syncthingNetwork.tcpPort }} - nodePort: {{ .Values.syncthingNetwork.tcpPort }} - targetPort: 22000 - targetSelector: syncthing - quic: - enabled: true - port: {{ .Values.syncthingNetwork.quicPort }} - nodePort: {{ .Values.syncthingNetwork.quicPort }} - targetPort: 22000 - protocol: udp - targetSelector: syncthing - -{{/* Persistence */}} -persistence: - home: - enabled: true - type: {{ .Values.syncthingStorage.home.type }} - datasetName: {{ .Values.syncthingStorage.home.datasetName | default "" }} - hostPath: {{ .Values.syncthingStorage.home.hostPath | default "" }} - targetSelector: - syncthing: - syncthing: - mountPath: /var/syncthing - 01-certs: - mountPath: /var/syncthing - configure: - enabled: true - type: configmap - objectName: syncthing-configure - defaultMode: "0770" - targetSelector: - syncthing: - syncthing: - mountPath: /configure.sh - subPath: configure.sh - - {{- if not .Values.syncthingStorage.additionalStorages -}} - {{- fail "Syncthing - Expected at least one additional storage defined" -}} - {{- end -}} - - {{- range $idx, $storage := .Values.syncthingStorage.additionalStorages }} - {{ printf "sync-%v" (int $idx) }}: - enabled: true - type: {{ $storage.type }} - datasetName: {{ $storage.datasetName | default "" }} - hostPath: {{ $storage.hostPath | default "" }} - targetSelector: - syncthing: - syncthing: - mountPath: {{ $storage.mountPath }} - {{- end }} - - {{- if .Values.syncthingNetwork.certificateID }} - certs: - enabled: true - type: secret - objectName: syncthing-cert - defaultMode: "0600" - items: - - key: tls.key - path: https-key.pem - - key: tls.crt - path: https-cert.pem - targetSelector: - syncthing: - 01-certs: - mountPath: /certs - readOnly: true - -scaleCertificate: - syncthing-cert: - enabled: true - id: {{ .Values.syncthingNetwork.certificateID }} - {{- end -}} {{- end -}} diff --git a/library/ix-dev/enterprise/syncthing/templates/common.yaml b/library/ix-dev/enterprise/syncthing/templates/common.yaml index f9f4fded52..fc970dffa5 100644 --- a/library/ix-dev/enterprise/syncthing/templates/common.yaml +++ b/library/ix-dev/enterprise/syncthing/templates/common.yaml @@ -2,6 +2,8 @@ {{/* Merge the templates with Values */}} {{- $_ := mustMergeOverwrite .Values (include "syncthing.workload" $ | fromYaml) -}} +{{- $_ := mustMergeOverwrite .Values (include "syncthing.persistence" $ | fromYaml) -}} +{{- $_ := mustMergeOverwrite .Values (include "syncthing.service" $ | fromYaml) -}} {{- $_ := mustMergeOverwrite .Values (include "syncthing.configure" $ | fromYaml) -}} {{/* Create the configmap for portal manually*/}}