forked from wrenn/wrenn
fix exec cwd and env propagation
This commit is contained in:
@ -35,9 +35,11 @@ var upgrader = websocket.Upgrader{
|
||||
|
||||
// wsStartMsg is the first message the client sends to start a process.
|
||||
type wsStartMsg struct {
|
||||
Type string `json:"type"` // "start"
|
||||
Cmd string `json:"cmd"`
|
||||
Args []string `json:"args"`
|
||||
Type string `json:"type"` // "start"
|
||||
Cmd string `json:"cmd"`
|
||||
Args []string `json:"args"`
|
||||
Envs map[string]string `json:"envs"`
|
||||
Cwd string `json:"cwd"`
|
||||
}
|
||||
|
||||
// wsOutMsg is sent by the server for process events.
|
||||
@ -133,6 +135,8 @@ func (h *execStreamHandler) runExecStream(ctx context.Context, conn *websocket.C
|
||||
SandboxId: sandboxIDStr,
|
||||
Cmd: startMsg.Cmd,
|
||||
Args: startMsg.Args,
|
||||
Envs: startMsg.Envs,
|
||||
Cwd: startMsg.Cwd,
|
||||
}))
|
||||
if err != nil {
|
||||
sendWSError(conn, "failed to start exec stream: "+err.Error())
|
||||
|
||||
Reference in New Issue
Block a user