Rewrite admin_url so Coolify's env-var scanner stops choking on it#5
Merged
Conversation
78db858 to
43f6a5a
Compare
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>
7850efc to
629bdca
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace upstream's
admin__url: ${ADMIN_DOMAIN:+https://${ADMIN_DOMAIN}}withadmin__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__urleditable 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.comas a normal Coolify env var. Leaving it empty falls back to$SERVICE_URL_GHOST.Test plan
bash .github/scripts/test-patch.shgreen (flipped assertion + guard against:+pattern regressing)shellcheck .github/scripts/test-patch.shcleanADMIN_DOMAIN:+https://${ADMIN_DOMAIN}row;admin__urlappears once as editable🤖 Generated with Claude Code