Commit Graph
24 Commits
Author SHA1 Message Date
tiennm99 7008a57cf5 refactor!: rebrand miti99bot to tiennm99bot
BREAKING CHANGE: the Go module path is now github.com/tiennm99/tiennm99bot,
the default sticker pack is stickers_by_<bot username>, and the health body,
deploy DM, User-Agents and image names say tiennm99bot.
2026-10-07 15:14:02 +07:00
tiennm99 79104ef3d7 feat(config): resolve the bot username from BOT_USERNAME or getMe
The default sticker pack name and the lol User-Agent now follow whichever
bot runs the code, so a bot account change needs no code edit. The default
pack becomes miti99_by_<bot username>.
2026-10-07 15:08:08 +07:00
tiennm99 c18006fabc fix(renderer): raise the default render timeout to 30s
Under normal load on the shared host, a /wheelofnames GIF takes 11-12s
and a /gacha wish 14-15s to render, so the 15s default turned ordinary
renders into 504s. The default is now 30s, and the bot waits 45s so it
never abandons a render the renderer is still allowed to finish.
2026-10-03 13:06:04 +07:00
tiennm99 1c64b44a46 chore(deploy): comment out optional compose variables
Coolify passes every dashboard variable to each service through its
generated .env, so optional values need no compose reference. It also
creates a dashboard entry for every referenced variable and keeps an
existing empty entry over a ${VAR:-default}, which overrides the compose
default. Optional variables are therefore commented-out ${VAR:-default}
lines, and the code supplies their defaults.
2026-10-03 12:46:11 +07:00
tiennm99 e418bf3390 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.
2026-10-03 12:42:16 +07:00
tiennm99 153fc211cf 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.
2026-10-03 12:38:39 +07:00
tiennm99 4f8c01dae7 chore(deploy): write compose env defaults as "default: value" 2026-10-03 12:26:41 +07:00
tiennm99 be7ad347bd chore(deploy): group compose env vars and list optional ones without defaults
Each service's environment is grouped into required, optional, and
stack-fixed values. Optional variables are referenced without a default,
so Coolify lists them as settings that can be filled in or left empty;
an empty value falls back to the code's default.
2026-10-03 12:24:16 +07:00
tiennm99 9457baf81a fix(deploy): pass LOL_PANDASCORE_TOKEN to the bot explicitly
The lol module reads the PandaScore token, but compose.yml never listed
it, so the bot depended on Coolify passing unlisted variables through. It
is optional: without it the lol commands fail and the rest of the bot
runs.
2026-10-03 12:19:56 +07:00
tiennm99 8c7a0ee313 chore(deploy): keep interpolation syntax out of compose comments 2026-10-03 12:11:38 +07:00
tiennm99 1ee679ad89 fix(deploy): stop exposing renderer tuning as Coolify settings
Coolify lists every ${VAR} that compose.yml references as an app setting,
so the four renderer tuning values showed up as entries to fill in. They
are no longer referenced: the renderer's own defaults apply, and an
override goes into compose.yml as a literal.
2026-10-03 12:11:25 +07:00
tiennm99 83321fa330 refactor(renderer)!: prefix every renderer env var with RENDERER_
The renderer's settings now read RENDERER_HOST, RENDERER_PORT,
RENDERER_MAX_CONCURRENT_RENDERS, RENDERER_RENDER_TIMEOUT_MS,
RENDERER_MAX_OPTIONS, and RENDERER_MAX_OPTION_CHARS, so they read as
renderer settings and cannot clash with the bot's variables, which
Coolify injects into every service. NODE_ENV keeps its standard name.

BREAKING CHANGE: the unprefixed HOST, PORT, MAX_CONCURRENT_RENDERS,
RENDER_TIMEOUT_MS, MAX_OPTIONS, and MAX_OPTION_CHARS are no longer read
by the renderer.
2026-10-03 12:05:56 +07:00
tiennm99 11ed121af9 fix(deploy): add a compose healthcheck for the bot
Coolify ignores its UI health-check settings for Docker Compose apps and
reads each service's healthcheck instead, so the bot reported an unknown
status. It now checks GET / with the image's busybox wget.
2026-10-03 12:01:30 +07:00
tiennm99 277c913f71 refactor(random)!: configure the renderer by base URL as RENDERER_URL
The bot now takes the renderer's base URL and appends each /api/<name>
route itself, instead of taking the full /api/gif endpoint and swapping
its last path segment for /gacha and /genshin. The client, its files, and
its errors are named after the renderer rather than wheelofnames; the
/wheelofnames command keeps its name.

BREAKING CHANGE: WHEELOFNAMES_API_URL is replaced by RENDERER_URL, which
holds the base URL (e.g. http://renderer:3000) rather than the /api/gif
endpoint. compose.yml sets it, so Coolify needs no value.
2026-10-03 11:52:50 +07:00
tiennm99 2ec4a2b371 refactor(renderer)!: drop the API token from the internal renderer
The renderer now runs only on the compose network with no published port
or domain, so a shared bearer token adds nothing. The renderer no longer
checks Authorization or requires API_TOKEN in production, and the bot no
longer sends a token.

BREAKING CHANGE: WHEELOFNAMES_API_TOKEN and the renderer's API_TOKEN are
removed. Never publish the renderer's port: its API is unauthenticated.
2026-10-03 11:45:26 +07:00
tiennm99 2bb5108151 feat(renderer): deploy the renderer next to the bot in compose
The bot now reaches the renderer at http://renderer:3000/api/gif on the
compose network instead of a separately deployed service. Both share
WHEELOFNAMES_API_TOKEN. CI runs the renderer's lint, typecheck, tests,
render smoke, and image build.
2026-10-03 11:16:54 +07:00
tiennm99 858eaa066b feat(misc): add /gacha Genshin-style wish picker
Options take an optional *4 or *5 rarity tag; untagged options are 3 stars.
A pick rolls a tier at Genshin base rates over the tiers present, then an
option uniformly within it, so untagged input matches /random. The wish
animation renders as MP4 on the wheelofnames service at /api/gacha, with a
text fallback when the renderer is unset or fails.
2026-10-01 13:02:46 +07:00
tiennm99 d51bcbd224 docs: correct README, deploy guide and module docs against current code 2026-09-30 14:17:31 +07:00
tiennm99 00dc4c7800 feat(misc): add wheelofnamesbeta render API 2026-07-07 00:12:58 +07:00
tiennm99 9c998a0e2f refactor(modules): remove twentyq genai integration 2026-06-29 10:07:21 +07:00
tiennm99 20dc03c6d2 refactor(config): remove price URL env overrides 2026-06-29 09:23:20 +07:00
tiennm99 9c8387bf3a fix(deploynotify): preserve coolify source commit 2026-06-29 00:20:04 +07:00
tiennm99 b0586903f5 refactor(deploy): remove retired aws support 2026-06-29 00:11:42 +07:00
tiennm99 d56c95cff2 build(coolify): rename compose file 2026-06-29 00:00:22 +07:00