aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-02-15 00:38:29 +0800
committerRunxi Yu <me@runxiyu.org>2025-02-15 00:38:29 +0800
commit612a65349492306e068e0b2259510ee6648027ba (patch)
tree30addcf73a35f346773418b66bb00ed0bc0e1dff
parenttemplates: *.html.tmpl -> *.tmpl (diff)
downloadforge-612a65349492306e068e0b2259510ee6648027ba.tar.gz
forge-612a65349492306e068e0b2259510ee6648027ba.tar.zst
forge-612a65349492306e068e0b2259510ee6648027ba.zip
ssh_server: Add link to source
-rw-r--r--config.go1
-rw-r--r--forge.scfg1
-rw-r--r--ssh_server.go1
3 files changed, 3 insertions, 0 deletions
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()