From 75d2a3a45f880def28ec227e919cf253bc735d4a Mon Sep 17 00:00:00 2001
From: Trenton Holmes <797416+stumpylog@users.noreply.github.com>
Date: Tue, 24 Jan 2023 19:29:54 -0800
Subject: [PATCH 01/18] Moves back to the main release-drafter now that it does
what we wanted
---
.github/workflows/ci.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index d83b2a3a0..ac0b89611 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -500,7 +500,7 @@ jobs:
-
name: Create Release and Changelog
id: create-release
- uses: paperless-ngx/release-drafter@master
+ uses: release-drafter/release-drafter@v5
with:
name: Paperless-ngx ${{ steps.get_version.outputs.version }}
tag: ${{ steps.get_version.outputs.version }}
From a4535c11e46efdf638ad0800ab5f1fba237a2623 Mon Sep 17 00:00:00 2001
From: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Date: Wed, 25 Jan 2023 15:02:33 +0000
Subject: [PATCH 02/18] Changelog v1.12.0 - GHA
---
docs/changelog.md | 95 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 95 insertions(+)
diff --git a/docs/changelog.md b/docs/changelog.md
index 8253532c9..355d36ec1 100644
--- a/docs/changelog.md
+++ b/docs/changelog.md
@@ -1,5 +1,100 @@
# Changelog
+## paperless-ngx 1.12.0
+
+### Features
+
+- New document_exporter options [@mhelleboid](https://github.com/mhelleboid) ([#2448](https://github.com/paperless-ngx/paperless-ngx/pull/2448))
+- Read ASN from barcode on page [@peterkappelt](https://github.com/peterkappelt) ([#2437](https://github.com/paperless-ngx/paperless-ngx/pull/2437))
+- Add AppleMail color tag support [@clemensrieder](https://github.com/clemensrieder) ([#2407](https://github.com/paperless-ngx/paperless-ngx/pull/2407))
+- Feature: Retain original filename on upload [@stumpylog](https://github.com/stumpylog) ([#2404](https://github.com/paperless-ngx/paperless-ngx/pull/2404))
+- Feature: Control scheduled tasks via cron expressions [@stumpylog](https://github.com/stumpylog) ([#2403](https://github.com/paperless-ngx/paperless-ngx/pull/2403))
+- Simplify json parsing in build scripts [@tribut](https://github.com/tribut) ([#2370](https://github.com/paperless-ngx/paperless-ngx/pull/2370))
+- Feature: include comments in advanced search [@shamoon](https://github.com/shamoon) ([#2351](https://github.com/paperless-ngx/paperless-ngx/pull/2351))
+
+### Bug Fixes
+
+- Fix: limit asn integer size [@shamoon](https://github.com/shamoon) ([#2498](https://github.com/paperless-ngx/paperless-ngx/pull/2498))
+- Bugfix: Rescales images for better barcode locating [@stumpylog](https://github.com/stumpylog) ([#2468](https://github.com/paperless-ngx/paperless-ngx/pull/2468))
+- Fix: fix downgrade migration [@shamoon](https://github.com/shamoon) ([#2494](https://github.com/paperless-ngx/paperless-ngx/pull/2494))
+- Fix: Allow setting mailrule order from frontend [@shamoon](https://github.com/shamoon) ([#2459](https://github.com/paperless-ngx/paperless-ngx/pull/2459))
+- Fix: tag color ordering [@shamoon](https://github.com/shamoon) ([#2456](https://github.com/paperless-ngx/paperless-ngx/pull/2456))
+- Fix: Better Handle arbitrary ISO 8601 strings after celery serializing [@shamoon](https://github.com/shamoon) ([#2441](https://github.com/paperless-ngx/paperless-ngx/pull/2441))
+- Use correct canonical path for nltk_data [@amo13](https://github.com/amo13) ([#2429](https://github.com/paperless-ngx/paperless-ngx/pull/2429))
+- Fix: Include optional socket file in release [@stumpylog](https://github.com/stumpylog) ([#2409](https://github.com/paperless-ngx/paperless-ngx/pull/2409))
+- Fix: display rtl content in correct direction [@shamoon](https://github.com/shamoon) ([#2302](https://github.com/paperless-ngx/paperless-ngx/pull/2302))
+- Fixed endpoint count in Docs The REST API [@PascalSenn](https://github.com/PascalSenn) ([#2386](https://github.com/paperless-ngx/paperless-ngx/pull/2386))
+- Fix subpath for websockets [@tribut](https://github.com/tribut) ([#2371](https://github.com/paperless-ngx/paperless-ngx/pull/2371))
+- Fix: Make missing environment from file files informational only [@stumpylog](https://github.com/stumpylog) ([#2368](https://github.com/paperless-ngx/paperless-ngx/pull/2368))
+- Bugfix: Backend tests weren't using correct Python version [@stumpylog](https://github.com/stumpylog) ([#2363](https://github.com/paperless-ngx/paperless-ngx/pull/2363))
+- Fix: preview content remains hidden on mobile [@shamoon](https://github.com/shamoon) ([#2346](https://github.com/paperless-ngx/paperless-ngx/pull/2346))
+- Bugfix: Removal of alpha channel truncates multipage TIFFs [@stumpylog](https://github.com/stumpylog) ([#2335](https://github.com/paperless-ngx/paperless-ngx/pull/2335))
+- Documentation: update build instructions to remove deprecated [@shamoon](https://github.com/shamoon) ([#2334](https://github.com/paperless-ngx/paperless-ngx/pull/2334))
+
+### Documentation
+
+- Docs: Fix typo - docker-compose.yml file name in setup doc [@muli](https://github.com/muli) ([#2477](https://github.com/paperless-ngx/paperless-ngx/pull/2477))
+- document existence of document_thumbnails [@frrad](https://github.com/frrad) ([#2470](https://github.com/paperless-ngx/paperless-ngx/pull/2470))
+- Add optional sudo command to bare metal docs [@shamoon](https://github.com/shamoon) ([#2464](https://github.com/paperless-ngx/paperless-ngx/pull/2464))
+- Fix link [@edenhaus](https://github.com/edenhaus) ([#2458](https://github.com/paperless-ngx/paperless-ngx/pull/2458))
+- Documentation: Fix comment re bare metal runserver command [@shamoon](https://github.com/shamoon) ([#2420](https://github.com/paperless-ngx/paperless-ngx/pull/2420))
+- Fix formatting of config variable in docs [@peterkappelt](https://github.com/peterkappelt) ([#2445](https://github.com/paperless-ngx/paperless-ngx/pull/2445))
+- Update docs nginx reverse proxy example [@Sprinterfreak](https://github.com/Sprinterfreak) ([#2443](https://github.com/paperless-ngx/paperless-ngx/pull/2443))
+- [Documentation] Add note re for dev server [@shamoon](https://github.com/shamoon) ([#2387](https://github.com/paperless-ngx/paperless-ngx/pull/2387))
+- Fixed endpoint count in Docs The REST API [@PascalSenn](https://github.com/PascalSenn) ([#2386](https://github.com/paperless-ngx/paperless-ngx/pull/2386))
+- [ Docs] Update bare metal setup instructions [@natrius](https://github.com/natrius) ([#2281](https://github.com/paperless-ngx/paperless-ngx/pull/2281))
+- [Docs] Add Paperless Mobile app to docs [@astubenbord](https://github.com/astubenbord) ([#2378](https://github.com/paperless-ngx/paperless-ngx/pull/2378))
+- Tiny spelling change [@veverkap](https://github.com/veverkap) ([#2369](https://github.com/paperless-ngx/paperless-ngx/pull/2369))
+- Documentation: update build instructions to remove deprecated [@shamoon](https://github.com/shamoon) ([#2334](https://github.com/paperless-ngx/paperless-ngx/pull/2334))
+- [Documentation] Add note that PAPERLESS_URL cant contain a path [@shamoon](https://github.com/shamoon) ([#2319](https://github.com/paperless-ngx/paperless-ngx/pull/2319))
+- [Documentation] Add v1.11.3 changelog [@github-actions](https://github.com/github-actions) ([#2311](https://github.com/paperless-ngx/paperless-ngx/pull/2311))
+
+### Maintenance
+
+- Fix: Include optional socket file in release [@stumpylog](https://github.com/stumpylog) ([#2409](https://github.com/paperless-ngx/paperless-ngx/pull/2409))
+- Chore: remove helm chart code [@shamoon](https://github.com/shamoon) ([#2388](https://github.com/paperless-ngx/paperless-ngx/pull/2388))
+- Simplify json parsing in build scripts [@tribut](https://github.com/tribut) ([#2370](https://github.com/paperless-ngx/paperless-ngx/pull/2370))
+- Bugfix: Backend tests weren't using correct Python version [@stumpylog](https://github.com/stumpylog) ([#2363](https://github.com/paperless-ngx/paperless-ngx/pull/2363))
+- Bump tj-actions/changed-files from 34 to 35 [@dependabot](https://github.com/dependabot) ([#2303](https://github.com/paperless-ngx/paperless-ngx/pull/2303))
+
+### Dependencies
+
+4 changes
+
+- Chore: Backend library updates [@stumpylog](https://github.com/stumpylog) ([#2401](https://github.com/paperless-ngx/paperless-ngx/pull/2401))
+- Bump tj-actions/changed-files from 34 to 35 [@dependabot](https://github.com/dependabot) ([#2303](https://github.com/paperless-ngx/paperless-ngx/pull/2303))
+- Bump [@typescript-eslint/parser from 5.43.0 to 5.47.1 in /src-ui @dependabot](https://github.com/typescript-eslint/parser from 5.43.0 to 5.47.1 in /src-ui @dependabot) ([#2306](https://github.com/paperless-ngx/paperless-ngx/pull/2306))
+- Bump [@typescript-eslint/eslint-plugin from 5.43.0 to 5.47.1 in /src-ui @dependabot](https://github.com/typescript-eslint/eslint-plugin from 5.43.0 to 5.47.1 in /src-ui @dependabot) ([#2308](https://github.com/paperless-ngx/paperless-ngx/pull/2308))
+
-
+
From 92fb390f7baf5e88290062f31cba0804e4dd5d8e Mon Sep 17 00:00:00 2001
From: Trenton H <797416+stumpylog@users.noreply.github.com>
Date: Wed, 25 Jan 2023 12:18:29 -0800
Subject: [PATCH 05/18] Bumps version to 1.12.1
---
src-ui/src/environments/environment.prod.ts | 2 +-
src/paperless/version.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src-ui/src/environments/environment.prod.ts b/src-ui/src/environments/environment.prod.ts
index 23c9a0755..832f69378 100644
--- a/src-ui/src/environments/environment.prod.ts
+++ b/src-ui/src/environments/environment.prod.ts
@@ -5,7 +5,7 @@ export const environment = {
apiBaseUrl: document.baseURI + 'api/',
apiVersion: '2',
appTitle: 'Paperless-ngx',
- version: '1.12.0-dev',
+ version: '1.12.1',
webSocketHost: window.location.host,
webSocketProtocol: window.location.protocol == 'https:' ? 'wss:' : 'ws:',
webSocketBaseUrl: base_url.pathname + 'ws/',
diff --git a/src/paperless/version.py b/src/paperless/version.py
index ea81fac54..36569e2e5 100644
--- a/src/paperless/version.py
+++ b/src/paperless/version.py
@@ -1,7 +1,7 @@
from typing import Final
from typing import Tuple
-__version__: Final[Tuple[int, int, int]] = (1, 12, 0)
+__version__: Final[Tuple[int, int, int]] = (1, 12, 1)
# Version string like X.Y.Z
__full_version_str__: Final[str] = ".".join(map(str, __version__))
# Version string like X.Y
From c430b9f8cf5e57cc8bc819d66b97a4cb99196f16 Mon Sep 17 00:00:00 2001
From: Trenton H <797416+stumpylog@users.noreply.github.com>
Date: Wed, 25 Jan 2023 12:29:57 -0800
Subject: [PATCH 06/18] Resets version to -dev tagging
---
src-ui/src/environments/environment.prod.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src-ui/src/environments/environment.prod.ts b/src-ui/src/environments/environment.prod.ts
index 832f69378..16cbe7df6 100644
--- a/src-ui/src/environments/environment.prod.ts
+++ b/src-ui/src/environments/environment.prod.ts
@@ -5,7 +5,7 @@ export const environment = {
apiBaseUrl: document.baseURI + 'api/',
apiVersion: '2',
appTitle: 'Paperless-ngx',
- version: '1.12.1',
+ version: '1.12.1-dev',
webSocketHost: window.location.host,
webSocketProtocol: window.location.protocol == 'https:' ? 'wss:' : 'ws:',
webSocketBaseUrl: base_url.pathname + 'ws/',
From 6ea6c795759900fce53b0bf3ae44e0343aa61cc0 Mon Sep 17 00:00:00 2001
From: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Date: Wed, 25 Jan 2023 21:02:01 +0000
Subject: [PATCH 07/18] Changelog v1.12.1 - GHA
---
docs/changelog.md | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/docs/changelog.md b/docs/changelog.md
index 355d36ec1..0e5a6fcba 100644
--- a/docs/changelog.md
+++ b/docs/changelog.md
@@ -1,5 +1,25 @@
# Changelog
+## paperless-ngx 1.12.1
+
+### Bug Fixes
+
+- Fix: comments not showing in search until after manual reindex in v1.12 [@shamoon](https://github.com/shamoon) ([#2513](https://github.com/paperless-ngx/paperless-ngx/pull/2513))
+- Fix: date range search broken in 1.12 [@shamoon](https://github.com/shamoon) ([#2509](https://github.com/paperless-ngx/paperless-ngx/pull/2509))
+
+### Documentation
+
+- [Documentation] Add v1.12.0 changelog [@github-actions](https://github.com/github-actions) ([#2507](https://github.com/paperless-ngx/paperless-ngx/pull/2507))
+
+### Maintenance
+
+- Moves back to the main release-drafter now that it does what we wanted [@stumpylog](https://github.com/stumpylog) ([#2503](https://github.com/paperless-ngx/paperless-ngx/pull/2503))
+
+### All App Changes
+
+- Fix: comments not showing in search until after manual reindex in v1.12 [@shamoon](https://github.com/shamoon) ([#2513](https://github.com/paperless-ngx/paperless-ngx/pull/2513))
+- Fix: date range search broken in 1.12 [@shamoon](https://github.com/shamoon) ([#2509](https://github.com/paperless-ngx/paperless-ngx/pull/2509))
+
## paperless-ngx 1.12.0
### Features
From e625ac21c33c50b4abe44ad2c06ec0a32c8cbe7c Mon Sep 17 00:00:00 2001
From: Michael Shamoon <4887959+shamoon@users.noreply.github.com>
Date: Wed, 25 Jan 2023 20:27:18 -0800
Subject: [PATCH 08/18] Update index version to force reindex, note in release
notes
---
docker/docker-prepare.sh | 2 +-
docs/changelog.md | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/docker/docker-prepare.sh b/docker/docker-prepare.sh
index dad49774b..af2bfe2a7 100755
--- a/docker/docker-prepare.sh
+++ b/docker/docker-prepare.sh
@@ -80,7 +80,7 @@ django_checks() {
search_index() {
- local -r index_version=1
+ local -r index_version=2
local -r index_version_file=${DATA_DIR}/.index_version
if [[ (! -f "${index_version_file}") || $(<"${index_version_file}") != "$index_version" ]]; then
diff --git a/docs/changelog.md b/docs/changelog.md
index 0e5a6fcba..5a9371781 100644
--- a/docs/changelog.md
+++ b/docs/changelog.md
@@ -2,6 +2,9 @@
## paperless-ngx 1.12.1
+_Note: Version 1.12.x introduced searching of comments which will work for comments added after the upgrade but a reindex of the search index is required in order to be able to search
+older comments. The Docker image will automatically perform this reindex, bare metal installations will have to perform this manually, see [the docs](https://docs.paperless-ngx.com/administration/#index)._
+
### Bug Fixes
- Fix: comments not showing in search until after manual reindex in v1.12 [@shamoon](https://github.com/shamoon) ([#2513](https://github.com/paperless-ngx/paperless-ngx/pull/2513))
From f1204d2749bc5b783edaebb722eeacacfdedb9b8 Mon Sep 17 00:00:00 2001
From: Trenton H <797416+stumpylog@users.noreply.github.com>
Date: Wed, 25 Jan 2023 08:09:35 -0800
Subject: [PATCH 09/18] Updates the installer library to be static in the final
image, saving the installers into Git and curl-ing the correct revision
---
.github/workflows/ci.yml | 6 -
.github/workflows/installer-library.yml | 139 ++++++++++++++++++++++++
Dockerfile | 53 ++++-----
docker-builders/Dockerfile.jbig2enc | 15 ++-
docker-builders/Dockerfile.pikepdf | 22 +++-
docker-builders/Dockerfile.psycopg2 | 18 ++-
docker-builders/README.md | 51 +++++++++
7 files changed, 263 insertions(+), 41 deletions(-)
create mode 100644 docker-builders/README.md
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index ac0b89611..adf03d4bb 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -212,12 +212,6 @@ jobs:
name: Prepare Docker Pipeline Data
if: github.event_name == 'push' && (startsWith(github.ref, 'refs/heads/feature-') || github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/beta' || contains(github.ref, 'beta.rc') || startsWith(github.ref, 'refs/tags/v'))
runs-on: ubuntu-22.04
- # If the push triggered the installer library workflow, wait for it to
- # complete here. This ensures the required versions for the final
- # image have been built, while not waiting at all if the versions haven't changed
- concurrency:
- group: build-installer-library
- cancel-in-progress: false
needs:
- documentation
- tests-backend
diff --git a/.github/workflows/installer-library.yml b/.github/workflows/installer-library.yml
index 32aaf85ee..56064ad86 100644
--- a/.github/workflows/installer-library.yml
+++ b/.github/workflows/installer-library.yml
@@ -169,3 +169,142 @@ jobs:
PIKEPDF_VERSION=${{ fromJSON(needs.prepare-docker-build.outputs.pikepdf-json).version }}
PILLOW_VERSION=${{ needs.prepare-docker-build.outputs.pillow-version }}
LXML_VERSION=${{ needs.prepare-docker-build.outputs.lxml-version }}
+
+ commit-binary-files:
+ name: Store installers
+ needs:
+ - prepare-docker-build
+ - build-qpdf-debs
+ - build-jbig2enc
+ - build-psycopg2-wheel
+ - build-pikepdf-wheel
+ runs-on: ubuntu-22.04
+ steps:
+ -
+ name: Checkout
+ uses: actions/checkout@v3
+ with:
+ ref: binary-library
+ -
+ name: Set up Python
+ uses: actions/setup-python@v4
+ with:
+ python-version: "3.9"
+ -
+ name: Install system dependencies
+ run: |
+ sudo apt-get update -qq
+ sudo apt-get install -qq --no-install-recommends tree
+ -
+ name: Extract qpdf files
+ run: |
+ version=${{ fromJSON(needs.prepare-docker-build.outputs.qpdf-json).version }}
+ tag=${{ fromJSON(needs.prepare-docker-build.outputs.qpdf-json).image_tag }}
+
+ docker pull --quiet ${tag}
+ docker create --name qpdf-extract ${tag}
+
+ mkdir --parents qpdf/${version}/amd64
+ docker cp qpdf-extract:/usr/src/qpdf/${version}/amd64 qpdf/${version}
+
+ mkdir --parents qpdf/${version}/arm64
+ docker cp qpdf-extract:/usr/src/qpdf/${version}/arm64 qpdf/${version}
+
+ mkdir --parents qpdf/${version}/armv7
+ docker cp qpdf-extract:/usr/src/qpdf/${version}/armv7 qpdf/${version}
+ -
+ name: Extract psycopg2 files
+ run: |
+ version=${{ fromJSON(needs.prepare-docker-build.outputs.psycopg2-json).version }}
+ tag=${{ fromJSON(needs.prepare-docker-build.outputs.psycopg2-json).image_tag }}
+
+ docker pull --quiet --platform linux/amd64 ${tag}
+ docker create --platform linux/amd64 --name psycopg2-extract ${tag}
+ mkdir --parents psycopg2/${version}/amd64
+ docker cp psycopg2-extract:/usr/src/wheels/ psycopg2/${version}/amd64
+ mv psycopg2/${version}/amd64/wheels/* psycopg2/${version}/amd64
+ rm -r psycopg2/${version}/amd64/wheels/
+ docker rm psycopg2-extract
+
+ docker pull --quiet --platform linux/arm64 ${tag}
+ docker create --platform linux/arm64 --name psycopg2-extract ${tag}
+ mkdir --parents psycopg2/${version}/arm64
+ docker cp psycopg2-extract:/usr/src/wheels/ psycopg2/${version}/arm64
+ mv psycopg2/${version}/arm64/wheels/* psycopg2/${version}/arm64
+ rm -r psycopg2/${version}/arm64/wheels/
+ docker rm psycopg2-extract
+
+ docker pull --quiet --platform linux/arm/v7 ${tag}
+ docker create --platform linux/arm/v7 --name psycopg2-extract ${tag}
+ mkdir --parents psycopg2/${version}/armv7
+ docker cp psycopg2-extract:/usr/src/wheels/ psycopg2/${version}/armv7
+ mv psycopg2/${version}/armv7/wheels/* psycopg2/${version}/armv7
+ rm -r psycopg2/${version}/armv7/wheels/
+ docker rm psycopg2-extract
+ -
+ name: Extract pikepdf files
+ run: |
+ version=${{ fromJSON(needs.prepare-docker-build.outputs.pikepdf-json).version }}
+ tag=${{ fromJSON(needs.prepare-docker-build.outputs.pikepdf-json).image_tag }}
+
+ docker pull --quiet --platform linux/amd64 ${tag}
+ docker create --platform linux/amd64 --name pikepdf-extract ${tag}
+ mkdir --parents pikepdf/${version}/amd64
+ docker cp pikepdf-extract:/usr/src/wheels/ pikepdf/${version}/amd64
+ mv pikepdf/${version}/amd64/wheels/* pikepdf/${version}/amd64
+ rm -r pikepdf/${version}/amd64/wheels/
+ docker rm pikepdf-extract
+
+ docker pull --quiet --platform linux/arm64 ${tag}
+ docker create --platform linux/arm64 --name pikepdf-extract ${tag}
+ mkdir --parents pikepdf/${version}/arm64
+ docker cp pikepdf-extract:/usr/src/wheels/ pikepdf/${version}/arm64
+ mv pikepdf/${version}/arm64/wheels/* pikepdf/${version}/arm64
+ rm -r pikepdf/${version}/arm64/wheels/
+ docker rm pikepdf-extract
+
+ docker pull --quiet --platform linux/arm/v7 ${tag}
+ docker create --platform linux/arm/v7 --name pikepdf-extract ${tag}
+ mkdir --parents pikepdf/${version}/armv7
+ docker cp pikepdf-extract:/usr/src/wheels/ pikepdf/${version}/armv7
+ mv pikepdf/${version}/armv7/wheels/* pikepdf/${version}/armv7
+ rm -r pikepdf/${version}/armv7/wheels/
+ docker rm pikepdf-extract
+ -
+ name: Extract jbig2enc files
+ run: |
+ version=${{ fromJSON(needs.prepare-docker-build.outputs.jbig2enc-json).version }}
+ tag=${{ fromJSON(needs.prepare-docker-build.outputs.jbig2enc-json).image_tag }}
+
+ docker pull --quiet --platform linux/amd64 ${tag}
+ docker create --platform linux/amd64 --name jbig2enc-extract ${tag}
+ mkdir --parents jbig2enc/${version}/amd64
+ docker cp jbig2enc-extract:/usr/src/jbig2enc/build jbig2enc/${version}/amd64/
+ mv jbig2enc/${version}/amd64/build/* jbig2enc/${version}/amd64/
+ docker rm jbig2enc-extract
+
+ docker pull --quiet --platform linux/arm64 ${tag}
+ docker create --platform linux/arm64 --name jbig2enc-extract ${tag}
+ mkdir --parents jbig2enc/${version}/arm64
+ docker cp jbig2enc-extract:/usr/src/jbig2enc/build jbig2enc/${version}/arm64
+ mv jbig2enc/${version}/arm64/build/* jbig2enc/${version}/arm64/
+ docker rm jbig2enc-extract
+
+ docker pull --quiet --platform linux/arm/v7 ${tag}
+ docker create --platform linux/arm/v7 --name jbig2enc-extract ${tag}
+ mkdir --parents jbig2enc/${version}/armv7
+ docker cp jbig2enc-extract:/usr/src/jbig2enc/build jbig2enc/${version}/armv7
+ mv jbig2enc/${version}/armv7/build/* jbig2enc/${version}/armv7/
+ docker rm jbig2enc-extract
+ -
+ name: Show file structure
+ run: |
+ tree .
+ -
+ name: Commit files
+ run: |
+ git config --global user.name "github-actions"
+ git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
+ git add pikepdf/ qpdf/ psycopg2/ jbig2enc/
+ git commit -m "Updating installer packages" || true
+ git push origin || true
diff --git a/Dockerfile b/Dockerfile
index 9522728d9..6588802bb 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,19 +1,5 @@
# syntax=docker/dockerfile:1.4
-# Pull the installer images from the library
-# These are all built previously
-# They provide either a .deb or .whl
-
-ARG JBIG2ENC_VERSION
-ARG QPDF_VERSION
-ARG PIKEPDF_VERSION
-ARG PSYCOPG2_VERSION
-
-FROM ghcr.io/paperless-ngx/paperless-ngx/builder/jbig2enc:${JBIG2ENC_VERSION} as jbig2enc-builder
-FROM --platform=$BUILDPLATFORM ghcr.io/paperless-ngx/paperless-ngx/builder/qpdf:${QPDF_VERSION} as qpdf-builder
-FROM ghcr.io/paperless-ngx/paperless-ngx/builder/pikepdf:${PIKEPDF_VERSION} as pikepdf-builder
-FROM ghcr.io/paperless-ngx/paperless-ngx/builder/psycopg2:${PSYCOPG2_VERSION} as psycopg2-builder
-
FROM --platform=$BUILDPLATFORM node:16-bullseye-slim AS compile-frontend
# This stage compiles the frontend
@@ -58,24 +44,21 @@ LABEL org.opencontainers.image.url="https://github.com/paperless-ngx/paperless-n
LABEL org.opencontainers.image.licenses="GPL-3.0-only"
ARG DEBIAN_FRONTEND=noninteractive
-# Buildx provided
+# Buildx provided, must be defined to use though
ARG TARGETARCH
ARG TARGETVARIANT
# Workflow provided
+ARG JBIG2ENC_VERSION
ARG QPDF_VERSION
+ARG PIKEPDF_VERSION
+ARG PSYCOPG2_VERSION
#
# Begin installation and configuration
# Order the steps below from least often changed to most
#
-# copy jbig2enc
-# Basically will never change again
-COPY --from=jbig2enc-builder /usr/src/jbig2enc/src/.libs/libjbig2enc* /usr/local/lib/
-COPY --from=jbig2enc-builder /usr/src/jbig2enc/src/jbig2 /usr/local/bin/
-COPY --from=jbig2enc-builder /usr/src/jbig2enc/src/*.h /usr/local/include/
-
# Packages need for running
ARG RUNTIME_PACKAGES="\
# Python
@@ -198,19 +181,29 @@ RUN set -eux \
# Install the built packages from the installer library images
# Use mounts to avoid copying installer files into the image
# These change sometimes
-RUN --mount=type=bind,from=qpdf-builder,target=/qpdf \
- --mount=type=bind,from=psycopg2-builder,target=/psycopg2 \
- --mount=type=bind,from=pikepdf-builder,target=/pikepdf \
- set -eux \
+RUN set -eux \
+ && echo "Getting binaries" \
+ && mkdir paperless-ngx \
+ && curl --fail --silent --show-error --output paperless-ngx.tar.gz --location https://github.com/paperless-ngx/paperless-ngx/archive/41d6e7e407af09a0882736d50c89b6e015997bff.tar.gz \
+ && tar -xf paperless-ngx.tar.gz --directory paperless-ngx --strip-components=1 \
+ && cd paperless-ngx \
+ # Setting a specific revision ensures we know what this installed
+ # and ensures cache breaking on changes
+ && echo "Installing jbig2enc" \
+ && cp ./jbig2enc/${JBIG2ENC_VERSION}/${TARGETARCH}${TARGETVARIANT}/jbig2 /usr/local/bin/ \
+ && cp ./jbig2enc/${JBIG2ENC_VERSION}/${TARGETARCH}${TARGETVARIANT}/libjbig2enc* /usr/local/lib/ \
&& echo "Installing qpdf" \
- && apt-get install --yes --no-install-recommends /qpdf/usr/src/qpdf/${QPDF_VERSION}/${TARGETARCH}${TARGETVARIANT}/libqpdf29_*.deb \
- && apt-get install --yes --no-install-recommends /qpdf/usr/src/qpdf/${QPDF_VERSION}/${TARGETARCH}${TARGETVARIANT}/qpdf_*.deb \
+ && apt-get install --yes --no-install-recommends ./qpdf/${QPDF_VERSION}/${TARGETARCH}${TARGETVARIANT}/libqpdf29_*.deb \
+ && apt-get install --yes --no-install-recommends ./qpdf/${QPDF_VERSION}/${TARGETARCH}${TARGETVARIANT}/qpdf_*.deb \
&& echo "Installing pikepdf and dependencies" \
- && python3 -m pip install --no-cache-dir /pikepdf/usr/src/wheels/*.whl \
+ && python3 -m pip install --no-cache-dir ./pikepdf/${PIKEPDF_VERSION}/${TARGETARCH}${TARGETVARIANT}/*.whl \
&& python3 -m pip list \
&& echo "Installing psycopg2" \
- && python3 -m pip install --no-cache-dir /psycopg2/usr/src/wheels/psycopg2*.whl \
- && python3 -m pip list
+ && python3 -m pip install --no-cache-dir ./psycopg2/${PSYCOPG2_VERSION}/${TARGETARCH}${TARGETVARIANT}/psycopg2*.whl \
+ && python3 -m pip list \
+ && echo "Cleaning up image layer" \
+ && cd ../ \
+ && rm -rf paperless-ngx
WORKDIR /usr/src/paperless/src/
diff --git a/docker-builders/Dockerfile.jbig2enc b/docker-builders/Dockerfile.jbig2enc
index 90318084f..388bdd1f7 100644
--- a/docker-builders/Dockerfile.jbig2enc
+++ b/docker-builders/Dockerfile.jbig2enc
@@ -29,7 +29,20 @@ RUN set -eux \
&& ./autogen.sh \
&& ./configure \
&& make \
+ && echo "Gathering package data" \
+ && dpkg-query -f '${Package;-40}${Version}\n' -W > ./pkg-list.txt \
&& echo "Cleaning up image" \
&& apt-get -y purge ${BUILD_PACKAGES} \
&& apt-get -y autoremove --purge \
- && rm -rf /var/lib/apt/lists/*
+ && rm -rf /var/lib/apt/lists/* \
+ && echo "Moving files around" \
+ && mkdir build \
+ # Unlink a symlink that causes problems
+ && unlink ./src/.libs/libjbig2enc.la \
+ # Move what the link pointed to
+ && mv ./src/libjbig2enc.la ./build/ \
+ # Move the shared library .so files
+ && mv ./src/.libs/libjbig2enc* ./build/ \
+ # And move the cli binary
+ && mv ./src/jbig2 ./build/ \
+ && mv ./pkg-list.txt ./build/
diff --git a/docker-builders/Dockerfile.pikepdf b/docker-builders/Dockerfile.pikepdf
index c4d1ee1dc..e4181c538 100644
--- a/docker-builders/Dockerfile.pikepdf
+++ b/docker-builders/Dockerfile.pikepdf
@@ -7,12 +7,17 @@
# Default to pulling from the main repo registry when manually building
ARG REPO="paperless-ngx/paperless-ngx"
+# This does nothing, except provide a name for a copy below
ARG QPDF_VERSION
FROM --platform=$BUILDPLATFORM ghcr.io/${REPO}/builder/qpdf:${QPDF_VERSION} as qpdf-builder
-# This does nothing, except provide a name for a copy below
-
-FROM python:3.9-slim-bullseye as main
+#
+# Stage: builder
+# Purpose:
+# - Build the pikepdf wheel
+# - Build any dependent wheels which can't be found
+#
+FROM python:3.9-slim-bullseye as builder
LABEL org.opencontainers.image.description="A intermediate image with pikepdf wheel built"
@@ -100,3 +105,14 @@ RUN set -eux \
&& apt-get -y purge ${BUILD_PACKAGES} \
&& apt-get -y autoremove --purge \
&& rm -rf /var/lib/apt/lists/*
+
+#
+# Stage: package
+# Purpose: Holds the compiled .whl files in a tiny image to pull
+#
+FROM alpine:3.17 as package
+
+WORKDIR /usr/src/wheels/
+
+COPY --from=builder /usr/src/wheels/*.whl ./
+COPY --from=builder /usr/src/wheels/pkg-list.txt ./
diff --git a/docker-builders/Dockerfile.psycopg2 b/docker-builders/Dockerfile.psycopg2
index 8fcf5264b..e3f182435 100644
--- a/docker-builders/Dockerfile.psycopg2
+++ b/docker-builders/Dockerfile.psycopg2
@@ -2,7 +2,12 @@
# Inputs:
# - PSYCOPG2_VERSION - Version to build
-FROM python:3.9-slim-bullseye as main
+#
+# Stage: builder
+# Purpose:
+# - Build the psycopg2 wheel
+#
+FROM python:3.9-slim-bullseye as builder
LABEL org.opencontainers.image.description="A intermediate image with psycopg2 wheel built"
@@ -48,3 +53,14 @@ RUN set -eux \
&& apt-get -y purge ${BUILD_PACKAGES} \
&& apt-get -y autoremove --purge \
&& rm -rf /var/lib/apt/lists/*
+
+#
+# Stage: package
+# Purpose: Holds the compiled .whl files in a tiny image to pull
+#
+FROM alpine:3.17 as package
+
+WORKDIR /usr/src/wheels/
+
+COPY --from=builder /usr/src/wheels/*.whl ./
+COPY --from=builder /usr/src/wheels/pkg-list.txt ./
diff --git a/docker-builders/README.md b/docker-builders/README.md
new file mode 100644
index 000000000..14e684ccf
--- /dev/null
+++ b/docker-builders/README.md
@@ -0,0 +1,51 @@
+# Installer Library
+
+This folder contains the Dockerfiles for building certain installers or libraries, which are then pulled into the main image.
+
+## [jbig2enc](https://github.com/agl/jbig2enc)
+
+### Why
+
+JBIG is an image coding which can achieve better compression of images for PDFs.
+
+### What
+
+The Docker image builds a shared library file and utility, which is copied into the correct location in the final image.
+
+See Also:
+
+- [OCRMyPDF Documentation](https://ocrmypdf.readthedocs.io/en/latest/jbig2.html)
+
+## [psycopg2](https://www.psycopg.org/)
+
+### Why
+
+The pre-built wheels of psycopg2 are built on Debian 9, which provides a quite old version of libpq-dev. This causes issue with authentication methods.
+
+### What
+
+The image builds psycopg2 wheels on Debian 10 and places the produced wheels into `/usr/src/wheels/`.
+
+See Also:
+
+- [Issue 266](https://github.com/paperless-ngx/paperless-ngx/issues/266)
+
+## [qpdf](https://qpdf.readthedocs.io/en/stable/index.html)
+
+### Why
+
+qpdf and it's library provide tools to read, manipulate and fix up PDFs. Version 11 is also required by `pikepdf` 6+ and Debian 9 does not provide above version 10.
+
+### What
+
+The Docker image cross compiles .deb installers for each supported architecture of the main image. The installers are placed in `/usr/src/qpdf/${QPDF_VERSION}/${TARGETARCH}${TARGETVARIANT}/`
+
+## [pikepdf](https://pikepdf.readthedocs.io/en/latest/)
+
+### Why
+
+Required by OCRMyPdf, this is a general purpose library for PDF manipulation in Python via the qpdf libraries.
+
+### What
+
+The built wheels are placed into `/usr/src/wheels/`
From 8fcb7efbd2087154d20fad3e43c918c827c8ac76 Mon Sep 17 00:00:00 2001
From: Trenton Holmes <797416+stumpylog@users.noreply.github.com>
Date: Wed, 25 Jan 2023 20:00:30 -0800
Subject: [PATCH 10/18] Adds some basic steps for updating
---
docker-builders/README.md | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/docker-builders/README.md b/docker-builders/README.md
index 14e684ccf..6202719c6 100644
--- a/docker-builders/README.md
+++ b/docker-builders/README.md
@@ -12,6 +12,12 @@ JBIG is an image coding which can achieve better compression of images for PDFs.
The Docker image builds a shared library file and utility, which is copied into the correct location in the final image.
+### Updating
+
+1. Ensure the given qpdf version is present in [Debian bookworm](https://packages.debian.org/bookworm/qpdf)
+2. Update `.build-config.json` to the given version
+3. If the Debian specific version has incremented, update `Dockerfile.qpdf`
+
See Also:
- [OCRMyPDF Documentation](https://ocrmypdf.readthedocs.io/en/latest/jbig2.html)
From 590d129cd3c1226db4bd866db93aacff918cbdba Mon Sep 17 00:00:00 2001
From: Michael Shamoon <4887959+shamoon@users.noreply.github.com>
Date: Fri, 27 Jan 2023 09:36:54 -0800
Subject: [PATCH 11/18] Fix typo, update translation strings
---
src-ui/messages.xlf | 645 +++++++++---------
.../manage/settings/settings.component.html | 2 +-
2 files changed, 334 insertions(+), 313 deletions(-)
diff --git a/src-ui/messages.xlf b/src-ui/messages.xlf
index 21ac728b3..edd742d45 100644
--- a/src-ui/messages.xlf
+++ b/src-ui/messages.xlf
@@ -5,242 +5,242 @@
No tracking data is collected by the app in any way.
-
+
-
+
{{contentTrimmed}}