Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker Compose : Missig config file: /root/.config/scan-to-paperless.yaml #868

Open
nodecentral opened this issue Oct 22, 2022 · 15 comments

Comments

@nodecentral
Copy link

nodecentral commented Oct 22, 2022

Hi

I’ve creaged the following Docker Compose file,

version: '2'
services:
    scan-to-paperless:
        image: sbrunner/scan-to-paperless
        container_name: scan-to-paperless
        environment:
            - PUID=1005
            - PGID=1000
            - TZ=Europe/London
        volumes:
            - /share/Container/scan-to-paperless/consume:/destination
            - /share/Container/scan-to-paperless/scan:/source
  restart: unless-stopped 

and while it installs and loads fine, I’m unable to do anything with it ? if I access the command line via docker exec -it scan-to-paperless /bin/bash and run the scan command it returns the following message

[~] # docker exec -it scan-to-paperless /bin/bash
root@986e247365d55:/opt# scan
Missig config file: /root/.config/scan-to-paperless.yaml
The scan folder isn't set, use:
    scan --set-settings scan_folder <a_folder>
    This should be shared with the process container in 'source'.
root@986e62632d55:/opt# 

I’ve tied to address this by adding additional environment variables (see beklow), but that hasn’t fixed it either?

version: '2'
services:
    scan-to-paperless:
        image: sbrunner/scan-to-paperless
        container_name: scan-to-paperless
        environment:
            - PUID=1005
            - PGID=1000
            - TZ=Europe/London
        volumes:
            - /share/Container/scan-to-paperless/consume:/destination
            - /share/Container/scan-to-paperless/scan:/source
        environment:
            SCAN_SOURCE_FOLDER: source
            SCAN_FINAL_FOLDER: destination
  restart: unless-stopped 

Any ideas?

@sbrunner
Copy link
Owner

The scan command should run on the client part, see: https://github.com/sbrunner/scan-to-paperless#on-the-desktop :-)

@nodecentral
Copy link
Author

Hi @sbrunner, sorry if I’m being a bit stupid here.

As I’m trying to setup scan_to_paperless via Docker on my QNAP NAS, what is the desktop In this set up ?

@sbrunner
Copy link
Owner

The server part is where the document were processed.
The client part is the host on which on the scanner is connected :-)

@nodecentral
Copy link
Author

Ahh, I see, thanks -

In my set up, I have a network scanner so everything is going to a FTP share (no client in that sense) ..

Is there scope in the future, for an option to process uploaded files in network share ?

@sbrunner
Copy link
Owner

If I understand, with your scanner you push one button, and the result will be a PDF on a folder of your NAS?

@nodecentral
Copy link
Author

If I understand, with your scanner you push one button, and the result will be a PDF on a folder of your NAS?

Correct, i can set it up to go to either a ftp share or a cloud storage service. I’m currently sending everything to a folder for me to review/work on (e.g. split/combine a pdf etc.) before I move it to Paperless consume folder.

@sbrunner
Copy link
Owner

Can you add in this issue a generated PDF, then I can do a real test?

@nodecentral
Copy link
Author

Sure, what type of pdf do you want, although to test, you can use anything from the internet? The idea is that you can do the following before Paperless-ngx does it’s bit...

  1. define the split on a multiple page pdf to create seperate pdf files
  2. rotate a pdf of a document scanned in upside down
  3. merge multip pdfs into one since pdf

@sbrunner
Copy link
Owner

1 and 3 are not currently implemented features, 2 is, I'd like just to have a document of two pages, I like to work on real example and also to have document from some other scanner than mine :-)

@nodecentral
Copy link
Author

nodecentral commented Oct 27, 2022

Hi @sbrunner , here you go it’s a pdf of a 2 page form i found, conveniently scanned in upside down (which was a genuine mistake) - hopefully this helps
BRW008092DC5E53_233662.pdf

@sbrunner
Copy link
Owner

Excellent, thanks :-)

@nodecentral
Copy link
Author

nodecentral commented Oct 28, 2022

No problem..

@sbrunner - I have a dream ! -> paperless-ngx/paperless-ngx#1848 (comment)

Anything you can do to help make it a reality, would be amazing :-)

@Maximus48p
Copy link

Ahh, I see, thanks -

In my set up, I have a network scanner so everything is going to a FTP share (no client in that sense) ..

Is there scope in the future, for an option to process uploaded files in network share ?

For this i use https://github.com/ocrmypdf/OCRmyPDF

ocrmypdf:
#    user: 0:0
    restart: always
    container_name: Ocrmypdf-x
    image: jbarlow83/ocrmypdf:latest
#    ports:
#       - 5000:5000    
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /share/scanned_originals/OCR-pickup:/input
      - /share/scanned_originals/OCR-done:/output
      - /share/docker-volumes/Home-tools/ocrmypdf/tessdata:/usr/local/share/tessdata
      - /share/docker-volumes/Home-tools/ocrmypdf/config:/usr/local/share/config
#      - /share/docker-volumes/Home-tools/ocrmypdf/tessdata:/usr/share/tesseract-ocr/4.00/tessdata
    environment:
      - TZ=Europe/Amsterdam
      - OCR_ON_SUCCESS_DELETE=1
      - OCR_DESKEW=1
      - OCR_FORCE-OCR=1
      - LANGUAGE=nld+eng
#      - OCR_JSON_SETTINGS='{"rotate_pages": true, "skip_text": true, "language": "nld+eng", "output_type":"pdf"}'
      - PYTHONUNBUFFERED=1
#      - TESSDATA_PREFIX=/usr/local/share/tessdata
#      - TESSDATA_PREFIX=/share/Container-volumes/Home-tools/ocrmypdf/tessdata/
    entrypoint: python3
    command: >- 
      watcher.py

But i'm still fiddling with the correct ultimate best settings....

@nodecentral
Copy link
Author

Hi @Maximus48p thanks so much for sharing that link and your docker compose, I’ll take a look later.

Do you tie this ocrmypdf into your Paperless-ngx workflow ?

@sbrunner
Copy link
Owner

You probably just make that the /output of ocrmypdf is the same folder that the /consume of paperless-ngx :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants