Skip to content

Commit

Permalink
Merge pull request #483 from MoJo2600/master
Browse files Browse the repository at this point in the history
  • Loading branch information
pascaliske authored Feb 8, 2024
2 parents 471b6d8 + 5cb6045 commit ca9386b
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 0 deletions.
8 changes: 8 additions & 0 deletions charts/paperless/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ The following values can be used to adjust the helm chart.
| consumption.nfs | object | `{}` | NFS storage volume for the consumption directory. Only used if type equals `nfs`. |
| consumption.persistentVolumeClaim | object | `{}` | PersistentVolumeClaim for the consumption directory. Only used if type equals `pvc`. |
| consumption.type | string | `"hostPath"` | Type of the target volume for the consumption directory. Possible values are: `hostPath`, `pvc`, `csi`, `nfs`, `emptyDir`. |
| media.csi | object | `{}` | CSI storage volume for the media directory. Only used if type equals `csi`. |
| media.emptyDir | object | `{}` | Temporary emptyDir volume for the media directory. Only used if type equals `emptyDir` or is unknown. |
| media.enabled | bool | `true` | Enable the volume mount of a [media directory](https://docs.paperless-ngx.com/configuration/#paths-and-folders). |
| media.hostPath | object | `{}` | Host path volume for the media directory. Only used if type equals `hostPath`. |
| media.mountPath | string | `"/media"` | Mount path of the media directory inside the container. |
| media.nfs | object | `{}` | NFS storage volume for the media directory. Only used if type equals `nfs`. |
| media.persistentVolumeClaim | object | `{}` | PersistentVolumeClaim for the media directory. Only used if type equals `pvc`. |
| media.type | string | `"hostPath"` | Type of the target volume for the media directory. Possible values are: `hostPath`, `pvc`, `csi`, `nfs`, `emptyDir`. |
| controller.annotations | object | `{}` | Additional annotations for the controller object. |
| controller.enabled | bool | `true` | Create a workload for this chart. |
| controller.kind | string | `"Deployment"` | Type of the workload object. |
Expand Down
20 changes: 20 additions & 0 deletions charts/paperless/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,26 @@ Consumption enabled
{{- end }}
{{- end }}

{{/*
Media mount path
*/}}
{{- define "paperless.media.mountPath" -}}
{{- if .Values.media.enabled }}
{{- default "/media" .Values.media.mountPath }}
{{- end }}
{{- end }}

{{/*
Media enabled
*/}}
{{- define "paperless.media.enabled" -}}
{{- if and .Values.media.enabled (include "paperless.media.mountPath" . ) -}}
{{- printf "true" }}
{{- else }}
{{- printf "false" }}
{{- end }}
{{- end }}

{{/*
Export mount path
*/}}
Expand Down
12 changes: 12 additions & 0 deletions charts/paperless/templates/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ spec:
- name: PAPERLESS_CONSUMPTION_DIR
value: {{ include "paperless.consumption.mountPath" . }}
{{- end }}
{{- if eq (include "paperless.media.enabled" .) "true" }}
- name: PAPERLESS_MEDIA_ROOT
value: {{ include "paperless.media.mountPath" . }}
{{- end }}
{{- if eq (include "paperless.trash.enabled" .) "true" }}
- name: PAPERLESS_TRASH_DIR
value: {{ include "paperless.trash.mountPath" . }}
Expand Down Expand Up @@ -105,6 +109,10 @@ spec:
- name: consumption-volume
mountPath: {{ include "paperless.consumption.mountPath" . }}
{{- end }}
{{- if eq (include "paperless.media.enabled" .) "true" }}
- name: media-volume
mountPath: {{ include "paperless.media.mountPath" . }}
{{- end }}
{{- if eq (include "paperless.export.enabled" .) "true" }}
- name: export-volume
mountPath: {{ include "paperless.export.mountPath" . }}
Expand Down Expand Up @@ -143,6 +151,10 @@ spec:
{{- $_ := set .Values.consumption "name" "consumption-volume" -}}
{{- include "base.persistence.volumeSpec" .Values.consumption | nindent 8 }}
{{- end -}}
{{- if eq (include "paperless.media.enabled" .) "true" -}}
{{- $_ := set .Values.media "name" "media-volume" -}}
{{- include "base.persistence.volumeSpec" .Values.media | nindent 8 }}
{{- end -}}
{{- if eq (include "paperless.export.enabled" .) "true" -}}
{{- $_ := set .Values.export "name" "export-volume" -}}
{{- include "base.persistence.volumeSpec" .Values.export | nindent 8 }}
Expand Down
18 changes: 18 additions & 0 deletions charts/paperless/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,24 @@ consumption:
# -- Temporary emptyDir volume for the consumption directory. Only used if type equals `emptyDir` or is unknown.
emptyDir: {}

media:
# -- Enable the volume mount of a [media directory](https://docs.paperless-ngx.com/configuration/#paths-and-folders).
enabled: false
# -- Type of the target volume for the media directory. Possible values are: `hostPath`, `pvc`, `csi`, `nfs`, `emptyDir`.
type: hostPath
# -- Mount path of the media directory inside the container.
mountPath: /media
# -- Host path volume for the media directory. Only used if type equals `hostPath`.
hostPath: {}
# -- PersistentVolumeClaim for the media directory. Only used if type equals `pvc`.
persistentVolumeClaim: {}
# -- CSI storage volume for the media directory. Only used if type equals `csi`.
csi: {}
# -- NFS storage volume for the media directory. Only used if type equals `nfs`.
nfs: {}
# -- Temporary emptyDir volume for the media directory. Only used if type equals `emptyDir` or is unknown.
emptyDir: {}

export:
# -- Enable the volume mount of an export directory for [backups](https://docs.paperless-ngx.com/administration/#backup) using the [document exporter](https://docs.paperless-ngx.com/administration/#exporter).
enabled: true
Expand Down

0 comments on commit ca9386b

Please sign in to comment.