docs: add log
continuous-integration/drone/tag Build is passing Details

master v0.1.6
Evan Chen 2021-11-18 14:50:57 +08:00
parent b6b0774531
commit 6828e6397a
1 changed files with 2 additions and 1 deletions

View File

@ -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