Files
hms-licht-ton/backend/app/config.py
T

44 lines
1.1 KiB
Python
Raw Normal View History

"""Application configuration via Pydantic Settings."""
from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings(BaseSettings):
"""Settings loaded from environment variables."""
model_config = SettingsConfigDict(env_file=".env", extra="ignore")
# Database
DATABASE_URL: str = "postgresql+asyncpg://hms:hms@localhost:5432/hms"
# Redis
REDIS_URL: str = "redis://localhost:6379/0"
# CORS
CORS_ORIGINS: str = "https://hms.media-on.de,http://localhost:3000"
# Rentman
RENTMAN_API_TOKEN: str = ""
# Auth
JWT_SECRET: str = "dev-secret-change-me"
# SMTP
SMTP_HOST: str = ""
SMTP_PORT: int = 587
SMTP_USER: str = ""
SMTP_PASSWORD: str = ""
SMTP_FROM: str = "info@hms-licht-ton.de"
# Admin
ADMIN_USERNAME: str = "admin"
ADMIN_PASSWORD: str = "change_me"
@property
def cors_origins_list(self) -> list[str]:
"""Parse CORS_ORIGINS into a list."""
return [origin.strip() for origin in self.CORS_ORIGINS.split(",") if origin.strip()]
settings = Settings()