diff --git a/.travis.yml b/.travis.yml index 2db24da8..248eebb6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,35 @@ language: python -python: - - "3.6" - - "3.7" - - "3.8" +jobs: + include: + - name: "Paperless on Python 3.6" + python: "3.6" + + - name: "Paperless on Python 3.7" + python: "3.7" + + - name: "Paperless on Python 3.8" + python: "3.8" + + - name: "Documentation" + script: + - cd docs/ + - make html + after_success: true + + - name: "Front end" + language: node_js + node_js: + - 15 + before_install: true + install: + - cd src-ui/ + - npm install -g @angular/cli + - npm install + script: + - ng build --prod + after_success: true + before_install: - sudo apt-get update -qq diff --git a/docs/changelog.rst b/docs/changelog.rst index 2af97b33..8f01d0d9 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -8,6 +8,9 @@ Changelog next #### +* Major changes to the front end (colors, shadows, layout of the cards, + better mobile support) + * Paperless now uses mime types and libmagic detection to determine if a file type is supported and which parser to use. Removes all file type checks that where present in MANY different places in @@ -17,30 +20,25 @@ next content type was not set correctly. (i.e. PDF documents with content type ``application/octet-stream``) -* Docker entrypoint script awaits the database server if it is - configured. - -* Basic sorting of mail rules added. - -* Disabled editing of logs. +* Basic sorting of mail rules added * Much better admin for mail rule editing. +* Docker entrypoint script awaits the database server if it is + configured. + +* Disabled editing of logs. + +* New setting ``PAPERLESS_OCR_PAGES`` limits the tesseract parser + to the first n pages of scanned documents. + +* Fixed a bug where tasks with too long task names would not show + up in the admin. paperless-ng 0.9.1 ################## -* Moved documentation of the settings to the actual documentation. -* Updated release script to force the user to choose between SQLite - and PostgreSQL. This avoids confusion when upgrading from paperless. - - -paperless-ng 0.9.0 -################## - -* **Deprecated:** GnuPG. :ref:`See this note on the state of GnuPG in paperless-ng. ` - This features will most likely be removed in future versions. - +* Moved documentation of the settings VG271UP * **Added:** New frontend. Features: * Single page application: It's much more responsive than the django admin pages. diff --git a/docs/configuration.rst b/docs/configuration.rst index 1ddd7ca0..afb0b5f9 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -184,6 +184,16 @@ PAPERLESS_TIME_ZONE= +PAPERLESS_OCR_PAGES= + Tells paperless to use only the specified amount of pages for OCR. Documents + with less than the specified amount of pages get OCR'ed completely. + + Specifying 1 here will only use the first page. + + Defaults to 0, which disables this feature and always uses all pages. + + + PAPERLESS_OCR_LANGUAGE= Customize the default language that tesseract will attempt to use when parsing documents. The default language is used whenever diff --git a/docs/setup.rst b/docs/setup.rst index 5520f559..dff60588 100644 --- a/docs/setup.rst +++ b/docs/setup.rst @@ -358,4 +358,30 @@ management commands as below. 7. Start paperless. +Considerations for less powerful devices +######################################## + +Paperless runs on Raspberry Pi. However, some things are rather slow on the Pi and +configuring some options in paperless can help improve performance immensely: + +* Consider setting ``PAPERLESS_OCR_PAGES`` to 1, so that paperless will only OCR + the first page of your documents. +* ``PAPERLESS_TASK_WORKERS`` and ``PAPERLESS_THREADS_PER_WORKER`` are configured + to use all cores. The Raspberry Pi models 3 and up have 4 cores, meaning that + paperless will use 2 workers and 2 threads per worker. This may result in + slugish response times during consumption, so you might want to lower these + settings (example: 2 workers and 1 thread to always have some computing power + left for other tasks). +* Keep ``PAPERLESS_OCR_ALWAYS`` at its default value 'false' and consider OCR'ing + your documents before feeding them into paperless. Some scanners are able to + do this! +* Lower ``PAPERLESS_CONVERT_DENSITY`` from its default value 300 to 200. This + will still result in rather accurate OCR, but will decrease consumption time + by quite a bit. +* Set ``PAPERLESS_OPTIMIZE_THUMBNAILS`` to 'false' if you want faster consumption + times. Thumbnails will be about 20% larger. + +For details, refer to :ref:`configuration`. + + .. _redis: https://redis.io/ diff --git a/paperless.conf.example b/paperless.conf.example index e1fd17a7..4749151e 100644 --- a/paperless.conf.example +++ b/paperless.conf.example @@ -35,6 +35,7 @@ #PAPERLESS_TASK_WORKERS=1 #PAPERLESS_THREADS_PER_WORKER=1 #PAPERLESS_TIME_ZONE=UTC +#PAPERLESS_OCR_PAGES=1 #PAPERLESS_OCR_LANGUAGE=eng #PAPERLESS_OCR_ALWAYS=false #PAPERLESS_CONSUMER_POLLING=10 diff --git a/scripts/make-release.sh b/scripts/make-release.sh index 6860b4ae..06548748 100755 --- a/scripts/make-release.sh +++ b/scripts/make-release.sh @@ -94,7 +94,7 @@ cp "$PAPERLESS_ROOT/docker/supervisord.conf" "$PAPERLESS_DIST_APP/docker/" cd "$PAPERLESS_DIST_APP" -docker-compose -f docker-compose.postgres.yml build +docker build . -t "jonaswinkler/paperless-ng:$VERSION" # works. package the app! diff --git a/src-ui/angular.json b/src-ui/angular.json index aca54b8e..2ff1bb3b 100644 --- a/src-ui/angular.json +++ b/src-ui/angular.json @@ -1,126 +1,130 @@ { - "$schema": "./node_modules/@angular/cli/lib/config/schema.json", - "version": 1, - "newProjectRoot": "projects", - "projects": { - "paperless-ui": { - "projectType": "application", - "schematics": {}, - "root": "", - "sourceRoot": "src", - "prefix": "app", - "architect": { - "build": { - "builder": "@angular-devkit/build-angular:browser", - "options": { - "outputPath": "dist/paperless-ui", - "outputHashing": "none", - "index": "src/index.html", - "main": "src/main.ts", - "polyfills": "src/polyfills.ts", - "tsConfig": "tsconfig.app.json", - "aot": true, - "assets": [ - "src/favicon.ico", - "src/assets" - ], - "styles": [ - "node_modules/bootstrap/dist/css/bootstrap.min.css", - "src/styles.css" - ], - "scripts": [] - }, - "configurations": { - "production": { - "fileReplacements": [ - { - "replace": "src/environments/environment.ts", - "with": "src/environments/environment.prod.ts" - } - ], - "optimization": true, - "outputHashing": "none", - "sourceMap": false, - "extractCss": true, - "namedChunks": false, - "extractLicenses": true, - "vendorChunk": false, - "buildOptimizer": true, - "budgets": [ - { - "type": "initial", - "maximumWarning": "2mb", - "maximumError": "5mb" - }, - { - "type": "anyComponentStyle", - "maximumWarning": "6kb", - "maximumError": "10kb" - } - ] - } - } - }, - "serve": { - "builder": "@angular-devkit/build-angular:dev-server", - "options": { - "browserTarget": "paperless-ui:build" - }, - "configurations": { - "production": { - "browserTarget": "paperless-ui:build:production" - } - } - }, - "extract-i18n": { - "builder": "@angular-devkit/build-angular:extract-i18n", - "options": { - "browserTarget": "paperless-ui:build" - } - }, - "test": { - "builder": "@angular-devkit/build-angular:karma", - "options": { - "main": "src/test.ts", - "polyfills": "src/polyfills.ts", - "tsConfig": "tsconfig.spec.json", - "karmaConfig": "karma.conf.js", - "assets": [ - "src/favicon.ico", - "src/assets" - ], - "styles": [ - "src/styles.css" - ], - "scripts": [] - } - }, - "lint": { - "builder": "@angular-devkit/build-angular:tslint", - "options": { - "tsConfig": [ - "tsconfig.app.json", - "tsconfig.spec.json", - "e2e/tsconfig.json" - ], - "exclude": [ - "**/node_modules/**" - ] - } - }, - "e2e": { - "builder": "@angular-devkit/build-angular:protractor", - "options": { - "protractorConfig": "e2e/protractor.conf.js", - "devServerTarget": "paperless-ui:serve" - }, - "configurations": { - "production": { - "devServerTarget": "paperless-ui:serve:production" - } - } - } - } - }}, - "defaultProject": "paperless-ui" -} + "$schema": "./node_modules/@angular/cli/lib/config/schema.json", + "version": 1, + "newProjectRoot": "projects", + "projects": { + "paperless-ui": { + "projectType": "application", + "schematics": { + "@schematics/angular:component": { + "style": "scss" + } + }, + "root": "", + "sourceRoot": "src", + "prefix": "app", + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:browser", + "options": { + "outputPath": "dist/paperless-ui", + "outputHashing": "none", + "index": "src/index.html", + "main": "src/main.ts", + "polyfills": "src/polyfills.ts", + "tsConfig": "tsconfig.app.json", + "aot": true, + "assets": [ + "src/favicon.ico", + "src/assets" + ], + "styles": [ + "src/styles.scss" + ], + "scripts": [] + }, + "configurations": { + "production": { + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.prod.ts" + } + ], + "optimization": true, + "outputHashing": "none", + "sourceMap": false, + "extractCss": true, + "namedChunks": false, + "extractLicenses": true, + "vendorChunk": false, + "buildOptimizer": true, + "budgets": [ + { + "type": "initial", + "maximumWarning": "2mb", + "maximumError": "5mb" + }, + { + "type": "anyComponentStyle", + "maximumWarning": "6kb", + "maximumError": "10kb" + } + ] + } + } + }, + "serve": { + "builder": "@angular-devkit/build-angular:dev-server", + "options": { + "browserTarget": "paperless-ui:build" + }, + "configurations": { + "production": { + "browserTarget": "paperless-ui:build:production" + } + } + }, + "extract-i18n": { + "builder": "@angular-devkit/build-angular:extract-i18n", + "options": { + "browserTarget": "paperless-ui:build" + } + }, + "test": { + "builder": "@angular-devkit/build-angular:karma", + "options": { + "main": "src/test.ts", + "polyfills": "src/polyfills.ts", + "tsConfig": "tsconfig.spec.json", + "karmaConfig": "karma.conf.js", + "assets": [ + "src/favicon.ico", + "src/assets" + ], + "styles": [ + "src/styles.scss" + ], + "scripts": [] + } + }, + "lint": { + "builder": "@angular-devkit/build-angular:tslint", + "options": { + "tsConfig": [ + "tsconfig.app.json", + "tsconfig.spec.json", + "e2e/tsconfig.json" + ], + "exclude": [ + "**/node_modules/**" + ] + } + }, + "e2e": { + "builder": "@angular-devkit/build-angular:protractor", + "options": { + "protractorConfig": "e2e/protractor.conf.js", + "devServerTarget": "paperless-ui:serve" + }, + "configurations": { + "production": { + "devServerTarget": "paperless-ui:serve:production" + } + } + } + } + } + }, + "defaultProject": "paperless-ui" +} \ No newline at end of file diff --git a/src-ui/src/app/app.component.css b/src-ui/src/app/app.component.scss similarity index 100% rename from src-ui/src/app/app.component.css rename to src-ui/src/app/app.component.scss diff --git a/src-ui/src/app/app.component.ts b/src-ui/src/app/app.component.ts index a6cd8beb..84c173a1 100644 --- a/src-ui/src/app/app.component.ts +++ b/src-ui/src/app/app.component.ts @@ -3,7 +3,7 @@ import { Component } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html', - styleUrls: ['./app.component.css'] + styleUrls: ['./app.component.scss'] }) export class AppComponent { diff --git a/src-ui/src/app/app.module.ts b/src-ui/src/app/app.module.ts index 014279cc..3ccb1c5f 100644 --- a/src-ui/src/app/app.module.ts +++ b/src-ui/src/app/app.module.ts @@ -41,6 +41,10 @@ import { TagsComponent } from './components/common/input/tags/tags.component'; import { SortableDirective } from './directives/sortable.directive'; import { CookieService } from 'ngx-cookie-service'; import { CsrfInterceptor } from './interceptors/csrf.interceptor'; +import { SavedViewWidgetComponent } from './components/dashboard/widgets/saved-view-widget/saved-view-widget.component'; +import { StatisticsWidgetComponent } from './components/dashboard/widgets/statistics-widget/statistics-widget.component'; +import { UploadFileWidgetComponent } from './components/dashboard/widgets/upload-file-widget/upload-file-widget.component'; +import { WidgetFrameComponent } from './components/dashboard/widgets/widget-frame/widget-frame.component'; @NgModule({ declarations: [ @@ -74,7 +78,11 @@ import { CsrfInterceptor } from './interceptors/csrf.interceptor'; SaveViewConfigDialogComponent, DateTimeComponent, TagsComponent, - SortableDirective + SortableDirective, + SavedViewWidgetComponent, + StatisticsWidgetComponent, + UploadFileWidgetComponent, + WidgetFrameComponent ], imports: [ BrowserModule, diff --git a/src-ui/src/app/components/app-frame/app-frame.component.html b/src-ui/src/app/components/app-frame/app-frame.component.html index 1232ecf1..3f326afd 100644 --- a/src-ui/src/app/components/app-frame/app-frame.component.html +++ b/src-ui/src/app/components/app-frame/app-frame.component.html @@ -1,24 +1,17 @@ -