From c5f3305c233ecc0965a0ce47a0c3ab910dae3dac Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Thu, 18 Feb 2021 18:32:26 +1300 Subject: [PATCH] remove **everything** in preparations for v3 --- .gitignore | 1 + api/.gitignore | 1 - api/package-lock.json | 903 ------------------------------------ api/package.json | 16 - api/src/index.js | 79 ---- api/src/languages.js | 39 -- api/start | 3 - cli/execute | 32 -- config/languages.json | 267 ----------- container/build.sh | 6 - container/configure.py | 13 - container/install_script.sh | 323 ------------- container/piston.yaml | 355 -------------- container/readme.md | 7 - images/icon_circle.svg | 32 -- license | 19 - lxc/execute | 55 --- lxc/execute.js | 56 --- lxc/executors/awk | 5 - lxc/executors/bash | 4 - lxc/executors/brainfuck | 36 -- lxc/executors/c | 5 - lxc/executors/cpp | 5 - lxc/executors/crystal | 5 - lxc/executors/csharp | 5 - lxc/executors/d | 6 - lxc/executors/dash | 4 - lxc/executors/deno | 4 - lxc/executors/elixir | 6 - lxc/executors/emacs | 4 - lxc/executors/go | 6 - lxc/executors/haskell | 6 - lxc/executors/java | 5 - lxc/executors/jelly | 4 - lxc/executors/julia | 4 - lxc/executors/kotlin | 6 - lxc/executors/lisp | 4 - lxc/executors/lua | 4 - lxc/executors/nasm | 6 - lxc/executors/nasm64 | 6 - lxc/executors/nim | 5 - lxc/executors/node | 4 - lxc/executors/osabie | 8 - lxc/executors/paradoc | 5 - lxc/executors/perl | 4 - lxc/executors/php | 4 - lxc/executors/prolog | 9 - lxc/executors/python2 | 4 - lxc/executors/python3 | 4 - lxc/executors/ruby | 4 - lxc/executors/rust | 5 - lxc/executors/scala | 5 - lxc/executors/swift | 4 - lxc/executors/typescript | 8 - lxc/executors/zig | 6 - lxc/shell | 3 - lxc/start | 9 - lxc/stop | 3 - lxc/tests/_run | 72 --- lxc/tests/awk.awk | 1 - lxc/tests/bash.sh | 1 - lxc/tests/c.c | 5 - lxc/tests/cpp.cpp | 6 - lxc/tests/crystal.cr | 1 - lxc/tests/csharp.cs | 9 - lxc/tests/d.d | 5 - lxc/tests/dash.sh | 1 - lxc/tests/deno.ts | 1 - lxc/tests/elixir.exs | 1 - lxc/tests/emacs.el | 1 - lxc/tests/go.go | 7 - lxc/tests/haskell.hs | 1 - lxc/tests/java.java | 5 - lxc/tests/jelly.jelly | 1 - lxc/tests/julia.jl | 1 - lxc/tests/kotlin.kt | 3 - lxc/tests/lisp.cl | 1 - lxc/tests/nasm.nasm | 16 - lxc/tests/nasm64.nasm | 18 - lxc/tests/nim.nim | 1 - lxc/tests/node.js | 1 - lxc/tests/osabie.abe | 1 - lxc/tests/paradoc.sh | 11 - lxc/tests/perl.pl | 1 - lxc/tests/php.php | 3 - lxc/tests/prolog.pl | 1 - lxc/tests/python2.py | 1 - lxc/tests/python3.py | 1 - lxc/tests/ruby.rb | 1 - lxc/tests/rust.rs | 3 - lxc/tests/scala.scala | 3 - lxc/tests/swift.swift | 1 - lxc/tests/typescript.ts | 1 - lxc/tests/zig.zig | 6 - lxc/util/disable_network | 2 - lxc/util/enable_network | 2 - lxc/util/versions | 150 ------ readme.md | 323 ------------- var/benchmark.txt | 12 - var/benchmark_payload.txt | 6 - var/install.txt | 14 - var/notes.txt | 24 - var/piston.service | 13 - 103 files changed, 1 insertion(+), 3179 deletions(-) delete mode 100644 api/.gitignore delete mode 100644 api/package-lock.json delete mode 100644 api/package.json delete mode 100644 api/src/index.js delete mode 100644 api/src/languages.js delete mode 100755 api/start delete mode 100755 cli/execute delete mode 100644 config/languages.json delete mode 100755 container/build.sh delete mode 100644 container/configure.py delete mode 100644 container/install_script.sh delete mode 100644 container/piston.yaml delete mode 100644 container/readme.md delete mode 100644 images/icon_circle.svg delete mode 100644 license delete mode 100755 lxc/execute delete mode 100644 lxc/execute.js delete mode 100755 lxc/executors/awk delete mode 100755 lxc/executors/bash delete mode 100755 lxc/executors/brainfuck delete mode 100755 lxc/executors/c delete mode 100755 lxc/executors/cpp delete mode 100644 lxc/executors/crystal delete mode 100755 lxc/executors/csharp delete mode 100644 lxc/executors/d delete mode 100644 lxc/executors/dash delete mode 100755 lxc/executors/deno delete mode 100755 lxc/executors/elixir delete mode 100755 lxc/executors/emacs delete mode 100755 lxc/executors/go delete mode 100755 lxc/executors/haskell delete mode 100755 lxc/executors/java delete mode 100755 lxc/executors/jelly delete mode 100755 lxc/executors/julia delete mode 100755 lxc/executors/kotlin delete mode 100644 lxc/executors/lisp delete mode 100755 lxc/executors/lua delete mode 100755 lxc/executors/nasm delete mode 100755 lxc/executors/nasm64 delete mode 100644 lxc/executors/nim delete mode 100755 lxc/executors/node delete mode 100644 lxc/executors/osabie delete mode 100755 lxc/executors/paradoc delete mode 100755 lxc/executors/perl delete mode 100755 lxc/executors/php delete mode 100755 lxc/executors/prolog delete mode 100755 lxc/executors/python2 delete mode 100755 lxc/executors/python3 delete mode 100755 lxc/executors/ruby delete mode 100755 lxc/executors/rust delete mode 100755 lxc/executors/scala delete mode 100755 lxc/executors/swift delete mode 100755 lxc/executors/typescript delete mode 100644 lxc/executors/zig delete mode 100755 lxc/shell delete mode 100755 lxc/start delete mode 100755 lxc/stop delete mode 100755 lxc/tests/_run delete mode 100644 lxc/tests/awk.awk delete mode 100644 lxc/tests/bash.sh delete mode 100644 lxc/tests/c.c delete mode 100644 lxc/tests/cpp.cpp delete mode 100644 lxc/tests/crystal.cr delete mode 100644 lxc/tests/csharp.cs delete mode 100644 lxc/tests/d.d delete mode 100644 lxc/tests/dash.sh delete mode 100644 lxc/tests/deno.ts delete mode 100644 lxc/tests/elixir.exs delete mode 100644 lxc/tests/emacs.el delete mode 100644 lxc/tests/go.go delete mode 100644 lxc/tests/haskell.hs delete mode 100644 lxc/tests/java.java delete mode 100644 lxc/tests/jelly.jelly delete mode 100644 lxc/tests/julia.jl delete mode 100644 lxc/tests/kotlin.kt delete mode 100644 lxc/tests/lisp.cl delete mode 100644 lxc/tests/nasm.nasm delete mode 100644 lxc/tests/nasm64.nasm delete mode 100644 lxc/tests/nim.nim delete mode 100644 lxc/tests/node.js delete mode 100644 lxc/tests/osabie.abe delete mode 100644 lxc/tests/paradoc.sh delete mode 100644 lxc/tests/perl.pl delete mode 100644 lxc/tests/php.php delete mode 100644 lxc/tests/prolog.pl delete mode 100644 lxc/tests/python2.py delete mode 100644 lxc/tests/python3.py delete mode 100644 lxc/tests/ruby.rb delete mode 100644 lxc/tests/rust.rs delete mode 100644 lxc/tests/scala.scala delete mode 100644 lxc/tests/swift.swift delete mode 100644 lxc/tests/typescript.ts delete mode 100644 lxc/tests/zig.zig delete mode 100755 lxc/util/disable_network delete mode 100755 lxc/util/enable_network delete mode 100755 lxc/util/versions delete mode 100644 readme.md delete mode 100644 var/benchmark.txt delete mode 100644 var/benchmark_payload.txt delete mode 100644 var/install.txt delete mode 100644 var/notes.txt delete mode 100644 var/piston.service diff --git a/.gitignore b/.gitignore index 140ea71..ba11e62 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ lxc/i lxc/lockfile container/build.yaml container/*.tar.xz +node_modules \ No newline at end of file diff --git a/api/.gitignore b/api/.gitignore deleted file mode 100644 index 3c3629e..0000000 --- a/api/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/api/package-lock.json b/api/package-lock.json deleted file mode 100644 index 4757c95..0000000 --- a/api/package-lock.json +++ /dev/null @@ -1,903 +0,0 @@ -{ - "name": "api", - "version": "1.0.0", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "version": "1.0.0", - "license": "ISC", - "dependencies": { - "express": "^4.17.1", - "express-validator": "^6.9.2" - } - }, - "node_modules/accepts": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", - "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", - "dependencies": { - "mime-types": "~2.1.24", - "negotiator": "0.6.2" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" - }, - "node_modules/body-parser": { - "version": "1.19.0", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", - "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", - "dependencies": { - "bytes": "3.1.0", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "~1.1.2", - "http-errors": "1.7.2", - "iconv-lite": "0.4.24", - "on-finished": "~2.3.0", - "qs": "6.7.0", - "raw-body": "2.4.0", - "type-is": "~1.6.17" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/bytes": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", - "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/content-disposition": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", - "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", - "dependencies": { - "safe-buffer": "5.1.2" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/content-type": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", - "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", - "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" - }, - "node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/destroy": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" - }, - "node_modules/ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" - }, - "node_modules/encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" - }, - "node_modules/etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/express": { - "version": "4.17.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", - "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", - "dependencies": { - "accepts": "~1.3.7", - "array-flatten": "1.1.1", - "body-parser": "1.19.0", - "content-disposition": "0.5.3", - "content-type": "~1.0.4", - "cookie": "0.4.0", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "~1.1.2", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "~1.1.2", - "fresh": "0.5.2", - "merge-descriptors": "1.0.1", - "methods": "~1.1.2", - "on-finished": "~2.3.0", - "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.5", - "qs": "6.7.0", - "range-parser": "~1.2.1", - "safe-buffer": "5.1.2", - "send": "0.17.1", - "serve-static": "1.14.1", - "setprototypeof": "1.1.1", - "statuses": "~1.5.0", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - }, - "engines": { - "node": ">= 0.10.0" - } - }, - "node_modules/express-validator": { - "version": "6.9.2", - "resolved": "https://registry.npmjs.org/express-validator/-/express-validator-6.9.2.tgz", - "integrity": "sha512-Yqlsw2/uBobtBVkP+gnds8OMmVAEb3uTI4uXC93l0Ym5JGHgr8Vd4ws7oSo7GGYpWn5YCq4UePMEppKchURXrw==", - "dependencies": { - "lodash": "^4.17.20", - "validator": "^13.5.2" - }, - "engines": { - "node": ">= 8.0.0" - } - }, - "node_modules/finalhandler": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", - "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", - "dependencies": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "~2.3.0", - "parseurl": "~1.3.3", - "statuses": "~1.5.0", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/forwarded": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", - "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/http-errors": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", - "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", - "dependencies": { - "depd": "~1.1.2", - "inherits": "2.0.3", - "setprototypeof": "1.1.1", - "statuses": ">= 1.5.0 < 2", - "toidentifier": "1.0.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" - }, - "node_modules/ipaddr.js": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" - }, - "node_modules/media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" - }, - "node_modules/methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/mime-db": { - "version": "1.45.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.45.0.tgz", - "integrity": "sha512-CkqLUxUk15hofLoLyljJSrukZi8mAtgd+yE5uO4tqRZsdsAJKv0O+rFMhVDRJgozy+yG6md5KwuXhD4ocIoP+w==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.28", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.28.tgz", - "integrity": "sha512-0TO2yJ5YHYr7M2zzT7gDU1tbwHxEUWBCLt0lscSNpcdAfFyJOVEpRYNS7EXVcTLNj/25QO8gulHC5JtTzSE2UQ==", - "dependencies": { - "mime-db": "1.45.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "node_modules/negotiator": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", - "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" - }, - "node_modules/proxy-addr": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz", - "integrity": "sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw==", - "dependencies": { - "forwarded": "~0.1.2", - "ipaddr.js": "1.9.1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/qs": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", - "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", - "engines": { - "node": ">=0.6" - } - }, - "node_modules/range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/raw-body": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", - "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", - "dependencies": { - "bytes": "3.1.0", - "http-errors": "1.7.2", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "node_modules/send": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", - "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", - "dependencies": { - "debug": "2.6.9", - "depd": "~1.1.2", - "destroy": "~1.0.4", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "~1.7.2", - "mime": "1.6.0", - "ms": "2.1.1", - "on-finished": "~2.3.0", - "range-parser": "~1.2.1", - "statuses": "~1.5.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/send/node_modules/ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" - }, - "node_modules/serve-static": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", - "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", - "dependencies": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.17.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/setprototypeof": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", - "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" - }, - "node_modules/statuses": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", - "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/toidentifier": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", - "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", - "engines": { - "node": ">=0.6" - } - }, - "node_modules/type-is": { - "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "dependencies": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/validator": { - "version": "13.5.2", - "resolved": "https://registry.npmjs.org/validator/-/validator-13.5.2.tgz", - "integrity": "sha512-mD45p0rvHVBlY2Zuy3F3ESIe1h5X58GPfAtslBjY7EtTqGquZTj+VX/J4RnHWN8FKq0C9WRVt1oWAcytWRuYLQ==", - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", - "engines": { - "node": ">= 0.8" - } - } - }, - "dependencies": { - "accepts": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", - "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", - "requires": { - "mime-types": "~2.1.24", - "negotiator": "0.6.2" - } - }, - "array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" - }, - "body-parser": { - "version": "1.19.0", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", - "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", - "requires": { - "bytes": "3.1.0", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "~1.1.2", - "http-errors": "1.7.2", - "iconv-lite": "0.4.24", - "on-finished": "~2.3.0", - "qs": "6.7.0", - "raw-body": "2.4.0", - "type-is": "~1.6.17" - } - }, - "bytes": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", - "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==" - }, - "content-disposition": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", - "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", - "requires": { - "safe-buffer": "5.1.2" - } - }, - "content-type": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", - "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" - }, - "cookie": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", - "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==" - }, - "cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" - }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - }, - "depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" - }, - "destroy": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" - }, - "ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" - }, - "encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" - }, - "escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" - }, - "etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" - }, - "express": { - "version": "4.17.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", - "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", - "requires": { - "accepts": "~1.3.7", - "array-flatten": "1.1.1", - "body-parser": "1.19.0", - "content-disposition": "0.5.3", - "content-type": "~1.0.4", - "cookie": "0.4.0", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "~1.1.2", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "~1.1.2", - "fresh": "0.5.2", - "merge-descriptors": "1.0.1", - "methods": "~1.1.2", - "on-finished": "~2.3.0", - "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.5", - "qs": "6.7.0", - "range-parser": "~1.2.1", - "safe-buffer": "5.1.2", - "send": "0.17.1", - "serve-static": "1.14.1", - "setprototypeof": "1.1.1", - "statuses": "~1.5.0", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - } - }, - "express-validator": { - "version": "6.9.2", - "resolved": "https://registry.npmjs.org/express-validator/-/express-validator-6.9.2.tgz", - "integrity": "sha512-Yqlsw2/uBobtBVkP+gnds8OMmVAEb3uTI4uXC93l0Ym5JGHgr8Vd4ws7oSo7GGYpWn5YCq4UePMEppKchURXrw==", - "requires": { - "lodash": "^4.17.20", - "validator": "^13.5.2" - } - }, - "finalhandler": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", - "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", - "requires": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "~2.3.0", - "parseurl": "~1.3.3", - "statuses": "~1.5.0", - "unpipe": "~1.0.0" - } - }, - "forwarded": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", - "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" - }, - "fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" - }, - "http-errors": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", - "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", - "requires": { - "depd": "~1.1.2", - "inherits": "2.0.3", - "setprototypeof": "1.1.1", - "statuses": ">= 1.5.0 < 2", - "toidentifier": "1.0.0" - } - }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" - }, - "ipaddr.js": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" - }, - "lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" - }, - "media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" - }, - "merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" - }, - "methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" - }, - "mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" - }, - "mime-db": { - "version": "1.45.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.45.0.tgz", - "integrity": "sha512-CkqLUxUk15hofLoLyljJSrukZi8mAtgd+yE5uO4tqRZsdsAJKv0O+rFMhVDRJgozy+yG6md5KwuXhD4ocIoP+w==" - }, - "mime-types": { - "version": "2.1.28", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.28.tgz", - "integrity": "sha512-0TO2yJ5YHYr7M2zzT7gDU1tbwHxEUWBCLt0lscSNpcdAfFyJOVEpRYNS7EXVcTLNj/25QO8gulHC5JtTzSE2UQ==", - "requires": { - "mime-db": "1.45.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "negotiator": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", - "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==" - }, - "on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", - "requires": { - "ee-first": "1.1.1" - } - }, - "parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" - }, - "path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" - }, - "proxy-addr": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz", - "integrity": "sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw==", - "requires": { - "forwarded": "~0.1.2", - "ipaddr.js": "1.9.1" - } - }, - "qs": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", - "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==" - }, - "range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" - }, - "raw-body": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", - "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", - "requires": { - "bytes": "3.1.0", - "http-errors": "1.7.2", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "send": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", - "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", - "requires": { - "debug": "2.6.9", - "depd": "~1.1.2", - "destroy": "~1.0.4", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "~1.7.2", - "mime": "1.6.0", - "ms": "2.1.1", - "on-finished": "~2.3.0", - "range-parser": "~1.2.1", - "statuses": "~1.5.0" - }, - "dependencies": { - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" - } - } - }, - "serve-static": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", - "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", - "requires": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.17.1" - } - }, - "setprototypeof": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", - "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" - }, - "statuses": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", - "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" - }, - "toidentifier": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", - "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" - }, - "type-is": { - "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "requires": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - } - }, - "unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" - }, - "utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" - }, - "validator": { - "version": "13.5.2", - "resolved": "https://registry.npmjs.org/validator/-/validator-13.5.2.tgz", - "integrity": "sha512-mD45p0rvHVBlY2Zuy3F3ESIe1h5X58GPfAtslBjY7EtTqGquZTj+VX/J4RnHWN8FKq0C9WRVt1oWAcytWRuYLQ==" - }, - "vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" - } - } -} diff --git a/api/package.json b/api/package.json deleted file mode 100644 index cf6bf15..0000000 --- a/api/package.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "api", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "keywords": [], - "author": "", - "license": "ISC", - "dependencies": { - "express": "^4.17.1", - "express-validator": "^6.9.2" - } -} diff --git a/api/src/index.js b/api/src/index.js deleted file mode 100644 index 5be8b75..0000000 --- a/api/src/index.js +++ /dev/null @@ -1,79 +0,0 @@ -const express = require('express'); -const { execute } = require('../../lxc/execute.js'); -const { languages } = require('./languages'); -const { checkSchema, validationResult } = require('express-validator'); - -const PORT = 2000; - -const app = express(); -app.use(express.json()); - -app.post( - '/execute', - checkSchema({ - language: { - in: 'body', - notEmpty: { - errorMessage: 'No language supplied', - }, - isString: { - errorMessage: 'Supplied language is not a string', - }, - custom: { - options: value => value && languages.find(language => language.aliases.includes(value.toLowerCase())), - errorMessage: 'Supplied language is not supported by Piston', - }, - }, - source: { - in: 'body', - notEmpty: { - errorMessage: 'No source supplied', - }, - isString: { - errorMessage: 'Supplied source is not a string', - }, - }, - args: { - in: 'body', - optional: true, - isArray: { - errorMessage: 'Supplied args is not an array', - }, - }, - stdin: { - in: 'body', - optional: true, - isString: { - errorMessage: 'Supplied stdin is not a string', - }, - } - }), - async (req, res) => { - const errors = validationResult(req).array(); - - if (errors.length === 0) { - const language = languages.find(language => - language.aliases.includes(req.body.language.toLowerCase()) - ); - - const { stdout, stderr, output, ran } = await execute(language, req.body.source, req.body.stdin, req.body.args); - - res.status(200).json({ - ran, - language: language.name, - version: language.version, - stdout, - stderr, - output, - }); - } else { - res.status(400).json({ - message: errors[0].msg, - }); - } - }, -); - -app.get('/versions', (_, res) => res.json(languages)); - -app.listen(PORT, () => console.log(`Listening on port ${PORT}`)); diff --git a/api/src/languages.js b/api/src/languages.js deleted file mode 100644 index 6ac2f14..0000000 --- a/api/src/languages.js +++ /dev/null @@ -1,39 +0,0 @@ -const { spawn } = require('child_process'); -const languages = require('../../config/languages.json'); - -{ - const process = spawn(__dirname + '/../../lxc/util/versions'); - - let output = ''; - process.stderr.on('data', chunk => output += chunk); - process.stdout.on('data', chunk => output += chunk); - - process.on('exit', () => { - const sections = output.toLowerCase().split('---'); - const versions = {}; - - for (const section of sections) { - const lines = section.trim().split('\n'); - - if (lines.length >= 2) { - const language = lines[0]; - - if (language === 'java') { - versions[language] = /\d+/.exec(lines[1])?.[0]; - } else if (language === 'emacs') { - versions[language] = /\d+\.\d+/.exec(lines[1])?.[0]; - } else { - versions[language] = /\d+\.\d+\.\d+/.exec(section)?.[0]; - } - } - } - - for (const language of languages) { - language.version = versions[language.name]; - } - }); -} - -module.exports = { - languages, -}; diff --git a/api/start b/api/start deleted file mode 100755 index fe2024e..0000000 --- a/api/start +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -node src diff --git a/cli/execute b/cli/execute deleted file mode 100755 index 6fdfdd3..0000000 --- a/cli/execute +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env node - -const { execute } = require('../lxc/execute.js'); -const { readFileSync } = require('fs'); -const languages = require('../config/languages.json'); - -const [languageName, sourceFile, ...args] = process.argv.slice(2); - -(async () => { - if (!languageName) { - console.error('Provide a language name'); - return; - } - - if (!sourceFile) { - console.error('Provide a source file'); - return; - } - - const source = readFileSync(sourceFile).toString(); - - const language = languages.find(language => language.aliases.includes(languageName.toLowerCase())); - - if (!language) { - console.error(`${languageName} is not supported by Piston`); - return; - } - - const { output } = await execute(language, source, '', args); - - console.log(output); -})(); diff --git a/config/languages.json b/config/languages.json deleted file mode 100644 index f62ea5c..0000000 --- a/config/languages.json +++ /dev/null @@ -1,267 +0,0 @@ -[ - { - "name": "nasm", - "aliases": [ - "asm", - "nasm" - ] - }, - { - "name": "nasm64", - "aliases": [ - "asm64", - "nasm64" - ] - }, - { - "name": "awk", - "aliases": [ - "awk" - ] - }, - { - "name": "bash", - "aliases": [ - "bash", - "sh" - ] - }, - { - "name": "brainfuck", - "aliases": [ - "bf", - "brainfuck" - ] - }, - { - "name": "c", - "aliases": [ - "c" - ] - }, - { - "name": "crystal", - "aliases": [ - "crystal", - "cr" - ] - }, - { - "name": "lisp", - "aliases": [ - "lisp", - "commonlisp", - "clisp", - "cl" - ] - }, - { - "name": "csharp", - "aliases": [ - "c#", - "cs", - "csharp" - ] - }, - { - "name": "cpp", - "aliases": [ - "c++", - "cpp", - "cc", - "cxx" - ] - }, - { - "name": "d", - "aliases": [ - "dlang", - "d" - ] - }, - { - "name": "deno", - "aliases": [ - "deno", - "denojs", - "denots" - ] - }, - { - "name": "dash", - "aliases": [ - "dash" - ] - }, - { - "name": "ruby", - "aliases": [ - "duby", - "rb", - "ruby" - ] - }, - { - "name": "emacs", - "aliases": [ - "el", - "elisp", - "emacs" - ] - }, - { - "name": "elixir", - "aliases": [ - "elixir", - "exs" - ] - }, - { - "name": "haskell", - "aliases": [ - "haskell", - "hs" - ] - }, - { - "name": "go", - "aliases": [ - "go", - "golang" - ] - }, - { - "name": "java", - "aliases": [ - "java" - ] - }, - { - "name": "nim", - "aliases": [ - "nim" - ] - }, - { - "name": "node", - "aliases": [ - "javascript", - "js", - "node", - "node.js" - ] - }, - { - "name": "jelly", - "aliases": [ - "jelly" - ] - }, - { - "name": "julia", - "aliases": [ - "jl", - "julia" - ] - }, - { - "name": "kotlin", - "aliases": [ - "kotlin", - "kt" - ] - }, - { - "name": "lua", - "aliases": [ - "lua" - ] - }, - { - "name": "paradoc", - "aliases": [ - "paradoc" - ] - }, - { - "name": "perl", - "aliases": [ - "perl", - "pl" - ] - }, - { - "name": "php", - "aliases": [ - "php", - "php3", - "php4", - "php5" - ] - }, - { - "name": "prolog", - "aliases": [ - "prolog", - "plg" - ] - }, - { - "name": "python3", - "aliases": [ - "py", - "py3", - "python", - "python3" - ] - }, - { - "name": "python2", - "aliases": [ - "python2", - "py2" - ] - }, - { - "name": "rust", - "aliases": [ - "rs", - "rust" - ] - }, - { - "name": "scala", - "aliases": [ - "scala", - "sc" - ] - }, - { - "name": "swift", - "aliases": [ - "swift" - ] - }, - { - "name": "typescript", - "aliases": [ - "ts", - "typescript" - ] - }, - { - "name": "zig", - "aliases": [ - "zig" - ] - }, - { - "name": "osabie", - "aliases": [ - "osabie", - "05AB1E", - "osable", - "usable" - ] - } -] diff --git a/container/build.sh b/container/build.sh deleted file mode 100755 index c7f7355..0000000 --- a/container/build.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -python3 -m pip install pyyaml -python3 configure.py -distrobuilder build-lxc build.yaml - diff --git a/container/configure.py b/container/configure.py deleted file mode 100644 index 5c02fd3..0000000 --- a/container/configure.py +++ /dev/null @@ -1,13 +0,0 @@ -import yaml - - -with open('piston.yaml') as dbc: - with open('install_script.sh') as install_script_file: - with open('build.yaml' , 'w+') as distrobuilder_config_file_new: - distrobuilder_config = yaml.safe_load(dbc) - distrobuilder_config['actions'].append({ - 'trigger': 'post-packages', - 'action': install_script_file.read(), - - }) - yaml.dump(distrobuilder_config, distrobuilder_config_file_new) diff --git a/container/install_script.sh b/container/install_script.sh deleted file mode 100644 index bb7264f..0000000 --- a/container/install_script.sh +++ /dev/null @@ -1,323 +0,0 @@ -#!/bin/bash -#echo "Don't run this on your system!" && exit 0 - -# install all necessary piston dependencies -echo 'source /opt/.profile' >> /opt/.bashrc -echo 'export HOME=/opt' >> /opt/.profile -echo 'export TERM=linux' >> /opt/.profile -echo 'export PATH=$PATH:/opt/.local/bin' >> /opt/.profile -export HOME=/opt -export TERM=linux -sed -i 's/\/root/\/opt/' /etc/passwd -sed -i \ - 's/http:\/\/archive.ubuntu.com\/ubuntu/http:\/\/mirror.math.princeton.edu\/pub\/ubuntu/' \ - /etc/apt/sources.list -apt-get update -apt-get install -y \ - nano wget build-essential pkg-config libxml2-dev \ - libsqlite3-dev mono-complete curl cmake libpython2.7-dev \ - ruby libtinfo-dev unzip git openssl libssl-dev sbcl libevent-dev - -# install python2 -# final binary: /opt/python2/Python-2.7.17/python -# get version: /opt/python2/Python-2.7.17/python -V -cd /opt && mkdir python2 && cd python2 -wget https://www.python.org/ftp/python/2.7.17/Python-2.7.17.tar.xz -unxz Python-2.7.17.tar.xz -tar -xf Python-2.7.17.tar -cd Python-2.7.17 -./configure -# open Modules/Setup and uncomment zlib line -make -echo 'export PATH=$PATH:/opt/python2/Python-2.7.17' >> /opt/.profile -source /opt/.profile - -# install python3 -# final binary: /opt/python3/Python-3.9.1/python -# get version: /opt/python3/Python-3.9.1/python -V -cd /opt && mkdir python3 && cd python3 -wget https://www.python.org/ftp/python/3.9.1/Python-3.9.1.tar.xz -unxz Python-3.9.1.tar.xz -tar -xf Python-3.9.1.tar -cd Python-3.9.1 -./configure -make -ln -s python python3.9 -echo 'export PATH=$PATH:/opt/python3/Python-3.9.1' >> /opt/.profile -source /opt/.profile - -# install paradoc -# this is not a binary, it is a python module -# therefore it cannot be run directly as it requires python3 to be installed -cd /opt && mkdir paradoc && cd paradoc -git clone https://github.com/betaveros/paradoc.git - -# install node.js -# final binary: /opt/nodejs/node-v12.16.1-linux-x64/bin/node -# get version: /opt/nodejs/node-v12.16.1-linux-x64/bin/node -v -cd /opt && mkdir nodejs && cd nodejs -wget https://nodejs.org/dist/v12.16.1/node-v12.16.1-linux-x64.tar.xz -unxz node-v12.16.1-linux-x64.tar.xz -tar -xf node-v12.16.1-linux-x64.tar -echo 'export PATH=$PATH:/opt/nodejs/node-v12.16.1-linux-x64/bin' >> /opt/.profile -source /opt/.profile - -# install typescript -# final binary: /opt/nodejs/node-v12.16.1-linux-x64/bin/tsc -# get version: /opt/nodejs/node-v12.16.1-linux-x64/bin/tsc -v -/opt/nodejs/node-v12.16.1-linux-x64/bin/npm i -g typescript - -# install golang -# final binary: /opt/go/go/bin/go -# get version: /opt/go/go/bin/go version -cd /opt && mkdir go && cd go -wget https://dl.google.com/go/go1.14.1.linux-amd64.tar.gz -tar -xzf go1.14.1.linux-amd64.tar.gz -echo 'export PATH=$PATH:/opt/go/go/bin' >> /opt/.profile -echo 'export GOROOT=/opt/go/go' >> /opt/.profile -echo 'export GOCACHE=/tmp' >> /opt/.profile -source /opt/.profile - -# install php -# final binary: /usr/local/bin/php -# get version: /usr/local/bin/php -v -cd /opt && mkdir php && cd php -wget https://www.php.net/distributions/php-8.0.0.tar.gz -tar -xzf php-8.0.0.tar.gz -cd php-8.0.0 -./configure -make -make install - -# install rust -# final binary: /usr/local/bin/rustc -# get version: /usr/local/bin/rustc --version -cd /opt && mkdir rust && cd rust -wget https://static.rust-lang.org/dist/rust-1.49.0-x86_64-unknown-linux-gnu.tar.gz -tar -xzf rust-1.49.0-x86_64-unknown-linux-gnu.tar.gz -cd rust-1.49.0-x86_64-unknown-linux-gnu -./install.sh - -# install scala -# final binary: /opt/scala/scala3-3.0.0-M3/bin/scala -# get version: /opt/scala/scala3-3.0.0-M3/bin/scala -version -cd /opt && mkdir scala && cd scala -wget https://github.com/lampepfl/dotty/releases/download/3.0.0-M3/scala3-3.0.0-M3.tar.gz -tar -xzf scala3-3.0.0-M3.tar.gz -echo 'export PATH=$PATH:/opt/scala/scala3-3.0.0-M3/bin' >> /opt/.profile -source /opt/.profile - -# install swift -# final binary: /opt/swift/swift-5.1.5-RELEASE-ubuntu18.04/usr/bin/swift -# get version: /opt/swift/swift-5.1.5-RELEASE-ubuntu18.04/usr/bin/swift --version -cd /opt && mkdir swift && cd swift -wget https://swift.org/builds/swift-5.1.5-release/ubuntu1804/swift-5.1.5-RELEASE/swift-5.1.5-RELEASE-ubuntu18.04.tar.gz -tar -xzf swift-5.1.5-RELEASE-ubuntu18.04.tar.gz -echo 'export PATH=$PATH:/opt/swift/swift-5.1.5-RELEASE-ubuntu18.04/usr/bin' >> /opt/.profile -source /opt/.profile - -# install nasm -# final binary: /opt/nasm/nasm-2.14.02/nasm -# get version: /opt/nasm/nasm-2.14.02/nasm -v -cd /opt && mkdir nasm && cd nasm -wget https://www.nasm.us/pub/nasm/releasebuilds/2.14.02/nasm-2.14.02.tar.gz -tar -xzf nasm-2.14.02.tar.gz -cd nasm-2.14.02 -./configure -make -echo 'export PATH=$PATH:/opt/nasm/nasm-2.14.02' >> /opt/.profile -source /opt/.profile - -# install java -# final binary: /opt/java/jdk-14/bin/java -# get version: /opt/java/jdk-14/bin/java -version -cd /opt && mkdir java && cd java -wget https://download.java.net/java/GA/jdk14/076bab302c7b4508975440c56f6cc26a/36/GPL/openjdk-14_linux-x64_bin.tar.gz -tar -xzf openjdk-14_linux-x64_bin.tar.gz -echo 'export PATH=$PATH:/opt/java/jdk-14/bin' >> /opt/.profile -# Scala will complain if JAVA_HOME isn't set -echo 'export JAVA_HOME=/opt/java/jdk-14' >> /opt/.profile -source /opt/.profile - -# install jelly -cd /opt && mkdir jelly && cd jelly -wget https://github.com/DennisMitchell/jellylanguage/archive/master.zip -unzip master.zip -cd jellylanguage-master -python3.8 -m pip install . -sed -i 's/\/usr\/local\/bin\/python3.8/\/opt\/python3\/Python-3.8.2\/python3.8/' /usr/local/bin/jelly - -# install julia -# final binary: /opt/julia/julia-1.5.0/bin/julia -# get version: /opt/julia/julia-1.5.0/bin/julia --version -cd /opt && mkdir julia && cd julia -wget https://julialang-s3.julialang.org/bin/linux/x64/1.5/julia-1.5.0-linux-x86_64.tar.gz -tar -xzf julia-1.5.0-linux-x86_64.tar.gz -echo 'export PATH=$PATH:/opt/julia/julia-1.5.0/bin' >> /opt/.profile -source /opt/.profile - -# install kotlin -# final binary: /opt/kotlinc/bin/kotlinc -# get version: /opt/kotlinc/bin/kotlinc -version -cd /opt -wget https://github.com/JetBrains/kotlin/releases/download/v1.4.10/kotlin-compiler-1.4.10.zip -unzip kotlin-compiler-1.4.10.zip -rm kotlin-compiler-1.4.10.zip -echo 'export PATH=$PATH:/opt/kotlinc/bin' >> /opt/.profile -source /opt/.profile - -# install elixir and erlang -# final binary: /opt/elixir/bin/elixir -# get version: /opt/elixir/bin/elixir --version -# erlang -cd /opt && mkdir erlang && cd erlang -wget http://erlang.org/download/otp_src_23.0.tar.gz -gunzip -c otp_src_23.0.tar.gz | tar xf - -cd otp_src_23.0 && ./configure -make -echo 'export PATH=$PATH:/opt/erlang/otp_src_23.0/bin' >> /opt/.profile -source /opt/.profile -# elixir -cd /opt && mkdir elixir && cd elixir -wget https://github.com/elixir-lang/elixir/releases/download/v1.10.3/Precompiled.zip -mkdir elixir-1.10.3 && unzip Precompiled.zip -d elixir-1.10.3/ -echo 'export PATH=$PATH:/opt/elixir/elixir-1.10.3/bin' >> /opt/.profile -source /opt/.profile - -# install emacs -# final binary: /opt/emacs/emacs-26.3/src/emacs -# get version: /opt/emacs/emacs-26.3/src/emacs --version -cd /opt && mkdir emacs && cd emacs -wget https://mirrors.ocf.berkeley.edu/gnu/emacs/emacs-26.3.tar.xz -tar -xf emacs-26.3.tar.xz -rm emacs-26.3.tar.xz -cd emacs-26.3 -./configure --with-gnutls=no -make -echo 'export PATH=$PATH:/opt/emacs/emacs-26.3/src' >> /opt/.profile -source /opt/.profile - -# install lua -# final binary: /opt/lua/lua54/src/lua -# get version: /opt/lua/lua54/src/lua -v -cd /opt && mkdir lua && cd lua -wget https://sourceforge.net/projects/luabinaries/files/5.4.0/Docs%20and%20Sources/lua-5.4.0_Sources.tar.gz/download -tar -xzf download -cd lua54 -make -echo 'export PATH=$PATH:/opt/lua/lua54/src' >> /opt/.profile -source /opt/.profile - -# install haskell -# final binary: /usr/bin/ghc -# get version: /usr/bin/ghc --version -apt install -y ghc - -# install deno -# final binary: /opt/.deno/bin/deno -# get version: /opt/.deno/bin/deno --version -cd /opt && mkdir deno && cd deno -curl -fsSL https://deno.land/x/install/install.sh | sh -echo 'export DENO_INSTALL="/opt/.deno"' >> /opt/.profile -echo 'export PATH="$DENO_INSTALL/bin:$PATH"' >> /opt/.profile -source /opt/.profile - -# install brainfuck -cd /opt && mkdir bf && cd bf -git clone https://github.com/texus/Brainfuck-interpreter -cd Brainfuck-interpreter -echo 'export PATH=$PATH:/opt/bf/Brainfuck-interpreter' >> /opt/.profile -source /opt/.profile - -# install crystal -# final binary: /opt/crystal/crystal-0.35.1-1/bin/crystal -# get version: /opt/crystal/crystal-0.35.1-1/bin/crystal -v -cd /opt && mkdir crystal && cd crystal -wget https://github.com/crystal-lang/crystal/releases/download/0.35.1/crystal-0.35.1-1-linux-x86_64.tar.gz -tar -xzf crystal-0.35.1-1-linux-x86_64.tar.gz -echo 'export PATH="$PATH:/opt/crystal/crystal-0.35.1-1/bin:$PATH"' >> /opt/.profile -source /opt/.profile - -# install d -# final binary: /opt/d/dmd2/linux/bin64/dmd -# get version: /opt/d/dmd2/linux/bin64/dmd --version -cd /opt && mkdir d && cd d -wget http://downloads.dlang.org/releases/2.x/2.095.0/dmd.2.095.0.linux.tar.xz -unxz dmd.2.095.0.linux.tar.xz -tar -xf dmd.2.095.0.linux.tar -echo 'export PATH=$PATH:/opt/d/dmd2/linux/bin64' >> /opt/.profile -source /opt/.profile - -# install zig -# final binary: /opt/zig/zig -# get version: /opt/zig/zig version -cd /opt && mkdir zig && cd zig -wget https://ziglang.org/download/0.7.1/zig-linux-x86_64-0.7.1.tar.xz -tar -xf zig-linux-x86_64-0.7.1.tar.xz -mv zig-linux-x86_64-0.7.1 zig -rm zig-linux-x86_64-0.7.1.tar.xz -echo 'export PATH=$PATH:/opt/zig/zig' >> /opt/.profile -source /opt/.profile - -# install nim -# final binary: /opt/nim/bin/nim -# get version: /opt/nim/bin/nim -v -cd /opt && mkdir nim && cd nim -wget https://nim-lang.org/download/nim-1.4.0-linux_x64.tar.xz -unxz nim-1.4.0-linux_x64.tar.xz -tar -xf nim-1.4.0-linux_x64.tar -cd nim-1.4.0 -./install.sh /opt -echo 'export PATH=$PATH:/opt/nim/bin' >> /opt/.profile -source /opt/.profile - -# install 05AB1E -# final binary: /opt/05AB1E/05AB1E/osabie -# requires Elixir to install -cd /opt && mkdir 05AB1E && cd 05AB1E -git clone https://github.com/Adriandmen/05AB1E.git -cd 05AB1E -mix local.hex --force -mix deps.get --force -MIX_ENV=prod mix escript.build --force -echo 'export PATH=$PATH:/opt/05AB1E/05AB1E' >> /opt/.profile -source /opt/.profile - - -# install prolog -# final binary: /opt/swipl/swipl-/build/src/swipl -cd /opt && mkdir swipl && cd swipl -SUB_DIR=swipl-8.2.4 -wget https://www.swi-prolog.org/download/stable/src/$SUB_DIR.tar.gz -tar -xf $SUB_DIR.tar.gz -rm $SUB_DIR.tar.gz -cd $SUB_DIR -mkdir build -cd build -cmake -DSWIPL_PACKAGES_JAVA=OFF -DSWIPL_PACKAGES_X=OFF -DMULTI_THREADED=OFF -G Ninja .. -ninja -echo "export PATH=\$PATH:/opt/swipl/$SUB_DIR/build/src" >> /opt/.profile -source /opt/.profile - -# create runnable users and apply limits -for i in {1..150}; do - useradd -M runner$i - usermod -d /tmp runner$i - echo "runner$i soft nproc 64" >> /etc/security/limits.conf - echo "runner$i hard nproc 64" >> /etc/security/limits.conf - echo "runner$i soft nofile 2048" >> /etc/security/limits.conf - echo "runner$i hard nofile 2048" >> /etc/security/limits.conf -done - -# remove any lingering write access to others -cd /opt -chown -R root: * -chmod -R o-w * - -# cleanup -rm -rf /home/ubuntu -chmod 777 /tmp - -# disable cron -systemctl stop cron -systemctl disable cron diff --git a/container/piston.yaml b/container/piston.yaml deleted file mode 100644 index 4cbb9c0..0000000 --- a/container/piston.yaml +++ /dev/null @@ -1,355 +0,0 @@ -image: - name: ubuntu-bionic-x86_64-piston - distribution: ubuntu - release: bionic - description: |- - Ubuntu {{ image.release }} preconfigured for Piston - architecture: x86_64 - -source: - downloader: debootstrap - same_as: bionic - url: http://archive.ubuntu.com/ubuntu - keyserver: keyserver.ubuntu.com - keys: - - '0x790BC7277767219C42C86F933B4FE6ACC0B21F32' - - '0xf6ecb3762474eda9d21b7022871920d1991bc93c' - -targets: - lxc: - create-message: |- - You just created an {{ image.description }} container. - To enable SSH, run: apt install openssh-server - No default root or user password are set by LXC. - config: - - type: all - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.common.conf - - type: user - before: 5 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/ubuntu.userns.conf - - type: all - after: 4 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/common.conf - # For Ubuntu 14.04 - lxc.mount.entry = /sys/kernel/debug sys/kernel/debug none bind,optional 0 0 - lxc.mount.entry = /sys/kernel/security sys/kernel/security none bind,optional 0 0 - lxc.mount.entry = /sys/fs/pstore sys/fs/pstore none bind,optional 0 0 - lxc.mount.entry = mqueue dev/mqueue mqueue rw,relatime,create=dir,optional 0 0 - - type: user - after: 4 - content: |- - lxc.include = LXC_TEMPLATE_CONFIG/userns.conf - # For Ubuntu 14.04 - lxc.mount.entry = /sys/firmware/efi/efivars sys/firmware/efi/efivars none bind,optional 0 0 - lxc.mount.entry = /proc/sys/fs/binfmt_misc proc/sys/fs/binfmt_misc none bind,optional 0 0 - - type: all - content: |- - lxc.arch = {{ image.architecture_personality }} -files: -- path: /etc/hostname - generator: hostname - -- path: /etc/hosts - generator: hosts - -- path: /etc/resolvconf/resolv.conf.d/original - generator: remove - -- path: /etc/resolvconf/resolv.conf.d/tail - generator: remove - -- path: /etc/machine-id - generator: dump - - -- path: /var/lib/dbus/machine-id - generator: remove - -- path: /etc/netplan/10-lxc.yaml - generator: dump - content: |- - network: - version: 2 - ethernets: - eth0: - dhcp4: true - dhcp-identifier: mac - releases: - - bionic - - eoan - - focal - - groovy - types: - - container - variants: - - default - -- path: /etc/network/interfaces - generator: dump - content: |- - # This file describes the network interfaces available on your system - # and how to activate them. For more information, see interfaces(5). - # The loopback network interface - auto lo - iface lo inet loopback - auto eth0 - iface eth0 inet dhcp - source /etc/network/interfaces.d/*.cfg - releases: - - trusty - - xenial - types: - - container - -- path: /etc/netplan/10-lxc.yaml - generator: dump - content: |- - network: - version: 2 - ethernets: - enp5s0: - dhcp4: true - dhcp-identifier: mac - releases: - - bionic - - eoan - - focal - - groovy - types: - - vm - variants: - - default - -- path: /etc/network/interfaces - generator: dump - content: |- - # This file describes the network interfaces available on your system - # and how to activate them. For more information, see interfaces(5). - # The loopback network interface - auto lo - iface lo inet loopback - auto enp5s0 - iface enp5s0 inet dhcp - source /etc/network/interfaces.d/*.cfg - releases: - - trusty - - xenial - types: - - vm - -- path: /etc/init/lxc-tty.conf - generator: upstart-tty - releases: - - trusty - types: - - container - -- name: meta-data - generator: cloud-init - variants: - - cloud - -- name: network-config - generator: cloud-init - variants: - - cloud - -- name: user-data - generator: cloud-init - variants: - - cloud - -- name: vendor-data - generator: cloud-init - variants: - - cloud - -- name: ext4 - generator: fstab - types: - - vm - -- name: lxd-agent - generator: lxd-agent - types: - - vm - -- path: /etc/default/grub.d/50-lxd.cfg - generator: dump - content: |- - GRUB_RECORDFAIL_TIMEOUT=0 - GRUB_TIMEOUT=0 - GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_DEFAULT} console=tty1 console=ttyS0" - GRUB_TERMINAL=console - types: - - vm - -- path: /etc/sudoers.d/90-lxd - generator: dump - mode: '0440' - content: |- - # User rules for ubuntu - ubuntu ALL=(ALL) NOPASSWD:ALL - variants: - - default - -packages: - manager: apt - update: true - cleanup: true - sets: - - packages: - - apt-transport-https - - fuse - - language-pack-en - - openssh-client - - vim - action: install - - - packages: - - cloud-init - action: install - variants: - - cloud - - - packages: - - acpid - action: install - architectures: - - amd64 - - arm64 - types: - - vm - - - packages: - - grub-efi-amd64-signed - - shim-signed - action: install - architectures: - - amd64 - types: - - vm - - - packages: - - grub-efi-arm64-signed - action: install - architectures: - - arm64 - types: - - vm - - - packages: - - shim-signed - action: install - architectures: - - arm64 - releases: - - disco - - eoan - - focal - - groovy - types: - - vm - - - packages: - - linux-virtual-hwe-16.04 - action: install - releases: - - xenial - types: - - vm - - - packages: - - linux-virtual - action: install - releases: - - bionic - - eoan - - focal - - groovy - types: - - vm - - - packages: - - os-prober - action: remove - types: - - vm - - repositories: - - name: sources.list - url: |- - deb http://archive.ubuntu.com/ubuntu {{ image.release }} main restricted universe multiverse - deb http://archive.ubuntu.com/ubuntu {{ image.release }}-updates main restricted universe multiverse - deb http://security.ubuntu.com/ubuntu {{ image.release }}-security main restricted universe multiverse - architectures: - - amd64 - - i386 - - - name: sources.list - url: |- - deb http://ports.ubuntu.com/ubuntu-ports {{ image.release }} main restricted universe multiverse - deb http://ports.ubuntu.com/ubuntu-ports {{ image.release }}-updates main restricted universe multiverse - deb http://ports.ubuntu.com/ubuntu-ports {{ image.release }}-security main restricted universe multiverse - architectures: - - armhf - - arm64 - - powerpc - - powerpc64 - - ppc64el - -actions: -- trigger: post-update - action: |- - #!/bin/sh - set -eux - # Create the ubuntu user account - getent group sudo >/dev/null 2>&1 || groupadd --system sudo - useradd --create-home -s /bin/bash -G sudo -U ubuntu - variants: - - default - -- trigger: post-packages - action: |- - #!/bin/sh - set -eux - # Enable systemd-networkd - systemctl enable systemd-networkd - releases: - - bionic - - eoan - - focal - - groovy - -- trigger: post-packages - action: |- - #!/bin/sh - set -eux - # Make sure the locale is built and functional - locale-gen en_US.UTF-8 - update-locale LANG=en_US.UTF-8 - # Cleanup underlying /run - mount -o bind / /mnt - rm -rf /mnt/run/* - umount /mnt - # Cleanup temporary shadow paths - rm /etc/*- -- trigger: post-files - action: |- - #!/bin/sh - set -eux - TARGET="x86_64" - [ "$(uname -m)" = "aarch64" ] && TARGET="arm64" - update-grub - grub-install --uefi-secure-boot --target="${TARGET}-efi" --no-nvram --removable - update-grub - sed -i "s#root=[^ ]*#root=/dev/sda2#g" /boot/grub/grub.cfg - types: - - vm - -mappings: - architecture_map: debian diff --git a/container/readme.md b/container/readme.md deleted file mode 100644 index 1af19d5..0000000 --- a/container/readme.md +++ /dev/null @@ -1,7 +0,0 @@ -# LXC Container Build - -Requires: `lxc`, `lxc-net`, `packer` (Hashicorp Packer) - -To build: `packer build -var 'apt_mirror=[apt mirror]' -var 'make_threads=[-j flag]' piston.pkr.hcl` - -After roughly 30 minutes (on an i7-4790k), you should have an image built \ No newline at end of file diff --git a/images/icon_circle.svg b/images/icon_circle.svg deleted file mode 100644 index 7acfd39..0000000 --- a/images/icon_circle.svg +++ /dev/null @@ -1,32 +0,0 @@ - - - diff --git a/license b/license deleted file mode 100644 index d2d6fd8..0000000 --- a/license +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2018 Brian Seymour, EMKC Contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/lxc/execute b/lxc/execute deleted file mode 100755 index 66e1daf..0000000 --- a/lxc/execute +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env bash - -dir="$( cd "$( dirname "$0" )" && pwd )" - -touch $dir/lockfile - -if [ -z "$1" ] || [ -z "$2" ]; then - echo "invalid args" - exit -fi - -language=$1 -id=$2 - -basepath="/var/lib/lxc/piston/rootfs" - -# process incrementor -exec 200>$dir/lockfile -flock 200 - -touch $dir/i -runner=$(cat $dir/i) -let 'runner = runner % 150 + 1' - -echo $runner > $dir/i -exec 200>&- - -# prevent users from spying on each other -lxc-attach --clear-env -n piston -- \ - /bin/bash -l -c " - chown runner$runner: -R /tmp/$id - chmod 700 /tmp/$id - " > /dev/null 2>&1 - -# runner -timeout -s KILL 20 \ - lxc-attach --clear-env -n piston -- \ - /bin/bash -l -c "runuser runner$runner /exec/$language $id" - -# process janitor -lxc-attach --clear-env -n piston -- \ - /bin/bash -l -c " - for i in {1..100} - do - pkill -u runner$runner --signal SIGKILL - done - - find /tmp -user runner$runner -delete - find /var/tmp -user runner$runner -delete - find /var/lock -user runner$runner -delete - find /dev/shm -user runner$runner -delete - find /run/lock -user runner$runner -delete - " > /dev/null 2>&1 & - -rm -rf $basepath/tmp/$id diff --git a/lxc/execute.js b/lxc/execute.js deleted file mode 100644 index fc9fb8b..0000000 --- a/lxc/execute.js +++ /dev/null @@ -1,56 +0,0 @@ -const { writeFileSync, unlinkSync, mkdirSync } = require('fs'); -const { spawn } = require('child_process'); - -const OUTPUT_LIMIT = 65535; -const LXC_ROOT = '/var/lib/lxc/piston/rootfs'; - -function execute(language, source, stdin = '', args = []) { - return new Promise(resolve => { - const id = new Date().getTime() + '_' + Math.floor(Math.random() * 10000000); - - mkdirSync(`${LXC_ROOT}/tmp/${id}`); - writeFileSync(`${LXC_ROOT}/tmp/${id}/code.code`, source); - writeFileSync(`${LXC_ROOT}/tmp/${id}/stdin.stdin`, stdin); - writeFileSync(`${LXC_ROOT}/tmp/${id}/args.args`, args.join('\n')); - - const process = spawn(__dirname + '/execute', [ - language.name, - id, - ]); - - let stdout = ''; - let stderr = ''; - let output = ''; - - process.stderr.on('data', chunk => { - if (stderr.length >= OUTPUT_LIMIT) return; - - stderr += chunk; - output += chunk; - }); - - process.stdout.on('data', chunk => { - if (stdout.length >= OUTPUT_LIMIT) return; - - stdout += chunk; - output += chunk; - }); - - process.on('exit', code => { - stderr = stderr.trim().substring(0, OUTPUT_LIMIT); - stdout = stdout.trim().substring(0, OUTPUT_LIMIT); - output = output.trim().substring(0, OUTPUT_LIMIT); - - resolve({ - stdout, - stderr, - output, - ran: code === 0, - }); - }); - }); -} - -module.exports = { - execute, -}; diff --git a/lxc/executors/awk b/lxc/executors/awk deleted file mode 100755 index 319a64e..0000000 --- a/lxc/executors/awk +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - - -cd /tmp/$1 -timeout -s KILL 3 xargs -a args.args -d '\n' awk -f code.code < stdin.stdin diff --git a/lxc/executors/bash b/lxc/executors/bash deleted file mode 100755 index 8685011..0000000 --- a/lxc/executors/bash +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -cd /tmp/$1 -xargs -a args.args -d '\n' timeout -s KILL 3 bash code.code < stdin.stdin diff --git a/lxc/executors/brainfuck b/lxc/executors/brainfuck deleted file mode 100755 index f03b43f..0000000 --- a/lxc/executors/brainfuck +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -cd /tmp/$1 -sedarg="\ -s/+/P/g;\ -s/-/M/g;\ -s/>/++p;/g;\ -s/ code.c -#include - -char mem[1<<$MEMSIZE]; -char *p = mem + (1<<$((MEMSIZE - 1))); -int c; - -int main() { - $(timeout -s KILL 3 sed 's/[^][<>.,+-]//g' code.code | timeout -s KILL 3 sed $sedarg) -} -EOF -timeout -s KILL 3 gcc -std=c11 -o binary code.c - -# Merging args.args and stdin.stdin for emkc challenges -cat stdin.stdin >> args.args - -# execution -timeout -s KILL 3 ./binary < args.args diff --git a/lxc/executors/c b/lxc/executors/c deleted file mode 100755 index e0806f3..0000000 --- a/lxc/executors/c +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/bash - -cd /tmp/$1 -timeout -s KILL 10 gcc -std=c11 -o binary -x c code.code -timeout -s KILL 3 xargs -a args.args -d '\n' ./binary < stdin.stdin diff --git a/lxc/executors/cpp b/lxc/executors/cpp deleted file mode 100755 index 0365b00..0000000 --- a/lxc/executors/cpp +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -cd /tmp/$1 -timeout -s KILL 10 g++ -std=c++17 -o binary -x c++ code.code -timeout -s KILL 3 xargs -a args.args -d '\n' ./binary < stdin.stdin diff --git a/lxc/executors/crystal b/lxc/executors/crystal deleted file mode 100644 index ec8fe01..0000000 --- a/lxc/executors/crystal +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -cd /tmp/$1 -timeout -s KILL 10 crystal build code.code -timeout -s KILL 3 xargs -a args.args -d '\n' ./code < stdin.stdin diff --git a/lxc/executors/csharp b/lxc/executors/csharp deleted file mode 100755 index 684beb9..0000000 --- a/lxc/executors/csharp +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -cd /tmp/$1 -mcs $(echo code.code | sed 's/\///') -nowarn:0219 -out:binary -timeout -s KILL 3 xargs -a args.args -d '\n' mono binary < stdin.stdin diff --git a/lxc/executors/d b/lxc/executors/d deleted file mode 100644 index 8893762..0000000 --- a/lxc/executors/d +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -cd /tmp/$1 -cp code.code code.d -timeout -s KILL 10 dmd code.d -timeout -s KILL 3 xargs -a args.args -d '\n' ./code diff --git a/lxc/executors/dash b/lxc/executors/dash deleted file mode 100644 index 4476310..0000000 --- a/lxc/executors/dash +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -cd /tmp/$1 -xargs -a args.args -d '\n' timeout -s KILL 3 dash code.code < stdin.stdin diff --git a/lxc/executors/deno b/lxc/executors/deno deleted file mode 100755 index f55e1f4..0000000 --- a/lxc/executors/deno +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -cd /tmp/$1 -timeout -s KILL 3 xargs -a args.args -d '\n' deno run code.code < stdin.stdin diff --git a/lxc/executors/elixir b/lxc/executors/elixir deleted file mode 100755 index 2f36aa9..0000000 --- a/lxc/executors/elixir +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -export LC_ALL="en_US.UTF-8" - -cd /tmp/$1 -timeout -s KILL 3 xargs -a args.args -d '\n' elixir code.code < stdin.stdin diff --git a/lxc/executors/emacs b/lxc/executors/emacs deleted file mode 100755 index efcac97..0000000 --- a/lxc/executors/emacs +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -cd /tmp/$1 -timeout -s KILL 3 xargs -a args.args -d '\n' emacs -Q --script code.code < stdin.stdin diff --git a/lxc/executors/go b/lxc/executors/go deleted file mode 100755 index 41592f7..0000000 --- a/lxc/executors/go +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -cd /tmp/$1 -cp code.code interim.go -go build interim.go -timeout -s KILL 3 xargs -a args.args -d '\n' ./interim < stdin.stdin diff --git a/lxc/executors/haskell b/lxc/executors/haskell deleted file mode 100755 index ad62cab..0000000 --- a/lxc/executors/haskell +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -cd /tmp/$1 -cp code.code code.hs -ghc -dynamic -o binary code.hs > /dev/null 2>&1 -timeout -s KILL 3 xargs -a args.args -d '\n' ./binary < stdin.stdin diff --git a/lxc/executors/java b/lxc/executors/java deleted file mode 100755 index c5effb6..0000000 --- a/lxc/executors/java +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -cd /tmp/$1 -cp code.code interim.java -timeout -s KILL 10 xargs -a args.args -d '\n' java interim.java < stdin.stdin diff --git a/lxc/executors/jelly b/lxc/executors/jelly deleted file mode 100755 index 6d83412..0000000 --- a/lxc/executors/jelly +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -cd /tmp/$1 -timeout -s KILL 3 xargs -a args.args -d '\n' jelly fu code.code < stdin.stdin diff --git a/lxc/executors/julia b/lxc/executors/julia deleted file mode 100755 index 1d4ba09..0000000 --- a/lxc/executors/julia +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -cd /tmp/$1 -timeout -s KILL 3 xargs -a args.args -d '\n' julia code.code < stdin.stdin diff --git a/lxc/executors/kotlin b/lxc/executors/kotlin deleted file mode 100755 index a144851..0000000 --- a/lxc/executors/kotlin +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -cd /tmp/$1 -cp code.code code.kt -kotlinc code.kt -include-runtime -d code.jar -timeout -s KILL 3 xargs -a args.args -d '\n' java -jar code.jar < stdin.stdin diff --git a/lxc/executors/lisp b/lxc/executors/lisp deleted file mode 100644 index d65e94a..0000000 --- a/lxc/executors/lisp +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -cd /tmp/$1 -timeout -s KILL 3 xargs -a args.args -d '\n' sbcl --script code.code < stdin.stdin diff --git a/lxc/executors/lua b/lxc/executors/lua deleted file mode 100755 index 7c50781..0000000 --- a/lxc/executors/lua +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -cd /tmp/$1 -timeout -s KILL 3 xargs -a args.args -d '\n' lua code.code < stdin.stdin diff --git a/lxc/executors/nasm b/lxc/executors/nasm deleted file mode 100755 index 8c9b13f..0000000 --- a/lxc/executors/nasm +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -cd /tmp/$1 -nasm -f elf32 -o binary.o code.code -ld -m elf_i386 binary.o -o binary -timeout -s KILL 3 xargs -a args.args -d '\n' ./binary < stdin.stdin diff --git a/lxc/executors/nasm64 b/lxc/executors/nasm64 deleted file mode 100755 index 44d8aa2..0000000 --- a/lxc/executors/nasm64 +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -cd /tmp/$1 -nasm -f elf64 -o binary.o code.code -ld -m elf_x86_64 binary.o -o binary -timeout -s KILL 3 xargs -a args.args -d '\n' ./binary < stdin.stdin diff --git a/lxc/executors/nim b/lxc/executors/nim deleted file mode 100644 index 51c1fee..0000000 --- a/lxc/executors/nim +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -cd /tmp/$1 -timeout -s KILL 10 nim --hints:off c code.code -timeout -s KILL 3 xargs -a args.args -d '\n' ./code diff --git a/lxc/executors/node b/lxc/executors/node deleted file mode 100755 index b69940b..0000000 --- a/lxc/executors/node +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -cd /tmp/$1 -timeout -s KILL 3 xargs -a args.args -d '\n' node code.code < stdin.stdin diff --git a/lxc/executors/osabie b/lxc/executors/osabie deleted file mode 100644 index cb66947..0000000 --- a/lxc/executors/osabie +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# osabie uses Elixir, which expects UTF-8 native encoding -export LC_ALL="en_US.UTF-8" - -# osabie will break if you try using it with xargs -cd /tmp/$1 -timeout -s KILL 3 osabie code.code < args.args diff --git a/lxc/executors/paradoc b/lxc/executors/paradoc deleted file mode 100755 index f4398a3..0000000 --- a/lxc/executors/paradoc +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -cd /tmp/$1 -export PYTHONPATH=$PYTHONPATH:/opt/paradoc -timeout -s KILL 3 python3.8 -m paradoc code.code < args.args diff --git a/lxc/executors/perl b/lxc/executors/perl deleted file mode 100755 index af78971..0000000 --- a/lxc/executors/perl +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -cd /tmp/$1 -timeout -s KILL 3 xargs -a args.args -d '\n' perl code.code < stdin.stdin diff --git a/lxc/executors/php b/lxc/executors/php deleted file mode 100755 index 5c37306..0000000 --- a/lxc/executors/php +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -cd /tmp/$1 -timeout -s KILL 3 xargs -a args.args -d '\n' php code.code < stdin.stdin diff --git a/lxc/executors/prolog b/lxc/executors/prolog deleted file mode 100755 index e5bb3ec..0000000 --- a/lxc/executors/prolog +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -cd /tmp/$1 - -sed 's/^.*$/:- forall((Goal = (\0), call(Goal)), (write(Goal), nl))./' input.input | - cat code.code - > code.pl - -timeout -s KILL 3 swipl -g true -t halt code.pl - diff --git a/lxc/executors/python2 b/lxc/executors/python2 deleted file mode 100755 index 54db44c..0000000 --- a/lxc/executors/python2 +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -cd /tmp/$1 -timeout -s KILL 3 xargs -a args.args -d '\n' python code.code < stdin.stdin diff --git a/lxc/executors/python3 b/lxc/executors/python3 deleted file mode 100755 index 9f4bd58..0000000 --- a/lxc/executors/python3 +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -cd /tmp/$1 -timeout -s KILL 3 xargs -a args.args -d '\n' python3.8 code.code < stdin.stdin diff --git a/lxc/executors/ruby b/lxc/executors/ruby deleted file mode 100755 index 7f64386..0000000 --- a/lxc/executors/ruby +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -cd /tmp/$1 -timeout -s KILL 3 xargs -a args.args -d '\n' ruby code.code < stdin.stdin diff --git a/lxc/executors/rust b/lxc/executors/rust deleted file mode 100755 index 56a7c02..0000000 --- a/lxc/executors/rust +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -cd /tmp/$1 -timeout -s KILL 10 rustc -o binary code.code -timeout -s KILL 3 xargs -a args.args -d '\n' ./binary < stdin.stdin diff --git a/lxc/executors/scala b/lxc/executors/scala deleted file mode 100755 index be9c27d..0000000 --- a/lxc/executors/scala +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -cd /tmp/$1 -cp code.code interim.scala -timeout -s KILL 10 xargs -a args.args -d '\n' scala interim.scala < stdin.stdin diff --git a/lxc/executors/swift b/lxc/executors/swift deleted file mode 100755 index 96c8830..0000000 --- a/lxc/executors/swift +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -cd /tmp/$1 -timeout -s KILL 3 xargs -a args.args -d '\n' swift code.code < stdin.stdin diff --git a/lxc/executors/typescript b/lxc/executors/typescript deleted file mode 100755 index b671996..0000000 --- a/lxc/executors/typescript +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -cd /tmp/$1 -mv code.code interim.ts -tsc interim.ts -rm -f interim.ts -mv interim.js code.code -timeout -s KILL 3 xargs -a args.args -d '\n' node code.code < stdin.stdin diff --git a/lxc/executors/zig b/lxc/executors/zig deleted file mode 100644 index bc2a971..0000000 --- a/lxc/executors/zig +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -cd /tmp/$1 -cp code.code main.zig -timeout -s KILL 10 zig build-exe main.zig && \ -timeout -s KILL 3 xargs -a args.args -d '\n' ./main diff --git a/lxc/shell b/lxc/shell deleted file mode 100755 index 080c0f5..0000000 --- a/lxc/shell +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -lxc-attach --clear-env -n piston diff --git a/lxc/start b/lxc/start deleted file mode 100755 index fec7aef..0000000 --- a/lxc/start +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -mkdir -p /var/lib/lxc/piston/rootfs/exec -rm -f /var/lib/lxc/piston/rootfs/exec/* -cp -f executors/* /var/lib/lxc/piston/rootfs/exec -chmod 555 /var/lib/lxc/piston/rootfs/exec/* -chown -R root:root /var/lib/lxc/piston/rootfs/exec - -lxc-start -n piston -d diff --git a/lxc/stop b/lxc/stop deleted file mode 100755 index 92e9f76..0000000 --- a/lxc/stop +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -lxc-stop -n piston -k diff --git a/lxc/tests/_run b/lxc/tests/_run deleted file mode 100755 index b166802..0000000 --- a/lxc/tests/_run +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/env bash - -echo -n 'testing awk = ' -../../cli/execute awk awk.awk -echo -n 'testing bash = ' -../../cli/execute bash bash.sh -echo -n 'testing c = ' -../../cli/execute c c.c -echo -n 'testing cpp = ' -../../cli/execute cpp cpp.cpp -echo -n 'testing crystal = ' -../../cli/execute crystal crystal.cr -echo -n 'testing csharp = ' -../../cli/execute csharp csharp.cs -echo -n 'testing d = ' -../../cli/execute d d.d -echo -n 'testing dash = ' -../../cli/execute dash dash.sh -echo -n 'testing deno = ' -../../cli/execute deno deno.ts -echo -n 'testing elixir = ' -../../cli/execute elixir elixir.exs -echo -n 'testing emacs = ' -../../cli/execute emacs emacs.el -echo -n 'testing go = ' -../../cli/execute go go.go -echo -n 'testing haskell = ' -../../cli/execute haskell haskell.hs -echo -n 'testing java = ' -../../cli/execute java java.java -echo -n 'testing jelly = ' -../../cli/execute jelly jelly.jelly good -echo -n 'testing julia = ' -../../cli/execute julia julia.jl -echo -n 'testing kotlin = ' -../../cli/execute kotlin kotlin.kt -echo -n 'testing lisp = ' -../../cli/execute lisp lisp.cl -echo -n 'testing nasm 32 bit = ' -../../cli/execute nasm nasm.nasm -echo -n 'testing nasm 64 bit = ' -../../cli/execute nasm64 nasm64.nasm -echo -n 'testing nim = ' -../../cli/execute nim nim.nim -echo -n 'testing node = ' -../../cli/execute node node.js -echo -n 'testing osabie = ' -../../cli/execute osabie osabie.abe -echo -n 'testing paradoc = ' -../../cli/execute bash paradoc.sh -echo -n 'testing perl = ' -../../cli/execute perl perl.pl -echo -n 'testing php = ' -../../cli/execute php php.php -echo -n 'testing prolog = ' -../../cli/execute prolog prolog.pl -echo -n 'testing python2 = ' -../../cli/execute python2 python2.py -echo -n 'testing python3 = ' -../../cli/execute python3 python3.py -echo -n 'testing ruby = ' -../../cli/execute ruby ruby.rb -echo -n 'testing rust = ' -../../cli/execute rust rust.rs -echo -n 'testing scala = ' -../../cli/execute scala scala.scala -echo -n 'testing swift = ' -../../cli/execute swift swift.swift -echo -n 'testing typescript = ' -../../cli/execute typescript typescript.ts -echo -n 'testing zig = ' -../../cli/execute zig zig.zig diff --git a/lxc/tests/awk.awk b/lxc/tests/awk.awk deleted file mode 100644 index 7c89842..0000000 --- a/lxc/tests/awk.awk +++ /dev/null @@ -1 +0,0 @@ -BEGIN{ print "good" } diff --git a/lxc/tests/bash.sh b/lxc/tests/bash.sh deleted file mode 100644 index f2f0102..0000000 --- a/lxc/tests/bash.sh +++ /dev/null @@ -1 +0,0 @@ -echo 'good' diff --git a/lxc/tests/c.c b/lxc/tests/c.c deleted file mode 100644 index 1ff459d..0000000 --- a/lxc/tests/c.c +++ /dev/null @@ -1,5 +0,0 @@ -#include - -void main(void) { - printf("good\n"); -} diff --git a/lxc/tests/cpp.cpp b/lxc/tests/cpp.cpp deleted file mode 100644 index 2bad760..0000000 --- a/lxc/tests/cpp.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include - -int main(void) { - printf("good\n"); - return 0; -} diff --git a/lxc/tests/crystal.cr b/lxc/tests/crystal.cr deleted file mode 100644 index 1af2472..0000000 --- a/lxc/tests/crystal.cr +++ /dev/null @@ -1 +0,0 @@ -puts "good" diff --git a/lxc/tests/csharp.cs b/lxc/tests/csharp.cs deleted file mode 100644 index bc4d225..0000000 --- a/lxc/tests/csharp.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; - -namespace HelloWorld { - class Hello { - static void Main() { - Console.WriteLine("good"); - } - } -} diff --git a/lxc/tests/d.d b/lxc/tests/d.d deleted file mode 100644 index e46985a..0000000 --- a/lxc/tests/d.d +++ /dev/null @@ -1,5 +0,0 @@ -import std.stdio; - -void main() { - writeln("good"); -} diff --git a/lxc/tests/dash.sh b/lxc/tests/dash.sh deleted file mode 100644 index f2f0102..0000000 --- a/lxc/tests/dash.sh +++ /dev/null @@ -1 +0,0 @@ -echo 'good' diff --git a/lxc/tests/deno.ts b/lxc/tests/deno.ts deleted file mode 100644 index 868450a..0000000 --- a/lxc/tests/deno.ts +++ /dev/null @@ -1 +0,0 @@ -console.log('good') \ No newline at end of file diff --git a/lxc/tests/elixir.exs b/lxc/tests/elixir.exs deleted file mode 100644 index 4c8d8b0..0000000 --- a/lxc/tests/elixir.exs +++ /dev/null @@ -1 +0,0 @@ -IO.puts("good") diff --git a/lxc/tests/emacs.el b/lxc/tests/emacs.el deleted file mode 100644 index 2c2a402..0000000 --- a/lxc/tests/emacs.el +++ /dev/null @@ -1 +0,0 @@ -(message "good") diff --git a/lxc/tests/go.go b/lxc/tests/go.go deleted file mode 100644 index 7304cc2..0000000 --- a/lxc/tests/go.go +++ /dev/null @@ -1,7 +0,0 @@ -package main - -import "fmt" - -func main() { - fmt.Println("good") -} diff --git a/lxc/tests/haskell.hs b/lxc/tests/haskell.hs deleted file mode 100644 index 4c4a8c3..0000000 --- a/lxc/tests/haskell.hs +++ /dev/null @@ -1 +0,0 @@ -main = putStrLn "good" diff --git a/lxc/tests/java.java b/lxc/tests/java.java deleted file mode 100644 index ca376fd..0000000 --- a/lxc/tests/java.java +++ /dev/null @@ -1,5 +0,0 @@ -public class HelloWorld { - public static void main(String[] args) { - System.out.println("good"); - } -} diff --git a/lxc/tests/jelly.jelly b/lxc/tests/jelly.jelly deleted file mode 100644 index 77a1774..0000000 --- a/lxc/tests/jelly.jelly +++ /dev/null @@ -1 +0,0 @@ -³ diff --git a/lxc/tests/julia.jl b/lxc/tests/julia.jl deleted file mode 100644 index 3bfd06e..0000000 --- a/lxc/tests/julia.jl +++ /dev/null @@ -1 +0,0 @@ -println("good") diff --git a/lxc/tests/kotlin.kt b/lxc/tests/kotlin.kt deleted file mode 100644 index 1e0df2c..0000000 --- a/lxc/tests/kotlin.kt +++ /dev/null @@ -1,3 +0,0 @@ -fun main() { - println("good") -} diff --git a/lxc/tests/lisp.cl b/lxc/tests/lisp.cl deleted file mode 100644 index 77b5dc7..0000000 --- a/lxc/tests/lisp.cl +++ /dev/null @@ -1 +0,0 @@ -(write-line "good") diff --git a/lxc/tests/nasm.nasm b/lxc/tests/nasm.nasm deleted file mode 100644 index 8570909..0000000 --- a/lxc/tests/nasm.nasm +++ /dev/null @@ -1,16 +0,0 @@ -SECTION .DATA -good: db 'good',10 -txtlen: equ $-good - -SECTION .TEXT -GLOBAL _start - -_start: -mov eax,4 -mov ebx,1 -mov ecx,good -mov edx,txtlen -int 80h -mov eax,1 -mov ebx,0 -int 80h diff --git a/lxc/tests/nasm64.nasm b/lxc/tests/nasm64.nasm deleted file mode 100644 index fbc5aef..0000000 --- a/lxc/tests/nasm64.nasm +++ /dev/null @@ -1,18 +0,0 @@ -SECTION .data - good: db "good", 0x0 - txtlen: equ $ - good - -SECTION .text -GLOBAL _start - -_start: - ;sys_write - mov rax, 1 - mov rdi, 1 - mov rsi, good - mov rdx, txtlen - syscall - ;sys_exit - mov rax, 60 - mov rdi, 0 - syscall diff --git a/lxc/tests/nim.nim b/lxc/tests/nim.nim deleted file mode 100644 index bd50e25..0000000 --- a/lxc/tests/nim.nim +++ /dev/null @@ -1 +0,0 @@ -echo("good") diff --git a/lxc/tests/node.js b/lxc/tests/node.js deleted file mode 100644 index 847245f..0000000 --- a/lxc/tests/node.js +++ /dev/null @@ -1 +0,0 @@ -console.log('good') diff --git a/lxc/tests/osabie.abe b/lxc/tests/osabie.abe deleted file mode 100644 index 0508ea0..0000000 --- a/lxc/tests/osabie.abe +++ /dev/null @@ -1 +0,0 @@ -"good \ No newline at end of file diff --git a/lxc/tests/paradoc.sh b/lxc/tests/paradoc.sh deleted file mode 100644 index 5f70e1c..0000000 --- a/lxc/tests/paradoc.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash -# add paradoc module to python python -export PYTHONPATH=$PYTHONPATH:/opt/paradoc -# file for test code -test_code=/tmp/paradoc.test -# save test code to file -echo -n iP>$test_code -# pass param to paradoc module and have it print it -echo good | python3.8 -m paradoc $test_code -# clean test code -rm -f $test_code diff --git a/lxc/tests/perl.pl b/lxc/tests/perl.pl deleted file mode 100644 index 89d8636..0000000 --- a/lxc/tests/perl.pl +++ /dev/null @@ -1 +0,0 @@ -print "good\n"; diff --git a/lxc/tests/php.php b/lxc/tests/php.php deleted file mode 100644 index c506f3b..0000000 --- a/lxc/tests/php.php +++ /dev/null @@ -1,3 +0,0 @@ -&1 | grep kotlin" -echo '---' - -echo 'lisp' -lxc-attach --clear-env -n piston -- /bin/bash -l -c "sbcl --version" -echo '---' - -echo 'lua' -lxc-attach --clear-env -n piston -- /bin/bash -l -c "lua -v" -echo '---' - -echo 'nasm' -lxc-attach --clear-env -n piston -- /bin/bash -l -c "nasm -version" -echo '---' - -echo 'nasm64' -lxc-attach --clear-env -n piston -- /bin/bash -l -c "nasm -version" -echo '---' - -echo 'nim' -lxc-attach --clear-env -n piston -- /bin/bash -l -c "nim -v" -echo '---' - -echo 'node' -lxc-attach --clear-env -n piston -- /bin/bash -l -c "node --version" -echo '---' - -echo 'perl' -lxc-attach --clear-env -n piston -- /bin/bash -l -c "perl --version | grep x86" -echo '---' - -echo 'php' -lxc-attach --clear-env -n piston -- /bin/bash -l -c "php -v" -echo '---' - -echo 'prolog' -lxc-attach --clear-env -n piston -- /bin/bash -l -c "swipl --version" -echo '---' - -echo 'python2' -lxc-attach --clear-env -n piston -- /bin/bash -l -c "python -V" -echo '---' - -echo 'python3' -lxc-attach --clear-env -n piston -- /bin/bash -l -c "python3.8 -V" -echo '---' - -echo 'paradoc' -lxc-attach --clear-env -n piston -- /bin/bash -l -c "python3.8 -m paradoc --version" -echo '---' - -echo 'ruby' -lxc-attach --clear-env -n piston -- /bin/bash -l -c "ruby --version" -echo '---' - -echo 'rust' -lxc-attach --clear-env -n piston -- /bin/bash -l -c "rustc --version" -echo '---' - -echo 'scala' -lxc-attach --clear-env -n piston -- /bin/bash -l -c "scala -version" -echo '---' - -echo 'swift' -lxc-attach --clear-env -n piston -- /bin/bash -l -c "swift --version" -echo '---' - -echo 'typescript' -lxc-attach --clear-env -n piston -- /bin/bash -l -c "tsc --version" -echo '---' - -echo 'zig' -lxc-attach --clear-env -n piston -- /bin/bash -l -c "zig version" -echo '---' - -echo 'osabie' -echo '1.0.1' -echo '---' diff --git a/readme.md b/readme.md deleted file mode 100644 index ea4c0e9..0000000 --- a/readme.md +++ /dev/null @@ -1,323 +0,0 @@ -

- engineer-man piston - Piston -

- -

A high performance general purpose code execution engine.

-
- -

- - GitHub last commit - - GitHub issues - - GitHub pull requests -

- ---- - -

- About • - Public API • - Getting Started • - Usage • - Supported Languages • - Principles • - Security • - License -

- ---- -
- -# About - -

-Piston is a high performance general purpose code execution engine. It excels at running untrusted and -possibly malicious code without fear from any harmful effects. -

-
- -It's used in numerous places including: -* [EMKC Challenges](https://emkc.org/challenges), -* [EMKC Weekly Contests](https://emkc.org/contests), -* [Engineer Man Discord Server](https://discord.gg/engineerman), -* [I Run Code (Discord Bot)](https://github.com/engineer-man/piston-bot) bot as well as 1300+ other servers -and 100+ direct integrations. - -To get it in your own server, go here: https://emkc.org/run. - -
- -# Public API - -- Requires no installation and you can use it immediately. -- Reference the Versions/Execute sections below to learn about the request and response formats. - -
- -When using the public Piston API, use the base URL: - -``` -https://emkc.org/api/v1/piston -``` - -#### GET -``` -https://emkc.org/api/v1/piston/versions -``` -#### POST -``` -https://emkc.org/api/v1/piston/execute -``` - -> Important Note: The Piston API is rate limited to 5 requests per second. If you have a need for more requests than that -and it's for a good cause, please reach out to me (EngineerMan#0001) on [Discord](https://discord.gg/engineerman) -so we can discuss potentially getting you an unlimited key. - -
- -# Getting Started - -### Host System Package Dependencies - -* NodeJS -* lxc -* libvirt - -
- -If your OS is not documented below, please open pull requests with the correct commands for your OS. - -
-CentOS / RHEL - -```sh -curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash -nvm install --lts -nvm use --lts - -yum install -y epel-release -yum install -y lxc lxc-templates debootstrap libvirt -systemctl start libvirtd -``` -
- -
-Ubuntu (18.04) - -```sh -curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash -nvm install --lts -nvm use --lts - -apt install -y lxc lxc-templates debootstrap libvirt0 -``` -
- -
-Arch Linux - -```sh -curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash -nvm install --lts -nvm use --lts - -pacman -S lxc libvirt unzip -``` -
- -#### After system dependencies are installed, clone this repository: - -```sh -# clone and enter repo -git clone https://github.com/engineer-man/piston -``` - -#### Installation (simple) - -- Install additional dependencies python3, pip and distrobuilder -- `cd container && ./build.sh` -- Wait, it may take up to an hour. -- `lxc-create -n piston -t local -- --metadata meta.tar.xz --fstree rootfs.tar.xz` -- `cd lxc && ./start` -- Good to go! - - -#### Installation (advanced) - -- See `var/install.txt` for how to build the container manually - -#### CLI Usage -- `cli/execute [language] [file path] [args]` -
- -# Usage - -### CLI - -```sh -lxc/execute [language] [file path] [args] -``` - -### API -To use the API, it must first be started. Please note that if root is required to access -LXC then the API must also be running as root. To start the API, run the following: - -``` -cd api -./start -``` - -For your own local installation, the API is available at: - -``` -http://127.0.0.1:2000 -``` - -#### Versions Endpoint -`GET /versions` -This endpoint will return the supported languages along with the current version and aliases. To execute -code for a particular language using the `/execute` endpoint, either the name or one of the aliases must -be provided. -```json -HTTP/1.1 200 OK -Content-Type: application/json - -[ - { - "name": "awk", - "aliases": ["awk"], - "version": "1.3.3" - }, - { - "name": "bash", - "aliases": ["bash"], - "version": "4.4.20" - }, - { - "name": "c", - "aliases": ["c"], - "version": "7.5.0" - } -] -``` - -#### Execute Endpoint -`POST /execute` -This endpoint requests execution of some arbitrary code. -- `language` (**required**) The language to use for execution, must be a string and supported by Piston (see list below). -- `source` (**required**) The source code to execute, must be a string. -- `stdin` (*optional*) The text to pass as stdin to the program. Must be a string or left out of the request. -- `args` (*optional*) The arguments to pass to the program. Must be an array or left out of the request. -```json -{ - "language": "js", - "source": "console.log(process.argv)", - "stdin": "", - "args": [ - "1", - "2", - "3" - ] -} -``` -A typical response upon successful execution will contain the `language`, `version`, `output` which -is a combination of both `stdout` and `stderr` but in chronological order according to program output, -as well as separate `stdout` and `stderr`. -```json -HTTP/1.1 200 OK -Content-Type: application/json - -{ - "ran": true, - "language": "js", - "version": "12.13.0", - "output": "[ '/usr/bin/node',\n '/tmp/code.code',\n '1',\n '2',\n '3' ]", - "stdout": "[ '/usr/bin/node',\n '/tmp/code.code',\n '1',\n '2',\n '3' ]", - "stderr": "" -} -``` -If a problem exists with the request, a `400` status code is returned and the reason in the `message` key. -```json -HTTP/1.1 400 Bad Request -Content-Type: application/json - -{ - "message": "Supplied language is not supported by Piston" -} -``` - -
- -# Supported Languages -`awk`, -`bash`, -`brainfuck`, -`c`, -`cpp`, -`crystal`, -`csharp`, -`d`, -`dash`, -`deno`, -`elixir`, -`emacs`, -`elisp`, -`go`, -`haskell`, -`java`, -`jelly`, -`julia`, -`kotlin`, -`lisp`, -`lua`, -`nasm`, -`nasm64`, -`nim`, -`node`, -`osabie`, -`paradoc`, -`perl`, -`php`, -`python2`, -`python3`, -`ruby`, -`rust`, -`scala`, -`swift`, -`typescript`, -`zig`, - -
- -# Principle of Operation -Piston utilizes LXC as the primary mechanism for sandboxing. There is a small API written in Node which takes -in execution requests and executes them in the container. High level, the API writes -a temporary source and args file to `/tmp` and that gets mounted read-only along with the execution scripts into the container. -The source file is either ran or compiled and ran (in the case of languages like c, c++, c#, go, etc.). - -
- -# Security -LXC provides a great deal of security out of the box in that it's separate from the system. -Piston takes additional steps to make it resistant to -various privilege escalation, denial-of-service, and resource saturation threats. These steps include: -- Disabling outgoing network interaction -- Capping max processes at 64 (resists `:(){ :|: &}:;`, `while True: os.fork()`, etc.) -- Capping max files at 2048 (resists various file based attacks) -- Mounting all resources read-only (resists `sudo rm -rf --no-preserve-root /`) -- Cleaning up all temp space after each execution (resists out of drive space attacks) -- Running as a variety of unprivileged users -- Capping runtime execution at 3 seconds -- Capping stdout to 65536 characters (resists yes/no bombs and runaway output) -- SIGKILLing misbehaving code - -
- -# License -Piston is licensed under the MIT license. diff --git a/var/benchmark.txt b/var/benchmark.txt deleted file mode 100644 index f7f20c3..0000000 --- a/var/benchmark.txt +++ /dev/null @@ -1,12 +0,0 @@ -ab -c 30 -n 1000 \ - https://emkc.org/api/v1/piston/versions - -ab -c 30 -n 1000 \ - -p benchmark_payload.txt \ - -T 'application/json' \ - https://emkc.org/api/v1/piston/execute - - -time for i in {1..100}; do - timeout -s KILL 3 lxc-attach --clear-env -n piston -- /bin/bash -l -c "runuser runner1 /bin/bash -c 'ls -l '" -done diff --git a/var/benchmark_payload.txt b/var/benchmark_payload.txt deleted file mode 100644 index 389cbbc..0000000 --- a/var/benchmark_payload.txt +++ /dev/null @@ -1,6 +0,0 @@ -{ - "language": "python", - "source": "print('test')", - "stdin": "", - "args": [] -} diff --git a/var/install.txt b/var/install.txt deleted file mode 100644 index 396cbae..0000000 --- a/var/install.txt +++ /dev/null @@ -1,14 +0,0 @@ -# create and start container -lxc-create -t download -n piston -- --dist ubuntu --release bionic --arch amd64 -./start - -# open a shell to the container -./shell - -# run everything located in container/install.sh - -# leave container -exit - -# optionally run tests -./test_all_lxc diff --git a/var/notes.txt b/var/notes.txt deleted file mode 100644 index 7767b8b..0000000 --- a/var/notes.txt +++ /dev/null @@ -1,24 +0,0 @@ -# make piston image -lxc-clone -KMP /mnt/piston_image piston piston -sed -i 's/\/mnt\/piston_image/\/var\/lib\/lxc/' piston/config -tar -czf piston.tar.gz piston/ - -# restore piston image -cd /var/lib/lxc -tar -xzf piston.tar.gz - - - - - -``` -# get piston image -cd /var/lib/lxc -wget whatever url -tar -xzf piston.tar.gz -sed -i "s/virtbr0/$(ip a | grep br0: | cut -d' ' -f2 | sed 's/://gi')/" piston/config - -# start piston -cd /path/to/piston/lxc -./start -``` diff --git a/var/piston.service b/var/piston.service deleted file mode 100644 index 87ac487..0000000 --- a/var/piston.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=Piston - -[Service] -Type=simple -User=root -Environment=PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/local/go/bin -WorkingDirectory=/root/piston/api -ExecStart=/root/piston/api/start -Restart=on-failure - -[Install] -WantedBy=multi-user.target