-
Notifications
You must be signed in to change notification settings - Fork 39
Description
Description
When passing a URL with an explicit port to caprover deploy --caproverUrl, the CLI strips the port and forces a request to port 443. This breaks deployments where CapRover is not exposed on 443.
Example
caprover deploy --caproverUrl https://captain.example.com:8443
Ensuring authentication...
Deploying *** to https://captain.example.com...
Something bad happened: cannot deploy *** at https://captain.example.com.
Expected Behavior
The CLI would respect the provided port (8443) and connect to it.
Actual Behavior
The CLI silently removes the :8443 and connects to https://captain.example.com on port 443.
Justification
CapRover may be deployed behind shared ingress/load balancers, reverse proxies, or on alternate ports, internal environments, or constrained hosting (It's sort of supported). In these setups, CapRover isn’t always a first-class service on 443.
For example, I've been recently deploying a HTTPS load balancing endpoint, using CapRover to deploy it. As a result CapRover has to be moved to a different port (.e.g 8443).
Proposed Solution
Preserve port in cleanAdminDomainUrl:
Parse the input (url.parse), keep hostname and port, enforce 'captain.' prefix if missing, and when rebuilding the URL, append :${port} if present.