# ---------------------------------------------------------------------------
# Telegram Media Publisher - sample configuration
# Copy this file to `.env` and replace every placeholder.
# Windows PowerShell: Copy-Item .env.example .env
# Linux:              cp .env.example .env
# NEVER commit `.env`.
# ---------------------------------------------------------------------------

# Required: token issued by @BotFather.
BOT_TOKEN=8821664535:AAEqvQpdZhsb39SIkcJCy3PYdiZIqO50H5o

# Required: comma-separated numeric Telegram user IDs. The first one is the
# protected primary administrator and cannot be removed from the panel.
ADMIN_IDS=7658106221

# Optional. Usually discovered automatically with getMe at startup.
# BOT_USERNAME=telpublisherbot

# ---------------------------------------------------------------------------
# Database
# SQLite (default):
DATABASE_URL=sqlite+aiosqlite:///./data/publisher.db
# PostgreSQL example (install/run PostgreSQL first):
# DATABASE_URL=postgresql+asyncpg://publisher:strong-password@db:5432/publisher

# Development convenience. For production prefer:
#   AUTO_CREATE_SCHEMA=false
#   RUN_MIGRATIONS=true
# The Docker entrypoint runs `alembic upgrade head` when either
# AUTO_CREATE_SCHEMA=false or RUN_MIGRATIONS=true.
AUTO_CREATE_SCHEMA=true
# RUN_MIGRATIONS=false

# Optional values used by docker-compose.yml's PostgreSQL profile.
# POSTGRES_DB=publisher
# POSTGRES_USER=publisher
# POSTGRES_PASSWORD=replace-with-a-long-random-password

# ---------------------------------------------------------------------------
# Runtime
# IANA timezone used only for displaying/parsing admin-panel dates. Storage is UTC.
TIMEZONE=Asia/Tehran
LOG_LEVEL=INFO
LOG_FILE=./logs/bot.log
DATA_DIR=./data

# Optional custom Bot API server (official API is used when empty).
# TELEGRAM_API_BASE_URL=https://api.telegram.org
# Optional HTTP proxy for the Telegram session.
# PROXY_URL=http://127.0.0.1:10809

# Polling is the supported deployment mode. Run exactly ONE bot instance per
# token. WEBHOOK is intentionally not enabled by this project.
# ---------------------------------------------------------------------------
# Limits / safety
MAX_MEDIA_SIZE_MB=2000
MAX_CAPTION_LENGTH=1024
DELIVERY_RATE_LIMIT_REQUESTS=5
DELIVERY_RATE_LIMIT_WINDOW_SECONDS=60
DELIVERY_MIN_INTERVAL_SECONDS=2
SCHEDULER_POLL_SECONDS=5
JOB_MAX_ATTEMPTS=5
TELEGRAM_REQUEST_TIMEOUT_SECONDS=60
RETRY_MAX_ATTEMPTS=3
RETRY_BASE_DELAY_SECONDS=1.0

# Telegram's public Bot API currently limits bot uploads to 50 MB. Re-sending
# an existing file_id does not require a local upload. See README for details.
TELEGRAM_UPLOAD_LIMIT_MB=50
