├── .gitignore ├── lib ├── logging_windows.go ├── logging.go ├── util_test.go ├── helpers_test.go ├── cli.go ├── model.go ├── search_test.go ├── util.go ├── image.go ├── search.go ├── cmdchain.go ├── rest.go ├── cmdchain_test.go ├── sqlitedb.go └── sqlitedb_test.go ├── web └── paperless-frontend │ ├── babel.config.js │ ├── public │ ├── favicon.ico │ └── index.html │ ├── src │ ├── assets │ │ └── logo.png │ ├── rest.js │ ├── main.js │ └── App.vue │ ├── .gitignore │ ├── vue.config.js │ ├── README.md │ └── package.json ├── docker ├── Dockerfile └── run.sh ├── clipper ├── qtclipper.pro └── qtclipper.cpp ├── go.mod ├── paperless.go ├── LICENSE ├── README.org ├── go.sum └── uploader └── uploader.go /.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | paperless -------------------------------------------------------------------------------- /lib/logging_windows.go: -------------------------------------------------------------------------------- 1 | 2 | // +build windows 3 | 4 | package paperless 5 | 6 | func SetupLogging() { 7 | } 8 | -------------------------------------------------------------------------------- /web/paperless-frontend/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /web/paperless-frontend/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kopoli/paperless/HEAD/web/paperless-frontend/public/favicon.ico -------------------------------------------------------------------------------- /web/paperless-frontend/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kopoli/paperless/HEAD/web/paperless-frontend/src/assets/logo.png -------------------------------------------------------------------------------- /web/paperless-frontend/src/rest.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios'; 2 | 3 | var base = '/api/v1/'; 4 | 5 | export const ImageApi = axios.create({ 6 | baseURL: base + 'image', 7 | timeout: 60000 8 | }); 9 | 10 | export const TagApi = axios.create({ 11 | baseURL: base + 'tag', 12 | timeout: 60000 13 | }); 14 | -------------------------------------------------------------------------------- /web/paperless-frontend/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | 4 | import vmodal from 'vue-js-modal' 5 | 6 | import Paginate from 'vuejs-paginate' 7 | Vue.component('paginate', Paginate) 8 | 9 | Vue.use(vmodal) 10 | 11 | new Vue({ 12 | el: '#app', 13 | render: h => h(App) 14 | }) 15 | -------------------------------------------------------------------------------- /web/paperless-frontend/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | pnpm-debug.log* 14 | 15 | # Editor directories and files 16 | .idea 17 | .vscode 18 | *.suo 19 | *.ntvs* 20 | *.njsproj 21 | *.sln 22 | *.sw? 23 | -------------------------------------------------------------------------------- /lib/logging.go: -------------------------------------------------------------------------------- 1 | 2 | // +build !windows 3 | 4 | package paperless 5 | 6 | import ( 7 | "log" 8 | "log/syslog" 9 | 10 | ) 11 | 12 | func SetupLogging() { 13 | syslg, err := syslog.New(syslog.LOG_ERR|syslog.LOG_DAEMON, "paperless") 14 | if err != nil { 15 | log.Fatal("Creating a syslog logger failed") 16 | } 17 | log.SetOutput(syslg) 18 | } 19 | -------------------------------------------------------------------------------- /docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | 3 | RUN \ 4 | /bin/sed -i -e 's,http://archive.ubuntu.com/ubuntu,mirror://mirrors.ubuntu.com/mirrors.txt,g' /etc/apt/sources.list && \ 5 | apt-get update && \ 6 | apt-get -y upgrade && \ 7 | apt-get install -y unpaper imagemagick tesseract-ocr tesseract-ocr-fin && \ 8 | rm -rf /var/lib/apt/lists/* 9 | 10 | EXPOSE 8078 11 | 12 | CMD [ "/paperless" ] 13 | -------------------------------------------------------------------------------- /web/paperless-frontend/vue.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | publicPath: process.env.NODE_ENV === 'production' 3 | ? '/dist/' 4 | : '/', 5 | devServer: { 6 | proxy: { 7 | '/api/v1': { 8 | target: 'http://localhost:8078', 9 | secure: false 10 | }, 11 | '/static/': { 12 | target: 'http://localhost:8078', 13 | secure: false 14 | } 15 | } 16 | } 17 | }; 18 | -------------------------------------------------------------------------------- /web/paperless-frontend/README.md: -------------------------------------------------------------------------------- 1 | # jeejee 2 | 3 | ## Project setup 4 | ``` 5 | npm install 6 | ``` 7 | 8 | ### Compiles and hot-reloads for development 9 | ``` 10 | npm run serve 11 | ``` 12 | 13 | ### Compiles and minifies for production 14 | ``` 15 | npm run build 16 | ``` 17 | 18 | ### Lints and fixes files 19 | ``` 20 | npm run lint 21 | ``` 22 | 23 | ### Customize configuration 24 | See [Configuration Reference](https://cli.vuejs.org/config/). 25 | -------------------------------------------------------------------------------- /docker/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | die() { 4 | echo "Error: $@" 1>&2 5 | exit 1 6 | } 7 | 8 | PAPERLESS=../paperless 9 | IMG=ubuntu-16.04-paperless:latest 10 | DATADIR=../docker-data 11 | 12 | set -x 13 | 14 | test -e "$PAPERLESS" || die "Build paperless before trying to run this" 15 | 16 | mkdir -p $DATADIR 17 | 18 | docker build . -t $IMG || die "Could not build the docker image" 19 | 20 | docker run -v $PWD/$PAPERLESS:/paperless -v $PWD/$DATADIR:/data \ 21 | --rm \ 22 | $IMG 23 | -------------------------------------------------------------------------------- /clipper/qtclipper.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2012-10-07T16:31:27 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | CONFIG += c++11 warn_on release 12 | 13 | release { 14 | DEFINES += QT_NO_DEBUG_OUTPUT 15 | } 16 | debug { 17 | QMAKE_CFLAGS_WARN_ON = -Wall -Werror -Wundef -Wextra 18 | QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON 19 | } 20 | 21 | TARGET = qtclipper 22 | TEMPLATE = app 23 | 24 | SOURCES += qtclipper.cpp 25 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/kopoli/paperless 2 | 3 | go 1.14 4 | 5 | require ( 6 | github.com/davecgh/go-spew v1.1.1 7 | github.com/gamegos/jsend v0.0.0-20151011171802-f47e169f3d76 8 | github.com/go-chi/chi v4.1.1+incompatible 9 | github.com/go-chi/docgen v1.0.5 10 | github.com/jawher/mow.cli v1.1.0 11 | github.com/jmoiron/sqlx v1.2.0 12 | github.com/kopoli/go-util v0.0.0-20180512085434-f355416491c0 13 | github.com/mattn/go-sqlite3 v2.0.3+incompatible 14 | github.com/pkg/errors v0.9.1 // indirect 15 | github.com/pmezard/go-difflib v1.0.0 16 | github.com/stretchr/testify v1.3.0 17 | google.golang.org/appengine v1.6.6 // indirect 18 | ) 19 | -------------------------------------------------------------------------------- /web/paperless-frontend/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 |{{info.showLog ? info.image.ProcessLog : info.image.Text}}
81 |
82 |
83 |
84 |