mirror of
https://github.com/tiennm99/miti99bot.git
synced 2026-08-06 00:23:31 +00:00
Swap the lol module upstream from the lolesports.com gql persisted-query client to PandaScore REST (/lol/matches, Bearer LOL_PANDASCORE_TOKEN, free tier 1000 req/h). The gql transport broke whenever Riot redeployed their frontend; PandaScore is a stable versioned contract. ScheduleEvent, formatters, cron, and the bson cache shape are unchanged: only the transport and response mapping moved. PandaScore league slugs canonicalize to the existing major-league allowlist; results join to opponents by team_id so reversed arrays cannot swap scores; outcomes are declared only once upstream commits a winner, preserving the score-pending rendering. A still-full final page now logs lol_page_budget_exhausted and the live page budget covers 500 raw matches per window. Missing token short-circuits with lol_token_missing before any upstream call; the 60-minute stale cache still covers outages. Document the new env var and cancel the superseded Leaguepedia score-enrichment plan.
47 lines
2.2 KiB
Bash
47 lines
2.2 KiB
Bash
# miti99bot — self-host (Coolify + MongoDB Atlas) environment.
|
|
# Copy to .env and fill in. .env is gitignored — never commit real secrets.
|
|
|
|
# ============================ Required ============================
|
|
# Telegram bot token from @BotFather.
|
|
TELEGRAM_BOT_TOKEN=123456:ABC-DEF...
|
|
|
|
# MongoDB Atlas connection. MONGO_URL is the full SRV string INCLUDING the
|
|
# db username + password — treat it as a secret (it is never logged).
|
|
# Create a least-privilege user: readWrite on this one database only.
|
|
MONGO_URL=mongodb+srv://botuser:STRONG_UNIQUE_PASSWORD@cluster0.xxxxx.mongodb.net/?retryWrites=true&w=majority
|
|
MONGO_DATABASE=miti99bot
|
|
|
|
# ============================ Operational =========================
|
|
# Comma-separated module list. Empty = load every module.
|
|
MODULES=
|
|
# Telegram user id for owner-only commands (renamed from BOT_OWNER_ID).
|
|
OWNER_ID=
|
|
# Comma-separated admin Telegram user ids (renamed from ADMIN_USER_IDS).
|
|
ADMIN_IDS=
|
|
|
|
# SOURCE_COMMIT (commit SHA) is read at startup for the deploynotify owner DM.
|
|
# Do NOT set it here. Coolify provides it at runtime. Keep "Include Source
|
|
# Commit in Build" disabled so Docker layer cache survives across commits.
|
|
# Local `docker compose up` has none, so deploynotify reports "unknown".
|
|
|
|
# PandaScore API token for the lol module's schedule fetches (free tier at
|
|
# https://app.pandascore.co/dashboard, no credit card). Secret — never logged.
|
|
# Without it every /lol* fetch fails; the stale cache covers ≤60 min.
|
|
LOL_PANDASCORE_TOKEN=
|
|
|
|
# Optional /wheelofnames GIF renderer. Standard deployment:
|
|
# https://github.com/tiennm99/wheelofnames. Leave blank to fall back to text
|
|
# selection.
|
|
WHEELOFNAMES_API_URL=
|
|
# Bearer token matching the wheelofnames service API_TOKEN when URL is set.
|
|
WHEELOFNAMES_API_TOKEN=
|
|
|
|
# ====================== Leave UNSET on self-host ==================
|
|
# Defaults are correct for self-host:
|
|
# KV_PROVIDER — auto-selects mongodb because MONGO_URL is set
|
|
# PORT — defaults to 8080 (internal health server)
|
|
# TELEGRAM_WEBHOOK_SECRET — long polling has no webhook
|
|
# GOLD_VNAPP_API_KEY — gold module auto-fetches + caches the key to Mongo
|
|
# Stock/coin/gold URL env overrides are not supported; modules use coded
|
|
# default providers.
|