Commit Graph

265 Commits

Author SHA1 Message Date
Omar Brikaa 416ade1b76 Refactor config.js 2022-01-28 17:58:00 +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
Thomas Hobson 142e7912fa
api(config): respect $PORT as used by heroku if no explicit bind address provided 2021-11-26 02:32:28 +13:00
Thomas Hobson c091c117c7
api(job): Decrease safe_call CPU time
By increasing the niceness value of child processes, the scheduler gives less CPU Time to them.
This allows the node process to get more CPU time, and can work through the event queue faster.
2021-11-11 21:34:30 +13:00
Thomas Hobson c7efa5372a
api(job): Switch process cleanup to sync
The system used to use async.
This would result in execution is handed off to other processes.
In the case of a forkbomb was used, it could circumvent the janitor as it consumed more CPU time which would prevent the process janitor from reading the process information in.
2021-11-11 19:27:54 +13:00
Brikaa 19252467cb Use some() instead of filter() in v2.js 2021-10-16 11:50:07 +02:00
Brikaa 64833a0408 pkg(file-0.0.1): Run executable 2021-10-16 11:49:59 +02:00
Brikaa 6ca9606f81 Adhere to project let, const practices in my code 2021-10-16 11:01:17 +02:00
Thomas Hobson 7e5844bcb1
require arleast 1 utf-8 encoded file 2021-10-15 16:14:06 +13:00
Thomas Hobson 0faea205db
Only compile/run files in utf8 encoding 2021-10-14 01:36:29 +13:00
Thomas Hobson 24a352699d
Support for uploading files in base64/hex format 2021-10-14 00:46:49 +13:00
Thomas Hobson 94a5568121
Merge pull request #371 from Brikaa/timeout
-1 for no timeout (infinite timeout)
2021-10-13 23:15:29 +13:00
Thomas Hobson e97b6d426d
Merge pull request #367 from Brikaa/constraints-bug
Fix important constraints bug
2021-10-13 06:43:26 +13:00
Brikaa afd71cc82d Fix env_val bug 2021-10-10 22:08:55 +02:00
Brikaa 2f114d6e54 Fix important constraints bug 2021-10-10 19:20:17 +02:00
Brikaa f973ecf281 Add infinite timeout 2021-10-10 17:18:31 +02:00
Brikaa f2c91acbe6 Piston lint 2021-10-09 18:10:58 +02:00
Brikaa adae6fde2f pkg(dotnet-5.0.201): Added F#.net, F# interactive and VB.net 2021-10-04 17:25:11 +02:00
Brikaa a5c3858100 Add per-language constraint overrides 2021-10-04 17:11:46 +02:00
Brikaa c0f203537c config.js: timeout, overrides 2021-10-04 17:11:46 +02:00
Brikaa 883d584c15 pkg(iverilog-11.0.0): Added iverilog 11.0.0 2021-10-04 17:11:46 +02:00
Thomas Hobson 36d72383a5 rework process janitor
Old process janitor required starting a `ps` process.
This was problematic, as `ps` requires another entry in the process table, which in some cases was impossible as it was exhausted.
2021-10-04 17:11:46 +02:00
Thomas Hobson 5d392effcc api: maximum concurrent jobs and potential fix for gcc 2021-10-04 17:11:46 +02:00
Dan Vargas 15e2e81d96 fix stdin for normal execute 2021-09-22 16:39:26 -05:00
Thomas Hobson 7d05f4e305
Merge branch 'master' into websocket 2021-09-22 08:21:31 +12:00
Brikaa 1250cf213a pkg(rscript-4.1.1): Added R 4.1.1 2021-09-12 14:38:57 +02:00
Thomas Hobson 2386684a05
api: fix file cleanup edge case
Processes could still be spawned writing files after the app has cleaned the dir out, and is ready to clear it out.
Dumb edge case, but oh well.
2021-08-20 01:05:13 +12:00
Thomas Hobson 5cd84ae816
api: allow paths when writing files (#302) 2021-07-22 14:58:41 +12:00
Thomas Hobson 230cb3abe1
bump versions major 2021-07-17 01:00:44 +12:00
Thomas Hobson 5ace2bf0e4
api: websocket init timeout 2021-07-17 00:25:19 +12:00
Thomas Hobson 3436648add
api: signaling process via ws 2021-07-17 00:22:55 +12:00
Thomas Hobson de89acb617
api: Implement Websocket transport for live data 2021-07-16 23:10:44 +12:00
Thomas Hobson c71aea6166
compute hash in chunks.
Previously we were loading the entire package file into memory, then
updating the hash. Now we update the hash with chunks of the data as it is read in.
Should fix #259
2021-05-18 21:07:40 +12:00
Thomas Hobson 543cb11e69
Change package manager request signature 2021-05-08 12:41:41 +12:00
Thomas Hobson b3be57e0b4
lint like rest of codebase 2021-05-08 12:30:40 +12:00
Thomas Hobson 1b7504a191
switch back to startsWith
This is because application/json;charset=utf8 is perfectly valid!
2021-05-08 12:25:04 +12:00
Thomas Hobson 4259e89bb2
lint api 2021-05-08 12:20:21 +12:00
Thomas Hobson 2beb0abff7
Merge branch 'master' of github.com:engineer-man/piston 2021-05-08 12:08:30 +12:00
Thomas Hobson b51350489f
Up the default max file size limit 2021-05-08 12:08:13 +12:00
Brian Seymour 106d5c72c9 fix json validation 2021-05-07 14:50:50 -05:00
Brian Seymour 3ea6ca1180 fix json validation 2021-05-07 14:42:55 -05:00
Brian Seymour 5830d7fb43 fix json validation 2021-05-07 14:35:27 -05:00
Brian Seymour de449c6d56 validate json instead of a json header, and lots of cleanup 2021-05-07 14:22:25 -05:00
Thomas Hobson 0da1cd5867
use real uid for killing processes instead of using euid (#206) 2021-05-07 22:11:28 +12:00
Thomas Hobson 972228412a
switch to taking config by env
To help with ease of deployment, configuration now is administered through the use of environment variables.
This allows for easy configuration directly from the docker-compose file and is a much more robust solution.
2021-05-07 21:11:36 +12:00
Felix fb102ebe83
Improved memory limits (#248)
* Added optional compile_memory_limit and run_memory_limit parameters

* Combined memory limit parameters into one
2021-05-07 20:21:25 +12:00
Thomas Hobson eaf0ba34bd
Allow additional content-type parameters 2021-05-07 20:12:27 +12:00
Thomas Hobson d95d67071c
reject on non-json content-types (#233) 2021-05-07 19:37:22 +12:00
Thomas Hobson 9590d5afbc
Patch for race condition with filesystem and process cleanup 2021-05-07 19:23:34 +12:00
Thomas Hobson 8b90c12c5c
chown directories to root, ensuring they are not writable by runners 2021-05-02 20:11:55 +12:00
Thomas Hobson 38ab15081e
Merge branch 'master' of https://github.com/engineer-man/piston 2021-05-02 17:02:26 +12:00
Thomas Hobson 37c760b081
allow empty contents 2021-05-02 17:01:50 +12:00
Thomas d577072749
Revert "Added max_memory_usage parameter (#238)" (#246)
This reverts commit a49acc7dbe.
2021-05-02 14:55:37 +12:00
Dan Vargas 2412d50f82
pkg(octave-6.2.0): add deps for octave (#245) 2021-05-02 14:41:53 +12:00
Felix a49acc7dbe
Added max_memory_usage parameter (#238)
* Added max_memory_usage parameter

* Added max_memory_usage description to readme
2021-05-01 21:10:53 +12:00
Thomas Hobson 5509492a99
uncomment the fix 2021-04-28 16:11:49 +12:00
Thomas Hobson 3bd73d07a9
file persistance fix 2021-04-28 16:03:35 +12:00
Thomas Hobson a6bc24e22e
Fix issue where large files can be written to exhaust space
**BREAKING CHANGE**
Requires manually editing the config file, or deleting the config file entirely!
2021-04-28 15:39:23 +12:00
Thomas Hobson 9a52e369f2
fix forking exploits 2021-04-26 19:37:40 +12:00
Thomas Hobson 6fe0da030d
edge case 2021-04-26 13:37:50 +12:00
Thomas Hobson 3673b4e403
zombie process handler 2021-04-26 13:00:34 +12:00
Thomas Hobson 347f2d56d7
use a compatible waitpid library 2021-04-26 11:32:10 +12:00
Thomas Hobson dd31873700
free zombie processes from proctable 2021-04-26 11:22:28 +12:00
Thomas Hobson 18a44bf146
install ps in container 2021-04-26 10:58:57 +12:00
Thomas Hobson 00fede6e0d
change api version to v2 2021-04-26 10:40:53 +12:00
Thomas Hobson 72bda367e0
cleanup all runner user processes 2021-04-26 10:35:34 +12:00
Thomas Hobson 3b0f2a0013
remove useless kill 2021-04-26 03:15:49 +12:00
Thomas Hobson 349beeb45a
Warn on errors when killing process group 2021-04-26 03:01:08 +12:00
Thomas Hobson f9b8fbd9c0
correct logging contexts 2021-04-25 21:01:16 +12:00
Thomas Hobson 3928bace86
refactor 2021-04-25 20:55:20 +12:00
Victor Frazao 5f97005a9a
Fixes nasm32 - adds 32bit arch to seccomp filter (#231) 2021-04-25 16:55:39 +12:00
Thomas Hobson 45eb4c799d
dont crash if there are no aliases 2021-04-25 16:37:05 +12:00
Thomas Hobson 30fa1d1425
use correct var name 2021-04-25 15:11:32 +12:00
Thomas Hobson a328b3eeda
better support for multiple languages per package 2021-04-25 15:02:57 +12:00
Thomas Hobson d851515f37
api: install rename in container 2021-04-24 19:51:33 +12:00
Thomas aeda95a215
add .code extension to files without file names 2021-04-24 17:59:06 +12:00
Thomas 5bc607dcec
API compatibility 2021-04-23 20:40:49 +12:00
Brian Seymour a1eb732406 update readme, refactor some code 2021-04-22 22:27:50 -05:00
Thomas Hobson 487bde6526
404 error 2021-04-23 14:49:12 +12:00
Thomas Hobson e6da87faa9
better error handling 2021-04-23 14:47:08 +12:00
Thomas Hobson 46b1e9118d
throw error 2021-04-23 14:32:05 +12:00
Thomas Hobson 890d9f024d
Merge branch 'v3' of https://github.com/engineer-man/piston into v3 2021-04-23 14:30:19 +12:00
Brian Seymour 04990566a1 updated readme 2021-04-22 21:30:01 -05:00
Thomas Hobson 6ff89f6e91
bail when not installed 2021-04-23 14:29:40 +12:00
Thomas Hobson 9c42254b80
default file name 2021-04-23 13:09:33 +12:00
Thomas Hobson 589dfec6df
default values 2021-04-23 11:54:37 +12:00
Thomas Hobson 9814217aee
remove main 2021-04-23 11:52:50 +12:00
Brian Seymour b3575246bd change urls, fix docker compose file 2021-04-22 18:43:21 -05:00
Thomas 1edb5ad046
ci bump 2021-04-17 12:11:31 +12:00
Dan Vargas d2e05a4a7e
pkg(*-*): Fix uninstall (#213) 2021-04-11 13:15:14 +12:00
Thomas Hobson 81cdc766b6
Uninstallation (#211) 2021-04-10 16:10:18 +12:00
Victor Frazao 552fb91c6b
v3 - Remove the use of unshare + privileged mode and instead (#195)
use seccomp to filter for socket syscalls
2021-04-07 12:31:30 +12:00
Thomas Hobson be47ab802c
Merge branch 'v3' of https://github.com/engineer-man/piston into v3 2021-03-29 21:33:54 +13:00
Thomas Hobson 607123f73d
switch to yarn 2021-03-29 21:33:49 +13:00
Brian Seymour 902ad71578 remove unnecessary author fields 2021-03-28 14:29:28 -05:00
Brian Seymour 7aa52bb0c5 move env 2021-03-28 14:03:08 -05:00
Brian Seymour b31deaddbc change port to match old piston, some formatting change, add env to fix debian warning/error 2021-03-28 14:01:46 -05:00
Vargas, Dan aa0a7ac35f pkg(swift-5.3.3): Add deps for swift 2021-03-18 15:08:51 -05:00
Vargas, Dan d50403230c pkg(prolog-8.2.4): Add deps for prolog 2021-03-18 09:13:02 -05:00