update paperless-ngx to v2.1.0
This commit is contained in:
parent
4e50bfe1a2
commit
9a3134cf46
8 changed files with 106 additions and 135 deletions
|
@ -5,7 +5,8 @@ Requires=redis.service
|
||||||
[Service]
|
[Service]
|
||||||
User=paperless
|
User=paperless
|
||||||
Group=paperless
|
Group=paperless
|
||||||
WorkingDirectory=/opt/paperless/src/src
|
Environment=PAPERLESS_CONFIGURATION_PATH=/opt/paperless/paperless.conf
|
||||||
|
WorkingDirectory=/opt/paperless/src/paperless-ngx/src
|
||||||
ExecStart=/opt/paperless/venv/bin/python manage.py document_consumer
|
ExecStart=/opt/paperless/venv/bin/python manage.py document_consumer
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
|
|
@ -5,8 +5,9 @@ Requires=redis.service
|
||||||
[Service]
|
[Service]
|
||||||
User=paperless
|
User=paperless
|
||||||
Group=paperless
|
Group=paperless
|
||||||
WorkingDirectory=/opt/paperless/src/src
|
Environment=PAPERLESS_CONFIGURATION_PATH=/opt/paperless/paperless.conf
|
||||||
ExecStart=/opt/paperless/venv/bin/python manage.py qcluster
|
WorkingDirectory=/opt/paperless/src/paperless-ngx/src
|
||||||
|
ExecStart=/opt/paperless/venv/bin/celery --app paperless beat --loglevel INFO
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
13
bundles/paperless-ng/files/paperless-taskqueue.service
Normal file
13
bundles/paperless-ng/files/paperless-taskqueue.service
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Paperless task queue
|
||||||
|
Requires=redis.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=paperless
|
||||||
|
Group=paperless
|
||||||
|
Environment=PAPERLESS_CONFIGURATION_PATH=/opt/paperless/paperless.conf
|
||||||
|
WorkingDirectory=/opt/paperless/src/paperless-ngx/src
|
||||||
|
ExecStart=/opt/paperless/venv/bin/celery --app paperless worker --loglevel INFO
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
|
@ -7,8 +7,9 @@ Requires=redis.service
|
||||||
[Service]
|
[Service]
|
||||||
User=paperless
|
User=paperless
|
||||||
Group=paperless
|
Group=paperless
|
||||||
WorkingDirectory=/opt/paperless/src/src
|
Environment=PAPERLESS_CONFIGURATION_PATH=/opt/paperless/paperless.conf
|
||||||
ExecStart=/opt/paperless/venv/bin/gunicorn -c /opt/paperless/src/gunicorn.conf.py -b 127.0.0.1:22070 paperless.asgi:application
|
WorkingDirectory=/opt/paperless/src/paperless-ngx/src
|
||||||
|
ExecStart=/opt/paperless/venv/bin/gunicorn -c /opt/paperless/src/paperless-ngx/gunicorn.conf.py -b 127.0.0.1:22070 paperless.asgi:application
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
|
@ -28,7 +28,8 @@ PAPERLESS_CORS_ALLOWED_HOSTS=http://${node.metadata.get('nginx/vhosts/paperless/
|
||||||
# OCR settings
|
# OCR settings
|
||||||
|
|
||||||
PAPERLESS_OCR_LANGUAGE=${'+'.join(sorted(node.metadata.get('paperless/ocr_languages', {'deu', 'eng'})))}
|
PAPERLESS_OCR_LANGUAGE=${'+'.join(sorted(node.metadata.get('paperless/ocr_languages', {'deu', 'eng'})))}
|
||||||
PAPERLESS_OCR_MODE=skip_noarchive
|
PAPERLESS_OCR_MODE=skip
|
||||||
|
PAPERLESS_OCR_SKIP_ARCHIVE_FILE=never
|
||||||
#PAPERLESS_OCR_OUTPUT_TYPE=pdfa
|
#PAPERLESS_OCR_OUTPUT_TYPE=pdfa
|
||||||
#PAPERLESS_OCR_PAGES=1
|
#PAPERLESS_OCR_PAGES=1
|
||||||
#PAPERLESS_OCR_IMAGE_DPI=300
|
#PAPERLESS_OCR_IMAGE_DPI=300
|
||||||
|
|
|
@ -1,146 +1,96 @@
|
||||||
users = {
|
version = node.metadata.get('paperless/version')
|
||||||
'paperless': {
|
workers = ('consumer', 'scheduler', 'taskqueue', 'webserver')
|
||||||
'home': '/opt/paperless',
|
|
||||||
|
users['paperless'] = {
|
||||||
|
'home': '/opt/paperless',
|
||||||
|
}
|
||||||
|
|
||||||
|
directories['/opt/paperless'] = {}
|
||||||
|
|
||||||
|
directories['/opt/paperless/static'] = {
|
||||||
|
'owner': 'paperless',
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
files['/opt/paperless/paperless.conf'] = {
|
||||||
|
'content_type': 'mako',
|
||||||
|
'triggers': {
|
||||||
|
f'svc_systemd:paperless-{worker}:restart'
|
||||||
|
for worker in workers
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
directories = {
|
actions['paperless_create_virtualenv'] = {
|
||||||
'/opt/paperless/src': {},
|
'command': '/usr/bin/python3 -m virtualenv -p python3 /opt/paperless/venv/',
|
||||||
'/opt/paperless/static': {
|
'unless': 'test -d /opt/paperless/venv/',
|
||||||
'owner': 'paperless',
|
'needs': {
|
||||||
|
'directory:/opt/paperless',
|
||||||
|
'pkg_apt:python3',
|
||||||
|
'pkg_apt:python3-pip',
|
||||||
|
'pkg_apt:python3-virtualenv',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
git_deploy = {
|
actions['paperless_install'] = {
|
||||||
'/opt/paperless/src': {
|
'command': ' && '.join([
|
||||||
'repo': 'https://github.com/paperless-ngx/paperless-ngx.git',
|
f'wget -qO /opt/paperless/{version}.tar.xz https://github.com/paperless-ngx/paperless-ngx/releases/download/{version}/paperless-ngx-{version}.tar.xz',
|
||||||
'rev': node.metadata.get('paperless/version'),
|
'rm -rf /opt/paperless/src/',
|
||||||
'triggers': {
|
'mkdir -p /opt/paperless/src/',
|
||||||
'action:paperless_collectstatic',
|
f'tar -C /opt/paperless/src -xf /opt/paperless/{version}.tar.xz',
|
||||||
'action:paperless_compile_frontend',
|
f'rm /opt/paperless/{version}.tar.xz',
|
||||||
'action:paperless_install_deps',
|
'cd /opt/paperless/src/paperless-ngx',
|
||||||
'action:paperless_migrate_database',
|
'/opt/paperless/venv/bin/pip install --upgrade pip',
|
||||||
'svc_systemd:paperless-consumer:restart',
|
'/opt/paperless/venv/bin/pip install --upgrade -r requirements.txt',
|
||||||
'svc_systemd:paperless-scheduler:restart',
|
f'echo "{version}" > /opt/paperless/version',
|
||||||
'svc_systemd:paperless-webserver:restart',
|
]),
|
||||||
},
|
'unless': f'''bash -c '[[ "$(cat /opt/paperless/version)" == "{version}" ]]' ''',
|
||||||
|
'after': {
|
||||||
|
'pkg_apt:',
|
||||||
|
},
|
||||||
|
'needs': {
|
||||||
|
'action:paperless_create_virtualenv',
|
||||||
|
},
|
||||||
|
'triggers': {
|
||||||
|
'action:paperless_migrate_database',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
files = {
|
actions['paperless_migrate_database'] = {
|
||||||
'/etc/systemd/system/paperless-consumer.service': {
|
'command': ' && '.join([
|
||||||
|
'cd /opt/paperless/src/paperless-ngx/src',
|
||||||
|
'sudo -Hu paperless PAPERLESS_CONFIGURATION_PATH=/opt/paperless/paperless.conf /opt/paperless/venv/bin/python manage.py migrate',
|
||||||
|
]),
|
||||||
|
'triggered': True,
|
||||||
|
'needs': {
|
||||||
|
# /mnt/paperless is NOT created by this bundle.
|
||||||
|
'action:paperless_install',
|
||||||
|
'directory:/mnt/paperless',
|
||||||
|
'directory:/opt/paperless/static',
|
||||||
|
'file:/opt/paperless/paperless.conf',
|
||||||
|
'user:paperless',
|
||||||
|
'postgres_db:paperless',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
for worker in workers:
|
||||||
|
files[f'/etc/systemd/system/paperless-{worker}.service'] = {
|
||||||
|
'delete': True,
|
||||||
'triggers': {
|
'triggers': {
|
||||||
'action:systemd-reload',
|
'action:systemd-reload',
|
||||||
'svc_systemd:paperless-consumer:restart',
|
|
||||||
},
|
},
|
||||||
},
|
}
|
||||||
'/etc/systemd/system/paperless-scheduler.service': {
|
|
||||||
|
files[f'/usr/local/lib/systemd/system/paperless-{worker}.service'] = {
|
||||||
'triggers': {
|
'triggers': {
|
||||||
'action:systemd-reload',
|
'action:systemd-reload',
|
||||||
'svc_systemd:paperless-scheduler:restart',
|
f'svc_systemd:paperless-{worker}:restart',
|
||||||
},
|
},
|
||||||
},
|
}
|
||||||
'/etc/systemd/system/paperless-webserver.service': {
|
|
||||||
'triggers': {
|
|
||||||
'action:systemd-reload',
|
|
||||||
'svc_systemd:paperless-webserver:restart',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
'/opt/paperless/src/paperless.conf': {
|
|
||||||
'content_type': 'mako',
|
|
||||||
'needs': {
|
|
||||||
'git_deploy:/opt/paperless/src',
|
|
||||||
},
|
|
||||||
'triggers': {
|
|
||||||
'svc_systemd:paperless-consumer:restart',
|
|
||||||
'svc_systemd:paperless-scheduler:restart',
|
|
||||||
'svc_systemd:paperless-webserver:restart',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
actions = {
|
svc_systemd[f'paperless-{worker}'] = {
|
||||||
'paperless_create_virtualenv': {
|
|
||||||
'command': '/usr/bin/python3 -m virtualenv -p python3 /opt/paperless/venv/',
|
|
||||||
'unless': 'test -d /opt/paperless/venv/',
|
|
||||||
'needs': {
|
|
||||||
# actually /opt/paperless, but we don't create that
|
|
||||||
'directory:/opt/paperless/src',
|
|
||||||
'pkg_apt:python3',
|
|
||||||
'pkg_apt:python3-pip',
|
|
||||||
'pkg_apt:python3-virtualenv',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
'paperless_install_deps': {
|
|
||||||
'command':
|
|
||||||
'cd /opt/paperless/src && '
|
|
||||||
'/opt/paperless/venv/bin/pip install --upgrade pip && '
|
|
||||||
'/opt/paperless/venv/bin/pip install --upgrade -r requirements.txt',
|
|
||||||
'triggered': True,
|
|
||||||
'needs': {
|
|
||||||
'action:paperless_create_virtualenv',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
'paperless_migrate_database': {
|
|
||||||
'command':
|
|
||||||
'cd /opt/paperless/src/src && '
|
|
||||||
'sudo -Hu paperless /opt/paperless/venv/bin/python manage.py migrate',
|
|
||||||
'triggered': True,
|
|
||||||
'needs': {
|
|
||||||
# /mnt/paperless is NOT created by this bundle.
|
|
||||||
'action:paperless_install_deps',
|
|
||||||
'directory:/mnt/paperless',
|
|
||||||
'directory:/opt/paperless/static',
|
|
||||||
'file:/opt/paperless/src/paperless.conf',
|
|
||||||
'user:paperless',
|
|
||||||
'postgres_db:paperless',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
'paperless_compile_frontend': {
|
|
||||||
'command':
|
|
||||||
'cd /opt/paperless/src/src-ui && '
|
|
||||||
'npm install && '
|
|
||||||
'node_modules/.bin/ng build',
|
|
||||||
'triggered': True,
|
|
||||||
'needs': {
|
|
||||||
'file:/opt/paperless/src/paperless.conf',
|
|
||||||
'pkg_apt:nodejs',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
'paperless_collectstatic': {
|
|
||||||
'command':
|
|
||||||
'cd /opt/paperless/src/src && '
|
|
||||||
'sudo -Hu paperless /opt/paperless/venv/bin/python manage.py collectstatic',
|
|
||||||
'triggered': True,
|
|
||||||
'needs': {
|
|
||||||
'directory:/opt/paperless/static',
|
|
||||||
'file:/opt/paperless/src/paperless.conf',
|
|
||||||
'action:paperless_install_deps',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
svc_systemd = {
|
|
||||||
'paperless-consumer': {
|
|
||||||
'needs': {
|
'needs': {
|
||||||
|
'action:paperless_install',
|
||||||
'action:paperless_migrate_database',
|
'action:paperless_migrate_database',
|
||||||
'file:/etc/systemd/system/paperless-consumer.service',
|
f'file:/usr/local/lib/systemd/system/paperless-{worker}.service',
|
||||||
'git_deploy:/opt/paperless/src',
|
|
||||||
},
|
},
|
||||||
},
|
}
|
||||||
'paperless-scheduler': {
|
|
||||||
'needs': {
|
|
||||||
'action:paperless_migrate_database',
|
|
||||||
'file:/etc/systemd/system/paperless-scheduler.service',
|
|
||||||
'git_deploy:/opt/paperless/src',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
'paperless-webserver': {
|
|
||||||
'needs': {
|
|
||||||
'action:paperless_compile_frontend',
|
|
||||||
'action:paperless_migrate_database',
|
|
||||||
'file:/etc/systemd/system/paperless-webserver.service',
|
|
||||||
'git_deploy:/opt/paperless/src',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
|
@ -6,7 +6,9 @@ defaults = {
|
||||||
'gnupg': {},
|
'gnupg': {},
|
||||||
'imagemagick': {},
|
'imagemagick': {},
|
||||||
'libmagic-dev': {},
|
'libmagic-dev': {},
|
||||||
|
'default-libmysqlclient-dev': {},
|
||||||
'libpq-dev': {},
|
'libpq-dev': {},
|
||||||
|
'mariadb-client': {},
|
||||||
'mime-support': {},
|
'mime-support': {},
|
||||||
'optipng': {},
|
'optipng': {},
|
||||||
'python3-wheel': {},
|
'python3-wheel': {},
|
||||||
|
@ -19,6 +21,8 @@ defaults = {
|
||||||
'pngquant': {},
|
'pngquant': {},
|
||||||
'qpdf': {},
|
'qpdf': {},
|
||||||
'tesseract-ocr': {},
|
'tesseract-ocr': {},
|
||||||
|
'tesseract-ocr-deu': {},
|
||||||
|
'tesseract-ocr-eng': {},
|
||||||
'unpaper': {},
|
'unpaper': {},
|
||||||
'zlib1g': {},
|
'zlib1g': {},
|
||||||
},
|
},
|
||||||
|
|
|
@ -55,11 +55,11 @@ nodes['home.paperless'] = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'paperless': {
|
'paperless': {
|
||||||
'version': 'v1.17.4',
|
'version': 'v2.1.0',
|
||||||
'timezone': 'Europe/Berlin',
|
'timezone': 'Europe/Berlin',
|
||||||
},
|
},
|
||||||
'postgresql': {
|
'postgresql': {
|
||||||
'version': '11',
|
'version': 15,
|
||||||
},
|
},
|
||||||
'vm': {
|
'vm': {
|
||||||
'cpu': 2,
|
'cpu': 2,
|
||||||
|
|
Loading…
Reference in a new issue