Compare commits

...

46 commits

Author SHA1 Message Date
Thomas Hobson
b98b208d0d
Merge pull request #498 from Brikaa/merge-master
Merge master into nix-packages and fix conflicts
2022-08-15 08:07:21 +12:00
Omar Brikaa
106297dc44 Merge branch 'master' into nix-packages 2022-08-14 13:26:39 +02:00
Thomas Hobson
1639bb90b3
Merge pull request #506 from Hydrazer/bqn
pkg(bqn-1.0.0): Added bqn 1.0.0
2022-07-29 16:40:34 +12:00
Hydrazer
0e8231ef01 pkg(bqn-1.0.0): Added bqn 1.0.0 2022-07-28 20:44:31 -06:00
Thomas Hobson
7c3db7d7fe
Merge pull request #503 from gagbo/pkg/rust_1.62
pkg(rust-1.62.0): Added rust 1.62.0
2022-07-17 21:39:19 +12:00
Gerry Agbobada
53e04c228d
pkg(rust-1.62.0): Added rust 1.62.0
Following template from #393 to bump the rust toolchain to the latest
stable
2022-07-17 02:40:50 +02:00
Omar Brikaa
12fec39897 Merge master into nix-packages and fix conflicts 2022-07-03 11:39:54 +02:00
Thomas Hobson
0c0be54505
Fix #495 2022-07-02 01:46:44 +12:00
Thomas Hobson
9d53703a66
Merge pull request #489 from Hydrazer/smalltalk
smalltalk fix argv
2022-07-02 01:26:27 +12:00
Thomas Hobson
8dacccd060
Merge pull request #496 from Brikaa/fix-jobs-permissions
Fix jobs permissions
2022-07-02 01:25:01 +12:00
Thomas Hobson
e021dab847
Merge pull request #497 from Jonxslays/task/piston_rspy
Add piston_rspy to the readme
2022-07-02 01:22:58 +12:00
Jonxslays
43a1242bbf
Add piston_rspy to the readme 2022-07-01 06:11:29 -07:00
Omar Brikaa
e1a1be7e4c Permission mode 711 2022-06-30 13:35:35 +02:00
Omar Brikaa
07ec6b3f78 Don't include the tmpfs in the docker volume 2022-06-30 13:31:17 +02:00
Omar Brikaa
5526071f00 Set jobs permissions on startup 2022-06-30 13:19:44 +02:00
Omar Brikaa
0e5d3b56a1 Get rid of pre-commit since it does not account for hunks 2022-06-30 13:18:50 +02:00
Omar Brikaa
0ea073f6d2 Add tmpfs parameters in docker-compose dev 2022-06-30 13:17:15 +02:00
Hydrazer
91bd30f59e smalltalk fix argv 2022-06-12 08:32:06 -06:00
Thomas Hobson
c355abc4a7
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.
2022-06-12 16:19:02 +12:00
Thomas Hobson
80f033ee6d
Merge pull request #484 from Hydrazer/smalltalk
pkg(smalltalk-3.2.3): add smalltalk
2022-06-05 15:15:31 +12:00
Thomas Hobson
c2f6584040
Merge branch 'master' into smalltalk 2022-06-05 15:07:52 +12:00
Hydrazer
61f5e8c6fe pkg(smalltalk-3.2.3): add smalltalk 2022-06-04 07:10:41 -06:00
Thomas Hobson
e4b77a34ea
Merge pull request #481 from Hydrazer/forth
pkg(forth-0.7.3): added forth
2022-06-03 12:29:11 +12:00
Thomas Hobson
1d6bbe3ea9
Merge branch 'master' into forth 2022-06-03 12:22:00 +12:00
Hydrazer
ea1a941597 pkg(forth-0.7.3): added forth 2022-06-02 17:33:50 -06:00
Thomas Hobson
4614c43573
Merge pull request #482 from Hydrazer/sql
sqlite3 add argv compitibility
2022-06-02 17:15:56 +12:00
Hydrazer
86ff6b74a7 sqlite3 add argv compitibility 2022-06-01 16:52:35 -06:00
Thomas Hobson
81e315609d
Use timeout as fallback for killing process 2022-04-27 03:05:29 +12:00
Thomas Hobson
0ab66f4f5f
Cleanup all zombie processes
Prevents process table exhaustion
2022-04-27 02:51:10 +12:00
Thomas Hobson
37e83c9813
Merge pull request #453 from engineer-man/revert-426-dependabot/npm_and_yarn/api/node-fetch-3.1.1
Revert "build(deps): bump node-fetch from 2.6.1 to 3.1.1 in /api"
2022-03-02 19:22:33 +13:00
Thomas Hobson
9276aa1109
Revert "build(deps): bump node-fetch from 2.6.1 to 3.1.1 in /api" 2022-03-02 19:20:55 +13:00
Thomas Hobson
c0e9c5f578
Merge pull request #452 from engineer-man/dependabot/npm_and_yarn/cli/ansi-regex-5.0.1
build(deps): bump ansi-regex from 5.0.0 to 5.0.1 in /cli
2022-02-26 10:55:43 +13:00
dependabot[bot]
5f8968d4bd
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] <support@github.com>
2022-02-25 21:31:32 +00:00
Thomas Hobson
c3678b9bce
Merge pull request #426 from engineer-man/dependabot/npm_and_yarn/api/node-fetch-3.1.1
build(deps): bump node-fetch from 2.6.1 to 3.1.1 in /api
2022-02-26 10:22:36 +13:00
Thomas Hobson
eb2808c171
Merge pull request #443 from engineer-man/dependabot/npm_and_yarn/cli/follow-redirects-1.14.8
build(deps): bump follow-redirects from 1.14.3 to 1.14.8 in /cli
2022-02-26 10:22:18 +13:00
Thomas Hobson
f113a18cef
Merge pull request #425 from Brikaa/checksum-app-use
checksum fail message undefined, app.use() duplicate
2022-02-26 10:20:55 +13:00
Thomas Hobson
d036ff1e91
Merge pull request #424 from Hydrazer/emojicode
pkg(emojicode-1.0.2): added emojicode 1.0.2
2022-02-24 20:43:38 +13:00
Thomas Hobson
3eff371bd4
Merge branch 'master' into emojicode 2022-02-24 19:18:08 +13:00
Thomas Hobson
1b76bd8d1d
Merge pull request #430 from Brikaa/base64
Include non-ascii in CLI binary checking
2022-02-24 18:54:48 +13:00
Thomas Hobson
cbd781c834
Merge branch 'master' into base64 2022-02-24 18:27:36 +13:00
dependabot[bot]
ccda7a7d26
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] <support@github.com>
2022-02-14 05:49:41 +00:00
Thomas Hobson
34d9b34480
Merge pull request #429 from Brikaa/refactor-config
config.js: index by key, bug fix and more refactoring
2022-02-07 15:39:43 +13:00
Omar Brikaa
37b5b02067 Include non-ascii in cli binary checking 2022-01-30 14:49:38 +02:00
dependabot[bot]
54cf8f6403
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] <support@github.com>
2022-01-22 19:58:40 +00:00
Omar Brikaa
3372ca1954 checksum fail message undefined, app.use() duplicate 2022-01-22 18:56:33 +02:00
Hydrazer
440559f7b4 pkg(emojicode-1.0.2): added emojicode 1.0.2 2022-01-17 18:05:17 -07:00
33 changed files with 214 additions and 17 deletions

