_persistence.tpl 2.3 KB

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