/
codespawn
/
tgstream
Обзор
Документация
Войти
/
codespawn
/
tgstream
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
16
CI/CD
Аналитика
Безопасность
master
deploy/.env.example
89 строк
4 KB
codespawn
Запрос на слияние 'feat/cli-config-override' (
#14
) из feat/cli-config-override в master
26 июл 2026, 18:09
Верифицирован
26 июл 2026, 18:09
3472af2
Код
Авторство
О чём код?
# tgstream Environment Configuration # Copy this file to .env and customize as needed. # Full reference: DEPLOY.md (Environment Variables). # # All config vars use prefix TGSTREAM_ and flat UPPER_SNAKE names: # TGSTREAM_<SECTION>_<FIELD>. Durations use Go format only (5m, 300s). # TGSTREAM_CONFIG_FILE points at a YAML config file. Meta vars (LOG_LEVEL, # LOG_FORMAT, HTTP_PROXY/HTTPS_PROXY/NO_PROXY) have no prefix. # --- Server / listen --- # TGSTREAM_SERVER_ADDR=:8080 # full host:port (takes priority over PORT) TGSTREAM_SERVER_PORT=8080 # --- Storage (SQLite only) --- TGSTREAM_STORE_DB_PATH=/app/data/tgstream.db # --- Cache (L1 in-memory; L2 reuses cache.ttl) --- # TGSTREAM_CACHE_TTL=5m # TGSTREAM_CACHE_SIZE=1000 # --- Source: DSL extraction configs (REQUIRED) --- # Directory with extraction configs (*.yaml/*.yml/*.json). Ships # deploy/websource-configs/telegram.yaml by default. Each file = one feed; # its `id` is the feed-id used in /feed/<id>. Without this the service won't start. TGSTREAM_SOURCE_CONFIGS_DIR=/app/websource-configs # Optional: external render service for JS-rendered pages (prerender-compatible # protocol: GET <renderURL>/<target>). Needed only if a config sets render:true. # TGSTREAM_SOURCE_RENDER_URL=http://renderer:3000 # --- Source: HTTP fetch policy --- # TGSTREAM_SOURCE_TIMEOUT=15s # TGSTREAM_SOURCE_MAX_CONCURRENCY=4 # TGSTREAM_SOURCE_MAX_RPS=2 # --- Source: User-Agent --- # TGSTREAM_SOURCE_USER_AGENT=tgstream/0.1 (+https://gitverse.ru/codespawn/tgstream) # --- Upstream HTTP proxy (standard Go mechanism; shared by Source + media) --- # No TGSTREAM_ prefix. Applies to both Source requests and media-proxy fetches # via http.DefaultTransport (http.ProxyFromEnvironment). SOCKS5 not supported. # HTTP_PROXY=http://proxy.example.com:8080 # HTTPS_PROXY=http://proxy.example.com:8080 # NO_PROXY=localhost,127.0.0.1 # --- Feed output --- # TGSTREAM_FEED_ITEM_LIMIT=20 # --- Stored post history --- # TGSTREAM_STORE_MAX_PER_CHANNEL=0 # --- HTTP server timeouts (Go duration) --- # TGSTREAM_SERVER_READ_HEADER_TIMEOUT=5s # TGSTREAM_SERVER_READ_TIMEOUT=15s # TGSTREAM_SERVER_WRITE_TIMEOUT=30s # TGSTREAM_SERVER_IDLE_TIMEOUT=2m # TGSTREAM_SERVER_SHUTDOWN_TIMEOUT=10s # --- Media proxy (optional; rewrites media URLs to be served via /media) --- # Requires TGSTREAM_BASE_URL when TGSTREAM_MEDIA_PROXY_ENABLED=true, otherwise # the service fails to start. TGSTREAM_MEDIA_PROXY_ALLOWED_HOSTS is required when # enabled (comma-separated host suffixes for SSRF protection; empty → all media # URLs rejected). # TGSTREAM_MEDIA_PROXY_ENABLED=true # TGSTREAM_BASE_URL=https://tgstream.example.com # TGSTREAM_MEDIA_PROXY_ALLOWED_HOSTS=telegram-cdn.org,telesco.pe,telegram.org,t.me # TGSTREAM_MEDIA_PROXY_CODEC_SECRET= # HMAC secret (empty → plain tokens) # TGSTREAM_MEDIA_PROXY_CLIENT_TIMEOUT=20s # --- Logging --- LOG_FORMAT=json LOG_LEVEL=info # --- Optional: YAML config file (overrides the default search path) --- # TGSTREAM_CONFIG_FILE=/etc/tgstream/config.yaml # --- Docker build: версия бинарника (compose-only, не влияют на runtime) --- # Читаются docker-compose.yml (build.args) при `docker compose build`. Позволяет # бинарнику внутри образа показывать реальную версию через `tgstream --version` # и в стартовом логе. Без них используются дефолты Dockerfile (dev/none/unknown). # Значения удобно брать из git: # TGSTREAM_VERSION=$(git describe --tags --always --dirty) # TGSTREAM_COMMIT=$(git rev-parse --short HEAD) # TGSTREAM_DATE=$(git log -1 --format=%cI) # Внимание: несмотря на префикс TGSTREAM_, эти переменные читаются ТОЛЬКО # compose на этапе сборки и НЕ попадают в конфигурацию приложения (koanf их # игнорирует — приложение не различает build-time версию от рантайм-настроек). # TGSTREAM_VERSION=v1.2.3 # TGSTREAM_COMMIT=abc1234 # TGSTREAM_DATE=2026-07-25T12:00:00+00:00