🎨 docker 沙箱
This commit is contained in:
parent
be2d5b74b3
commit
41e2316cc5
3
main.go
3
main.go
|
@ -66,9 +66,6 @@ func init() {
|
||||||
log.SetLevel("warn")
|
log.SetLevel("warn")
|
||||||
logger = log.NewLogger(os.Stdout)
|
logger = log.NewLogger(os.Stdout)
|
||||||
|
|
||||||
logger.Warnf(*confUsers)
|
|
||||||
logger.Warnf(*confUsersWorkspaces)
|
|
||||||
|
|
||||||
//wd := util.OS.Pwd()
|
//wd := util.OS.Pwd()
|
||||||
//if strings.HasPrefix(wd, os.TempDir()) {
|
//if strings.HasPrefix(wd, os.TempDir()) {
|
||||||
// logger.Error("Don't run Wide in OS' temp directory or with `go run`")
|
// logger.Error("Don't run Wide in OS' temp directory or with `go run`")
|
||||||
|
|
|
@ -68,6 +68,7 @@ func RunHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
cmd = exec.Command(filePath)
|
cmd = exec.Command(filePath)
|
||||||
curDir := filepath.Dir(filePath)
|
curDir := filepath.Dir(filePath)
|
||||||
cmd.Dir = curDir
|
cmd.Dir = curDir
|
||||||
|
logger.Warnf("Executing user's program [" + filePath + "] without docker sandbox")
|
||||||
}
|
}
|
||||||
|
|
||||||
stdout, err := cmd.StdoutPipe()
|
stdout, err := cmd.StdoutPipe()
|
||||||
|
|
Loading…
Reference in New Issue