Skip to content

Commit

Permalink
Merge pull request #59 from sbs20/staging
Browse files Browse the repository at this point in the history
v2.0.0
  • Loading branch information
sbs20 authored Sep 13, 2020
2 parents 282e307 + 123ec27 commit 3991fa5
Show file tree
Hide file tree
Showing 58 changed files with 16,750 additions and 7,402 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
22 changes: 14 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ npm-debug.log*
pids
*.pid
*.seed
device.conf

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
Expand Down Expand Up @@ -47,8 +46,6 @@ jspm_packages

# Thumbnails
._*
*.tif
*.jpg

# Files that might appear in the root of a volume
.DocumentRevisions-V100
Expand Down Expand Up @@ -88,8 +85,17 @@ $RECYCLE.BIN/
*.lnk

# Release folders
# ===============
build
assets
release
etc
release/**/*
dist/**/*

# VSCode
.vscode


# Project specific
*.tif
*.pdf
*.png
scan*.jpg
config/devices.json
var
46 changes: 0 additions & 46 deletions .vscode/launch.json

This file was deleted.

5 changes: 0 additions & 5 deletions .vscode/settings.json

This file was deleted.

29 changes: 0 additions & 29 deletions .vscode/tasks.json

This file was deleted.

27 changes: 10 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,36 +1,29 @@
# builder image
FROM node:buster AS builder

ENV APP_DIR=/app
WORKDIR "$APP_DIR"

# install build dependencies
COPY package.json "$APP_DIR"
COPY package*.json "$APP_DIR/"
RUN npm install

# run a gulp build
COPY . "$APP_DIR"
RUN npm run build
RUN npm run server-build
RUN npm run client-build

# production image
FROM node:buster-slim
ENV APP_DIR=/app
WORKDIR "$APP_DIR"
# Install sane
RUN apt-get update && apt-get install -yq sane sane-utils imagemagick
RUN sed -i '/policy domain="coder" rights="none" pattern="PDF"/d' /etc/ImageMagick-6/policy.xml

COPY --from=builder "$APP_DIR/build/scanservjs" "$APP_DIR/"
RUN sed -i 's/policy domain="coder" rights="none" pattern="PDF"/policy domain="coder" rights="read | write" pattern="PDF"'/ /etc/ImageMagick-6/policy.xml
COPY --from=builder "$APP_DIR/dist" "$APP_DIR/"

# Install dependencies
RUN npm install --production


ENV NET_HOST=""

# Copy built assets from builder image

COPY entrypoint.sh /entrypoint.sh

ENTRYPOINT [ "/entrypoint.sh" ]

# Copy entry point
COPY run.sh /run.sh
RUN ["chmod", "+x", "/run.sh"]
ENTRYPOINT [ "/run.sh" ]
EXPOSE 8080
84 changes: 47 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,64 @@
# scanservjs
scanservjs is a nodejs port of scanserv. It's a simple web-based UI for SANE
which allows you to share a scanner on a network without the need for drivers
or complicated installation. scanservjs does not do image conversion or
manipulation (beyond the bare minimum necessary for the purposes of browser
preview) or OCR.
scanservjs is a simple web-based UI for your scanner. It allows you to share a
scanner (using SANE) on a network without the need for drivers or complicated
installation. It can save to TIF, JPG, PNG and PDF with varyings compression
settings. It also allows for configurable output conversions through
configuration.

![screenshot](https://github.com/sbs20/scanservjs/raw/master/docs/screen0.png)

Copyright 2016 [Sam Strachan](https://github.com/sbs20)
Copyright 2016 [Sam Strachan](https://github.com/sbs20)

# requirements
* SANE
* ImageMagick
* nodejs
## Requirements
* SANE
* ImageMagick
* nodejs

# installation notes
For an easy docker-based install (assuming that SANE supports your scanner out-of-the-box on Debian):
## Installation notes
For an easy docker-based install (assuming that SANE supports your scanner
out-of-the-box on Debian) use the following commands. Please note that by
default, configuration and scanned images are stored within the container and
will be lost if you recreate it. If you want to map your scanned images then
specify the volume mapping option `-v /local/path/:/app/data/output/`

```console
$ docker build -t scanservjs .
$ docker run -p 8080:8080 --restart unless-stopped --name scanservjs --privileged scanservjs
docker pull sbs20/scanservjs:latest
docker rm --force scanservjs-container 2> /dev/null
docker run -d -p 8080:8080 --restart unless-stopped --name scanservjs-container --privileged sbs20/scanservjs:latest
```
(`--privileged` is required for the container to access the host's devices, to allow it to talk to the scanner)
(`--privileged` is required for the container to access the host's devices, to
allow it to talk to the scanner)

scanservjs will now be accessible from `http://your-computer's-ip-here:8080/`
scanservjs will now be accessible from `http://$host:8080/`

## manual installation
* See the installation notes [here](docs/install.md)
If you want to install the latest staging branch (this may contain newer code)

# background
This is yet another scanimage-web-front-end. Why?
```console
docker pull sbs20/scanservjs:staging
docker rm --force scanservjs-container 2> /dev/null
docker run -d -p 8080:8080 --restart unless-stopped --name scanservjs-container --privileged sbs20/scanservjs:staging
```

More installation options:

* I wanted a simple server which would simply scan an image with as little
dependency on other software as possible. I already have Photoshop / GIMP
I don't need a webapp to do that stuff
* Desire for easier and cleaner set up and configuration
* Separation of presentation and control logic with json-rpc
* I just wanted to
* Manual installation notes [here](docs/install.md)
* [Development notes](docs/development.md)
* [Configuring the scanner and SANE](docs/sane.md)

# roadmap
* ES2016
* Setup page (auto diagnostics)
* Configuration page for debugging set up assisting new users
* Multi-language support
## 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](https://github.com/sbs20/scanserv) but is no longer
maintained. Then, I just wanted to write in node, and it's been a labour of love
ever since.

# acknowledgements
## Roadmap
* Configuration page for debugging set up assisting new users
* Multi-language support

## Acknowledgements
* This project owes a lot to [phpsane](http://sourceforge.net/projects/phpsane/)
* In many respects phpsane is more powerful than this. Scanservjs does not
support jpeg conversion or OCR. phpSANE, however, is also more brittle and
somewhat dated in its implementation.

# more about SANE

## More about SANE
* http://www.sane-project.org/
5 changes: 5 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}
108 changes: 0 additions & 108 deletions classes/Api.js

This file was deleted.

Loading

0 comments on commit 3991fa5

Please sign in to comment.