support multiple Coolify instances — select by identifier instead of editing .coolify.env #14
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#14
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
loadConfig(src/config.ts) reads exactly oneCOOLIFY_BASE_URL+COOLIFY_ACCESS_TOKENfrom<state>/.coolify.env, with no env-var or flagoverride. The connection target is implicit in a file's current contents.
Retargeting cast at a different Coolify instance therefore means hand-editing
that file — and putting it back afterwards.
That is uncomfortable in normal use and genuinely unsafe during the prod
migration (D-193). There, the state repo's
.coolify.envholds awrite+deploytoken for the new control plane, while the migration'sverification gate requires a
--fulldiff of the new manifest against thelegacy, hand-built box that is currently serving live users. Today the only
ways to do that are to overwrite the live
.coolify.envor to clone the wholestate dir just to vary one untracked file. The failure mode of getting it wrong
is running
applyagainst production.The instance you are pointing at is the single most consequential input to any
cast command. It should be explicit at the call site.
Proposal
<state>/.coolify.envworking exactly as today (single instance, noflag → no behavior change).
<state>/.coolify/<name>.env, each holding its ownCOOLIFY_BASE_URL+COOLIFY_ACCESS_TOKEN.--instance <name>to every verb that reaches Coolify(
apply,diff,server add,smoke,team).environments.yamlbind a default instance per environment(
environments.prod.instance: prod-cp), so--env prodselects the rightcontrol plane with no flag and no file edit at all.
--instancenames an unknown instance — andname the instances that do exist, in the same spirit as the absent-target
refusal from #12 (D-237).
Nice-to-have on the same theme: let an instance declare its expected token
scope (e.g.
read_only: true), so an instance configured for inspection cannotbe used by
applyeven if the token itself would permit the writes. That turns"I pointed the wrong token at the wrong box" from a live incident into an exit
code.
Acceptance
cast diff <slug> --env prod --instance legacyworks with no edit to.coolify.env.--instancerefuses and lists the known instances.--instanceflag, behavior is unchanged from today.