Skip to content

wheels deploy: a bare accessory port: publishes on a random host port; require a bind address #4067

Closed

Description

@bpamiri

What happens

AccessoryCommands.\$portArgs() passes an accessory's port: to docker run --publish unchanged. A bare value such as port: 5432 publishes container port 5432 on a random host port. Other hosts then can't reach the accessory at <host>:5432, and nothing warns about it. A value without a bind address (5432:5432) publishes on every interface (0.0.0.0), which for a database or cache is usually not what you want.

Kamal

  • Released Kamal (through v2.12.0, and the 2.4.0 that wheels deploy mirrors): passes port through as-is, the same as Wheels today.
  • Kamal main: since basecamp/kamal@00cb4cf1d ("Require an explicit bind host on accessory ports", 2026-06-17, not yet in a release), an accessory port (and options: publish) must name a bind address. Otherwise kamal raises: accessories/<name>: port "<value>" must name a bind address — "127.0.0.1:PORT:PORT" to keep it private, "0.0.0.0:PORT:PORT" to publish it.

Proposal

Validate accessory port: in config/Validator.cfc the way Kamal main does: require <ip>:<host port>:<container port> (IPv6 in brackets), and fail with a message naming the private (127.0.0.1:…) and public (0.0.0.0:…) forms. This is a breaking change for configs with a bare port, but those don't do what their author expects today, so it needs an upgrade note.

The v4-2-0 guides (accessories, config reference) now use the bound form, with a caution about bare ports (#4064).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugdeploywheels deploy CLI / Kamal-port surface

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions