about summary refs log tree commit diff
path: root/pkgs/applications/office
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2019-09-14 14:59:00 +0200
committerMaximilian Bosch <maximilian@mbosch.me>2019-09-14 14:59:00 +0200
commit0d5806fefd312d904c9f8b49c728a3072678a87e (patch)
treea5503591b54448393bf59312380dc31ca0f928ac /pkgs/applications/office
parentcbab4663f33f59b1fe347beb66f12d0f73746301 (diff)
downloadnixlib-0d5806fefd312d904c9f8b49c728a3072678a87e.tar
nixlib-0d5806fefd312d904c9f8b49c728a3072678a87e.tar.gz
nixlib-0d5806fefd312d904c9f8b49c728a3072678a87e.tar.bz2
nixlib-0d5806fefd312d904c9f8b49c728a3072678a87e.tar.lz
nixlib-0d5806fefd312d904c9f8b49c728a3072678a87e.tar.xz
nixlib-0d5806fefd312d904c9f8b49c728a3072678a87e.tar.zst
nixlib-0d5806fefd312d904c9f8b49c728a3072678a87e.zip
paperless: fix cors header
`django-cors-headers` 3.x (which is used in nixpkgs) requires a scheme
for allowed hosts. Upstream uses 2.4, however we create the python env
with Nix, so the source needs to be patched accordingly.
Diffstat (limited to 'pkgs/applications/office')
-rw-r--r--pkgs/applications/office/paperless/default.nix6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkgs/applications/office/paperless/default.nix b/pkgs/applications/office/paperless/default.nix
index af2fd82ddb03..97088f360417 100644
--- a/pkgs/applications/office/paperless/default.nix
+++ b/pkgs/applications/office/paperless/default.nix
@@ -57,6 +57,12 @@ let
       cp -r --no-preserve=mode $src/src/* $src/LICENSE $srcDir
     '';
 
+    postPatch = ''
+      # django-cors-headers 3.x requires a scheme for allowed hosts
+      substituteInPlace $out/share/paperless/paperless/settings.py \
+        --replace "localhost:8080" "http://localhost:8080"
+    '';
+
     buildPhase = let
       # Paperless has explicit runtime checks that expect these binaries to be in PATH
       extraBin = lib.makeBinPath [ imagemagick7 ghostscript optipng tesseract unpaper ];