Handling for bare metal

This commit is contained in:
Trenton H 2025-03-10 11:17:21 -07:00
parent 037389fbd5
commit ca8c3bb95d
2 changed files with 16 additions and 3 deletions

View File

@ -508,8 +508,7 @@ jobs:
requirements.txt \
LICENSE \
README.md \
paperless.conf.example \
webserver.py
paperless.conf.example
do
cp --verbose ${file_name} dist/paperless-ngx/
done

View File

@ -9,7 +9,21 @@ Requires=redis.service
User=paperless
Group=paperless
WorkingDirectory=/opt/paperless/src
ExecStart=python3 webserver.py
Environment=GRANIAN_HOST=::
Environment=GRANIAN_PORT=8000
Environment=GRANIAN_WORKERS=1
ExecStart=/bin/sh -c '\
# Host: GRANIAN_HOST -> PAPERLESS_BIND_ADDR -> default \
[ -z "$GRANIAN_HOST" ] && [ -n "$PAPERLESS_BIND_ADDR" ] && export GRANIAN_HOST=$PAPERLESS_BIND_ADDR; \
# Port: GRANIAN_PORT -> PAPERLESS_PORT -> default \
[ -z "$GRANIAN_PORT" ] && [ -n "$PAPERLESS_PORT" ] && export GRANIAN_PORT=$PAPERLESS_PORT; \
# Workers: GRANIAN_WORKERS -> PAPERLESS_WEBSERVER_WORKERS -> default \
[ -z "$GRANIAN_WORKERS" ] && [ -n "$PAPERLESS_WEBSERVER_WORKERS" ] && export GRANIAN_WORKERS=$PAPERLESS_WEBSERVER_WORKERS; \
# URL path prefix: only set if PAPERLESS_FORCE_SCRIPT_NAME exists \
[ -n "$PAPERLESS_FORCE_SCRIPT_NAME" ] && export GRANIAN_URL_PATH_PREFIX=$PAPERLESS_FORCE_SCRIPT_NAME; \
exec granian --interface asginl --ws "paperless.asgi:application"'
[Install]
WantedBy=multi-user.target