View file

@ -35,6 +35,7 @@ expressWs(app);
}
}
});
fss.chmodSync(path.join(config.data_directory, globals.data_directories.jobs), 0o711)
logger.info('Loading packages');

View file

@ -152,12 +152,17 @@ class Job {
'--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 = [
'nice',
...timeout_call,
...prlimit,
...nonetwork,
'bash',
@ -362,13 +367,21 @@ class Job {
const [_1, state, user_friendly] = state_line.split(/\s+/);
if (state == 'Z')
// Zombie process, just needs to be waited
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
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;
}

View file

@ -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 <20> (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 {

24
cli/package-lock.json generated
View file

@ -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"
}
@ -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",
@ -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",
@ -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",

9
packages/bqn/1.0.0/build.sh vendored Normal file
View file

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

5
packages/bqn/1.0.0/environment vendored Normal file
View file

@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Python and Vyxal path
export PATH=$PWD/bin:$PATH
export BQN_PATH=$PWD/bqn

5
packages/bqn/1.0.0/metadata.json vendored Normal file
View file

@ -0,0 +1,5 @@
{
"language": "bqn",
"version": "1.0.0",
"aliases": []
}

3
packages/bqn/1.0.0/run vendored Normal file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env bash
$BQN_PATH/BQN "$@"

1
packages/bqn/1.0.0/test.bqn vendored Normal file
View file

@ -0,0 +1 @@
•Out @+(+(2×)´¨)(-'0') "01001111""01001011"

15
packages/emojicode/1.0.2/build.sh vendored Normal file
View file

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

4
packages/emojicode/1.0.2/compile vendored Normal file
View file

@ -0,0 +1,4 @@
#!/usr/bin/env bash
"$EMOJI_PATH"/emojicodec -S "$EMOJI_PATH"/packages "$1" -o "bruh.exe"
chmod +x "bruh.exe"

5
packages/emojicode/1.0.2/environment vendored Normal file
View file

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

View file

@ -0,0 +1,7 @@
{
"language": "emojicode",
"version": "1.0.2",
"aliases": [
"emojic"
]
}

5
packages/emojicode/1.0.2/run vendored Normal file
View file

@ -0,0 +1,5 @@
#!/usr/bin/env bash
shift
./"bruh.exe" "$@"

3
packages/emojicode/1.0.2/test.emojic vendored Normal file
View file

@ -0,0 +1,3 @@
🏁 🍇
😀 🔤OK🔤❗
🍉

12
packages/forth/0.7.3/build.sh vendored Normal file
View file

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

5
packages/forth/0.7.3/environment vendored Normal file
View file

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

7
packages/forth/0.7.3/metadata.json vendored Normal file
View file

@ -0,0 +1,7 @@
{
"language": "forth",
"version": "0.7.3",
"aliases": [
"gforth"
]
}

4
packages/forth/0.7.3/run vendored Normal file
View file

@ -0,0 +1,4 @@
#!/usr/bin/env bash
$FORTH_PATH/gforth "$@"

1
packages/forth/0.7.3/test.forth vendored Normal file
View file

@ -0,0 +1 @@
.( OK) bye

5
packages/rust/1.62.0/build.sh vendored Executable file
View file

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

6
packages/rust/1.62.0/compile vendored Executable file
View file

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

5
packages/rust/1.62.0/environment vendored Executable file
View file

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

7
packages/rust/1.62.0/metadata.json vendored Normal file
View file

@ -0,0 +1,7 @@
{
"language": "rust",
"version": "1.56.1",
"aliases": [
"rs"
]
}

4
packages/rust/1.62.0/run vendored Executable file
View file

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

3
packages/rust/1.62.0/test.rs vendored Normal file
View file

@ -0,0 +1,3 @@
fn main() {
println!("OK");
}

19
packages/smalltalk/3.2.3/build.sh vendored Normal file
View file

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

5
packages/smalltalk/3.2.3/environment vendored Normal file
View file

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

View file

@ -0,0 +1,5 @@
{
"language": "smalltalk",
"version": "3.2.3",
"aliases": ["st"]
}

8
packages/smalltalk/3.2.3/run vendored Normal file
View file

@ -0,0 +1,8 @@
#!/usr/bin/env bash
code_file=`pwd`/"$1"
shift
cd $SMALLTALK_PATH
$SMALLTALK_PATH/gst "$code_file" -a "$@"

1
packages/smalltalk/3.2.3/test.st vendored Normal file
View file

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

19
packages/sqlite3/3.36.0/run vendored Normal file
View file

@ -0,0 +1,19 @@
#!/bin/bash
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"

View file

@ -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`.
<br>
@ -311,6 +312,7 @@ Content-Type: application/json
`befunge93`,
`brachylog`,
`brainfuck`,
`bqn`,
`c`,
`c++`,
`cjam`,
@ -327,6 +329,7 @@ Content-Type: application/json
`dragon`,
`elixir`,
`emacs`,
`emojicode`,
`erlang`,
`file`,
`forte`,
@ -378,6 +381,7 @@ Content-Type: application/json
`ruby`,
`rust`,
`scala`,
`smalltalk`,
`sqlite3`,
`swift`,
`typescript`,