URGENT: Fix production Paperless integration

- Remove hardcoded fallbacks from config.py (relied on old prod values)
- Add missing Paperless env vars to compose.yml for production
- Update compose.dev.yml with complete Paperless configuration
- Fixes 500 errors by ensuring all env vars are passed to containers

Required: VPS .env must have PAPERLESS_*_TAG_ID and PAPERLESS_*_TAG variables
This commit is contained in:
Stiftung Development
2025-09-17 22:06:01 +02:00
parent 002e649116
commit 0fbaf7abb2
3 changed files with 21 additions and 11 deletions

View File

@@ -38,16 +38,14 @@ def get_paperless_config():
dict: Dictionary containing all Paperless configuration dict: Dictionary containing all Paperless configuration
""" """
return { return {
"api_url": get_config("paperless_api_url", "http://192.168.178.167:30070"), "api_url": get_config("paperless_api_url"),
"api_token": get_config("paperless_api_token", ""), "api_token": get_config("paperless_api_token"),
"destinataere_tag": get_config( "destinataere_tag": get_config("paperless_destinataere_tag"),
"paperless_destinataere_tag", "Stiftung_Destinatäre" "destinataere_tag_id": get_config("paperless_destinataere_tag_id"),
), "land_tag": get_config("paperless_land_tag"),
"destinataere_tag_id": get_config("paperless_destinataere_tag_id", "210"), "land_tag_id": get_config("paperless_land_tag_id"),
"land_tag": get_config("paperless_land_tag", "Stiftung_Land_und_Pächter"), "admin_tag": get_config("paperless_admin_tag"),
"land_tag_id": get_config("paperless_land_tag_id", "204"), "admin_tag_id": get_config("paperless_admin_tag_id"),
"admin_tag": get_config("paperless_admin_tag", "Stiftung_Administration"),
"admin_tag_id": get_config("paperless_admin_tag_id", "216"),
} }

View File

@@ -40,7 +40,13 @@ services:
- TIME_ZONE=Europe/Berlin - TIME_ZONE=Europe/Berlin
- REDIS_URL=redis://redis:6379/0 - REDIS_URL=redis://redis:6379/0
- PAPERLESS_API_URL=http://paperless:8000 - PAPERLESS_API_URL=http://paperless:8000
- PAPERLESS_API_TOKEN=dev-token-will-be-set-after-paperless-setup - PAPERLESS_API_TOKEN=d477152aca264ea00620910ac09a06f0a4faaecc
- PAPERLESS_REQUIRED_TAG=Stiftung_Destinatäre
- PAPERLESS_LAND_TAG=Stiftung_Land_und_Pächter
- PAPERLESS_ADMIN_TAG=Stiftung_Administration
- PAPERLESS_DESTINATAERE_TAG_ID=1
- PAPERLESS_LAND_TAG_ID=3
- PAPERLESS_ADMIN_TAG_ID=2
ports: ports:
- "8081:8000" - "8081:8000"
volumes: volumes:

View File

@@ -45,6 +45,12 @@ services:
- REDIS_URL=${REDIS_URL} - REDIS_URL=${REDIS_URL}
- PAPERLESS_API_URL=${PAPERLESS_API_URL} - PAPERLESS_API_URL=${PAPERLESS_API_URL}
- PAPERLESS_API_TOKEN=${PAPERLESS_API_TOKEN} - PAPERLESS_API_TOKEN=${PAPERLESS_API_TOKEN}
- PAPERLESS_REQUIRED_TAG=${PAPERLESS_REQUIRED_TAG}
- PAPERLESS_LAND_TAG=${PAPERLESS_LAND_TAG}
- PAPERLESS_ADMIN_TAG=${PAPERLESS_ADMIN_TAG}
- PAPERLESS_DESTINATAERE_TAG_ID=${PAPERLESS_DESTINATAERE_TAG_ID}
- PAPERLESS_LAND_TAG_ID=${PAPERLESS_LAND_TAG_ID}
- PAPERLESS_ADMIN_TAG_ID=${PAPERLESS_ADMIN_TAG_ID}
ports: ports:
- "8081:8000" - "8081:8000"
volumes: volumes: