From 1775d51d22a82019ff96cf5a567ec854c28f4619 Mon Sep 17 00:00:00 2001 From: Mike K <2726746+mr-onion-2@users.noreply.github.com> Date: Tue, 2 Feb 2021 07:35:46 +0000 Subject: [PATCH] [Paperless] - Update chart to use the 'Paperless-ng' fork (#525) --- charts/paperless/Chart.yaml | 6 ++-- charts/paperless/README.md | 19 ++++++++---- charts/paperless/ci/ct-values.yaml | 4 --- charts/paperless/templates/NOTES.txt | 5 +++- charts/paperless/values.yaml | 45 +++++++++++----------------- 5 files changed, 38 insertions(+), 41 deletions(-) diff --git a/charts/paperless/Chart.yaml b/charts/paperless/Chart.yaml index 1a7f1a96..bc08fc69 100644 --- a/charts/paperless/Chart.yaml +++ b/charts/paperless/Chart.yaml @@ -1,14 +1,14 @@ apiVersion: v2 -appVersion: 2.7.0 +appVersion: 1.0.0 description: Paperless - Index and archive all of your scanned paper documents name: paperless -version: 2.3.1 +version: 3.0.0 keywords: - paperless home: https://github.com/k8s-at-home/charts/tree/master/charts/paperless icon: https://raw.githubusercontent.com/the-paperless-project/paperless/master/src/paperless/static/paperless/img/logo-dark.png sources: - - https://github.com/the-paperless-project/paperless + - https://github.com/jonaswinkler/paperless-ng maintainers: - name: mr-onion-2 dependencies: diff --git a/charts/paperless/README.md b/charts/paperless/README.md index 61ac203d..8c7b6646 100644 --- a/charts/paperless/README.md +++ b/charts/paperless/README.md @@ -1,6 +1,6 @@ # Paperless -This is a helm chart for [Paperless](https://github.com/the-paperless-project/paperless). The documentation can be found [here](https://paperless.readthedocs.io/en/latest/index.html). +This is a helm chart for [Paperless-ng](https://github.com/jonaswinkler/paperless-ng). The documentation can be found [here](https://paperless-ng.readthedocs.io/en/latest/). **This chart is not maintained by the upstream project and any issues with the chart should be raised [here](https://github.com/k8s-at-home/charts/issues/new/choose).** @@ -35,16 +35,23 @@ The chart's [values.yaml](https://github.com/k8s-at-home/charts/blob/master/char Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, ```console helm install paperless \ - --set env.TZ="America/New_York" \ + --set env.PAPERLESS_TIME_ZONE="America/New_York" \ k8s-at-home/paperless ``` Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example, ```console helm install paperless k8s-at-home/paperless --values values.yaml ``` +--- -## Backup & Restore -Documents can be exported and re-imported by running the following commands directly on the pod. [More info](https://paperless.readthedocs.io/en/latest/migrating.html). +## Upgrading an existing Release to a new major version -Backup: `/usr/src/paperless/src/manage.py document_exporter /path/to/somewhere/` -Restore: `/usr/src/paperless/src/manage.py document_importer /path/to/somewhere/` +A major chart version change (like 1.0.1 -> 2.0.0) indicates that there is an incompatible breaking change potentially needing manual actions. + +### Upgrading from 2.x.x to 3.x.x + +Version 3.0.0 of this chart has been adapted for [Paperless-ng](https://github.com/jonaswinkler/paperless-ng) (currently a fork of the main project). The default `values.yaml` has been updated accordingly. Changes include: + +* A new set of [environment variables](https://github.com/jonaswinkler/paperless-ng/blob/master/paperless.conf.example) +* New mouthPath defaults for the consume and export volumes +* Seperate consumer pod no longer required. \ No newline at end of file diff --git a/charts/paperless/ci/ct-values.yaml b/charts/paperless/ci/ct-values.yaml index 3428775c..3c93dee9 100644 --- a/charts/paperless/ci/ct-values.yaml +++ b/charts/paperless/ci/ct-values.yaml @@ -2,16 +2,12 @@ persistence: data: enabled: true emptyDir: true - mountPath: /usr/src/paperless/data media: enabled: true emptyDir: true - mountPath: /usr/src/paperless/media consume: enabled: true emptyDir: true - mountPath: /consume export: enabled: true emptyDir: true - mountPath: /export diff --git a/charts/paperless/templates/NOTES.txt b/charts/paperless/templates/NOTES.txt index a4b771eb..58de7156 100644 --- a/charts/paperless/templates/NOTES.txt +++ b/charts/paperless/templates/NOTES.txt @@ -1 +1,4 @@ -{{- include "common.notes.defaultNotes" . -}} \ No newline at end of file +{{- include "common.notes.defaultNotes" . }} +2. Create a super user by running the command: + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "common.names.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + kubectl exec -it --namespace {{ .Release.Namespace }} $POD_NAME -- bash -c "python manage.py createsuperuser" \ No newline at end of file diff --git a/charts/paperless/values.yaml b/charts/paperless/values.yaml index 32e524a3..046b095e 100644 --- a/charts/paperless/values.yaml +++ b/charts/paperless/values.yaml @@ -1,26 +1,23 @@ # Default values for Paperless. image: - repository: thepaperlessproject/paperless + repository: jonaswinkler/paperless-ng pullPolicy: IfNotPresent tag: latest -args: "['gunicorn', '-b', '0.0.0.0:8000']" - strategy: type: Recreate -# See the following files for supported environment variables -# https://github.com/the-paperless-project/paperless/blob/master/docker-compose.env.example -# https://github.com/the-paperless-project/paperless/blob/master/paperless.conf.example +# See the following files for additional environment variables +# https://github.com/jonaswinkler/paperless-ng/tree/master/docker/compose/ +# https://github.com/jonaswinkler/paperless-ng/blob/master/paperless.conf.example env: - # TZ: Europe/London - PAPERLESS_OCR_LANGUAGES: eng - # PAPERLESS_FORGIVING_OCR: true - # PAPERLESS_DISABLE_LOGIN: true - # PAPERLESS_INLINE_DOC: true - # PAPERLESS_OCR_THREADS: - # PAPERLESS_CONVERT_DENSITY: + COMPOSE_PROJECT_NAME: paperless + PAPERLESS_REDIS: redis://localhost:6379 + PAPERLESS_OCR_LANGUAGE: eng + # USERMAP_UID: 1000 + # USERMAP_GID: 1000 + # PAPERLESS_TIME_ZONE: Europe/London service: port: @@ -30,27 +27,21 @@ persistence: data: enabled: false mountPath: /usr/src/paperless/data + emptyDir: false media: enabled: false mountPath: /usr/src/paperless/media + emptyDir: false consume: enabled: false - mountPath: /consume + mountPath: /usr/src/paperless/consume + emptyDir: false export: enabled: false - mountPath: /export + mountPath: /usr/src/paperless/export + emptyDir: false additionalContainers: - - name: consumer - image: thepaperlessproject/paperless:latest + - name: broker + image: redis:6.0 imagePullPolicy: IfNotPresent - args: ['document_consumer'] - volumeMounts: - - mountPath: /usr/src/paperless/data - name: data - - mountPath: /usr/src/paperless/media - name: media - - mountPath: /consume - name: consume - - mountPath: /export - name: export