From c5f3305c233ecc0965a0ce47a0c3ab910dae3dac Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Thu, 18 Feb 2021 18:32:26 +1300 Subject: [PATCH 001/385] 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 From 84c627d1df940c934913c975baf6d99bd0663f0f Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Thu, 18 Feb 2021 19:59:49 +1300 Subject: [PATCH 002/385] add basic architecture --- ARCHITECTURE.TXT | 71 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 ARCHITECTURE.TXT diff --git a/ARCHITECTURE.TXT b/ARCHITECTURE.TXT new file mode 100644 index 0000000..db212dc --- /dev/null +++ b/ARCHITECTURE.TXT @@ -0,0 +1,71 @@ +== Breif == + +This document covers the overall architecture of Piston v3, and not the +individual components and their implementations. + +In Piston v2 we saw 2 ways of using piston - through the CLI and the API. +These 2 methods would call the same load of bash scripts contained within +a LXC container which would then resolve your request. +There are a number of issues with this approach: + 1. This uses bash - which isn't the best language for performance + 2. It relied on calling through a `lxc-attach` command to access + inside the container + 3. This isn't easy to distribute + 4. It was difficult to add languages - having to edit 4 different files + in 4 different places to add a single language + +Piston v3 aims to tackle these 4 issues. +Firstly, v3 will be less reliant on bash, only using it as an option +for running different interpreters. +Secondly, v3 can run on bare-metal or in a container, but a core API will be +exposed from within the container, instead of running external to it. +Thirdly, v3 will provide a simple docker container, which will expose both the +piston API, and run all the runners within it. +Finally, v3 will provide a repository of precompiled language executers, so its +1 command away from installing a language + + + +== Piston API == + +Piston v3 exposes a REST API, allowing the user to control the entire thing +over one simple JSON based protocol. This eliminates the need to connect into +the container to do maintainace such as adding new languages, or checking +usage statistics. + +See design/api.txt for more information. + + + +== Package Manager == + +Piston v3 includes a package manager right out of the box. The package manager +manages the different languages and versions that it can run. +The package manager is hooked directly into the API and addresses our point +of easy distibution, as users now can easily enable/disable different +components built into piston as they see fit. + +See design/ppman.txt for more information. + + + +== Runtime Environment == + +The new architecture moves to a more bare-metal approach, where the code can be +run without the overhead of a container manager such as LXC or Docker, making +piston much easier to manage this way + +It is still possible to run Piston v3 in a contain, but now a container engine +is not required for usage, however it is still recommended. + + + +== Proxy API == + +The in-container API is more powerful than a simple execution API and thus +should be limited, however to keep the weight down, and speed up there is a +reference implementation of a proxy API included, which passes through +execution commands to many different piston instances and allows for +security with rate limiting and API keys. + +See design/proxy.txt \ No newline at end of file From 30426d0d96172a7e537121ba585dda4d414f89b2 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Thu, 18 Feb 2021 21:44:53 +1300 Subject: [PATCH 003/385] remove gitignore until we need it --- .gitignore | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 .gitignore diff --git a/.gitignore b/.gitignore deleted file mode 100644 index ba11e62..0000000 --- a/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -api/api -api/package-lock.json -lxc/i -lxc/lockfile -container/build.yaml -container/*.tar.xz -node_modules \ No newline at end of file From 3103721c8e2f554448ec116cbc1c4e7247dba50e Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Thu, 18 Feb 2021 23:09:16 +1300 Subject: [PATCH 004/385] design pt1 --- ARCHITECTURE.TXT | 2 +- design/api.txt | 75 ++++++++++++++++++++++++++++++++++++++++++++++++ design/index.txt | 13 +++++++++ design/ppman.txt | 74 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 163 insertions(+), 1 deletion(-) create mode 100644 design/api.txt create mode 100644 design/index.txt create mode 100644 design/ppman.txt diff --git a/ARCHITECTURE.TXT b/ARCHITECTURE.TXT index db212dc..edf52d3 100644 --- a/ARCHITECTURE.TXT +++ b/ARCHITECTURE.TXT @@ -1,4 +1,4 @@ -== Breif == +== Breif == [ Piston ] This document covers the overall architecture of Piston v3, and not the individual components and their implementations. diff --git a/design/api.txt b/design/api.txt new file mode 100644 index 0000000..a9e7e63 --- /dev/null +++ b/design/api.txt @@ -0,0 +1,75 @@ +== Piston API == [ Piston ] + +When we speak of piston, what we actually talk about is the Piston API. +This API provides unrestricted, unlimited access to managing piston and +thus shouldn't be publicly exposed. This API is comparable to one of the +docker engine, where everything regarding control of docker goes directly +through the api. + +The API is responsible for managing the execution lifecycle of any given +job, as well as managing the different languages which it can execute a +job in. + + + +== Job Execution == + +Piston v3 exposes an endpoint per package `/execute`, which when called takes +in both a string of code, and an array of arguments to pass into the program +as well as data to write to STDIN. The stdout and stderr from the process are +then both returned seperately, along with the error code returned. + +All of this is has no rate-limiting built in making it lightning fast as a call +will directly start the runner process and get under way instantly. + +The 2 stages of this process - compile and run are both run in sequence, with +different timeouts configurable in the runners config file located in the +data directory. + +Requests to this endpoint can have caching enabled at 3 different levels. +The first option is to have no caching, which is the default for all +interpreted language. The second option is for the compiled binaries to be +cached, which is the default for all compiled languages. The final option is +for output to be cached, which isn't used by default but can be enabled per +package or per request. This is done for the reason that code may choose to +source data from /dev/(u)random or similar sources and as such may not be as +reliable when their outputs are cached. Caching is per package and is used as +an acceleration method to help boost performance of Piston. Cache entries are +automatically purged after the set time, or can be manually purged through the +API on a per package basis. + + +== Package Manager == + +Piston v3 has an inbuilt package manager which is responsible for +(un)installing different packages. Piston v3 by default has access to a single +offical repository hosting various versions of various common languages. These +packages and repositories conform to the specifications set out in ppman.txt + +The Piston API service downloads the repository index whenever a `/packages` +request is issued to a repository with the `sync` flag is set. This will cause +the service to download the latest repostiory index off the mirror. + +In piston there is no concept of a package being "outdated" as each package is +a specific version of a language, and different languages can be installed in +paralleland function without any issues. Each package should be considered the +final version of that language. If there is a new version of a language +available (i.e. Python 3.9.1 -> 3.9.2), a new package should be created for +this. + +Invidual languages can be queried from the repo using the +`/repos/{repo}/packages/{package}/{package-version}` endpoint. This endpoint +allows for the metadata of the package to be accessed, such as the author, +size, checksums, dependencies, build file git url and download url. + +To install packages, a request to `/install` can be made to the package +endpoint and it will download and install it, making it available on the +`/packages/{package}/{version}` endpoint. + +There is a meta-repository name `all` which can be used to access all +repositories. + +Internally the install process involved downloading and unpacking the package, +ensuring any dependencies are also downloaded and installed, mounting the +squashfs filesystem to a folder, then overlaying it with all its dependencies +in another folder. diff --git a/design/index.txt b/design/index.txt new file mode 100644 index 0000000..685222a --- /dev/null +++ b/design/index.txt @@ -0,0 +1,13 @@ +== Index == [ Piston ] + +Design outlines the design of the different components and does not give a +concrete definition of the implementation or how to use it. + +api.txt Design of Piston API +ppman.txt Design of the package manager's package and repository format + + +== Glossary == + +Execution Job A single code run with arguments resulting in an output +Package A version of a language bundled together into a tarball \ No newline at end of file diff --git a/design/ppman.txt b/design/ppman.txt new file mode 100644 index 0000000..7721ebd --- /dev/null +++ b/design/ppman.txt @@ -0,0 +1,74 @@ +== Package Manager (ppman) == [ Piston ] + +The package manager is the part of the API responsible for managing different +versions of different languages, managing their installation, uninstallation +and their dependencies. The package manager talks over the piston api and is +built directly into piston, although has parts which are not directly built +into the API (i.e. the repositories and the cli utility). + +The package manager is a complex part of piston, and requires 2 different file +specifications - the repository index file and the package file. + + + +== Repository Index File == + +The piston repository is the central place where packages are hosted and +downloaded from. This repository can either be a webserver or a local file +containing the right content - as long as its accessable by a URL, its +considered a valid repository by piston. A repository URL is simply a URL +pointing to a repository index file, as set out by the following information. + +A repository index file is a YAML file containing the keys: `schema`, `baseurl` +and `packages`. + +The schema key simply should have a value of `ppman-repo-1`. This indicates the +version and file format for the client to recieve. + +The baseurl key contains the base url that relative URLs should be based off, +this doesn't need to be related to the url that the repository index is hosted +at, only the downloadable files, which are possible to split over many domains +by using absolute paths. + +The packages key contains a list of packages, which contain the keys: `author`, +`language`, `version`, `checksums`, `dependencies`, `size`, `buildfile` and +`download`. + +The author field is self explainatory, it is simply the authors name and email, +formatted similar to git's default format: `Full Name `. If the +repository index is automatically generated, it is best to use the commit +author's name in here. + +The language and version fields define the version and name of the compiler or +interpreter contained within. The language should not include a version at all. +In the case of python, use the name python for both python 2 and 3, using the +version field to differentiate between the 2. + +The checksums field is simply a map of hash types to hashes, hash types include +md5, sha1, sha256, sha512. The digests should simply be written as lowercase +hex characters. Only one checksum is required, but if more are supplied the +most secure one is picked, with sha512 as the highest possible. + +The dependencies is simply a map of language names to versions, which should be +installed for the package to run correctly. An example of this would be +typescript requires node to run. + +The size field is the number of bytes the package file is in size, while +uncompressed. This is used to determine if there is enough room, and thus +should be accurate. + +The buildfile field is a URL pointing to the exact build script for this build. +This should always point to a URL either containing steps, a script or other +means of reproducing the build. This field is purely so people can understand +how the image was built, and to make sure you aren't packing any mallicious +code into it. + +The final field is download, this points to a URL of which the package file can +be obtained from. If this is a relative url, the baseurl will be appended to +it. This is particularly useful if everything is stored within 1 s3 bucket, or +you have a repository in a folder. + + +== Package File == + +TODO \ No newline at end of file From d57b1f0fd4b9a72345bab8d3bc92d50cc634e436 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Fri, 19 Feb 2021 16:09:56 +1300 Subject: [PATCH 005/385] Python Package example --- packages/Makefile | 22 ++++++++++++++++++++++ packages/python/3.9.1/Makefile | 17 +++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 packages/Makefile create mode 100644 packages/python/3.9.1/Makefile diff --git a/packages/Makefile b/packages/Makefile new file mode 100644 index 0000000..56fba4f --- /dev/null +++ b/packages/Makefile @@ -0,0 +1,22 @@ +LANG_NAME=$(or ${NAME},none) +LANG_VERSION=$(or ${VERSION},0.0.0) +LANG_AUTHOR=$(or ${AUTHOR},HexF ) +LANG_DEPS=$(or ${DEPS}) +LANG_BINARY_FILES=$(or ${BINARY_FILES},) + +${LANG_NAME}-${LANG_VERSION}.pkg.tar.gz: pkg-info.json package.squashfs + tar czvf $@ $* + +package.squashfs: ${LANG_BINARY_FILES} + mksquashfs $* $@ + +%.json: %.jq + jq '$(shell tr '\n' '|' < $<).' <<< "{}" > $@ + +pkg-info.jq: + echo '.language="${LANG_NAME}"' > pkg-info.jq + echo '.version="${LANG_VERSION}"' >> pkg-info.jq + echo '.author="${LANG_AUTHOR}"' >> pkg-info.jq + echo '.dependencies={}' >> pkg-info.jq + $(foreach dep, ${LANG_DEPS}, echo '.dependencies.$(word 1,$(subst =, ,${dep}))="$(word 2,$(subst =, ,${dep}))"' >> pkg-info.jq) + diff --git a/packages/python/3.9.1/Makefile b/packages/python/3.9.1/Makefile new file mode 100644 index 0000000..ebfa3fe --- /dev/null +++ b/packages/python/3.9.1/Makefile @@ -0,0 +1,17 @@ +NAME=python +VERSION=3.9.1 +AUTHOR=Thomas Hobson +DEPS= +BINARY_FILES= + +include ../../Makefile + +bin: + +Python-${VERSION}.tgz: + curl "https://www.python.org/ftp/python/${VERSION}/Python-${VERSION}.tgz" -O $@ + +%: %.tgz + tar xzvf $@ + + From e2c8427a7ae33ef284026c50cef6dfd94a9c3762 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Fri, 19 Feb 2021 16:48:46 +1300 Subject: [PATCH 006/385] Python 3.9.1 Package --- packages/.gitignore | 3 +++ packages/Makefile | 8 ++++++-- packages/python/3.9.1/Makefile | 18 +++++++++++++----- 3 files changed, 22 insertions(+), 7 deletions(-) create mode 100644 packages/.gitignore diff --git a/packages/.gitignore b/packages/.gitignore new file mode 100644 index 0000000..022537b --- /dev/null +++ b/packages/.gitignore @@ -0,0 +1,3 @@ +* +!Makefile +!.gitignore \ No newline at end of file diff --git a/packages/Makefile b/packages/Makefile index 56fba4f..52345bc 100644 --- a/packages/Makefile +++ b/packages/Makefile @@ -5,10 +5,10 @@ LANG_DEPS=$(or ${DEPS}) LANG_BINARY_FILES=$(or ${BINARY_FILES},) ${LANG_NAME}-${LANG_VERSION}.pkg.tar.gz: pkg-info.json package.squashfs - tar czvf $@ $* + tar czvf $@ $? package.squashfs: ${LANG_BINARY_FILES} - mksquashfs $* $@ + mksquashfs $? $@ %.json: %.jq jq '$(shell tr '\n' '|' < $<).' <<< "{}" > $@ @@ -20,3 +20,7 @@ pkg-info.jq: echo '.dependencies={}' >> pkg-info.jq $(foreach dep, ${LANG_DEPS}, echo '.dependencies.$(word 1,$(subst =, ,${dep}))="$(word 2,$(subst =, ,${dep}))"' >> pkg-info.jq) +.PHONY: clean +clean: + rm -rf $(filter-out Makefile, $(wildcard *)) + \ No newline at end of file diff --git a/packages/python/3.9.1/Makefile b/packages/python/3.9.1/Makefile index ebfa3fe..d77b69a 100644 --- a/packages/python/3.9.1/Makefile +++ b/packages/python/3.9.1/Makefile @@ -2,16 +2,24 @@ NAME=python VERSION=3.9.1 AUTHOR=Thomas Hobson DEPS= -BINARY_FILES= +BINARY_FILES=out/ run + +MAKE_JOBS=64 include ../../Makefile -bin: +run: + echo "bin/python3.9 $*" > run + +out/: Python-${VERSION}/ + cd $< && ./configure --prefix / + make -j${MAKE_JOBS} -C $< + DESTDIR=../out make -j${MAKE_JOBS} -C $< altinstall Python-${VERSION}.tgz: - curl "https://www.python.org/ftp/python/${VERSION}/Python-${VERSION}.tgz" -O $@ + curl "https://www.python.org/ftp/python/${VERSION}/Python-${VERSION}.tgz" -o $@ -%: %.tgz - tar xzvf $@ +%/: %.tgz + tar xzvf $< From 36102f22b4ce36cc6ec7a455754549e5c12f431c Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Fri, 19 Feb 2021 17:32:35 +1300 Subject: [PATCH 007/385] Python 3.9.1 Package (but better) --- packages/.gitignore | 2 +- packages/Makefile | 12 +++++++----- packages/python/3.9.1/Makefile | 13 ++++++++----- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/packages/.gitignore b/packages/.gitignore index 022537b..a9f5c08 100644 --- a/packages/.gitignore +++ b/packages/.gitignore @@ -1,3 +1,3 @@ * -!Makefile +!**/Makefile !.gitignore \ No newline at end of file diff --git a/packages/Makefile b/packages/Makefile index 52345bc..51218a8 100644 --- a/packages/Makefile +++ b/packages/Makefile @@ -2,14 +2,16 @@ LANG_NAME=$(or ${NAME},none) LANG_VERSION=$(or ${VERSION},0.0.0) LANG_AUTHOR=$(or ${AUTHOR},HexF ) LANG_DEPS=$(or ${DEPS}) -LANG_BINARY_FILES=$(or ${BINARY_FILES},) +LANG_COMPILED=$(or ${COMPILED}, false) -${LANG_NAME}-${LANG_VERSION}.pkg.tar.gz: pkg-info.json package.squashfs +LANG_PKG_TARGETS=pkg-info.json ${LANG_NAME}-${LANG_VERSION}/ ${LANG_NAME}-${LANG_VERSION}/environment run + +ifeq (${LANG_COMPILED}, true) +${LANG_NAME}-${LANG_VERSION}.pkg.tar.gz: $(LANG_PKG_TARGETS) compile +endif +${LANG_NAME}-${LANG_VERSION}.pkg.tar.gz: $(LANG_PKG_TARGETS) tar czvf $@ $? -package.squashfs: ${LANG_BINARY_FILES} - mksquashfs $? $@ - %.json: %.jq jq '$(shell tr '\n' '|' < $<).' <<< "{}" > $@ diff --git a/packages/python/3.9.1/Makefile b/packages/python/3.9.1/Makefile index d77b69a..6854683 100644 --- a/packages/python/3.9.1/Makefile +++ b/packages/python/3.9.1/Makefile @@ -2,22 +2,25 @@ NAME=python VERSION=3.9.1 AUTHOR=Thomas Hobson DEPS= -BINARY_FILES=out/ run +COMPILED=false MAKE_JOBS=64 include ../../Makefile run: - echo "bin/python3.9 $*" > run + echo "python3.9 $*" > run -out/: Python-${VERSION}/ +python-${VERSION}/environment: + echo 'export PATH=$$PWD/python-${VERSION}/bin:$$PATH' > $@ + +python-${VERSION}/: Python-${VERSION}/ cd $< && ./configure --prefix / make -j${MAKE_JOBS} -C $< - DESTDIR=../out make -j${MAKE_JOBS} -C $< altinstall + DESTDIR=../$@ make -j${MAKE_JOBS} -C $< altinstall || true Python-${VERSION}.tgz: - curl "https://www.python.org/ftp/python/${VERSION}/Python-${VERSION}.tgz" -o $@ + curl "https://www.python.org/ftp/python/${VERSION}/$@" -o $@ %/: %.tgz tar xzvf $< From 51b06018c11aff2a053ecfe89c4ef728dac296f9 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Fri, 19 Feb 2021 18:06:07 +1300 Subject: [PATCH 008/385] Add signing to common --- packages/Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/Makefile b/packages/Makefile index 51218a8..3ef4592 100644 --- a/packages/Makefile +++ b/packages/Makefile @@ -22,7 +22,12 @@ pkg-info.jq: echo '.dependencies={}' >> pkg-info.jq $(foreach dep, ${LANG_DEPS}, echo '.dependencies.$(word 1,$(subst =, ,${dep}))="$(word 2,$(subst =, ,${dep}))"' >> pkg-info.jq) +%.asc: % + gpg --detach-sig --armor --output $@ $< + .PHONY: clean clean: rm -rf $(filter-out Makefile, $(wildcard *)) - \ No newline at end of file + +.PHONY: sign +sign: ${LANG_NAME}-${LANG_VERSION}.pkg.tar.gz.asc \ No newline at end of file From 4f3e7a536d7680efc2fa896338c191c0456f3095 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Fri, 19 Feb 2021 18:53:26 +1300 Subject: [PATCH 009/385] Better python packaging --- packages/.gitignore | 3 --- packages/{Makefile => common.mk} | 9 ++++++++- packages/python/.gitignore | 1 + packages/python/3.9.1/Makefile | 28 ---------------------------- packages/python/Makefile | 24 ++++++++++++++++++++++++ packages/python/base.mk | 21 +++++++++++++++++++++ 6 files changed, 54 insertions(+), 32 deletions(-) delete mode 100644 packages/.gitignore rename packages/{Makefile => common.mk} (78%) create mode 100644 packages/python/.gitignore delete mode 100644 packages/python/3.9.1/Makefile create mode 100644 packages/python/Makefile create mode 100644 packages/python/base.mk diff --git a/packages/.gitignore b/packages/.gitignore deleted file mode 100644 index a9f5c08..0000000 --- a/packages/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -* -!**/Makefile -!.gitignore \ No newline at end of file diff --git a/packages/Makefile b/packages/common.mk similarity index 78% rename from packages/Makefile rename to packages/common.mk index 3ef4592..8305faf 100644 --- a/packages/Makefile +++ b/packages/common.mk @@ -10,7 +10,7 @@ ifeq (${LANG_COMPILED}, true) ${LANG_NAME}-${LANG_VERSION}.pkg.tar.gz: $(LANG_PKG_TARGETS) compile endif ${LANG_NAME}-${LANG_VERSION}.pkg.tar.gz: $(LANG_PKG_TARGETS) - tar czvf $@ $? + tar czf $@ $? %.json: %.jq jq '$(shell tr '\n' '|' < $<).' <<< "{}" > $@ @@ -25,9 +25,16 @@ pkg-info.jq: %.asc: % gpg --detach-sig --armor --output $@ $< +%/: %.tgz + tar xzf $< + .PHONY: clean clean: rm -rf $(filter-out Makefile, $(wildcard *)) + +,PHONY: cleanup +cleanup: + rm -rf $(filter-out ${LANG_NAME}-${LANG_VERSION}.pkg.tar.gz.asc, $(filter-out ${LANG_NAME}-${LANG_VERSION}.pkg.tar.gz, $(filter-out Makefile, $(wildcard *)))) .PHONY: sign sign: ${LANG_NAME}-${LANG_VERSION}.pkg.tar.gz.asc \ No newline at end of file diff --git a/packages/python/.gitignore b/packages/python/.gitignore new file mode 100644 index 0000000..0a00d70 --- /dev/null +++ b/packages/python/.gitignore @@ -0,0 +1 @@ +*/ \ No newline at end of file diff --git a/packages/python/3.9.1/Makefile b/packages/python/3.9.1/Makefile deleted file mode 100644 index 6854683..0000000 --- a/packages/python/3.9.1/Makefile +++ /dev/null @@ -1,28 +0,0 @@ -NAME=python -VERSION=3.9.1 -AUTHOR=Thomas Hobson -DEPS= -COMPILED=false - -MAKE_JOBS=64 - -include ../../Makefile - -run: - echo "python3.9 $*" > run - -python-${VERSION}/environment: - echo 'export PATH=$$PWD/python-${VERSION}/bin:$$PATH' > $@ - -python-${VERSION}/: Python-${VERSION}/ - cd $< && ./configure --prefix / - make -j${MAKE_JOBS} -C $< - DESTDIR=../$@ make -j${MAKE_JOBS} -C $< altinstall || true - -Python-${VERSION}.tgz: - curl "https://www.python.org/ftp/python/${VERSION}/$@" -o $@ - -%/: %.tgz - tar xzvf $< - - diff --git a/packages/python/Makefile b/packages/python/Makefile new file mode 100644 index 0000000..4e1ab09 --- /dev/null +++ b/packages/python/Makefile @@ -0,0 +1,24 @@ +LANGUAGE=python +VERSIONS=2.7.1 3.9.1 + +.PHONY: build sign cleanup clean +build: $(patsubst %,%/${LANGUAGE}-%.pkg.tar.gz,${VERSIONS}) +sign: $(patsubst %,%/${LANGUAGE}-%.pkg.tar.gz.asc,${VERSIONS}) +clean: + rm -rf ${VERSIONS} +cleanup: $(patsubst %,%/cleanup,${VERSIONS}) + + +%/cleanup: %/Makefile + $(MAKE) -C $(shell dirname $<) cleanup + rm $(shell dirname $<)/Makefile + +%/${LANGUAGE}-%.pkg.tar.gz.asc: %/Makefile + $(MAKE) -C $(shell dirname $<) sign +%/${LANGUAGE}-%.pkg.tar.gz: %/Makefile + $(MAKE) -C $(shell dirname $<) + +%/Makefile: + @mkdir -p $(shell dirname $@) + @echo 'VERSION=$(patsubst %/Makefile,%,$@)' > $@ + @echo 'include ../base.mk' >> $@ diff --git a/packages/python/base.mk b/packages/python/base.mk new file mode 100644 index 0000000..bcb11d1 --- /dev/null +++ b/packages/python/base.mk @@ -0,0 +1,21 @@ +NAME=python +AUTHOR=Thomas Hobson +DEPS= +#VERSION= +COMPILED=false + +include ../../common.mk + +run: + echo 'python$(shell grep -oP "\d+.\d+"<<<${VERSION}) $$*' > run + +python-${VERSION}/environment: + echo 'export PATH=$$PWD/${NAME}-${VERSION}/bin:$$PATH' > $@ + +python-${VERSION}/: Python-${VERSION}/ + cd $< && ./configure --prefix / + $(MAKE) -j$(or ${MAKE_JOBS},64) -C $< + DESTDIR=../$@ $(MAKE) -j$(or ${MAKE_JOBS},64) -C $< altinstall || true + +Python-${VERSION}.tgz: + curl "https://www.python.org/ftp/python/${VERSION}/$@" -o $@ \ No newline at end of file From e03c7c50f36e5f21e944cb2667b5e73615d98780 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Fri, 19 Feb 2021 20:34:30 +1300 Subject: [PATCH 010/385] store build distro with package --- packages/common.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/common.mk b/packages/common.mk index 8305faf..9cb6bbd 100644 --- a/packages/common.mk +++ b/packages/common.mk @@ -20,6 +20,7 @@ pkg-info.jq: echo '.version="${LANG_VERSION}"' >> pkg-info.jq echo '.author="${LANG_AUTHOR}"' >> pkg-info.jq echo '.dependencies={}' >> pkg-info.jq + echo '.distro="$(shell grep -oP "^ID=\K\w+" /etc/os-release )"' $(foreach dep, ${LANG_DEPS}, echo '.dependencies.$(word 1,$(subst =, ,${dep}))="$(word 2,$(subst =, ,${dep}))"' >> pkg-info.jq) %.asc: % From 47c31e3792ca0c28eebf05166f5e07f009fa8ff3 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Fri, 19 Feb 2021 21:05:37 +1300 Subject: [PATCH 011/385] Allow build platform to be directly specified --- packages/common.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/common.mk b/packages/common.mk index 9cb6bbd..f045d34 100644 --- a/packages/common.mk +++ b/packages/common.mk @@ -6,6 +6,8 @@ LANG_COMPILED=$(or ${COMPILED}, false) LANG_PKG_TARGETS=pkg-info.json ${LANG_NAME}-${LANG_VERSION}/ ${LANG_NAME}-${LANG_VERSION}/environment run +BUILD_PLATFORM=$(or ${PLATFORM}, baremetal-$(shell grep -oP "^ID=\K\w+" /etc/os-release )) + ifeq (${LANG_COMPILED}, true) ${LANG_NAME}-${LANG_VERSION}.pkg.tar.gz: $(LANG_PKG_TARGETS) compile endif @@ -20,7 +22,7 @@ pkg-info.jq: echo '.version="${LANG_VERSION}"' >> pkg-info.jq echo '.author="${LANG_AUTHOR}"' >> pkg-info.jq echo '.dependencies={}' >> pkg-info.jq - echo '.distro="$(shell grep -oP "^ID=\K\w+" /etc/os-release )"' + echo '.build_platform="${BUILD_PLATFORM}"' $(foreach dep, ${LANG_DEPS}, echo '.dependencies.$(word 1,$(subst =, ,${dep}))="$(word 2,$(subst =, ,${dep}))"' >> pkg-info.jq) %.asc: % From 32632926de75a8d95a3b0849ea40a6b0b730bf6b Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Fri, 19 Feb 2021 21:28:59 +1300 Subject: [PATCH 012/385] add the build platform to json --- packages/common.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/common.mk b/packages/common.mk index f045d34..08fc488 100644 --- a/packages/common.mk +++ b/packages/common.mk @@ -22,7 +22,7 @@ pkg-info.jq: echo '.version="${LANG_VERSION}"' >> pkg-info.jq echo '.author="${LANG_AUTHOR}"' >> pkg-info.jq echo '.dependencies={}' >> pkg-info.jq - echo '.build_platform="${BUILD_PLATFORM}"' + echo '.build_platform="${BUILD_PLATFORM}"' >> pkg-info.jq $(foreach dep, ${LANG_DEPS}, echo '.dependencies.$(word 1,$(subst =, ,${dep}))="$(word 2,$(subst =, ,${dep}))"' >> pkg-info.jq) %.asc: % From bda5129da70ec6742b4386429386e531fb059065 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Fri, 19 Feb 2021 21:58:31 +1300 Subject: [PATCH 013/385] more documentation --- design/fs.txt | 18 ++++++++++++ design/ppman.txt | 74 ++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 86 insertions(+), 6 deletions(-) create mode 100644 design/fs.txt diff --git a/design/fs.txt b/design/fs.txt new file mode 100644 index 0000000..030d563 --- /dev/null +++ b/design/fs.txt @@ -0,0 +1,18 @@ +== File System Layout == [ Piston ] + +All of pistons files are installed in the `/piston` directory. This directory +contains all runtimes, config, packages and cache that piston uses. + +Each package gets its own directory, where it its prebuilt binaries are +unpacked into. This is contained within `/piston/packages` + +The binaries folder contained within this is then symlinked into the runtimes +directory. This is where all the different runtimes available are placed. This +is contained within the `/piston/runtimes` directory. + +The cache directory a directory containing all the different cache files. It is +recommended to either sym-link this into a folder withing /tmp/ or directly +mount it as a tmpfs filesystem. + +Configuration is stored in a single file - piston.yaml and contains all +documentation required for configuring the piston API \ No newline at end of file diff --git a/design/ppman.txt b/design/ppman.txt index 7721ebd..bd5da28 100644 --- a/design/ppman.txt +++ b/design/ppman.txt @@ -19,8 +19,8 @@ containing the right content - as long as its accessable by a URL, its considered a valid repository by piston. A repository URL is simply a URL pointing to a repository index file, as set out by the following information. -A repository index file is a YAML file containing the keys: `schema`, `baseurl` -and `packages`. +A repository index file is a YAML file containing the keys: `schema`, +`baseurl`, `keys` and `packages`. The schema key simply should have a value of `ppman-repo-1`. This indicates the version and file format for the client to recieve. @@ -30,9 +30,12 @@ this doesn't need to be related to the url that the repository index is hosted at, only the downloadable files, which are possible to split over many domains by using absolute paths. +The keys key contains a list of GPG key ids which should be used when +verifying. + The packages key contains a list of packages, which contain the keys: `author`, -`language`, `version`, `checksums`, `dependencies`, `size`, `buildfile` and -`download`. +`language`, `version`, `checksums`, `dependencies`, `size`, `buildfile`, +`download` and `signature`. The author field is self explainatory, it is simply the authors name and email, formatted similar to git's default format: `Full Name `. If the @@ -63,12 +66,71 @@ means of reproducing the build. This field is purely so people can understand how the image was built, and to make sure you aren't packing any mallicious code into it. -The final field is download, this points to a URL of which the package file can +The download field is a URL pointing to a place of which the package file can be obtained from. If this is a relative url, the baseurl will be appended to it. This is particularly useful if everything is stored within 1 s3 bucket, or you have a repository in a folder. +The signature field is an armored signature + == Package File == -TODO \ No newline at end of file +Within a repository, many package files are contained. These files are +downloaded and installed into `/piston`. They need to all follow the format +as listed below for the API to properly utilize them. + +A package file is a gzipped tar archive, containing 4/5 things - `run`, +`compile` (optional), `pkg-info.json`, `lang-ver` and `lang-ver/environment`. +Replacing lang-ver with the language name and the version respectively. + + +The `pkg-info.json` file contains 5 different keys: `language`, `version`, +`author`, `dependencies` and `build_platform`. + +The language field is simply the name of the language, all lowercase and not +containing any version number. This is important in the case of python +specifically as python3 and python2 come under the same language, just +different versions. + +The version field is a sem-ver compliant version number for the interpreter +contained wthin the package. It should be a string. + +The author field contains the author name, and should be formatted exactly like +shown previously in the repo index spec. + +The dependencies field is simply a map containing packages which this package +depends on. This should only be used when one language is a requirement for +another, like how typescript is dependent on node. The key should be the name +of the package, with the value being the version selector. + +The build_platform field is used for defining which type of system the package +was built on, this helps resolve system compatability errors. It consists of 2 +parts - environment and disto. The environment is simply one of `baremetal`, +`docker`, `lxc` or any other type of environment you can run piston on. The +distro is the ID of the distro as contained in /etc/os-release on the system +which built the package. This is done to ensure system compatability, +especially inside the offically supported Docker container. + + +The `run` and `compile` files are used in the execution of a job, being used +to both compile and run the source code provided. They are both treated the +same inputs-wise but can have timeouts independently set per stage. The +arguments fed both these files are the same, with the first argument being a +path to the code file, and the rest being the arguments to passed in. These +files are run in a temporary directory contained within the cache folder. +Depending on the cache control level the code and associated files will either +be disposed of or kept. By default only files named `binary` will be kept. +STDIN is only passed into the `run` file, but both files have their output +captured and returned through the API + +The `lang-ver` folder should contain any interpreter specific files, such as +the binary to execute and any other files that may be required to run the +interpreter/compiler contained within the package. + +The `environment` file contained within `lang-ver` should contain export +commands like a ~/.bashrc file should, as this is its intended purpose. Firstly +the language which is being executed has its environment file sources, then it +walks down the dependency tree sourcing files. The environment variables are +eventually cached to speed up the execution process. + From 0242c993883d4abaabfd9e430ea418d4bb9641d8 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Fri, 19 Feb 2021 22:05:00 +1300 Subject: [PATCH 014/385] clarify exit code returning --- design/ppman.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/design/ppman.txt b/design/ppman.txt index bd5da28..b4920db 100644 --- a/design/ppman.txt +++ b/design/ppman.txt @@ -122,7 +122,7 @@ files are run in a temporary directory contained within the cache folder. Depending on the cache control level the code and associated files will either be disposed of or kept. By default only files named `binary` will be kept. STDIN is only passed into the `run` file, but both files have their output -captured and returned through the API +captured and returned along with their exit codes through the API The `lang-ver` folder should contain any interpreter specific files, such as the binary to execute and any other files that may be required to run the From 170dbc419ebd8027ae0cefd7109a36517db26948 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 20 Feb 2021 18:34:02 +1300 Subject: [PATCH 015/385] relocate gitignore for packages --- packages/.gitignore | 1 + packages/python/.gitignore | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 packages/.gitignore delete mode 100644 packages/python/.gitignore diff --git a/packages/.gitignore b/packages/.gitignore new file mode 100644 index 0000000..db91d1f --- /dev/null +++ b/packages/.gitignore @@ -0,0 +1 @@ +*/*/ \ No newline at end of file diff --git a/packages/python/.gitignore b/packages/python/.gitignore deleted file mode 100644 index 0a00d70..0000000 --- a/packages/python/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*/ \ No newline at end of file From 13d5191d77af62542a34a871e3b0ba4b27b9ad31 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 20 Feb 2021 18:34:44 +1300 Subject: [PATCH 016/385] pkg(python): refactor --- packages/python/Makefile | 22 +--------------------- packages/python/base.mk | 8 +++----- packages/secondary.mk | 22 ++++++++++++++++++++++ 3 files changed, 26 insertions(+), 26 deletions(-) create mode 100644 packages/secondary.mk diff --git a/packages/python/Makefile b/packages/python/Makefile index 4e1ab09..23daac2 100644 --- a/packages/python/Makefile +++ b/packages/python/Makefile @@ -1,24 +1,4 @@ LANGUAGE=python VERSIONS=2.7.1 3.9.1 -.PHONY: build sign cleanup clean -build: $(patsubst %,%/${LANGUAGE}-%.pkg.tar.gz,${VERSIONS}) -sign: $(patsubst %,%/${LANGUAGE}-%.pkg.tar.gz.asc,${VERSIONS}) -clean: - rm -rf ${VERSIONS} -cleanup: $(patsubst %,%/cleanup,${VERSIONS}) - - -%/cleanup: %/Makefile - $(MAKE) -C $(shell dirname $<) cleanup - rm $(shell dirname $<)/Makefile - -%/${LANGUAGE}-%.pkg.tar.gz.asc: %/Makefile - $(MAKE) -C $(shell dirname $<) sign -%/${LANGUAGE}-%.pkg.tar.gz: %/Makefile - $(MAKE) -C $(shell dirname $<) - -%/Makefile: - @mkdir -p $(shell dirname $@) - @echo 'VERSION=$(patsubst %/Makefile,%,$@)' > $@ - @echo 'include ../base.mk' >> $@ +include ../secondary.mk \ No newline at end of file diff --git a/packages/python/base.mk b/packages/python/base.mk index bcb11d1..8c3b746 100644 --- a/packages/python/base.mk +++ b/packages/python/base.mk @@ -1,7 +1,5 @@ -NAME=python AUTHOR=Thomas Hobson DEPS= -#VERSION= COMPILED=false include ../../common.mk @@ -9,13 +7,13 @@ include ../../common.mk run: echo 'python$(shell grep -oP "\d+.\d+"<<<${VERSION}) $$*' > run -python-${VERSION}/environment: +${NAME}-${VERSION}/environment: echo 'export PATH=$$PWD/${NAME}-${VERSION}/bin:$$PATH' > $@ -python-${VERSION}/: Python-${VERSION}/ +${NAME}-${VERSION}/: Python-${VERSION}/ cd $< && ./configure --prefix / $(MAKE) -j$(or ${MAKE_JOBS},64) -C $< DESTDIR=../$@ $(MAKE) -j$(or ${MAKE_JOBS},64) -C $< altinstall || true -Python-${VERSION}.tgz: +${NAME}-${VERSION}.tgz: curl "https://www.python.org/ftp/python/${VERSION}/$@" -o $@ \ No newline at end of file diff --git a/packages/secondary.mk b/packages/secondary.mk new file mode 100644 index 0000000..a748fa6 --- /dev/null +++ b/packages/secondary.mk @@ -0,0 +1,22 @@ +.PHONY: build sign cleanup clean +build: $(patsubst %,%/${LANGUAGE}-%.pkg.tar.gz,${VERSIONS}) +sign: $(patsubst %,%/${LANGUAGE}-%.pkg.tar.gz.asc,${VERSIONS}) +clean: + rm -rf ${VERSIONS} +cleanup: $(patsubst %,%/cleanup,${VERSIONS}) + + +%/cleanup: %/Makefile + $(MAKE) -C $(shell dirname $<) cleanup + rm $(shell dirname $<)/Makefile + +%/${LANGUAGE}-%.pkg.tar.gz.asc: %/Makefile + $(MAKE) -C $(shell dirname $<) sign +%/${LANGUAGE}-%.pkg.tar.gz: %/Makefile + $(MAKE) -C $(shell dirname $<) + +%/Makefile: + @mkdir -p $(shell dirname $@) + @echo 'VERSION=$(patsubst %/Makefile,%,$@)' > $@ + @echo 'NAME=${LANGUAGE}' > $@ + @echo 'include ../base.mk' >> $@ From e83da209be31655b176b464f694c586f19c96b1e Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 20 Feb 2021 18:37:55 +1300 Subject: [PATCH 017/385] pkg: contribution guidelines --- packages/CONTRIBUTING.MD | 41 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 packages/CONTRIBUTING.MD diff --git a/packages/CONTRIBUTING.MD b/packages/CONTRIBUTING.MD new file mode 100644 index 0000000..19eba6f --- /dev/null +++ b/packages/CONTRIBUTING.MD @@ -0,0 +1,41 @@ +# Contributing packages to the Piston Repository + +## Creating new languages + +1. Create a new branch on your fork of engineer-man/piston. +2. Create a directory (all lowercase) with the name of the language. +3. Create a Makefile containing the following, filling in the fields marked with % +Versions can be a list of version numbers, separated by spaces. +Quotes are not required. +```makefile +LANGUAGE=% +VERSIONS=% + +include ../secondary.mk +``` +4. Create a `base.mk` file, this is the file which will hold the correct targets to make each build. +It should download any sources it requires uring `curl` and use as much version templating as possible. +You should include 3 variables: `AUTHOR`, `DEPS` and `COMPILED`. + +`AUTHOR` is simply your name, and email address formatted as `Your Name `. +`DEPS` is a list (separated by spaces) of packages which are required with this one for it to work correctly. +This is mainly used in the case of golfing languages, which use other languages (e.g. python and eilxar) to interpret them. Give a package name and a SemVer selector (e.g. `python==3.x.x` for any python3 build). +`COMPILED` is simply a true or false field indicating if the package contains a `compile` target (see below). + +You should also include 3/4 targets: `run`, `${NAME}-${VERSION}`, `${NAME}-${VERSION}/environment` and optionally `compile` (only if the language is a compiled language, e.g. cpp/c) + +The `run` file is one which is passed the main source file (first argument) and the arguments for the process (remaining arguments). STDIN data is also piped in. Generate this by using either a `cat` or an `echo` statement(s) and piping them into `$@` (it means the target name in Makefiles). You have to escape `$` symbols with `$$`. + +The `${NAME}-${VERSION}` directory should contain all the binaries required to run the language. +You should use this target to compile all the sources, and installing them into the `$@` location + +`${NAME}-${VERSION}/environment` should contain a bunch of environment variables which will be passed into the `run` and `compile` scripts of not only this language, but any which depend on it. +If your package depends on any others, their environment variables are automatically sourced, then your packages ones are sourced after. + +The `compile` file contains instructions to compile source files into a final binary which should be run by `run`. It's first argument is the main source file, with other source files being provided as other arguments. STDIN is left blank, but both STDOUT and STDERR are returned. The `run` file will be skipped if this file returns a non-zero error code. + +5. Commit your new package with the following message format: `pkg([language name] [version(s)]): [description including versions]` + +Examples: +* `pkg(python 3.9.1): new version` +* `pkg(python 3.9.1 2.7.1): refactor` \ No newline at end of file From d8239c27038afd23770701dbe203424c0aa1ac62 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 20 Feb 2021 18:42:50 +1300 Subject: [PATCH 018/385] docs(pkg): tell user to create pr --- packages/CONTRIBUTING.MD | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/CONTRIBUTING.MD b/packages/CONTRIBUTING.MD index 19eba6f..6e145d4 100644 --- a/packages/CONTRIBUTING.MD +++ b/packages/CONTRIBUTING.MD @@ -38,4 +38,6 @@ The `compile` file contains instructions to compile source files into a final bi Examples: * `pkg(python 3.9.1): new version` -* `pkg(python 3.9.1 2.7.1): refactor` \ No newline at end of file +* `pkg(python 3.9.1 2.7.1): refactor` + +6. Create a pull request, referencing the issue number of the language \ No newline at end of file From 91420c39d7ebf8fe65cfac04634c46d2d35b8bdd Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 21 Feb 2021 03:13:56 +1300 Subject: [PATCH 019/385] api: v3 --- api/.dockerignore | 2 + api/.eslintrc.json | 39 ++ api/.gitignore | 2 + api/Dockerfile | 11 + api/package.json | 22 + api/src/cache.js | 54 ++ api/src/config.js | 166 +++++ api/src/executor/job.js | 146 +++++ api/src/executor/routes.js | 34 ++ api/src/globals.js | 25 + api/src/helpers.js | 34 ++ api/src/index.js | 106 ++++ api/src/ppman/package.js | 170 ++++++ api/src/ppman/repo.js | 66 ++ api/src/ppman/routes.js | 136 +++++ api/src/runtime.js | 85 +++ api/src/state.js | 45 ++ api/yarn.lock | 1185 ++++++++++++++++++++++++++++++++++++ 18 files changed, 2328 insertions(+) create mode 100644 api/.dockerignore create mode 100644 api/.eslintrc.json create mode 100644 api/.gitignore create mode 100644 api/Dockerfile create mode 100644 api/package.json create mode 100644 api/src/cache.js create mode 100644 api/src/config.js create mode 100644 api/src/executor/job.js create mode 100644 api/src/executor/routes.js create mode 100644 api/src/globals.js create mode 100644 api/src/helpers.js create mode 100644 api/src/index.js create mode 100644 api/src/ppman/package.js create mode 100644 api/src/ppman/repo.js create mode 100644 api/src/ppman/routes.js create mode 100644 api/src/runtime.js create mode 100644 api/src/state.js create mode 100644 api/yarn.lock diff --git a/api/.dockerignore b/api/.dockerignore new file mode 100644 index 0000000..ad00d4c --- /dev/null +++ b/api/.dockerignore @@ -0,0 +1,2 @@ +node_modules/ +_piston/ \ No newline at end of file diff --git a/api/.eslintrc.json b/api/.eslintrc.json new file mode 100644 index 0000000..4af7bf3 --- /dev/null +++ b/api/.eslintrc.json @@ -0,0 +1,39 @@ +{ + "env": { + "commonjs": true, + "es2021": true, + "node": true + }, + "plugins": [ + "snakecasejs" + ], + "extends": "eslint:recommended", + "parserOptions": { + "ecmaVersion": 12 + }, + "settings": + { + "snakecasejs/filter": ["ClassDeclaration", "NewExpression"], + "snakecasejs/whitelist": [] + }, + "rules": { + "indent": [ + "error", + 4 + ], + "linebreak-style": [ + "error", + "unix" + ], + "quotes": [ + "error", + "double" + ], + "semi": [ + "error", + "never" + ], + "no-unused-vars": ["error", { "argsIgnorePattern": "^_"}], + "snakecasejs/snakecasejs": "warn" + } +} diff --git a/api/.gitignore b/api/.gitignore new file mode 100644 index 0000000..adbd330 --- /dev/null +++ b/api/.gitignore @@ -0,0 +1,2 @@ +node_modules +_piston \ No newline at end of file diff --git a/api/Dockerfile b/api/Dockerfile new file mode 100644 index 0000000..1d32806 --- /dev/null +++ b/api/Dockerfile @@ -0,0 +1,11 @@ +FROM node:15.8.0-alpine3.13 +RUN apk add --no-cache gnupg tar bash coreutils + +ENV NODE_ENV=production +WORKDIR /piston_api +COPY ["package.json", "yarn.lock", "./"] +RUN yarn +COPY ./src ./src + +CMD [ "node", "src", "-m", "-c", "/piston/config.yaml"] +EXPOSE 6969/tcp \ No newline at end of file diff --git a/api/package.json b/api/package.json new file mode 100644 index 0000000..bee046b --- /dev/null +++ b/api/package.json @@ -0,0 +1,22 @@ +{ + "name": "piston-api", + "version": "3.0.0", + "description": "API for piston - a high performance code execution engine", + "main": "src/index.js", + "dependencies": { + "body-parser": "^1.19.0", + "express": "^4.17.1", + "is-docker": "^2.1.1", + "js-yaml": "^4.0.0", + "logplease": "^1.2.15", + "nocamel": "*", + "node-fetch": "^2.6.1", + "semver": "^7.3.4", + "uuid": "^8.3.2", + "yargs": "^16.2.0" + }, + "devDependencies": { + "eslint": "^7.20.0", + "eslint-plugin-snakecasejs": "^2.2.0" + } +} diff --git a/api/src/cache.js b/api/src/cache.js new file mode 100644 index 0000000..97b31a1 --- /dev/null +++ b/api/src/cache.js @@ -0,0 +1,54 @@ +const globals = require("./globals") +const logger = require("logplease").create("cache") +const fs = require("fs"), path = require("path") +const util = require("util") + +const cache = new Map() + +module.exports = { + cache_key: (context, key) => Buffer.from(`${context}-${key}`).toString("base64"), + has(key){ + return cache.has(key) && cache.get(key).expiry > Date.now() + }, + async get(key, callback, ttl=globals.cache_ttl){ + logger.debug("get:", key) + if(module.exports.has(key)){ + logger.debug("hit:",key) + return cache.get(key).data + } + logger.debug("miss:", key) + var data = await callback() + cache.set(key, {data, expiry: Date.now() + ttl}) + return data + }, + async flush(cache_dir){ + logger.info("Flushing cache") + cache.forEach((v,k)=>{ + var file_path = path.join(cache_dir, k) + if(v.expiry < Date.now()){ + //remove from cache + cache.delete(k) + fs.stat(file_path, (err, stats)=>{ + if(err) return //ignore - probably hasn't been flushed yet + if(stats.is_file()) + fs.rm(file_path, (err)=>{ + if(err) logger.warn(`Couldn't clean up on-disk cache file ${k}`) + }) + }) + }else{ + //flush to disk + fs.write_file(file_path, JSON.stringify(v),()=>{}) + } + }) + + }, + async load(cache_dir){ + return util.promisify(fs.readdir)(cache_dir) + .then(files => Promise.all(files.map( + async file => { + cache.set(file, JSON.parse(fs.read_file_sync(path.join(cache_dir,file)).toString())) + } + ))) + } + +} \ No newline at end of file diff --git a/api/src/config.js b/api/src/config.js new file mode 100644 index 0000000..be4dae5 --- /dev/null +++ b/api/src/config.js @@ -0,0 +1,166 @@ +const fs = require("fs") +const yargs = require("yargs") +const hide_bin = require("yargs/helpers").hideBin //eslint-disable-line snakecasejs/snakecasejs +const Logger = require("logplease") +const logger = Logger.create("config") +const yaml = require("js-yaml") + +const header = `# +# ____ _ _ +# | _ \\(_)___| |_ ___ _ __ +# | |_) | / __| __/ _ \\| '_ \\ +# | __/| \\__ \\ || (_) | | | | +# |_| |_|___/\\__\\___/|_| |_| +# +# A High performance code execution engine +# github.com/engineer-man/piston +# + +` +const argv = yargs(hide_bin(process.argv)) + .usage("Usage: $0 -c [config]") + .demandOption("c") //eslint-disable-line snakecasejs/snakecasejs + .option("config", { + alias: "c", + describe: "config file to load from", + default: "/piston/config.yaml" + }) + .option("make-config", { + alias: "m", + type: "boolean", + describe: "create config file and populate defaults if it does not already exist" + }).argv + + +const options = [ + { + key: "log_level", + desc: "Level of data to log", + default: "INFO", + /* eslint-disable snakecasejs/snakecasejs */ + options: Object.values(Logger.LogLevels), + validators: [x=>Object.values(Logger.LogLevels).includes(x) || `Log level ${x} does not exist`] + /* eslint-enable snakecasejs/snakecasejs */ + }, + { + key: "bind_address", + desc: "Address to bind REST API on\nThank @Bones for the number", + default: "0.0.0.0:6969", + validators: [] + }, + { + key: "data_directory", + desc: "Absolute path to store all piston related data at", + default: "/piston", + validators: [x=> fs.exists_sync(x) || `Directory ${x} does not exist`] + }, + { + key: "cache_ttl", + desc: "Time in milliseconds to keep data in cache for at a maximum", + default: 60 * 60 * 1000, + validators: [] + }, + { + key: "cache_flush_time", + desc: "Interval in milliseconds to flush cache to disk at", + default: 90 * 60 * 1000, //90 minutes + validators: [] + }, + { + key: "state_flush_time", + desc: "Interval in milliseconds to flush state to disk at", + default: 5000, // 5 seconds (file is tiny) + validators: [] + }, + { + key: "runner_uid_min", + desc: "Minimum uid to use for runner", + default: 1000, + validators: [] + }, + { + key: "runner_uid_max", + desc: "Maximum uid to use for runner", + default: 1500, + validators: [] + }, + { + key: "runner_gid_min", + desc: "Minimum gid to use for runner", + default: 1000, + validators: [] + }, + { + key: "runner_gid_max", + desc: "Maximum gid to use for runner", + default: 1500, + validators: [] + } +] + +const default_config = [ + ...header.split("\n"), + ...options.map(option => ` +${[ + ...option.desc.split("\n"), + option.options?("Options: " + option.options.join(", ")):"" + ].filter(x=>x.length>0).map(x=>`# ${x}`).join("\n")} +${option.key}: ${option.default} + `)].join("\n") + +logger.info(`Loading Configuration from ${argv.config}`) +!!argv["make-config"] && logger.debug("Make configuration flag is set") + +if(!!argv["make-config"] && !fs.exists_sync(argv.config)){ + logger.info("Writing default configuration...") + try { + fs.write_file_sync(argv.config, default_config) + } catch (err) { + logger.error("Error writing default configuration:", err.message) + process.exit(1) + } + + +} +var config = {} +logger.debug("Reading config file") +try{ + const cfg_content = fs.read_file_sync(argv.config) + try{ + config = yaml.load(cfg_content) + }catch(err){ + logger.error("Error parsing configuration file:", err.message) + process.exit(1) + } + +}catch(err){ + logger.error("Error reading configuration from disk:", err.message) + process.exit(1) +} + +logger.debug("Validating config entries") +var errored=false +options.forEach(opt => { + logger.debug("Checking key",opt.key) + var cfg_val = config[opt.key] + if(cfg_val == undefined){ + errored = true + logger.error(`Config key ${opt.key} does not exist on currently loaded configuration`) + return + } + opt.validators.forEach(validator => { + var response = validator(cfg_val) + if(response !== true){ + errored = true + logger.error(`Config key ${opt.key} failed validation:`, response) + return + } + }) +}) + +if(errored) process.exit(1) + +logger.info("Configuration successfully loaded") + +module.exports = config + diff --git a/api/src/executor/job.js b/api/src/executor/job.js new file mode 100644 index 0000000..f56f3a7 --- /dev/null +++ b/api/src/executor/job.js @@ -0,0 +1,146 @@ +const logger = require("logplease").create("executor/job") +const { v4: uuidv4 } = require("uuid") +const cp = require("child_process") +const path = require("path") +const config = require("../config"); +const globals = require("../globals"); +const fs = require("fs"); +const util = require("util"); + +const job_states = { + READY: Symbol("Ready to be primed"), + PRIMED: Symbol("Primed and ready for execution"), + EXECUTED: Symbol("Executed and ready for cleanup") +} + +var uid=0; +var gid=0; + +class Job { + constructor(runtime, files, args, stdin, timeouts, main){ + this.uuid = uuidv4() + this.runtime = runtime + this.files = files + this.args = args + this.stdin = stdin + this.timeouts = timeouts + this.main = main + + if(!Object.keys(this.files).includes(this.main)) + throw new Error(`Main file "${this.main}" will not be written to disk`) + + this.uid = config.runner_uid_min + uid; + this.gid = config.runner_gid_min + gid; + + uid++ + gid++ + + uid %= (config.runner_uid_max - config.runner_uid_min) + 1 + gid %= (config.runner_gid_max - config.runner_gid_min) + 1 + + this.state = job_states.READY; + this.dir = path.join(config.data_directory, globals.data_directories.jobs, this.uuid); + } + + async prime(){ + logger.info(`Priming job uuid=${this.uuid}`) + + logger.debug("Writing files to job cache") + + await util.promisify(fs.mkdir)(this.dir, {mode:0o700}) + + const files = Object.keys(this.files).map(fileName => { + var content = this.files[fileName]; + return util.promisify(fs.writeFile)(path.join(this.dir, fileName), content) + }) + + await Promise.all(files) + + logger.debug(`Transfering ownership uid=${this.uid} gid=${this.gid}`) + await util.promisify(fs.chown)(this.dir, this.uid, this.gid) + + const chowns = Object.keys(this.files).map(fileName => { + return util.promisify(fs.chown)(path.join(this.dir, fileName), this.uid, this.gid) + }) + + await Promise.all(chowns) + + this.state = job_states.PRIMED; + logger.debug("Primed job") + } + + async execute(){ + if(this.state != job_states.PRIMED) throw new Error("Job must be in primed state, current state: " + this.state.toString()) + logger.info(`Executing job uuid=${this.uuid} uid=${this.uid} gid=${this.gid} runtime=${this.runtime.toString()}`) + logger.debug(`Compiling`) + + const compile = this.runtime.compiled && await new Promise((resolve, reject) => { + var stderr, stdout = ""; + const proc = cp.spawn(this.runtime.pkgdir, [this.main, ...this.args] ,{ + env: this.runtime.env_vars, + stdio: ['pipe', 'pipe', 'pipe'], + cwd: this.dir, + uid: this.uid, + gid: this.gid + }) + + const killTimeout = setTimeout(proc.kill, this.timeouts.compile, "SIGKILL") + + proc.stderr.on('data', d=>stderr += d) + proc.stdout.on('data', d=>stdout += d) + + proc.on('exit', (code, signal)=>{ + clearTimeout(killTimeout); + resolve({stdout, stderr, code, signal}) + }) + + proc.on('error', (code, signal) => { + clearTimeout(killTimeout); + reject({stdout, stderr, code, signal}) + }) + }) + + logger.debug("Running") + + const run = await new Promise((resolve, reject) => { + var stderr, stdout = ""; + const proc = cp.spawn('bash', [path.join(this.runtime.pkgdir, "run"), this.main, ...this.args] ,{ + env: this.runtime.env_vars, + stdio: ['pipe', 'pipe', 'pipe'], + cwd: this.dir, + uid: this.uid, + gid: this.gid + }) + + const killTimeout = setTimeout(proc.kill, this.timeouts.run, "SIGKILL") + + proc.stderr.on('data', d=>stderr += d) + proc.stdout.on('data', d=>stdout += d) + + proc.on('exit', (code, signal)=>{ + clearTimeout(killTimeout); + resolve({stdout, stderr, code, signal}) + }) + + proc.on('error', (code, signal) => { + clearTimeout(killTimeout); + reject({stdout, stderr, code, signal}) + }) + }) + + this.state = job_states.EXECUTED; + + return { + compile, + run + } + + } + + async cleanup(){ + logger.info(`Cleaning up job uuid=${this.uuid}`) + await util.promisify(fs.rm)(this.dir, {recursive: true, force: true}) + } +} + +module.exports = {Job} \ No newline at end of file diff --git a/api/src/executor/routes.js b/api/src/executor/routes.js new file mode 100644 index 0000000..7bd0ef3 --- /dev/null +++ b/api/src/executor/routes.js @@ -0,0 +1,34 @@ +// {"language":"python","version":"3.9.1","files":{"code.py":"print('hello world')"},"args":[],"stdin":"","compile_timeout":10, "run_timeout":3, "main": "code.py"} +// {"success":true, "run":{"stdout":"hello world", "stderr":"", "error_code":0},"compile":{"stdout":"","stderr":"","error_code":0}} + +const { get_latest_runtime_matching_language_version } = require("../runtime"); +const { Job } = require("./job"); + +module.exports = { + async run_job(req, res){ + // POST /jobs + var errored = false; + ["language", "version", + "files", "main", + "args", "stdin", + "compile_timeout", "run_timeout", + ].forEach(key => { + if(req.body[key] == undefined) errored = errored || res.json_error(`${key} is required`, 400) + }) + if(errored) return errored; + + const runtime = get_latest_runtime_matching_language_version(req.body.language, req.body.version); + if(runtime == undefined) return res.json_error(`${req.body.language}-${req.body.version} runtime is unknown`, 400) + + const job = new Job(runtime, req.body.files, req.body.args, req.body.stdin, {run: req.body.run_timeout, compile: req.body.compile_timeout}, req.body.main) + await job.prime() + + const result = await job.execute() + res.json_success(result) + + await job.cleanup() + + + + } +} \ No newline at end of file diff --git a/api/src/globals.js b/api/src/globals.js new file mode 100644 index 0000000..55f376d --- /dev/null +++ b/api/src/globals.js @@ -0,0 +1,25 @@ +// Globals are things the user shouldn't change in config, but is good to not use inline constants for +const is_docker = require("is-docker") +const fs = require("fs") +const platform = `${is_docker() ? "docker" : "baremetal"}-${ + fs.read_file_sync("/etc/os-release") + .toString() + .split("\n") + .find(x=>x.startsWith("ID")) + .replace("ID=","") +}` + +module.exports = { + data_directories: { + cache: "cache", + packages: "packages", + runtimes: "runtimes", + jobs: "jobs" + }, + data_files:{ + state: "state.json" + }, + version: require("../package.json").version, + platform, + pkg_installed_file: ".ppman-installed" //Used as indication for if a package was installed +} \ No newline at end of file diff --git a/api/src/helpers.js b/api/src/helpers.js new file mode 100644 index 0000000..61f6483 --- /dev/null +++ b/api/src/helpers.js @@ -0,0 +1,34 @@ +const fs = require("fs"), + path= require("path"), + util = require("util"), + fetch = require("node-fetch"), + urlp = require("url") + + + +module.exports = { + async buffer_from_u_r_l(url){ + if(!(url instanceof URL)) + url = new URL(url) + if(url.protocol == "file:"){ + //eslint-disable-next-line snakecasejs/snakecasejs + return await util.promisify(fs.read_file)(urlp.fileURLToPath(url)) + }else{ + return await fetch({ + url: url.toString() + }) + } + }, + add_url_base_if_required(url, base){ + try{ + return new URL(url) + }catch{ + //Assume this is a file name + return new URL(url, base + "/") + } + }, + url_basename(url){ + return path.basename(url.pathname) + }, + +} \ No newline at end of file diff --git a/api/src/index.js b/api/src/index.js new file mode 100644 index 0000000..b9d8fca --- /dev/null +++ b/api/src/index.js @@ -0,0 +1,106 @@ +#!/usr/bin/env node +require("nocamel") +const Logger = require("logplease") +const express = require("express") +const globals = require("./globals") +const config = require("./config") +const cache = require("./cache") +const state = require("./state") +const path = require("path") +const fs = require("fs") +const util = require("util") +const body_parser = require("body-parser") +const runtime = require("./runtime") + +const logger = Logger.create("index") +const app = express(); + +(async () => { + logger.info("Setting loglevel to",config.log_level) + Logger.setLogLevel(config.log_level) //eslint-disable-line snakecasejs/snakecasejs + + logger.debug("Ensuring data directories exist") + Object.values(globals.data_directories).forEach(dir => { + var data_path = path.join(config.data_directory, dir) + logger.debug(`Ensuring ${data_path} exists`) + if(!fs.exists_sync(data_path)){ + logger.info(`${data_path} does not exist.. Creating..`) + try{ + fs.mkdir_sync(data_path) + }catch(err){ + logger.error(`Failed to create ${data_path}: `, err.message) + } + } + + }) + + + logger.info("Loading state") + await state.load(path.join(config.data_directory,globals.data_files.state)) + + logger.info("Loading cache") + await cache.load(path.join(config.data_directory,globals.data_directories.cache)) + + logger.info("Loading packages") + const pkgdir = path.join(config.data_directory,globals.data_directories.packages) + await util.promisify(fs.readdir)(pkgdir) + .then(langs => Promise.all( + langs.map(lang=> + util.promisify(fs.readdir)(path.join(pkgdir,lang)) + .then(x=>x.map(y=>path.join(pkgdir, lang, y))) + ))) + //eslint-disable-next-line snakecasejs/snakecasejs + .then(pkgs=>pkgs.flat().filter(pkg=>fs.existsSync(path.join(pkg, globals.pkg_installed_file)))) + .then(pkgs=>pkgs.forEach(pkg => new runtime.Runtime(pkg))) + + + + logger.info("Starting API Server") + + logger.debug("Constructing Express App") + + logger.debug("Registering middleware") + + app.use(body_parser.urlencoded({extended: true})) + app.use(body_parser.json()) + + logger.debug("Registering custom message wrappers") + + express.response.json_error = function(message, code) { + this.status(code) + return this.json({success: false, message, code}) + } + + express.response.json_success = function(obj) { + return this.json({success: true, data: obj}) + } + + logger.debug("Registering Routes") + + const ppman_routes = require("./ppman/routes") + + app.get ("/repos", ppman_routes.repo_list) + app.post ("/repos", ppman_routes.repo_add) + app.get ("/repos/:repo_slug", ppman_routes.repo_info) + app.get ("/repos/:repo_slug/packages", ppman_routes.repo_packages) + app.get ("/repos/:repo_slug/packages/:language/:version", ppman_routes.package_info) + app.post ("/repos/:repo_slug/packages/:language/:version", ppman_routes.package_install) + app.delete("/repos/:repo_slug/packages/:language/:version", ppman_routes.package_uninstall) //TODO + + const executor_routes = require('./executor/routes') + app.post ("/jobs", executor_routes.run_job) + + + + + logger.debug("Calling app.listen") + const [address,port] = config.bind_address.split(":") + + app.listen(port, address, ()=>{ + logger.info("API server started on", config.bind_address) + }) + + logger.debug("Setting up flush timers") + setInterval(cache.flush,config.cache_flush_time,path.join(config.data_directory,globals.data_directories.cache)) + setInterval(state.save,config.state_flush_time,path.join(config.data_directory,globals.data_files.state)) +})() \ No newline at end of file diff --git a/api/src/ppman/package.js b/api/src/ppman/package.js new file mode 100644 index 0000000..e3e69cc --- /dev/null +++ b/api/src/ppman/package.js @@ -0,0 +1,170 @@ +const logger = require("logplease").create("ppman/package") +const semver = require("semver") +const config = require("../config") +const globals = require("../globals") +const helpers = require("../helpers") +const path = require("path") +const fs = require("fs") +const util = require("util") +const cp = require("child_process") +const crypto = require("crypto") +const runtime = require("../runtime") + +class Package { + constructor(repo, {author, language, version, checksums, dependencies, size, buildfile, download, signature}){ + this.author = author + this.language = language + this.version = semver.parse(version) + this.checksums = checksums + this.dependencies = dependencies + this.size = size + this.buildfile = buildfile + this.download = download + this.signature = signature + + this.repo = repo + + } + + get installed(){ + return fs.exists_sync(path.join(this.install_path, globals.pkg_installed_file)) + } + + get download_url(){ + return helpers.add_url_base_if_required(this.download, this.repo.base_u_r_l) + } + + get install_path(){ + return path.join(config.data_directory, + globals.data_directories.packages, + this.language, + this.version.raw) + } + + async install(){ + if(this.installed) throw new Error("Already installed") + logger.info(`Installing ${this.language}-${this.version.raw}`) + + if(fs.exists_sync(this.install_path)){ + logger.warn(`${this.language}-${this.version.raw} has residual files. Removing them.`) + await util.promisify(fs.rm)(this.install_path, {recursive: true, force: true}) + } + + logger.debug(`Making directory ${this.install_path}`) + await util.promisify(fs.mkdir)(this.install_path, {recursive: true}) + + + logger.debug(`Downloading package from ${this.download_url} in to ${this.install_path}`) + const pkgfile = helpers.url_basename(this.download_url) + const pkgpath = path.join(this.install_path, pkgfile) + await helpers.buffer_from_u_r_l(this.download_url) + .then(buf=> util.promisify(fs.write_file)(pkgpath, buf)) + + logger.debug("Validating checksums") + Object.keys(this.checksums).forEach(algo => { + var val = this.checksums[algo] + logger.debug(`Assert ${algo}(${pkgpath}) == ${val}`) + var cs = crypto.create_hash(algo) + .update(fs.read_file_sync(pkgpath)) + .digest("hex") + if(cs != val) throw new Error(`Checksum miss-match want: ${val} got: ${cs}`) + }) + + await this.repo.importKeys() + + logger.debug("Validating signatutes") + await new Promise((resolve,reject)=>{ + const gpgspawn = cp.spawn("gpg", ["--verify", "-", pkgpath], { + stdio: ["pipe", "ignore", "ignore"] + }) + + gpgspawn.once("exit", (code, _) => { + if(code == 0) resolve() + else reject(new Error("Invalid signature")) + }) + + gpgspawn.once("error", reject) + + gpgspawn.stdin.write(this.signature) + gpgspawn.stdin.end() + + }) + + + logger.debug(`Extracting package files from archive ${pkgfile} in to ${this.install_path}`) + await new Promise((resolve, reject)=>{ + const proc = cp.exec(`bash -c 'cd "${this.install_path}" && tar xzf ${pkgfile}'`) + proc.once("exit", (code,_)=>{ + if(code == 0) resolve() + else reject(new Error("Failed to extract package")) + }) + proc.stdout.pipe(process.stdout) + proc.stderr.pipe(process.stderr) + + proc.once("error", reject) + }) + + logger.debug("Ensuring binary files exist for package") + const pkgbin = path.join(this.install_path, `${this.language}-${this.version.raw}`) + try{ + const pkgbinstat = await util.promisify(fs.stat)(pkgbin) + //eslint-disable-next-line snakecasejs/snakecasejs + if(!pkgbinstat.isDirectory()) throw new Error() + }catch(err){ + throw new Error(`Invalid package: could not find ${this.language}-${this.version.raw}/ contained within package files`) + } + + logger.debug("Symlinking into runtimes") + await util.promisify(fs.symlink)( + pkgbin, + path.join(config.data_directory, + globals.data_directories.runtimes, + `${this.language}-${this.version.raw}`) + ).catch((err)=>err) //catch + + + logger.debug("Registering runtime") + const pkgruntime = new runtime.Runtime(this.install_path) + + + logger.debug("Caching environment") + const required_pkgs = [pkgruntime, ...pkgruntime.get_all_dependencies()] + const get_env_command = [...required_pkgs.map(p=>`cd "${p.runtime_dir}"; source environment; `), + "env" ].join(" ") + + const envout = await new Promise((resolve, reject)=>{ + var stdout = "" + const proc = cp.spawn("env",["-i","bash","-c",`${get_env_command}`], { + stdio: ["ignore", "pipe", "pipe"]}) + proc.once("exit", (code,_)=>{ + if(code == 0) resolve(stdout) + else reject(new Error("Failed to cache environment")) + }) + + proc.stdout.on("data", (data)=>{ + stdout += data + }) + + proc.once("error", reject) + }) + + const filtered_env = envout.split("\n") + .filter(l=>!["PWD","OLDPWD","_", "SHLVL"].includes(l.split("=",2)[0])) + .join("\n") + + await util.promisify(fs.write_file)(path.join(this.install_path, ".env"), filtered_env) + + logger.debug("Writing installed state to disk") + await util.promisify(fs.write_file)(path.join(this.install_path, globals.pkg_installed_file), Date.now().toString()) + + logger.info(`Installed ${this.language}-${this.version.raw}`) + + return { + language: this.language, + version: this.version.raw + } + } +} + + +module.exports = {Package} \ No newline at end of file diff --git a/api/src/ppman/repo.js b/api/src/ppman/repo.js new file mode 100644 index 0000000..77fb8e3 --- /dev/null +++ b/api/src/ppman/repo.js @@ -0,0 +1,66 @@ +const logger = require("logplease").create("ppman/repo") +const cache = require("../cache") +const CACHE_CONTEXT = "repo" + +const cp = require("child_process") +const yaml = require("js-yaml") +const { Package } = require("./package") +const helpers = require("../helpers") + +class Repository { + constructor(slug, url){ + this.slug = slug + this.url = new URL(url) + this.keys = [] + this.packages = [] + this.base_u_r_l="" + logger.debug(`Created repo slug=${this.slug} url=${this.url}`) + } + + get cache_key(){ + return cache.cache_key(CACHE_CONTEXT, this.slug) + } + + async load(){ + try{ + var index = await cache.get(this.cache_key,async ()=>{ + return helpers.buffer_from_u_r_l(this.url) + }) + + var repo = yaml.load(index) + if(repo.schema != "ppman-repo-1"){ + throw new Error("YAML Schema unknown") + } + + this.keys = repo.keys + this.packages = repo.packages.map(pkg => new Package(this, pkg)) + this.base_u_r_l = repo.baseurl + }catch(err){ + logger.error(`Failed to load repository ${this.slug}:`,err.message) + } + } + + + async importKeys(){ + await this.load(); + logger.info(`Importing keys for repo ${this.slug}`) + + await new Promise((resolve,reject)=>{ + const gpgspawn = cp.spawn("gpg", ['--receive-keys', this.keys], { + stdio: ["ignore", "ignore", "ignore"] + }) + + gpgspawn.once("exit", (code, _) => { + if(code == 0) resolve() + else reject(new Error("Failed to import keys")) + }) + + gpgspawn.once("error", reject) + + }) + + } + +} + +module.exports = {Repository} \ No newline at end of file diff --git a/api/src/ppman/routes.js b/api/src/ppman/routes.js new file mode 100644 index 0000000..13818f4 --- /dev/null +++ b/api/src/ppman/routes.js @@ -0,0 +1,136 @@ +const repos = new Map() +const state = require("../state") +const logger = require("logplease").create("ppman/routes") +const {Repository} = require("./repo") +const semver = require("semver") + +async function get_or_construct_repo(slug){ + if(repos.has(slug))return repos.get(slug) + if(state.state.get("repositories").has(slug)){ + const repo_url = state.state.get("repositories").get(slug) + const repo = new Repository(slug, repo_url) + await repo.load() + repos.set(slug, repo) + return repo + } + logger.warn(`Requested repo ${slug} does not exist`) + return null +} + +async function get_package(repo, lang, version){ + var candidates = repo.packages.filter( + pkg => pkg.language == lang && semver.satisfies(pkg.version, version) + ) + return candidates.sort((a,b)=>semver.rcompare(a.version,b.version))[0] || null +} + +module.exports = { + async repo_list(req,res){ + // GET /repos + + logger.debug("Request for repoList") + res.json_success({ + repos: (await Promise.all( + [...state.state.get("repositories").keys()].map( async slug => await get_or_construct_repo(slug)) + )).map(repo=>({ + slug: repo.slug, + url: repo.url, + packages: repo.packages.length + })) + }) + }, + async repo_add(req, res){ + // POST /repos + + logger.debug(`Request for repoAdd slug=${req.body.slug} url=${req.body.url}`) + if(!req.body.slug) + return res.json_error("slug is missing from request body", 400) + if(!req.body.url) + return res.json_error("url is missing from request body", 400) + + const repo_state = state.state.get("repositories") + + if(repo_state.has(req.body.slug)) return res.json_error(`repository ${req.body.slug} already exists`, 409) + + repo_state.set(req.body.slug, req.body.url) + logger.info(`Repository ${req.body.slug} added url=${req.body.url}`) + + return res.json_success(req.body.slug) + }, + async repo_info(req, res){ + // GET /repos/:slug + + logger.debug(`Request for repoInfo for ${req.params.repo_slug}`) + const repo = await get_or_construct_repo(req.params.repo_slug) + + if(repo == null) return res.json_error(`Requested repo ${req.params.repo_slug} does not exist`, 404) + + res.json_success({ + slug: repo.slug, + url: repo.url, + packages: repo.packages.length + }) + }, + async repo_packages(req, res){ + // GET /repos/:slug/packages + logger.debug("Request to repoPackages") + + const repo = await get_or_construct_repo(req.params.repo_slug) + if(repo == null) return res.json_error(`Requested repo ${req.params.repo_slug} does not exist`, 404) + + res.json_success({ + packages: repo.packages.map(pkg=>({ + language: pkg.language, + language_version: pkg.version.raw, + installed: pkg.installed + })) + }) + }, + async package_info(req, res){ + // GET /repos/:slug/packages/:language/:version + + logger.debug("Request to packageInfo") + + const repo = await get_or_construct_repo(req.params.repo_slug) + if(repo == null) return res.json_error(`Requested repo ${req.params.repo_slug} does not exist`, 404) + + const package = await get_package(repo, req.params.language, req.params.version) + if(package == null) return res.json_error(`Requested package ${req.params.language}-${req.params.version} does not exist`, 404) + + res.json_success({ + language: package.language, + language_version: package.version.raw, + author: package.author, + buildfile: package.buildfile, + size: package.size, + dependencies: package.dependencies, + installed: package.installed + }) + }, + async package_install(req,res){ + // POST /repos/:slug/packages/:language/:version + + logger.debug("Request to packageInstall") + + const repo = await get_or_construct_repo(req.params.repo_slug) + if(repo == null) return res.json_error(`Requested repo ${req.params.repo_slug} does not exist`, 404) + + const package = await get_package(repo, req.params.language, req.params.version) + if(package == null) return res.json_error(`Requested package ${req.params.language}-${req.params.version} does not exist`, 404) + + try{ + const response = await package.install() + return res.json_success(response) + }catch(err){ + logger.error(`Error while installing package ${package.language}-${package.version}:`, err.message) + res.json_error(err.message,500) + } + + + }, + async package_uninstall(req,res){ + // DELETE /repos/:slug/packages/:language/:version + + res.json(req.body) //TODO + } +} \ No newline at end of file diff --git a/api/src/runtime.js b/api/src/runtime.js new file mode 100644 index 0000000..4686d06 --- /dev/null +++ b/api/src/runtime.js @@ -0,0 +1,85 @@ +const logger = require("logplease").create("runtime") +const semver = require("semver") +const config = require("./config") +const globals = require("./globals") +const fs = require("fs") +const path = require("path") + +const runtimes = [] + +class Runtime { + #env_vars + #compiled + constructor(package_dir){ + const {language, version, author, dependencies, build_platform} = JSON.parse( + fs.read_file_sync(path.join(package_dir, "pkg-info.json")) + ) + + this.pkgdir = package_dir + this.language = language + this.version = semver.parse(version) + this.author = author + this.dependencies = dependencies + + if(build_platform != globals.platform){ + logger.warn(`Package ${language}-${version} was built for platform ${build_platform}, but our platform is ${globals.platform}`) + } + + logger.debug(`Package ${language}-${version} was loaded`) + runtimes.push(this) + } + + get env_file_path(){ + return path.join(this.runtime_dir, "environment") + } + + get runtime_dir(){ + return path.join(config.data_directory,globals.data_directories.runtimes, this.toString()) + } + + get_all_dependencies(){ + const res = [] + Object.keys(this.dependencies).forEach(dep => { + const selector = this.dependencies[dep] + const lang = module.exports.get_latest_runtime_matching_language_version(dep, selector) + res.push(lang) + res.concat(lang.get_all_dependencies(lang)) + }) + return res + } + + get compile(){ + if(this.#compiled === undefined) this.#compiled = fs.existsSync(path.join(this.pkgdir, "compile")) + return this.#compiled + } + + get env_vars(){ + if(!this.#env_vars){ + const env_file = path.join(this.pkgdir, ".env") + const env_content = fs.read_file_sync(env_file).toString() + this.#env_vars = {} + env_content + .split("\n") + .map(line => line.split("=",2)) + .forEach(([key,val]) => { + this.#env_vars[key] = val + }) + } + return this.#env_vars + } + + toString(){ + return `${this.language}-${this.version.raw}` + } +} + +module.exports = runtimes +module.exports.Runtime = Runtime +module.exports.get_runtimes_matching_language_version = function(lang, ver){ + return runtimes.filter(rt => rt.language == lang && semver.satisfies(rt.version, ver)) +} +module.exports.get_latest_runtime_matching_language_version = function(lang, ver){ + return module.exports.get_runtimes_matching_language_version(lang, ver) + .sort((a,b) => semver.rcompare(a.version, b.version))[0] +} + diff --git a/api/src/state.js b/api/src/state.js new file mode 100644 index 0000000..1122a3b --- /dev/null +++ b/api/src/state.js @@ -0,0 +1,45 @@ +const fs = require("fs") +const util = require("util") + +const logger = require("logplease").create("state") +const state = new Map() + +function replacer(key, value) { + if(value instanceof Map) { + return { + data_type: "Map", + value: Array.from(value.entries()), + } + } else { + return value + } +} + +function reviver(key, value) { + if(typeof value === "object" && value !== null) { + if (value.data_type === "Map") { + return new Map(value.value) + } + } + return value +} + + +module.exports = { + state, + async load(data_file){ + if(fs.exists_sync(data_file)){ + logger.info("Loading state from file") + var content = await util.promisify(fs.read_file)(data_file) + var obj = JSON.parse(content.toString(), reviver); + [...obj.keys()].forEach(k => state.set(k, obj.get(k))) + }else{ + logger.info("Creating new statefile") + state.set("repositories", new Map().set("offical", "https://repo.pistonee.org/index.yaml")) + } + }, + async save(data_file){ + logger.info("Saving state to disk") + await util.promisify(fs.write_file)(data_file, JSON.stringify(state, replacer)) + } +} \ No newline at end of file diff --git a/api/yarn.lock b/api/yarn.lock new file mode 100644 index 0000000..7f679dd --- /dev/null +++ b/api/yarn.lock @@ -0,0 +1,1185 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@babel/code-frame@7.12.11": + version "7.12.11" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" + integrity sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw== + dependencies: + "@babel/highlight" "^7.10.4" + +"@babel/helper-validator-identifier@^7.12.11": + version "7.12.11" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz#c9a1f021917dcb5ccf0d4e453e399022981fc9ed" + integrity sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw== + +"@babel/highlight@^7.10.4": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.12.13.tgz#8ab538393e00370b26271b01fa08f7f27f2e795c" + integrity sha512-kocDQvIbgMKlWxXe9fof3TQ+gkIPOUSEYhJjqUjvKMez3krV7vbzYCDq39Oj11UAVK7JqPVGQPlgE85dPNlQww== + dependencies: + "@babel/helper-validator-identifier" "^7.12.11" + chalk "^2.0.0" + js-tokens "^4.0.0" + +"@eslint/eslintrc@^0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.3.0.tgz#d736d6963d7003b6514e6324bec9c602ac340318" + integrity sha512-1JTKgrOKAHVivSvOYw+sJOunkBjUOvjqWk1DPja7ZFhIS2mX/4EgTT8M7eTK9jrKhL/FvXXEbQwIs3pg1xp3dg== + dependencies: + ajv "^6.12.4" + debug "^4.1.1" + espree "^7.3.0" + globals "^12.1.0" + ignore "^4.0.6" + import-fresh "^3.2.1" + js-yaml "^3.13.1" + lodash "^4.17.20" + minimatch "^3.0.4" + strip-json-comments "^3.1.1" + +accepts@~1.3.7: + version "1.3.7" + resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" + integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== + dependencies: + mime-types "~2.1.24" + negotiator "0.6.2" + +acorn-jsx@^5.3.1: + version "5.3.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.1.tgz#fc8661e11b7ac1539c47dbfea2e72b3af34d267b" + integrity sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng== + +acorn@^7.4.0: + version "7.4.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" + integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== + +ajv@^6.10.0, ajv@^6.12.4: + version "6.12.6" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" + integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== + dependencies: + fast-deep-equal "^3.1.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +ajv@^7.0.2: + version "7.1.1" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-7.1.1.tgz#1e6b37a454021fa9941713f38b952fc1c8d32a84" + integrity sha512-ga/aqDYnUy/o7vbsRTFhhTsNeXiYb5JWDIcRIeZfwRNCefwjNTVYCGdGSUrEmiu3yDK3vFvNbgJxvrQW4JXrYQ== + dependencies: + fast-deep-equal "^3.1.1" + json-schema-traverse "^1.0.0" + require-from-string "^2.0.2" + uri-js "^4.2.2" + +ansi-colors@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" + integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== + +ansi-regex@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" + integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== + +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +ansi-styles@^4.0.0, ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== + dependencies: + sprintf-js "~1.0.2" + +argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== + +array-flatten@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" + integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= + +astral-regex@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" + integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + +body-parser@1.19.0, body-parser@^1.19.0: + version "1.19.0" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" + 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" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +bytes@3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" + integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== + +callsites@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" + integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== + +chalk@^2.0.0: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chalk@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a" + integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +cliui@^7.0.2: + version "7.0.4" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" + integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^7.0.0" + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +content-disposition@0.5.3: + version "0.5.3" + resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd" + integrity sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g== + dependencies: + safe-buffer "5.1.2" + +content-type@~1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" + integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== + +cookie-signature@1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" + integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= + +cookie@0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" + integrity sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== + +cross-spawn@^7.0.2: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + +debug@2.6.9: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + +debug@^4.0.1, debug@^4.1.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" + integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== + dependencies: + ms "2.1.2" + +deep-is@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= + +depd@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" + integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= + +destroy@~1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" + integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= + +doctrine@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" + integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== + dependencies: + esutils "^2.0.2" + +ee-first@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" + integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +encodeurl@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" + integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= + +enquirer@^2.3.5: + version "2.3.6" + resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" + integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== + dependencies: + ansi-colors "^4.1.1" + +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + +escape-html@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" + integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= + +escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= + +eslint-plugin-snakecasejs@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-snakecasejs/-/eslint-plugin-snakecasejs-2.2.0.tgz#e35bf4eee2f375a9ba79de68c96303e06f8acf86" + integrity sha512-vdQHT2VvzPpJHHPAVXjtyAZ/CfiJqNCa2d9kn6XMapWBN2Uio/nzL957TooNa6gumlHabBAhB5eSNmqwHgu8gA== + +eslint-scope@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" + integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== + dependencies: + esrecurse "^4.3.0" + estraverse "^4.1.1" + +eslint-utils@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27" + integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg== + dependencies: + eslint-visitor-keys "^1.1.0" + +eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" + integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== + +eslint-visitor-keys@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz#21fdc8fbcd9c795cc0321f0563702095751511a8" + integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ== + +eslint@^7.20.0: + version "7.20.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.20.0.tgz#db07c4ca4eda2e2316e7aa57ac7fc91ec550bdc7" + integrity sha512-qGi0CTcOGP2OtCQBgWZlQjcTuP0XkIpYFj25XtRTQSHC+umNnp7UMshr2G8SLsRFYDdAPFeHOsiteadmMH02Yw== + dependencies: + "@babel/code-frame" "7.12.11" + "@eslint/eslintrc" "^0.3.0" + ajv "^6.10.0" + chalk "^4.0.0" + cross-spawn "^7.0.2" + debug "^4.0.1" + doctrine "^3.0.0" + enquirer "^2.3.5" + eslint-scope "^5.1.1" + eslint-utils "^2.1.0" + eslint-visitor-keys "^2.0.0" + espree "^7.3.1" + esquery "^1.4.0" + esutils "^2.0.2" + file-entry-cache "^6.0.0" + functional-red-black-tree "^1.0.1" + glob-parent "^5.0.0" + globals "^12.1.0" + ignore "^4.0.6" + import-fresh "^3.0.0" + imurmurhash "^0.1.4" + is-glob "^4.0.0" + js-yaml "^3.13.1" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.4.1" + lodash "^4.17.20" + minimatch "^3.0.4" + natural-compare "^1.4.0" + optionator "^0.9.1" + progress "^2.0.0" + regexpp "^3.1.0" + semver "^7.2.1" + strip-ansi "^6.0.0" + strip-json-comments "^3.1.0" + table "^6.0.4" + text-table "^0.2.0" + v8-compile-cache "^2.0.3" + +espree@^7.3.0, espree@^7.3.1: + version "7.3.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-7.3.1.tgz#f2df330b752c6f55019f8bd89b7660039c1bbbb6" + integrity sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g== + dependencies: + acorn "^7.4.0" + acorn-jsx "^5.3.1" + eslint-visitor-keys "^1.3.0" + +esprima@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== + +esquery@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.4.0.tgz#2148ffc38b82e8c7057dfed48425b3e61f0f24a5" + integrity sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w== + dependencies: + estraverse "^5.1.0" + +esrecurse@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" + integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== + dependencies: + estraverse "^5.2.0" + +estraverse@^4.1.1: + version "4.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" + integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== + +estraverse@^5.1.0, estraverse@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880" + integrity sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ== + +esutils@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" + integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== + +etag@~1.8.1: + version "1.8.1" + resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" + integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= + +express@^4.17.1: + version "4.17.1" + resolved "https://registry.yarnpkg.com/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134" + 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" + +fast-deep-equal@^3.1.1: + version "3.1.3" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" + integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== + +fast-json-stable-stringify@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" + integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== + +fast-levenshtein@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= + +file-entry-cache@^6.0.0: + version "6.0.1" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" + integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== + dependencies: + flat-cache "^3.0.4" + +finalhandler@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d" + 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" + +flat-cache@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" + integrity sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg== + dependencies: + flatted "^3.1.0" + rimraf "^3.0.2" + +flatted@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.1.1.tgz#c4b489e80096d9df1dfc97c79871aea7c617c469" + integrity sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA== + +forwarded@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84" + integrity sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ= + +fresh@0.5.2: + version "0.5.2" + resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" + integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + +functional-red-black-tree@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= + +get-caller-file@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + +glob-parent@^5.0.0: + version "5.1.1" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.1.tgz#b6c1ef417c4e5663ea498f1c45afac6916bbc229" + integrity sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ== + dependencies: + is-glob "^4.0.1" + +glob@^7.1.3: + version "7.1.6" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" + integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globals@^12.1.0: + version "12.4.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-12.4.0.tgz#a18813576a41b00a24a97e7f815918c2e19925f8" + integrity sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg== + dependencies: + type-fest "^0.8.1" + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +http-errors@1.7.2: + version "1.7.2" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.2.tgz#4f5029cf13239f31036e5b2e55292bcfbcc85c8f" + 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" + +http-errors@~1.7.2: + version "1.7.3" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" + integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== + dependencies: + depd "~1.1.2" + inherits "2.0.4" + setprototypeof "1.1.1" + statuses ">= 1.5.0 < 2" + toidentifier "1.0.0" + +iconv-lite@0.4.24: + version "0.4.24" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + +ignore@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" + integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== + +import-fresh@^3.0.0, import-fresh@^3.2.1: + version "3.3.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" + integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== + dependencies: + parent-module "^1.0.0" + resolve-from "^4.0.0" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +inherits@2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= + +ipaddr.js@1.9.1: + version "1.9.1" + resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" + integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== + +is-docker@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.1.1.tgz#4125a88e44e450d384e09047ede71adc2d144156" + integrity sha512-ZOoqiXfEwtGknTiuDEy8pN2CfE3TxMHprvNer1mXiqwkOT77Rw3YVrUQ52EqAOU3QAWDQ+bQdx7HJzrv7LS2Hw== + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= + +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + +is-glob@^4.0.0, is-glob@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" + integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== + dependencies: + is-extglob "^2.1.1" + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + +js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +js-yaml@^3.13.1: + version "3.14.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" + integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +js-yaml@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.0.0.tgz#f426bc0ff4b4051926cd588c71113183409a121f" + integrity sha512-pqon0s+4ScYUvX30wxQi3PogGFAlUyH0awepWvwkj4jD4v+ova3RiYw8bmA6x2rDrEaj8i/oWKoRxpVNW+Re8Q== + dependencies: + argparse "^2.0.1" + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +json-schema-traverse@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" + integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== + +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= + +levn@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" + integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== + dependencies: + prelude-ls "^1.2.1" + type-check "~0.4.0" + +lodash@^4.17.20: + version "4.17.20" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" + integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== + +logplease@^1.2.15: + version "1.2.15" + resolved "https://registry.yarnpkg.com/logplease/-/logplease-1.2.15.tgz#3da442e93751a5992cc19010a826b08d0293c48a" + integrity sha512-jLlHnlsPSJjpwUfcNyUxXCl33AYg2cHhIf9QhGL2T4iPT0XPB+xP1LRKFPgIg1M/sg9kAJvy94w9CzBNrfnstA== + +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + +media-typer@0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" + integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= + +merge-descriptors@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" + integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= + +methods@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" + integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= + +mime-db@1.46.0: + version "1.46.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.46.0.tgz#6267748a7f799594de3cbc8cde91def349661cee" + integrity sha512-svXaP8UQRZ5K7or+ZmfNhg2xX3yKDMUzqadsSqi4NCH/KomcH75MAMYAGVlvXn4+b/xOPhS3I2uHKRUzvjY7BQ== + +mime-types@~2.1.24: + version "2.1.29" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.29.tgz#1d4ab77da64b91f5f72489df29236563754bb1b2" + integrity sha512-Y/jMt/S5sR9OaqteJtslsFZKWOIIqMACsJSiHghlCAyhf7jfVYjKBmLiX8OgpWeW+fjJ2b+Az69aPFPkUOY6xQ== + dependencies: + mime-db "1.46.0" + +mime@1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" + integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== + +minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + +ms@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" + integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= + +negotiator@0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" + integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== + +nocamel@*: + version "1.0.2" + resolved "https://registry.yarnpkg.com/nocamel/-/nocamel-1.0.2.tgz#13ff04ffacd5487ba65555c0dcafcf8c95c918ba" + integrity sha512-CRkRSRLChj+H6e4lHS851QS6YGCoTETnSG/z+XGanxLSsTbBkvEeIWaIYMKzuBznFwWM0YcLGXsFyXg4xWYnWA== + +node-fetch@^2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" + integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== + +on-finished@~2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" + integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= + dependencies: + ee-first "1.1.1" + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +optionator@^0.9.1: + version "0.9.1" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499" + integrity sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw== + dependencies: + deep-is "^0.1.3" + fast-levenshtein "^2.0.6" + levn "^0.4.1" + prelude-ls "^1.2.1" + type-check "^0.4.0" + word-wrap "^1.2.3" + +parent-module@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" + integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== + dependencies: + callsites "^3.0.0" + +parseurl@~1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" + integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + +path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + +path-to-regexp@0.1.7: + version "0.1.7" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" + integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= + +prelude-ls@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" + integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== + +progress@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" + integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== + +proxy-addr@~2.0.5: + version "2.0.6" + resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.6.tgz#fdc2336505447d3f2f2c638ed272caf614bbb2bf" + integrity sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw== + dependencies: + forwarded "~0.1.2" + ipaddr.js "1.9.1" + +punycode@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== + +qs@6.7.0: + version "6.7.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" + integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== + +range-parser@~1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" + integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== + +raw-body@2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.0.tgz#a1ce6fb9c9bc356ca52e89256ab59059e13d0332" + 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" + +regexpp@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.1.0.tgz#206d0ad0a5648cffbdb8ae46438f3dc51c9f78e2" + integrity sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q== + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= + +require-from-string@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" + integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== + +resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== + +rimraf@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" + integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== + dependencies: + glob "^7.1.3" + +safe-buffer@5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +"safer-buffer@>= 2.1.2 < 3": + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +semver@^7.2.1, semver@^7.3.4: + version "7.3.4" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.4.tgz#27aaa7d2e4ca76452f98d3add093a72c943edc97" + integrity sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw== + dependencies: + lru-cache "^6.0.0" + +send@0.17.1: + version "0.17.1" + resolved "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8" + 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" + +serve-static@1.14.1: + version "1.14.1" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.1.tgz#666e636dc4f010f7ef29970a88a674320898b2f9" + 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" + +setprototypeof@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" + integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== + +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + +slice-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b" + integrity sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ== + dependencies: + ansi-styles "^4.0.0" + astral-regex "^2.0.0" + is-fullwidth-code-point "^3.0.0" + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= + +"statuses@>= 1.5.0 < 2", statuses@~1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" + integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= + +string-width@^4.1.0, string-width@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" + integrity sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.0" + +strip-ansi@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" + integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== + dependencies: + ansi-regex "^5.0.0" + +strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" + integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +table@^6.0.4: + version "6.0.7" + resolved "https://registry.yarnpkg.com/table/-/table-6.0.7.tgz#e45897ffbcc1bcf9e8a87bf420f2c9e5a7a52a34" + integrity sha512-rxZevLGTUzWna/qBLObOe16kB2RTnnbhciwgPbMMlazz1yZGVEgnZK762xyVdVznhqxrfCeBMmMkgOOaPwjH7g== + dependencies: + ajv "^7.0.2" + lodash "^4.17.20" + slice-ansi "^4.0.0" + string-width "^4.2.0" + +text-table@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= + +toidentifier@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" + integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== + +type-check@^0.4.0, type-check@~0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" + integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== + dependencies: + prelude-ls "^1.2.1" + +type-fest@^0.8.1: + version "0.8.1" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" + integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== + +type-is@~1.6.17, type-is@~1.6.18: + version "1.6.18" + resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" + integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== + dependencies: + media-typer "0.3.0" + mime-types "~2.1.24" + +unpipe@1.0.0, unpipe@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" + integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= + +uri-js@^4.2.2: + version "4.4.1" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" + integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== + dependencies: + punycode "^2.1.0" + +utils-merge@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" + integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= + +uuid@^8.3.2: + version "8.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" + integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== + +v8-compile-cache@^2.0.3: + version "2.2.0" + resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz#9471efa3ef9128d2f7c6a7ca39c4dd6b5055b132" + integrity sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q== + +vary@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" + integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= + +which@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + +word-wrap@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" + integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== + +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +y18n@^5.0.5: + version "5.0.5" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.5.tgz#8769ec08d03b1ea2df2500acef561743bbb9ab18" + integrity sha512-hsRUr4FFrvhhRH12wOdfs38Gy7k2FFzB9qgN9v3aLykRq0dRcdcpz5C9FxdS2NuhOrI/628b/KSTJ3rwHysYSg== + +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== + +yargs-parser@^20.2.2: + version "20.2.5" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.5.tgz#5d37729146d3f894f39fc94b6796f5b239513186" + integrity sha512-jYRGS3zWy20NtDtK2kBgo/TlAoy5YUuhD9/LZ7z7W4j1Fdw2cqD0xEEclf8fxc8xjD6X5Qr+qQQwCEsP8iRiYg== + +yargs@^16.2.0: + version "16.2.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" + integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.0" + y18n "^5.0.5" + yargs-parser "^20.2.2" From 291cbe8c50b26e55f7135e0a2207d920023b4d65 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 21 Feb 2021 03:29:13 +1300 Subject: [PATCH 020/385] pkg: fix secondary rules --- packages/secondary.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/secondary.mk b/packages/secondary.mk index a748fa6..2def001 100644 --- a/packages/secondary.mk +++ b/packages/secondary.mk @@ -15,8 +15,9 @@ cleanup: $(patsubst %,%/cleanup,${VERSIONS}) %/${LANGUAGE}-%.pkg.tar.gz: %/Makefile $(MAKE) -C $(shell dirname $<) + %/Makefile: @mkdir -p $(shell dirname $@) @echo 'VERSION=$(patsubst %/Makefile,%,$@)' > $@ - @echo 'NAME=${LANGUAGE}' > $@ + @echo 'NAME=${LANGUAGE}' >> $@ @echo 'include ../base.mk' >> $@ From f1c082bfa135f3078bdedf79a16d5ec2909f5d86 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 21 Feb 2021 03:29:32 +1300 Subject: [PATCH 021/385] fix(python *): fix python rules --- packages/python/base.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/python/base.mk b/packages/python/base.mk index 8c3b746..722f8d5 100644 --- a/packages/python/base.mk +++ b/packages/python/base.mk @@ -15,5 +15,5 @@ ${NAME}-${VERSION}/: Python-${VERSION}/ $(MAKE) -j$(or ${MAKE_JOBS},64) -C $< DESTDIR=../$@ $(MAKE) -j$(or ${MAKE_JOBS},64) -C $< altinstall || true -${NAME}-${VERSION}.tgz: +Python-${VERSION}.tgz: curl "https://www.python.org/ftp/python/${VERSION}/$@" -o $@ \ No newline at end of file From 216451d1aa8830d4b4010f87235078887fa506d8 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 21 Feb 2021 03:29:47 +1300 Subject: [PATCH 022/385] pkg: add tar.gz unpack rule --- packages/common.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/common.mk b/packages/common.mk index 08fc488..3b3d201 100644 --- a/packages/common.mk +++ b/packages/common.mk @@ -31,6 +31,9 @@ pkg-info.jq: %/: %.tgz tar xzf $< +%/: %.tar.gz + tar xzf $< + .PHONY: clean clean: rm -rf $(filter-out Makefile, $(wildcard *)) From 60c004eea9f646ee61f0d6ee23a828998b465685 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 21 Feb 2021 11:39:03 +1300 Subject: [PATCH 023/385] api: lint **everything** --- api/.eslintrc.json | 5 +- api/package.json | 1 + api/src/cache.js | 55 ++++++----- api/src/config.js | 158 ++++++++++++++--------------- api/src/executor/job.js | 147 ++++++++++++++------------- api/src/executor/routes.js | 34 +++---- api/src/globals.js | 32 +++--- api/src/helpers.js | 25 +++-- api/src/index.js | 124 +++++++++++------------ api/src/ppman/package.js | 198 ++++++++++++++++++------------------- api/src/ppman/repo.js | 70 ++++++------- api/src/ppman/routes.js | 118 +++++++++++----------- api/src/runtime.js | 86 ++++++++-------- api/src/state.js | 40 ++++---- api/yarn.lock | 152 +++++++++++++++++++++++++++- docker-compose.yaml | 20 ++++ packages/common.mk | 2 +- repo/.gitignore | 3 + repo/Dockerfile | 8 ++ repo/README.MD | 3 + repo/make.sh | 7 ++ repo/mkindex.sh | 26 +++++ 22 files changed, 764 insertions(+), 550 deletions(-) create mode 100644 docker-compose.yaml create mode 100644 repo/.gitignore create mode 100644 repo/Dockerfile create mode 100644 repo/README.MD create mode 100644 repo/make.sh create mode 100755 repo/mkindex.sh diff --git a/api/.eslintrc.json b/api/.eslintrc.json index 4af7bf3..579bcfc 100644 --- a/api/.eslintrc.json +++ b/api/.eslintrc.json @@ -8,6 +8,7 @@ "snakecasejs" ], "extends": "eslint:recommended", + "parser": "babel-eslint", "parserOptions": { "ecmaVersion": 12 }, @@ -27,11 +28,11 @@ ], "quotes": [ "error", - "double" + "single" ], "semi": [ "error", - "never" + "always" ], "no-unused-vars": ["error", { "argsIgnorePattern": "^_"}], "snakecasejs/snakecasejs": "warn" diff --git a/api/package.json b/api/package.json index bee046b..a530298 100644 --- a/api/package.json +++ b/api/package.json @@ -16,6 +16,7 @@ "yargs": "^16.2.0" }, "devDependencies": { + "babel-eslint": "^10.1.0", "eslint": "^7.20.0", "eslint-plugin-snakecasejs": "^2.2.0" } diff --git a/api/src/cache.js b/api/src/cache.js index 97b31a1..469623a 100644 --- a/api/src/cache.js +++ b/api/src/cache.js @@ -1,54 +1,55 @@ -const globals = require("./globals") -const logger = require("logplease").create("cache") -const fs = require("fs"), path = require("path") -const util = require("util") +const globals = require('./globals'); +const logger = require('logplease').create('cache'); +const fs = require('fs/promises'), + fss = require('fs'), + path = require('path'); -const cache = new Map() +const cache = new Map(); module.exports = { - cache_key: (context, key) => Buffer.from(`${context}-${key}`).toString("base64"), + cache_key: (context, key) => Buffer.from(`${context}-${key}`).toString('base64'), has(key){ - return cache.has(key) && cache.get(key).expiry > Date.now() + return cache.has(key) && cache.get(key).expiry > Date.now(); }, async get(key, callback, ttl=globals.cache_ttl){ - logger.debug("get:", key) + logger.debug('get:', key); if(module.exports.has(key)){ - logger.debug("hit:",key) - return cache.get(key).data + logger.debug('hit:',key); + return cache.get(key).data; } - logger.debug("miss:", key) - var data = await callback() - cache.set(key, {data, expiry: Date.now() + ttl}) - return data + logger.debug('miss:', key); + var data = await callback(); + cache.set(key, {data, expiry: Date.now() + ttl}); + return data; }, async flush(cache_dir){ - logger.info("Flushing cache") + logger.info('Flushing cache'); cache.forEach((v,k)=>{ - var file_path = path.join(cache_dir, k) + var file_path = path.join(cache_dir, k); if(v.expiry < Date.now()){ //remove from cache - cache.delete(k) + cache.delete(k); fs.stat(file_path, (err, stats)=>{ - if(err) return //ignore - probably hasn't been flushed yet + if(err) return; //ignore - probably hasn't been flushed yet if(stats.is_file()) fs.rm(file_path, (err)=>{ - if(err) logger.warn(`Couldn't clean up on-disk cache file ${k}`) - }) - }) + if(err) logger.warn(`Couldn't clean up on-disk cache file ${k}`); + }); + }); }else{ //flush to disk - fs.write_file(file_path, JSON.stringify(v),()=>{}) + fs.write_file(file_path, JSON.stringify(v),()=>{}); } - }) + }); }, async load(cache_dir){ - return util.promisify(fs.readdir)(cache_dir) + return fs.readdir(cache_dir) .then(files => Promise.all(files.map( async file => { - cache.set(file, JSON.parse(fs.read_file_sync(path.join(cache_dir,file)).toString())) + cache.set(file, JSON.parse(fss.read_file_sync(path.join(cache_dir,file)).toString())); } - ))) + ))); } -} \ No newline at end of file +}; \ No newline at end of file diff --git a/api/src/config.js b/api/src/config.js index be4dae5..a2503bf 100644 --- a/api/src/config.js +++ b/api/src/config.js @@ -1,9 +1,9 @@ -const fs = require("fs") -const yargs = require("yargs") -const hide_bin = require("yargs/helpers").hideBin //eslint-disable-line snakecasejs/snakecasejs -const Logger = require("logplease") -const logger = Logger.create("config") -const yaml = require("js-yaml") +const fss = require('fs'); +const yargs = require('yargs'); +const hide_bin = require('yargs/helpers').hideBin; //eslint-disable-line snakecasejs/snakecasejs +const Logger = require('logplease'); +const logger = Logger.create('config'); +const yaml = require('js-yaml'); const header = `# # ____ _ _ @@ -16,151 +16,151 @@ const header = `# # github.com/engineer-man/piston # -` +`; const argv = yargs(hide_bin(process.argv)) - .usage("Usage: $0 -c [config]") - .demandOption("c") //eslint-disable-line snakecasejs/snakecasejs - .option("config", { - alias: "c", - describe: "config file to load from", - default: "/piston/config.yaml" + .usage('Usage: $0 -c [config]') + .demandOption('c') //eslint-disable-line snakecasejs/snakecasejs + .option('config', { + alias: 'c', + describe: 'config file to load from', + default: '/piston/config.yaml' }) - .option("make-config", { - alias: "m", - type: "boolean", - describe: "create config file and populate defaults if it does not already exist" - }).argv + .option('make-config', { + alias: 'm', + type: 'boolean', + describe: 'create config file and populate defaults if it does not already exist' + }).argv; const options = [ { - key: "log_level", - desc: "Level of data to log", - default: "INFO", + key: 'log_level', + desc: 'Level of data to log', + default: 'INFO', /* eslint-disable snakecasejs/snakecasejs */ options: Object.values(Logger.LogLevels), validators: [x=>Object.values(Logger.LogLevels).includes(x) || `Log level ${x} does not exist`] /* eslint-enable snakecasejs/snakecasejs */ }, { - key: "bind_address", - desc: "Address to bind REST API on\nThank @Bones for the number", - default: "0.0.0.0:6969", + key: 'bind_address', + desc: 'Address to bind REST API on\nThank @Bones for the number', + default: '0.0.0.0:6969', validators: [] }, { - key: "data_directory", - desc: "Absolute path to store all piston related data at", - default: "/piston", - validators: [x=> fs.exists_sync(x) || `Directory ${x} does not exist`] + key: 'data_directory', + desc: 'Absolute path to store all piston related data at', + default: '/piston', + validators: [x=> fss.exists_sync(x) || `Directory ${x} does not exist`] }, { - key: "cache_ttl", - desc: "Time in milliseconds to keep data in cache for at a maximum", + key: 'cache_ttl', + desc: 'Time in milliseconds to keep data in cache for at a maximum', default: 60 * 60 * 1000, validators: [] }, { - key: "cache_flush_time", - desc: "Interval in milliseconds to flush cache to disk at", + key: 'cache_flush_time', + desc: 'Interval in milliseconds to flush cache to disk at', default: 90 * 60 * 1000, //90 minutes validators: [] }, { - key: "state_flush_time", - desc: "Interval in milliseconds to flush state to disk at", + key: 'state_flush_time', + desc: 'Interval in milliseconds to flush state to disk at', default: 5000, // 5 seconds (file is tiny) validators: [] }, { - key: "runner_uid_min", - desc: "Minimum uid to use for runner", + key: 'runner_uid_min', + desc: 'Minimum uid to use for runner', default: 1000, validators: [] }, { - key: "runner_uid_max", - desc: "Maximum uid to use for runner", + key: 'runner_uid_max', + desc: 'Maximum uid to use for runner', default: 1500, validators: [] }, { - key: "runner_gid_min", - desc: "Minimum gid to use for runner", + key: 'runner_gid_min', + desc: 'Minimum gid to use for runner', default: 1000, validators: [] }, { - key: "runner_gid_max", - desc: "Maximum gid to use for runner", + key: 'runner_gid_max', + desc: 'Maximum gid to use for runner', default: 1500, validators: [] } -] +]; const default_config = [ - ...header.split("\n"), + ...header.split('\n'), ...options.map(option => ` ${[ - ...option.desc.split("\n"), - option.options?("Options: " + option.options.join(", ")):"" - ].filter(x=>x.length>0).map(x=>`# ${x}`).join("\n")} + ...option.desc.split('\n'), + option.options?('Options: ' + option.options.join(', ')):'' + ].filter(x=>x.length>0).map(x=>`# ${x}`).join('\n')} ${option.key}: ${option.default} - `)].join("\n") + `)].join('\n'); -logger.info(`Loading Configuration from ${argv.config}`) -!!argv["make-config"] && logger.debug("Make configuration flag is set") +logger.info(`Loading Configuration from ${argv.config}`); +!!argv['make-config'] && logger.debug('Make configuration flag is set'); -if(!!argv["make-config"] && !fs.exists_sync(argv.config)){ - logger.info("Writing default configuration...") +if(!!argv['make-config'] && !fss.exists_sync(argv.config)){ + logger.info('Writing default configuration...'); try { - fs.write_file_sync(argv.config, default_config) + fss.write_file_sync(argv.config, default_config); } catch (err) { - logger.error("Error writing default configuration:", err.message) - process.exit(1) + logger.error('Error writing default configuration:', err.message); + process.exit(1); } } -var config = {} -logger.debug("Reading config file") +var config = {}; +logger.debug('Reading config file'); try{ - const cfg_content = fs.read_file_sync(argv.config) + const cfg_content = fss.read_file_sync(argv.config); try{ - config = yaml.load(cfg_content) + config = yaml.load(cfg_content); }catch(err){ - logger.error("Error parsing configuration file:", err.message) - process.exit(1) + logger.error('Error parsing configuration file:', err.message); + process.exit(1); } }catch(err){ - logger.error("Error reading configuration from disk:", err.message) - process.exit(1) + logger.error('Error reading configuration from disk:', err.message); + process.exit(1); } -logger.debug("Validating config entries") -var errored=false +logger.debug('Validating config entries'); +var errored=false; options.forEach(opt => { - logger.debug("Checking key",opt.key) - var cfg_val = config[opt.key] + logger.debug('Checking key',opt.key); + var cfg_val = config[opt.key]; if(cfg_val == undefined){ - errored = true - logger.error(`Config key ${opt.key} does not exist on currently loaded configuration`) - return + errored = true; + logger.error(`Config key ${opt.key} does not exist on currently loaded configuration`); + return; } opt.validators.forEach(validator => { - var response = validator(cfg_val) + var response = validator(cfg_val); if(response !== true){ - errored = true - logger.error(`Config key ${opt.key} failed validation:`, response) - return + errored = true; + logger.error(`Config key ${opt.key} failed validation:`, response); + return; } - }) -}) + }); +}); -if(errored) process.exit(1) +if(errored) process.exit(1); -logger.info("Configuration successfully loaded") +logger.info('Configuration successfully loaded'); -module.exports = config +module.exports = config; diff --git a/api/src/executor/job.js b/api/src/executor/job.js index f56f3a7..b10e3ab 100644 --- a/api/src/executor/job.js +++ b/api/src/executor/job.js @@ -1,146 +1,145 @@ -const logger = require("logplease").create("executor/job") -const { v4: uuidv4 } = require("uuid") -const cp = require("child_process") -const path = require("path") -const config = require("../config"); -const globals = require("../globals"); -const fs = require("fs"); -const util = require("util"); +const logger = require('logplease').create('executor/job'); +const { v4: uuidv4 } = require('uuid'); +const cp = require('child_process'); +const path = require('path'); +const config = require('../config'); +const globals = require('../globals'); +const fs = require('fs/promises'); + const job_states = { - READY: Symbol("Ready to be primed"), - PRIMED: Symbol("Primed and ready for execution"), - EXECUTED: Symbol("Executed and ready for cleanup") -} + READY: Symbol('Ready to be primed'), + PRIMED: Symbol('Primed and ready for execution'), + EXECUTED: Symbol('Executed and ready for cleanup') +}; var uid=0; var gid=0; class Job { constructor(runtime, files, args, stdin, timeouts, main){ - this.uuid = uuidv4() - this.runtime = runtime - this.files = files - this.args = args - this.stdin = stdin - this.timeouts = timeouts - this.main = main + this.uuid = uuidv4(); + this.runtime = runtime; + this.files = files; + this.args = args; + this.stdin = stdin; + this.timeouts = timeouts; + this.main = main; - if(!Object.keys(this.files).includes(this.main)) - throw new Error(`Main file "${this.main}" will not be written to disk`) + if(!this.files.map(f=>f.name).includes(this.main)) + throw new Error(`Main file "${this.main}" will not be written to disk`); this.uid = config.runner_uid_min + uid; this.gid = config.runner_gid_min + gid; - uid++ - gid++ + uid++; + gid++; - uid %= (config.runner_uid_max - config.runner_uid_min) + 1 - gid %= (config.runner_gid_max - config.runner_gid_min) + 1 + uid %= (config.runner_uid_max - config.runner_uid_min) + 1; + gid %= (config.runner_gid_max - config.runner_gid_min) + 1; this.state = job_states.READY; this.dir = path.join(config.data_directory, globals.data_directories.jobs, this.uuid); } async prime(){ - logger.info(`Priming job uuid=${this.uuid}`) + logger.info(`Priming job uuid=${this.uuid}`); - logger.debug("Writing files to job cache") + logger.debug('Writing files to job cache'); - await util.promisify(fs.mkdir)(this.dir, {mode:0o700}) + await fs.mkdir(this.dir, {mode:0o700}); - const files = Object.keys(this.files).map(fileName => { - var content = this.files[fileName]; - return util.promisify(fs.writeFile)(path.join(this.dir, fileName), content) - }) + const files = this.files.map(({name: file_name, content}) => { + return fs.write_file(path.join(this.dir, file_name), content); + }); - await Promise.all(files) + await Promise.all(files); - logger.debug(`Transfering ownership uid=${this.uid} gid=${this.gid}`) - await util.promisify(fs.chown)(this.dir, this.uid, this.gid) + logger.debug(`Transfering ownership uid=${this.uid} gid=${this.gid}`); + await fs.chown(this.dir, this.uid, this.gid); - const chowns = Object.keys(this.files).map(fileName => { - return util.promisify(fs.chown)(path.join(this.dir, fileName), this.uid, this.gid) - }) + const chowns = this.files.map(({name:file_name}) => { + return fs.chown(path.join(this.dir, file_name), this.uid, this.gid); + }); - await Promise.all(chowns) + await Promise.all(chowns); this.state = job_states.PRIMED; - logger.debug("Primed job") + logger.debug('Primed job'); } async execute(){ - if(this.state != job_states.PRIMED) throw new Error("Job must be in primed state, current state: " + this.state.toString()) - logger.info(`Executing job uuid=${this.uuid} uid=${this.uid} gid=${this.gid} runtime=${this.runtime.toString()}`) - logger.debug(`Compiling`) + if(this.state != job_states.PRIMED) throw new Error('Job must be in primed state, current state: ' + this.state.toString()); + logger.info(`Executing job uuid=${this.uuid} uid=${this.uid} gid=${this.gid} runtime=${this.runtime.toString()}`); + logger.debug('Compiling'); const compile = this.runtime.compiled && await new Promise((resolve, reject) => { - var stderr, stdout = ""; - const proc = cp.spawn(this.runtime.pkgdir, [this.main, ...this.args] ,{ + var stderr, stdout = ''; + const proc = cp.spawn(path.join(this.runtime.pkgdir, 'compile'), [this.main, ...this.args] ,{ env: this.runtime.env_vars, stdio: ['pipe', 'pipe', 'pipe'], cwd: this.dir, uid: this.uid, gid: this.gid - }) + }); - const killTimeout = setTimeout(proc.kill, this.timeouts.compile, "SIGKILL") + const kill_timeout = setTimeout(proc.kill, this.timeouts.compile, 'SIGKILL'); - proc.stderr.on('data', d=>stderr += d) - proc.stdout.on('data', d=>stdout += d) + proc.stderr.on('data', d=>stderr += d); + proc.stdout.on('data', d=>stdout += d); proc.on('exit', (code, signal)=>{ - clearTimeout(killTimeout); - resolve({stdout, stderr, code, signal}) - }) + clearTimeout(kill_timeout); + resolve({stdout, stderr, code, signal}); + }); proc.on('error', (code, signal) => { - clearTimeout(killTimeout); - reject({stdout, stderr, code, signal}) - }) - }) + clearTimeout(kill_timeout); + reject({stdout, stderr, code, signal}); + }); + }); - logger.debug("Running") + logger.debug('Running'); const run = await new Promise((resolve, reject) => { - var stderr, stdout = ""; - const proc = cp.spawn('bash', [path.join(this.runtime.pkgdir, "run"), this.main, ...this.args] ,{ + var stderr, stdout = ''; + const proc = cp.spawn(path.join(this.runtime.pkgdir, 'run'), [this.main, ...this.args] ,{ env: this.runtime.env_vars, stdio: ['pipe', 'pipe', 'pipe'], cwd: this.dir, uid: this.uid, gid: this.gid - }) + }); - const killTimeout = setTimeout(proc.kill, this.timeouts.run, "SIGKILL") + const kill_timeout = setTimeout(proc.kill, this.timeouts.run, 'SIGKILL'); - proc.stderr.on('data', d=>stderr += d) - proc.stdout.on('data', d=>stdout += d) + proc.stderr.on('data', d=>stderr += d); + proc.stdout.on('data', d=>stdout += d); proc.on('exit', (code, signal)=>{ - clearTimeout(killTimeout); - resolve({stdout, stderr, code, signal}) - }) + clearTimeout(kill_timeout); + resolve({stdout, stderr, code, signal}); + }); proc.on('error', (code, signal) => { - clearTimeout(killTimeout); - reject({stdout, stderr, code, signal}) - }) - }) + clearTimeout(kill_timeout); + reject({stdout, stderr, code, signal}); + }); + }); this.state = job_states.EXECUTED; return { compile, run - } + }; } async cleanup(){ - logger.info(`Cleaning up job uuid=${this.uuid}`) - await util.promisify(fs.rm)(this.dir, {recursive: true, force: true}) + logger.info(`Cleaning up job uuid=${this.uuid}`); + await fs.rm(this.dir, {recursive: true, force: true}); } } -module.exports = {Job} \ No newline at end of file +module.exports = {Job}; \ No newline at end of file diff --git a/api/src/executor/routes.js b/api/src/executor/routes.js index 7bd0ef3..07f7ace 100644 --- a/api/src/executor/routes.js +++ b/api/src/executor/routes.js @@ -1,34 +1,34 @@ // {"language":"python","version":"3.9.1","files":{"code.py":"print('hello world')"},"args":[],"stdin":"","compile_timeout":10, "run_timeout":3, "main": "code.py"} // {"success":true, "run":{"stdout":"hello world", "stderr":"", "error_code":0},"compile":{"stdout":"","stderr":"","error_code":0}} -const { get_latest_runtime_matching_language_version } = require("../runtime"); -const { Job } = require("./job"); +const { get_latest_runtime_matching_language_version } = require('../runtime'); +const { Job } = require('./job'); module.exports = { async run_job(req, res){ // POST /jobs var errored = false; - ["language", "version", - "files", "main", - "args", "stdin", - "compile_timeout", "run_timeout", - ].forEach(key => { - if(req.body[key] == undefined) errored = errored || res.json_error(`${key} is required`, 400) - }) - if(errored) return errored; + ['language', 'version', + 'files', 'main', + 'args', 'stdin', + 'compile_timeout', 'run_timeout', + ].forEach(key => { + if(req.body[key] == undefined) errored = errored || res.json_error(`${key} is required`, 400); + }); + if(errored) return errored; const runtime = get_latest_runtime_matching_language_version(req.body.language, req.body.version); - if(runtime == undefined) return res.json_error(`${req.body.language}-${req.body.version} runtime is unknown`, 400) + if(runtime == undefined) return res.json_error(`${req.body.language}-${req.body.version} runtime is unknown`, 400); - const job = new Job(runtime, req.body.files, req.body.args, req.body.stdin, {run: req.body.run_timeout, compile: req.body.compile_timeout}, req.body.main) - await job.prime() + const job = new Job(runtime, req.body.files, req.body.args, req.body.stdin, {run: req.body.run_timeout, compile: req.body.compile_timeout}, req.body.main); + await job.prime(); - const result = await job.execute() - res.json_success(result) + const result = await job.execute(); + res.json_success(result); - await job.cleanup() + await job.cleanup(); } -} \ No newline at end of file +}; \ No newline at end of file diff --git a/api/src/globals.js b/api/src/globals.js index 55f376d..09ccb2e 100644 --- a/api/src/globals.js +++ b/api/src/globals.js @@ -1,25 +1,25 @@ // Globals are things the user shouldn't change in config, but is good to not use inline constants for -const is_docker = require("is-docker") -const fs = require("fs") -const platform = `${is_docker() ? "docker" : "baremetal"}-${ - fs.read_file_sync("/etc/os-release") +const is_docker = require('is-docker'); +const fss = require('fs'); +const platform = `${is_docker() ? 'docker' : 'baremetal'}-${ + fss.read_file_sync('/etc/os-release') .toString() - .split("\n") - .find(x=>x.startsWith("ID")) - .replace("ID=","") -}` + .split('\n') + .find(x=>x.startsWith('ID')) + .replace('ID=','') +}`; module.exports = { data_directories: { - cache: "cache", - packages: "packages", - runtimes: "runtimes", - jobs: "jobs" + cache: 'cache', + packages: 'packages', + runtimes: 'runtimes', + jobs: 'jobs' }, data_files:{ - state: "state.json" + state: 'state.json' }, - version: require("../package.json").version, + version: require('../package.json').version, platform, - pkg_installed_file: ".ppman-installed" //Used as indication for if a package was installed -} \ No newline at end of file + pkg_installed_file: '.ppman-installed' //Used as indication for if a package was installed +}; \ No newline at end of file diff --git a/api/src/helpers.js b/api/src/helpers.js index 61f6483..0a67c5b 100644 --- a/api/src/helpers.js +++ b/api/src/helpers.js @@ -1,34 +1,33 @@ -const fs = require("fs"), - path= require("path"), - util = require("util"), - fetch = require("node-fetch"), - urlp = require("url") +const fs = require('fs/promises'), + path= require('path'), + fetch = require('node-fetch'), + urlp = require('url'); module.exports = { async buffer_from_u_r_l(url){ if(!(url instanceof URL)) - url = new URL(url) - if(url.protocol == "file:"){ + url = new URL(url); + if(url.protocol == 'file:'){ //eslint-disable-next-line snakecasejs/snakecasejs - return await util.promisify(fs.read_file)(urlp.fileURLToPath(url)) + return await fs.read_file(urlp.fileURLToPath(url)); }else{ return await fetch({ url: url.toString() - }) + }); } }, add_url_base_if_required(url, base){ try{ - return new URL(url) + return new URL(url); }catch{ //Assume this is a file name - return new URL(url, base + "/") + return new URL(url, base + '/'); } }, url_basename(url){ - return path.basename(url.pathname) + return path.basename(url.pathname); }, -} \ No newline at end of file +}; \ No newline at end of file diff --git a/api/src/index.js b/api/src/index.js index b9d8fca..873b66a 100644 --- a/api/src/index.js +++ b/api/src/index.js @@ -1,106 +1,106 @@ #!/usr/bin/env node -require("nocamel") -const Logger = require("logplease") -const express = require("express") -const globals = require("./globals") -const config = require("./config") -const cache = require("./cache") -const state = require("./state") -const path = require("path") -const fs = require("fs") -const util = require("util") -const body_parser = require("body-parser") -const runtime = require("./runtime") +require('nocamel'); +const Logger = require('logplease'); +const express = require('express'); +const globals = require('./globals'); +const config = require('./config'); +const cache = require('./cache'); +const state = require('./state'); +const path = require('path'); +const fs = require('fs/promises'); +const fss = require('fs'); +const body_parser = require('body-parser'); +const runtime = require('./runtime'); -const logger = Logger.create("index") +const logger = Logger.create('index'); const app = express(); (async () => { - logger.info("Setting loglevel to",config.log_level) - Logger.setLogLevel(config.log_level) //eslint-disable-line snakecasejs/snakecasejs + logger.info('Setting loglevel to',config.log_level); + Logger.setLogLevel(config.log_level); //eslint-disable-line snakecasejs/snakecasejs - logger.debug("Ensuring data directories exist") + logger.debug('Ensuring data directories exist'); Object.values(globals.data_directories).forEach(dir => { - var data_path = path.join(config.data_directory, dir) - logger.debug(`Ensuring ${data_path} exists`) - if(!fs.exists_sync(data_path)){ - logger.info(`${data_path} does not exist.. Creating..`) + var data_path = path.join(config.data_directory, dir); + logger.debug(`Ensuring ${data_path} exists`); + if(!fss.exists_sync(data_path)){ + logger.info(`${data_path} does not exist.. Creating..`); try{ - fs.mkdir_sync(data_path) + fss.mkdir_sync(data_path); }catch(err){ - logger.error(`Failed to create ${data_path}: `, err.message) + logger.error(`Failed to create ${data_path}: `, err.message); } } - }) + }); - logger.info("Loading state") - await state.load(path.join(config.data_directory,globals.data_files.state)) + logger.info('Loading state'); + await state.load(path.join(config.data_directory,globals.data_files.state)); - logger.info("Loading cache") - await cache.load(path.join(config.data_directory,globals.data_directories.cache)) + logger.info('Loading cache'); + await cache.load(path.join(config.data_directory,globals.data_directories.cache)); - logger.info("Loading packages") - const pkgdir = path.join(config.data_directory,globals.data_directories.packages) - await util.promisify(fs.readdir)(pkgdir) + logger.info('Loading packages'); + const pkgdir = path.join(config.data_directory,globals.data_directories.packages); + await fs.readdir(pkgdir) .then(langs => Promise.all( langs.map(lang=> - util.promisify(fs.readdir)(path.join(pkgdir,lang)) + fs.readdir(path.join(pkgdir,lang)) .then(x=>x.map(y=>path.join(pkgdir, lang, y))) ))) //eslint-disable-next-line snakecasejs/snakecasejs .then(pkgs=>pkgs.flat().filter(pkg=>fs.existsSync(path.join(pkg, globals.pkg_installed_file)))) - .then(pkgs=>pkgs.forEach(pkg => new runtime.Runtime(pkg))) + .then(pkgs=>pkgs.forEach(pkg => new runtime.Runtime(pkg))); - logger.info("Starting API Server") + logger.info('Starting API Server'); - logger.debug("Constructing Express App") + logger.debug('Constructing Express App'); - logger.debug("Registering middleware") + logger.debug('Registering middleware'); - app.use(body_parser.urlencoded({extended: true})) - app.use(body_parser.json()) + app.use(body_parser.urlencoded({extended: true})); + app.use(body_parser.json()); - logger.debug("Registering custom message wrappers") + logger.debug('Registering custom message wrappers'); express.response.json_error = function(message, code) { - this.status(code) - return this.json({success: false, message, code}) - } + this.status(code); + return this.json({success: false, message, code}); + }; express.response.json_success = function(obj) { - return this.json({success: true, data: obj}) - } + return this.json({success: true, data: obj}); + }; - logger.debug("Registering Routes") + logger.debug('Registering Routes'); - const ppman_routes = require("./ppman/routes") + const ppman_routes = require('./ppman/routes'); - app.get ("/repos", ppman_routes.repo_list) - app.post ("/repos", ppman_routes.repo_add) - app.get ("/repos/:repo_slug", ppman_routes.repo_info) - app.get ("/repos/:repo_slug/packages", ppman_routes.repo_packages) - app.get ("/repos/:repo_slug/packages/:language/:version", ppman_routes.package_info) - app.post ("/repos/:repo_slug/packages/:language/:version", ppman_routes.package_install) - app.delete("/repos/:repo_slug/packages/:language/:version", ppman_routes.package_uninstall) //TODO + app.get ('/repos', ppman_routes.repo_list); + app.post ('/repos', ppman_routes.repo_add); + app.get ('/repos/:repo_slug', ppman_routes.repo_info); + app.get ('/repos/:repo_slug/packages', ppman_routes.repo_packages); + app.get ('/repos/:repo_slug/packages/:language/:version', ppman_routes.package_info); + app.post ('/repos/:repo_slug/packages/:language/:version', ppman_routes.package_install); + app.delete('/repos/:repo_slug/packages/:language/:version', ppman_routes.package_uninstall); //TODO - const executor_routes = require('./executor/routes') - app.post ("/jobs", executor_routes.run_job) + const executor_routes = require('./executor/routes'); + app.post ('/jobs', executor_routes.run_job); - logger.debug("Calling app.listen") - const [address,port] = config.bind_address.split(":") + logger.debug('Calling app.listen'); + const [address,port] = config.bind_address.split(':'); app.listen(port, address, ()=>{ - logger.info("API server started on", config.bind_address) - }) + logger.info('API server started on', config.bind_address); + }); - logger.debug("Setting up flush timers") - setInterval(cache.flush,config.cache_flush_time,path.join(config.data_directory,globals.data_directories.cache)) - setInterval(state.save,config.state_flush_time,path.join(config.data_directory,globals.data_files.state)) -})() \ No newline at end of file + logger.debug('Setting up flush timers'); + setInterval(cache.flush,config.cache_flush_time,path.join(config.data_directory,globals.data_directories.cache)); + setInterval(state.save,config.state_flush_time,path.join(config.data_directory,globals.data_files.state)); +})(); \ No newline at end of file diff --git a/api/src/ppman/package.js b/api/src/ppman/package.js index e3e69cc..5ccdf4d 100644 --- a/api/src/ppman/package.js +++ b/api/src/ppman/package.js @@ -1,170 +1,170 @@ -const logger = require("logplease").create("ppman/package") -const semver = require("semver") -const config = require("../config") -const globals = require("../globals") -const helpers = require("../helpers") -const path = require("path") -const fs = require("fs") -const util = require("util") -const cp = require("child_process") -const crypto = require("crypto") -const runtime = require("../runtime") +const logger = require('logplease').create('ppman/package'); +const semver = require('semver'); +const config = require('../config'); +const globals = require('../globals'); +const helpers = require('../helpers'); +const path = require('path'); +const fs = require('fs/promises'); +const fss = require('fs'); +const cp = require('child_process'); +const crypto = require('crypto'); +const runtime = require('../runtime'); class Package { constructor(repo, {author, language, version, checksums, dependencies, size, buildfile, download, signature}){ - this.author = author - this.language = language - this.version = semver.parse(version) - this.checksums = checksums - this.dependencies = dependencies - this.size = size - this.buildfile = buildfile - this.download = download - this.signature = signature + this.author = author; + this.language = language; + this.version = semver.parse(version); + this.checksums = checksums; + this.dependencies = dependencies; + this.size = size; + this.buildfile = buildfile; + this.download = download; + this.signature = signature; - this.repo = repo + this.repo = repo; } get installed(){ - return fs.exists_sync(path.join(this.install_path, globals.pkg_installed_file)) + return fss.exists_sync(path.join(this.install_path, globals.pkg_installed_file)); } get download_url(){ - return helpers.add_url_base_if_required(this.download, this.repo.base_u_r_l) + return helpers.add_url_base_if_required(this.download, this.repo.base_u_r_l); } get install_path(){ return path.join(config.data_directory, globals.data_directories.packages, this.language, - this.version.raw) + this.version.raw); } async install(){ - if(this.installed) throw new Error("Already installed") - logger.info(`Installing ${this.language}-${this.version.raw}`) + if(this.installed) throw new Error('Already installed'); + logger.info(`Installing ${this.language}-${this.version.raw}`); - if(fs.exists_sync(this.install_path)){ - logger.warn(`${this.language}-${this.version.raw} has residual files. Removing them.`) - await util.promisify(fs.rm)(this.install_path, {recursive: true, force: true}) + if(fss.exists_sync(this.install_path)){ + logger.warn(`${this.language}-${this.version.raw} has residual files. Removing them.`); + await fs.rm(this.install_path, {recursive: true, force: true}); } - logger.debug(`Making directory ${this.install_path}`) - await util.promisify(fs.mkdir)(this.install_path, {recursive: true}) + logger.debug(`Making directory ${this.install_path}`); + await fs.mkdir(this.install_path, {recursive: true}); - logger.debug(`Downloading package from ${this.download_url} in to ${this.install_path}`) - const pkgfile = helpers.url_basename(this.download_url) - const pkgpath = path.join(this.install_path, pkgfile) + logger.debug(`Downloading package from ${this.download_url} in to ${this.install_path}`); + const pkgfile = helpers.url_basename(this.download_url); + const pkgpath = path.join(this.install_path, pkgfile); await helpers.buffer_from_u_r_l(this.download_url) - .then(buf=> util.promisify(fs.write_file)(pkgpath, buf)) + .then(buf=> fs.write_file(pkgpath, buf)); - logger.debug("Validating checksums") + logger.debug('Validating checksums'); Object.keys(this.checksums).forEach(algo => { - var val = this.checksums[algo] - logger.debug(`Assert ${algo}(${pkgpath}) == ${val}`) + var val = this.checksums[algo]; + logger.debug(`Assert ${algo}(${pkgpath}) == ${val}`); var cs = crypto.create_hash(algo) - .update(fs.read_file_sync(pkgpath)) - .digest("hex") - if(cs != val) throw new Error(`Checksum miss-match want: ${val} got: ${cs}`) - }) + .update(fss.read_file_sync(pkgpath)) + .digest('hex'); + if(cs != val) throw new Error(`Checksum miss-match want: ${val} got: ${cs}`); + }); - await this.repo.importKeys() + await this.repo.import_keys(); - logger.debug("Validating signatutes") + logger.debug('Validating signatutes'); await new Promise((resolve,reject)=>{ - const gpgspawn = cp.spawn("gpg", ["--verify", "-", pkgpath], { - stdio: ["pipe", "ignore", "ignore"] - }) + const gpgspawn = cp.spawn('gpg', ['--verify', '-', pkgpath], { + stdio: ['pipe', 'ignore', 'ignore'] + }); - gpgspawn.once("exit", (code, _) => { - if(code == 0) resolve() - else reject(new Error("Invalid signature")) - }) + gpgspawn.once('exit', (code, _) => { + if(code == 0) resolve(); + else reject(new Error('Invalid signature')); + }); - gpgspawn.once("error", reject) + gpgspawn.once('error', reject); - gpgspawn.stdin.write(this.signature) - gpgspawn.stdin.end() + gpgspawn.stdin.write(this.signature); + gpgspawn.stdin.end(); - }) + }); - logger.debug(`Extracting package files from archive ${pkgfile} in to ${this.install_path}`) + logger.debug(`Extracting package files from archive ${pkgfile} in to ${this.install_path}`); await new Promise((resolve, reject)=>{ - const proc = cp.exec(`bash -c 'cd "${this.install_path}" && tar xzf ${pkgfile}'`) - proc.once("exit", (code,_)=>{ - if(code == 0) resolve() - else reject(new Error("Failed to extract package")) - }) - proc.stdout.pipe(process.stdout) - proc.stderr.pipe(process.stderr) + const proc = cp.exec(`bash -c 'cd "${this.install_path}" && tar xzf ${pkgfile}'`); + proc.once('exit', (code,_)=>{ + if(code == 0) resolve(); + else reject(new Error('Failed to extract package')); + }); + proc.stdout.pipe(process.stdout); + proc.stderr.pipe(process.stderr); - proc.once("error", reject) - }) + proc.once('error', reject); + }); - logger.debug("Ensuring binary files exist for package") - const pkgbin = path.join(this.install_path, `${this.language}-${this.version.raw}`) + logger.debug('Ensuring binary files exist for package'); + const pkgbin = path.join(this.install_path, `${this.language}-${this.version.raw}`); try{ - const pkgbinstat = await util.promisify(fs.stat)(pkgbin) + const pkgbinstat = await fs.stat(pkgbin); //eslint-disable-next-line snakecasejs/snakecasejs - if(!pkgbinstat.isDirectory()) throw new Error() + if(!pkgbinstat.isDirectory()) throw new Error(); }catch(err){ - throw new Error(`Invalid package: could not find ${this.language}-${this.version.raw}/ contained within package files`) + throw new Error(`Invalid package: could not find ${this.language}-${this.version.raw}/ contained within package files`); } - logger.debug("Symlinking into runtimes") - await util.promisify(fs.symlink)( + logger.debug('Symlinking into runtimes'); + await fs.symlink( pkgbin, path.join(config.data_directory, globals.data_directories.runtimes, `${this.language}-${this.version.raw}`) - ).catch((err)=>err) //catch + ).catch((err)=>err); //catch - logger.debug("Registering runtime") - const pkgruntime = new runtime.Runtime(this.install_path) + logger.debug('Registering runtime'); + const pkgruntime = new runtime.Runtime(this.install_path); - logger.debug("Caching environment") - const required_pkgs = [pkgruntime, ...pkgruntime.get_all_dependencies()] + logger.debug('Caching environment'); + const required_pkgs = [pkgruntime, ...pkgruntime.get_all_dependencies()]; const get_env_command = [...required_pkgs.map(p=>`cd "${p.runtime_dir}"; source environment; `), - "env" ].join(" ") + 'env' ].join(' '); const envout = await new Promise((resolve, reject)=>{ - var stdout = "" - const proc = cp.spawn("env",["-i","bash","-c",`${get_env_command}`], { - stdio: ["ignore", "pipe", "pipe"]}) - proc.once("exit", (code,_)=>{ - if(code == 0) resolve(stdout) - else reject(new Error("Failed to cache environment")) - }) + var stdout = ''; + const proc = cp.spawn('env',['-i','bash','-c',`${get_env_command}`], { + stdio: ['ignore', 'pipe', 'pipe']}); + proc.once('exit', (code,_)=>{ + if(code == 0) resolve(stdout); + else reject(new Error('Failed to cache environment')); + }); - proc.stdout.on("data", (data)=>{ - stdout += data - }) + proc.stdout.on('data', (data)=>{ + stdout += data; + }); - proc.once("error", reject) - }) + proc.once('error', reject); + }); - const filtered_env = envout.split("\n") - .filter(l=>!["PWD","OLDPWD","_", "SHLVL"].includes(l.split("=",2)[0])) - .join("\n") + const filtered_env = envout.split('\n') + .filter(l=>!['PWD','OLDPWD','_', 'SHLVL'].includes(l.split('=',2)[0])) + .join('\n'); - await util.promisify(fs.write_file)(path.join(this.install_path, ".env"), filtered_env) + await fs.write_file(path.join(this.install_path, '.env'), filtered_env); - logger.debug("Writing installed state to disk") - await util.promisify(fs.write_file)(path.join(this.install_path, globals.pkg_installed_file), Date.now().toString()) + logger.debug('Writing installed state to disk'); + await fs.write_file(path.join(this.install_path, globals.pkg_installed_file), Date.now().toString()); - logger.info(`Installed ${this.language}-${this.version.raw}`) + logger.info(`Installed ${this.language}-${this.version.raw}`); return { language: this.language, version: this.version.raw - } + }; } } -module.exports = {Package} \ No newline at end of file +module.exports = {Package}; \ No newline at end of file diff --git a/api/src/ppman/repo.js b/api/src/ppman/repo.js index 77fb8e3..fc6378c 100644 --- a/api/src/ppman/repo.js +++ b/api/src/ppman/repo.js @@ -1,66 +1,66 @@ -const logger = require("logplease").create("ppman/repo") -const cache = require("../cache") -const CACHE_CONTEXT = "repo" +const logger = require('logplease').create('ppman/repo'); +const cache = require('../cache'); +const CACHE_CONTEXT = 'repo'; -const cp = require("child_process") -const yaml = require("js-yaml") -const { Package } = require("./package") -const helpers = require("../helpers") +const cp = require('child_process'); +const yaml = require('js-yaml'); +const { Package } = require('./package'); +const helpers = require('../helpers'); class Repository { constructor(slug, url){ - this.slug = slug - this.url = new URL(url) - this.keys = [] - this.packages = [] - this.base_u_r_l="" - logger.debug(`Created repo slug=${this.slug} url=${this.url}`) + this.slug = slug; + this.url = new URL(url); + this.keys = []; + this.packages = []; + this.base_u_r_l=''; + logger.debug(`Created repo slug=${this.slug} url=${this.url}`); } get cache_key(){ - return cache.cache_key(CACHE_CONTEXT, this.slug) + return cache.cache_key(CACHE_CONTEXT, this.slug); } async load(){ try{ var index = await cache.get(this.cache_key,async ()=>{ - return helpers.buffer_from_u_r_l(this.url) - }) + return helpers.buffer_from_u_r_l(this.url); + }); - var repo = yaml.load(index) - if(repo.schema != "ppman-repo-1"){ - throw new Error("YAML Schema unknown") + var repo = yaml.load(index); + if(repo.schema != 'ppman-repo-1'){ + throw new Error('YAML Schema unknown'); } - this.keys = repo.keys - this.packages = repo.packages.map(pkg => new Package(this, pkg)) - this.base_u_r_l = repo.baseurl + this.keys = repo.keys; + this.packages = repo.packages.map(pkg => new Package(this, pkg)); + this.base_u_r_l = repo.baseurl; }catch(err){ - logger.error(`Failed to load repository ${this.slug}:`,err.message) + logger.error(`Failed to load repository ${this.slug}:`,err.message); } } - async importKeys(){ + async import_keys(){ await this.load(); - logger.info(`Importing keys for repo ${this.slug}`) + logger.info(`Importing keys for repo ${this.slug}`); await new Promise((resolve,reject)=>{ - const gpgspawn = cp.spawn("gpg", ['--receive-keys', this.keys], { - stdio: ["ignore", "ignore", "ignore"] - }) + const gpgspawn = cp.spawn('gpg', ['--receive-keys', this.keys], { + stdio: ['ignore', 'ignore', 'ignore'] + }); - gpgspawn.once("exit", (code, _) => { - if(code == 0) resolve() - else reject(new Error("Failed to import keys")) - }) + gpgspawn.once('exit', (code, _) => { + if(code == 0) resolve(); + else reject(new Error('Failed to import keys')); + }); - gpgspawn.once("error", reject) + gpgspawn.once('error', reject); - }) + }); } } -module.exports = {Repository} \ No newline at end of file +module.exports = {Repository}; \ No newline at end of file diff --git a/api/src/ppman/routes.js b/api/src/ppman/routes.js index 13818f4..c376172 100644 --- a/api/src/ppman/routes.js +++ b/api/src/ppman/routes.js @@ -1,82 +1,82 @@ -const repos = new Map() -const state = require("../state") -const logger = require("logplease").create("ppman/routes") -const {Repository} = require("./repo") -const semver = require("semver") +const repos = new Map(); +const state = require('../state'); +const logger = require('logplease').create('ppman/routes'); +const {Repository} = require('./repo'); +const semver = require('semver'); async function get_or_construct_repo(slug){ - if(repos.has(slug))return repos.get(slug) - if(state.state.get("repositories").has(slug)){ - const repo_url = state.state.get("repositories").get(slug) - const repo = new Repository(slug, repo_url) - await repo.load() - repos.set(slug, repo) - return repo + if(repos.has(slug))return repos.get(slug); + if(state.state.get('repositories').has(slug)){ + const repo_url = state.state.get('repositories').get(slug); + const repo = new Repository(slug, repo_url); + await repo.load(); + repos.set(slug, repo); + return repo; } - logger.warn(`Requested repo ${slug} does not exist`) - return null + logger.warn(`Requested repo ${slug} does not exist`); + return null; } async function get_package(repo, lang, version){ var candidates = repo.packages.filter( pkg => pkg.language == lang && semver.satisfies(pkg.version, version) - ) - return candidates.sort((a,b)=>semver.rcompare(a.version,b.version))[0] || null + ); + return candidates.sort((a,b)=>semver.rcompare(a.version,b.version))[0] || null; } module.exports = { async repo_list(req,res){ // GET /repos - logger.debug("Request for repoList") + logger.debug('Request for repoList'); res.json_success({ repos: (await Promise.all( - [...state.state.get("repositories").keys()].map( async slug => await get_or_construct_repo(slug)) + [...state.state.get('repositories').keys()].map( async slug => await get_or_construct_repo(slug)) )).map(repo=>({ slug: repo.slug, url: repo.url, packages: repo.packages.length })) - }) + }); }, async repo_add(req, res){ // POST /repos - logger.debug(`Request for repoAdd slug=${req.body.slug} url=${req.body.url}`) + logger.debug(`Request for repoAdd slug=${req.body.slug} url=${req.body.url}`); if(!req.body.slug) - return res.json_error("slug is missing from request body", 400) + return res.json_error('slug is missing from request body', 400); if(!req.body.url) - return res.json_error("url is missing from request body", 400) + return res.json_error('url is missing from request body', 400); - const repo_state = state.state.get("repositories") + const repo_state = state.state.get('repositories'); - if(repo_state.has(req.body.slug)) return res.json_error(`repository ${req.body.slug} already exists`, 409) + if(repo_state.has(req.body.slug)) return res.json_error(`repository ${req.body.slug} already exists`, 409); - repo_state.set(req.body.slug, req.body.url) - logger.info(`Repository ${req.body.slug} added url=${req.body.url}`) + repo_state.set(req.body.slug, req.body.url); + logger.info(`Repository ${req.body.slug} added url=${req.body.url}`); - return res.json_success(req.body.slug) + return res.json_success(req.body.slug); }, async repo_info(req, res){ // GET /repos/:slug - logger.debug(`Request for repoInfo for ${req.params.repo_slug}`) - const repo = await get_or_construct_repo(req.params.repo_slug) + logger.debug(`Request for repoInfo for ${req.params.repo_slug}`); + const repo = await get_or_construct_repo(req.params.repo_slug); - if(repo == null) return res.json_error(`Requested repo ${req.params.repo_slug} does not exist`, 404) + if(repo == null) return res.json_error(`Requested repo ${req.params.repo_slug} does not exist`, 404); res.json_success({ slug: repo.slug, url: repo.url, packages: repo.packages.length - }) + }); }, async repo_packages(req, res){ // GET /repos/:slug/packages - logger.debug("Request to repoPackages") + logger.debug('Request to repoPackages'); - const repo = await get_or_construct_repo(req.params.repo_slug) - if(repo == null) return res.json_error(`Requested repo ${req.params.repo_slug} does not exist`, 404) + const repo = await get_or_construct_repo(req.params.repo_slug); + if(repo == null) return res.json_error(`Requested repo ${req.params.repo_slug} does not exist`, 404); res.json_success({ packages: repo.packages.map(pkg=>({ @@ -84,46 +84,46 @@ module.exports = { language_version: pkg.version.raw, installed: pkg.installed })) - }) + }); }, async package_info(req, res){ // GET /repos/:slug/packages/:language/:version - logger.debug("Request to packageInfo") + logger.debug('Request to packageInfo'); - const repo = await get_or_construct_repo(req.params.repo_slug) - if(repo == null) return res.json_error(`Requested repo ${req.params.repo_slug} does not exist`, 404) + const repo = await get_or_construct_repo(req.params.repo_slug); + if(repo == null) return res.json_error(`Requested repo ${req.params.repo_slug} does not exist`, 404); - const package = await get_package(repo, req.params.language, req.params.version) - if(package == null) return res.json_error(`Requested package ${req.params.language}-${req.params.version} does not exist`, 404) + const pkg = await get_package(repo, req.params.language, req.params.version); + if(pkg == null) return res.json_error(`Requested package ${req.params.language}-${req.params.version} does not exist`, 404); res.json_success({ - language: package.language, - language_version: package.version.raw, - author: package.author, - buildfile: package.buildfile, - size: package.size, - dependencies: package.dependencies, - installed: package.installed - }) + language: pkg.language, + language_version: pkg.version.raw, + author: pkg.author, + buildfile: pkg.buildfile, + size: pkg.size, + dependencies: pkg.dependencies, + installed: pkg.installed + }); }, async package_install(req,res){ // POST /repos/:slug/packages/:language/:version - logger.debug("Request to packageInstall") + logger.debug('Request to packageInstall'); - const repo = await get_or_construct_repo(req.params.repo_slug) - if(repo == null) return res.json_error(`Requested repo ${req.params.repo_slug} does not exist`, 404) + const repo = await get_or_construct_repo(req.params.repo_slug); + if(repo == null) return res.json_error(`Requested repo ${req.params.repo_slug} does not exist`, 404); - const package = await get_package(repo, req.params.language, req.params.version) - if(package == null) return res.json_error(`Requested package ${req.params.language}-${req.params.version} does not exist`, 404) + const pkg = await get_package(repo, req.params.language, req.params.version); + if(pkg == null) return res.json_error(`Requested package ${req.params.language}-${req.params.version} does not exist`, 404); try{ - const response = await package.install() - return res.json_success(response) + const response = await pkg.install(); + return res.json_success(response); }catch(err){ - logger.error(`Error while installing package ${package.language}-${package.version}:`, err.message) - res.json_error(err.message,500) + logger.error(`Error while installing package ${pkg.language}-${pkg.version}:`, err.message); + res.json_error(err.message,500); } @@ -131,6 +131,6 @@ module.exports = { async package_uninstall(req,res){ // DELETE /repos/:slug/packages/:language/:version - res.json(req.body) //TODO + res.json(req.body); //TODO } -} \ No newline at end of file +}; \ No newline at end of file diff --git a/api/src/runtime.js b/api/src/runtime.js index 4686d06..f32140b 100644 --- a/api/src/runtime.js +++ b/api/src/runtime.js @@ -1,85 +1,85 @@ -const logger = require("logplease").create("runtime") -const semver = require("semver") -const config = require("./config") -const globals = require("./globals") -const fs = require("fs") -const path = require("path") +const logger = require('logplease').create('runtime'); +const semver = require('semver'); +const config = require('./config'); +const globals = require('./globals'); +const fss = require('fs'); +const path = require('path'); -const runtimes = [] +const runtimes = []; class Runtime { #env_vars #compiled constructor(package_dir){ const {language, version, author, dependencies, build_platform} = JSON.parse( - fs.read_file_sync(path.join(package_dir, "pkg-info.json")) - ) + fss.read_file_sync(path.join(package_dir, 'pkg-info.json')) + ); - this.pkgdir = package_dir - this.language = language - this.version = semver.parse(version) - this.author = author - this.dependencies = dependencies + this.pkgdir = package_dir; + this.language = language; + this.version = semver.parse(version); + this.author = author; + this.dependencies = dependencies; if(build_platform != globals.platform){ - logger.warn(`Package ${language}-${version} was built for platform ${build_platform}, but our platform is ${globals.platform}`) + logger.warn(`Package ${language}-${version} was built for platform ${build_platform}, but our platform is ${globals.platform}`); } - logger.debug(`Package ${language}-${version} was loaded`) - runtimes.push(this) + logger.debug(`Package ${language}-${version} was loaded`); + runtimes.push(this); } get env_file_path(){ - return path.join(this.runtime_dir, "environment") + return path.join(this.runtime_dir, 'environment'); } get runtime_dir(){ - return path.join(config.data_directory,globals.data_directories.runtimes, this.toString()) + return path.join(config.data_directory,globals.data_directories.runtimes, this.toString()); } get_all_dependencies(){ - const res = [] + const res = []; Object.keys(this.dependencies).forEach(dep => { - const selector = this.dependencies[dep] - const lang = module.exports.get_latest_runtime_matching_language_version(dep, selector) - res.push(lang) - res.concat(lang.get_all_dependencies(lang)) - }) - return res + const selector = this.dependencies[dep]; + const lang = module.exports.get_latest_runtime_matching_language_version(dep, selector); + res.push(lang); + res.concat(lang.get_all_dependencies(lang)); + }); + return res; } get compile(){ - if(this.#compiled === undefined) this.#compiled = fs.existsSync(path.join(this.pkgdir, "compile")) - return this.#compiled + if(this.#compiled === undefined) this.#compiled = fss.exists_sync(path.join(this.pkgdir, 'compile')); + return this.#compiled; } get env_vars(){ if(!this.#env_vars){ - const env_file = path.join(this.pkgdir, ".env") - const env_content = fs.read_file_sync(env_file).toString() - this.#env_vars = {} + const env_file = path.join(this.pkgdir, '.env'); + const env_content = fss.read_file_sync(env_file).toString(); + this.#env_vars = {}; env_content - .split("\n") - .map(line => line.split("=",2)) + .split('\n') + .map(line => line.split('=',2)) .forEach(([key,val]) => { - this.#env_vars[key] = val - }) + this.#env_vars[key] = val; + }); } - return this.#env_vars + return this.#env_vars; } toString(){ - return `${this.language}-${this.version.raw}` + return `${this.language}-${this.version.raw}`; } } -module.exports = runtimes -module.exports.Runtime = Runtime +module.exports = runtimes; +module.exports.Runtime = Runtime; module.exports.get_runtimes_matching_language_version = function(lang, ver){ - return runtimes.filter(rt => rt.language == lang && semver.satisfies(rt.version, ver)) -} + return runtimes.filter(rt => rt.language == lang && semver.satisfies(rt.version, ver)); +}; module.exports.get_latest_runtime_matching_language_version = function(lang, ver){ return module.exports.get_runtimes_matching_language_version(lang, ver) - .sort((a,b) => semver.rcompare(a.version, b.version))[0] -} + .sort((a,b) => semver.rcompare(a.version, b.version))[0]; +}; diff --git a/api/src/state.js b/api/src/state.js index 1122a3b..6dc555f 100644 --- a/api/src/state.js +++ b/api/src/state.js @@ -1,45 +1,45 @@ -const fs = require("fs") -const util = require("util") +const fs = require('fs/promises'); +const fss = require('fs'); -const logger = require("logplease").create("state") -const state = new Map() +const logger = require('logplease').create('state'); +const state = new Map(); function replacer(key, value) { if(value instanceof Map) { return { - data_type: "Map", + data_type: 'Map', value: Array.from(value.entries()), - } + }; } else { - return value + return value; } } function reviver(key, value) { - if(typeof value === "object" && value !== null) { - if (value.data_type === "Map") { - return new Map(value.value) + if(typeof value === 'object' && value !== null) { + if (value.data_type === 'Map') { + return new Map(value.value); } } - return value + return value; } module.exports = { state, async load(data_file){ - if(fs.exists_sync(data_file)){ - logger.info("Loading state from file") - var content = await util.promisify(fs.read_file)(data_file) + if(fss.exists_sync(data_file)){ + logger.info('Loading state from file'); + var content = await fs.read_file(data_file); var obj = JSON.parse(content.toString(), reviver); - [...obj.keys()].forEach(k => state.set(k, obj.get(k))) + [...obj.keys()].forEach(k => state.set(k, obj.get(k))); }else{ - logger.info("Creating new statefile") - state.set("repositories", new Map().set("offical", "https://repo.pistonee.org/index.yaml")) + logger.info('Creating new statefile'); + state.set('repositories', new Map().set('offical', 'https://repo.pistonee.org/index.yaml')); } }, async save(data_file){ - logger.info("Saving state to disk") - await util.promisify(fs.write_file)(data_file, JSON.stringify(state, replacer)) + logger.info('Saving state to disk'); + await fs.write_file(data_file, JSON.stringify(state, replacer)); } -} \ No newline at end of file +}; \ No newline at end of file diff --git a/api/yarn.lock b/api/yarn.lock index 7f679dd..7221bfc 100644 --- a/api/yarn.lock +++ b/api/yarn.lock @@ -9,12 +9,51 @@ dependencies: "@babel/highlight" "^7.10.4" +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.13.tgz#dcfc826beef65e75c50e21d3837d7d95798dd658" + integrity sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g== + dependencies: + "@babel/highlight" "^7.12.13" + +"@babel/generator@^7.12.17": + version "7.12.17" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.12.17.tgz#9ef1dd792d778b32284411df63f4f668a9957287" + integrity sha512-DSA7ruZrY4WI8VxuS1jWSRezFnghEoYEFrZcw9BizQRmOZiUsiHl59+qEARGPqPikwA/GPTyRCi7isuCK/oyqg== + dependencies: + "@babel/types" "^7.12.17" + jsesc "^2.5.1" + source-map "^0.5.0" + +"@babel/helper-function-name@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz#93ad656db3c3c2232559fd7b2c3dbdcbe0eb377a" + integrity sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA== + dependencies: + "@babel/helper-get-function-arity" "^7.12.13" + "@babel/template" "^7.12.13" + "@babel/types" "^7.12.13" + +"@babel/helper-get-function-arity@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz#bc63451d403a3b3082b97e1d8b3fe5bd4091e583" + integrity sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg== + dependencies: + "@babel/types" "^7.12.13" + +"@babel/helper-split-export-declaration@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz#e9430be00baf3e88b0e13e6f9d4eaf2136372b05" + integrity sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg== + dependencies: + "@babel/types" "^7.12.13" + "@babel/helper-validator-identifier@^7.12.11": version "7.12.11" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz#c9a1f021917dcb5ccf0d4e453e399022981fc9ed" integrity sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw== -"@babel/highlight@^7.10.4": +"@babel/highlight@^7.10.4", "@babel/highlight@^7.12.13": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.12.13.tgz#8ab538393e00370b26271b01fa08f7f27f2e795c" integrity sha512-kocDQvIbgMKlWxXe9fof3TQ+gkIPOUSEYhJjqUjvKMez3krV7vbzYCDq39Oj11UAVK7JqPVGQPlgE85dPNlQww== @@ -23,6 +62,44 @@ chalk "^2.0.0" js-tokens "^4.0.0" +"@babel/parser@^7.12.13", "@babel/parser@^7.12.17", "@babel/parser@^7.7.0": + version "7.12.17" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.12.17.tgz#bc85d2d47db38094e5bb268fc761716e7d693848" + integrity sha512-r1yKkiUTYMQ8LiEI0UcQx5ETw5dpTLn9wijn9hk6KkTtOK95FndDN10M+8/s6k/Ymlbivw0Av9q4SlgF80PtHg== + +"@babel/template@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.12.13.tgz#530265be8a2589dbb37523844c5bcb55947fb327" + integrity sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA== + dependencies: + "@babel/code-frame" "^7.12.13" + "@babel/parser" "^7.12.13" + "@babel/types" "^7.12.13" + +"@babel/traverse@^7.7.0": + version "7.12.17" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.12.17.tgz#40ec8c7ffb502c4e54c7f95492dc11b88d718619" + integrity sha512-LGkTqDqdiwC6Q7fWSwQoas/oyiEYw6Hqjve5KOSykXkmFJFqzvGMb9niaUEag3Rlve492Mkye3gLw9FTv94fdQ== + dependencies: + "@babel/code-frame" "^7.12.13" + "@babel/generator" "^7.12.17" + "@babel/helper-function-name" "^7.12.13" + "@babel/helper-split-export-declaration" "^7.12.13" + "@babel/parser" "^7.12.17" + "@babel/types" "^7.12.17" + debug "^4.1.0" + globals "^11.1.0" + lodash "^4.17.19" + +"@babel/types@^7.12.13", "@babel/types@^7.12.17", "@babel/types@^7.7.0": + version "7.12.17" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.12.17.tgz#9d711eb807e0934c90b8b1ca0eb1f7230d150963" + integrity sha512-tNMDjcv/4DIcHxErTgwB9q2ZcYyN0sUfgGKUK/mm1FJK7Wz+KstoEekxrl/tBiNDgLK1HGi+sppj1An/1DR4fQ== + dependencies: + "@babel/helper-validator-identifier" "^7.12.11" + lodash "^4.17.19" + to-fast-properties "^2.0.0" + "@eslint/eslintrc@^0.3.0": version "0.3.0" resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.3.0.tgz#d736d6963d7003b6514e6324bec9c602ac340318" @@ -123,6 +200,18 @@ astral-regex@^2.0.0: resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== +babel-eslint@^10.1.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.1.0.tgz#6968e568a910b78fb3779cdd8b6ac2f479943232" + integrity sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg== + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/parser" "^7.7.0" + "@babel/traverse" "^7.7.0" + "@babel/types" "^7.7.0" + eslint-visitor-keys "^1.0.0" + resolve "^1.12.0" + balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" @@ -255,7 +344,7 @@ debug@2.6.9: dependencies: ms "2.0.0" -debug@^4.0.1, debug@^4.1.1: +debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: version "4.3.1" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== @@ -341,7 +430,7 @@ eslint-utils@^2.1.0: dependencies: eslint-visitor-keys "^1.1.0" -eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: +eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== @@ -541,6 +630,11 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= +function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== + functional-red-black-tree@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" @@ -570,6 +664,11 @@ glob@^7.1.3: once "^1.3.0" path-is-absolute "^1.0.0" +globals@^11.1.0: + version "11.12.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" + integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== + globals@^12.1.0: version "12.4.0" resolved "https://registry.yarnpkg.com/globals/-/globals-12.4.0.tgz#a18813576a41b00a24a97e7f815918c2e19925f8" @@ -587,6 +686,13 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== +has@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + dependencies: + function-bind "^1.1.1" + http-errors@1.7.2: version "1.7.2" resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.2.tgz#4f5029cf13239f31036e5b2e55292bcfbcc85c8f" @@ -657,6 +763,13 @@ ipaddr.js@1.9.1: resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== +is-core-module@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.2.0.tgz#97037ef3d52224d85163f5597b2b63d9afed981a" + integrity sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ== + dependencies: + has "^1.0.3" + is-docker@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.1.1.tgz#4125a88e44e450d384e09047ede71adc2d144156" @@ -704,6 +817,11 @@ js-yaml@^4.0.0: dependencies: argparse "^2.0.1" +jsesc@^2.5.1: + version "2.5.2" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" + integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== + json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" @@ -727,6 +845,11 @@ levn@^0.4.1: prelude-ls "^1.2.1" type-check "~0.4.0" +lodash@^4.17.19: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + lodash@^4.17.20: version "4.17.20" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" @@ -866,6 +989,11 @@ path-key@^3.1.0: resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== +path-parse@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" + integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + path-to-regexp@0.1.7: version "0.1.7" resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" @@ -934,6 +1062,14 @@ resolve-from@^4.0.0: resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== +resolve@^1.12.0: + version "1.20.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" + integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== + dependencies: + is-core-module "^2.2.0" + path-parse "^1.0.6" + rimraf@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" @@ -1013,6 +1149,11 @@ slice-ansi@^4.0.0: astral-regex "^2.0.0" is-fullwidth-code-point "^3.0.0" +source-map@^0.5.0: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= + sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" @@ -1073,6 +1214,11 @@ text-table@^0.2.0: resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= +to-fast-properties@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= + toidentifier@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..356f800 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,20 @@ +version: '3.8' + +services: + piston_api: + build: api + restart: always + ports: + - 6969:6969 + volumes: + - ./data/piston:/piston + - ./repo:/repo + tmpfs: + - /piston/cache + - /piston/jobs + + piston_fs_repo: #Temporary solution until CI works + build: repo + volumes: + - ./repo:/repo + - ./packages:/packages \ No newline at end of file diff --git a/packages/common.mk b/packages/common.mk index 3b3d201..90773cc 100644 --- a/packages/common.mk +++ b/packages/common.mk @@ -26,7 +26,7 @@ pkg-info.jq: $(foreach dep, ${LANG_DEPS}, echo '.dependencies.$(word 1,$(subst =, ,${dep}))="$(word 2,$(subst =, ,${dep}))"' >> pkg-info.jq) %.asc: % - gpg --detach-sig --armor --output $@ $< + gpg --detach-sig --armor --batch --output $@ $< %/: %.tgz tar xzf $< diff --git a/repo/.gitignore b/repo/.gitignore new file mode 100644 index 0000000..fd572dc --- /dev/null +++ b/repo/.gitignore @@ -0,0 +1,3 @@ +*.pkg.tar.gz +index.yaml +*.key \ No newline at end of file diff --git a/repo/Dockerfile b/repo/Dockerfile new file mode 100644 index 0000000..beeb9d0 --- /dev/null +++ b/repo/Dockerfile @@ -0,0 +1,8 @@ +FROM alpine:3.13 + +RUN apk add --no-cache gnupg jq zlib zlib-dev cmake cmake-doc extra-cmake-modules extra-cmake-modules-doc build-base gcc abuild binutils binutils-doc gcc-doc yq bash coreutils util-linux pciutils usbutils coreutils binutils findutils grep && \ + ln -sf /bin/bash /bin/sh && \ + wget https://github.com/mikefarah/yq/releases/download/2.4.1/yq_linux_amd64 -O /usr/bin/yq &&\ + chmod +x /usr/bin/yq + +CMD [ "bash", "/repo/make.sh" ] \ No newline at end of file diff --git a/repo/README.MD b/repo/README.MD new file mode 100644 index 0000000..43d66dd --- /dev/null +++ b/repo/README.MD @@ -0,0 +1,3 @@ +# Piston Filesystem Repo Builder + +This is just a simple POC for a repository tool to run locally. diff --git a/repo/make.sh b/repo/make.sh new file mode 100644 index 0000000..f380e4f --- /dev/null +++ b/repo/make.sh @@ -0,0 +1,7 @@ +#!/bin/bash +cd /repo +cat password.key | gpg --batch --import private.key +pushd ../packages/python +cat password.key | make sign VERSIONS=3.9.1 && make cleanup +popd +./mkindex.sh \ No newline at end of file diff --git a/repo/mkindex.sh b/repo/mkindex.sh new file mode 100755 index 0000000..4f2ac42 --- /dev/null +++ b/repo/mkindex.sh @@ -0,0 +1,26 @@ +echo "schema: ppman-repo-1" > index.yaml +echo "baseurl: file://$PWD" >> index.yaml +echo "keys: []" >> index.yaml +echo "packages: []" >> index.yaml + +yq -yi '.keys[0] = "0x107DA02C7AE97B084746564B9F1FD9D87950DB6F"' index.yaml + +i=-1 + +for pkg in $(find ../packages -type f -name "*.pkg.tar.gz") +do + ((i=i+1)) + cp $pkg . + PKGFILE=$(basename $pkg) + PKGFILENAME=$(echo $PKGFILE | sed 's/\.pkg\.tar\.gz//g') + PKGNAME=$(echo $PKGFILENAME | grep -oP '^\K.+(?=-)') + PKGVERSION=$(echo $PKGFILENAME | grep -oP '^.+-\K.+') + BUILDFILE=https://github.com/engineer-man/piston/tree/v3/packages/python/ + SIZE=$(tar tzvf $PKGFILE | sed 's/ \+/ /g' | cut -f3 -d' ' | sed '2,$s/^/+ /' | paste -sd' ' | bc) + + tar xzf $PKGFILE pkg-info.json + + yq -yi ".packages[$i] = {} | .packages[$i].signature = \"$(cat ${pkg}.asc)\" | .packages[$i].buildfile = \"$BUILDFILE\" | .packages[$i].size = $SIZE | .packages[$i].download = \"$PKGFILE\" | .packages[$i].dependencies = $(jq .dependencies -r pkg-info.json) | .packages[$i].author = $(jq .author pkg-info.json) | .packages[$i].language =\"$PKGNAME\" | .packages[$i].version = \"$PKGVERSION\" | .packages[$i].checksums = {} | .packages[$i].checksums.sha256 = \"$(sha256sum $PKGFILE | awk '{print $1}')\"" index.yaml + + rm pkg-info.json +done \ No newline at end of file From 8ad62ec9838686c6cc78cc908c963907884e4b43 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 21 Feb 2021 12:06:20 +1300 Subject: [PATCH 024/385] api: use patched nocamel for fs/promises --- api/package.json | 2 +- api/src/index.js | 3 +-- api/yarn.lock | 7 +++---- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/api/package.json b/api/package.json index a530298..74072e5 100644 --- a/api/package.json +++ b/api/package.json @@ -9,7 +9,7 @@ "is-docker": "^2.1.1", "js-yaml": "^4.0.0", "logplease": "^1.2.15", - "nocamel": "*", + "nocamel": "HexF/nocamel#patch-1", "node-fetch": "^2.6.1", "semver": "^7.3.4", "uuid": "^8.3.2", diff --git a/api/src/index.js b/api/src/index.js index 873b66a..7b295b3 100644 --- a/api/src/index.js +++ b/api/src/index.js @@ -49,8 +49,7 @@ const app = express(); fs.readdir(path.join(pkgdir,lang)) .then(x=>x.map(y=>path.join(pkgdir, lang, y))) ))) - //eslint-disable-next-line snakecasejs/snakecasejs - .then(pkgs=>pkgs.flat().filter(pkg=>fs.existsSync(path.join(pkg, globals.pkg_installed_file)))) + .then(pkgs=>pkgs.flat().filter(pkg=>fss.exists_sync(path.join(pkg, globals.pkg_installed_file)))) .then(pkgs=>pkgs.forEach(pkg => new runtime.Runtime(pkg))); diff --git a/api/yarn.lock b/api/yarn.lock index 7221bfc..ec163b5 100644 --- a/api/yarn.lock +++ b/api/yarn.lock @@ -931,10 +931,9 @@ negotiator@0.6.2: resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== -nocamel@*: - version "1.0.2" - resolved "https://registry.yarnpkg.com/nocamel/-/nocamel-1.0.2.tgz#13ff04ffacd5487ba65555c0dcafcf8c95c918ba" - integrity sha512-CRkRSRLChj+H6e4lHS851QS6YGCoTETnSG/z+XGanxLSsTbBkvEeIWaIYMKzuBznFwWM0YcLGXsFyXg4xWYnWA== +nocamel@HexF/nocamel#patch-1: + version "1.1.0" + resolved "https://codeload.github.com/HexF/nocamel/tar.gz/89a5bfbbd07c72c302d968b967d0f4fe54846544" node-fetch@^2.6.1: version "2.6.1" From b20f853ef161feea921c5cda794d09dbd65a709c Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 21 Feb 2021 12:56:35 +1300 Subject: [PATCH 025/385] api: fix function name + allow unsigned packages --- api/src/helpers.js | 2 +- api/src/ppman/package.js | 36 +++++++++++++++++++----------------- api/src/ppman/repo.js | 2 +- 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/api/src/helpers.js b/api/src/helpers.js index 0a67c5b..ba3ef56 100644 --- a/api/src/helpers.js +++ b/api/src/helpers.js @@ -6,7 +6,7 @@ const fs = require('fs/promises'), module.exports = { - async buffer_from_u_r_l(url){ + async buffer_from_url(url){ if(!(url instanceof URL)) url = new URL(url); if(url.protocol == 'file:'){ diff --git a/api/src/ppman/package.js b/api/src/ppman/package.js index 5ccdf4d..e45877a 100644 --- a/api/src/ppman/package.js +++ b/api/src/ppman/package.js @@ -57,7 +57,7 @@ class Package { logger.debug(`Downloading package from ${this.download_url} in to ${this.install_path}`); const pkgfile = helpers.url_basename(this.download_url); const pkgpath = path.join(this.install_path, pkgfile); - await helpers.buffer_from_u_r_l(this.download_url) + await helpers.buffer_from_url(this.download_url) .then(buf=> fs.write_file(pkgpath, buf)); logger.debug('Validating checksums'); @@ -73,23 +73,25 @@ class Package { await this.repo.import_keys(); logger.debug('Validating signatutes'); - await new Promise((resolve,reject)=>{ - const gpgspawn = cp.spawn('gpg', ['--verify', '-', pkgpath], { - stdio: ['pipe', 'ignore', 'ignore'] + if(this.signature != "") + await new Promise((resolve,reject)=>{ + const gpgspawn = cp.spawn('gpg', ['--verify', '-', pkgpath], { + stdio: ['pipe', 'ignore', 'ignore'] + }); + + gpgspawn.once('exit', (code, _) => { + if(code == 0) resolve(); + else reject(new Error('Invalid signature')); + }); + + gpgspawn.once('error', reject); + + gpgspawn.stdin.write(this.signature); + gpgspawn.stdin.end(); + }); - - gpgspawn.once('exit', (code, _) => { - if(code == 0) resolve(); - else reject(new Error('Invalid signature')); - }); - - gpgspawn.once('error', reject); - - gpgspawn.stdin.write(this.signature); - gpgspawn.stdin.end(); - - }); - + else + logger.warn("Package does not contain a signature - allowing install, but proceed with caution") logger.debug(`Extracting package files from archive ${pkgfile} in to ${this.install_path}`); await new Promise((resolve, reject)=>{ diff --git a/api/src/ppman/repo.js b/api/src/ppman/repo.js index fc6378c..4c6deab 100644 --- a/api/src/ppman/repo.js +++ b/api/src/ppman/repo.js @@ -24,7 +24,7 @@ class Repository { async load(){ try{ var index = await cache.get(this.cache_key,async ()=>{ - return helpers.buffer_from_u_r_l(this.url); + return helpers.buffer_from_url(this.url); }); var repo = yaml.load(index); From cdc65d6605911e1c29c1978b1902cb05afdc8c14 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 21 Feb 2021 12:57:02 +1300 Subject: [PATCH 026/385] api: use bash to call run/compile script --- api/src/executor/job.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/api/src/executor/job.js b/api/src/executor/job.js index b10e3ab..12946ab 100644 --- a/api/src/executor/job.js +++ b/api/src/executor/job.js @@ -72,10 +72,9 @@ class Job { if(this.state != job_states.PRIMED) throw new Error('Job must be in primed state, current state: ' + this.state.toString()); logger.info(`Executing job uuid=${this.uuid} uid=${this.uid} gid=${this.gid} runtime=${this.runtime.toString()}`); logger.debug('Compiling'); - const compile = this.runtime.compiled && await new Promise((resolve, reject) => { var stderr, stdout = ''; - const proc = cp.spawn(path.join(this.runtime.pkgdir, 'compile'), [this.main, ...this.args] ,{ + const proc = cp.spawn('bash', [path.join(this.runtime.pkgdir, 'compile'),this.main, ...this.args] ,{ env: this.runtime.env_vars, stdio: ['pipe', 'pipe', 'pipe'], cwd: this.dir, @@ -103,7 +102,7 @@ class Job { const run = await new Promise((resolve, reject) => { var stderr, stdout = ''; - const proc = cp.spawn(path.join(this.runtime.pkgdir, 'run'), [this.main, ...this.args] ,{ + const proc = cp.spawn('bash', [path.join(this.runtime.pkgdir, 'run'),this.main, ...this.args] ,{ env: this.runtime.env_vars, stdio: ['pipe', 'pipe', 'pipe'], cwd: this.dir, From 233fb9bf2629f2e7defc44534613cbb2f5da2467 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 21 Feb 2021 12:57:20 +1300 Subject: [PATCH 027/385] api: trim whitespace off env vars --- api/src/runtime.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/src/runtime.js b/api/src/runtime.js index f32140b..6e71837 100644 --- a/api/src/runtime.js +++ b/api/src/runtime.js @@ -59,10 +59,11 @@ class Runtime { const env_content = fss.read_file_sync(env_file).toString(); this.#env_vars = {}; env_content + .trim() .split('\n') .map(line => line.split('=',2)) .forEach(([key,val]) => { - this.#env_vars[key] = val; + this.#env_vars[key.trim()] = val.trim(); }); } return this.#env_vars; From 816efaff3b8c4a636d60a13328c5a63241de0dd7 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 21 Feb 2021 12:57:40 +1300 Subject: [PATCH 028/385] pkg(python *): correct environment --- packages/python/base.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/python/base.mk b/packages/python/base.mk index 722f8d5..3a19952 100644 --- a/packages/python/base.mk +++ b/packages/python/base.mk @@ -8,7 +8,7 @@ run: echo 'python$(shell grep -oP "\d+.\d+"<<<${VERSION}) $$*' > run ${NAME}-${VERSION}/environment: - echo 'export PATH=$$PWD/${NAME}-${VERSION}/bin:$$PATH' > $@ + echo 'export PATH=$$PWD/bin:$$PATH' > $@ ${NAME}-${VERSION}/: Python-${VERSION}/ cd $< && ./configure --prefix / From 60b258f57c6e0c3f2af71c48bee755ee1bcef285 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 21 Feb 2021 12:58:18 +1300 Subject: [PATCH 029/385] repo: Automated local repository builder --- repo/Dockerfile | 5 ++--- repo/README.MD | 4 ++++ repo/make.sh | 12 +++++++++--- 3 files changed, 15 insertions(+), 6 deletions(-) mode change 100644 => 100755 repo/make.sh diff --git a/repo/Dockerfile b/repo/Dockerfile index beeb9d0..d49182e 100644 --- a/repo/Dockerfile +++ b/repo/Dockerfile @@ -1,8 +1,7 @@ FROM alpine:3.13 -RUN apk add --no-cache gnupg jq zlib zlib-dev cmake cmake-doc extra-cmake-modules extra-cmake-modules-doc build-base gcc abuild binutils binutils-doc gcc-doc yq bash coreutils util-linux pciutils usbutils coreutils binutils findutils grep && \ +RUN apk add --no-cache python3 py3-pip gnupg jq zlib zlib-dev cmake cmake-doc extra-cmake-modules extra-cmake-modules-doc build-base gcc abuild binutils binutils-doc gcc-doc yq bash coreutils util-linux pciutils usbutils coreutils binutils findutils grep && \ ln -sf /bin/bash /bin/sh && \ - wget https://github.com/mikefarah/yq/releases/download/2.4.1/yq_linux_amd64 -O /usr/bin/yq &&\ - chmod +x /usr/bin/yq + pip3 install 'yq==2.12.0' CMD [ "bash", "/repo/make.sh" ] \ No newline at end of file diff --git a/repo/README.MD b/repo/README.MD index 43d66dd..28f833f 100644 --- a/repo/README.MD +++ b/repo/README.MD @@ -1,3 +1,7 @@ # Piston Filesystem Repo Builder This is just a simple POC for a repository tool to run locally. + +This only demonstrates building an unsigned python-3.9.1 package, however if it finds an `asc` file it will include it as the signature. + +Mount this whole directory into `/repo` in your API container if you wish to use it. \ No newline at end of file diff --git a/repo/make.sh b/repo/make.sh old mode 100644 new mode 100755 index f380e4f..e89dc1e --- a/repo/make.sh +++ b/repo/make.sh @@ -1,7 +1,13 @@ -#!/bin/bash +#!/bin/bash -e + cd /repo -cat password.key | gpg --batch --import private.key + +# Make packages pushd ../packages/python -cat password.key | make sign VERSIONS=3.9.1 && make cleanup +make build VERSIONS=3.9.1 popd + + +# Make repo index + ./mkindex.sh \ No newline at end of file From 7b2305f30c629d5efd8e967003d226e86171017e Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 21 Feb 2021 13:15:11 +1300 Subject: [PATCH 030/385] api: add licence to package.json --- api/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/package.json b/api/package.json index 74072e5..5c494a7 100644 --- a/api/package.json +++ b/api/package.json @@ -19,5 +19,6 @@ "babel-eslint": "^10.1.0", "eslint": "^7.20.0", "eslint-plugin-snakecasejs": "^2.2.0" - } + }, + "license": "MIT" } From f957019710a4252eb29ff1af0150bd2e82f81669 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 21 Feb 2021 13:15:27 +1300 Subject: [PATCH 031/385] deploy: docker compose file --- .gitignore | 1 + docker-compose.yaml | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..adbb97d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +data/ \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml index 356f800..5cd8ede 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -15,6 +15,11 @@ services: piston_fs_repo: #Temporary solution until CI works build: repo + command: > + bash -c '/repo/make.sh && + curl http://piston_api:6969/repos -XPOST -d "slug=local&url=file:///repo/index.yaml"; + echo -e "\nAn error here is fine, it just means its already added it. Perhaps you restarted this container" + ' volumes: - ./repo:/repo - ./packages:/packages \ No newline at end of file From ac46c1b5bb08f218adc045d8a7357a29e4c71a8c Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 21 Feb 2021 13:32:35 +1300 Subject: [PATCH 032/385] api: read both stdout and stderr --- api/src/executor/job.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/api/src/executor/job.js b/api/src/executor/job.js index 12946ab..52792ac 100644 --- a/api/src/executor/job.js +++ b/api/src/executor/job.js @@ -73,8 +73,9 @@ class Job { logger.info(`Executing job uuid=${this.uuid} uid=${this.uid} gid=${this.gid} runtime=${this.runtime.toString()}`); logger.debug('Compiling'); const compile = this.runtime.compiled && await new Promise((resolve, reject) => { - var stderr, stdout = ''; - const proc = cp.spawn('bash', [path.join(this.runtime.pkgdir, 'compile'),this.main, ...this.args] ,{ + var stdout = ''; + var stderr = ''; + const proc = cp.spawn('bash', [path.join(this.runtime.pkgdir, 'compile'),this.main, ...this.files] ,{ env: this.runtime.env_vars, stdio: ['pipe', 'pipe', 'pipe'], cwd: this.dir, @@ -92,16 +93,17 @@ class Job { resolve({stdout, stderr, code, signal}); }); - proc.on('error', (code, signal) => { + proc.on('error', (err) => { clearTimeout(kill_timeout); - reject({stdout, stderr, code, signal}); + reject({error: err, stdout, stderr}); }); }); logger.debug('Running'); const run = await new Promise((resolve, reject) => { - var stderr, stdout = ''; + var stdout = ''; + var stderr = ''; const proc = cp.spawn('bash', [path.join(this.runtime.pkgdir, 'run'),this.main, ...this.args] ,{ env: this.runtime.env_vars, stdio: ['pipe', 'pipe', 'pipe'], @@ -120,9 +122,9 @@ class Job { resolve({stdout, stderr, code, signal}); }); - proc.on('error', (code, signal) => { + proc.on('error', (err) => { clearTimeout(kill_timeout); - reject({stdout, stderr, code, signal}); + reject({error: err, stdout, stderr}); }); }); From 72f57ef1ce38413e1d6839a8a4da586d192edd09 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 21 Feb 2021 13:37:21 +1300 Subject: [PATCH 033/385] docs: readme --- README.MD | 238 ++++++++++++++++++++++++++++++++++++ docs/images/icon_circle.svg | 32 +++++ 2 files changed, 270 insertions(+) create mode 100644 README.MD create mode 100644 docs/images/icon_circle.svg diff --git a/README.MD b/README.MD new file mode 100644 index 0000000..44f9298 --- /dev/null +++ b/README.MD @@ -0,0 +1,238 @@ +

+ 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 + +- Docker +- Docker Compose +- Node JS + +#### After system dependencies are installed, clone this repository: + +```sh +# clone and enter repo +git clone https://github.com/engineer-man/piston +``` + +#### Installation + +- docker-compose up + +#### 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 + +`python`, + + +
+ +
+ + +# License +Piston is licensed under the MIT license. \ No newline at end of file diff --git a/docs/images/icon_circle.svg b/docs/images/icon_circle.svg new file mode 100644 index 0000000..7acfd39 --- /dev/null +++ b/docs/images/icon_circle.svg @@ -0,0 +1,32 @@ + + + From 5ac128553426b2d2e9d6ee1dc179ed02dc63595b Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 21 Feb 2021 14:15:48 +1300 Subject: [PATCH 034/385] api: lint --- api/src/ppman/package.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/ppman/package.js b/api/src/ppman/package.js index e45877a..ebccd7f 100644 --- a/api/src/ppman/package.js +++ b/api/src/ppman/package.js @@ -73,7 +73,7 @@ class Package { await this.repo.import_keys(); logger.debug('Validating signatutes'); - if(this.signature != "") + if(this.signature != '') await new Promise((resolve,reject)=>{ const gpgspawn = cp.spawn('gpg', ['--verify', '-', pkgpath], { stdio: ['pipe', 'ignore', 'ignore'] @@ -91,7 +91,7 @@ class Package { }); else - logger.warn("Package does not contain a signature - allowing install, but proceed with caution") + logger.warn('Package does not contain a signature - allowing install, but proceed with caution'); logger.debug(`Extracting package files from archive ${pkgfile} in to ${this.install_path}`); await new Promise((resolve, reject)=>{ From 2f64f238962809264d4177d6aa30a7ce4584fac4 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 21 Feb 2021 14:25:03 +1300 Subject: [PATCH 035/385] api: container hardening --- api/Dockerfile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/api/Dockerfile b/api/Dockerfile index 1d32806..faa6b8b 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -1,5 +1,13 @@ FROM node:15.8.0-alpine3.13 -RUN apk add --no-cache gnupg tar bash coreutils +RUN apk add --no-cache gnupg tar bash coreutils shadow +RUN for i in $(seq 1000 1500); do \ + groupadd -g $i runner$i && \ + useradd -M runner$i -g $i -u $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 ENV NODE_ENV=production WORKDIR /piston_api From 8727a545c635ed7ac174cf2c089a7e34b5a412ef Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 21 Feb 2021 14:56:07 +1300 Subject: [PATCH 036/385] api: disable networking during execute --- api/src/executor/job.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/executor/job.js b/api/src/executor/job.js index 52792ac..b28589e 100644 --- a/api/src/executor/job.js +++ b/api/src/executor/job.js @@ -75,7 +75,7 @@ class Job { const compile = this.runtime.compiled && await new Promise((resolve, reject) => { var stdout = ''; var stderr = ''; - const proc = cp.spawn('bash', [path.join(this.runtime.pkgdir, 'compile'),this.main, ...this.files] ,{ + const proc = cp.spawn('unshare', ['-n', 'bash', path.join(this.runtime.pkgdir, 'compile'),this.main, ...this.files] ,{ env: this.runtime.env_vars, stdio: ['pipe', 'pipe', 'pipe'], cwd: this.dir, @@ -104,7 +104,7 @@ class Job { const run = await new Promise((resolve, reject) => { var stdout = ''; var stderr = ''; - const proc = cp.spawn('bash', [path.join(this.runtime.pkgdir, 'run'),this.main, ...this.args] ,{ + const proc = cp.spawn('unshare', ['-n', 'bash', path.join(this.runtime.pkgdir, 'run'),this.main, ...this.args] ,{ env: this.runtime.env_vars, stdio: ['pipe', 'pipe', 'pipe'], cwd: this.dir, From 514006058b61c0d18ea285b6b5bc20ee60c4c4ae Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 21 Feb 2021 21:36:49 +1300 Subject: [PATCH 037/385] api: harden runaway code --- api/src/executor/job.js | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/api/src/executor/job.js b/api/src/executor/job.js index b28589e..a6cabd3 100644 --- a/api/src/executor/job.js +++ b/api/src/executor/job.js @@ -73,9 +73,10 @@ class Job { logger.info(`Executing job uuid=${this.uuid} uid=${this.uid} gid=${this.gid} runtime=${this.runtime.toString()}`); logger.debug('Compiling'); const compile = this.runtime.compiled && await new Promise((resolve, reject) => { - var stdout = ''; - var stderr = ''; - const proc = cp.spawn('unshare', ['-n', 'bash', path.join(this.runtime.pkgdir, 'compile'),this.main, ...this.files] ,{ + const proc_call = ['unshare', '-n', '-r', 'bash', path.join(this.runtime.pkgdir, 'compile'),this.main, ...this.files].slice(!config.enable_unshare * 3) + var stdout = ''; + var stderr = ''; + const proc = cp.spawn(proc_call[0], proc_call.splice(1) ,{ env: this.runtime.env_vars, stdio: ['pipe', 'pipe', 'pipe'], cwd: this.dir, @@ -83,18 +84,24 @@ class Job { gid: this.gid }); - const kill_timeout = setTimeout(proc.kill, this.timeouts.compile, 'SIGKILL'); + const kill_timeout = setTimeout(_ => proc.kill('SIGKILL'), this.timeouts.compile); - proc.stderr.on('data', d=>stderr += d); - proc.stdout.on('data', d=>stdout += d); + proc.stderr.on('data', d=>{if(stderr.length>config.output_max_size) proc.kill('SIGKILL'); else stderr += d;}); + proc.stdout.on('data', d=>{if(stdout.length>config.output_max_size) proc.kill('SIGKILL'); else stdout += d;}); proc.on('exit', (code, signal)=>{ clearTimeout(kill_timeout); + proc.stderr.destroy() + proc.stdout.destroy() + resolve({stdout, stderr, code, signal}); }); proc.on('error', (err) => { clearTimeout(kill_timeout); + proc.stderr.destroy() + proc.stdout.destroy() + reject({error: err, stdout, stderr}); }); }); @@ -102,28 +109,36 @@ class Job { logger.debug('Running'); const run = await new Promise((resolve, reject) => { + const proc_call = ['unshare', '-n', '-r', 'bash', path.join(this.runtime.pkgdir, 'run'), this.main, ...this.args].slice(!config.enable_unshare * 3); var stdout = ''; var stderr = ''; - const proc = cp.spawn('unshare', ['-n', 'bash', path.join(this.runtime.pkgdir, 'run'),this.main, ...this.args] ,{ + const proc = cp.spawn(proc_call[0], proc_call.slice(1) ,{ env: this.runtime.env_vars, stdio: ['pipe', 'pipe', 'pipe'], cwd: this.dir, uid: this.uid, gid: this.gid }); + + const kill_timeout = setTimeout(_ => proc.kill('SIGKILL'), this.timeouts.run); - const kill_timeout = setTimeout(proc.kill, this.timeouts.run, 'SIGKILL'); + proc.stderr.on('data', d=>{if(stderr.length>config.output_max_size) proc.kill('SIGKILL'); else stderr += d;}); + proc.stdout.on('data', d=>{if(stdout.length>config.output_max_size) proc.kill('SIGKILL'); else stdout += d;}); - proc.stderr.on('data', d=>stderr += d); - proc.stdout.on('data', d=>stdout += d); + proc.stdin.write(this.stdin) + proc.stdin.end() proc.on('exit', (code, signal)=>{ clearTimeout(kill_timeout); + proc.stderr.destroy() + proc.stdout.destroy() resolve({stdout, stderr, code, signal}); }); proc.on('error', (err) => { clearTimeout(kill_timeout); + proc.stderr.destroy() + proc.stdout.destroy() reject({error: err, stdout, stderr}); }); }); From 1f5d4b8eb1501eafb508c1ae27f618c4effba6d9 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 21 Feb 2021 21:37:13 +1300 Subject: [PATCH 038/385] api: config options --- api/src/config.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/api/src/config.js b/api/src/config.js index a2503bf..e541ce9 100644 --- a/api/src/config.js +++ b/api/src/config.js @@ -95,6 +95,18 @@ const options = [ desc: 'Maximum gid to use for runner', default: 1500, validators: [] + }, + { + key: 'enable_unshare', + desc: 'Enable using unshare to disable networking', + default: true, + validators: [] + }, + { + key: 'output_max_size', + desc: 'Max size of each stdio buffer', + default: 1024, + validators: [] } ]; From 64b28824500692659f58f110231032cfb05f47af Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 21 Feb 2021 21:37:38 +1300 Subject: [PATCH 039/385] api: gpg key importing --- api/src/ppman/repo.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/api/src/ppman/repo.js b/api/src/ppman/repo.js index 4c6deab..d05c1a9 100644 --- a/api/src/ppman/repo.js +++ b/api/src/ppman/repo.js @@ -44,9 +44,8 @@ class Repository { async import_keys(){ await this.load(); logger.info(`Importing keys for repo ${this.slug}`); - await new Promise((resolve,reject)=>{ - const gpgspawn = cp.spawn('gpg', ['--receive-keys', this.keys], { + const gpgspawn = cp.spawn('gpg', ['--receive-keys', ...this.keys], { stdio: ['ignore', 'ignore', 'ignore'] }); From 72e1eb145784123b960653871d0520813d6be4fa Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 21 Feb 2021 22:53:42 +1300 Subject: [PATCH 040/385] deploy: api privilege --- docker-compose.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 5cd8ede..1776a45 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -3,6 +3,7 @@ version: '3.8' services: piston_api: build: api + privileged: true restart: always ports: - 6969:6969 @@ -17,7 +18,7 @@ services: build: repo command: > bash -c '/repo/make.sh && - curl http://piston_api:6969/repos -XPOST -d "slug=local&url=file:///repo/index.yaml"; + true || curl http://piston_api:6969/repos -XPOST -d "slug=local&url=file:///repo/index.yaml"; echo -e "\nAn error here is fine, it just means its already added it. Perhaps you restarted this container" ' volumes: From 3e6fac5c0e21228839ec9fdf3d9e1213e9f29197 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Mon, 22 Feb 2021 21:13:31 +1300 Subject: [PATCH 041/385] deploy: enable automated repo add --- docker-compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 1776a45..509e677 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -18,7 +18,7 @@ services: build: repo command: > bash -c '/repo/make.sh && - true || curl http://piston_api:6969/repos -XPOST -d "slug=local&url=file:///repo/index.yaml"; + curl http://piston_api:6969/repos -XPOST -d "slug=local&url=file:///repo/index.yaml"; echo -e "\nAn error here is fine, it just means its already added it. Perhaps you restarted this container" ' volumes: From 00bb5be55bcd502a14d7b8c79b10747964efef10 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Mon, 22 Feb 2021 21:55:51 +1300 Subject: [PATCH 042/385] api: tidy up execute --- api/src/executor/job.js | 72 ++++++++++++++--------------------------- 1 file changed, 25 insertions(+), 47 deletions(-) diff --git a/api/src/executor/job.js b/api/src/executor/job.js index a6cabd3..ae5f55c 100644 --- a/api/src/executor/job.js +++ b/api/src/executor/job.js @@ -68,80 +68,58 @@ class Job { logger.debug('Primed job'); } - async execute(){ - if(this.state != job_states.PRIMED) throw new Error('Job must be in primed state, current state: ' + this.state.toString()); - logger.info(`Executing job uuid=${this.uuid} uid=${this.uid} gid=${this.gid} runtime=${this.runtime.toString()}`); - logger.debug('Compiling'); - const compile = this.runtime.compiled && await new Promise((resolve, reject) => { - const proc_call = ['unshare', '-n', '-r', 'bash', path.join(this.runtime.pkgdir, 'compile'),this.main, ...this.files].slice(!config.enable_unshare * 3) + async safe_call(file, args){ + return await new Promise((resolve, reject) => { + const proc_call = ['bash',file, ...args] var stdout = ''; var stderr = ''; const proc = cp.spawn(proc_call[0], proc_call.splice(1) ,{ env: this.runtime.env_vars, - stdio: ['pipe', 'pipe', 'pipe'], + stdio: 'pipe', cwd: this.dir, uid: this.uid, - gid: this.gid + gid: this.gid, + detached: true //dont kill the main process when we kill the group }); + + const kill_timeout = setTimeout(_ => proc.kill('SIGKILL'), this.timeouts.compile); proc.stderr.on('data', d=>{if(stderr.length>config.output_max_size) proc.kill('SIGKILL'); else stderr += d;}); proc.stdout.on('data', d=>{if(stdout.length>config.output_max_size) proc.kill('SIGKILL'); else stdout += d;}); - - proc.on('exit', (code, signal)=>{ + function exitCleanup(){ clearTimeout(kill_timeout); proc.stderr.destroy() proc.stdout.destroy() + try{ + process.kill(-proc.pid, 'SIGKILL') + }catch{} //Probably already dead! + } + + proc.on('exit', (code, signal)=>{ + exitCleanup() resolve({stdout, stderr, code, signal}); }); proc.on('error', (err) => { - clearTimeout(kill_timeout); - proc.stderr.destroy() - proc.stdout.destroy() + exitCleanup() reject({error: err, stdout, stderr}); }); }); + } + + async execute(){ + if(this.state != job_states.PRIMED) throw new Error('Job must be in primed state, current state: ' + this.state.toString()); + logger.info(`Executing job uuid=${this.uuid} uid=${this.uid} gid=${this.gid} runtime=${this.runtime.toString()}`); + logger.debug('Compiling'); + const compile = this.runtime.compiled && await this.safe_call(path.join(this.runtime.pkgdir, 'compile'), [this.main, ...this.files]) logger.debug('Running'); - const run = await new Promise((resolve, reject) => { - const proc_call = ['unshare', '-n', '-r', 'bash', path.join(this.runtime.pkgdir, 'run'), this.main, ...this.args].slice(!config.enable_unshare * 3); - var stdout = ''; - var stderr = ''; - const proc = cp.spawn(proc_call[0], proc_call.slice(1) ,{ - env: this.runtime.env_vars, - stdio: ['pipe', 'pipe', 'pipe'], - cwd: this.dir, - uid: this.uid, - gid: this.gid - }); - - const kill_timeout = setTimeout(_ => proc.kill('SIGKILL'), this.timeouts.run); - - proc.stderr.on('data', d=>{if(stderr.length>config.output_max_size) proc.kill('SIGKILL'); else stderr += d;}); - proc.stdout.on('data', d=>{if(stdout.length>config.output_max_size) proc.kill('SIGKILL'); else stdout += d;}); - - proc.stdin.write(this.stdin) - proc.stdin.end() - - proc.on('exit', (code, signal)=>{ - clearTimeout(kill_timeout); - proc.stderr.destroy() - proc.stdout.destroy() - resolve({stdout, stderr, code, signal}); - }); - - proc.on('error', (err) => { - clearTimeout(kill_timeout); - proc.stderr.destroy() - proc.stdout.destroy() - reject({error: err, stdout, stderr}); - }); - }); + const run = await this.safe_call(path.join(this.runtime.pkgdir, 'run'), [this.main, ...this.args]) this.state = job_states.EXECUTED; From 0ebdcadf126903cd6c4451bbc391f310b5f4922f Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Mon, 22 Feb 2021 21:57:03 +1300 Subject: [PATCH 043/385] api: add unshare back --- api/src/executor/job.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/executor/job.js b/api/src/executor/job.js index ae5f55c..cb4701d 100644 --- a/api/src/executor/job.js +++ b/api/src/executor/job.js @@ -70,7 +70,7 @@ class Job { async safe_call(file, args){ return await new Promise((resolve, reject) => { - const proc_call = ['bash',file, ...args] + const proc_call = ['unshare','-n','-r','bash',file, ...args].slice(!config.enable_unshare*3) var stdout = ''; var stderr = ''; const proc = cp.spawn(proc_call[0], proc_call.splice(1) ,{ From 94d179762b0cd08c70977d8e1c5382d75ebe03cb Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Mon, 22 Feb 2021 22:00:37 +1300 Subject: [PATCH 044/385] api: enforce execute time limits --- api/src/executor/job.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/api/src/executor/job.js b/api/src/executor/job.js index cb4701d..421655d 100644 --- a/api/src/executor/job.js +++ b/api/src/executor/job.js @@ -68,7 +68,7 @@ class Job { logger.debug('Primed job'); } - async safe_call(file, args){ + async safe_call(file, args, timeout){ return await new Promise((resolve, reject) => { const proc_call = ['unshare','-n','-r','bash',file, ...args].slice(!config.enable_unshare*3) var stdout = ''; @@ -84,7 +84,7 @@ class Job { - const kill_timeout = setTimeout(_ => proc.kill('SIGKILL'), this.timeouts.compile); + const kill_timeout = setTimeout(_ => proc.kill('SIGKILL'), timeout); proc.stderr.on('data', d=>{if(stderr.length>config.output_max_size) proc.kill('SIGKILL'); else stderr += d;}); proc.stdout.on('data', d=>{if(stdout.length>config.output_max_size) proc.kill('SIGKILL'); else stdout += d;}); @@ -115,11 +115,17 @@ class Job { if(this.state != job_states.PRIMED) throw new Error('Job must be in primed state, current state: ' + this.state.toString()); logger.info(`Executing job uuid=${this.uuid} uid=${this.uid} gid=${this.gid} runtime=${this.runtime.toString()}`); logger.debug('Compiling'); - const compile = this.runtime.compiled && await this.safe_call(path.join(this.runtime.pkgdir, 'compile'), [this.main, ...this.files]) + const compile = this.runtime.compiled && await this.safe_call( + path.join(this.runtime.pkgdir, 'compile'), + [this.main, ...this.files], + this.timeouts.compile) logger.debug('Running'); - const run = await this.safe_call(path.join(this.runtime.pkgdir, 'run'), [this.main, ...this.args]) + const run = await this.safe_call( + path.join(this.runtime.pkgdir, 'run'), + [this.main, ...this.args], + this.timeouts.run) this.state = job_states.EXECUTED; From 9b1a9bf8b37040d94716e37e092d78d2184e14a8 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Mon, 22 Feb 2021 22:51:19 +1300 Subject: [PATCH 045/385] api: harden process limit --- api/Dockerfile | 10 +--------- api/src/executor/job.js | 29 +++++++++++++++++++---------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/api/Dockerfile b/api/Dockerfile index faa6b8b..3b07adf 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -1,13 +1,5 @@ FROM node:15.8.0-alpine3.13 -RUN apk add --no-cache gnupg tar bash coreutils shadow -RUN for i in $(seq 1000 1500); do \ - groupadd -g $i runner$i && \ - useradd -M runner$i -g $i -u $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 +RUN apk add --no-cache gnupg tar bash coreutils util-linux ENV NODE_ENV=production WORKDIR /piston_api diff --git a/api/src/executor/job.js b/api/src/executor/job.js index 421655d..7c0e83c 100644 --- a/api/src/executor/job.js +++ b/api/src/executor/job.js @@ -70,7 +70,14 @@ class Job { async safe_call(file, args, timeout){ return await new Promise((resolve, reject) => { - const proc_call = ['unshare','-n','-r','bash',file, ...args].slice(!config.enable_unshare*3) + const unshare = config.enable_unshare ? ['unshare','-n','-r'] : []; + const prlimit = ['prlimit','--nproc=64']; + + const proc_call = [ + ...prlimit, + ...unshare, + 'bash',file, ...args + ]; var stdout = ''; var stderr = ''; const proc = cp.spawn(proc_call[0], proc_call.splice(1) ,{ @@ -88,23 +95,25 @@ class Job { proc.stderr.on('data', d=>{if(stderr.length>config.output_max_size) proc.kill('SIGKILL'); else stderr += d;}); proc.stdout.on('data', d=>{if(stdout.length>config.output_max_size) proc.kill('SIGKILL'); else stdout += d;}); - function exitCleanup(){ + function exit_cleanup(){ clearTimeout(kill_timeout); - proc.stderr.destroy() - proc.stdout.destroy() + proc.stderr.destroy(); + proc.stdout.destroy(); try{ - process.kill(-proc.pid, 'SIGKILL') - }catch{} //Probably already dead! + process.kill(-proc.pid, 'SIGKILL'); + }catch{ + // Process will be dead alread, so nothing to kill. + } } proc.on('exit', (code, signal)=>{ - exitCleanup() + exit_cleanup(); resolve({stdout, stderr, code, signal}); }); proc.on('error', (err) => { - exitCleanup() + exit_cleanup(); reject({error: err, stdout, stderr}); }); @@ -118,14 +127,14 @@ class Job { const compile = this.runtime.compiled && await this.safe_call( path.join(this.runtime.pkgdir, 'compile'), [this.main, ...this.files], - this.timeouts.compile) + this.timeouts.compile); logger.debug('Running'); const run = await this.safe_call( path.join(this.runtime.pkgdir, 'run'), [this.main, ...this.args], - this.timeouts.run) + this.timeouts.run); this.state = job_states.EXECUTED; From e31e66aad52a36e297b7705dce1ac56629a0b6e6 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Mon, 22 Feb 2021 22:52:04 +1300 Subject: [PATCH 046/385] api: harden file count --- api/src/executor/job.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/executor/job.js b/api/src/executor/job.js index 7c0e83c..a54bb6c 100644 --- a/api/src/executor/job.js +++ b/api/src/executor/job.js @@ -71,7 +71,7 @@ class Job { async safe_call(file, args, timeout){ return await new Promise((resolve, reject) => { const unshare = config.enable_unshare ? ['unshare','-n','-r'] : []; - const prlimit = ['prlimit','--nproc=64']; + const prlimit = ['prlimit','--nproc=64','--nofile=2048']; const proc_call = [ ...prlimit, From 920e6e705445b8862643005906c2c363c95c7905 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Mon, 22 Feb 2021 22:56:54 +1300 Subject: [PATCH 047/385] api: add rlimits to config --- api/src/config.js | 12 ++++++++++++ api/src/executor/job.js | 6 +++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/api/src/config.js b/api/src/config.js index e541ce9..ffe6391 100644 --- a/api/src/config.js +++ b/api/src/config.js @@ -107,6 +107,18 @@ const options = [ desc: 'Max size of each stdio buffer', default: 1024, validators: [] + }, + { + key: 'max_process_count', + desc: 'Max number of processes per job', + default: 64, + validators: [] + }, + { + key: 'max_open_files', + desc: 'Max number of open files per job', + default: 2048, + validators: [] } ]; diff --git a/api/src/executor/job.js b/api/src/executor/job.js index a54bb6c..5a51a61 100644 --- a/api/src/executor/job.js +++ b/api/src/executor/job.js @@ -71,7 +71,11 @@ class Job { async safe_call(file, args, timeout){ return await new Promise((resolve, reject) => { const unshare = config.enable_unshare ? ['unshare','-n','-r'] : []; - const prlimit = ['prlimit','--nproc=64','--nofile=2048']; + const prlimit = [ + 'prlimit', + '--nproc=' + config.max_process_count, + '--nofile=' + config.max_open_files + ]; const proc_call = [ ...prlimit, From 809004ecf9539b4a727368d906028f0c39304a48 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Mon, 22 Feb 2021 23:15:04 +1300 Subject: [PATCH 048/385] api: add all users --- api/Dockerfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/api/Dockerfile b/api/Dockerfile index 3b07adf..268d713 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -1,5 +1,10 @@ FROM node:15.8.0-alpine3.13 -RUN apk add --no-cache gnupg tar bash coreutils util-linux +RUN apk add --no-cache gnupg tar bash coreutils shadow util-linux +RUN userdel -r node +RUN for i in $(seq 1000 1500); do \ + groupadd -g $i runner$i && \ + useradd -M runner$i -g $i -u $i ; \ + done ENV NODE_ENV=production WORKDIR /piston_api From 16b86607b1df7e7b1e39d83605fa81154b866e75 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Mon, 22 Feb 2021 23:37:54 +1300 Subject: [PATCH 049/385] api-client: initial commit --- api-client/.gitignore | 1 + api-client/index.cjs | 110 ++++++++++++++++++++++++++++++++++++++++ api-client/package.json | 11 ++++ 3 files changed, 122 insertions(+) create mode 100644 api-client/.gitignore create mode 100644 api-client/index.cjs create mode 100644 api-client/package.json diff --git a/api-client/.gitignore b/api-client/.gitignore new file mode 100644 index 0000000..b512c09 --- /dev/null +++ b/api-client/.gitignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/api-client/index.cjs b/api-client/index.cjs new file mode 100644 index 0000000..815f57e --- /dev/null +++ b/api-client/index.cjs @@ -0,0 +1,110 @@ +const fetch = require('node-fetch') + +class APIWrapper { + #base; + constructor(base_url){ + this.#base = base_url.toString() + } + + async query(endpoint, options={}){ + const url = new URL(endpoint, this.#base).href; + return await fetch(url, options) + .then(res=>res.json()) + .then(res=>{if(res.data)return res.data; throw new Error(res.message)}); + } + + get(endpoint){ + return this.query(endpoint); + } + + post(endpoint, body={}){ + return this.query(endpoint, { + method: 'post', + headers: {'Content-Type': 'application/json'}, + body: JSON.stringify(body) + }) + } + + delete(endpoint, body={}){ + return this.query(endpoint, { + method: 'delete', + headers: {'Content-Type': 'application/json'}, + body: JSON.stringify(body) + }) + } + + get_child_object(endpoint, class_type){ + return this.get(endpoint).then(x => new class_type(this, x)) + } + + get url_base(){ + return this.#base + } +} + +class PistonEngineRepositoryPackage extends APIWrapper { + constructor(repo, {language, language_version, author, buildfile, size, dependencies, installed}){ + super(new URL(`/packages/${language}/${language_version}`,repo.url_base)) + + this.language = language; + this.language_version = language_version; + this.author = author; + this,buildfile = buildfile; + this.size = size; + this.dependencies = dependencies; + this.installed = installed; + } + + install(){ + return this.post('/', {}); + } + + uninstall(){ + return this.delete('/', {}); + } +} + +class PistonEngineRepository extends APIWrapper { + + constructor(engine, {slug, url, packages}){ + super(new URL(`/repos/${slug}`, engine.url_base,)) + + this.slug = slug; + this.url = url; + this.package_count = packages + + } + + list_packages(){ + return this.get(`/packages`).then(x=>x.packages) + } + + get_package(language, language_version){ + return this.get_child_object(`/packages/${language}/${language_version}`, PistonEngineRepositoryPackage) + } +} + +class PistonEngine extends APIWrapper { + constructor(base_url = 'http://127.0.0.1:6969'){ + super(base_url); + } + + list_repos(){ + return this.get(`/repos`); + } + + add_repo(slug, url){ + return this.post(`/repos`, {slug, url}) + } + + get_repo(slug){ + return this.get_child_object(`/repos/${slug}`, PistonEngineRepository) + } + + run_job(language, version, files, main, args, stdin, compile_timeout, run_timeout){ + return this.post(`/jobs`, {language, version, files, main, args, stdin, compile_timeout, run_timeout}) + } +} + + +module.exports = {PistonEngine} \ No newline at end of file diff --git a/api-client/package.json b/api-client/package.json new file mode 100644 index 0000000..a0f144d --- /dev/null +++ b/api-client/package.json @@ -0,0 +1,11 @@ +{ + "name": "piston-api-client", + "version": "1.0.0", + "description": "Wraps API of Piston Engine API", + "main": "index.cjs", + "author": "Thomas Hobson ", + "license": "MIT", + "dependencies": { + "node-fetch": "^2.6.1" + } +} From 1fd3dce31d284ee74c37a8798fd8cbeb3571e75c Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Mon, 22 Feb 2021 23:38:11 +1300 Subject: [PATCH 050/385] cil: execute command --- cli/.gitignore | 1 + cli/commands/execute.js | 90 ++++++++++++++++++++++++++ cli/index.js | 14 ++++ cli/package.json | 13 ++++ cli/yarn.lock | 139 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 257 insertions(+) create mode 100644 cli/.gitignore create mode 100644 cli/commands/execute.js create mode 100755 cli/index.js create mode 100644 cli/package.json create mode 100644 cli/yarn.lock diff --git a/cli/.gitignore b/cli/.gitignore new file mode 100644 index 0000000..b512c09 --- /dev/null +++ b/cli/.gitignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/cli/commands/execute.js b/cli/commands/execute.js new file mode 100644 index 0000000..703213d --- /dev/null +++ b/cli/commands/execute.js @@ -0,0 +1,90 @@ +const {PistonEngine} = require('piston-api-wrapper'); +const fs = require('fs'); +const path = require('path'); +const chalk = require('chalk'); + +exports.command = ['execute [args..]'] +exports.aliases = ['run'] +exports.describe = 'Executes file with the specified runner' + +exports.builder = { + stdin: { + boolean: true, + desc: 'Read input from stdin and pass to executor', + alias: ['i'] + }, + run_timeout: { + alias: ['rt', 'r'], + number: true, + desc: 'Milliseconds before killing run process', + default: 3000 + }, + compile_timeout: { + alias: ['ct', 'c'], + number: true, + desc: 'Milliseconds before killing compile process', + default: 10000, + }, + files: { + alias: ['f'], + array: true, + desc: 'Additional files to add', + } +} + +exports.handler = async function(argv){ + + const api = new PistonEngine(argv['piston-url']); + + const files = [...(argv.files || []),argv.file] + .map(file_path => ({ + name: path.basename(file_path), + content: fs.readFileSync(file_path).toString() + })); + + + const stdin = (argv.stdin && await new Promise((resolve, _)=>{ + var data = ""; + process.stdin.on('data', d=> data += d) + process.stdin.on('end', _ => resolve(data)) + })) || ""; + + + const response = await api.run_job( + argv.language, + argv['language-version'], + files, + argv.file, + argv.args, + stdin, + argv.ct, + argv.rt + ) + + function step(name, ctx){ + console.log(chalk.bold(`== ${name} ==`)) + if(ctx.stdout){ + console.log(" ",chalk.bold(`STDOUT`)) + console.log(" ",ctx.stdout.replace(/\n/g,'\n ')) + } + if(ctx.stderr){ + console.log(chalk.bold(`STDERR`)) + console.log(" ",ctx.stderr.replace(/\n/g,'\n ')) + } + + if(ctx.code) + console.log( + chalk.bold(`Exit Code:`), + chalk.bold[ctx.code > 0 ? 'red' : 'green'](ctx.code) + ) + if(ctx.signal) + console.log( + chalk.bold(`Signal:`), + chalk.bold.yellow(ctx.signal) + ) + } + + if(response.compile) step('Compile', response.compile) + step('Run', response.run) + +} \ No newline at end of file diff --git a/cli/index.js b/cli/index.js new file mode 100755 index 0000000..ff29736 --- /dev/null +++ b/cli/index.js @@ -0,0 +1,14 @@ +#!/usr/bin/node +require('yargs')(process.argv.slice(2)) + .option('piston-url', { + alias: ['u'], + default: 'http://127.0.0.1:6969', + desc: 'Piston API URL', + string: true + }) + .scriptName("piston") + .commandDir('commands') + .demandCommand() + .help() + .wrap(72) + .argv diff --git a/cli/package.json b/cli/package.json new file mode 100644 index 0000000..ca8f8f5 --- /dev/null +++ b/cli/package.json @@ -0,0 +1,13 @@ +{ + "name": "piston-cli", + "version": "1.0.0", + "description": "Piston Execution Engine CLI tools", + "main": "index.js", + "author": "Thomas Hobson ", + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "piston-api-client": "file:../api-client", + "yargs": "^16.2.0" + } +} diff --git a/cli/yarn.lock b/cli/yarn.lock new file mode 100644 index 0000000..d6958b1 --- /dev/null +++ b/cli/yarn.lock @@ -0,0 +1,139 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +ansi-regex@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" + integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== + +ansi-styles@^4.0.0, ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +chalk@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a" + integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +cliui@^7.0.2: + version "7.0.4" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" + integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^7.0.0" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + +get-caller-file@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + +node-fetch@^2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" + integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== + +"piston-api-client@file:../api-client": + version "1.0.0" + dependencies: + node-fetch "^2.6.1" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= + +string-width@^4.1.0, string-width@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" + integrity sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.0" + +strip-ansi@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" + integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== + dependencies: + ansi-regex "^5.0.0" + +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +y18n@^5.0.5: + version "5.0.5" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.5.tgz#8769ec08d03b1ea2df2500acef561743bbb9ab18" + integrity sha512-hsRUr4FFrvhhRH12wOdfs38Gy7k2FFzB9qgN9v3aLykRq0dRcdcpz5C9FxdS2NuhOrI/628b/KSTJ3rwHysYSg== + +yargs-parser@^20.2.2: + version "20.2.6" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.6.tgz#69f920addf61aafc0b8b89002f5d66e28f2d8b20" + integrity sha512-AP1+fQIWSM/sMiET8fyayjx/J+JmTPt2Mr0FkrgqB4todtfa53sOsrSAcIrJRD5XS20bKUwaDIuMkWKCEiQLKA== + +yargs@^16.2.0: + version "16.2.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" + integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.0" + y18n "^5.0.5" + yargs-parser "^20.2.2" From 2505b89fcfb76e83ee9d8fabf931c38af411879b Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Mon, 22 Feb 2021 23:39:34 +1300 Subject: [PATCH 051/385] cli: correct package name --- cli/commands/execute.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/commands/execute.js b/cli/commands/execute.js index 703213d..4fbcbc5 100644 --- a/cli/commands/execute.js +++ b/cli/commands/execute.js @@ -1,4 +1,4 @@ -const {PistonEngine} = require('piston-api-wrapper'); +const {PistonEngine} = require('piston-api-client'); const fs = require('fs'); const path = require('path'); const chalk = require('chalk'); From 9d32012bbc5c36a796e9bc027fb73fed610333f8 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Tue, 23 Feb 2021 19:52:49 +1300 Subject: [PATCH 052/385] api: write stdin to child process --- api/src/executor/job.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/src/executor/job.js b/api/src/executor/job.js index 5a51a61..c99ecb9 100644 --- a/api/src/executor/job.js +++ b/api/src/executor/job.js @@ -92,13 +92,16 @@ class Job { gid: this.gid, detached: true //dont kill the main process when we kill the group }); - + + proc.stdin.write(this.stdin); + proc.stdin.end(); const kill_timeout = setTimeout(_ => proc.kill('SIGKILL'), timeout); proc.stderr.on('data', d=>{if(stderr.length>config.output_max_size) proc.kill('SIGKILL'); else stderr += d;}); proc.stdout.on('data', d=>{if(stdout.length>config.output_max_size) proc.kill('SIGKILL'); else stdout += d;}); + function exit_cleanup(){ clearTimeout(kill_timeout); proc.stderr.destroy(); From 8b61f4f69ff9eeebd8c3277b86ae9e73b83c4ad0 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 27 Feb 2021 12:58:30 +1300 Subject: [PATCH 053/385] api: add validators to endpoints --- api/src/executor/routes.js | 34 +++++++++++++++++------- api/src/index.js | 38 ++++++++++++++++----------- api/src/ppman/routes.js | 54 +++++++++++++++++++++++++++++--------- 3 files changed, 89 insertions(+), 37 deletions(-) diff --git a/api/src/executor/routes.js b/api/src/executor/routes.js index 07f7ace..440e290 100644 --- a/api/src/executor/routes.js +++ b/api/src/executor/routes.js @@ -3,19 +3,35 @@ const { get_latest_runtime_matching_language_version } = require('../runtime'); const { Job } = require('./job'); +const { body } = require('express-validator'); module.exports = { + run_job_validators: [ + body('language') + .isString(), + body('version') + .isSemVer(), + body('files') + .isArray(), + body('files.*.name') + .isString() + .bail() + .not() + .contains('/'), + body('files.*.content') + .isString(), + body('*_timeout') + .isNumeric(), + body('stdin') + .isString(), + body('args') + .isArray(), + body('args.*') + .isString() + ], async run_job(req, res){ // POST /jobs - var errored = false; - ['language', 'version', - 'files', 'main', - 'args', 'stdin', - 'compile_timeout', 'run_timeout', - ].forEach(key => { - if(req.body[key] == undefined) errored = errored || res.json_error(`${key} is required`, 400); - }); - if(errored) return errored; + const runtime = get_latest_runtime_matching_language_version(req.body.language, req.body.version); if(runtime == undefined) return res.json_error(`${req.body.language}-${req.body.version} runtime is unknown`, 400); diff --git a/api/src/index.js b/api/src/index.js index 7b295b3..5c0da73 100644 --- a/api/src/index.js +++ b/api/src/index.js @@ -11,6 +11,7 @@ const fs = require('fs/promises'); const fss = require('fs'); const body_parser = require('body-parser'); const runtime = require('./runtime'); +const {validationResult} = require('express-validator'); const logger = Logger.create('index'); const app = express(); @@ -58,11 +59,6 @@ const app = express(); logger.debug('Constructing Express App'); - logger.debug('Registering middleware'); - - app.use(body_parser.urlencoded({extended: true})); - app.use(body_parser.json()); - logger.debug('Registering custom message wrappers'); express.response.json_error = function(message, code) { @@ -74,23 +70,33 @@ const app = express(); return this.json({success: true, data: obj}); }; + logger.debug('Registering middleware'); + + app.use(body_parser.urlencoded({extended: true})); + app.use(body_parser.json()); + + + function validate(req, res, next) { + const errors = validationResult(req); + if (!errors.isEmpty()) + return res.json_error(errors.array(), 422); + next(); + } + logger.debug('Registering Routes'); const ppman_routes = require('./ppman/routes'); - app.get ('/repos', ppman_routes.repo_list); - app.post ('/repos', ppman_routes.repo_add); - app.get ('/repos/:repo_slug', ppman_routes.repo_info); - app.get ('/repos/:repo_slug/packages', ppman_routes.repo_packages); - app.get ('/repos/:repo_slug/packages/:language/:version', ppman_routes.package_info); - app.post ('/repos/:repo_slug/packages/:language/:version', ppman_routes.package_install); - app.delete('/repos/:repo_slug/packages/:language/:version', ppman_routes.package_uninstall); //TODO + app.get ('/repos', validate, ppman_routes.repo_list); + app.post ('/repos', ppman_routes.repo_add_validators, validate, ppman_routes.repo_add); + app.get ('/repos/:repo_slug', ppman_routes.repo_info_validators, validate, ppman_routes.repo_info); + app.get ('/repos/:repo_slug/packages', ppman_routes.repo_packages_validators, validate, ppman_routes.repo_packages); + app.get ('/repos/:repo_slug/packages/:language/:version', ppman_routes.package_info_validators, validate, ppman_routes.package_info); + app.post ('/repos/:repo_slug/packages/:language/:version', ppman_routes.package_info_validators, validate, ppman_routes.package_install); + app.delete('/repos/:repo_slug/packages/:language/:version', ppman_routes.package_info_validators, validate, ppman_routes.package_uninstall); //TODO const executor_routes = require('./executor/routes'); - app.post ('/jobs', executor_routes.run_job); - - - + app.post ('/jobs', executor_routes.run_job_validators, validate, executor_routes.run_job); logger.debug('Calling app.listen'); const [address,port] = config.bind_address.split(':'); diff --git a/api/src/ppman/routes.js b/api/src/ppman/routes.js index c376172..01ea19c 100644 --- a/api/src/ppman/routes.js +++ b/api/src/ppman/routes.js @@ -3,6 +3,7 @@ const state = require('../state'); const logger = require('logplease').create('ppman/routes'); const {Repository} = require('./repo'); const semver = require('semver'); +const { body, param } = require('express-validator'); async function get_or_construct_repo(slug){ if(repos.has(slug))return repos.get(slug); @@ -39,31 +40,46 @@ module.exports = { })) }); }, + repo_add_validators: [ + body('slug') + .notEmpty() + .bail() + .isSlug() + .bail() + .not() + .custom(value=>state.state.get('repositories').keys().includes(value)) + .withMessage("slug is already in use"), + body('url') + .notEmpty() + .bail() + .isURL({require_protocol: true}) + + ], async repo_add(req, res){ // POST /repos logger.debug(`Request for repoAdd slug=${req.body.slug} url=${req.body.url}`); - if(!req.body.slug) - return res.json_error('slug is missing from request body', 400); - if(!req.body.url) - return res.json_error('url is missing from request body', 400); const repo_state = state.state.get('repositories'); - - if(repo_state.has(req.body.slug)) return res.json_error(`repository ${req.body.slug} already exists`, 409); repo_state.set(req.body.slug, req.body.url); logger.info(`Repository ${req.body.slug} added url=${req.body.url}`); return res.json_success(req.body.slug); }, + repo_info_validators: [ + param('repo_slug') + .isSlug() + .bail() + .custom(value=>state.state.get('repositories').has(value)) + .withMessage("repository does not exist") + .bail() + ], async repo_info(req, res){ // GET /repos/:slug logger.debug(`Request for repoInfo for ${req.params.repo_slug}`); const repo = await get_or_construct_repo(req.params.repo_slug); - - if(repo == null) return res.json_error(`Requested repo ${req.params.repo_slug} does not exist`, 404); res.json_success({ slug: repo.slug, @@ -71,6 +87,14 @@ module.exports = { packages: repo.packages.length }); }, + repo_packages_validators: [ + param('repo_slug') + .isSlug() + .bail() + .custom(value=>state.state.get('repositories').has(value)) + .withMessage("repository does not exist") + .bail() + ], async repo_packages(req, res){ // GET /repos/:slug/packages logger.debug('Request to repoPackages'); @@ -86,13 +110,20 @@ module.exports = { })) }); }, + package_info_validators: [ + param('repo_slug') + .isSlug() + .bail() + .custom(value=>state.state.get('repositories').has(value)) + .withMessage("repository does not exist") + .bail() + ], async package_info(req, res){ // GET /repos/:slug/packages/:language/:version logger.debug('Request to packageInfo'); const repo = await get_or_construct_repo(req.params.repo_slug); - if(repo == null) return res.json_error(`Requested repo ${req.params.repo_slug} does not exist`, 404); const pkg = await get_package(repo, req.params.language, req.params.version); if(pkg == null) return res.json_error(`Requested package ${req.params.language}-${req.params.version} does not exist`, 404); @@ -113,8 +144,6 @@ module.exports = { logger.debug('Request to packageInstall'); const repo = await get_or_construct_repo(req.params.repo_slug); - if(repo == null) return res.json_error(`Requested repo ${req.params.repo_slug} does not exist`, 404); - const pkg = await get_package(repo, req.params.language, req.params.version); if(pkg == null) return res.json_error(`Requested package ${req.params.language}-${req.params.version} does not exist`, 404); @@ -131,6 +160,7 @@ module.exports = { async package_uninstall(req,res){ // DELETE /repos/:slug/packages/:language/:version - res.json(req.body); //TODO + //res.json(req.body); //TODO + res.json_error("not implemented", 500) } }; \ No newline at end of file From 764641b5a6dae815002c175ea8d35121a5a44dd0 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 27 Feb 2021 13:08:51 +1300 Subject: [PATCH 054/385] api: lint --- api/src/executor/routes.js | 16 ++++++++-------- api/src/index.js | 6 +++--- api/src/ppman/routes.js | 24 ++++++++++++------------ 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/api/src/executor/routes.js b/api/src/executor/routes.js index 440e290..a69aeeb 100644 --- a/api/src/executor/routes.js +++ b/api/src/executor/routes.js @@ -8,26 +8,26 @@ const { body } = require('express-validator'); module.exports = { run_job_validators: [ body('language') - .isString(), + .isString(), // eslint-disable-line snakecasejs/snakecasejs body('version') - .isSemVer(), + .isSemVer(), // eslint-disable-line snakecasejs/snakecasejs body('files') - .isArray(), + .isArray(), // eslint-disable-line snakecasejs/snakecasejs body('files.*.name') - .isString() + .isString() // eslint-disable-line snakecasejs/snakecasejs .bail() .not() .contains('/'), body('files.*.content') - .isString(), + .isString(), // eslint-disable-line snakecasejs/snakecasejs body('*_timeout') - .isNumeric(), + .isNumeric(), // eslint-disable-line snakecasejs/snakecasejs body('stdin') - .isString(), + .isString(), // eslint-disable-line snakecasejs/snakecasejs body('args') .isArray(), body('args.*') - .isString() + .isString() // eslint-disable-line snakecasejs/snakecasejs ], async run_job(req, res){ // POST /jobs diff --git a/api/src/index.js b/api/src/index.js index 5c0da73..98d9a1d 100644 --- a/api/src/index.js +++ b/api/src/index.js @@ -11,7 +11,7 @@ const fs = require('fs/promises'); const fss = require('fs'); const body_parser = require('body-parser'); const runtime = require('./runtime'); -const {validationResult} = require('express-validator'); +const {validationResult} = require('express-validator'); //eslint-disable-line snakecasejs/snakecasejs const logger = Logger.create('index'); const app = express(); @@ -77,8 +77,8 @@ const app = express(); function validate(req, res, next) { - const errors = validationResult(req); - if (!errors.isEmpty()) + const errors = validationResult(req); //eslint-disable-line snakecasejs/snakecasejs + if (!errors.isEmpty()) //eslint-disable-line snakecasejs/snakecasejs return res.json_error(errors.array(), 422); next(); } diff --git a/api/src/ppman/routes.js b/api/src/ppman/routes.js index 01ea19c..86a45e7 100644 --- a/api/src/ppman/routes.js +++ b/api/src/ppman/routes.js @@ -42,17 +42,17 @@ module.exports = { }, repo_add_validators: [ body('slug') - .notEmpty() + .notEmpty() // eslint-disable-line snakecasejs/snakecasejs .bail() - .isSlug() + .isSlug() // eslint-disable-line snakecasejs/snakecasejs .bail() .not() .custom(value=>state.state.get('repositories').keys().includes(value)) - .withMessage("slug is already in use"), + .withMessage('slug is already in use'), // eslint-disable-line snakecasejs/snakecasejs body('url') - .notEmpty() + .notEmpty() // eslint-disable-line snakecasejs/snakecasejs .bail() - .isURL({require_protocol: true}) + .isURL({require_protocol: true}) // eslint-disable-line snakecasejs/snakecasejs ], async repo_add(req, res){ @@ -69,10 +69,10 @@ module.exports = { }, repo_info_validators: [ param('repo_slug') - .isSlug() + .isSlug() // eslint-disable-line snakecasejs/snakecasejs .bail() .custom(value=>state.state.get('repositories').has(value)) - .withMessage("repository does not exist") + .withMessage('repository does not exist') // eslint-disable-line snakecasejs/snakecasejs .bail() ], async repo_info(req, res){ @@ -89,10 +89,10 @@ module.exports = { }, repo_packages_validators: [ param('repo_slug') - .isSlug() + .isSlug() // eslint-disable-line snakecasejs/snakecasejs .bail() .custom(value=>state.state.get('repositories').has(value)) - .withMessage("repository does not exist") + .withMessage('repository does not exist') // eslint-disable-line snakecasejs/snakecasejs .bail() ], async repo_packages(req, res){ @@ -112,10 +112,10 @@ module.exports = { }, package_info_validators: [ param('repo_slug') - .isSlug() + .isSlug() // eslint-disable-line snakecasejs/snakecasejs .bail() .custom(value=>state.state.get('repositories').has(value)) - .withMessage("repository does not exist") + .withMessage('repository does not exist') // eslint-disable-line snakecasejs/snakecasejs .bail() ], async package_info(req, res){ @@ -161,6 +161,6 @@ module.exports = { // DELETE /repos/:slug/packages/:language/:version //res.json(req.body); //TODO - res.json_error("not implemented", 500) + res.json_error('not implemented', 500); } }; \ No newline at end of file From 21c605713034cbc7e5bc419b7f50d1bc3c8df45a Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 27 Feb 2021 18:28:08 +1300 Subject: [PATCH 055/385] pkg: massive overhaul --- packages/.gitignore | 3 +- packages/CONTRIBUTING.MD | 76 +++++++++++++++++++------------ packages/Makefile | 30 +++++++++++++ packages/README.MD | 7 +++ packages/common.mk | 96 +++++++++++++++++++++++++--------------- packages/python.mk | 22 +++++++++ packages/python/Makefile | 4 -- packages/python/base.mk | 19 -------- packages/secondary.mk | 23 ---------- 9 files changed, 168 insertions(+), 112 deletions(-) create mode 100644 packages/Makefile create mode 100644 packages/README.MD create mode 100644 packages/python.mk delete mode 100644 packages/python/Makefile delete mode 100644 packages/python/base.mk delete mode 100644 packages/secondary.mk diff --git a/packages/.gitignore b/packages/.gitignore index db91d1f..2e367bf 100644 --- a/packages/.gitignore +++ b/packages/.gitignore @@ -1 +1,2 @@ -*/*/ \ No newline at end of file +build/ +*.pkg.tar.gz \ No newline at end of file diff --git a/packages/CONTRIBUTING.MD b/packages/CONTRIBUTING.MD index 6e145d4..6e41706 100644 --- a/packages/CONTRIBUTING.MD +++ b/packages/CONTRIBUTING.MD @@ -1,43 +1,61 @@ # Contributing packages to the Piston Repository +## Naming Lanaguages + +Some languages have multiple different wide-spread interpreters (node/deno for example) which need to be accounted for. + +If the given language has multiple incompatiable interpreters (e.g. deno/node/v8), these should be named as `[language]-[interpreter]`. +For cases where the language has many compatable interpreters (e.g. gcc/llvm), pick one and name it `[language]`. +For languages with only 1 wide-spread interpreter (e.g. Kotlin), name it `[language]` + +## File Naming Rules + +Different versions of interpreters require different steps to build, and in this case they should be given 2 different files, but keep the same language name. + +Use `[language-name].mk` (see naming languages) for languages with a common build script. +When the build steps become obsolete, create a new file named `[language-name]-[version].mk`, with the first version where the new build steps were required. + ## Creating new languages -1. Create a new branch on your fork of engineer-man/piston. -2. Create a directory (all lowercase) with the name of the language. -3. Create a Makefile containing the following, filling in the fields marked with % -Versions can be a list of version numbers, separated by spaces. -Quotes are not required. -```makefile -LANGUAGE=% -VERSIONS=% +See [python.mk](python.mk) or any other `.mk` file (except `common.mk`) for an example. -include ../secondary.mk -``` -4. Create a `base.mk` file, this is the file which will hold the correct targets to make each build. -It should download any sources it requires uring `curl` and use as much version templating as possible. -You should include 3 variables: `AUTHOR`, `DEPS` and `COMPILED`. +Please note that this is a regular Makefile, with a few extra varibles added by `common.mk`, any additional variables not listed here can be located in there. -`AUTHOR` is simply your name, and email address formatted as `Your Name `. -`DEPS` is a list (separated by spaces) of packages which are required with this one for it to work correctly. -This is mainly used in the case of golfing languages, which use other languages (e.g. python and eilxar) to interpret them. Give a package name and a SemVer selector (e.g. `python==3.x.x` for any python3 build). -`COMPILED` is simply a true or false field indicating if the package contains a `compile` target (see below). +1. Create a new branch on your fork of engineer-man/piston -You should also include 3/4 targets: `run`, `${NAME}-${VERSION}`, `${NAME}-${VERSION}/environment` and optionally `compile` (only if the language is a compiled language, e.g. cpp/c) +2. Create a new file for your language, following the naming rules as listed above -The `run` file is one which is passed the main source file (first argument) and the arguments for the process (remaining arguments). STDIN data is also piped in. Generate this by using either a `cat` or an `echo` statement(s) and piping them into `$@` (it means the target name in Makefiles). You have to escape `$` symbols with `$$`. +3. Add `NAME=[language name]` to this file, replacing `[language name]` with the language name all in lowercase, removing any punctuation and numbers (e.g. 05AB1E becomes osabie). -The `${NAME}-${VERSION}` directory should contain all the binaries required to run the language. -You should use this target to compile all the sources, and installing them into the `$@` location +4. Add `AUTHOR=[author]` to this file, replacing `[author]` with your name and email address in the format `Full Name ` (standard git format). -`${NAME}-${VERSION}/environment` should contain a bunch of environment variables which will be passed into the `run` and `compile` scripts of not only this language, but any which depend on it. -If your package depends on any others, their environment variables are automatically sourced, then your packages ones are sourced after. +5. Add `DEPENDENCIES=[dependencies list]` to this file, replacing `[dependencies list]` with a list of dependencies, seperated by spaces in the format `[language]==[version]`. If there are none, simply leave this as `DEPENDENCIES=` -The `compile` file contains instructions to compile source files into a final binary which should be run by `run`. It's first argument is the main source file, with other source files being provided as other arguments. STDIN is left blank, but both STDOUT and STDERR are returned. The `run` file will be skipped if this file returns a non-zero error code. +6. Add `COMPILED=[true/false]` to this file, set this to true if the language requires the compile stage, and false if it only requires run. -5. Commit your new package with the following message format: `pkg([language name] [version(s)]): [description including versions]` +7. Add `VERSIONS=[version list]` to this file, replacing `[version list]` with a list of [SemVer](https://semver.org/) compilant version numbers for the language which this build file can build. This value will be passed in as `${VERSION}` for you to access -Examples: -* `pkg(python 3.9.1): new version` -* `pkg(python 3.9.1 2.7.1): refactor` +8. Add `include common.mk`, to include all the common Makefile rules and variables. + +9. Create the target for the run file by adding `${RUN_FILE}:`, followed by steps on new lines, indented by a tab (`\t`) to create a bash script, which is run for every job (`/execute` endpoint) for this language and returns on STDOUT/STDERR the output of the run. +The script is expected to take in the first argument (`$1`) as the main code file, with subsequent arguments being passed in from the execute endpoint. +The script is passed STDIN as specified in the job, and expects output on STDOUT/STDERR. It should also pass through the exit code from the interpreter. +It is recommended to use `echo` statements, redirecting output to `$@` (a special Makefile variable expanding to the target file, in this case RUN_FILE). +Make sure to escape any `$` with `$$`, as `$` will expand make variables. + +10. (optional, only use if language requires compliation) +Create the target for the compile file by adding `${COMPILE_FILE}:`, followed by steps on new lines, indented by a tab (`\t`) to create a bash script, which is run for every job (`/execute` endpoint) for this language, if it requires compilation. +This script is expected to take all code files in as arguements, and output binary files. STDERR/STDOUT are captured and passed out, along with error code. The job STDIN and args are not passed in to this script. +This script should compile source code into a binary, and has a seperate time limit from run, and thus should split the stages. +Follow all priciples from step 9, using echo statements and escaping `$`. + +11. Create the target for the environment file by adding `${ENV_FILE}:`, followed by steps on new lines, indented by a tab (`\t`) to create a bash script, which modifies environment variables exactly how you would a `.profile` or `.bashrc` file. Note that this file is only run at install time, and thus cannot dynamicly adjust to the arguements passed into it. +The environment file is also appended with all dependencies before being cached. +You should add in the path to any binaries. The current working directory for the script is contained within the `${BIN_DIR}` folder. + +12. Create the target for the binaries by adding `${BIN_DIR}:`, followed by steps on new lines, indented by a tab (`\t`) which will download sources, compile and output binaries in to the `${BIN_DIR}` (`$@`) + +13. Locally test your Makefile builds with `make build-[language]-[version]`. +If everything went well, you should now have a `[language]-[version].pkg.tar.gz` file sitting in the root. +If not, read through your error logs, and if in doubt ask for help in #emkc-felix-piston in Discord. -6. Create a pull request, referencing the issue number of the language \ No newline at end of file diff --git a/packages/Makefile b/packages/Makefile new file mode 100644 index 0000000..f8d01f0 --- /dev/null +++ b/packages/Makefile @@ -0,0 +1,30 @@ +# Wraps all other Makefiles + +# Variables +PKG_FILES=$(filter-out common.mk,$(wildcard *.mk)) +PKG_SLUGS=$(foreach pkg, ${PKG_FILES}, $(addprefix $(shell make -f ${pkg} name)-, $(shell make -f ${pkg} versions))) + +# Functions +define pkg_info + $(eval PKG_SLUG=$(patsubst $1-%,%,$2)) + $(eval PKG_PARTS=$(subst -, ,${PKG_SLUG})) + $(eval PKG_NAME=$(word 1,${PKG_PARTS})) + $(eval PKG_VERSION=$(word 2,${PKG_PARTS})) + $(eval PKG_FILE=$(shell grep '^VERSIONS\s*=.*${PKG_VERSION}' $(shell grep "NAME\s*=\s*${PKG_NAME}" ${PKG_FILES} -l) -l)) +endef + +# Targets + +build: $(foreach pkg, ${PKG_FILES}, $(addprefix build-$(shell make -f ${pkg} name)-, $(lastword $(shell make -f ${pkg} versions)))) + +$(addprefix build-, ${PKG_SLUGS}): + $(call pkg_info,build,$@) + $(MAKE) -f ${PKG_FILE} VERSION=${PKG_VERSION} build + + + +clean: $(foreach pkg, ${PKG_FILES}, $(addprefix clean-$(shell make -f ${pkg} name)-, $(shell make -f ${pkg} versions))) + rm -rf build/ +$(addprefix clean-, ${PKG_SLUGS}): + $(call pkg_info,clean,$@) + $(MAKE) -f ${PKG_FILE} VERSION=${PKG_VERSION} clean diff --git a/packages/README.MD b/packages/README.MD new file mode 100644 index 0000000..bcc3a93 --- /dev/null +++ b/packages/README.MD @@ -0,0 +1,7 @@ +# Piston Package Build Scripts + +## Building + +```bash +make build-[name]-[version] +``` diff --git a/packages/common.mk b/packages/common.mk index 90773cc..c55d94f 100644 --- a/packages/common.mk +++ b/packages/common.mk @@ -1,46 +1,70 @@ -LANG_NAME=$(or ${NAME},none) -LANG_VERSION=$(or ${VERSION},0.0.0) -LANG_AUTHOR=$(or ${AUTHOR},HexF ) -LANG_DEPS=$(or ${DEPS}) -LANG_COMPILED=$(or ${COMPILED}, false) +# Variables +PKG_SLUG=${NAME}-${VERSION} +BUILD_DIR=build/${PKG_SLUG}/ -LANG_PKG_TARGETS=pkg-info.json ${LANG_NAME}-${LANG_VERSION}/ ${LANG_NAME}-${LANG_VERSION}/environment run +BIN_DIR=${BUILD_DIR}${PKG_SLUG}/ +RUN_FILE=${BUILD_DIR}run +COMPILE_FILE=${BUILD_DIR}compile +ENV_FILE=${BIN_DIR}environment +INFO_FILE=${BUILD_DIR}pkg-info.jq -BUILD_PLATFORM=$(or ${PLATFORM}, baremetal-$(shell grep -oP "^ID=\K\w+" /etc/os-release )) +PKG_FILE=${PKG_SLUG}.pkg.tar.gz -ifeq (${LANG_COMPILED}, true) -${LANG_NAME}-${LANG_VERSION}.pkg.tar.gz: $(LANG_PKG_TARGETS) compile +VERSION_MINOR=$(shell grep -oP "\d+.\d+"<<<${VERSION}) +VERSION_MAJOR=$(shell grep -oP "\d+"<<<${VERSION}) + +PKG_TARGETS=${BIN_DIR} ${ENV_FILE} ${RUN_FILE} ${INFO_FILE} + + +# Command Targets + +.PHONY: catch versions name build clean +catch: + # Catch manual calling + # This is done to make sure people don't call without ${VERSION}, which can cause problems + @echo "Don't directly call individual scripts, instead call the common Makefile" + @exit 1 + +versions: + @echo ${VERSIONS} + +name: + @echo ${NAME} + +build: ${BUILD_DIR} ${PKG_FILE} +clean: + rm -rf ${BUILD_DIR} + rm -f ${PKG_FILE} + +# mkdir +${BUILD_DIR}: + mkdir -p ${BUILD_DIR} + + +# Generated files + +ifeq (${COMPILED}, true) +${PKG_FILE}: ${PKG_TARGETS} ${COMPILE_FILE} endif -${LANG_NAME}-${LANG_VERSION}.pkg.tar.gz: $(LANG_PKG_TARGETS) - tar czf $@ $? - -%.json: %.jq - jq '$(shell tr '\n' '|' < $<).' <<< "{}" > $@ +${PKG_FILE}: ${PKG_TARGETS} + tar -czC ${BUILD_DIR} -f $@ ${patsubst ${BUILD_DIR}%,%,$?} -pkg-info.jq: - echo '.language="${LANG_NAME}"' > pkg-info.jq - echo '.version="${LANG_VERSION}"' >> pkg-info.jq - echo '.author="${LANG_AUTHOR}"' >> pkg-info.jq - echo '.dependencies={}' >> pkg-info.jq - echo '.build_platform="${BUILD_PLATFORM}"' >> pkg-info.jq - $(foreach dep, ${LANG_DEPS}, echo '.dependencies.$(word 1,$(subst =, ,${dep}))="$(word 2,$(subst =, ,${dep}))"' >> pkg-info.jq) +${INFO_FILE}: + echo '.language="${NAME}"' > $@ + echo '.version="${VERSION}"' >> $@ + echo '.author="${AUTHOR}"' >> $@ + echo '.dependencies={}' >> $@ + echo '.build_platform="$(or ${PLATFORM}, baremetal-$(shell grep -oP "^ID=\K\w+" /etc/os-release ))"' >> $@ + $(foreach dep, ${DEPENDENCIES}, echo '.dependencies.$(word 1,$(subst =, ,${dep}))="$(word 2,$(subst =, ,${dep}))"' >> $@) -%.asc: % - gpg --detach-sig --armor --batch --output $@ $< + + +# Helpers %/: %.tgz - tar xzf $< - + cd ${BUILD_DIR} && tar xzf $(patsubst ${BUILD_DIR}%,%,$<) %/: %.tar.gz - tar xzf $< + cd ${BUILD_DIR} && tar xzf $(patsubst ${BUILD_DIR}%,%,$<) -.PHONY: clean -clean: - rm -rf $(filter-out Makefile, $(wildcard *)) - -,PHONY: cleanup -cleanup: - rm -rf $(filter-out ${LANG_NAME}-${LANG_VERSION}.pkg.tar.gz.asc, $(filter-out ${LANG_NAME}-${LANG_VERSION}.pkg.tar.gz, $(filter-out Makefile, $(wildcard *)))) - -.PHONY: sign -sign: ${LANG_NAME}-${LANG_VERSION}.pkg.tar.gz.asc \ No newline at end of file +%.json: %.jq + jq '$(shell tr '\n' '|' < $<).' <<< "{}" > $@ \ No newline at end of file diff --git a/packages/python.mk b/packages/python.mk new file mode 100644 index 0000000..4aaef1d --- /dev/null +++ b/packages/python.mk @@ -0,0 +1,22 @@ +NAME=python +AUTHOR=Thomas Hobson +DEPENDENCIES= +COMPILED=false +VERSIONS=2.7.1 3.5.1 3.9.1 + +include common.mk + + +${RUN_FILE}: + echo 'python${VERSION_MINOR} $$*' > $@ + +${ENV_FILE}: + echo 'export PATH=$$PWD/bin:$$PATH' > $@ + +${BIN_DIR}: ${BUILD_DIR}Python-${VERSION}/ + cd $< && ./configure --prefix / + $(MAKE) -j64 -C $< + DESTDIR=../${PKG_SLUG} $(MAKE) -j64 -C $< altinstall || true + +${BUILD_DIR}Python-${VERSION}.tgz: + curl "https://www.python.org/ftp/python/${VERSION}/Python-${VERSION}.tgz" -o $@ diff --git a/packages/python/Makefile b/packages/python/Makefile deleted file mode 100644 index 23daac2..0000000 --- a/packages/python/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -LANGUAGE=python -VERSIONS=2.7.1 3.9.1 - -include ../secondary.mk \ No newline at end of file diff --git a/packages/python/base.mk b/packages/python/base.mk deleted file mode 100644 index 3a19952..0000000 --- a/packages/python/base.mk +++ /dev/null @@ -1,19 +0,0 @@ -AUTHOR=Thomas Hobson -DEPS= -COMPILED=false - -include ../../common.mk - -run: - echo 'python$(shell grep -oP "\d+.\d+"<<<${VERSION}) $$*' > run - -${NAME}-${VERSION}/environment: - echo 'export PATH=$$PWD/bin:$$PATH' > $@ - -${NAME}-${VERSION}/: Python-${VERSION}/ - cd $< && ./configure --prefix / - $(MAKE) -j$(or ${MAKE_JOBS},64) -C $< - DESTDIR=../$@ $(MAKE) -j$(or ${MAKE_JOBS},64) -C $< altinstall || true - -Python-${VERSION}.tgz: - curl "https://www.python.org/ftp/python/${VERSION}/$@" -o $@ \ No newline at end of file diff --git a/packages/secondary.mk b/packages/secondary.mk deleted file mode 100644 index 2def001..0000000 --- a/packages/secondary.mk +++ /dev/null @@ -1,23 +0,0 @@ -.PHONY: build sign cleanup clean -build: $(patsubst %,%/${LANGUAGE}-%.pkg.tar.gz,${VERSIONS}) -sign: $(patsubst %,%/${LANGUAGE}-%.pkg.tar.gz.asc,${VERSIONS}) -clean: - rm -rf ${VERSIONS} -cleanup: $(patsubst %,%/cleanup,${VERSIONS}) - - -%/cleanup: %/Makefile - $(MAKE) -C $(shell dirname $<) cleanup - rm $(shell dirname $<)/Makefile - -%/${LANGUAGE}-%.pkg.tar.gz.asc: %/Makefile - $(MAKE) -C $(shell dirname $<) sign -%/${LANGUAGE}-%.pkg.tar.gz: %/Makefile - $(MAKE) -C $(shell dirname $<) - - -%/Makefile: - @mkdir -p $(shell dirname $@) - @echo 'VERSION=$(patsubst %/Makefile,%,$@)' > $@ - @echo 'NAME=${LANGUAGE}' >> $@ - @echo 'include ../base.mk' >> $@ From a59453f231848f640a63ddb4e4761418b1ac9efd Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 27 Feb 2021 18:28:18 +1300 Subject: [PATCH 056/385] pkg: finalize contributing --- packages/CONTRIBUTING.MD | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/CONTRIBUTING.MD b/packages/CONTRIBUTING.MD index 6e41706..d1b37d0 100644 --- a/packages/CONTRIBUTING.MD +++ b/packages/CONTRIBUTING.MD @@ -59,3 +59,7 @@ You should add in the path to any binaries. The current working directory for th If everything went well, you should now have a `[language]-[version].pkg.tar.gz` file sitting in the root. If not, read through your error logs, and if in doubt ask for help in #emkc-felix-piston in Discord. +14. Commit your changes, using message format of `pkg([language]): Added [language] [version]` +Any additional commits regarding this package should start with `pkg([language]): ` + +15. Create a pull request (currently to v3), referencing an Issue number (if there is one associated). From 8a0f7b3abd51c926b0535f0fe54fbdc898cac3b9 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 27 Feb 2021 18:45:43 +1300 Subject: [PATCH 057/385] api: add express-validator --- api/package.json | 1 + api/yarn.lock | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/api/package.json b/api/package.json index 5c494a7..ba86daa 100644 --- a/api/package.json +++ b/api/package.json @@ -6,6 +6,7 @@ "dependencies": { "body-parser": "^1.19.0", "express": "^4.17.1", + "express-validator": "^6.10.0", "is-docker": "^2.1.1", "js-yaml": "^4.0.0", "logplease": "^1.2.15", diff --git a/api/yarn.lock b/api/yarn.lock index ec163b5..05ec0fc 100644 --- a/api/yarn.lock +++ b/api/yarn.lock @@ -531,6 +531,14 @@ etag@~1.8.1: resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= +express-validator@^6.10.0: + version "6.10.0" + resolved "https://registry.yarnpkg.com/express-validator/-/express-validator-6.10.0.tgz#66f70f73d04fb55c227401c75fe3713879c9cb70" + integrity sha512-gDtepU94EpUzgFvKO/8JzjZ4uqIF4xHekjYtcNgFDiBK6Hob3MQhPU8s/c3NaWd1xi5e5nA0oVmOJ0b0ZBO36Q== + dependencies: + lodash "^4.17.20" + validator "^13.5.2" + express@^4.17.1: version "4.17.1" resolved "https://registry.yarnpkg.com/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134" @@ -1270,6 +1278,11 @@ v8-compile-cache@^2.0.3: resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz#9471efa3ef9128d2f7c6a7ca39c4dd6b5055b132" integrity sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q== +validator@^13.5.2: + version "13.5.2" + resolved "https://registry.yarnpkg.com/validator/-/validator-13.5.2.tgz#c97ae63ed4224999fb6f42c91eaca9567fe69a46" + integrity sha512-mD45p0rvHVBlY2Zuy3F3ESIe1h5X58GPfAtslBjY7EtTqGquZTj+VX/J4RnHWN8FKq0C9WRVt1oWAcytWRuYLQ== + vary@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" From e5225f05c9bb7e41bf6a13d16aa47ae5543f8ce3 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 27 Feb 2021 19:29:15 +1300 Subject: [PATCH 058/385] api-client: fix url joining --- api-client/index.cjs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/api-client/index.cjs b/api-client/index.cjs index 815f57e..846b237 100644 --- a/api-client/index.cjs +++ b/api-client/index.cjs @@ -1,5 +1,10 @@ const fetch = require('node-fetch') +function url_join(base, endpoint){ + return base + endpoint + //return new URL(endpoint, base).href; +} + class APIWrapper { #base; constructor(base_url){ @@ -7,7 +12,7 @@ class APIWrapper { } async query(endpoint, options={}){ - const url = new URL(endpoint, this.#base).href; + const url = url_join(this.#base, endpoint); return await fetch(url, options) .then(res=>res.json()) .then(res=>{if(res.data)return res.data; throw new Error(res.message)}); @@ -44,7 +49,7 @@ class APIWrapper { class PistonEngineRepositoryPackage extends APIWrapper { constructor(repo, {language, language_version, author, buildfile, size, dependencies, installed}){ - super(new URL(`/packages/${language}/${language_version}`,repo.url_base)) + super(url_join(repo.url_base, `/packages/${language}/${language_version}`)) this.language = language; this.language_version = language_version; @@ -67,7 +72,7 @@ class PistonEngineRepositoryPackage extends APIWrapper { class PistonEngineRepository extends APIWrapper { constructor(engine, {slug, url, packages}){ - super(new URL(`/repos/${slug}`, engine.url_base,)) + super(url_join(engine.url_base,`/repos/${slug}`)) this.slug = slug; this.url = url; From ff69a28a68b00082937108473cc780afbc14d1e6 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 27 Feb 2021 19:30:11 +1300 Subject: [PATCH 059/385] cli: add ppman install and list --- cli/commands/ppman.js | 7 ++++++ cli/commands/ppman_commands/install.js | 35 ++++++++++++++++++++++++++ cli/commands/ppman_commands/list.js | 31 +++++++++++++++++++++++ 3 files changed, 73 insertions(+) create mode 100644 cli/commands/ppman.js create mode 100644 cli/commands/ppman_commands/install.js create mode 100644 cli/commands/ppman_commands/list.js diff --git a/cli/commands/ppman.js b/cli/commands/ppman.js new file mode 100644 index 0000000..f41c1dd --- /dev/null +++ b/cli/commands/ppman.js @@ -0,0 +1,7 @@ +exports.command = 'ppman' +exports.aliases = ['pkg'] +exports.describe = 'Package Manager' + +exports.builder = yargs => yargs + .commandDir('ppman_commands') + .demandCommand() \ No newline at end of file diff --git a/cli/commands/ppman_commands/install.js b/cli/commands/ppman_commands/install.js new file mode 100644 index 0000000..83da33a --- /dev/null +++ b/cli/commands/ppman_commands/install.js @@ -0,0 +1,35 @@ +const {PistonEngine} = require('piston-api-client'); +const chalk = require('chalk'); + +exports.command = ['install '] +exports.aliases = ['i'] +exports.describe = 'Installs the named package' + + +const msg_format = { + 'color': p => `${p.success ? chalk.green.bold('✓') : chalk.red.bold('❌')} Installation ${p.success ? "succeeded" : "failed: " + p.message}`, + 'monochrome': p => `Installation ${p.success ? "succeeded" : "failed: " + p.message}`, + 'json': JSON.stringify + +} + +exports.handler = async function(argv){ + const api = new PistonEngine(argv['piston-url']); + + const repos = await api.list_repos(); + const repos_obj = await Promise.all(repos.repos.map(({slug}) => api.get_repo(slug))); + const repo_pkgs = await Promise.all(repos_obj.map( + async repo => ({ + repo: repo, + packages: await repo.list_packages().catch(x=>[]) + }) + )) + + const repo = repo_pkgs.find(r => r.packages.find(p=>p.language == argv['language'] && p.language_version == argv['language-version'])) + if(!repo) throw Error("Package could not be located") + + const package = await repo.repo.get_package(argv['language'], argv['language-version']) + const install = await package.install().catch(x=>x) + + console.log(msg_format.color(install)); +} \ No newline at end of file diff --git a/cli/commands/ppman_commands/list.js b/cli/commands/ppman_commands/list.js new file mode 100644 index 0000000..162d286 --- /dev/null +++ b/cli/commands/ppman_commands/list.js @@ -0,0 +1,31 @@ +const {PistonEngine} = require('piston-api-client'); +const chalk = require('chalk'); + +exports.command = ['list'] +exports.aliases = ['l'] +exports.describe = 'Lists all available packages' + + +const msg_format = { + 'color': p => `${chalk[p.installed ? "green":"red"]("•")} ${p.language} ${p.language_version}`, + 'monochrome': p => `${p.language} ${p.language_version} ${p.installed ? "(INSTALLED)": ""}`, + 'json': JSON.stringify + +} + +exports.handler = async function(argv){ + const api = new PistonEngine(argv['piston-url']); + + const repos = await api.list_repos(); + const repos_obj = await Promise.all(repos.repos.map(({slug}) => api.get_repo(slug))); + const packages = await repos_obj.reduce(async (a, c) => [ + ...await a, + ...await c.list_packages().catch(x=>{console.log(x); return []}) + ], []); + + const pkg_msg = packages + .map(msg_format.color) + .join('\n'); + + console.log(pkg_msg); +} \ No newline at end of file From f786a7def0846f0065261d36ad36dad8e6d0e3aa Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 27 Feb 2021 19:43:25 +1300 Subject: [PATCH 060/385] pkg(python): use proper extension for tar.gz archives --- packages/python.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/python.mk b/packages/python.mk index 4aaef1d..0c8d72f 100644 --- a/packages/python.mk +++ b/packages/python.mk @@ -18,5 +18,5 @@ ${BIN_DIR}: ${BUILD_DIR}Python-${VERSION}/ $(MAKE) -j64 -C $< DESTDIR=../${PKG_SLUG} $(MAKE) -j64 -C $< altinstall || true -${BUILD_DIR}Python-${VERSION}.tgz: +${BUILD_DIR}Python-${VERSION}.tar.gz: curl "https://www.python.org/ftp/python/${VERSION}/Python-${VERSION}.tgz" -o $@ From fb8ce57b60f8520626c0c7123d295c88701ededc Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 27 Feb 2021 19:43:58 +1300 Subject: [PATCH 061/385] pkg(common): remove tgz helper --- packages/common.mk | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/common.mk b/packages/common.mk index c55d94f..3ceec09 100644 --- a/packages/common.mk +++ b/packages/common.mk @@ -60,9 +60,6 @@ ${INFO_FILE}: # Helpers - -%/: %.tgz - cd ${BUILD_DIR} && tar xzf $(patsubst ${BUILD_DIR}%,%,$<) %/: %.tar.gz cd ${BUILD_DIR} && tar xzf $(patsubst ${BUILD_DIR}%,%,$<) From bc0b9741cff66d18fbbc2673833060cecfe14c24 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 27 Feb 2021 19:50:23 +1300 Subject: [PATCH 062/385] pkg(common): add tar.xz helper --- packages/common.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/common.mk b/packages/common.mk index 3ceec09..82ff19c 100644 --- a/packages/common.mk +++ b/packages/common.mk @@ -62,6 +62,8 @@ ${INFO_FILE}: # Helpers %/: %.tar.gz cd ${BUILD_DIR} && tar xzf $(patsubst ${BUILD_DIR}%,%,$<) +%/: %.tar.xz + cd ${BUILD_DIR} && tar xf $(patsubst ${BUILD_DIR}%,%,$<) %.json: %.jq jq '$(shell tr '\n' '|' < $<).' <<< "{}" > $@ \ No newline at end of file From da51de09b3d1611cce43f39ec3b3a3cb36947162 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 27 Feb 2021 19:51:13 +1300 Subject: [PATCH 063/385] pkg(Makefile): allow hyphen in language names --- packages/Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/Makefile b/packages/Makefile index f8d01f0..a3a5513 100644 --- a/packages/Makefile +++ b/packages/Makefile @@ -7,9 +7,8 @@ PKG_SLUGS=$(foreach pkg, ${PKG_FILES}, $(addprefix $(shell make -f ${pkg} name)- # Functions define pkg_info $(eval PKG_SLUG=$(patsubst $1-%,%,$2)) - $(eval PKG_PARTS=$(subst -, ,${PKG_SLUG})) - $(eval PKG_NAME=$(word 1,${PKG_PARTS})) - $(eval PKG_VERSION=$(word 2,${PKG_PARTS})) + $(eval PKG_VERSION=$(lastword $(subst -, ,${PKG_SLUG}))) + $(eval PKG_NAME=$(patsubst %-${PKG_VERSION},%,${PKG_SLUG})) $(eval PKG_FILE=$(shell grep '^VERSIONS\s*=.*${PKG_VERSION}' $(shell grep "NAME\s*=\s*${PKG_NAME}" ${PKG_FILES} -l) -l)) endef From d75d38f2266ac5ed8f2e2d92a49e4b1060e4afd8 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 27 Feb 2021 20:26:58 +1300 Subject: [PATCH 064/385] pkg(Makefile): Always call with VERSION set --- packages/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/Makefile b/packages/Makefile index a3a5513..91124e2 100644 --- a/packages/Makefile +++ b/packages/Makefile @@ -2,7 +2,7 @@ # Variables PKG_FILES=$(filter-out common.mk,$(wildcard *.mk)) -PKG_SLUGS=$(foreach pkg, ${PKG_FILES}, $(addprefix $(shell make -f ${pkg} name)-, $(shell make -f ${pkg} versions))) +PKG_SLUGS=$(foreach pkg, ${PKG_FILES}, $(addprefix $(shell make -f ${pkg} name VERSION=UNKNOWN)-, $(shell make -f ${pkg} versions VERSION=UNKNOWN))) # Functions define pkg_info @@ -14,7 +14,7 @@ endef # Targets -build: $(foreach pkg, ${PKG_FILES}, $(addprefix build-$(shell make -f ${pkg} name)-, $(lastword $(shell make -f ${pkg} versions)))) +build: $(foreach pkg, ${PKG_FILES}, $(addprefix build-$(shell make -f ${pkg} name VERSION=UNKNOWN)-, $(lastword $(shell make -f ${pkg} versions VERSION=UNKNOWN)))) $(addprefix build-, ${PKG_SLUGS}): $(call pkg_info,build,$@) @@ -22,7 +22,7 @@ $(addprefix build-, ${PKG_SLUGS}): -clean: $(foreach pkg, ${PKG_FILES}, $(addprefix clean-$(shell make -f ${pkg} name)-, $(shell make -f ${pkg} versions))) +clean: $(foreach pkg, ${PKG_FILES}, $(addprefix clean-$(shell make -f ${pkg} name VERSION=UNKNOWN)-, $(shell make -f ${pkg} versions VERSION=UNKNOWN))) rm -rf build/ $(addprefix clean-, ${PKG_SLUGS}): $(call pkg_info,clean,$@) From cf67bd94e92415c7815be132b107947aab4b0153 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 27 Feb 2021 20:46:29 +1300 Subject: [PATCH 065/385] pkg(common): disallow running top level build in parallel --- packages/common.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/common.mk b/packages/common.mk index 82ff19c..f998a2b 100644 --- a/packages/common.mk +++ b/packages/common.mk @@ -31,7 +31,10 @@ versions: name: @echo ${NAME} + +.NOTPARALLEL: build build: ${BUILD_DIR} ${PKG_FILE} + clean: rm -rf ${BUILD_DIR} rm -f ${PKG_FILE} From 99dee4c90425578d04c24e55f9cd7081f76a83e8 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 27 Feb 2021 20:47:33 +1300 Subject: [PATCH 066/385] pkg(python): remove forced -j64 in favor of MAKEFLAGS --- packages/python.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/python.mk b/packages/python.mk index 0c8d72f..0cd120e 100644 --- a/packages/python.mk +++ b/packages/python.mk @@ -15,8 +15,8 @@ ${ENV_FILE}: ${BIN_DIR}: ${BUILD_DIR}Python-${VERSION}/ cd $< && ./configure --prefix / - $(MAKE) -j64 -C $< - DESTDIR=../${PKG_SLUG} $(MAKE) -j64 -C $< altinstall || true + $(MAKE) -C $< + DESTDIR=../${PKG_SLUG} $(MAKE) -C $< altinstall || true ${BUILD_DIR}Python-${VERSION}.tar.gz: curl "https://www.python.org/ftp/python/${VERSION}/Python-${VERSION}.tgz" -o $@ From 0159891ed9ec00b2151e986bd8b67df141a67e28 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 27 Feb 2021 21:53:42 +1300 Subject: [PATCH 067/385] pkg(common): Add prefix variable Prefix is used for autoconf based projects so that absolute paths can be used. --- packages/common.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/common.mk b/packages/common.mk index f998a2b..4f69da6 100644 --- a/packages/common.mk +++ b/packages/common.mk @@ -7,6 +7,7 @@ RUN_FILE=${BUILD_DIR}run COMPILE_FILE=${BUILD_DIR}compile ENV_FILE=${BIN_DIR}environment INFO_FILE=${BUILD_DIR}pkg-info.jq +PREFIX=/piston/packages/${NAME}/${VERSION}/${PKG_SLUG} PKG_FILE=${PKG_SLUG}.pkg.tar.gz From 687085a99d0dff05faa042196ac8b357d06df15d Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 27 Feb 2021 22:07:44 +1300 Subject: [PATCH 068/385] pkg(python): use proper prefix --- packages/python.mk | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/python.mk b/packages/python.mk index 0cd120e..02fe442 100644 --- a/packages/python.mk +++ b/packages/python.mk @@ -14,9 +14,12 @@ ${ENV_FILE}: echo 'export PATH=$$PWD/bin:$$PATH' > $@ ${BIN_DIR}: ${BUILD_DIR}Python-${VERSION}/ - cd $< && ./configure --prefix / + $(eval TMP_DIR=${PWD}/${BUILD_DIR}tmpout/) + cd $< && ./configure --prefix ${PREFIX} $(MAKE) -C $< - DESTDIR=../${PKG_SLUG} $(MAKE) -C $< altinstall || true + DESTDIR=${TMP_DIR} $(MAKE) -C $< altinstall + mv ${TMP_DIR}${PREFIX} ${BIN_DIR} && rm -rf ${TMP_DIR} + ${BUILD_DIR}Python-${VERSION}.tar.gz: curl "https://www.python.org/ftp/python/${VERSION}/Python-${VERSION}.tgz" -o $@ From 09913d9e40d048d5adf4bce47058f868a7d8c606 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 27 Feb 2021 22:22:03 +1300 Subject: [PATCH 069/385] pkg(csharp-mono): Added version 6.12.0.122 --- packages/csharp-mono.mk | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 packages/csharp-mono.mk diff --git a/packages/csharp-mono.mk b/packages/csharp-mono.mk new file mode 100644 index 0000000..b9d7f54 --- /dev/null +++ b/packages/csharp-mono.mk @@ -0,0 +1,34 @@ +NAME=csharp-mono +AUTHOR=Thomas Hobson +DEPENDENCIES= +COMPILED=true +VERSIONS=6.12.0 + +include common.mk + + +VERSION_6.12.0_FULL=6.12.0.122 + +VERSION_FULL=${VERSION_${VERSION}_FULL} + + +${RUN_FILE}: + echo 'CODE=$${1/cs/exe}' > $@ + echo 'shift' >> $@ + echo 'mono $$CODE $$*' >> $@ + +${COMPILE_FILE}: + echo 'csc $$*' > $@ + +${ENV_FILE}: + echo 'export PATH=$$PWD/bin:$$PATH' > $@ + +${BIN_DIR}: ${BUILD_DIR}mono-${VERSION_FULL}/ + $(eval TMP_DIR=${PWD}/${BUILD_DIR}tmpout/) + cd $< && ./configure --prefix ${PREFIX} + $(MAKE) -j64 -C $< + DESTDIR=${TMP_DIR} $(MAKE) -C $< install + mv ${TMP_DIR}${PREFIX} ${BIN_DIR} && rm -r ${TMP_DIR} + +${BUILD_DIR}mono-${VERSION_FULL}.tar.xz: + curl "https://download.mono-project.com/sources/mono/mono-${VERSION_FULL}.tar.xz" -o $@ From 3ab6aefe056dfcbb08bed2d284202dce3248874b Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 27 Feb 2021 22:43:02 +1300 Subject: [PATCH 070/385] pkg(common): build pkg-info.json --- packages/common.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/common.mk b/packages/common.mk index 4f69da6..a481c3a 100644 --- a/packages/common.mk +++ b/packages/common.mk @@ -6,7 +6,7 @@ BIN_DIR=${BUILD_DIR}${PKG_SLUG}/ RUN_FILE=${BUILD_DIR}run COMPILE_FILE=${BUILD_DIR}compile ENV_FILE=${BIN_DIR}environment -INFO_FILE=${BUILD_DIR}pkg-info.jq +INFO_FILE=${BUILD_DIR}pkg-info.json PREFIX=/piston/packages/${NAME}/${VERSION}/${PKG_SLUG} PKG_FILE=${PKG_SLUG}.pkg.tar.gz @@ -53,7 +53,7 @@ endif ${PKG_FILE}: ${PKG_TARGETS} tar -czC ${BUILD_DIR} -f $@ ${patsubst ${BUILD_DIR}%,%,$?} -${INFO_FILE}: +$(patsubst %.json,%.jq,${INFO_FILE}): echo '.language="${NAME}"' > $@ echo '.version="${VERSION}"' >> $@ echo '.author="${AUTHOR}"' >> $@ From b91ff42bb8556cf7964b91c33e28e4d794339717 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 27 Feb 2021 23:10:54 +1300 Subject: [PATCH 071/385] api: fix validators --- api/src/executor/routes.js | 7 +++++-- api/src/ppman/routes.js | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/api/src/executor/routes.js b/api/src/executor/routes.js index a69aeeb..7d65b6b 100644 --- a/api/src/executor/routes.js +++ b/api/src/executor/routes.js @@ -10,7 +10,8 @@ module.exports = { body('language') .isString(), // eslint-disable-line snakecasejs/snakecasejs body('version') - .isSemVer(), // eslint-disable-line snakecasejs/snakecasejs + .isString(), // eslint-disable-line snakecasejs/snakecasejs + // isSemVer requires it to be a version, not a selector body('files') .isArray(), // eslint-disable-line snakecasejs/snakecasejs body('files.*.name') @@ -20,7 +21,9 @@ module.exports = { .contains('/'), body('files.*.content') .isString(), // eslint-disable-line snakecasejs/snakecasejs - body('*_timeout') + body('compile_timeout') + .isNumeric(), // eslint-disable-line snakecasejs/snakecasejs + body('run_timeout') .isNumeric(), // eslint-disable-line snakecasejs/snakecasejs body('stdin') .isString(), // eslint-disable-line snakecasejs/snakecasejs diff --git a/api/src/ppman/routes.js b/api/src/ppman/routes.js index 86a45e7..a14fcf0 100644 --- a/api/src/ppman/routes.js +++ b/api/src/ppman/routes.js @@ -52,7 +52,7 @@ module.exports = { body('url') .notEmpty() // eslint-disable-line snakecasejs/snakecasejs .bail() - .isURL({require_protocol: true}) // eslint-disable-line snakecasejs/snakecasejs + .isURL({require_host: false, require_protocol: true, protocols: ['http','https','file']}) // eslint-disable-line snakecasejs/snakecasejs ], async repo_add(req, res){ From 12dc93435d2308028609c8ad31cb3ca4190c688a Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 28 Feb 2021 01:15:52 +1300 Subject: [PATCH 072/385] api,repo: Switch to debian base image --- api/Dockerfile | 10 ++++++---- repo/Dockerfile | 7 ++++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/api/Dockerfile b/api/Dockerfile index 268d713..8e2b7eb 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -1,7 +1,9 @@ -FROM node:15.8.0-alpine3.13 -RUN apk add --no-cache gnupg tar bash coreutils shadow util-linux -RUN userdel -r node -RUN for i in $(seq 1000 1500); do \ +FROM node:15.8.0-buster-slim +RUN dpkg-reconfigure -p critical dash +RUN apt-get update && apt-get install -y gnupg tar coreutils util-linux \ + && rm -rf /var/lib/apt/lists/* + +RUN for i in $(seq 1001 1500); do \ groupadd -g $i runner$i && \ useradd -M runner$i -g $i -u $i ; \ done diff --git a/repo/Dockerfile b/repo/Dockerfile index d49182e..730b8f1 100644 --- a/repo/Dockerfile +++ b/repo/Dockerfile @@ -1,7 +1,8 @@ -FROM alpine:3.13 +FROM debian:buster-slim -RUN apk add --no-cache python3 py3-pip gnupg jq zlib zlib-dev cmake cmake-doc extra-cmake-modules extra-cmake-modules-doc build-base gcc abuild binutils binutils-doc gcc-doc yq bash coreutils util-linux pciutils usbutils coreutils binutils findutils grep && \ +RUN apt-get update && apt-get install -y bc curl git linux-headers-amd64 perl xz-utils python3 python3-pip gnupg jq zlib1g-dev cmake cmake-doc extra-cmake-modules build-essential gcc binutils bash coreutils util-linux pciutils usbutils coreutils binutils findutils grep && \ ln -sf /bin/bash /bin/sh && \ - pip3 install 'yq==2.12.0' + pip3 install 'yq==2.12.0' && \ + rm -rf /var/lib/apt/lists/* CMD [ "bash", "/repo/make.sh" ] \ No newline at end of file From 55f481e4651e097392d1e3697184c9b84edc2d31 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 28 Feb 2021 01:16:11 +1300 Subject: [PATCH 073/385] repo: build all --- repo/make.sh | 4 ++-- repo/mkindex.sh | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/repo/make.sh b/repo/make.sh index e89dc1e..bad392e 100755 --- a/repo/make.sh +++ b/repo/make.sh @@ -3,8 +3,8 @@ cd /repo # Make packages -pushd ../packages/python -make build VERSIONS=3.9.1 +pushd ../packages/ +make -j16 popd diff --git a/repo/mkindex.sh b/repo/mkindex.sh index 4f2ac42..a38caf6 100755 --- a/repo/mkindex.sh +++ b/repo/mkindex.sh @@ -3,7 +3,7 @@ echo "baseurl: file://$PWD" >> index.yaml echo "keys: []" >> index.yaml echo "packages: []" >> index.yaml -yq -yi '.keys[0] = "0x107DA02C7AE97B084746564B9F1FD9D87950DB6F"' index.yaml +#yq -yi '.keys[0] = "0x107DA02C7AE97B084746564B9F1FD9D87950DB6F"' index.yaml i=-1 @@ -15,12 +15,12 @@ do PKGFILENAME=$(echo $PKGFILE | sed 's/\.pkg\.tar\.gz//g') PKGNAME=$(echo $PKGFILENAME | grep -oP '^\K.+(?=-)') PKGVERSION=$(echo $PKGFILENAME | grep -oP '^.+-\K.+') - BUILDFILE=https://github.com/engineer-man/piston/tree/v3/packages/python/ + BUILDFILE=https://github.com/engineer-man/piston/tree/v3/packages/ SIZE=$(tar tzvf $PKGFILE | sed 's/ \+/ /g' | cut -f3 -d' ' | sed '2,$s/^/+ /' | paste -sd' ' | bc) tar xzf $PKGFILE pkg-info.json - yq -yi ".packages[$i] = {} | .packages[$i].signature = \"$(cat ${pkg}.asc)\" | .packages[$i].buildfile = \"$BUILDFILE\" | .packages[$i].size = $SIZE | .packages[$i].download = \"$PKGFILE\" | .packages[$i].dependencies = $(jq .dependencies -r pkg-info.json) | .packages[$i].author = $(jq .author pkg-info.json) | .packages[$i].language =\"$PKGNAME\" | .packages[$i].version = \"$PKGVERSION\" | .packages[$i].checksums = {} | .packages[$i].checksums.sha256 = \"$(sha256sum $PKGFILE | awk '{print $1}')\"" index.yaml + yq -yi ".packages[$i] = {} | .packages[$i].signature = \"\" | .packages[$i].buildfile = \"$BUILDFILE\" | .packages[$i].size = $SIZE | .packages[$i].download = \"$PKGFILE\" | .packages[$i].dependencies = $(jq .dependencies -r pkg-info.json) | .packages[$i].author = $(jq .author pkg-info.json) | .packages[$i].language =\"$PKGNAME\" | .packages[$i].version = \"$PKGVERSION\" | .packages[$i].checksums = {} | .packages[$i].checksums.sha256 = \"$(sha256sum $PKGFILE | awk '{print $1}')\"" index.yaml rm pkg-info.json done \ No newline at end of file From 7d3777aef8ceb02ef607b8cd63f8369120f90660 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 28 Feb 2021 01:16:33 +1300 Subject: [PATCH 074/385] cli: fix ppman install output --- cli/commands/ppman_commands/install.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/commands/ppman_commands/install.js b/cli/commands/ppman_commands/install.js index 83da33a..4c4b10a 100644 --- a/cli/commands/ppman_commands/install.js +++ b/cli/commands/ppman_commands/install.js @@ -7,8 +7,8 @@ exports.describe = 'Installs the named package' const msg_format = { - 'color': p => `${p.success ? chalk.green.bold('✓') : chalk.red.bold('❌')} Installation ${p.success ? "succeeded" : "failed: " + p.message}`, - 'monochrome': p => `Installation ${p.success ? "succeeded" : "failed: " + p.message}`, + 'color': p => `${p.language ? chalk.green.bold('✓') : chalk.red.bold('❌')} Installation ${p.language ? "succeeded" : "failed: " + p.message}`, + 'monochrome': p => `Installation ${p.language ? "succeeded" : "failed: " + p.message}`, 'json': JSON.stringify } From 870a4c1282069bec1813e9f2c576b41c84fac856 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 28 Feb 2021 01:18:04 +1300 Subject: [PATCH 075/385] api: fix compile stage runtime.compiled always returned false as it was undefined. This made the code think it's a run-only language, and never called the compile script. --- api/src/executor/job.js | 10 ++++++---- api/src/runtime.js | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/api/src/executor/job.js b/api/src/executor/job.js index c99ecb9..1b2aaaa 100644 --- a/api/src/executor/job.js +++ b/api/src/executor/job.js @@ -131,10 +131,12 @@ class Job { if(this.state != job_states.PRIMED) throw new Error('Job must be in primed state, current state: ' + this.state.toString()); logger.info(`Executing job uuid=${this.uuid} uid=${this.uid} gid=${this.gid} runtime=${this.runtime.toString()}`); logger.debug('Compiling'); - const compile = this.runtime.compiled && await this.safe_call( - path.join(this.runtime.pkgdir, 'compile'), - [this.main, ...this.files], - this.timeouts.compile); + var compile = undefined; + if(this.runtime.compiled) + compile = await this.safe_call( + path.join(this.runtime.pkgdir, 'compile'), + this.files.map(x=>x.name), + this.timeouts.compile); logger.debug('Running'); diff --git a/api/src/runtime.js b/api/src/runtime.js index 6e71837..1658f81 100644 --- a/api/src/runtime.js +++ b/api/src/runtime.js @@ -48,7 +48,7 @@ class Runtime { return res; } - get compile(){ + get compiled(){ if(this.#compiled === undefined) this.#compiled = fss.exists_sync(path.join(this.pkgdir, 'compile')); return this.#compiled; } From bd920b19b9b1b7ff5de6c02b8f8d2526be693cd4 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 28 Feb 2021 01:25:10 +1300 Subject: [PATCH 076/385] api: add /runtimes endpoint --- api/src/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/api/src/index.js b/api/src/index.js index 98d9a1d..94381c2 100644 --- a/api/src/index.js +++ b/api/src/index.js @@ -93,11 +93,17 @@ const app = express(); app.get ('/repos/:repo_slug/packages', ppman_routes.repo_packages_validators, validate, ppman_routes.repo_packages); app.get ('/repos/:repo_slug/packages/:language/:version', ppman_routes.package_info_validators, validate, ppman_routes.package_info); app.post ('/repos/:repo_slug/packages/:language/:version', ppman_routes.package_info_validators, validate, ppman_routes.package_install); - app.delete('/repos/:repo_slug/packages/:language/:version', ppman_routes.package_info_validators, validate, ppman_routes.package_uninstall); //TODO + app.delete('/repos/:repo_slug/packages/:language/:version', ppman_routes.package_info_validators, validate, ppman_routes.package_uninstall); const executor_routes = require('./executor/routes'); app.post ('/jobs', executor_routes.run_job_validators, validate, executor_routes.run_job); + app.get ('/runtimes', (_, res) => res.json_success({runtimes: runtime.map(rt=>({ + language: rt.language, + version: rt.version.raw, + author: rt.author + }))})) + logger.debug('Calling app.listen'); const [address,port] = config.bind_address.split(':'); From a27638b06b71bb02cd1295d6938c7ddce00efa0d Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 28 Feb 2021 01:39:19 +1300 Subject: [PATCH 077/385] pkg(common): helpers extract into directories --- packages/common.mk | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/common.mk b/packages/common.mk index a481c3a..ec069b0 100644 --- a/packages/common.mk +++ b/packages/common.mk @@ -65,9 +65,13 @@ $(patsubst %.json,%.jq,${INFO_FILE}): # Helpers %/: %.tar.gz - cd ${BUILD_DIR} && tar xzf $(patsubst ${BUILD_DIR}%,%,$<) + mkdir -p $@ + tar xzf $< --strip-components=1 -C $@ %/: %.tar.xz - cd ${BUILD_DIR} && tar xf $(patsubst ${BUILD_DIR}%,%,$<) - + mkdir -p $@ + tar xf $< --strip-components=1 -C $@ +%/: %.zip + mkdir -p $@ + unzip $< -d $@ %.json: %.jq jq '$(shell tr '\n' '|' < $<).' <<< "{}" > $@ \ No newline at end of file From e6a1fd06a97efe4995c64f633fbc785d8104cfc2 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 28 Feb 2021 01:42:23 +1300 Subject: [PATCH 078/385] pkg(deno): Added deno version 1.7.5 Closes issue #119 --- packages/deno.mk | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 packages/deno.mk diff --git a/packages/deno.mk b/packages/deno.mk new file mode 100644 index 0000000..a2b83c3 --- /dev/null +++ b/packages/deno.mk @@ -0,0 +1,22 @@ +NAME=deno +AUTHOR=Thomas Hobson +DEPENDENCIES= +COMPILED=false +VERSIONS=1.7.5 + +include common.mk + + +${RUN_FILE}: + echo 'deno run $$*' > $@ + +${ENV_FILE}: + echo 'export PATH=$$PWD:$$PATH' > $@ + +${BIN_DIR}: ${BUILD_DIR}deno-x86_64-unknown-linux-gnu/ + mkdir -p $@ + mv $ Date: Sun, 28 Feb 2021 15:44:43 +1300 Subject: [PATCH 079/385] api,repo: Add libxml2 to container --- api/Dockerfile | 2 +- repo/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/Dockerfile b/api/Dockerfile index 8e2b7eb..b3eb8a8 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -1,6 +1,6 @@ FROM node:15.8.0-buster-slim RUN dpkg-reconfigure -p critical dash -RUN apt-get update && apt-get install -y gnupg tar coreutils util-linux \ +RUN apt-get update && apt-get install -y libxml2 gnupg tar coreutils util-linux \ && rm -rf /var/lib/apt/lists/* RUN for i in $(seq 1001 1500); do \ diff --git a/repo/Dockerfile b/repo/Dockerfile index 730b8f1..8980d53 100644 --- a/repo/Dockerfile +++ b/repo/Dockerfile @@ -1,6 +1,6 @@ FROM debian:buster-slim -RUN apt-get update && apt-get install -y bc curl git linux-headers-amd64 perl xz-utils python3 python3-pip gnupg jq zlib1g-dev cmake cmake-doc extra-cmake-modules build-essential gcc binutils bash coreutils util-linux pciutils usbutils coreutils binutils findutils grep && \ +RUN apt-get update && apt-get install -y autoconf build-essential libssl-dev pkg-config zlib1g-dev libargon2-dev libsodium-dev libcurl4-openssl-dev sqlite3 libsqlite3-dev libonig-dev libxml2 libxml2-dev bc curl git linux-headers-amd64 perl xz-utils python3 python3-pip gnupg jq zlib1g-dev cmake cmake-doc extra-cmake-modules build-essential gcc binutils bash coreutils util-linux pciutils usbutils coreutils binutils findutils grep && \ ln -sf /bin/bash /bin/sh && \ pip3 install 'yq==2.12.0' && \ rm -rf /var/lib/apt/lists/* From ba539b89657fea85b3178f4fa6c9ebbbeeb46a23 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 28 Feb 2021 15:58:02 +1300 Subject: [PATCH 080/385] ci: comment affected packages on prs --- .github/workflows/package-pr.yaml | 49 +++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/package-pr.yaml diff --git a/.github/workflows/package-pr.yaml b/.github/workflows/package-pr.yaml new file mode 100644 index 0000000..a2697a3 --- /dev/null +++ b/.github/workflows/package-pr.yaml @@ -0,0 +1,49 @@ +name: 'Package Pull Requests' + +on: + pull_requests: + types: + - opened + - edited + - reopened + - synchronize + paths: + - 'packages/**' + +jobs: + packages-affected: + name: List affected packages + runs-on: ubuntu-latest + steps: + - name: Get PR Commits + id: 'get-pr-commits' + uses: tim-actions/get-pr-commits@master + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Check subsystem + if: ${{ success() || failure() }} + uses: tim-actions/commit-message-checker-with-regex@v0.3.1 + with: + commits: ${{ steps.get-pr-commits.outputs.commits }} + pattern: '^[\h]*(pkg\([^:\h\n]+\))[\h]*:' + error: 'Your commit message must start with pkg([package])' + + - name: Get packages + id: 'get-packages' + shell: bash + run: | + PACKAGES=$(echo '${{ steps.get-pr-commits.outputs.commits }}' | jq .[].commit.message -r | grep -oP '^pkg\(\K[^:\h\n]+(?=\))'' | sort -u | sed 's/^/* /') + PACKAGES=${PACKAGES//$'%'/'%25'} + PACKAGES=${PACKAGES//$'\n'/'%0A'} + PACKAGES=${PACKAGES//$'\r'/'%0D'} + echo "::set-output name=packages::$PACKAGES" + + + - name: Comment on PR + uses: unsplash/comment-on-pr@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + msg: "Affected packages:\n${{ steps.get-packages.outputs.packages }}" + check_for_duplicate_msg: true + \ No newline at end of file From 88faac0335fb4985ea83362e048e608153bb9640 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 28 Feb 2021 16:07:16 +1300 Subject: [PATCH 081/385] ci: fix regex --- .github/workflows/package-pr.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/package-pr.yaml b/.github/workflows/package-pr.yaml index a2697a3..6c3bce4 100644 --- a/.github/workflows/package-pr.yaml +++ b/.github/workflows/package-pr.yaml @@ -1,7 +1,7 @@ name: 'Package Pull Requests' on: - pull_requests: + pull_request: types: - opened - edited @@ -25,7 +25,7 @@ jobs: uses: tim-actions/commit-message-checker-with-regex@v0.3.1 with: commits: ${{ steps.get-pr-commits.outputs.commits }} - pattern: '^[\h]*(pkg\([^:\h\n]+\))[\h]*:' + pattern: '^[\s]*(pkg\([^:\s\n]+\))[\s]*:' error: 'Your commit message must start with pkg([package])' - name: Get packages From 792c7c69eb52354b0d67c948ec44c7be49cc302b Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 28 Feb 2021 16:13:28 +1300 Subject: [PATCH 082/385] ci(package-pr): move into different var --- .github/workflows/package-pr.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/package-pr.yaml b/.github/workflows/package-pr.yaml index 6c3bce4..37ee491 100644 --- a/.github/workflows/package-pr.yaml +++ b/.github/workflows/package-pr.yaml @@ -32,7 +32,8 @@ jobs: id: 'get-packages' shell: bash run: | - PACKAGES=$(echo '${{ steps.get-pr-commits.outputs.commits }}' | jq .[].commit.message -r | grep -oP '^pkg\(\K[^:\h\n]+(?=\))'' | sort -u | sed 's/^/* /') + COMMITS='${{ steps.get-pr-commits.outputs.commits }}' + PACKAGES=$(echo $COMMITS | jq .[].commit.message -r | grep -oP '^pkg\(\K[^:\h\n]+(?=\))'' | sort -u | sed 's/^/* /') PACKAGES=${PACKAGES//$'%'/'%25'} PACKAGES=${PACKAGES//$'\n'/'%0A'} PACKAGES=${PACKAGES//$'\r'/'%0D'} From f0f5991bf3bef3d75968de19819b237ca45c044d Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 28 Feb 2021 16:15:41 +1300 Subject: [PATCH 083/385] ci(package-pr): remove extra ' --- .github/workflows/package-pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/package-pr.yaml b/.github/workflows/package-pr.yaml index 37ee491..31a571f 100644 --- a/.github/workflows/package-pr.yaml +++ b/.github/workflows/package-pr.yaml @@ -33,7 +33,7 @@ jobs: shell: bash run: | COMMITS='${{ steps.get-pr-commits.outputs.commits }}' - PACKAGES=$(echo $COMMITS | jq .[].commit.message -r | grep -oP '^pkg\(\K[^:\h\n]+(?=\))'' | sort -u | sed 's/^/* /') + PACKAGES=$(echo $COMMITS | jq .[].commit.message -r | grep -oP '^pkg\(\K[^:\h\n]+(?=\))' | sort -u | sed 's/^/* /') PACKAGES=${PACKAGES//$'%'/'%25'} PACKAGES=${PACKAGES//$'\n'/'%0A'} PACKAGES=${PACKAGES//$'\r'/'%0D'} From ab14de9ae84adb597f62700e939886ee2d9a3d54 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 28 Feb 2021 16:21:38 +1300 Subject: [PATCH 084/385] ci(package-pr): use github scripts --- .github/workflows/package-pr.yaml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/package-pr.yaml b/.github/workflows/package-pr.yaml index 31a571f..de2f025 100644 --- a/.github/workflows/package-pr.yaml +++ b/.github/workflows/package-pr.yaml @@ -39,12 +39,11 @@ jobs: PACKAGES=${PACKAGES//$'\r'/'%0D'} echo "::set-output name=packages::$PACKAGES" - - - name: Comment on PR - uses: unsplash/comment-on-pr@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: 'Comment PR' + uses: actions/github-script@0.3.0 + if: github.event_name == 'pull_request' with: - msg: "Affected packages:\n${{ steps.get-packages.outputs.packages }}" - check_for_duplicate_msg: true - \ No newline at end of file + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const { issue: { number: issue_number }, repo: { owner, repo } } = context; + github.issues.createComment({ issue_number, owner, repo, body: "Affected packages:\n${{ steps.get-packages.outputs.packages }}" }); \ No newline at end of file From 09802f9f2720a9ba5e2eeb07d68ac0ad4983a787 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 28 Feb 2021 16:51:45 +1300 Subject: [PATCH 085/385] pkg(contributing): required test script --- packages/CONTRIBUTING.MD | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/packages/CONTRIBUTING.MD b/packages/CONTRIBUTING.MD index d1b37d0..d0390a0 100644 --- a/packages/CONTRIBUTING.MD +++ b/packages/CONTRIBUTING.MD @@ -59,7 +59,21 @@ You should add in the path to any binaries. The current working directory for th If everything went well, you should now have a `[language]-[version].pkg.tar.gz` file sitting in the root. If not, read through your error logs, and if in doubt ask for help in #emkc-felix-piston in Discord. -14. Commit your changes, using message format of `pkg([language]): Added [language] [version]` +14. Create a source file for the app, which outputs `OK`, naming the file `[language-name].test` +For example, `mono` would have a file named `csharp-mono.test` containing: +```cs +using System; + +public class Test +{ + public static void Main(string[] args) + { + Console.WriteLine("OK"); + } +} +``` + +15. Commit your changes, using message format of `pkg([language]): Added [language] [version]` Any additional commits regarding this package should start with `pkg([language]): ` -15. Create a pull request (currently to v3), referencing an Issue number (if there is one associated). +16. Create a pull request (currently to v3), referencing an Issue number (if there is one associated). From a1a6702e75072f06a5f007a3b233bd0a7f0d620c Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 28 Feb 2021 16:53:00 +1300 Subject: [PATCH 086/385] pkg(csharp-mono): add test --- packages/csharp-mono.test | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 packages/csharp-mono.test diff --git a/packages/csharp-mono.test b/packages/csharp-mono.test new file mode 100644 index 0000000..e91a2a2 --- /dev/null +++ b/packages/csharp-mono.test @@ -0,0 +1,9 @@ +using System; + +public class Test +{ + public static void Main(string[] args) + { + Console.WriteLine("OK"); + } +} \ No newline at end of file From b6f8ee88d8f95403ba4e5b826cc6337e5a830245 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 28 Feb 2021 16:53:13 +1300 Subject: [PATCH 087/385] pkg(deno): add test --- packages/deno.test | 1 + 1 file changed, 1 insertion(+) create mode 100644 packages/deno.test diff --git a/packages/deno.test b/packages/deno.test new file mode 100644 index 0000000..56ed4a0 --- /dev/null +++ b/packages/deno.test @@ -0,0 +1 @@ +console.log("OK") \ No newline at end of file From d7687096ffae9a0210bbabb92a2302ed12720541 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 28 Feb 2021 16:53:20 +1300 Subject: [PATCH 088/385] pkg(python): add test --- packages/python.test | 1 + 1 file changed, 1 insertion(+) create mode 100644 packages/python.test diff --git a/packages/python.test b/packages/python.test new file mode 100644 index 0000000..3f2688f --- /dev/null +++ b/packages/python.test @@ -0,0 +1 @@ +print("OK") \ No newline at end of file From d7a4292382f6d5585a7a9acdc1b5cc5fd3e588d3 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 28 Feb 2021 18:20:10 +1300 Subject: [PATCH 089/385] pkg(python): 2.7.1 doesn't build properly --- packages/python.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/python.mk b/packages/python.mk index 02fe442..d0aa0ab 100644 --- a/packages/python.mk +++ b/packages/python.mk @@ -2,7 +2,7 @@ NAME=python AUTHOR=Thomas Hobson DEPENDENCIES= COMPILED=false -VERSIONS=2.7.1 3.5.1 3.9.1 +VERSIONS=3.5.1 3.9.1 include common.mk @@ -15,6 +15,7 @@ ${ENV_FILE}: ${BIN_DIR}: ${BUILD_DIR}Python-${VERSION}/ $(eval TMP_DIR=${PWD}/${BUILD_DIR}tmpout/) + cd $< && ./configure --prefix ${PREFIX} $(MAKE) -C $< DESTDIR=${TMP_DIR} $(MAKE) -C $< altinstall From 1ab3f463d0156cac4d31efb874fa5165e1e56f79 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 28 Feb 2021 18:20:41 +1300 Subject: [PATCH 090/385] pkg(Makefile): add language specific build rules --- packages/Makefile | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/packages/Makefile b/packages/Makefile index 91124e2..44fe47c 100644 --- a/packages/Makefile +++ b/packages/Makefile @@ -5,6 +5,8 @@ PKG_FILES=$(filter-out common.mk,$(wildcard *.mk)) PKG_SLUGS=$(foreach pkg, ${PKG_FILES}, $(addprefix $(shell make -f ${pkg} name VERSION=UNKNOWN)-, $(shell make -f ${pkg} versions VERSION=UNKNOWN))) # Functions +CALL_MAKE=$(shell make -f $1 $2 VERSION=UNKNOWN) + define pkg_info $(eval PKG_SLUG=$(patsubst $1-%,%,$2)) $(eval PKG_VERSION=$(lastword $(subst -, ,${PKG_SLUG}))) @@ -12,18 +14,27 @@ define pkg_info $(eval PKG_FILE=$(shell grep '^VERSIONS\s*=.*${PKG_VERSION}' $(shell grep "NAME\s*=\s*${PKG_NAME}" ${PKG_FILES} -l) -l)) endef +define per-lang +build-$(call CALL_MAKE, $1, name):: $$(addprefix build-$(call CALL_MAKE, $1, name)-, $$(call CALL_MAKE, $1, versions)) +clean-$(call CALL_MAKE, $1, name):: $$(addprefix clean-$(call CALL_MAKE, $1, name)-, $$(call CALL_MAKE, $1, versions)) +endef + + # Targets -build: $(foreach pkg, ${PKG_FILES}, $(addprefix build-$(shell make -f ${pkg} name VERSION=UNKNOWN)-, $(lastword $(shell make -f ${pkg} versions VERSION=UNKNOWN)))) +$(foreach e,${PKG_FILES}, $(eval $(call per-lang,${e}))) + +build build-all: $(foreach pkg, ${PKG_FILES}, build-$(call CALL_MAKE, ${pkg}, name)) $(addprefix build-, ${PKG_SLUGS}): $(call pkg_info,build,$@) $(MAKE) -f ${PKG_FILE} VERSION=${PKG_VERSION} build - - -clean: $(foreach pkg, ${PKG_FILES}, $(addprefix clean-$(shell make -f ${pkg} name VERSION=UNKNOWN)-, $(shell make -f ${pkg} versions VERSION=UNKNOWN))) +clean clean-all: $(foreach pkg, ${PKG_FILES}, clean-$(call CALL_MAKE, ${pkg}, name)) rm -rf build/ + $(addprefix clean-, ${PKG_SLUGS}): $(call pkg_info,clean,$@) $(MAKE) -f ${PKG_FILE} VERSION=${PKG_VERSION} clean + + From 1dd9e1a738844ca122419da8e96c8fc68ce872a0 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 28 Feb 2021 18:23:28 +1300 Subject: [PATCH 091/385] repo: allow individual package building --- repo/Dockerfile | 5 ++++- repo/entrypoint.sh | 10 ++++++++++ repo/make.sh | 13 ------------- 3 files changed, 14 insertions(+), 14 deletions(-) create mode 100755 repo/entrypoint.sh delete mode 100755 repo/make.sh diff --git a/repo/Dockerfile b/repo/Dockerfile index 8980d53..35201e0 100644 --- a/repo/Dockerfile +++ b/repo/Dockerfile @@ -5,4 +5,7 @@ RUN apt-get update && apt-get install -y autoconf build-essential libssl-dev pkg pip3 install 'yq==2.12.0' && \ rm -rf /var/lib/apt/lists/* -CMD [ "bash", "/repo/make.sh" ] \ No newline at end of file +ADD *.sh / + +ENTRYPOINT ["bash","/entrypoint.sh"] +CMD ["all"] diff --git a/repo/entrypoint.sh b/repo/entrypoint.sh new file mode 100755 index 0000000..bd958ab --- /dev/null +++ b/repo/entrypoint.sh @@ -0,0 +1,10 @@ +cd /packages +for pkg in "$*" +do + make -j16 build-$pkg +done + +cd /repo +./mkindex.sh + +curl -s http://piston_api:6969/repos -XPOST -d "slug=local&url=file:///repo/index.yaml" diff --git a/repo/make.sh b/repo/make.sh deleted file mode 100755 index bad392e..0000000 --- a/repo/make.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -e - -cd /repo - -# Make packages -pushd ../packages/ -make -j16 -popd - - -# Make repo index - -./mkindex.sh \ No newline at end of file From 70262d8c4b792dcaea021780865761ceee508b57 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 28 Feb 2021 18:29:20 +1300 Subject: [PATCH 092/385] deploy: new repo container takes care of this --- docker-compose.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 509e677..c74a814 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -16,11 +16,7 @@ services: piston_fs_repo: #Temporary solution until CI works build: repo - command: > - bash -c '/repo/make.sh && - curl http://piston_api:6969/repos -XPOST -d "slug=local&url=file:///repo/index.yaml"; - echo -e "\nAn error here is fine, it just means its already added it. Perhaps you restarted this container" - ' + command: ['python'] # Only build python volumes: - ./repo:/repo - ./packages:/packages \ No newline at end of file From 1a7382bb6f24cd4fd888ac6aa05ac779aba248f6 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 28 Feb 2021 19:20:28 +1300 Subject: [PATCH 093/385] pkg(common): Generate test file per version --- packages/.gitignore | 3 ++- packages/common.mk | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/.gitignore b/packages/.gitignore index 2e367bf..5c3f8df 100644 --- a/packages/.gitignore +++ b/packages/.gitignore @@ -1,2 +1,3 @@ build/ -*.pkg.tar.gz \ No newline at end of file +*.pkg.tar.gz +*.tf \ No newline at end of file diff --git a/packages/common.mk b/packages/common.mk index ec069b0..d71d584 100644 --- a/packages/common.mk +++ b/packages/common.mk @@ -34,11 +34,12 @@ name: .NOTPARALLEL: build -build: ${BUILD_DIR} ${PKG_FILE} +build: ${BUILD_DIR} ${PKG_FILE} ${PKG_SLUG}.tf clean: rm -rf ${BUILD_DIR} rm -f ${PKG_FILE} + rm -f ${PKG_SLUG}.tf # mkdir ${BUILD_DIR}: @@ -61,7 +62,8 @@ $(patsubst %.json,%.jq,${INFO_FILE}): echo '.build_platform="$(or ${PLATFORM}, baremetal-$(shell grep -oP "^ID=\K\w+" /etc/os-release ))"' >> $@ $(foreach dep, ${DEPENDENCIES}, echo '.dependencies.$(word 1,$(subst =, ,${dep}))="$(word 2,$(subst =, ,${dep}))"' >> $@) - +${PKG_SLUG}.tf: + cp ${NAME}.test $@ # Helpers %/: %.tar.gz From 89d787cd63f1ebbe0ccb8b81b174b8853592fc82 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 28 Feb 2021 19:30:35 +1300 Subject: [PATCH 094/385] ci(package-pr): automated testing --- .github/workflows/package-pr.yaml | 56 ++++++++++++++++++++++--------- 1 file changed, 41 insertions(+), 15 deletions(-) diff --git a/.github/workflows/package-pr.yaml b/.github/workflows/package-pr.yaml index de2f025..866a1a1 100644 --- a/.github/workflows/package-pr.yaml +++ b/.github/workflows/package-pr.yaml @@ -11,8 +11,8 @@ on: - 'packages/**' jobs: - packages-affected: - name: List affected packages + check-build: + name: Check that package builds runs-on: ubuntu-latest steps: - name: Get PR Commits @@ -21,7 +21,6 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} - name: Check subsystem - if: ${{ success() || failure() }} uses: tim-actions/commit-message-checker-with-regex@v0.3.1 with: commits: ${{ steps.get-pr-commits.outputs.commits }} @@ -33,17 +32,44 @@ jobs: shell: bash run: | COMMITS='${{ steps.get-pr-commits.outputs.commits }}' - PACKAGES=$(echo $COMMITS | jq .[].commit.message -r | grep -oP '^pkg\(\K[^:\h\n]+(?=\))' | sort -u | sed 's/^/* /') - PACKAGES=${PACKAGES//$'%'/'%25'} - PACKAGES=${PACKAGES//$'\n'/'%0A'} - PACKAGES=${PACKAGES//$'\r'/'%0D'} + PACKAGES=$(echo $COMMITS | jq .[].commit.message -r | grep -oP '^pkg\(\K[^:\h\n]+(?=\))' | sort -u) echo "::set-output name=packages::$PACKAGES" - - name: 'Comment PR' - uses: actions/github-script@0.3.0 - if: github.event_name == 'pull_request' - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const { issue: { number: issue_number }, repo: { owner, repo } } = context; - github.issues.createComment({ issue_number, owner, repo, body: "Affected packages:\n${{ steps.get-packages.outputs.packages }}" }); \ No newline at end of file + - name: Checkout + uses: actions/checkout@v2 + + - name: Build docker containers + run: | + docker build -t piston_fs_repo repo + docker build -t piston_api api + + - name: Build Packages + run: | + docker run -v './repo:/repo' -v './packages:/packages' piston_fs_repo ${{ steps.get-packages.outputs.packages }} + + - name: Run tests + run: | + docker run -dp 6969:6969 -v './repo:/repo' --privileged --name api piston_api + echo Waiting for API to start.. + bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:6969/runtimes)" != "200" ]]; do sleep 5; done' + echo Adding local repo + curl -s http://127.0.0.1:6969/repos -XPOST -d "slug=local&url=file:///repo/index.yaml" + echo Testing packages + for pkg in "$(curl -s http://127.0.0.1:6969/repos/local/packages/ | jq '.data.packages[] | "\(.language)/\(.language_version)"' -r)" + do + PKG_SLUG=${pkg/\//-} + PKG_NAME=$(echo $pkg | cut -d'/' -f 1) + PKG_VERSION=$(echo $pkg | cut -d'/' -f 2) + echo Installing ${PKG_SLUG} + curl -sXPOST http://127.0.0.1:6969/repos/local/packages/${pkg} | jq '.language' -r || exit 1 + echo Testing ${PKG_SLUG} (using ${PKG_SLUG}.tf) + TEST_FILE=$(cat ${PKG_SLUG}.tf) + TEST_JSON=`jq -C '.language = "${PKG_NAME}" | .version = "${PKG_VERSION}" | .files=[] | .files[0]={} | .files[0].name="test" | .files[0].name.content="${TEST_FILE}" | .main = "test" | .args = [] | .stdin = "" | .compile_timeout = 10000 | .run_timeout = 3000' <<< '{}'` + curl -sXPOST http://127.0.0.1:6969/jobs -H 'Content-Type: application/json' -d "$TEST_JSON" + done + + + + + + From b410fa8525f7fd13a3becb8f25c985c3de4235f2 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 28 Feb 2021 19:43:34 +1300 Subject: [PATCH 095/385] ci(package-pr): use absolute paths in docker --- .github/workflows/package-pr.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/package-pr.yaml b/.github/workflows/package-pr.yaml index 866a1a1..daf23e8 100644 --- a/.github/workflows/package-pr.yaml +++ b/.github/workflows/package-pr.yaml @@ -45,11 +45,11 @@ jobs: - name: Build Packages run: | - docker run -v './repo:/repo' -v './packages:/packages' piston_fs_repo ${{ steps.get-packages.outputs.packages }} + docker run -v $(pwd)'/repo:/repo' -v $(pwd)'/packages:/packages' piston_fs_repo ${{ steps.get-packages.outputs.packages }} - name: Run tests run: | - docker run -dp 6969:6969 -v './repo:/repo' --privileged --name api piston_api + docker run -dp 6969:6969 -v $(pwd)'/repo:/repo' --privileged --name api piston_api echo Waiting for API to start.. bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:6969/runtimes)" != "200" ]]; do sleep 5; done' echo Adding local repo From d295861a7dbdcf8673a280c5cec14ec78903f804 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 28 Feb 2021 22:18:27 +1300 Subject: [PATCH 096/385] repo: dont error if we cannot access piston_api --- repo/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repo/entrypoint.sh b/repo/entrypoint.sh index bd958ab..6f917d7 100755 --- a/repo/entrypoint.sh +++ b/repo/entrypoint.sh @@ -7,4 +7,4 @@ done cd /repo ./mkindex.sh -curl -s http://piston_api:6969/repos -XPOST -d "slug=local&url=file:///repo/index.yaml" +curl -s http://piston_api:6969/repos -XPOST -d "slug=local&url=file:///repo/index.yaml" || echo "WARNING: Could not add repository" From d86dc4bbb3355211d5ac18f7435c32d2973bef4a Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 28 Feb 2021 22:20:23 +1300 Subject: [PATCH 097/385] ci(package-pr): check OK is included in STDOUT --- .github/workflows/package-pr.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/package-pr.yaml b/.github/workflows/package-pr.yaml index daf23e8..d5c317b 100644 --- a/.github/workflows/package-pr.yaml +++ b/.github/workflows/package-pr.yaml @@ -65,7 +65,8 @@ jobs: echo Testing ${PKG_SLUG} (using ${PKG_SLUG}.tf) TEST_FILE=$(cat ${PKG_SLUG}.tf) TEST_JSON=`jq -C '.language = "${PKG_NAME}" | .version = "${PKG_VERSION}" | .files=[] | .files[0]={} | .files[0].name="test" | .files[0].name.content="${TEST_FILE}" | .main = "test" | .args = [] | .stdin = "" | .compile_timeout = 10000 | .run_timeout = 3000' <<< '{}'` - curl -sXPOST http://127.0.0.1:6969/jobs -H 'Content-Type: application/json' -d "$TEST_JSON" + curl -sXPOST http://127.0.0.1:6969/jobs -H 'Content-Type: application/json' -d "$TEST_JSON" > ${PKG_SLUG}.tr + jq '.run.stdout' ${PKG_SLUG}.tr | grep "OK" || exit 1 done From f85c430869667839962c049e664baf98f0a86c71 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 28 Feb 2021 22:25:23 +1300 Subject: [PATCH 098/385] ci(package-pr): dont endlessly hang --- .github/workflows/package-pr.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/package-pr.yaml b/.github/workflows/package-pr.yaml index d5c317b..dc3d9fd 100644 --- a/.github/workflows/package-pr.yaml +++ b/.github/workflows/package-pr.yaml @@ -49,9 +49,9 @@ jobs: - name: Run tests run: | - docker run -dp 6969:6969 -v $(pwd)'/repo:/repo' --privileged --name api piston_api + docker run -p 6969:6969 -v $(pwd)'/repo:/repo' --privileged --name api piston_api & echo Waiting for API to start.. - bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:6969/runtimes)" != "200" ]]; do sleep 5; done' + while [[ "$(curl -s -w '%{http_code}' http://127.0.0.1:6969/runtimes)" != "200" ]]; do sleep 5; done echo Adding local repo curl -s http://127.0.0.1:6969/repos -XPOST -d "slug=local&url=file:///repo/index.yaml" echo Testing packages From e82f019d0ec62a48d61eff1d31d64fbd1302d99c Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 28 Feb 2021 22:30:07 +1300 Subject: [PATCH 099/385] ci(package-pr): mount piston directory into api --- .github/workflows/package-pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/package-pr.yaml b/.github/workflows/package-pr.yaml index dc3d9fd..245e81a 100644 --- a/.github/workflows/package-pr.yaml +++ b/.github/workflows/package-pr.yaml @@ -49,7 +49,7 @@ jobs: - name: Run tests run: | - docker run -p 6969:6969 -v $(pwd)'/repo:/repo' --privileged --name api piston_api & + docker run -p 6969:6969 -v $(pwd)'/data:/piston' -v $(pwd)'/repo:/repo' --privileged --name api piston_api & echo Waiting for API to start.. while [[ "$(curl -s -w '%{http_code}' http://127.0.0.1:6969/runtimes)" != "200" ]]; do sleep 5; done echo Adding local repo From a2f3058dff6ffcfbfa5c5b3bf2f257966b6646b6 Mon Sep 17 00:00:00 2001 From: ThreshMain <50732964+ThreshMain@users.noreply.github.com> Date: Mon, 1 Mar 2021 03:42:42 +0100 Subject: [PATCH 100/385] pkg(php): Added php 7.4.15 8.0.2 (#128) --- README.MD | 4 ++-- packages/php.mk | 24 ++++++++++++++++++++++++ packages/php.test | 3 +++ 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 packages/php.mk create mode 100644 packages/php.test diff --git a/README.MD b/README.MD index 44f9298..db0b24e 100644 --- a/README.MD +++ b/README.MD @@ -204,7 +204,7 @@ Content-Type: application/json # Supported Languages -`python`, +`python`,`php`
@@ -235,4 +235,4 @@ various privilege escalation, denial-of-service, and resource saturation threats # License -Piston is licensed under the MIT license. \ No newline at end of file +Piston is licensed under the MIT license. diff --git a/packages/php.mk b/packages/php.mk new file mode 100644 index 0000000..65dbc37 --- /dev/null +++ b/packages/php.mk @@ -0,0 +1,24 @@ +NAME=php +AUTHOR=Martin Kos +DEPENDENCIES= +COMPILED=false +VERSIONS=7.4.15 8.0.2 + +include common.mk + + +${RUN_FILE}: + echo 'php $$*' > $@ + +${ENV_FILE}: + echo 'export PATH=$$PWD/bin:$$PATH' > $@ + +${BIN_DIR}: ${BUILD_DIR}php-${VERSION}-sources/ + $(eval TMP_DIR=${PWD}/${BUILD_DIR}tmpout) + cd $< && ./configure --prefix ${PREFIX} + $(MAKE) -C $< + INSTALL_ROOT=${TMP_DIR}/ $(MAKE) -C $< install + mv ${TMP_DIR}${PREFIX} ${BIN_DIR} && rm -r ${TMP_DIR} + +${BUILD_DIR}php-${VERSION}-sources.tar.gz: + curl "https://www.php.net/distributions/php-${VERSION}.tar.gz" -o $@ diff --git a/packages/php.test b/packages/php.test new file mode 100644 index 0000000..997ffba --- /dev/null +++ b/packages/php.test @@ -0,0 +1,3 @@ + From 8047c8e986e4d457f5b2c7da21a9f8edd71e337d Mon Sep 17 00:00:00 2001 From: ThreshMain <50732964+ThreshMain@users.noreply.github.com> Date: Fri, 5 Mar 2021 03:38:22 +0100 Subject: [PATCH 101/385] pkg(javascript-node): Added javascript-node 14.16.0 15.10.0 (#130) --- README.MD | 2 +- packages/javascript-node.mk | 22 ++++++++++++++++++++++ packages/javascript-node.test | 1 + 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 packages/javascript-node.mk create mode 100644 packages/javascript-node.test diff --git a/README.MD b/README.MD index db0b24e..bc40f1c 100644 --- a/README.MD +++ b/README.MD @@ -204,7 +204,7 @@ Content-Type: application/json # Supported Languages -`python`,`php` +`python`,`php`,`node`
diff --git a/packages/javascript-node.mk b/packages/javascript-node.mk new file mode 100644 index 0000000..ff15d9c --- /dev/null +++ b/packages/javascript-node.mk @@ -0,0 +1,22 @@ +NAME=javascript-node +AUTHOR=Martin Kos +DEPENDENCIES= +COMPILED=false +VERSIONS=14.16.0 15.10.0 + +include common.mk + + +${RUN_FILE}: + echo 'node $$*' > $@ + +${ENV_FILE}: + echo 'export PATH=$$PWD/bin:$$PATH' > $@ + +${BIN_DIR}: ${BUILD_DIR}node-${VERSION}-sources/ + mkdir -p $@ + mv $ Date: Fri, 5 Mar 2021 17:06:42 +1300 Subject: [PATCH 102/385] repo: build all packages instead of just first --- repo/entrypoint.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/repo/entrypoint.sh b/repo/entrypoint.sh index 6f917d7..0b4d78c 100755 --- a/repo/entrypoint.sh +++ b/repo/entrypoint.sh @@ -1,5 +1,6 @@ cd /packages -for pkg in "$*" + +for pkg in "$@" do make -j16 build-$pkg done From af1741becc94336479b4f6a02f2d9dd4b25d2da1 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Fri, 5 Mar 2021 19:29:09 +1300 Subject: [PATCH 103/385] api: code cleanup --- api/src/cache.js | 52 ++++++++++-------- api/src/config.js | 63 ++++++++++++---------- api/src/executor/job.js | 17 ++++-- api/src/executor/routes.js | 18 +++++-- api/src/index.js | 107 ++++++++++++++++++++++++++++--------- api/src/ppman/package.js | 25 ++++++--- api/src/state.js | 8 +-- 7 files changed, 195 insertions(+), 95 deletions(-) diff --git a/api/src/cache.js b/api/src/cache.js index 469623a..43727ab 100644 --- a/api/src/cache.js +++ b/api/src/cache.js @@ -1,7 +1,6 @@ const globals = require('./globals'); const logger = require('logplease').create('cache'); const fs = require('fs/promises'), - fss = require('fs'), path = require('path'); const cache = new Map(); @@ -13,43 +12,54 @@ module.exports = { }, async get(key, callback, ttl=globals.cache_ttl){ logger.debug('get:', key); + if(module.exports.has(key)){ logger.debug('hit:',key); return cache.get(key).data; } + logger.debug('miss:', key); var data = await callback(); cache.set(key, {data, expiry: Date.now() + ttl}); + return data; }, async flush(cache_dir){ logger.info('Flushing cache'); - cache.forEach((v,k)=>{ - var file_path = path.join(cache_dir, k); - if(v.expiry < Date.now()){ - //remove from cache - cache.delete(k); - fs.stat(file_path, (err, stats)=>{ - if(err) return; //ignore - probably hasn't been flushed yet + + async function flush_single(value, key){ + const file_path = path.join(cache_dir, key); + + if(value.expiry < Date.now()){ + cache.delete(key); + try { + const stats = await fs.stat(file_path); if(stats.is_file()) - fs.rm(file_path, (err)=>{ - if(err) logger.warn(`Couldn't clean up on-disk cache file ${k}`); - }); - }); + await fs.rm(file_path); + }catch{ + // Ignore, file hasn't been flushed yet + } }else{ - //flush to disk - fs.write_file(file_path, JSON.stringify(v),()=>{}); + await fs.write_file(file_path, JSON.stringify(value)); } - }); + + } + + return Promise.all( + Array.from(cache).map(flush_single) + ); }, async load(cache_dir){ - return fs.readdir(cache_dir) - .then(files => Promise.all(files.map( - async file => { - cache.set(file, JSON.parse(fss.read_file_sync(path.join(cache_dir,file)).toString())); - } - ))); + const files = await fs.readdir(cache_dir); + + async function load_single(file_name){ + const file_path = path.join(cache_dir,file_name); + const file_content = await fs.read_file(file_path).toString(); + cache.set(file_name, JSON.parse(file_content)); + } + + return Promise.all(files.map(load_single)); } }; \ No newline at end of file diff --git a/api/src/config.js b/api/src/config.js index ffe6391..27cb1e9 100644 --- a/api/src/config.js +++ b/api/src/config.js @@ -122,61 +122,70 @@ const options = [ } ]; -const default_config = [ - ...header.split('\n'), - ...options.map(option => ` -${[ - ...option.desc.split('\n'), - option.options?('Options: ' + option.options.join(', ')):'' - ].filter(x=>x.length>0).map(x=>`# ${x}`).join('\n')} -${option.key}: ${option.default} - `)].join('\n'); +function make_default_config(){ + let content = header.split('\n'); + + options.forEach(option => { + content.concat(option.desc.split('\n').map(x=>`# ${x}`)); + + if(option.options) + content.append('# Options: ' + option.options.join(', ')); + + content.append(`${option.key}: ${option.default}`); + + content.append(''); // New line between + }); + + return content.join('\n'); +} logger.info(`Loading Configuration from ${argv.config}`); -!!argv['make-config'] && logger.debug('Make configuration flag is set'); + +if(argv['make-config']) + logger.debug('Make configuration flag is set'); if(!!argv['make-config'] && !fss.exists_sync(argv.config)){ logger.info('Writing default configuration...'); try { - fss.write_file_sync(argv.config, default_config); + fss.write_file_sync(argv.config, make_default_config()); } catch (err) { logger.error('Error writing default configuration:', err.message); process.exit(1); } - - } + var config = {}; + logger.debug('Reading config file'); + try{ const cfg_content = fss.read_file_sync(argv.config); - try{ - config = yaml.load(cfg_content); - }catch(err){ - logger.error('Error parsing configuration file:', err.message); - process.exit(1); - } - + config = yaml.load(cfg_content); }catch(err){ - logger.error('Error reading configuration from disk:', err.message); + logger.error('Error reading configuration file:', err.message); process.exit(1); } logger.debug('Validating config entries'); + var errored=false; -options.forEach(opt => { - logger.debug('Checking key',opt.key); - var cfg_val = config[opt.key]; + +options.forEach(option => { + logger.debug('Checking option', option.key); + + var cfg_val = config[option.key]; + if(cfg_val == undefined){ errored = true; - logger.error(`Config key ${opt.key} does not exist on currently loaded configuration`); + logger.error(`Config key ${option.key} does not exist on currently loaded configuration`); return; } - opt.validators.forEach(validator => { + + option.validators.forEach(validator => { var response = validator(cfg_val); if(response !== true){ errored = true; - logger.error(`Config key ${opt.key} failed validation:`, response); + logger.error(`Config option ${option.key} failed validation:`, response); return; } }); diff --git a/api/src/executor/job.js b/api/src/executor/job.js index 1b2aaaa..046cd53 100644 --- a/api/src/executor/job.js +++ b/api/src/executor/job.js @@ -6,7 +6,6 @@ const config = require('../config'); const globals = require('../globals'); const fs = require('fs/promises'); - const job_states = { READY: Symbol('Ready to be primed'), PRIMED: Symbol('Primed and ready for execution'), @@ -17,7 +16,7 @@ var uid=0; var gid=0; class Job { - constructor(runtime, files, args, stdin, timeouts, main){ + constructor({runtime, files, args, stdin, timeouts, main}){ this.uuid = uuidv4(); this.runtime = runtime; this.files = files; @@ -71,6 +70,7 @@ class Job { async safe_call(file, args, timeout){ return await new Promise((resolve, reject) => { const unshare = config.enable_unshare ? ['unshare','-n','-r'] : []; + const prlimit = [ 'prlimit', '--nproc=' + config.max_process_count, @@ -82,15 +82,17 @@ class Job { ...unshare, 'bash',file, ...args ]; + var stdout = ''; var stderr = ''; + const proc = cp.spawn(proc_call[0], proc_call.splice(1) ,{ env: this.runtime.env_vars, stdio: 'pipe', cwd: this.dir, uid: this.uid, gid: this.gid, - detached: true //dont kill the main process when we kill the group + detached: true //give this process its own process group }); proc.stdin.write(this.stdin); @@ -109,7 +111,7 @@ class Job { try{ process.kill(-proc.pid, 'SIGKILL'); }catch{ - // Process will be dead alread, so nothing to kill. + // Process will be dead already, so nothing to kill. } } @@ -128,15 +130,20 @@ class Job { } async execute(){ - if(this.state != job_states.PRIMED) throw new Error('Job must be in primed state, current state: ' + this.state.toString()); + if(this.state != job_states.PRIMED) + throw new Error('Job must be in primed state, current state: ' + this.state.toString()); + logger.info(`Executing job uuid=${this.uuid} uid=${this.uid} gid=${this.gid} runtime=${this.runtime.toString()}`); + logger.debug('Compiling'); + var compile = undefined; if(this.runtime.compiled) compile = await this.safe_call( path.join(this.runtime.pkgdir, 'compile'), this.files.map(x=>x.name), this.timeouts.compile); + logger.debug('Running'); diff --git a/api/src/executor/routes.js b/api/src/executor/routes.js index 7d65b6b..fe09d63 100644 --- a/api/src/executor/routes.js +++ b/api/src/executor/routes.js @@ -11,7 +11,7 @@ module.exports = { .isString(), // eslint-disable-line snakecasejs/snakecasejs body('version') .isString(), // eslint-disable-line snakecasejs/snakecasejs - // isSemVer requires it to be a version, not a selector + // isSemVer requires it to be a version, not a selector body('files') .isArray(), // eslint-disable-line snakecasejs/snakecasejs body('files.*.name') @@ -39,15 +39,23 @@ module.exports = { const runtime = get_latest_runtime_matching_language_version(req.body.language, req.body.version); if(runtime == undefined) return res.json_error(`${req.body.language}-${req.body.version} runtime is unknown`, 400); - const job = new Job(runtime, req.body.files, req.body.args, req.body.stdin, {run: req.body.run_timeout, compile: req.body.compile_timeout}, req.body.main); + const job = new Job({ + runtime, + files: req.body.files, + args: req.body.args, + stdin: req.body.stdin, + timeouts: { + run: req.body.run_timeout, + compile: req.body.compile_timeout + }, + main: req.body.main + }); + await job.prime(); const result = await job.execute(); res.json_success(result); await job.cleanup(); - - - } }; \ No newline at end of file diff --git a/api/src/index.js b/api/src/index.js index 94381c2..4d5e76c 100644 --- a/api/src/index.js +++ b/api/src/index.js @@ -44,16 +44,17 @@ const app = express(); logger.info('Loading packages'); const pkgdir = path.join(config.data_directory,globals.data_directories.packages); - await fs.readdir(pkgdir) - .then(langs => Promise.all( - langs.map(lang=> - fs.readdir(path.join(pkgdir,lang)) - .then(x=>x.map(y=>path.join(pkgdir, lang, y))) - ))) - .then(pkgs=>pkgs.flat().filter(pkg=>fss.exists_sync(path.join(pkg, globals.pkg_installed_file)))) - .then(pkgs=>pkgs.forEach(pkg => new runtime.Runtime(pkg))); + const pkglist = await fs.readdir(pkgdir); + const languages = await Promise.all( + pkglist.map(lang=> + fs.readdir(path.join(pkgdir,lang)) + .then(x=>x.map(y=>path.join(pkgdir, lang, y))) + )); + const installed_languages = languages.flat() + .filter(pkg=>fss.exists_sync(path.join(pkg, globals.pkg_installed_file))); + installed_languages.forEach(pkg => new runtime.Runtime(pkg)); logger.info('Starting API Server'); @@ -86,23 +87,69 @@ const app = express(); logger.debug('Registering Routes'); const ppman_routes = require('./ppman/routes'); - - app.get ('/repos', validate, ppman_routes.repo_list); - app.post ('/repos', ppman_routes.repo_add_validators, validate, ppman_routes.repo_add); - app.get ('/repos/:repo_slug', ppman_routes.repo_info_validators, validate, ppman_routes.repo_info); - app.get ('/repos/:repo_slug/packages', ppman_routes.repo_packages_validators, validate, ppman_routes.repo_packages); - app.get ('/repos/:repo_slug/packages/:language/:version', ppman_routes.package_info_validators, validate, ppman_routes.package_info); - app.post ('/repos/:repo_slug/packages/:language/:version', ppman_routes.package_info_validators, validate, ppman_routes.package_install); - app.delete('/repos/:repo_slug/packages/:language/:version', ppman_routes.package_info_validators, validate, ppman_routes.package_uninstall); - const executor_routes = require('./executor/routes'); - app.post ('/jobs', executor_routes.run_job_validators, validate, executor_routes.run_job); - app.get ('/runtimes', (_, res) => res.json_success({runtimes: runtime.map(rt=>({ - language: rt.language, - version: rt.version.raw, - author: rt.author - }))})) + app.get('/repos', + validate, + ppman_routes.repo_list + ); + + app.post('/repos', + ppman_routes.repo_add_validators, + validate, + ppman_routes.repo_add + ); + + app.get('/repos/:repo_slug', + ppman_routes.repo_info_validators, + validate, + ppman_routes.repo_info + ); + + app.get('/repos/:repo_slug/packages', + ppman_routes.repo_packages_validators, + validate, + ppman_routes.repo_packages + ); + + app.get('/repos/:repo_slug/packages/:language/:version', + ppman_routes.package_info_validators, + validate, + ppman_routes.package_info + ); + + app.post('/repos/:repo_slug/packages/:language/:version', + ppman_routes.package_info_validators, + validate, + ppman_routes.package_install + ); + + app.delete('/repos/:repo_slug/packages/:language/:version', + ppman_routes.package_info_validators, + validate, + ppman_routes.package_uninstall + ); + + app.post('/jobs', + executor_routes.run_job_validators, + validate, + executor_routes.run_job); + + function list_runtimes(_, res){ + const runtimes = runtime.map(rt => ( + { + language: rt.language, + version: rt.version.raw, + author: rt.author + } + )); + + return res.json_success({ + runtimes + }); + } + + app.get('/runtimes', list_runtimes); logger.debug('Calling app.listen'); const [address,port] = config.bind_address.split(':'); @@ -112,6 +159,16 @@ const app = express(); }); logger.debug('Setting up flush timers'); - setInterval(cache.flush,config.cache_flush_time,path.join(config.data_directory,globals.data_directories.cache)); - setInterval(state.save,config.state_flush_time,path.join(config.data_directory,globals.data_files.state)); + + setInterval( + cache.flush, + config.cache_flush_time, + path.join(config.data_directory,globals.data_directories.cache) + ); + + setInterval( + state.save, + config.state_flush_time, + path.join(config.data_directory,globals.data_files.state) + ); })(); \ No newline at end of file diff --git a/api/src/ppman/package.js b/api/src/ppman/package.js index ebccd7f..894376b 100644 --- a/api/src/ppman/package.js +++ b/api/src/ppman/package.js @@ -63,7 +63,9 @@ class Package { logger.debug('Validating checksums'); Object.keys(this.checksums).forEach(algo => { var val = this.checksums[algo]; + logger.debug(`Assert ${algo}(${pkgpath}) == ${val}`); + var cs = crypto.create_hash(algo) .update(fss.read_file_sync(pkgpath)) .digest('hex'); @@ -72,7 +74,8 @@ class Package { await this.repo.import_keys(); - logger.debug('Validating signatutes'); + logger.debug('Validating signatures'); + if(this.signature != '') await new Promise((resolve,reject)=>{ const gpgspawn = cp.spawn('gpg', ['--verify', '-', pkgpath], { @@ -94,6 +97,7 @@ class Package { logger.warn('Package does not contain a signature - allowing install, but proceed with caution'); logger.debug(`Extracting package files from archive ${pkgfile} in to ${this.install_path}`); + await new Promise((resolve, reject)=>{ const proc = cp.exec(`bash -c 'cd "${this.install_path}" && tar xzf ${pkgfile}'`); proc.once('exit', (code,_)=>{ @@ -109,30 +113,35 @@ class Package { logger.debug('Ensuring binary files exist for package'); const pkgbin = path.join(this.install_path, `${this.language}-${this.version.raw}`); try{ - const pkgbinstat = await fs.stat(pkgbin); + const pkgbin_stat = await fs.stat(pkgbin); //eslint-disable-next-line snakecasejs/snakecasejs - if(!pkgbinstat.isDirectory()) throw new Error(); + if(!pkgbin_stat.isDirectory()) throw new Error(); + // Throw a blank error here, so it will be caught by the following catch, and output the correct error message + // The catch is used to catch fs.stat }catch(err){ throw new Error(`Invalid package: could not find ${this.language}-${this.version.raw}/ contained within package files`); } logger.debug('Symlinking into runtimes'); + await fs.symlink( pkgbin, path.join(config.data_directory, globals.data_directories.runtimes, `${this.language}-${this.version.raw}`) - ).catch((err)=>err); //catch + ).catch((err)=>err); //Ignore if we fail - probably means its already been installed and not cleaned up right logger.debug('Registering runtime'); - const pkgruntime = new runtime.Runtime(this.install_path); + const pkg_runtime = new runtime.Runtime(this.install_path); logger.debug('Caching environment'); - const required_pkgs = [pkgruntime, ...pkgruntime.get_all_dependencies()]; - const get_env_command = [...required_pkgs.map(p=>`cd "${p.runtime_dir}"; source environment; `), - 'env' ].join(' '); + const required_pkgs = [pkg_runtime, ...pkg_runtime.get_all_dependencies()]; + const get_env_command = [ + ...required_pkgs.map(pkg=>`cd "${pkg.runtime_dir}"; source environment; `), + 'env' + ].join(' '); const envout = await new Promise((resolve, reject)=>{ var stdout = ''; diff --git a/api/src/state.js b/api/src/state.js index 6dc555f..b69d626 100644 --- a/api/src/state.js +++ b/api/src/state.js @@ -30,12 +30,12 @@ module.exports = { async load(data_file){ if(fss.exists_sync(data_file)){ logger.info('Loading state from file'); - var content = await fs.read_file(data_file); - var obj = JSON.parse(content.toString(), reviver); + + const content = await fs.read_file(data_file); + const obj = JSON.parse(content.toString(), reviver); [...obj.keys()].forEach(k => state.set(k, obj.get(k))); }else{ - logger.info('Creating new statefile'); - state.set('repositories', new Map().set('offical', 'https://repo.pistonee.org/index.yaml')); + logger.info('Creating new state file'); } }, async save(data_file){ From e57e56037c052774d42b93b4e214a056effbaf4f Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Fri, 5 Mar 2021 19:34:09 +1300 Subject: [PATCH 104/385] api-wrapper: code cleanup --- api-client/index.cjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api-client/index.cjs b/api-client/index.cjs index 846b237..c58f9b3 100644 --- a/api-client/index.cjs +++ b/api-client/index.cjs @@ -106,7 +106,7 @@ class PistonEngine extends APIWrapper { return this.get_child_object(`/repos/${slug}`, PistonEngineRepository) } - run_job(language, version, files, main, args, stdin, compile_timeout, run_timeout){ + run_job({language, version, files, main, args, stdin, compile_timeout, run_timeout}){ return this.post(`/jobs`, {language, version, files, main, args, stdin, compile_timeout, run_timeout}) } } From d1b41e3c2fad681f1cbd7f88823da60601df0d78 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Fri, 5 Mar 2021 19:40:47 +1300 Subject: [PATCH 105/385] cli: code cleanup --- cli/commands/execute.js | 18 +++++++++--------- cli/commands/ppman_commands/install.js | 4 +++- cli/commands/ppman_commands/list.js | 11 +++++++---- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/cli/commands/execute.js b/cli/commands/execute.js index 4fbcbc5..11afaa2 100644 --- a/cli/commands/execute.js +++ b/cli/commands/execute.js @@ -50,16 +50,16 @@ exports.handler = async function(argv){ })) || ""; - const response = await api.run_job( - argv.language, - argv['language-version'], - files, - argv.file, - argv.args, + const response = await api.run_job({ + language: argv.language, + version: argv['language-version'], + files: files, + main: argv.file, + arsg: argv.args, stdin, - argv.ct, - argv.rt - ) + compile_timeout: argv.ct, + run_timeout: argv.rt + }) function step(name, ctx){ console.log(chalk.bold(`== ${name} ==`)) diff --git a/cli/commands/ppman_commands/install.js b/cli/commands/ppman_commands/install.js index 4c4b10a..1cab867 100644 --- a/cli/commands/ppman_commands/install.js +++ b/cli/commands/ppman_commands/install.js @@ -17,11 +17,13 @@ exports.handler = async function(argv){ const api = new PistonEngine(argv['piston-url']); const repos = await api.list_repos(); + const repos_obj = await Promise.all(repos.repos.map(({slug}) => api.get_repo(slug))); + const repo_pkgs = await Promise.all(repos_obj.map( async repo => ({ repo: repo, - packages: await repo.list_packages().catch(x=>[]) + packages: await repo.list_packages().catch(_=>[]) }) )) diff --git a/cli/commands/ppman_commands/list.js b/cli/commands/ppman_commands/list.js index 162d286..6dd4bed 100644 --- a/cli/commands/ppman_commands/list.js +++ b/cli/commands/ppman_commands/list.js @@ -17,11 +17,14 @@ exports.handler = async function(argv){ const api = new PistonEngine(argv['piston-url']); const repos = await api.list_repos(); + const repos_obj = await Promise.all(repos.repos.map(({slug}) => api.get_repo(slug))); - const packages = await repos_obj.reduce(async (a, c) => [ - ...await a, - ...await c.list_packages().catch(x=>{console.log(x); return []}) - ], []); + + const packages = await repos_obj.reduce(async (accumulator, repo) => [ + ...await accumulator, + ...await repo.list_packages() + .catch(x=>{console.log(x); return []}) + ], []); // Loops over repos, listing packages and flattening them into a single array const pkg_msg = packages .map(msg_format.color) From eba1d3abcdd13b0eb3a828c63b143508412c9fda Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Fri, 5 Mar 2021 22:16:17 +1300 Subject: [PATCH 106/385] pkg: new build system --- packages/.gitignore | 6 ++-- packages/Makefile | 53 ++++++++++++------------------ packages/common.mk | 79 --------------------------------------------- 3 files changed, 24 insertions(+), 114 deletions(-) delete mode 100644 packages/common.mk diff --git a/packages/.gitignore b/packages/.gitignore index 5c3f8df..80f2a67 100644 --- a/packages/.gitignore +++ b/packages/.gitignore @@ -1,3 +1,3 @@ -build/ -*.pkg.tar.gz -*.tf \ No newline at end of file +*/build +*/output +*.pkg.tar.gz \ No newline at end of file diff --git a/packages/Makefile b/packages/Makefile index 44fe47c..a861705 100644 --- a/packages/Makefile +++ b/packages/Makefile @@ -1,40 +1,29 @@ -# Wraps all other Makefiles +PACKAGES=$(shell find * -maxdepth 0 -type d) +BUILD_PLATFORM=$(or ${PLATFORM},baremetal-$(shell grep -oP "^ID=\K.+" /etc/os-release)) -# Variables -PKG_FILES=$(filter-out common.mk,$(wildcard *.mk)) -PKG_SLUGS=$(foreach pkg, ${PKG_FILES}, $(addprefix $(shell make -f ${pkg} name VERSION=UNKNOWN)-, $(shell make -f ${pkg} versions VERSION=UNKNOWN))) +help: + @echo "You probably don't want to build all package" + @echo "If you do run $`make build-all$`" + @echo + @echo "Run $`make [language]-[version].pkg.tar.gz$` to build a specific language" -# Functions -CALL_MAKE=$(shell make -f $1 $2 VERSION=UNKNOWN) +build build-all: $(addsuffix .pkg.tar.gz, ${PACKAGES}) +clean clean-all: $(addprefix clean-, ${PACKAGES}) -define pkg_info - $(eval PKG_SLUG=$(patsubst $1-%,%,$2)) - $(eval PKG_VERSION=$(lastword $(subst -, ,${PKG_SLUG}))) - $(eval PKG_NAME=$(patsubst %-${PKG_VERSION},%,${PKG_SLUG})) - $(eval PKG_FILE=$(shell grep '^VERSIONS\s*=.*${PKG_VERSION}' $(shell grep "NAME\s*=\s*${PKG_NAME}" ${PKG_FILES} -l) -l)) -endef +clean-%: %/ + rm -rf $ $@ + +%/output: %/ %/build.sh + cd $< && chmod +x ./build.sh && ./build.sh -define per-lang -build-$(call CALL_MAKE, $1, name):: $$(addprefix build-$(call CALL_MAKE, $1, name)-, $$(call CALL_MAKE, $1, versions)) -clean-$(call CALL_MAKE, $1, name):: $$(addprefix clean-$(call CALL_MAKE, $1, name)-, $$(call CALL_MAKE, $1, versions)) -endef -# Targets - -$(foreach e,${PKG_FILES}, $(eval $(call per-lang,${e}))) - -build build-all: $(foreach pkg, ${PKG_FILES}, build-$(call CALL_MAKE, ${pkg}, name)) - -$(addprefix build-, ${PKG_SLUGS}): - $(call pkg_info,build,$@) - $(MAKE) -f ${PKG_FILE} VERSION=${PKG_VERSION} build - -clean clean-all: $(foreach pkg, ${PKG_FILES}, clean-$(call CALL_MAKE, ${pkg}, name)) - rm -rf build/ - -$(addprefix clean-, ${PKG_SLUGS}): - $(call pkg_info,clean,$@) - $(MAKE) -f ${PKG_FILE} VERSION=${PKG_VERSION} clean diff --git a/packages/common.mk b/packages/common.mk deleted file mode 100644 index d71d584..0000000 --- a/packages/common.mk +++ /dev/null @@ -1,79 +0,0 @@ -# Variables -PKG_SLUG=${NAME}-${VERSION} -BUILD_DIR=build/${PKG_SLUG}/ - -BIN_DIR=${BUILD_DIR}${PKG_SLUG}/ -RUN_FILE=${BUILD_DIR}run -COMPILE_FILE=${BUILD_DIR}compile -ENV_FILE=${BIN_DIR}environment -INFO_FILE=${BUILD_DIR}pkg-info.json -PREFIX=/piston/packages/${NAME}/${VERSION}/${PKG_SLUG} - -PKG_FILE=${PKG_SLUG}.pkg.tar.gz - -VERSION_MINOR=$(shell grep -oP "\d+.\d+"<<<${VERSION}) -VERSION_MAJOR=$(shell grep -oP "\d+"<<<${VERSION}) - -PKG_TARGETS=${BIN_DIR} ${ENV_FILE} ${RUN_FILE} ${INFO_FILE} - - -# Command Targets - -.PHONY: catch versions name build clean -catch: - # Catch manual calling - # This is done to make sure people don't call without ${VERSION}, which can cause problems - @echo "Don't directly call individual scripts, instead call the common Makefile" - @exit 1 - -versions: - @echo ${VERSIONS} - -name: - @echo ${NAME} - - -.NOTPARALLEL: build -build: ${BUILD_DIR} ${PKG_FILE} ${PKG_SLUG}.tf - -clean: - rm -rf ${BUILD_DIR} - rm -f ${PKG_FILE} - rm -f ${PKG_SLUG}.tf - -# mkdir -${BUILD_DIR}: - mkdir -p ${BUILD_DIR} - - -# Generated files - -ifeq (${COMPILED}, true) -${PKG_FILE}: ${PKG_TARGETS} ${COMPILE_FILE} -endif -${PKG_FILE}: ${PKG_TARGETS} - tar -czC ${BUILD_DIR} -f $@ ${patsubst ${BUILD_DIR}%,%,$?} - -$(patsubst %.json,%.jq,${INFO_FILE}): - echo '.language="${NAME}"' > $@ - echo '.version="${VERSION}"' >> $@ - echo '.author="${AUTHOR}"' >> $@ - echo '.dependencies={}' >> $@ - echo '.build_platform="$(or ${PLATFORM}, baremetal-$(shell grep -oP "^ID=\K\w+" /etc/os-release ))"' >> $@ - $(foreach dep, ${DEPENDENCIES}, echo '.dependencies.$(word 1,$(subst =, ,${dep}))="$(word 2,$(subst =, ,${dep}))"' >> $@) - -${PKG_SLUG}.tf: - cp ${NAME}.test $@ - -# Helpers -%/: %.tar.gz - mkdir -p $@ - tar xzf $< --strip-components=1 -C $@ -%/: %.tar.xz - mkdir -p $@ - tar xf $< --strip-components=1 -C $@ -%/: %.zip - mkdir -p $@ - unzip $< -d $@ -%.json: %.jq - jq '$(shell tr '\n' '|' < $<).' <<< "{}" > $@ \ No newline at end of file From 34fbda0772eb70abd084c7e03843dd3ef2971158 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Fri, 5 Mar 2021 22:16:42 +1300 Subject: [PATCH 107/385] repo: use new build system --- repo/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repo/entrypoint.sh b/repo/entrypoint.sh index 0b4d78c..44a5d65 100755 --- a/repo/entrypoint.sh +++ b/repo/entrypoint.sh @@ -2,7 +2,7 @@ cd /packages for pkg in "$@" do - make -j16 build-$pkg + make -j16 $pkg.pkg.tar.gz done cd /repo From 4732681864c975447e6feb7abb29052aa39886d6 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 6 Mar 2021 00:27:24 +1300 Subject: [PATCH 108/385] pkg(contributing): update guide for new format --- packages/CONTRIBUTING.MD | 84 ++++++++++++++++------------------------ 1 file changed, 33 insertions(+), 51 deletions(-) diff --git a/packages/CONTRIBUTING.MD b/packages/CONTRIBUTING.MD index d0390a0..5dcb752 100644 --- a/packages/CONTRIBUTING.MD +++ b/packages/CONTRIBUTING.MD @@ -1,66 +1,33 @@ # Contributing packages to the Piston Repository -## Naming Lanaguages +## Naming Languages -Some languages have multiple different wide-spread interpreters (node/deno for example) which need to be accounted for. - -If the given language has multiple incompatiable interpreters (e.g. deno/node/v8), these should be named as `[language]-[interpreter]`. -For cases where the language has many compatable interpreters (e.g. gcc/llvm), pick one and name it `[language]`. -For languages with only 1 wide-spread interpreter (e.g. Kotlin), name it `[language]` - -## File Naming Rules - -Different versions of interpreters require different steps to build, and in this case they should be given 2 different files, but keep the same language name. - -Use `[language-name].mk` (see naming languages) for languages with a common build script. -When the build steps become obsolete, create a new file named `[language-name]-[version].mk`, with the first version where the new build steps were required. +Languages should be named after their interpreters, and the command line binaries you call. +For example, the full name of the standard python interpreter is `CPython`, however we would name it `python`, after the main binary which it provides. +In the example of NodeJS, we would call this `node`, after the main binary. ## Creating new languages -See [python.mk](python.mk) or any other `.mk` file (except `common.mk`) for an example. - -Please note that this is a regular Makefile, with a few extra varibles added by `common.mk`, any additional variables not listed here can be located in there. +See [deno-1.7.5/](deno-1.7.5/) or any other directory for examples. 1. Create a new branch on your fork of engineer-man/piston -2. Create a new file for your language, following the naming rules as listed above +2. Create a directory named `[language]-[version]`. See Naming Languages for how to determine the name for your language -3. Add `NAME=[language name]` to this file, replacing `[language name]` with the language name all in lowercase, removing any punctuation and numbers (e.g. 05AB1E becomes osabie). +3. Create a file named `build.sh`, adding a shebang for bash `#!/bin/bash` on the first line. +In this file put any steps to compile the specified langauge. +It is allowed to use 2 directories, `output` and `build`, the former which contains files which should get packaged into the final output, and the latter containing intermediate build files. -4. Add `AUTHOR=[author]` to this file, replacing `[author]` with your name and email address in the format `Full Name ` (standard git format). +4. Create a file named `run`, containing bash script to run the interpreter. +The first argument given to this script (`$1`) is the name of the main file, with the remaining ones as program arguments. +STDIN is piped directly into the run file, and as such nothing special is required to deal with STDIN, except leaving it open. -5. Add `DEPENDENCIES=[dependencies list]` to this file, replacing `[dependencies list]` with a list of dependencies, seperated by spaces in the format `[language]==[version]`. If there are none, simply leave this as `DEPENDENCIES=` +5. Create a file named `compile`, containing bash script to compile sources into binaries. This is only required if the language requires a compling stage. +The first argument is always the main file, followed the names of the other files as additional arguements. If the language does not require a compile stage, don't create a compile file. -6. Add `COMPILED=[true/false]` to this file, set this to true if the language requires the compile stage, and false if it only requires run. +6. Create a file named `environment`, containing `export` statements which edit the environment variables accordingly. The `$PWD` variable should be used, and is set inside the `output` directory, but when running on the target system. -7. Add `VERSIONS=[version list]` to this file, replacing `[version list]` with a list of [SemVer](https://semver.org/) compilant version numbers for the language which this build file can build. This value will be passed in as `${VERSION}` for you to access - -8. Add `include common.mk`, to include all the common Makefile rules and variables. - -9. Create the target for the run file by adding `${RUN_FILE}:`, followed by steps on new lines, indented by a tab (`\t`) to create a bash script, which is run for every job (`/execute` endpoint) for this language and returns on STDOUT/STDERR the output of the run. -The script is expected to take in the first argument (`$1`) as the main code file, with subsequent arguments being passed in from the execute endpoint. -The script is passed STDIN as specified in the job, and expects output on STDOUT/STDERR. It should also pass through the exit code from the interpreter. -It is recommended to use `echo` statements, redirecting output to `$@` (a special Makefile variable expanding to the target file, in this case RUN_FILE). -Make sure to escape any `$` with `$$`, as `$` will expand make variables. - -10. (optional, only use if language requires compliation) -Create the target for the compile file by adding `${COMPILE_FILE}:`, followed by steps on new lines, indented by a tab (`\t`) to create a bash script, which is run for every job (`/execute` endpoint) for this language, if it requires compilation. -This script is expected to take all code files in as arguements, and output binary files. STDERR/STDOUT are captured and passed out, along with error code. The job STDIN and args are not passed in to this script. -This script should compile source code into a binary, and has a seperate time limit from run, and thus should split the stages. -Follow all priciples from step 9, using echo statements and escaping `$`. - -11. Create the target for the environment file by adding `${ENV_FILE}:`, followed by steps on new lines, indented by a tab (`\t`) to create a bash script, which modifies environment variables exactly how you would a `.profile` or `.bashrc` file. Note that this file is only run at install time, and thus cannot dynamicly adjust to the arguements passed into it. -The environment file is also appended with all dependencies before being cached. -You should add in the path to any binaries. The current working directory for the script is contained within the `${BIN_DIR}` folder. - -12. Create the target for the binaries by adding `${BIN_DIR}:`, followed by steps on new lines, indented by a tab (`\t`) which will download sources, compile and output binaries in to the `${BIN_DIR}` (`$@`) - -13. Locally test your Makefile builds with `make build-[language]-[version]`. -If everything went well, you should now have a `[language]-[version].pkg.tar.gz` file sitting in the root. -If not, read through your error logs, and if in doubt ask for help in #emkc-felix-piston in Discord. - -14. Create a source file for the app, which outputs `OK`, naming the file `[language-name].test` -For example, `mono` would have a file named `csharp-mono.test` containing: +7. Create a test script starting with test, with the file extension of the language. This script should simply output the phrase `OK`. For example, for mono we would create `test.cs` with the content: ```cs using System; @@ -73,7 +40,22 @@ public class Test } ``` -15. Commit your changes, using message format of `pkg([language]): Added [language] [version]` +8. Create a `metadata.json` file which contains metadata about the language and interpreter. This simply contains the language name, as in the folder name, the version as in the folder name, the author's name and email address, aliases that can be used to call this package, and finally a dependencies map. +The dependencies map contains the keys as language names, and the values as semver selectors for packages. +```json +{ + "language": "deno", + "version": "1.7.5", + "author": "Thomas Hobson ", + "dependencies": {}, + "aliases": ["deno-ts", "deno-js"] +} +``` + +9. Test your package builds with running `make [language]-[version].pkg.tar.gz`. +If it all goes to plan, you should have a file named `[language]-[version].pkg.tar.gz`, in this case your good to go! + +10. Commit your changes, using message format of `pkg([language]): Added [language] [version]` Any additional commits regarding this package should start with `pkg([language]): ` -16. Create a pull request (currently to v3), referencing an Issue number (if there is one associated). +11. Create a pull request (currently to v3 branch), referencing an Issue number (if there is one associated). From 49c761311bb35c8bf3bedc687cbd272caaa1ae63 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 6 Mar 2021 00:31:51 +1300 Subject: [PATCH 109/385] api: fix bugs introduced in code cleanup --- api/src/config.js | 8 ++++---- api/src/state.js | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/api/src/config.js b/api/src/config.js index 27cb1e9..6d73f54 100644 --- a/api/src/config.js +++ b/api/src/config.js @@ -129,11 +129,11 @@ function make_default_config(){ content.concat(option.desc.split('\n').map(x=>`# ${x}`)); if(option.options) - content.append('# Options: ' + option.options.join(', ')); + content.push('# Options: ' + option.options.join(', ')); - content.append(`${option.key}: ${option.default}`); - - content.append(''); // New line between + content.push(`${option.key}: ${option.default}`); + + content.push(''); // New line between }); return content.join('\n'); diff --git a/api/src/state.js b/api/src/state.js index b69d626..dd6f773 100644 --- a/api/src/state.js +++ b/api/src/state.js @@ -30,12 +30,12 @@ module.exports = { async load(data_file){ if(fss.exists_sync(data_file)){ logger.info('Loading state from file'); - - const content = await fs.read_file(data_file); - const obj = JSON.parse(content.toString(), reviver); + var content = await fs.read_file(data_file); + var obj = JSON.parse(content.toString(), reviver); [...obj.keys()].forEach(k => state.set(k, obj.get(k))); }else{ logger.info('Creating new state file'); + state.set('repositories', new Map()); } }, async save(data_file){ From 21af84aaabdbba635e39815d50ae9affd6b93415 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 6 Mar 2021 00:44:25 +1300 Subject: [PATCH 110/385] pkg(deno-1.7.5): Migrate to new version --- packages/deno-1.7.5/build.sh | 11 +++++++++++ packages/deno-1.7.5/environment | 1 + packages/deno-1.7.5/metadata.json | 7 +++++++ packages/deno-1.7.5/run | 2 ++ packages/{deno.test => deno-1.7.5/test.ts} | 0 packages/deno.mk | 22 ---------------------- 6 files changed, 21 insertions(+), 22 deletions(-) create mode 100755 packages/deno-1.7.5/build.sh create mode 100644 packages/deno-1.7.5/environment create mode 100644 packages/deno-1.7.5/metadata.json create mode 100644 packages/deno-1.7.5/run rename packages/{deno.test => deno-1.7.5/test.ts} (100%) delete mode 100644 packages/deno.mk diff --git a/packages/deno-1.7.5/build.sh b/packages/deno-1.7.5/build.sh new file mode 100755 index 0000000..b15f804 --- /dev/null +++ b/packages/deno-1.7.5/build.sh @@ -0,0 +1,11 @@ +mkdir -p output build + +cd build +curl -L https://github.com/denoland/deno/releases/download/v1.7.5/deno-x86_64-unknown-linux-gnu.zip --output deno.zip +unzip deno.zip + +cd .. + +mv build/deno output + +chmod +x output/deno \ No newline at end of file diff --git a/packages/deno-1.7.5/environment b/packages/deno-1.7.5/environment new file mode 100644 index 0000000..98fd770 --- /dev/null +++ b/packages/deno-1.7.5/environment @@ -0,0 +1 @@ +export PATH=$PWD:$PATH \ No newline at end of file diff --git a/packages/deno-1.7.5/metadata.json b/packages/deno-1.7.5/metadata.json new file mode 100644 index 0000000..0ab8971 --- /dev/null +++ b/packages/deno-1.7.5/metadata.json @@ -0,0 +1,7 @@ +{ + "language": "deno", + "version": "1.7.5", + "author": "Thomas Hobson ", + "dependencies": {}, + "aliases": ["deno-ts", "deno-js"] +} \ No newline at end of file diff --git a/packages/deno-1.7.5/run b/packages/deno-1.7.5/run new file mode 100644 index 0000000..9bcf3ef --- /dev/null +++ b/packages/deno-1.7.5/run @@ -0,0 +1,2 @@ +#!/bin/bash +DENO_DIR=$PWD deno run $* \ No newline at end of file diff --git a/packages/deno.test b/packages/deno-1.7.5/test.ts similarity index 100% rename from packages/deno.test rename to packages/deno-1.7.5/test.ts diff --git a/packages/deno.mk b/packages/deno.mk deleted file mode 100644 index a2b83c3..0000000 --- a/packages/deno.mk +++ /dev/null @@ -1,22 +0,0 @@ -NAME=deno -AUTHOR=Thomas Hobson -DEPENDENCIES= -COMPILED=false -VERSIONS=1.7.5 - -include common.mk - - -${RUN_FILE}: - echo 'deno run $$*' > $@ - -${ENV_FILE}: - echo 'export PATH=$$PWD:$$PATH' > $@ - -${BIN_DIR}: ${BUILD_DIR}deno-x86_64-unknown-linux-gnu/ - mkdir -p $@ - mv $ Date: Sat, 6 Mar 2021 00:44:35 +1300 Subject: [PATCH 111/385] cli: fix execute not working --- cli/commands/execute.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/commands/execute.js b/cli/commands/execute.js index 11afaa2..8d5ed69 100644 --- a/cli/commands/execute.js +++ b/cli/commands/execute.js @@ -55,7 +55,7 @@ exports.handler = async function(argv){ version: argv['language-version'], files: files, main: argv.file, - arsg: argv.args, + args: argv.args, stdin, compile_timeout: argv.ct, run_timeout: argv.rt From 66fd00e410b60d60993746dba5e451308ce26567 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 6 Mar 2021 00:45:14 +1300 Subject: [PATCH 112/385] repo: add unzip to build tools --- repo/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repo/Dockerfile b/repo/Dockerfile index 35201e0..606b596 100644 --- a/repo/Dockerfile +++ b/repo/Dockerfile @@ -1,6 +1,6 @@ FROM debian:buster-slim -RUN apt-get update && apt-get install -y autoconf build-essential libssl-dev pkg-config zlib1g-dev libargon2-dev libsodium-dev libcurl4-openssl-dev sqlite3 libsqlite3-dev libonig-dev libxml2 libxml2-dev bc curl git linux-headers-amd64 perl xz-utils python3 python3-pip gnupg jq zlib1g-dev cmake cmake-doc extra-cmake-modules build-essential gcc binutils bash coreutils util-linux pciutils usbutils coreutils binutils findutils grep && \ +RUN apt-get update && apt-get install -y unzip autoconf build-essential libssl-dev pkg-config zlib1g-dev libargon2-dev libsodium-dev libcurl4-openssl-dev sqlite3 libsqlite3-dev libonig-dev libxml2 libxml2-dev bc curl git linux-headers-amd64 perl xz-utils python3 python3-pip gnupg jq zlib1g-dev cmake cmake-doc extra-cmake-modules build-essential gcc binutils bash coreutils util-linux pciutils usbutils coreutils binutils findutils grep && \ ln -sf /bin/bash /bin/sh && \ pip3 install 'yq==2.12.0' && \ rm -rf /var/lib/apt/lists/* From 51666c2d5ae633fbea8a9239827d8ae59734d7c3 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 6 Mar 2021 01:06:00 +1300 Subject: [PATCH 113/385] pkg(mono-6.12.0): change to new build system --- packages/csharp-mono.mk | 34 ------------------- packages/mono-6.12.0/build.sh | 16 +++++++++ packages/mono-6.12.0/compile | 3 ++ packages/mono-6.12.0/environment | 1 + packages/mono-6.12.0/metadata.json | 7 ++++ packages/mono-6.12.0/run | 5 +++ .../{csharp-mono.test => mono-6.12.0/test.cs} | 0 7 files changed, 32 insertions(+), 34 deletions(-) delete mode 100644 packages/csharp-mono.mk create mode 100755 packages/mono-6.12.0/build.sh create mode 100644 packages/mono-6.12.0/compile create mode 100644 packages/mono-6.12.0/environment create mode 100644 packages/mono-6.12.0/metadata.json create mode 100644 packages/mono-6.12.0/run rename packages/{csharp-mono.test => mono-6.12.0/test.cs} (100%) diff --git a/packages/csharp-mono.mk b/packages/csharp-mono.mk deleted file mode 100644 index b9d7f54..0000000 --- a/packages/csharp-mono.mk +++ /dev/null @@ -1,34 +0,0 @@ -NAME=csharp-mono -AUTHOR=Thomas Hobson -DEPENDENCIES= -COMPILED=true -VERSIONS=6.12.0 - -include common.mk - - -VERSION_6.12.0_FULL=6.12.0.122 - -VERSION_FULL=${VERSION_${VERSION}_FULL} - - -${RUN_FILE}: - echo 'CODE=$${1/cs/exe}' > $@ - echo 'shift' >> $@ - echo 'mono $$CODE $$*' >> $@ - -${COMPILE_FILE}: - echo 'csc $$*' > $@ - -${ENV_FILE}: - echo 'export PATH=$$PWD/bin:$$PATH' > $@ - -${BIN_DIR}: ${BUILD_DIR}mono-${VERSION_FULL}/ - $(eval TMP_DIR=${PWD}/${BUILD_DIR}tmpout/) - cd $< && ./configure --prefix ${PREFIX} - $(MAKE) -j64 -C $< - DESTDIR=${TMP_DIR} $(MAKE) -C $< install - mv ${TMP_DIR}${PREFIX} ${BIN_DIR} && rm -r ${TMP_DIR} - -${BUILD_DIR}mono-${VERSION_FULL}.tar.xz: - curl "https://download.mono-project.com/sources/mono/mono-${VERSION_FULL}.tar.xz" -o $@ diff --git a/packages/mono-6.12.0/build.sh b/packages/mono-6.12.0/build.sh new file mode 100755 index 0000000..0dddd14 --- /dev/null +++ b/packages/mono-6.12.0/build.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +mkdir -p build/tmp build/mono +cd build + +curl "https://download.mono-project.com/sources/mono/mono-6.12.0.122.tar.xz" -o mono.tar.xz +tar xf mono.tar.xz --strip-components=1 -C mono + +cd mono + +./configure --prefix /piston/packages/mono/6.12.0/mono-6.12.0 + +make +DESTDIR=build/tmp make install + +mv build/tmp/piston/packages/mono/6.12.0/mono-6.12.0 ../../output diff --git a/packages/mono-6.12.0/compile b/packages/mono-6.12.0/compile new file mode 100644 index 0000000..3151cde --- /dev/null +++ b/packages/mono-6.12.0/compile @@ -0,0 +1,3 @@ +#!/bin/bash + +csc $* \ No newline at end of file diff --git a/packages/mono-6.12.0/environment b/packages/mono-6.12.0/environment new file mode 100644 index 0000000..98fd770 --- /dev/null +++ b/packages/mono-6.12.0/environment @@ -0,0 +1 @@ +export PATH=$PWD:$PATH \ No newline at end of file diff --git a/packages/mono-6.12.0/metadata.json b/packages/mono-6.12.0/metadata.json new file mode 100644 index 0000000..24837d9 --- /dev/null +++ b/packages/mono-6.12.0/metadata.json @@ -0,0 +1,7 @@ +{ + "language": "mono", + "version": "6.12.0", + "author": "Thomas Hobson ", + "dependencies": {}, + "aliases": ["csharp", "cs"] +} \ No newline at end of file diff --git a/packages/mono-6.12.0/run b/packages/mono-6.12.0/run new file mode 100644 index 0000000..9d9b61a --- /dev/null +++ b/packages/mono-6.12.0/run @@ -0,0 +1,5 @@ +#!/bin/bash + +CODE=${1/cs/exe} +shift +mono $CODE $* \ No newline at end of file diff --git a/packages/csharp-mono.test b/packages/mono-6.12.0/test.cs similarity index 100% rename from packages/csharp-mono.test rename to packages/mono-6.12.0/test.cs From ebe869aefa8a7f2f94cd7a668b95b79c3a0aa9ba Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 6 Mar 2021 01:10:18 +1300 Subject: [PATCH 114/385] pkg(contributing): update commit format --- packages/CONTRIBUTING.MD | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/CONTRIBUTING.MD b/packages/CONTRIBUTING.MD index 5dcb752..9ae44fd 100644 --- a/packages/CONTRIBUTING.MD +++ b/packages/CONTRIBUTING.MD @@ -55,7 +55,7 @@ The dependencies map contains the keys as language names, and the values as semv 9. Test your package builds with running `make [language]-[version].pkg.tar.gz`. If it all goes to plan, you should have a file named `[language]-[version].pkg.tar.gz`, in this case your good to go! -10. Commit your changes, using message format of `pkg([language]): Added [language] [version]` -Any additional commits regarding this package should start with `pkg([language]): ` +10. Commit your changes, using message format of `pkg([language]-[version]): Added [language] [version]` +Any additional commits regarding this package should start with `pkg([language]-[version]): ` 11. Create a pull request (currently to v3 branch), referencing an Issue number (if there is one associated). From f592bbb97194b46b7467139b1cfe22469ceade8d Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 6 Mar 2021 01:10:44 +1300 Subject: [PATCH 115/385] pkg(mono-6.12.0): use many core to build --- packages/mono-6.12.0/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/mono-6.12.0/build.sh b/packages/mono-6.12.0/build.sh index 0dddd14..52ac46a 100755 --- a/packages/mono-6.12.0/build.sh +++ b/packages/mono-6.12.0/build.sh @@ -10,7 +10,7 @@ cd mono ./configure --prefix /piston/packages/mono/6.12.0/mono-6.12.0 -make -DESTDIR=build/tmp make install +make -j$(nproc) +DESTDIR=build/tmp make install -j$(nproc) mv build/tmp/piston/packages/mono/6.12.0/mono-6.12.0 ../../output From d36c23a5bf4245e1cfb873749745e2211f6dfe84 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 6 Mar 2021 01:12:19 +1300 Subject: [PATCH 116/385] pkg(python-3.9.1): switch to new build system --- packages/python-3.9.1/build.sh | 19 ++++++++++++++ packages/python-3.9.1/environment | 1 + packages/python-3.9.1/metadata.json | 7 +++++ packages/python-3.9.1/pkg-info.json | 11 ++++++++ packages/python-3.9.1/run | 3 +++ .../{python.test => python-3.9.1/test.py} | 0 packages/python.mk | 26 ------------------- 7 files changed, 41 insertions(+), 26 deletions(-) create mode 100755 packages/python-3.9.1/build.sh create mode 100644 packages/python-3.9.1/environment create mode 100644 packages/python-3.9.1/metadata.json create mode 100644 packages/python-3.9.1/pkg-info.json create mode 100644 packages/python-3.9.1/run rename packages/{python.test => python-3.9.1/test.py} (100%) delete mode 100644 packages/python.mk diff --git a/packages/python-3.9.1/build.sh b/packages/python-3.9.1/build.sh new file mode 100755 index 0000000..83e0873 --- /dev/null +++ b/packages/python-3.9.1/build.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +mkdir -p build/tmp build/python +cd build + +curl "https://www.python.org/ftp/python/3.9.1/Python-3.9.1.tgz" -o python.tar.gz +tar xzf python.tar.gz --strip-components=1 -C python + +cd python + + +./configure --prefix /piston/packages/python/3.9.1/python-3.9.1 +make -j$(nproc) +DESTDIR=build/tmp make altinstall -j$(nproc) + + +mv build/tmp/piston/packages/python/3.9.1/python-3.9.1 ../../output + + diff --git a/packages/python-3.9.1/environment b/packages/python-3.9.1/environment new file mode 100644 index 0000000..bd0ff98 --- /dev/null +++ b/packages/python-3.9.1/environment @@ -0,0 +1 @@ +export PATH=$PWD/bin:$PATH \ No newline at end of file diff --git a/packages/python-3.9.1/metadata.json b/packages/python-3.9.1/metadata.json new file mode 100644 index 0000000..98c33ed --- /dev/null +++ b/packages/python-3.9.1/metadata.json @@ -0,0 +1,7 @@ +{ + "language": "python", + "version": "3.9.1", + "author": "Thomas Hobson ", + "dependencies": {}, + "aliases": ["py", "python3"] +} \ No newline at end of file diff --git a/packages/python-3.9.1/pkg-info.json b/packages/python-3.9.1/pkg-info.json new file mode 100644 index 0000000..4759093 --- /dev/null +++ b/packages/python-3.9.1/pkg-info.json @@ -0,0 +1,11 @@ +{ + "language": "python", + "version": "3.9.1", + "author": "Thomas Hobson ", + "dependencies": {}, + "aliases": [ + "py", + "python3" + ], + "build_platform": "baremetal-debian" +} diff --git a/packages/python-3.9.1/run b/packages/python-3.9.1/run new file mode 100644 index 0000000..7b3205b --- /dev/null +++ b/packages/python-3.9.1/run @@ -0,0 +1,3 @@ +#!/bin/bash + +python3.9 $* \ No newline at end of file diff --git a/packages/python.test b/packages/python-3.9.1/test.py similarity index 100% rename from packages/python.test rename to packages/python-3.9.1/test.py diff --git a/packages/python.mk b/packages/python.mk deleted file mode 100644 index d0aa0ab..0000000 --- a/packages/python.mk +++ /dev/null @@ -1,26 +0,0 @@ -NAME=python -AUTHOR=Thomas Hobson -DEPENDENCIES= -COMPILED=false -VERSIONS=3.5.1 3.9.1 - -include common.mk - - -${RUN_FILE}: - echo 'python${VERSION_MINOR} $$*' > $@ - -${ENV_FILE}: - echo 'export PATH=$$PWD/bin:$$PATH' > $@ - -${BIN_DIR}: ${BUILD_DIR}Python-${VERSION}/ - $(eval TMP_DIR=${PWD}/${BUILD_DIR}tmpout/) - - cd $< && ./configure --prefix ${PREFIX} - $(MAKE) -C $< - DESTDIR=${TMP_DIR} $(MAKE) -C $< altinstall - mv ${TMP_DIR}${PREFIX} ${BIN_DIR} && rm -rf ${TMP_DIR} - - -${BUILD_DIR}Python-${VERSION}.tar.gz: - curl "https://www.python.org/ftp/python/${VERSION}/Python-${VERSION}.tgz" -o $@ From a0e7d1b736a4e918c9c4f7f547dde54e3ffe642d Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 6 Mar 2021 01:23:51 +1300 Subject: [PATCH 117/385] pkg(node-15.10.0): switch to new build system --- packages/javascript-node.mk | 22 ---------------------- packages/javascript-node.test | 1 - packages/node-15.10.0/build.sh | 11 +++++++++++ packages/node-15.10.0/environment | 1 + packages/node-15.10.0/metadata.json | 7 +++++++ packages/node-15.10.0/run | 3 +++ packages/node-15.10.0/test.js | 1 + 7 files changed, 23 insertions(+), 23 deletions(-) delete mode 100644 packages/javascript-node.mk delete mode 100644 packages/javascript-node.test create mode 100755 packages/node-15.10.0/build.sh create mode 100644 packages/node-15.10.0/environment create mode 100644 packages/node-15.10.0/metadata.json create mode 100644 packages/node-15.10.0/run create mode 100644 packages/node-15.10.0/test.js diff --git a/packages/javascript-node.mk b/packages/javascript-node.mk deleted file mode 100644 index ff15d9c..0000000 --- a/packages/javascript-node.mk +++ /dev/null @@ -1,22 +0,0 @@ -NAME=javascript-node -AUTHOR=Martin Kos -DEPENDENCIES= -COMPILED=false -VERSIONS=14.16.0 15.10.0 - -include common.mk - - -${RUN_FILE}: - echo 'node $$*' > $@ - -${ENV_FILE}: - echo 'export PATH=$$PWD/bin:$$PATH' > $@ - -${BIN_DIR}: ${BUILD_DIR}node-${VERSION}-sources/ - mkdir -p $@ - mv $", + "dependencies": {}, + "aliases": ["node-javascript", "node-js", "javascript", "js"] +} \ No newline at end of file diff --git a/packages/node-15.10.0/run b/packages/node-15.10.0/run new file mode 100644 index 0000000..004ca32 --- /dev/null +++ b/packages/node-15.10.0/run @@ -0,0 +1,3 @@ +#!/bin/bash + +node $* \ No newline at end of file diff --git a/packages/node-15.10.0/test.js b/packages/node-15.10.0/test.js new file mode 100644 index 0000000..56ed4a0 --- /dev/null +++ b/packages/node-15.10.0/test.js @@ -0,0 +1 @@ +console.log("OK") \ No newline at end of file From 083793ee4301383364b3e49293d1044628f1980e Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 6 Mar 2021 01:35:35 +1300 Subject: [PATCH 118/385] pkg(php-8.0.2): switch to new build system --- packages/php-8.0.2/build.sh | 20 ++++++++++++++++++++ packages/php-8.0.2/environment | 1 + packages/php-8.0.2/metadata.json | 7 +++++++ packages/php-8.0.2/run | 3 +++ packages/php-8.0.2/test.php | 1 + packages/php.mk | 24 ------------------------ packages/php.test | 3 --- 7 files changed, 32 insertions(+), 27 deletions(-) create mode 100755 packages/php-8.0.2/build.sh create mode 100644 packages/php-8.0.2/environment create mode 100644 packages/php-8.0.2/metadata.json create mode 100644 packages/php-8.0.2/run create mode 100644 packages/php-8.0.2/test.php delete mode 100644 packages/php.mk delete mode 100644 packages/php.test diff --git a/packages/php-8.0.2/build.sh b/packages/php-8.0.2/build.sh new file mode 100755 index 0000000..9d5f5c7 --- /dev/null +++ b/packages/php-8.0.2/build.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +mkdir -p build/tmp build/php +cd build + +curl "https://www.php.net/distributions/php-8.0.2.tar.gz" -o php.tar.gz +tar xzf php.tar.gz --strip-components=1 -C php + +cd php + + +./configure --prefix /piston/packages/php/8.0.2/php-8.0.2 + +make -j$(nproc) +INSTALL_ROOT=build/tmp make install -j$(nproc) + + +mv build/tmp/piston/packages/php/8.0.2/php-8.0.2 ../../output + + diff --git a/packages/php-8.0.2/environment b/packages/php-8.0.2/environment new file mode 100644 index 0000000..bd0ff98 --- /dev/null +++ b/packages/php-8.0.2/environment @@ -0,0 +1 @@ +export PATH=$PWD/bin:$PATH \ No newline at end of file diff --git a/packages/php-8.0.2/metadata.json b/packages/php-8.0.2/metadata.json new file mode 100644 index 0000000..35ff122 --- /dev/null +++ b/packages/php-8.0.2/metadata.json @@ -0,0 +1,7 @@ +{ + "language": "php", + "version": "8.0.2", + "author": "Martin Kos ", + "dependencies": {}, + "aliases": ["php8","html"] +} \ No newline at end of file diff --git a/packages/php-8.0.2/run b/packages/php-8.0.2/run new file mode 100644 index 0000000..2bce27a --- /dev/null +++ b/packages/php-8.0.2/run @@ -0,0 +1,3 @@ +#!/bin/bash + +php $* \ No newline at end of file diff --git a/packages/php-8.0.2/test.php b/packages/php-8.0.2/test.php new file mode 100644 index 0000000..a0aba93 --- /dev/null +++ b/packages/php-8.0.2/test.php @@ -0,0 +1 @@ +OK \ No newline at end of file diff --git a/packages/php.mk b/packages/php.mk deleted file mode 100644 index 65dbc37..0000000 --- a/packages/php.mk +++ /dev/null @@ -1,24 +0,0 @@ -NAME=php -AUTHOR=Martin Kos -DEPENDENCIES= -COMPILED=false -VERSIONS=7.4.15 8.0.2 - -include common.mk - - -${RUN_FILE}: - echo 'php $$*' > $@ - -${ENV_FILE}: - echo 'export PATH=$$PWD/bin:$$PATH' > $@ - -${BIN_DIR}: ${BUILD_DIR}php-${VERSION}-sources/ - $(eval TMP_DIR=${PWD}/${BUILD_DIR}tmpout) - cd $< && ./configure --prefix ${PREFIX} - $(MAKE) -C $< - INSTALL_ROOT=${TMP_DIR}/ $(MAKE) -C $< install - mv ${TMP_DIR}${PREFIX} ${BIN_DIR} && rm -r ${TMP_DIR} - -${BUILD_DIR}php-${VERSION}-sources.tar.gz: - curl "https://www.php.net/distributions/php-${VERSION}.tar.gz" -o $@ diff --git a/packages/php.test b/packages/php.test deleted file mode 100644 index 997ffba..0000000 --- a/packages/php.test +++ /dev/null @@ -1,3 +0,0 @@ - From 9d61aba24e42dc49ab5d33244521040cc28d9ed8 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 6 Mar 2021 01:38:47 +1300 Subject: [PATCH 119/385] pkg(python-3.9.1): remove temp file --- packages/python-3.9.1/pkg-info.json | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 packages/python-3.9.1/pkg-info.json diff --git a/packages/python-3.9.1/pkg-info.json b/packages/python-3.9.1/pkg-info.json deleted file mode 100644 index 4759093..0000000 --- a/packages/python-3.9.1/pkg-info.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "language": "python", - "version": "3.9.1", - "author": "Thomas Hobson ", - "dependencies": {}, - "aliases": [ - "py", - "python3" - ], - "build_platform": "baremetal-debian" -} From 9706f2fab8da039f8c2010963ebb4fefbe451844 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 6 Mar 2021 01:39:05 +1300 Subject: [PATCH 120/385] pkg(gitignore): add pkg-info.json to gitignore --- packages/.gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/.gitignore b/packages/.gitignore index 80f2a67..6cc2e5b 100644 --- a/packages/.gitignore +++ b/packages/.gitignore @@ -1,3 +1,4 @@ */build */output -*.pkg.tar.gz \ No newline at end of file +*.pkg.tar.gz +*/pkg-info.json \ No newline at end of file From 22dcad0dd92a24debc7bce10041535f251f41fb1 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 6 Mar 2021 18:31:13 +1300 Subject: [PATCH 121/385] design: remove as outdated --- ARCHITECTURE.TXT | 71 ------------------------- design/api.txt | 75 -------------------------- design/fs.txt | 18 ------- design/index.txt | 13 ----- design/ppman.txt | 136 ----------------------------------------------- 5 files changed, 313 deletions(-) delete mode 100644 ARCHITECTURE.TXT delete mode 100644 design/api.txt delete mode 100644 design/fs.txt delete mode 100644 design/index.txt delete mode 100644 design/ppman.txt diff --git a/ARCHITECTURE.TXT b/ARCHITECTURE.TXT deleted file mode 100644 index edf52d3..0000000 --- a/ARCHITECTURE.TXT +++ /dev/null @@ -1,71 +0,0 @@ -== Breif == [ Piston ] - -This document covers the overall architecture of Piston v3, and not the -individual components and their implementations. - -In Piston v2 we saw 2 ways of using piston - through the CLI and the API. -These 2 methods would call the same load of bash scripts contained within -a LXC container which would then resolve your request. -There are a number of issues with this approach: - 1. This uses bash - which isn't the best language for performance - 2. It relied on calling through a `lxc-attach` command to access - inside the container - 3. This isn't easy to distribute - 4. It was difficult to add languages - having to edit 4 different files - in 4 different places to add a single language - -Piston v3 aims to tackle these 4 issues. -Firstly, v3 will be less reliant on bash, only using it as an option -for running different interpreters. -Secondly, v3 can run on bare-metal or in a container, but a core API will be -exposed from within the container, instead of running external to it. -Thirdly, v3 will provide a simple docker container, which will expose both the -piston API, and run all the runners within it. -Finally, v3 will provide a repository of precompiled language executers, so its -1 command away from installing a language - - - -== Piston API == - -Piston v3 exposes a REST API, allowing the user to control the entire thing -over one simple JSON based protocol. This eliminates the need to connect into -the container to do maintainace such as adding new languages, or checking -usage statistics. - -See design/api.txt for more information. - - - -== Package Manager == - -Piston v3 includes a package manager right out of the box. The package manager -manages the different languages and versions that it can run. -The package manager is hooked directly into the API and addresses our point -of easy distibution, as users now can easily enable/disable different -components built into piston as they see fit. - -See design/ppman.txt for more information. - - - -== Runtime Environment == - -The new architecture moves to a more bare-metal approach, where the code can be -run without the overhead of a container manager such as LXC or Docker, making -piston much easier to manage this way - -It is still possible to run Piston v3 in a contain, but now a container engine -is not required for usage, however it is still recommended. - - - -== Proxy API == - -The in-container API is more powerful than a simple execution API and thus -should be limited, however to keep the weight down, and speed up there is a -reference implementation of a proxy API included, which passes through -execution commands to many different piston instances and allows for -security with rate limiting and API keys. - -See design/proxy.txt \ No newline at end of file diff --git a/design/api.txt b/design/api.txt deleted file mode 100644 index a9e7e63..0000000 --- a/design/api.txt +++ /dev/null @@ -1,75 +0,0 @@ -== Piston API == [ Piston ] - -When we speak of piston, what we actually talk about is the Piston API. -This API provides unrestricted, unlimited access to managing piston and -thus shouldn't be publicly exposed. This API is comparable to one of the -docker engine, where everything regarding control of docker goes directly -through the api. - -The API is responsible for managing the execution lifecycle of any given -job, as well as managing the different languages which it can execute a -job in. - - - -== Job Execution == - -Piston v3 exposes an endpoint per package `/execute`, which when called takes -in both a string of code, and an array of arguments to pass into the program -as well as data to write to STDIN. The stdout and stderr from the process are -then both returned seperately, along with the error code returned. - -All of this is has no rate-limiting built in making it lightning fast as a call -will directly start the runner process and get under way instantly. - -The 2 stages of this process - compile and run are both run in sequence, with -different timeouts configurable in the runners config file located in the -data directory. - -Requests to this endpoint can have caching enabled at 3 different levels. -The first option is to have no caching, which is the default for all -interpreted language. The second option is for the compiled binaries to be -cached, which is the default for all compiled languages. The final option is -for output to be cached, which isn't used by default but can be enabled per -package or per request. This is done for the reason that code may choose to -source data from /dev/(u)random or similar sources and as such may not be as -reliable when their outputs are cached. Caching is per package and is used as -an acceleration method to help boost performance of Piston. Cache entries are -automatically purged after the set time, or can be manually purged through the -API on a per package basis. - - -== Package Manager == - -Piston v3 has an inbuilt package manager which is responsible for -(un)installing different packages. Piston v3 by default has access to a single -offical repository hosting various versions of various common languages. These -packages and repositories conform to the specifications set out in ppman.txt - -The Piston API service downloads the repository index whenever a `/packages` -request is issued to a repository with the `sync` flag is set. This will cause -the service to download the latest repostiory index off the mirror. - -In piston there is no concept of a package being "outdated" as each package is -a specific version of a language, and different languages can be installed in -paralleland function without any issues. Each package should be considered the -final version of that language. If there is a new version of a language -available (i.e. Python 3.9.1 -> 3.9.2), a new package should be created for -this. - -Invidual languages can be queried from the repo using the -`/repos/{repo}/packages/{package}/{package-version}` endpoint. This endpoint -allows for the metadata of the package to be accessed, such as the author, -size, checksums, dependencies, build file git url and download url. - -To install packages, a request to `/install` can be made to the package -endpoint and it will download and install it, making it available on the -`/packages/{package}/{version}` endpoint. - -There is a meta-repository name `all` which can be used to access all -repositories. - -Internally the install process involved downloading and unpacking the package, -ensuring any dependencies are also downloaded and installed, mounting the -squashfs filesystem to a folder, then overlaying it with all its dependencies -in another folder. diff --git a/design/fs.txt b/design/fs.txt deleted file mode 100644 index 030d563..0000000 --- a/design/fs.txt +++ /dev/null @@ -1,18 +0,0 @@ -== File System Layout == [ Piston ] - -All of pistons files are installed in the `/piston` directory. This directory -contains all runtimes, config, packages and cache that piston uses. - -Each package gets its own directory, where it its prebuilt binaries are -unpacked into. This is contained within `/piston/packages` - -The binaries folder contained within this is then symlinked into the runtimes -directory. This is where all the different runtimes available are placed. This -is contained within the `/piston/runtimes` directory. - -The cache directory a directory containing all the different cache files. It is -recommended to either sym-link this into a folder withing /tmp/ or directly -mount it as a tmpfs filesystem. - -Configuration is stored in a single file - piston.yaml and contains all -documentation required for configuring the piston API \ No newline at end of file diff --git a/design/index.txt b/design/index.txt deleted file mode 100644 index 685222a..0000000 --- a/design/index.txt +++ /dev/null @@ -1,13 +0,0 @@ -== Index == [ Piston ] - -Design outlines the design of the different components and does not give a -concrete definition of the implementation or how to use it. - -api.txt Design of Piston API -ppman.txt Design of the package manager's package and repository format - - -== Glossary == - -Execution Job A single code run with arguments resulting in an output -Package A version of a language bundled together into a tarball \ No newline at end of file diff --git a/design/ppman.txt b/design/ppman.txt deleted file mode 100644 index b4920db..0000000 --- a/design/ppman.txt +++ /dev/null @@ -1,136 +0,0 @@ -== Package Manager (ppman) == [ Piston ] - -The package manager is the part of the API responsible for managing different -versions of different languages, managing their installation, uninstallation -and their dependencies. The package manager talks over the piston api and is -built directly into piston, although has parts which are not directly built -into the API (i.e. the repositories and the cli utility). - -The package manager is a complex part of piston, and requires 2 different file -specifications - the repository index file and the package file. - - - -== Repository Index File == - -The piston repository is the central place where packages are hosted and -downloaded from. This repository can either be a webserver or a local file -containing the right content - as long as its accessable by a URL, its -considered a valid repository by piston. A repository URL is simply a URL -pointing to a repository index file, as set out by the following information. - -A repository index file is a YAML file containing the keys: `schema`, -`baseurl`, `keys` and `packages`. - -The schema key simply should have a value of `ppman-repo-1`. This indicates the -version and file format for the client to recieve. - -The baseurl key contains the base url that relative URLs should be based off, -this doesn't need to be related to the url that the repository index is hosted -at, only the downloadable files, which are possible to split over many domains -by using absolute paths. - -The keys key contains a list of GPG key ids which should be used when -verifying. - -The packages key contains a list of packages, which contain the keys: `author`, -`language`, `version`, `checksums`, `dependencies`, `size`, `buildfile`, -`download` and `signature`. - -The author field is self explainatory, it is simply the authors name and email, -formatted similar to git's default format: `Full Name `. If the -repository index is automatically generated, it is best to use the commit -author's name in here. - -The language and version fields define the version and name of the compiler or -interpreter contained within. The language should not include a version at all. -In the case of python, use the name python for both python 2 and 3, using the -version field to differentiate between the 2. - -The checksums field is simply a map of hash types to hashes, hash types include -md5, sha1, sha256, sha512. The digests should simply be written as lowercase -hex characters. Only one checksum is required, but if more are supplied the -most secure one is picked, with sha512 as the highest possible. - -The dependencies is simply a map of language names to versions, which should be -installed for the package to run correctly. An example of this would be -typescript requires node to run. - -The size field is the number of bytes the package file is in size, while -uncompressed. This is used to determine if there is enough room, and thus -should be accurate. - -The buildfile field is a URL pointing to the exact build script for this build. -This should always point to a URL either containing steps, a script or other -means of reproducing the build. This field is purely so people can understand -how the image was built, and to make sure you aren't packing any mallicious -code into it. - -The download field is a URL pointing to a place of which the package file can -be obtained from. If this is a relative url, the baseurl will be appended to -it. This is particularly useful if everything is stored within 1 s3 bucket, or -you have a repository in a folder. - -The signature field is an armored signature - - -== Package File == - -Within a repository, many package files are contained. These files are -downloaded and installed into `/piston`. They need to all follow the format -as listed below for the API to properly utilize them. - -A package file is a gzipped tar archive, containing 4/5 things - `run`, -`compile` (optional), `pkg-info.json`, `lang-ver` and `lang-ver/environment`. -Replacing lang-ver with the language name and the version respectively. - - -The `pkg-info.json` file contains 5 different keys: `language`, `version`, -`author`, `dependencies` and `build_platform`. - -The language field is simply the name of the language, all lowercase and not -containing any version number. This is important in the case of python -specifically as python3 and python2 come under the same language, just -different versions. - -The version field is a sem-ver compliant version number for the interpreter -contained wthin the package. It should be a string. - -The author field contains the author name, and should be formatted exactly like -shown previously in the repo index spec. - -The dependencies field is simply a map containing packages which this package -depends on. This should only be used when one language is a requirement for -another, like how typescript is dependent on node. The key should be the name -of the package, with the value being the version selector. - -The build_platform field is used for defining which type of system the package -was built on, this helps resolve system compatability errors. It consists of 2 -parts - environment and disto. The environment is simply one of `baremetal`, -`docker`, `lxc` or any other type of environment you can run piston on. The -distro is the ID of the distro as contained in /etc/os-release on the system -which built the package. This is done to ensure system compatability, -especially inside the offically supported Docker container. - - -The `run` and `compile` files are used in the execution of a job, being used -to both compile and run the source code provided. They are both treated the -same inputs-wise but can have timeouts independently set per stage. The -arguments fed both these files are the same, with the first argument being a -path to the code file, and the rest being the arguments to passed in. These -files are run in a temporary directory contained within the cache folder. -Depending on the cache control level the code and associated files will either -be disposed of or kept. By default only files named `binary` will be kept. -STDIN is only passed into the `run` file, but both files have their output -captured and returned along with their exit codes through the API - -The `lang-ver` folder should contain any interpreter specific files, such as -the binary to execute and any other files that may be required to run the -interpreter/compiler contained within the package. - -The `environment` file contained within `lang-ver` should contain export -commands like a ~/.bashrc file should, as this is its intended purpose. Firstly -the language which is being executed has its environment file sources, then it -walks down the dependency tree sourcing files. The environment variables are -eventually cached to speed up the execution process. - From 812069cc3f487c5f751981180d4f2e39a0ecdff8 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 6 Mar 2021 19:17:56 +1300 Subject: [PATCH 122/385] api: remove repos from ppman --- api/src/cache.js | 65 ----------------- api/src/config.js | 26 ++----- api/src/globals.js | 5 -- api/src/helpers.js | 33 --------- api/src/index.js | 63 ++-------------- api/src/ppman/package.js | 101 ++++++-------------------- api/src/ppman/repo.js | 65 ----------------- api/src/ppman/routes.js | 151 +++++++-------------------------------- api/src/runtime.js | 23 ++---- api/src/state.js | 45 ------------ 10 files changed, 66 insertions(+), 511 deletions(-) delete mode 100644 api/src/cache.js delete mode 100644 api/src/helpers.js delete mode 100644 api/src/ppman/repo.js delete mode 100644 api/src/state.js diff --git a/api/src/cache.js b/api/src/cache.js deleted file mode 100644 index 43727ab..0000000 --- a/api/src/cache.js +++ /dev/null @@ -1,65 +0,0 @@ -const globals = require('./globals'); -const logger = require('logplease').create('cache'); -const fs = require('fs/promises'), - path = require('path'); - -const cache = new Map(); - -module.exports = { - cache_key: (context, key) => Buffer.from(`${context}-${key}`).toString('base64'), - has(key){ - return cache.has(key) && cache.get(key).expiry > Date.now(); - }, - async get(key, callback, ttl=globals.cache_ttl){ - logger.debug('get:', key); - - if(module.exports.has(key)){ - logger.debug('hit:',key); - return cache.get(key).data; - } - - logger.debug('miss:', key); - var data = await callback(); - cache.set(key, {data, expiry: Date.now() + ttl}); - - return data; - }, - async flush(cache_dir){ - logger.info('Flushing cache'); - - async function flush_single(value, key){ - const file_path = path.join(cache_dir, key); - - if(value.expiry < Date.now()){ - cache.delete(key); - try { - const stats = await fs.stat(file_path); - if(stats.is_file()) - await fs.rm(file_path); - }catch{ - // Ignore, file hasn't been flushed yet - } - }else{ - await fs.write_file(file_path, JSON.stringify(value)); - } - - } - - return Promise.all( - Array.from(cache).map(flush_single) - ); - - }, - async load(cache_dir){ - const files = await fs.readdir(cache_dir); - - async function load_single(file_name){ - const file_path = path.join(cache_dir,file_name); - const file_content = await fs.read_file(file_path).toString(); - cache.set(file_name, JSON.parse(file_content)); - } - - return Promise.all(files.map(load_single)); - } - -}; \ No newline at end of file diff --git a/api/src/config.js b/api/src/config.js index 6d73f54..2d841b0 100644 --- a/api/src/config.js +++ b/api/src/config.js @@ -54,24 +54,6 @@ const options = [ default: '/piston', validators: [x=> fss.exists_sync(x) || `Directory ${x} does not exist`] }, - { - key: 'cache_ttl', - desc: 'Time in milliseconds to keep data in cache for at a maximum', - default: 60 * 60 * 1000, - validators: [] - }, - { - key: 'cache_flush_time', - desc: 'Interval in milliseconds to flush cache to disk at', - default: 90 * 60 * 1000, //90 minutes - validators: [] - }, - { - key: 'state_flush_time', - desc: 'Interval in milliseconds to flush state to disk at', - default: 5000, // 5 seconds (file is tiny) - validators: [] - }, { key: 'runner_uid_min', desc: 'Minimum uid to use for runner', @@ -119,6 +101,12 @@ const options = [ desc: 'Max number of open files per job', default: 2048, validators: [] + }, + { + key: 'repo_url', + desc: 'URL of repo index', + default: 'https://github.com', + validators: [] } ]; @@ -126,7 +114,7 @@ function make_default_config(){ let content = header.split('\n'); options.forEach(option => { - content.concat(option.desc.split('\n').map(x=>`# ${x}`)); + content = content.concat(option.desc.split('\n').map(x=>`# ${x}`)); if(option.options) content.push('# Options: ' + option.options.join(', ')); diff --git a/api/src/globals.js b/api/src/globals.js index 09ccb2e..c9bd427 100644 --- a/api/src/globals.js +++ b/api/src/globals.js @@ -11,14 +11,9 @@ const platform = `${is_docker() ? 'docker' : 'baremetal'}-${ module.exports = { data_directories: { - cache: 'cache', packages: 'packages', - runtimes: 'runtimes', jobs: 'jobs' }, - data_files:{ - state: 'state.json' - }, version: require('../package.json').version, platform, pkg_installed_file: '.ppman-installed' //Used as indication for if a package was installed diff --git a/api/src/helpers.js b/api/src/helpers.js deleted file mode 100644 index ba3ef56..0000000 --- a/api/src/helpers.js +++ /dev/null @@ -1,33 +0,0 @@ -const fs = require('fs/promises'), - path= require('path'), - fetch = require('node-fetch'), - urlp = require('url'); - - - -module.exports = { - async buffer_from_url(url){ - if(!(url instanceof URL)) - url = new URL(url); - if(url.protocol == 'file:'){ - //eslint-disable-next-line snakecasejs/snakecasejs - return await fs.read_file(urlp.fileURLToPath(url)); - }else{ - return await fetch({ - url: url.toString() - }); - } - }, - add_url_base_if_required(url, base){ - try{ - return new URL(url); - }catch{ - //Assume this is a file name - return new URL(url, base + '/'); - } - }, - url_basename(url){ - return path.basename(url.pathname); - }, - -}; \ No newline at end of file diff --git a/api/src/index.js b/api/src/index.js index 4d5e76c..1325243 100644 --- a/api/src/index.js +++ b/api/src/index.js @@ -4,8 +4,6 @@ const Logger = require('logplease'); const express = require('express'); const globals = require('./globals'); const config = require('./config'); -const cache = require('./cache'); -const state = require('./state'); const path = require('path'); const fs = require('fs/promises'); const fss = require('fs'); @@ -35,13 +33,6 @@ const app = express(); }); - - logger.info('Loading state'); - await state.load(path.join(config.data_directory,globals.data_files.state)); - - logger.info('Loading cache'); - await cache.load(path.join(config.data_directory,globals.data_directories.cache)); - logger.info('Loading packages'); const pkgdir = path.join(config.data_directory,globals.data_directories.packages); @@ -89,44 +80,16 @@ const app = express(); const ppman_routes = require('./ppman/routes'); const executor_routes = require('./executor/routes'); - app.get('/repos', - validate, - ppman_routes.repo_list + + app.get('/packages', + ppman_routes.package_list ); - app.post('/repos', - ppman_routes.repo_add_validators, - validate, - ppman_routes.repo_add - ); - - app.get('/repos/:repo_slug', - ppman_routes.repo_info_validators, - validate, - ppman_routes.repo_info - ); - - app.get('/repos/:repo_slug/packages', - ppman_routes.repo_packages_validators, - validate, - ppman_routes.repo_packages - ); - - app.get('/repos/:repo_slug/packages/:language/:version', - ppman_routes.package_info_validators, - validate, - ppman_routes.package_info - ); - - app.post('/repos/:repo_slug/packages/:language/:version', - ppman_routes.package_info_validators, - validate, + app.post('/packages/:language/:version', ppman_routes.package_install ); - app.delete('/repos/:repo_slug/packages/:language/:version', - ppman_routes.package_info_validators, - validate, + app.delete('/packages/:language/:version', ppman_routes.package_uninstall ); @@ -140,7 +103,8 @@ const app = express(); { language: rt.language, version: rt.version.raw, - author: rt.author + author: rt.author, + aliases: rt.aliases } )); @@ -158,17 +122,4 @@ const app = express(); logger.info('API server started on', config.bind_address); }); - logger.debug('Setting up flush timers'); - - setInterval( - cache.flush, - config.cache_flush_time, - path.join(config.data_directory,globals.data_directories.cache) - ); - - setInterval( - state.save, - config.state_flush_time, - path.join(config.data_directory,globals.data_files.state) - ); })(); \ No newline at end of file diff --git a/api/src/ppman/package.js b/api/src/ppman/package.js index 894376b..66a29b7 100644 --- a/api/src/ppman/package.js +++ b/api/src/ppman/package.js @@ -2,7 +2,7 @@ const logger = require('logplease').create('ppman/package'); const semver = require('semver'); const config = require('../config'); const globals = require('../globals'); -const helpers = require('../helpers'); +const fetch = require('node-fetch'); const path = require('path'); const fs = require('fs/promises'); const fss = require('fs'); @@ -11,19 +11,11 @@ const crypto = require('crypto'); const runtime = require('../runtime'); class Package { - constructor(repo, {author, language, version, checksums, dependencies, size, buildfile, download, signature}){ - this.author = author; + constructor({language, version, download, checksum}){ this.language = language; this.version = semver.parse(version); - this.checksums = checksums; - this.dependencies = dependencies; - this.size = size; - this.buildfile = buildfile; + this.checksum = checksum; this.download = download; - this.signature = signature; - - this.repo = repo; - } get installed(){ @@ -31,7 +23,7 @@ class Package { } get download_url(){ - return helpers.add_url_base_if_required(this.download, this.repo.base_u_r_l); + return this.download; } get install_path(){ @@ -55,51 +47,26 @@ class Package { logger.debug(`Downloading package from ${this.download_url} in to ${this.install_path}`); - const pkgfile = helpers.url_basename(this.download_url); - const pkgpath = path.join(this.install_path, pkgfile); - await helpers.buffer_from_url(this.download_url) - .then(buf=> fs.write_file(pkgpath, buf)); - - logger.debug('Validating checksums'); - Object.keys(this.checksums).forEach(algo => { - var val = this.checksums[algo]; - - logger.debug(`Assert ${algo}(${pkgpath}) == ${val}`); - - var cs = crypto.create_hash(algo) - .update(fss.read_file_sync(pkgpath)) - .digest('hex'); - if(cs != val) throw new Error(`Checksum miss-match want: ${val} got: ${cs}`); + const pkgpath = path.join(this.install_path, "pkg.tar.gz"); + const download = await fetch(this.download_url); + const file_stream = fss.create_write_stream(pkgpath); + await new Promise((resolve, reject) => { + download.body.pipe(file_stream) + download.body.on("error", reject) + file_stream.on("finish", resolve) }); - await this.repo.import_keys(); + logger.debug('Validating checksums'); + logger.debug(`Assert sha256(pkg.tar.gz) == ${this.checksum}`) + const cs = crypto.create_hash("sha256") + .update(fss.readFileSync(pkgpath)) + .digest('hex'); + if(cs != this.checksum) throw new Error(`Checksum miss-match want: ${val} got: ${cs}`); - logger.debug('Validating signatures'); - - if(this.signature != '') - await new Promise((resolve,reject)=>{ - const gpgspawn = cp.spawn('gpg', ['--verify', '-', pkgpath], { - stdio: ['pipe', 'ignore', 'ignore'] - }); - - gpgspawn.once('exit', (code, _) => { - if(code == 0) resolve(); - else reject(new Error('Invalid signature')); - }); - - gpgspawn.once('error', reject); - - gpgspawn.stdin.write(this.signature); - gpgspawn.stdin.end(); - - }); - else - logger.warn('Package does not contain a signature - allowing install, but proceed with caution'); - - logger.debug(`Extracting package files from archive ${pkgfile} in to ${this.install_path}`); + logger.debug(`Extracting package files from archive ${pkgpath} in to ${this.install_path}`); await new Promise((resolve, reject)=>{ - const proc = cp.exec(`bash -c 'cd "${this.install_path}" && tar xzf ${pkgfile}'`); + const proc = cp.exec(`bash -c 'cd "${this.install_path}" && tar xzf ${pkgpath}'`); proc.once('exit', (code,_)=>{ if(code == 0) resolve(); else reject(new Error('Failed to extract package')); @@ -110,38 +77,12 @@ class Package { proc.once('error', reject); }); - logger.debug('Ensuring binary files exist for package'); - const pkgbin = path.join(this.install_path, `${this.language}-${this.version.raw}`); - try{ - const pkgbin_stat = await fs.stat(pkgbin); - //eslint-disable-next-line snakecasejs/snakecasejs - if(!pkgbin_stat.isDirectory()) throw new Error(); - // Throw a blank error here, so it will be caught by the following catch, and output the correct error message - // The catch is used to catch fs.stat - }catch(err){ - throw new Error(`Invalid package: could not find ${this.language}-${this.version.raw}/ contained within package files`); - } - - logger.debug('Symlinking into runtimes'); - - await fs.symlink( - pkgbin, - path.join(config.data_directory, - globals.data_directories.runtimes, - `${this.language}-${this.version.raw}`) - ).catch((err)=>err); //Ignore if we fail - probably means its already been installed and not cleaned up right - - logger.debug('Registering runtime'); - const pkg_runtime = new runtime.Runtime(this.install_path); + new runtime.Runtime(this.install_path); logger.debug('Caching environment'); - const required_pkgs = [pkg_runtime, ...pkg_runtime.get_all_dependencies()]; - const get_env_command = [ - ...required_pkgs.map(pkg=>`cd "${pkg.runtime_dir}"; source environment; `), - 'env' - ].join(' '); + const get_env_command = `cd ${this.install_path}; source environment; env`; const envout = await new Promise((resolve, reject)=>{ var stdout = ''; diff --git a/api/src/ppman/repo.js b/api/src/ppman/repo.js deleted file mode 100644 index d05c1a9..0000000 --- a/api/src/ppman/repo.js +++ /dev/null @@ -1,65 +0,0 @@ -const logger = require('logplease').create('ppman/repo'); -const cache = require('../cache'); -const CACHE_CONTEXT = 'repo'; - -const cp = require('child_process'); -const yaml = require('js-yaml'); -const { Package } = require('./package'); -const helpers = require('../helpers'); - -class Repository { - constructor(slug, url){ - this.slug = slug; - this.url = new URL(url); - this.keys = []; - this.packages = []; - this.base_u_r_l=''; - logger.debug(`Created repo slug=${this.slug} url=${this.url}`); - } - - get cache_key(){ - return cache.cache_key(CACHE_CONTEXT, this.slug); - } - - async load(){ - try{ - var index = await cache.get(this.cache_key,async ()=>{ - return helpers.buffer_from_url(this.url); - }); - - var repo = yaml.load(index); - if(repo.schema != 'ppman-repo-1'){ - throw new Error('YAML Schema unknown'); - } - - this.keys = repo.keys; - this.packages = repo.packages.map(pkg => new Package(this, pkg)); - this.base_u_r_l = repo.baseurl; - }catch(err){ - logger.error(`Failed to load repository ${this.slug}:`,err.message); - } - } - - - async import_keys(){ - await this.load(); - logger.info(`Importing keys for repo ${this.slug}`); - await new Promise((resolve,reject)=>{ - const gpgspawn = cp.spawn('gpg', ['--receive-keys', ...this.keys], { - stdio: ['ignore', 'ignore', 'ignore'] - }); - - gpgspawn.once('exit', (code, _) => { - if(code == 0) resolve(); - else reject(new Error('Failed to import keys')); - }); - - gpgspawn.once('error', reject); - - }); - - } - -} - -module.exports = {Repository}; \ No newline at end of file diff --git a/api/src/ppman/routes.js b/api/src/ppman/routes.js index a14fcf0..c4f0b8a 100644 --- a/api/src/ppman/routes.js +++ b/api/src/ppman/routes.js @@ -1,150 +1,53 @@ -const repos = new Map(); -const state = require('../state'); const logger = require('logplease').create('ppman/routes'); -const {Repository} = require('./repo'); const semver = require('semver'); -const { body, param } = require('express-validator'); +const fetch = require('node-fetch'); +const config = require('../config'); +const { Package } = require('./package'); -async function get_or_construct_repo(slug){ - if(repos.has(slug))return repos.get(slug); - if(state.state.get('repositories').has(slug)){ - const repo_url = state.state.get('repositories').get(slug); - const repo = new Repository(slug, repo_url); - await repo.load(); - repos.set(slug, repo); - return repo; - } - logger.warn(`Requested repo ${slug} does not exist`); - return null; + +async function get_package_list(){ + const repo_content = await fetch(config.repo_url).then(x=>x.text()); + + const entries = repo_content.split('\n').filter(x=>x.length > 0); + + return entries.map(line => { + const [language, version, checksum, download] = line.split(',',4); + return new Package({language, version, checksum, download}); + }) } -async function get_package(repo, lang, version){ - var candidates = repo.packages.filter( + +async function get_package(lang, version){ + const packages = await get_package_list(); + const candidates = packages.filter( pkg => pkg.language == lang && semver.satisfies(pkg.version, version) ); return candidates.sort((a,b)=>semver.rcompare(a.version,b.version))[0] || null; } module.exports = { - async repo_list(req,res){ - // GET /repos + + async package_list(req, res){ + // GET /packages + logger.debug('Request to list packages'); - logger.debug('Request for repoList'); - res.json_success({ - repos: (await Promise.all( - [...state.state.get('repositories').keys()].map( async slug => await get_or_construct_repo(slug)) - )).map(repo=>({ - slug: repo.slug, - url: repo.url, - packages: repo.packages.length - })) - }); - }, - repo_add_validators: [ - body('slug') - .notEmpty() // eslint-disable-line snakecasejs/snakecasejs - .bail() - .isSlug() // eslint-disable-line snakecasejs/snakecasejs - .bail() - .not() - .custom(value=>state.state.get('repositories').keys().includes(value)) - .withMessage('slug is already in use'), // eslint-disable-line snakecasejs/snakecasejs - body('url') - .notEmpty() // eslint-disable-line snakecasejs/snakecasejs - .bail() - .isURL({require_host: false, require_protocol: true, protocols: ['http','https','file']}) // eslint-disable-line snakecasejs/snakecasejs - - ], - async repo_add(req, res){ - // POST /repos - - logger.debug(`Request for repoAdd slug=${req.body.slug} url=${req.body.url}`); - - const repo_state = state.state.get('repositories'); - - repo_state.set(req.body.slug, req.body.url); - logger.info(`Repository ${req.body.slug} added url=${req.body.url}`); - - return res.json_success(req.body.slug); - }, - repo_info_validators: [ - param('repo_slug') - .isSlug() // eslint-disable-line snakecasejs/snakecasejs - .bail() - .custom(value=>state.state.get('repositories').has(value)) - .withMessage('repository does not exist') // eslint-disable-line snakecasejs/snakecasejs - .bail() - ], - async repo_info(req, res){ - // GET /repos/:slug - - logger.debug(`Request for repoInfo for ${req.params.repo_slug}`); - const repo = await get_or_construct_repo(req.params.repo_slug); - - res.json_success({ - slug: repo.slug, - url: repo.url, - packages: repo.packages.length - }); - }, - repo_packages_validators: [ - param('repo_slug') - .isSlug() // eslint-disable-line snakecasejs/snakecasejs - .bail() - .custom(value=>state.state.get('repositories').has(value)) - .withMessage('repository does not exist') // eslint-disable-line snakecasejs/snakecasejs - .bail() - ], - async repo_packages(req, res){ - // GET /repos/:slug/packages - logger.debug('Request to repoPackages'); - - const repo = await get_or_construct_repo(req.params.repo_slug); - if(repo == null) return res.json_error(`Requested repo ${req.params.repo_slug} does not exist`, 404); + const packages = await get_package_list(); res.json_success({ - packages: repo.packages.map(pkg=>({ + packages: packages.map(pkg=>({ language: pkg.language, language_version: pkg.version.raw, installed: pkg.installed })) }); - }, - package_info_validators: [ - param('repo_slug') - .isSlug() // eslint-disable-line snakecasejs/snakecasejs - .bail() - .custom(value=>state.state.get('repositories').has(value)) - .withMessage('repository does not exist') // eslint-disable-line snakecasejs/snakecasejs - .bail() - ], - async package_info(req, res){ - // GET /repos/:slug/packages/:language/:version - logger.debug('Request to packageInfo'); - - const repo = await get_or_construct_repo(req.params.repo_slug); - - const pkg = await get_package(repo, req.params.language, req.params.version); - if(pkg == null) return res.json_error(`Requested package ${req.params.language}-${req.params.version} does not exist`, 404); - - res.json_success({ - language: pkg.language, - language_version: pkg.version.raw, - author: pkg.author, - buildfile: pkg.buildfile, - size: pkg.size, - dependencies: pkg.dependencies, - installed: pkg.installed - }); }, async package_install(req,res){ - // POST /repos/:slug/packages/:language/:version + // POST /packages/:language/:version - logger.debug('Request to packageInstall'); + logger.debug('Request to install package'); - const repo = await get_or_construct_repo(req.params.repo_slug); - const pkg = await get_package(repo, req.params.language, req.params.version); + const pkg = await get_package(req.params.language, req.params.version); if(pkg == null) return res.json_error(`Requested package ${req.params.language}-${req.params.version} does not exist`, 404); try{ @@ -158,7 +61,7 @@ module.exports = { }, async package_uninstall(req,res){ - // DELETE /repos/:slug/packages/:language/:version + // DELETE /packages/:language/:version //res.json(req.body); //TODO res.json_error('not implemented', 500); diff --git a/api/src/runtime.js b/api/src/runtime.js index 1658f81..5a01891 100644 --- a/api/src/runtime.js +++ b/api/src/runtime.js @@ -11,7 +11,7 @@ class Runtime { #env_vars #compiled constructor(package_dir){ - const {language, version, author, dependencies, build_platform} = JSON.parse( + const {language, version, author, build_platform, aliases} = JSON.parse( fss.read_file_sync(path.join(package_dir, 'pkg-info.json')) ); @@ -19,7 +19,7 @@ class Runtime { this.language = language; this.version = semver.parse(version); this.author = author; - this.dependencies = dependencies; + this.aliases = aliases; if(build_platform != globals.platform){ logger.warn(`Package ${language}-${version} was built for platform ${build_platform}, but our platform is ${globals.platform}`); @@ -30,22 +30,7 @@ class Runtime { } get env_file_path(){ - return path.join(this.runtime_dir, 'environment'); - } - - get runtime_dir(){ - return path.join(config.data_directory,globals.data_directories.runtimes, this.toString()); - } - - get_all_dependencies(){ - const res = []; - Object.keys(this.dependencies).forEach(dep => { - const selector = this.dependencies[dep]; - const lang = module.exports.get_latest_runtime_matching_language_version(dep, selector); - res.push(lang); - res.concat(lang.get_all_dependencies(lang)); - }); - return res; + return path.join(this.pkgdir, 'environment'); } get compiled(){ @@ -77,7 +62,7 @@ class Runtime { module.exports = runtimes; module.exports.Runtime = Runtime; module.exports.get_runtimes_matching_language_version = function(lang, ver){ - return runtimes.filter(rt => rt.language == lang && semver.satisfies(rt.version, ver)); + return runtimes.filter(rt => (rt.language == lang || rt.aliases.includes(lang)) && semver.satisfies(rt.version, ver)); }; module.exports.get_latest_runtime_matching_language_version = function(lang, ver){ return module.exports.get_runtimes_matching_language_version(lang, ver) diff --git a/api/src/state.js b/api/src/state.js deleted file mode 100644 index dd6f773..0000000 --- a/api/src/state.js +++ /dev/null @@ -1,45 +0,0 @@ -const fs = require('fs/promises'); -const fss = require('fs'); - -const logger = require('logplease').create('state'); -const state = new Map(); - -function replacer(key, value) { - if(value instanceof Map) { - return { - data_type: 'Map', - value: Array.from(value.entries()), - }; - } else { - return value; - } -} - -function reviver(key, value) { - if(typeof value === 'object' && value !== null) { - if (value.data_type === 'Map') { - return new Map(value.value); - } - } - return value; -} - - -module.exports = { - state, - async load(data_file){ - if(fss.exists_sync(data_file)){ - logger.info('Loading state from file'); - var content = await fs.read_file(data_file); - var obj = JSON.parse(content.toString(), reviver); - [...obj.keys()].forEach(k => state.set(k, obj.get(k))); - }else{ - logger.info('Creating new state file'); - state.set('repositories', new Map()); - } - }, - async save(data_file){ - logger.info('Saving state to disk'); - await fs.write_file(data_file, JSON.stringify(state, replacer)); - } -}; \ No newline at end of file From 0363f1bb9f0ea5be987011607129f071c711c677 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 6 Mar 2021 19:20:07 +1300 Subject: [PATCH 123/385] repo: new index format --- repo/.gitignore | 3 +-- repo/entrypoint.sh | 2 +- repo/mkindex.sh | 22 +++++++++------------- 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/repo/.gitignore b/repo/.gitignore index fd572dc..c3607c0 100644 --- a/repo/.gitignore +++ b/repo/.gitignore @@ -1,3 +1,2 @@ *.pkg.tar.gz -index.yaml -*.key \ No newline at end of file +index \ No newline at end of file diff --git a/repo/entrypoint.sh b/repo/entrypoint.sh index 44a5d65..83e7c73 100755 --- a/repo/entrypoint.sh +++ b/repo/entrypoint.sh @@ -8,4 +8,4 @@ done cd /repo ./mkindex.sh -curl -s http://piston_api:6969/repos -XPOST -d "slug=local&url=file:///repo/index.yaml" || echo "WARNING: Could not add repository" +python3 -m http.server \ No newline at end of file diff --git a/repo/mkindex.sh b/repo/mkindex.sh index a38caf6..c3c72a0 100755 --- a/repo/mkindex.sh +++ b/repo/mkindex.sh @@ -1,26 +1,22 @@ -echo "schema: ppman-repo-1" > index.yaml -echo "baseurl: file://$PWD" >> index.yaml -echo "keys: []" >> index.yaml -echo "packages: []" >> index.yaml +BASEURL=http://piston_fs_repo:8000/ -#yq -yi '.keys[0] = "0x107DA02C7AE97B084746564B9F1FD9D87950DB6F"' index.yaml +i=0 -i=-1 +echo "" > index for pkg in $(find ../packages -type f -name "*.pkg.tar.gz") do - ((i=i+1)) + cp $pkg . + PKGFILE=$(basename $pkg) PKGFILENAME=$(echo $PKGFILE | sed 's/\.pkg\.tar\.gz//g') + PKGNAME=$(echo $PKGFILENAME | grep -oP '^\K.+(?=-)') PKGVERSION=$(echo $PKGFILENAME | grep -oP '^.+-\K.+') - BUILDFILE=https://github.com/engineer-man/piston/tree/v3/packages/ - SIZE=$(tar tzvf $PKGFILE | sed 's/ \+/ /g' | cut -f3 -d' ' | sed '2,$s/^/+ /' | paste -sd' ' | bc) + PKGCHECKSUM=$(sha256sum $PKGFILE | awk '{print $1}') - tar xzf $PKGFILE pkg-info.json - - yq -yi ".packages[$i] = {} | .packages[$i].signature = \"\" | .packages[$i].buildfile = \"$BUILDFILE\" | .packages[$i].size = $SIZE | .packages[$i].download = \"$PKGFILE\" | .packages[$i].dependencies = $(jq .dependencies -r pkg-info.json) | .packages[$i].author = $(jq .author pkg-info.json) | .packages[$i].language =\"$PKGNAME\" | .packages[$i].version = \"$PKGVERSION\" | .packages[$i].checksums = {} | .packages[$i].checksums.sha256 = \"$(sha256sum $PKGFILE | awk '{print $1}')\"" index.yaml + echo "$PKGNAME,$PKGVERSION,$PKGCHECKSUM,$BASEURL$PKGFILE" >> index - rm pkg-info.json + ((i=i+1)) done \ No newline at end of file From 2ca34bccadb2e29c07caded2bbc63d7e36c8e9f9 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 6 Mar 2021 19:20:31 +1300 Subject: [PATCH 124/385] deploy: update compose to match latest changes --- docker-compose.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index c74a814..8b5f62f 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -11,12 +11,11 @@ services: - ./data/piston:/piston - ./repo:/repo tmpfs: - - /piston/cache - /piston/jobs piston_fs_repo: #Temporary solution until CI works build: repo - command: ['python'] # Only build python + command: ['deno-1.7.5'] # Only build deno volumes: - ./repo:/repo - ./packages:/packages \ No newline at end of file From f9640d6166051336b98783fff28cc9657e004911 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 6 Mar 2021 19:26:51 +1300 Subject: [PATCH 125/385] api-client: update to match api --- api-client/index.cjs | 69 ++++++++------------------------------------ 1 file changed, 12 insertions(+), 57 deletions(-) diff --git a/api-client/index.cjs b/api-client/index.cjs index c58f9b3..14723dd 100644 --- a/api-client/index.cjs +++ b/api-client/index.cjs @@ -38,77 +38,32 @@ class APIWrapper { }) } - get_child_object(endpoint, class_type){ - return this.get(endpoint).then(x => new class_type(this, x)) - } - get url_base(){ return this.#base } } -class PistonEngineRepositoryPackage extends APIWrapper { - constructor(repo, {language, language_version, author, buildfile, size, dependencies, installed}){ - super(url_join(repo.url_base, `/packages/${language}/${language_version}`)) - - this.language = language; - this.language_version = language_version; - this.author = author; - this,buildfile = buildfile; - this.size = size; - this.dependencies = dependencies; - this.installed = installed; - } - - install(){ - return this.post('/', {}); - } - - uninstall(){ - return this.delete('/', {}); - } -} - -class PistonEngineRepository extends APIWrapper { - - constructor(engine, {slug, url, packages}){ - super(url_join(engine.url_base,`/repos/${slug}`)) - - this.slug = slug; - this.url = url; - this.package_count = packages - - } - - list_packages(){ - return this.get(`/packages`).then(x=>x.packages) - } - - get_package(language, language_version){ - return this.get_child_object(`/packages/${language}/${language_version}`, PistonEngineRepositoryPackage) - } -} class PistonEngine extends APIWrapper { constructor(base_url = 'http://127.0.0.1:6969'){ super(base_url); } - list_repos(){ - return this.get(`/repos`); - } - - add_repo(slug, url){ - return this.post(`/repos`, {slug, url}) - } - - get_repo(slug){ - return this.get_child_object(`/repos/${slug}`, PistonEngineRepository) - } - run_job({language, version, files, main, args, stdin, compile_timeout, run_timeout}){ return this.post(`/jobs`, {language, version, files, main, args, stdin, compile_timeout, run_timeout}) } + + list_packages(){ + return this.get('/packages').then(x=>x.packages) + } + + install_package({language, version}){ + return this.post(`/packages/${language}/${version}`); + } + + uninstall_package({language, version}){ + return this.post(`/packages/${language}/${version}`); + } } From fe2e2f4e30a499aaa5f4235225faffa88144f957 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 6 Mar 2021 19:27:13 +1300 Subject: [PATCH 126/385] cli: new api-client version --- cli/commands/ppman_commands/install.js | 20 +++++--------------- cli/commands/ppman_commands/list.js | 11 ++--------- 2 files changed, 7 insertions(+), 24 deletions(-) diff --git a/cli/commands/ppman_commands/install.js b/cli/commands/ppman_commands/install.js index 1cab867..39d0a28 100644 --- a/cli/commands/ppman_commands/install.js +++ b/cli/commands/ppman_commands/install.js @@ -15,23 +15,13 @@ const msg_format = { exports.handler = async function(argv){ const api = new PistonEngine(argv['piston-url']); - - const repos = await api.list_repos(); - - const repos_obj = await Promise.all(repos.repos.map(({slug}) => api.get_repo(slug))); - const repo_pkgs = await Promise.all(repos_obj.map( - async repo => ({ - repo: repo, - packages: await repo.list_packages().catch(_=>[]) - }) - )) + const opts = { + language: argv['language'], + version: argv['language-version'] + }; - const repo = repo_pkgs.find(r => r.packages.find(p=>p.language == argv['language'] && p.language_version == argv['language-version'])) - if(!repo) throw Error("Package could not be located") - - const package = await repo.repo.get_package(argv['language'], argv['language-version']) - const install = await package.install().catch(x=>x) + const install = await api.install_package(opts).catch(x=>x); console.log(msg_format.color(install)); } \ No newline at end of file diff --git a/cli/commands/ppman_commands/list.js b/cli/commands/ppman_commands/list.js index 6dd4bed..4a44dcf 100644 --- a/cli/commands/ppman_commands/list.js +++ b/cli/commands/ppman_commands/list.js @@ -15,17 +15,10 @@ const msg_format = { exports.handler = async function(argv){ const api = new PistonEngine(argv['piston-url']); - - const repos = await api.list_repos(); - const repos_obj = await Promise.all(repos.repos.map(({slug}) => api.get_repo(slug))); + const packages = await api.list_packages(); - const packages = await repos_obj.reduce(async (accumulator, repo) => [ - ...await accumulator, - ...await repo.list_packages() - .catch(x=>{console.log(x); return []}) - ], []); // Loops over repos, listing packages and flattening them into a single array - + const pkg_msg = packages .map(msg_format.color) .join('\n'); From b5902ceff9b3bf902ea0c5eed5c658dce015d2eb Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 6 Mar 2021 19:28:37 +1300 Subject: [PATCH 127/385] pkg(contibuting): update to match new format --- packages/CONTRIBUTING.MD | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/CONTRIBUTING.MD b/packages/CONTRIBUTING.MD index 9ae44fd..0c5381a 100644 --- a/packages/CONTRIBUTING.MD +++ b/packages/CONTRIBUTING.MD @@ -16,7 +16,7 @@ See [deno-1.7.5/](deno-1.7.5/) or any other directory for examples. 3. Create a file named `build.sh`, adding a shebang for bash `#!/bin/bash` on the first line. In this file put any steps to compile the specified langauge. -It is allowed to use 2 directories, `output` and `build`, the former which contains files which should get packaged into the final output, and the latter containing intermediate build files. +This script should download sources, compile sources and output binaries. They should be dumped into the current working directory, removing any files which aren't required in the process. 4. Create a file named `run`, containing bash script to run the interpreter. The first argument given to this script (`$1`) is the name of the main file, with the remaining ones as program arguments. @@ -25,7 +25,7 @@ STDIN is piped directly into the run file, and as such nothing special is requir 5. Create a file named `compile`, containing bash script to compile sources into binaries. This is only required if the language requires a compling stage. The first argument is always the main file, followed the names of the other files as additional arguements. If the language does not require a compile stage, don't create a compile file. -6. Create a file named `environment`, containing `export` statements which edit the environment variables accordingly. The `$PWD` variable should be used, and is set inside the `output` directory, but when running on the target system. +6. Create a file named `environment`, containing `export` statements which edit the environment variables accordingly. The `$PWD` variable should be used, and is set inside the package directory when running on the target system. 7. Create a test script starting with test, with the file extension of the language. This script should simply output the phrase `OK`. For example, for mono we would create `test.cs` with the content: ```cs From dc7f0ed86c2b91914e2dc8ca2d49a3ba4ee01aec Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 6 Mar 2021 19:28:55 +1300 Subject: [PATCH 128/385] pkg(gitignore): whitelist specific files --- packages/.gitignore | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/.gitignore b/packages/.gitignore index 6cc2e5b..92bd97e 100644 --- a/packages/.gitignore +++ b/packages/.gitignore @@ -1,4 +1,8 @@ -*/build -*/output +*/* *.pkg.tar.gz -*/pkg-info.json \ No newline at end of file +!*/metadata.json +!*/build.sh +!*/environment +!*/run +!*/compile +!*/test.* \ No newline at end of file From 905ed435fdbc12f31da334c525c0fcf4d2826a99 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 6 Mar 2021 19:29:28 +1300 Subject: [PATCH 129/385] pkg(Makefile): package entire directory --- packages/Makefile | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/packages/Makefile b/packages/Makefile index a861705..80360f5 100644 --- a/packages/Makefile +++ b/packages/Makefile @@ -8,22 +8,15 @@ help: @echo "Run $`make [language]-[version].pkg.tar.gz$` to build a specific language" build build-all: $(addsuffix .pkg.tar.gz, ${PACKAGES}) -clean clean-all: $(addprefix clean-, ${PACKAGES}) -clean-%: %/ - rm -rf $ $@ -%/output: %/ %/build.sh - cd $< && chmod +x ./build.sh && ./build.sh - - From 81dd0acbd00c08b182005e9553834711c9849324 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 6 Mar 2021 19:29:43 +1300 Subject: [PATCH 130/385] pkg(deno-1.7.5): update to match --- packages/deno-1.7.5/build.sh | 12 +++--------- packages/deno-1.7.5/metadata.json | 1 - 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/packages/deno-1.7.5/build.sh b/packages/deno-1.7.5/build.sh index b15f804..0b0674c 100755 --- a/packages/deno-1.7.5/build.sh +++ b/packages/deno-1.7.5/build.sh @@ -1,11 +1,5 @@ -mkdir -p output build - -cd build curl -L https://github.com/denoland/deno/releases/download/v1.7.5/deno-x86_64-unknown-linux-gnu.zip --output deno.zip -unzip deno.zip +unzip -o deno.zip +rm deno.zip -cd .. - -mv build/deno output - -chmod +x output/deno \ No newline at end of file +chmod +x deno \ No newline at end of file diff --git a/packages/deno-1.7.5/metadata.json b/packages/deno-1.7.5/metadata.json index 0ab8971..a73d171 100644 --- a/packages/deno-1.7.5/metadata.json +++ b/packages/deno-1.7.5/metadata.json @@ -2,6 +2,5 @@ "language": "deno", "version": "1.7.5", "author": "Thomas Hobson ", - "dependencies": {}, "aliases": ["deno-ts", "deno-js"] } \ No newline at end of file From 6391120176e36bbd5320d543cafb9294d319b08e Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 6 Mar 2021 19:31:02 +1300 Subject: [PATCH 131/385] pkg(node-15.10.0): update to match --- packages/node-15.10.0/build.sh | 9 +-------- packages/node-15.10.0/metadata.json | 1 - 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/packages/node-15.10.0/build.sh b/packages/node-15.10.0/build.sh index 0c64523..25d419d 100755 --- a/packages/node-15.10.0/build.sh +++ b/packages/node-15.10.0/build.sh @@ -1,11 +1,4 @@ #!/bin/bash - -mkdir -p build output - -cd build - curl "https://nodejs.org/dist/v15.10.0/node-v15.10.0-linux-x64.tar.xz" -o node.tar.xz tar xf node.tar.xz --strip-components=1 - -cd .. -mv build/bin/node output \ No newline at end of file +rm node.tar.xz \ No newline at end of file diff --git a/packages/node-15.10.0/metadata.json b/packages/node-15.10.0/metadata.json index 793142c..972f4f2 100644 --- a/packages/node-15.10.0/metadata.json +++ b/packages/node-15.10.0/metadata.json @@ -2,6 +2,5 @@ "language": "node", "version": "15.10.0", "author": "Martin Kos ", - "dependencies": {}, "aliases": ["node-javascript", "node-js", "javascript", "js"] } \ No newline at end of file From a24770e43a368d0f15afd8b0fa01c074c6eb0296 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 6 Mar 2021 19:38:52 +1300 Subject: [PATCH 132/385] pkg(python-3.9.1): match new build system --- packages/python-3.9.1/build.sh | 15 +++------------ packages/python-3.9.1/environment | 2 +- packages/python-3.9.1/metadata.json | 1 - 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/packages/python-3.9.1/build.sh b/packages/python-3.9.1/build.sh index 83e0873..1ee0843 100755 --- a/packages/python-3.9.1/build.sh +++ b/packages/python-3.9.1/build.sh @@ -1,19 +1,10 @@ #!/bin/bash -mkdir -p build/tmp build/python -cd build - curl "https://www.python.org/ftp/python/3.9.1/Python-3.9.1.tgz" -o python.tar.gz -tar xzf python.tar.gz --strip-components=1 -C python - -cd python - +tar xzf python.tar.gz --strip-components=1 +rm python.tar.gz ./configure --prefix /piston/packages/python/3.9.1/python-3.9.1 make -j$(nproc) -DESTDIR=build/tmp make altinstall -j$(nproc) - - -mv build/tmp/piston/packages/python/3.9.1/python-3.9.1 ../../output - +ln -s python python3.9 diff --git a/packages/python-3.9.1/environment b/packages/python-3.9.1/environment index bd0ff98..98fd770 100644 --- a/packages/python-3.9.1/environment +++ b/packages/python-3.9.1/environment @@ -1 +1 @@ -export PATH=$PWD/bin:$PATH \ No newline at end of file +export PATH=$PWD:$PATH \ No newline at end of file diff --git a/packages/python-3.9.1/metadata.json b/packages/python-3.9.1/metadata.json index 98c33ed..306c376 100644 --- a/packages/python-3.9.1/metadata.json +++ b/packages/python-3.9.1/metadata.json @@ -2,6 +2,5 @@ "language": "python", "version": "3.9.1", "author": "Thomas Hobson ", - "dependencies": {}, "aliases": ["py", "python3"] } \ No newline at end of file From 3a1e99436a827dddfd2e2a6258f1875a542d4db9 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 6 Mar 2021 19:42:18 +1300 Subject: [PATCH 133/385] pkg(mono-6.12.0): update to match --- packages/mono-6.12.0/build.sh | 5 ++++- packages/mono-6.12.0/environment | 2 +- packages/mono-6.12.0/metadata.json | 1 - 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/mono-6.12.0/build.sh b/packages/mono-6.12.0/build.sh index 52ac46a..59fb3ad 100755 --- a/packages/mono-6.12.0/build.sh +++ b/packages/mono-6.12.0/build.sh @@ -13,4 +13,7 @@ cd mono make -j$(nproc) DESTDIR=build/tmp make install -j$(nproc) -mv build/tmp/piston/packages/mono/6.12.0/mono-6.12.0 ../../output +mv build/tmp/piston/packages/mono/6.12.0/mono-6.12.0 ../../mono-6.12.0 + +cd ../../ +rm -rf build diff --git a/packages/mono-6.12.0/environment b/packages/mono-6.12.0/environment index 98fd770..03bbb35 100644 --- a/packages/mono-6.12.0/environment +++ b/packages/mono-6.12.0/environment @@ -1 +1 @@ -export PATH=$PWD:$PATH \ No newline at end of file +export PATH=$PWD/mono-6.12.0:$PATH \ No newline at end of file diff --git a/packages/mono-6.12.0/metadata.json b/packages/mono-6.12.0/metadata.json index 24837d9..a7c979b 100644 --- a/packages/mono-6.12.0/metadata.json +++ b/packages/mono-6.12.0/metadata.json @@ -2,6 +2,5 @@ "language": "mono", "version": "6.12.0", "author": "Thomas Hobson ", - "dependencies": {}, "aliases": ["csharp", "cs"] } \ No newline at end of file From 92149030619c6c44c8683a66bd61aa67f8dafb74 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 6 Mar 2021 19:43:09 +1300 Subject: [PATCH 134/385] pkg(php-8.0.2): update to match --- packages/php-8.0.2/build.sh | 2 +- packages/php-8.0.2/environment | 2 +- packages/php-8.0.2/metadata.json | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/php-8.0.2/build.sh b/packages/php-8.0.2/build.sh index 9d5f5c7..ba78728 100755 --- a/packages/php-8.0.2/build.sh +++ b/packages/php-8.0.2/build.sh @@ -15,6 +15,6 @@ make -j$(nproc) INSTALL_ROOT=build/tmp make install -j$(nproc) -mv build/tmp/piston/packages/php/8.0.2/php-8.0.2 ../../output +mv build/tmp/piston/packages/php/8.0.2/php-8.0.2 ../../php-8.0.2 diff --git a/packages/php-8.0.2/environment b/packages/php-8.0.2/environment index bd0ff98..153022d 100644 --- a/packages/php-8.0.2/environment +++ b/packages/php-8.0.2/environment @@ -1 +1 @@ -export PATH=$PWD/bin:$PATH \ No newline at end of file +export PATH=$PWD/php-8.0.2/bin:$PATH \ No newline at end of file diff --git a/packages/php-8.0.2/metadata.json b/packages/php-8.0.2/metadata.json index 35ff122..2da0ef9 100644 --- a/packages/php-8.0.2/metadata.json +++ b/packages/php-8.0.2/metadata.json @@ -2,6 +2,5 @@ "language": "php", "version": "8.0.2", "author": "Martin Kos ", - "dependencies": {}, "aliases": ["php8","html"] } \ No newline at end of file From dca8fcaaae1a946a29d69f0759dcecf3a20d042d Mon Sep 17 00:00:00 2001 From: Brian Seymour Date: Sat, 6 Mar 2021 12:05:28 -0600 Subject: [PATCH 135/385] move docs to var --- README.MD => readme.md | 6 +++--- {docs => var/docs}/images/icon_circle.svg | 0 2 files changed, 3 insertions(+), 3 deletions(-) rename README.MD => readme.md (97%) rename {docs => var/docs}/images/icon_circle.svg (100%) diff --git a/README.MD b/readme.md similarity index 97% rename from README.MD rename to readme.md index bc40f1c..e671b93 100644 --- a/README.MD +++ b/readme.md @@ -1,5 +1,5 @@

- engineer-man piston + engineer-man piston Piston

@@ -208,7 +208,7 @@ Content-Type: application/json
-+<]>------.----. \ No newline at end of file From 8f71c8f4a779975069e85d1642b1b356757c1359 Mon Sep 17 00:00:00 2001 From: Shivansh-007 Date: Wed, 17 Mar 2021 15:12:32 +0530 Subject: [PATCH 284/385] pkg(lua-5.4.2): Add lua 5.4.2 --- packages/lua/5.4.2/build.sh | 14 ++++++++++++++ packages/lua/5.4.2/environment | 4 ++++ packages/lua/5.4.2/metadata.json | 6 ++++++ packages/lua/5.4.2/run | 4 ++++ packages/lua/5.4.2/test.lua | 1 + 5 files changed, 29 insertions(+) create mode 100755 packages/lua/5.4.2/build.sh create mode 100644 packages/lua/5.4.2/environment create mode 100644 packages/lua/5.4.2/metadata.json create mode 100644 packages/lua/5.4.2/run create mode 100644 packages/lua/5.4.2/test.lua diff --git a/packages/lua/5.4.2/build.sh b/packages/lua/5.4.2/build.sh new file mode 100755 index 0000000..8b02f7d --- /dev/null +++ b/packages/lua/5.4.2/build.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +# Put instructions to build your package in here +curl -R -O -L http://www.lua.org/ftp/lua-5.4.2.tar.gz +tar zxf lua-5.4.2.tar.gz +rm lua-5.4.2.tar.gz + +cd lua-5.4.2 +# Building Lua +make linux +# To check that Lua has been built correctly +make test +# Installing Lua +make linux install diff --git a/packages/lua/5.4.2/environment b/packages/lua/5.4.2/environment new file mode 100644 index 0000000..780b668 --- /dev/null +++ b/packages/lua/5.4.2/environment @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# Put 'export' statements here for environment variables +export PATH=$PWD/bin:$PATH diff --git a/packages/lua/5.4.2/metadata.json b/packages/lua/5.4.2/metadata.json new file mode 100644 index 0000000..401c03a --- /dev/null +++ b/packages/lua/5.4.2/metadata.json @@ -0,0 +1,6 @@ +{ + "language": "lua", + "version": "5.4.2", + "author": "Shivansh-007 ", + "aliases": ["lua"] +} \ No newline at end of file diff --git a/packages/lua/5.4.2/run b/packages/lua/5.4.2/run new file mode 100644 index 0000000..d23038b --- /dev/null +++ b/packages/lua/5.4.2/run @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# Put instructions to run the runtime +lua "$@" diff --git a/packages/lua/5.4.2/test.lua b/packages/lua/5.4.2/test.lua new file mode 100644 index 0000000..3f2688f --- /dev/null +++ b/packages/lua/5.4.2/test.lua @@ -0,0 +1 @@ +print("OK") \ No newline at end of file From 6b64c4bb5fa2619a8b344968a4a4abfffdccd8a8 Mon Sep 17 00:00:00 2001 From: Shivansh-007 <69356296+Shivansh-007@users.noreply.github.com> Date: Wed, 17 Mar 2021 15:46:35 +0530 Subject: [PATCH 285/385] pkg(lua-5.4.2): Fix path in environment --- packages/lua/5.4.2/environment | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/lua/5.4.2/environment b/packages/lua/5.4.2/environment index 780b668..2b26fe3 100644 --- a/packages/lua/5.4.2/environment +++ b/packages/lua/5.4.2/environment @@ -1,4 +1,4 @@ #!/usr/bin/env bash # Put 'export' statements here for environment variables -export PATH=$PWD/bin:$PATH +export PATH="lua-5.4.2/src" From cb5ad603d0d60f64dea9b163d5c56e5b13cec6b8 Mon Sep 17 00:00:00 2001 From: "Vargas, Dan" Date: Wed, 17 Mar 2021 12:29:10 -0500 Subject: [PATCH 286/385] pkg(haskell-9.0.1): Add deps to api container --- api/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/Dockerfile b/api/Dockerfile index db35ff7..6a1156d 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -5,7 +5,7 @@ RUN for i in $(seq 1001 1500); do \ useradd -M runner$i -g $i -u $i ; \ done RUN apt-get update && \ - apt-get install -y libxml2 gnupg tar coreutils util-linux libc6-dev binutils build-essential locales libpcre3-dev libevent-dev && \ + apt-get install -y libxml2 gnupg tar coreutils util-linux libc6-dev binutils build-essential locales libpcre3-dev libevent-dev libgmp3-dev && \ rm -rf /var/lib/apt/lists/* RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen From fdf236a789f94c4a2148ce6b4131559f1030b94d Mon Sep 17 00:00:00 2001 From: "Vargas, Dan" Date: Wed, 17 Mar 2021 12:35:16 -0500 Subject: [PATCH 287/385] pkg(haskell-9.0.1): Add haskell 9.0.1 --- packages/haskell/9.0.1/build.sh | 19 +++++++++++++++++++ packages/haskell/9.0.1/compile | 5 +++++ packages/haskell/9.0.1/environment | 1 + packages/haskell/9.0.1/metadata.json | 6 ++++++ packages/haskell/9.0.1/run | 4 ++++ packages/haskell/9.0.1/test.hs | 1 + 6 files changed, 36 insertions(+) create mode 100755 packages/haskell/9.0.1/build.sh create mode 100644 packages/haskell/9.0.1/compile create mode 100644 packages/haskell/9.0.1/environment create mode 100644 packages/haskell/9.0.1/metadata.json create mode 100644 packages/haskell/9.0.1/run create mode 100644 packages/haskell/9.0.1/test.hs diff --git a/packages/haskell/9.0.1/build.sh b/packages/haskell/9.0.1/build.sh new file mode 100755 index 0000000..50d63c2 --- /dev/null +++ b/packages/haskell/9.0.1/build.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +PREFIX=$(realpath $(dirname $0)) + +mkdir -p build + +cd build + +# Platform specific because a true source compile would require GHC to be installed already on the latest +curl -L "https://downloads.haskell.org/~ghc/9.0.1/ghc-9.0.1-x86_64-deb10-linux.tar.xz" -o ghc.tar.xz +tar xf ghc.tar.xz --strip-components=1 +rm ghc.tar.xz + +./configure --prefix="$PREFIX" +make install -j$(nproc) + +cd ../ + +rm -rf build diff --git a/packages/haskell/9.0.1/compile b/packages/haskell/9.0.1/compile new file mode 100644 index 0000000..2dd42e9 --- /dev/null +++ b/packages/haskell/9.0.1/compile @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +# Compile haskell file(s) +ghc -dynamic -v0 -o out "$@" +chmod +x out diff --git a/packages/haskell/9.0.1/environment b/packages/haskell/9.0.1/environment new file mode 100644 index 0000000..bd0ff98 --- /dev/null +++ b/packages/haskell/9.0.1/environment @@ -0,0 +1 @@ +export PATH=$PWD/bin:$PATH \ No newline at end of file diff --git a/packages/haskell/9.0.1/metadata.json b/packages/haskell/9.0.1/metadata.json new file mode 100644 index 0000000..c6fae6d --- /dev/null +++ b/packages/haskell/9.0.1/metadata.json @@ -0,0 +1,6 @@ +{ + "language": "haskell", + "version": "9.0.1", + "author": "Dan Vargas ", + "aliases": ["haskell", "hs"] +} \ No newline at end of file diff --git a/packages/haskell/9.0.1/run b/packages/haskell/9.0.1/run new file mode 100644 index 0000000..6955ba9 --- /dev/null +++ b/packages/haskell/9.0.1/run @@ -0,0 +1,4 @@ +#!/bin/bash + +shift # Filename is only used to compile +./out "$@" diff --git a/packages/haskell/9.0.1/test.hs b/packages/haskell/9.0.1/test.hs new file mode 100644 index 0000000..a8dd75a --- /dev/null +++ b/packages/haskell/9.0.1/test.hs @@ -0,0 +1 @@ +main = putStrLn "OK" \ No newline at end of file From 992a5f52fcb74d1063b43a018f9a2946f977a261 Mon Sep 17 00:00:00 2001 From: Victor Frazao Date: Wed, 17 Mar 2021 18:26:59 -0400 Subject: [PATCH 288/385] pkg(rust-1.50.0): Fix run file to remove filename from being passed to binary --- packages/rust/1.50.0/run | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/rust/1.50.0/run b/packages/rust/1.50.0/run index f66526f..d377dd9 100644 --- a/packages/rust/1.50.0/run +++ b/packages/rust/1.50.0/run @@ -1,3 +1,4 @@ #!/usr/bin/env bash +shift ./binary "$@" From 09c9c13d07e1fb6a13dcf34d9decd279432c5412 Mon Sep 17 00:00:00 2001 From: "Vargas, Dan" Date: Wed, 17 Mar 2021 18:10:35 -0500 Subject: [PATCH 289/385] pkg(lisp-2.1.2): Add lisp (SBCL) 2.1.2 --- packages/lisp/2.1.2/build.sh | 19 +++++++++++++++++++ packages/lisp/2.1.2/environment | 4 ++++ packages/lisp/2.1.2/metadata.json | 6 ++++++ packages/lisp/2.1.2/run | 4 ++++ packages/lisp/2.1.2/test.cl | 1 + 5 files changed, 34 insertions(+) create mode 100755 packages/lisp/2.1.2/build.sh create mode 100644 packages/lisp/2.1.2/environment create mode 100644 packages/lisp/2.1.2/metadata.json create mode 100644 packages/lisp/2.1.2/run create mode 100644 packages/lisp/2.1.2/test.cl diff --git a/packages/lisp/2.1.2/build.sh b/packages/lisp/2.1.2/build.sh new file mode 100755 index 0000000..37f1f8a --- /dev/null +++ b/packages/lisp/2.1.2/build.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +# Put instructions to build your package in here +PREFIX=$(realpath $(dirname $0)) + +mkdir -p build + +cd build + +# Prebuilt binary install since source compile requires lisp to be installed already +curl -L "http://prdownloads.sourceforge.net/sbcl/sbcl-2.1.2-x86-64-linux-binary.tar.bz2" -o sbcl.tar.bz2 +tar xf sbcl.tar.bz2 --strip-components=1 +rm sbcl.tar.bz2 + +INSTALL_ROOT=$PREFIX sh install.sh + +cd ../ + +rm -rf build diff --git a/packages/lisp/2.1.2/environment b/packages/lisp/2.1.2/environment new file mode 100644 index 0000000..780b668 --- /dev/null +++ b/packages/lisp/2.1.2/environment @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# Put 'export' statements here for environment variables +export PATH=$PWD/bin:$PATH diff --git a/packages/lisp/2.1.2/metadata.json b/packages/lisp/2.1.2/metadata.json new file mode 100644 index 0000000..fd35513 --- /dev/null +++ b/packages/lisp/2.1.2/metadata.json @@ -0,0 +1,6 @@ +{ + "language": "lisp", + "version": "2.1.2", + "aliases": ["lisp","cl","sbcl","commonlisp"], + "author": "Dan Vargas " +} diff --git a/packages/lisp/2.1.2/run b/packages/lisp/2.1.2/run new file mode 100644 index 0000000..74a5cf3 --- /dev/null +++ b/packages/lisp/2.1.2/run @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# Put instructions to run the runtime +sbcl --script "$@" diff --git a/packages/lisp/2.1.2/test.cl b/packages/lisp/2.1.2/test.cl new file mode 100644 index 0000000..1de92b7 --- /dev/null +++ b/packages/lisp/2.1.2/test.cl @@ -0,0 +1 @@ +(write-line "OK") \ No newline at end of file From 599b1f793d03ae1246badd874e41f30ffe29b585 Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Wed, 17 Mar 2021 20:49:21 -0500 Subject: [PATCH 290/385] pkg(nim-1.4.4): Add nim 1.4.4 --- packages/nim/1.4.4/build.sh | 18 ++++++++++++++++++ packages/nim/1.4.4/compile | 5 +++++ packages/nim/1.4.4/environment | 1 + packages/nim/1.4.4/metadata.json | 6 ++++++ packages/nim/1.4.4/run | 4 ++++ packages/nim/1.4.4/test.nim | 1 + 6 files changed, 35 insertions(+) create mode 100755 packages/nim/1.4.4/build.sh create mode 100644 packages/nim/1.4.4/compile create mode 100644 packages/nim/1.4.4/environment create mode 100644 packages/nim/1.4.4/metadata.json create mode 100644 packages/nim/1.4.4/run create mode 100644 packages/nim/1.4.4/test.nim diff --git a/packages/nim/1.4.4/build.sh b/packages/nim/1.4.4/build.sh new file mode 100755 index 0000000..1bb0bee --- /dev/null +++ b/packages/nim/1.4.4/build.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +PREFIX=$(realpath $(dirname $0)) + +mkdir -p build + +cd build + +# Prebuilt binary - source *can* be built, but it requires gcc +curl -L "https://nim-lang.org/download/nim-1.4.4-linux_x64.tar.xz" -o nim.tar.xz +tar xf nim.tar.xz --strip-components=1 +rm nim.tar.xz + +./install.sh "$PREFIX" + +cd ../ + +rm -rf build diff --git a/packages/nim/1.4.4/compile b/packages/nim/1.4.4/compile new file mode 100644 index 0000000..91dc0ba --- /dev/null +++ b/packages/nim/1.4.4/compile @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +# Compile nim file(s) +nim --hints:off --out:out --nimcache:./ c "$@" +chmod +x out diff --git a/packages/nim/1.4.4/environment b/packages/nim/1.4.4/environment new file mode 100644 index 0000000..872a1f3 --- /dev/null +++ b/packages/nim/1.4.4/environment @@ -0,0 +1 @@ +export PATH=$PWD/nim/bin:$PATH \ No newline at end of file diff --git a/packages/nim/1.4.4/metadata.json b/packages/nim/1.4.4/metadata.json new file mode 100644 index 0000000..6f88382 --- /dev/null +++ b/packages/nim/1.4.4/metadata.json @@ -0,0 +1,6 @@ +{ + "language": "nim", + "version": "1.4.4", + "author": "Dan Vargas ", + "aliases": ["nim"] +} \ No newline at end of file diff --git a/packages/nim/1.4.4/run b/packages/nim/1.4.4/run new file mode 100644 index 0000000..6955ba9 --- /dev/null +++ b/packages/nim/1.4.4/run @@ -0,0 +1,4 @@ +#!/bin/bash + +shift # Filename is only used to compile +./out "$@" diff --git a/packages/nim/1.4.4/test.nim b/packages/nim/1.4.4/test.nim new file mode 100644 index 0000000..6c57628 --- /dev/null +++ b/packages/nim/1.4.4/test.nim @@ -0,0 +1 @@ +echo("OK") \ No newline at end of file From b8aa60c4ab511708e16bbe23a4a156838aaedb25 Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Wed, 17 Mar 2021 22:04:43 -0500 Subject: [PATCH 291/385] pkg(osabie-1.0.1): Fix osabie args --- packages/osabie/1.0.1/run | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/osabie/1.0.1/run b/packages/osabie/1.0.1/run index 2f99ab0..fde91e3 100644 --- a/packages/osabie/1.0.1/run +++ b/packages/osabie/1.0.1/run @@ -1,4 +1,4 @@ #!/bin/bash -# Put instructions to run the runtime -osabie "$@" \ No newline at end of file +# osabie only takes filename and stdin +osabie "$1" \ No newline at end of file From 50c4e0fae566ed396f52bfb26f2e1780bacdb207 Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Wed, 17 Mar 2021 21:56:33 -0500 Subject: [PATCH 292/385] pkg(paradoc-0.6.0): Add paradoc 0.6.0 --- packages/paradoc/0.6.0/build.sh | 5 +++++ packages/paradoc/0.6.0/environment | 2 ++ packages/paradoc/0.6.0/metadata.json | 6 ++++++ packages/paradoc/0.6.0/run | 4 ++++ packages/paradoc/0.6.0/test.paradoc | 1 + 5 files changed, 18 insertions(+) create mode 100755 packages/paradoc/0.6.0/build.sh create mode 100644 packages/paradoc/0.6.0/environment create mode 100644 packages/paradoc/0.6.0/metadata.json create mode 100644 packages/paradoc/0.6.0/run create mode 100644 packages/paradoc/0.6.0/test.paradoc diff --git a/packages/paradoc/0.6.0/build.sh b/packages/paradoc/0.6.0/build.sh new file mode 100755 index 0000000..d3801b9 --- /dev/null +++ b/packages/paradoc/0.6.0/build.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +source ../../python/3.9.1/build.sh + +git clone -q https://github.com/betaveros/paradoc.git paradoc diff --git a/packages/paradoc/0.6.0/environment b/packages/paradoc/0.6.0/environment new file mode 100644 index 0000000..4ca7a04 --- /dev/null +++ b/packages/paradoc/0.6.0/environment @@ -0,0 +1,2 @@ +export PYTHONPATH=$PYTHONPATH:$PWD/paradoc +export PATH=$PWD/bin:$PATH \ No newline at end of file diff --git a/packages/paradoc/0.6.0/metadata.json b/packages/paradoc/0.6.0/metadata.json new file mode 100644 index 0000000..8037f2a --- /dev/null +++ b/packages/paradoc/0.6.0/metadata.json @@ -0,0 +1,6 @@ +{ + "language": "paradoc", + "version": "0.6.0", + "author": "Dan Vargas ", + "aliases": ["paradoc"] +} \ No newline at end of file diff --git a/packages/paradoc/0.6.0/run b/packages/paradoc/0.6.0/run new file mode 100644 index 0000000..718ee98 --- /dev/null +++ b/packages/paradoc/0.6.0/run @@ -0,0 +1,4 @@ +#!/bin/bash + +# Paradoc only takes filename and stdin +python3 -m paradoc "$1" diff --git a/packages/paradoc/0.6.0/test.paradoc b/packages/paradoc/0.6.0/test.paradoc new file mode 100644 index 0000000..45021e7 --- /dev/null +++ b/packages/paradoc/0.6.0/test.paradoc @@ -0,0 +1 @@ +"OK" \ No newline at end of file From 7f07024129196ea18db0eabeb297ba43b210091b Mon Sep 17 00:00:00 2001 From: Shivansh-007 <69356296+Shivansh-007@users.noreply.github.com> Date: Thu, 18 Mar 2021 09:07:59 +0530 Subject: [PATCH 293/385] pkg(lua-5.4.2): Add PATH to indicate we are chaining them. PATH is a list of paths the shell should look for the binary. --- packages/lua/5.4.2/environment | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/lua/5.4.2/environment b/packages/lua/5.4.2/environment index 2b26fe3..5d94f5c 100644 --- a/packages/lua/5.4.2/environment +++ b/packages/lua/5.4.2/environment @@ -1,4 +1,4 @@ #!/usr/bin/env bash # Put 'export' statements here for environment variables -export PATH="lua-5.4.2/src" +export PATH="lua-5.4.2/src:$PATH" From 3c60ae75037e41389b53dedec1ce2e94c54aa7c8 Mon Sep 17 00:00:00 2001 From: Shivansh-007 <69356296+Shivansh-007@users.noreply.github.com> Date: Thu, 18 Mar 2021 09:56:40 +0530 Subject: [PATCH 294/385] pkg(lua-5.4.2): Add PWD before specifying the path --- packages/lua/5.4.2/environment | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/lua/5.4.2/environment b/packages/lua/5.4.2/environment index 5d94f5c..936b3b6 100644 --- a/packages/lua/5.4.2/environment +++ b/packages/lua/5.4.2/environment @@ -1,4 +1,4 @@ #!/usr/bin/env bash # Put 'export' statements here for environment variables -export PATH="lua-5.4.2/src:$PATH" +export PATH="$PWD/lua-5.4.2/src:$PATH" From 7744eea4595eb26c13128bca276846d1f634c6cb Mon Sep 17 00:00:00 2001 From: Shivansh-007 Date: Thu, 18 Mar 2021 12:48:28 +0530 Subject: [PATCH 295/385] pkg(lolcode-0.11.2): Add lolcode 0.11.2 --- packages/lolcode/0.11.2/build.sh | 13 +++++++++++++ packages/lolcode/0.11.2/environment | 4 ++++ packages/lolcode/0.11.2/metadata.json | 6 ++++++ packages/lolcode/0.11.2/run | 4 ++++ packages/lolcode/0.11.2/test.lol | 4 ++++ 5 files changed, 31 insertions(+) create mode 100755 packages/lolcode/0.11.2/build.sh create mode 100644 packages/lolcode/0.11.2/environment create mode 100644 packages/lolcode/0.11.2/metadata.json create mode 100644 packages/lolcode/0.11.2/run create mode 100644 packages/lolcode/0.11.2/test.lol diff --git a/packages/lolcode/0.11.2/build.sh b/packages/lolcode/0.11.2/build.sh new file mode 100755 index 0000000..33ed9f8 --- /dev/null +++ b/packages/lolcode/0.11.2/build.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +PREFIX=$(realpath $(dirname $0)) + +# Cloning lolcode source +git clone https://github.com/justinmeza/lci.git lolcode +cd lolcode + +# Building and installing lolcode +./install.py --prefix="$PREFIX" + +# Cleaning up +cd ../ && rm -rf lolcode \ No newline at end of file diff --git a/packages/lolcode/0.11.2/environment b/packages/lolcode/0.11.2/environment new file mode 100644 index 0000000..780b668 --- /dev/null +++ b/packages/lolcode/0.11.2/environment @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# Put 'export' statements here for environment variables +export PATH=$PWD/bin:$PATH diff --git a/packages/lolcode/0.11.2/metadata.json b/packages/lolcode/0.11.2/metadata.json new file mode 100644 index 0000000..80e46ea --- /dev/null +++ b/packages/lolcode/0.11.2/metadata.json @@ -0,0 +1,6 @@ +{ + "language": "lolcode", + "version": "0.11.2", + "author": "Shivansh-007 ", + "aliases": ["lol", "lci"] +} diff --git a/packages/lolcode/0.11.2/run b/packages/lolcode/0.11.2/run new file mode 100644 index 0000000..ce329fb --- /dev/null +++ b/packages/lolcode/0.11.2/run @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# Put instructions to run the runtime +lolcode "$@" diff --git a/packages/lolcode/0.11.2/test.lol b/packages/lolcode/0.11.2/test.lol new file mode 100644 index 0000000..f93f722 --- /dev/null +++ b/packages/lolcode/0.11.2/test.lol @@ -0,0 +1,4 @@ +HAI 1.2 + CAN HAS STDIO? + VISIBLE "OK" +KTHXBYE From d50403230caaa0f026f5251346a501de7c5a6c4c Mon Sep 17 00:00:00 2001 From: "Vargas, Dan" Date: Thu, 18 Mar 2021 09:13:02 -0500 Subject: [PATCH 296/385] pkg(prolog-8.2.4): Add deps for prolog --- api/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/Dockerfile b/api/Dockerfile index 6a1156d..62b6d24 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -5,7 +5,7 @@ RUN for i in $(seq 1001 1500); do \ useradd -M runner$i -g $i -u $i ; \ done RUN apt-get update && \ - apt-get install -y libxml2 gnupg tar coreutils util-linux libc6-dev binutils build-essential locales libpcre3-dev libevent-dev libgmp3-dev && \ + apt-get install -y libxml2 gnupg tar coreutils util-linux libc6-dev binutils build-essential locales libpcre3-dev libevent-dev libgmp3-dev libncurses6 && \ rm -rf /var/lib/apt/lists/* RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen From d5723a11d2b891509b2fbad1e53a8751ff7f2950 Mon Sep 17 00:00:00 2001 From: "Vargas, Dan" Date: Thu, 18 Mar 2021 09:20:37 -0500 Subject: [PATCH 297/385] pkg(prolog-8.2.4): Add prolog 8.2.4 --- packages/prolog/8.2.4/build.sh | 22 ++++++++++++++++++++++ packages/prolog/8.2.4/environment | 1 + packages/prolog/8.2.4/metadata.json | 6 ++++++ packages/prolog/8.2.4/run | 4 ++++ packages/prolog/8.2.4/test.prolog | 1 + 5 files changed, 34 insertions(+) create mode 100755 packages/prolog/8.2.4/build.sh create mode 100644 packages/prolog/8.2.4/environment create mode 100644 packages/prolog/8.2.4/metadata.json create mode 100644 packages/prolog/8.2.4/run create mode 100644 packages/prolog/8.2.4/test.prolog diff --git a/packages/prolog/8.2.4/build.sh b/packages/prolog/8.2.4/build.sh new file mode 100755 index 0000000..3473d69 --- /dev/null +++ b/packages/prolog/8.2.4/build.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +PREFIX=$(realpath $(dirname $0)) + +mkdir -p build + +cd build + +# Source compile +curl -L "https://www.swi-prolog.org/download/stable/src/swipl-8.2.4.tar.gz" -o swipl.tar.gz +tar xzf swipl.tar.gz --strip-components=1 +rm swipl.tar.gz + +mkdir build +cd build +cmake -DCMAKE_INSTALL_PREFIX="$PREFIX" -DSWIPL_PACKAGES_JAVA=OFF -DSWIPL_PACKAGES_X=OFF -DMULTI_THREADED=OFF -DINSTALL_DOCUMENTATION=OFF .. +make -j$(nproc) +make install -j$(nproc) + +cd ../../ + +rm -rf build diff --git a/packages/prolog/8.2.4/environment b/packages/prolog/8.2.4/environment new file mode 100644 index 0000000..bd0ff98 --- /dev/null +++ b/packages/prolog/8.2.4/environment @@ -0,0 +1 @@ +export PATH=$PWD/bin:$PATH \ No newline at end of file diff --git a/packages/prolog/8.2.4/metadata.json b/packages/prolog/8.2.4/metadata.json new file mode 100644 index 0000000..8238856 --- /dev/null +++ b/packages/prolog/8.2.4/metadata.json @@ -0,0 +1,6 @@ +{ + "language": "prolog", + "version": "8.2.4", + "aliases": ["prolog","plg"], + "author": "Dan Vargas " +} diff --git a/packages/prolog/8.2.4/run b/packages/prolog/8.2.4/run new file mode 100644 index 0000000..7609191 --- /dev/null +++ b/packages/prolog/8.2.4/run @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# Put instructions to run the runtime +swipl -g true -t halt "$@" diff --git a/packages/prolog/8.2.4/test.prolog b/packages/prolog/8.2.4/test.prolog new file mode 100644 index 0000000..290ef7c --- /dev/null +++ b/packages/prolog/8.2.4/test.prolog @@ -0,0 +1 @@ +:- write('OK'), nl. \ No newline at end of file From 389c9be86ccb2b6a553930ff2896706d287b2d48 Mon Sep 17 00:00:00 2001 From: "Vargas, Dan" Date: Thu, 18 Mar 2021 13:34:03 -0500 Subject: [PATCH 298/385] pkg(scala-3.0.0): Add scala 3.0.0 --- packages/scala/3.0.0/build.sh | 16 ++++++++++++++++ packages/scala/3.0.0/environment | 5 +++++ packages/scala/3.0.0/metadata.json | 6 ++++++ packages/scala/3.0.0/run | 4 ++++ packages/scala/3.0.0/test.scala | 3 +++ 5 files changed, 34 insertions(+) create mode 100755 packages/scala/3.0.0/build.sh create mode 100644 packages/scala/3.0.0/environment create mode 100644 packages/scala/3.0.0/metadata.json create mode 100644 packages/scala/3.0.0/run create mode 100644 packages/scala/3.0.0/test.scala diff --git a/packages/scala/3.0.0/build.sh b/packages/scala/3.0.0/build.sh new file mode 100755 index 0000000..0a3fcf7 --- /dev/null +++ b/packages/scala/3.0.0/build.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +# Scala depends on Java +mkdir -p java +cd java +curl "https://download.java.net/java/GA/jdk15.0.2/0d1cfde4252546c6931946de8db48ee2/7/GPL/openjdk-15.0.2_linux-x64_bin.tar.gz" -o java.tar.gz +tar xzf java.tar.gz --strip-components=1 +rm java.tar.gz +cd .. + +mkdir -p scala +cd scala +curl -L "https://github.com/lampepfl/dotty/releases/download/3.0.0-RC1/scala3-3.0.0-RC1.tar.gz" -o scala.tar.gz +tar -xzf scala.tar.gz --strip-components=1 +rm scala.tar.gz +cd .. diff --git a/packages/scala/3.0.0/environment b/packages/scala/3.0.0/environment new file mode 100644 index 0000000..40244a6 --- /dev/null +++ b/packages/scala/3.0.0/environment @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +# Scala requires JAVA_HOME to be set +export JAVA_HOME=$PWD/java +export PATH=$PWD/scala/bin:$PATH diff --git a/packages/scala/3.0.0/metadata.json b/packages/scala/3.0.0/metadata.json new file mode 100644 index 0000000..6227bb9 --- /dev/null +++ b/packages/scala/3.0.0/metadata.json @@ -0,0 +1,6 @@ +{ + "language": "scala", + "version": "3.0.0", + "aliases": ["scala","sc"], + "author": "Dan Vargas " +} diff --git a/packages/scala/3.0.0/run b/packages/scala/3.0.0/run new file mode 100644 index 0000000..e8bd3c2 --- /dev/null +++ b/packages/scala/3.0.0/run @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# Put instructions to run the runtime +scala -color never "$@" diff --git a/packages/scala/3.0.0/test.scala b/packages/scala/3.0.0/test.scala new file mode 100644 index 0000000..bf4cabc --- /dev/null +++ b/packages/scala/3.0.0/test.scala @@ -0,0 +1,3 @@ +@main def run(): Unit = { + println("OK") +} \ No newline at end of file From aa0a7ac35f4806ef7378e4b165f46455b482ecc9 Mon Sep 17 00:00:00 2001 From: "Vargas, Dan" Date: Thu, 18 Mar 2021 15:08:51 -0500 Subject: [PATCH 299/385] pkg(swift-5.3.3): Add deps for swift --- api/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/Dockerfile b/api/Dockerfile index 62b6d24..96e64ef 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -5,7 +5,7 @@ RUN for i in $(seq 1001 1500); do \ useradd -M runner$i -g $i -u $i ; \ done RUN apt-get update && \ - apt-get install -y libxml2 gnupg tar coreutils util-linux libc6-dev binutils build-essential locales libpcre3-dev libevent-dev libgmp3-dev libncurses6 && \ + apt-get install -y libxml2 gnupg tar coreutils util-linux libc6-dev binutils build-essential locales libpcre3-dev libevent-dev libgmp3-dev libncurses6 libncurses5 libedit-dev && \ rm -rf /var/lib/apt/lists/* RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen From 0d1906e1b603fc9ad0831f102290b24cbcf0703a Mon Sep 17 00:00:00 2001 From: "Vargas, Dan" Date: Thu, 18 Mar 2021 15:34:25 -0500 Subject: [PATCH 300/385] pkg(swift-5.3.3): Add swift 5.3.3 --- packages/swift/5.3.3/build.sh | 6 ++++++ packages/swift/5.3.3/environment | 4 ++++ packages/swift/5.3.3/metadata.json | 6 ++++++ packages/swift/5.3.3/run | 4 ++++ packages/swift/5.3.3/test.swift | 1 + 5 files changed, 21 insertions(+) create mode 100755 packages/swift/5.3.3/build.sh create mode 100644 packages/swift/5.3.3/environment create mode 100644 packages/swift/5.3.3/metadata.json create mode 100644 packages/swift/5.3.3/run create mode 100644 packages/swift/5.3.3/test.swift diff --git a/packages/swift/5.3.3/build.sh b/packages/swift/5.3.3/build.sh new file mode 100755 index 0000000..5070b12 --- /dev/null +++ b/packages/swift/5.3.3/build.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +# Binary install +curl -L "https://swift.org/builds/swift-5.3.3-release/ubuntu1804/swift-5.3.3-RELEASE/swift-5.3.3-RELEASE-ubuntu18.04.tar.gz" -o swift.tar.gz +tar xzf swift.tar.gz --strip-components=2 +rm swift.tar.gz diff --git a/packages/swift/5.3.3/environment b/packages/swift/5.3.3/environment new file mode 100644 index 0000000..780b668 --- /dev/null +++ b/packages/swift/5.3.3/environment @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# Put 'export' statements here for environment variables +export PATH=$PWD/bin:$PATH diff --git a/packages/swift/5.3.3/metadata.json b/packages/swift/5.3.3/metadata.json new file mode 100644 index 0000000..679b8da --- /dev/null +++ b/packages/swift/5.3.3/metadata.json @@ -0,0 +1,6 @@ +{ + "language": "swift", + "version": "5.3.3", + "aliases": ["swift"], + "author": "Dan Vargas " +} diff --git a/packages/swift/5.3.3/run b/packages/swift/5.3.3/run new file mode 100644 index 0000000..5d29e87 --- /dev/null +++ b/packages/swift/5.3.3/run @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# Setting clang cache to current dir to avoid permission error on /tmp +swift -module-cache-path . "$@" diff --git a/packages/swift/5.3.3/test.swift b/packages/swift/5.3.3/test.swift new file mode 100644 index 0000000..3f2688f --- /dev/null +++ b/packages/swift/5.3.3/test.swift @@ -0,0 +1 @@ +print("OK") \ No newline at end of file From fb95a4dbc093e2c863113541e342d53034a1d1ba Mon Sep 17 00:00:00 2001 From: "Vargas, Dan" Date: Thu, 18 Mar 2021 16:45:14 -0500 Subject: [PATCH 301/385] pkg(zig-0.7.1): Add zig 0.7.1 --- packages/zig/0.7.1/build.sh | 10 ++++++++++ packages/zig/0.7.1/compile | 4 ++++ packages/zig/0.7.1/environment | 4 ++++ packages/zig/0.7.1/metadata.json | 6 ++++++ packages/zig/0.7.1/run | 4 ++++ packages/zig/0.7.1/test.zig | 6 ++++++ 6 files changed, 34 insertions(+) create mode 100755 packages/zig/0.7.1/build.sh create mode 100644 packages/zig/0.7.1/compile create mode 100644 packages/zig/0.7.1/environment create mode 100644 packages/zig/0.7.1/metadata.json create mode 100644 packages/zig/0.7.1/run create mode 100644 packages/zig/0.7.1/test.zig diff --git a/packages/zig/0.7.1/build.sh b/packages/zig/0.7.1/build.sh new file mode 100755 index 0000000..9714794 --- /dev/null +++ b/packages/zig/0.7.1/build.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +mkdir -p bin +cd bin/ + +curl -L "https://ziglang.org/download/0.7.1/zig-linux-x86_64-0.7.1.tar.xz" -o zig.tar.xz +tar xf zig.tar.xz --strip-components=1 +rm zig.tar.xz + +cd ../ \ No newline at end of file diff --git a/packages/zig/0.7.1/compile b/packages/zig/0.7.1/compile new file mode 100644 index 0000000..af7e9eb --- /dev/null +++ b/packages/zig/0.7.1/compile @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# optimizing for small programs +zig build-exe -O ReleaseSmall --color off --cache-dir . --global-cache-dir . --name out "$@" diff --git a/packages/zig/0.7.1/environment b/packages/zig/0.7.1/environment new file mode 100644 index 0000000..a85000c --- /dev/null +++ b/packages/zig/0.7.1/environment @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# compiler path +export PATH=$PWD/bin:$PATH diff --git a/packages/zig/0.7.1/metadata.json b/packages/zig/0.7.1/metadata.json new file mode 100644 index 0000000..3de611e --- /dev/null +++ b/packages/zig/0.7.1/metadata.json @@ -0,0 +1,6 @@ +{ + "language": "zig", + "version": "0.7.1", + "aliases": ["zig"], + "author": "Dan Vargas " +} diff --git a/packages/zig/0.7.1/run b/packages/zig/0.7.1/run new file mode 100644 index 0000000..d96e06f --- /dev/null +++ b/packages/zig/0.7.1/run @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +shift # Filename is only used in compile step, so we can take it out here +./out "$@" diff --git a/packages/zig/0.7.1/test.zig b/packages/zig/0.7.1/test.zig new file mode 100644 index 0000000..548c703 --- /dev/null +++ b/packages/zig/0.7.1/test.zig @@ -0,0 +1,6 @@ +const std = @import("std"); + +pub fn main() !void { + const stdout = std.io.getStdOut().writer(); + try stdout.print("OK\n", .{}); +} \ No newline at end of file From 228880ba9bda2fcc76f90c6970816902fb384dfc Mon Sep 17 00:00:00 2001 From: Shivansh-007 <69356296+Shivansh-007@users.noreply.github.com> Date: Fri, 19 Mar 2021 03:55:25 +0530 Subject: [PATCH 302/385] pkg(lolcode-0.11.2): Shift to cmake/make rather then running install.py --- packages/lolcode/0.11.2/build.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/lolcode/0.11.2/build.sh b/packages/lolcode/0.11.2/build.sh index 33ed9f8..72a9ea3 100755 --- a/packages/lolcode/0.11.2/build.sh +++ b/packages/lolcode/0.11.2/build.sh @@ -7,7 +7,9 @@ git clone https://github.com/justinmeza/lci.git lolcode cd lolcode # Building and installing lolcode -./install.py --prefix="$PREFIX" +cmake -DCMAKE_INSTALL_PREFIX:STRING="$PREFIX" . +make -j$(nproc) +make install -j$(nproc) # Cleaning up -cd ../ && rm -rf lolcode \ No newline at end of file +cd ../ && rm -rf lolcode From 412e1ec7ee76f97d3412903553983866e98e80fb Mon Sep 17 00:00:00 2001 From: Shivansh-007 <69356296+Shivansh-007@users.noreply.github.com> Date: Fri, 19 Mar 2021 04:05:43 +0530 Subject: [PATCH 303/385] =?UTF-8?q?pkg(lolcode-0.11.2):=20The=20binary=20i?= =?UTF-8?q?s=20"lci"=20not=20"lolcode=E2=80=9D.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/lolcode/0.11.2/run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/lolcode/0.11.2/run b/packages/lolcode/0.11.2/run index ce329fb..d4e6725 100644 --- a/packages/lolcode/0.11.2/run +++ b/packages/lolcode/0.11.2/run @@ -1,4 +1,4 @@ #!/usr/bin/env bash # Put instructions to run the runtime -lolcode "$@" +lci "$@" From a024c9193d05f4d3d509c6d8538ff211e22e81c6 Mon Sep 17 00:00:00 2001 From: Ethan Edwards Date: Thu, 18 Mar 2021 19:45:46 -0400 Subject: [PATCH 304/385] Fix syntax error in shell.nix --- shell.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shell.nix b/shell.nix index f43b1b4..d3c1b54 100644 --- a/shell.nix +++ b/shell.nix @@ -1,5 +1,5 @@ { pkgs ? import {} }: pkgs.mkShell { # nativeBuildInputs is usually what you want -- tools you need to run - nativeBuildInputs = [ pkgs.nodejs-15_x pkgs.yarn pkgs.jq ]; -} \ No newline at end of file + nativeBuildInputs = with pkgs; [ nodejs-15_x yarn jq ]; +} From e57ef95e0276fad3c16f671ca03e858402bb2587 Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Thu, 18 Mar 2021 19:28:35 -0500 Subject: [PATCH 305/385] pkg(emacs-27.1.0): Add emacs 27.1.0 --- packages/emacs/27.1.0/build.sh | 24 ++++++++++++++++++++++++ packages/emacs/27.1.0/environment | 4 ++++ packages/emacs/27.1.0/metadata.json | 6 ++++++ packages/emacs/27.1.0/run | 4 ++++ packages/emacs/27.1.0/test.el | 1 + 5 files changed, 39 insertions(+) create mode 100755 packages/emacs/27.1.0/build.sh create mode 100644 packages/emacs/27.1.0/environment create mode 100644 packages/emacs/27.1.0/metadata.json create mode 100644 packages/emacs/27.1.0/run create mode 100644 packages/emacs/27.1.0/test.el diff --git a/packages/emacs/27.1.0/build.sh b/packages/emacs/27.1.0/build.sh new file mode 100755 index 0000000..a4aecc6 --- /dev/null +++ b/packages/emacs/27.1.0/build.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +export PATH=$PWD/bin:$PATH + +PREFIX=$(realpath $(dirname $0)) + +mkdir -p build + +cd build + +# Emacs version 27.1 supports Docker builds +# Otherwise, older versions will work too, but you will have to disable `/proc/sys/kernel/randomize_va_space` which is less secure +curl -L "http://ftpmirror.gnu.org/emacs/emacs-27.1.tar.gz" -o emacs.tar.gz +tar xzf emacs.tar.gz --strip-components=1 +rm emacs.tar.gz + +# Building without all that X11 stuff +./configure --prefix="$PREFIX" --with-x=no --with-x-toolkit=no --with-xpm=no --with-jpeg=no --with-png=no --with-gif=no --with-tiff=no --with-gnutls=no +make -j$(nproc) +make install -j$(nproc) + +cd .. + +rm -rf build diff --git a/packages/emacs/27.1.0/environment b/packages/emacs/27.1.0/environment new file mode 100644 index 0000000..780b668 --- /dev/null +++ b/packages/emacs/27.1.0/environment @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# Put 'export' statements here for environment variables +export PATH=$PWD/bin:$PATH diff --git a/packages/emacs/27.1.0/metadata.json b/packages/emacs/27.1.0/metadata.json new file mode 100644 index 0000000..bcd3d08 --- /dev/null +++ b/packages/emacs/27.1.0/metadata.json @@ -0,0 +1,6 @@ +{ + "language": "emacs", + "version": "27.1.0", + "author": "Dan Vargas ", + "aliases": ["emacs", "el", "elisp"] +} \ No newline at end of file diff --git a/packages/emacs/27.1.0/run b/packages/emacs/27.1.0/run new file mode 100644 index 0000000..8bf46e4 --- /dev/null +++ b/packages/emacs/27.1.0/run @@ -0,0 +1,4 @@ +#!/bin/bash + +# Put instructions to run the runtime +emacs -Q --script "$@" \ No newline at end of file diff --git a/packages/emacs/27.1.0/test.el b/packages/emacs/27.1.0/test.el new file mode 100644 index 0000000..ebe0215 --- /dev/null +++ b/packages/emacs/27.1.0/test.el @@ -0,0 +1 @@ +(princ "OK") \ No newline at end of file From 90039056492b8989da617d6fd61a4c5cae96095e Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Fri, 19 Mar 2021 22:07:48 +1300 Subject: [PATCH 306/385] pkg(brainfuck-1.0.0): Remove non-working version --- packages/brainfuck/1.0.0/build.sh | 10 ---------- packages/brainfuck/1.0.0/environment | 4 ---- packages/brainfuck/1.0.0/metadata.json | 6 ------ packages/brainfuck/1.0.0/run | 4 ---- packages/brainfuck/1.0.0/test.bf | 1 - 5 files changed, 25 deletions(-) delete mode 100644 packages/brainfuck/1.0.0/build.sh delete mode 100644 packages/brainfuck/1.0.0/environment delete mode 100644 packages/brainfuck/1.0.0/metadata.json delete mode 100644 packages/brainfuck/1.0.0/run delete mode 100644 packages/brainfuck/1.0.0/test.bf diff --git a/packages/brainfuck/1.0.0/build.sh b/packages/brainfuck/1.0.0/build.sh deleted file mode 100644 index abd4a65..0000000 --- a/packages/brainfuck/1.0.0/build.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -echo 'H4sIAAAAAAAAA61XS4/iRhA+m19Rw2gHG9uMiaIcBoyUaKVcNrtSFCkHgqLGbqBnbXfLNjs7nuW/p6ofxjCzh5VyAOzqenz1bu6nI/ikWlGKTlR72NZMVLtj9hlEqQpe8qplrZAVyB3kghU8a2HLGp4D0kbwnlWCF5MG8u1OgN9wDuNf4Quvn6E5yLqFhhe7WFQtr1XN8XscjEbw10E0MCDCgTWor3jGL44H6tg+gKrlvmYlsCo3JGgltAeOVt3RgX3hRN1ytKNYzVrE9STaA9wAn+1nMI5mN2yM/GisgQmboG0JxwaNtKjUYGBZK1BPKXMOijUth2d5rM/2G2N+5oC7g4xVZDmTpRKFM/zx04ePf0LJslpCznei4vlsZKm5aNi24OiqiXcf2ALZWA2FlKoB/+nAaw6T5WqCkS5YlfE8iIw/63gVrsJwudyg0g9nKUBYGJoK+FeeHSkK6BzFEr1RBPxTwffwB+tk9ZnBz/CeZ/BTkvwCcGhb9XB/X5qjGTpzj+xT/LoVVVYcMSbLps0LsZ0dVpc0Ia9JGOY90Ubts+LoPZqvj1gw/0o1ehl5GG2sCrFrI3R6tzCEKeQRNB2+nZmRuJf2PLO/Yi8jG6iz5DbCDwmfMKaL0eiLFLnJtlQ+6ekCZ/gRpfTJzh9LlU7GAanZ+XCDdrND7Y+XqzAeR128ygIIwPG+y8aRnx1YHegTFNrJ2ofHNFnA4xJpGgA8hiEKvS2Vb9ePm2Bgf2LCkL7LKRD0s5f0/QLjked5hMHGCZ+QQ/9iAOAN871xlOyt56Adya/snv6pyO2TDdQUOlYUMvPNm4pAZ6gzv7IxwVOQQs0No4qQiApLXja89bWH00CFyBsleBZLc45dfawrUGTr1rSBtSW0joj4nHUV+fg2bUTH5c5H00HkyysKKh0RqD1vtzu/TypDWxX/2j6MPIYw8ZQQ+S61LE3jOabFwonn1ymPZutNGC9XN+OIUdL3EqcJKVx4Xu8F0xHTtSir5lhyXVmyB1GqNImELUqCIbFQEK825SytN9YES60PxCEpfyhBwPA5x0cXpiSaR0lg6FgCeJJYCSo4TL99TjWZimKx6HVjMSA4gHMQvn2jh8nNBCFsMZ2fF+58GAuL0TIQh7YxgKXfI4sinLunYNEzr91huEE5ZtRYIJOQ7BPDulSbMFwMz+LhWRxfnOEsDOgdvfJKpQV1eEu1Sk0QA0ASHV8Hkl4jzWPgGrCeib3RdCLVp6G95dkegLOUoJFSaWQeL3CJkEWwujBHeAI/AEA3sjDwFyBW2NEijl0MxMZUEj7F841DnK+TjSmFtz04mZqi4YFspYIQDDZKw/0UcDlgFdcVrxsa8t7TAVeXDyaEd3fGoH5Do5CiJYMH38ntN9kTx2iL7swOYH0k15bOUT0pr30MtY9g0WqnsOlet2CJ1xPT/3pNSGw9nPL04VVue5DaA2cYEssIY4AfvV9ce/b9Z7uGYmiwe7JPmy9pKoXzfgpJFeDgGrwFrga/22CkcN10m1lmGsHzLvvNdNvLYCTQhGlFdeQLSqbTPtlMBuVNbhTpHB1MtVuezUpxdydWaRJQDWMdBVCEqS8xxrNMqwji89t6YkqQDIhlQiDcjjhW7tIBKKQXBt4qROvPAwPK01poG6VgARgvDUnYctQDuR+YoSn6kx1VuiTEEsWFWV1UOEaxVnIn184KlsWt2FV0m9C3KBsW4woVHjqjS7FHhRjCeU8ymzZNegIN06WuV6+fGES3l7AUYv2ar2PHvuljNWRcmpK3Ks6r/29WV3gPesAlintP4HVS39Aoju5mckd6TAbOckYtXgMw5tHAkOO7BGkmwMnGWk+jVwy32BJiNzJhL82iSRLsRRwErHqG6lhu8fJNc6C82DwlrXO955VZLyRKFzJqMnoMdeJ1JhfQ3aS6+SAMO5NLTBjl6/1vv7tLCTpNBdAj0tGkC5XO4EZPW1veNGtpA2DJdymy6JugdsG4eSG5vpK8uRaF78tGE6p7IzC8O1w04ZuSMy2J/wm0hNbwWoyCrBT+p6H4On+bboAXG7kyacGVpg/Dzg5r644+XtH8uii1YbbKiJgoZa5QjMqqtM2JYF51kINjq+WsW4PKeUGYyK37nknr8obzvBvOc+K26EOxCVPUMe3MjDcoKIou/z+kqdfiMulCSY29Mj34AvB2RIknnP/P8TQfWq5pD2Qxuqz6oXtl75xNvblniDRFHed/GuYvyWAi6Gt8qUcFWKPuyFzkXThP/aJM9KL8DwGaOq3UDwAA' | base64 -d > bff4.c.gz -gunzip bff4.c.gz -gcc -O3 -o bff4 bff4.c -chmod +x bff4 -rm bff4.c - - - diff --git a/packages/brainfuck/1.0.0/environment b/packages/brainfuck/1.0.0/environment deleted file mode 100644 index bed795b..0000000 --- a/packages/brainfuck/1.0.0/environment +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -# Put 'export' statements here for environment variables -export PATH=$PWD:$PATH diff --git a/packages/brainfuck/1.0.0/metadata.json b/packages/brainfuck/1.0.0/metadata.json deleted file mode 100644 index 4b1ec24..0000000 --- a/packages/brainfuck/1.0.0/metadata.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "language": "brainfuck", - "version": "1.0.0", - "aliases": ["bf"], - "author": "Thomas Hobson " -} diff --git a/packages/brainfuck/1.0.0/run b/packages/brainfuck/1.0.0/run deleted file mode 100644 index 32735c1..0000000 --- a/packages/brainfuck/1.0.0/run +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -# Put instructions to run the runtime -bff4 "$@" diff --git a/packages/brainfuck/1.0.0/test.bf b/packages/brainfuck/1.0.0/test.bf deleted file mode 100644 index d0c07ec..0000000 --- a/packages/brainfuck/1.0.0/test.bf +++ /dev/null @@ -1 +0,0 @@ --[--->+<]>------.----. \ No newline at end of file From 4b409cb011f580b302b1f0c99bda5dbe11ad37f8 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Fri, 19 Mar 2021 22:13:27 +1300 Subject: [PATCH 307/385] pkg(brainfuck-2.7.3): add brainfuck --- packages/brainfuck/2.7.3/build.sh | 23 +++++++++++++++++++++++ packages/brainfuck/2.7.3/environment | 4 ++++ packages/brainfuck/2.7.3/metadata.json | 6 ++++++ packages/brainfuck/2.7.3/run | 4 ++++ packages/brainfuck/2.7.3/test.bf | 1 + 5 files changed, 38 insertions(+) create mode 100644 packages/brainfuck/2.7.3/build.sh create mode 100644 packages/brainfuck/2.7.3/environment create mode 100644 packages/brainfuck/2.7.3/metadata.json create mode 100644 packages/brainfuck/2.7.3/run create mode 100644 packages/brainfuck/2.7.3/test.bf diff --git a/packages/brainfuck/2.7.3/build.sh b/packages/brainfuck/2.7.3/build.sh new file mode 100644 index 0000000..6eccdec --- /dev/null +++ b/packages/brainfuck/2.7.3/build.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +# Put instructions to build your package in here +PREFIX=$(realpath $(dirname $0)) + +mkdir -p build + +git clone https://github.com/fabianishere/brainfuck.git + +cd build + +cmake ../brainfuck + +make -j$(nproc) +make install -j$(nproc) + + +# === autoconf based === +./configure --prefix "$PREFIX" + + +cd ../ +rm -rf build brainfuck diff --git a/packages/brainfuck/2.7.3/environment b/packages/brainfuck/2.7.3/environment new file mode 100644 index 0000000..780b668 --- /dev/null +++ b/packages/brainfuck/2.7.3/environment @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# Put 'export' statements here for environment variables +export PATH=$PWD/bin:$PATH diff --git a/packages/brainfuck/2.7.3/metadata.json b/packages/brainfuck/2.7.3/metadata.json new file mode 100644 index 0000000..5d9fc66 --- /dev/null +++ b/packages/brainfuck/2.7.3/metadata.json @@ -0,0 +1,6 @@ +{ + "language": "brainfuck", + "version": "2.7.3", + "aliases": ["bf"], + "author": "Thomas Hobson " +} diff --git a/packages/brainfuck/2.7.3/run b/packages/brainfuck/2.7.3/run new file mode 100644 index 0000000..9a754ca --- /dev/null +++ b/packages/brainfuck/2.7.3/run @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# Put instructions to run the runtime +brainfuck-2.7.3 "$@" diff --git a/packages/brainfuck/2.7.3/test.bf b/packages/brainfuck/2.7.3/test.bf new file mode 100644 index 0000000..d0c07ec --- /dev/null +++ b/packages/brainfuck/2.7.3/test.bf @@ -0,0 +1 @@ +-[--->+<]>------.----. \ No newline at end of file From ee25a2eefad7422cc59530c456b1a2816ed02329 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Fri, 19 Mar 2021 22:19:45 +1300 Subject: [PATCH 308/385] pkg(brainfuck-2.7.3): add prefix --- packages/brainfuck/2.7.3/build.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/brainfuck/2.7.3/build.sh b/packages/brainfuck/2.7.3/build.sh index 6eccdec..dc4f445 100644 --- a/packages/brainfuck/2.7.3/build.sh +++ b/packages/brainfuck/2.7.3/build.sh @@ -9,15 +9,10 @@ git clone https://github.com/fabianishere/brainfuck.git cd build -cmake ../brainfuck +cmake ../brainfuck -DCMAKE_INSTALL_PREFIX=$PREFIX make -j$(nproc) make install -j$(nproc) - -# === autoconf based === -./configure --prefix "$PREFIX" - - cd ../ rm -rf build brainfuck From 8342a4db33d89a1aca0e4f1c33cc333223f3cd03 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Fri, 19 Mar 2021 22:24:40 +1300 Subject: [PATCH 309/385] pkg(brainfuck-2.7.3): Disable edit line and run correctly --- packages/brainfuck/2.7.3/build.sh | 2 +- packages/brainfuck/2.7.3/run | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/brainfuck/2.7.3/build.sh b/packages/brainfuck/2.7.3/build.sh index dc4f445..42557f0 100644 --- a/packages/brainfuck/2.7.3/build.sh +++ b/packages/brainfuck/2.7.3/build.sh @@ -9,7 +9,7 @@ git clone https://github.com/fabianishere/brainfuck.git cd build -cmake ../brainfuck -DCMAKE_INSTALL_PREFIX=$PREFIX +cmake -DCMAKE_INSTALL_PREFIX=$PREFIX -DENABLE_EDITLINE=OFF ../brainfuck make -j$(nproc) make install -j$(nproc) diff --git a/packages/brainfuck/2.7.3/run b/packages/brainfuck/2.7.3/run index 9a754ca..4c8f425 100644 --- a/packages/brainfuck/2.7.3/run +++ b/packages/brainfuck/2.7.3/run @@ -1,4 +1,4 @@ #!/usr/bin/env bash # Put instructions to run the runtime -brainfuck-2.7.3 "$@" +brainfuck $1 From 0d134c738e2ed186f5230a0b34ec8125659972d5 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Fri, 19 Mar 2021 22:26:19 +1300 Subject: [PATCH 310/385] pkg(brainfuck-2.7.3): prefix requires trailing slash --- packages/brainfuck/2.7.3/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/brainfuck/2.7.3/build.sh b/packages/brainfuck/2.7.3/build.sh index 42557f0..ae896ff 100644 --- a/packages/brainfuck/2.7.3/build.sh +++ b/packages/brainfuck/2.7.3/build.sh @@ -9,7 +9,7 @@ git clone https://github.com/fabianishere/brainfuck.git cd build -cmake -DCMAKE_INSTALL_PREFIX=$PREFIX -DENABLE_EDITLINE=OFF ../brainfuck +cmake -DCMAKE_INSTALL_PREFIX=$PREFIX/ -DENABLE_EDITLINE=OFF ../brainfuck make -j$(nproc) make install -j$(nproc) From fed0a3eeaf330a708bce6befd086c62b767aa806 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Fri, 19 Mar 2021 22:34:41 +1300 Subject: [PATCH 311/385] pkg(brainfuck-2.7.3): relocate fs tree --- packages/brainfuck/2.7.3/build.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/brainfuck/2.7.3/build.sh b/packages/brainfuck/2.7.3/build.sh index ae896ff..2e15179 100644 --- a/packages/brainfuck/2.7.3/build.sh +++ b/packages/brainfuck/2.7.3/build.sh @@ -3,16 +3,17 @@ # Put instructions to build your package in here PREFIX=$(realpath $(dirname $0)) -mkdir -p build - git clone https://github.com/fabianishere/brainfuck.git +cd brainfuck + +mkdir -p build cd build -cmake -DCMAKE_INSTALL_PREFIX=$PREFIX/ -DENABLE_EDITLINE=OFF ../brainfuck +cmake -DCMAKE_INSTALL_PREFIX=$PREFIX/ -DENABLE_EDITLINE=OFF .. make -j$(nproc) make install -j$(nproc) -cd ../ -rm -rf build brainfuck +cd ../../ +rm -rf brainfuck From a7740d5f77fadafab0b5ea5892f2bdc1ef3e576f Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Fri, 19 Mar 2021 22:43:29 +1300 Subject: [PATCH 312/385] pkg(brainfuck-2.7.3): move path to first parameter --- packages/brainfuck/2.7.3/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/brainfuck/2.7.3/build.sh b/packages/brainfuck/2.7.3/build.sh index 2e15179..796b573 100644 --- a/packages/brainfuck/2.7.3/build.sh +++ b/packages/brainfuck/2.7.3/build.sh @@ -6,11 +6,11 @@ PREFIX=$(realpath $(dirname $0)) git clone https://github.com/fabianishere/brainfuck.git cd brainfuck - mkdir -p build + cd build -cmake -DCMAKE_INSTALL_PREFIX=$PREFIX/ -DENABLE_EDITLINE=OFF .. +cmake .. -DCMAKE_INSTALL_PREFIX=$PREFIX/ -DENABLE_EDITLINE=OFF make -j$(nproc) make install -j$(nproc) From c69af5bc6d6634609404313f477a9eb4383dac47 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Fri, 19 Mar 2021 22:57:12 +1300 Subject: [PATCH 313/385] repo: add python to build container --- repo/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repo/Dockerfile b/repo/Dockerfile index 6c3053f..be968fa 100644 --- a/repo/Dockerfile +++ b/repo/Dockerfile @@ -1,6 +1,6 @@ FROM debian:buster-slim -RUN apt-get update && apt-get install -y unzip autoconf build-essential libssl-dev pkg-config zlib1g-dev libargon2-dev libsodium-dev libcurl4-openssl-dev sqlite3 libsqlite3-dev libonig-dev libxml2 libxml2-dev bc curl git linux-headers-amd64 perl xz-utils python3 python3-pip gnupg jq zlib1g-dev cmake cmake-doc extra-cmake-modules build-essential gcc binutils bash coreutils util-linux pciutils usbutils coreutils binutils findutils grep libncurses5-dev libncursesw5-dev && \ +RUN apt-get update && apt-get install -y unzip autoconf build-essential libssl-dev pkg-config zlib1g-dev libargon2-dev libsodium-dev libcurl4-openssl-dev sqlite3 libsqlite3-dev libonig-dev libxml2 libxml2-dev bc curl git linux-headers-amd64 perl xz-utils python3 python3-pip gnupg jq zlib1g-dev cmake cmake-doc extra-cmake-modules build-essential gcc binutils bash coreutils util-linux pciutils usbutils coreutils binutils findutils grep libncurses5-dev libncursesw5-dev python3-pip && \ ln -sf /bin/bash /bin/sh && \ rm -rf /var/lib/apt/lists/* From ca109128b745bfda42de4e01bab50e2f6d4eedbf Mon Sep 17 00:00:00 2001 From: "Vargas, Dan" Date: Fri, 19 Mar 2021 13:45:59 -0500 Subject: [PATCH 314/385] pkg(clojure-1.10.3): Add clojure 1.10.3 --- packages/clojure/1.10.3/build.sh | 43 +++++++++++++++++++++++++++ packages/clojure/1.10.3/environment | 6 ++++ packages/clojure/1.10.3/metadata.json | 6 ++++ packages/clojure/1.10.3/run | 4 +++ packages/clojure/1.10.3/test.clj | 5 ++++ 5 files changed, 64 insertions(+) create mode 100755 packages/clojure/1.10.3/build.sh create mode 100644 packages/clojure/1.10.3/environment create mode 100644 packages/clojure/1.10.3/metadata.json create mode 100644 packages/clojure/1.10.3/run create mode 100644 packages/clojure/1.10.3/test.clj diff --git a/packages/clojure/1.10.3/build.sh b/packages/clojure/1.10.3/build.sh new file mode 100755 index 0000000..4633daf --- /dev/null +++ b/packages/clojure/1.10.3/build.sh @@ -0,0 +1,43 @@ +#!/usr/bin/env bash + +# Installation location +PREFIX=$(realpath $(dirname $0)) + +# Clojure depends on Java (build and runtime) +mkdir -p java +cd java +curl "https://download.java.net/java/GA/jdk15.0.2/0d1cfde4252546c6931946de8db48ee2/7/GPL/openjdk-15.0.2_linux-x64_bin.tar.gz" -o java.tar.gz +tar xzf java.tar.gz --strip-components=1 +rm java.tar.gz +cd .. + +# Clojure depends on Maven (build) +mkdir -p maven +cd maven +curl "https://apache.claz.org/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz" -o maven.tar.gz +tar xzf maven.tar.gz --strip-components=1 +rm maven.tar.gz +cd .. + +# Adding java and maven to the path for building +export PATH=$PWD/java/bin:$PWD/maven/bin:$PATH +export JAVA_HOME=$PWD/java + +# Clojure download +mkdir -p build +cd build +git clone -q "https://github.com/clojure/clojure.git" . +git checkout -b clojure-1.10.3 aaf73b12467df80f5db3e086550a33fee0e1b39e # commit for 1.10.3 release + +# Build using maven +mvn -Plocal -Dmaven.test.skip=true package + +# Get ridda that m2 bloat from Maven and remove Maven itself +cd ../ +rm -rf ~/.m2 +rm -rf maven/ + +# Move the jar for easier reference and cleanup +mkdir -p bin +mv build/clojure.jar bin +rm -rf build diff --git a/packages/clojure/1.10.3/environment b/packages/clojure/1.10.3/environment new file mode 100644 index 0000000..e7ef3b1 --- /dev/null +++ b/packages/clojure/1.10.3/environment @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +# Clojure requires JAVA_HOME to be set and java binary to be in the path +export JAVA_HOME=$PWD/java +export CLOJURE_PATH=$PWD/bin +export PATH=$PWD/java/bin:$PATH diff --git a/packages/clojure/1.10.3/metadata.json b/packages/clojure/1.10.3/metadata.json new file mode 100644 index 0000000..64f83fa --- /dev/null +++ b/packages/clojure/1.10.3/metadata.json @@ -0,0 +1,6 @@ +{ + "language": "clojure", + "version": "1.10.3", + "aliases": ["clojure","clj"], + "author": "Dan Vargas " +} diff --git a/packages/clojure/1.10.3/run b/packages/clojure/1.10.3/run new file mode 100644 index 0000000..a8901af --- /dev/null +++ b/packages/clojure/1.10.3/run @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# Run clojure with Java referencing the clojure jar location +java -jar $CLOJURE_PATH/clojure.jar "$@" diff --git a/packages/clojure/1.10.3/test.clj b/packages/clojure/1.10.3/test.clj new file mode 100644 index 0000000..7f50202 --- /dev/null +++ b/packages/clojure/1.10.3/test.clj @@ -0,0 +1,5 @@ +(ns clojure.examples.main + (:gen-class)) +(defn main [] + (println "OK")) +(main) \ No newline at end of file From d032caa9bcd013af84e3a2c1d22dc5edb528b754 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 20 Mar 2021 12:35:36 +1300 Subject: [PATCH 315/385] pkg(brainfuck-2.7.3): use older commit --- packages/brainfuck/2.7.3/build.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/brainfuck/2.7.3/build.sh b/packages/brainfuck/2.7.3/build.sh index 796b573..4863c8b 100644 --- a/packages/brainfuck/2.7.3/build.sh +++ b/packages/brainfuck/2.7.3/build.sh @@ -6,6 +6,9 @@ PREFIX=$(realpath $(dirname $0)) git clone https://github.com/fabianishere/brainfuck.git cd brainfuck +git checkout 6ea0f173989df4d5ce698e1f3c95f2cd0535ebd1 + + mkdir -p build cd build From 538d3d34512f83f2b32de34eb9ad7d4bcf603479 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 20 Mar 2021 12:37:55 +1300 Subject: [PATCH 316/385] pkg(brainfuck-2.7.3): go back further in time --- packages/brainfuck/2.7.3/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/brainfuck/2.7.3/build.sh b/packages/brainfuck/2.7.3/build.sh index 4863c8b..50c1868 100644 --- a/packages/brainfuck/2.7.3/build.sh +++ b/packages/brainfuck/2.7.3/build.sh @@ -6,7 +6,7 @@ PREFIX=$(realpath $(dirname $0)) git clone https://github.com/fabianishere/brainfuck.git cd brainfuck -git checkout 6ea0f173989df4d5ce698e1f3c95f2cd0535ebd1 +git checkout 06f84462e0a96487670a4b8024e3ec531e0377ee mkdir -p build From 947bc35304cb81a00794bdf887dfbc767938a8cf Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 20 Mar 2021 12:55:07 +1300 Subject: [PATCH 317/385] pkg(python-*): Install common packages within python --- packages/python/2.7.18/build.sh | 2 +- packages/python/3.5.10/build.sh | 2 +- packages/python/3.9.1/build.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/python/2.7.18/build.sh b/packages/python/2.7.18/build.sh index 1cc8e23..28a93e6 100755 --- a/packages/python/2.7.18/build.sh +++ b/packages/python/2.7.18/build.sh @@ -18,4 +18,4 @@ cd .. rm -rf build - +bin/pip2 install numpy scipy pandas pycrypto numba whoosh bcrypt passlib diff --git a/packages/python/3.5.10/build.sh b/packages/python/3.5.10/build.sh index 445f96a..d02faf4 100755 --- a/packages/python/3.5.10/build.sh +++ b/packages/python/3.5.10/build.sh @@ -18,4 +18,4 @@ cd .. rm -rf build - +bin/pip3 install numpy scipy pandas pycrypto numba whoosh bcrypt passlib diff --git a/packages/python/3.9.1/build.sh b/packages/python/3.9.1/build.sh index ec2a2d5..03fab6f 100755 --- a/packages/python/3.9.1/build.sh +++ b/packages/python/3.9.1/build.sh @@ -18,4 +18,4 @@ cd .. rm -rf build - +bin/pip3 install numpy scipy pandas pycrypto numba whoosh bcrypt passlib From aa885a37ad8cf2fdae675be1c7a29fa85f619e68 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 20 Mar 2021 13:03:33 +1300 Subject: [PATCH 318/385] pkg(python-*): remove llvm dependency through numba --- packages/python/2.7.18/build.sh | 2 +- packages/python/3.5.10/build.sh | 2 +- packages/python/3.9.1/build.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/python/2.7.18/build.sh b/packages/python/2.7.18/build.sh index 28a93e6..d973d04 100755 --- a/packages/python/2.7.18/build.sh +++ b/packages/python/2.7.18/build.sh @@ -18,4 +18,4 @@ cd .. rm -rf build -bin/pip2 install numpy scipy pandas pycrypto numba whoosh bcrypt passlib +bin/pip2 install numpy scipy pandas pycrypto whoosh bcrypt passlib diff --git a/packages/python/3.5.10/build.sh b/packages/python/3.5.10/build.sh index d02faf4..bced203 100755 --- a/packages/python/3.5.10/build.sh +++ b/packages/python/3.5.10/build.sh @@ -18,4 +18,4 @@ cd .. rm -rf build -bin/pip3 install numpy scipy pandas pycrypto numba whoosh bcrypt passlib +bin/pip3 install numpy scipy pandas pycrypto whoosh bcrypt passlib diff --git a/packages/python/3.9.1/build.sh b/packages/python/3.9.1/build.sh index 03fab6f..fcae7c7 100755 --- a/packages/python/3.9.1/build.sh +++ b/packages/python/3.9.1/build.sh @@ -18,4 +18,4 @@ cd .. rm -rf build -bin/pip3 install numpy scipy pandas pycrypto numba whoosh bcrypt passlib +bin/pip3 install numpy scipy pandas pycrypto whoosh bcrypt passlib From d2f1d62d15dc24ae3dd754ad853f56d4a554d0a1 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 20 Mar 2021 13:19:00 +1300 Subject: [PATCH 319/385] pkg(python-2.7.18): use correct package versions for py2 --- packages/python/2.7.18/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/python/2.7.18/build.sh b/packages/python/2.7.18/build.sh index d973d04..3cd371d 100755 --- a/packages/python/2.7.18/build.sh +++ b/packages/python/2.7.18/build.sh @@ -18,4 +18,4 @@ cd .. rm -rf build -bin/pip2 install numpy scipy pandas pycrypto whoosh bcrypt passlib +bin/pip2 install numpy==1.16.* scipy==1.2.* pandas==0.23.* pycrypto whoosh bcrypt==3.1.* passlib From aecfcedaba023be69beb14b644d958dc06737abb Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 20 Mar 2021 13:30:36 +1300 Subject: [PATCH 320/385] pkg(python-2.7.18): update pip before using Pip 20.3.* respects python_requires --- packages/python/2.7.18/build.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/python/2.7.18/build.sh b/packages/python/2.7.18/build.sh index 3cd371d..68ee12d 100755 --- a/packages/python/2.7.18/build.sh +++ b/packages/python/2.7.18/build.sh @@ -17,5 +17,7 @@ make install -j$(nproc) cd .. rm -rf build +bin/pip2 install -U pip==20.3.* +# Upgrade pip to latest supported version -bin/pip2 install numpy==1.16.* scipy==1.2.* pandas==0.23.* pycrypto whoosh bcrypt==3.1.* passlib +bin/pip2 install numpy scipy pandas pycrypto whoosh bcrypt passlib From 1d4fbab57cbb2799702c0f85e10ae173714c64f8 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 20 Mar 2021 13:34:21 +1300 Subject: [PATCH 321/385] pkg(python-2.7.18): pandas seems to not define metadata correctly --- packages/python/2.7.18/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/python/2.7.18/build.sh b/packages/python/2.7.18/build.sh index 68ee12d..8e0fd2e 100755 --- a/packages/python/2.7.18/build.sh +++ b/packages/python/2.7.18/build.sh @@ -20,4 +20,4 @@ rm -rf build bin/pip2 install -U pip==20.3.* # Upgrade pip to latest supported version -bin/pip2 install numpy scipy pandas pycrypto whoosh bcrypt passlib +bin/pip2 install numpy scipy pandas==0.23.* pycrypto whoosh bcrypt passlib From d85f1d2c5bfe676051aae1a3709795f98584d782 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 20 Mar 2021 13:37:48 +1300 Subject: [PATCH 322/385] pkg(python-2.7.18): pandas just doesn't like py2? --- packages/python/2.7.18/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/python/2.7.18/build.sh b/packages/python/2.7.18/build.sh index 8e0fd2e..131ba96 100755 --- a/packages/python/2.7.18/build.sh +++ b/packages/python/2.7.18/build.sh @@ -20,4 +20,4 @@ rm -rf build bin/pip2 install -U pip==20.3.* # Upgrade pip to latest supported version -bin/pip2 install numpy scipy pandas==0.23.* pycrypto whoosh bcrypt passlib +bin/pip2 install numpy scipy pycrypto whoosh bcrypt passlib From 332a077f469a763592660eaf1b30a808d5be1b43 Mon Sep 17 00:00:00 2001 From: Shivansh-007 Date: Sat, 20 Mar 2021 06:16:54 +0530 Subject: [PATCH 323/385] pkg(vlang-0.1.13): Add vlang 0.1.13 (#177) * pkg(vlang-0.1.13): Add vlang 0.1.13 * Export environment variables: VMODULES and TMPDIR environment vars to the current working dir in the run script. Co-authored-by: Shivansh-007 --- packages/vlang/0.1.13/build.sh | 8 ++++++++ packages/vlang/0.1.13/environment | 4 ++++ packages/vlang/0.1.13/metadata.json | 6 ++++++ packages/vlang/0.1.13/run | 8 ++++++++ packages/vlang/0.1.13/test.v | 3 +++ 5 files changed, 29 insertions(+) create mode 100755 packages/vlang/0.1.13/build.sh create mode 100644 packages/vlang/0.1.13/environment create mode 100644 packages/vlang/0.1.13/metadata.json create mode 100644 packages/vlang/0.1.13/run create mode 100644 packages/vlang/0.1.13/test.v diff --git a/packages/vlang/0.1.13/build.sh b/packages/vlang/0.1.13/build.sh new file mode 100755 index 0000000..127bac9 --- /dev/null +++ b/packages/vlang/0.1.13/build.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +# Cloning vlang source +git clone https://github.com/vlang/v +cd v + +# Building and installing vlang +make \ No newline at end of file diff --git a/packages/vlang/0.1.13/environment b/packages/vlang/0.1.13/environment new file mode 100644 index 0000000..638b0c2 --- /dev/null +++ b/packages/vlang/0.1.13/environment @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# Put 'export' statements here for environment variables +export PATH="$PWD/v:$PATH" \ No newline at end of file diff --git a/packages/vlang/0.1.13/metadata.json b/packages/vlang/0.1.13/metadata.json new file mode 100644 index 0000000..855f7bb --- /dev/null +++ b/packages/vlang/0.1.13/metadata.json @@ -0,0 +1,6 @@ +{ + "language": "vlang", + "version": "0.1.13", + "author": "Shivansh-007 ", + "aliases": ["v"] +} diff --git a/packages/vlang/0.1.13/run b/packages/vlang/0.1.13/run new file mode 100644 index 0000000..d8fa7b2 --- /dev/null +++ b/packages/vlang/0.1.13/run @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +# Export environment variables +export VMODULES="$PWD" +export TMPDIR="$PWD" + +# Put instructions to run the runtime +v run "$@" \ No newline at end of file diff --git a/packages/vlang/0.1.13/test.v b/packages/vlang/0.1.13/test.v new file mode 100644 index 0000000..fb5de5e --- /dev/null +++ b/packages/vlang/0.1.13/test.v @@ -0,0 +1,3 @@ +fn main() { + println('OK') +} \ No newline at end of file From 96fd2d0102abcd5ec827672eb57b0523e60bc061 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 20 Mar 2021 13:49:14 +1300 Subject: [PATCH 324/385] repo: add libgmp --- repo/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repo/Dockerfile b/repo/Dockerfile index be968fa..450aaa5 100644 --- a/repo/Dockerfile +++ b/repo/Dockerfile @@ -1,6 +1,6 @@ FROM debian:buster-slim -RUN apt-get update && apt-get install -y unzip autoconf build-essential libssl-dev pkg-config zlib1g-dev libargon2-dev libsodium-dev libcurl4-openssl-dev sqlite3 libsqlite3-dev libonig-dev libxml2 libxml2-dev bc curl git linux-headers-amd64 perl xz-utils python3 python3-pip gnupg jq zlib1g-dev cmake cmake-doc extra-cmake-modules build-essential gcc binutils bash coreutils util-linux pciutils usbutils coreutils binutils findutils grep libncurses5-dev libncursesw5-dev python3-pip && \ +RUN apt-get update && apt-get install -y unzip autoconf build-essential libssl-dev pkg-config zlib1g-dev libargon2-dev libsodium-dev libcurl4-openssl-dev sqlite3 libsqlite3-dev libonig-dev libxml2 libxml2-dev bc curl git linux-headers-amd64 perl xz-utils python3 python3-pip gnupg jq zlib1g-dev cmake cmake-doc extra-cmake-modules build-essential gcc binutils bash coreutils util-linux pciutils usbutils coreutils binutils findutils grep libncurses5-dev libncursesw5-dev python3-pip libgmp-dev && \ ln -sf /bin/bash /bin/sh && \ rm -rf /var/lib/apt/lists/* From c4a4811b17461fdc4f21029b1d9edffdc5079a8f Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 20 Mar 2021 13:59:57 +1300 Subject: [PATCH 325/385] repo: add libmpfr --- repo/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repo/Dockerfile b/repo/Dockerfile index 450aaa5..d628b2e 100644 --- a/repo/Dockerfile +++ b/repo/Dockerfile @@ -1,6 +1,6 @@ FROM debian:buster-slim -RUN apt-get update && apt-get install -y unzip autoconf build-essential libssl-dev pkg-config zlib1g-dev libargon2-dev libsodium-dev libcurl4-openssl-dev sqlite3 libsqlite3-dev libonig-dev libxml2 libxml2-dev bc curl git linux-headers-amd64 perl xz-utils python3 python3-pip gnupg jq zlib1g-dev cmake cmake-doc extra-cmake-modules build-essential gcc binutils bash coreutils util-linux pciutils usbutils coreutils binutils findutils grep libncurses5-dev libncursesw5-dev python3-pip libgmp-dev && \ +RUN apt-get update && apt-get install -y unzip autoconf build-essential libssl-dev pkg-config zlib1g-dev libargon2-dev libsodium-dev libcurl4-openssl-dev sqlite3 libsqlite3-dev libonig-dev libxml2 libxml2-dev bc curl git linux-headers-amd64 perl xz-utils python3 python3-pip gnupg jq zlib1g-dev cmake cmake-doc extra-cmake-modules build-essential gcc binutils bash coreutils util-linux pciutils usbutils coreutils binutils findutils grep libncurses5-dev libncursesw5-dev python3-pip libgmp-dev libmpfr-dev && \ ln -sf /bin/bash /bin/sh && \ rm -rf /var/lib/apt/lists/* From 6d04cc168030acaa7aeacfcd8a3bbe566133e7cf Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 20 Mar 2021 14:26:57 +1300 Subject: [PATCH 326/385] repo: install py2 in build container --- repo/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repo/Dockerfile b/repo/Dockerfile index d628b2e..a4fcf0a 100644 --- a/repo/Dockerfile +++ b/repo/Dockerfile @@ -1,6 +1,6 @@ FROM debian:buster-slim -RUN apt-get update && apt-get install -y unzip autoconf build-essential libssl-dev pkg-config zlib1g-dev libargon2-dev libsodium-dev libcurl4-openssl-dev sqlite3 libsqlite3-dev libonig-dev libxml2 libxml2-dev bc curl git linux-headers-amd64 perl xz-utils python3 python3-pip gnupg jq zlib1g-dev cmake cmake-doc extra-cmake-modules build-essential gcc binutils bash coreutils util-linux pciutils usbutils coreutils binutils findutils grep libncurses5-dev libncursesw5-dev python3-pip libgmp-dev libmpfr-dev && \ +RUN apt-get update && apt-get install -y unzip autoconf build-essential libssl-dev pkg-config zlib1g-dev libargon2-dev libsodium-dev libcurl4-openssl-dev sqlite3 libsqlite3-dev libonig-dev libxml2 libxml2-dev bc curl git linux-headers-amd64 perl xz-utils python3 python3-pip gnupg jq zlib1g-dev cmake cmake-doc extra-cmake-modules build-essential gcc binutils bash coreutils util-linux pciutils usbutils coreutils binutils findutils grep libncurses5-dev libncursesw5-dev python3-pip libgmp-dev libmpfr-dev python2 && \ ln -sf /bin/bash /bin/sh && \ rm -rf /var/lib/apt/lists/* From 7ad8f337bc2eeda6f0b15e52d211afa371a359f1 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 20 Mar 2021 14:39:59 +1300 Subject: [PATCH 327/385] pkg(dotnet-5.0.201): Add dotnet 5.0.201 support --- packages/dotnet/5.0.201/build.sh | 6 ++++++ packages/dotnet/5.0.201/compile | 5 +++++ packages/dotnet/5.0.201/environment | 5 +++++ packages/dotnet/5.0.201/metadata.json | 6 ++++++ packages/dotnet/5.0.201/run | 5 +++++ packages/dotnet/5.0.201/test.cs | 9 +++++++++ 6 files changed, 36 insertions(+) create mode 100644 packages/dotnet/5.0.201/build.sh create mode 100644 packages/dotnet/5.0.201/compile create mode 100644 packages/dotnet/5.0.201/environment create mode 100644 packages/dotnet/5.0.201/metadata.json create mode 100644 packages/dotnet/5.0.201/run create mode 100644 packages/dotnet/5.0.201/test.cs diff --git a/packages/dotnet/5.0.201/build.sh b/packages/dotnet/5.0.201/build.sh new file mode 100644 index 0000000..cd72067 --- /dev/null +++ b/packages/dotnet/5.0.201/build.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +curl "https://download.visualstudio.microsoft.com/download/pr/73a9cb2a-1acd-4d20-b864-d12797ca3d40/075dbe1dc3bba4aa85ca420167b861b6/dotnet-sdk-5.0.201-linux-x64.tar.gz" -Lo dotnet.tar.gz +tar xzf dotnet.tar.gz --strip-components=1 +rm dotnet.tar.gz + diff --git a/packages/dotnet/5.0.201/compile b/packages/dotnet/5.0.201/compile new file mode 100644 index 0000000..9a0ea83 --- /dev/null +++ b/packages/dotnet/5.0.201/compile @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +dotnet new console +rm Program.cs +dotnet build -o . \ No newline at end of file diff --git a/packages/dotnet/5.0.201/environment b/packages/dotnet/5.0.201/environment new file mode 100644 index 0000000..34d0bbb --- /dev/null +++ b/packages/dotnet/5.0.201/environment @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +# Put 'export' statements here for environment variables +export DOTNET_ROOT=$PWD +export PATH=$DOTNET_ROOT:$PATH diff --git a/packages/dotnet/5.0.201/metadata.json b/packages/dotnet/5.0.201/metadata.json new file mode 100644 index 0000000..72f2e79 --- /dev/null +++ b/packages/dotnet/5.0.201/metadata.json @@ -0,0 +1,6 @@ +{ + "language": "dotnet", + "version": "5.0.201", + "aliases": ["cs", "csharp"], + "author": "Thomas Hobson " +} diff --git a/packages/dotnet/5.0.201/run b/packages/dotnet/5.0.201/run new file mode 100644 index 0000000..1739d03 --- /dev/null +++ b/packages/dotnet/5.0.201/run @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +# Put instructions to run the runtime +shift +dotnet $(basename $(realpath .)).dll "$@" \ No newline at end of file diff --git a/packages/dotnet/5.0.201/test.cs b/packages/dotnet/5.0.201/test.cs new file mode 100644 index 0000000..e91a2a2 --- /dev/null +++ b/packages/dotnet/5.0.201/test.cs @@ -0,0 +1,9 @@ +using System; + +public class Test +{ + public static void Main(string[] args) + { + Console.WriteLine("OK"); + } +} \ No newline at end of file From 91018d6d8513f5062ffe2c27ccdc2bdcaaa3a222 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 20 Mar 2021 15:17:55 +1300 Subject: [PATCH 328/385] pkg(dotnet-5.0.201): Nuget caching --- packages/dotnet/5.0.201/build.sh | 8 ++++++++ packages/dotnet/5.0.201/compile | 11 +++++++++-- packages/dotnet/5.0.201/environment | 2 +- packages/dotnet/5.0.201/run | 2 ++ 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/packages/dotnet/5.0.201/build.sh b/packages/dotnet/5.0.201/build.sh index cd72067..9093a3a 100644 --- a/packages/dotnet/5.0.201/build.sh +++ b/packages/dotnet/5.0.201/build.sh @@ -4,3 +4,11 @@ curl "https://download.visualstudio.microsoft.com/download/pr/73a9cb2a-1acd-4d20 tar xzf dotnet.tar.gz --strip-components=1 rm dotnet.tar.gz +# Cache nuget packages +export DOTNET_CLI_HOME=$PWD +dotnet new console -o cache_application +# This calls a restore on the global-packages index ($DOTNET_CLI_HOME/.nuget/packages) +# If we want to allow more packages, we could add them to this cache_application + +rm -rf cache_application +# Get rid of it, we don't actually need the application - just the restore \ No newline at end of file diff --git a/packages/dotnet/5.0.201/compile b/packages/dotnet/5.0.201/compile index 9a0ea83..d92c7a9 100644 --- a/packages/dotnet/5.0.201/compile +++ b/packages/dotnet/5.0.201/compile @@ -1,5 +1,12 @@ #!/usr/bin/env bash -dotnet new console +export DOTNET_CLI_HOME=$PWD + +dotnet build > /dev/null # Shut the thing up + +dotnet new console -o . --no-restore rm Program.cs -dotnet build -o . \ No newline at end of file + +dotnet restore --source $DOTNET_ROOT/.nuget/packages + +dotnet build -o . --no-restore \ No newline at end of file diff --git a/packages/dotnet/5.0.201/environment b/packages/dotnet/5.0.201/environment index 34d0bbb..596d56e 100644 --- a/packages/dotnet/5.0.201/environment +++ b/packages/dotnet/5.0.201/environment @@ -2,4 +2,4 @@ # Put 'export' statements here for environment variables export DOTNET_ROOT=$PWD -export PATH=$DOTNET_ROOT:$PATH +export PATH=$DOTNET_ROOT:$PATH \ No newline at end of file diff --git a/packages/dotnet/5.0.201/run b/packages/dotnet/5.0.201/run index 1739d03..40495e0 100644 --- a/packages/dotnet/5.0.201/run +++ b/packages/dotnet/5.0.201/run @@ -1,5 +1,7 @@ #!/usr/bin/env bash # Put instructions to run the runtime +export DOTNET_CLI_HOME=$PWD + shift dotnet $(basename $(realpath .)).dll "$@" \ No newline at end of file From c01d8e1c55956221ef45fc43d4fe161bd5782534 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 20 Mar 2021 15:19:41 +1300 Subject: [PATCH 329/385] pkg(dotnet-5.0.201): call the correect dotnet binary --- packages/dotnet/5.0.201/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/dotnet/5.0.201/build.sh b/packages/dotnet/5.0.201/build.sh index 9093a3a..c685668 100644 --- a/packages/dotnet/5.0.201/build.sh +++ b/packages/dotnet/5.0.201/build.sh @@ -6,7 +6,7 @@ rm dotnet.tar.gz # Cache nuget packages export DOTNET_CLI_HOME=$PWD -dotnet new console -o cache_application +./dotnet new console -o cache_application # This calls a restore on the global-packages index ($DOTNET_CLI_HOME/.nuget/packages) # If we want to allow more packages, we could add them to this cache_application From cbe759ab5667e91ecbdd5f3a2b92e1663e3ae6df Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 20 Mar 2021 15:57:29 +1300 Subject: [PATCH 330/385] pkg(dotnet-5.0.201): fix builds --- packages/dotnet/5.0.201/compile | 6 +++--- packages/dotnet/5.0.201/run | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/dotnet/5.0.201/compile b/packages/dotnet/5.0.201/compile index d92c7a9..1500acb 100644 --- a/packages/dotnet/5.0.201/compile +++ b/packages/dotnet/5.0.201/compile @@ -1,12 +1,12 @@ #!/usr/bin/env bash export DOTNET_CLI_HOME=$PWD +export HOME=$PWD -dotnet build > /dev/null # Shut the thing up +dotnet build --help > /dev/null # Shut the thing up dotnet new console -o . --no-restore rm Program.cs dotnet restore --source $DOTNET_ROOT/.nuget/packages - -dotnet build -o . --no-restore \ No newline at end of file +dotnet build --no-restore \ No newline at end of file diff --git a/packages/dotnet/5.0.201/run b/packages/dotnet/5.0.201/run index 40495e0..774a08a 100644 --- a/packages/dotnet/5.0.201/run +++ b/packages/dotnet/5.0.201/run @@ -4,4 +4,4 @@ export DOTNET_CLI_HOME=$PWD shift -dotnet $(basename $(realpath .)).dll "$@" \ No newline at end of file +dotnet bin/Debug/net5.0/$(basename $(realpath .)).dll "$@" \ No newline at end of file From b8e79572b5c37238ccffaecbdf8fa31473410808 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 20 Mar 2021 17:06:35 +1300 Subject: [PATCH 331/385] readme: update for v3 --- readme.md | 178 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 107 insertions(+), 71 deletions(-) diff --git a/readme.md b/readme.md index e671b93..d53dfa7 100644 --- a/readme.md +++ b/readme.md @@ -83,111 +83,155 @@ so we can discuss potentially getting you an unlimited key. # Getting Started +## All In One + ### Host System Package Dependencies - Docker - Docker Compose - Node JS -#### After system dependencies are installed, clone this repository: +### After system dependencies are installed, clone this repository: ```sh # clone and enter repo git clone https://github.com/engineer-man/piston ``` -#### Installation +## Just Piston (no CLI) -- docker-compose up +### Host System Package Dependencies + +- Docker + +### Installation + +```sh +echo "$GITHUB_TOKEN" | docker login https://docker.pkg.github.com -u "$GITHUB_USERNAME" --password-stdin +# Change out the $GITHUB_TOKEN and $GITHUB_USERNAME with appropritate values + +docker run -v $PWD:'/piston' --tmpfs /piston/jobs -dit -p 6969:6969 --privileged --name piston_api docker.pkg.github.com/engineer-man/piston/api:latest +``` + +### Installation + +- docker-compose up -d piston_api -#### CLI Usage -- `cli/execute [language] [file path] [args]`
# Usage ### CLI +The CLI is the main tool used for installing packages within piston, but also supports running code. + +You can execute the cli with `cli/index.js`. + ```sh -lxc/execute [language] [file path] [args] +# List all available packages +cli/index.js ppman list + +# Install python 3.9.1 +cli/index.js ppman install python 3.9.1 + +# Run a python script +echo 'print("Hello world!")' > test.py +cli/index.js run python 3.9.1 test.py +``` + +If you are operating on a remote machine, add the `-u` flag like so: + +```sh +cli/index.js -u http://piston.server:6969 ppman list ``` ### 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 -``` +The container exposes an API on port 6969 by default. +This is used by the CLI to carry out running jobs and package managment. -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. +#### Runtimes Endpoint +`GET /runtimes` +This endpoint will return the supported languages along with the current version, author and aliases. To execute +code for a particular language using the `/jobs` endpoint, either the name or one of the aliases must +be provided, along with the version. +Multiple versions of the same language may be present at the same time, and may be selected when running a job. ```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" - } + { + "language": "bash", + "version": "5.1.0", + "author": "Thomas Hobson ", + "aliases": [ + "sh" + ] + }, + { + "language": "brainfuck", + "version": "2.7.3", + "author": "Thomas Hobson ", + "aliases": [ + "bf" + ] + }, + ... ] ``` #### Execute Endpoint -`POST /execute` +`POST /jobs` 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. +- `language` (**required**) The language to use for execution, must be a string and must be installed. +- `version` (**required**) The version of the language to use for execution, must be a string containing a SemVer selector for the version or the specific version number to use. +- `files` (**required**) An array of files containing code or other data that should be used for execution. +- `files[].name` (**required**) The name of the file to upload, must be a string containing no path. +- `files[].content` (**required**) The content of the files to upload, must be a string containing text to write. +- `main` (**required**) The name of one of the files provided that should be considered the main source file which will be used as the entrypoint, must be a string and be the name of a file in `files`. +- `stdin` (**required**) The text to pass as stdin to the program. Must be a string, can be left blank. +- `args` (**required**) The arguments to pass to the program. Must be an array. +- `compile_timeout` (**required**) The maximum time allowed for the compile stage to finish before bailing out in milliseconds. Must be a number. +- `run_timeout` (**required**) The maximum time allowed for the run stage to finish before bailing out in milliseconds. Must be a number. + ```json { "language": "js", - "source": "console.log(process.argv)", + "version": "15.10.0", + "files":[ + { + "name": "my_cool_code.js", + "content": "console.log(process.argv)" + } + ], + "main": "my_cool_code.js", "stdin": "", "args": [ "1", "2", "3" - ] + ], + "compile_timeout": 10000, + "run_timeout": 3000 } ``` -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`. +A typical response upon successful execution will contain 1 or 2 keys `run` and `compile`. +`compile` will only be present if the language requested requires a compile stage. + +Each of these keys has an identical structure, containing both a `stdout` and `stderr` key, which is a string containing the text outputted during the stage into each buffer. +It also contains the `code` and `signal` which was returned from each process. ```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": "" + "run": { + "stdout": "[\n '/piston/packages/node/15.10.0/bin/node',\n '/piston/jobs/9501b09d-0105-496b-b61a-e5148cf66384/my_cool_code.js',\n '1',\n '2',\n '3'\n]\n", + "stderr": "", + "code": 0, + "signal": null + } } ``` If a problem exists with the request, a `400` status code is returned and the reason in the `message` key. @@ -196,43 +240,35 @@ HTTP/1.1 400 Bad Request Content-Type: application/json { - "message": "Supplied language is not supported by Piston" + "message": "html-5.0.0 runtime is unknown" } ```
-# Supported Languages - -`python`,`php`,`node` - - -
- +
- # License Piston is licensed under the MIT license. From cbfeef55abbd8f073776b3bf60b5ff9151847d6f Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 20 Mar 2021 17:08:12 +1300 Subject: [PATCH 332/385] readme: put installation where it should be --- readme.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/readme.md b/readme.md index d53dfa7..afe9a9f 100644 --- a/readme.md +++ b/readme.md @@ -98,6 +98,10 @@ so we can discuss potentially getting you an unlimited key. git clone https://github.com/engineer-man/piston ``` +### Installation + +- docker-compose up -d piston_api + ## Just Piston (no CLI) ### Host System Package Dependencies @@ -113,10 +117,6 @@ echo "$GITHUB_TOKEN" | docker login https://docker.pkg.github.com -u "$GITHUB_US docker run -v $PWD:'/piston' --tmpfs /piston/jobs -dit -p 6969:6969 --privileged --name piston_api docker.pkg.github.com/engineer-man/piston/api:latest ``` -### Installation - -- docker-compose up -d piston_api -
# Usage From e1b5b55b6997115761af23ecd4cf3a4a7d492dbe Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 20 Mar 2021 17:10:53 +1300 Subject: [PATCH 333/385] readme: add cli dependencies --- readme.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index afe9a9f..9d1fb11 100644 --- a/readme.md +++ b/readme.md @@ -100,7 +100,14 @@ git clone https://github.com/engineer-man/piston ### Installation -- docker-compose up -d piston_api +```sh +docker-compose up -d piston_api +# Start the API container + +npm install -g yarn +cd cli && yarn && cd - +# Install all the dependencies for the cli +``` ## Just Piston (no CLI) From 2ccae2949390003f4f0bba8e43d733601f9fc78a Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 20 Mar 2021 21:28:13 +1300 Subject: [PATCH 334/385] deploy: simplify --- docker-compose.yaml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 0a321a4..67e1253 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -9,13 +9,11 @@ services: - 6969:6969 volumes: - ./data/piston:/piston - - ./repo:/repo tmpfs: - /piston/jobs:exec - piston_fs_repo: #Temporary solution until CI works + piston_fs_repo: # Local testing of packages build: repo - command: ['typescript-4.2.3'] # Only build typescript + command: ['dart-2.12.1'] # Only build dart volumes: - - ./repo:/piston/repo - - ./packages:/piston/packages \ No newline at end of file + - .:/piston \ No newline at end of file From f24b3496d7b6a404891c37bb100f840a3bc4d4b9 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 20 Mar 2021 21:58:07 +1300 Subject: [PATCH 335/385] repo: python is python3 --- repo/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repo/Dockerfile b/repo/Dockerfile index a4fcf0a..83735c0 100644 --- a/repo/Dockerfile +++ b/repo/Dockerfile @@ -1,6 +1,6 @@ FROM debian:buster-slim -RUN apt-get update && apt-get install -y unzip autoconf build-essential libssl-dev pkg-config zlib1g-dev libargon2-dev libsodium-dev libcurl4-openssl-dev sqlite3 libsqlite3-dev libonig-dev libxml2 libxml2-dev bc curl git linux-headers-amd64 perl xz-utils python3 python3-pip gnupg jq zlib1g-dev cmake cmake-doc extra-cmake-modules build-essential gcc binutils bash coreutils util-linux pciutils usbutils coreutils binutils findutils grep libncurses5-dev libncursesw5-dev python3-pip libgmp-dev libmpfr-dev python2 && \ +RUN apt-get update && apt-get install -y unzip autoconf build-essential libssl-dev pkg-config zlib1g-dev libargon2-dev libsodium-dev libcurl4-openssl-dev sqlite3 libsqlite3-dev libonig-dev libxml2 libxml2-dev bc curl git linux-headers-amd64 perl xz-utils python3 python3-pip gnupg jq zlib1g-dev cmake cmake-doc extra-cmake-modules build-essential gcc binutils bash coreutils util-linux pciutils usbutils coreutils binutils findutils grep libncurses5-dev libncursesw5-dev python3-pip libgmp-dev libmpfr-dev python2 python-is-python3 && \ ln -sf /bin/bash /bin/sh && \ rm -rf /var/lib/apt/lists/* From 5fb49b05d5d5dbb9377b3350e279a5e08dda52a0 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 20 Mar 2021 22:05:36 +1300 Subject: [PATCH 336/385] repo: force python 3.5 --- repo/Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/repo/Dockerfile b/repo/Dockerfile index 83735c0..a362537 100644 --- a/repo/Dockerfile +++ b/repo/Dockerfile @@ -1,8 +1,9 @@ FROM debian:buster-slim -RUN apt-get update && apt-get install -y unzip autoconf build-essential libssl-dev pkg-config zlib1g-dev libargon2-dev libsodium-dev libcurl4-openssl-dev sqlite3 libsqlite3-dev libonig-dev libxml2 libxml2-dev bc curl git linux-headers-amd64 perl xz-utils python3 python3-pip gnupg jq zlib1g-dev cmake cmake-doc extra-cmake-modules build-essential gcc binutils bash coreutils util-linux pciutils usbutils coreutils binutils findutils grep libncurses5-dev libncursesw5-dev python3-pip libgmp-dev libmpfr-dev python2 python-is-python3 && \ +RUN apt-get update && apt-get install -y unzip autoconf build-essential libssl-dev pkg-config zlib1g-dev libargon2-dev libsodium-dev libcurl4-openssl-dev sqlite3 libsqlite3-dev libonig-dev libxml2 libxml2-dev bc curl git linux-headers-amd64 perl xz-utils python3 python3-pip gnupg jq zlib1g-dev cmake cmake-doc extra-cmake-modules build-essential gcc binutils bash coreutils util-linux pciutils usbutils coreutils binutils findutils grep libncurses5-dev libncursesw5-dev python3-pip libgmp-dev libmpfr-dev python2 && \ ln -sf /bin/bash /bin/sh && \ - rm -rf /var/lib/apt/lists/* + rm -rf /var/lib/apt/lists/* && \ + update-alternatives --install /usr/bin/python python /usr/bin/python3.5 2 ADD entrypoint.sh mkindex.sh / From 58fb3ed172c3c967f463820691ea9af1fd9eea8f Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 20 Mar 2021 22:08:00 +1300 Subject: [PATCH 337/385] repo: python version is 3.7 --- repo/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repo/Dockerfile b/repo/Dockerfile index a362537..debbd0b 100644 --- a/repo/Dockerfile +++ b/repo/Dockerfile @@ -3,7 +3,7 @@ FROM debian:buster-slim RUN apt-get update && apt-get install -y unzip autoconf build-essential libssl-dev pkg-config zlib1g-dev libargon2-dev libsodium-dev libcurl4-openssl-dev sqlite3 libsqlite3-dev libonig-dev libxml2 libxml2-dev bc curl git linux-headers-amd64 perl xz-utils python3 python3-pip gnupg jq zlib1g-dev cmake cmake-doc extra-cmake-modules build-essential gcc binutils bash coreutils util-linux pciutils usbutils coreutils binutils findutils grep libncurses5-dev libncursesw5-dev python3-pip libgmp-dev libmpfr-dev python2 && \ ln -sf /bin/bash /bin/sh && \ rm -rf /var/lib/apt/lists/* && \ - update-alternatives --install /usr/bin/python python /usr/bin/python3.5 2 + update-alternatives --install /usr/bin/python python /usr/bin/python3.7 2 ADD entrypoint.sh mkindex.sh / From 4776700a1bf7235552678e4ed0ecfd146ef85193 Mon Sep 17 00:00:00 2001 From: Dan Vargas <10914883+dvargas46@users.noreply.github.com> Date: Mon, 22 Mar 2021 21:53:36 -0500 Subject: [PATCH 338/385] pkg(rockstar-1.0.0): Add rockstar 1.0.0 (#184) Co-authored-by: Vargas, Dan --- packages/rockstar/1.0.0/build.sh | 20 ++++++++++++++++++++ packages/rockstar/1.0.0/environment | 2 ++ packages/rockstar/1.0.0/metadata.json | 6 ++++++ packages/rockstar/1.0.0/run | 3 +++ packages/rockstar/1.0.0/test.rock | 9 +++++++++ 5 files changed, 40 insertions(+) create mode 100755 packages/rockstar/1.0.0/build.sh create mode 100644 packages/rockstar/1.0.0/environment create mode 100644 packages/rockstar/1.0.0/metadata.json create mode 100644 packages/rockstar/1.0.0/run create mode 100644 packages/rockstar/1.0.0/test.rock diff --git a/packages/rockstar/1.0.0/build.sh b/packages/rockstar/1.0.0/build.sh new file mode 100755 index 0000000..baaa9f0 --- /dev/null +++ b/packages/rockstar/1.0.0/build.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# Download and install NodeJS +curl "https://nodejs.org/dist/v15.10.0/node-v15.10.0-linux-x64.tar.xz" -o node.tar.xz +tar xf node.tar.xz --strip-components=1 +rm node.tar.xz +export PATH=$PWD/bin:$PATH + +# Pull Rockstar reference implementation project +git clone -q "https://github.com/RockstarLang/rockstar.git" rockstar +cd rockstar +git reset --hard bc9eedc6acb7c0f31a425cc204dcd93cb3e68936 + +# Install Satriani dependencies +cd satriani +npm install +cd ../.. + +# Suppress "(program returned no output)" output at the end of each program +sed -i 's/console.log(result ? result : "(program returned no output)");/if (result) console.log(result);/g' rockstar/satriani/rockstar.js diff --git a/packages/rockstar/1.0.0/environment b/packages/rockstar/1.0.0/environment new file mode 100644 index 0000000..19eafb2 --- /dev/null +++ b/packages/rockstar/1.0.0/environment @@ -0,0 +1,2 @@ +export ROCKSTAR_PATH=$PWD/rockstar/satriani +export PATH=$PWD/bin:$PATH \ No newline at end of file diff --git a/packages/rockstar/1.0.0/metadata.json b/packages/rockstar/1.0.0/metadata.json new file mode 100644 index 0000000..6f3957b --- /dev/null +++ b/packages/rockstar/1.0.0/metadata.json @@ -0,0 +1,6 @@ +{ + "language": "rockstar", + "version": "1.0.0", + "author": "Dan Vargas ", + "aliases": ["rockstar", "rock"] +} \ No newline at end of file diff --git a/packages/rockstar/1.0.0/run b/packages/rockstar/1.0.0/run new file mode 100644 index 0000000..7cac84f --- /dev/null +++ b/packages/rockstar/1.0.0/run @@ -0,0 +1,3 @@ +#!/bin/bash + +node $ROCKSTAR_PATH/rockstar "$@" \ No newline at end of file diff --git a/packages/rockstar/1.0.0/test.rock b/packages/rockstar/1.0.0/test.rock new file mode 100644 index 0000000..eebfa1c --- /dev/null +++ b/packages/rockstar/1.0.0/test.rock @@ -0,0 +1,9 @@ +My heart is burning powerless +My mind is failing right +Cast my heart +Cast my mind + +My feelings are empty +Let my feelings be with my heart +Let my feelings be with my mind +Shout my feelings \ No newline at end of file From eae11d6025bcee046ca7aa2a90931f3890de82c9 Mon Sep 17 00:00:00 2001 From: Dan Vargas <10914883+dvargas46@users.noreply.github.com> Date: Wed, 24 Mar 2021 15:39:17 -0500 Subject: [PATCH 339/385] pkg(cow-1.0.0): Add cow 1.0.0 (#188) Co-authored-by: Vargas, Dan --- packages/cow/1.0.0/build.sh | 12 ++++++++++++ packages/cow/1.0.0/environment | 2 ++ packages/cow/1.0.0/metadata.json | 6 ++++++ packages/cow/1.0.0/run | 2 ++ packages/cow/1.0.0/test.cow | 4 ++++ 5 files changed, 26 insertions(+) create mode 100755 packages/cow/1.0.0/build.sh create mode 100644 packages/cow/1.0.0/environment create mode 100644 packages/cow/1.0.0/metadata.json create mode 100644 packages/cow/1.0.0/run create mode 100644 packages/cow/1.0.0/test.cow diff --git a/packages/cow/1.0.0/build.sh b/packages/cow/1.0.0/build.sh new file mode 100755 index 0000000..3bf5938 --- /dev/null +++ b/packages/cow/1.0.0/build.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +# Grab the latest cow source from github +git clone -q https://github.com/BigZaphod/COW.git cow + +# Generate the cow binary into bin +mkdir -p bin +sed -i '1i#define NO_GREETINGS' cow/source/cow.cpp +g++ -o bin/cow cow/source/cow.cpp + +# Cleanup +rm -rf cow diff --git a/packages/cow/1.0.0/environment b/packages/cow/1.0.0/environment new file mode 100644 index 0000000..f31a19f --- /dev/null +++ b/packages/cow/1.0.0/environment @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +export PATH=$PWD/bin:$PATH \ No newline at end of file diff --git a/packages/cow/1.0.0/metadata.json b/packages/cow/1.0.0/metadata.json new file mode 100644 index 0000000..edd6502 --- /dev/null +++ b/packages/cow/1.0.0/metadata.json @@ -0,0 +1,6 @@ +{ + "language": "cow", + "version": "1.0.0", + "author": "Dan Vargas ", + "aliases": ["cow"] +} \ No newline at end of file diff --git a/packages/cow/1.0.0/run b/packages/cow/1.0.0/run new file mode 100644 index 0000000..4cc2d92 --- /dev/null +++ b/packages/cow/1.0.0/run @@ -0,0 +1,2 @@ +#!/bin/bash +cow "$@" diff --git a/packages/cow/1.0.0/test.cow b/packages/cow/1.0.0/test.cow new file mode 100644 index 0000000..b4223ec --- /dev/null +++ b/packages/cow/1.0.0/test.cow @@ -0,0 +1,4 @@ +MoO MoO MoO MoO MoO MoO MoO MoO +MOO moO MoO MoO MoO MoO MoO MoO MoO MoO MoO mOo MOo moo +moO MoO MoO MoO MoO MoO MoO MoO Moo +MOo MOo MOo MOo Moo \ No newline at end of file From 928c2a6d169b181c98a9b51d009203b32222d83a Mon Sep 17 00:00:00 2001 From: Dan Vargas <10914883+dvargas46@users.noreply.github.com> Date: Wed, 24 Mar 2021 15:39:36 -0500 Subject: [PATCH 340/385] pkg(pascal-3.2.0): Add pascal (FreePascal) 3.2.0 (#187) --- packages/pascal/3.2.0/build.sh | 25 +++++++++++++++++++++++++ packages/pascal/3.2.0/compile | 5 +++++ packages/pascal/3.2.0/environment | 1 + packages/pascal/3.2.0/metadata.json | 6 ++++++ packages/pascal/3.2.0/run | 4 ++++ packages/pascal/3.2.0/test.pp | 5 +++++ 6 files changed, 46 insertions(+) create mode 100755 packages/pascal/3.2.0/build.sh create mode 100644 packages/pascal/3.2.0/compile create mode 100644 packages/pascal/3.2.0/environment create mode 100644 packages/pascal/3.2.0/metadata.json create mode 100644 packages/pascal/3.2.0/run create mode 100644 packages/pascal/3.2.0/test.pp diff --git a/packages/pascal/3.2.0/build.sh b/packages/pascal/3.2.0/build.sh new file mode 100755 index 0000000..0d1a3b8 --- /dev/null +++ b/packages/pascal/3.2.0/build.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +PREFIX=$(realpath $(dirname $0)) + +mkdir -p build + +cd build +curl -L "https://sourceforge.net/projects/freepascal/files/Linux/3.2.0/fpc-3.2.0-x86_64-linux.tar/download" -o pascal.tar +tar xf pascal.tar --strip-components=1 + +# FreePascal uses an interactive installer +./install.sh << ANSWERS +$PREFIX +n +n +n +ANSWERS + +cd .. +rm -rf build + +# A sample config (needed for each "project") is written to /etc +# We'll copy that into the local lib dir (fpc searches there too on compile) +mkdir lib/fpc/etc +cp -r /etc/fp* lib/fpc/etc/ diff --git a/packages/pascal/3.2.0/compile b/packages/pascal/3.2.0/compile new file mode 100644 index 0000000..93855b7 --- /dev/null +++ b/packages/pascal/3.2.0/compile @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +# Compile pascal files +fpc -oout -v0 "$@" +chmod +x out diff --git a/packages/pascal/3.2.0/environment b/packages/pascal/3.2.0/environment new file mode 100644 index 0000000..bd0ff98 --- /dev/null +++ b/packages/pascal/3.2.0/environment @@ -0,0 +1 @@ +export PATH=$PWD/bin:$PATH \ No newline at end of file diff --git a/packages/pascal/3.2.0/metadata.json b/packages/pascal/3.2.0/metadata.json new file mode 100644 index 0000000..69f7dc7 --- /dev/null +++ b/packages/pascal/3.2.0/metadata.json @@ -0,0 +1,6 @@ +{ + "language": "pascal", + "version": "3.2.0", + "author": "Dan Vargas ", + "aliases": ["pascal", "freepascal", "pp", "pas"] +} \ No newline at end of file diff --git a/packages/pascal/3.2.0/run b/packages/pascal/3.2.0/run new file mode 100644 index 0000000..6955ba9 --- /dev/null +++ b/packages/pascal/3.2.0/run @@ -0,0 +1,4 @@ +#!/bin/bash + +shift # Filename is only used to compile +./out "$@" diff --git a/packages/pascal/3.2.0/test.pp b/packages/pascal/3.2.0/test.pp new file mode 100644 index 0000000..3c5165d --- /dev/null +++ b/packages/pascal/3.2.0/test.pp @@ -0,0 +1,5 @@ +program test; + + begin + writeln('OK'); + end. \ No newline at end of file From 3ad4375a68ce06660725fdbcb70dfb2d86da0a8b Mon Sep 17 00:00:00 2001 From: Shivansh-007 Date: Thu, 25 Mar 2021 02:22:12 +0530 Subject: [PATCH 341/385] pkg(pure-0.68): Add pure-lang 0.68 (#178) * pkg(pure-0.68): Add pure-lang 0.68 * pkg(pure-0.68): Remove `--strip-components` flag and use SemVer. * pkg(pure-0.68):Add -O flag on curl, so it just outputs to stdout * pkg(pure-0.68):Add -L flag on curl, so that it can allow redirects. * pkg(pure-0.68): Goodbye `v` flag from tar. * pkg(pure-0.68): Add python alias. * pkg(pure-0.68): Disable docs. * pkg(pure-0.68): Fix settings for enable docs. * Update build.sh * Update environment * Whoops typo. * pkg(pure-0.68):Use semver naming method i.e. instead `0.68` it should be `0.68.0` Co-authored-by: Shivansh-007 --- packages/pure/0.68.0/build.sh | 33 ++++++++++++++++++++++++++++++ packages/pure/0.68.0/environment | 5 +++++ packages/pure/0.68.0/metadata.json | 6 ++++++ packages/pure/0.68.0/run | 4 ++++ packages/pure/0.68.0/test.pure | 2 ++ 5 files changed, 50 insertions(+) create mode 100755 packages/pure/0.68.0/build.sh create mode 100644 packages/pure/0.68.0/environment create mode 100644 packages/pure/0.68.0/metadata.json create mode 100644 packages/pure/0.68.0/run create mode 100644 packages/pure/0.68.0/test.pure diff --git a/packages/pure/0.68.0/build.sh b/packages/pure/0.68.0/build.sh new file mode 100755 index 0000000..8acb9a2 --- /dev/null +++ b/packages/pure/0.68.0/build.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +PREFIX=$(realpath $(dirname $0)) + +# Python is available in the container as 'python3' and 'python2', not as 'python' +alias python=python3 + +# Installing LLVM and clang (the latter is optional but recommended) +curl -OL "http://llvm.org/releases/3.4/llvm-3.4.src.tar.gz" +curl -OL "http://llvm.org/releases/3.4/clang-3.4.src.tar.gz" +tar xfz llvm-3.4.src.tar.gz +tar xfz clang-3.4.src.tar.gz + +mv clang-3.4 llvm-3.4/tools/clang +# Cleaning up gzip files. +rm llvm-3.4.src.tar.gz && rm clang-3.4.src.tar.gz +cd llvm-3.4 + +# Building and installing - LLVM and clang +./configure --prefix="$PREFIX" --enable-optimized --enable-targets=host-only --enable-docs="no" --enable-assertions="no" +make -j$(nproc) +make install -j$(nproc) + +# Installing Pure +curl -sSLO "https://github.com/agraef/pure-lang/releases/download/pure-0.68/pure-0.68.tar.gz" +tar xfz pure-0.68.tar.gz +rm pure-0.68.tar.gz +cd pure-0.68 + +# Building and installing pure-lang +./configure --prefix="$PREFIX" --enable-release --with-tool-prefix="$PREFIX/bin" --with-static-llvm +make -j$(nproc) +make install -j$(nproc) diff --git a/packages/pure/0.68.0/environment b/packages/pure/0.68.0/environment new file mode 100644 index 0000000..73cb42f --- /dev/null +++ b/packages/pure/0.68.0/environment @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +# Put 'export' statements here for environment variables +export PATH=$PWD/bin:$PATH +export LD_LIBRARY_PATH=$PWD/lib diff --git a/packages/pure/0.68.0/metadata.json b/packages/pure/0.68.0/metadata.json new file mode 100644 index 0000000..3aadcc9 --- /dev/null +++ b/packages/pure/0.68.0/metadata.json @@ -0,0 +1,6 @@ +{ + "language": "pure", + "version": "0.68.0", + "author": "Shivansh-007 ", + "aliases": [] +} diff --git a/packages/pure/0.68.0/run b/packages/pure/0.68.0/run new file mode 100644 index 0000000..3b29e6a --- /dev/null +++ b/packages/pure/0.68.0/run @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# Put instructions to run the runtime +pure "$@" diff --git a/packages/pure/0.68.0/test.pure b/packages/pure/0.68.0/test.pure new file mode 100644 index 0000000..88aabf8 --- /dev/null +++ b/packages/pure/0.68.0/test.pure @@ -0,0 +1,2 @@ +using system; +puts "OK"; \ No newline at end of file From 01bc13d1158e20477e925302c4440584401d3983 Mon Sep 17 00:00:00 2001 From: Dan Vargas <10914883+dvargas46@users.noreply.github.com> Date: Wed, 24 Mar 2021 15:52:27 -0500 Subject: [PATCH 342/385] pkg(coffeescript-2.5.1): Add coffeescript 2.5.1 (#186) Co-authored-by: Vargas, Dan --- packages/coffeescript/2.5.1/build.sh | 10 ++++++++++ packages/coffeescript/2.5.1/environment | 1 + packages/coffeescript/2.5.1/metadata.json | 6 ++++++ packages/coffeescript/2.5.1/run | 3 +++ packages/coffeescript/2.5.1/test.coffee | 1 + 5 files changed, 21 insertions(+) create mode 100755 packages/coffeescript/2.5.1/build.sh create mode 100644 packages/coffeescript/2.5.1/environment create mode 100644 packages/coffeescript/2.5.1/metadata.json create mode 100644 packages/coffeescript/2.5.1/run create mode 100644 packages/coffeescript/2.5.1/test.coffee diff --git a/packages/coffeescript/2.5.1/build.sh b/packages/coffeescript/2.5.1/build.sh new file mode 100755 index 0000000..58d99b2 --- /dev/null +++ b/packages/coffeescript/2.5.1/build.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# Download and install NodeJS +curl "https://nodejs.org/dist/v15.10.0/node-v15.10.0-linux-x64.tar.xz" -o node.tar.xz +tar xf node.tar.xz --strip-components=1 +rm node.tar.xz +export PATH=$PWD/bin:$PATH + +# Install CoffeeScript via npm and done +npm install --global coffeescript@2.5.1 diff --git a/packages/coffeescript/2.5.1/environment b/packages/coffeescript/2.5.1/environment new file mode 100644 index 0000000..bd0ff98 --- /dev/null +++ b/packages/coffeescript/2.5.1/environment @@ -0,0 +1 @@ +export PATH=$PWD/bin:$PATH \ No newline at end of file diff --git a/packages/coffeescript/2.5.1/metadata.json b/packages/coffeescript/2.5.1/metadata.json new file mode 100644 index 0000000..97437c4 --- /dev/null +++ b/packages/coffeescript/2.5.1/metadata.json @@ -0,0 +1,6 @@ +{ + "language": "coffeescript", + "version": "2.5.1", + "author": "Dan Vargas ", + "aliases": ["coffeescript", "coffee"] +} \ No newline at end of file diff --git a/packages/coffeescript/2.5.1/run b/packages/coffeescript/2.5.1/run new file mode 100644 index 0000000..5d8cc03 --- /dev/null +++ b/packages/coffeescript/2.5.1/run @@ -0,0 +1,3 @@ +#!/bin/bash + +coffee "$@" diff --git a/packages/coffeescript/2.5.1/test.coffee b/packages/coffeescript/2.5.1/test.coffee new file mode 100644 index 0000000..b3a8f72 --- /dev/null +++ b/packages/coffeescript/2.5.1/test.coffee @@ -0,0 +1 @@ +console.log "OK" \ No newline at end of file From b31deaddbc9226f3bceaa3b14cbbed852d397e1c Mon Sep 17 00:00:00 2001 From: Brian Seymour Date: Sun, 28 Mar 2021 14:01:46 -0500 Subject: [PATCH 343/385] change port to match old piston, some formatting change, add env to fix debian warning/error --- .github/workflows/package-pr.yaml | 8 ++++---- api/Dockerfile | 8 ++++++-- api/src/config.js | 2 +- cli/index.js | 2 +- docker-compose.yaml | 30 +++++++++++++++--------------- readme.md | 6 +++--- 6 files changed, 30 insertions(+), 26 deletions(-) diff --git a/.github/workflows/package-pr.yaml b/.github/workflows/package-pr.yaml index 6c3395d..0528f8c 100644 --- a/.github/workflows/package-pr.yaml +++ b/.github/workflows/package-pr.yaml @@ -64,7 +64,7 @@ jobs: path: data/config.yaml contents: | log_level: DEBUG - bind_address: 0.0.0.0:6969 + bind_address: 0.0.0.0:2000 data_directory: /piston runner_uid_min: 1100 runner_uid_max: 1500 @@ -91,7 +91,7 @@ jobs: docker run -v $(pwd)'/repo:/piston/repo' -v $(pwd)'/packages:/piston/packages' -d --name piston_fs_repo docker.pkg.github.com/engineer-man/piston/repo-builder --no-build docker run --network container:piston_fs_repo -v $(pwd)'/data:/piston' -d --name api docker.pkg.github.com/engineer-man/piston/api echo Waiting for API to start.. - docker run --network container:api appropriate/curl -s --retry 10 --retry-connrefused http://localhost:6969/runtimes + docker run --network container:api appropriate/curl -s --retry 10 --retry-connrefused http://localhost:2000/runtimes echo Waiting for Index to start.. docker run --network container:piston_fs_repo appropriate/curl -s --retry 10 --retry-connrefused http://localhost:8000/index @@ -100,7 +100,7 @@ jobs: sed -i 's/piston_fs_repo/localhost/g' repo/index echo Listing Packages - PACKAGES_JSON=$(docker run --network container:api appropriate/curl -s http://localhost:6969/packages) + PACKAGES_JSON=$(docker run --network container:api appropriate/curl -s http://localhost:2000/packages) echo $PACKAGES_JSON echo Getting CLI ready @@ -114,7 +114,7 @@ jobs: PKG_VERSION=$(awk -F- '{ print $2 }' <<< $package) echo "Installing..." - docker run --network container:api appropriate/curl -sXPOST http://localhost:6969/packages/$PKG_PATH + docker run --network container:api appropriate/curl -sXPOST http://localhost:2000/packages/$PKG_PATH TEST_SCRIPTS=packages/$PKG_PATH/test.* echo "Tests: $TEST_SCRIPTS" diff --git a/api/Dockerfile b/api/Dockerfile index 96e64ef..f3adcf5 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -1,20 +1,24 @@ FROM node:15.8.0-buster-slim + RUN dpkg-reconfigure -p critical dash RUN for i in $(seq 1001 1500); do \ groupadd -g $i runner$i && \ useradd -M runner$i -g $i -u $i ; \ done RUN apt-get update && \ - apt-get install -y libxml2 gnupg tar coreutils util-linux libc6-dev binutils build-essential locales libpcre3-dev libevent-dev libgmp3-dev libncurses6 libncurses5 libedit-dev && \ + apt-get install -y libxml2 gnupg tar coreutils util-linux libc6-dev \ + binutils build-essential locales libpcre3-dev libevent-dev libgmp3-dev \ + libncurses6 libncurses5 libedit-dev && \ rm -rf /var/lib/apt/lists/* RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen ENV NODE_ENV=production +ENV DEBIAN_FRONTEND noninteractive WORKDIR /piston_api COPY ["package.json", "yarn.lock", "./"] RUN yarn COPY ./src ./src CMD [ "node", "src", "-m", "-c", "/piston/config.yaml"] -EXPOSE 6969/tcp +EXPOSE 2000/tcp diff --git a/api/src/config.js b/api/src/config.js index ade4a36..023cc8e 100644 --- a/api/src/config.js +++ b/api/src/config.js @@ -45,7 +45,7 @@ const options = [ { key: 'bind_address', desc: 'Address to bind REST API on\nThank @Bones for the number', - default: '0.0.0.0:6969', + default: '0.0.0.0:2000', validators: [] }, { diff --git a/cli/index.js b/cli/index.js index 8bb17e0..415dbf3 100755 --- a/cli/index.js +++ b/cli/index.js @@ -13,7 +13,7 @@ const axios_instance = function(argv){ require('yargs')(process.argv.slice(2)) .option('piston-url', { alias: ['u'], - default: 'http://127.0.0.1:6969', + default: 'http://127.0.0.1:2000', desc: 'Piston API URL', string: true }) diff --git a/docker-compose.yaml b/docker-compose.yaml index 67e1253..ed67d43 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,19 +1,19 @@ version: '3.8' services: - piston_api: - build: api - privileged: true - restart: always - ports: - - 6969:6969 - volumes: - - ./data/piston:/piston - tmpfs: - - /piston/jobs:exec + piston_api: + build: api + privileged: true + restart: always + ports: + - 2000:2000 + volumes: + - ./data/piston:/piston + tmpfs: + - /piston/jobs:exec - piston_fs_repo: # Local testing of packages - build: repo - command: ['dart-2.12.1'] # Only build dart - volumes: - - .:/piston \ No newline at end of file + piston_fs_repo: # Local testing of packages + build: repo + command: ['dart-2.12.1'] # Only build dart + volumes: + - .:/piston diff --git a/readme.md b/readme.md index 32f7dd9..cd4ab15 100644 --- a/readme.md +++ b/readme.md @@ -121,7 +121,7 @@ cd cli && yarn && cd - echo "$GITHUB_TOKEN" | docker login https://docker.pkg.github.com -u "$GITHUB_USERNAME" --password-stdin # Change out the $GITHUB_TOKEN and $GITHUB_USERNAME with appropritate values -docker run -v $PWD:'/piston' --tmpfs /piston/jobs -dit -p 6969:6969 --privileged --name piston_api docker.pkg.github.com/engineer-man/piston/api:latest +docker run -v $PWD:'/piston' --tmpfs /piston/jobs -dit -p 2000:2000 --privileged --name piston_api docker.pkg.github.com/engineer-man/piston/api:latest ```
@@ -149,12 +149,12 @@ cli/index.js run python 3.9.1 test.py If you are operating on a remote machine, add the `-u` flag like so: ```sh -cli/index.js -u http://piston.server:6969 ppman list +cli/index.js -u http://piston.server:2000 ppman list ``` ### API -The container exposes an API on port 6969 by default. +The container exposes an API on port 2000 by default. This is used by the CLI to carry out running jobs and package managment. #### Runtimes Endpoint From 7aa52bb0c5616c3f257c11e79c73ae3f380e7d8c Mon Sep 17 00:00:00 2001 From: Brian Seymour Date: Sun, 28 Mar 2021 14:03:08 -0500 Subject: [PATCH 344/385] move env --- api/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/Dockerfile b/api/Dockerfile index f3adcf5..e9948d8 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -1,5 +1,7 @@ FROM node:15.8.0-buster-slim +ENV DEBIAN_FRONTEND=noninteractive + RUN dpkg-reconfigure -p critical dash RUN for i in $(seq 1001 1500); do \ groupadd -g $i runner$i && \ @@ -14,7 +16,7 @@ RUN apt-get update && \ RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen ENV NODE_ENV=production -ENV DEBIAN_FRONTEND noninteractive + WORKDIR /piston_api COPY ["package.json", "yarn.lock", "./"] RUN yarn From 902ad71578a8e25f319d04c79a80452729380c70 Mon Sep 17 00:00:00 2001 From: Brian Seymour Date: Sun, 28 Mar 2021 14:29:28 -0500 Subject: [PATCH 345/385] remove unnecessary author fields --- api/src/index.js | 1 - api/src/runtime.js | 3 +-- cli/package.json | 21 ++++++++++----------- packages/CONTRIBUTING.MD | 7 +++---- packages/bash/5.1.0/metadata.json | 7 +++---- packages/brainfuck/2.7.3/metadata.json | 7 +++---- packages/clojure/1.10.3/metadata.json | 7 +++---- packages/coffeescript/2.5.1/metadata.json | 3 +-- packages/cow/1.0.0/metadata.json | 3 +-- packages/crystal/0.36.1/metadata.json | 3 +-- packages/dart/2.12.1/metadata.json | 7 +++---- packages/dash/0.5.11/metadata.json | 7 +++---- packages/deno/1.7.5/metadata.json | 3 +-- packages/dotnet/5.0.201/metadata.json | 7 +++---- packages/elixir/1.11.3/metadata.json | 3 +-- packages/emacs/27.1.0/metadata.json | 3 +-- packages/erlang/23.0.0/metadata.json | 3 +-- packages/gawk/5.1.0/metadata.json | 7 +++---- packages/gcc/10.2.0/metadata.json | 7 +++---- packages/go/1.16.2/metadata.json | 1 - packages/haskell/9.0.1/metadata.json | 3 +-- packages/init | 5 ++--- packages/java/15.0.2/metadata.json | 7 +++---- packages/jelly/0.1.31/metadata.json | 3 +-- packages/julia/1.5.4/metadata.json | 7 +++---- packages/kotlin/1.4.31/metadata.json | 7 +++---- packages/lisp/2.1.2/metadata.json | 7 +++---- packages/lolcode/0.11.2/metadata.json | 1 - packages/lua/5.4.2/metadata.json | 3 +-- packages/mono/6.12.0/metadata.json | 3 +-- packages/nasm/2.15.5/metadata.json | 7 +++---- packages/nim/1.4.4/metadata.json | 3 +-- packages/node/15.10.0/metadata.json | 3 +-- packages/osabie/1.0.1/metadata.json | 3 +-- packages/paradoc/0.6.0/metadata.json | 3 +-- packages/pascal/3.2.0/metadata.json | 3 +-- packages/perl/5.26.1/metadata.json | 3 +-- packages/php/8.0.2/metadata.json | 5 ++--- packages/prolog/8.2.4/metadata.json | 7 +++---- packages/pure/0.68.0/metadata.json | 1 - packages/python/2.7.18/metadata.json | 3 +-- packages/python/3.5.10/metadata.json | 3 +-- packages/python/3.9.1/metadata.json | 3 +-- packages/rockstar/1.0.0/metadata.json | 3 +-- packages/ruby/2.5.1/metadata.json | 3 +-- packages/rust/1.50.0/metadata.json | 7 +++---- packages/scala/3.0.0/metadata.json | 7 +++---- packages/swift/5.3.3/metadata.json | 7 +++---- packages/typescript/4.2.3/metadata.json | 7 +++---- packages/vlang/0.1.13/metadata.json | 1 - packages/zig/0.7.1/metadata.json | 7 +++---- readme.md | 4 +--- 52 files changed, 98 insertions(+), 151 deletions(-) diff --git a/api/src/index.js b/api/src/index.js index 63d1393..00b55b8 100644 --- a/api/src/index.js +++ b/api/src/index.js @@ -92,7 +92,6 @@ const app = express(); return { language: rt.language, version: rt.version.raw, - author: rt.author, aliases: rt.aliases }; }); diff --git a/api/src/runtime.js b/api/src/runtime.js index 2603835..8d0604e 100644 --- a/api/src/runtime.js +++ b/api/src/runtime.js @@ -14,12 +14,11 @@ class Runtime { fss.read_file_sync(path.join(package_dir, 'pkg-info.json')) ); - const { language, version, author, build_platform, aliases } = info; + const { language, version, build_platform, aliases } = info; this.pkgdir = package_dir; this.language = language; this.version = semver.parse(version); - this.author = author; this.aliases = aliases; if (build_platform !== globals.platform) { diff --git a/cli/package.json b/cli/package.json index 5d89dfd..6a998a4 100644 --- a/cli/package.json +++ b/cli/package.json @@ -1,13 +1,12 @@ { - "name": "piston-cli", - "version": "1.0.0", - "description": "Piston Execution Engine CLI tools", - "main": "index.js", - "author": "Thomas Hobson ", - "license": "MIT", - "dependencies": { - "axios": "^0.21.1", - "chalk": "^4.1.0", - "yargs": "^16.2.0" - } + "name": "piston-cli", + "version": "1.0.0", + "description": "Piston Execution Engine CLI tools", + "main": "index.js", + "license": "MIT", + "dependencies": { + "axios": "^0.21.1", + "chalk": "^4.1.0", + "yargs": "^16.2.0" + } } diff --git a/packages/CONTRIBUTING.MD b/packages/CONTRIBUTING.MD index 499cff8..813f71e 100644 --- a/packages/CONTRIBUTING.MD +++ b/packages/CONTRIBUTING.MD @@ -16,7 +16,7 @@ See [deno/1.7.5/](deno/1.7.5/) or any other directory for examples. 3. Create a file named `build.sh`, adding a shebang for bash `#!/bin/bash` on the first line. In this file put any steps to compile the specified langauge. -This script should download sources, compile sources and output binaries. They should be dumped into the current working directory, removing any files which aren't required in the process. +This script should download sources, compile sources and output binaries. They should be dumped into the current working directory, removing any files which aren't required in the process. 4. Create a file named `run`, containing bash script to run the interpreter. The first argument given to this script (`$1`) is the name of the main file, with the remaining ones as program arguments. @@ -27,7 +27,7 @@ The first argument is always the main file, followed the names of the other file 6. Create a file named `environment`, containing `export` statements which edit the environment variables accordingly. The `$PWD` variable should be used, and is set inside the package directory when running on the target system. -7. Create a test script starting with test, with the file extension of the language. This script should simply output the phrase `OK`. For example, for mono we would create `test.cs` with the content: +7. Create a test script starting with test, with the file extension of the language. This script should simply output the phrase `OK`. For example, for mono we would create `test.cs` with the content: ```cs using System; @@ -40,13 +40,12 @@ public class Test } ``` -8. Create a `metadata.json` file which contains metadata about the language and interpreter. This simply contains the language name, as in the folder name, the version as in the folder name, the author's name and email address, aliases that can be used to call this package, and finally a dependencies map. +8. Create a `metadata.json` file which contains metadata about the language and interpreter. This simply contains the language name, as in the folder name, the version as in the folder name, aliases that can be used to call this package, and finally a dependencies map. The dependencies map contains the keys as language names, and the values as semver selectors for packages. ```json { "language": "deno", "version": "1.7.5", - "author": "Thomas Hobson ", "dependencies": {}, "aliases": ["deno-ts", "deno-js"] } diff --git a/packages/bash/5.1.0/metadata.json b/packages/bash/5.1.0/metadata.json index acd4c6b..9ac1250 100644 --- a/packages/bash/5.1.0/metadata.json +++ b/packages/bash/5.1.0/metadata.json @@ -1,6 +1,5 @@ { - "language": "bash", - "version": "5.1.0", - "aliases": ["sh"], - "author": "Thomas Hobson " + "language": "bash", + "version": "5.1.0", + "aliases": ["sh"] } diff --git a/packages/brainfuck/2.7.3/metadata.json b/packages/brainfuck/2.7.3/metadata.json index 5d9fc66..a9f3083 100644 --- a/packages/brainfuck/2.7.3/metadata.json +++ b/packages/brainfuck/2.7.3/metadata.json @@ -1,6 +1,5 @@ { - "language": "brainfuck", - "version": "2.7.3", - "aliases": ["bf"], - "author": "Thomas Hobson " + "language": "brainfuck", + "version": "2.7.3", + "aliases": ["bf"] } diff --git a/packages/clojure/1.10.3/metadata.json b/packages/clojure/1.10.3/metadata.json index 64f83fa..847ecb6 100644 --- a/packages/clojure/1.10.3/metadata.json +++ b/packages/clojure/1.10.3/metadata.json @@ -1,6 +1,5 @@ { - "language": "clojure", - "version": "1.10.3", - "aliases": ["clojure","clj"], - "author": "Dan Vargas " + "language": "clojure", + "version": "1.10.3", + "aliases": ["clojure", "clj"] } diff --git a/packages/coffeescript/2.5.1/metadata.json b/packages/coffeescript/2.5.1/metadata.json index 97437c4..23380d1 100644 --- a/packages/coffeescript/2.5.1/metadata.json +++ b/packages/coffeescript/2.5.1/metadata.json @@ -1,6 +1,5 @@ { "language": "coffeescript", "version": "2.5.1", - "author": "Dan Vargas ", "aliases": ["coffeescript", "coffee"] -} \ No newline at end of file +} diff --git a/packages/cow/1.0.0/metadata.json b/packages/cow/1.0.0/metadata.json index edd6502..2dcca9f 100644 --- a/packages/cow/1.0.0/metadata.json +++ b/packages/cow/1.0.0/metadata.json @@ -1,6 +1,5 @@ { "language": "cow", "version": "1.0.0", - "author": "Dan Vargas ", "aliases": ["cow"] -} \ No newline at end of file +} diff --git a/packages/crystal/0.36.1/metadata.json b/packages/crystal/0.36.1/metadata.json index ca2c062..ee995eb 100644 --- a/packages/crystal/0.36.1/metadata.json +++ b/packages/crystal/0.36.1/metadata.json @@ -1,6 +1,5 @@ { "language": "crystal", "version": "0.36.1", - "author": "Dan Vargas ", "aliases": ["crystal", "cr"] -} \ No newline at end of file +} diff --git a/packages/dart/2.12.1/metadata.json b/packages/dart/2.12.1/metadata.json index 388121e..cec3d77 100644 --- a/packages/dart/2.12.1/metadata.json +++ b/packages/dart/2.12.1/metadata.json @@ -1,6 +1,5 @@ { - "language": "dart", - "version": "2.12.1", - "aliases": [], - "author": "Thomas Hobson " + "language": "dart", + "version": "2.12.1", + "aliases": [] } diff --git a/packages/dash/0.5.11/metadata.json b/packages/dash/0.5.11/metadata.json index a07a67e..a2e5be5 100644 --- a/packages/dash/0.5.11/metadata.json +++ b/packages/dash/0.5.11/metadata.json @@ -1,6 +1,5 @@ { - "language": "dash", - "version": "0.5.11", - "aliases": ["dash"], - "author": "Dan Vargas " + "language": "dash", + "version": "0.5.11", + "aliases": ["dash"] } diff --git a/packages/deno/1.7.5/metadata.json b/packages/deno/1.7.5/metadata.json index a73d171..60b8a65 100644 --- a/packages/deno/1.7.5/metadata.json +++ b/packages/deno/1.7.5/metadata.json @@ -1,6 +1,5 @@ { "language": "deno", "version": "1.7.5", - "author": "Thomas Hobson ", "aliases": ["deno-ts", "deno-js"] -} \ No newline at end of file +} diff --git a/packages/dotnet/5.0.201/metadata.json b/packages/dotnet/5.0.201/metadata.json index 72f2e79..619265d 100644 --- a/packages/dotnet/5.0.201/metadata.json +++ b/packages/dotnet/5.0.201/metadata.json @@ -1,6 +1,5 @@ { - "language": "dotnet", - "version": "5.0.201", - "aliases": ["cs", "csharp"], - "author": "Thomas Hobson " + "language": "dotnet", + "version": "5.0.201", + "aliases": ["cs", "csharp"] } diff --git a/packages/elixir/1.11.3/metadata.json b/packages/elixir/1.11.3/metadata.json index 6349e0e..9c1a2fc 100644 --- a/packages/elixir/1.11.3/metadata.json +++ b/packages/elixir/1.11.3/metadata.json @@ -1,6 +1,5 @@ { "language": "elixir", "version": "1.11.3", - "author": "Dan Vargas ", "aliases": ["elixir", "exs"] -} \ No newline at end of file +} diff --git a/packages/emacs/27.1.0/metadata.json b/packages/emacs/27.1.0/metadata.json index bcd3d08..caa2fb4 100644 --- a/packages/emacs/27.1.0/metadata.json +++ b/packages/emacs/27.1.0/metadata.json @@ -1,6 +1,5 @@ { "language": "emacs", "version": "27.1.0", - "author": "Dan Vargas ", "aliases": ["emacs", "el", "elisp"] -} \ No newline at end of file +} diff --git a/packages/erlang/23.0.0/metadata.json b/packages/erlang/23.0.0/metadata.json index d035d40..e82b4b3 100644 --- a/packages/erlang/23.0.0/metadata.json +++ b/packages/erlang/23.0.0/metadata.json @@ -1,6 +1,5 @@ { "language": "erlang", "version": "23.0.0", - "author": "Dan Vargas ", "aliases": ["erlang", "erl", "escript"] -} \ No newline at end of file +} diff --git a/packages/gawk/5.1.0/metadata.json b/packages/gawk/5.1.0/metadata.json index a4f3ae2..e22b5d1 100644 --- a/packages/gawk/5.1.0/metadata.json +++ b/packages/gawk/5.1.0/metadata.json @@ -1,6 +1,5 @@ { - "language": "gawk", - "version": "5.1.0", - "aliases": ["awk"], - "author": "Thomas Hobson " + "language": "gawk", + "version": "5.1.0", + "aliases": ["awk"] } diff --git a/packages/gcc/10.2.0/metadata.json b/packages/gcc/10.2.0/metadata.json index 8f3e9b5..6e211f6 100644 --- a/packages/gcc/10.2.0/metadata.json +++ b/packages/gcc/10.2.0/metadata.json @@ -1,6 +1,5 @@ { - "language": "gcc", - "version": "10.2.0", - "aliases": ["c","g++","c++","cpp","gdc","d"], - "author": "Thomas Hobson " + "language": "gcc", + "version": "10.2.0", + "aliases": ["c", "g++", "c++", "cpp", "gdc", "d"] } diff --git a/packages/go/1.16.2/metadata.json b/packages/go/1.16.2/metadata.json index 7f9e443..0144808 100644 --- a/packages/go/1.16.2/metadata.json +++ b/packages/go/1.16.2/metadata.json @@ -1,6 +1,5 @@ { "language": "go", "version": "1.16.2", - "author": "Victor Frazao ", "aliases": ["go", "golang"] } diff --git a/packages/haskell/9.0.1/metadata.json b/packages/haskell/9.0.1/metadata.json index c6fae6d..d58d528 100644 --- a/packages/haskell/9.0.1/metadata.json +++ b/packages/haskell/9.0.1/metadata.json @@ -1,6 +1,5 @@ { "language": "haskell", "version": "9.0.1", - "author": "Dan Vargas ", "aliases": ["haskell", "hs"] -} \ No newline at end of file +} diff --git a/packages/init b/packages/init index 5a0c9b9..68a303b 100755 --- a/packages/init +++ b/packages/init @@ -9,7 +9,6 @@ fi NAME=$1 VERSION=$2 -AUTHOR="$(git config user.name) <$(git config user.email)>" SOURCE=$3 DIR=$NAME/$VERSION @@ -26,7 +25,7 @@ build_instructions(){ echo "curl \"$SOURCE\" -o $NAME.tar.gz" echo echo "tar xzf $NAME.tar.gz --strip-components=1" - echo + echo echo "# === autoconf based ===" echo './configure --prefix "$PREFIX"' @@ -58,7 +57,7 @@ echo "$NAME-$VERSION \"\$@\"" >> run echo "# Put instructions to compile source code, remove this file if the language does not require this stage" >> compile -jq '.language = "'$NAME'" | .version = "'$VERSION'" | .aliases = [] | .author = "'"$AUTHOR"'"' <<< "{}" > metadata.json +jq '.language = "'$NAME'" | .version = "'$VERSION'" | .aliases = []' <<< "{}" > metadata.json cd - > /dev/null diff --git a/packages/java/15.0.2/metadata.json b/packages/java/15.0.2/metadata.json index 2f24706..9c3a298 100644 --- a/packages/java/15.0.2/metadata.json +++ b/packages/java/15.0.2/metadata.json @@ -1,6 +1,5 @@ { - "language": "java", - "version": "15.0.2", - "aliases": [], - "author": "Thomas Hobson " + "language": "java", + "version": "15.0.2", + "aliases": [] } diff --git a/packages/jelly/0.1.31/metadata.json b/packages/jelly/0.1.31/metadata.json index bf63814..905242e 100644 --- a/packages/jelly/0.1.31/metadata.json +++ b/packages/jelly/0.1.31/metadata.json @@ -1,6 +1,5 @@ { "language": "jelly", "version": "0.1.31", - "author": "Thomas Hobson ", "aliases": [] -} \ No newline at end of file +} diff --git a/packages/julia/1.5.4/metadata.json b/packages/julia/1.5.4/metadata.json index 3dfba09..f177ea8 100644 --- a/packages/julia/1.5.4/metadata.json +++ b/packages/julia/1.5.4/metadata.json @@ -1,6 +1,5 @@ { - "language": "julia", - "version": "1.5.4", - "aliases": ["jl"], - "author": "Victor Frazao " + "language": "julia", + "version": "1.5.4", + "aliases": ["jl"] } diff --git a/packages/kotlin/1.4.31/metadata.json b/packages/kotlin/1.4.31/metadata.json index 87ffdf8..304c5cd 100644 --- a/packages/kotlin/1.4.31/metadata.json +++ b/packages/kotlin/1.4.31/metadata.json @@ -1,6 +1,5 @@ { - "language": "kotlin", - "version": "1.4.31", - "aliases": ["kt"], - "author": "Thomas Hobson " + "language": "kotlin", + "version": "1.4.31", + "aliases": ["kt"] } diff --git a/packages/lisp/2.1.2/metadata.json b/packages/lisp/2.1.2/metadata.json index fd35513..185cf9e 100644 --- a/packages/lisp/2.1.2/metadata.json +++ b/packages/lisp/2.1.2/metadata.json @@ -1,6 +1,5 @@ { - "language": "lisp", - "version": "2.1.2", - "aliases": ["lisp","cl","sbcl","commonlisp"], - "author": "Dan Vargas " + "language": "lisp", + "version": "2.1.2", + "aliases": ["lisp", "cl", "sbcl", "commonlisp"] } diff --git a/packages/lolcode/0.11.2/metadata.json b/packages/lolcode/0.11.2/metadata.json index 80e46ea..1bd6bbf 100644 --- a/packages/lolcode/0.11.2/metadata.json +++ b/packages/lolcode/0.11.2/metadata.json @@ -1,6 +1,5 @@ { "language": "lolcode", "version": "0.11.2", - "author": "Shivansh-007 ", "aliases": ["lol", "lci"] } diff --git a/packages/lua/5.4.2/metadata.json b/packages/lua/5.4.2/metadata.json index 401c03a..f0396db 100644 --- a/packages/lua/5.4.2/metadata.json +++ b/packages/lua/5.4.2/metadata.json @@ -1,6 +1,5 @@ { "language": "lua", "version": "5.4.2", - "author": "Shivansh-007 ", "aliases": ["lua"] -} \ No newline at end of file +} diff --git a/packages/mono/6.12.0/metadata.json b/packages/mono/6.12.0/metadata.json index a7c979b..85679bf 100644 --- a/packages/mono/6.12.0/metadata.json +++ b/packages/mono/6.12.0/metadata.json @@ -1,6 +1,5 @@ { "language": "mono", "version": "6.12.0", - "author": "Thomas Hobson ", "aliases": ["csharp", "cs"] -} \ No newline at end of file +} diff --git a/packages/nasm/2.15.5/metadata.json b/packages/nasm/2.15.5/metadata.json index e9d1507..9f8a384 100644 --- a/packages/nasm/2.15.5/metadata.json +++ b/packages/nasm/2.15.5/metadata.json @@ -1,6 +1,5 @@ { - "language": "nasm", - "version": "2.15.5", - "aliases": ["nasm64"], - "author": "Thomas Hobson " + "language": "nasm", + "version": "2.15.5", + "aliases": ["nasm64"] } diff --git a/packages/nim/1.4.4/metadata.json b/packages/nim/1.4.4/metadata.json index 6f88382..f23eb0e 100644 --- a/packages/nim/1.4.4/metadata.json +++ b/packages/nim/1.4.4/metadata.json @@ -1,6 +1,5 @@ { "language": "nim", "version": "1.4.4", - "author": "Dan Vargas ", "aliases": ["nim"] -} \ No newline at end of file +} diff --git a/packages/node/15.10.0/metadata.json b/packages/node/15.10.0/metadata.json index 972f4f2..2f601d1 100644 --- a/packages/node/15.10.0/metadata.json +++ b/packages/node/15.10.0/metadata.json @@ -1,6 +1,5 @@ { "language": "node", "version": "15.10.0", - "author": "Martin Kos ", "aliases": ["node-javascript", "node-js", "javascript", "js"] -} \ No newline at end of file +} diff --git a/packages/osabie/1.0.1/metadata.json b/packages/osabie/1.0.1/metadata.json index 140965f..d4480d2 100644 --- a/packages/osabie/1.0.1/metadata.json +++ b/packages/osabie/1.0.1/metadata.json @@ -1,6 +1,5 @@ { "language": "osabie", "version": "1.0.1", - "author": "Dan Vargas ", "aliases": ["osabie", "05AB1E", "usable"] -} \ No newline at end of file +} diff --git a/packages/paradoc/0.6.0/metadata.json b/packages/paradoc/0.6.0/metadata.json index 8037f2a..cdbb30a 100644 --- a/packages/paradoc/0.6.0/metadata.json +++ b/packages/paradoc/0.6.0/metadata.json @@ -1,6 +1,5 @@ { "language": "paradoc", "version": "0.6.0", - "author": "Dan Vargas ", "aliases": ["paradoc"] -} \ No newline at end of file +} diff --git a/packages/pascal/3.2.0/metadata.json b/packages/pascal/3.2.0/metadata.json index 69f7dc7..daaca4f 100644 --- a/packages/pascal/3.2.0/metadata.json +++ b/packages/pascal/3.2.0/metadata.json @@ -1,6 +1,5 @@ { "language": "pascal", "version": "3.2.0", - "author": "Dan Vargas ", "aliases": ["pascal", "freepascal", "pp", "pas"] -} \ No newline at end of file +} diff --git a/packages/perl/5.26.1/metadata.json b/packages/perl/5.26.1/metadata.json index e3267e4..67a6624 100644 --- a/packages/perl/5.26.1/metadata.json +++ b/packages/perl/5.26.1/metadata.json @@ -1,6 +1,5 @@ { "language": "perl", "version": "5.26.1", - "author": "Dan Vargas ", "aliases": ["perl", "pl"] -} \ No newline at end of file +} diff --git a/packages/php/8.0.2/metadata.json b/packages/php/8.0.2/metadata.json index 2da0ef9..14d3e11 100644 --- a/packages/php/8.0.2/metadata.json +++ b/packages/php/8.0.2/metadata.json @@ -1,6 +1,5 @@ { "language": "php", "version": "8.0.2", - "author": "Martin Kos ", - "aliases": ["php8","html"] -} \ No newline at end of file + "aliases": ["php8", "html"] +} diff --git a/packages/prolog/8.2.4/metadata.json b/packages/prolog/8.2.4/metadata.json index 8238856..d799d87 100644 --- a/packages/prolog/8.2.4/metadata.json +++ b/packages/prolog/8.2.4/metadata.json @@ -1,6 +1,5 @@ { - "language": "prolog", - "version": "8.2.4", - "aliases": ["prolog","plg"], - "author": "Dan Vargas " + "language": "prolog", + "version": "8.2.4", + "aliases": ["prolog", "plg"] } diff --git a/packages/pure/0.68.0/metadata.json b/packages/pure/0.68.0/metadata.json index 3aadcc9..409df52 100644 --- a/packages/pure/0.68.0/metadata.json +++ b/packages/pure/0.68.0/metadata.json @@ -1,6 +1,5 @@ { "language": "pure", "version": "0.68.0", - "author": "Shivansh-007 ", "aliases": [] } diff --git a/packages/python/2.7.18/metadata.json b/packages/python/2.7.18/metadata.json index fb22add..7677ded 100644 --- a/packages/python/2.7.18/metadata.json +++ b/packages/python/2.7.18/metadata.json @@ -1,6 +1,5 @@ { "language": "python", "version": "2.7.18", - "author": "Shivansh-007 ", "aliases": ["py", "python2"] -} \ No newline at end of file +} diff --git a/packages/python/3.5.10/metadata.json b/packages/python/3.5.10/metadata.json index 6432f16..fca2ef6 100644 --- a/packages/python/3.5.10/metadata.json +++ b/packages/python/3.5.10/metadata.json @@ -1,6 +1,5 @@ { "language": "python", "version": "3.5.10", - "author": "Shivansh-007 ", "aliases": ["py", "python3"] -} \ No newline at end of file +} diff --git a/packages/python/3.9.1/metadata.json b/packages/python/3.9.1/metadata.json index 306c376..5537b3e 100644 --- a/packages/python/3.9.1/metadata.json +++ b/packages/python/3.9.1/metadata.json @@ -1,6 +1,5 @@ { "language": "python", "version": "3.9.1", - "author": "Thomas Hobson ", "aliases": ["py", "python3"] -} \ No newline at end of file +} diff --git a/packages/rockstar/1.0.0/metadata.json b/packages/rockstar/1.0.0/metadata.json index 6f3957b..f65bfd6 100644 --- a/packages/rockstar/1.0.0/metadata.json +++ b/packages/rockstar/1.0.0/metadata.json @@ -1,6 +1,5 @@ { "language": "rockstar", "version": "1.0.0", - "author": "Dan Vargas ", "aliases": ["rockstar", "rock"] -} \ No newline at end of file +} diff --git a/packages/ruby/2.5.1/metadata.json b/packages/ruby/2.5.1/metadata.json index e22c78c..a483428 100644 --- a/packages/ruby/2.5.1/metadata.json +++ b/packages/ruby/2.5.1/metadata.json @@ -1,6 +1,5 @@ { "language": "ruby", "version": "2.5.1", - "author": "Dan Vargas ", "aliases": ["ruby", "rb"] -} \ No newline at end of file +} diff --git a/packages/rust/1.50.0/metadata.json b/packages/rust/1.50.0/metadata.json index 48dc091..57cefa0 100644 --- a/packages/rust/1.50.0/metadata.json +++ b/packages/rust/1.50.0/metadata.json @@ -1,6 +1,5 @@ { - "language": "rust", - "version": "1.50.0", - "aliases": ["rs"], - "author": "Victor Frazao " + "language": "rust", + "version": "1.50.0", + "aliases": ["rs"] } diff --git a/packages/scala/3.0.0/metadata.json b/packages/scala/3.0.0/metadata.json index 6227bb9..8c2e7b4 100644 --- a/packages/scala/3.0.0/metadata.json +++ b/packages/scala/3.0.0/metadata.json @@ -1,6 +1,5 @@ { - "language": "scala", - "version": "3.0.0", - "aliases": ["scala","sc"], - "author": "Dan Vargas " + "language": "scala", + "version": "3.0.0", + "aliases": ["scala", "sc"] } diff --git a/packages/swift/5.3.3/metadata.json b/packages/swift/5.3.3/metadata.json index 679b8da..ecc52ae 100644 --- a/packages/swift/5.3.3/metadata.json +++ b/packages/swift/5.3.3/metadata.json @@ -1,6 +1,5 @@ { - "language": "swift", - "version": "5.3.3", - "aliases": ["swift"], - "author": "Dan Vargas " + "language": "swift", + "version": "5.3.3", + "aliases": ["swift"] } diff --git a/packages/typescript/4.2.3/metadata.json b/packages/typescript/4.2.3/metadata.json index f4a54de..cc7669b 100644 --- a/packages/typescript/4.2.3/metadata.json +++ b/packages/typescript/4.2.3/metadata.json @@ -1,6 +1,5 @@ { - "language": "typescript", - "version": "4.2.3", - "aliases": ["ts","node-ts","tsc"], - "author": "Thomas Hobson " + "language": "typescript", + "version": "4.2.3", + "aliases": ["ts", "node-ts", "tsc"] } diff --git a/packages/vlang/0.1.13/metadata.json b/packages/vlang/0.1.13/metadata.json index 855f7bb..d136076 100644 --- a/packages/vlang/0.1.13/metadata.json +++ b/packages/vlang/0.1.13/metadata.json @@ -1,6 +1,5 @@ { "language": "vlang", "version": "0.1.13", - "author": "Shivansh-007 ", "aliases": ["v"] } diff --git a/packages/zig/0.7.1/metadata.json b/packages/zig/0.7.1/metadata.json index 3de611e..2712dc0 100644 --- a/packages/zig/0.7.1/metadata.json +++ b/packages/zig/0.7.1/metadata.json @@ -1,6 +1,5 @@ { - "language": "zig", - "version": "0.7.1", - "aliases": ["zig"], - "author": "Dan Vargas " + "language": "zig", + "version": "0.7.1", + "aliases": ["zig"] } diff --git a/readme.md b/readme.md index cd4ab15..1e588f2 100644 --- a/readme.md +++ b/readme.md @@ -159,7 +159,7 @@ This is used by the CLI to carry out running jobs and package managment. #### Runtimes Endpoint `GET /runtimes` -This endpoint will return the supported languages along with the current version, author and aliases. To execute +This endpoint will return the supported languages along with the current version and aliases. To execute code for a particular language using the `/jobs` endpoint, either the name or one of the aliases must be provided, along with the version. Multiple versions of the same language may be present at the same time, and may be selected when running a job. @@ -171,7 +171,6 @@ Content-Type: application/json { "language": "bash", "version": "5.1.0", - "author": "Thomas Hobson ", "aliases": [ "sh" ] @@ -179,7 +178,6 @@ Content-Type: application/json { "language": "brainfuck", "version": "2.7.3", - "author": "Thomas Hobson ", "aliases": [ "bf" ] From 607123f73d3b3f10dd86fbadc3861d0a0d2b0b3a Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Mon, 29 Mar 2021 21:33:49 +1300 Subject: [PATCH 346/385] switch to yarn --- .github/workflows/package-pr.yaml | 2 +- api/Dockerfile | 4 +- api/package-lock.json | 1328 ++++++++++++++++++++++++++++ api/yarn.lock | 1343 ----------------------------- cli/package-lock.json | 387 +++++++++ cli/yarn.lock | 141 --- readme.md | 3 +- shell.nix | 2 +- 8 files changed, 1720 insertions(+), 1490 deletions(-) create mode 100644 api/package-lock.json delete mode 100644 api/yarn.lock create mode 100644 cli/package-lock.json delete mode 100644 cli/yarn.lock diff --git a/.github/workflows/package-pr.yaml b/.github/workflows/package-pr.yaml index 6c3395d..0a35c8c 100644 --- a/.github/workflows/package-pr.yaml +++ b/.github/workflows/package-pr.yaml @@ -104,7 +104,7 @@ jobs: echo $PACKAGES_JSON echo Getting CLI ready - docker run -v "$PWD/cli:/app" --entrypoint /bin/bash node:15 -c 'cd /app; yarn' + docker run -v "$PWD/cli:/app" --entrypoint /bin/bash node:15 -c 'cd /app; npm i' for package in $(jq -r '.[] | "\(.language)-\(.language_version)"' <<< "$PACKAGES_JSON") do diff --git a/api/Dockerfile b/api/Dockerfile index 96e64ef..7b873ce 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -12,8 +12,8 @@ RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen ENV NODE_ENV=production WORKDIR /piston_api -COPY ["package.json", "yarn.lock", "./"] -RUN yarn +COPY ["package.json", "package-lock.json", "./"] +RUN npm i COPY ./src ./src CMD [ "node", "src", "-m", "-c", "/piston/config.yaml"] diff --git a/api/package-lock.json b/api/package-lock.json new file mode 100644 index 0000000..4106074 --- /dev/null +++ b/api/package-lock.json @@ -0,0 +1,1328 @@ +{ + "name": "piston-api", + "version": "3.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "piston-api", + "version": "3.0.0", + "license": "MIT", + "dependencies": { + "body-parser": "^1.19.0", + "express": "^4.17.1", + "express-validator": "^6.10.0", + "is-docker": "^2.1.1", + "js-yaml": "^4.0.0", + "logplease": "^1.2.15", + "nocamel": "HexF/nocamel#patch-1", + "node-fetch": "^2.6.1", + "semver": "^7.3.4", + "uuid": "^8.3.2", + "yargs": "^16.2.0" + } + }, + "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/ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, + "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/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "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/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "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/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "engines": { + "node": ">=6" + } + }, + "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.10.0", + "resolved": "https://registry.npmjs.org/express-validator/-/express-validator-6.10.0.tgz", + "integrity": "sha512-gDtepU94EpUzgFvKO/8JzjZ4uqIF4xHekjYtcNgFDiBK6Hob3MQhPU8s/c3NaWd1xi5e5nA0oVmOJ0b0ZBO36Q==", + "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/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "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/is-docker": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.1.1.tgz", + "integrity": "sha512-ZOoqiXfEwtGknTiuDEy8pN2CfE3TxMHprvNer1mXiqwkOT77Rw3YVrUQ52EqAOU3QAWDQ+bQdx7HJzrv7LS2Hw==", + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/js-yaml": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.0.0.tgz", + "integrity": "sha512-pqon0s+4ScYUvX30wxQi3PogGFAlUyH0awepWvwkj4jD4v+ova3RiYw8bmA6x2rDrEaj8i/oWKoRxpVNW+Re8Q==", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "node_modules/logplease": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/logplease/-/logplease-1.2.15.tgz", + "integrity": "sha512-jLlHnlsPSJjpwUfcNyUxXCl33AYg2cHhIf9QhGL2T4iPT0XPB+xP1LRKFPgIg1M/sg9kAJvy94w9CzBNrfnstA==" + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "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.46.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.46.0.tgz", + "integrity": "sha512-svXaP8UQRZ5K7or+ZmfNhg2xX3yKDMUzqadsSqi4NCH/KomcH75MAMYAGVlvXn4+b/xOPhS3I2uHKRUzvjY7BQ==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.29", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.29.tgz", + "integrity": "sha512-Y/jMt/S5sR9OaqteJtslsFZKWOIIqMACsJSiHghlCAyhf7jfVYjKBmLiX8OgpWeW+fjJ2b+Az69aPFPkUOY6xQ==", + "dependencies": { + "mime-db": "1.46.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/nocamel": { + "version": "1.1.0", + "resolved": "git+ssh://git@github.com/HexF/nocamel.git#89a5bfbbd07c72c302d968b967d0f4fe54846544", + "license": "ISC" + }, + "node_modules/node-fetch": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", + "engines": { + "node": "4.x || >=6.0.0" + } + }, + "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/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "engines": { + "node": ">=0.10.0" + } + }, + "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/semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "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/string-width": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", + "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dependencies": { + "ansi-regex": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "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/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "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" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/y18n": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.5.tgz", + "integrity": "sha512-hsRUr4FFrvhhRH12wOdfs38Gy7k2FFzB9qgN9v3aLykRq0dRcdcpz5C9FxdS2NuhOrI/628b/KSTJ3rwHysYSg==", + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-parser": { + "version": "20.2.7", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.7.tgz", + "integrity": "sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw==", + "engines": { + "node": ">=10" + } + } + }, + "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" + } + }, + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, + "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==" + }, + "cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "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=" + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" + }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" + }, + "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.10.0", + "resolved": "https://registry.npmjs.org/express-validator/-/express-validator-6.10.0.tgz", + "integrity": "sha512-gDtepU94EpUzgFvKO/8JzjZ4uqIF4xHekjYtcNgFDiBK6Hob3MQhPU8s/c3NaWd1xi5e5nA0oVmOJ0b0ZBO36Q==", + "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=" + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" + }, + "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==" + }, + "is-docker": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.1.1.tgz", + "integrity": "sha512-ZOoqiXfEwtGknTiuDEy8pN2CfE3TxMHprvNer1mXiqwkOT77Rw3YVrUQ52EqAOU3QAWDQ+bQdx7HJzrv7LS2Hw==" + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + }, + "js-yaml": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.0.0.tgz", + "integrity": "sha512-pqon0s+4ScYUvX30wxQi3PogGFAlUyH0awepWvwkj4jD4v+ova3RiYw8bmA6x2rDrEaj8i/oWKoRxpVNW+Re8Q==", + "requires": { + "argparse": "^2.0.1" + } + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "logplease": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/logplease/-/logplease-1.2.15.tgz", + "integrity": "sha512-jLlHnlsPSJjpwUfcNyUxXCl33AYg2cHhIf9QhGL2T4iPT0XPB+xP1LRKFPgIg1M/sg9kAJvy94w9CzBNrfnstA==" + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "requires": { + "yallist": "^4.0.0" + } + }, + "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.46.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.46.0.tgz", + "integrity": "sha512-svXaP8UQRZ5K7or+ZmfNhg2xX3yKDMUzqadsSqi4NCH/KomcH75MAMYAGVlvXn4+b/xOPhS3I2uHKRUzvjY7BQ==" + }, + "mime-types": { + "version": "2.1.29", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.29.tgz", + "integrity": "sha512-Y/jMt/S5sR9OaqteJtslsFZKWOIIqMACsJSiHghlCAyhf7jfVYjKBmLiX8OgpWeW+fjJ2b+Az69aPFPkUOY6xQ==", + "requires": { + "mime-db": "1.46.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==" + }, + "nocamel": { + "version": "git+ssh://git@github.com/HexF/nocamel.git#89a5bfbbd07c72c302d968b967d0f4fe54846544", + "from": "nocamel@HexF/nocamel#patch-1" + }, + "node-fetch": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" + }, + "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" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" + }, + "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==" + }, + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "requires": { + "lru-cache": "^6.0.0" + } + }, + "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=" + }, + "string-width": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", + "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "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=" + }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + }, + "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=" + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "y18n": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.5.tgz", + "integrity": "sha512-hsRUr4FFrvhhRH12wOdfs38Gy7k2FFzB9qgN9v3aLykRq0dRcdcpz5C9FxdS2NuhOrI/628b/KSTJ3rwHysYSg==" + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + } + }, + "yargs-parser": { + "version": "20.2.7", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.7.tgz", + "integrity": "sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw==" + } + } +} diff --git a/api/yarn.lock b/api/yarn.lock deleted file mode 100644 index 05ec0fc..0000000 --- a/api/yarn.lock +++ /dev/null @@ -1,1343 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@babel/code-frame@7.12.11": - version "7.12.11" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" - integrity sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw== - dependencies: - "@babel/highlight" "^7.10.4" - -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.13.tgz#dcfc826beef65e75c50e21d3837d7d95798dd658" - integrity sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g== - dependencies: - "@babel/highlight" "^7.12.13" - -"@babel/generator@^7.12.17": - version "7.12.17" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.12.17.tgz#9ef1dd792d778b32284411df63f4f668a9957287" - integrity sha512-DSA7ruZrY4WI8VxuS1jWSRezFnghEoYEFrZcw9BizQRmOZiUsiHl59+qEARGPqPikwA/GPTyRCi7isuCK/oyqg== - dependencies: - "@babel/types" "^7.12.17" - jsesc "^2.5.1" - source-map "^0.5.0" - -"@babel/helper-function-name@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz#93ad656db3c3c2232559fd7b2c3dbdcbe0eb377a" - integrity sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA== - dependencies: - "@babel/helper-get-function-arity" "^7.12.13" - "@babel/template" "^7.12.13" - "@babel/types" "^7.12.13" - -"@babel/helper-get-function-arity@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz#bc63451d403a3b3082b97e1d8b3fe5bd4091e583" - integrity sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg== - dependencies: - "@babel/types" "^7.12.13" - -"@babel/helper-split-export-declaration@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz#e9430be00baf3e88b0e13e6f9d4eaf2136372b05" - integrity sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg== - dependencies: - "@babel/types" "^7.12.13" - -"@babel/helper-validator-identifier@^7.12.11": - version "7.12.11" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz#c9a1f021917dcb5ccf0d4e453e399022981fc9ed" - integrity sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw== - -"@babel/highlight@^7.10.4", "@babel/highlight@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.12.13.tgz#8ab538393e00370b26271b01fa08f7f27f2e795c" - integrity sha512-kocDQvIbgMKlWxXe9fof3TQ+gkIPOUSEYhJjqUjvKMez3krV7vbzYCDq39Oj11UAVK7JqPVGQPlgE85dPNlQww== - dependencies: - "@babel/helper-validator-identifier" "^7.12.11" - chalk "^2.0.0" - js-tokens "^4.0.0" - -"@babel/parser@^7.12.13", "@babel/parser@^7.12.17", "@babel/parser@^7.7.0": - version "7.12.17" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.12.17.tgz#bc85d2d47db38094e5bb268fc761716e7d693848" - integrity sha512-r1yKkiUTYMQ8LiEI0UcQx5ETw5dpTLn9wijn9hk6KkTtOK95FndDN10M+8/s6k/Ymlbivw0Av9q4SlgF80PtHg== - -"@babel/template@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.12.13.tgz#530265be8a2589dbb37523844c5bcb55947fb327" - integrity sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA== - dependencies: - "@babel/code-frame" "^7.12.13" - "@babel/parser" "^7.12.13" - "@babel/types" "^7.12.13" - -"@babel/traverse@^7.7.0": - version "7.12.17" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.12.17.tgz#40ec8c7ffb502c4e54c7f95492dc11b88d718619" - integrity sha512-LGkTqDqdiwC6Q7fWSwQoas/oyiEYw6Hqjve5KOSykXkmFJFqzvGMb9niaUEag3Rlve492Mkye3gLw9FTv94fdQ== - dependencies: - "@babel/code-frame" "^7.12.13" - "@babel/generator" "^7.12.17" - "@babel/helper-function-name" "^7.12.13" - "@babel/helper-split-export-declaration" "^7.12.13" - "@babel/parser" "^7.12.17" - "@babel/types" "^7.12.17" - debug "^4.1.0" - globals "^11.1.0" - lodash "^4.17.19" - -"@babel/types@^7.12.13", "@babel/types@^7.12.17", "@babel/types@^7.7.0": - version "7.12.17" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.12.17.tgz#9d711eb807e0934c90b8b1ca0eb1f7230d150963" - integrity sha512-tNMDjcv/4DIcHxErTgwB9q2ZcYyN0sUfgGKUK/mm1FJK7Wz+KstoEekxrl/tBiNDgLK1HGi+sppj1An/1DR4fQ== - dependencies: - "@babel/helper-validator-identifier" "^7.12.11" - lodash "^4.17.19" - to-fast-properties "^2.0.0" - -"@eslint/eslintrc@^0.3.0": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.3.0.tgz#d736d6963d7003b6514e6324bec9c602ac340318" - integrity sha512-1JTKgrOKAHVivSvOYw+sJOunkBjUOvjqWk1DPja7ZFhIS2mX/4EgTT8M7eTK9jrKhL/FvXXEbQwIs3pg1xp3dg== - dependencies: - ajv "^6.12.4" - debug "^4.1.1" - espree "^7.3.0" - globals "^12.1.0" - ignore "^4.0.6" - import-fresh "^3.2.1" - js-yaml "^3.13.1" - lodash "^4.17.20" - minimatch "^3.0.4" - strip-json-comments "^3.1.1" - -accepts@~1.3.7: - version "1.3.7" - resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" - integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== - dependencies: - mime-types "~2.1.24" - negotiator "0.6.2" - -acorn-jsx@^5.3.1: - version "5.3.1" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.1.tgz#fc8661e11b7ac1539c47dbfea2e72b3af34d267b" - integrity sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng== - -acorn@^7.4.0: - version "7.4.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" - integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== - -ajv@^6.10.0, ajv@^6.12.4: - version "6.12.6" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" - integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== - dependencies: - fast-deep-equal "^3.1.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" - uri-js "^4.2.2" - -ajv@^7.0.2: - version "7.1.1" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-7.1.1.tgz#1e6b37a454021fa9941713f38b952fc1c8d32a84" - integrity sha512-ga/aqDYnUy/o7vbsRTFhhTsNeXiYb5JWDIcRIeZfwRNCefwjNTVYCGdGSUrEmiu3yDK3vFvNbgJxvrQW4JXrYQ== - dependencies: - fast-deep-equal "^3.1.1" - json-schema-traverse "^1.0.0" - require-from-string "^2.0.2" - uri-js "^4.2.2" - -ansi-colors@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" - integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== - -ansi-regex@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" - integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== - -ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - -ansi-styles@^4.0.0, ansi-styles@^4.1.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" - integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== - dependencies: - color-convert "^2.0.1" - -argparse@^1.0.7: - version "1.0.10" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" - integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== - dependencies: - sprintf-js "~1.0.2" - -argparse@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" - integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== - -array-flatten@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" - integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= - -astral-regex@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" - integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== - -babel-eslint@^10.1.0: - version "10.1.0" - resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.1.0.tgz#6968e568a910b78fb3779cdd8b6ac2f479943232" - integrity sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg== - dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/parser" "^7.7.0" - "@babel/traverse" "^7.7.0" - "@babel/types" "^7.7.0" - eslint-visitor-keys "^1.0.0" - resolve "^1.12.0" - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= - -body-parser@1.19.0, body-parser@^1.19.0: - version "1.19.0" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" - 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" - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -bytes@3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" - integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== - -callsites@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" - integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== - -chalk@^2.0.0: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - -chalk@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a" - integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - -cliui@^7.0.2: - version "7.0.4" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" - integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.0" - wrap-ansi "^7.0.0" - -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - -color-convert@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" - integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== - dependencies: - color-name "~1.1.4" - -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= - -color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -content-disposition@0.5.3: - version "0.5.3" - resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd" - integrity sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g== - dependencies: - safe-buffer "5.1.2" - -content-type@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" - integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== - -cookie-signature@1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" - integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= - -cookie@0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" - integrity sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== - -cross-spawn@^7.0.2: - version "7.0.3" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" - integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== - dependencies: - path-key "^3.1.0" - shebang-command "^2.0.0" - which "^2.0.1" - -debug@2.6.9: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== - dependencies: - ms "2.0.0" - -debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" - integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== - dependencies: - ms "2.1.2" - -deep-is@^0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" - integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= - -depd@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" - integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= - -destroy@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" - integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= - -doctrine@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" - integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== - dependencies: - esutils "^2.0.2" - -ee-first@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" - integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= - -emoji-regex@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" - integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== - -encodeurl@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" - integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= - -enquirer@^2.3.5: - version "2.3.6" - resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" - integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== - dependencies: - ansi-colors "^4.1.1" - -escalade@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" - integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== - -escape-html@~1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" - integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= - -escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= - -eslint-plugin-snakecasejs@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-snakecasejs/-/eslint-plugin-snakecasejs-2.2.0.tgz#e35bf4eee2f375a9ba79de68c96303e06f8acf86" - integrity sha512-vdQHT2VvzPpJHHPAVXjtyAZ/CfiJqNCa2d9kn6XMapWBN2Uio/nzL957TooNa6gumlHabBAhB5eSNmqwHgu8gA== - -eslint-scope@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" - integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== - dependencies: - esrecurse "^4.3.0" - estraverse "^4.1.1" - -eslint-utils@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27" - integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg== - dependencies: - eslint-visitor-keys "^1.1.0" - -eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" - integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== - -eslint-visitor-keys@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz#21fdc8fbcd9c795cc0321f0563702095751511a8" - integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ== - -eslint@^7.20.0: - version "7.20.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.20.0.tgz#db07c4ca4eda2e2316e7aa57ac7fc91ec550bdc7" - integrity sha512-qGi0CTcOGP2OtCQBgWZlQjcTuP0XkIpYFj25XtRTQSHC+umNnp7UMshr2G8SLsRFYDdAPFeHOsiteadmMH02Yw== - dependencies: - "@babel/code-frame" "7.12.11" - "@eslint/eslintrc" "^0.3.0" - ajv "^6.10.0" - chalk "^4.0.0" - cross-spawn "^7.0.2" - debug "^4.0.1" - doctrine "^3.0.0" - enquirer "^2.3.5" - eslint-scope "^5.1.1" - eslint-utils "^2.1.0" - eslint-visitor-keys "^2.0.0" - espree "^7.3.1" - esquery "^1.4.0" - esutils "^2.0.2" - file-entry-cache "^6.0.0" - functional-red-black-tree "^1.0.1" - glob-parent "^5.0.0" - globals "^12.1.0" - ignore "^4.0.6" - import-fresh "^3.0.0" - imurmurhash "^0.1.4" - is-glob "^4.0.0" - js-yaml "^3.13.1" - json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.4.1" - lodash "^4.17.20" - minimatch "^3.0.4" - natural-compare "^1.4.0" - optionator "^0.9.1" - progress "^2.0.0" - regexpp "^3.1.0" - semver "^7.2.1" - strip-ansi "^6.0.0" - strip-json-comments "^3.1.0" - table "^6.0.4" - text-table "^0.2.0" - v8-compile-cache "^2.0.3" - -espree@^7.3.0, espree@^7.3.1: - version "7.3.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-7.3.1.tgz#f2df330b752c6f55019f8bd89b7660039c1bbbb6" - integrity sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g== - dependencies: - acorn "^7.4.0" - acorn-jsx "^5.3.1" - eslint-visitor-keys "^1.3.0" - -esprima@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" - integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== - -esquery@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.4.0.tgz#2148ffc38b82e8c7057dfed48425b3e61f0f24a5" - integrity sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w== - dependencies: - estraverse "^5.1.0" - -esrecurse@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" - integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== - dependencies: - estraverse "^5.2.0" - -estraverse@^4.1.1: - version "4.3.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" - integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== - -estraverse@^5.1.0, estraverse@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880" - integrity sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ== - -esutils@^2.0.2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" - integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== - -etag@~1.8.1: - version "1.8.1" - resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" - integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= - -express-validator@^6.10.0: - version "6.10.0" - resolved "https://registry.yarnpkg.com/express-validator/-/express-validator-6.10.0.tgz#66f70f73d04fb55c227401c75fe3713879c9cb70" - integrity sha512-gDtepU94EpUzgFvKO/8JzjZ4uqIF4xHekjYtcNgFDiBK6Hob3MQhPU8s/c3NaWd1xi5e5nA0oVmOJ0b0ZBO36Q== - dependencies: - lodash "^4.17.20" - validator "^13.5.2" - -express@^4.17.1: - version "4.17.1" - resolved "https://registry.yarnpkg.com/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134" - 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" - -fast-deep-equal@^3.1.1: - version "3.1.3" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" - integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== - -fast-json-stable-stringify@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" - integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== - -fast-levenshtein@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" - integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= - -file-entry-cache@^6.0.0: - version "6.0.1" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" - integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== - dependencies: - flat-cache "^3.0.4" - -finalhandler@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d" - 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" - -flat-cache@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" - integrity sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg== - dependencies: - flatted "^3.1.0" - rimraf "^3.0.2" - -flatted@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.1.1.tgz#c4b489e80096d9df1dfc97c79871aea7c617c469" - integrity sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA== - -forwarded@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84" - integrity sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ= - -fresh@0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" - integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== - -functional-red-black-tree@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" - integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= - -get-caller-file@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" - integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== - -glob-parent@^5.0.0: - version "5.1.1" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.1.tgz#b6c1ef417c4e5663ea498f1c45afac6916bbc229" - integrity sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ== - dependencies: - is-glob "^4.0.1" - -glob@^7.1.3: - version "7.1.6" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" - integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -globals@^11.1.0: - version "11.12.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" - integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== - -globals@^12.1.0: - version "12.4.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-12.4.0.tgz#a18813576a41b00a24a97e7f815918c2e19925f8" - integrity sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg== - dependencies: - type-fest "^0.8.1" - -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= - -has-flag@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" - integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== - -has@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== - dependencies: - function-bind "^1.1.1" - -http-errors@1.7.2: - version "1.7.2" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.2.tgz#4f5029cf13239f31036e5b2e55292bcfbcc85c8f" - 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" - -http-errors@~1.7.2: - version "1.7.3" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" - integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== - dependencies: - depd "~1.1.2" - inherits "2.0.4" - setprototypeof "1.1.1" - statuses ">= 1.5.0 < 2" - toidentifier "1.0.0" - -iconv-lite@0.4.24: - version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - -ignore@^4.0.6: - version "4.0.6" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" - integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== - -import-fresh@^3.0.0, import-fresh@^3.2.1: - version "3.3.0" - resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" - integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== - dependencies: - parent-module "^1.0.0" - resolve-from "^4.0.0" - -imurmurhash@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" - integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -inherits@2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - -ipaddr.js@1.9.1: - version "1.9.1" - resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" - integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== - -is-core-module@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.2.0.tgz#97037ef3d52224d85163f5597b2b63d9afed981a" - integrity sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ== - dependencies: - has "^1.0.3" - -is-docker@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.1.1.tgz#4125a88e44e450d384e09047ede71adc2d144156" - integrity sha512-ZOoqiXfEwtGknTiuDEy8pN2CfE3TxMHprvNer1mXiqwkOT77Rw3YVrUQ52EqAOU3QAWDQ+bQdx7HJzrv7LS2Hw== - -is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= - -is-fullwidth-code-point@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" - integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== - -is-glob@^4.0.0, is-glob@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" - integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== - dependencies: - is-extglob "^2.1.1" - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= - -js-tokens@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" - integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== - -js-yaml@^3.13.1: - version "3.14.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" - integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - -js-yaml@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.0.0.tgz#f426bc0ff4b4051926cd588c71113183409a121f" - integrity sha512-pqon0s+4ScYUvX30wxQi3PogGFAlUyH0awepWvwkj4jD4v+ova3RiYw8bmA6x2rDrEaj8i/oWKoRxpVNW+Re8Q== - dependencies: - argparse "^2.0.1" - -jsesc@^2.5.1: - version "2.5.2" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" - integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== - -json-schema-traverse@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" - integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== - -json-schema-traverse@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" - integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== - -json-stable-stringify-without-jsonify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" - integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= - -levn@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" - integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== - dependencies: - prelude-ls "^1.2.1" - type-check "~0.4.0" - -lodash@^4.17.19: - version "4.17.21" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" - integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== - -lodash@^4.17.20: - version "4.17.20" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" - integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== - -logplease@^1.2.15: - version "1.2.15" - resolved "https://registry.yarnpkg.com/logplease/-/logplease-1.2.15.tgz#3da442e93751a5992cc19010a826b08d0293c48a" - integrity sha512-jLlHnlsPSJjpwUfcNyUxXCl33AYg2cHhIf9QhGL2T4iPT0XPB+xP1LRKFPgIg1M/sg9kAJvy94w9CzBNrfnstA== - -lru-cache@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" - integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== - dependencies: - yallist "^4.0.0" - -media-typer@0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" - integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= - -merge-descriptors@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" - integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= - -methods@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" - integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= - -mime-db@1.46.0: - version "1.46.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.46.0.tgz#6267748a7f799594de3cbc8cde91def349661cee" - integrity sha512-svXaP8UQRZ5K7or+ZmfNhg2xX3yKDMUzqadsSqi4NCH/KomcH75MAMYAGVlvXn4+b/xOPhS3I2uHKRUzvjY7BQ== - -mime-types@~2.1.24: - version "2.1.29" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.29.tgz#1d4ab77da64b91f5f72489df29236563754bb1b2" - integrity sha512-Y/jMt/S5sR9OaqteJtslsFZKWOIIqMACsJSiHghlCAyhf7jfVYjKBmLiX8OgpWeW+fjJ2b+Az69aPFPkUOY6xQ== - dependencies: - mime-db "1.46.0" - -mime@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" - integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== - -minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= - -ms@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" - integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== - -ms@2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - -natural-compare@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" - integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= - -negotiator@0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" - integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== - -nocamel@HexF/nocamel#patch-1: - version "1.1.0" - resolved "https://codeload.github.com/HexF/nocamel/tar.gz/89a5bfbbd07c72c302d968b967d0f4fe54846544" - -node-fetch@^2.6.1: - version "2.6.1" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" - integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== - -on-finished@~2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" - integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= - dependencies: - ee-first "1.1.1" - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -optionator@^0.9.1: - version "0.9.1" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499" - integrity sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw== - dependencies: - deep-is "^0.1.3" - fast-levenshtein "^2.0.6" - levn "^0.4.1" - prelude-ls "^1.2.1" - type-check "^0.4.0" - word-wrap "^1.2.3" - -parent-module@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" - integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== - dependencies: - callsites "^3.0.0" - -parseurl@~1.3.3: - version "1.3.3" - resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" - integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= - -path-key@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" - integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== - -path-parse@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" - integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== - -path-to-regexp@0.1.7: - version "0.1.7" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" - integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= - -prelude-ls@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" - integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== - -progress@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" - integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== - -proxy-addr@~2.0.5: - version "2.0.6" - resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.6.tgz#fdc2336505447d3f2f2c638ed272caf614bbb2bf" - integrity sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw== - dependencies: - forwarded "~0.1.2" - ipaddr.js "1.9.1" - -punycode@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" - integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== - -qs@6.7.0: - version "6.7.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" - integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== - -range-parser@~1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" - integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== - -raw-body@2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.0.tgz#a1ce6fb9c9bc356ca52e89256ab59059e13d0332" - 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" - -regexpp@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.1.0.tgz#206d0ad0a5648cffbdb8ae46438f3dc51c9f78e2" - integrity sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q== - -require-directory@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= - -require-from-string@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" - integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== - -resolve-from@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" - integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== - -resolve@^1.12.0: - version "1.20.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" - integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== - dependencies: - is-core-module "^2.2.0" - path-parse "^1.0.6" - -rimraf@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" - integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== - dependencies: - glob "^7.1.3" - -safe-buffer@5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - -"safer-buffer@>= 2.1.2 < 3": - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -semver@^7.2.1, semver@^7.3.4: - version "7.3.4" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.4.tgz#27aaa7d2e4ca76452f98d3add093a72c943edc97" - integrity sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw== - dependencies: - lru-cache "^6.0.0" - -send@0.17.1: - version "0.17.1" - resolved "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8" - 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" - -serve-static@1.14.1: - version "1.14.1" - resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.1.tgz#666e636dc4f010f7ef29970a88a674320898b2f9" - 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" - -setprototypeof@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" - integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== - -shebang-command@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" - integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== - dependencies: - shebang-regex "^3.0.0" - -shebang-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" - integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== - -slice-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b" - integrity sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ== - dependencies: - ansi-styles "^4.0.0" - astral-regex "^2.0.0" - is-fullwidth-code-point "^3.0.0" - -source-map@^0.5.0: - version "0.5.7" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" - integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= - -sprintf-js@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= - -"statuses@>= 1.5.0 < 2", statuses@~1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" - integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= - -string-width@^4.1.0, string-width@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" - integrity sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.0" - -strip-ansi@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" - integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== - dependencies: - ansi-regex "^5.0.0" - -strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" - integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== - -supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - -supports-color@^7.1.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" - integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== - dependencies: - has-flag "^4.0.0" - -table@^6.0.4: - version "6.0.7" - resolved "https://registry.yarnpkg.com/table/-/table-6.0.7.tgz#e45897ffbcc1bcf9e8a87bf420f2c9e5a7a52a34" - integrity sha512-rxZevLGTUzWna/qBLObOe16kB2RTnnbhciwgPbMMlazz1yZGVEgnZK762xyVdVznhqxrfCeBMmMkgOOaPwjH7g== - dependencies: - ajv "^7.0.2" - lodash "^4.17.20" - slice-ansi "^4.0.0" - string-width "^4.2.0" - -text-table@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" - integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= - -to-fast-properties@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" - integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= - -toidentifier@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" - integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== - -type-check@^0.4.0, type-check@~0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" - integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== - dependencies: - prelude-ls "^1.2.1" - -type-fest@^0.8.1: - version "0.8.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" - integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== - -type-is@~1.6.17, type-is@~1.6.18: - version "1.6.18" - resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" - integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== - dependencies: - media-typer "0.3.0" - mime-types "~2.1.24" - -unpipe@1.0.0, unpipe@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= - -uri-js@^4.2.2: - version "4.4.1" - resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" - integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== - dependencies: - punycode "^2.1.0" - -utils-merge@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" - integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= - -uuid@^8.3.2: - version "8.3.2" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" - integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== - -v8-compile-cache@^2.0.3: - version "2.2.0" - resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz#9471efa3ef9128d2f7c6a7ca39c4dd6b5055b132" - integrity sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q== - -validator@^13.5.2: - version "13.5.2" - resolved "https://registry.yarnpkg.com/validator/-/validator-13.5.2.tgz#c97ae63ed4224999fb6f42c91eaca9567fe69a46" - integrity sha512-mD45p0rvHVBlY2Zuy3F3ESIe1h5X58GPfAtslBjY7EtTqGquZTj+VX/J4RnHWN8FKq0C9WRVt1oWAcytWRuYLQ== - -vary@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" - integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= - -which@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" - integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== - dependencies: - isexe "^2.0.0" - -word-wrap@^1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" - integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== - -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -y18n@^5.0.5: - version "5.0.5" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.5.tgz#8769ec08d03b1ea2df2500acef561743bbb9ab18" - integrity sha512-hsRUr4FFrvhhRH12wOdfs38Gy7k2FFzB9qgN9v3aLykRq0dRcdcpz5C9FxdS2NuhOrI/628b/KSTJ3rwHysYSg== - -yallist@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" - integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== - -yargs-parser@^20.2.2: - version "20.2.5" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.5.tgz#5d37729146d3f894f39fc94b6796f5b239513186" - integrity sha512-jYRGS3zWy20NtDtK2kBgo/TlAoy5YUuhD9/LZ7z7W4j1Fdw2cqD0xEEclf8fxc8xjD6X5Qr+qQQwCEsP8iRiYg== - -yargs@^16.2.0: - version "16.2.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" - integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== - dependencies: - cliui "^7.0.2" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.0" - y18n "^5.0.5" - yargs-parser "^20.2.2" diff --git a/cli/package-lock.json b/cli/package-lock.json new file mode 100644 index 0000000..f997f96 --- /dev/null +++ b/cli/package-lock.json @@ -0,0 +1,387 @@ +{ + "name": "piston-cli", + "version": "1.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "piston-cli", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "axios": "^0.21.1", + "chalk": "^4.1.0", + "yargs": "^16.2.0" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/axios": { + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", + "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", + "dependencies": { + "follow-redirects": "^1.10.0" + } + }, + "node_modules/chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "engines": { + "node": ">=6" + } + }, + "node_modules/follow-redirects": { + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.3.tgz", + "integrity": "sha512-DUgl6+HDzB0iEptNQEXLx/KhTmDb8tZUHSeLqpnjpknR70H0nC2t9N73BK6fN4hOvJ84pKlIQVQ4k5FFlBedKA==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/string-width": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", + "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dependencies": { + "ansi-regex": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/y18n": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.5.tgz", + "integrity": "sha512-hsRUr4FFrvhhRH12wOdfs38Gy7k2FFzB9qgN9v3aLykRq0dRcdcpz5C9FxdS2NuhOrI/628b/KSTJ3rwHysYSg==", + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-parser": { + "version": "20.2.7", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.7.tgz", + "integrity": "sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw==", + "engines": { + "node": ">=10" + } + } + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "axios": { + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", + "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", + "requires": { + "follow-redirects": "^1.10.0" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" + }, + "follow-redirects": { + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.3.tgz", + "integrity": "sha512-DUgl6+HDzB0iEptNQEXLx/KhTmDb8tZUHSeLqpnjpknR70H0nC2t9N73BK6fN4hOvJ84pKlIQVQ4k5FFlBedKA==" + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" + }, + "string-width": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", + "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "requires": { + "has-flag": "^4.0.0" + } + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "y18n": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.5.tgz", + "integrity": "sha512-hsRUr4FFrvhhRH12wOdfs38Gy7k2FFzB9qgN9v3aLykRq0dRcdcpz5C9FxdS2NuhOrI/628b/KSTJ3rwHysYSg==" + }, + "yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + } + }, + "yargs-parser": { + "version": "20.2.7", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.7.tgz", + "integrity": "sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw==" + } + } +} diff --git a/cli/yarn.lock b/cli/yarn.lock deleted file mode 100644 index 2d24666..0000000 --- a/cli/yarn.lock +++ /dev/null @@ -1,141 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -ansi-regex@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" - integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== - -ansi-styles@^4.0.0, ansi-styles@^4.1.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" - integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== - dependencies: - color-convert "^2.0.1" - -axios@^0.21.1: - version "0.21.1" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.1.tgz#22563481962f4d6bde9a76d516ef0e5d3c09b2b8" - integrity sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA== - dependencies: - follow-redirects "^1.10.0" - -chalk@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a" - integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - -cliui@^7.0.2: - version "7.0.4" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" - integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.0" - wrap-ansi "^7.0.0" - -color-convert@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" - integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== - dependencies: - color-name "~1.1.4" - -color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - -emoji-regex@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" - integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== - -escalade@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" - integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== - -follow-redirects@^1.10.0: - version "1.13.3" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.3.tgz#e5598ad50174c1bc4e872301e82ac2cd97f90267" - integrity sha512-DUgl6+HDzB0iEptNQEXLx/KhTmDb8tZUHSeLqpnjpknR70H0nC2t9N73BK6fN4hOvJ84pKlIQVQ4k5FFlBedKA== - -get-caller-file@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" - integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== - -has-flag@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" - integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== - -is-fullwidth-code-point@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" - integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== - -require-directory@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= - -string-width@^4.1.0, string-width@^4.2.0: - version "4.2.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.2.tgz#dafd4f9559a7585cfba529c6a0a4f73488ebd4c5" - integrity sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.0" - -strip-ansi@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" - integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== - dependencies: - ansi-regex "^5.0.0" - -supports-color@^7.1.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" - integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== - dependencies: - has-flag "^4.0.0" - -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - -y18n@^5.0.5: - version "5.0.5" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.5.tgz#8769ec08d03b1ea2df2500acef561743bbb9ab18" - integrity sha512-hsRUr4FFrvhhRH12wOdfs38Gy7k2FFzB9qgN9v3aLykRq0dRcdcpz5C9FxdS2NuhOrI/628b/KSTJ3rwHysYSg== - -yargs-parser@^20.2.2: - version "20.2.7" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.7.tgz#61df85c113edfb5a7a4e36eb8aa60ef423cbc90a" - integrity sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw== - -yargs@^16.2.0: - version "16.2.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" - integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== - dependencies: - cliui "^7.0.2" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.0" - y18n "^5.0.5" - yargs-parser "^20.2.2" diff --git a/readme.md b/readme.md index 32f7dd9..ce2a947 100644 --- a/readme.md +++ b/readme.md @@ -104,8 +104,7 @@ git clone https://github.com/engineer-man/piston docker-compose up -d piston_api # Start the API container -npm install -g yarn -cd cli && yarn && cd - +cd cli && npm i && cd - # Install all the dependencies for the cli ``` diff --git a/shell.nix b/shell.nix index d3c1b54..47b2d12 100644 --- a/shell.nix +++ b/shell.nix @@ -1,5 +1,5 @@ { pkgs ? import {} }: pkgs.mkShell { # nativeBuildInputs is usually what you want -- tools you need to run - nativeBuildInputs = with pkgs; [ nodejs-15_x yarn jq ]; + nativeBuildInputs = with pkgs; [ nodejs-15_x jq ]; } From 5044bfdfbbabbf2206d2f06289e5bb4632d88ed3 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Mon, 29 Mar 2021 21:41:47 +1300 Subject: [PATCH 347/385] split docker files into prod/dev --- docker-compose.dev.yaml | 20 ++++++++++++++++++++ docker-compose.yaml | 13 ++++--------- 2 files changed, 24 insertions(+), 9 deletions(-) create mode 100644 docker-compose.dev.yaml diff --git a/docker-compose.dev.yaml b/docker-compose.dev.yaml new file mode 100644 index 0000000..cafae5c --- /dev/null +++ b/docker-compose.dev.yaml @@ -0,0 +1,20 @@ +version: '2.7' + +services: + piston_api: + build: api + cap_add: + - CAP_SYS_ADMIN + restart: always + ports: + - 2000:2000 + volumes: + - ./data/piston:/piston + tmpfs: + - /piston/jobs:exec + + piston_fs_repo: # Local testing of packages + build: repo + command: ['dart-2.12.1'] # Only build dart + volumes: + - .:/piston diff --git a/docker-compose.yaml b/docker-compose.yaml index ed67d43..82ec45a 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,19 +1,14 @@ -version: '3.8' +version: '2.7' services: piston_api: build: api - privileged: true + cap_add: + - CAP_SYS_ADMIN restart: always ports: - 2000:2000 volumes: - ./data/piston:/piston tmpfs: - - /piston/jobs:exec - - piston_fs_repo: # Local testing of packages - build: repo - command: ['dart-2.12.1'] # Only build dart - volumes: - - .:/piston + - /piston/jobs:exec \ No newline at end of file From 0ee500353360a8b043c16fc1a4d7f0c47a810d25 Mon Sep 17 00:00:00 2001 From: Thomas Date: Fri, 2 Apr 2021 17:45:17 +1300 Subject: [PATCH 348/385] Up timeout for index starting --- .github/workflows/package-pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/package-pr.yaml b/.github/workflows/package-pr.yaml index 928749c..18a8b66 100644 --- a/.github/workflows/package-pr.yaml +++ b/.github/workflows/package-pr.yaml @@ -94,7 +94,7 @@ jobs: docker run --network container:api appropriate/curl -s --retry 10 --retry-connrefused http://localhost:2000/runtimes echo Waiting for Index to start.. - docker run --network container:piston_fs_repo appropriate/curl -s --retry 10 --retry-connrefused http://localhost:8000/index + docker run --network container:piston_fs_repo appropriate/curl -s --retry 30 --retry-connrefused http://localhost:8000/index echo Adjusting index sed -i 's/piston_fs_repo/localhost/g' repo/index From ba8a0bc377ce74ace40903d89e3f36bfaeb1a4b4 Mon Sep 17 00:00:00 2001 From: Dan Vargas <10914883+dvargas46@users.noreply.github.com> Date: Tue, 6 Apr 2021 00:07:42 -0500 Subject: [PATCH 349/385] pkg(groovy-3.0.7): Add groovy 3.0.7 (#202) --- packages/groovy/3.0.7/build.sh | 13 +++++++++++++ packages/groovy/3.0.7/environment | 5 +++++ packages/groovy/3.0.7/metadata.json | 5 +++++ packages/groovy/3.0.7/run | 3 +++ packages/groovy/3.0.7/test.groovy | 1 + 5 files changed, 27 insertions(+) create mode 100755 packages/groovy/3.0.7/build.sh create mode 100644 packages/groovy/3.0.7/environment create mode 100644 packages/groovy/3.0.7/metadata.json create mode 100644 packages/groovy/3.0.7/run create mode 100644 packages/groovy/3.0.7/test.groovy diff --git a/packages/groovy/3.0.7/build.sh b/packages/groovy/3.0.7/build.sh new file mode 100755 index 0000000..ae1ecc5 --- /dev/null +++ b/packages/groovy/3.0.7/build.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# Groovy depends on JDK8+ +mkdir -p java +cd java +curl "https://download.java.net/java/GA/jdk15.0.2/0d1cfde4252546c6931946de8db48ee2/7/GPL/openjdk-15.0.2_linux-x64_bin.tar.gz" -o java.tar.gz +tar xzf java.tar.gz --strip-components=1 +rm java.tar.gz +cd .. + +curl -L "https://dl.bintray.com/groovy/maven/apache-groovy-binary-3.0.7.zip" -o groovy.zip +unzip -q groovy.zip +rm groovy.zip diff --git a/packages/groovy/3.0.7/environment b/packages/groovy/3.0.7/environment new file mode 100644 index 0000000..842a62b --- /dev/null +++ b/packages/groovy/3.0.7/environment @@ -0,0 +1,5 @@ +#!/bin/bash + +# Groovy requires JAVA_HOME to be set +export JAVA_HOME=$PWD/java +export PATH=$PWD/groovy-3.0.7/bin:$PATH diff --git a/packages/groovy/3.0.7/metadata.json b/packages/groovy/3.0.7/metadata.json new file mode 100644 index 0000000..b790007 --- /dev/null +++ b/packages/groovy/3.0.7/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "groovy", + "version": "3.0.7", + "aliases": ["groovy", "gvy"] +} diff --git a/packages/groovy/3.0.7/run b/packages/groovy/3.0.7/run new file mode 100644 index 0000000..e31d7d4 --- /dev/null +++ b/packages/groovy/3.0.7/run @@ -0,0 +1,3 @@ +#!/bin/bash + +groovy "$@" diff --git a/packages/groovy/3.0.7/test.groovy b/packages/groovy/3.0.7/test.groovy new file mode 100644 index 0000000..e4eb9d8 --- /dev/null +++ b/packages/groovy/3.0.7/test.groovy @@ -0,0 +1 @@ +println 'OK' From 7cbfdd9f4c566ff71931da52f3a21db73b2cddaa Mon Sep 17 00:00:00 2001 From: Dan Vargas <10914883+dvargas46@users.noreply.github.com> Date: Tue, 6 Apr 2021 00:07:54 -0500 Subject: [PATCH 350/385] pkg(ocaml-4.12.0): Add ocaml 4.12.0 (#200) --- packages/ocaml/4.12.0/build.sh | 17 +++++++++++++++++ packages/ocaml/4.12.0/compile | 3 +++ packages/ocaml/4.12.0/environment | 3 +++ packages/ocaml/4.12.0/metadata.json | 5 +++++ packages/ocaml/4.12.0/run | 4 ++++ packages/ocaml/4.12.0/test.ml | 1 + 6 files changed, 33 insertions(+) create mode 100755 packages/ocaml/4.12.0/build.sh create mode 100644 packages/ocaml/4.12.0/compile create mode 100644 packages/ocaml/4.12.0/environment create mode 100644 packages/ocaml/4.12.0/metadata.json create mode 100644 packages/ocaml/4.12.0/run create mode 100644 packages/ocaml/4.12.0/test.ml diff --git a/packages/ocaml/4.12.0/build.sh b/packages/ocaml/4.12.0/build.sh new file mode 100755 index 0000000..fd91cdd --- /dev/null +++ b/packages/ocaml/4.12.0/build.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +PREFIX=$(realpath $(dirname $0)) + +mkdir -p build +cd build + +curl -L "https://github.com/ocaml/ocaml/archive/4.12.0.tar.gz" -o ocaml.tar.gz +tar xzf ocaml.tar.gz --strip-components=1 +rm ocaml.tar.gz + +./configure --prefix="$PREFIX" +make -j$(nproc) +make install -j$(nproc) + +cd .. +rm -rf build diff --git a/packages/ocaml/4.12.0/compile b/packages/ocaml/4.12.0/compile new file mode 100644 index 0000000..c1d3e6a --- /dev/null +++ b/packages/ocaml/4.12.0/compile @@ -0,0 +1,3 @@ +#!/bin/bash + +ocamlc -o out "$@" diff --git a/packages/ocaml/4.12.0/environment b/packages/ocaml/4.12.0/environment new file mode 100644 index 0000000..116e7aa --- /dev/null +++ b/packages/ocaml/4.12.0/environment @@ -0,0 +1,3 @@ +#!/bin/bash + +export PATH=$PWD/bin:$PATH diff --git a/packages/ocaml/4.12.0/metadata.json b/packages/ocaml/4.12.0/metadata.json new file mode 100644 index 0000000..ddbfb89 --- /dev/null +++ b/packages/ocaml/4.12.0/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "ocaml", + "version": "4.12.0", + "aliases": ["ocaml", "ml"] +} diff --git a/packages/ocaml/4.12.0/run b/packages/ocaml/4.12.0/run new file mode 100644 index 0000000..e2663b1 --- /dev/null +++ b/packages/ocaml/4.12.0/run @@ -0,0 +1,4 @@ +#!/bin/bash + +shift +./out "$@" diff --git a/packages/ocaml/4.12.0/test.ml b/packages/ocaml/4.12.0/test.ml new file mode 100644 index 0000000..ef98f8c --- /dev/null +++ b/packages/ocaml/4.12.0/test.ml @@ -0,0 +1 @@ +print_string "OK\n"; From 2d446c33e6d9297fde987df8eea04b9119b397f9 Mon Sep 17 00:00:00 2001 From: Thomas Date: Tue, 6 Apr 2021 17:09:19 +1200 Subject: [PATCH 351/385] Up wait time for index Needed for large packages like ponyc --- .github/workflows/package-pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/package-pr.yaml b/.github/workflows/package-pr.yaml index 18a8b66..1fda6be 100644 --- a/.github/workflows/package-pr.yaml +++ b/.github/workflows/package-pr.yaml @@ -94,7 +94,7 @@ jobs: docker run --network container:api appropriate/curl -s --retry 10 --retry-connrefused http://localhost:2000/runtimes echo Waiting for Index to start.. - docker run --network container:piston_fs_repo appropriate/curl -s --retry 30 --retry-connrefused http://localhost:8000/index + docker run --network container:piston_fs_repo appropriate/curl -s --retry 200 --retry-connrefused http://localhost:8000/index echo Adjusting index sed -i 's/piston_fs_repo/localhost/g' repo/index From e6d39d4a7fffaeef7c675b48b8ea471b630d77f5 Mon Sep 17 00:00:00 2001 From: Thomas Date: Tue, 6 Apr 2021 17:27:37 +1200 Subject: [PATCH 352/385] Update readme.md --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 1f86d35..5835096 100644 --- a/readme.md +++ b/readme.md @@ -120,7 +120,7 @@ cd cli && npm i && cd - echo "$GITHUB_TOKEN" | docker login https://docker.pkg.github.com -u "$GITHUB_USERNAME" --password-stdin # Change out the $GITHUB_TOKEN and $GITHUB_USERNAME with appropritate values -docker run -v $PWD:'/piston' --tmpfs /piston/jobs -dit -p 2000:2000 --privileged --name piston_api docker.pkg.github.com/engineer-man/piston/api:latest +docker run -v $PWD:'/piston' --tmpfs /piston/jobs -dit -p 2000:2000 --name piston_api docker.pkg.github.com/engineer-man/piston/api:latest ```
From 1a04b5f8899a41a662568d6a93335555661cd61e Mon Sep 17 00:00:00 2001 From: Thomas Date: Tue, 6 Apr 2021 17:34:08 +1200 Subject: [PATCH 353/385] Show semver selector on cli --- readme.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/readme.md b/readme.md index 5835096..1dcbe02 100644 --- a/readme.md +++ b/readme.md @@ -143,6 +143,13 @@ cli/index.js ppman install python 3.9.1 # Run a python script echo 'print("Hello world!")' > test.py cli/index.js run python 3.9.1 test.py + +# Run the script using the latest version +cli/index.js run python '*' test.py + +# Run using python 3.x +cli/index.js run python 3.x test.py + ``` If you are operating on a remote machine, add the `-u` flag like so: From f6a4e67d5fa851b6fd424d19b13ffb0a7316c3a3 Mon Sep 17 00:00:00 2001 From: Thomas Date: Tue, 6 Apr 2021 17:38:30 +1200 Subject: [PATCH 354/385] Update supported languages --- readme.md | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/readme.md b/readme.md index 1dcbe02..7d3173a 100644 --- a/readme.md +++ b/readme.md @@ -258,21 +258,23 @@ Content-Type: application/json
# Supported Languages -`awk`, `bash`, `brainfuck`, -`c`, -`cpp`, `clojure`, +`coffeescript`, +`cow`, `crystal`, -`csharp`, -`d`, +`dart`, `dash`, `deno`, +`dotnet`, `elixir`, `emacs`, -`elisp`, +`erlang`, +`gawk`, +`gcc`, `go`, +`groovy`, `haskell`, `java`, `jelly`, @@ -281,21 +283,26 @@ Content-Type: application/json `lisp`, `lolcode`, `lua`, +`mono`, `nasm`, -`nasm64`, `nim`, `node`, +`ocaml`, `osabie`, `paradoc`, +`pascal`, `perl`, `php`, -`python2`, -`python3`, +`prolog`, +`pure`, +`python`, +`rockstar`, `ruby`, `rust`, `scala`, `swift`, `typescript`, +`vlang`, `zig`,
From 552fb91c6b444aa4402b50b66905066f5e2cdbb5 Mon Sep 17 00:00:00 2001 From: Victor Frazao <31864869+vfrazao-ns1@users.noreply.github.com> Date: Tue, 6 Apr 2021 20:31:30 -0400 Subject: [PATCH 355/385] v3 - Remove the use of unshare + privileged mode and instead (#195) use seccomp to filter for socket syscalls --- .github/workflows/package-pr.yaml | 2 +- api/Dockerfile | 4 ++- api/src/config.js | 4 +-- api/src/executor/job.js | 4 +-- api/src/nosocket/Makefile | 19 +++++++++++++ api/src/nosocket/nosocket.c | 46 +++++++++++++++++++++++++++++++ docker-compose.yaml | 4 +-- repo/Dockerfile | 2 +- 8 files changed, 75 insertions(+), 10 deletions(-) create mode 100644 api/src/nosocket/Makefile create mode 100644 api/src/nosocket/nosocket.c diff --git a/.github/workflows/package-pr.yaml b/.github/workflows/package-pr.yaml index 1fda6be..7b200aa 100644 --- a/.github/workflows/package-pr.yaml +++ b/.github/workflows/package-pr.yaml @@ -70,7 +70,7 @@ jobs: runner_uid_max: 1500 runner_gid_min: 1100 runner_gid_max: 1500 - enable_unshare: false + disable_networking: false output_max_size: 1024 max_process_count: 64 max_open_files: 2048 diff --git a/api/Dockerfile b/api/Dockerfile index 8f61d16..395e414 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -10,7 +10,7 @@ RUN for i in $(seq 1001 1500); do \ RUN apt-get update && \ apt-get install -y libxml2 gnupg tar coreutils util-linux libc6-dev \ binutils build-essential locales libpcre3-dev libevent-dev libgmp3-dev \ - libncurses6 libncurses5 libedit-dev && \ + libncurses6 libncurses5 libedit-dev libseccomp-dev && \ rm -rf /var/lib/apt/lists/* RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen @@ -22,5 +22,7 @@ COPY ["package.json", "package-lock.json", "./"] RUN npm i COPY ./src ./src +RUN make -C ./src/nosocket/ all && make -C ./src/nosocket/ install + CMD [ "node", "src", "-m", "-c", "/piston/config.yaml"] EXPOSE 2000/tcp diff --git a/api/src/config.js b/api/src/config.js index 023cc8e..d98a4b4 100644 --- a/api/src/config.js +++ b/api/src/config.js @@ -79,8 +79,8 @@ const options = [ validators: [] }, { - key: 'enable_unshare', - desc: 'Enable using unshare to disable networking', + key: 'disable_networking', + desc: 'Set to true to disable networking', default: true, validators: [] }, diff --git a/api/src/executor/job.js b/api/src/executor/job.js index 445c73a..77ecbfe 100644 --- a/api/src/executor/job.js +++ b/api/src/executor/job.js @@ -70,7 +70,7 @@ class Job { async safe_call(file, args, timeout) { return new Promise((resolve, reject) => { - const unshare = config.enable_unshare ? ['unshare','-n','-r'] : []; + const nonetwork = config.disable_networking ? ['nosocket'] : []; const prlimit = [ 'prlimit', @@ -80,7 +80,7 @@ class Job { const proc_call = [ ...prlimit, - ...unshare, + ...nonetwork, 'bash',file, ...args ]; diff --git a/api/src/nosocket/Makefile b/api/src/nosocket/Makefile new file mode 100644 index 0000000..a86a8f5 --- /dev/null +++ b/api/src/nosocket/Makefile @@ -0,0 +1,19 @@ +CC = gcc +CFLAGS = -O2 -Wall -lseccomp +TARGET = nosocket +BUILD_PATH = ./ +INSTALL_PATH = /usr/local/bin/ +SOURCE = nosocket.c + +all: $(TARGET) + +$(TARGET): $(SOURCE) + $(CC) $(BUILD_PATH)$(SOURCE) $(CFLAGS) -o $(TARGET) + +install: + mv $(TARGET) $(INSTALL_PATH) + +clean: + $(RM) $(TARGET) + $(RM) $(INSTALL_PATH)$(TARGET) + diff --git a/api/src/nosocket/nosocket.c b/api/src/nosocket/nosocket.c new file mode 100644 index 0000000..03909ee --- /dev/null +++ b/api/src/nosocket/nosocket.c @@ -0,0 +1,46 @@ +/* +nosocket.c + +Disables access to the `socket` syscall and runs a program provided as the first +commandline argument. +*/ +#include +#include +#include +#include +#include + +int main(int argc, char *argv[]) +{ + // Disallow any new capabilities from being added + prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0); + + // SCMP_ACT_ALLOW lets the filter have no effect on syscalls not matching a + // configured filter rule (allow all by default) + scmp_filter_ctx ctx = seccomp_init(SCMP_ACT_ALLOW); + if (!ctx) + { + fprintf(stderr, "Unable to initialize seccomp filter context\n"); + return 1; + } + + // Add a seccomp rule to the syscall blacklist - blacklist the socket syscall + if (seccomp_rule_add(ctx, SCMP_ACT_ERRNO(EACCES), SCMP_SYS(socket), 0) < 0) + { + fprintf(stderr, "Unable to add seccomp rule to context\n"); + return 1; + } + +#ifdef DEBUG + seccomp_export_pfc(ctx, 0); +#endif + + if (argc < 2) + { + fprintf(stderr, "Usage %s: %s \n", argv[0], argv[0]); + return 1; + } + seccomp_load(ctx); + execvp(argv[1], argv + 1); + return 1; +} diff --git a/docker-compose.yaml b/docker-compose.yaml index 82ec45a..76cf319 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -3,12 +3,10 @@ version: '2.7' services: piston_api: build: api - cap_add: - - CAP_SYS_ADMIN restart: always ports: - 2000:2000 volumes: - ./data/piston:/piston tmpfs: - - /piston/jobs:exec \ No newline at end of file + - /piston/jobs:exec diff --git a/repo/Dockerfile b/repo/Dockerfile index debbd0b..4c85179 100644 --- a/repo/Dockerfile +++ b/repo/Dockerfile @@ -1,5 +1,5 @@ FROM debian:buster-slim - +ENV DEBIAN_FRONTEND noninteractive RUN apt-get update && apt-get install -y unzip autoconf build-essential libssl-dev pkg-config zlib1g-dev libargon2-dev libsodium-dev libcurl4-openssl-dev sqlite3 libsqlite3-dev libonig-dev libxml2 libxml2-dev bc curl git linux-headers-amd64 perl xz-utils python3 python3-pip gnupg jq zlib1g-dev cmake cmake-doc extra-cmake-modules build-essential gcc binutils bash coreutils util-linux pciutils usbutils coreutils binutils findutils grep libncurses5-dev libncursesw5-dev python3-pip libgmp-dev libmpfr-dev python2 && \ ln -sf /bin/bash /bin/sh && \ rm -rf /var/lib/apt/lists/* && \ From 90217a620299692ccac0450dc55d619ae5cdcaf3 Mon Sep 17 00:00:00 2001 From: Thomas Date: Wed, 7 Apr 2021 16:16:19 +1200 Subject: [PATCH 356/385] Retry infinitely --- .github/workflows/package-pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/package-pr.yaml b/.github/workflows/package-pr.yaml index 7b200aa..fd3d91e 100644 --- a/.github/workflows/package-pr.yaml +++ b/.github/workflows/package-pr.yaml @@ -94,7 +94,7 @@ jobs: docker run --network container:api appropriate/curl -s --retry 10 --retry-connrefused http://localhost:2000/runtimes echo Waiting for Index to start.. - docker run --network container:piston_fs_repo appropriate/curl -s --retry 200 --retry-connrefused http://localhost:8000/index + docker run --network container:piston_fs_repo appropriate/curl -s --retry 999 --retry-max-time 0 --retry-connrefused http://localhost:8000/index echo Adjusting index sed -i 's/piston_fs_repo/localhost/g' repo/index From a2de8dea0c56da39737865dde1d3b935d6af5047 Mon Sep 17 00:00:00 2001 From: Shivansh-007 Date: Fri, 9 Apr 2021 12:20:55 +0530 Subject: [PATCH 357/385] pkg(pony-0.39.0): Add pony-lang 0.39.0 (#194) * pkg(pony-0.39.0): Add pony-lang 0.39.0 * pkg(pony-0.39.0): Use `git submodule` to install llvm and get the source through cloning. * pkg(pony-0.39.0): Reset to 0.39.0 commit and cd into `ponyc` * pkg(pony-0.39.0): User proper installation instructions, like specified in the installation guide * pkg(pony-0.39.0): Setup compile script. * pkg(pony-0.39.0): Properly delete the build dir. * pkg(pony-0.39.0): Get rid of author key in metdata * pkg(pony-0.39.0): `CD` into `ponyc` right before cloning. * pkg(ponyc-0.39.0): Move `cd` to the correct palce. --- packages/ponylang/0.39.0/build.sh | 27 ++++++++++++++++++++++++++ packages/ponylang/0.39.0/compile | 4 ++++ packages/ponylang/0.39.0/environment | 4 ++++ packages/ponylang/0.39.0/metadata.json | 5 +++++ packages/ponylang/0.39.0/run | 6 ++++++ packages/ponylang/0.39.0/test.pony | 3 +++ 6 files changed, 49 insertions(+) create mode 100755 packages/ponylang/0.39.0/build.sh create mode 100644 packages/ponylang/0.39.0/compile create mode 100644 packages/ponylang/0.39.0/environment create mode 100644 packages/ponylang/0.39.0/metadata.json create mode 100644 packages/ponylang/0.39.0/run create mode 100644 packages/ponylang/0.39.0/test.pony diff --git a/packages/ponylang/0.39.0/build.sh b/packages/ponylang/0.39.0/build.sh new file mode 100755 index 0000000..ec93a10 --- /dev/null +++ b/packages/ponylang/0.39.0/build.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +PREFIX=$(realpath $(dirname $0)) + +# get sources - only get the latest copy of the relevant files +git clone -q https://github.com/ponylang/ponyc.git ponyc + +cd ponyc + +# release commit for 0.39.0 +git reset --hard 85d897b978c5082a1f3264a3a9ad479446d73984 + +# updates all submodules recursively along their tracking branches +# i.e. https://github.com/ponylang/ponyc/blob/main/.gitmodules +git submodule update --recursive --init + +# Build the vendored LLVM libraries that are included in the `lib/llvm/src`. +make libs build_flags="-j$(nproc)" +# Configure the CMake build directory. +make configure +# Will build pony and put it in `build/release`. +make build +# Install pony into `$PREFIX`. +make prefix="$PREFIX" install + +cd .. +rm -rf ponyc diff --git a/packages/ponylang/0.39.0/compile b/packages/ponylang/0.39.0/compile new file mode 100644 index 0000000..a412613 --- /dev/null +++ b/packages/ponylang/0.39.0/compile @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# Compile pony file(s) +ponyc -b out \ No newline at end of file diff --git a/packages/ponylang/0.39.0/environment b/packages/ponylang/0.39.0/environment new file mode 100644 index 0000000..c6ab089 --- /dev/null +++ b/packages/ponylang/0.39.0/environment @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# Put 'export' statements here for environment variables +export PATH=$PWD/bin:$PATH \ No newline at end of file diff --git a/packages/ponylang/0.39.0/metadata.json b/packages/ponylang/0.39.0/metadata.json new file mode 100644 index 0000000..5856c39 --- /dev/null +++ b/packages/ponylang/0.39.0/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "ponylang", + "version": "0.39.0", + "aliases": ["pony", "ponyc"] +} diff --git a/packages/ponylang/0.39.0/run b/packages/ponylang/0.39.0/run new file mode 100644 index 0000000..8ac647b --- /dev/null +++ b/packages/ponylang/0.39.0/run @@ -0,0 +1,6 @@ +#!/bin/bash + +# removes the first arg from $@, which is always the filename +shift +# runs the executable with whatever args are left in $@ +./out "$@" \ No newline at end of file diff --git a/packages/ponylang/0.39.0/test.pony b/packages/ponylang/0.39.0/test.pony new file mode 100644 index 0000000..556516a --- /dev/null +++ b/packages/ponylang/0.39.0/test.pony @@ -0,0 +1,3 @@ +actor Main + new create(env: Env) => + env.out.print("OK") From 81cdc766b64738cbe875c56c756332d3f3196eff Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 10 Apr 2021 16:10:18 +1200 Subject: [PATCH 358/385] Uninstallation (#211) --- api/src/ppman/package.js | 22 ++++++++++++++++ api/src/ppman/routes.js | 32 ++++++++++++++++++++---- api/src/runtime.js | 5 ++++ cli/commands/ppman_commands/uninstall.js | 23 +++++++++++++++++ 4 files changed, 77 insertions(+), 5 deletions(-) create mode 100644 cli/commands/ppman_commands/uninstall.js diff --git a/api/src/ppman/package.js b/api/src/ppman/package.js index 0f4c78d..0be9822 100644 --- a/api/src/ppman/package.js +++ b/api/src/ppman/package.js @@ -131,6 +131,28 @@ class Package { }; } + + async uninstall(){ + logger.info(`Uninstalling ${this.language}-${this.version.raw}`); + + logger.debug("Finding runtime") + const runtime = runtime.get_latest_runtime_matching_language_version(this.language, this.version.raw); + + logger.debug("Unregistering runtime") + runtime.unregister(); + + logger.debug("Cleaning files from disk") + await fs.rmdir(this.install_path, {recursive: true}) + + logger.info(`Uninstalled ${this.language}-${this.version.raw}`) + + return { + language: this.language, + version: this.version.raw + }; + + } + } module.exports = { diff --git a/api/src/ppman/routes.js b/api/src/ppman/routes.js index fc8bbaf..4df95f6 100644 --- a/api/src/ppman/routes.js +++ b/api/src/ppman/routes.js @@ -91,11 +91,33 @@ module.exports = { // DELETE /packages/:language/:version async package_uninstall(req, res) { - return res - .status(500) - .send({ - message: 'Not implemented' - }); + logger.debug('Request to install package'); + + const pkg = await get_package(req.params.language, req.params.version); + + if (pkg == null) { + return res + .status(404) + .send({ + message: `Requested package ${req.params.language}-${req.params.version} does not exist` + }); + } + + try { + const response = await pkg.uninstall(); + + return res + .status(200) + .send(response); + } catch(e) { + logger.error(`Error while uninstalling package ${pkg.language}-${pkg.version}:`, e.message); + + return res + .status(500) + .send({ + message: e.message + }); + } } }; diff --git a/api/src/runtime.js b/api/src/runtime.js index 8d0604e..c5239c3 100644 --- a/api/src/runtime.js +++ b/api/src/runtime.js @@ -63,6 +63,11 @@ class Runtime { toString() { return `${this.language}-${this.version.raw}`; } + + unregister() { + const index = runtimes.indexOf(this); + runtimes.splice(index, 1); //Remove from runtimes list + } } module.exports = runtimes; diff --git a/cli/commands/ppman_commands/uninstall.js b/cli/commands/ppman_commands/uninstall.js new file mode 100644 index 0000000..11c7e4c --- /dev/null +++ b/cli/commands/ppman_commands/uninstall.js @@ -0,0 +1,23 @@ +const chalk = require('chalk'); + +exports.command = ['uninstall '] +exports.aliases = ['u'] +exports.describe = 'Installs the named package' + + +const msg_format = { + 'color': p => `${p.language ? chalk.green.bold('✓') : chalk.red.bold('❌')} Uninstallation ${p.language ? "succeeded" : "failed: " + p.message}`, + 'monochrome': p => `Uninstallation ${p.language ? "succeeded" : "failed: " + p.message}`, + 'json': JSON.stringify + +} + +exports.handler = async function({axios, language, languageVersion}){ + try{ + const install = await axios.delete(`/packages/${language}/${languageVersion}`) + + console.log(msg_format.color(install.data)); + }catch({response}){ + console.error(response.data.message) + } +} \ No newline at end of file From d2e05a4a7ea3cf09374f4daa4301764cc32c8310 Mon Sep 17 00:00:00 2001 From: Dan Vargas <10914883+dvargas46@users.noreply.github.com> Date: Sat, 10 Apr 2021 20:15:14 -0500 Subject: [PATCH 359/385] pkg(*-*): Fix uninstall (#213) --- api/src/ppman/package.js | 4 ++-- api/src/ppman/routes.js | 2 +- cli/commands/ppman_commands/uninstall.js | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/src/ppman/package.js b/api/src/ppman/package.js index 0be9822..21c7f16 100644 --- a/api/src/ppman/package.js +++ b/api/src/ppman/package.js @@ -136,10 +136,10 @@ class Package { logger.info(`Uninstalling ${this.language}-${this.version.raw}`); logger.debug("Finding runtime") - const runtime = runtime.get_latest_runtime_matching_language_version(this.language, this.version.raw); + const found_runtime = runtime.get_latest_runtime_matching_language_version(this.language, this.version.raw); logger.debug("Unregistering runtime") - runtime.unregister(); + found_runtime.unregister(); logger.debug("Cleaning files from disk") await fs.rmdir(this.install_path, {recursive: true}) diff --git a/api/src/ppman/routes.js b/api/src/ppman/routes.js index 4df95f6..89f472c 100644 --- a/api/src/ppman/routes.js +++ b/api/src/ppman/routes.js @@ -91,7 +91,7 @@ module.exports = { // DELETE /packages/:language/:version async package_uninstall(req, res) { - logger.debug('Request to install package'); + logger.debug('Request to uninstall package'); const pkg = await get_package(req.params.language, req.params.version); diff --git a/cli/commands/ppman_commands/uninstall.js b/cli/commands/ppman_commands/uninstall.js index 11c7e4c..c8230ae 100644 --- a/cli/commands/ppman_commands/uninstall.js +++ b/cli/commands/ppman_commands/uninstall.js @@ -2,7 +2,7 @@ const chalk = require('chalk'); exports.command = ['uninstall '] exports.aliases = ['u'] -exports.describe = 'Installs the named package' +exports.describe = 'Uninstalls the named package' const msg_format = { @@ -14,9 +14,9 @@ const msg_format = { exports.handler = async function({axios, language, languageVersion}){ try{ - const install = await axios.delete(`/packages/${language}/${languageVersion}`) + const uninstall = await axios.delete(`/packages/${language}/${languageVersion}`) - console.log(msg_format.color(install.data)); + console.log(msg_format.color(uninstall.data)); }catch({response}){ console.error(response.data.message) } From 86e902e63015849d7d63e8badcd11538b14a3c9e Mon Sep 17 00:00:00 2001 From: Thomas Date: Mon, 12 Apr 2021 19:09:45 +1200 Subject: [PATCH 360/385] Add libffi-dev to dependencies --- repo/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repo/Dockerfile b/repo/Dockerfile index 4c85179..90d6547 100644 --- a/repo/Dockerfile +++ b/repo/Dockerfile @@ -1,6 +1,6 @@ FROM debian:buster-slim ENV DEBIAN_FRONTEND noninteractive -RUN apt-get update && apt-get install -y unzip autoconf build-essential libssl-dev pkg-config zlib1g-dev libargon2-dev libsodium-dev libcurl4-openssl-dev sqlite3 libsqlite3-dev libonig-dev libxml2 libxml2-dev bc curl git linux-headers-amd64 perl xz-utils python3 python3-pip gnupg jq zlib1g-dev cmake cmake-doc extra-cmake-modules build-essential gcc binutils bash coreutils util-linux pciutils usbutils coreutils binutils findutils grep libncurses5-dev libncursesw5-dev python3-pip libgmp-dev libmpfr-dev python2 && \ +RUN apt-get update && apt-get install -y unzip autoconf build-essential libssl-dev pkg-config zlib1g-dev libargon2-dev libsodium-dev libcurl4-openssl-dev sqlite3 libsqlite3-dev libonig-dev libxml2 libxml2-dev bc curl git linux-headers-amd64 perl xz-utils python3 python3-pip gnupg jq zlib1g-dev cmake cmake-doc extra-cmake-modules build-essential gcc binutils bash coreutils util-linux pciutils usbutils coreutils binutils findutils grep libncurses5-dev libncursesw5-dev python3-pip libgmp-dev libmpfr-dev python2 libffi-dev && \ ln -sf /bin/bash /bin/sh && \ rm -rf /var/lib/apt/lists/* && \ update-alternatives --install /usr/bin/python python /usr/bin/python3.7 2 From f24f1a45a7be2f6e5c7a63cfd309ba97425b9e61 Mon Sep 17 00:00:00 2001 From: Shivansh-007 Date: Wed, 14 Apr 2021 09:54:58 +0530 Subject: [PATCH 361/385] Adds python 3.9.4 and 3.10.0a7 (#217) * pkg(python-3.9.4): Adds python 3.9.4 * pkg(python-3.10.0a7): Adds python 3.10.0a7 * pkg(python-3.10.0a7): More pythonic 3.10.0a7 code * pkg(python-3.10.0a7): Use semver versioning * pkg(python-3.10.0a7): remove 'py3' alias and add 'py' * pkg(python-3.9.4): remove 'py3' alias and add 'py' --- packages/python/3.10.0-alpha.7/build.sh | 22 ++++++++++++++++++++ packages/python/3.10.0-alpha.7/environment | 1 + packages/python/3.10.0-alpha.7/metadata.json | 5 +++++ packages/python/3.10.0-alpha.7/run | 3 +++ packages/python/3.10.0-alpha.7/test.py | 7 +++++++ packages/python/3.9.4/build.sh | 21 +++++++++++++++++++ packages/python/3.9.4/environment | 1 + packages/python/3.9.4/metadata.json | 5 +++++ packages/python/3.9.4/run | 3 +++ packages/python/3.9.4/test.py | 18 ++++++++++++++++ 10 files changed, 86 insertions(+) create mode 100755 packages/python/3.10.0-alpha.7/build.sh create mode 100644 packages/python/3.10.0-alpha.7/environment create mode 100644 packages/python/3.10.0-alpha.7/metadata.json create mode 100644 packages/python/3.10.0-alpha.7/run create mode 100644 packages/python/3.10.0-alpha.7/test.py create mode 100755 packages/python/3.9.4/build.sh create mode 100644 packages/python/3.9.4/environment create mode 100644 packages/python/3.9.4/metadata.json create mode 100644 packages/python/3.9.4/run create mode 100644 packages/python/3.9.4/test.py diff --git a/packages/python/3.10.0-alpha.7/build.sh b/packages/python/3.10.0-alpha.7/build.sh new file mode 100755 index 0000000..914353f --- /dev/null +++ b/packages/python/3.10.0-alpha.7/build.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +PREFIX=$(realpath $(dirname $0)) + +mkdir -p build + +cd build + +curl "https://www.python.org/ftp/python/3.10.0/Python-3.10.0a7.tgz" -o python.tar.gz +tar xzf python.tar.gz --strip-components=1 +rm python.tar.gz + +./configure --prefix "$PREFIX" --with-ensurepip=install +make -j$(nproc) +make install -j$(nproc) + +cd .. + +rm -rf build + +# This is alpha version, hence most of the libraries are not compatible with python3.10.0 +# bin/pip3 install numpy scipy pandas pycrypto whoosh bcrypt passlib diff --git a/packages/python/3.10.0-alpha.7/environment b/packages/python/3.10.0-alpha.7/environment new file mode 100644 index 0000000..bd0ff98 --- /dev/null +++ b/packages/python/3.10.0-alpha.7/environment @@ -0,0 +1 @@ +export PATH=$PWD/bin:$PATH \ No newline at end of file diff --git a/packages/python/3.10.0-alpha.7/metadata.json b/packages/python/3.10.0-alpha.7/metadata.json new file mode 100644 index 0000000..18c1722 --- /dev/null +++ b/packages/python/3.10.0-alpha.7/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "python", + "version": "3.10.0-alpha.7", + "aliases": ["py", "python3"] +} diff --git a/packages/python/3.10.0-alpha.7/run b/packages/python/3.10.0-alpha.7/run new file mode 100644 index 0000000..ff60df2 --- /dev/null +++ b/packages/python/3.10.0-alpha.7/run @@ -0,0 +1,3 @@ +#!/bin/bash + +python3.10 "$@" \ No newline at end of file diff --git a/packages/python/3.10.0-alpha.7/test.py b/packages/python/3.10.0-alpha.7/test.py new file mode 100644 index 0000000..c3135e2 --- /dev/null +++ b/packages/python/3.10.0-alpha.7/test.py @@ -0,0 +1,7 @@ +working = True + +match working: + case True: + print("OK") + case False: + print() \ No newline at end of file diff --git a/packages/python/3.9.4/build.sh b/packages/python/3.9.4/build.sh new file mode 100755 index 0000000..f9ab88c --- /dev/null +++ b/packages/python/3.9.4/build.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +PREFIX=$(realpath $(dirname $0)) + +mkdir -p build + +cd build + +curl "https://www.python.org/ftp/python/3.9.4/Python-3.9.4.tgz" -o python.tar.gz +tar xzf python.tar.gz --strip-components=1 +rm python.tar.gz + +./configure --prefix "$PREFIX" --with-ensurepip=install +make -j$(nproc) +make install -j$(nproc) + +cd .. + +rm -rf build + +bin/pip3 install numpy scipy pandas pycrypto whoosh bcrypt passlib diff --git a/packages/python/3.9.4/environment b/packages/python/3.9.4/environment new file mode 100644 index 0000000..bd0ff98 --- /dev/null +++ b/packages/python/3.9.4/environment @@ -0,0 +1 @@ +export PATH=$PWD/bin:$PATH \ No newline at end of file diff --git a/packages/python/3.9.4/metadata.json b/packages/python/3.9.4/metadata.json new file mode 100644 index 0000000..b49acc9 --- /dev/null +++ b/packages/python/3.9.4/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "python", + "version": "3.9.4", + "aliases": ["py", "python3"] +} diff --git a/packages/python/3.9.4/run b/packages/python/3.9.4/run new file mode 100644 index 0000000..450bb76 --- /dev/null +++ b/packages/python/3.9.4/run @@ -0,0 +1,3 @@ +#!/bin/bash + +python3.9 "$@" \ No newline at end of file diff --git a/packages/python/3.9.4/test.py b/packages/python/3.9.4/test.py new file mode 100644 index 0000000..f8bcd5c --- /dev/null +++ b/packages/python/3.9.4/test.py @@ -0,0 +1,18 @@ +execute = (execute_with := lambda *a, **k: lambda f: f(*a, **k))() + + +@int +@execute +class n: __int__ = lambda _: 69 + + +@execute +class cout: __lshift__ = print + + +@execute_with(n) +def output(n): + return "OK" + + +cout << output From 75e30ee6d3ff89fdfeeea7b58529806049338a17 Mon Sep 17 00:00:00 2001 From: Thomas Date: Sat, 17 Apr 2021 12:10:59 +1200 Subject: [PATCH 362/385] Update api-push.yaml --- .github/workflows/api-push.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/api-push.yaml b/.github/workflows/api-push.yaml index 7bafdc1..bcf0472 100644 --- a/.github/workflows/api-push.yaml +++ b/.github/workflows/api-push.yaml @@ -21,6 +21,12 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} registry: docker.pkg.github.com + - name: Login to ghcr.io + uses: docker/login-action@v1 + with: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + registry: ghcr.io - name: Build and push API uses: docker/build-push-action@v2 @@ -29,4 +35,5 @@ jobs: push: true pull: true tags: | - docker.pkg.github.com/engineer-man/piston/api \ No newline at end of file + docker.pkg.github.com/engineer-man/piston/api + ghcr.io/engineer-man/piston From 1edb5ad0466056eeecab11670baf9bc00048ee86 Mon Sep 17 00:00:00 2001 From: Thomas Date: Sat, 17 Apr 2021 12:11:31 +1200 Subject: [PATCH 363/385] ci bump --- api/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/api/Dockerfile b/api/Dockerfile index 395e414..40ecb71 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -26,3 +26,4 @@ RUN make -C ./src/nosocket/ all && make -C ./src/nosocket/ install CMD [ "node", "src", "-m", "-c", "/piston/config.yaml"] EXPOSE 2000/tcp + From df34a3f421572865ce77dbe19b5dd6308da34e12 Mon Sep 17 00:00:00 2001 From: Thomas Date: Sat, 17 Apr 2021 16:40:53 +1200 Subject: [PATCH 364/385] ghcr.io package --- readme.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/readme.md b/readme.md index 7d3173a..cbc8826 100644 --- a/readme.md +++ b/readme.md @@ -117,10 +117,7 @@ cd cli && npm i && cd - ### Installation ```sh -echo "$GITHUB_TOKEN" | docker login https://docker.pkg.github.com -u "$GITHUB_USERNAME" --password-stdin -# Change out the $GITHUB_TOKEN and $GITHUB_USERNAME with appropritate values - -docker run -v $PWD:'/piston' --tmpfs /piston/jobs -dit -p 2000:2000 --name piston_api docker.pkg.github.com/engineer-man/piston/api:latest +docker run -v $PWD:'/piston' --tmpfs /piston/jobs -dit -p 2000:2000 --name piston_api ghcr.io/engineer-man/piston ```
From 7191bc063cb6418d46db28e4ad16c12a4616a558 Mon Sep 17 00:00:00 2001 From: Thomas Date: Sat, 17 Apr 2021 16:41:27 +1200 Subject: [PATCH 365/385] ghcr.io package --- docker-compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 76cf319..3202a28 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -2,7 +2,7 @@ version: '2.7' services: piston_api: - build: api + image: ghcr.io/engineer-man/piston restart: always ports: - 2000:2000 From 353de20ae923d4697538d0d9d608c11aca8adc04 Mon Sep 17 00:00:00 2001 From: Dan Vargas <10914883+dvargas46@users.noreply.github.com> Date: Wed, 21 Apr 2021 20:34:48 -0500 Subject: [PATCH 366/385] pkg(pyth-1.0.0): Add pyth 1.0.0 (#222) --- packages/pyth/1.0.0/build.sh | 6 ++++++ packages/pyth/1.0.0/environment | 5 +++++ packages/pyth/1.0.0/metadata.json | 5 +++++ packages/pyth/1.0.0/run | 4 ++++ packages/pyth/1.0.0/test.pyth | 1 + 5 files changed, 21 insertions(+) create mode 100755 packages/pyth/1.0.0/build.sh create mode 100644 packages/pyth/1.0.0/environment create mode 100644 packages/pyth/1.0.0/metadata.json create mode 100644 packages/pyth/1.0.0/run create mode 100644 packages/pyth/1.0.0/test.pyth diff --git a/packages/pyth/1.0.0/build.sh b/packages/pyth/1.0.0/build.sh new file mode 100755 index 0000000..b1c2968 --- /dev/null +++ b/packages/pyth/1.0.0/build.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +# Pyth install +source ../../python/3.9.1/build.sh + +git clone -q "https://github.com/isaacg1/pyth.git" pyth diff --git a/packages/pyth/1.0.0/environment b/packages/pyth/1.0.0/environment new file mode 100644 index 0000000..7a20607 --- /dev/null +++ b/packages/pyth/1.0.0/environment @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +# Python and Pyth path +export PATH=$PWD/bin:$PATH +export PYTH_PATH=$PWD/pyth diff --git a/packages/pyth/1.0.0/metadata.json b/packages/pyth/1.0.0/metadata.json new file mode 100644 index 0000000..bcddb7a --- /dev/null +++ b/packages/pyth/1.0.0/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "pyth", + "version": "1.0.0", + "aliases": ["pyth"] +} diff --git a/packages/pyth/1.0.0/run b/packages/pyth/1.0.0/run new file mode 100644 index 0000000..43a6a6d --- /dev/null +++ b/packages/pyth/1.0.0/run @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# pyth only takes filename and stdin +python3 "$PYTH_PATH"/pyth.py "$1" diff --git a/packages/pyth/1.0.0/test.pyth b/packages/pyth/1.0.0/test.pyth new file mode 100644 index 0000000..d096585 --- /dev/null +++ b/packages/pyth/1.0.0/test.pyth @@ -0,0 +1 @@ +"OK \ No newline at end of file From 2a8595142633f9b85b0c4edf900d6ad1e76f611c Mon Sep 17 00:00:00 2001 From: Dan Vargas <10914883+dvargas46@users.noreply.github.com> Date: Wed, 21 Apr 2021 20:35:33 -0500 Subject: [PATCH 367/385] pkg(golfscript-1.0.0): Add golfscript 1.0.0 (#221) --- packages/golfscript/1.0.0/build.sh | 10 ++++++++++ packages/golfscript/1.0.0/environment | 4 ++++ packages/golfscript/1.0.0/metadata.json | 5 +++++ packages/golfscript/1.0.0/run | 4 ++++ packages/golfscript/1.0.0/test.golfscript | 1 + 5 files changed, 24 insertions(+) create mode 100755 packages/golfscript/1.0.0/build.sh create mode 100644 packages/golfscript/1.0.0/environment create mode 100644 packages/golfscript/1.0.0/metadata.json create mode 100644 packages/golfscript/1.0.0/run create mode 100644 packages/golfscript/1.0.0/test.golfscript diff --git a/packages/golfscript/1.0.0/build.sh b/packages/golfscript/1.0.0/build.sh new file mode 100755 index 0000000..6dda246 --- /dev/null +++ b/packages/golfscript/1.0.0/build.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# golfscript was implemented as a Ruby script originally +source ../../ruby/2.5.1/build.sh + +curl "http://www.golfscript.com/golfscript/golfscript.rb" -o bin/golfscript.rb + +# using the shebang to run it with the right Ruby +sed -i "s|/usr/bin/|$PWD/bin/|g" bin/golfscript.rb +chmod +x bin/golfscript.rb diff --git a/packages/golfscript/1.0.0/environment b/packages/golfscript/1.0.0/environment new file mode 100644 index 0000000..242cd43 --- /dev/null +++ b/packages/golfscript/1.0.0/environment @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# Path to Ruby and golfscript.rb +export PATH=$PWD/bin:$PATH diff --git a/packages/golfscript/1.0.0/metadata.json b/packages/golfscript/1.0.0/metadata.json new file mode 100644 index 0000000..4ef3a62 --- /dev/null +++ b/packages/golfscript/1.0.0/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "golfscript", + "version": "1.0.0", + "aliases": ["golfscript"] +} diff --git a/packages/golfscript/1.0.0/run b/packages/golfscript/1.0.0/run new file mode 100644 index 0000000..8f24eda --- /dev/null +++ b/packages/golfscript/1.0.0/run @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# golfscript only takes code file and stdin +golfscript.rb "$1" diff --git a/packages/golfscript/1.0.0/test.golfscript b/packages/golfscript/1.0.0/test.golfscript new file mode 100644 index 0000000..11e42d0 --- /dev/null +++ b/packages/golfscript/1.0.0/test.golfscript @@ -0,0 +1 @@ +"OK" From 8424307029af51d4b56873d17cbe0f3bf0b84e59 Mon Sep 17 00:00:00 2001 From: Dan Vargas <10914883+dvargas46@users.noreply.github.com> Date: Wed, 21 Apr 2021 21:30:20 -0500 Subject: [PATCH 368/385] pkg(cjam-0.6.5): Add cjam 0.6.5 (#223) * pkg(cjam-0.6.5): Add cjam 0.6.5 * pkg(cjam-0.6.5): Run jar file normally and remove self alias --- packages/cjam/0.6.5/build.sh | 6 ++++++ packages/cjam/0.6.5/environment | 5 +++++ packages/cjam/0.6.5/metadata.json | 5 +++++ packages/cjam/0.6.5/run | 4 ++++ packages/cjam/0.6.5/test.cjam | 1 + 5 files changed, 21 insertions(+) create mode 100755 packages/cjam/0.6.5/build.sh create mode 100644 packages/cjam/0.6.5/environment create mode 100644 packages/cjam/0.6.5/metadata.json create mode 100644 packages/cjam/0.6.5/run create mode 100644 packages/cjam/0.6.5/test.cjam diff --git a/packages/cjam/0.6.5/build.sh b/packages/cjam/0.6.5/build.sh new file mode 100755 index 0000000..825c007 --- /dev/null +++ b/packages/cjam/0.6.5/build.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +# CJam depends on Java +source ../../java/15.0.2/build.sh + +curl -L "https://downloads.sourceforge.net/project/cjam/cjam-0.6.5/cjam-0.6.5.jar?ts=gAAAAABgf6xp4bmSJmNMjz8z23zWVbRgW6mhaFrnxdBe_riqC4rZnhUpXJrQzPpSqhniaoGptfkI_r-tjjBc5326oRmloXIJYQ%3D%3D&r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fcjam%2Ffiles%2Fcjam-0.6.5%2Fcjam-0.6.5.jar%2Fdownload" -o bin/cjam.jar diff --git a/packages/cjam/0.6.5/environment b/packages/cjam/0.6.5/environment new file mode 100644 index 0000000..111d4de --- /dev/null +++ b/packages/cjam/0.6.5/environment @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +# CJam and Java Path +export PATH=$PWD/bin:$PATH +export CJAM_PATH=$PWD/bin diff --git a/packages/cjam/0.6.5/metadata.json b/packages/cjam/0.6.5/metadata.json new file mode 100644 index 0000000..af510fd --- /dev/null +++ b/packages/cjam/0.6.5/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "cjam", + "version": "0.6.5", + "aliases": [] +} diff --git a/packages/cjam/0.6.5/run b/packages/cjam/0.6.5/run new file mode 100644 index 0000000..1877d8f --- /dev/null +++ b/packages/cjam/0.6.5/run @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# run cjam jar +java -jar "$CJAM_PATH"/cjam.jar "$@" diff --git a/packages/cjam/0.6.5/test.cjam b/packages/cjam/0.6.5/test.cjam new file mode 100644 index 0000000..45021e7 --- /dev/null +++ b/packages/cjam/0.6.5/test.cjam @@ -0,0 +1 @@ +"OK" \ No newline at end of file From e975b64f2df63db49e9d8c33e4c0c66623846900 Mon Sep 17 00:00:00 2001 From: Dan Vargas <10914883+dvargas46@users.noreply.github.com> Date: Wed, 21 Apr 2021 21:31:00 -0500 Subject: [PATCH 369/385] pkg(dragon-1.9.8): Add dragon 1.9.8 (#220) * pkg(dragon-1.9.8): Add dragon 1.9.8 * pkg(dragon-1.9.8): Remove manpages and self alias --- packages/dragon/1.9.8/build.sh | 25 +++++++++++++++++++++++++ packages/dragon/1.9.8/environment | 5 +++++ packages/dragon/1.9.8/metadata.json | 5 +++++ packages/dragon/1.9.8/run | 4 ++++ packages/dragon/1.9.8/test.dragon | 1 + 5 files changed, 40 insertions(+) create mode 100755 packages/dragon/1.9.8/build.sh create mode 100644 packages/dragon/1.9.8/environment create mode 100644 packages/dragon/1.9.8/metadata.json create mode 100644 packages/dragon/1.9.8/run create mode 100644 packages/dragon/1.9.8/test.dragon diff --git a/packages/dragon/1.9.8/build.sh b/packages/dragon/1.9.8/build.sh new file mode 100755 index 0000000..560db8a --- /dev/null +++ b/packages/dragon/1.9.8/build.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +# Dragon install +mkdir -p build + +cd build + +curl "https://dragon-lang.org/Dragon_1.9.8_linux(x86_x64).tar.bz2" -o dragon.tar.bz2 +tar xjf dragon.tar.bz2 --strip-components=1 + +### re-purposed the install script for local install and without manpages + +mkdir -p ../bin +cp dragon ../bin/ +chmod +x ../bin/dragon + +cp -r runtime ../bin/ +chmod +x ../bin/runtime/bin/java + +sed -i 's|/bin/runtime/bin/java|$JAVA_RUNTIME|g' ../bin/dragon + +### + +cd ../ +rm -rf build diff --git a/packages/dragon/1.9.8/environment b/packages/dragon/1.9.8/environment new file mode 100644 index 0000000..b4106f8 --- /dev/null +++ b/packages/dragon/1.9.8/environment @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +# dragon binary & java runtime path +export PATH=$PWD/bin:$PATH +export JAVA_RUNTIME=$PWD/bin/runtime/bin/java \ No newline at end of file diff --git a/packages/dragon/1.9.8/metadata.json b/packages/dragon/1.9.8/metadata.json new file mode 100644 index 0000000..86cfc4c --- /dev/null +++ b/packages/dragon/1.9.8/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "dragon", + "version": "1.9.8", + "aliases": [] +} diff --git a/packages/dragon/1.9.8/run b/packages/dragon/1.9.8/run new file mode 100644 index 0000000..87512ae --- /dev/null +++ b/packages/dragon/1.9.8/run @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# dragon run +dragon -r "$@" diff --git a/packages/dragon/1.9.8/test.dragon b/packages/dragon/1.9.8/test.dragon new file mode 100644 index 0000000..6c33003 --- /dev/null +++ b/packages/dragon/1.9.8/test.dragon @@ -0,0 +1 @@ +showln "OK" \ No newline at end of file From b3575246bd1525a25af0ceb918f0db0ade5c447d Mon Sep 17 00:00:00 2001 From: Brian Seymour Date: Thu, 22 Apr 2021 18:43:21 -0500 Subject: [PATCH 370/385] change urls, fix docker compose file --- api/src/index.js | 10 +- cli/commands/ppman_commands/install.js | 6 +- cli/commands/ppman_commands/list.js | 6 +- cli/commands/ppman_commands/uninstall.js | 6 +- cli/package-lock.json | 233 +---------------------- docker-compose.dev.yaml | 10 +- docker-compose.yaml | 5 +- readme.md | 10 +- 8 files changed, 29 insertions(+), 257 deletions(-) diff --git a/api/src/index.js b/api/src/index.js index 00b55b8..ce4a1ae 100644 --- a/api/src/index.js +++ b/api/src/index.js @@ -78,15 +78,15 @@ const app = express(); const ppman_routes = require('./ppman/routes'); const executor_routes = require('./executor/routes'); - app.get('/packages', ppman_routes.package_list); - app.post('/packages/:language/:version', ppman_routes.package_install); - app.delete('/packages/:language/:version', ppman_routes.package_uninstall); - app.post('/jobs', + app.get('/api/v1/packages', ppman_routes.package_list); + app.post('/api/v1/packages/:language/:version', ppman_routes.package_install); + app.delete('/api/v1/packages/:language/:version', ppman_routes.package_uninstall); + app.post('/api/v1/execute', executor_routes.run_job_validators, validate, executor_routes.run_job ); - app.get('/runtimes', (req, res) => { + app.get('/api/v1/runtimes', (req, res) => { const runtimes = runtime .map(rt => { return { diff --git a/cli/commands/ppman_commands/install.js b/cli/commands/ppman_commands/install.js index 151ab1d..4211510 100644 --- a/cli/commands/ppman_commands/install.js +++ b/cli/commands/ppman_commands/install.js @@ -14,10 +14,10 @@ const msg_format = { exports.handler = async function({axios, language, languageVersion}){ try{ - const install = await axios.post(`/packages/${language}/${languageVersion}`) - + const install = await axios.post(`/api/v1/packages/${language}/${languageVersion}`) + console.log(msg_format.color(install.data)); }catch({response}){ console.error(response.data.message) } -} \ No newline at end of file +} diff --git a/cli/commands/ppman_commands/list.js b/cli/commands/ppman_commands/list.js index b4ad16c..fa3cb27 100644 --- a/cli/commands/ppman_commands/list.js +++ b/cli/commands/ppman_commands/list.js @@ -15,12 +15,12 @@ const msg_format = { exports.handler = async function({axios}){ - const packages = await axios.get('/packages'); + const packages = await axios.get('/api/v1/packages'); + - const pkg_msg = packages.data .map(msg_format.color) .join('\n'); console.log(pkg_msg); -} \ No newline at end of file +} diff --git a/cli/commands/ppman_commands/uninstall.js b/cli/commands/ppman_commands/uninstall.js index c8230ae..dc5bd87 100644 --- a/cli/commands/ppman_commands/uninstall.js +++ b/cli/commands/ppman_commands/uninstall.js @@ -14,10 +14,10 @@ const msg_format = { exports.handler = async function({axios, language, languageVersion}){ try{ - const uninstall = await axios.delete(`/packages/${language}/${languageVersion}`) - + const uninstall = await axios.delete(`/api/v1/packages/${language}/${languageVersion}`) + console.log(msg_format.color(uninstall.data)); }catch({response}){ console.error(response.data.message) } -} \ No newline at end of file +} diff --git a/cli/package-lock.json b/cli/package-lock.json index f997f96..66fb04d 100644 --- a/cli/package-lock.json +++ b/cli/package-lock.json @@ -1,239 +1,8 @@ { "name": "piston-cli", "version": "1.0.0", - "lockfileVersion": 2, + "lockfileVersion": 1, "requires": true, - "packages": { - "": { - "name": "piston-cli", - "version": "1.0.0", - "license": "MIT", - "dependencies": { - "axios": "^0.21.1", - "chalk": "^4.1.0", - "yargs": "^16.2.0" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/axios": { - "version": "0.21.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", - "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", - "dependencies": { - "follow-redirects": "^1.10.0" - } - }, - "node_modules/chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, - "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "engines": { - "node": ">=6" - } - }, - "node_modules/follow-redirects": { - "version": "1.13.3", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.3.tgz", - "integrity": "sha512-DUgl6+HDzB0iEptNQEXLx/KhTmDb8tZUHSeLqpnjpknR70H0nC2t9N73BK6fN4hOvJ84pKlIQVQ4k5FFlBedKA==", - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" - } - ], - "engines": { - "node": ">=4.0" - }, - "peerDependenciesMeta": { - "debug": { - "optional": true - } - } - }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "engines": { - "node": ">=8" - } - }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/string-width": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", - "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dependencies": { - "ansi-regex": "^5.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/y18n": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.5.tgz", - "integrity": "sha512-hsRUr4FFrvhhRH12wOdfs38Gy7k2FFzB9qgN9v3aLykRq0dRcdcpz5C9FxdS2NuhOrI/628b/KSTJ3rwHysYSg==", - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "dependencies": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs-parser": { - "version": "20.2.7", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.7.tgz", - "integrity": "sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw==", - "engines": { - "node": ">=10" - } - } - }, "dependencies": { "ansi-regex": { "version": "5.0.0", diff --git a/docker-compose.dev.yaml b/docker-compose.dev.yaml index cafae5c..f2b3a14 100644 --- a/docker-compose.dev.yaml +++ b/docker-compose.dev.yaml @@ -1,9 +1,10 @@ -version: '2.7' +version: '3.2' services: - piston_api: + api: build: api - cap_add: + container_name: piston_api + cap_add: - CAP_SYS_ADMIN restart: always ports: @@ -13,8 +14,9 @@ services: tmpfs: - /piston/jobs:exec - piston_fs_repo: # Local testing of packages + repo: # Local testing of packages build: repo + container_name: piston_repo command: ['dart-2.12.1'] # Only build dart volumes: - .:/piston diff --git a/docker-compose.yaml b/docker-compose.yaml index 3202a28..764a55b 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,8 +1,9 @@ -version: '2.7' +version: '3.2' services: - piston_api: + api: image: ghcr.io/engineer-man/piston + container_name: piston_api restart: always ports: - 2000:2000 diff --git a/readme.md b/readme.md index cbc8826..190464e 100644 --- a/readme.md +++ b/readme.md @@ -101,11 +101,11 @@ git clone https://github.com/engineer-man/piston ### Installation ```sh -docker-compose up -d piston_api # Start the API container +docker-compose up -d api -cd cli && npm i && cd - # Install all the dependencies for the cli +cd cli && npm i && cd - ``` ## Just Piston (no CLI) @@ -158,10 +158,10 @@ cli/index.js -u http://piston.server:2000 ppman list ### API The container exposes an API on port 2000 by default. -This is used by the CLI to carry out running jobs and package managment. +This is used by the CLI to carry out running jobs and package management. #### Runtimes Endpoint -`GET /runtimes` +`GET /api/v1/runtimes` This endpoint will return the supported languages along with the current version and aliases. To execute code for a particular language using the `/jobs` endpoint, either the name or one of the aliases must be provided, along with the version. @@ -190,7 +190,7 @@ Content-Type: application/json ``` #### Execute Endpoint -`POST /jobs` +`POST /api/v1/execute` This endpoint requests execution of some arbitrary code. - `language` (**required**) The language to use for execution, must be a string and must be installed. - `version` (**required**) The version of the language to use for execution, must be a string containing a SemVer selector for the version or the specific version number to use. From 9814217aeeb67a79ba3cc3b3da9f0d3f495ebed8 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Fri, 23 Apr 2021 11:52:50 +1200 Subject: [PATCH 371/385] remove main --- api/src/executor/job.js | 11 ++--------- api/src/executor/routes.js | 5 ++--- cli/commands/execute.js | 1 - readme.md | 4 +--- 4 files changed, 5 insertions(+), 16 deletions(-) diff --git a/api/src/executor/job.js b/api/src/executor/job.js index 77ecbfe..2aff1be 100644 --- a/api/src/executor/job.js +++ b/api/src/executor/job.js @@ -17,22 +17,15 @@ let gid = 0; class Job { - constructor({ runtime, files, args, stdin, timeouts, main, alias }) { + constructor({ runtime, files, args, stdin, timeouts, alias }) { this.uuid = uuidv4(); this.runtime = runtime; this.files = files; this.args = args; this.stdin = stdin; this.timeouts = timeouts; - this.main = main; this.alias = alias; - let file_list = this.files.map(f => f.name); - - if (!file_list.includes(this.main)) { - throw new Error(`Main file "${this.main}" will not be written to disk`); - } - this.uid = config.runner_uid_min + uid; this.gid = config.runner_gid_min + gid; @@ -171,7 +164,7 @@ class Job { const run = await this.safe_call( path.join(this.runtime.pkgdir, 'run'), - [this.main, ...this.args], + [this.files[0].name, ...this.args], this.timeouts.run ); diff --git a/api/src/executor/routes.js b/api/src/executor/routes.js index 3cb4fe2..2bcd0d7 100644 --- a/api/src/executor/routes.js +++ b/api/src/executor/routes.js @@ -1,4 +1,4 @@ -// {"language":"python","version":"3.9.1","files":{"code.py":"print('hello world')"},"args":[],"stdin":"","compile_timeout":10, "run_timeout":3, "main": "code.py"} +// {"language":"python","version":"3.9.1","files":{"code.py":"print('hello world')"},"args":[],"stdin":"","compile_timeout":10, "run_timeout":3} // {"success":true, "run":{"stdout":"hello world", "stderr":"", "error_code":0},"compile":{"stdout":"","stderr":"","error_code":0}} const { get_latest_runtime_matching_language_version } = require('../runtime'); @@ -55,8 +55,7 @@ module.exports = { timeouts: { run: req.body.run_timeout, compile: req.body.compile_timeout - }, - main: req.body.main + } }); await job.prime(); diff --git a/cli/commands/execute.js b/cli/commands/execute.js index b4baf35..6adaf7e 100644 --- a/cli/commands/execute.js +++ b/cli/commands/execute.js @@ -52,7 +52,6 @@ exports.handler = async function(argv){ language: argv.language, version: argv['language-version'], files: files, - main: path.basename(argv.file), args: argv.args, stdin, compile_timeout: argv.ct, diff --git a/readme.md b/readme.md index 190464e..08f15da 100644 --- a/readme.md +++ b/readme.md @@ -194,10 +194,9 @@ Content-Type: application/json This endpoint requests execution of some arbitrary code. - `language` (**required**) The language to use for execution, must be a string and must be installed. - `version` (**required**) The version of the language to use for execution, must be a string containing a SemVer selector for the version or the specific version number to use. -- `files` (**required**) An array of files containing code or other data that should be used for execution. +- `files` (**required**) An array of files containing code or other data that should be used for execution. The first file in this array is considered the main file. - `files[].name` (**required**) The name of the file to upload, must be a string containing no path. - `files[].content` (**required**) The content of the files to upload, must be a string containing text to write. -- `main` (**required**) The name of one of the files provided that should be considered the main source file which will be used as the entrypoint, must be a string and be the name of a file in `files`. - `stdin` (**required**) The text to pass as stdin to the program. Must be a string, can be left blank. - `args` (**required**) The arguments to pass to the program. Must be an array. - `compile_timeout` (**required**) The maximum time allowed for the compile stage to finish before bailing out in milliseconds. Must be a number. @@ -213,7 +212,6 @@ This endpoint requests execution of some arbitrary code. "content": "console.log(process.argv)" } ], - "main": "my_cool_code.js", "stdin": "", "args": [ "1", From 589dfec6dfb8c14503e91a643592b5668b6bc23a Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Fri, 23 Apr 2021 11:54:37 +1200 Subject: [PATCH 372/385] default values --- api/src/executor/routes.js | 18 ++++-------------- readme.md | 8 ++++---- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/api/src/executor/routes.js b/api/src/executor/routes.js index 2bcd0d7..8943a9a 100644 --- a/api/src/executor/routes.js +++ b/api/src/executor/routes.js @@ -22,16 +22,6 @@ module.exports = { .contains('/'), body('files.*.content') .isString(), - body('compile_timeout') - .isNumeric(), - body('run_timeout') - .isNumeric(), - body('stdin') - .isString(), - body('args') - .isArray(), - body('args.*') - .isString() ], // POST /jobs @@ -50,11 +40,11 @@ module.exports = { runtime, alias: req.body.language, files: req.body.files, - args: req.body.args, - stdin: req.body.stdin, + args: req.body.args || [], + stdin: req.body.stdin || "", timeouts: { - run: req.body.run_timeout, - compile: req.body.compile_timeout + run: req.body.run_timeout || 3000, + compile: req.body.compile_timeout || 10000 } }); diff --git a/readme.md b/readme.md index 08f15da..26bae26 100644 --- a/readme.md +++ b/readme.md @@ -197,10 +197,10 @@ This endpoint requests execution of some arbitrary code. - `files` (**required**) An array of files containing code or other data that should be used for execution. The first file in this array is considered the main file. - `files[].name` (**required**) The name of the file to upload, must be a string containing no path. - `files[].content` (**required**) The content of the files to upload, must be a string containing text to write. -- `stdin` (**required**) The text to pass as stdin to the program. Must be a string, can be left blank. -- `args` (**required**) The arguments to pass to the program. Must be an array. -- `compile_timeout` (**required**) The maximum time allowed for the compile stage to finish before bailing out in milliseconds. Must be a number. -- `run_timeout` (**required**) The maximum time allowed for the run stage to finish before bailing out in milliseconds. Must be a number. +- `stdin` (**optional**) The text to pass as stdin to the program. Must be a string, can be left blank. +- `args` (**optional**) The arguments to pass to the program. Must be an array. +- `compile_timeout` (**optional**) The maximum time allowed for the compile stage to finish before bailing out in milliseconds. Must be a number. +- `run_timeout` (**optional**) The maximum time allowed for the run stage to finish before bailing out in milliseconds. Must be a number. ```json { From f683dfc2cf6df79d03488386c9c83f7819df4ae5 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Fri, 23 Apr 2021 11:59:54 +1200 Subject: [PATCH 373/385] no version = latest version --- cli/commands/execute.js | 8 +++++++- cli/commands/ppman_commands/install.js | 4 ++-- cli/commands/ppman_commands/uninstall.js | 4 ++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/cli/commands/execute.js b/cli/commands/execute.js index 6adaf7e..2cd0595 100644 --- a/cli/commands/execute.js +++ b/cli/commands/execute.js @@ -3,11 +3,17 @@ const fs = require('fs'); const path = require('path'); const chalk = require('chalk'); -exports.command = ['execute [args..]'] +exports.command = ['execute [args..]'] exports.aliases = ['run'] exports.describe = 'Executes file with the specified runner' exports.builder = { + languageVersion: { + string: true, + desc: 'Set the version of the language to use', + alias: ['l'], + default: '*' + }, stdin: { boolean: true, desc: 'Read input from stdin and pass to executor', diff --git a/cli/commands/ppman_commands/install.js b/cli/commands/ppman_commands/install.js index 4211510..fedf5b8 100644 --- a/cli/commands/ppman_commands/install.js +++ b/cli/commands/ppman_commands/install.js @@ -1,6 +1,6 @@ const chalk = require('chalk'); -exports.command = ['install '] +exports.command = ['install [language-version]'] exports.aliases = ['i'] exports.describe = 'Installs the named package' @@ -14,7 +14,7 @@ const msg_format = { exports.handler = async function({axios, language, languageVersion}){ try{ - const install = await axios.post(`/api/v1/packages/${language}/${languageVersion}`) + const install = await axios.post(`/api/v1/packages/${language}/${languageVersion || '*'}`) console.log(msg_format.color(install.data)); }catch({response}){ diff --git a/cli/commands/ppman_commands/uninstall.js b/cli/commands/ppman_commands/uninstall.js index dc5bd87..0e4ebf2 100644 --- a/cli/commands/ppman_commands/uninstall.js +++ b/cli/commands/ppman_commands/uninstall.js @@ -1,6 +1,6 @@ const chalk = require('chalk'); -exports.command = ['uninstall '] +exports.command = ['uninstall [language-version]'] exports.aliases = ['u'] exports.describe = 'Uninstalls the named package' @@ -14,7 +14,7 @@ const msg_format = { exports.handler = async function({axios, language, languageVersion}){ try{ - const uninstall = await axios.delete(`/api/v1/packages/${language}/${languageVersion}`) + const uninstall = await axios.delete(`/api/v1/packages/${language}/${languageVersion || '*'}`) console.log(msg_format.color(uninstall.data)); }catch({response}){ From 9c42254b80cf66267513ea06d69388f88f72b381 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Fri, 23 Apr 2021 13:09:33 +1200 Subject: [PATCH 374/385] default file name --- api/src/executor/job.js | 7 ++++++- api/src/executor/routes.js | 5 ----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/src/executor/job.js b/api/src/executor/job.js index 2aff1be..44d6358 100644 --- a/api/src/executor/job.js +++ b/api/src/executor/job.js @@ -20,7 +20,11 @@ class Job { constructor({ runtime, files, args, stdin, timeouts, alias }) { this.uuid = uuidv4(); this.runtime = runtime; - this.files = files; + this.files = files.map((file,i) => ({ + name: file.name || `file${i}`, + content: file.content + })); + this.args = args; this.stdin = stdin; this.timeouts = timeouts; @@ -35,6 +39,7 @@ class Job { uid %= (config.runner_uid_max - config.runner_uid_min) + 1; gid %= (config.runner_gid_max - config.runner_gid_min) + 1; + this.state = job_states.READY; this.dir = path.join(config.data_directory, globals.data_directories.jobs, this.uuid); } diff --git a/api/src/executor/routes.js b/api/src/executor/routes.js index 8943a9a..c634858 100644 --- a/api/src/executor/routes.js +++ b/api/src/executor/routes.js @@ -15,11 +15,6 @@ module.exports = { // isSemVer requires it to be a version, not a selector body('files') .isArray(), - body('files.*.name') - .isString() - .bail() - .not() - .contains('/'), body('files.*.content') .isString(), ], From 09983a5fa5705b6d6365766f27abcfe7ada46a2b Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Fri, 23 Apr 2021 13:10:24 +1200 Subject: [PATCH 375/385] update readme to match --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 26bae26..52dd05b 100644 --- a/readme.md +++ b/readme.md @@ -195,7 +195,7 @@ This endpoint requests execution of some arbitrary code. - `language` (**required**) The language to use for execution, must be a string and must be installed. - `version` (**required**) The version of the language to use for execution, must be a string containing a SemVer selector for the version or the specific version number to use. - `files` (**required**) An array of files containing code or other data that should be used for execution. The first file in this array is considered the main file. -- `files[].name` (**required**) The name of the file to upload, must be a string containing no path. +- `files[].name` (**optinal**) The name of the file to upload, must be a string containing no path. - `files[].content` (**required**) The content of the files to upload, must be a string containing text to write. - `stdin` (**optional**) The text to pass as stdin to the program. Must be a string, can be left blank. - `args` (**optional**) The arguments to pass to the program. Must be an array. From 6ff89f6e912d08db47e29da93a42ad2f2d3247f1 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Fri, 23 Apr 2021 14:29:40 +1200 Subject: [PATCH 376/385] bail when not installed --- api/src/ppman/package.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/api/src/ppman/package.js b/api/src/ppman/package.js index 21c7f16..2e04905 100644 --- a/api/src/ppman/package.js +++ b/api/src/ppman/package.js @@ -138,6 +138,11 @@ class Package { logger.debug("Finding runtime") const found_runtime = runtime.get_latest_runtime_matching_language_version(this.language, this.version.raw); + if(!found_runtime){ + logger.error(`Uninstalling ${this.language}-${this.version.raw} failed: Not installed`) + return + } + logger.debug("Unregistering runtime") found_runtime.unregister(); From 04990566a12e9d7ebc0034abcc51ed73e938493a Mon Sep 17 00:00:00 2001 From: Brian Seymour Date: Thu, 22 Apr 2021 21:30:01 -0500 Subject: [PATCH 377/385] updated readme --- api/src/index.js | 2 +- readme.md | 84 ++++++++++++--------- var/docs/images/{icon_circle.svg => em.svg} | 0 var/docs/images/piston.svg | 1 + 4 files changed, 51 insertions(+), 36 deletions(-) rename var/docs/images/{icon_circle.svg => em.svg} (100%) create mode 100644 var/docs/images/piston.svg diff --git a/api/src/index.js b/api/src/index.js index ce4a1ae..21579b0 100644 --- a/api/src/index.js +++ b/api/src/index.js @@ -64,7 +64,7 @@ const app = express(); if (!errors.isEmpty()) { return res - .status(422) + .status(400) .send({ message: errors.array() }); diff --git a/readme.md b/readme.md index 52dd05b..b2a422c 100644 --- a/readme.md +++ b/readme.md @@ -1,9 +1,14 @@

- engineer-man piston - Piston + + engineer-man piston + + + Piston +

A high performance general purpose code execution engine.

+

@@ -37,22 +42,29 @@ # 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. + 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. +* [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 4000+ other servers +and 200+ direct integrations. To get it in your own server, go here: https://emkc.org/run.
+### Official Extensions +The following are approved and endorsed extensions/utilities to the core Piston offering. +- [Piston CLI](https://github.com/Shivansh-007/piston-cli), a universal shell supporting code highlighting, files, and interpretation without the need to download a language. + +
+ # Public API - Requires no installation and you can use it immediately. @@ -171,21 +183,21 @@ HTTP/1.1 200 OK Content-Type: application/json [ - { - "language": "bash", - "version": "5.1.0", - "aliases": [ - "sh" - ] - }, - { - "language": "brainfuck", - "version": "2.7.3", - "aliases": [ - "bf" - ] - }, - ... + { + "language": "bash", + "version": "5.1.0", + "aliases": [ + "sh" + ] + }, + { + "language": "brainfuck", + "version": "2.7.3", + "aliases": [ + "bf" + ] + }, + ... ] ``` @@ -197,17 +209,18 @@ This endpoint requests execution of some arbitrary code. - `files` (**required**) An array of files containing code or other data that should be used for execution. The first file in this array is considered the main file. - `files[].name` (**optinal**) The name of the file to upload, must be a string containing no path. - `files[].content` (**required**) The content of the files to upload, must be a string containing text to write. -- `stdin` (**optional**) The text to pass as stdin to the program. Must be a string, can be left blank. -- `args` (**optional**) The arguments to pass to the program. Must be an array. -- `compile_timeout` (**optional**) The maximum time allowed for the compile stage to finish before bailing out in milliseconds. Must be a number. -- `run_timeout` (**optional**) The maximum time allowed for the run stage to finish before bailing out in milliseconds. Must be a number. +- `stdin` (*optional*) The text to pass as stdin to the program. Must be a string, can be left blank. +- `args` (*optional*) The arguments to pass to the program. Must be an array. +- `compile_timeout` (*optional*) The maximum time allowed for the compile stage to finish before bailing out in milliseconds. Must be a number. +- `run_timeout` (*optional*) The maximum time allowed for the run stage to finish before bailing out in milliseconds. Must be a number. ```json { "language": "js", "version": "15.10.0", - "files":[ + "files": [ { + "main": true, "name": "my_cool_code.js", "content": "console.log(process.argv)" } @@ -232,14 +245,15 @@ HTTP/1.1 200 OK Content-Type: application/json { - "run": { - "stdout": "[\n '/piston/packages/node/15.10.0/bin/node',\n '/piston/jobs/9501b09d-0105-496b-b61a-e5148cf66384/my_cool_code.js',\n '1',\n '2',\n '3'\n]\n", - "stderr": "", - "code": 0, - "signal": null - } + "run": { + "stdout": "[\n '/piston/packages/node/15.10.0/bin/node',\n '/piston/jobs/9501b09d-0105-496b-b61a-e5148cf66384/my_cool_code.js',\n '1',\n '2',\n '3'\n]\n", + "stderr": "", + "code": 0, + "signal": null + } } ``` + 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 diff --git a/var/docs/images/icon_circle.svg b/var/docs/images/em.svg similarity index 100% rename from var/docs/images/icon_circle.svg rename to var/docs/images/em.svg diff --git a/var/docs/images/piston.svg b/var/docs/images/piston.svg new file mode 100644 index 0000000..cae0941 --- /dev/null +++ b/var/docs/images/piston.svg @@ -0,0 +1 @@ + \ No newline at end of file From 46b1e9118dd31298b4398ce5828c7b14bcf06a7e Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Fri, 23 Apr 2021 14:32:05 +1200 Subject: [PATCH 378/385] throw error --- api/src/ppman/package.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/ppman/package.js b/api/src/ppman/package.js index 2e04905..ee12bd9 100644 --- a/api/src/ppman/package.js +++ b/api/src/ppman/package.js @@ -140,7 +140,7 @@ class Package { if(!found_runtime){ logger.error(`Uninstalling ${this.language}-${this.version.raw} failed: Not installed`) - return + throw new Error(`${this.language}-${this.version.raw} is not installed`) } logger.debug("Unregistering runtime") From 6f9e2f642044a070256de8b45e26ad4c2559ff03 Mon Sep 17 00:00:00 2001 From: Brian Seymour Date: Thu, 22 Apr 2021 21:34:04 -0500 Subject: [PATCH 379/385] updated readme --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index b2a422c..3814f73 100644 --- a/readme.md +++ b/readme.md @@ -1,6 +1,6 @@

- engineer-man piston + engineer-man piston Piston From 88d7475923d024ff48042bc511518b9e18e26145 Mon Sep 17 00:00:00 2001 From: Brian Seymour Date: Thu, 22 Apr 2021 21:34:10 -0500 Subject: [PATCH 380/385] updated readme --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 3814f73..ea764b1 100644 --- a/readme.md +++ b/readme.md @@ -2,7 +2,7 @@ engineer-man piston - + Piston

From c805451c118f5863bc48fe684c2e5a33ba5af703 Mon Sep 17 00:00:00 2001 From: Brian Seymour Date: Thu, 22 Apr 2021 21:39:44 -0500 Subject: [PATCH 381/385] updated readme --- readme.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/readme.md b/readme.md index ea764b1..57aad50 100644 --- a/readme.md +++ b/readme.md @@ -207,12 +207,12 @@ This endpoint requests execution of some arbitrary code. - `language` (**required**) The language to use for execution, must be a string and must be installed. - `version` (**required**) The version of the language to use for execution, must be a string containing a SemVer selector for the version or the specific version number to use. - `files` (**required**) An array of files containing code or other data that should be used for execution. The first file in this array is considered the main file. -- `files[].name` (**optinal**) The name of the file to upload, must be a string containing no path. +- `files[].name` (*optional*) The name of the file to upload, must be a string containing no path or left out. - `files[].content` (**required**) The content of the files to upload, must be a string containing text to write. -- `stdin` (*optional*) The text to pass as stdin to the program. Must be a string, can be left blank. -- `args` (*optional*) The arguments to pass to the program. Must be an array. -- `compile_timeout` (*optional*) The maximum time allowed for the compile stage to finish before bailing out in milliseconds. Must be a number. -- `run_timeout` (*optional*) The maximum time allowed for the run stage to finish before bailing out in milliseconds. Must be a number. +- `stdin` (*optional*) The text to pass as stdin to the program. Must be a string or left out. Defaults to blank string. +- `args` (*optional*) The arguments to pass to the program. Must be an array or left out. Defaults to `[]`. +- `compile_timeout` (*optional*) The maximum time allowed for the compile stage to finish before bailing out in milliseconds. Must be a number or left out. Defaults to `10000` (10 seconds). +- `run_timeout` (*optional*) The maximum time allowed for the run stage to finish before bailing out in milliseconds. Must be a number or left out. Defaults to `3000` (3 seconds). ```json { @@ -220,7 +220,6 @@ This endpoint requests execution of some arbitrary code. "version": "15.10.0", "files": [ { - "main": true, "name": "my_cool_code.js", "content": "console.log(process.argv)" } From e6da87faa91622aeb322bfa4ce67ea41cc8102e7 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Fri, 23 Apr 2021 14:47:08 +1200 Subject: [PATCH 382/385] better error handling --- api/src/index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/api/src/index.js b/api/src/index.js index 21579b0..29f4c1c 100644 --- a/api/src/index.js +++ b/api/src/index.js @@ -59,6 +59,14 @@ const app = express(); app.use(body_parser.urlencoded({ extended: true })); app.use(body_parser.json()); + app.use(function (err, req, res, next) { + return res + .status(400) + .send({ + stack: err.stack + }) + }) + const validate = (req, res, next) => { const errors = validationResult(req); From 487bde65269b1fc5684fc9cdbb334c4e5c0779dd Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Fri, 23 Apr 2021 14:49:12 +1200 Subject: [PATCH 383/385] 404 error --- api/src/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/src/index.js b/api/src/index.js index 29f4c1c..94840ad 100644 --- a/api/src/index.js +++ b/api/src/index.js @@ -109,6 +109,10 @@ const app = express(); .send(runtimes); }); + app.use(function (req,res,next){ + return res.status(404).send({message: 'Not Found'}); + }); + logger.debug('Calling app.listen'); const [ address, port ] = config.bind_address.split(':'); From b41f3543e8278bff785904820cabb11cee362255 Mon Sep 17 00:00:00 2001 From: Brian Seymour Date: Thu, 22 Apr 2021 22:08:00 -0500 Subject: [PATCH 384/385] add missing languages to readme --- readme.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/readme.md b/readme.md index 57aad50..fb377d9 100644 --- a/readme.md +++ b/readme.md @@ -268,6 +268,7 @@ Content-Type: application/json # Supported Languages `bash`, `brainfuck`, +`cjam`, `clojure`, `coffeescript`, `cow`, @@ -276,12 +277,14 @@ Content-Type: application/json `dash`, `deno`, `dotnet`, +`dragon`, `elixir`, `emacs`, `erlang`, `gawk`, `gcc`, `go`, +`golfscript`, `groovy`, `haskell`, `java`, @@ -301,6 +304,7 @@ Content-Type: application/json `pascal`, `perl`, `php`, +`ponylang`, `prolog`, `pure`, `python`, From 890dce363ebb3e86434e7d80dde935333d1d9995 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Fri, 23 Apr 2021 15:15:47 +1200 Subject: [PATCH 385/385] -l flag for run --- readme.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/readme.md b/readme.md index fb377d9..caf2aa3 100644 --- a/readme.md +++ b/readme.md @@ -149,15 +149,18 @@ cli/index.js ppman list # Install python 3.9.1 cli/index.js ppman install python 3.9.1 +# Install latest python +cli/index.js ppman install python + # Run a python script echo 'print("Hello world!")' > test.py -cli/index.js run python 3.9.1 test.py +cli/index.js run python test.py -l 3.9.1 # Run the script using the latest version -cli/index.js run python '*' test.py +cli/index.js run python test.py # Run using python 3.x -cli/index.js run python 3.x test.py +cli/index.js run python test.py -l 3.x ```