-
Notifications
You must be signed in to change notification settings - Fork 373
Open
Description
Problem Statement
openshell gateway add ssh://user@host:8080 parses 8080 as the gateway's HTTPS port. There is no way to specify a custom SSH port (e.g. 2222) for the connection itself. The CLI strips the SSH connection down to user@host, which forces the underlying Docker library to default to port 22.
Proposed Design
- CLI Flag: Add
--ssh-port <PORT>to remote commands (gateway add,gateway start, etc). - Internal API: Add
ssh_port: Option<u16>toRemoteOptions. - Execution: In
create_ssh_docker_client, append the port to the bollard connection string if set (ssh://user@host:PORT).
Alternatives Considered
~/.ssh/configalias: Users define aHostwith a customPort. Rejected: This is currently broken.resolve_ssh_hostnameinmetadata.rsonly parses thehostnameline fromssh -Gand ignores theportline, so the custom port is lost before the connection starts.- URI overloading: Support
ssh://user@host:2222:8080. Rejected: Invalid URL format.
Agent Investigation
crates/openshell-cli/src/run.rsL925: URL parser assigns the parsed port to the gateway.crates/openshell-bootstrap/src/lib.rsL59:RemoteOptionsstruct has nossh_portfield.crates/openshell-bootstrap/src/docker.rsL240:create_ssh_docker_clientpassesssh://user@hosttobollardwithout a port.crates/openshell-bootstrap/src/metadata.rsL164:resolve_ssh_hostnameignores theportfield fromssh -Goutput.
Checklist
- I've reviewed existing issues and the architecture docs
- This is a design proposal, not a "please build this" request
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels