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 != "/" {
|
if base != "ws" && base != "." && base != "/" {
|
||||||
base = strings.Trim(base, "/")
|
base = strings.Trim(base, "/")
|
||||||
param, _ := xorencrypt.Decrypt(base, g.Salt)
|
param, _ := xorencrypt.Decrypt(base, g.Salt)
|
||||||
l.Info("starting cmd => ", l.M(param, klog.FgHiGreen))
|
|
||||||
req := &NewCmdRequest{}
|
req := &NewCmdRequest{}
|
||||||
err := json.Unmarshal([]byte(param), req)
|
err := json.Unmarshal([]byte(param), req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
l.ErrorF(klog.H{"base": base, "decrypt": param}, err)
|
||||||
cmd = g.defaultCmd()
|
cmd = g.defaultCmd()
|
||||||
} else {
|
} else {
|
||||||
|
l.Info("starting cmd => ", l.M(fmt.Sprintf("%+v", req), klog.FgHiGreen))
|
||||||
cmd = exec.Command(req.Cmd, req.Args...)
|
cmd = exec.Command(req.Cmd, req.Args...)
|
||||||
cmd.Env = req.Envs
|
cmd.Env = req.Envs
|
||||||
cmd.Dir = req.Dir
|
cmd.Dir = req.Dir
|
||||||
|
|
Loading…
Reference in New Issue