revert: restore code fallbacks for config defaults

This reverts commit 153fc21. With no fallback in code, the deploy
crash-looped: Coolify keeps an entry for every variable compose.yml has
referenced, and empty entries appear to reach the containers as empty
values instead of the compose defaults.
This commit is contained in:
tiennm99 committed 2026-10-03 12:42:16 +07:00
1 parent 153fc211cf
commit e418bf3390
17 files changed
+100 -214

No files matched your search

+16 -16
View File
@@ -11,18 +11,18 @@ services:
MONGO_URL: ${MONGO_URL} # Atlas SRV string incl. credentials — SECRET
MONGO_DATABASE: ${MONGO_DATABASE} # e.g. miti99bot
# --- Access control (optional; empty means none / all) ---
MODULES: ${MODULES:-} # CSV of modules; empty = all modules
OWNER_ID: ${OWNER_ID:-} # Telegram user id for owner-only commands; empty = none
ADMIN_IDS: ${ADMIN_IDS:-} # CSV of admin Telegram user ids; empty = none
# --- Access control (optional; empty uses the default) ---
MODULES: ${MODULES} # CSV of modules; default: all modules
OWNER_ID: ${OWNER_ID} # Telegram user id for owner-only commands; default: none
ADMIN_IDS: ${ADMIN_IDS} # CSV of admin Telegram user ids; default: none
# --- Module settings (optional) ---
LOL_PANDASCORE_TOKEN: ${LOL_PANDASCORE_TOKEN:-} # PandaScore token — SECRET; empty = /lol* fetches fail
GOLD_VNAPP_API_KEY: ${GOLD_VNAPP_API_KEY:-} # VNAppMob key — SECRET; empty = fetched and cached in Mongo
STICKER_PACK_NAME: ${STICKER_PACK_NAME:-miti99_by_miti99bot} # /addsticker set; must end in _by_<bot username>
# --- Module settings (optional; empty uses the default) ---
LOL_PANDASCORE_TOKEN: ${LOL_PANDASCORE_TOKEN} # PandaScore token — SECRET; default: none (/lol* fetches fail)
GOLD_VNAPP_API_KEY: ${GOLD_VNAPP_API_KEY} # VNAppMob key — SECRET; default: fetched and cached in Mongo
STICKER_PACK_NAME: ${STICKER_PACK_NAME} # /addsticker set; default: miti99_by_miti99bot
# --- Runtime (defaults below; the code has no fallback) ---
LOG_LEVEL: ${LOG_LEVEL:-info} # debug|info|warn|error
# --- Runtime (optional; empty uses the default) ---
LOG_LEVEL: ${LOG_LEVEL} # debug|info|warn|error; default: info
# --- Fixed by this stack (not Coolify settings) ---
# The bundled renderer service below draws /wheelofnames, /gacha and
@@ -30,12 +30,12 @@ services:
# platform-level value cannot point the bot elsewhere; the bot appends
# each /api/<name> route itself.
RENDERER_URL: http://renderer:3000
PORT: "8080" # health server; keep in sync with the healthcheck below
# --- Deliberately not declared ---
# SOURCE_COMMIT: Coolify provides it at runtime via its generated env
# file; declaring it here with Compose interpolation can override the
# runtime value with an empty string.
# PORT: the health server defaults to 8080, which the healthcheck uses.
# KV_PROVIDER: storage auto-selects mongodb because MONGO_URL is set.
# Long polling = no TELEGRAM_WEBHOOK_SECRET, no /webhook, no public domain.
# Cron is in-process only — no CRON_MODE, no /cron route, no secret.
@@ -70,11 +70,11 @@ services:
# Every renderer setting carries the RENDERER_ prefix so it reads as a
# renderer setting and cannot clash with the bot's variables.
# --- Tuning (defaults below; the renderer has no fallback) ---
RENDERER_MAX_CONCURRENT_RENDERS: ${RENDERER_MAX_CONCURRENT_RENDERS:-1}
RENDERER_RENDER_TIMEOUT_MS: ${RENDERER_RENDER_TIMEOUT_MS:-15000} # floor 7000
RENDERER_MAX_OPTIONS: ${RENDERER_MAX_OPTIONS:-32} # wheel options
RENDERER_MAX_OPTION_CHARS: ${RENDERER_MAX_OPTION_CHARS:-40} # chars per option/label
# --- Tuning (optional; empty uses the default) ---
RENDERER_MAX_CONCURRENT_RENDERS: ${RENDERER_MAX_CONCURRENT_RENDERS} # default: 1
RENDERER_RENDER_TIMEOUT_MS: ${RENDERER_RENDER_TIMEOUT_MS} # default: 15000 (floor 7000)
RENDERER_MAX_OPTIONS: ${RENDERER_MAX_OPTIONS} # default: 32 wheel options
RENDERER_MAX_OPTION_CHARS: ${RENDERER_MAX_OPTION_CHARS} # default: 40 chars per option/label
# --- Fixed by this stack (not Coolify settings) ---
NODE_ENV: production