Paperless NGX "all in once"

Hier ist eine fertige paperless composedatei für Portainer.
Diese Version von Paperless-NGX ist aufgepimpt und beherrscht zusätzlich:
Officeformate, docx, odt …
Mail.body: eml
Signierte Pdf

Wer das öffentlich betreiben will bitte das Kommentar tag in der Zeile: # PAPERLESS_SECRET_KEY rausnehmen und eine zufällige Zeichenfolge eintragen min 18 Zeichen. Am einfachsten: Konsole öffnen, openssl rand -hex 32 eingeben und Zeichenfolge kopieren. Keine Angst, das braucht man sich nicht merken.

# Docker Compose file for running paperless from the docker container registry.
# This file contains everything paperless needs to run.
# Paperless supports amd64, arm and arm64 hardware.
#
# All compose files of paperless configure paperless in the following way:
#
# - Paperless is (re)started on system boot, if it was running before shutdown.
# - Docker volumes for storing data are managed by Docker.
# - Folders for importing and exporting files are created in the same directory
#   as this file and mounted to the correct folders inside the container.
# - Paperless listens on port 8000.
#
# In addition to that, this Docker Compose file adds the following optional
# configurations:
#
# - Instead of SQLite (default), PostgreSQL is used as the database server.
# - Apache Tika and Gotenberg servers are started with paperless and paperless
#   is configured to use these services. These provide support for consuming
#   Office documents (Word, Excel, PowerPoint and their LibreOffice counter-
#   parts).
#
# To install and update paperless with this file, do the following:
#
# - Copy this file as 'docker-compose.yml' and the files 'docker-compose.env'
#   and '.env' into a folder.
# - Run 'docker compose pull'.
# - Run 'docker compose up -d'.
#
# For more extensive installation and update instructions, refer to the
# documentation.
services:
  broker:
    image: docker.io/library/redis:8
    restart: unless-stopped
    volumes:
      - redisdata:/data
  db:
    image: docker.io/library/postgres:18
    restart: unless-stopped
    volumes:
      - pgdata:/var/lib/postgresql
    environment:
      POSTGRES_DB: paperless
      POSTGRES_USER: paperless
      POSTGRES_PASSWORD: paperless
  webserver:
    image: ghcr.io/paperless-ngx/paperless-ngx:latest
    restart: unless-stopped
    depends_on:
      - db
      - broker
      - gotenberg
      - tika
    ports:
      - "8000:8000"
    volumes:
      - data:/usr/src/paperless/data
      - media:/usr/src/paperless/media
      - ./export:/usr/src/paperless/export
      - ./consume:/usr/src/paperless/consume
    environment:
      PAPERLESS_TIME_ZONE: Europe/Berlin
      PAPERLESS_OCR_USER_ARGS: '{"invalidate_digital_signatures": true}'
      PAPERLESS_OCR_LANGUAGE: deu
      PAPERLESS_OCR_LANGUAGES: eng
      # PAPERLESS_SECRET_KEY: hier eine zufällige Zeichenfolge einfügen z.b.(openssl rand -hex 32)
      PAPERLESS_URL: https://paper.int.de
      PAPERLESS_REDIS: redis://broker:6379
      PAPERLESS_DBHOST: db
      PAPERLESS_TIKA_ENABLED: 1
      PAPERLESS_TIKA_GOTENBERG_ENDPOINT: http://gotenberg:3000
      PAPERLESS_TIKA_ENDPOINT: http://tika:9998
  gotenberg:
    image: docker.io/gotenberg/gotenberg:8.24
    restart: unless-stopped
    # The gotenberg chromium route is used to convert .eml files. We do not
    # want to allow external content like tracking pixels or even javascript.
    command:
      - "gotenberg"
      - "--chromium-disable-javascript=true"
      - "--chromium-allow-list=file:///tmp/.*"
  tika:
    image: docker.io/apache/tika:latest
    restart: unless-stopped
volumes:
  data:
  media:
  pgdata:
  redisdata:

in Portainer /add Stack
in den /Webeditor die Compose kopieren
Name “paperless” oben eingeben nicht vergessen
auf deployen klicken und warten.

Danach in https://portal.int.de/caddy_configuration/ auf manuell hinzufügen:

paper.int.de {
  tls internal
  reverse_proxy localhost:8000
}

fertig.

2 „Gefällt mir“

Sehr interessant, schaue ich mir mal an! :slight_smile:

1 „Gefällt mir“

ich hätte das gerne als addon gebaut, aber das .env file wird substituiert.

1 „Gefällt mir“

Wie meinst Du das genau?
man kann ja das Addon aus dem Generator dann noch anpassen, wie man es braucht.
Gerne helfe ich Dir dabei.

1 „Gefällt mir“

ja kann man anpassen, aber deine auto replace env im setup script funkt mir immer dazwischen.

1 „Gefällt mir“

Kannst ja danach noch weiter anpassen.
Aber was genau da drinnen stört Dich da?

ok, da muss ich dann noch mal reingucken, ist ein paar tage her :slight_smile:

ok, hier ist die setup

#!/bin/bash

mkdir -p /root/paperlessngx
cp docker-compose.yml /root/paperlessngx/

secret_key=$(openssl rand -hex 32)

# Write docker-compose.env file
echo "
# Map to www-data
USERMAP_UID=33
USERMAP_GID=33
PAPERLESS_URL=https://paper.$DOMAIN
PAPERLESS_SECRET_KEY=$secret_key
PAPERLESS_TIME_ZONE=Europe/Berlin
PAPERLESS_OCR_USER_ARGS: '{"invalidate_digital_signatures": true}'
PAPERLESS_OCR_LANGUAGE=deu
PAPERLESS_OCR_LANGUAGES=eng
PAPERLESS_ADMIN_USER=Administrator
PAPERLESS_ADMIN_PASSWORD=$ADMIN_PASSWORD
PAPERLESS_REDIS: redis://broker:6379
PAPERLESS_DBHOST: db
PAPERLESS_TIKA_ENABLED: 1
PAPERLESS_TIKA_GOTENBERG_ENDPOINT: http://gotenberg:3000
PAPERLESS_TIKA_ENDPOINT: http://tika:9998
" > /root/paperlessngx/docker-compose.env

docker-compose -f /root/paperlessngx/docker-compose.yml up -d

echo "paper.$DOMAIN {
    #tls internal
    reverse_proxy localhost:8000
}

" >> /etc/caddy/Caddyfile

# If domain is "int.de" uncomment the tls internal line for internal https
if [ "$DOMAIN" = "int.de" ]; then
    sed -i 's/#tls internal/tls internal/g' /etc/caddy/Caddyfile
fi

systemctl reload caddy

die zeile

> /root/paperlessngx/docker-compose.env

hätte die .enf in das rottfolder von paperless schreiben müssen, das ich dann in der .yml vermerkt habe.
die .env ist aber überschrieben worden. ich hatte vermutet, dass du da eine “magic ldap automatic” gebaut hast.

1 „Gefällt mir“

Nein, eine Magic LDAP Implementierung gibt es nicht, auch nur simples Bash :slight_smile: