Actually switch to cabal

This commit is contained in:
1Computer1 2019-09-04 23:53:57 -04:00
parent 46b60a9944
commit 4776a89f9a
3 changed files with 71 additions and 154 deletions

View file

@ -15,6 +15,7 @@ Arbitrary code execution server using Docker.
## Endpoints ## Endpoints
### **GET** `/languages` ### **GET** `/languages`
List of enabled languages. List of enabled languages.
Example response: Example response:
@ -23,6 +24,7 @@ Example response:
``` ```
### **POST** `/eval` ### **POST** `/eval`
Evaluate code. Evaluate code.
JSON payload with `language` and `code` keys. JSON payload with `language` and `code` keys.
The `language` is as in the name of a subfolder in the `languages` directory. The `language` is as in the name of a subfolder in the `languages` directory.
@ -41,7 +43,9 @@ Example response:
Errors with 404 if `language` is not found, `504` if evaluation timed out, or `500` if evaluation failed for other reasons. Errors with 404 if `language` is not found, `504` if evaluation timed out, or `500` if evaluation failed for other reasons.
### **GET** `/containers` ### **GET** `/containers`
List of containers being handled by Myriad. List of containers being handled by Myriad.
### **POST** `/cleanup` ### **POST** `/cleanup`
Kill all containers, giving back the names of the containers killed. Kill all containers, giving back the names of the containers killed.

View file

@ -1,10 +1,4 @@
cabal-version: 1.12 cabal-version: 2.2
-- This file has been generated from package.yaml by hpack version 0.31.2.
--
-- see: https://github.com/sol/hpack
--
-- hash: 04a15c51f0ad270f323a3edd67bc229f0a0796226ff53a118338ec643b22b3c1
name: myriad name: myriad
version: 0.1.0.0 version: 0.1.0.0
@ -20,81 +14,82 @@ license: MIT
license-file: LICENSE license-file: LICENSE
build-type: Simple build-type: Simple
extra-source-files: extra-source-files:
README.md README.md
source-repository head source-repository head
type: git type: git
location: https://github.com/1computer1/myriad location: https://github.com/1computer1/myriad
library common extensions
exposed-modules: default-extensions:
Myriad BlockArguments
Myriad.Core ConstraintKinds
Myriad.Docker DataKinds
Myriad.Server DerivingStrategies
other-modules: DeriveFunctor
Paths_myriad DeriveGeneric
hs-source-dirs: FlexibleContexts
src FlexibleInstances
default-extensions: BlockArguments ConstraintKinds DataKinds DerivingStrategies DeriveFunctor DeriveGeneric FlexibleContexts FlexibleInstances FunctionalDependencies GADTs GeneralizedNewtypeDeriving LambdaCase MultiParamTypeClasses MultiWayIf NamedFieldPuns OverloadedStrings PatternSynonyms PolyKinds RankNTypes ScopedTypeVariables StandaloneDeriving TupleSections TypeApplications TypeOperators TypeFamilies ViewPatterns FunctionalDependencies
GADTs
GeneralizedNewtypeDeriving
LambdaCase
MultiParamTypeClasses
MultiWayIf
NamedFieldPuns
OverloadedStrings
PatternSynonyms
PolyKinds
RankNTypes
ScopedTypeVariables
StandaloneDeriving
TupleSections
TypeApplications
TypeOperators
TypeFamilies
ViewPatterns
common deps
build-depends: build-depends:
aeson aeson ^>= 1.4.4.0
, async , async ^>= 2.2.2
, base , base ^>= 4.12.0.0
, bytestring , bytestring ^>= 0.10.8.2
, containers , containers ^>= 0.6.0.1
, dhall , dhall ^>= 1.24.0
, filepath , filepath ^>= 1.4.2.1
, lifted-async , lifted-async ^>= 0.10.0.4
, lifted-base , lifted-base ^>= 0.2.3.12
, monad-control , monad-control ^>= 1.0.2.3
, monad-logger , monad-logger ^>= 0.3.30
, mtl , mtl ^>= 2.2.2
, servant , servant ^>= 0.16.2
, servant-server , servant-server ^>= 0.16.2
, snowflake , snowflake ^>= 0.1.1.1
, string-conversions , string-conversions ^>= 0.4.0.1
, text , text ^>= 1.2.3.1
, time , time ^>= 1.8.0.2
, transformers , transformers ^>= 0.5.6.2
, transformers-base , transformers-base ^>= 0.4.5.2
, typed-process , typed-process ^>= 0.2.6.0
, wai , wai ^>= 3.2.2.1
, warp , warp ^>= 3.2.28
default-language: Haskell2010 default-language: Haskell2010
library
import: extensions, deps
exposed-modules:
Myriad
Myriad.Core
Myriad.Docker
Myriad.Server
hs-source-dirs: src
executable myriad executable myriad
import: extensions, deps
main-is: Main.hs main-is: Main.hs
other-modules: hs-source-dirs: app
Paths_myriad
hs-source-dirs:
app
default-extensions: BlockArguments ConstraintKinds DataKinds DerivingStrategies DeriveFunctor DeriveGeneric FlexibleContexts FlexibleInstances FunctionalDependencies GADTs GeneralizedNewtypeDeriving LambdaCase MultiParamTypeClasses MultiWayIf NamedFieldPuns OverloadedStrings PatternSynonyms PolyKinds RankNTypes ScopedTypeVariables StandaloneDeriving TupleSections TypeApplications TypeOperators TypeFamilies ViewPatterns
ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall
build-depends: build-depends:
aeson myriad
, async
, base
, bytestring
, containers
, dhall
, filepath
, lifted-async
, lifted-base
, monad-control
, monad-logger
, mtl
, myriad
, optparse-applicative , optparse-applicative
, servant
, servant-server
, snowflake
, string-conversions
, text
, time
, transformers
, transformers-base
, typed-process
, wai
, warp
default-language: Haskell2010

View file

@ -1,82 +0,0 @@
name: myriad
version: 0.1.0.0
github: "1computer1/myriad"
license: MIT
author: "1Computer1"
maintainer: "onecomputer00@gmail.com"
copyright: "2019 1Computer1"
extra-source-files:
- README.md
synopsis: Arbitrary code execution in Docker
category: Server
description: Please see the README
dependencies:
- aeson
- async
- base
- bytestring
- containers
- dhall
- filepath
- lifted-base
- lifted-async
- monad-control
- monad-logger
- mtl
- servant
- servant-server
- snowflake
- string-conversions
- text
- time
- transformers
- transformers-base
- typed-process
- wai
- warp
default-extensions:
- BlockArguments
- ConstraintKinds
- DataKinds
- DerivingStrategies
- DeriveFunctor
- DeriveGeneric
- FlexibleContexts
- FlexibleInstances
- FunctionalDependencies
- GADTs
- GeneralizedNewtypeDeriving
- LambdaCase
- MultiParamTypeClasses
- MultiWayIf
- NamedFieldPuns
- OverloadedStrings
- PatternSynonyms
- PolyKinds
- RankNTypes
- ScopedTypeVariables
- StandaloneDeriving
- TupleSections
- TypeApplications
- TypeOperators
- TypeFamilies
- ViewPatterns
library:
source-dirs: src
executable:
main: Main.hs
source-dirs: app
ghc-options:
- -threaded
- -rtsopts
- -with-rtsopts=-N
- -Wall
dependencies:
- myriad
- optparse-applicative