jdoss / ppngx

Podman + Paperless NGX
MIT License
97 stars 11 forks source link

I cannot set environment variable #11

Closed manueldeljesus closed 9 months ago

manueldeljesus commented 9 months ago

I am trying to set the following environment variable with its value:

PAPERLESS_OCR_USER_ARGS={"invalidate_digital_signatures": true}

I need to import many digitally signed documents, so I need to tell the system to just invalidate the signatures. If I have properly understood from my readings, this will keep also a copy of the original, so I should be able to consult my documents and still keep them valid.

Any way, I was trying to set the environment variable with the -e option in you start.sh script, but I am not able to make it work.

I am just adding the line within the Starting paperless block. What am I doing wrong for it to not set the environment variable?

jdoss commented 9 months ago

Try setting the env this way under https://github.com/jdoss/ppngx/blob/master/start.sh#L92

-e PAPERLESS_OCR_USER_ARGS="{'invalidate_digital_signatures': true}"
manueldeljesus commented 9 months ago

Nope, it does not seem to work. It still throws the following error:

DigitalSignatureError: Input PDF has a digital signature. OCR would alter the document, invalidating the signature.

I am not really sure how that JSON? metadata may be passed through and environment variable, and that is why I am out of clues on how to deal with it.

manueldeljesus commented 9 months ago

After close inspection, your way of passing the variable is correct, in the sense that within the container the environment variable is set. The problem is that Paperless does not seem to be acting on it.

jdoss commented 9 months ago

That is odd. Is there anything on the Paperless NGX Github issues about PAPERLESS_OCR_USER_ARGS not working?

manueldeljesus commented 9 months ago

I have been checking paperless-ngx Issues and have not found anything about it, BUT playing with variations of the format you suggested, I finally made it work. I used the following syntax:

-e PAPERLESS_OCR_USER_ARGS='{"invalidate_digital_signatures": true}'

Thank you very much for your help

jdoss commented 9 months ago

No problem! Glad it got sorted out. 😄