Point a created repo's SSH URL at a host we can reach
Gitea builds ssh_url from its own SSH_DOMAIN, which is whatever the
server was told to advertise. A server announcing a public hostname
whose SSH port is only open on the LAN hands out a remote that connects
from nowhere — and because "Create and attach" does not push, the
failure surfaces later, at the first Sync:
ssh: connect to host <wan-name> port 2228: Connection refused
The app already knows an address that works, having just made an API
call over it, so the SSH host is taken from the configured server URL
instead. The port Gitea reports is kept, as are the user and path, and
both URL shapes are handled (ssh://user@host:port/path and the scp-like
user@host:path). Setting the server to a tailnet address therefore gets
a remote that works on and off the LAN alike.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GBWj9TphFMCoh7VHaSRnvQ
This commit is contained in:
@@ -1226,8 +1226,11 @@ impl App {
|
||||
save_now |= ui
|
||||
.checkbox(&mut self.config.gitea_use_ssh, "Attach over SSH")
|
||||
.on_hover_text(
|
||||
"SSH pushes on a key. Turn this off to use the HTTPS clone \
|
||||
URL, which asks for a credential on every push.",
|
||||
"SSH pushes on a key. The host is taken from the server URL \
|
||||
above rather than from what Gitea advertises, so the remote \
|
||||
points at an address this machine can actually reach. Turn \
|
||||
this off to use the HTTPS clone URL, which asks for a \
|
||||
credential on every push.",
|
||||
)
|
||||
.changed();
|
||||
ui.add_space(4.0);
|
||||
|
||||
Reference in New Issue
Block a user