diff --git a/.github/workflows/api-push.yaml b/.github/workflows/api-push.yaml new file mode 100644 index 0000000..bcf0472 --- /dev/null +++ b/.github/workflows/api-push.yaml @@ -0,0 +1,39 @@ +name: Publish API image +on: + push: + branches: + - master + - v3 + paths: + - api/** + + +jobs: + push_to_registry: + runs-on: ubuntu-latest + name: Build and Push Docker image to Github Packages + steps: + - name: Check out repo + uses: actions/checkout@v2 + - name: Login to GitHub registry + uses: docker/login-action@v1 + with: + 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 + with: + context: api + push: true + pull: true + tags: | + docker.pkg.github.com/engineer-man/piston/api + ghcr.io/engineer-man/piston diff --git a/.github/workflows/package-pr.yaml b/.github/workflows/package-pr.yaml new file mode 100644 index 0000000..fd3d91e --- /dev/null +++ b/.github/workflows/package-pr.yaml @@ -0,0 +1,145 @@ +name: 'Package Pull Requests' + +on: + pull_request: + types: + - opened + - edited + - reopened + - synchronize + paths: + - 'packages/**' + +jobs: + build-pkg: + name: Check that package builds + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Login to GitHub registry + uses: docker/login-action@v1 + with: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + registry: docker.pkg.github.com + + - name: Get list of changed files + uses: lots0logs/gh-action-get-changed-files@2.1.4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Build Packages + run: | + PACKAGES=$(jq '.[]' -r ${HOME}/files.json | awk -F/ '{ print $2 "-" $3 }' | sort -u) + echo "Packages: $PACKAGES" + docker run -v "${{ github.workspace }}:/piston" docker.pkg.github.com/engineer-man/piston/repo-builder:latest --no-server $PACKAGES + ls -la packages + + - name: Upload package as artifact + uses: actions/upload-artifact@v2 + with: + name: packages + path: packages/*.pkg.tar.gz + + + test-pkg: + name: Test package + runs-on: ubuntu-latest + needs: build-pkg + steps: + - uses: actions/checkout@v2 + + - uses: actions/download-artifact@v2 + with: + name: packages + + - name: Relocate downloaded packages + run: mv *.pkg.tar.gz packages/ + + - name: Write test config file + uses: DamianReeves/write-file-action@v1.0 + with: + path: data/config.yaml + contents: | + log_level: DEBUG + bind_address: 0.0.0.0:2000 + data_directory: /piston + runner_uid_min: 1100 + runner_uid_max: 1500 + runner_gid_min: 1100 + runner_gid_max: 1500 + disable_networking: false + output_max_size: 1024 + max_process_count: 64 + max_open_files: 2048 + repo_url: http://localhost:8000/index + + write-mode: overwrite + + - name: Login to GitHub registry + uses: docker/login-action@v1 + with: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + registry: docker.pkg.github.com + + - name: Run tests + run: | + ls -la + 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:2000/runtimes + + echo Waiting for Index to start.. + 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 + + echo Listing Packages + PACKAGES_JSON=$(docker run --network container:api appropriate/curl -s http://localhost:2000/packages) + echo $PACKAGES_JSON + + echo Getting CLI ready + 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 + echo "Testing $package" + PKG_PATH=$(sed 's|-|/|' <<< $package) + PKG_NAME=$(awk -F- '{ print $1 }' <<< $package) + PKG_VERSION=$(awk -F- '{ print $2 }' <<< $package) + + echo "Installing..." + docker run --network container:api appropriate/curl -sXPOST http://localhost:2000/packages/$PKG_PATH + + TEST_SCRIPTS=packages/$PKG_PATH/test.* + echo "Tests: $TEST_SCRIPTS" + + for tscript in $TEST_SCRIPTS + do + TEST_RUNTIME=$(awk -F. '{print $2}' <<< $(basename $tscript)) + echo Running $tscript with runtime=$TEST_RUNTIME + docker run --network container:api -v "$PWD/cli:/app" -v "$PWD/$(dirname $tscript):/pkg" node:15 /app/index.js run $TEST_RUNTIME $PKG_VERSION /pkg/$(basename $tscript) > test_output + cat test_output + grep "OK" test_output + done + done + + + - name: Dump logs + if: ${{ always() }} + run: | + docker logs api + docker logs piston_fs_repo + + + + + + + + diff --git a/.github/workflows/package-push.yaml b/.github/workflows/package-push.yaml new file mode 100644 index 0000000..ad33f3e --- /dev/null +++ b/.github/workflows/package-push.yaml @@ -0,0 +1,76 @@ +name: 'Package Pushed' + +on: + push: + branches: + - master + - v3 + paths: + - packages/** + + +jobs: + build-pkg: + name: Build package + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Login to GitHub registry + uses: docker/login-action@v1 + with: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + registry: docker.pkg.github.com + + - name: Get list of changed files + uses: lots0logs/gh-action-get-changed-files@2.1.4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Build Packages + run: | + PACKAGES=$(jq '.[]' -r ${HOME}/files.json | awk -F/ '{ print $2 "-" $3 }' | sort -u) + echo "Packages: $PACKAGES" + docker run -v "${{ github.workspace }}:/piston" docker.pkg.github.com/engineer-man/piston/repo-builder:latest --no-server $PACKAGES + ls -la packages + + - name: Upload Packages + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: packages/*.pkg.tar.gz + tag: pkgs + overwrite: true + file_glob: true + create-index: + name: Create Index + runs-on: ubuntu-latest + needs: build-pkg + steps: + - name: "Download all release assets" + run: curl -s https://api.github.com/repos/engineer-man/piston/releases/latest | jq '.assets[].browser_download_url' -r | xargs -L 1 curl -sLO + - name: "Generate index file" + run: | + echo "" > index + BASEURL=https://github.com/engineer-man/piston/releases/download/pkgs/ + for pkg in *.pkg.tar.gz + do + PKGFILE=$(basename $pkg) + PKGFILENAME=$(echo $PKGFILE | sed 's/\.pkg\.tar\.gz//g') + + PKGNAME=$(echo $PKGFILENAME | grep -oP '^\K.+(?=-)') + PKGVERSION=$(echo $PKGFILENAME | grep -oP '^.+-\K.+') + PKGCHECKSUM=$(sha256sum $PKGFILE | awk '{print $1}') + echo "$PKGNAME,$PKGVERSION,$PKGCHECKSUM,$BASEURL$PKGFILE" >> index + echo "Adding package $PKGNAME-$PKGVERSION" + done + - name: Upload index + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: index + tag: pkgs + overwrite: true + file_glob: true \ No newline at end of file diff --git a/.github/workflows/repo-push.yaml b/.github/workflows/repo-push.yaml new file mode 100644 index 0000000..b5a603c --- /dev/null +++ b/.github/workflows/repo-push.yaml @@ -0,0 +1,31 @@ +name: Publish Repo image +on: + push: + branches: + - master + - v3 + paths: + - repo/** + +jobs: + push_to_registry: + runs-on: ubuntu-latest + name: Build and Push Docker image to Github Packages + steps: + - name: Check out repo + uses: actions/checkout@v2 + - name: Login to GitHub registry + uses: docker/login-action@v1 + with: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + registry: docker.pkg.github.com + + - name: Build and push repo + uses: docker/build-push-action@v2 + with: + context: repo + pull: true + push: true + tags: | + docker.pkg.github.com/engineer-man/piston/repo-builder \ No newline at end of file diff --git a/.gitignore b/.gitignore index 140ea71..adbb97d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1 @@ -api/api -api/package-lock.json -lxc/i -lxc/lockfile -container/build.yaml -container/*.tar.xz +data/ \ No newline at end of file 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/.gitignore b/api/.gitignore index 3c3629e..adbd330 100644 --- a/api/.gitignore +++ b/api/.gitignore @@ -1 +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..40ecb71 --- /dev/null +++ b/api/Dockerfile @@ -0,0 +1,29 @@ +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 && \ + 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 libseccomp-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 + +WORKDIR /piston_api +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/package-lock.json b/api/package-lock.json index 4757c95..4106074 100644 --- a/api/package-lock.json +++ b/api/package-lock.json @@ -1,903 +1,1328 @@ { - "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==" + "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" + } } - } }, - "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=" + "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/package.json b/api/package.json index cf6bf15..75cb08c 100644 --- a/api/package.json +++ b/api/package.json @@ -1,16 +1,20 @@ { - "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" - } + "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", + "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" + }, + "license": "MIT" } diff --git a/api/src/config.js b/api/src/config.js new file mode 100644 index 0000000..d98a4b4 --- /dev/null +++ b/api/src/config.js @@ -0,0 +1,191 @@ +const fss = require('fs'); +const yargs = require('yargs'); +const hide_bin = require('yargs/helpers').hideBin; +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') + .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', + options: Object.values(Logger.LogLevels), + validators: [ + x => Object.values(Logger.LogLevels).includes(x) || `Log level ${x} does not exist` + ] + }, + { + key: 'bind_address', + desc: 'Address to bind REST API on\nThank @Bones for the number', + default: '0.0.0.0:2000', + validators: [] + }, + { + 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: 'runner_uid_min', + desc: 'Minimum uid to use for runner', + default: 1001, + 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: 1001, + validators: [] + }, + { + key: 'runner_gid_max', + desc: 'Maximum gid to use for runner', + default: 1500, + validators: [] + }, + { + key: 'disable_networking', + desc: 'Set to true to disable networking', + default: true, + validators: [] + }, + { + key: 'output_max_size', + 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: [] + }, + { + key: 'repo_url', + desc: 'URL of repo index', + default: 'https://github.com/engineer-man/piston/releases/download/pkgs/index', + validators: [] + } +]; + +const make_default_config = () => { + let content = header.split('\n'); + + options.forEach(option => { + content = content.concat(option.desc.split('\n').map(x=>`# ${x}`)); + + if (option.options) { + content.push('# Options: ' + option.options.join(', ')); + } + + content.push(`${option.key}: ${option.default}`); + + content.push(''); // New line between + }); + + return content.join('\n'); +}; + +logger.info(`Loading Configuration from ${argv.config}`); + +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, make_default_config()); + } catch (e) { + logger.error('Error writing default configuration:', e.message); + process.exit(1); + } +} + +let config = {}; + +logger.debug('Reading config file'); + +try { + const cfg_content = fss.read_file_sync(argv.config); + config = yaml.load(cfg_content); +} catch(err) { + logger.error('Error reading configuration file:', err.message); + process.exit(1); +} + +logger.debug('Validating config entries'); + +let errored = false; + +options.for_each(option => { + logger.debug('Checking option', option.key); + + let cfg_val = config[option.key]; + + if (cfg_val === undefined) { + errored = true; + logger.error(`Config key ${option.key} does not exist on currently loaded configuration`); + return; + } + + option.validators.for_each(validator => { + let response = validator(cfg_val); + + if (!response) { + errored = true; + logger.error(`Config option ${option.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..44d6358 --- /dev/null +++ b/api/src/executor/job.js @@ -0,0 +1,193 @@ +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') +}; + +let uid = 0; +let gid = 0; + +class Job { + + constructor({ runtime, files, args, stdin, timeouts, alias }) { + this.uuid = uuidv4(); + this.runtime = runtime; + this.files = files.map((file,i) => ({ + name: file.name || `file${i}`, + content: file.content + })); + + this.args = args; + this.stdin = stdin; + this.timeouts = timeouts; + this.alias = alias; + + 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'); + + logger.debug(`Transfering ownership uid=${this.uid} gid=${this.gid}`); + + await fs.mkdir(this.dir, { mode:0o700 }); + await fs.chown(this.dir, this.uid, this.gid); + + for (const file of this.files) { + let file_path = path.join(this.dir, file.name); + + await fs.write_file(file_path, file.content); + await fs.chown(file_path, this.uid, this.gid); + } + + this.state = job_states.PRIMED; + + logger.debug('Primed job'); + } + + async safe_call(file, args, timeout) { + return new Promise((resolve, reject) => { + const nonetwork = config.disable_networking ? ['nosocket'] : []; + + const prlimit = [ + 'prlimit', + '--nproc=' + config.max_process_count, + '--nofile=' + config.max_open_files + ]; + + const proc_call = [ + ...prlimit, + ...nonetwork, + 'bash',file, + ...args + ]; + + var stdout = ''; + var stderr = ''; + + const proc = cp.spawn(proc_call[0], proc_call.splice(1) ,{ + env: { + ...this.runtime.env_vars, + PISTON_ALIAS: this.alias + }, + stdio: 'pipe', + cwd: this.dir, + uid: this.uid, + gid: this.gid, + detached: true //give this process its own process group + }); + + proc.stdin.write(this.stdin); + proc.stdin.end(); + + const kill_timeout = set_timeout(_ => proc.kill('SIGKILL'), timeout); + + proc.stderr.on('data', data => { + if (stderr.length > config.output_max_size) { + proc.kill('SIGKILL'); + } else { + stderr += data; + } + }); + + proc.stdout.on('data', data => { + if (stdout.length > config.output_max_size) { + proc.kill('SIGKILL'); + } else { + stdout += data; + } + }); + + const exit_cleanup = () => { + clear_timeout(kill_timeout); + + proc.stderr.destroy(); + proc.stdout.destroy(); + + try { + process.kill(-proc.pid, 'SIGKILL'); + } catch { + // Process will be dead already, so nothing to kill. + } + }; + + proc.on('exit', (code, signal)=>{ + exit_cleanup(); + + resolve({ stdout, stderr, code, signal }); + }); + + proc.on('error', (err) => { + exit_cleanup(); + + 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'); + + let compile; + + 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'); + + const run = await this.safe_call( + path.join(this.runtime.pkgdir, 'run'), + [this.files[0].name, ...this.args], + this.timeouts.run + ); + + this.state = job_states.EXECUTED; + + return { + compile, + run + }; + } + + async cleanup() { + logger.info(`Cleaning up job uuid=${this.uuid}`); + await fs.rm(this.dir, { recursive: true, force: true }); + } + +} + +module.exports = { + Job +}; diff --git a/api/src/executor/routes.js b/api/src/executor/routes.js new file mode 100644 index 0000000..c634858 --- /dev/null +++ b/api/src/executor/routes.js @@ -0,0 +1,57 @@ +// {"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'); +const { Job } = require('./job'); +const { body } = require('express-validator'); + +module.exports = { + + run_job_validators: [ + body('language') + .isString(), + body('version') + .isString(), + // isSemVer requires it to be a version, not a selector + body('files') + .isArray(), + body('files.*.content') + .isString(), + ], + + // POST /jobs + async run_job(req, res) { + const runtime = get_latest_runtime_matching_language_version(req.body.language, req.body.version); + + if (runtime === undefined) { + return res + .status(400) + .send({ + message: `${req.body.language}-${req.body.version} runtime is unknown` + }); + } + + const job = new Job({ + runtime, + alias: req.body.language, + files: req.body.files, + args: req.body.args || [], + stdin: req.body.stdin || "", + timeouts: { + run: req.body.run_timeout || 3000, + compile: req.body.compile_timeout || 10000 + } + }); + + await job.prime(); + + const result = await job.execute(); + + await job.cleanup(); + + return res + .status(200) + .send(result); + } + +}; diff --git a/api/src/globals.js b/api/src/globals.js new file mode 100644 index 0000000..300558e --- /dev/null +++ b/api/src/globals.js @@ -0,0 +1,20 @@ +// 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 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=','') +}`; + +module.exports = { + data_directories: { + packages: 'packages', + jobs: 'jobs' + }, + 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/index.js b/api/src/index.js index 5be8b75..94840ad 100644 --- a/api/src/index.js +++ b/api/src/index.js @@ -1,79 +1,122 @@ +#!/usr/bin/env node +require('nocamel'); +const Logger = require('logplease'); const express = require('express'); -const { execute } = require('../../lxc/execute.js'); -const { languages } = require('./languages'); -const { checkSchema, validationResult } = require('express-validator'); - -const PORT = 2000; +const globals = require('./globals'); +const config = require('./config'); +const path = require('path'); +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(); -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 () => { + logger.info('Setting loglevel to',config.log_level); + Logger.setLogLevel(config.log_level); + logger.debug('Ensuring data directories exist'); + + Object.values(globals.data_directories).for_each(dir => { + let 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 { + fss.mkdir_sync(data_path); + } catch(e) { + logger.error(`Failed to create ${data_path}: `, e.message); + } } - }), - async (req, res) => { - const errors = validationResult(req).array(); + }); - if (errors.length === 0) { - const language = languages.find(language => - language.aliases.includes(req.body.language.toLowerCase()) - ); + logger.info('Loading packages'); + const pkgdir = path.join(config.data_directory,globals.data_directories.packages); - const { stdout, stderr, output, ran } = await execute(language, req.body.source, req.body.stdin, req.body.args); + const pkglist = await fs.readdir(pkgdir); - res.status(200).json({ - ran, - language: language.name, - version: language.version, - stdout, - stderr, - output, - }); - } else { - res.status(400).json({ - message: errors[0].msg, - }); + 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'); + logger.debug('Constructing Express App'); + logger.debug('Registering middleware'); + + 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); + + if (!errors.isEmpty()) { + return res + .status(400) + .send({ + message: errors.array() + }); } - }, -); -app.get('/versions', (_, res) => res.json(languages)); + next(); + }; -app.listen(PORT, () => console.log(`Listening on port ${PORT}`)); + logger.debug('Registering Routes'); + + const ppman_routes = require('./ppman/routes'); + const executor_routes = require('./executor/routes'); + + 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('/api/v1/runtimes', (req, res) => { + const runtimes = runtime + .map(rt => { + return { + language: rt.language, + version: rt.version.raw, + aliases: rt.aliases + }; + }); + + return res + .status(200) + .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(':'); + + app.listen(port, address, () => { + logger.info('API server started on', config.bind_address); + }); +})(); diff --git a/api/src/languages.js b/api/src/languages.js deleted file mode 100644 index b1c93d2..0000000 --- a/api/src/languages.js +++ /dev/null @@ -1,41 +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 if (language === 'clojure') { - versions[language] = /\d+\.\d+\.\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/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/api/src/ppman/package.js b/api/src/ppman/package.js new file mode 100644 index 0000000..ee12bd9 --- /dev/null +++ b/api/src/ppman/package.js @@ -0,0 +1,165 @@ +const logger = require('logplease').create('ppman/package'); +const semver = require('semver'); +const config = require('../config'); +const globals = require('../globals'); +const fetch = require('node-fetch'); +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({ language, version, download, checksum }){ + this.language = language; + this.version = semver.parse(version); + this.checksum = checksum; + this.download = download; + } + + get installed() { + return fss.exists_sync(path.join(this.install_path, globals.pkg_installed_file)); + } + + 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 (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 fs.mkdir(this.install_path, {recursive: true}); + + logger.debug(`Downloading package from ${this.download} in to ${this.install_path}`); + const pkgpath = path.join(this.install_path, 'pkg.tar.gz'); + const download = await fetch(this.download); + + 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); + }); + + 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(`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 ${pkgpath}'`); + + proc.once('exit', (code, _) => { + code === 0 ? resolve() : reject(); + }); + + proc.stdout.pipe(process.stdout); + proc.stderr.pipe(process.stderr); + + proc.once('error', reject); + }); + + logger.debug('Registering runtime'); + new runtime.Runtime(this.install_path); + + logger.debug('Caching environment'); + const get_env_command = `cd ${this.install_path}; source environment; env`; + + const envout = await new Promise((resolve, reject) => { + let stdout = ''; + + const proc = cp + .spawn( + 'env', + ['-i','bash','-c',`${get_env_command}`], + { + stdio: ['ignore', 'pipe', 'pipe'] + } + ); + + proc.once('exit', (code, _) => { + code === 0 ? resolve(stdout) : reject(); + }); + + 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 fs.write_file(path.join(this.install_path, '.env'), filtered_env); + + 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}`); + + return { + language: this.language, + version: this.version.raw + }; + } + + + async uninstall(){ + logger.info(`Uninstalling ${this.language}-${this.version.raw}`); + + 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`) + throw new Error(`${this.language}-${this.version.raw} is not installed`) + } + + logger.debug("Unregistering runtime") + found_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 = { + Package +}; diff --git a/api/src/ppman/routes.js b/api/src/ppman/routes.js new file mode 100644 index 0000000..89f472c --- /dev/null +++ b/api/src/ppman/routes.js @@ -0,0 +1,123 @@ +const logger = require('logplease').create('ppman/routes'); +const semver = require('semver'); +const fetch = require('node-fetch'); +const config = require('../config'); +const { Package } = require('./package'); + +const get_package_list = async () => { + 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 + }); + }); +}; + +const get_package = async (lang, version) => { + const packages = await get_package_list(); + + const candidates = packages + .filter(pkg => { + return pkg.language == lang && semver.satisfies(pkg.version, version) + }); + + candidates.sort((a, b) => semver.rcompare(a.version, b.version)); + + return candidates[0] || null; +}; + +module.exports = { + + // GET /packages + async package_list(req, res) { + logger.debug('Request to list packages'); + + let packages = await get_package_list(); + + packages = packages + .map(pkg => { + return { + language: pkg.language, + language_version: pkg.version.raw, + installed: pkg.installed + }; + }); + + return res + .status(200) + .send(packages); + }, + + // POST /packages/:language/:version + async package_install(req, res) { + 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.install(); + + return res + .status(200) + .send(response); + } catch(e) { + logger.error(`Error while installing package ${pkg.language}-${pkg.version}:`, e.message); + + return res + .status(500) + .send({ + message: e.message + }); + } + }, + + // DELETE /packages/:language/:version + async package_uninstall(req, res) { + logger.debug('Request to uninstall 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 new file mode 100644 index 0000000..c5239c3 --- /dev/null +++ b/api/src/runtime.js @@ -0,0 +1,81 @@ +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 = []; + +class Runtime { + + constructor(package_dir){ + let info = JSON.parse( + fss.read_file_sync(path.join(package_dir, 'pkg-info.json')) + ); + + const { language, version, build_platform, aliases } = info; + + this.pkgdir = package_dir; + this.language = language; + this.version = semver.parse(version); + 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}` + ); + } + + logger.debug(`Package ${language}-${version} was loaded`); + + runtimes.push(this); + } + + get 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 = 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.trim()] = val.trim(); + }); + } + + return this._env_vars; + } + + toString() { + return `${this.language}-${this.version.raw}`; + } + + unregister() { + const index = runtimes.indexOf(this); + runtimes.splice(index, 1); //Remove from runtimes list + } +} + +module.exports = runtimes; +module.exports.Runtime = Runtime; +module.exports.get_runtimes_matching_language_version = function(lang, 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) + .sort((a,b) => semver.rcompare(a.version, b.version))[0]; +}; 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..2cd0595 --- /dev/null +++ b/cli/commands/execute.js @@ -0,0 +1,98 @@ +//const fetch = require('node-fetch'); +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 = { + 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', + 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 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 request = { + language: argv.language, + version: argv['language-version'], + files: files, + args: argv.args, + stdin, + compile_timeout: argv.ct, + run_timeout: argv.rt + }; + + let response = await argv.axios.post('/jobs', request); + response = response.data + + 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/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..fedf5b8 --- /dev/null +++ b/cli/commands/ppman_commands/install.js @@ -0,0 +1,23 @@ +const chalk = require('chalk'); + +exports.command = ['install [language-version]'] +exports.aliases = ['i'] +exports.describe = 'Installs the named package' + + +const msg_format = { + '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 + +} + +exports.handler = async function({axios, language, languageVersion}){ + try{ + const install = await axios.post(`/api/v1/packages/${language}/${languageVersion || '*'}`) + + console.log(msg_format.color(install.data)); + }catch({response}){ + console.error(response.data.message) + } +} diff --git a/cli/commands/ppman_commands/list.js b/cli/commands/ppman_commands/list.js new file mode 100644 index 0000000..fa3cb27 --- /dev/null +++ b/cli/commands/ppman_commands/list.js @@ -0,0 +1,26 @@ +//const fetch = require('node-fetch'); +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({axios}){ + + const packages = await axios.get('/api/v1/packages'); + + + const pkg_msg = packages.data + .map(msg_format.color) + .join('\n'); + + console.log(pkg_msg); +} diff --git a/cli/commands/ppman_commands/uninstall.js b/cli/commands/ppman_commands/uninstall.js new file mode 100644 index 0000000..0e4ebf2 --- /dev/null +++ b/cli/commands/ppman_commands/uninstall.js @@ -0,0 +1,23 @@ +const chalk = require('chalk'); + +exports.command = ['uninstall [language-version]'] +exports.aliases = ['u'] +exports.describe = 'Uninstalls 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 uninstall = await axios.delete(`/api/v1/packages/${language}/${languageVersion || '*'}`) + + console.log(msg_format.color(uninstall.data)); + }catch({response}){ + console.error(response.data.message) + } +} 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/cli/index.js b/cli/index.js new file mode 100755 index 0000000..415dbf3 --- /dev/null +++ b/cli/index.js @@ -0,0 +1,26 @@ +#!/usr/bin/env node + +const axios = require('axios').default; + +const axios_instance = function(argv){ + argv.axios = axios.create({ + baseURL: argv['piston-url'] + }); + + return argv; +}; + +require('yargs')(process.argv.slice(2)) + .option('piston-url', { + alias: ['u'], + default: 'http://127.0.0.1:2000', + desc: 'Piston API URL', + string: true + }) + .middleware(axios_instance) + .scriptName("piston") + .commandDir('commands') + .demandCommand() + .help() + .wrap(72) + .argv; diff --git a/cli/package-lock.json b/cli/package-lock.json new file mode 100644 index 0000000..66fb04d --- /dev/null +++ b/cli/package-lock.json @@ -0,0 +1,156 @@ +{ + "name": "piston-cli", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "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/package.json b/cli/package.json new file mode 100644 index 0000000..6a998a4 --- /dev/null +++ b/cli/package.json @@ -0,0 +1,12 @@ +{ + "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/config/languages.json b/config/languages.json deleted file mode 100644 index e3c0c50..0000000 --- a/config/languages.json +++ /dev/null @@ -1,280 +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": "clojure", - "aliases": [ - "clojure", - "clj" - ] - }, - { - "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": "lolcode", - "aliases": [ - "lolcode" - ] - }, - { - "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 b9682c6..0000000 --- a/container/install_script.sh +++ /dev/null @@ -1,343 +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 \ - ninja-build maven - -# 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/scalac -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 -DINSTALL_DOCUMENTATION=OFF -G Ninja .. -ninja -echo "export PATH=\$PATH:/opt/swipl/$SUB_DIR/build/src" >> /opt/.profile -source /opt/.profile - -# install lolcode -# final binary: /opt/lolcode/bin/lci -cd /opt -git clone https://github.com/justinmeza/lci.git lolcode -cd lolcode -mkdir bin -cd bin -cmake .. -make -echo 'export PATH=$PATH:/opt/lolcode/bin' >> /opt/.profile -source /opt/.profile - -# install clojure -# final binary: /opt/clojure/bin/clojure -# get version: /opt/clojure/bin/clojure -version -cd /opt && mkdir clojure && cd clojure -git clone https://github.com/clojure/clojure.git -cd clojure -mvn -Plocal -Dmaven.test.skip=true package - -# 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/docker-compose.dev.yaml b/docker-compose.dev.yaml new file mode 100644 index 0000000..f2b3a14 --- /dev/null +++ b/docker-compose.dev.yaml @@ -0,0 +1,22 @@ +version: '3.2' + +services: + api: + build: api + container_name: piston_api + cap_add: + - CAP_SYS_ADMIN + restart: always + ports: + - 2000:2000 + volumes: + - ./data/piston:/piston + tmpfs: + - /piston/jobs:exec + + 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 new file mode 100644 index 0000000..764a55b --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,13 @@ +version: '3.2' + +services: + api: + image: ghcr.io/engineer-man/piston + container_name: piston_api + restart: always + ports: + - 2000:2000 + volumes: + - ./data/piston:/piston + tmpfs: + - /piston/jobs:exec 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 9a4a611..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 -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 -c " - while pgrep -u runner$runner > /dev/null - 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 a1bac7d..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.substring(0, OUTPUT_LIMIT); - stdout = stdout.substring(0, OUTPUT_LIMIT); - output = output.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 e849a08..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 -lm -timeout -s KILL 3 xargs -a args.args -d '\n' ./binary < stdin.stdin diff --git a/lxc/executors/clojure b/lxc/executors/clojure deleted file mode 100644 index 03f475a..0000000 --- a/lxc/executors/clojure +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -cd /tmp/$1 -timeout -s KILL 10 xargs -a args.args -d '\n' java -jar /opt/clojure/clojure/clojure.jar code.code < 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 85bdd93..0000000 --- a/lxc/executors/deno +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -cd /tmp/$1 -export NO_COLOR=true -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/lolcode b/lxc/executors/lolcode deleted file mode 100644 index 15e7473..0000000 --- a/lxc/executors/lolcode +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -cd /tmp/$1 -timeout -s KILL 3 lci 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 d9a6211..0000000 --- a/lxc/executors/prolog +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -cd /tmp/$1 - -sed 's/^.*$/:- forall((Goal = (\0), call(Goal)), (write(Goal), nl))./' stdin.stdin | - cat code.code - > code.pl - -if [ -s args.args ] -then - echo ":- main($(jq --raw-input -c --slurp 'split("\n")' args.args))." >> code.pl -fi - -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 7221451..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 -color never 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 dbcc47b..0000000 --- a/lxc/tests/_run +++ /dev/null @@ -1,76 +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 clojure = ' -../../cli/execute clojure clojure.clj -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 lolcode = ' -../../cli/execute lolcode lolcode.lol -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/clojure.clj b/lxc/tests/clojure.clj deleted file mode 100644 index befe5c3..0000000 --- a/lxc/tests/clojure.clj +++ /dev/null @@ -1,5 +0,0 @@ -(ns clojure.examples.hello - (:gen-class)) -(defn hello-world [] - (println "good")) -(hello-world) 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/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/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/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/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 'lolcode' -lxc-attach --clear-env -n piston -- /bin/bash -l -c "lci --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 "scalac -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/packages/.gitignore b/packages/.gitignore new file mode 100644 index 0000000..d98ab0b --- /dev/null +++ b/packages/.gitignore @@ -0,0 +1,8 @@ +*/*/* +*.pkg.tar.gz +!*/*/metadata.json +!*/*/build.sh +!*/*/environment +!*/*/run +!*/*/compile +!*/*/test.* \ No newline at end of file diff --git a/packages/CONTRIBUTING.MD b/packages/CONTRIBUTING.MD new file mode 100644 index 0000000..813f71e --- /dev/null +++ b/packages/CONTRIBUTING.MD @@ -0,0 +1,60 @@ +# Contributing packages to the Piston Repository + +## Naming Languages + +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 [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 directories named `[language]/[version]`. See Naming Languages for how to determine the name for your language + +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. + +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. 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 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 +using System; + +public class Test +{ + public static void Main(string[] args) + { + Console.WriteLine("OK"); + } +} +``` + +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", + "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]-[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). diff --git a/packages/Makefile b/packages/Makefile new file mode 100644 index 0000000..22566f2 --- /dev/null +++ b/packages/Makefile @@ -0,0 +1,25 @@ +PACKAGES=$(subst /,-,$(shell find * -maxdepth 1 -mindepth 1 -type d)) +BUILD_PLATFORM=$(or ${PLATFORM},baremetal-$(shell grep -oP "^ID=\K.+" /etc/os-release)) + +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" + +build build-all: $(addsuffix .pkg.tar.gz, ${PACKAGES}) + + +define PKG_RULE +$(1).pkg.tar.gz: $(subst -,/,$(1)) $(subst -,/,$(1))/pkg-info.json + cd $$< && chmod +x ./build.sh && ./build.sh + rm -f $$@ + + tar czf $$@ -C $$< . +endef + +$(foreach pkg,$(PACKAGES),$(eval $(call PKG_RULE,$(pkg)))) + +%/pkg-info.json: %/metadata.json + jq '.build_platform="${BUILD_PLATFORM}"' $< > $@ + 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/bash/5.1.0/build.sh b/packages/bash/5.1.0/build.sh new file mode 100755 index 0000000..657ae7a --- /dev/null +++ b/packages/bash/5.1.0/build.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +# Put instructions to build your package in here +PREFIX=$(realpath $(dirname $0)) + +mkdir -p build + +cd build + +curl "https://ftp.gnu.org/gnu/bash/bash-5.1.tar.gz" -o bash.tar.gz + +tar xzf bash.tar.gz --strip-components=1 + +# === autoconf based === +./configure --prefix "$PREFIX" + +make -j$(nproc) +make install -j$(nproc) +cd ../ +rm -rf build + diff --git a/packages/bash/5.1.0/environment b/packages/bash/5.1.0/environment new file mode 100644 index 0000000..780b668 --- /dev/null +++ b/packages/bash/5.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/bash/5.1.0/metadata.json b/packages/bash/5.1.0/metadata.json new file mode 100644 index 0000000..9ac1250 --- /dev/null +++ b/packages/bash/5.1.0/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "bash", + "version": "5.1.0", + "aliases": ["sh"] +} diff --git a/packages/bash/5.1.0/run b/packages/bash/5.1.0/run new file mode 100644 index 0000000..a8f3ffb --- /dev/null +++ b/packages/bash/5.1.0/run @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# Put instructions to run the runtime +bash "$@" diff --git a/packages/bash/5.1.0/test.bash.sh b/packages/bash/5.1.0/test.bash.sh new file mode 100644 index 0000000..727518f --- /dev/null +++ b/packages/bash/5.1.0/test.bash.sh @@ -0,0 +1 @@ +echo "OK" \ No newline at end of file diff --git a/packages/brainfuck/2.7.3/build.sh b/packages/brainfuck/2.7.3/build.sh new file mode 100644 index 0000000..50c1868 --- /dev/null +++ b/packages/brainfuck/2.7.3/build.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +# Put instructions to build your package in here +PREFIX=$(realpath $(dirname $0)) + +git clone https://github.com/fabianishere/brainfuck.git + +cd brainfuck +git checkout 06f84462e0a96487670a4b8024e3ec531e0377ee + + +mkdir -p build + +cd build + +cmake .. -DCMAKE_INSTALL_PREFIX=$PREFIX/ -DENABLE_EDITLINE=OFF + +make -j$(nproc) +make install -j$(nproc) + +cd ../../ +rm -rf 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..a9f3083 --- /dev/null +++ b/packages/brainfuck/2.7.3/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "brainfuck", + "version": "2.7.3", + "aliases": ["bf"] +} diff --git a/packages/brainfuck/2.7.3/run b/packages/brainfuck/2.7.3/run new file mode 100644 index 0000000..4c8f425 --- /dev/null +++ b/packages/brainfuck/2.7.3/run @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# Put instructions to run the runtime +brainfuck $1 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 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 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..847ecb6 --- /dev/null +++ b/packages/clojure/1.10.3/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "clojure", + "version": "1.10.3", + "aliases": ["clojure", "clj"] +} 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 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..23380d1 --- /dev/null +++ b/packages/coffeescript/2.5.1/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "coffeescript", + "version": "2.5.1", + "aliases": ["coffeescript", "coffee"] +} 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 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..2dcca9f --- /dev/null +++ b/packages/cow/1.0.0/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "cow", + "version": "1.0.0", + "aliases": ["cow"] +} 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 diff --git a/packages/crystal/0.36.1/build.sh b/packages/crystal/0.36.1/build.sh new file mode 100755 index 0000000..ba10f3f --- /dev/null +++ b/packages/crystal/0.36.1/build.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +PREFIX=$(realpath $(dirname $0)) + +curl -L "https://github.com/crystal-lang/crystal/releases/download/0.36.1/crystal-0.36.1-1-linux-x86_64.tar.gz" -o crystal.tar.gz +tar xzf crystal.tar.gz --strip-components=1 +rm crystal.tar.gz diff --git a/packages/crystal/0.36.1/compile b/packages/crystal/0.36.1/compile new file mode 100644 index 0000000..afbad6c --- /dev/null +++ b/packages/crystal/0.36.1/compile @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +# Compile crystal files into out file +crystal build "$@" -o out --no-color && \ +chmod +x out diff --git a/packages/crystal/0.36.1/environment b/packages/crystal/0.36.1/environment new file mode 100644 index 0000000..bd0ff98 --- /dev/null +++ b/packages/crystal/0.36.1/environment @@ -0,0 +1 @@ +export PATH=$PWD/bin:$PATH \ No newline at end of file diff --git a/packages/crystal/0.36.1/metadata.json b/packages/crystal/0.36.1/metadata.json new file mode 100644 index 0000000..ee995eb --- /dev/null +++ b/packages/crystal/0.36.1/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "crystal", + "version": "0.36.1", + "aliases": ["crystal", "cr"] +} diff --git a/packages/crystal/0.36.1/run b/packages/crystal/0.36.1/run new file mode 100644 index 0000000..6955ba9 --- /dev/null +++ b/packages/crystal/0.36.1/run @@ -0,0 +1,4 @@ +#!/bin/bash + +shift # Filename is only used to compile +./out "$@" diff --git a/packages/crystal/0.36.1/test.cr b/packages/crystal/0.36.1/test.cr new file mode 100644 index 0000000..3fca0dd --- /dev/null +++ b/packages/crystal/0.36.1/test.cr @@ -0,0 +1 @@ +puts("OK") \ No newline at end of file diff --git a/packages/dart/2.12.1/build.sh b/packages/dart/2.12.1/build.sh new file mode 100755 index 0000000..d202d7f --- /dev/null +++ b/packages/dart/2.12.1/build.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +curl -L "https://storage.googleapis.com/dart-archive/channels/stable/release/2.12.1/sdk/dartsdk-linux-x64-release.zip" -o dart.zip + +unzip dart.zip +rm dart.zip + +cp -r dart-sdk/* . +rm -rf dart-sdk + +chmod -R +rx bin diff --git a/packages/dart/2.12.1/environment b/packages/dart/2.12.1/environment new file mode 100644 index 0000000..780b668 --- /dev/null +++ b/packages/dart/2.12.1/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/dart/2.12.1/metadata.json b/packages/dart/2.12.1/metadata.json new file mode 100644 index 0000000..cec3d77 --- /dev/null +++ b/packages/dart/2.12.1/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "dart", + "version": "2.12.1", + "aliases": [] +} diff --git a/packages/dart/2.12.1/run b/packages/dart/2.12.1/run new file mode 100644 index 0000000..aae792a --- /dev/null +++ b/packages/dart/2.12.1/run @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# Put instructions to run the runtime +dart run "$@" diff --git a/packages/dart/2.12.1/test.dart b/packages/dart/2.12.1/test.dart new file mode 100644 index 0000000..27e87b2 --- /dev/null +++ b/packages/dart/2.12.1/test.dart @@ -0,0 +1,3 @@ +void main() { + print('OK'); +} \ No newline at end of file diff --git a/packages/dash/0.5.11/build.sh b/packages/dash/0.5.11/build.sh new file mode 100755 index 0000000..202d5aa --- /dev/null +++ b/packages/dash/0.5.11/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 + +curl "http://gondor.apana.org.au/~herbert/dash/files/dash-0.5.11.tar.gz" -o dash.tar.gz +tar xzf dash.tar.gz --strip-components=1 + +./configure --prefix "$PREFIX" && +make -j$(nproc) && +make install -j$(nproc) + +cd ../ + +rm -rf build diff --git a/packages/dash/0.5.11/environment b/packages/dash/0.5.11/environment new file mode 100644 index 0000000..780b668 --- /dev/null +++ b/packages/dash/0.5.11/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/dash/0.5.11/metadata.json b/packages/dash/0.5.11/metadata.json new file mode 100644 index 0000000..a2e5be5 --- /dev/null +++ b/packages/dash/0.5.11/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "dash", + "version": "0.5.11", + "aliases": ["dash"] +} diff --git a/packages/dash/0.5.11/run b/packages/dash/0.5.11/run new file mode 100644 index 0000000..6a8a1da --- /dev/null +++ b/packages/dash/0.5.11/run @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# Put instructions to run the runtime +dash "$@" diff --git a/packages/dash/0.5.11/test.dash b/packages/dash/0.5.11/test.dash new file mode 100644 index 0000000..727518f --- /dev/null +++ b/packages/dash/0.5.11/test.dash @@ -0,0 +1 @@ +echo "OK" \ No newline at end of file diff --git a/packages/deno/1.7.5/build.sh b/packages/deno/1.7.5/build.sh new file mode 100755 index 0000000..165d3b6 --- /dev/null +++ b/packages/deno/1.7.5/build.sh @@ -0,0 +1,5 @@ +curl -L https://github.com/denoland/deno/releases/download/v1.7.5/deno-x86_64-unknown-linux-gnu.zip --output deno.zip +unzip -o deno.zip +rm deno.zip + +chmod +x deno 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..60b8a65 --- /dev/null +++ b/packages/deno/1.7.5/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "deno", + "version": "1.7.5", + "aliases": ["deno-ts", "deno-js"] +} diff --git a/packages/deno/1.7.5/run b/packages/deno/1.7.5/run new file mode 100644 index 0000000..d1b196f --- /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/1.7.5/test.deno.ts b/packages/deno/1.7.5/test.deno.ts new file mode 100644 index 0000000..56ed4a0 --- /dev/null +++ b/packages/deno/1.7.5/test.deno.ts @@ -0,0 +1 @@ +console.log("OK") \ No newline at end of file diff --git a/packages/dotnet/5.0.201/build.sh b/packages/dotnet/5.0.201/build.sh new file mode 100644 index 0000000..c685668 --- /dev/null +++ b/packages/dotnet/5.0.201/build.sh @@ -0,0 +1,14 @@ +#!/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 + +# 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 new file mode 100644 index 0000000..1500acb --- /dev/null +++ b/packages/dotnet/5.0.201/compile @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +export DOTNET_CLI_HOME=$PWD +export HOME=$PWD + +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 --no-restore \ 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..596d56e --- /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 \ No newline at end of file diff --git a/packages/dotnet/5.0.201/metadata.json b/packages/dotnet/5.0.201/metadata.json new file mode 100644 index 0000000..619265d --- /dev/null +++ b/packages/dotnet/5.0.201/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "dotnet", + "version": "5.0.201", + "aliases": ["cs", "csharp"] +} diff --git a/packages/dotnet/5.0.201/run b/packages/dotnet/5.0.201/run new file mode 100644 index 0000000..774a08a --- /dev/null +++ b/packages/dotnet/5.0.201/run @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +# Put instructions to run the runtime +export DOTNET_CLI_HOME=$PWD + +shift +dotnet bin/Debug/net5.0/$(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 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 diff --git a/packages/elixir/1.11.3/build.sh b/packages/elixir/1.11.3/build.sh new file mode 100755 index 0000000..9328d8c --- /dev/null +++ b/packages/elixir/1.11.3/build.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +source ../../erlang/23.0.0/build.sh + +export PATH=$PWD/bin:$PATH + +PREFIX=$(realpath $(dirname $0)) + +mkdir -p build + +cd build + +curl -L "https://github.com/elixir-lang/elixir/archive/v1.11.3.tar.gz" -o elixir.tar.gz +tar xzf elixir.tar.gz --strip-components=1 +rm elixir.tar.gz + +./configure --prefix "$PREFIX" +make -j$(nproc) + +cd .. + +cp -r build/bin . +cp -r build/lib . + +rm -rf build diff --git a/packages/elixir/1.11.3/environment b/packages/elixir/1.11.3/environment new file mode 100644 index 0000000..ea24603 --- /dev/null +++ b/packages/elixir/1.11.3/environment @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +# Put 'export' statements here for environment variables +export LC_ALL=en_US.UTF-8 +export PATH=$PWD/bin:$PATH diff --git a/packages/elixir/1.11.3/metadata.json b/packages/elixir/1.11.3/metadata.json new file mode 100644 index 0000000..9c1a2fc --- /dev/null +++ b/packages/elixir/1.11.3/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "elixir", + "version": "1.11.3", + "aliases": ["elixir", "exs"] +} diff --git a/packages/elixir/1.11.3/run b/packages/elixir/1.11.3/run new file mode 100644 index 0000000..9b3ba9c --- /dev/null +++ b/packages/elixir/1.11.3/run @@ -0,0 +1,4 @@ +#!/bin/bash + +# Put instructions to run the runtime +elixir "$@" \ No newline at end of file diff --git a/packages/elixir/1.11.3/test.exs b/packages/elixir/1.11.3/test.exs new file mode 100644 index 0000000..bc837c6 --- /dev/null +++ b/packages/elixir/1.11.3/test.exs @@ -0,0 +1 @@ +IO.puts("OK") \ No newline at end of file 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..caa2fb4 --- /dev/null +++ b/packages/emacs/27.1.0/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "emacs", + "version": "27.1.0", + "aliases": ["emacs", "el", "elisp"] +} 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 diff --git a/packages/erlang/23.0.0/build.sh b/packages/erlang/23.0.0/build.sh new file mode 100755 index 0000000..f282bc2 --- /dev/null +++ b/packages/erlang/23.0.0/build.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +PREFIX=$(realpath $(dirname $0)) + +mkdir -p build + +cd build + +curl "http://erlang.org/download/otp_src_23.0.tar.gz" -o erlang.tar.gz +tar xzf erlang.tar.gz --strip-components=1 +rm erlang.tar.gz + +export ERL_TOP=$(pwd) +./configure --prefix "$PREFIX" +make -j$(nproc) +make install -j$(nproc) + +cd .. + +rm -rf build + diff --git a/packages/erlang/23.0.0/environment b/packages/erlang/23.0.0/environment new file mode 100644 index 0000000..780b668 --- /dev/null +++ b/packages/erlang/23.0.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/erlang/23.0.0/metadata.json b/packages/erlang/23.0.0/metadata.json new file mode 100644 index 0000000..e82b4b3 --- /dev/null +++ b/packages/erlang/23.0.0/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "erlang", + "version": "23.0.0", + "aliases": ["erlang", "erl", "escript"] +} diff --git a/packages/erlang/23.0.0/run b/packages/erlang/23.0.0/run new file mode 100644 index 0000000..135d9f4 --- /dev/null +++ b/packages/erlang/23.0.0/run @@ -0,0 +1,4 @@ +#!/bin/bash + +# Put instructions to run the runtime +escript "$@" \ No newline at end of file diff --git a/packages/erlang/23.0.0/test.erl b/packages/erlang/23.0.0/test.erl new file mode 100644 index 0000000..d898d2c --- /dev/null +++ b/packages/erlang/23.0.0/test.erl @@ -0,0 +1,3 @@ + +main(_) -> + io:format("OK~n"). \ No newline at end of file diff --git a/packages/gawk/5.1.0/build.sh b/packages/gawk/5.1.0/build.sh new file mode 100644 index 0000000..81fb998 --- /dev/null +++ b/packages/gawk/5.1.0/build.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +# Put instructions to build your package in here +PREFIX=$(realpath $(dirname $0)) + +mkdir -p build + +cd build + +curl "https://ftp.gnu.org/gnu/gawk/gawk-5.1.0.tar.gz" -o gawk.tar.gz + +tar xzf gawk.tar.gz --strip-components=1 + +# === autoconf based === +./configure --prefix "$PREFIX" + +make -j$(nproc) +make install -j$(nproc) +cd ../ +rm -rf build + diff --git a/packages/gawk/5.1.0/compile b/packages/gawk/5.1.0/compile new file mode 100644 index 0000000..e37a74c --- /dev/null +++ b/packages/gawk/5.1.0/compile @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +# Put instructions to compile source code, remove this file if the language does not require this stage diff --git a/packages/gawk/5.1.0/environment b/packages/gawk/5.1.0/environment new file mode 100644 index 0000000..780b668 --- /dev/null +++ b/packages/gawk/5.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/gawk/5.1.0/metadata.json b/packages/gawk/5.1.0/metadata.json new file mode 100644 index 0000000..e22b5d1 --- /dev/null +++ b/packages/gawk/5.1.0/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "gawk", + "version": "5.1.0", + "aliases": ["awk"] +} diff --git a/packages/gawk/5.1.0/run b/packages/gawk/5.1.0/run new file mode 100644 index 0000000..5134ddf --- /dev/null +++ b/packages/gawk/5.1.0/run @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# Put instructions to run the runtime +gawk-5.1.0 -f "$@" diff --git a/packages/gawk/5.1.0/test.awk b/packages/gawk/5.1.0/test.awk new file mode 100644 index 0000000..25e1bd3 --- /dev/null +++ b/packages/gawk/5.1.0/test.awk @@ -0,0 +1 @@ +{print "OK"} \ No newline at end of file diff --git a/packages/gcc/10.2.0/build.sh b/packages/gcc/10.2.0/build.sh new file mode 100755 index 0000000..0f4be80 --- /dev/null +++ b/packages/gcc/10.2.0/build.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +# Put instructions to build your package in here +[[ -d "bin" ]] && exit 0 +PREFIX=$(realpath $(dirname $0)) + +mkdir -p build obj + +cd build + +curl "https://ftp.gnu.org/gnu/gcc/gcc-10.2.0/gcc-10.2.0.tar.gz" -o gcc.tar.gz + +tar xzf gcc.tar.gz --strip-components=1 + +./contrib/download_prerequisites + +cd ../obj + +# === autoconf based === +../build/configure --prefix "$PREFIX" --enable-languages=c,c++,d --disable-multilib --disable-bootstrap + +make -j$(nproc) +make install -j$(nproc) +cd ../ +rm -rf build obj + diff --git a/packages/gcc/10.2.0/compile b/packages/gcc/10.2.0/compile new file mode 100644 index 0000000..acc9ae4 --- /dev/null +++ b/packages/gcc/10.2.0/compile @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +# Put instructions to compile source code, remove this file if the language does not require this stage + + +case "${PISTON_ALIAS}" in + gcc | c) + gcc -std=c11 "$@" -lm + ;; + g++ | c++ | cpp) + g++ -std=c++17 "$@" + ;; + gccgo | go) + gccgo "$@" + ;; + gdc | d) + gdc "$@" + ;; + *) + echo "How did you get here? (${PISTON_ALIAS})" + exit 1 + ;; +esac + +chmod +x a.out \ No newline at end of file diff --git a/packages/gcc/10.2.0/environment b/packages/gcc/10.2.0/environment new file mode 100644 index 0000000..780b668 --- /dev/null +++ b/packages/gcc/10.2.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/gcc/10.2.0/metadata.json b/packages/gcc/10.2.0/metadata.json new file mode 100644 index 0000000..6e211f6 --- /dev/null +++ b/packages/gcc/10.2.0/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "gcc", + "version": "10.2.0", + "aliases": ["c", "g++", "c++", "cpp", "gdc", "d"] +} diff --git a/packages/gcc/10.2.0/run b/packages/gcc/10.2.0/run new file mode 100644 index 0000000..60ad16b --- /dev/null +++ b/packages/gcc/10.2.0/run @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +# Put instructions to run the runtime + +shift # Discard main filename +./a.out "$@" diff --git a/packages/gcc/10.2.0/test.c b/packages/gcc/10.2.0/test.c new file mode 100644 index 0000000..fafae75 --- /dev/null +++ b/packages/gcc/10.2.0/test.c @@ -0,0 +1,6 @@ +#include + +int main(void) { + printf("OK"); + return 0; +} \ No newline at end of file diff --git a/lxc/tests/cpp.cpp b/packages/gcc/10.2.0/test.cpp similarity index 68% rename from lxc/tests/cpp.cpp rename to packages/gcc/10.2.0/test.cpp index 2bad760..9d0499e 100644 --- a/lxc/tests/cpp.cpp +++ b/packages/gcc/10.2.0/test.cpp @@ -1,6 +1,6 @@ #include int main(void) { - printf("good\n"); + printf("OK"); return 0; -} +} \ No newline at end of file diff --git a/lxc/tests/d.d b/packages/gcc/10.2.0/test.d similarity index 58% rename from lxc/tests/d.d rename to packages/gcc/10.2.0/test.d index e46985a..e74851d 100644 --- a/lxc/tests/d.d +++ b/packages/gcc/10.2.0/test.d @@ -1,5 +1,5 @@ import std.stdio; void main() { - writeln("good"); -} + writeln("OK"); +} \ No newline at end of file diff --git a/packages/go/1.16.2/build.sh b/packages/go/1.16.2/build.sh new file mode 100755 index 0000000..5cf70f9 --- /dev/null +++ b/packages/go/1.16.2/build.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +curl -LO https://golang.org/dl/go1.16.2.linux-amd64.tar.gz +tar -xzf go1.16.2.linux-amd64.tar.gz +rm go1.16.2.linux-amd64.tar.gz + diff --git a/packages/go/1.16.2/environment b/packages/go/1.16.2/environment new file mode 100644 index 0000000..88299c1 --- /dev/null +++ b/packages/go/1.16.2/environment @@ -0,0 +1,2 @@ +export PATH=$PWD/go/bin:$PATH +export GOPATH=$PWD/gopath diff --git a/packages/go/1.16.2/metadata.json b/packages/go/1.16.2/metadata.json new file mode 100644 index 0000000..0144808 --- /dev/null +++ b/packages/go/1.16.2/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "go", + "version": "1.16.2", + "aliases": ["go", "golang"] +} diff --git a/packages/go/1.16.2/run b/packages/go/1.16.2/run new file mode 100644 index 0000000..09656af --- /dev/null +++ b/packages/go/1.16.2/run @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +GOCACHE=$PWD go run "$@" diff --git a/lxc/tests/go.go b/packages/go/1.16.2/test.go similarity index 64% rename from lxc/tests/go.go rename to packages/go/1.16.2/test.go index 7304cc2..c06f485 100644 --- a/lxc/tests/go.go +++ b/packages/go/1.16.2/test.go @@ -3,5 +3,5 @@ package main import "fmt" func main() { - fmt.Println("good") + fmt.Println("OK") } 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" 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' 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..d58d528 --- /dev/null +++ b/packages/haskell/9.0.1/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "haskell", + "version": "9.0.1", + "aliases": ["haskell", "hs"] +} 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 diff --git a/packages/init b/packages/init new file mode 100755 index 0000000..68a303b --- /dev/null +++ b/packages/init @@ -0,0 +1,64 @@ +#!/usr/bin/env bash + +if [[ $# -lt 3 ]]; then + echo "Usage: $0 [name] [version] [source]" + echo "" + echo "Initializes an empty package" + exit 1 +fi + +NAME=$1 +VERSION=$2 +SOURCE=$3 + +DIR=$NAME/$VERSION + +mkdir -p $DIR + +build_instructions(){ + echo 'PREFIX=$(realpath $(dirname $0))' + echo + echo 'mkdir -p build' + echo + echo 'cd build' + echo + echo "curl \"$SOURCE\" -o $NAME.tar.gz" + echo + echo "tar xzf $NAME.tar.gz --strip-components=1" + echo + + echo "# === autoconf based ===" + echo './configure --prefix "$PREFIX"' + echo + echo 'make -j$(nproc)' + echo 'make install -j$(nproc)' + + echo 'cd ../' + echo 'rm -rf build' + +} + +cd $DIR + +for name in build.sh environment run compile; do + echo "#!/usr/bin/env bash" > "$name" + echo "" >> "$name" +done + +echo "# Put instructions to build your package in here" >> build.sh +echo "" +build_instructions >> build.sh + +echo "# Put 'export' statements here for environment variables" >> environment +echo "export PATH=\$PWD/bin:\$PATH" >> environment + +echo "# Put instructions to run the runtime" >> run +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 = []' <<< "{}" > metadata.json + +cd - > /dev/null + +echo $DIR diff --git a/packages/java/15.0.2/build.sh b/packages/java/15.0.2/build.sh new file mode 100755 index 0000000..aef09a6 --- /dev/null +++ b/packages/java/15.0.2/build.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +# Put instructions to build your package in here + +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 + diff --git a/packages/java/15.0.2/environment b/packages/java/15.0.2/environment new file mode 100644 index 0000000..780b668 --- /dev/null +++ b/packages/java/15.0.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/java/15.0.2/metadata.json b/packages/java/15.0.2/metadata.json new file mode 100644 index 0000000..9c3a298 --- /dev/null +++ b/packages/java/15.0.2/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "java", + "version": "15.0.2", + "aliases": [] +} diff --git a/packages/java/15.0.2/run b/packages/java/15.0.2/run new file mode 100644 index 0000000..0837ba4 --- /dev/null +++ b/packages/java/15.0.2/run @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# Put instructions to run the runtime +java "$@" diff --git a/lxc/tests/java.java b/packages/java/15.0.2/test.java similarity index 66% rename from lxc/tests/java.java rename to packages/java/15.0.2/test.java index ca376fd..2dc0eaa 100644 --- a/lxc/tests/java.java +++ b/packages/java/15.0.2/test.java @@ -1,5 +1,5 @@ public class HelloWorld { public static void main(String[] args) { - System.out.println("good"); + System.out.println("OK"); } -} +} \ No newline at end of file diff --git a/packages/jelly/0.1.31/build.sh b/packages/jelly/0.1.31/build.sh new file mode 100755 index 0000000..db57122 --- /dev/null +++ b/packages/jelly/0.1.31/build.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +source ../../python/3.9.1/build.sh + +mkdir -p build + +git clone -q https://github.com/DennisMitchell/jellylanguage.git build/jelly +cd build/jelly +../../bin/python3.9 setup.py install --optimize=1 + +cd ../../ +rm -rf build diff --git a/packages/jelly/0.1.31/environment b/packages/jelly/0.1.31/environment new file mode 100644 index 0000000..bd0ff98 --- /dev/null +++ b/packages/jelly/0.1.31/environment @@ -0,0 +1 @@ +export PATH=$PWD/bin:$PATH \ No newline at end of file diff --git a/packages/jelly/0.1.31/metadata.json b/packages/jelly/0.1.31/metadata.json new file mode 100644 index 0000000..905242e --- /dev/null +++ b/packages/jelly/0.1.31/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "jelly", + "version": "0.1.31", + "aliases": [] +} diff --git a/packages/jelly/0.1.31/run b/packages/jelly/0.1.31/run new file mode 100644 index 0000000..e07c1af --- /dev/null +++ b/packages/jelly/0.1.31/run @@ -0,0 +1 @@ +jelly fu "$@" \ No newline at end of file diff --git a/packages/jelly/0.1.31/test.jelly b/packages/jelly/0.1.31/test.jelly new file mode 100644 index 0000000..b32bbcd --- /dev/null +++ b/packages/jelly/0.1.31/test.jelly @@ -0,0 +1 @@ +“OK” \ No newline at end of file diff --git a/packages/julia/1.5.4/build.sh b/packages/julia/1.5.4/build.sh new file mode 100755 index 0000000..d9e746c --- /dev/null +++ b/packages/julia/1.5.4/build.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +curl -OL https://julialang-s3.julialang.org/bin/linux/x64/1.5/julia-1.5.4-linux-x86_64.tar.gz +tar zxvf julia-1.5.4-linux-x86_64.tar.gz +rm julia-1.5.4-linux-x86_64.tar.gz + diff --git a/packages/julia/1.5.4/environment b/packages/julia/1.5.4/environment new file mode 100644 index 0000000..a20e0bf --- /dev/null +++ b/packages/julia/1.5.4/environment @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +export PATH=$PWD/julia-1.5.4/bin:$PATH diff --git a/packages/julia/1.5.4/metadata.json b/packages/julia/1.5.4/metadata.json new file mode 100644 index 0000000..f177ea8 --- /dev/null +++ b/packages/julia/1.5.4/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "julia", + "version": "1.5.4", + "aliases": ["jl"] +} diff --git a/packages/julia/1.5.4/run b/packages/julia/1.5.4/run new file mode 100755 index 0000000..215025f --- /dev/null +++ b/packages/julia/1.5.4/run @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# Put instructions to run the runtime +julia --startup-file=no --history-file=no "$@" diff --git a/packages/julia/1.5.4/test.jl b/packages/julia/1.5.4/test.jl new file mode 100644 index 0000000..dc98a27 --- /dev/null +++ b/packages/julia/1.5.4/test.jl @@ -0,0 +1 @@ +println("OK") diff --git a/packages/kotlin/1.4.31/build.sh b/packages/kotlin/1.4.31/build.sh new file mode 100755 index 0000000..e921dd5 --- /dev/null +++ b/packages/kotlin/1.4.31/build.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +source ../../java/15.0.2/build.sh + +curl -L "https://github.com/JetBrains/kotlin/releases/download/v1.4.31/kotlin-compiler-1.4.31.zip" -o kotlin.zip +unzip kotlin.zip +rm kotlin.zip + +cp -r kotlinc/* . +rm -rf kotlinc diff --git a/packages/kotlin/1.4.31/compile b/packages/kotlin/1.4.31/compile new file mode 100644 index 0000000..d042c39 --- /dev/null +++ b/packages/kotlin/1.4.31/compile @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# Put instructions to compile source code, remove this file if the language does not require this stage +kotlinc "$@" -include-runtime -d code.jar \ No newline at end of file diff --git a/packages/kotlin/1.4.31/environment b/packages/kotlin/1.4.31/environment new file mode 100644 index 0000000..780b668 --- /dev/null +++ b/packages/kotlin/1.4.31/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/kotlin/1.4.31/metadata.json b/packages/kotlin/1.4.31/metadata.json new file mode 100644 index 0000000..304c5cd --- /dev/null +++ b/packages/kotlin/1.4.31/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "kotlin", + "version": "1.4.31", + "aliases": ["kt"] +} diff --git a/packages/kotlin/1.4.31/run b/packages/kotlin/1.4.31/run new file mode 100644 index 0000000..d7c9501 --- /dev/null +++ b/packages/kotlin/1.4.31/run @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# Put instructions to run the runtime +java -jar code.jar \ No newline at end of file diff --git a/packages/kotlin/1.4.31/test.kt b/packages/kotlin/1.4.31/test.kt new file mode 100644 index 0000000..31acf7b --- /dev/null +++ b/packages/kotlin/1.4.31/test.kt @@ -0,0 +1,3 @@ +fun main() { + println("OK") +} \ No newline at end of file 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..185cf9e --- /dev/null +++ b/packages/lisp/2.1.2/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "lisp", + "version": "2.1.2", + "aliases": ["lisp", "cl", "sbcl", "commonlisp"] +} 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 diff --git a/packages/lolcode/0.11.2/build.sh b/packages/lolcode/0.11.2/build.sh new file mode 100755 index 0000000..72a9ea3 --- /dev/null +++ b/packages/lolcode/0.11.2/build.sh @@ -0,0 +1,15 @@ +#!/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 +cmake -DCMAKE_INSTALL_PREFIX:STRING="$PREFIX" . +make -j$(nproc) +make install -j$(nproc) + +# Cleaning up +cd ../ && rm -rf lolcode 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..1bd6bbf --- /dev/null +++ b/packages/lolcode/0.11.2/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "lolcode", + "version": "0.11.2", + "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..d4e6725 --- /dev/null +++ b/packages/lolcode/0.11.2/run @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# Put instructions to run the runtime +lci "$@" diff --git a/lxc/tests/lolcode.lol b/packages/lolcode/0.11.2/test.lol similarity index 66% rename from lxc/tests/lolcode.lol rename to packages/lolcode/0.11.2/test.lol index eac51ad..f93f722 100644 --- a/lxc/tests/lolcode.lol +++ b/packages/lolcode/0.11.2/test.lol @@ -1,4 +1,4 @@ HAI 1.2 CAN HAS STDIO? - VISIBLE "good" + VISIBLE "OK" KTHXBYE 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..936b3b6 --- /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/lua-5.4.2/src:$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..f0396db --- /dev/null +++ b/packages/lua/5.4.2/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "lua", + "version": "5.4.2", + "aliases": ["lua"] +} 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 diff --git a/packages/mono/6.12.0/build.sh b/packages/mono/6.12.0/build.sh new file mode 100755 index 0000000..2cecc07 --- /dev/null +++ b/packages/mono/6.12.0/build.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +PREFIX=$(realpath $(dirname $0)) + +mkdir -p 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 "$PREFIX" + +make -j$(nproc) +make install -j$(nproc) + +cd ../../ +rm -rf build + diff --git a/packages/mono/6.12.0/compile b/packages/mono/6.12.0/compile new file mode 100644 index 0000000..746c05e --- /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..03bbb35 --- /dev/null +++ b/packages/mono/6.12.0/environment @@ -0,0 +1 @@ +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 new file mode 100644 index 0000000..85679bf --- /dev/null +++ b/packages/mono/6.12.0/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "mono", + "version": "6.12.0", + "aliases": ["csharp", "cs"] +} diff --git a/packages/mono/6.12.0/run b/packages/mono/6.12.0/run new file mode 100644 index 0000000..557ce76 --- /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/mono/6.12.0/test.cs b/packages/mono/6.12.0/test.cs new file mode 100644 index 0000000..e91a2a2 --- /dev/null +++ b/packages/mono/6.12.0/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 diff --git a/packages/nasm/2.15.5/build.sh b/packages/nasm/2.15.5/build.sh new file mode 100755 index 0000000..0f39f6f --- /dev/null +++ b/packages/nasm/2.15.5/build.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +# Put instructions to build your package in here +PREFIX=$(realpath $(dirname $0)) + +mkdir -p build + +cd build + +curl -L "https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/nasm-2.15.05.tar.gz" -o nasm.tar.gz + +tar xzf nasm.tar.gz --strip-components=1 + +# === autoconf based === +./configure --prefix "$PREFIX" + +make -j$(nproc) +make install -j$(nproc) +cd ../ +rm -rf build + diff --git a/packages/nasm/2.15.5/compile b/packages/nasm/2.15.5/compile new file mode 100644 index 0000000..e481319 --- /dev/null +++ b/packages/nasm/2.15.5/compile @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +# Put instructions to compile source code, remove this file if the language does not require this stage + + +case "${PISTON_ALIAS}" in + nasm) + nasm -f elf32 -o binary.o "$@" + ld -m elf_i386 binary.o -o binary + ;; + nasm64) + nasm -f elf64 -o binary.o "$@" + ld -m elf_x86_64 binary.o -o binary + ;; + *) + echo "How did you get here? (${PISTON_ALIAS})" + exit 1 + ;; +esac + +chmod +x ./binary \ No newline at end of file diff --git a/packages/nasm/2.15.5/environment b/packages/nasm/2.15.5/environment new file mode 100644 index 0000000..780b668 --- /dev/null +++ b/packages/nasm/2.15.5/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/nasm/2.15.5/metadata.json b/packages/nasm/2.15.5/metadata.json new file mode 100644 index 0000000..9f8a384 --- /dev/null +++ b/packages/nasm/2.15.5/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "nasm", + "version": "2.15.5", + "aliases": ["nasm64"] +} diff --git a/packages/nasm/2.15.5/run b/packages/nasm/2.15.5/run new file mode 100644 index 0000000..f910a1c --- /dev/null +++ b/packages/nasm/2.15.5/run @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +# Put instructions to run the runtime +shift +./binary "$@" diff --git a/lxc/tests/nasm.nasm b/packages/nasm/2.15.5/test.nasm.asm similarity index 82% rename from lxc/tests/nasm.nasm rename to packages/nasm/2.15.5/test.nasm.asm index 8570909..d1e5a57 100644 --- a/lxc/tests/nasm.nasm +++ b/packages/nasm/2.15.5/test.nasm.asm @@ -1,5 +1,5 @@ SECTION .DATA -good: db 'good',10 +good: db 'OK',10 txtlen: equ $-good SECTION .TEXT @@ -13,4 +13,4 @@ mov edx,txtlen int 80h mov eax,1 mov ebx,0 -int 80h +int 80h \ No newline at end of file diff --git a/lxc/tests/nasm64.nasm b/packages/nasm/2.15.5/test.nasm64.asm similarity index 85% rename from lxc/tests/nasm64.nasm rename to packages/nasm/2.15.5/test.nasm64.asm index fbc5aef..20ea316 100644 --- a/lxc/tests/nasm64.nasm +++ b/packages/nasm/2.15.5/test.nasm64.asm @@ -1,5 +1,5 @@ SECTION .data - good: db "good", 0x0 + good: db "OK", 0x0 txtlen: equ $ - good SECTION .text @@ -15,4 +15,4 @@ _start: ;sys_exit mov rax, 60 mov rdi, 0 - syscall + syscall \ No newline at end of file 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..f23eb0e --- /dev/null +++ b/packages/nim/1.4.4/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "nim", + "version": "1.4.4", + "aliases": ["nim"] +} 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 diff --git a/packages/node/15.10.0/build.sh b/packages/node/15.10.0/build.sh new file mode 100755 index 0000000..6a84798 --- /dev/null +++ b/packages/node/15.10.0/build.sh @@ -0,0 +1,4 @@ +#!/bin/bash +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 diff --git a/packages/node/15.10.0/environment b/packages/node/15.10.0/environment new file mode 100644 index 0000000..bd0ff98 --- /dev/null +++ b/packages/node/15.10.0/environment @@ -0,0 +1 @@ +export PATH=$PWD/bin:$PATH \ No newline at end of file diff --git a/packages/node/15.10.0/metadata.json b/packages/node/15.10.0/metadata.json new file mode 100644 index 0000000..2f601d1 --- /dev/null +++ b/packages/node/15.10.0/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "node", + "version": "15.10.0", + "aliases": ["node-javascript", "node-js", "javascript", "js"] +} diff --git a/packages/node/15.10.0/run b/packages/node/15.10.0/run new file mode 100644 index 0000000..6d1fdee --- /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 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"; diff --git a/packages/osabie/1.0.1/build.sh b/packages/osabie/1.0.1/build.sh new file mode 100755 index 0000000..8914444 --- /dev/null +++ b/packages/osabie/1.0.1/build.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +source ../../elixir/1.11.3/build.sh + +export PATH=$PWD/bin:$PATH + +PREFIX=$(realpath $(dirname $0)) + +mkdir -p build + +cd build + +git clone 'https://github.com/Adriandmen/05AB1E.git' . +mix local.hex --force +mix local.rebar --force +mix deps.get --force +MIX_ENV=prod mix escript.build --force + +cd .. + +cp -r build/* bin + +rm -rf build diff --git a/packages/osabie/1.0.1/environment b/packages/osabie/1.0.1/environment new file mode 100644 index 0000000..ea24603 --- /dev/null +++ b/packages/osabie/1.0.1/environment @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +# Put 'export' statements here for environment variables +export LC_ALL=en_US.UTF-8 +export PATH=$PWD/bin:$PATH diff --git a/packages/osabie/1.0.1/metadata.json b/packages/osabie/1.0.1/metadata.json new file mode 100644 index 0000000..d4480d2 --- /dev/null +++ b/packages/osabie/1.0.1/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "osabie", + "version": "1.0.1", + "aliases": ["osabie", "05AB1E", "usable"] +} diff --git a/packages/osabie/1.0.1/run b/packages/osabie/1.0.1/run new file mode 100644 index 0000000..fde91e3 --- /dev/null +++ b/packages/osabie/1.0.1/run @@ -0,0 +1,4 @@ +#!/bin/bash + +# osabie only takes filename and stdin +osabie "$1" \ No newline at end of file diff --git a/packages/osabie/1.0.1/test.osabie b/packages/osabie/1.0.1/test.osabie new file mode 100644 index 0000000..4a7ac92 --- /dev/null +++ b/packages/osabie/1.0.1/test.osabie @@ -0,0 +1 @@ +"OK 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..cdbb30a --- /dev/null +++ b/packages/paradoc/0.6.0/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "paradoc", + "version": "0.6.0", + "aliases": ["paradoc"] +} 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 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..daaca4f --- /dev/null +++ b/packages/pascal/3.2.0/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "pascal", + "version": "3.2.0", + "aliases": ["pascal", "freepascal", "pp", "pas"] +} 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 diff --git a/packages/perl/5.26.1/build.sh b/packages/perl/5.26.1/build.sh new file mode 100755 index 0000000..1aed9eb --- /dev/null +++ b/packages/perl/5.26.1/build.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +PREFIX=$(realpath $(dirname $0)) + +mkdir -p build + +cd build + +curl "https://www.cpan.org/src/5.0/perl-5.26.1.tar.gz" -o perl.tar.gz +tar xzf perl.tar.gz --strip-components=1 +./Configure -des -Dprefix="$PREFIX" + +make -j$(nproc) +make install -j$(nproc) + +cd .. + +rm -rf build + diff --git a/packages/perl/5.26.1/environment b/packages/perl/5.26.1/environment new file mode 100644 index 0000000..bd0ff98 --- /dev/null +++ b/packages/perl/5.26.1/environment @@ -0,0 +1 @@ +export PATH=$PWD/bin:$PATH \ No newline at end of file diff --git a/packages/perl/5.26.1/metadata.json b/packages/perl/5.26.1/metadata.json new file mode 100644 index 0000000..67a6624 --- /dev/null +++ b/packages/perl/5.26.1/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "perl", + "version": "5.26.1", + "aliases": ["perl", "pl"] +} diff --git a/packages/perl/5.26.1/run b/packages/perl/5.26.1/run new file mode 100644 index 0000000..3b8d77c --- /dev/null +++ b/packages/perl/5.26.1/run @@ -0,0 +1,3 @@ +#!/bin/bash + +perl "$@" \ No newline at end of file diff --git a/packages/perl/5.26.1/test.pl b/packages/perl/5.26.1/test.pl new file mode 100644 index 0000000..3f2688f --- /dev/null +++ b/packages/perl/5.26.1/test.pl @@ -0,0 +1 @@ +print("OK") \ No newline at end of file diff --git a/packages/php/8.0.2/build.sh b/packages/php/8.0.2/build.sh new file mode 100755 index 0000000..b84a80d --- /dev/null +++ b/packages/php/8.0.2/build.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +PREFIX=$(realpath $(dirname $0)) + +mkdir -p 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 "$PREFIX" + +make -j$(nproc) +make install -j$(nproc) + +cd ../../ +rm -rf build 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..14d3e11 --- /dev/null +++ b/packages/php/8.0.2/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "php", + "version": "8.0.2", + "aliases": ["php8", "html"] +} diff --git a/packages/php/8.0.2/run b/packages/php/8.0.2/run new file mode 100644 index 0000000..1261d95 --- /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/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") 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..d799d87 --- /dev/null +++ b/packages/prolog/8.2.4/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "prolog", + "version": "8.2.4", + "aliases": ["prolog", "plg"] +} 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 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..409df52 --- /dev/null +++ b/packages/pure/0.68.0/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "pure", + "version": "0.68.0", + "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 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 diff --git a/packages/python/2.7.18/build.sh b/packages/python/2.7.18/build.sh new file mode 100755 index 0000000..131ba96 --- /dev/null +++ b/packages/python/2.7.18/build.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +PREFIX=$(realpath $(dirname $0)) + +mkdir -p build + +cd build + +curl "https://www.python.org/ftp/python/2.7.18/Python-2.7.18.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/pip2 install -U pip==20.3.* +# Upgrade pip to latest supported version + +bin/pip2 install numpy scipy pycrypto whoosh bcrypt passlib diff --git a/packages/python/2.7.18/environment b/packages/python/2.7.18/environment new file mode 100644 index 0000000..bd0ff98 --- /dev/null +++ b/packages/python/2.7.18/environment @@ -0,0 +1 @@ +export PATH=$PWD/bin:$PATH \ No newline at end of file diff --git a/packages/python/2.7.18/metadata.json b/packages/python/2.7.18/metadata.json new file mode 100644 index 0000000..7677ded --- /dev/null +++ b/packages/python/2.7.18/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "python", + "version": "2.7.18", + "aliases": ["py", "python2"] +} diff --git a/packages/python/2.7.18/run b/packages/python/2.7.18/run new file mode 100644 index 0000000..9858f52 --- /dev/null +++ b/packages/python/2.7.18/run @@ -0,0 +1,3 @@ +#!/bin/bash + +python2.7 "$@" \ No newline at end of file diff --git a/packages/python/2.7.18/test.py b/packages/python/2.7.18/test.py new file mode 100644 index 0000000..d9708c5 --- /dev/null +++ b/packages/python/2.7.18/test.py @@ -0,0 +1 @@ +print "OK" \ No newline at end of file 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.5.10/build.sh b/packages/python/3.5.10/build.sh new file mode 100755 index 0000000..bced203 --- /dev/null +++ b/packages/python/3.5.10/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.5.10/Python-3.5.10.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.5.10/environment b/packages/python/3.5.10/environment new file mode 100644 index 0000000..bd0ff98 --- /dev/null +++ b/packages/python/3.5.10/environment @@ -0,0 +1 @@ +export PATH=$PWD/bin:$PATH \ No newline at end of file diff --git a/packages/python/3.5.10/metadata.json b/packages/python/3.5.10/metadata.json new file mode 100644 index 0000000..fca2ef6 --- /dev/null +++ b/packages/python/3.5.10/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "python", + "version": "3.5.10", + "aliases": ["py", "python3"] +} diff --git a/packages/python/3.5.10/run b/packages/python/3.5.10/run new file mode 100644 index 0000000..aafa4ab --- /dev/null +++ b/packages/python/3.5.10/run @@ -0,0 +1,3 @@ +#!/bin/bash + +python3.5 "$@" \ No newline at end of file diff --git a/packages/python/3.5.10/test.py b/packages/python/3.5.10/test.py new file mode 100644 index 0000000..3f2688f --- /dev/null +++ b/packages/python/3.5.10/test.py @@ -0,0 +1 @@ +print("OK") \ No newline at end of file diff --git a/packages/python/3.9.1/build.sh b/packages/python/3.9.1/build.sh new file mode 100755 index 0000000..fcae7c7 --- /dev/null +++ b/packages/python/3.9.1/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.1/Python-3.9.1.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.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..5537b3e --- /dev/null +++ b/packages/python/3.9.1/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "python", + "version": "3.9.1", + "aliases": ["py", "python3"] +} diff --git a/packages/python/3.9.1/run b/packages/python/3.9.1/run new file mode 100644 index 0000000..450bb76 --- /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/3.9.1/test.py b/packages/python/3.9.1/test.py new file mode 100644 index 0000000..3f2688f --- /dev/null +++ b/packages/python/3.9.1/test.py @@ -0,0 +1 @@ +print("OK") \ 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 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..f65bfd6 --- /dev/null +++ b/packages/rockstar/1.0.0/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "rockstar", + "version": "1.0.0", + "aliases": ["rockstar", "rock"] +} 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 diff --git a/packages/ruby/2.5.1/build.sh b/packages/ruby/2.5.1/build.sh new file mode 100755 index 0000000..7403e87 --- /dev/null +++ b/packages/ruby/2.5.1/build.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +PREFIX=$(realpath $(dirname $0)) + +mkdir -p build + +cd build + +curl "https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.1.tar.gz" -o ruby.tar.gz +tar xzf ruby.tar.gz --strip-components=1 +rm ruby.tar.gz + +./configure --prefix "$PREFIX" +make -j$(nproc) +make install -j$(nproc) + +cd .. + +rm -rf build + diff --git a/packages/ruby/2.5.1/environment b/packages/ruby/2.5.1/environment new file mode 100644 index 0000000..bd0ff98 --- /dev/null +++ b/packages/ruby/2.5.1/environment @@ -0,0 +1 @@ +export PATH=$PWD/bin:$PATH \ No newline at end of file diff --git a/packages/ruby/2.5.1/metadata.json b/packages/ruby/2.5.1/metadata.json new file mode 100644 index 0000000..a483428 --- /dev/null +++ b/packages/ruby/2.5.1/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "ruby", + "version": "2.5.1", + "aliases": ["ruby", "rb"] +} diff --git a/packages/ruby/2.5.1/run b/packages/ruby/2.5.1/run new file mode 100644 index 0000000..ae76e5f --- /dev/null +++ b/packages/ruby/2.5.1/run @@ -0,0 +1,3 @@ +#!/bin/bash + +ruby "$@" \ No newline at end of file diff --git a/packages/ruby/2.5.1/test.rb b/packages/ruby/2.5.1/test.rb new file mode 100644 index 0000000..3fca0dd --- /dev/null +++ b/packages/ruby/2.5.1/test.rb @@ -0,0 +1 @@ +puts("OK") \ No newline at end of file diff --git a/packages/rust/1.50.0/build.sh b/packages/rust/1.50.0/build.sh new file mode 100755 index 0000000..c3e41b1 --- /dev/null +++ b/packages/rust/1.50.0/build.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +curl -OL "https://static.rust-lang.org/dist/rust-1.50.0-x86_64-unknown-linux-gnu.tar.gz" +tar xzvf rust-1.50.0-x86_64-unknown-linux-gnu.tar.gz +rm rust-1.50.0-x86_64-unknown-linux-gnu.tar.gz diff --git a/packages/rust/1.50.0/compile b/packages/rust/1.50.0/compile new file mode 100644 index 0000000..201318a --- /dev/null +++ b/packages/rust/1.50.0/compile @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +# https://stackoverflow.com/questions/38041331/rust-compiler-cant-find-crate-for-std +# Rust compiler needs to find the stdlib to link against +rustc -o binary -L ${RUST_INSTALL_LOC}/rustc/lib -L ${RUST_INSTALL_LOC}/rust-std-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib "$@" +chmod +x binary diff --git a/packages/rust/1.50.0/environment b/packages/rust/1.50.0/environment new file mode 100644 index 0000000..2a704ee --- /dev/null +++ b/packages/rust/1.50.0/environment @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +# Put 'export' statements here for environment variables +export PATH=$PWD/rust-1.50.0-x86_64-unknown-linux-gnu/rustc/bin/:$PATH +export RUST_INSTALL_LOC=$PWD/rust-1.50.0-x86_64-unknown-linux-gnu diff --git a/packages/rust/1.50.0/metadata.json b/packages/rust/1.50.0/metadata.json new file mode 100644 index 0000000..57cefa0 --- /dev/null +++ b/packages/rust/1.50.0/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "rust", + "version": "1.50.0", + "aliases": ["rs"] +} diff --git a/api/start b/packages/rust/1.50.0/run old mode 100755 new mode 100644 similarity index 51% rename from api/start rename to packages/rust/1.50.0/run index fe2024e..d377dd9 --- a/api/start +++ b/packages/rust/1.50.0/run @@ -1,3 +1,4 @@ #!/usr/bin/env bash -node src +shift +./binary "$@" diff --git a/packages/rust/1.50.0/test.rs b/packages/rust/1.50.0/test.rs new file mode 100644 index 0000000..9561664 --- /dev/null +++ b/packages/rust/1.50.0/test.rs @@ -0,0 +1,3 @@ +fn main() { + println!("OK"); +} 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..8c2e7b4 --- /dev/null +++ b/packages/scala/3.0.0/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "scala", + "version": "3.0.0", + "aliases": ["scala", "sc"] +} 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/lxc/tests/scala.scala b/packages/scala/3.0.0/test.scala similarity index 56% rename from lxc/tests/scala.scala rename to packages/scala/3.0.0/test.scala index 4083d74..bf4cabc 100644 --- a/lxc/tests/scala.scala +++ b/packages/scala/3.0.0/test.scala @@ -1,3 +1,3 @@ @main def run(): Unit = { - println("good") -} + println("OK") +} \ No newline at end of file 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..ecc52ae --- /dev/null +++ b/packages/swift/5.3.3/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "swift", + "version": "5.3.3", + "aliases": ["swift"] +} 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 diff --git a/packages/typescript/4.2.3/build.sh b/packages/typescript/4.2.3/build.sh new file mode 100755 index 0000000..9182055 --- /dev/null +++ b/packages/typescript/4.2.3/build.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +source ../../node/15.10.0/build.sh + +source ./environment + +bin/npm install -g typescript@4.2.3 diff --git a/packages/typescript/4.2.3/compile b/packages/typescript/4.2.3/compile new file mode 100644 index 0000000..fdf5f19 --- /dev/null +++ b/packages/typescript/4.2.3/compile @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +# Put instructions to compile source code, remove this file if the language does not require this stage + +tsc "$@" \ No newline at end of file diff --git a/packages/typescript/4.2.3/environment b/packages/typescript/4.2.3/environment new file mode 100644 index 0000000..780b668 --- /dev/null +++ b/packages/typescript/4.2.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/typescript/4.2.3/metadata.json b/packages/typescript/4.2.3/metadata.json new file mode 100644 index 0000000..cc7669b --- /dev/null +++ b/packages/typescript/4.2.3/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "typescript", + "version": "4.2.3", + "aliases": ["ts", "node-ts", "tsc"] +} diff --git a/packages/typescript/4.2.3/run b/packages/typescript/4.2.3/run new file mode 100644 index 0000000..1d26f3f --- /dev/null +++ b/packages/typescript/4.2.3/run @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +# Put instructions to run the runtime + +CODE=$(sed 's/ts$/js/' <<<"$1") +shift + +node $CODE "$@" diff --git a/packages/typescript/4.2.3/test.ts b/packages/typescript/4.2.3/test.ts new file mode 100644 index 0000000..56ed4a0 --- /dev/null +++ b/packages/typescript/4.2.3/test.ts @@ -0,0 +1 @@ +console.log("OK") \ No newline at end of file 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..d136076 --- /dev/null +++ b/packages/vlang/0.1.13/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "vlang", + "version": "0.1.13", + "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 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..2712dc0 --- /dev/null +++ b/packages/zig/0.7.1/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "zig", + "version": "0.7.1", + "aliases": ["zig"] +} 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/lxc/tests/zig.zig b/packages/zig/0.7.1/test.zig similarity index 71% rename from lxc/tests/zig.zig rename to packages/zig/0.7.1/test.zig index 6a9d2ac..548c703 100644 --- a/lxc/tests/zig.zig +++ b/packages/zig/0.7.1/test.zig @@ -2,5 +2,5 @@ const std = @import("std"); pub fn main() !void { const stdout = std.io.getStdOut().writer(); - try stdout.print("good\n", .{}); -} + try stdout.print("OK\n", .{}); +} \ No newline at end of file diff --git a/readme.md b/readme.md index 3628d2a..caf2aa3 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. @@ -83,193 +95,200 @@ so we can discuss potentially getting you an unlimited key. # Getting Started +## All In One + ### Host System Package Dependencies -* NodeJS -* lxc -* libvirt +- Docker +- Docker Compose +- Node JS -
- -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: +### After system dependencies are installed, clone this repository: ```sh # clone and enter repo git clone https://github.com/engineer-man/piston ``` -#### Installation (simple) +### Installation -- 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! +```sh +# Start the API container +docker-compose up -d api +# Install all the dependencies for the cli +cd cli && npm i && cd - +``` -#### Installation (advanced) +## Just Piston (no CLI) -- See `var/install.txt` for how to build the container manually +### Host System Package Dependencies + +- Docker + +### Installation + +```sh +docker run -v $PWD:'/piston' --tmpfs /piston/jobs -dit -p 2000:2000 --name piston_api ghcr.io/engineer-man/piston +``` -#### 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 + +# Install latest python +cli/index.js ppman install python + +# Run a python script +echo 'print("Hello world!")' > 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 + +# Run using python 3.x +cli/index.js run python test.py -l 3.x + +``` + +If you are operating on a remote machine, add the `-u` flag like so: + +```sh +cli/index.js -u http://piston.server:2000 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 2000 by default. +This is used by the CLI to carry out running jobs and package management. -For your own local installation, the API is available at: - -``` -http://127.0.0.1:2000 -``` - -#### Versions Endpoint -`GET /versions` +#### Runtimes Endpoint +`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 `/execute` endpoint, either the name or one of the aliases must -be provided. +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" + "language": "bash", + "version": "5.1.0", + "aliases": [ + "sh" + ] }, { - "name": "bash", - "aliases": ["bash"], - "version": "4.4.20" + "language": "brainfuck", + "version": "2.7.3", + "aliases": [ + "bf" + ] }, - { - "name": "c", - "aliases": ["c"], - "version": "7.5.0" - } + ... ] ``` #### Execute Endpoint -`POST /execute` +`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 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. The first file in this array is considered the main file. +- `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 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 { "language": "js", - "source": "console.log(process.argv)", + "version": "15.10.0", + "files": [ + { + "name": "my_cool_code.js", + "content": "console.log(process.argv)" + } + ], "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. ```json 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 -`awk`, `bash`, `brainfuck`, -`c`, -`cpp`, +`cjam`, `clojure`, +`coffeescript`, +`cow`, `crystal`, -`csharp`, -`d`, +`dart`, `dash`, `deno`, +`dotnet`, +`dragon`, `elixir`, `emacs`, -`elisp`, +`erlang`, +`gawk`, +`gcc`, `go`, +`golfscript`, +`groovy`, `haskell`, `java`, `jelly`, @@ -278,41 +297,47 @@ Content-Type: application/json `lisp`, `lolcode`, `lua`, +`mono`, `nasm`, -`nasm64`, `nim`, `node`, +`ocaml`, `osabie`, `paradoc`, +`pascal`, `perl`, `php`, -`python2`, -`python3`, +`ponylang`, +`prolog`, +`pure`, +`python`, +`rockstar`, `ruby`, `rust`, `scala`, `swift`, `typescript`, +`vlang`, `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. + +Piston uses Docker as the primary mechanism for sandboxing. There is an API within the container written in Node +which takes in execution requests and executees them within the container safely. +High level, the API writes any source code to a temporary directory in `/piston/jobs`. 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. +Docker 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 processes at 256 by default (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 diff --git a/repo/.gitignore b/repo/.gitignore new file mode 100644 index 0000000..c3607c0 --- /dev/null +++ b/repo/.gitignore @@ -0,0 +1,2 @@ +*.pkg.tar.gz +index \ No newline at end of file diff --git a/repo/Dockerfile b/repo/Dockerfile new file mode 100644 index 0000000..90d6547 --- /dev/null +++ b/repo/Dockerfile @@ -0,0 +1,11 @@ +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 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 + +ADD entrypoint.sh mkindex.sh / + +ENTRYPOINT ["bash","/entrypoint.sh"] +CMD ["--no-build"] diff --git a/repo/entrypoint.sh b/repo/entrypoint.sh new file mode 100755 index 0000000..6c47e37 --- /dev/null +++ b/repo/entrypoint.sh @@ -0,0 +1,59 @@ +cd /piston/packages + +SERVER=1 +BUILD=1 +CI=0 + +echo "Running through arguments.." + +for pkg in "$@" +do + shift + if [[ "$pkg" = "--no-server" ]]; then + echo "Not starting index server after builds" + SERVER=0 + elif [[ "$pkg" = "--no-build" ]]; then + echo "Building no more package" + BUILD=0 + elif [[ "$pkg" = "--ci" ]]; then + echo "Running in CI mode, --no-build, --no-server" + BUILD=0 + SERVER=0 + CI=1 + else + if [[ $BUILD -eq 1 ]]; then + echo "Building package $pkg" + make -j16 $pkg.pkg.tar.gz PLATFORM=docker-debian + echo "Done with package $pkg" + elif [[ $CI -eq 1 ]]; then + echo "Commit SHA: $pkg" + + cd .. + echo "Changed files:" + git diff --name-only $pkg^1 $pkg + PACKAGES=$(git diff --name-only $pkg^1 $pkg | awk -F/ '{ print $2 "-" $3 }' | sort -u) + cd packages + + echo "Building packages: $PACKAGES" + for package in "$PACKAGES"; do + make -j16 $package.pkg.tar.gz PLATFORM=docker-debian + done + + else + echo "Building was disabled, skipping $pkg build=$BUILD ci=$CI" + fi + fi +done + +cd /piston/repo +echo "Creating index" +./mkindex.sh +echo "Index created" + +if [[ $SERVER -eq 1 ]]; then + echo "Starting index server.." + python3 -m http.server +else + echo "Skipping starting index server" +fi +exit 0 \ No newline at end of file diff --git a/repo/mkindex.sh b/repo/mkindex.sh new file mode 100755 index 0000000..082423e --- /dev/null +++ b/repo/mkindex.sh @@ -0,0 +1,23 @@ +BASEURL=http://piston_fs_repo:8000/ + +i=0 + +echo "" > index + +for pkg in $(find ../packages -type f -name "*.pkg.tar.gz") +do + + 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.+') + PKGCHECKSUM=$(sha256sum $PKGFILE | awk '{print $1}') + + echo "$PKGNAME,$PKGVERSION,$PKGCHECKSUM,$BASEURL$PKGFILE" >> index + echo "Adding package $PKGNAME-$PKGVERSION" + + ((i=i+1)) +done \ No newline at end of file diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..47b2d12 --- /dev/null +++ b/shell.nix @@ -0,0 +1,5 @@ +{ pkgs ? import {} }: + pkgs.mkShell { + # nativeBuildInputs is usually what you want -- tools you need to run + nativeBuildInputs = with pkgs; [ nodejs-15_x jq ]; +} 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/images/icon_circle.svg b/var/docs/images/em.svg similarity index 100% rename from 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 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