From 440559f7b46f552f2d0305ba25eeb5078cb3add2 Mon Sep 17 00:00:00 2001 From: Hydrazer Date: Mon, 17 Jan 2022 18:05:17 -0700 Subject: [PATCH 01/23] pkg(emojicode-1.0.2): added emojicode 1.0.2 --- packages/emojicode/1.0.2/build.sh | 15 +++++++++++++++ packages/emojicode/1.0.2/compile | 4 ++++ packages/emojicode/1.0.2/environment | 5 +++++ packages/emojicode/1.0.2/metadata.json | 7 +++++++ packages/emojicode/1.0.2/run | 5 +++++ packages/emojicode/1.0.2/test.emojic | 3 +++ readme.md | 1 + 7 files changed, 40 insertions(+) create mode 100644 packages/emojicode/1.0.2/build.sh create mode 100644 packages/emojicode/1.0.2/compile create mode 100644 packages/emojicode/1.0.2/environment create mode 100644 packages/emojicode/1.0.2/metadata.json create mode 100644 packages/emojicode/1.0.2/run create mode 100644 packages/emojicode/1.0.2/test.emojic diff --git a/packages/emojicode/1.0.2/build.sh b/packages/emojicode/1.0.2/build.sh new file mode 100644 index 0000000..cf63d26 --- /dev/null +++ b/packages/emojicode/1.0.2/build.sh @@ -0,0 +1,15 @@ +curl -L https://github.com/emojicode/emojicode/releases/download/v1.0-beta.2/Emojicode-1.0-beta.2-Linux-x86_64.tar.gz -o emoji.tar.gz +tar xzf emoji.tar.gz + +mv Emojicode-1.0-beta.2-Linux-x86_64 emoji + +rm emoji.tar.gz + +cd emoji + +./install.sh + + +chmod +x emojicodec + +cd .. diff --git a/packages/emojicode/1.0.2/compile b/packages/emojicode/1.0.2/compile new file mode 100644 index 0000000..1ff67af --- /dev/null +++ b/packages/emojicode/1.0.2/compile @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +"$EMOJI_PATH"/emojicodec -S "$EMOJI_PATH"/packages "$1" -o "bruh.exe" +chmod +x "bruh.exe" diff --git a/packages/emojicode/1.0.2/environment b/packages/emojicode/1.0.2/environment new file mode 100644 index 0000000..4e32c1f --- /dev/null +++ b/packages/emojicode/1.0.2/environment @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +# Put 'export' statements here for environment variables +export PATH=$PWD/bin:$PATH +export EMOJI_PATH=$PWD/emoji diff --git a/packages/emojicode/1.0.2/metadata.json b/packages/emojicode/1.0.2/metadata.json new file mode 100644 index 0000000..6b2449a --- /dev/null +++ b/packages/emojicode/1.0.2/metadata.json @@ -0,0 +1,7 @@ +{ + "language": "emojicode", + "version": "1.0.2", + "aliases": [ + "emojic" + ] +} diff --git a/packages/emojicode/1.0.2/run b/packages/emojicode/1.0.2/run new file mode 100644 index 0000000..014c2c6 --- /dev/null +++ b/packages/emojicode/1.0.2/run @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +shift + +./"bruh.exe" "$@" diff --git a/packages/emojicode/1.0.2/test.emojic b/packages/emojicode/1.0.2/test.emojic new file mode 100644 index 0000000..f80f01b --- /dev/null +++ b/packages/emojicode/1.0.2/test.emojic @@ -0,0 +1,3 @@ +🏁 πŸ‡ + πŸ˜€ πŸ”€OKπŸ”€β—οΈ +πŸ‰ diff --git a/readme.md b/readme.md index cebde53..261053c 100644 --- a/readme.md +++ b/readme.md @@ -328,6 +328,7 @@ Content-Type: application/json `dragon`, `elixir`, `emacs`, +`emojicode`, `erlang`, `file`, `forte`, From 3372ca195415fa3a0b8ce443a7a6abf8047e8ac3 Mon Sep 17 00:00:00 2001 From: Omar Brikaa Date: Sat, 22 Jan 2022 18:56:33 +0200 Subject: [PATCH 02/23] checksum fail message undefined, app.use() duplicate --- api/src/index.js | 1 - api/src/package.js | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/api/src/index.js b/api/src/index.js index 025f5ae..79bca00 100644 --- a/api/src/index.js +++ b/api/src/index.js @@ -77,7 +77,6 @@ expressWs(app); const api_v2 = require('./api/v2'); app.use('/api/v2', api_v2); - app.use('/api/v2', api_v2); app.use((req, res, next) => { return res.status(404).send({ message: 'Not Found' }); diff --git a/api/src/package.js b/api/src/package.js index 4e4630f..11e4f34 100644 --- a/api/src/package.js +++ b/api/src/package.js @@ -80,7 +80,9 @@ class Package { const cs = hash.digest('hex'); if (cs !== this.checksum) { - throw new Error(`Checksum miss-match want: ${val} got: ${cs}`); + throw new Error( + `Checksum miss-match want: ${this.checksum} got: ${cs}` + ); } logger.debug( From 54cf8f6403b4c13b20e185f290449bee0956ea3d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 22 Jan 2022 19:58:40 +0000 Subject: [PATCH 03/23] build(deps): bump node-fetch from 2.6.1 to 3.1.1 in /api Bumps [node-fetch](https://github.com/node-fetch/node-fetch) from 2.6.1 to 3.1.1. - [Release notes](https://github.com/node-fetch/node-fetch/releases) - [Changelog](https://github.com/node-fetch/node-fetch/blob/main/docs/CHANGELOG.md) - [Commits](https://github.com/node-fetch/node-fetch/compare/v2.6.1...v3.1.1) --- updated-dependencies: - dependency-name: node-fetch dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- api/package-lock.json | 131 +++++++++++++++++++++++++++++++++++++++--- api/package.json | 2 +- 2 files changed, 123 insertions(+), 10 deletions(-) diff --git a/api/package-lock.json b/api/package-lock.json index 2b34fc4..7f45fe5 100644 --- a/api/package-lock.json +++ b/api/package-lock.json @@ -16,7 +16,7 @@ "is-docker": "^2.1.1", "logplease": "^1.2.15", "nocamel": "HexF/nocamel#patch-1", - "node-fetch": "^2.6.1", + "node-fetch": "^3.1.1", "semver": "^7.3.4", "uuid": "^8.3.2", "waitpid": "git+https://github.com/HexF/node-waitpid.git" @@ -107,6 +107,14 @@ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" }, + "node_modules/data-uri-to-buffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz", + "integrity": "sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA==", + "engines": { + "node": ">= 12" + } + }, "node_modules/debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -208,6 +216,28 @@ "express": "^4.0.0 || ^5.0.0-alpha.1" } }, + "node_modules/fetch-blob": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.1.4.tgz", + "integrity": "sha512-Eq5Xv5+VlSrYWEqKrusxY1C3Hm/hjeAsCGVG3ft7pZahlUAChpGZT/Ms1WmSLnEAisEXszjzu/s+ce6HZB2VHA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "paypal", + "url": "https://paypal.me/jimmywarting" + } + ], + "dependencies": { + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" + }, + "engines": { + "node": "^12.20 || >= 14.13" + } + }, "node_modules/finalhandler": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", @@ -225,6 +255,17 @@ "node": ">= 0.8" } }, + "node_modules/formdata-polyfill": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", + "dependencies": { + "fetch-blob": "^3.1.2" + }, + "engines": { + "node": ">=12.20.0" + } + }, "node_modules/forwarded": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", @@ -374,12 +415,39 @@ "node_modules/nocamel": { "resolved": "git+ssh://git@github.com/HexF/nocamel.git#89a5bfbbd07c72c302d968b967d0f4fe54846544" }, - "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==", + "node_modules/node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "github", + "url": "https://paypal.me/jimmywarting" + } + ], "engines": { - "node": "4.x || >=6.0.0" + "node": ">=10.5.0" + } + }, + "node_modules/node-fetch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.1.1.tgz", + "integrity": "sha512-SMk+vKgU77PYotRdWzqZGTZeuFKlsJ0hu4KPviQKkfY+N3vn2MIzr0rvpnYpR8MtB3IEuhlEcuOLbGvLRlA+yg==", + "dependencies": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.3", + "formdata-polyfill": "^4.0.10" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" } }, "node_modules/on-finished": { @@ -583,6 +651,14 @@ "resolved": "git+ssh://git@github.com/HexF/node-waitpid.git#a08d116a5d993a747624fe72ff890167be8c34aa", "hasInstallScript": true }, + "node_modules/web-streams-polyfill": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.0.tgz", + "integrity": "sha512-EqPmREeOzttaLRm5HS7io98goBgZ7IVz79aDvqjD0kYXLtFZTc0T/U6wHTPKyIjb+MdN7DFIIX6hgdBEpWmfPA==", + "engines": { + "node": ">= 8" + } + }, "node_modules/ws": { "version": "7.5.3", "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.3.tgz", @@ -674,6 +750,11 @@ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" }, + "data-uri-to-buffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz", + "integrity": "sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA==" + }, "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -757,6 +838,15 @@ "ws": "^7.4.6" } }, + "fetch-blob": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.1.4.tgz", + "integrity": "sha512-Eq5Xv5+VlSrYWEqKrusxY1C3Hm/hjeAsCGVG3ft7pZahlUAChpGZT/Ms1WmSLnEAisEXszjzu/s+ce6HZB2VHA==", + "requires": { + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" + } + }, "finalhandler": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", @@ -771,6 +861,14 @@ "unpipe": "~1.0.0" } }, + "formdata-polyfill": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", + "requires": { + "fetch-blob": "^3.1.2" + } + }, "forwarded": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", @@ -876,10 +974,20 @@ "version": "git+ssh://git@github.com/HexF/nocamel.git#89a5bfbbd07c72c302d968b967d0f4fe54846544", "from": "nocamel@HexF/nocamel#patch-1" }, + "node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==" + }, "node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.1.1.tgz", + "integrity": "sha512-SMk+vKgU77PYotRdWzqZGTZeuFKlsJ0hu4KPviQKkfY+N3vn2MIzr0rvpnYpR8MtB3IEuhlEcuOLbGvLRlA+yg==", + "requires": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.3", + "formdata-polyfill": "^4.0.10" + } }, "on-finished": { "version": "2.3.0", @@ -1033,6 +1141,11 @@ "version": "git+ssh://git@github.com/HexF/node-waitpid.git#a08d116a5d993a747624fe72ff890167be8c34aa", "from": "waitpid@git+https://github.com/HexF/node-waitpid.git" }, + "web-streams-polyfill": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.0.tgz", + "integrity": "sha512-EqPmREeOzttaLRm5HS7io98goBgZ7IVz79aDvqjD0kYXLtFZTc0T/U6wHTPKyIjb+MdN7DFIIX6hgdBEpWmfPA==" + }, "ws": { "version": "7.5.3", "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.3.tgz", diff --git a/api/package.json b/api/package.json index fb107a5..a6ee6e9 100644 --- a/api/package.json +++ b/api/package.json @@ -11,7 +11,7 @@ "is-docker": "^2.1.1", "logplease": "^1.2.15", "nocamel": "HexF/nocamel#patch-1", - "node-fetch": "^2.6.1", + "node-fetch": "^3.1.1", "semver": "^7.3.4", "uuid": "^8.3.2", "waitpid": "git+https://github.com/HexF/node-waitpid.git" From 37b5b02067387ca617073750420848272779db0e Mon Sep 17 00:00:00 2001 From: Omar Brikaa Date: Sun, 30 Jan 2022 14:47:06 +0200 Subject: [PATCH 04/23] Include non-ascii in cli binary checking --- cli/commands/execute.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/commands/execute.js b/cli/commands/execute.js index 0d906bc..ee468cf 100644 --- a/cli/commands/execute.js +++ b/cli/commands/execute.js @@ -246,11 +246,12 @@ async function run_non_interactively(files, argv) { exports.handler = async argv => { const files = [...(argv.files || []), argv.file].map(file_path => { const buffer = fs.readFileSync(file_path); + // Checks for οΏ½ (the replacement character) after encoding the buffer to uf8 const encoding = (buffer .toString() .split('') - .some(x => x.charCodeAt(0) >= 128) && + .some(x => x.charCodeAt(0) === 65533) && 'base64') || 'utf8'; return { From ccda7a7d26a4c635d21251e9683becaaec455d37 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Feb 2022 05:49:41 +0000 Subject: [PATCH 05/23] build(deps): bump follow-redirects from 1.14.3 to 1.14.8 in /cli Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.3 to 1.14.8. - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) - [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.3...v1.14.8) --- updated-dependencies: - dependency-name: follow-redirects dependency-type: indirect ... Signed-off-by: dependabot[bot] --- cli/package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/package-lock.json b/cli/package-lock.json index 335ed21..8dd1e31 100644 --- a/cli/package-lock.json +++ b/cli/package-lock.json @@ -116,9 +116,9 @@ } }, "node_modules/follow-redirects": { - "version": "1.14.3", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.3.tgz", - "integrity": "sha512-3MkHxknWMUtb23apkgz/83fDoe+y+qr0TdgacGIA7bew+QLBo3vdgEN2xEsuXNivpFy4CyDhBBZnNZOtalmenw==", + "version": "1.14.8", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.8.tgz", + "integrity": "sha512-1x0S9UVJHsQprFcEC/qnNzBLcIxsjAV905f/UkQxbclCsoTWlacCNOpQa/anodLl2uaEKFhfWOvM2Qg77+15zA==", "funding": [ { "type": "individual", @@ -398,9 +398,9 @@ "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" }, "follow-redirects": { - "version": "1.14.3", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.3.tgz", - "integrity": "sha512-3MkHxknWMUtb23apkgz/83fDoe+y+qr0TdgacGIA7bew+QLBo3vdgEN2xEsuXNivpFy4CyDhBBZnNZOtalmenw==" + "version": "1.14.8", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.8.tgz", + "integrity": "sha512-1x0S9UVJHsQprFcEC/qnNzBLcIxsjAV905f/UkQxbclCsoTWlacCNOpQa/anodLl2uaEKFhfWOvM2Qg77+15zA==" }, "get-caller-file": { "version": "2.0.5", From 5f8968d4bdca210ade5d1107c97cea64124eabb0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 25 Feb 2022 21:31:32 +0000 Subject: [PATCH 06/23] build(deps): bump ansi-regex from 5.0.0 to 5.0.1 in /cli Bumps [ansi-regex](https://github.com/chalk/ansi-regex) from 5.0.0 to 5.0.1. - [Release notes](https://github.com/chalk/ansi-regex/releases) - [Commits](https://github.com/chalk/ansi-regex/compare/v5.0.0...v5.0.1) --- updated-dependencies: - dependency-name: ansi-regex dependency-type: indirect ... Signed-off-by: dependabot[bot] --- cli/package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/package-lock.json b/cli/package-lock.json index 8dd1e31..3a73bbf 100644 --- a/cli/package-lock.json +++ b/cli/package-lock.json @@ -19,9 +19,9 @@ } }, "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==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "engines": { "node": ">=8" } @@ -316,9 +316,9 @@ }, "dependencies": { "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" }, "ansi-styles": { "version": "4.3.0", From 9276aa110997b5de7a545397f14c2229ef47a7dd Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Wed, 2 Mar 2022 19:20:55 +1300 Subject: [PATCH 07/23] Revert "build(deps): bump node-fetch from 2.6.1 to 3.1.1 in /api" --- api/package-lock.json | 129 +++--------------------------------------- api/package.json | 2 +- 2 files changed, 9 insertions(+), 122 deletions(-) diff --git a/api/package-lock.json b/api/package-lock.json index 7f45fe5..2b34fc4 100644 --- a/api/package-lock.json +++ b/api/package-lock.json @@ -16,7 +16,7 @@ "is-docker": "^2.1.1", "logplease": "^1.2.15", "nocamel": "HexF/nocamel#patch-1", - "node-fetch": "^3.1.1", + "node-fetch": "^2.6.1", "semver": "^7.3.4", "uuid": "^8.3.2", "waitpid": "git+https://github.com/HexF/node-waitpid.git" @@ -107,14 +107,6 @@ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" }, - "node_modules/data-uri-to-buffer": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz", - "integrity": "sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA==", - "engines": { - "node": ">= 12" - } - }, "node_modules/debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -216,28 +208,6 @@ "express": "^4.0.0 || ^5.0.0-alpha.1" } }, - "node_modules/fetch-blob": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.1.4.tgz", - "integrity": "sha512-Eq5Xv5+VlSrYWEqKrusxY1C3Hm/hjeAsCGVG3ft7pZahlUAChpGZT/Ms1WmSLnEAisEXszjzu/s+ce6HZB2VHA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/jimmywarting" - }, - { - "type": "paypal", - "url": "https://paypal.me/jimmywarting" - } - ], - "dependencies": { - "node-domexception": "^1.0.0", - "web-streams-polyfill": "^3.0.3" - }, - "engines": { - "node": "^12.20 || >= 14.13" - } - }, "node_modules/finalhandler": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", @@ -255,17 +225,6 @@ "node": ">= 0.8" } }, - "node_modules/formdata-polyfill": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", - "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", - "dependencies": { - "fetch-blob": "^3.1.2" - }, - "engines": { - "node": ">=12.20.0" - } - }, "node_modules/forwarded": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", @@ -415,39 +374,12 @@ "node_modules/nocamel": { "resolved": "git+ssh://git@github.com/HexF/nocamel.git#89a5bfbbd07c72c302d968b967d0f4fe54846544" }, - "node_modules/node-domexception": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", - "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/jimmywarting" - }, - { - "type": "github", - "url": "https://paypal.me/jimmywarting" - } - ], - "engines": { - "node": ">=10.5.0" - } - }, "node_modules/node-fetch": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.1.1.tgz", - "integrity": "sha512-SMk+vKgU77PYotRdWzqZGTZeuFKlsJ0hu4KPviQKkfY+N3vn2MIzr0rvpnYpR8MtB3IEuhlEcuOLbGvLRlA+yg==", - "dependencies": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.3", - "formdata-polyfill": "^4.0.10" - }, + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" + "node": "4.x || >=6.0.0" } }, "node_modules/on-finished": { @@ -651,14 +583,6 @@ "resolved": "git+ssh://git@github.com/HexF/node-waitpid.git#a08d116a5d993a747624fe72ff890167be8c34aa", "hasInstallScript": true }, - "node_modules/web-streams-polyfill": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.0.tgz", - "integrity": "sha512-EqPmREeOzttaLRm5HS7io98goBgZ7IVz79aDvqjD0kYXLtFZTc0T/U6wHTPKyIjb+MdN7DFIIX6hgdBEpWmfPA==", - "engines": { - "node": ">= 8" - } - }, "node_modules/ws": { "version": "7.5.3", "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.3.tgz", @@ -750,11 +674,6 @@ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" }, - "data-uri-to-buffer": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz", - "integrity": "sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA==" - }, "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -838,15 +757,6 @@ "ws": "^7.4.6" } }, - "fetch-blob": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.1.4.tgz", - "integrity": "sha512-Eq5Xv5+VlSrYWEqKrusxY1C3Hm/hjeAsCGVG3ft7pZahlUAChpGZT/Ms1WmSLnEAisEXszjzu/s+ce6HZB2VHA==", - "requires": { - "node-domexception": "^1.0.0", - "web-streams-polyfill": "^3.0.3" - } - }, "finalhandler": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", @@ -861,14 +771,6 @@ "unpipe": "~1.0.0" } }, - "formdata-polyfill": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", - "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", - "requires": { - "fetch-blob": "^3.1.2" - } - }, "forwarded": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", @@ -974,20 +876,10 @@ "version": "git+ssh://git@github.com/HexF/nocamel.git#89a5bfbbd07c72c302d968b967d0f4fe54846544", "from": "nocamel@HexF/nocamel#patch-1" }, - "node-domexception": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", - "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==" - }, "node-fetch": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.1.1.tgz", - "integrity": "sha512-SMk+vKgU77PYotRdWzqZGTZeuFKlsJ0hu4KPviQKkfY+N3vn2MIzr0rvpnYpR8MtB3IEuhlEcuOLbGvLRlA+yg==", - "requires": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.3", - "formdata-polyfill": "^4.0.10" - } + "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", @@ -1141,11 +1033,6 @@ "version": "git+ssh://git@github.com/HexF/node-waitpid.git#a08d116a5d993a747624fe72ff890167be8c34aa", "from": "waitpid@git+https://github.com/HexF/node-waitpid.git" }, - "web-streams-polyfill": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.0.tgz", - "integrity": "sha512-EqPmREeOzttaLRm5HS7io98goBgZ7IVz79aDvqjD0kYXLtFZTc0T/U6wHTPKyIjb+MdN7DFIIX6hgdBEpWmfPA==" - }, "ws": { "version": "7.5.3", "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.3.tgz", diff --git a/api/package.json b/api/package.json index a6ee6e9..fb107a5 100644 --- a/api/package.json +++ b/api/package.json @@ -11,7 +11,7 @@ "is-docker": "^2.1.1", "logplease": "^1.2.15", "nocamel": "HexF/nocamel#patch-1", - "node-fetch": "^3.1.1", + "node-fetch": "^2.6.1", "semver": "^7.3.4", "uuid": "^8.3.2", "waitpid": "git+https://github.com/HexF/node-waitpid.git" From 0ab66f4f5f25eb65a7ff606527a0d81f28e9eb8d Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Wed, 27 Apr 2022 02:51:10 +1200 Subject: [PATCH 08/23] Cleanup all zombie processes Prevents process table exhaustion --- api/src/job.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/api/src/job.js b/api/src/job.js index eef2ffd..0fc24a1 100644 --- a/api/src/job.js +++ b/api/src/job.js @@ -336,14 +336,20 @@ class Job { const [_, ruid, euid, suid, fuid] = uid_line.split(/\s+/); const [_1, state, user_friendly] = state_line.split(/\s+/); + + const proc_id_int = parse_int(proc_id); - if (state == 'Z') - // Zombie process, just needs to be waited + if (state == 'Z'){ + // Zombie process, just needs to be waited, regardless of the user id + if(!to_wait.includes(proc_id_int)) + to_wait.push(proc_id_int); + return -1; + } // We should kill in all other state (Sleep, Stopped & Running) if (ruid == this.uid || euid == this.uid) - return parse_int(proc_id); + return proc_id_int; } catch { return -1; } From 81e315609dd2631da8cc1cbbc15fd7e01076cb21 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Wed, 27 Apr 2022 03:05:29 +1200 Subject: [PATCH 09/23] Use `timeout` as fallback for killing process --- api/src/job.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/api/src/job.js b/api/src/job.js index 0fc24a1..d561036 100644 --- a/api/src/job.js +++ b/api/src/job.js @@ -120,13 +120,18 @@ class Job { '--nofile=' + this.runtime.max_open_files, '--fsize=' + this.runtime.max_file_size, ]; + + const timeout_call = [ + 'timeout', '-s', '9', Math.ceil(timeout / 1000), + ]; if (memory_limit >= 0) { prlimit.push('--as=' + memory_limit); } - const proc_call = [ + const proc_call = [ 'nice', + ...timeout_call, ...prlimit, ...nonetwork, 'bash', From 86ff6b74a733811483add00c67507c77b6acc8ba Mon Sep 17 00:00:00 2001 From: Hydrazer Date: Wed, 1 Jun 2022 16:52:35 -0600 Subject: [PATCH 10/23] sqlite3 add argv compitibility --- packages/sqlite3/3.36.0/run | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/sqlite3/3.36.0/run b/packages/sqlite3/3.36.0/run index 8484f3d..3aff0c1 100644 --- a/packages/sqlite3/3.36.0/run +++ b/packages/sqlite3/3.36.0/run @@ -1,3 +1,19 @@ #!/bin/bash -sqlite3 < "$1" +code=`cat "$1"` + +shift + +argv_text="" + +for arg in "$@" +do + argv_text+='insert into argv (arg) values ("'"`echo "$arg" | sed 's/"/""/g'`"'"); +' +done + + +sqlite3 <<< "create table argv (arg text); +$argv_text +$code" + From ea1a9415972e844a5c53b28813a87090c5f05a91 Mon Sep 17 00:00:00 2001 From: Hydrazer Date: Sun, 29 May 2022 18:27:55 -0600 Subject: [PATCH 11/23] pkg(forth-0.7.3): added forth --- packages/forth/0.7.3/build.sh | 12 ++++++++++++ packages/forth/0.7.3/environment | 5 +++++ packages/forth/0.7.3/metadata.json | 7 +++++++ packages/forth/0.7.3/run | 4 ++++ packages/forth/0.7.3/test.forth | 1 + readme.md | 1 + 6 files changed, 30 insertions(+) create mode 100644 packages/forth/0.7.3/build.sh create mode 100644 packages/forth/0.7.3/environment create mode 100644 packages/forth/0.7.3/metadata.json create mode 100644 packages/forth/0.7.3/run create mode 100644 packages/forth/0.7.3/test.forth diff --git a/packages/forth/0.7.3/build.sh b/packages/forth/0.7.3/build.sh new file mode 100644 index 0000000..81c2182 --- /dev/null +++ b/packages/forth/0.7.3/build.sh @@ -0,0 +1,12 @@ +curl -L https://ftp.gnu.org/gnu/gforth/gforth-0.7.3.tar.gz -o forth.tar.gz +tar xzf forth.tar.gz +rm forth.tar.gz + +cd gforth-0.7.3/ +./BUILD-FROM-SCRATCH --host=x86_64 --build=x86_64 + +make +make install + +chmod +x ./gforth +cd .. diff --git a/packages/forth/0.7.3/environment b/packages/forth/0.7.3/environment new file mode 100644 index 0000000..10092be --- /dev/null +++ b/packages/forth/0.7.3/environment @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +# Put 'export' statements here for environment variables +export PATH=$PWD/bin:$PATH +export FORTH_PATH=$PWD/gforth-0.7.3 diff --git a/packages/forth/0.7.3/metadata.json b/packages/forth/0.7.3/metadata.json new file mode 100644 index 0000000..cd23825 --- /dev/null +++ b/packages/forth/0.7.3/metadata.json @@ -0,0 +1,7 @@ +{ + "language": "forth", + "version": "0.7.3", + "aliases": [ + "gforth" + ] +} diff --git a/packages/forth/0.7.3/run b/packages/forth/0.7.3/run new file mode 100644 index 0000000..5556ca3 --- /dev/null +++ b/packages/forth/0.7.3/run @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +$FORTH_PATH/gforth "$@" + diff --git a/packages/forth/0.7.3/test.forth b/packages/forth/0.7.3/test.forth new file mode 100644 index 0000000..c50ef0b --- /dev/null +++ b/packages/forth/0.7.3/test.forth @@ -0,0 +1 @@ +.( OK) bye diff --git a/readme.md b/readme.md index 261053c..5c6ab68 100644 --- a/readme.md +++ b/readme.md @@ -332,6 +332,7 @@ Content-Type: application/json `erlang`, `file`, `forte`, +`forth`, `fortran`, `freebasic`, `fsharp.net`, From 61f5e8c6fea47560493ecea1a49a7367590edd93 Mon Sep 17 00:00:00 2001 From: Hydrazer Date: Tue, 31 May 2022 07:39:03 -0600 Subject: [PATCH 12/23] pkg(smalltalk-3.2.3): add smalltalk --- packages/smalltalk/3.2.3/build.sh | 19 +++++++++++++++++++ packages/smalltalk/3.2.3/environment | 5 +++++ packages/smalltalk/3.2.3/metadata.json | 5 +++++ packages/smalltalk/3.2.3/run | 8 ++++++++ packages/smalltalk/3.2.3/test.st | 1 + readme.md | 1 + repo/Dockerfile | 2 +- 7 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 packages/smalltalk/3.2.3/build.sh create mode 100644 packages/smalltalk/3.2.3/environment create mode 100644 packages/smalltalk/3.2.3/metadata.json create mode 100644 packages/smalltalk/3.2.3/run create mode 100644 packages/smalltalk/3.2.3/test.st diff --git a/packages/smalltalk/3.2.3/build.sh b/packages/smalltalk/3.2.3/build.sh new file mode 100644 index 0000000..5f2290e --- /dev/null +++ b/packages/smalltalk/3.2.3/build.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +set -e + +curl -L https://ftp.gnu.org/gnu/smalltalk/smalltalk-3.2.3.tar.gz -o smalltalk-3.2.3.tar.gz +tar xzf smalltalk-3.2.3.tar.gz + +rm smalltalk-3.2.3.tar.gz + +cd smalltalk-3.2.3 + +./configure +rm libc.la + +make +make install + +chmod +x gst +cd .. diff --git a/packages/smalltalk/3.2.3/environment b/packages/smalltalk/3.2.3/environment new file mode 100644 index 0000000..df2907d --- /dev/null +++ b/packages/smalltalk/3.2.3/environment @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +# Put 'export' statements here for environment variables +export PATH=$PWD/bin:$PATH +export SMALLTALK_PATH=$PWD/smalltalk-3.2.3 diff --git a/packages/smalltalk/3.2.3/metadata.json b/packages/smalltalk/3.2.3/metadata.json new file mode 100644 index 0000000..accb078 --- /dev/null +++ b/packages/smalltalk/3.2.3/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "smalltalk", + "version": "3.2.3", + "aliases": ["st"] +} diff --git a/packages/smalltalk/3.2.3/run b/packages/smalltalk/3.2.3/run new file mode 100644 index 0000000..7553905 --- /dev/null +++ b/packages/smalltalk/3.2.3/run @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +code_file=`pwd`/"$1" +shift + +cd $SMALLTALK_PATH +$SMALLTALK_PATH/gst "$code_file" "$@" + diff --git a/packages/smalltalk/3.2.3/test.st b/packages/smalltalk/3.2.3/test.st new file mode 100644 index 0000000..d7b2d24 --- /dev/null +++ b/packages/smalltalk/3.2.3/test.st @@ -0,0 +1 @@ +'OK' display diff --git a/readme.md b/readme.md index 261053c..06afe11 100644 --- a/readme.md +++ b/readme.md @@ -378,6 +378,7 @@ Content-Type: application/json `ruby`, `rust`, `scala`, +`smalltalk`, `sqlite3`, `swift`, `typescript`, diff --git a/repo/Dockerfile b/repo/Dockerfile index de28c11..fe61a6f 100644 --- a/repo/Dockerfile +++ b/repo/Dockerfile @@ -9,7 +9,7 @@ RUN apt-get update && apt-get install -y unzip autoconf build-essential libssl-d libncursesw5-dev python3-pip libgmp-dev libmpfr-dev python2 libffi-dev gfortran\ libreadline-dev libblas-dev liblapack-dev libpcre3-dev libarpack2-dev libfftw3-dev \ libglpk-dev libqhull-dev libqrupdate-dev libsuitesparse-dev libsundials-dev \ - libbz2-dev liblzma-dev libpcre2-dev gperf bison flex g++ && \ + libbz2-dev liblzma-dev libpcre2-dev gperf bison flex g++ gawk zip && \ ln -sf /bin/bash /bin/sh && \ rm -rf /var/lib/apt/lists/* && \ update-alternatives --install /usr/bin/python python /usr/bin/python3.7 2 From c355abc4a7face113855e1b0435749b00b29fdd6 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sun, 12 Jun 2022 16:19:02 +1200 Subject: [PATCH 13/23] Fix #487 Permissions on the jobs directory allowed anyone to write into the directory - this commit simply allows only the `node` user to `rwx` on the jobs directory. --- docker-compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 8888f53..83a1383 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -10,5 +10,5 @@ services: volumes: - ./data/piston:/piston tmpfs: - - /piston/jobs:exec + - /piston/jobs:exec,uid=1000,gid=1000,mode=700 - /tmp:exec From 91bd30f59e22f16dec124715c4968a7f16d6e3c5 Mon Sep 17 00:00:00 2001 From: Hydrazer Date: Sun, 12 Jun 2022 08:32:06 -0600 Subject: [PATCH 14/23] smalltalk fix argv --- packages/smalltalk/3.2.3/run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/smalltalk/3.2.3/run b/packages/smalltalk/3.2.3/run index 7553905..a1ac6fa 100644 --- a/packages/smalltalk/3.2.3/run +++ b/packages/smalltalk/3.2.3/run @@ -4,5 +4,5 @@ code_file=`pwd`/"$1" shift cd $SMALLTALK_PATH -$SMALLTALK_PATH/gst "$code_file" "$@" +$SMALLTALK_PATH/gst "$code_file" -a "$@" From 0ea073f6d26cff8a16cd7cb8e25e132661e23c63 Mon Sep 17 00:00:00 2001 From: Omar Brikaa Date: Thu, 30 Jun 2022 13:11:17 +0200 Subject: [PATCH 15/23] Add tmpfs parameters in docker-compose dev --- docker-compose.dev.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.dev.yaml b/docker-compose.dev.yaml index 25d8fe6..75cbd2d 100644 --- a/docker-compose.dev.yaml +++ b/docker-compose.dev.yaml @@ -14,7 +14,7 @@ services: environment: - PISTON_REPO_URL=http://repo:8000/index tmpfs: - - /piston/jobs:exec + - /piston/jobs:exec,uid=1000,gid=1000,mode=700 repo: # Local testing of packages build: repo From 0e5d3b56a11a8a830488d8af8520e30446fd2cb5 Mon Sep 17 00:00:00 2001 From: Omar Brikaa Date: Thu, 30 Jun 2022 13:18:50 +0200 Subject: [PATCH 16/23] Get rid of pre-commit since it does not account for hunks --- piston | 9 --------- 1 file changed, 9 deletions(-) diff --git a/piston b/piston index fbd256d..fd83727 100755 --- a/piston +++ b/piston @@ -14,13 +14,6 @@ docker_compose(){ fi } -init_precommit() { - if [ $PISTON_ENV == "dev" ]; then - rm -f .git/hooks/pre-commit - ln -s "$PISTON_PATH/pre-commit" "$PISTON_PATH/.git/hooks/pre-commit" - fi -} - case $1 in help) echo "=== Piston Management ===" @@ -66,14 +59,12 @@ case $1 in restart) docker_compose restart ;; start) - init_precommit docker_compose up -d ;; stop) docker_compose down ;; bash) docker_compose exec api /bin/bash ;; rebuild) - init_precommit docker_compose build && docker_compose up -d ;; From 5526071f00fcaacf78dbd7db5bd93d6c92f45e16 Mon Sep 17 00:00:00 2001 From: Omar Brikaa Date: Thu, 30 Jun 2022 13:19:44 +0200 Subject: [PATCH 17/23] Set jobs permissions on startup --- api/src/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/api/src/index.js b/api/src/index.js index 79bca00..2870902 100644 --- a/api/src/index.js +++ b/api/src/index.js @@ -35,6 +35,7 @@ expressWs(app); } } }); + fss.chmodSync(path.join(config.data_directory, globals.data_directories.jobs), 0o711) logger.info('Loading packages'); const pkgdir = path.join( From 07ec6b3f78d72430fbfcd224e01bbb28a8ed2eb8 Mon Sep 17 00:00:00 2001 From: Omar Brikaa Date: Thu, 30 Jun 2022 13:31:17 +0200 Subject: [PATCH 18/23] Don't include the tmpfs in the docker volume --- docker-compose.dev.yaml | 2 +- docker-compose.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.dev.yaml b/docker-compose.dev.yaml index 75cbd2d..579b632 100644 --- a/docker-compose.dev.yaml +++ b/docker-compose.dev.yaml @@ -10,7 +10,7 @@ services: ports: - 2000:2000 volumes: - - ./data/piston:/piston + - ./data/piston/packages:/piston/packages environment: - PISTON_REPO_URL=http://repo:8000/index tmpfs: diff --git a/docker-compose.yaml b/docker-compose.yaml index 83a1383..74d5f87 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -8,7 +8,7 @@ services: ports: - 2000:2000 volumes: - - ./data/piston:/piston + - ./data/piston/packages:/piston/packages tmpfs: - /piston/jobs:exec,uid=1000,gid=1000,mode=700 - /tmp:exec From e1a1be7e4cf1ad48444b6c87eb214dc6fdc76eb9 Mon Sep 17 00:00:00 2001 From: Omar Brikaa Date: Thu, 30 Jun 2022 13:35:35 +0200 Subject: [PATCH 19/23] Permission mode 711 --- docker-compose.dev.yaml | 2 +- docker-compose.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.dev.yaml b/docker-compose.dev.yaml index 579b632..8a0d385 100644 --- a/docker-compose.dev.yaml +++ b/docker-compose.dev.yaml @@ -14,7 +14,7 @@ services: environment: - PISTON_REPO_URL=http://repo:8000/index tmpfs: - - /piston/jobs:exec,uid=1000,gid=1000,mode=700 + - /piston/jobs:exec,uid=1000,gid=1000,mode=711 repo: # Local testing of packages build: repo diff --git a/docker-compose.yaml b/docker-compose.yaml index 74d5f87..839b340 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -10,5 +10,5 @@ services: volumes: - ./data/piston/packages:/piston/packages tmpfs: - - /piston/jobs:exec,uid=1000,gid=1000,mode=700 + - /piston/jobs:exec,uid=1000,gid=1000,mode=711 - /tmp:exec From 43a1242bbfbdee72d27ae81edea073a1f138a869 Mon Sep 17 00:00:00 2001 From: Jonxslays <51417989+Jonxslays@users.noreply.github.com> Date: Fri, 1 Jul 2022 06:11:29 -0700 Subject: [PATCH 20/23] Add piston_rspy to the readme --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index a65ec87..6dc36f7 100644 --- a/readme.md +++ b/readme.md @@ -71,6 +71,7 @@ The following are approved and endorsed extensions/utilities to the core Piston - [Pyston](https://github.com/ffaanngg/pyston), a Python wrapper for accessing the Piston API. - [Go-Piston](https://github.com/milindmadhukar/go-piston), a Golang wrapper for accessing the Piston API. - [piston_rs](https://github.com/Jonxslays/piston_rs), a Rust wrapper for accessing the Piston API. +- [piston_rspy](https://github.com/Jonxslays/piston_rspy), Python bindings for accessing the Piston API via `piston_rs`.
From 0c0be54505f5acd67eb854d82ef314df76488405 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Sat, 2 Jul 2022 01:46:44 +1200 Subject: [PATCH 21/23] Fix #495 --- api/src/job.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api/src/job.js b/api/src/job.js index d561036..2150279 100644 --- a/api/src/job.js +++ b/api/src/job.js @@ -343,6 +343,9 @@ class Job { const [_1, state, user_friendly] = state_line.split(/\s+/); const proc_id_int = parse_int(proc_id); + + // Skip over any processes that aren't ours. + if(ruid != this.uid && euid != this.uid) return -1; if (state == 'Z'){ // Zombie process, just needs to be waited, regardless of the user id @@ -353,8 +356,7 @@ class Job { } // We should kill in all other state (Sleep, Stopped & Running) - if (ruid == this.uid || euid == this.uid) - return proc_id_int; + return proc_id_int; } catch { return -1; } From 53e04c228df530a2d41fa83c130bac5d288c1748 Mon Sep 17 00:00:00 2001 From: Gerry Agbobada Date: Sun, 17 Jul 2022 02:40:50 +0200 Subject: [PATCH 22/23] pkg(rust-1.62.0): Added rust 1.62.0 Following template from #393 to bump the rust toolchain to the latest stable --- packages/rust/1.62.0/build.sh | 5 +++++ packages/rust/1.62.0/compile | 6 ++++++ packages/rust/1.62.0/environment | 5 +++++ packages/rust/1.62.0/metadata.json | 7 +++++++ packages/rust/1.62.0/run | 4 ++++ packages/rust/1.62.0/test.rs | 3 +++ 6 files changed, 30 insertions(+) create mode 100755 packages/rust/1.62.0/build.sh create mode 100755 packages/rust/1.62.0/compile create mode 100755 packages/rust/1.62.0/environment create mode 100644 packages/rust/1.62.0/metadata.json create mode 100755 packages/rust/1.62.0/run create mode 100644 packages/rust/1.62.0/test.rs diff --git a/packages/rust/1.62.0/build.sh b/packages/rust/1.62.0/build.sh new file mode 100755 index 0000000..d46fee0 --- /dev/null +++ b/packages/rust/1.62.0/build.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +curl -OL "https://static.rust-lang.org/dist/rust-1.62.0-x86_64-unknown-linux-gnu.tar.gz" +tar xzvf rust-1.62.0-x86_64-unknown-linux-gnu.tar.gz +rm rust-1.62.0-x86_64-unknown-linux-gnu.tar.gz diff --git a/packages/rust/1.62.0/compile b/packages/rust/1.62.0/compile new file mode 100755 index 0000000..201318a --- /dev/null +++ b/packages/rust/1.62.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.62.0/environment b/packages/rust/1.62.0/environment new file mode 100755 index 0000000..2bf6cf5 --- /dev/null +++ b/packages/rust/1.62.0/environment @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +# Put 'export' statements here for environment variables +export PATH=$PWD/rust-1.62.0-x86_64-unknown-linux-gnu/rustc/bin/:$PATH +export RUST_INSTALL_LOC=$PWD/rust-1.62.0-x86_64-unknown-linux-gnu diff --git a/packages/rust/1.62.0/metadata.json b/packages/rust/1.62.0/metadata.json new file mode 100644 index 0000000..1f7319a --- /dev/null +++ b/packages/rust/1.62.0/metadata.json @@ -0,0 +1,7 @@ +{ + "language": "rust", + "version": "1.56.1", + "aliases": [ + "rs" + ] +} diff --git a/packages/rust/1.62.0/run b/packages/rust/1.62.0/run new file mode 100755 index 0000000..d377dd9 --- /dev/null +++ b/packages/rust/1.62.0/run @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +shift +./binary "$@" diff --git a/packages/rust/1.62.0/test.rs b/packages/rust/1.62.0/test.rs new file mode 100644 index 0000000..9561664 --- /dev/null +++ b/packages/rust/1.62.0/test.rs @@ -0,0 +1,3 @@ +fn main() { + println!("OK"); +} From 0e8231ef017f360113dbdad0834c173383cc0304 Mon Sep 17 00:00:00 2001 From: Hydrazer Date: Thu, 28 Jul 2022 20:39:45 -0600 Subject: [PATCH 23/23] pkg(bqn-1.0.0): Added bqn 1.0.0 --- packages/bqn/1.0.0/build.sh | 9 +++++++++ packages/bqn/1.0.0/environment | 5 +++++ packages/bqn/1.0.0/metadata.json | 5 +++++ packages/bqn/1.0.0/run | 3 +++ packages/bqn/1.0.0/test.bqn | 1 + readme.md | 1 + 6 files changed, 24 insertions(+) create mode 100644 packages/bqn/1.0.0/build.sh create mode 100644 packages/bqn/1.0.0/environment create mode 100644 packages/bqn/1.0.0/metadata.json create mode 100644 packages/bqn/1.0.0/run create mode 100644 packages/bqn/1.0.0/test.bqn diff --git a/packages/bqn/1.0.0/build.sh b/packages/bqn/1.0.0/build.sh new file mode 100644 index 0000000..3ffe3e6 --- /dev/null +++ b/packages/bqn/1.0.0/build.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +set -e + +git clone "https://github.com/dzaima/CBQN" bqn +cd bqn + +git checkout 88f65850fa6ac28bc50886c5942652f21d5be924 +make CC=gcc diff --git a/packages/bqn/1.0.0/environment b/packages/bqn/1.0.0/environment new file mode 100644 index 0000000..4844e9a --- /dev/null +++ b/packages/bqn/1.0.0/environment @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +# Python and Vyxal path +export PATH=$PWD/bin:$PATH +export BQN_PATH=$PWD/bqn diff --git a/packages/bqn/1.0.0/metadata.json b/packages/bqn/1.0.0/metadata.json new file mode 100644 index 0000000..58623c7 --- /dev/null +++ b/packages/bqn/1.0.0/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "bqn", + "version": "1.0.0", + "aliases": [] +} diff --git a/packages/bqn/1.0.0/run b/packages/bqn/1.0.0/run new file mode 100644 index 0000000..558f00a --- /dev/null +++ b/packages/bqn/1.0.0/run @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +$BQN_PATH/BQN "$@" diff --git a/packages/bqn/1.0.0/test.bqn b/packages/bqn/1.0.0/test.bqn new file mode 100644 index 0000000..ad90468 --- /dev/null +++ b/packages/bqn/1.0.0/test.bqn @@ -0,0 +1 @@ +β€’Out @⊸+∘(+⟜(2βŠΈΓ—)´∘⌽¨)∘(-⟜'0') "01001111"β€Ώ"01001011" diff --git a/readme.md b/readme.md index 6dc36f7..1135e90 100644 --- a/readme.md +++ b/readme.md @@ -313,6 +313,7 @@ Content-Type: application/json `befunge93`, `brachylog`, `brainfuck`, +`bqn`, `c`, `c++`, `cjam`,