Skip to content

Commit

Permalink
Merge pull request #33 from mariux64/updates-290
Browse files Browse the repository at this point in the history
paperless-ngs: update to 2.9.0
  • Loading branch information
wwwutz authored Jun 3, 2024
2 parents f5dee06 + 1aa03e5 commit 171eaff
Show file tree
Hide file tree
Showing 10 changed files with 75 additions and 37 deletions.
2 changes: 1 addition & 1 deletion Python.build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ ln -vfs pip3 "${PREFIX}/bin/pip"
. "${PREFIX}/profile"

pip3 install --prefix="${PREFIX}" --upgrade pip
python3 -m pip install --no-cache-dir --upgrade pipenv==2023.10.24
python3 -m pip install --no-cache-dir --upgrade pipenv==2023.12.1
pip3 install meson
pip3 install sphinx

Expand Down
35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,44 @@ cd paperless-baremetal
./buildall
. build.profile
cd $PREFIX
./startstop-paperless.sh install
./startstop-paperless.sh start
echo "URL: ${PAPERLESS_URL}:${PAPERLESS_PORT}"
```

## updating/data migration from older versions

after successfully building:

```
OLD="${HOME}/paperless-server/2.8.6"
NEW="${HOME}/paperless-server/2.9.0"
# stop running instance
cd "$OLD"
./startstop.sh stop
# remove empty database and media
rm -rf "$NEW/data" "$NEW/media"
# change to new installation folder
cd "$NEW"
# copy old data to new location ( $PREFIX )
cp -ax "$OLD/data" "$NEW/"
cp -ax "$OLD/media" "$NEW/"
# migrate
( . profile; cd "$NEW/paperless-ngx/src"; ./manage.py migrate )
# start
./startstop.sh start
# check status
./startstop.sh status
```

## build

Overall, this script automates the setup of a local development environment for the paperless project, handling configuration, directory creation, and the building of dependencies. It also sets up logging to keep track of the build process.

## Explanation of `buildall.sh`
Expand Down
12 changes: 6 additions & 6 deletions build.profile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
BUILD_TAG=2.8.6
BUILD_TAG=2.9.0

. build.local

Expand All @@ -10,20 +10,20 @@ XDG_CACHE_HOME=${PREFIX}/cache
TMPDIR=${TMPDIR:-/tmp/${USER}/${BUILD_TAG}}
LOGDIR=${PROJECT}/log

BUILD_sqlite=sqlite-3.45.3
BUILD_redis=redis-7.2.4
BUILD_sqlite=sqlite-3.46.0
BUILD_redis=redis-7.2.5
BUILD_python=Python-3.11.9
BUILD_node=node-20.13.1
BUILD_node=node-20.14.0
BUILD_ffmpeg=ffmpeg-7.0
BUILD_pngquant=pngquant-3.0.3-3-gdbb78b1
BUILD_unpaper=unpaper-7.0.0-125-gfe89949
BUILD_zbar=zbar-0.23.93
BUILD_leptonica=leptonica-1.84.1
BUILD_tesseract=tesseract-5.3.4
BUILD_tessdata=tessdata_best-4.1.0
BUILD_nginx=nginx-1.26.0
BUILD_nginx=nginx-1.26.1
BUILD_jbig2enc=jbig2enc-0.28-17-gea05019
BUILD_jbig2dec=jbig2dec-0.20
BUILD_libfontttf=liberation-fonts-ttf-2.1.5

BUILD_paperless=paperless-ngx-2.8.6
BUILD_paperless=paperless-ngx-2.9.0
5 changes: 5 additions & 0 deletions buildall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ PAPERLESS_PORT=8880
# PAPERLESS_HTTPS=8443
PAPERLESS_URL=https://localhost
PAPERLESS_CSRF_TRUSTED_ORIGINS=http://localhost:\${PAPERLESS_PORT}
NGINX_SSL_DHPARAM=\${PROJECT}/certs/dhparam.pem
NGINX_SSL_CERTIFICATE=\${PROJECT}/certs/fullchain.pem
NGINX_SSL_CERTIFICATE_KEY=\${PROJECT}/certs/privkey.pem
_EOP_
) ${BUILD_LOCAL}
cat ${BUILD_LOCAL}
Expand Down
9 changes: 4 additions & 5 deletions nginx.build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ set -u

function B_NGINX {

# SRCURL[0]="https://nginx.org/download/nginx-1.26.0.tar.gz"
SRCURL[0]="https://beehive.molgen.mpg.de/bb1b92cf7d72efcc0da343b057f23516/nginx-1.26.0.tar.gz"
# SRCURL[0]="https://nginx.org/download/nginx-1.26.1.tar.gz"
SRCURL[0]="https://beehive.molgen.mpg.de/56b83c172c7f2fd09d59123bc28ff2b1/nginx-1.26.1.tar.gz"

BUILD_PKG=${BUILD_nginx}
BUILD_EXT=${SRCURL/${SRCURL%.*.*}/}
Expand All @@ -28,9 +28,8 @@ EOF

. ${PREFIX}/profile

mkdir -p ${PREFIX}/conf
DHPARAM=${PREFIX}/conf/dhparam.pem
test -e ${DHPARAM} || openssl dhparam -dsaparam -out ${DHPARAM} 2048
mkdir -p "${NGINX_SSL_DHPARAM%/*}"
test -e "${NGINX_SSL_DHPARAM}" || openssl dhparam -dsaparam -out "${NGINX_SSL_DHPARAM}" 2048


test -e ${BUILD_PKG}${BUILD_EXT} || wget -nv ${SRCURL} -O ${BUILD_PKG}${BUILD_EXT}
Expand Down
4 changes: 2 additions & 2 deletions nginx.chicken.patch
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ index 088aa1e..0e1632f 100644


#define nginx_version 1025003
-#define NGINX_VERSION "1.26.0"
-#define NGINX_VERSION "1.26.1"
-#define NGINX_VER "nginx/" NGINX_VERSION
+#define NGINX_VERSION "1.26.1"
+#define NGINX_VERSION "1.26.2"
+#define NGINX_VER "chicken/" NGINX_VERSION

#ifdef NGX_BUILD
Expand Down
2 changes: 1 addition & 1 deletion nginx.conf.build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ tee -a ${CONF} <<_EOP_
listen ${PAPERLESS_BIND_ADDR}:${PAPERLESS_HTTPS} ssl;
ssl_certificate ${NGINX_SSL_CERTIFICATE}; # from build.local
ssl_certificate_key ${NGINX_SSL_CERTIFICATE_KEY}; # from build.local
ssl_dhparam dhparam.pem; # src/nginx.build.sh
ssl_dhparam ${NGINX_SSL_DHPARAM}; # src/nginx.build.sh
ssl_session_timeout 1d;
ssl_session_cache shared:MozSSL:10m;
ssl_session_tickets off;
Expand Down
4 changes: 2 additions & 2 deletions node.build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ function B_NODEJS {

[ -d "$PREFIX" ] || { echo "PREFIX unset or not a directory";exit; }

# wget "https://nodejs.org/download/release/v20.13.0/node-v20.13.0.tar.gz"
SRCURL="https://beehive.molgen.mpg.de/070f7b2fbcfa095db0ae7887da1fe55e/node-v20.13.0.tar.gz"
# wget "https://nodejs.org/download/release/v20.14.0/node-v20.14.0.tar.gz"
SRCURL="https://beehive.molgen.mpg.de/42e1625ee90c170a0e44882033392b99/node-v20.14.0.tar.gz"

PREFIX=${PREFIX}/${BUILD_node}

Expand Down
11 changes: 5 additions & 6 deletions redis.build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,19 @@ set -u

function B_REDIS {

SRCURL="https://download.redis.io/releases/redis-7.2.4.tar.gz"
# SRCURL="https://download.redis.io/releases/redis-7.2.5.tar.gz"
SRCURL="https://beehive.molgen.mpg.de/b2a5dde2024516d431fc1e4f360020b3/redis-7.2.5.tar.gz"

BUILD_PKG=${BUILD_redis}

PREFIX=${PREFIX}/${BUILD_PKG}

mkdir -p $PREFIX
mkdir -p ${PREFIX}

cat >$PREFIX/profile <<-EOF
PATH=$PREFIX/bin:\$PATH
# PKG_CONFIG_PATH=${PROJECT}/${BUILD_PKG}/lib/pkgconfig\${PKG_CONFIG_PATH:+:}\$PKG_CONFIG_PATH
cat >${PREFIX}/profile <<-EOF
PATH=${PREFIX}/bin:\${PATH}
EOF


test -e ${BUILD_PKG}.tar.gz || wget -nv ${SRCURL} -O ${BUILD_PKG}.tar.gz
test -d ${BUILD_PKG} || mkdir -pv ${BUILD_PKG} && tar -xf ${BUILD_PKG}.tar.gz --strip-components=1 -C ${BUILD_PKG}

Expand Down
28 changes: 15 additions & 13 deletions sqlite.build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,26 @@ set -u

function B_SQLITE {

SRCURL[0]="https://sqlite.org/2024/sqlite-autoconf-3450300.tar.gz"
SRCURL[0]="https://beehive.molgen.mpg.de/f418272ba1d588747dcd4201018ed912/sqlite-autoconf-3450300.tar.gz"
# wget "https://sqlite.org/2024/sqlite-autoconf-3460000.tar.gz"
SRCURL[0]="https://beehive.molgen.mpg.de/ff687dfc7483196420a4f16a6f53702d/sqlite-autoconf-3460000.tar.gz"

PKGARC=${SRCURL##*.*/}
PKGVER=${PKGARC%.*.*}
BUILD_PKG=${BUILD_sqlite}
BUILD_EXT=${SRCURL/${SRCURL%.*.*}/}

PREFIX=${PREFIX}/${BUILD_sqlite}
PREFIX=${PREFIX}/${BUILD_PKG}

mkdir -p $PREFIX
mkdir -p ${TMPDIR}
mkdir -p ${PREFIX}

cat >$PREFIX/profile <<-EOF
PATH=$PREFIX/bin:\$PATH
PKG_CONFIG_PATH=${PROJECT}/${BUILD_sqlite}/lib/pkgconfig\${PKG_CONFIG_PATH:+:}\${PKG_CONFIG_PATH:-}
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}${BUILD_EXT} || wget -nv ${SRCURL} -O ${BUILD_PKG}${BUILD_EXT}
test -d ${BUILD_PKG} || mkdir -pv ${BUILD_PKG} && tar -xf ${BUILD_PKG}${BUILD_EXT} --strip-components=1 -C ${BUILD_PKG}

test -e ${BUILD_sqlite}.tar.gz || wget -nv ${SRCURL} -O ${BUILD_sqlite}.tar.gz
test -d ${BUILD_sqlite} || mkdir -pv ${BUILD_sqlite} && tar -xf ${BUILD_sqlite}.tar.gz --strip-components=1 -C ${BUILD_sqlite}

cd ${BUILD_sqlite}
pushd ${BUILD_PKG}

local _conf=(
--prefix ${PREFIX}
Expand All @@ -47,6 +47,8 @@ local _conf=(
make -j $NPROC
make install

popd

}

B_SQLITE
Expand Down

0 comments on commit 171eaff

Please sign in to comment.