_persistence.tpl 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. {{- define "filebrowser.persistence" -}}
  2. {{- $configBasePath := "/config" }}
  3. persistence:
  4. config:
  5. enabled: true
  6. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.filebrowserStorage.config) | nindent 4 }}
  7. targetSelector:
  8. filebrowser:
  9. filebrowser:
  10. mountPath: {{ $configBasePath }}
  11. 02-init-config:
  12. mountPath: {{ $configBasePath }}
  13. {{- if and (eq .Values.filebrowserStorage.config.type "ixVolume")
  14. (not (.Values.filebrowserStorage.config.ixVolumeConfig | default dict).aclEnable) }}
  15. 01-permissions:
  16. mountPath: /mnt/directories/config
  17. {{- end }}
  18. {{- if not .Values.filebrowserStorage.additionalStorages -}}
  19. {{- fail "Filebrowser - Expected at least 1 additional storage" -}}
  20. {{- end -}}
  21. {{- range $idx, $storage := .Values.filebrowserStorage.additionalStorages }}
  22. {{- if not (hasPrefix "/" $storage.mountPath) -}}
  23. {{- fail (printf "Filebrowser - Expected [Mount Path] to start with [/], but got [%v]" $storage.mountPath) -}}
  24. {{- end }}
  25. {{ printf "filebrowser-%v:" (int $idx) }}
  26. enabled: true
  27. {{- include "ix.v1.common.app.storageOptions" (dict "storage" $storage) | nindent 4 }}
  28. targetSelector:
  29. filebrowser:
  30. filebrowser:
  31. mountPath: /data{{ $storage.mountPath }}
  32. {{- if and (eq $storage.type "ixVolume") (not ($storage.ixVolumeConfig | default dict).aclEnable) }}
  33. 01-permissions:
  34. mountPath: /mnt/directories{{ $storage.mountPath }}
  35. {{- end }}
  36. {{- end }}
  37. {{/* Certificate */}}
  38. {{- with .Values.filebrowserNetwork.certificateID }}
  39. cert:
  40. enabled: true
  41. type: secret
  42. objectName: filebrowser-cert
  43. defaultMode: "0600"
  44. items:
  45. - key: tls.key
  46. path: tls.key
  47. - key: tls.crt
  48. path: tls.crt
  49. targetSelector:
  50. filebrowser:
  51. filebrowser:
  52. mountPath: {{ $configBasePath }}/certs
  53. readOnly: true
  54. scaleCertificate:
  55. filebrowser-cert:
  56. enabled: true
  57. id: {{ . }}
  58. {{- end -}}
  59. {{- end -}}