from pydantic_settings import BaseSettings from functools import lru_cache class Settings(BaseSettings): APP_NAME: str = "CMDB" APP_VERSION: str = "1.0.0" DEBUG: bool = False DATABASE_URL: str = "postgresql+asyncpg://cmdb:cmdb_secret@localhost:5432/cmdb" DATABASE_POOL_SIZE: int = 20 DATABASE_MAX_OVERFLOW: int = 10 JWT_SECRET: str = "CHANGE-ME-IN-PRODUCTION-use-openssl-rand-hex-32" JWT_ALGORITHM: str = "HS256" JWT_EXPIRATION_MINUTES: int = 60 CORS_ORIGINS: list[str] = ["http://localhost:3000", "http://localhost:5173"] RATE_LIMIT_PER_MINUTE: int = 120 class Config: env_file = ".env" env_file_encoding = "utf-8" @lru_cache() def get_settings() -> Settings: return Settings()