Documentation menu

Configuration

Configuration & Environment Reference

Exhaustive reference of AutoTelegramForward environment variables, database URLs, port mappings, and performance tuning parameters.

Verified against the checkout built for v2.2.4 · updated 20 Oct 2026

Overview

AutoTelegramForward is configured via environment variables, loaded automatically from .env in the working directory. Configuration is strictly typed and validated at application startup.

Environment Variables Reference

VariableTypeRequiredDefaultDescription
TELEGRAM_API_IDintegerRequiredNoneTelegram Application ID obtained from my.telegram.org.
TELEGRAM_API_HASHstringRequiredNone32-character Telegram API Hash from my.telegram.org.
TELEGRAM_BOT_TOKENstringRequiredNoneTelegram Bot Token from @BotFather for the management UI.
ADMIN_USER_IDintegerRequiredNonePrimary admin Telegram numerical ID for fail-closed root access.
DATABASE_URLstringOptionalsqlite:///data/atf.dbDatabase connection string. Supports SQLite WAL mode and PostgreSQL.
GRPC_PORTintegerOptional50051Internal gRPC port for communication between atf-core and atf-api.
API_PORTintegerOptional8080HTTP port for the Go API gateway.
LOGGER_PORTintegerOptional50052gRPC port for centralized structured telemetry logger.
WEB_PORTintegerOptional8088HTTP port for the Web Dashboard interface.
DURABLE_QUEUE_WORKERSintegerOptional4Number of parallel queue worker coroutines per tenant.
MAX_TIME_EDIT_DEFAULTintegerOptional86400Maximum message age in seconds to accept edit synchronizations.
LOG_LEVELstringOptionalINFOLogging verbosity (DEBUG, INFO, WARNING, ERROR).

Database Selection: SQLite vs PostgreSQL

SQLite (Default & Embedded)

Ideal for single-server setups forwarding hundreds of messages per hour. ATF automatically configures:

PRAGMA journal_mode=WAL;
PRAGMA busy_timeout=5000;
PRAGMA synchronous=NORMAL;

PostgreSQL (Enterprise Scale)

Recommended for high-concurrency clusters with thousands of simultaneous channels. Supply standard URI:

DATABASE_URL=postgresql://user:pass@postgres:5432/atf_db