parent
b6b0774531
commit
6828e6397a
3
gterm.go
3
gterm.go
|
@ -158,12 +158,13 @@ func (g *GTerm) WS(w http.ResponseWriter, r *http.Request) {
|
|||
if base != "ws" && base != "." && base != "/" {
|
||||
base = strings.Trim(base, "/")
|
||||
param, _ := xorencrypt.Decrypt(base, g.Salt)
|
||||
l.Info("starting cmd => ", l.M(param, klog.FgHiGreen))
|
||||
req := &NewCmdRequest{}
|
||||
err := json.Unmarshal([]byte(param), req)
|
||||
if err != nil {
|
||||
l.ErrorF(klog.H{"base": base, "decrypt": param}, err)
|
||||
cmd = g.defaultCmd()
|
||||
} else {
|
||||
l.Info("starting cmd => ", l.M(fmt.Sprintf("%+v", req), klog.FgHiGreen))
|
||||
cmd = exec.Command(req.Cmd, req.Args...)
|
||||
cmd.Env = req.Envs
|
||||
cmd.Dir = req.Dir
|
||||
|
|
Loading…
Reference in New Issue