from functools import lru_cache from pydantic_settings import BaseSettings, SettingsConfigDict class Settings(BaseSettings): app_name: str = "dodo" database_url: str = "postgresql+asyncpg://dodo:dodo@localhost:5432/dodo" session_days: int = 30 cookie_secure: bool = False trusted_proxies: str = "" auto_create_schema: bool = False attachment_dir: str = "./data/attachments" attachment_max_mb: int = 20 backup_max_archive_mb: int = 256 backup_max_pending_per_user: int = 3 backup_max_staged_mb_per_user: int = 768 backup_preflight_ttl_seconds: int = 900 backup_staging_dir: str = "./data/backup-staging" login_attempts: int = 5 login_window_seconds: int = 300 model_config = SettingsConfigDict(env_prefix="DODO_", env_file=".env", extra="ignore") @lru_cache def get_settings() -> Settings: return Settings()