### Install and Run UI Development Server Source: https://docs.papermerge.io/3.5/developer-manual/architecture Commands to install frontend dependencies and start the UI development server. This setup is similar to the core setup but includes the user interface. ```bash yarn install yarn workspace ui dev ``` -------------------------------- ### Start Docker Compose Source: https://docs.papermerge.io/3.5/setup/docker-compose Command to start the services defined in the docker-compose.yml file. ```bash docker compose up ``` -------------------------------- ### I3 Worker Args Example (With Prefix) Source: https://docs.papermerge.io/3.5/settings/i3worker Example of I3_WORKER_ARGS for a prefixed queue when PAPERMERGE__MAIN__PREFIX is set. For example, if PAPERMERGE__MAIN__PREFIX=demo, use -Q demo_i3. ```bash I3_WORKER_ARGS="-Q prefix_i3" ``` -------------------------------- ### PostgreSQL Database URL Example Source: https://docs.papermerge.io/3.5/settings/database?h=db.sqlite3 An example of a PostgreSQL database connection URL. ```sql postgresql://scott:tiger@db:5432/mydatabase ``` -------------------------------- ### Perform Data Export (Example 2) Source: https://docs.papermerge.io/3.5/pmdump Another example of the export command, demonstrating different configuration and output file names. ```bash pmdump -c examples/source_3_3_pg.yaml -f pm3.3_pg.tar.gz export ``` -------------------------------- ### Check Docker Installation Source: https://docs.papermerge.io/3.5/setup/requirements Verify that Docker is installed on your system by checking its version. This command is essential before proceeding with Docker-based installations. ```bash $ docker --version Docker version 26.1.3, build b72abbb ``` -------------------------------- ### Clone and Install Papermerge Core Source: https://docs.papermerge.io/3.5/developer-manual/architecture Steps to clone the papermerge-core repository and install dependencies using Poetry. Assumes git, python, and poetry are installed. ```bash git clone https://github.com/papermerge/papermerge-core cd papermerge-core/ poetry install poetry run task server ``` -------------------------------- ### Redis URL Example Source: https://docs.papermerge.io/3.5/settings/ocrworker An example of a Redis connection URL. ```redis redis://redis:6379/0 ``` -------------------------------- ### Docker Compose for S3 Backend Setup Source: https://docs.papermerge.io/3.5/setup/s3backend Example Docker Compose file demonstrating the configuration for Papermerge DMS with an S3 backend. This includes webapp, path_template_worker, s3worker, database, and redis services. ```yaml services: webapp: image: papermerge/papermerge:3.5.3 environment: PAPERMERGE__SECURITY__SECRET_KEY: "random-sequence-of-characters" PAPERMERGE__AUTH__USERNAME: admin PAPERMERGE__AUTH__PASSWORD: 1234 PAPERMERGE__DATABASE__URL: postgresql://coco:jumbo@db:5432/pmgdb PAPERMERGE__MAIN__MEDIA_ROOT: /var/media/pmg PAPERMERGE__REDIS__URL: redis://redis:6379/0 ports: - "12000:80" depends_on: - db - redis volumes: - media_root:/var/media/pmg path_template_worker: image: papermerge/path-tmpl-worker:0.4 command: worker environment: PAPERMERGE__DATABASE__URL: postgresql://coco:jumbo@db:5432/pmgdb PAPERMERGE__REDIS__URL: redis://redis:6379/0 PATH_TMPL_WORKER_ARGS: "-Q path_tmpl -c 2" depends_on: - db - redis s3worker: image: papermerge/s3worker:0.5.1 command: worker environment: PAPERMERGE__DATABASE__URL: postgresql://coco:jumbo@db:5432/pmgdb PAPERMERGE__REDIS__URL: redis://redis:6379/0 PAPERMERGE__MAIN__MEDIA_ROOT: /var/media/pmg PAPERMERGE__S3__BUCKET_NAME: pl S3_WORKER_ARGS: "-Q s3 -c 2" AWS_REGION_NAME: eu-central-1 AWS_ACCESS_KEY_ID: AL AWS_SECRET_ACCESS_KEY: sj depends_on: - db - redis volumes: - media_root:/var/media/pmg db: image: postgres:16.1 volumes: - pgdata:/var/lib/postgresql/data/ environment: POSTGRES_PASSWORD: jumbo POSTGRES_DB: pmgdb POSTGRES_USER: coco healthcheck: test: pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB interval: 5s timeout: 10s retries: 5 start_period: 10s redis: image: redis:7.2 ports: - "6379:6379" environment: ALLOW_EMPTY_PASSWORD: "yes" volumes: pgdata: media_root: ``` -------------------------------- ### Basic Docker Compose Setup Source: https://docs.papermerge.io/3.5/setup/docker-compose This configuration includes the web application, a path template worker, a PostgreSQL database, and Redis. It's a foundational setup for running Papermerge. ```yaml services: webapp: image: papermerge/papermerge:3.5.3 environment: PAPERMERGE__SECURITY__SECRET_KEY: 12345 PAPERMERGE__AUTH__USERNAME: admin PAPERMERGE__AUTH__PASSWORD: admin PAPERMERGE__DATABASE__URL: postgresql://coco:jumbo@db:5432/pmgdb PAPERMERGE__MAIN__MEDIA_ROOT: /var/media/pmg PAPERMERGE__REDIS__URL: redis://redis:6379/0 volumes: - media_root:/var/media/pmg ports: - "12000:80" depends_on: - db - redis path_template_worker: image: papermerge/path-tmpl-worker:0.4.1 command: worker environment: PAPERMERGE__DATABASE__URL: postgresql://coco:jumbo@db:5432/pmgdb PAPERMERGE__REDIS__URL: redis://redis:6379/0 PATH_TMPL_WORKER_ARGS: "-Q path_tmpl -c 2" depends_on: - redis db: image: postgres:16.1 volumes: - pgdata:/var/lib/postgresql/data/ environment: POSTGRES_PASSWORD: jumbo POSTGRES_DB: pmgdb POSTGRES_USER: coco healthcheck: test: pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB interval: 5s timeout: 10s retries: 5 start_period: 10s redis: image: redis:7.2 ports: - "6379:6379" environment: ALLOW_EMPTY_PASSWORD: "yes" volumes: pgdata: media_root: ``` -------------------------------- ### I3 Worker Args Example (No Prefix) Source: https://docs.papermerge.io/3.5/settings/i3worker Example of I3_WORKER_ARGS for a default queue named 'i3' when PAPERMERGE__MAIN__PREFIX is empty. ```bash I3_WORKER_ARGS="-Q i3" ``` -------------------------------- ### Import Configuration for PostgreSQL Destination Source: https://docs.papermerge.io/3.5/pmdump Example configuration file for importing data into a PostgreSQL database. ```yaml media_root: /home/eugen/DockerCompose/pm3.4-pg/media/ database_url: postgresql://coco:kesha@127.0.0.1:5432/pmg34?sslmode=disable app_version: 3.4 ``` -------------------------------- ### I3 Worker Args Example (Concurrency) Source: https://docs.papermerge.io/3.5/settings/i3worker Example of I3_WORKER_ARGS including concurrency settings for the Celery worker. ```bash I3_WORKER_ARGS="-Q i3 -c 2" ``` -------------------------------- ### Perform Data Import (SQLite) Source: https://docs.papermerge.io/3.5/pmdump Example of the import command when targeting a SQLite database. ```bash pmdump -c dest_sqlite.yaml -f /path/to/archive.tar.gz import ``` -------------------------------- ### MariaDB/MySQL Database URL Example Source: https://docs.papermerge.io/3.5/settings/ocrworker An example of a MariaDB or MySQL database connection URL. The scheme should be 'mysql'. ```sql mysql://myuser:mypass@db:3306/paperdb ``` -------------------------------- ### Import Configuration for SQLite Destination Source: https://docs.papermerge.io/3.5/pmdump Example configuration file for importing data into a SQLite database. ```yaml media_root: /home/eugen/DockerCompose/pm3.4-sqlite/media/ database_url: sqlite:///home/eugen/DockerCompose/pm3.4-sqlite/data/db.sqlite3 app_version: 3.4 ``` -------------------------------- ### Install pgloader on Debian/Ubuntu Source: https://docs.papermerge.io/3.5/admin-manual/db-migrations Installs the pgloader utility on Debian-based systems. This tool is essential for migrating data between databases. ```bash sudo apt update sudo apt install pgloader ``` -------------------------------- ### Execute User Listing Command Source: https://docs.papermerge.io/3.5/rest-api/token This example shows how to execute the `list_users.sh` script using a specific Docker container ID. ```bash $ docker exec d8b965388fd9 list_users.sh ``` -------------------------------- ### Start Papermerge DMS with Persistent Media Storage Source: https://docs.papermerge.io/3.5/setup/docker-compose This configuration enhances the basic setup by adding persistent storage for uploaded documents using a Docker volume named 'media_root'. The PAPERMERGE__MAIN__MEDIA_ROOT variable points to the internal directory where files are stored. ```yaml services: webapp: image: papermerge/papermerge:3.5.3 environment: PAPERMERGE__SECURITY__SECRET_KEY: 12345 PAPERMERGE__AUTH__USERNAME: admin PAPERMERGE__AUTH__PASSWORD: admin PAPERMERGE__DATABASE__URL: postgresql://coco:jumbo@db:5432/pmgdb PAPERMERGE__MAIN__MEDIA_ROOT: /var/media/pmg volumes: - media_root:/var/media/pmg ports: - "12000:80" depends_on: - db db: image: postgres:16.1 volumes: - pgdata:/var/lib/postgresql/data/ environment: POSTGRES_PASSWORD: jumbo POSTGRES_DB: pmgdb POSTGRES_USER: coco healthcheck: test: pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB interval: 5s timeout: 10s retries: 5 start_period: 10s volumes: pgdata: media_root: ``` -------------------------------- ### Configure OIDC Scope Source: https://docs.papermerge.io/3.5/settings/auth Define the OIDC scopes delimited by spaces. Example includes 'openid', 'email', and 'profile'. ```bash PAPERMERGE__AUTH_OIDC_SCOPE="openid email profile" ``` -------------------------------- ### Get PMDump Help Source: https://docs.papermerge.io/3.5/pmdump Display help information for the PMDump tool, showing available commands and flags. ```bash pmdump -h ``` -------------------------------- ### Example Solr Search URL Source: https://docs.papermerge.io/3.5/settings/search An example of a Solr search engine URL for Papermerge DMS. ```plaintext solr://solr:8983/pmg-index ``` -------------------------------- ### Docker Compose Setup with S3 Object Storage Source: https://docs.papermerge.io/3.5/setup/docker-compose This configuration extends the basic setup by adding an S3 worker for synchronizing media storage with remote S3 buckets. It requires AWS credentials and S3 bucket configuration. ```yaml services: webapp: image: papermerge/papermerge:3.5.3 environment: PAPERMERGE__SECURITY__SECRET_KEY: 12345 PAPERMERGE__AUTH__USERNAME: admin PAPERMERGE__AUTH__PASSWORD: admin PAPERMERGE__DATABASE__URL: postgresql://coco:jumbo@db:5432/pmgdb PAPERMERGE__MAIN__MEDIA_ROOT: /var/media/pmg PAPERMERGE__REDIS__URL: redis://redis:6379/0 volumes: - media_root:/var/media/pmg ports: - "12000:80" depends_on: - db - redis path_template_worker: image: papermerge/path-tmpl-worker:0.4.1 command: worker environment: PAPERMERGE__DATABASE__URL: postgresql://coco:jumbo@db:5432/pmgdb PAPERMERGE__REDIS__URL: redis://redis:6379/0 PATH_TMPL_WORKER_ARGS: "-Q path_tmpl -c 2" depends_on: - redis s3worker: image: papermerge/s3worker:0.5.1 command: worker environment: PAPERMERGE__DATABASE__URL: postgresql://coco:jumbo@db:5432/pmgdb PAPERMERGE__REDIS__URL: redis://redis:6379/0 PAPERMERGE__MAIN__MEDIA_ROOT: /var/media/pmg PAPERMERGE__S3__BUCKET_NAME: name-of-your-s3-backet S3_WORKER_ARGS: "-Q s3 -c 2" AWS_REGION_NAME: eu-central-1 AWS_ACCESS_KEY_ID: your-aws-access-key-id-here AWS_SECRET_ACCESS_KEY: your-aws-secret-access-key-here depends_on: - db - redis volumes: - media_root:/var/media/pmg db: image: postgres:16.1 volumes: - pgdata:/var/lib/postgresql/data/ environment: POSTGRES_PASSWORD: jumbo POSTGRES_DB: pmgdb POSTGRES_USER: coco healthcheck: test: pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB interval: 5s timeout: 10s retries: 5 start_period: 10s redis: image: redis:7.2 ports: - "6379:6379" environment: ALLOW_EMPTY_PASSWORD: "yes" volumes: pgdata: media_root: ``` -------------------------------- ### Start Papermerge DMS with PostgreSQL Source: https://docs.papermerge.io/3.5/setup/docker-compose This configuration starts Papermerge DMS with a PostgreSQL 16.1 database. It is suitable for demonstrations but lacks persistent storage for uploaded documents. ```yaml services: webapp: image: papermerge/papermerge:3.5.3 environment: PAPERMERGE__SECURITY__SECRET_KEY: 12345 PAPERMERGE__AUTH__USERNAME: admin PAPERMERGE__AUTH__PASSWORD: admin PAPERMERGE__DATABASE__URL: postgresql://coco:jumbo@db:5432/pmgdb ports: - "12000:80" depends_on: - db db: image: postgres:16.1 volumes: - pgdata:/var/lib/postgresql/data/ environment: POSTGRES_PASSWORD: jumbo POSTGRES_DB: pmgdb POSTGRES_USER: coco healthcheck: test: pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB interval: 5s timeout: 10s retries: 5 start_period: 10s volumes: pgdata: ``` -------------------------------- ### Example Xapian Search URL Source: https://docs.papermerge.io/3.5/settings/search An example of a Xapian search engine URL for Papermerge DMS, indicating the index database folder. ```plaintext xapian:////index_db ``` -------------------------------- ### Generate Token for Specific User Source: https://docs.papermerge.io/3.5/rest-api/token This example demonstrates the command to generate a REST API token for the user 'john', using the identified Docker container ID. ```bash $ docker exec d8b965388fd9 create_token.sh john ``` -------------------------------- ### Run Basic Papermerge Docker Container Source: https://docs.papermerge.io/3.5/setup/docker This command starts the Papermerge web application using Docker. It requires setting the secret key and admin password environment variables. Access the application via http://localhost:12000. ```bash docker run -p 12000:80 \ -e PAPERMERGE__SECURITY__SECRET_KEY=abc \ -e PAPERMERGE__AUTH__PASSWORD=pass123 \ papermerge/papermerge:3.5.3 ``` -------------------------------- ### Verify Installed OCR Languages Source: https://docs.papermerge.io/3.5/setup/add-ocr-langs Execute this command inside a running OCR worker container to list all installed Tesseract OCR languages. ```bash docker exec -it tesseract --list-langs ``` -------------------------------- ### Export Configuration for Papermerge DMS 3.3 (PostgreSQL) Source: https://docs.papermerge.io/3.5/pmdump Example configuration file for exporting data from Papermerge DMS version 3.3 using a PostgreSQL database. ```yaml media_root: /home/eugen/DockerCompose/pm3.3.1-pg/media database_url: postgresql://coco:jumbo@127.0.0.1:5432/pmgdb?sslmode=disable app_version: 3.3 ``` -------------------------------- ### Export Configuration for Papermerge DMS 2.0 (SQLite) Source: https://docs.papermerge.io/3.5/pmdump Example configuration file for exporting data from Papermerge DMS version 2.0 using a SQLite database. ```yaml app_version: 2.0 media_root: /path/to/media/folder/ database_url: sqlite:///path/to/data/papermerge.db ``` -------------------------------- ### Create Authelia Configuration Directory and File Source: https://docs.papermerge.io/3.5/sso/remote-user/authelia Commands to create the necessary directory structure and an empty configuration file for Authelia. ```bash mkdir -p authelia/authelia cd authelia/authelia touch configuration.yml ``` -------------------------------- ### Papermerge DMS Docker Compose Configuration Source: https://docs.papermerge.io/3.5/sso/remote-user/authelia This Docker Compose configuration starts Papermerge DMS with remote authentication enabled. Ensure that the environment variables for security, authentication endpoints, and user credentials match your Authelia setup. ```yaml services: paper: image: papermerge/papermerge:3.2 container_name: paper ports: - 12000:80 restart: unless-stopped environment: - PAPERMERGE__SECURITY__SECRET_KEY=abc-secret - PAPERMERGE__AUTH__REMOTE=yes - PAPERMERGE__AUTH__REMOTE_LOGOUT_ENDPOINT=https://auth.trusel.net/logout - PAPERMERGE__AUTH__USERNAME=bender - PAPERMERGE__AUTH__PASSWORD=not-used-but-needs-to-be-present - PAPERMERGE__AUTH__EMAIL=bender@mail.com ``` -------------------------------- ### Make PMDump Executable and Move to PATH Source: https://docs.papermerge.io/3.5/pmdump Make the downloaded PMDump binary executable and move it to a directory in your system's PATH. ```bash chmod +x pmdump sudo mv pmdump /usr/local/bin/ ``` -------------------------------- ### Download PMDump Binary with wget Source: https://docs.papermerge.io/3.5/pmdump Use wget to download the PMDump binary. Replace with the actual release URL for your platform. ```bash wget -O pmdump ``` -------------------------------- ### Perform Data Import Source: https://docs.papermerge.io/3.5/pmdump Execute the import command using a specified configuration file and the archive to import. The 'import' command must be the last parameter. ```bash pmdump -c dest_pg.yaml -f /path/to/archive.tar.gz import ``` -------------------------------- ### Run Papermerge Container with Authentication Server Source: https://docs.papermerge.io/3.5/developer-manual/architecture This command demonstrates how to run the official Papermerge container, including the bundled authentication server. Environment variables are used to configure security and authentication settings. ```bash docker run -p 12000:80 \ -e PAPERMERGE__SECURITY__SECRET_KEY=abc \ -e PAPERMERGE__AUTH__PASSWORD=pass123 \ papermerge/papermerge:3.5.2 ``` -------------------------------- ### Basic Path Template with Document Attributes Source: https://docs.papermerge.io/3.5/user/path-templates Demonstrates using document ID and title to construct a file path. The expressions within curly braces are evaluated dynamically. ```Jinja2 /home/Invoices/Misc/{{ document.id }}-{{ document.title }}.pdf ``` -------------------------------- ### Import Data using pgloader Source: https://docs.papermerge.io/3.5/admin-manual/db-migrations This command executes the pgloader migration process using the specified configuration file. Ensure PostgreSQL is running before executing this command. ```bash pgloader db.load ``` -------------------------------- ### Dockerfile for Custom OCR Worker Source: https://docs.papermerge.io/3.5/setup/add-ocr-langs Use this Dockerfile to extend the base papermerge/ocrworker image and install additional Tesseract OCR languages. ```dockerfile FROM papermerge/ocrworker:0.3.1 # Add the required languages here RUN apt update && apt install -y tesseract-ocr-kaz tesseract-ocr-rus ``` -------------------------------- ### Add Current Directory to PATH Temporarily Source: https://docs.papermerge.io/3.5/pmdump Temporarily add the current directory to your PATH environment variable to run PMDump without global installation. ```bash export PATH=$PWD:$PATH ``` -------------------------------- ### OCR Worker Arguments - Prefixed Queue Source: https://docs.papermerge.io/3.5/settings/ocrworker Sets Celery worker arguments to use a queue prefixed with the PAPERMERGE__MAIN__PREFIX. For example, if the prefix is 'demo', the queue will be 'demo_ocr'. ```bash OCR_WORKER_ARG="-Q demo_ocr" ``` -------------------------------- ### Download PMDump Binary with curl Source: https://docs.papermerge.io/3.5/pmdump Use curl to download the PMDump binary. Replace with the actual release URL for your platform. ```bash curl -o pmdump ``` -------------------------------- ### OpenID Connect Provider Configuration Source: https://docs.papermerge.io/3.5/setup/authentification Set environment variables to configure OIDC authentication with your identity provider. These include client secrets, IDs, and URLs for authorization, token exchange, user info, logout, and introspection. ```bash PAPERMERGE__AUTH__OIDC_CLIENT_SECRET=pT5Ff-your-token-eWOSvEPmtyY PAPERMERGE__AUTH__OIDC_CLIENT_ID=papermerge PAPERMERGE__AUTH__OIDC_AUTHORIZE_URL=http://keycloak.trusel.net:8080/realms/myrealm/protocol/openid-connect/auth PAPERMERGE__AUTH__OIDC_ACCESS_TOKEN_URL=http://keycloak.trusel.net:8080/realms/myrealm/protocol/openid-connect/token PAPERMERGE__AUTH__OIDC_USER_INFO_URL=http://keycloak.trusel.net:8080/realms/myrealm/protocol/openid-connect/userinfo PAPERMERGE__AUTH__OIDC_LOGOUT_URL=http://keycloak.trusel.net:8080/realms/myrealm/protocol/openid-connect/logout PAPERMERGE__AUTH__OIDC_INTROSPECT_URL=http://keycloak.trusel.net:8080/realms/myrealm/protocol/openid-connect/token/introspect ``` -------------------------------- ### Set Superuser Email Source: https://docs.papermerge.io/3.5/settings/auth Specify the email address for the superuser account. The default value is 'admin@example.com'. ```bash PAPERMERGE__AUTH__EMAIL=john@mail.com ``` -------------------------------- ### Enable/Disable Automatic OCR Source: https://docs.papermerge.io/3.5/settings/ocr Control whether OCR processing starts automatically without user intervention. Setting to 'false' requires manual initiation by the end-user. ```bash PAPERMERGE__OCR__AUTOMATIC=false ``` -------------------------------- ### Set Media Root Directory Source: https://docs.papermerge.io/3.5/settings/main Specifies the absolute filesystem path for user-uploaded documents. Ensure this directory exists and is writable by the application. ```bash PAPERMERGE__MAIN__MEDIA_ROOT=/var/www/example.com/media/ ``` -------------------------------- ### Configure UI OCR Language Codes Source: https://docs.papermerge.io/3.5/settings/ocr Specify a comma-delimited list of language codes to be displayed in the user interface for OCR selection. The OCR worker must have these languages installed. ```bash PAPERMERGE__OCR__LANG_CODES="eng,deu,fra,spa" ``` ```bash PAPERMERGE__OCR__LANG_CODES="eng, deu" ``` ```bash PAPERMERGE__OCR__LANG_CODES="ita, fra, ron" ``` ```bash PAPERMERGE__OCR__LANG_CODES="deu,eng,ron" ``` -------------------------------- ### Perform Data Export Source: https://docs.papermerge.io/3.5/pmdump Execute the export command using a specified configuration file and output archive name. The 'export' command must be the last parameter. ```bash pmdump -c source.yaml -f pm3.3.tar.gz export ``` -------------------------------- ### Authelia Docker Compose Configuration Source: https://docs.papermerge.io/3.5/sso/remote-user/authelia Defines the Docker services for Authelia and Redis, including network setup, volume mounts for configuration and data, port mappings, and environment variables. ```yaml networks: net: driver: bridge services: authelia: image: authelia/authelia container_name: authelia volumes: - ${PWD}/authelia/authelia:/config networks: - net ports: - 9091:9091 restart: unless-stopped environment: - PUID=1000 - PGID=1000 - TZ=Europe/Berlin redis: image: redis:alpine container_name: redis_authelia volumes: - ./redis:/data networks: - net expose: - 6379 restart: unless-stopped environment: - TZ=Europe/Berlin - PUID=1000 - PGID=1000 ``` -------------------------------- ### Papermerge Docker Compose Configuration for OIDC Source: https://docs.papermerge.io/3.5/sso/oidc/keycloak Configure Papermerge DMS to use Keycloak for OIDC authentication. Ensure environment variables match your Keycloak setup and user details. ```yaml version: "3.9" x-backend: &common image: papermerge/papermerge:3.5.3 environment: PAPERMERGE__SECURITY__SECRET_KEY: super-secret-12345 PAPERMERGE__AUTH__USERNAME: bender PAPERMERGE__AUTH__EMAIL: bender@mail.com PAPERMERGE__AUTH__PASSWORD: 1234-not-relevant-but-still-needs-to-be-here PAPERMERGE__AUTH__OIDC_CLIENT_SECRET: OHGMBgyAjcvDtn4PAu8w8vE9yf06aHn1 PAPERMERGE__AUTH__OIDC_CLIENT_ID: papermerge PAPERMERGE__AUTH__OIDC_AUTHORIZE_URL: http://keycloak.trusel.net:8080/realms/myrealm/protocol/openid-connect/auth PAPERMERGE__AUTH__OIDC_ACCESS_TOKEN_URL: http://keycloak.trusel.net:8080/realms/myrealm/protocol/openid-connect/token PAPERMERGE__AUTH__OIDC_INTROSPECT_URL: http://keycloak.trusel.net:8080/realms/myrealm/protocol/openid-connect/token/introspect PAPERMERGE__AUTH__OIDC_USER_INFO_URL: http://keycloak.trusel.net:8080/realms/myrealm/protocol/openid-connect/userinfo PAPERMERGE__AUTH__OIDC_LOGOUT_URL: http://keycloak.trusel.net:8080/realms/myrealm/protocol/openid-connect/logout PAPERMERGE__AUTH__OIDC_REDIRECT_URL: http://demo.trusel.net:12000/oidc/callback services: web: <<: *common ports: - "12000:80" worker: <<: *common command: worker ``` -------------------------------- ### Configure LDAP Server URL Source: https://docs.papermerge.io/3.5/settings/auth Set the URL for the LDAP server. The scheme (e.g., ldap://) should be omitted. ```bash PAPERMERGE__AUTH__LDAP_URL=ldap.trusel.net ``` -------------------------------- ### Docker Compose for I3 and OCR Workers with Solr Source: https://docs.papermerge.io/3.5/setup/docker-compose This configuration includes the web application, I3 worker, OCR worker, PostgreSQL, Redis, and Solr. It is designed for environments that require both document indexing and OCR processing, enabling cooperative workflows between workers. ```yaml services: webapp: image: papermerge/papermerge:3.5.3 environment: PAPERMERGE__SECURITY__SECRET_KEY: 12345 PAPERMERGE__AUTH__USERNAME: admin PAPERMERGE__AUTH__PASSWORD: admin PAPERMERGE__DATABASE__URL: postgresql://coco:jumbo@db:5432/pmgdb PAPERMERGE__SEARCH__URL: solr://solr:8983/pmg PAPERMERGE__MAIN__MEDIA_ROOT: /var/media/pmg PAPERMERGE__REDIS__URL: redis://redis:6379/0 PAPERMERGE__OCR__LANG_CODES: "deu,eng,ron" PAPERMERGE__OCR__DEFAULT_LANG_CODE: "deu" volumes: - media_root:/var/media/pmg ports: - "12000:80" depends_on: - db - redis - solr ocr_worker: image: papermerge/ocrworker:0.3.1 command: worker environment: PAPERMERGE__DATABASE__URL: postgresql://coco:jumbo@db:5432/pmgdb PAPERMERGE__REDIS__URL: redis://redis:6379/0 PAPERMERGE__MAIN__MEDIA_ROOT: /var/media/pmg OCR_WORKER_ARGS: "-Q ocr -c 2" depends_on: - redis - db volumes: - media_root:/var/media/pmg i3worker: image: papermerge/i3worker:0.3 command: worker environment: PAPERMERGE__DATABASE__URL: postgresql://coco:jumbo@db:5432/pmgdb PAPERMERGE__SEARCH__URL: solr://solr:8983/pmg PAPERMERGE__REDIS__URL: redis://redis:6379/0 I3_WORKER_ARGS: "-Q i3 -c 2" depends_on: - redis - db - solr db: image: postgres:16.1 volumes: - pgdata:/var/lib/postgresql/data/ environment: POSTGRES_PASSWORD: jumbo POSTGRES_DB: pmgdb POSTGRES_USER: coco healthcheck: test: pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB interval: 5s timeout: 10s retries: 5 start_period: 10s redis: image: redis:7.2 ports: - "6379:6379" environment: ALLOW_EMPTY_PASSWORD: "yes" solr: image: solr:9.7 ports: - "8983:8983" volumes: - solr_data:/var/solr command: - solr-precreate - pmg volumes: pgdata: media_root: solr_data: ``` -------------------------------- ### Set SECURITY__TOKEN_EXPIRE_MINUTES Environment Variable Source: https://docs.papermerge.io/3.5/settings/security Configure the expiration time for REST API tokens in minutes. The default is 360 minutes (6 hours). This example sets the expiration to 7 days (10080 minutes). ```bash PAPERMERGE__SECURITY__TOKEN_EXPIRE_MINUTES=10080 ``` -------------------------------- ### Create REST API Token Source: https://docs.papermerge.io/3.5/rest-api/token Use this command to generate a REST API token for a specific user. Replace `` with the actual container name or ID and `` with the desired user's username. ```bash docker exec create_token.sh ``` -------------------------------- ### Configure Logging Settings Source: https://docs.papermerge.io/3.5/settings/main Sets the absolute filesystem path to the YAML file for detailed logging configuration. The file content must be in Python-specific YAML format. ```bash PAPERMERGE__MAIN__LOGGING_CFG=/etc/papermerge/logging.yaml ``` -------------------------------- ### Set Superuser Password Source: https://docs.papermerge.io/3.5/settings/auth Define the password for the superuser account. There is no default value. ```bash PAPERMERGE__AUTH__PASSWORD=topsecret ``` -------------------------------- ### Authentik Instance and Papermerge DMS URLs Source: https://docs.papermerge.io/3.5/sso/oidc/authentik These are the base URLs for your Authentik instance and Papermerge DMS deployment. Ensure these are accessible for the integration to work. ```text http://authk.trusel.net:9000/ (Authentik instance) http://demo.trusel.net:12000/ (Papermerge DMS instance) ``` -------------------------------- ### Docker Compose for I3 Worker and Solr Source: https://docs.papermerge.io/3.5/setup/docker-compose This configuration sets up a Papermerge web application, an I3 worker for search indexing, a PostgreSQL database, Redis, and Solr. It's suitable for scenarios where search synchronization is the primary requirement. ```yaml services: webapp: image: papermerge/papermerge:3.5.3 environment: PAPERMERGE__SECURITY__SECRET_KEY: 12345 PAPERMERGE__AUTH__USERNAME: admin PAPERMERGE__AUTH__PASSWORD: admin PAPERMERGE__DATABASE__URL: postgresql://coco:jumbo@db:5432/pmgdb PAPERMERGE__SEARCH__URL: solr://solr:8983/pmg PAPERMERGE__MAIN__MEDIA_ROOT: /var/media/pmg PAPERMERGE__REDIS__URL: redis://redis:6379/0 PAPERMERGE__OCR__LANG_CODES: "deu,eng,ron" PAPERMERGE__OCR__DEFAULT_LANG_CODE: "deu" volumes: - media_root:/var/media/pmg ports: - "12000:80" depends_on: - db - redis - solr i3worker: image: papermerge/i3worker:0.3 command: worker environment: PAPERMERGE__DATABASE__URL: postgresql://coco:jumbo@db:5432/pmgdb PAPERMERGE__SEARCH__URL: solr://solr:8983/pmg PAPERMERGE__REDIS__URL: redis://redis:6379/0 I3_WORKER_ARGS: "-Q i3 -c 2" depends_on: - redis - db - solr db: image: postgres:16.1 volumes: - pgdata:/var/lib/postgresql/data/ environment: POSTGRES_PASSWORD: jumbo POSTGRES_DB: pmgdb POSTGRES_USER: coco healthcheck: test: pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB interval: 5s timeout: 10s retries: 5 start_period: 10s redis: image: redis:7.2 ports: - "6379:6379" environment: ALLOW_EMPTY_PASSWORD: "yes" solr: image: solr:9.7 ports: - "8983:8983" volumes: - solr_data:/var/solr command: - solr-precreate - pmg volumes: pgdata: media_root: solr_data: ``` -------------------------------- ### Enable Content Delivery via CDN Source: https://docs.papermerge.io/3.5/setup/s3backend Configuration setting in the webapp to enable content delivery through a CDN. This involves setting PAPERMERGE__MAIN__FILE_SERVER to 's3'. ```shell PAPERMERGE__MAIN__FILE_SERVER=s3 ``` -------------------------------- ### Logging Configuration Path Source: https://docs.papermerge.io/3.5/settings/s3worker Specifies the absolute filesystem path to the YAML file containing the logging configuration. ```bash PAPERMERGE__MAIN__LOGGING_CFG=/etc/papermerge/logging.yaml ``` -------------------------------- ### Configure pgloader for SQLite to PostgreSQL Migration Source: https://docs.papermerge.io/3.5/admin-manual/db-migrations This pgloader configuration file specifies the source SQLite database and the destination PostgreSQL database. It includes options to retain existing schema, load only data, and set memory work parameters. ```sql LOAD database FROM sqlite:////db.sqlite3 INTO postgresql://papermerge@localhost:5432/pmgdb WITH include no drop, create no tables, create no indexes, reset sequences, data only SET work_mem to '16MB', maintenance_work_mem to '512 MB'; ``` -------------------------------- ### Set Superuser Username Source: https://docs.papermerge.io/3.5/settings/auth Configure the username for the superuser account. The default value is 'admin'. ```bash PAPERMERGE__AUTH__USERNAME=john ``` -------------------------------- ### Authentik Application Configuration Source: https://docs.papermerge.io/3.5/sso/oidc/authentik Create a new application in Authentik named 'Papermerge' with a specific slug. The policy engine mode is set to 'any'. ```text Name: Papermerge Slug: papermerge Policy engine mode: any ``` -------------------------------- ### Configure LDAP User DN Format Source: https://docs.papermerge.io/3.5/settings/auth Define the format for the distinguished name of user entries in LDAP. Use '{username}' as a placeholder for the username. ```bash PAPERMERGE__AUTH__LDAP_USER_DN_FORMAT="uid={username},ou=People,dc=ldap,dc=trusel,dc=net" ``` ```bash PAPERMERGE__AUTH__LDAP_USER_DN_FORMAT="uid={username},ou=Users,dc=example,dc=com" ``` ```bash PAPERMERGE__AUTH__LDAP_USER_DN_FORMAT="uid={username},ou=Accounts,dc=acme,dc=com" ``` -------------------------------- ### Configure LDAP Email Domain Fallback Source: https://docs.papermerge.io/3.5/settings/auth Provide a fallback domain for user emails if the email cannot be extracted from LDAP. The format will be '@'. ```bash PAPERMERGE__AUTH__LDAP_USER_EMAIL_DOMAIN_FALLBACK=starship.com ``` -------------------------------- ### Referencing Custom Fields with Spaces and Case Source: https://docs.papermerge.io/3.5/user/path-templates Shows the correct syntax for referencing custom fields that contain spaces or require specific casing. The field name must match exactly, including spaces and case. ```Jinja2 {{ document.cf['Total (EUR)'] }} ``` -------------------------------- ### Generate Docker Compose with pmcompose Source: https://docs.papermerge.io/3.5/setup/s3backend Command to generate the Docker Compose configuration for Papermerge DMS with an S3 backend using the pmcompose utility. ```bash $ pmcompose -u admin -p 1234 -lc -s3 ``` -------------------------------- ### Docker Compose for Papermerge and OCR Worker Source: https://docs.papermerge.io/3.5/setup/docker-compose This configuration sets up the web application, OCR worker, database, and Redis. It ensures both the webapp and OCR worker share access to the same local media storage. ```yaml services: webapp: image: papermerge/papermerge:3.5.3 environment: PAPERMERGE__SECURITY__SECRET_KEY: 12345 PAPERMERGE__AUTH__USERNAME: admin PAPERMERGE__AUTH__PASSWORD: admin PAPERMERGE__DATABASE__URL: postgresql://coco:jumbo@db:5432/pmgdb PAPERMERGE__MAIN__MEDIA_ROOT: /var/media/pmg PAPERMERGE__REDIS__URL: redis://redis:6379/0 PAPERMERGE__OCR__LANG_CODES: "eng,deu" PAPERMERGE__OCR__DEFAULT_LANG_CODE: "deu" volumes: - media_root:/var/media/pmg ports: - "12000:80" depends_on: - db - redis ocr_worker: image: papermerge/ocrworker:0.3.1 command: worker environment: PAPERMERGE__DATABASE__URL: postgresql://coco:jumbo@db:5432/pmgdb PAPERMERGE__REDIS__URL: redis://redis:6379/0 PAPERMERGE__MAIN__MEDIA_ROOT: /var/media/pmg OCR_WORKER_ARGS: "-Q ocr -c 2" depends_on: - redis - db volumes: - media_root:/var/media/pmg db: image: postgres:16.1 volumes: - pgdata:/var/lib/postgresql/data/ environment: POSTGRES_PASSWORD: jumbo POSTGRES_DB: pmgdb POSTGRES_USER: coco healthcheck: test: pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB interval: 5s timeout: 10s retries: 5 start_period: 10s redis: image: redis:7.2 ports: - "6379:6379" environment: ALLOW_EMPTY_PASSWORD: "yes" volumes: pgdata: media_root: ``` -------------------------------- ### Permissions for Sharing Source: https://docs.papermerge.io/3.5/user/sharing These are the minimum permissions required for a user to share documents and folders. ```text - Shared Node - Create - Shared Node - Update - Shared Node - Delete - Users - Select - Groups - Select - Roles - Select ``` -------------------------------- ### Match Documents with Logical AND Source: https://docs.papermerge.io/3.5/user/search Use the 'AND' operator (in capital letters) to find documents containing multiple specified words. ```text pizza AND salami ```