Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software:2222/vole.git

A free and open-source forge that lives in your Git repo.

#250

Name the configured host in the SSH clone link

merged · by keenan 20h ago · merged into main at 268b9368 by keenan 18h ago

keenan opened this 20h ago

The clone menu built its SSH URL from ssh_addr, which is the address the listener binds. On an instance listening on 0.0.0.0:2222 that offered ssh://git@0.0.0.0:2222/<repo>.git — an address nobody can connect to — even with public_url naming the instance.

What changed

  • sshURL is now a method on Web and takes the host from public_url, the configured name, keeping the port from ssh_addr, because that is the port the SSH server actually answers on. Without a public_url there is no configured name, so the listener address is still what it shows.
  • The instance repository panel read the same helper, so both places agree.
  • netJoin now brackets an IPv6 host and uses net.JoinHostPort, so [::1]:2222 round-trips instead of becoming ::1:2222.
  • docs/configuration.md says where the SSH clone host comes from, next to the existing explanation of public_url for the HTTPS link.

Result

With ssh_addr = "0.0.0.0:2222" and public_url = "https://rodent.software", the clone menu shows git clone ssh://git@rodent.software:2222/vole.git.

Verification

  • TestSSHURLUsesTheConfiguredHost covers a wildcard bind with a configured name, the default port being omitted, no public_url, and an IPv6 listener.
  • ./vole workflow run verify passes.

Closes #235.

Discussion (0)

No discussion yet.