hellfire1980 / scanservjs

SANE scanner nodejs web ui

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

scanservjs

About this fork

Since i got a raspberry pi 4 laying around and an old printer, i decided to made this and share it with the world.

  • Base image changed to compile for arm64
  • Installed libsane-hpaio drivers (for my old HP deskjet F4180)
  • run.sh script restarts dbus service (if DBUS_WORKAROUND is "true")

Credit for the original project should go to Sam Strachan.

What i recommend

Check the original instructions for returning the 00X and 00Y and run something like this:

docker run -d \
  -p 8080:8080 \
  -v /var/run/dbus:/var/run/dbus \
  -v /docker/scanservjs/scans:/app/data/output \
  -e DBUS_WORKAROUND='false' \
  --restart always \
  --name scanservjs-rpi \
  --device /dev/bus/usb/00X/00Y:/dev/bus/usb/00X/00Y \
  brunoalves/scanservjs-rpi:latest

or add the "privileged" which is unsafer:

docker run -d \
  -p 8080:8080 \
  -v /var/run/dbus:/var/run/dbus \
  -v /docker/scanservjs/scans:/app/data/output \
  -e DBUS_WORKAROUND='false' \
  --restart always \
  --name scanservjs-rpi \
  --privileged brunoalves/scanservjs-rpi:latest

If your device is not found, you may need to run this on your host:

sudo chmod a+rw /dev/bus/usb/00X/00Y

Automatically set permissions

In my case, everytime i connected my printer the 00Y was different. So i decided to set the permissions automatically when i connected my printer.

When you run

lsusb

You will see something like this:

Bus XXX Device YYY: ID VENDOR:PRODUCT My awesome printer

Create a script in your desired path '/PATH/script.sh' and add the vendor and product:

#!/bin/sh

bus=$(lsusb | grep "VENDOR:PRODUCT" | tr -d ':'| awk '{print $2}')
device=$(lsusb | grep "VENDOR:PRODUCT" | tr -d ':'| awk '{print $4}')

sudo chmod a+rw "/dev/bus/usb/$bus/$device"

Set permissions:

sudo chmod +x /PATH/script.sh

Create a new file /etc/udev/rules.d/permission.rules and paste inside:

ATTRS{idVendor}=="VENDOR", ATTRS{idProduct}=="PRODUCT", RUN+="/bin/sh -c '/PATH/script.sh'"

Now everytime the printer is connected, the command will be run. It's useful for things like restarting a docker container if needed.

Build Status Code QL Status Docker Image Size (latest by date) Docker Pulls GitHub stars GitHub

screenshot

Copyright 2016-2021 Sam Strachan

What people are saying

I've decided to switch to using only this, I find using this in a browser is just perfect and way better than bloated software from printer manufacturers

It enabled me to still use my old hp3900 scanner without worrying about drivers and vendor specific UIs. Furthermore, scans just being accessible via an awesome web interface makes it even more brilliant!

This is a great project! The touchscreen and buttons on my Brother scanner are broken, meaning the device is useless by itself because one cannot trigger scans, but with this project I can trigger it remotely just fine.

Absolutely love untethering my scanner from my laptop. Also means that I know it will work "forever", regardless of OS updates, since its all just a docker container.

About

scanservjs is a web UI frontend for your scanner. It allows you to share one or more scanners (using SANE) on a network without the need for drivers or complicated installation.

Features

  • Cropping
  • Source selection (Flatbed / ADF)
  • Resolution
  • Output formats (TIF, JPG, PNG, PDF and TXT with Tesseract OCR) with varying compression settings
  • Filters: Autolevels, Threshold, Blur
  • Configurable overrides for all defaults as well as filters and formats
  • Multipage scanning (with collation for double sided scans)
  • International translations: Czech, Dutch, French, German, Italian, Mandarin, Polish, Portuguese (PT & BR), Russian, Spanish, Turkish; Help requested
  • Light and dark mode
  • Responsive design

It supports any SANE compatible devices.

Requirements

  • SANE Scanner
  • Linux host (or VM with necessary pass-through e.g. USB)
  • Software sane-utils, ImageMagick, Tesseract (optional) and nodejs

Documentation

Why?

This is yet another scanimage-web-front-end. Why? It originally started as an adaptation of phpsane - just to make everything a bit newer, give it a refresh and make it work on minimal installations without imagemagick - that version is still available but is no longer maintained. Since then, I just wanted to write it in node and enhance it a bit, and it's been a labour of love ever since.

Acknowledgements

  • This project owes its genesis to phpsane
  • Everyone who has filed issues, tested, fixed issues, added translations and helped over the years. Thank you!

More about SANE

About

SANE scanner nodejs web ui

License:GNU General Public License v2.0


Languages

Language:JavaScript 66.2%Language:Vue 25.9%Language:Shell 5.6%Language:Dockerfile 1.8%Language:HTML 0.4%Language:SCSS 0.1%