From 9fdae09271f5b6793edda90111648616b02c3670 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Fri, 30 Oct 2026 19:40:20 +0100 Subject: [PATCH] Minimal fixes --- Dockerfile | 6 +++--- src/redakcja/settings/__init__.py | 18 ++++++++++++++++-- src/redakcja/settings/defaults.py | 3 +++ 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 256a22c9..cda7f2fd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -79,11 +79,11 @@ ARG GID=8200 # COPY nginx.conf conf.d/... RUN addgroup -g $GID app && addgroup nginx app -COPY --from=static-builder /app/var/static /app/var/static +COPY --from=static-builder /app/src/static /app/var/static -FROM base AS prod +FROM prod-base AS prod -COPY --from=static-builder /app/var/static/staticfiles.json /app/var/static/staticfiles.json +COPY --from=static-builder /app/src/static/staticfiles.json /app/src/static/staticfiles.json diff --git a/src/redakcja/settings/__init__.py b/src/redakcja/settings/__init__.py index b204d0af..f2383498 100644 --- a/src/redakcja/settings/__init__.py +++ b/src/redakcja/settings/__init__.py @@ -1,11 +1,15 @@ # This file is part of FNP-Redakcja, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # -import os.path +import os import sentry_sdk from sentry_sdk.integrations.django import DjangoIntegration from .defaults import * -from ..localsettings import * + +try: + from ..localsettings import * +except ImportError: + pass DATA_UPLOAD_MAX_MEMORY_SIZE = 20000000 @@ -15,6 +19,16 @@ STATICFILES_DIRS = [ PROJECT_ROOT + '/static/' ] +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.postgresql', + 'HOST': 'db', + 'USER': os.environ.get('POSTGRES_USER'), + 'PASSWORD': os.environ.get('POSTGRES_PASSWORD'), + 'NAME': os.environ.get('POSTGRES_USER'), + } +} + TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', diff --git a/src/redakcja/settings/defaults.py b/src/redakcja/settings/defaults.py index cb49c8d3..297cd422 100644 --- a/src/redakcja/settings/defaults.py +++ b/src/redakcja/settings/defaults.py @@ -49,6 +49,8 @@ USE_L10N = True # Example: "/home/media/media.lawrence.com/" MEDIA_ROOT = PROJECT_ROOT + '/media/dynamic' STATIC_ROOT = PROJECT_ROOT + '/../static/' +CATALOGUE_REPO_PATH = MEDIA_ROOT + '/repo' +CATALOGUE_IMAGE_REPO_PATH = MEDIA_ROOT + '/imgrepo' # URL that handles the media served from MEDIA_ROOT. Make sure to use a # trailing slash if there is a path component (optional in other cases). @@ -64,6 +66,7 @@ BROKER_URL = 'django://' SHOW_APP_VERSION = False +CAS_SERVER_URL = None CAS_APPLY_ATTRIBUTES_TO_USER = True CAS_RENAME_ATTRIBUTES = { 'email': 'email', 'firstname': 'first_name', 'lastname': 'last_name'} -- 2.20.1