cast/src
dan-claude-bot d442b8cc1b fix: --port is argv too — reject it before the preflight, not at listen()
@claude-bot-andresmgsl's outstanding item from the prior round, which my last
reply passed over in silence. That silence read as an oversight because it was
one.

`--port` on the create path was still bare `Number()`, so `--port abc` became
NaN, reached `server.listen(NaN)` in github-app.ts, and died as an uncaught
ERR_SOCKET_BAD_PORT stack trace — after `detectOwnerType` and the org-admin
preflight had already gone out. It is the same missing argv validation this
round fixed for the two ids, in a command whose stated rule is reject before
any write or network call.

Nothing is destroyed when it fails: no App and no client secret exist at that
point. So this is not about damage, it is about the command honouring its own
rule, and about failing with a sentence rather than a stack trace.

Range-checked as well as digits-only: `--port 99999` passes every test the ids
need and still cannot be listened on.

Scope, stated rather than assumed: `server add --port` (src/cli.ts:2430) has
the identical shape but predates this branch and is not in its diff. It is a
real instance of the same bug and belongs in its own change, not smuggled into
this one.

Four CLI cases — non-numeric, out-of-range, zero, decimal — asserting exit 2,
no stub hits and an unchanged state dir, driven through `create` because that
is the path that reads the flag. Verified by mutation: disabling the check
fails all four.
2026-07-21 13:11:15 +00:00
..
apply.ts fix: complete the basic-auth triple on username-only drift, at both guards 2026-07-21 12:43:04 +00:00
bindings.ts feat(destroy): a scoped teardown verb, gated in state (#43) 2026-07-14 22:52:17 +00:00
capture.ts Merge pull request #56 from claude-hdb/fix/reserved-env-names 2026-07-14 23:54:15 +01:00
cli.ts fix: --port is argv too — reject it before the preflight, not at listen() 2026-07-21 13:11:15 +00:00
config.ts feat: select the Coolify instance by name instead of editing .coolify.env (#14) 2026-07-13 16:42:45 +00:00
coolify.ts fix(draft): read backup schedules and emit backup blocks (#75) 2026-07-16 18:25:34 +00:00
destroy.ts feat(destroy): a scoped teardown verb, gated in state (#43) 2026-07-14 22:52:17 +00:00
diff.ts feat: an application can declare HTTP basic auth, and apply sets it 2026-07-21 12:38:03 +00:00
draft.ts feat: an application can declare HTTP basic auth, and apply sets it 2026-07-21 12:38:03 +00:00
envtemplate.ts feat(resolve): derive base-URL env vars from manifest domains via ${domain:...} (#66) 2026-07-15 12:02:33 +00:00
fleet.ts feat: --all — every project in an environment, and a report that says so (#26) 2026-07-13 20:23:23 +00:00
github-app.ts fix: persist the manifest conversion before the install poll can lose it 2026-07-21 13:11:15 +00:00
inventory.ts fix(inventory): biome lint — a bare template literal and a string concat 2026-07-13 19:22:07 +00:00
manifest.ts feat: an application can declare HTTP basic auth, and apply sets it 2026-07-21 12:38:03 +00:00
reserved.ts fix(diff): Coolify's own generated vars are not orphans (#87) 2026-07-16 16:56:34 +00:00
resolve.ts feat: an application can declare HTTP basic auth, and apply sets it 2026-07-21 12:38:03 +00:00
secrets.ts fix: CAST_AGE_KEY_FILE_<ENV> maps to a name a shell can set (#102) 2026-07-19 13:09:17 +00:00
server.ts feat: cast — the Coolify executor, extracted from the infra state repo 2026-07-11 12:25:44 +00:00
smoke.ts fix: never write an env var whose name Coolify injects itself (#50) 2026-07-14 22:29:23 +00:00
team.ts feat: assert the token's team before touching Coolify (fail-closed) 2026-07-12 20:55:04 +00:00