Skip to content

RU Configuration

Andrewkydev edited this page Aug 25, 2026 · 1 revision

Configuration

English: EN-Configuration

AstraEngine не требует собственного config format. Adapter config можно собрать напрямую из environment.

Для CLI и examples/multi-platform есть helper:

cfg := runtimecfg.Load()
if err := cfg.ValidatePlatforms(); err != nil {
	return err
}

runtime.Load() читает локальный .env, затем environment. configs/config.example.yaml — только схема-пример и автоматически не загружается.

Variable Default Назначение
ASTRAENGINE_APP_NAME multi-platform-bot имя приложения
ASTRAENGINE_LOG_LEVEL info debug, info, warn, error
ASTRAENGINE_LOG_FORMAT text text или json
ASTRAENGINE_LOG_SOURCE false source location
TELEGRAM_TOKEN — Telegram token
TG_SERVER_URL — custom Bot API URL
TG_PROXY_URL — proxy URL
TG_INIT_TIMEOUT_SEC 20 init timeout
TG_POLL_TIMEOUT_SEC 30 polling timeout
TG_REQUEST_TIMEOUT_SEC 30 request timeout
TG_SKIP_GETME false skip initial getMe
VK_TOKEN — VK community token
VK_GROUP_ID 0 positive community ID
VK_DEBUG false adapter debug
DISCORD_TOKEN — Discord bot token
ASTRAENGINE_STORAGE_DRIVER memory CLI storage driver
ASTRAENGINE_DATABASE_URL — PostgreSQL DSN
ASTRAENGINE_PG_AUTO_SCHEMA false CLI schema creation
ASTRAENGINE_MIGRATIONS_STORE file file или session
ASTRAENGINE_MIGRATIONS_FILE .astraengine/migrations.json migration state file

Boolean true: 1, true, yes, on без учёта регистра. Не коммитьте .env.

Clone this wiki locally