refactor!: move every config default into compose.yml

compose.yml now holds each default as ${VAR:-default}, and the code keeps
no fallback values. The bot stops at startup on a missing or invalid
PORT or LOG_LEVEL, /addsticker refuses without STICKER_PACK_NAME, and the
renderer refuses to start until every RENDERER_* setting is a valid
value, listing each problem. Settings whose empty value means none or
all (MODULES, OWNER_ID, ADMIN_IDS, the API tokens) use ${VAR:-}.

The renderer's npm start and dev load .env when present, so a local run
works from a copy of .env.example.

BREAKING CHANGE: running outside compose now requires LOG_LEVEL and PORT
for the bot, STICKER_PACK_NAME for /addsticker, and every RENDERER_*
variable for the renderer.
This commit is contained in:
tiennm99 committed 2026-10-03 12:38:39 +07:00
1 parent 4f8c01dae7
commit 153fc211cf
17 files changed
+208 -94

No files matched your search

+7
View File
@@ -262,6 +262,8 @@ shell, then run the server with Go:
```powershell
# PowerShell
$env:TELEGRAM_BOT_TOKEN = "…"
$env:LOG_LEVEL = "info"
$env:PORT = "8080"
$env:MODULES = ""
go run ./cmd/server
```
@@ -269,10 +271,15 @@ go run ./cmd/server
```sh
# POSIX shells (Linux/macOS)
export TELEGRAM_BOT_TOKEN="…"
export LOG_LEVEL=info
export PORT=8080
export MODULES=""
go run ./cmd/server
```
The code has no default values: `compose.yml` supplies them, so a local run
sets `LOG_LEVEL` and `PORT` itself (and `STICKER_PACK_NAME` for `/addsticker`).
The bot uses long polling, so a local run talks to Telegram directly — no
`ngrok` or public URL. The server clears any existing webhook on startup. The
dev bot is created manually; its token is injected through the environment.