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.
This commit is contained in:
Maximilian Bosch 2019-09-14 14:59:00 +02:00
parent cbab4663f3
commit 0d5806fefd
No known key found for this signature in database
GPG Key ID: 091DBF4D1FC46B8E

View File

@ -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 ];