_persistence.tpl 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. {{- define "syncthing.persistence" -}}
  2. persistence:
  3. home:
  4. enabled: true
  5. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.syncthingStorage.home) | nindent 4 }}
  6. targetSelector:
  7. syncthing:
  8. syncthing:
  9. mountPath: /var/syncthing
  10. 01-certs:
  11. mountPath: /var/syncthing
  12. configure:
  13. enabled: true
  14. type: configmap
  15. objectName: syncthing-configure
  16. defaultMode: "0770"
  17. targetSelector:
  18. syncthing:
  19. syncthing:
  20. mountPath: /configure.sh
  21. subPath: configure.sh
  22. truenas-logo:
  23. enabled: true
  24. type: configmap
  25. objectName: syncthing-truenas-logo
  26. defaultMode: "0770"
  27. targetSelector:
  28. syncthing:
  29. syncthing:
  30. mountPath: /var/truenas/assets/gui/default/assets/img/logo-horizontal.svg
  31. subPath: logo-horizontal.svg
  32. {{- if not .Values.syncthingStorage.additionalStorages -}}
  33. {{- fail "Syncthing - Expected at least one additional storage defined" -}}
  34. {{- end -}}
  35. {{- range $idx, $storage := .Values.syncthingStorage.additionalStorages }}
  36. {{- if eq $storage.type "smb-pv-pvc" -}}
  37. {{- if $storage.smbConfig.migrationMode -}}
  38. {{- $_ := set $storage "readOnly" true -}}
  39. {{- $_ := set $storage.smbConfig "mountOptions" (list
  40. (dict "key" "noperm")
  41. (dict "key" "cifsacl")
  42. (dict "key" "vers" "value" "3.0")
  43. ) -}}
  44. {{- end -}}
  45. {{- end }}
  46. {{ printf "sync-%v" (int $idx) }}:
  47. enabled: true
  48. {{- include "ix.v1.common.app.storageOptions" (dict "storage" $storage) | nindent 4 }}
  49. targetSelector:
  50. syncthing:
  51. syncthing:
  52. mountPath: {{ $storage.mountPath }}
  53. {{- end }}
  54. {{- if .Values.syncthingNetwork.certificateID }}
  55. certs:
  56. enabled: true
  57. type: secret
  58. objectName: syncthing-cert
  59. defaultMode: "0600"
  60. items:
  61. - key: tls.key
  62. path: https-key.pem
  63. - key: tls.crt
  64. path: https-cert.pem
  65. targetSelector:
  66. syncthing:
  67. 01-certs:
  68. mountPath: /certs
  69. readOnly: true
  70. scaleCertificate:
  71. syncthing-cert:
  72. enabled: true
  73. id: {{ .Values.syncthingNetwork.certificateID }}
  74. {{- end -}}
  75. {{- end -}}