Skip to content

Rewrite admin_url so Coolify's env-var scanner stops choking on it#5

Merged
lunarthegrey merged 1 commit into
mainfrom
fix-admin-url-coolify-parsing
Apr 24, 2026
Merged

Rewrite admin_url so Coolify's env-var scanner stops choking on it#5
lunarthegrey merged 1 commit into
mainfrom
fix-admin-url-coolify-parsing

Conversation

@lunarthegrey
Copy link
Copy Markdown

@lunarthegrey lunarthegrey commented Apr 22, 2026

Summary

Replace upstream's admin__url: ${ADMIN_DOMAIN:+https://${ADMIN_DOMAIN}} with admin__url: ${admin__url:-$SERVICE_URL_GHOST}.

Why

Live Coolify deploy surfaced a garbage env-var row named ADMIN_DOMAIN:+https://${ADMIN_DOMAIN} in the UI — Coolify's scanner doesn't handle the nested ${VAR:+...} conditional and extracted the inner text as a literal variable name.

The new form gives Coolify a single clean admin__url editable row, defaults to the primary Ghost URL when unset (Ghost's own fallback behavior), and eliminates the theoretical empty-string concern that motivated the original G4 decision.

Users wanting a separate admin domain set admin__url=https://admin.example.com as a normal Coolify env var. Leaving it empty falls back to $SERVICE_URL_GHOST.

Test plan

  • bash .github/scripts/test-patch.sh green (flipped assertion + guard against :+ pattern regressing)
  • shellcheck .github/scripts/test-patch.sh clean
  • After merge + sync: confirm Coolify UI no longer shows the ADMIN_DOMAIN:+https://${ADMIN_DOMAIN} row; admin__url appears once as editable

🤖 Generated with Claude Code

@github-actions github-actions Bot force-pushed the main branch 2 times, most recently from 78db858 to 43f6a5a Compare April 24, 2026 03:26
Live deploy on Coolify showed a garbage env-var row named
"ADMIN_DOMAIN:+https://${ADMIN_DOMAIN}" — Coolify's parser doesn't
handle the nested ${ADMIN_DOMAIN:+...} conditional and extracted the
inner text as a literal var name.

Replace upstream's conditional with ${admin__url:-$SERVICE_URL_GHOST}:
a clean single-var reference Coolify shows as one editable row, with
a sensible fallback to the primary URL so Ghost always boots with a
valid admin URL whether the user sets one or not.

This reverses the G4 decision from #1 (preserving upstream's :+
syntax). That decision was based on theoretical concern about
Ghost 6's empty-string admin_url handling; the Coolify parsing bug
is a concrete problem that overrides the theoretical one. Defaulting
admin_url to $SERVICE_URL_GHOST sidesteps the empty-string question
entirely — Ghost always gets a real URL.

test-patch.sh: flip the admin_url assertion to the new form; guard
against the old :+ pattern leaking back in. Function definition
moved up so earlier assertions can use it.

README.coolify.md: rewrite the "Optional: separate admin domain"
section around the new admin__url env var.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@lunarthegrey lunarthegrey force-pushed the fix-admin-url-coolify-parsing branch from 7850efc to 629bdca Compare April 24, 2026 11:18
@lunarthegrey lunarthegrey merged commit 8b73d77 into main Apr 24, 2026
2 checks passed
@lunarthegrey lunarthegrey deleted the fix-admin-url-coolify-parsing branch April 24, 2026 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant