Derive *_BASE_URL env vars from the manifest domains cast already parses — hand-writing them into the env template drifts from the domains it creates #66
Labels
No labels
blocked
blocker:ci-red
blocker:conflict
blocker:drill-pending
blocker:unrequested
bug
claimed
documentation
enhancement
epic
merge-next
needs-triage
ready
release
scope:apply
scope:capture
scope:coolify-api
scope:fleet
scope:manifest
scope:secrets
stale
state:addressing
state:bots-reviewing
state:building
state:needs-human
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: heavy-duty/cast#66
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The env templates carry base-URL vars that are already fully determined by the domain fields in
manifest.yaml— the same fields cast reads to create Coolify domains. Because cast doesn't derive them, they're hand-transcribed a second time intoenv/*.env.template, and the two copies drift.Concretely,
incubator's prod env template was missing three vars staging had, and one of them (LANDING_BASE_URL) still pointed at the old pre-apex host even after the manifest'sdomains/service_domainswere renamed to the apex scheme. The manifest was right; the env template was stale — exactly the class of drift cast exists to kill.The app reads (via
apps/core/src/platform/config.ts):LANDING_BASE_URLapplications.landing.domains[0]ADMIN_WEB_BASE_URLapplications.core.service_domains.admin[0]LANDING_BASE_URLdrives branded-email header images + footer links;ADMIN_WEB_BASE_URLis required at startup onceREPORTING_ENABLEDflips (loadConfigthrows without it). So a stale value is not cosmetic — it's a boot-time failure or broken outbound links at cutover.Why this is the same shape as #60 / #63
DATABASE_URL/REDIS_URLfrom the database resource cast created.This is the identical pattern applied to the domain fields: cast already parses
domainsandservice_domainsto reconcile Coolify domains, so the base-URL env values are known at plan time. Writing them into the template by hand is the duplication (and the drift vector).Proposal
Let the env template reference derived domain values instead of literals — e.g. a
${domain:...}-style interpolation resolved from the manifest, symmetric with howgenerated_secretsare resolved post-create:(exact syntax TBD — mirror whatever
generated_secretsinterpolation settles on.)Out of scope / notes
REPORTING_TZis not derivable — it's an operator policy choice (Europe/Madrid), not topology. It stays a literal in the template. This issue is only for values that are pure functions of the manifest's domains.API_BASE_URLis intentionally the internal compose address (http://api:3000), not a public domain — don't derive that one fromservice_domains.api.Bridge until then
incubator's.infra/env/core.prod.env.templatenow hard-codes the three literals as a temporary bridge. When this lands, those*_BASE_URLlines become derived and the manual copies retire.Filed from the
incubatorrepo — pattern precedent: cast#60 (D-268), cast#63 (D-267).