mirror of
https://github.com/truenas/charts.git
synced 2026-04-10 22:28:53 +08:00
* add initial files * add some validation and fix image tag * add modules to the config * extend test and add capabilities * add extra test * rsync -> Rsync and add metadata file * add UI * hide questions when module is disablwed * rename test file and add validation to questions * remove dot * update wording * remove logToStdout toggle * update image
63 lines
1.8 KiB
Smarty
63 lines
1.8 KiB
Smarty
{{- define "rsync.configuration" -}}
|
|
{{- include "rsync.validation" $ }}
|
|
configmap:
|
|
config:
|
|
enabled: true
|
|
data:
|
|
rsyncd.conf: |
|
|
port = {{ .Values.rsyncNetwork.rsyncPort }}
|
|
use chroot = yes
|
|
pid file = /tmp/rsyncd.pid
|
|
|
|
max connections = {{ .Values.rsyncConfig.maxConnections }}
|
|
log file = /dev/stdout
|
|
|
|
{{- range $aux := .Values.rsyncConfig.auxParams }}
|
|
{{ printf "%v = %v" $aux.param $aux.value }}
|
|
{{- end }}
|
|
|
|
{{- $mods := list -}}
|
|
{{- range $mod := .Values.rsyncModules }}
|
|
{{- if $mod.enabled -}}
|
|
{{- include "rsync.module.validation" (dict "mod" $mod) }}
|
|
|
|
{{ printf "[%v]" $mod.name }}
|
|
path = {{ printf "/data/%v" $mod.name }}
|
|
max connections = {{ $mod.maxConnections }}
|
|
uid = {{ $mod.uid }}
|
|
gid = {{ $mod.gid }}
|
|
{{- if $mod.comment }}
|
|
comment = {{ $mod.comment }}
|
|
{{- end }}
|
|
|
|
{{- if eq $mod.accessMode "RO" }}
|
|
write only = false
|
|
read only = true
|
|
{{- else if eq $mod.accessMode "WO" }}
|
|
write only = true
|
|
read only = false
|
|
{{- else if eq $mod.accessMode "RW" }}
|
|
read only = false
|
|
write only = false
|
|
{{- end }}
|
|
|
|
{{- if $mod.hostsAllow }}
|
|
hosts allow = {{ join " " $mod.hostsAllow }}
|
|
{{- end }}
|
|
|
|
{{- if $mod.hostsDeny }}
|
|
hosts deny = {{ join " " $mod.hostsDeny }}
|
|
{{- end }}
|
|
{{- range $aux := $mod.auxParams }}
|
|
{{- include "rsync.aux.validation" (dict "aux" $aux) }}
|
|
{{ printf "%v = %v" $aux.param $aux.value }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- $mods = mustAppend $mods $mod.name }}
|
|
{{- end }}
|
|
|
|
{{- if not (deepEqual $mods (uniq $mods)) -}}
|
|
{{- fail "Rsync - Module Names must be unique" -}}
|
|
{{- end -}}
|
|
{{- end -}}
|