Files
stoat-mbot/.env.example
T
Leonid PershinandClaude Opus 5 2b999bf2a0 Document YouTube cookie auth and warn when the file is unusable
Cookies were already wired up but only mentioned in passing, and the
non-obvious parts were undocumented: yt-dlp has no username/password
support for YouTube, it rewrites the cookie file to persist rotated
cookies (so a read-only file expires early), and the export has to
happen in a private window that is logged out before closing.

Startup now reports whether the cookie file is usable, missing, or
read-only, and YTDLP_EXTRACTOR_ARGS is passed through for the cases
where YouTube blocks a server IP outright.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-08 23:26:48 +03:00

59 lines
2.8 KiB
Bash

# ---------------------------------------------------------------- Stoat ----
# Публичный адрес API вашего инстанса (тот же, что в клиенте).
# Бот ходит по нему как обычный клиент; домен резолвится в хост через
# extra_hosts в compose.yml, поэтому TLS валидный и NAT loopback не нужен.
STOAT_API_URL=https://chat.example.com/api
# Токен бота: Settings → My Bots → создать бота → скопировать токен.
STOAT_BOT_TOKEN=
# Префикс команд в чате.
COMMAND_PREFIX=!
# ------------------------------------------------------------- Веб-панель ---
PORT=3005
HOST=0.0.0.0
# Адрес, по которому панель открывается в браузере (без слэша в конце).
PUBLIC_URL=https://music.example.com
# Секрет для подписи сессионных cookie. Сгенерируйте: openssl rand -hex 32
JWT_SECRET=
# Срок жизни сессии панели, часов.
SESSION_TTL_HOURS=168
# ---------------------------------------------------------------- Аудио ----
# Путь к yt-dlp. В docker-образе он уже установлен.
YTDLP_PATH=yt-dlp
# Необязательно: cookies.txt аккаунта YouTube — снимает возрастные ограничения,
# «Sign in to confirm you're not a bot» и открывает приватные/платные видео.
# Файл должен быть доступен на ЗАПИСЬ: yt-dlp обновляет в нём ротируемые куки.
# Подробности — в README, раздел «Учётка YouTube (cookies)».
# YTDLP_COOKIES=/data/cookies.txt
# Необязательно: дополнительные --extractor-args, через ";".
# Помогает, когда YouTube не отдаёт форматы серверному IP:
# YTDLP_EXTRACTOR_ARGS=youtube:player_client=default,web_safari
# Необязательно: каталог с локальной медиатекой (смонтируйте том).
# LOCAL_MEDIA_DIR=/media/music
DEFAULT_VOLUME=60
MAX_QUEUE_SIZE=500
SEARCH_RESULT_LIMIT=10
# Через сколько секунд простоя бот выходит из голосового канала (0 — никогда).
IDLE_TIMEOUT_SECONDS=300
# --------------------------------------------------------------- Доступ ----
# false — управлять может любой участник сервера.
# true — только владелец, ManageServer или роль DJ_ROLE_NAME.
REQUIRE_DJ_ROLE=false
DJ_ROLE_NAME=DJ
# ----------------------------------------------------------------- Прочее ---
LOG_LEVEL=info
NODE_ENV=production