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

shipped production is serving it opened this has it
opened this

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:731 and :848-853). It prints ssh://git@<host>:<sshPort>/… whenever sshPort is defined, which includes 0, 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 as http://<host>:<port ?? 3000>/… instead of the forge's public URL. src/ssh/command.ts is already the one builder for the terminal command and already refuses a port of 0 or less.

Done:

  • [ ] src/ssh/command.ts gains sshCloneUrl(app, owner, name), which is undefined exactly when sshCommand(app) is undefined or the forge is hosted (appSsh set). The repository page and the terminal's About both use it.
  • [ ] The terminal's HTTP clone line is the same <origin>/<owner>/<name>.git the web page shows, built from the forge's configured URL.
  • [ ] Tests: with sshPort: 0, the repository page has no clone-ssh field and About has no ssh line. With sshPort: 2222 both show ssh://git@<host>:2222/<owner>/<name>.git. With port 22, the address has no port.
  • [ ] The stale comment "An SSH listener is not built yet" goes.

Files: src/ssh/command.ts, src/web/pages/repo.ts, src/tui/screens/about.ts, test/ssh-site.test.ts or a new test file. Risk: low. Check that test/web-browse.test.ts still passes.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs