2 Commits
v2.7 ... v2.8

Author SHA1 Message Date
09e4a5d646 doc: increament version
All checks were successful
Go Project Action / Spell-check and test go project (push) Successful in 46s
Release Go Application / Release go project (release) Successful in 46s
2025-10-31 23:27:38 +01:00
904f585c4d mod: use log file as stderr for ssh command
Some checks failed
Go Project Action / Spell-check and test go project (push) Has been cancelled
2025-10-31 23:26:58 +01:00

View File

@@ -4,7 +4,6 @@ import (
"context"
"errors"
"fmt"
"io"
"net"
"os"
"os/signal"
@@ -57,10 +56,14 @@ func setupSshServer(host string, port string, host_key_path string, users map[st
func(next ssh.Handler) ssh.Handler {
return func(s ssh.Session) {
cmd := wish.Command(s, name, args...)
file, err := os.OpenFile("log", os.O_APPEND|os.O_WRONLY|os.O_CREATE, 0600)
if err != nil {
wish.Fatalln(s, err)
}
cmd.SetStderr(file)
if err := cmd.Run(); err != nil {
wish.Fatalln(s, err)
}
io.Copy(os.Stderr, s.Stderr())
next(s)
}
},
@@ -73,7 +76,7 @@ func setupSshServer(host string, port string, host_key_path string, users map[st
// Serve an ssh application using the provided arguments.
func Serve(host string, port string, host_key_path string, users map[string]string, name string, args []string) {
setupLogging()
log.Info("Running Serve (v2.7)...") // TODO make version string automatically the git tag (otherwise commit-hash)?
log.Info("Running Serve (v2.8)...") // TODO make version string automatically the git tag (otherwise commit-hash)?
defer log.Info("Stopping Serve...")
srv, err := setupSshServer(host, port, host_key_path, users, name, args)