""" Application configuration from environment variables. """ from pydantic_settings import BaseSettings from functools import lru_cache class Settings(BaseSettings): """Application settings loaded from environment variables.""" # MongoDB MONGODB_URL: str = "mongodb://admin:password123@localhost:27022/" DB_NAME: str = "web_inspector" # Redis REDIS_URL: str = "redis://localhost:6392" # Inspection URL_FETCH_TIMEOUT: int = 10 CATEGORY_TIMEOUT: int = 60 MAX_HTML_SIZE: int = 10485760 # 10MB # Site inspection SITE_MAX_PAGES: int = 500 SITE_MAX_DEPTH: int = 2 SITE_CONCURRENCY: int = 8 # Batch inspection BATCH_MAX_URLS: int = 200 BATCH_CONCURRENCY: int = 8 # Application PROJECT_NAME: str = "Web Inspector API" class Config: env_file = ".env" case_sensitive = True @lru_cache() def get_settings() -> Settings: return Settings()