Skip to content

Commit 3a97827

Browse files
authored
Merge pull request #3 from unredacted/expose-mail-vars-to-coolify
Expose SMTP vars so they appear in Coolify's env-var UI
2 parents 7f90764 + f222514 commit 3a97827

3 files changed

Lines changed: 32 additions & 4 deletions

File tree

.github/README.coolify.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ daily; the Coolify-specific patch lives in
1313
2. On the `ghost` service, set the primary **Domain (FQDN)** to the URL
1414
you want (e.g. `https://blog.example.com`). Coolify fills in
1515
`SERVICE_URL_GHOST` automatically and wires Traefik to port 2368.
16-
3. Set SMTP env vars on the resource: `mail__options__host`,
17-
`mail__options__port`, `mail__options__auth__user`,
18-
`mail__options__auth__pass`, `mail__from`. Transactional email is
19-
required by Ghost for staff invites and password resets.
16+
3. Fill in the SMTP rows in the **Environment Variables** tab — the
17+
keys (`mail__options__host`, `mail__options__port`,
18+
`mail__options__auth__user`, `mail__options__auth__pass`, `mail__from`)
19+
are pre-listed. Transactional email is required for staff invites and
20+
password resets; Ghost will still boot without it, only those flows fail.
2021
4. **Deploy**. MySQL credentials generate on first boot via
2122
`SERVICE_USER_MYSQL` / `SERVICE_PASSWORD_MYSQL` / `SERVICE_PASSWORD_MYSQLROOT`
2223
you don't enter them manually.

.github/scripts/patch.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,25 @@ def patch_compose() -> None:
173173
"activitypub.SERVICE_URL_ACTIVITYPUB_8080",
174174
)
175175

176+
# Expose SMTP vars as explicit ${...} refs so Coolify's env scanner
177+
# surfaces them in the UI (upstream passes mail via env_file, which
178+
# Coolify doesn't scan).
179+
c = swap(
180+
c,
181+
" tinybird__stats__endpoint: ${TINYBIRD_API_URL:-https://api.tinybird.co}\n"
182+
" volumes:\n",
183+
" tinybird__stats__endpoint: ${TINYBIRD_API_URL:-https://api.tinybird.co}\n"
184+
" mail__transport: ${mail__transport:-SMTP}\n"
185+
" mail__options__host: ${mail__options__host:-}\n"
186+
" mail__options__port: ${mail__options__port:-465}\n"
187+
" mail__options__secure: ${mail__options__secure:-true}\n"
188+
" mail__options__auth__user: ${mail__options__auth__user:-}\n"
189+
" mail__options__auth__pass: ${mail__options__auth__pass:-}\n"
190+
" mail__from: ${mail__from:-}\n"
191+
" volumes:\n",
192+
"ghost.mail vars",
193+
)
194+
176195
path.write_text(c)
177196

178197

.github/scripts/test-patch.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ grep -q 'SERVICE_URL_ACTIVITYPUB_8080: ""' compose.yml
3737
echo "→ assert Ghost healthcheck injected"
3838
grep -q 'localhost:2368/ghost/api/admin/site' compose.yml
3939

40+
echo "→ assert mail vars exposed to Coolify UI"
41+
# shellcheck disable=SC2016 # literal compose ${...} syntax, no shell expansion wanted
42+
grep -qF 'mail__transport: ${mail__transport:-SMTP}' compose.yml
43+
# shellcheck disable=SC2016
44+
grep -qF 'mail__options__host: ${mail__options__host:-}' compose.yml
45+
# shellcheck disable=SC2016
46+
grep -qF 'mail__from: ${mail__from:-}' compose.yml
47+
4048
echo "→ assert ADMIN_DOMAIN kept upstream :+ conditional"
4149
# shellcheck disable=SC2016 # literal compose syntax, no shell expansion wanted
4250
grep -qF '${ADMIN_DOMAIN:+https://${ADMIN_DOMAIN}}' compose.yml

0 commit comments

Comments
 (0)