From 612a65349492306e068e0b2259510ee6648027ba Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sat, 15 Feb 2025 00:38:29 +0800 Subject: [PATCH] ssh_server: Add link to source --- config.go | 1 + forge.scfg | 1 + ssh_server.go | 1 + diff --git a/config.go b/config.go index 31ab743667281760717f93379d7317b95f19d739..888d488b2a18465b299302087e0260b6b6efb55c 100644 --- a/config.go +++ b/config.go @@ -19,6 +19,7 @@ HTTP struct { Net string `scfg:"net"` Addr string `scfg:"addr"` CookieExpiry int `scfg:"cookie_expiry"` + Root string `scfg:"root"` } `scfg:"http"` SSH struct { Net string `scfg:"net"` diff --git a/forge.scfg b/forge.scfg index abcefae543f3581ac8dfc7d16833c4a203266c1a..49f62227d7bbf95e0537ea44e8b6da9d29aa19bd 100644 --- a/forge.scfg +++ b/forge.scfg @@ -2,6 +2,7 @@ http { net tcp addr :8080 cookie_expiry 604800 + root https://forge.example.org } ssh { diff --git a/ssh_server.go b/ssh_server.go index b5882de9b0b4efc6830de00144209193220d5fea..bddfeeb90fbbccc3ac313bd872040b7dfd534b0f 100644 --- a/ssh_server.go +++ b/ssh_server.go @@ -42,6 +42,7 @@ client_public_key_string = string(go_ssh.MarshalAuthorizedKey(client_public_key)) } clog.Info("Incoming SSH: " + session.RemoteAddr().String() + " " + strings.TrimSuffix(client_public_key_string, "\n") + " " + session.RawCommand()) + fmt.Fprintln(session.Stderr(), "Lindenii Forge " + VERSION + ", source at " + strings.TrimSuffix(config.HTTP.Root, "/") + "/:/source/") cmd := session.Command() -- 2.48.1