Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add paperless ngx #651

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 9 additions & 12 deletions roles/paperless_ng/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
paperless_ng_enabled: false
paperless_ng_available_externally: false

# directories
paperless_ng_config_directory: "{{ docker_home }}/paperless_ng"
paperless_ng_files_directory: "{{ documents_root }}/paperless"

paperless_ng_postgres_directory: "{{ paperless_ng_config_directory }}/postgres"
paperless_ng_data_directory: "{{ paperless_ng_config_directory }}/data"
paperless_ng_export_directory: "{{ paperless_ng_config_directory }}/export"
paperless_ng_media_directory: "{{ paperless_ng_files_directory }}/media"
Expand All @@ -15,25 +15,22 @@ paperless_ng_consume_directory: "{{ paperless_ng_files_directory }}/consume"
paperless_ng_port: "16922"
paperless_ng_hostname: "paperless_ng"

# postgres
paperless_ng_postgres_db: "paperless"
paperless_ng_postgres_user: "paperless"
paperless_ng_postgres_password: "paperless"

# container names
paperless_ng_container_network_name: "paperless_ng_network"
paperless_ng_container_name_redis: "paperless_ng_redis"
paperless_ng_container_name_postgres: "paperless_ng_postgres"
paperless_ng_container_name_uiserver: "paperless_ng_uiserver"
paperless_ng_container_network_name: "paperless_ngx_network"
paperless_ng_container_name_redis: "paperless_ngx_redis"
paperless_ng_container_name_uiserver: "paperless_ngx_uiserver"
paperless_ng_container_name_tika: "paperless_ngx_tika"
paperless_ng_container_name_gotenberg: "paperless_ngx_gotenberg"

# uid/guid
paperless_ng_user_id: "1000"
paperless_ng_group_id: "1000"

# settings
paperless_ng_languages: "deu eng"
paperless_ng_languages: "eng"

# specs
paperless_ng_ui_memory: 1g
paperless_ng_postgres_memory: 1g
paperless_ng_redis_memory: 1g
paperless_ng_tika_memory: 1g
paperless_ng_gotenberg_memory: 1g
48 changes: 30 additions & 18 deletions roles/paperless_ng/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,13 @@
path: "{{ item }}"
state: directory
with_items:
- "{{ paperless_ng_config_directory }}"
- "{{ paperless_ng_files_directory }}"
- "{{ paperless_ng_postgres_directory }}"
- "{{ paperless_ng_data_directory }}"
- "{{ paperless_ng_export_directory }}"
- "{{ paperless_ng_media_directory }}"
- "{{ paperless_ng_consume_directory }}"


- name: Create paperless_ng network
- name: Create paperless_ngx network
docker_network:
name: "{{ paperless_ng_container_network_name }}"

Expand All @@ -27,27 +24,33 @@
networks:
- name: "{{ paperless_ng_container_network_name }}"

- name: Create paperless_ng postgres Docker Container
- name: Create paperless_ngx gotenberg service
docker_container:
name: "{{ paperless_ng_container_name_postgres }}"
image: postgres:13
name: "{{ paperless_ng_container_name_gotenberg }}"
image: thecodingmachine/gotenberg
pull: true
volumes:
- "{{ paperless_ng_postgres_directory }}:/var/lib/postgresql/data"
restart_policy: unless-stopped

env:
POSTGRES_DB: "{{ paperless_ng_postgres_db }}"
POSTGRES_USER: "{{ paperless_ng_postgres_user }}"
POSTGRES_PASSWORD: "{{ paperless_ng_postgres_password }}"
DISABLE_GOOGLE_CHROME: "1"
networks:
- name: "{{ paperless_ng_container_network_name }}"

- name: Create paperless_ngx tika service
docker_container:
name: "{{ paperless_ng_container_name_tika }}"
image: apache/tika
pull: true
restart_policy: unless-stopped
memory: "{{ paperless_ng_postgres_memory }}"
networks:
- name: "{{ paperless_ng_container_network_name }}"

- name: Create paperless_ng UI Docker Container
docker_container:
name: "{{ paperless_ng_container_name_uiserver }}"
image: jonaswinkler/paperless-ng:latest
image: paperlessngx/paperless-ngx:latest
pull: true
restart_policy: unless-stopped
volumes:
- "{{ paperless_ng_data_directory }}:/usr/src/paperless/data"
- "{{ paperless_ng_media_directory }}:/usr/src/paperless/media"
Expand All @@ -56,12 +59,21 @@
ports:
- "{{ paperless_ng_port }}:8000"
env:
PAPERLESS_REDIS: "redis://{{ paperless_ng_container_name_redis | string }}:6379"
PAPERLESS_DBHOST: "{{ paperless_ng_container_name_postgres | string }}"
USERMAP_UID: "{{ paperless_ng_user_id }}"
USERMAP_GID: "{{ paperless_ng_group_id }}"
PAPERLESS_OCR_LANGUAGES: "{{ paperless_ng_languages }}"
restart_policy: unless-stopped
PAPERLESS_URL: "https://{{ paperless_ng_hostname }}.{{ ansible_nas_domain }}"
PAPERLESS_REDIS: "redis://{{ paperless_ng_container_name_redis | string }}:6379"
PAPERLESS_OCR_LANGUAGE: "{{ paperless_ng_languages }}"
PAPERLESS_TIKA_ENABLED: "1"
PAPERLESS_TIKA_GOTENBERG_ENDPOINT: "http://{{ paperless_ng_container_name_gotenberg }}:3000"
PAPERLESS_TIKA_ENDPOINT: "http://{{ paperless_ng_container_name_tika }}:9998"
memory: "{{ paperless_ng_ui_memory }}"
networks:
- name: "{{ paperless_ng_container_network_name }}"
labels:
traefik.enable: "{{ paperless_ng_available_externally | string }}"
traefik.http.routers.paperless_ng.rule: "Host(`{{ paperless_ng_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.paperless_ng.tls.certresolver: "letsencrypt"
traefik.http.routers.paperless_ng.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.paperless_ng.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.paperless_ng.loadbalancer.server.port: "8000"
6 changes: 3 additions & 3 deletions website/docs/applications/other/paperless_ng.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
title: "Paperless-ng"
title: "Paperless-ngx"
---

Homepage: <https://github.com/jonaswinkler/paperless-ng>
Homepage: <https://github.com/paperless-ngx/paperless-ngx>

Paperless is an application by Daniel Quinn and contributors that indexes your scanned documents and allows you to easily search for documents and store metadata alongside your documents.

Paperless-ng is a fork of the original project, adding a new interface and many other changes under the hood
Paperless-ngx is a fork of fork of the original project, adding a new interface and many other changes under the hood

## Usage

Expand Down