From 0d5806fefd312d904c9f8b49c728a3072678a87e Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sat, 14 Sep 2019 14:59:00 +0200 Subject: [PATCH] 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. --- pkgs/applications/office/paperless/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/applications/office/paperless/default.nix b/pkgs/applications/office/paperless/default.nix index af2fd82ddb0..97088f36041 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 ];