Skip to content

--caproverUrl ignores port; cannot deploy to CapRover instances not on 443 #153

@Riches

Description

@Riches

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions