update readme and build

This commit is contained in:
2026-05-24 07:18:54 +00:00
parent 45e18b5423
commit 5b4803bc49
9 changed files with 447 additions and 38 deletions
+9
View File
@@ -20,6 +20,7 @@ func Run() {
certFlag := flag.String("cert", "", "set custom TLS certificate PEM file (stored encrypted)")
cetkeyFlag := flag.String("certkey", "", "set custom TLS private key PEM file")
certreset := flag.Bool("certreset", false, "remove stored custom certificate, revert to self-signed")
logFlag := flag.String("log", "", "auth log file path; 'off' disables file logging (default: gotermix.log next to binary)")
flag.Parse()
initialCwd, _ = os.Getwd()
@@ -100,6 +101,13 @@ func Run() {
fmt.Printf("auth: enabled user=%q creds=%s\n", appCreds.Username, credsPath)
}
// Auth logging — default path is gotermix.log next to the binary.
logPath := *logFlag
if logPath == "" {
logPath = filepath.Join(filepath.Dir(exe), "gotermix.log")
}
initAuthLogger(logPath)
// Reap idle sessions.
go func() {
t := time.NewTicker(10 * time.Minute)
@@ -137,6 +145,7 @@ func Run() {
mux := http.NewServeMux()
mux.HandleFunc("/", handleIndex)
mux.HandleFunc("/login", handleLogin)
mux.HandleFunc("/s/", handleShell)
mux.HandleFunc("/ws/", handleWS)
mux.HandleFunc("/auth", handleAuth)