Automatically upload file to paperless when filename match a prefix
  • Go 90.9%
  • Dockerfile 9.1%
Find a file
2025-10-31 18:54:22 -07:00
.github/workflows feat: release process 2025-05-18 18:12:15 +02:00
Dockerfile Chore: bump deps 2025-10-31 18:54:22 -07:00
go.mod Chore: bump deps 2025-10-31 18:54:22 -07:00
go.sum Chore: bump deps 2025-10-31 18:54:22 -07:00
LICENSE Add LICENSE 2024-01-01 15:11:59 -08:00
README.md fix: readme updated 2025-05-18 18:19:29 +02:00
renovate.json5 feat: Add renovate 2025-05-18 13:41:19 +02:00
scantopl.go feat[scantopl.go]: Added some logging 2025-05-18 12:55:09 +02:00

scantopl

An updated fork of celedhrim's original work.

Automatically send scanservjs scanned document to paperless-ngx

What is updated

3rd party libs go language docker base container

How to configure

Usage of /usr/bin/scantopl:
  -config string
        path to config file
  -pltoken string
        Paperless auth token , generated through admin (default "xxxxxxxxxxxxxxxxxx")
  -plurl string
        The paperless instance URL without trailing / (default "http://localhost:8080")
  -scandir string
        Scanserjs ouput directory (default "/home/scanservjs/output")

or you can use envvar : SCANDIR, PLTOKEN, PLURL

provide the paperless-ngx url , the paperless-ngx token and the scanservjs output dir ( or bind to /output in docker)

How to use it

  • Scan something
  • if you want to send it to paperless-ngx , go in the scanservjs file section and rename file to add prefix pl_ ( test_scan.pdf -> pl_test_scan.pdf)
  • the file is submitted with name "test_scan" ( remove prefix and extension automatically) then remove source file is deleted

How it work

  • listen for file creation in the scanservjs output dir
  • if a newly created file start with pl_ , upload it to paperless
  • If uploaded succefully, remove file from scanservjs output

Install

Docker

$ docker run --rm \
  -v /your/host/scanservjs/output:/output \
  -e PLURL=https://paperless.yourdomain.instance \
  -e PLTOKEN=XXXXXXXXXXXX \
  ghcr.io/starkzarn/scantopl:master

Docker Compose

Example with scanservjs container.

Paperless webserver is reachable on a network called plnet So scan2pl is connected to this network.

Your local network is repesented via homelan. Scanservjs is maybe connected here. This is yust an example.

version: "3"
services:
  scanservjs:
    container_name: scanservjs
    environment:
      - SANED_NET_HOSTS="<IP of your scanner>"
    volumes:
      - ./scans:/var/lib/scanservjs/output
      - ./config:/etc/scanservjs
      - /var/run/dbus:/var/run/dbus
    ports:
      - 8080:8080
    restart: unless-stopped
    image: sbs20/scanservjs:latest
    networks:
      homelan:
        # Define a static ip for the container. The containter can be accessible by others devices on the LAN network with this IP.
        ipv4_address: <containers ip addr from your local network>
    
  
  scan2pl:
    container_name: scan2pl
    environment:
      - PLURL=http://paperless-ngx-webserver-1:8000
      - PLTOKEN=${PLTOKEN}
    image: ghcr.io/sidey79/scantopl:master
    networks:
      - plnet
    volumes:
      - ./scans:/output

networks:
  homelan:
    name: network_homelan
    external: true

  plnet:
    name: paperless_internal_network
    external: true