Arbitrary code execution server using Docker https://github.com/SunRed/myriad
Go to file
1computer1 8e246c8851 Add CLI and configurable configuration 2019-07-11 01:00:41 -04:00
languages Initial commit 2019-07-09 05:19:41 -04:00
src Add CLI and configurable configuration 2019-07-11 01:00:41 -04:00
.gitignore Initial commit 2019-07-09 05:19:41 -04:00
LICENSE Initial commit 2019-07-09 05:19:41 -04:00
README.md Add CLI and configurable configuration 2019-07-11 01:00:41 -04:00
Setup.hs Initial commit 2019-07-09 05:19:41 -04:00
config.dhall Fix port type 2019-07-09 08:37:23 -04:00
package.yaml Add CLI and configurable configuration 2019-07-11 01:00:41 -04:00
stack.yaml Initial commit 2019-07-09 05:19:41 -04:00
stack.yaml.lock Initial commit 2019-07-09 05:19:41 -04:00

README.md

Myriad

Arbitrary code execution server using Docker.

Install

  • Install Stack 2+
  • Run stack install, a myriad executable will be installed

Running

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

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.