implemented the pts feature in the server side as well

This commit is contained in:
2025-06-23 21:09:24 +09:00
parent d092540f08
commit 8331fdc1a2
11 changed files with 403 additions and 17 deletions

View File

@ -94,6 +94,8 @@ type ServerAppConfig struct {
LogRotate int `yaml:"log-rotate"`
MaxPeers int `yaml:"max-peer-conns"` // maximum number of connections from peers
MaxRpcConns int `yaml:"max-rpc-conns"` // maximum number of rpc connections
PtsUser string `yaml:"pts-user"`
PtsShell string `yaml:"pts-shell"`
XtermHtmlFile string `yaml:"xterm-html-file"`
}

View File

@ -97,6 +97,8 @@ func server_main(ctl_addrs []string, rpc_addrs []string, pxy_addrs []string, wpx
var logmask hodu.LogMask
var logfile_maxsize int64
var logfile_rotate int
var pts_user string
var pts_shell string
var xterm_html_file string
var xterm_html string
var err error
@ -132,6 +134,9 @@ func server_main(ctl_addrs []string, rpc_addrs []string, pxy_addrs []string, wpx
config.CtlPrefix = cfg.CTL.Service.Prefix
config.RpcMaxConns = cfg.APP.MaxRpcConns
config.MaxPeers = cfg.APP.MaxPeers
pts_user = cfg.APP.PtsUser
pts_shell = cfg.APP.PtsShell
xterm_html_file = cfg.APP.XtermHtmlFile
logmask = log_strings_to_mask(cfg.APP.LogMask)
@ -167,6 +172,8 @@ func server_main(ctl_addrs []string, rpc_addrs []string, pxy_addrs []string, wpx
return fmt.Errorf("failed to create server - %s", err.Error())
}
if pts_user != "" { s.SetPtsUser(pts_user) }
if pts_shell != "" { s.SetPtsShell(pts_shell) }
if xterm_html != "" { s.SetXtermHtml(xterm_html) }
s.StartService(nil)