This page documents all environment variables used to configure Alita Robot.
Hours between activity checks
Property Value Type integerRequired No Default 1Validation min=1,max=24
Whether to automatically mark inactive chats
Property Value Type booleanRequired No Default true
Days before marking a chat as inactive
Property Value Type integerRequired No Default 30Validation min=1,max=365
Property Value Type integerRequired Yes Validation required,min=1
Property Value Type integerRequired Yes Validation required,min=1
Property Value Type booleanRequired No Default false
Comma-separated list of enabled language codes (e.g., en,es,fr,hi). Only these locales will be loaded.
Property Value Type string[]Required No Default en
Property Value Type stringRequired Yes Validation required
Custom Telegram Bot API server URL. Used with local telegram-bot-api server.
Property Value Type stringRequired No Default https://api.telegram.org
Telegram API ID for local telegram-bot-api server. Obtain from https://my.telegram.org/apps .
Property Value Type integerRequired No
Telegram API hash for local telegram-bot-api server. Obtain from https://my.telegram.org/apps .
Property Value Type stringRequired No
Enables debug logging and disables automatic performance monitoring.
Property Value Type booleanRequired No Default false
Property Value Type stringRequired No Default worker
Property Value Type stringRequired Yes Validation required
Max idle time in minutes
Property Value Type integerRequired No Default 60Validation min=1,max=60
Max lifetime in minutes
Property Value Type integerRequired No Default 240Validation min=1,max=1440
Property Value Type integerRequired No Default 50Validation min=1,max=100
Property Value Type integerRequired No Default 200Validation min=1,max=1000
Enable automatic database migrations on startup
Property Value Type booleanRequired No Default false
Continue running even if migrations fail
Property Value Type booleanRequired No Default false
Path to migration files
Property Value Type stringRequired No Default migrations
Property Value Type booleanRequired No Default false
Batch request timeout in milliseconds
Property Value Type integerRequired No Default 100Validation min=10,max=5000
Enable async processing for non-critical operations
Property Value Type booleanRequired No Default true
Enable batch API requests
Property Value Type booleanRequired No Default true
Enable cache prewarming on startup
Property Value Type booleanRequired No Default true
Enable HTTP connection pooling
Property Value Type booleanRequired No Default true
Enable query batching and prefetching
Property Value Type booleanRequired No Default true
Enable response caching
Property Value Type booleanRequired No Default true
HTTP connection pool size
Property Value Type integerRequired No Default 100Validation min=10,max=1000
HTTP connections per host
Property Value Type integerRequired No Default 50Validation min=5,max=500
Response cache TTL in seconds
Property Value Type integerRequired No Default 30Validation min=1,max=3600
Enable pprof endpoints for performance profiling (development only)
Property Value Type booleanRequired No Default false
Unified HTTP server for health checks, metrics, and webhooks.
Property Value Type integerRequired No Default 8080Validation min=1,max=65535
Redis host:port. Alias for REDIS_URL host component. Either REDIS_ADDRESS or REDIS_URL is required.
Property Value Type stringRequired Yes* Default localhost:6379
*Required if REDIS_URL is not set.
Standard Redis URL (redis://user:password@host:port). If set, REDIS_ADDRESS and REDIS_PASSWORD are extracted from it automatically. Takes lower priority than REDIS_ADDRESS/REDIS_PASSWORD if both are set.
Property Value Type stringRequired Yes*
*Required if REDIS_ADDRESS is not set.
Property Value Type integerRequired No Default 1
Property Value Type stringRequired No
Memory threshold for triggering GC
Property Value Type integerRequired No Default 400Validation min=100,max=5000
Maximum goroutines before triggering cleanup
Property Value Type integerRequired No Default 1000Validation min=100,max=10000
Maximum memory usage in MB
Property Value Type integerRequired No Default 500Validation min=100,max=10000
Whether to clear all caches on bot startup
Property Value Type booleanRequired No Default true
Max concurrent goroutines for dispatcher
Property Value Type integerRequired No Default 200Validation min=1,max=1000
Automatically enabled in production (when DEBUG=false). Set to false to disable.
Property Value Type booleanRequired No Default true (production), false (debug)
Automatically enabled in production (when DEBUG=false). Set to false to disable.
Property Value Type booleanRequired No Default true (production), false (debug)
Property Value Type integerRequired No Default 50Validation min=1,max=1000
Timeout for operations in seconds. Converted to time.Duration internally at OperationTimeoutSeconds * time.Second.
Property Value Type integerRequired No Default 30Validation min=1,max=300
Property Value Type booleanRequired No Default false
Required when USE_WEBHOOKS=true.
Property Value Type stringRequired Conditional
Deprecated: use HTTP_PORT instead.
Property Value Type integerRequired No Default 8081Validation min=1,max=65535
Required when USE_WEBHOOKS=true.
Property Value Type stringRequired Conditional
Token for Cloudflare Tunnel (cloudflared) when using tunnel mode for webhooks.
Property Value Type stringRequired No
Property Value Type integerRequired No Default 4Validation min=1,max=20
Property Value Type integerRequired No Default 3Validation min=1,max=20
Property Value Type integerRequired No Default 10Validation min=1,max=100
Property Value Type integerRequired No Default 5Validation min=1,max=50
Default is number of CPU cores, capped at 8.
Property Value Type integerRequired No Default runtime.NumCPU() (max 8)Validation min=1,max=50
Property Value Type integerRequired No Default 2Validation min=1,max=10
REDIS_ADDRESS = # or REDIS_URL
ACTIVITY_CHECK_INTERVAL = # hours between activity checks ( default: 1 )
API_SERVER = # custom API server URL ( default: https://api.telegram.org )
AUTO_MIGRATE = # enable automatic database migrations ( default: false )
AUTO_MIGRATE_SILENT_FAIL = # continue even if migrations fail (default: false )
BATCH_REQUEST_TIMEOUT_MS = # batch timeout in ms ( default: 100 )
BULK_OPERATION_WORKERS = # ( default: 4 )
CACHE_WORKERS = # ( default: 3 )
CHAT_VALIDATION_WORKERS = # ( default: 10 )
CLEAR_CACHE_ON_STARTUP = # clear all caches on startup ( default: true )
CLOUDFLARE_TUNNEL_TOKEN = # Cloudflare tunnel token for webhooks
DATABASE_WORKERS = # ( default: 5 )
DB_CONN_MAX_IDLE_TIME_MIN = # max idle time in min ( default: 60 )
DB_CONN_MAX_LIFETIME_MIN = # max lifetime in min ( default: 240 )
DB_MAX_IDLE_CONNS = # ( default: 50 )
DB_MAX_OPEN_CONNS = # ( default: 200 )
DEBUG = # enable debug logging ( default: false )
DISPATCHER_MAX_ROUTINES = # ( default: 200 )
DROP_PENDING_UPDATES = # ( default: false )
ENABLE_ASYNC_PROCESSING = # ( default: true )
ENABLE_AUTO_CLEANUP = # ( default: true )
ENABLE_BACKGROUND_STATS = # ( default: true in prod, false in debug )
ENABLE_BATCH_REQUESTS = # ( default: true )
ENABLE_CACHE_PREWARMING = # ( default: true )
ENABLE_DB_MONITORING = # ( default: false )
ENABLE_HTTP_CONNECTION_POOLING = # ( default: true )
ENABLE_PERFORMANCE_MONITORING = # ( default: true in prod, false in debug )
ENABLE_PPROF = # enable pprof endpoints ( default: false )
ENABLE_QUERY_PREFETCHING = # ( default: true )
ENABLE_RESPONSE_CACHING = # ( default: true )
ENABLED_LOCALES = # comma-separated language codes ( default: en )
HTTP_MAX_IDLE_CONNS = # ( default: 100 )
HTTP_MAX_IDLE_CONNS_PER_HOST = # ( default: 50 )
HTTP_PORT = # unified HTTP server port ( default: 8080 )
INACTIVITY_THRESHOLD_DAYS = # days before marking inactive ( default: 30 )
MAX_CONCURRENT_OPERATIONS = # ( default: 50 )
MESSAGE_PIPELINE_WORKERS = # ( default: NumCPU, max 8 )
MIGRATIONS_PATH = # path to migration files ( default: migrations )
OPERATION_TIMEOUT_SECONDS = # timeout in seconds → time.Duration ( default: 30 )
REDIS_DB = # Redis database number ( default: 1 )
REDIS_PASSWORD = # Redis password
REDIS_URL = # Redis URL ( fallback for REDIS_ADDRESS + REDIS_PASSWORD )
RESOURCE_GC_THRESHOLD_MB = # GC threshold in MB ( default: 400 )
RESOURCE_MAX_GOROUTINES = # max goroutines ( default: 1000 )
RESOURCE_MAX_MEMORY_MB = # max memory in MB ( default: 500 )
RESPONSE_CACHE_TTL = # response cache TTL in seconds ( default: 30 )
STATS_COLLECTION_WORKERS = # ( default: 2 )
TELEGRAM_API_HASH = # for local telegram-bot-api server
TELEGRAM_API_ID = # for local telegram-bot-api server
USE_WEBHOOKS = # enable webhook mode ( default: false )
WEBHOOK_DOMAIN = # required if USE_WEBHOOKS = true
WEBHOOK_PORT = # deprecated, use HTTP_PORT ( default: 8081 )
WEBHOOK_SECRET = # required if USE_WEBHOOKS = true
WORKING_MODE = # ( default: worker )