Files
mtusi2026lab3/app/config.py

21 lines
607 B
Python

import os
import secrets
class Config:
DATABASE_URL: str = os.getenv(
"DATABASE_URL",
"postgresql://messenger:messenger@localhost:5432/messenger",
)
SESSION_TTL_SECONDS: int = int(os.getenv("SESSION_TTL_SECONDS", "3600"))
APP_HOST: str = os.getenv("APP_HOST", "0.0.0.0")
APP_PORT: int = int(os.getenv("APP_PORT", "8080"))
SESSION_STORE: str = os.getenv("SESSION_STORE", "postgres")
CACHE_URL: str = os.getenv(
"CACHE_URL",
"redis://valkey:6379/0",
)
INSTANCE_ID: str = os.getenv("INSTANCE_ID") or secrets.token_hex(6)
config = Config()