Merge branch 'v3' into v3-remove-privilege

This commit is contained in:
Victor Frazao 2021-04-06 09:42:32 -04:00 committed by GitHub
commit 288c9e2611
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
74 changed files with 1949 additions and 1679 deletions

View file

@ -64,7 +64,7 @@ jobs:
path: data/config.yaml path: data/config.yaml
contents: | contents: |
log_level: DEBUG log_level: DEBUG
bind_address: 0.0.0.0:6969 bind_address: 0.0.0.0:2000
data_directory: /piston data_directory: /piston
runner_uid_min: 1100 runner_uid_min: 1100
runner_uid_max: 1500 runner_uid_max: 1500
@ -91,20 +91,20 @@ jobs:
docker run -v $(pwd)'/repo:/piston/repo' -v $(pwd)'/packages:/piston/packages' -d --name piston_fs_repo docker.pkg.github.com/engineer-man/piston/repo-builder --no-build docker run -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 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.. echo Waiting for API to start..
docker run --network container:api appropriate/curl -s --retry 10 --retry-connrefused http://localhost:6969/runtimes docker run --network container:api appropriate/curl -s --retry 10 --retry-connrefused http://localhost:2000/runtimes
echo Waiting for Index to start.. echo Waiting for Index to start..
docker run --network container:piston_fs_repo appropriate/curl -s --retry 10 --retry-connrefused http://localhost:8000/index docker run --network container:piston_fs_repo appropriate/curl -s --retry 200 --retry-connrefused http://localhost:8000/index
echo Adjusting index echo Adjusting index
sed -i 's/piston_fs_repo/localhost/g' repo/index sed -i 's/piston_fs_repo/localhost/g' repo/index
echo Listing Packages echo Listing Packages
PACKAGES_JSON=$(docker run --network container:api appropriate/curl -s http://localhost:6969/packages) PACKAGES_JSON=$(docker run --network container:api appropriate/curl -s http://localhost:2000/packages)
echo $PACKAGES_JSON echo $PACKAGES_JSON
echo Getting CLI ready echo Getting CLI ready
docker run -v "$PWD/cli:/app" --entrypoint /bin/bash node:15 -c 'cd /app; yarn' docker run -v "$PWD/cli:/app" --entrypoint /bin/bash node:15 -c 'cd /app; npm i'
for package in $(jq -r '.[] | "\(.language)-\(.language_version)"' <<< "$PACKAGES_JSON") for package in $(jq -r '.[] | "\(.language)-\(.language_version)"' <<< "$PACKAGES_JSON")
do do
@ -114,7 +114,7 @@ jobs:
PKG_VERSION=$(awk -F- '{ print $2 }' <<< $package) PKG_VERSION=$(awk -F- '{ print $2 }' <<< $package)
echo "Installing..." echo "Installing..."
docker run --network container:api appropriate/curl -sXPOST http://localhost:6969/packages/$PKG_PATH docker run --network container:api appropriate/curl -sXPOST http://localhost:2000/packages/$PKG_PATH
TEST_SCRIPTS=packages/$PKG_PATH/test.* TEST_SCRIPTS=packages/$PKG_PATH/test.*
echo "Tests: $TEST_SCRIPTS" echo "Tests: $TEST_SCRIPTS"

View file

@ -1,23 +1,28 @@
FROM node:15.8.0-buster-slim FROM node:15.8.0-buster-slim
ENV DEBIAN_FRONTEND noninteractive
ENV DEBIAN_FRONTEND=noninteractive
RUN dpkg-reconfigure -p critical dash RUN dpkg-reconfigure -p critical dash
RUN for i in $(seq 1001 1500); do \ RUN for i in $(seq 1001 1500); do \
groupadd -g $i runner$i && \ groupadd -g $i runner$i && \
useradd -M runner$i -g $i -u $i ; \ useradd -M runner$i -g $i -u $i ; \
done done
RUN apt-get update && \ 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 && \ 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/* rm -rf /var/lib/apt/lists/*
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen
ENV NODE_ENV=production ENV NODE_ENV=production
WORKDIR /piston_api WORKDIR /piston_api
COPY ["package.json", "yarn.lock", "./"] COPY ["package.json", "package-lock.json", "./"]
RUN yarn RUN npm i
COPY ./src ./src COPY ./src ./src
RUN make -C ./src/nosocket/ all && make -C ./src/nosocket/ install RUN make -C ./src/nosocket/ all && make -C ./src/nosocket/ install
CMD [ "node", "src", "-m", "-c", "/piston/config.yaml"] CMD [ "node", "src", "-m", "-c", "/piston/config.yaml"]
EXPOSE 6969/tcp EXPOSE 2000/tcp

1328
api/package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -45,7 +45,7 @@ const options = [
{ {
key: 'bind_address', key: 'bind_address',
desc: 'Address to bind REST API on\nThank @Bones for the number', desc: 'Address to bind REST API on\nThank @Bones for the number',
default: '0.0.0.0:6969', default: '0.0.0.0:2000',
validators: [] validators: []
}, },
{ {

View file

@ -92,7 +92,6 @@ const app = express();
return { return {
language: rt.language, language: rt.language,
version: rt.version.raw, version: rt.version.raw,
author: rt.author,
aliases: rt.aliases aliases: rt.aliases
}; };
}); });

View file

@ -14,12 +14,11 @@ class Runtime {
fss.read_file_sync(path.join(package_dir, 'pkg-info.json')) fss.read_file_sync(path.join(package_dir, 'pkg-info.json'))
); );
const { language, version, author, build_platform, aliases } = info; const { language, version, build_platform, aliases } = info;
this.pkgdir = package_dir; this.pkgdir = package_dir;
this.language = language; this.language = language;
this.version = semver.parse(version); this.version = semver.parse(version);
this.author = author;
this.aliases = aliases; this.aliases = aliases;
if (build_platform !== globals.platform) { if (build_platform !== globals.platform) {

File diff suppressed because it is too large Load diff

View file

@ -13,7 +13,7 @@ const axios_instance = function(argv){
require('yargs')(process.argv.slice(2)) require('yargs')(process.argv.slice(2))
.option('piston-url', { .option('piston-url', {
alias: ['u'], alias: ['u'],
default: 'http://127.0.0.1:6969', default: 'http://127.0.0.1:2000',
desc: 'Piston API URL', desc: 'Piston API URL',
string: true string: true
}) })

387
cli/package-lock.json generated Normal file
View file

@ -0,0 +1,387 @@
{
"name": "piston-cli",
"version": "1.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "piston-cli",
"version": "1.0.0",
"license": "MIT",
"dependencies": {
"axios": "^0.21.1",
"chalk": "^4.1.0",
"yargs": "^16.2.0"
}
},
"node_modules/ansi-regex": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
"integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
"engines": {
"node": ">=8"
}
},
"node_modules/ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dependencies": {
"color-convert": "^2.0.1"
},
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/axios": {
"version": "0.21.1",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz",
"integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==",
"dependencies": {
"follow-redirects": "^1.10.0"
}
},
"node_modules/chalk": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz",
"integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==",
"dependencies": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/chalk/chalk?sponsor=1"
}
},
"node_modules/cliui": {
"version": "7.0.4",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz",
"integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==",
"dependencies": {
"string-width": "^4.2.0",
"strip-ansi": "^6.0.0",
"wrap-ansi": "^7.0.0"
}
},
"node_modules/color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dependencies": {
"color-name": "~1.1.4"
},
"engines": {
"node": ">=7.0.0"
}
},
"node_modules/color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
},
"node_modules/emoji-regex": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
},
"node_modules/escalade": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
"integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==",
"engines": {
"node": ">=6"
}
},
"node_modules/follow-redirects": {
"version": "1.13.3",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.3.tgz",
"integrity": "sha512-DUgl6+HDzB0iEptNQEXLx/KhTmDb8tZUHSeLqpnjpknR70H0nC2t9N73BK6fN4hOvJ84pKlIQVQ4k5FFlBedKA==",
"funding": [
{
"type": "individual",
"url": "https://github.com/sponsors/RubenVerborgh"
}
],
"engines": {
"node": ">=4.0"
},
"peerDependenciesMeta": {
"debug": {
"optional": true
}
}
},
"node_modules/get-caller-file": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
"engines": {
"node": "6.* || 8.* || >= 10.*"
}
},
"node_modules/has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"engines": {
"node": ">=8"
}
},
"node_modules/is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
"engines": {
"node": ">=8"
}
},
"node_modules/require-directory": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
"integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/string-width": {
"version": "4.2.2",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz",
"integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==",
"dependencies": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/strip-ansi": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
"integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
"dependencies": {
"ansi-regex": "^5.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dependencies": {
"has-flag": "^4.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/wrap-ansi": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
"integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
"dependencies": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
"strip-ansi": "^6.0.0"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
}
},
"node_modules/y18n": {
"version": "5.0.5",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.5.tgz",
"integrity": "sha512-hsRUr4FFrvhhRH12wOdfs38Gy7k2FFzB9qgN9v3aLykRq0dRcdcpz5C9FxdS2NuhOrI/628b/KSTJ3rwHysYSg==",
"engines": {
"node": ">=10"
}
},
"node_modules/yargs": {
"version": "16.2.0",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz",
"integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==",
"dependencies": {
"cliui": "^7.0.2",
"escalade": "^3.1.1",
"get-caller-file": "^2.0.5",
"require-directory": "^2.1.1",
"string-width": "^4.2.0",
"y18n": "^5.0.5",
"yargs-parser": "^20.2.2"
},
"engines": {
"node": ">=10"
}
},
"node_modules/yargs-parser": {
"version": "20.2.7",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.7.tgz",
"integrity": "sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw==",
"engines": {
"node": ">=10"
}
}
},
"dependencies": {
"ansi-regex": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
"integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg=="
},
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"requires": {
"color-convert": "^2.0.1"
}
},
"axios": {
"version": "0.21.1",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz",
"integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==",
"requires": {
"follow-redirects": "^1.10.0"
}
},
"chalk": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz",
"integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==",
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"cliui": {
"version": "7.0.4",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz",
"integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==",
"requires": {
"string-width": "^4.2.0",
"strip-ansi": "^6.0.0",
"wrap-ansi": "^7.0.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
},
"emoji-regex": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
},
"escalade": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
"integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw=="
},
"follow-redirects": {
"version": "1.13.3",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.3.tgz",
"integrity": "sha512-DUgl6+HDzB0iEptNQEXLx/KhTmDb8tZUHSeLqpnjpknR70H0nC2t9N73BK6fN4hOvJ84pKlIQVQ4k5FFlBedKA=="
},
"get-caller-file": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg=="
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="
},
"is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg=="
},
"require-directory": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
"integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I="
},
"string-width": {
"version": "4.2.2",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz",
"integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==",
"requires": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.0"
}
},
"strip-ansi": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
"integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
"requires": {
"ansi-regex": "^5.0.0"
}
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"requires": {
"has-flag": "^4.0.0"
}
},
"wrap-ansi": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
"integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
"requires": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
"strip-ansi": "^6.0.0"
}
},
"y18n": {
"version": "5.0.5",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.5.tgz",
"integrity": "sha512-hsRUr4FFrvhhRH12wOdfs38Gy7k2FFzB9qgN9v3aLykRq0dRcdcpz5C9FxdS2NuhOrI/628b/KSTJ3rwHysYSg=="
},
"yargs": {
"version": "16.2.0",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz",
"integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==",
"requires": {
"cliui": "^7.0.2",
"escalade": "^3.1.1",
"get-caller-file": "^2.0.5",
"require-directory": "^2.1.1",
"string-width": "^4.2.0",
"y18n": "^5.0.5",
"yargs-parser": "^20.2.2"
}
},
"yargs-parser": {
"version": "20.2.7",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.7.tgz",
"integrity": "sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw=="
}
}
}

View file

@ -3,7 +3,6 @@
"version": "1.0.0", "version": "1.0.0",
"description": "Piston Execution Engine CLI tools", "description": "Piston Execution Engine CLI tools",
"main": "index.js", "main": "index.js",
"author": "Thomas Hobson <thomas@hexf.me>",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"axios": "^0.21.1", "axios": "^0.21.1",

View file

@ -1,141 +0,0 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
ansi-regex@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75"
integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==
ansi-styles@^4.0.0, ansi-styles@^4.1.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937"
integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==
dependencies:
color-convert "^2.0.1"
axios@^0.21.1:
version "0.21.1"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.1.tgz#22563481962f4d6bde9a76d516ef0e5d3c09b2b8"
integrity sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==
dependencies:
follow-redirects "^1.10.0"
chalk@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a"
integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==
dependencies:
ansi-styles "^4.1.0"
supports-color "^7.1.0"
cliui@^7.0.2:
version "7.0.4"
resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f"
integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==
dependencies:
string-width "^4.2.0"
strip-ansi "^6.0.0"
wrap-ansi "^7.0.0"
color-convert@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3"
integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==
dependencies:
color-name "~1.1.4"
color-name@~1.1.4:
version "1.1.4"
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
emoji-regex@^8.0.0:
version "8.0.0"
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37"
integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==
escalade@^3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40"
integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==
follow-redirects@^1.10.0:
version "1.13.3"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.3.tgz#e5598ad50174c1bc4e872301e82ac2cd97f90267"
integrity sha512-DUgl6+HDzB0iEptNQEXLx/KhTmDb8tZUHSeLqpnjpknR70H0nC2t9N73BK6fN4hOvJ84pKlIQVQ4k5FFlBedKA==
get-caller-file@^2.0.5:
version "2.0.5"
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e"
integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==
has-flag@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b"
integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==
is-fullwidth-code-point@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d"
integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==
require-directory@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I=
string-width@^4.1.0, string-width@^4.2.0:
version "4.2.2"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.2.tgz#dafd4f9559a7585cfba529c6a0a4f73488ebd4c5"
integrity sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.0"
strip-ansi@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532"
integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==
dependencies:
ansi-regex "^5.0.0"
supports-color@^7.1.0:
version "7.2.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da"
integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==
dependencies:
has-flag "^4.0.0"
wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
dependencies:
ansi-styles "^4.0.0"
string-width "^4.1.0"
strip-ansi "^6.0.0"
y18n@^5.0.5:
version "5.0.5"
resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.5.tgz#8769ec08d03b1ea2df2500acef561743bbb9ab18"
integrity sha512-hsRUr4FFrvhhRH12wOdfs38Gy7k2FFzB9qgN9v3aLykRq0dRcdcpz5C9FxdS2NuhOrI/628b/KSTJ3rwHysYSg==
yargs-parser@^20.2.2:
version "20.2.7"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.7.tgz#61df85c113edfb5a7a4e36eb8aa60ef423cbc90a"
integrity sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw==
yargs@^16.2.0:
version "16.2.0"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66"
integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==
dependencies:
cliui "^7.0.2"
escalade "^3.1.1"
get-caller-file "^2.0.5"
require-directory "^2.1.1"
string-width "^4.2.0"
y18n "^5.0.5"
yargs-parser "^20.2.2"

20
docker-compose.dev.yaml Normal file
View file

@ -0,0 +1,20 @@
version: '2.7'
services:
piston_api:
build: api
cap_add:
- CAP_SYS_ADMIN
restart: always
ports:
- 2000:2000
volumes:
- ./data/piston:/piston
tmpfs:
- /piston/jobs:exec
piston_fs_repo: # Local testing of packages
build: repo
command: ['dart-2.12.1'] # Only build dart
volumes:
- .:/piston

View file

@ -1,18 +1,12 @@
version: '3.8' version: '2.7'
services: services:
piston_api: piston_api:
build: api build: api
restart: always restart: always
ports: ports:
- 6969:6969 - 2000:2000
volumes: volumes:
- ./data/piston:/piston - ./data/piston:/piston
tmpfs: tmpfs:
- /piston/jobs:exec - /piston/jobs:exec
piston_fs_repo: # Local testing of packages
build: repo
command: ['dart-2.12.1'] # Only build dart
volumes:
- .:/piston

View file

@ -40,13 +40,12 @@ public class Test
} }
``` ```
8. Create a `metadata.json` file which contains metadata about the language and interpreter. This simply contains the language name, as in the folder name, the version as in the folder name, the author's name and email address, aliases that can be used to call this package, and finally a dependencies map. 8. Create a `metadata.json` file which contains metadata about the language and interpreter. This simply contains the language name, as in the folder name, the version as in the folder name, aliases that can be used to call this package, and finally a dependencies map.
The dependencies map contains the keys as language names, and the values as semver selectors for packages. The dependencies map contains the keys as language names, and the values as semver selectors for packages.
```json ```json
{ {
"language": "deno", "language": "deno",
"version": "1.7.5", "version": "1.7.5",
"author": "Thomas Hobson <thomas@hexf.me>",
"dependencies": {}, "dependencies": {},
"aliases": ["deno-ts", "deno-js"] "aliases": ["deno-ts", "deno-js"]
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "bash", "language": "bash",
"version": "5.1.0", "version": "5.1.0",
"aliases": ["sh"], "aliases": ["sh"]
"author": "Thomas Hobson <git@hexf.me>"
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "brainfuck", "language": "brainfuck",
"version": "2.7.3", "version": "2.7.3",
"aliases": ["bf"], "aliases": ["bf"]
"author": "Thomas Hobson <git@hexf.me>"
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "clojure", "language": "clojure",
"version": "1.10.3", "version": "1.10.3",
"aliases": ["clojure","clj"], "aliases": ["clojure", "clj"]
"author": "Dan Vargas <danvargas46@gmail.com>"
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "coffeescript", "language": "coffeescript",
"version": "2.5.1", "version": "2.5.1",
"author": "Dan Vargas <danvargas46@gmail.com>",
"aliases": ["coffeescript", "coffee"] "aliases": ["coffeescript", "coffee"]
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "cow", "language": "cow",
"version": "1.0.0", "version": "1.0.0",
"author": "Dan Vargas <danvargas46@gmail.com>",
"aliases": ["cow"] "aliases": ["cow"]
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "crystal", "language": "crystal",
"version": "0.36.1", "version": "0.36.1",
"author": "Dan Vargas <danvargas46@gmail.com>",
"aliases": ["crystal", "cr"] "aliases": ["crystal", "cr"]
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "dart", "language": "dart",
"version": "2.12.1", "version": "2.12.1",
"aliases": [], "aliases": []
"author": "Thomas Hobson <git@hexf.me>"
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "dash", "language": "dash",
"version": "0.5.11", "version": "0.5.11",
"aliases": ["dash"], "aliases": ["dash"]
"author": "Dan Vargas <danvargas46@gmail.com>"
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "deno", "language": "deno",
"version": "1.7.5", "version": "1.7.5",
"author": "Thomas Hobson <thomas@hexf.me>",
"aliases": ["deno-ts", "deno-js"] "aliases": ["deno-ts", "deno-js"]
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "dotnet", "language": "dotnet",
"version": "5.0.201", "version": "5.0.201",
"aliases": ["cs", "csharp"], "aliases": ["cs", "csharp"]
"author": "Thomas Hobson <git@hexf.me>"
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "elixir", "language": "elixir",
"version": "1.11.3", "version": "1.11.3",
"author": "Dan Vargas <danvargas46@gmail.com>",
"aliases": ["elixir", "exs"] "aliases": ["elixir", "exs"]
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "emacs", "language": "emacs",
"version": "27.1.0", "version": "27.1.0",
"author": "Dan Vargas <danvargas46@gmail.com>",
"aliases": ["emacs", "el", "elisp"] "aliases": ["emacs", "el", "elisp"]
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "erlang", "language": "erlang",
"version": "23.0.0", "version": "23.0.0",
"author": "Dan Vargas <danvargas46@gmail.com>",
"aliases": ["erlang", "erl", "escript"] "aliases": ["erlang", "erl", "escript"]
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "gawk", "language": "gawk",
"version": "5.1.0", "version": "5.1.0",
"aliases": ["awk"], "aliases": ["awk"]
"author": "Thomas Hobson <git@hexf.me>"
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "gcc", "language": "gcc",
"version": "10.2.0", "version": "10.2.0",
"aliases": ["c","g++","c++","cpp","gdc","d"], "aliases": ["c", "g++", "c++", "cpp", "gdc", "d"]
"author": "Thomas Hobson <git@hexf.me>"
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "go", "language": "go",
"version": "1.16.2", "version": "1.16.2",
"author": "Victor Frazao <luiz_victor_frazao@hotmail.com>",
"aliases": ["go", "golang"] "aliases": ["go", "golang"]
} }

13
packages/groovy/3.0.7/build.sh vendored Executable file
View file

@ -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

5
packages/groovy/3.0.7/environment vendored Normal file
View file

@ -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

5
packages/groovy/3.0.7/metadata.json vendored Normal file
View file

@ -0,0 +1,5 @@
{
"language": "groovy",
"version": "3.0.7",
"aliases": ["groovy", "gvy"]
}

3
packages/groovy/3.0.7/run vendored Normal file
View file

@ -0,0 +1,3 @@
#!/bin/bash
groovy "$@"

1
packages/groovy/3.0.7/test.groovy vendored Normal file
View file

@ -0,0 +1 @@
println 'OK'

View file

@ -1,6 +1,5 @@
{ {
"language": "haskell", "language": "haskell",
"version": "9.0.1", "version": "9.0.1",
"author": "Dan Vargas <danvargas46@gmail.com>",
"aliases": ["haskell", "hs"] "aliases": ["haskell", "hs"]
} }

View file

@ -9,7 +9,6 @@ fi
NAME=$1 NAME=$1
VERSION=$2 VERSION=$2
AUTHOR="$(git config user.name) <$(git config user.email)>"
SOURCE=$3 SOURCE=$3
DIR=$NAME/$VERSION DIR=$NAME/$VERSION
@ -58,7 +57,7 @@ echo "$NAME-$VERSION \"\$@\"" >> run
echo "# Put instructions to compile source code, remove this file if the language does not require this stage" >> compile echo "# Put instructions to compile source code, remove this file if the language does not require this stage" >> compile
jq '.language = "'$NAME'" | .version = "'$VERSION'" | .aliases = [] | .author = "'"$AUTHOR"'"' <<< "{}" > metadata.json jq '.language = "'$NAME'" | .version = "'$VERSION'" | .aliases = []' <<< "{}" > metadata.json
cd - > /dev/null cd - > /dev/null

View file

@ -1,6 +1,5 @@
{ {
"language": "java", "language": "java",
"version": "15.0.2", "version": "15.0.2",
"aliases": [], "aliases": []
"author": "Thomas Hobson <git@hexf.me>"
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "jelly", "language": "jelly",
"version": "0.1.31", "version": "0.1.31",
"author": "Thomas Hobson <thomas@hexf.me>",
"aliases": [] "aliases": []
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "julia", "language": "julia",
"version": "1.5.4", "version": "1.5.4",
"aliases": ["jl"], "aliases": ["jl"]
"author": "Victor Frazao <luiz_victor_frazao@hotmail.com>"
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "kotlin", "language": "kotlin",
"version": "1.4.31", "version": "1.4.31",
"aliases": ["kt"], "aliases": ["kt"]
"author": "Thomas Hobson <git@hexf.me>"
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "lisp", "language": "lisp",
"version": "2.1.2", "version": "2.1.2",
"aliases": ["lisp","cl","sbcl","commonlisp"], "aliases": ["lisp", "cl", "sbcl", "commonlisp"]
"author": "Dan Vargas <danvargas46@gmail.com>"
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "lolcode", "language": "lolcode",
"version": "0.11.2", "version": "0.11.2",
"author": "Shivansh-007 <Shivansh-007@users.noreply.github.com>",
"aliases": ["lol", "lci"] "aliases": ["lol", "lci"]
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "lua", "language": "lua",
"version": "5.4.2", "version": "5.4.2",
"author": "Shivansh-007 <Shivansh-007@users.noreply.github.com>",
"aliases": ["lua"] "aliases": ["lua"]
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "mono", "language": "mono",
"version": "6.12.0", "version": "6.12.0",
"author": "Thomas Hobson <thomas@hexf.me>",
"aliases": ["csharp", "cs"] "aliases": ["csharp", "cs"]
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "nasm", "language": "nasm",
"version": "2.15.5", "version": "2.15.5",
"aliases": ["nasm64"], "aliases": ["nasm64"]
"author": "Thomas Hobson <git@hexf.me>"
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "nim", "language": "nim",
"version": "1.4.4", "version": "1.4.4",
"author": "Dan Vargas <danvargas46@gmail.com>",
"aliases": ["nim"] "aliases": ["nim"]
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "node", "language": "node",
"version": "15.10.0", "version": "15.10.0",
"author": "Martin Kos <martinkos007@gmail.com>",
"aliases": ["node-javascript", "node-js", "javascript", "js"] "aliases": ["node-javascript", "node-js", "javascript", "js"]
} }

17
packages/ocaml/4.12.0/build.sh vendored Executable file
View file

@ -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

3
packages/ocaml/4.12.0/compile vendored Normal file
View file

@ -0,0 +1,3 @@
#!/bin/bash
ocamlc -o out "$@"

3
packages/ocaml/4.12.0/environment vendored Normal file
View file

@ -0,0 +1,3 @@
#!/bin/bash
export PATH=$PWD/bin:$PATH

5
packages/ocaml/4.12.0/metadata.json vendored Normal file
View file

@ -0,0 +1,5 @@
{
"language": "ocaml",
"version": "4.12.0",
"aliases": ["ocaml", "ml"]
}

4
packages/ocaml/4.12.0/run vendored Normal file
View file

@ -0,0 +1,4 @@
#!/bin/bash
shift
./out "$@"

1
packages/ocaml/4.12.0/test.ml vendored Normal file
View file

@ -0,0 +1 @@
print_string "OK\n";

View file

@ -1,6 +1,5 @@
{ {
"language": "osabie", "language": "osabie",
"version": "1.0.1", "version": "1.0.1",
"author": "Dan Vargas <danvargas46@gmail.com>",
"aliases": ["osabie", "05AB1E", "usable"] "aliases": ["osabie", "05AB1E", "usable"]
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "paradoc", "language": "paradoc",
"version": "0.6.0", "version": "0.6.0",
"author": "Dan Vargas <danvargas46@gmail.com>",
"aliases": ["paradoc"] "aliases": ["paradoc"]
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "pascal", "language": "pascal",
"version": "3.2.0", "version": "3.2.0",
"author": "Dan Vargas <danvargas46@gmail.com>",
"aliases": ["pascal", "freepascal", "pp", "pas"] "aliases": ["pascal", "freepascal", "pp", "pas"]
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "perl", "language": "perl",
"version": "5.26.1", "version": "5.26.1",
"author": "Dan Vargas <danvargas46@gmail.com>",
"aliases": ["perl", "pl"] "aliases": ["perl", "pl"]
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "php", "language": "php",
"version": "8.0.2", "version": "8.0.2",
"author": "Martin Kos <martinkos007@gmail.com>", "aliases": ["php8", "html"]
"aliases": ["php8","html"]
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "prolog", "language": "prolog",
"version": "8.2.4", "version": "8.2.4",
"aliases": ["prolog","plg"], "aliases": ["prolog", "plg"]
"author": "Dan Vargas <danvargas46@gmail.com>"
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "pure", "language": "pure",
"version": "0.68.0", "version": "0.68.0",
"author": "Shivansh-007 <shivansh-007@outlook.com>",
"aliases": [] "aliases": []
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "python", "language": "python",
"version": "2.7.18", "version": "2.7.18",
"author": "Shivansh-007 <Shivansh-007@users.noreply.github.com>",
"aliases": ["py", "python2"] "aliases": ["py", "python2"]
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "python", "language": "python",
"version": "3.5.10", "version": "3.5.10",
"author": "Shivansh-007 <Shivansh-007@users.noreply.github.com>",
"aliases": ["py", "python3"] "aliases": ["py", "python3"]
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "python", "language": "python",
"version": "3.9.1", "version": "3.9.1",
"author": "Thomas Hobson <thomas@hexf.me>",
"aliases": ["py", "python3"] "aliases": ["py", "python3"]
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "rockstar", "language": "rockstar",
"version": "1.0.0", "version": "1.0.0",
"author": "Dan Vargas <danvargas46@gmail.com>",
"aliases": ["rockstar", "rock"] "aliases": ["rockstar", "rock"]
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "ruby", "language": "ruby",
"version": "2.5.1", "version": "2.5.1",
"author": "Dan Vargas <danvargas46@gmail.com>",
"aliases": ["ruby", "rb"] "aliases": ["ruby", "rb"]
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "rust", "language": "rust",
"version": "1.50.0", "version": "1.50.0",
"aliases": ["rs"], "aliases": ["rs"]
"author": "Victor Frazao <luiz_victor_frazao@hotmail.com>"
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "scala", "language": "scala",
"version": "3.0.0", "version": "3.0.0",
"aliases": ["scala","sc"], "aliases": ["scala", "sc"]
"author": "Dan Vargas <danvargas46@gmail.com>"
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "swift", "language": "swift",
"version": "5.3.3", "version": "5.3.3",
"aliases": ["swift"], "aliases": ["swift"]
"author": "Dan Vargas <danvargas46@gmail.com>"
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "typescript", "language": "typescript",
"version": "4.2.3", "version": "4.2.3",
"aliases": ["ts","node-ts","tsc"], "aliases": ["ts", "node-ts", "tsc"]
"author": "Thomas Hobson <git@hexf.me>"
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "vlang", "language": "vlang",
"version": "0.1.13", "version": "0.1.13",
"author": "Shivansh-007 <shivansh-007@outlook.com>",
"aliases": ["v"] "aliases": ["v"]
} }

View file

@ -1,6 +1,5 @@
{ {
"language": "zig", "language": "zig",
"version": "0.7.1", "version": "0.7.1",
"aliases": ["zig"], "aliases": ["zig"]
"author": "Dan Vargas <danvargas46@gmail.com>"
} }

View file

@ -104,8 +104,7 @@ git clone https://github.com/engineer-man/piston
docker-compose up -d piston_api docker-compose up -d piston_api
# Start the API container # Start the API container
npm install -g yarn cd cli && npm i && cd -
cd cli && yarn && cd -
# Install all the dependencies for the cli # Install all the dependencies for the cli
``` ```
@ -121,7 +120,7 @@ cd cli && yarn && cd -
echo "$GITHUB_TOKEN" | docker login https://docker.pkg.github.com -u "$GITHUB_USERNAME" --password-stdin echo "$GITHUB_TOKEN" | docker login https://docker.pkg.github.com -u "$GITHUB_USERNAME" --password-stdin
# Change out the $GITHUB_TOKEN and $GITHUB_USERNAME with appropritate values # Change out the $GITHUB_TOKEN and $GITHUB_USERNAME with appropritate values
docker run -v $PWD:'/piston' --tmpfs /piston/jobs -dit -p 6969:6969 --privileged --name piston_api docker.pkg.github.com/engineer-man/piston/api:latest docker run -v $PWD:'/piston' --tmpfs /piston/jobs -dit -p 2000:2000 --name piston_api docker.pkg.github.com/engineer-man/piston/api:latest
``` ```
<br> <br>
@ -144,22 +143,29 @@ cli/index.js ppman install python 3.9.1
# Run a python script # Run a python script
echo 'print("Hello world!")' > test.py echo 'print("Hello world!")' > test.py
cli/index.js run python 3.9.1 test.py cli/index.js run python 3.9.1 test.py
# Run the script using the latest version
cli/index.js run python '*' test.py
# Run using python 3.x
cli/index.js run python 3.x test.py
``` ```
If you are operating on a remote machine, add the `-u` flag like so: If you are operating on a remote machine, add the `-u` flag like so:
```sh ```sh
cli/index.js -u http://piston.server:6969 ppman list cli/index.js -u http://piston.server:2000 ppman list
``` ```
### API ### API
The container exposes an API on port 6969 by default. The container exposes an API on port 2000 by default.
This is used by the CLI to carry out running jobs and package managment. This is used by the CLI to carry out running jobs and package managment.
#### Runtimes Endpoint #### Runtimes Endpoint
`GET /runtimes` `GET /runtimes`
This endpoint will return the supported languages along with the current version, author and aliases. To execute This endpoint will return the supported languages along with the current version and aliases. To execute
code for a particular language using the `/jobs` endpoint, either the name or one of the aliases must code for a particular language using the `/jobs` endpoint, either the name or one of the aliases must
be provided, along with the version. 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. Multiple versions of the same language may be present at the same time, and may be selected when running a job.
@ -171,7 +177,6 @@ Content-Type: application/json
{ {
"language": "bash", "language": "bash",
"version": "5.1.0", "version": "5.1.0",
"author": "Thomas Hobson <git@hexf.me>",
"aliases": [ "aliases": [
"sh" "sh"
] ]
@ -179,7 +184,6 @@ Content-Type: application/json
{ {
"language": "brainfuck", "language": "brainfuck",
"version": "2.7.3", "version": "2.7.3",
"author": "Thomas Hobson <git@hexf.me>",
"aliases": [ "aliases": [
"bf" "bf"
] ]
@ -254,21 +258,23 @@ Content-Type: application/json
<br> <br>
# Supported Languages # Supported Languages
`awk`,
`bash`, `bash`,
`brainfuck`, `brainfuck`,
`c`,
`cpp`,
`clojure`, `clojure`,
`coffeescript`,
`cow`,
`crystal`, `crystal`,
`csharp`, `dart`,
`d`,
`dash`, `dash`,
`deno`, `deno`,
`dotnet`,
`elixir`, `elixir`,
`emacs`, `emacs`,
`elisp`, `erlang`,
`gawk`,
`gcc`,
`go`, `go`,
`groovy`,
`haskell`, `haskell`,
`java`, `java`,
`jelly`, `jelly`,
@ -277,21 +283,26 @@ Content-Type: application/json
`lisp`, `lisp`,
`lolcode`, `lolcode`,
`lua`, `lua`,
`mono`,
`nasm`, `nasm`,
`nasm64`,
`nim`, `nim`,
`node`, `node`,
`ocaml`,
`osabie`, `osabie`,
`paradoc`, `paradoc`,
`pascal`,
`perl`, `perl`,
`php`, `php`,
`python2`, `prolog`,
`python3`, `pure`,
`python`,
`rockstar`,
`ruby`, `ruby`,
`rust`, `rust`,
`scala`, `scala`,
`swift`, `swift`,
`typescript`, `typescript`,
`vlang`,
`zig`, `zig`,
<br> <br>

View file

@ -1,5 +1,5 @@
{ pkgs ? import <nixpkgs> {} }: { pkgs ? import <nixpkgs> {} }:
pkgs.mkShell { pkgs.mkShell {
# nativeBuildInputs is usually what you want -- tools you need to run # nativeBuildInputs is usually what you want -- tools you need to run
nativeBuildInputs = with pkgs; [ nodejs-15_x yarn jq ]; nativeBuildInputs = with pkgs; [ nodejs-15_x jq ];
} }