_persistence.tpl 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. {{- define "filebrowser.persistence" -}}
  2. {{- $configBasePath := "/config" }}
  3. persistence:
  4. config:
  5. enabled: true
  6. type: {{ .Values.filebrowserStorage.config.type }}
  7. datasetName: {{ .Values.filebrowserStorage.config.datasetName | default "" }}
  8. hostPath: {{ .Values.filebrowserStorage.config.hostPath | default "" }}
  9. targetSelector:
  10. filebrowser:
  11. filebrowser:
  12. mountPath: {{ $configBasePath }}
  13. 02-init-config:
  14. mountPath: {{ $configBasePath }}
  15. 01-permissions:
  16. mountPath: /mnt/directories/config
  17. {{- if not .Values.filebrowserStorage.additionalStorages -}}
  18. {{- fail "Filebrowser - Expected at least 1 additional storage" -}}
  19. {{- end -}}
  20. {{- range $idx, $storage := .Values.filebrowserStorage.additionalStorages }}
  21. {{- if not (hasPrefix "/" $storage.mountPath) -}}
  22. {{- fail (printf "Filebrowser - Expected [Mount Path] to start with [/], but got [%v]" $storage.mountPath) -}}
  23. {{- end }}
  24. {{ printf "filebrowser-%v" (int $idx) }}:
  25. {{- $size := "" -}}
  26. {{- if $storage.size -}}
  27. {{- $size = (printf "%vGi" $storage.size) -}}
  28. {{- end }}
  29. enabled: true
  30. type: {{ $storage.type }}
  31. datasetName: {{ $storage.datasetName | default "" }}
  32. hostPath: {{ $storage.hostPath | default "" }}
  33. server: {{ $storage.server | default "" }}
  34. share: {{ $storage.share | default "" }}
  35. domain: {{ $storage.domain | default "" }}
  36. username: {{ $storage.username | default "" }}
  37. password: {{ $storage.password | default "" }}
  38. size: {{ $size }}
  39. {{- if eq $storage.type "smb-pv-pvc" }}
  40. mountOptions:
  41. - key: noperm
  42. {{- end }}
  43. targetSelector:
  44. filebrowser:
  45. filebrowser:
  46. mountPath: /data{{ $storage.mountPath }}
  47. 01-permissions:
  48. mountPath: /mnt/directories{{ $storage.mountPath }}
  49. {{- end }}
  50. {{/* Certificate */}}
  51. {{- with .Values.filebrowserNetwork.certificateID }}
  52. cert:
  53. enabled: true
  54. type: secret
  55. objectName: filebrowser-cert
  56. defaultMode: "0600"
  57. items:
  58. - key: tls.key
  59. path: tls.key
  60. - key: tls.crt
  61. path: tls.crt
  62. targetSelector:
  63. filebrowser:
  64. filebrowser:
  65. mountPath: {{ $configBasePath }}/certs
  66. readOnly: true
  67. scaleCertificate:
  68. filebrowser-cert:
  69. enabled: true
  70. id: {{ . }}
  71. {{- end -}}
  72. {{- end -}}