mirror of
https://github.com/tiennm99/tiennm99bot.git
synced 2026-10-11 12:28:54 +00:00
fix(deploynotify): stop clobbering Coolify-injected SOURCE_COMMIT
Declaring SOURCE_COMMIT: ${SOURCE_COMMIT:-} in compose resolved to an empty
string at parse time and overrode the value Coolify auto-injects into the
container at runtime, so gitSHA stayed empty and the owner DM was skipped.
Remove the declaration; the bot already reads SOURCE_COMMIT from the container
env at startup.
This commit is contained in:
1 parent
0abd33cb42
commit
035149f600
3 files changed
+16
-14
No files matched your search
+5
-5
@@ -23,11 +23,11 @@ ADMIN_IDS=
|
||||
# Only the twentyq module needs this. Leave blank to disable that command.
|
||||
GEMINI_API_KEY=
|
||||
|
||||
# SOURCE_COMMIT is injected into the container at runtime by Coolify (a
|
||||
# predefined env var holding the commit SHA); read at startup for the
|
||||
# deploynotify owner DM. Leave unset for local `docker compose up` —
|
||||
# deploynotify just stays silent.
|
||||
# SOURCE_COMMIT=
|
||||
# SOURCE_COMMIT (commit SHA) is auto-injected into the container at runtime by
|
||||
# Coolify and read at startup for the deploynotify owner DM — do NOT set it here
|
||||
# and do NOT declare it in docker-compose (that would clobber Coolify's value
|
||||
# with an empty string). Local `docker compose up` has none, so deploynotify
|
||||
# just stays silent.
|
||||
|
||||
# ====================== Leave UNSET on self-host ==================
|
||||
# These are AWS-only. cmd/server reads secrets directly from the plain env
|
||||
|
||||
+5
-4
@@ -16,10 +16,11 @@ services:
|
||||
ADMIN_IDS: ${ADMIN_IDS} # CSV of admin Telegram user ids
|
||||
# --- Optional ---
|
||||
GEMINI_API_KEY: ${GEMINI_API_KEY} # only the twentyq module needs it
|
||||
# Coolify injects SOURCE_COMMIT (commit SHA) at deploy time; passed to the
|
||||
# container so deploynotify DMs the owner once per new version. Empty (e.g.
|
||||
# local `docker compose up` without it) just stays silent.
|
||||
SOURCE_COMMIT: ${SOURCE_COMMIT:-}
|
||||
# SOURCE_COMMIT (commit SHA, read at startup for the deploynotify owner DM)
|
||||
# is auto-injected into the container by Coolify — do NOT declare it here.
|
||||
# A `SOURCE_COMMIT: ${SOURCE_COMMIT:-}` entry resolves to "" at compose-parse
|
||||
# time and would clobber Coolify's runtime value. Local `docker compose up`
|
||||
# has no SOURCE_COMMIT, so deploynotify just stays silent there.
|
||||
# Storage auto-selects mongodb because MONGO_URL is set — no KV_PROVIDER.
|
||||
# The in-process cron scheduler runs by default — no CRON_MODE.
|
||||
# PORT defaults to 8080 (internal health server) — omit unless overriding.
|
||||
|
||||
@@ -88,11 +88,12 @@ SSM/AWS lookup that fails with no AWS creds and bricks startup), `KV_PROVIDER`,
|
||||
bot token; a second poller gets HTTP 409, and a second in-process scheduler
|
||||
double-fires crons. Prefer **stop-first redeploys** so two containers never
|
||||
overlap near a cron time.
|
||||
5. **deploynotify commit SHA:** Coolify injects `SOURCE_COMMIT` (a predefined
|
||||
runtime env var) into the container, and the compose `environment` forwards
|
||||
it, so the bot reads it at startup and DMs the owner the "new version"
|
||||
notice — no manual wiring. Without it, `deploynotify` stays silent (no
|
||||
crash) — but you lose that notification.
|
||||
5. **deploynotify commit SHA:** Coolify auto-injects `SOURCE_COMMIT` (a
|
||||
predefined runtime env var) into the container, and the bot reads it at
|
||||
startup to DM the owner the "new version" notice — no manual wiring, and do
|
||||
**not** declare `SOURCE_COMMIT` in compose/env (a `${SOURCE_COMMIT:-}` entry
|
||||
resolves to `""` at parse time and clobbers Coolify's value). Without it,
|
||||
`deploynotify` stays silent (no crash) — but you lose that notification.
|
||||
6. **Health check:** use Coolify's HTTP monitor against `GET /` (returns
|
||||
`text/plain` `miti99bot ok`). Do **not** use a compose `healthcheck` — the
|
||||
distroless image has no shell/curl and `cmd/server` has no `-healthcheck`
|
||||
|
||||
Reference in new issue
Block a user