"""Reader service configuration — all from environment variables."""

import os

# ── Database (reuse Brain's PostgreSQL) ──
DATABASE_URL = os.environ.get(
    "DATABASE_URL",
    "postgresql+asyncpg://brain:brain@brain-db:5432/brain",
)
DATABASE_URL_SYNC = DATABASE_URL.replace("+asyncpg", "")

# ── Redis (reuse Brain's Redis) ──
REDIS_URL = os.environ.get("REDIS_URL", "redis://brain-redis:6379/0")

# ── Crawler (reuse Brain's Playwright crawler) ──
CRAWLER_URL = os.environ.get("CRAWLER_URL", "http://brain-crawler:3100")

# ── Service ──
PORT = int(os.environ.get("PORT", "8300"))
DEBUG = os.environ.get("DEBUG", "").lower() in ("1", "true")

# ── Feed fetch interval (seconds) ──
FEED_FETCH_INTERVAL = int(os.environ.get("FEED_FETCH_INTERVAL", "600"))
