aboutsummaryrefslogtreecommitdiffstats
path: root/config.py
blob: a28885547e7f29b74b77e685b3d65b4f5b60310d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import os
from dotenv import load_dotenv

load_dotenv()

class Config:
    SECRET_KEY = os.environ.get('SECRET_KEY', 'dev-secret-key-change-in-production')
    SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL', 'postgresql://slotfinder:slotfinder@localhost/slotfinder')
    SQLALCHEMY_TRACK_MODIFICATIONS = False

    # Session security
    SESSION_COOKIE_SECURE = os.environ.get('SESSION_COOKIE_SECURE', 'false').lower() in ('true', '1', 'yes')

    # OIDC Configuration (Keycloak)
    OIDC_CLIENT_ID = os.environ.get('OIDC_CLIENT_ID', 'slotfinder')
    OIDC_CLIENT_SECRET = os.environ.get('OIDC_CLIENT_SECRET', 'slotfinder-dev-secret')
    OIDC_DISCOVERY_URL = os.environ.get('OIDC_DISCOVERY_URL', 'http://localhost:8080/realms/master/.well-known/openid-configuration')
    OIDC_USE_GIVEN_NAME = os.environ.get('OIDC_USE_GIVEN_NAME', 'false').lower() in ('true', '1', 'yes')