Arbitrary code execution server using Docker https://github.com/SunRed/myriad
Find a file
2019-09-05 10:17:20 -04:00
app Add default values to the CLI 2019-09-05 10:17:20 -04:00
languages Add Idris 2019-07-21 18:59:52 -04:00
src Change the CLI to take the languages folder 2019-09-05 10:17:08 -04:00
.gitignore Switch to cabal 2019-07-25 00:31:46 -04:00
config.example.dhall Change the CLI to take the languages folder 2019-09-05 10:17:08 -04:00
LICENSE Initial commit 2019-07-09 05:19:41 -04:00
myriad.cabal Change the CLI to take the languages folder 2019-09-05 10:17:08 -04:00
README.md Change the CLI to take the languages folder 2019-09-05 10:17:08 -04:00
Setup.hs Initial commit 2019-07-09 05:19:41 -04:00

Myriad

Arbitrary code execution server using Docker.

Install

  • Install GHC and Cabal, see the Haskell website
  • Run cabal new-install, a myriad executable will be installed

Running

  • Make sure the configuration is filled out, see config.example.dhall for an example
  • Run myriad --config /path/to/config.dhall --languages /path/to/languages/

Endpoints

GET /languages

List of enabled languages.
Example response:

["haskell", "javascript"]

POST /eval

Evaluate code.
JSON payload with language and code keys.
The language is as in the name of a subfolder in the languages directory.
Example payload:

{ "language": "haskell", "code": "main = print (1 + 1)" }

Example response:

{ "result": "2\n" }

Errors with 404 if language is not found, 504 if evaluation timed out, or 500 if evaluation failed for other reasons.

GET /containers

List of containers being handled by Myriad.

POST /cleanup

Kill all containers, giving back the names of the containers killed.