"""Server configuration from environment variables.""" from pathlib import Path from pydantic_settings import BaseSettings class Settings(BaseSettings): """Application settings loaded from environment variables.""" # Database data_dir: Path = Path("/data") database_url: str = "" # Computed from data_dir if empty # JWT secret_key: str = "change-me-in-production" access_token_expire_minutes: int = 60 refresh_token_expire_days: int = 30 # Server host: str = "0.0.0.0" port: int = 8420 debug: bool = False # Claude AI (optional - leave empty to disable AI features) anthropic_api_key: str = "" ai_model: str = "claude-sonnet-4-20250514" ai_max_tokens: int = 1024 # Telegram webhook secret (used to validate incoming webhook requests) telegram_webhook_secret: str = "" model_config = {"env_prefix": "IMMICH_WATCHER_"} @property def effective_database_url(self) -> str: if self.database_url: return self.database_url db_path = self.data_dir / "immich_watcher.db" return f"sqlite+aiosqlite:///{db_path}" settings = Settings()