From 3aba668aec065d126535ea5331ab9b47ea44bcbe Mon Sep 17 00:00:00 2001 From: Brian Seymour Date: Fri, 21 Sep 2018 13:45:09 -0500 Subject: [PATCH] readme and path fix --- docker/execute | 10 ++++++---- readme.md | 23 ++++++++++++++++++++++- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/docker/execute b/docker/execute index 842f41d..e05ea97 100755 --- a/docker/execute +++ b/docker/execute @@ -17,8 +17,8 @@ if [ -z "$2" ]; then fi lang=$1 -abs=$2 -file=$(basename $abs) +filepath=$(realpath $2) +file=$(basename $2) bin= case "$lang" in @@ -53,7 +53,7 @@ docker run \ --network none \ --cpus=".5" \ --rm \ - -v $abs:/$file:ro \ + -v $filepath:/$file:ro \ -v $dir/executors/python2:/executor_python2:ro \ -v $dir/executors/python3:/executor_python3:ro \ -v $dir/executors/ruby:/executor_ruby:ro \ @@ -62,6 +62,8 @@ docker run \ -v $dir/executors/cpp:/executor_cpp:ro \ -v $dir/executors/go:/executor_go:ro \ piston \ - runuser -l runner -c "/$bin /$file $file 2>&1" + runuser \ + -l runner \ + -c "/$bin /$file $file 2>&1" rm -f /tmp/$file diff --git a/readme.md b/readme.md index aa1d996..e33cc09 100644 --- a/readme.md +++ b/readme.md @@ -1 +1,22 @@ -### piston +## Piston +This project is the underlying engine for running untrusted and possibly malicious code that originates +from from EMKC contests and challenges. + + +#### Installation +- Install Docker https://www.docker.com/get-started +- `git clone https://github.com/engineer-man/piston` +- `cd piston/docker` +- `./build` + + +#### Usage +- `docker/execute ` + + +#### Supported Languages +Currently python2, python3, c, c++, go, node, and ruby are supported. + + +#### License +Piston is licensed under the MIT license.