aboutsummaryrefslogtreecommitdiff
path: root/ssh_server.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-02-13 15:16:11 +0800
committerRunxi Yu <me@runxiyu.org>2025-02-13 15:16:11 +0800
commit1364d688e454454258c6c97b1dc844cc94a67a9e (patch)
treef95b9370cff76eeba71b86dbcd7333586ba1f7a9 /ssh_server.go
parent{http,ssh}_server.go: Add debug logs for incoming requests (diff)
downloadforge-1364d688e454454258c6c97b1dc844cc94a67a9e.tar.gz
forge-1364d688e454454258c6c97b1dc844cc94a67a9e.tar.zst
forge-1364d688e454454258c6c97b1dc844cc94a67a9e.zip
ssh_url_generation.go, etc.: Add config ssh.root and use it
Detecting it based on HTTP host name is definitely unreliable. Just add a configuration option and it should work.
Diffstat (limited to 'ssh_server.go')
-rw-r--r--ssh_server.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/ssh_server.go b/ssh_server.go
index 8cea1a9..b226b7c 100644
--- a/ssh_server.go
+++ b/ssh_server.go
@@ -80,6 +80,9 @@ func serve_ssh(listener net.Listener) error {
},
PublicKeyHandler: func(ctx glider_ssh.Context, key glider_ssh.PublicKey) bool { return true },
KeyboardInteractiveHandler: func(ctx glider_ssh.Context, challenge go_ssh.KeyboardInteractiveChallenge) bool { return true },
+ // It is intentional that we do not check any credentials and accept all connections.
+ // This allows all users to connect and clone repositories; when pushing is added later,
+ // we will check their public key in the session handler, not in the auth handlers.
}
server.AddHostKey(host_key)