From 1461cf2827440ac7adfe4d13c83a3b213cfc8cf8 Mon Sep 17 00:00:00 2001 From: Sophie Schiller Date: Mon, 24 May 2021 19:04:59 +0200 Subject: [PATCH] bw/home.paperless-sophie add sophie's paperless host --- bundles/paperless-ng/items.py | 4 + .../extras/home.paperless-sophie/paperless | 3 + nodes/home/paperless-sophie.py | 76 +++++++++++++++++++ 3 files changed, 83 insertions(+) create mode 100644 data/nginx/files/extras/home.paperless-sophie/paperless create mode 100644 nodes/home/paperless-sophie.py diff --git a/bundles/paperless-ng/items.py b/bundles/paperless-ng/items.py index f97b324..84e9e43 100644 --- a/bundles/paperless-ng/items.py +++ b/bundles/paperless-ng/items.py @@ -66,6 +66,9 @@ actions = { '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': { @@ -112,6 +115,7 @@ actions = { 'needs': { 'directory:/opt/paperless/static', 'file:/opt/paperless/src/paperless.conf', + 'action:paperless_create_virtualenv', }, }, } diff --git a/data/nginx/files/extras/home.paperless-sophie/paperless b/data/nginx/files/extras/home.paperless-sophie/paperless new file mode 100644 index 0000000..1aa1b28 --- /dev/null +++ b/data/nginx/files/extras/home.paperless-sophie/paperless @@ -0,0 +1,3 @@ + location /static/ { + alias /opt/paperless/static/; + } diff --git a/nodes/home/paperless-sophie.py b/nodes/home/paperless-sophie.py new file mode 100644 index 0000000..89ef2df --- /dev/null +++ b/nodes/home/paperless-sophie.py @@ -0,0 +1,76 @@ +nodes['home.paperless-sophie'] = { + 'hostname': '172.19.138.30', + 'bundles': { + 'nfs-client', + 'nodejs', + 'redis', + 'postgresql', + 'paperless-ng', + }, + 'groups': { + 'debian-buster', + 'webserver', + }, + 'metadata': { + 'backups': { + 'exclude_from_backups': True, + }, + 'icinga_options': { + 'exclude_from_monitoring': True, + }, + 'interfaces': { + 'enp1s0': { + 'ips': { + '172.19.138.30/24', + }, + 'gateway4': '172.19.138.1', + }, + }, + 'nfs-client': { + 'mounts': { + 'nas_paperless': { + 'mountpoint': '/mnt/paperless', + 'serverpath': '172.19.138.98:/mnt/paperless', + 'mount_options': { + 'retry=0', + 'rw', + }, + }, + 'nas_scansnap': { + 'mountpoint': '/mnt/scansnap', + 'serverpath': '172.19.138.20:/srv/scansnap', + 'mount_options': { + 'retry=0', + 'rw', + }, + }, + }, + }, + 'nginx': { + 'vhosts': { + 'paperless': { + 'domain': 'paperless-sophie.home.kunbox.net', + 'ssl': '_.home.kunbox.net', + 'proxy': { + '/': { + 'target': 'http://127.0.0.1:22070', + 'websockets': True, + 'proxy_set_header': { + 'X-Forwarded-Host': '$server_name', + }, + }, + }, + 'extras': True, + }, + }, + }, + 'paperless': { + 'version': 'ng-1.4.4', + 'timezone': 'Europe/Berlin', + }, + 'vm': { + 'cpu': 2, + 'ram': 2, + }, + }, +}