From a4a9bb743902dab5a0ca37acf0fe2c13309ef9e3 Mon Sep 17 00:00:00 2001 From: Peter Marquardt Date: Mon, 12 Feb 2024 10:27:42 +0100 Subject: [PATCH 01/12] updated to 2.5.0 --- build.profile | 4 ++-- cleanall.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.profile b/build.profile index 5960c4b..1988816 100644 --- a/build.profile +++ b/build.profile @@ -1,4 +1,4 @@ -BUILD_TAG=2.4.2 +BUILD_TAG=2.5.0 . build.local @@ -20,4 +20,4 @@ BUILD_tesseract=tesseract-5.3.3 BUILD_node=node-20.10.0 BUILD_nginx=nginx-1.24.0 -BUILD_paperless=paperless-ngx-2.4.2 +BUILD_paperless=paperless-ngx-2.5.0 diff --git a/cleanall.sh b/cleanall.sh index e2c6a59..1483781 100644 --- a/cleanall.sh +++ b/cleanall.sh @@ -8,7 +8,7 @@ function removeall { rm -rf ./nginx-1.24.0 rm -rf ./node-20.10.0 rm -rf ./paperless-ngx - rm -rf ./paperless-ngx-2.4.2 + rm -rf ./paperless-ngx-2.5.0 rm -rf ./Python-3.11.7 rm -rf ./sqlite-3.44.2 rm -rf ./tesseract-5.3.3 From 7c59347d1dd3d9f258240ea17e2dda6bfd402900 Mon Sep 17 00:00:00 2001 From: Peter Marquardt Date: Mon, 12 Feb 2024 13:23:04 +0100 Subject: [PATCH 02/12] sqlite upgrade 3.44.2 to 3.45.1 --- README.todo | 19 +++++++++++++++++++ build.profile | 2 +- cleanall.sh | 2 +- sqlite.build.sh | 5 ++--- 4 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 README.todo diff --git a/README.todo b/README.todo new file mode 100644 index 0000000..9e1f90b --- /dev/null +++ b/README.todo @@ -0,0 +1,19 @@ + ✔ sqlite => 3.45.1 @done (24-02-12 13:18) + https://sqlite.org/download.html + ☐ Python => 3.11.8 + https://www.python.org/downloads/release/python-3118/ + ☐ node => 20.11.0 + https://nodejs.org/download/release/latest-v20.x/ + ☐ unpaper => git latest + https://github.com/unpaper/unpaper + ☐ ffmpeg ? + ☐ zbar => 0.23.93 + https://github.com/mchehab/zbar/releases/tag/0.23.93 + ☐ leptonica => 1.84.1 + https://github.com/DanBloomberg/leptonica/releases + ☐ tesseract => 5.3.4 + https://github.com/tesseract-ocr/tesseract + ☐ nginx => 1.25.3 + https://nginx.org/download/ + + diff --git a/build.profile b/build.profile index 1988816..81fc1d0 100644 --- a/build.profile +++ b/build.profile @@ -11,7 +11,7 @@ NPROC=$(nproc) XDG_CACHE_HOME=${PREFIX}/cache TMPDIR=${TMPDIR:-/tmp/${USER}/${BUILD_TAG}} -BUILD_sqlite=sqlite-3.44.2 +BUILD_sqlite=sqlite-3.45.1 BUILD_python=Python-3.11.7 BUILD_unpaper=unpaper-7.0.0 BUILD_zbar=zbar-0.23.90 diff --git a/cleanall.sh b/cleanall.sh index 1483781..6f1d2e0 100644 --- a/cleanall.sh +++ b/cleanall.sh @@ -10,7 +10,7 @@ function removeall { rm -rf ./paperless-ngx rm -rf ./paperless-ngx-2.5.0 rm -rf ./Python-3.11.7 - rm -rf ./sqlite-3.44.2 + rm -rf ./sqlite-3.45.1 rm -rf ./tesseract-5.3.3 rm -rf ./unpaper-7.0.0 rm -rf ./zbar-0.23.90 diff --git a/sqlite.build.sh b/sqlite.build.sh index 1caede7..b2f5f3e 100755 --- a/sqlite.build.sh +++ b/sqlite.build.sh @@ -9,9 +9,8 @@ function B_SQLITE { [ -d "$PREFIX" ] || { echo "PREFIX unset or not a directory";exit; } -# SRCURL[0]="https://www.sqlite.org/2023/sqlite-autoconf-3440200.tar.gz" -SRCURL[0]="https://beehive.molgen.mpg.de/c02f40fd4f809ced95096250adc5764a/sqlite-autoconf-3440200.tar.gz" - +# SRCURL[0]="https://sqlite.org/2024/sqlite-autoconf-3450100.tar.gz" +SRCURL[0]="https://beehive.molgen.mpg.de/743c99f996add46273694df83c9140d4/sqlite-3.45.1.tar.gz" PKGARC=${SRCURL##*.*/} PKGVER=${PKGARC%.*.*} From 89eb8c85a8ca793ef52aaba18a5aece96a56f55b Mon Sep 17 00:00:00 2001 From: Peter Marquardt Date: Mon, 12 Feb 2024 16:03:07 +0100 Subject: [PATCH 03/12] python upgrade 3.11.7 to 3.11.8 --- Python.build.sh | 6 ++++-- build.profile | 2 +- cleanall.sh | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Python.build.sh b/Python.build.sh index 28a2890..96de4c5 100755 --- a/Python.build.sh +++ b/Python.build.sh @@ -13,8 +13,8 @@ function B_PYTHON { [ -d "$PREFIX" ] || { echo "PREFIX unset or not a directory";exit; } # apt install libbz2-dev -# wget "https://www.python.org/ftp/python/3.11.7/Python-3.11.7.tgz" -SRCURL[0]="https://beehive.molgen.mpg.de/ef61f81ec82c490484219c7f0ec96783/Python-3.11.7.tgz" +# wget "https://www.python.org/ftp/python/3.11.8/Python-3.11.8.tgz" +SRCURL[0]="https://beehive.molgen.mpg.de/7fb0bfaa2f6aae4aadcdb51abe957825/Python-3.11.8.tgz" PREFIX=${PREFIX}/${BUILD_python} @@ -51,6 +51,7 @@ ln -vfs python3 ${PREFIX}/bin/python ln -vfs python3-config ${PREFIX}/bin/python-config ln -vfs pydoc3 ${PREFIX}/bin/pydoc ln -vfs idle3 ${PREFIX}/bin/idle +ln -vfs pip3 ${PREFIX}/bin/pip . $PREFIX/profile @@ -58,6 +59,7 @@ pip3 install --prefix=$PREFIX --upgrade pip python3 -m pip install --no-cache-dir --upgrade pipenv==2023.10.24 pip3 install meson pip3 install sphinx + } B_PYTHON diff --git a/build.profile b/build.profile index 81fc1d0..763ffb5 100644 --- a/build.profile +++ b/build.profile @@ -12,7 +12,7 @@ XDG_CACHE_HOME=${PREFIX}/cache TMPDIR=${TMPDIR:-/tmp/${USER}/${BUILD_TAG}} BUILD_sqlite=sqlite-3.45.1 -BUILD_python=Python-3.11.7 +BUILD_python=Python-3.11.8 BUILD_unpaper=unpaper-7.0.0 BUILD_zbar=zbar-0.23.90 BUILD_leptonica=leptonica-1.83.1 diff --git a/cleanall.sh b/cleanall.sh index 6f1d2e0..db4854f 100644 --- a/cleanall.sh +++ b/cleanall.sh @@ -9,7 +9,7 @@ function removeall { rm -rf ./node-20.10.0 rm -rf ./paperless-ngx rm -rf ./paperless-ngx-2.5.0 - rm -rf ./Python-3.11.7 + rm -rf ./Python-3.11.8 rm -rf ./sqlite-3.45.1 rm -rf ./tesseract-5.3.3 rm -rf ./unpaper-7.0.0 From 1c9ddfef924ed16c91989bdedb020dbdbd1cd3b4 Mon Sep 17 00:00:00 2001 From: Peter Marquardt Date: Mon, 12 Feb 2024 16:33:12 +0100 Subject: [PATCH 04/12] node upgrade 20.10.0 to 20.11.0 donk --- build.profile | 2 +- cleanall.sh | 2 +- node.build.sh | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.profile b/build.profile index 763ffb5..8be4425 100644 --- a/build.profile +++ b/build.profile @@ -13,11 +13,11 @@ TMPDIR=${TMPDIR:-/tmp/${USER}/${BUILD_TAG}} BUILD_sqlite=sqlite-3.45.1 BUILD_python=Python-3.11.8 +BUILD_node=node-20.11.0 BUILD_unpaper=unpaper-7.0.0 BUILD_zbar=zbar-0.23.90 BUILD_leptonica=leptonica-1.83.1 BUILD_tesseract=tesseract-5.3.3 -BUILD_node=node-20.10.0 BUILD_nginx=nginx-1.24.0 BUILD_paperless=paperless-ngx-2.5.0 diff --git a/cleanall.sh b/cleanall.sh index db4854f..4aa3626 100644 --- a/cleanall.sh +++ b/cleanall.sh @@ -6,7 +6,7 @@ function removeall { set +e rm -rf ./leptonica-1.83.1 rm -rf ./nginx-1.24.0 - rm -rf ./node-20.10.0 + rm -rf ./node-20.11.0 rm -rf ./paperless-ngx rm -rf ./paperless-ngx-2.5.0 rm -rf ./Python-3.11.8 diff --git a/node.build.sh b/node.build.sh index 771477b..5d9bc1f 100755 --- a/node.build.sh +++ b/node.build.sh @@ -12,8 +12,8 @@ function B_NODEJS { [ -d "$PREFIX" ] || { echo "PREFIX unset or not a directory";exit; } -# wget "https://nodejs.org/download/release/v20.10.0/node-v20.10.0.tar.gz" -SRCURL[0]="https://beehive.molgen.mpg.de/44b5a59e790b5cbcf5cb2d21822feeb5/node-v20.10.0.tar.gz" +# wget "https://nodejs.org/download/release/v20.11.0/node-v20.11.0.tar.gz" +SRCURL[0]="https://beehive.molgen.mpg.de/94db35ddc577e52d15a6e242260beea7/node-v20.11.0.tar.gz" PREFIX=${PREFIX}/${BUILD_node} From e1a5e36bbbd771c2a651c97ccedc5df0225e0030 Mon Sep 17 00:00:00 2001 From: Peter Marquardt Date: Mon, 12 Feb 2024 17:22:34 +0100 Subject: [PATCH 05/12] upgrade unpaper to git main --- build.profile | 2 +- cleanall.sh | 2 +- unpaper.build.sh | 30 +++++++++++++++++++++++------- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/build.profile b/build.profile index 8be4425..f688bac 100644 --- a/build.profile +++ b/build.profile @@ -14,7 +14,7 @@ TMPDIR=${TMPDIR:-/tmp/${USER}/${BUILD_TAG}} BUILD_sqlite=sqlite-3.45.1 BUILD_python=Python-3.11.8 BUILD_node=node-20.11.0 -BUILD_unpaper=unpaper-7.0.0 +BUILD_unpaper=unpaper-7.0.0-99-gf41e9bb BUILD_zbar=zbar-0.23.90 BUILD_leptonica=leptonica-1.83.1 BUILD_tesseract=tesseract-5.3.3 diff --git a/cleanall.sh b/cleanall.sh index 4aa3626..0b5a562 100644 --- a/cleanall.sh +++ b/cleanall.sh @@ -12,7 +12,7 @@ function removeall { rm -rf ./Python-3.11.8 rm -rf ./sqlite-3.45.1 rm -rf ./tesseract-5.3.3 - rm -rf ./unpaper-7.0.0 + rm -rf ./unpaper-7.0.0-99-gf41e9bb rm -rf ./zbar-0.23.90 rm -rf ./logs/ set -e diff --git a/unpaper.build.sh b/unpaper.build.sh index 68f7e72..ec4a1e6 100755 --- a/unpaper.build.sh +++ b/unpaper.build.sh @@ -11,23 +11,39 @@ function B_UNPAPER { [ -d "$PREFIX" ] || { echo "PREFIX unset or not a directory";exit; } -SRCURL[0]="https://github.com/unpaper/unpaper/releases/download/unpaper-7.0.0/unpaper-7.0.0.tar.xz" - BUILD_PKG=${BUILD_unpaper} PREFIX=${PREFIX}/${BUILD_PKG} -mkdir -p $PREFIX +if [ ! -d ${BUILD_unpaper} ]; then + if [ ! -e ${BUILD_unpaper}.tar ]; then + git clone https://github.com/unpaper/unpaper.git --single-branch ${BUILD_unpaper} + pushd ${BUILD_unpaper} + GITVER=$(git describe --tags) + popd + if [ "${GITVER}" != "${BUILD_unpaper}" ]; then + echo "${GITVER} should be ${BUILD_unpaper}. update!" + exit 1 + fi + tar cf ${BUILD_unpaper}.tar ${BUILD_unpaper} + else + tar -xf ${BUILD_unpaper}.tar + fi +fi + +if [ ! -d ${PREFIX} ]; then + git clone ${BUILD_unpaper} $PREFIX +else + pushd ${PREFIX} + git pull origin + popd +fi cat >$PREFIX/profile <<-EOF PATH=$PREFIX/bin:\$PATH PKG_CONFIG_PATH=${PROJECT}/${BUILD_PKG}/lib/pkgconfig${PKG_CONFIG_PATH:+:}$PKG_CONFIG_PATH EOF - -test -e ${BUILD_PKG}.tar.xz || wget -nv ${SRCURL} -O ${BUILD_PKG}.tar.xz -test -d ${BUILD_PKG} || mkdir -pv ${BUILD_PKG} && tar -xf ${BUILD_PKG}.tar.xz --strip-components=1 -C ${BUILD_PKG} - cd ${BUILD_PKG} local _cflags=( From 482cb42dd76f2a0bd8028609b42d02ffaaab368e Mon Sep 17 00:00:00 2001 From: Peter Marquardt Date: Tue, 13 Feb 2024 12:35:07 +0100 Subject: [PATCH 06/12] paperless-ngs bounce 2.5.0 to 2.5.1 --- build.profile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.profile b/build.profile index f688bac..4b0b5f9 100644 --- a/build.profile +++ b/build.profile @@ -1,4 +1,4 @@ -BUILD_TAG=2.5.0 +BUILD_TAG=2.5.1 . build.local @@ -20,4 +20,4 @@ BUILD_leptonica=leptonica-1.83.1 BUILD_tesseract=tesseract-5.3.3 BUILD_nginx=nginx-1.24.0 -BUILD_paperless=paperless-ngx-2.5.0 +BUILD_paperless=paperless-ngx-2.5.1 From 82201cb6e7c6159b3295bbcbce62539b173d3a20 Mon Sep 17 00:00:00 2001 From: Peter Marquardt Date: Tue, 13 Feb 2024 12:37:33 +0100 Subject: [PATCH 07/12] zbar update 2.23.90 to 2.23.93 --- build.profile | 2 +- zbar.build.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.profile b/build.profile index 4b0b5f9..706a4a0 100644 --- a/build.profile +++ b/build.profile @@ -15,7 +15,7 @@ BUILD_sqlite=sqlite-3.45.1 BUILD_python=Python-3.11.8 BUILD_node=node-20.11.0 BUILD_unpaper=unpaper-7.0.0-99-gf41e9bb -BUILD_zbar=zbar-0.23.90 +BUILD_zbar=zbar-0.23.93 BUILD_leptonica=leptonica-1.83.1 BUILD_tesseract=tesseract-5.3.3 BUILD_nginx=nginx-1.24.0 diff --git a/zbar.build.sh b/zbar.build.sh index 9172bfb..4b9ba1c 100755 --- a/zbar.build.sh +++ b/zbar.build.sh @@ -9,8 +9,8 @@ function B_ZBAR { [ -d "$PREFIX" ] || { echo "PREFIX unset or not a directory";exit; } -# SRCURL[0]="https://github.com/mchehab/zbar/archive/refs/tags/0.23.90.tar.gz" -SRCURL[0]="https://beehive.molgen.mpg.de/cb1667e20c1d7acf1b9911414adaeb84/zbar-0.23.90.tar.gz" +# SRCURL[0]="https://github.com/mchehab/zbar/archive/refs/tags/0.23.93.tar.gz" +SRCURL[0]="https://beehive.molgen.mpg.de/3f69d17f6495de023b59b3539ce5e605/zbar-0.23.93.tar.gz" BUILD_PKG=${BUILD_zbar} BUILD_EXT=${SRCURL/${SRCURL%.*.*}/} From c6851b124f94f36a886b22c0eaa4bfb44ff7470b Mon Sep 17 00:00:00 2001 From: Peter Marquardt Date: Tue, 13 Feb 2024 12:40:43 +0100 Subject: [PATCH 08/12] update leptonica 1.83.1 to 1.84.1 --- build.profile | 2 +- leptonica.build.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/build.profile b/build.profile index 706a4a0..d0ddea3 100644 --- a/build.profile +++ b/build.profile @@ -16,7 +16,7 @@ BUILD_python=Python-3.11.8 BUILD_node=node-20.11.0 BUILD_unpaper=unpaper-7.0.0-99-gf41e9bb BUILD_zbar=zbar-0.23.93 -BUILD_leptonica=leptonica-1.83.1 +BUILD_leptonica=leptonica-1.84.1 BUILD_tesseract=tesseract-5.3.3 BUILD_nginx=nginx-1.24.0 diff --git a/leptonica.build.sh b/leptonica.build.sh index e831d22..80fa8c1 100755 --- a/leptonica.build.sh +++ b/leptonica.build.sh @@ -9,7 +9,8 @@ function B_LEPTONICA { [ -d "$PREFIX" ] || { echo "PREFIX unset or not a directory";exit; } -SRCURL[0]="https://github.com/DanBloomberg/leptonica/releases/download/1.83.1/leptonica-1.83.1.tar.gz" +# SRCURL[0]="https://github.com/DanBloomberg/leptonica/releases/download/1.84.1/leptonica-1.84.1.tar.gz" +SRCURL[0]="https://beehive.molgen.mpg.de/01e6de7af2ba93b8350cdc3f7aeb0fbf/leptonica-1.84.1.tar.gz" PREFIX=${PREFIX}/${BUILD_leptonica} From a54b038cfad9e2edaa5dceedf432eafc10882c60 Mon Sep 17 00:00:00 2001 From: Peter Marquardt Date: Tue, 13 Feb 2024 12:49:45 +0100 Subject: [PATCH 09/12] update tesseract 5.3.3 to 5.3.4 --- build.profile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.profile b/build.profile index d0ddea3..7b3e036 100644 --- a/build.profile +++ b/build.profile @@ -17,7 +17,7 @@ BUILD_node=node-20.11.0 BUILD_unpaper=unpaper-7.0.0-99-gf41e9bb BUILD_zbar=zbar-0.23.93 BUILD_leptonica=leptonica-1.84.1 -BUILD_tesseract=tesseract-5.3.3 +BUILD_tesseract=tesseract-5.3.4 BUILD_nginx=nginx-1.24.0 BUILD_paperless=paperless-ngx-2.5.1 From b3e9b7e0d057ec475064f64054f08d809132a8c0 Mon Sep 17 00:00:00 2001 From: Peter Marquardt Date: Wed, 14 Feb 2024 09:19:38 +0100 Subject: [PATCH 10/12] nginx: upgrade from 1.24.0 to chicken 1.25.3 --- .gitignore | 2 + build.profile | 2 +- nginx-1.25.3.chicken.patch | 118 +++++++++++++++++++++++++++++++++++++ nginx.build.sh | 11 +++- 4 files changed, 129 insertions(+), 4 deletions(-) create mode 100644 nginx-1.25.3.chicken.patch diff --git a/.gitignore b/.gitignore index 4d2bc14..609ffa8 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,5 @@ *.tar *.tar.gz *.tar.xz +!/*.patch +!/*.sh diff --git a/build.profile b/build.profile index 7b3e036..85ea90d 100644 --- a/build.profile +++ b/build.profile @@ -18,6 +18,6 @@ BUILD_unpaper=unpaper-7.0.0-99-gf41e9bb BUILD_zbar=zbar-0.23.93 BUILD_leptonica=leptonica-1.84.1 BUILD_tesseract=tesseract-5.3.4 -BUILD_nginx=nginx-1.24.0 +BUILD_nginx=nginx-1.25.3 BUILD_paperless=paperless-ngx-2.5.1 diff --git a/nginx-1.25.3.chicken.patch b/nginx-1.25.3.chicken.patch new file mode 100644 index 0000000..47fd38f --- /dev/null +++ b/nginx-1.25.3.chicken.patch @@ -0,0 +1,118 @@ +diff --git a/html/50x.html b/html/50x.html +index a57c2f9..6ba724b 100644 +--- a/html/50x.html ++++ b/html/50x.html +@@ -9,11 +9,9 @@ font-family: Tahoma, Verdana, Arial, sans-serif; } + + + +-

An error occurred.

+-

Sorry, the page you are looking for is currently unavailable.
+-Please try again later.

+-

If you are the system administrator of this resource then you should check +-the error log for details.

+-

Faithfully yours, nginx.

++

Bwok.

++

Cock-a-dodle-doooo-cock-a-doooodle-doooooo Cock-a-doodle-dooooo bwwwaaaaaak-bwwwaaak-bwwwaaak Waaak cock-a-doooodle-dooo bok Waaaaaak-waaak-waaak bwwwaaak cock-a-doooodle-doooo-cock-a-dooooodle-doooo Cluckity-cluckity? Pukaak cock-a-doodle-do-cock-a-dooooodle-doooo cluckity. Cluck-cluck Bwok cluck-cluck-cluck cluck-a-buh-gawk Bwok Bwak waaak Bok Cluck-a-buh-gawk-cluck-a-buh-gawk honk Bok-bok-bok Cluck waaaaaaak bwwwaaak cock-a-dooooooodle-doooo pukak!

++

.

++

Bok bok bok.

+ + +diff --git a/html/index.html b/html/index.html +index e8f5622..b6668f7 100644 +--- a/html/index.html ++++ b/html/index.html +@@ -1,7 +1,7 @@ + + + +-Welcome to nginx! ++Cluck-a-buh-gawk-cluck-a-buh-gawk cluck waaaaaaak! + + + +-

Welcome to nginx!

+-

If you see this page, the nginx web server is successfully installed and +-working. Further configuration is required.

++

Chicken!

++

Bwok Puk bok pukak bwak-bwak bwok Cluck bwak-bwak waaaaak bwwwaak-bwwwaaaaak.

+ +-

For online documentation and support please refer to +-nginx.org.
+-Commercial support is available at +-nginx.com.

++

Cluckity... Cluckity Puk-puk Waaaaak cock-a-doodle-doo bwak-bwak-bwak cluckity bwwwaak! Cluckity bok-bok Bok bwok-bwok-bwok bwak-bwak-bwak cluck. Cluck wak-waaaak pukaaaak-pukaaaak-pukaaaaak Puk-puk-puk Puk Gobble-gobble bok Pukaaaaaaak-pukaaaaak bwwwak-bwwwak-bwwwaaaaak Puk bwak bwak-bwak waak-waaaaaaak cluck. Pukak Bwok?

+ +-

Thank you for using nginx.

++

Cluck-cluck-cluck gobble-gobble-gobble honk Gobble-gobble bwwwaaaaaak.

+ + +diff --git a/src/core/nginx.h b/src/core/nginx.h +index 088aa1e..0e1632f 100644 +--- a/src/core/nginx.h ++++ b/src/core/nginx.h +@@ -10,8 +10,8 @@ + + + #define nginx_version 1025003 +-#define NGINX_VERSION "1.25.3" +-#define NGINX_VER "nginx/" NGINX_VERSION ++#define NGINX_VERSION "1.25.4" ++#define NGINX_VER "chicken/" NGINX_VERSION + + #ifdef NGX_BUILD + #define NGINX_VER_BUILD NGINX_VER " (" NGX_BUILD ")" +diff --git a/src/http/ngx_http_special_response.c b/src/http/ngx_http_special_response.c +index eaf42e3..fd682a3 100644 +--- a/src/http/ngx_http_special_response.c ++++ b/src/http/ngx_http_special_response.c +@@ -33,7 +33,7 @@ static u_char ngx_http_error_build_tail[] = + + + static u_char ngx_http_error_tail[] = +-"
nginx
" CRLF ++"
chicken
" CRLF + "" CRLF + "" CRLF + ; +diff --git a/src/http/v2/ngx_http_v2_filter_module.c b/src/http/v2/ngx_http_v2_filter_module.c +index 1e2cafa..30223d6 100644 +--- a/src/http/v2/ngx_http_v2_filter_module.c ++++ b/src/http/v2/ngx_http_v2_filter_module.c +@@ -115,7 +115,7 @@ ngx_http_v2_header_filter(ngx_http_request_t *r) + ngx_http_core_srv_conf_t *cscf; + u_char addr[NGX_SOCKADDR_STRLEN]; + +- static const u_char nginx[5] = "\x84\xaa\x63\x55\xe7"; ++ static const u_char nginx[6] = "\x85\x24\xe6\x27\x52\xd5"; + #if (NGX_HTTP_GZIP) + static const u_char accept_encoding[12] = + "\x8b\x84\x84\x2d\x69\x5b\x05\x44\x3c\x86\xaa\x6f"; +diff --git a/src/http/v3/ngx_http_v3_filter_module.c b/src/http/v3/ngx_http_v3_filter_module.c +index 4d2276d..7b156a6 100644 +--- a/src/http/v3/ngx_http_v3_filter_module.c ++++ b/src/http/v3/ngx_http_v3_filter_module.c +@@ -166,7 +166,7 @@ ngx_http_v3_header_filter(ngx_http_request_t *r) + n = sizeof(NGINX_VER_BUILD) - 1; + + } else { +- n = sizeof("nginx") - 1; ++ n = sizeof("chicken") - 1; + } + + len += ngx_http_v3_encode_field_lri(NULL, 0, +@@ -349,8 +349,8 @@ ngx_http_v3_header_filter(ngx_http_request_t *r) + n = sizeof(NGINX_VER_BUILD) - 1; + + } else { +- p = (u_char *) "nginx"; +- n = sizeof("nginx") - 1; ++ p = (u_char *) "chicken"; ++ n = sizeof("chicken") - 1; + } + + ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0, diff --git a/nginx.build.sh b/nginx.build.sh index 00cc2fa..475243a 100755 --- a/nginx.build.sh +++ b/nginx.build.sh @@ -11,8 +11,9 @@ set -e . ${PREFIX}/${BUILD_python}/profile function B_NGINX { -# wget "https://nginx.org/download/nginx-1.24.0.tar.gz" -SRCURL[0]="https://beehive.molgen.mpg.de/f95835b55b3cbf05a4368e7bccbb8a46/nginx-1.24.0.tar.gz" + +# SRCURL[0]="https://nginx.org/download/nginx-1.25.3.tar.gz" +SRCURL[0]="https://beehive.molgen.mpg.de/92f07d33918ca0a09612665337d67f2b/nginx-1.25.3.tar.gz" BUILD_PKG=${BUILD_nginx} BUILD_EXT=${SRCURL/${SRCURL%.*.*}/} @@ -39,7 +40,11 @@ test -d ${BUILD_PKG} || mkdir -pv ${BUILD_PKG} && tar -xf ${BUILD_PKG}${BUILD_EX pushd ${BUILD_PKG} -patch -p1 --silent --backup --forward --input=../nginx-1.24.0.chicken.patch || true +# static const u_char nginx[5] = "\x84\xaa\x63\x55\xe7"; +# What you see here is the representation of the string "nginx" compressed with HPACK's Huffman encoding. +# ~/go/src/github.com/wwwutz/hpack + +patch -p1 --silent --backup --forward --input=../nginx-1.25.3.chicken.patch || true local _conf=( --prefix=${PREFIX} From ad8be0a78c697190f81d080027d2eeac8e869eb7 Mon Sep 17 00:00:00 2001 From: Peter Marquardt Date: Wed, 14 Feb 2024 10:12:17 +0100 Subject: [PATCH 11/12] cleanall: add AI logic --- cleanall.sh | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/cleanall.sh b/cleanall.sh index 0b5a562..34fdf3e 100644 --- a/cleanall.sh +++ b/cleanall.sh @@ -2,19 +2,29 @@ set -e set -x +. build.profile + +declare -a RMRF + +RMRF=( + $BUILD_sqlite + $BUILD_python + $BUILD_node + $BUILD_unpaper + $BUILD_zbar + $BUILD_leptonica + $BUILD_tesseract + $BUILD_nginx + $BUILD_paperless + ./logs +) + function removeall { set +e - rm -rf ./leptonica-1.83.1 - rm -rf ./nginx-1.24.0 - rm -rf ./node-20.11.0 - rm -rf ./paperless-ngx - rm -rf ./paperless-ngx-2.5.0 - rm -rf ./Python-3.11.8 - rm -rf ./sqlite-3.45.1 - rm -rf ./tesseract-5.3.3 - rm -rf ./unpaper-7.0.0-99-gf41e9bb - rm -rf ./zbar-0.23.90 - rm -rf ./logs/ + for i in "${RMRF[@]}"; do + echo "[$i]" + [ -n "$i" ] && [ -d "$i" ] && rm -rf "$i" + done set -e } From 6c8440435e5bf721d0b59f5e64da6e209815edf9 Mon Sep 17 00:00:00 2001 From: Peter Marquardt Date: Thu, 15 Feb 2024 09:24:35 +0100 Subject: [PATCH 12/12] add ffmpeg & pngquant --- .gitignore | 2 ++ build.profile | 2 ++ buildall.sh | 2 ++ cleanall.sh | 2 ++ ffmpeg.build.sh | 48 +++++++++++++++++++++++++++++++ paperless-ngx.build.sh | 3 ++ paperless.conf.build.sh | 3 +- pngquant.build.sh | 63 +++++++++++++++++++++++++++++++++++++++++ profile.build.sh | 2 ++ unpaper.build.sh | 2 ++ 10 files changed, 128 insertions(+), 1 deletion(-) create mode 100755 ffmpeg.build.sh create mode 100755 pngquant.build.sh diff --git a/.gitignore b/.gitignore index 609ffa8..7a08b92 100644 --- a/.gitignore +++ b/.gitignore @@ -5,12 +5,14 @@ /leptonica-* /nginx-* /node-* +/pngquant-* /sqlite-* /tessconfigs /tessdata /tesseract-* /unpaper-* /zbar-* +/ffmpeg-* *.tar *.tar.gz *.tar.xz diff --git a/build.profile b/build.profile index 85ea90d..f5f1fee 100644 --- a/build.profile +++ b/build.profile @@ -14,6 +14,8 @@ TMPDIR=${TMPDIR:-/tmp/${USER}/${BUILD_TAG}} BUILD_sqlite=sqlite-3.45.1 BUILD_python=Python-3.11.8 BUILD_node=node-20.11.0 +BUILD_ffmpeg=ffmpeg-6.1.1 +BUILD_pngquant=pngquant-3.0.3-2-g88da53e BUILD_unpaper=unpaper-7.0.0-99-gf41e9bb BUILD_zbar=zbar-0.23.93 BUILD_leptonica=leptonica-1.84.1 diff --git a/buildall.sh b/buildall.sh index 1a19d9d..17369f6 100755 --- a/buildall.sh +++ b/buildall.sh @@ -61,6 +61,8 @@ ln -fs $logfile $LOGS/build.log [ -d ${BUILD_sqlite} ] || ./sqlite.build.sh [ -d ${BUILD_python} ] || ./Python.build.sh [ -d ${BUILD_node} ] || ./node.build.sh +[ -d ${BUILD_ffmpeg} ] || ./ffmpeg.build.sh +[ -d ${BUILD_pngquant} ] || ./pngquant.build.sh [ -d ${BUILD_unpaper} ] || ./unpaper.build.sh [ -d ${BUILD_zbar} ] || ./zbar.build.sh [ -d ${BUILD_leptonica} ] || ./leptonica.build.sh diff --git a/cleanall.sh b/cleanall.sh index 34fdf3e..6ceb1ff 100644 --- a/cleanall.sh +++ b/cleanall.sh @@ -10,7 +10,9 @@ RMRF=( $BUILD_sqlite $BUILD_python $BUILD_node + $BUILD_ffmpeg $BUILD_unpaper + $BUILD_pngquant $BUILD_zbar $BUILD_leptonica $BUILD_tesseract diff --git a/ffmpeg.build.sh b/ffmpeg.build.sh new file mode 100755 index 0000000..660857c --- /dev/null +++ b/ffmpeg.build.sh @@ -0,0 +1,48 @@ +#!/bin/bash +{ +set -x +set -e + +. build.profile + +function B_FFMPEG { + +[ -d "$PREFIX" ] || { echo "PREFIX unset or not a directory";exit; } + +# SRCURL[0]="https://ffmpeg.org//releases/${BUILD_ffmpeg}.tar.gz" +SRCURL[0]="https://beehive.molgen.mpg.de/cce359cad7ed0d4f0079f7864080ad36/ffmpeg-6.1.1.tar.gz" + +PREFIX=${PREFIX}/${BUILD_ffmpeg} + +mkdir -p $PREFIX + +cat >$PREFIX/profile <<-EOF +PATH=$PREFIX/bin:\$PATH +PKG_CONFIG_PATH=${PROJECT}/${BUILD_ffmpeg}/lib/pkgconfig${PKG_CONFIG_PATH:+:}$PKG_CONFIG_PATH +EOF + + +test -e ${BUILD_ffmpeg}.tar.gz || wget -nv ${SRCURL} -O ${BUILD_ffmpeg}.tar.gz +test -d ${BUILD_ffmpeg} || mkdir -pv ${BUILD_ffmpeg} && tar -xf ${BUILD_ffmpeg}.tar.gz --strip-components=1 -C ${BUILD_ffmpeg} + +cd ${BUILD_ffmpeg} + +local _conf=( + --prefix=${PREFIX} + --enable-gpl + --enable-version3 + --enable-nonfree + --enable-gray + --disable-doc +) + +./configure "${_conf[@]}" + +make -j $NPROC +make install + +} + +B_FFMPEG + +} diff --git a/paperless-ngx.build.sh b/paperless-ngx.build.sh index f2bc68b..a1bd5f7 100755 --- a/paperless-ngx.build.sh +++ b/paperless-ngx.build.sh @@ -5,6 +5,9 @@ set -e . build.profile +. ${PREFIX}/${BUILD_pngquant}/profile +. ${PREFIX}/${BUILD_ffmpeg}/profile +. ${PREFIX}/${BUILD_unpaper}/profile . ${PREFIX}/${BUILD_sqlite}/profile . ${PREFIX}/${BUILD_zbar}/profile . ${PREFIX}/${BUILD_python}/profile diff --git a/paperless.conf.build.sh b/paperless.conf.build.sh index 44566a7..3e8f123 100755 --- a/paperless.conf.build.sh +++ b/paperless.conf.build.sh @@ -24,8 +24,9 @@ _sed=( -e "/#PAPERLESS_SECRET_KEY=change-me/ a PAPERLESS_SECRET_KEY=${PAPERLESS_SECRET_KEY}" # -e '/#PAPERLESS_AUTO_LOGIN_USERNAME=/ a PAPERLESS_AUTO_LOGIN_USERNAME=paperless' -e '/#PAPERLESS_OCR_LANGUAGE=/ a PAPERLESS_OCR_LANGUAGE=deu+eng' - -e '/#PAPERLESS_OCR_MODE=skip/ a PAPERLESS_OCR_MODE=redo' + -e '/#PAPERLESS_OCR_MODE=skip/ a PAPERLESS_OCR_MODE=force' -e "/#PAPERLESS_OCR_LANGUAGE=/ a PAPERLESS_NLTK_DIR=${PROJECT}/data/nltk" + -e "/#PAPERLESS_OCR_CLEAN=/ a PAPERLESS_OCR_CLEAN=clean-final" -e "/#PAPERLESS_CONSUMPTION_DIR=/ a PAPERLESS_CONSUMPTION_DIR=${PROJECT}/consume" -e "/#PAPERLESS_CONSUMPTION_DIR=/ a PAPERLESS_LOGGING_DIR=${PROJECT}/log" -e '/#PAPERLESS_CONSUMER_RECURSIVE=/ a PAPERLESS_CONSUMER_RECURSIVE=true' diff --git a/pngquant.build.sh b/pngquant.build.sh new file mode 100755 index 0000000..c0ae32a --- /dev/null +++ b/pngquant.build.sh @@ -0,0 +1,63 @@ +#!/bin/bash +{ +set -x +set -e + +. build.profile + +. ${PREFIX}/${BUILD_python}/profile + +function B_PNGQUANT { + +[ -d "$PREFIX" ] || { echo "PREFIX unset or not a directory";exit; } + +BUILD_PKG=${BUILD_pngquant} + +PREFIX=${PREFIX}/${BUILD_PKG} + +if [ ! -d ${BUILD_pngquant} ]; then + if [ ! -e ${BUILD_pngquant}.tar ]; then + git clone --recursive https://github.com/kornelski/pngquant.git --single-branch ${BUILD_pngquant} + pushd ${BUILD_pngquant} + GITVER=$(git describe --tags) + popd + if [ "${GITVER}" != "${BUILD_pngquant##pngquant-}" ]; then + echo "${GITVER} should be ${BUILD_pngquant}. update!" + exit 1 + fi + tar cf ${BUILD_pngquant}.tar ${BUILD_pngquant} + else + tar -xf ${BUILD_pngquant}.tar + fi +fi + +if [ ! -d ${PREFIX} ]; then + git clone ${BUILD_pngquant} $PREFIX +else + pushd ${PREFIX} + git pull origin + popd +fi + +cat >$PREFIX/profile <<-EOF +PATH=$PREFIX/bin:\$PATH +PKG_CONFIG_PATH=${PROJECT}/${BUILD_PKG}/lib/pkgconfig${PKG_CONFIG_PATH:+:}$PKG_CONFIG_PATH +EOF + +cd ${BUILD_PKG} + +local _conf=( + --release +) + +[ -d /usr/local/package/bin ] && PATH=${PATH}:/usr/local/package/bin + +CARGO_HOME=.cargo cargo build "${_conf[@]}" + +install -v -Dm0755 ./target/release/pngquant $PREFIX/bin/pngquant + +} + +B_PNGQUANT + +} diff --git a/profile.build.sh b/profile.build.sh index ec65f54..46b552f 100755 --- a/profile.build.sh +++ b/profile.build.sh @@ -18,6 +18,8 @@ PATH=$HOME/bin:/bin:/sbin:/usr/bin:/usr/sbin . ${PROJECT}/${BUILD_node}/profile . ${PROJECT}/${BUILD_nginx}/profile . ${PROJECT}/${BUILD_unpaper}/profile +. ${PROJECT}/${BUILD_ffmpeg}/profile +. ${PROJECT}/${BUILD_pngquant}/profile . ${PROJECT}/${BUILD_leptonica}/profile . ${PROJECT}/${BUILD_tesseract}/profile diff --git a/unpaper.build.sh b/unpaper.build.sh index ec4a1e6..17cf1eb 100755 --- a/unpaper.build.sh +++ b/unpaper.build.sh @@ -6,6 +6,7 @@ set -e . build.profile . ${PREFIX}/${BUILD_python}/profile +. ${PREFIX}/${BUILD_ffmpeg}/profile function B_UNPAPER { @@ -55,6 +56,7 @@ local _cflags=( local _conf=( --prefix ${PREFIX} --buildtype=debugoptimized + --pkg-config-path=${PKG_CONFIG_PATH} ) CFLAGS="${_cflags[@]}" meson setup "${_conf[@]}" builddir