aboutsummaryrefslogtreecommitdiff
path: root/tw/services/paperless.scm
diff options
context:
space:
mode:
Diffstat (limited to 'tw/services/paperless.scm')
-rw-r--r--tw/services/paperless.scm12
1 files changed, 11 insertions, 1 deletions
diff --git a/tw/services/paperless.scm b/tw/services/paperless.scm
index 6db99f65..b643ac99 100644
--- a/tw/services/paperless.scm
+++ b/tw/services/paperless.scm
@@ -4,6 +4,7 @@
#:use-module (gnu services)
#:use-module (gnu services configuration)
#:use-module (gnu services databases)
+ #:use-module (gnu services web)
#:use-module (guix records)
#:use-module (tw services docker)
#:use-module (tw services restic)
@@ -80,7 +81,16 @@ PAPERLESS_GID=" (number->string %paperless-uid) "
(destination-ip
(if (string=? bind-address "0.0.0.0")
"127.0.0.1"
- bind-address)))))))
+ bind-address))
+ (extra-locations
+ (list (nginx-location-configuration
+ (uri "/ws/") ; e.g. /ws/status/ endpoint
+ ;; https://nginx.org/en/docs/http/websocket.html
+ (body `(("proxy_pass http://" ,destination-ip ":"
+ ,(number->string destination-port) ";")
+ "proxy_http_version 1.1;"
+ "proxy_set_header Upgrade $http_upgrade;"
+ "proxy_set_header Connection \"upgrade\";"))))))))))
(define %paperless-backup-repo
(restic-local-repository (path "/var/backups/paperless")))