From 69ec63e19987c9497b95024900e2cddf1c49b727 Mon Sep 17 00:00:00 2001 From: rfl Date: Fri, 25 Oct 2024 20:06:53 +0200 Subject: [PATCH] Track files --- paperless/docker-compose.env | 23 +++++++++++++++++++++++ paperless/docker-compose.yml | 17 +++++++++++++++++ paperless/init.sls | 4 ++-- 3 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 paperless/docker-compose.env create mode 100644 paperless/docker-compose.yml diff --git a/paperless/docker-compose.env b/paperless/docker-compose.env new file mode 100644 index 0000000..2b48bf5 --- /dev/null +++ b/paperless/docker-compose.env @@ -0,0 +1,23 @@ +USER_UID=1000 +USER_GID=1000 + +PAPERLESS_REDIS={{ salt['pillar.get']('paperless:webserver:environment:redis', 'redis://broker:6379') }} +PAPERLESS_TIKA_ENABLED={{ salt['pillar.get']('paperless:webserver:environment:tika_enabled', '1') }} +PAPERLESS_TIKA_ENDPOINT={{ salt['pillar.get']('paperless:webserver:environment:tika_endpoint', 'http://tika:9998') }} +PAPERLESS_TIKA_GOTENBERG_ENDPOINT={{ salt['pillar.get']('paperless:webserver:environment:tika_gotenberg_endpoint', 'http://gotenberg:3000') }} + +PAPERLESS_APPS=allauth.socialaccount.providers.openid_connect +PAPERLESS_SOCIALACCOUNT_PROVIDERS={"key": {"value": 3}} + +{% client_secret = salt['pillar.get']('paperless:webserver:keycloak:client_secret', '') %} +{% set oauth_server = salt['pillar.get']('paperless:webserver:keycloak:server_url', 'https:///realms//.well-known/openid-configuration') %} +{% set PAPERLESS_SOCIALACCOUNT_PROVIDERS_ = +{'openid_connect':{'APPS':[{'provider_id': 'keycloak', 'name': 'Keycloak', +'client_id': 'paperless', 'secret': client_secret, 'settings':{'server_url': +oauth_server}}]}} | tojson %} + +PAPERLESS_DISABLE_REGULAR_LOGIN={{ salt['pillar.get']('paperless:webserver:environment:disable_regular_login', 'true') }} +PAPERLESS_REDIRECT_LOGIN_TO_SSO={{ salt['pillar.get']('paperless:webserver:environment:redirect_login_to_sso', 'true') }} + +PAPERLESS_ADMIN_USER={{ salt['pillar.get']('paperless:webserver:environment:admin_user', 'admin') }} +PAPERLESS_ADMIN_PASSWORD={{ salt['pillar.get']('paperless:webserver:environment:admin_password', 'change-me') }} diff --git a/paperless/docker-compose.yml b/paperless/docker-compose.yml new file mode 100644 index 0000000..707cb15 --- /dev/null +++ b/paperless/docker-compose.yml @@ -0,0 +1,17 @@ +services: + paperless: + - image: {{ salt['pillar.get']('paperless:webserver:image:path', 'ghcr.io/paperless-ngx/paperless-ngx') }}:{{ salt['pillar.get']('paperless:webserver:image:version', '2.12') }} + - container_name: paperless + - env_file: docker-compose.env + - restart: always + - networks: + - paperless-network + - binds: + - /opt/paperless/webserver/data:/usr/src/paperless/data + - /opt/paperless/webserver/media:/usr/src/paperless/media + - /opt/paperless/webserver/export:/usr/src/paperless/export + - /opt/paperless/webserver/consume:/usr/src/paperless/consume + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + - port_bindings: + - {{ salt['pillar.get']('paperless:webserver:ip', '127.0.0.1') }}:{{ salt['pillar.get']('paperless:webserver:port', '8000') }}:8000 diff --git a/paperless/init.sls b/paperless/init.sls index 9322f27..f9ffd2c 100644 --- a/paperless/init.sls +++ b/paperless/init.sls @@ -106,13 +106,13 @@ paperless-docker-compose-env-file-present: file.managed: - name: /opt/docker-compose.env - template: jinja - - source: salt://docker-compose.env + - source: ./docker-compose.env paperless-docker-compose-file-present: file.managed: - name: /opt/docker-compose.yml - template: jinja - - source: salt://docker-compose.yml + - source: ./docker-compose.yml paperless-docker-compose-up: module.run: