From 612a65349492306e068e0b2259510ee6648027ba Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sat, 15 Feb 2025 00:38:29 +0800 Subject: ssh_server: Add link to source --- config.go | 1 + forge.scfg | 1 + ssh_server.go | 1 + 3 files changed, 3 insertions(+) diff --git a/config.go b/config.go index 31ab743..888d488 100644 --- a/config.go +++ b/config.go @@ -19,6 +19,7 @@ var config 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 abcefae..49f6222 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 b5882de..bddfeeb 100644 --- a/ssh_server.go +++ b/ssh_server.go @@ -42,6 +42,7 @@ func serve_ssh(listener net.Listener) error { } 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() -- cgit v1.2.3