Files
haos-hacs-immich-album-watcher/packages/server/src/immich_watcher_server/config.py
alexei.dolgolyov 89cb2bbb70
Some checks failed
Validate / Hassfest (push) Has been cancelled
Add enhanced models, scheduled jobs, per-locale templates (Phase 7b)
Backend changes for full blueprint feature parity:

Database models:
- MessageTemplate: add body_ru (locale variant), event_type field
- AlbumTracker: add track_images, track_videos, notify_favorites_only,
  include_people, include_asset_details, max_assets_to_show,
  assets_order_by, assets_order fields
- New ScheduledJob model: supports periodic_summary, scheduled_assets,
  and memory (On This Day) notification modes with full config
  (times, interval, album_mode, limit, filters, sorting)

API:
- New /api/scheduled/* CRUD endpoints for scheduled jobs
- Tracker create/update accept all new filtering fields
- Tracker response includes new fields

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 15:48:01 +03:00

44 lines
1.1 KiB
Python

"""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()