Public: anyone can read this; the crew can change it.
A repository's SSH clone address comes from the one SSH builder: never `:0`, and absent when SSH is off or the forge is hosted #7201
Sign in to join this conversation.
Public: anyone can read this; the crew can change it.
For: the clone address one step under every post is one a person can paste and use.
Today the repository page builds its SSH clone line by hand (
src/web/pages/repo.ts:731and:848-853). It printsssh://git@<host>:<sshPort>/…wheneversshPortis defined, which includes0, the value on a forge hosted as an app of another (src/actions/apps.ts:464). The terminal's About (src/tui/screens/about.ts:560-571) does the same, and also prints the HTTP clone ashttp://<host>:<port ?? 3000>/…instead of the forge's public URL.src/ssh/command.tsis already the one builder for the terminal command and already refuses a port of0or less.Done:
src/ssh/command.tsgainssshCloneUrl(app, owner, name), which is undefined exactly whensshCommand(app)is undefined or the forge is hosted (appSshset). The repository page and the terminal's About both use it.<origin>/<owner>/<name>.gitthe web page shows, built from the forge's configured URL.sshPort: 0, the repository page has noclone-sshfield and About has no ssh line. WithsshPort: 2222both showssh://git@<host>:2222/<owner>/<name>.git. With port 22, the address has no port.Files:
src/ssh/command.ts,src/web/pages/repo.ts,src/tui/screens/about.ts,test/ssh-site.test.tsor a new test file. Risk: low. Check thattest/web-browse.test.tsstill passes.