bug: `git-clone` did not parse and add port to `ssh-keyscan` command
- Dominant language
- HCL
- Stars
- 79
- Forks
- 161
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 38
Description
## Issue
PR https://github.com/coder/registry/pull/942 add feature to add repo url to known host, but it only parse the host and did not parse the port when running `ssh-keyscan` command. This make the known host added for port 22 instead.
My use case is using self hosted gitea/forgejo, because port 22 already used by the host for ssh into the host machine I use port 2222 instead for the git ssh. The repo URL is something like this:
```
ssh://git@forgejo.domain.tld:2222/LazyGeniusMan/test-repo.git
```
The current parsing is :
https://github.com/coder/registry/blob/6be121e4f6eabd2f248cb9c81953af4c95457634/registry/coder/modules/git-clone/run.sh#L56
The result for repo URL above is : `forgejo@domain.tld`
Then the value used in:
https://github.com/coder/registry/blob/6be121e4f6eabd2f248cb9c81953af4c95457634/registry/coder/modules/git-clone/run.sh#L64
## Proposed Fix
1. Parse the port from ssh repo url
2. Pass the `-p` arg to `ssh-keyscan` command
Contributor guide
Assessment
This issue has not been assessed yet.