├── .gitattributes ├── .github ├── FUNDING.yml └── dependabot.yml ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── Config.example.toml ├── LICENSE ├── README.md ├── Rocket.toml ├── languages ├── apl │ ├── Dockerfile │ └── run.sh ├── bash │ ├── Dockerfile │ └── run.sh ├── brainfuck │ ├── Dockerfile │ ├── bf.cpp │ └── run.sh ├── c │ ├── Dockerfile │ └── run.sh ├── clojure │ ├── Dockerfile │ └── run.sh ├── cpp │ ├── Dockerfile │ └── run.sh ├── csharp │ ├── Dockerfile │ └── run.sh ├── elixir │ ├── Dockerfile │ └── run.sh ├── fsharp │ ├── Dockerfile │ └── run.sh ├── go │ ├── Dockerfile │ └── run.sh ├── haskell │ ├── Dockerfile │ └── run.sh ├── idris │ ├── Dockerfile │ └── run.sh ├── java │ ├── Dockerfile │ └── run.sh ├── javascript │ ├── Dockerfile │ └── run.sh ├── julia │ ├── Dockerfile │ └── run.sh ├── lua │ ├── Dockerfile │ └── run.sh ├── ocaml │ ├── Dockerfile │ └── run.sh ├── pascal │ ├── Dockerfile │ └── run.sh ├── perl │ ├── Dockerfile │ └── run.sh ├── php │ ├── Dockerfile │ └── run.sh ├── prolog │ ├── Dockerfile │ └── run.sh ├── python │ ├── Dockerfile │ └── run.sh ├── racket │ ├── Dockerfile │ └── run.sh ├── ruby │ ├── Dockerfile │ └── run.sh ├── rust │ ├── Dockerfile │ └── run.sh └── typescript │ ├── Dockerfile │ └── run.sh └── src ├── docker.rs ├── lib.rs ├── main.rs ├── router.rs └── router ├── cleanup.rs ├── containers.rs ├── create_container.rs ├── eval.rs ├── gateway_timeout.rs ├── internal_server_error.rs ├── languages.rs └── not_found.rs /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [icrawl] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: iCrawl 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: crawltogo 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: cargo 4 | directory: "/" 5 | schedule: 6 | interval: daily 7 | time: "15:00" 8 | timezone: Europe/Vienna 9 | open-pull-requests-limit: 99 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | **/*.rs.bk 3 | Config.toml 4 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "aead" 7 | version = "0.2.0" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "4cf01b9b56e767bb57b94ebf91a58b338002963785cdd7013e21c0d4679471e4" 10 | dependencies = [ 11 | "generic-array", 12 | ] 13 | 14 | [[package]] 15 | name = "aes" 16 | version = "0.3.2" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "54eb1d8fe354e5fc611daf4f2ea97dd45a765f4f1e4512306ec183ae2e8f20c9" 19 | dependencies = [ 20 | "aes-soft", 21 | "aesni", 22 | "block-cipher-trait", 23 | ] 24 | 25 | [[package]] 26 | name = "aes-gcm" 27 | version = "0.5.0" 28 | source = "registry+https://github.com/rust-lang/crates.io-index" 29 | checksum = "834a6bda386024dbb7c8fc51322856c10ffe69559f972261c868485f5759c638" 30 | dependencies = [ 31 | "aead", 32 | "aes", 33 | "block-cipher-trait", 34 | "ghash", 35 | "subtle 2.2.3", 36 | "zeroize", 37 | ] 38 | 39 | [[package]] 40 | name = "aes-soft" 41 | version = "0.3.3" 42 | source = "registry+https://github.com/rust-lang/crates.io-index" 43 | checksum = "cfd7e7ae3f9a1fb5c03b389fc6bb9a51400d0c13053f0dca698c832bfd893a0d" 44 | dependencies = [ 45 | "block-cipher-trait", 46 | "byteorder", 47 | "opaque-debug", 48 | ] 49 | 50 | [[package]] 51 | name = "aesni" 52 | version = "0.6.0" 53 | source = "registry+https://github.com/rust-lang/crates.io-index" 54 | checksum = "2f70a6b5f971e473091ab7cfb5ffac6cde81666c4556751d8d5620ead8abf100" 55 | dependencies = [ 56 | "block-cipher-trait", 57 | "opaque-debug", 58 | ] 59 | 60 | [[package]] 61 | name = "atty" 62 | version = "0.2.14" 63 | source = "registry+https://github.com/rust-lang/crates.io-index" 64 | checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" 65 | dependencies = [ 66 | "hermit-abi", 67 | "libc", 68 | "winapi 0.3.9", 69 | ] 70 | 71 | [[package]] 72 | name = "autocfg" 73 | version = "1.0.0" 74 | source = "registry+https://github.com/rust-lang/crates.io-index" 75 | checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" 76 | 77 | [[package]] 78 | name = "base64" 79 | version = "0.9.3" 80 | source = "registry+https://github.com/rust-lang/crates.io-index" 81 | checksum = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643" 82 | dependencies = [ 83 | "byteorder", 84 | "safemem", 85 | ] 86 | 87 | [[package]] 88 | name = "base64" 89 | version = "0.12.3" 90 | source = "registry+https://github.com/rust-lang/crates.io-index" 91 | checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" 92 | 93 | [[package]] 94 | name = "base64" 95 | version = "0.13.0" 96 | source = "registry+https://github.com/rust-lang/crates.io-index" 97 | checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" 98 | 99 | [[package]] 100 | name = "bitflags" 101 | version = "1.2.1" 102 | source = "registry+https://github.com/rust-lang/crates.io-index" 103 | checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" 104 | 105 | [[package]] 106 | name = "block-buffer" 107 | version = "0.7.3" 108 | source = "registry+https://github.com/rust-lang/crates.io-index" 109 | checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" 110 | dependencies = [ 111 | "block-padding", 112 | "byte-tools", 113 | "byteorder", 114 | "generic-array", 115 | ] 116 | 117 | [[package]] 118 | name = "block-cipher-trait" 119 | version = "0.6.2" 120 | source = "registry+https://github.com/rust-lang/crates.io-index" 121 | checksum = "1c924d49bd09e7c06003acda26cd9742e796e34282ec6c1189404dee0c1f4774" 122 | dependencies = [ 123 | "generic-array", 124 | ] 125 | 126 | [[package]] 127 | name = "block-padding" 128 | version = "0.1.5" 129 | source = "registry+https://github.com/rust-lang/crates.io-index" 130 | checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" 131 | dependencies = [ 132 | "byte-tools", 133 | ] 134 | 135 | [[package]] 136 | name = "byte-tools" 137 | version = "0.3.1" 138 | source = "registry+https://github.com/rust-lang/crates.io-index" 139 | checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" 140 | 141 | [[package]] 142 | name = "byteorder" 143 | version = "1.3.4" 144 | source = "registry+https://github.com/rust-lang/crates.io-index" 145 | checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" 146 | 147 | [[package]] 148 | name = "cfg-if" 149 | version = "0.1.10" 150 | source = "registry+https://github.com/rust-lang/crates.io-index" 151 | checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" 152 | 153 | [[package]] 154 | name = "cfg-if" 155 | version = "1.0.0" 156 | source = "registry+https://github.com/rust-lang/crates.io-index" 157 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 158 | 159 | [[package]] 160 | name = "chrono" 161 | version = "0.4.13" 162 | source = "registry+https://github.com/rust-lang/crates.io-index" 163 | checksum = "c74d84029116787153e02106bf53e66828452a4b325cc8652b788b5967c0a0b6" 164 | dependencies = [ 165 | "num-integer", 166 | "num-traits", 167 | "time", 168 | ] 169 | 170 | [[package]] 171 | name = "cloudabi" 172 | version = "0.0.3" 173 | source = "registry+https://github.com/rust-lang/crates.io-index" 174 | checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" 175 | dependencies = [ 176 | "bitflags", 177 | ] 178 | 179 | [[package]] 180 | name = "cookie" 181 | version = "0.11.3" 182 | source = "registry+https://github.com/rust-lang/crates.io-index" 183 | checksum = "5795cda0897252e34380a27baf884c53aa7ad9990329cdad96d4c5d027015d44" 184 | dependencies = [ 185 | "aes-gcm", 186 | "base64 0.12.3", 187 | "hkdf", 188 | "hmac", 189 | "percent-encoding 2.1.0", 190 | "rand", 191 | "sha2", 192 | "time", 193 | ] 194 | 195 | [[package]] 196 | name = "crypto-mac" 197 | version = "0.7.0" 198 | source = "registry+https://github.com/rust-lang/crates.io-index" 199 | checksum = "4434400df11d95d556bac068ddfedd482915eb18fe8bea89bc80b6e4b1c179e5" 200 | dependencies = [ 201 | "generic-array", 202 | "subtle 1.0.0", 203 | ] 204 | 205 | [[package]] 206 | name = "devise" 207 | version = "0.2.1" 208 | source = "registry+https://github.com/rust-lang/crates.io-index" 209 | checksum = "dd716c4a507adc5a2aa7c2a372d06c7497727e0892b243d3036bc7478a13e526" 210 | dependencies = [ 211 | "devise_codegen", 212 | "devise_core", 213 | ] 214 | 215 | [[package]] 216 | name = "devise_codegen" 217 | version = "0.2.1" 218 | source = "registry+https://github.com/rust-lang/crates.io-index" 219 | checksum = "ea7b8290d118127c08e3669da20b331bed56b09f20be5945b7da6c116d8fab53" 220 | dependencies = [ 221 | "devise_core", 222 | "quote 0.6.13", 223 | ] 224 | 225 | [[package]] 226 | name = "devise_core" 227 | version = "0.2.1" 228 | source = "registry+https://github.com/rust-lang/crates.io-index" 229 | checksum = "d1053e9d5d5aade9bcedb5ab53b78df2b56ff9408a3138ce77eaaef87f932373" 230 | dependencies = [ 231 | "bitflags", 232 | "proc-macro2 0.4.30", 233 | "quote 0.6.13", 234 | "syn 0.15.44", 235 | ] 236 | 237 | [[package]] 238 | name = "digest" 239 | version = "0.8.1" 240 | source = "registry+https://github.com/rust-lang/crates.io-index" 241 | checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" 242 | dependencies = [ 243 | "generic-array", 244 | ] 245 | 246 | [[package]] 247 | name = "fake-simd" 248 | version = "0.1.2" 249 | source = "registry+https://github.com/rust-lang/crates.io-index" 250 | checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" 251 | 252 | [[package]] 253 | name = "filetime" 254 | version = "0.2.10" 255 | source = "registry+https://github.com/rust-lang/crates.io-index" 256 | checksum = "affc17579b132fc2461adf7c575cc6e8b134ebca52c51f5411388965227dc695" 257 | dependencies = [ 258 | "cfg-if 0.1.10", 259 | "libc", 260 | "redox_syscall", 261 | "winapi 0.3.9", 262 | ] 263 | 264 | [[package]] 265 | name = "fsevent" 266 | version = "0.4.0" 267 | source = "registry+https://github.com/rust-lang/crates.io-index" 268 | checksum = "5ab7d1bd1bd33cc98b0889831b72da23c0aa4df9cec7e0702f46ecea04b35db6" 269 | dependencies = [ 270 | "bitflags", 271 | "fsevent-sys", 272 | ] 273 | 274 | [[package]] 275 | name = "fsevent-sys" 276 | version = "2.0.1" 277 | source = "registry+https://github.com/rust-lang/crates.io-index" 278 | checksum = "f41b048a94555da0f42f1d632e2e19510084fb8e303b0daa2816e733fb3644a0" 279 | dependencies = [ 280 | "libc", 281 | ] 282 | 283 | [[package]] 284 | name = "fuchsia-zircon" 285 | version = "0.3.3" 286 | source = "registry+https://github.com/rust-lang/crates.io-index" 287 | checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" 288 | dependencies = [ 289 | "bitflags", 290 | "fuchsia-zircon-sys", 291 | ] 292 | 293 | [[package]] 294 | name = "fuchsia-zircon-sys" 295 | version = "0.3.3" 296 | source = "registry+https://github.com/rust-lang/crates.io-index" 297 | checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" 298 | 299 | [[package]] 300 | name = "generic-array" 301 | version = "0.12.4" 302 | source = "registry+https://github.com/rust-lang/crates.io-index" 303 | checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" 304 | dependencies = [ 305 | "typenum", 306 | ] 307 | 308 | [[package]] 309 | name = "getrandom" 310 | version = "0.1.14" 311 | source = "registry+https://github.com/rust-lang/crates.io-index" 312 | checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" 313 | dependencies = [ 314 | "cfg-if 0.1.10", 315 | "libc", 316 | "wasi", 317 | ] 318 | 319 | [[package]] 320 | name = "ghash" 321 | version = "0.2.3" 322 | source = "registry+https://github.com/rust-lang/crates.io-index" 323 | checksum = "9f0930ed19a7184089ea46d2fedead2f6dc2b674c5db4276b7da336c7cd83252" 324 | dependencies = [ 325 | "polyval", 326 | ] 327 | 328 | [[package]] 329 | name = "glob" 330 | version = "0.3.0" 331 | source = "registry+https://github.com/rust-lang/crates.io-index" 332 | checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" 333 | 334 | [[package]] 335 | name = "hashbrown" 336 | version = "0.9.1" 337 | source = "registry+https://github.com/rust-lang/crates.io-index" 338 | checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" 339 | 340 | [[package]] 341 | name = "hermit-abi" 342 | version = "0.1.15" 343 | source = "registry+https://github.com/rust-lang/crates.io-index" 344 | checksum = "3deed196b6e7f9e44a2ae8d94225d80302d81208b1bb673fd21fe634645c85a9" 345 | dependencies = [ 346 | "libc", 347 | ] 348 | 349 | [[package]] 350 | name = "hkdf" 351 | version = "0.8.0" 352 | source = "registry+https://github.com/rust-lang/crates.io-index" 353 | checksum = "3fa08a006102488bd9cd5b8013aabe84955cf5ae22e304c2caf655b633aefae3" 354 | dependencies = [ 355 | "digest", 356 | "hmac", 357 | ] 358 | 359 | [[package]] 360 | name = "hmac" 361 | version = "0.7.1" 362 | source = "registry+https://github.com/rust-lang/crates.io-index" 363 | checksum = "5dcb5e64cda4c23119ab41ba960d1e170a774c8e4b9d9e6a9bc18aabf5e59695" 364 | dependencies = [ 365 | "crypto-mac", 366 | "digest", 367 | ] 368 | 369 | [[package]] 370 | name = "httparse" 371 | version = "1.3.4" 372 | source = "registry+https://github.com/rust-lang/crates.io-index" 373 | checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" 374 | 375 | [[package]] 376 | name = "hyper" 377 | version = "0.10.16" 378 | source = "registry+https://github.com/rust-lang/crates.io-index" 379 | checksum = "0a0652d9a2609a968c14be1a9ea00bf4b1d64e2e1f53a1b51b6fff3a6e829273" 380 | dependencies = [ 381 | "base64 0.9.3", 382 | "httparse", 383 | "language-tags", 384 | "log 0.3.9", 385 | "mime", 386 | "num_cpus", 387 | "time", 388 | "traitobject", 389 | "typeable", 390 | "unicase", 391 | "url", 392 | ] 393 | 394 | [[package]] 395 | name = "idna" 396 | version = "0.1.5" 397 | source = "registry+https://github.com/rust-lang/crates.io-index" 398 | checksum = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" 399 | dependencies = [ 400 | "matches", 401 | "unicode-bidi", 402 | "unicode-normalization", 403 | ] 404 | 405 | [[package]] 406 | name = "indexmap" 407 | version = "1.6.2" 408 | source = "registry+https://github.com/rust-lang/crates.io-index" 409 | checksum = "824845a0bf897a9042383849b02c1bc219c2383772efcd5c6f9766fa4b81aef3" 410 | dependencies = [ 411 | "autocfg", 412 | "hashbrown", 413 | ] 414 | 415 | [[package]] 416 | name = "inotify" 417 | version = "0.7.1" 418 | source = "registry+https://github.com/rust-lang/crates.io-index" 419 | checksum = "4816c66d2c8ae673df83366c18341538f234a26d65a9ecea5c348b453ac1d02f" 420 | dependencies = [ 421 | "bitflags", 422 | "inotify-sys", 423 | "libc", 424 | ] 425 | 426 | [[package]] 427 | name = "inotify-sys" 428 | version = "0.1.3" 429 | source = "registry+https://github.com/rust-lang/crates.io-index" 430 | checksum = "e74a1aa87c59aeff6ef2cc2fa62d41bc43f54952f55652656b18a02fd5e356c0" 431 | dependencies = [ 432 | "libc", 433 | ] 434 | 435 | [[package]] 436 | name = "iovec" 437 | version = "0.1.4" 438 | source = "registry+https://github.com/rust-lang/crates.io-index" 439 | checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" 440 | dependencies = [ 441 | "libc", 442 | ] 443 | 444 | [[package]] 445 | name = "itoa" 446 | version = "0.4.6" 447 | source = "registry+https://github.com/rust-lang/crates.io-index" 448 | checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" 449 | 450 | [[package]] 451 | name = "kernel32-sys" 452 | version = "0.2.2" 453 | source = "registry+https://github.com/rust-lang/crates.io-index" 454 | checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" 455 | dependencies = [ 456 | "winapi 0.2.8", 457 | "winapi-build", 458 | ] 459 | 460 | [[package]] 461 | name = "language-tags" 462 | version = "0.2.2" 463 | source = "registry+https://github.com/rust-lang/crates.io-index" 464 | checksum = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" 465 | 466 | [[package]] 467 | name = "lazycell" 468 | version = "1.2.1" 469 | source = "registry+https://github.com/rust-lang/crates.io-index" 470 | checksum = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f" 471 | 472 | [[package]] 473 | name = "libc" 474 | version = "0.2.72" 475 | source = "registry+https://github.com/rust-lang/crates.io-index" 476 | checksum = "a9f8082297d534141b30c8d39e9b1773713ab50fdbe4ff30f750d063b3bfd701" 477 | 478 | [[package]] 479 | name = "lock_api" 480 | version = "0.3.4" 481 | source = "registry+https://github.com/rust-lang/crates.io-index" 482 | checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" 483 | dependencies = [ 484 | "scopeguard", 485 | ] 486 | 487 | [[package]] 488 | name = "log" 489 | version = "0.3.9" 490 | source = "registry+https://github.com/rust-lang/crates.io-index" 491 | checksum = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" 492 | dependencies = [ 493 | "log 0.4.17", 494 | ] 495 | 496 | [[package]] 497 | name = "log" 498 | version = "0.4.17" 499 | source = "registry+https://github.com/rust-lang/crates.io-index" 500 | checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" 501 | dependencies = [ 502 | "cfg-if 1.0.0", 503 | ] 504 | 505 | [[package]] 506 | name = "matches" 507 | version = "0.1.8" 508 | source = "registry+https://github.com/rust-lang/crates.io-index" 509 | checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" 510 | 511 | [[package]] 512 | name = "maybe-uninit" 513 | version = "2.0.0" 514 | source = "registry+https://github.com/rust-lang/crates.io-index" 515 | checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" 516 | 517 | [[package]] 518 | name = "memchr" 519 | version = "2.3.3" 520 | source = "registry+https://github.com/rust-lang/crates.io-index" 521 | checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" 522 | 523 | [[package]] 524 | name = "mime" 525 | version = "0.2.6" 526 | source = "registry+https://github.com/rust-lang/crates.io-index" 527 | checksum = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0" 528 | dependencies = [ 529 | "log 0.3.9", 530 | ] 531 | 532 | [[package]] 533 | name = "mio" 534 | version = "0.6.22" 535 | source = "registry+https://github.com/rust-lang/crates.io-index" 536 | checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430" 537 | dependencies = [ 538 | "cfg-if 0.1.10", 539 | "fuchsia-zircon", 540 | "fuchsia-zircon-sys", 541 | "iovec", 542 | "kernel32-sys", 543 | "libc", 544 | "log 0.4.17", 545 | "miow", 546 | "net2", 547 | "slab", 548 | "winapi 0.2.8", 549 | ] 550 | 551 | [[package]] 552 | name = "mio-extras" 553 | version = "2.0.6" 554 | source = "registry+https://github.com/rust-lang/crates.io-index" 555 | checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" 556 | dependencies = [ 557 | "lazycell", 558 | "log 0.4.17", 559 | "mio", 560 | "slab", 561 | ] 562 | 563 | [[package]] 564 | name = "miow" 565 | version = "0.2.2" 566 | source = "registry+https://github.com/rust-lang/crates.io-index" 567 | checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" 568 | dependencies = [ 569 | "kernel32-sys", 570 | "net2", 571 | "winapi 0.2.8", 572 | "ws2_32-sys", 573 | ] 574 | 575 | [[package]] 576 | name = "myrias" 577 | version = "0.1.0" 578 | dependencies = [ 579 | "log 0.4.17", 580 | "rocket", 581 | "rocket_contrib", 582 | "rustflake", 583 | "serde", 584 | "toml 0.5.9", 585 | ] 586 | 587 | [[package]] 588 | name = "net2" 589 | version = "0.2.37" 590 | source = "registry+https://github.com/rust-lang/crates.io-index" 591 | checksum = "391630d12b68002ae1e25e8f974306474966550ad82dac6886fb8910c19568ae" 592 | dependencies = [ 593 | "cfg-if 0.1.10", 594 | "libc", 595 | "winapi 0.3.9", 596 | ] 597 | 598 | [[package]] 599 | name = "notify" 600 | version = "4.0.15" 601 | source = "registry+https://github.com/rust-lang/crates.io-index" 602 | checksum = "80ae4a7688d1fab81c5bf19c64fc8db920be8d519ce6336ed4e7efe024724dbd" 603 | dependencies = [ 604 | "bitflags", 605 | "filetime", 606 | "fsevent", 607 | "fsevent-sys", 608 | "inotify", 609 | "libc", 610 | "mio", 611 | "mio-extras", 612 | "walkdir", 613 | "winapi 0.3.9", 614 | ] 615 | 616 | [[package]] 617 | name = "num-integer" 618 | version = "0.1.43" 619 | source = "registry+https://github.com/rust-lang/crates.io-index" 620 | checksum = "8d59457e662d541ba17869cf51cf177c0b5f0cbf476c66bdc90bf1edac4f875b" 621 | dependencies = [ 622 | "autocfg", 623 | "num-traits", 624 | ] 625 | 626 | [[package]] 627 | name = "num-traits" 628 | version = "0.2.12" 629 | source = "registry+https://github.com/rust-lang/crates.io-index" 630 | checksum = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611" 631 | dependencies = [ 632 | "autocfg", 633 | ] 634 | 635 | [[package]] 636 | name = "num_cpus" 637 | version = "1.13.0" 638 | source = "registry+https://github.com/rust-lang/crates.io-index" 639 | checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" 640 | dependencies = [ 641 | "hermit-abi", 642 | "libc", 643 | ] 644 | 645 | [[package]] 646 | name = "opaque-debug" 647 | version = "0.2.3" 648 | source = "registry+https://github.com/rust-lang/crates.io-index" 649 | checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" 650 | 651 | [[package]] 652 | name = "parking_lot" 653 | version = "0.9.0" 654 | source = "registry+https://github.com/rust-lang/crates.io-index" 655 | checksum = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" 656 | dependencies = [ 657 | "lock_api", 658 | "parking_lot_core", 659 | "rustc_version", 660 | ] 661 | 662 | [[package]] 663 | name = "parking_lot_core" 664 | version = "0.6.2" 665 | source = "registry+https://github.com/rust-lang/crates.io-index" 666 | checksum = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" 667 | dependencies = [ 668 | "cfg-if 0.1.10", 669 | "cloudabi", 670 | "libc", 671 | "redox_syscall", 672 | "rustc_version", 673 | "smallvec 0.6.13", 674 | "winapi 0.3.9", 675 | ] 676 | 677 | [[package]] 678 | name = "pear" 679 | version = "0.1.5" 680 | source = "registry+https://github.com/rust-lang/crates.io-index" 681 | checksum = "32dfa7458144c6af7f9ce6a137ef975466aa68ffa44d4d816ee5934018ba960a" 682 | dependencies = [ 683 | "pear_codegen", 684 | ] 685 | 686 | [[package]] 687 | name = "pear_codegen" 688 | version = "0.1.4" 689 | source = "registry+https://github.com/rust-lang/crates.io-index" 690 | checksum = "bfc1c836fdc3d1ef87c348b237b5b5c4dff922156fb2d968f57734f9669768ca" 691 | dependencies = [ 692 | "proc-macro2 0.4.30", 693 | "quote 0.6.13", 694 | "syn 0.15.44", 695 | "version_check 0.9.2", 696 | "yansi", 697 | ] 698 | 699 | [[package]] 700 | name = "percent-encoding" 701 | version = "1.0.1" 702 | source = "registry+https://github.com/rust-lang/crates.io-index" 703 | checksum = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" 704 | 705 | [[package]] 706 | name = "percent-encoding" 707 | version = "2.1.0" 708 | source = "registry+https://github.com/rust-lang/crates.io-index" 709 | checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" 710 | 711 | [[package]] 712 | name = "polyval" 713 | version = "0.3.3" 714 | source = "registry+https://github.com/rust-lang/crates.io-index" 715 | checksum = "7ec3341498978de3bfd12d1b22f1af1de22818f5473a11e8a6ef997989e3a212" 716 | dependencies = [ 717 | "cfg-if 0.1.10", 718 | "universal-hash", 719 | ] 720 | 721 | [[package]] 722 | name = "ppv-lite86" 723 | version = "0.2.8" 724 | source = "registry+https://github.com/rust-lang/crates.io-index" 725 | checksum = "237a5ed80e274dbc66f86bd59c1e25edc039660be53194b5fe0a482e0f2612ea" 726 | 727 | [[package]] 728 | name = "proc-macro2" 729 | version = "0.4.30" 730 | source = "registry+https://github.com/rust-lang/crates.io-index" 731 | checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" 732 | dependencies = [ 733 | "unicode-xid 0.1.0", 734 | ] 735 | 736 | [[package]] 737 | name = "proc-macro2" 738 | version = "1.0.36" 739 | source = "registry+https://github.com/rust-lang/crates.io-index" 740 | checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" 741 | dependencies = [ 742 | "unicode-xid 0.2.1", 743 | ] 744 | 745 | [[package]] 746 | name = "quote" 747 | version = "0.6.13" 748 | source = "registry+https://github.com/rust-lang/crates.io-index" 749 | checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" 750 | dependencies = [ 751 | "proc-macro2 0.4.30", 752 | ] 753 | 754 | [[package]] 755 | name = "quote" 756 | version = "1.0.7" 757 | source = "registry+https://github.com/rust-lang/crates.io-index" 758 | checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" 759 | dependencies = [ 760 | "proc-macro2 1.0.36", 761 | ] 762 | 763 | [[package]] 764 | name = "rand" 765 | version = "0.7.3" 766 | source = "registry+https://github.com/rust-lang/crates.io-index" 767 | checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" 768 | dependencies = [ 769 | "getrandom", 770 | "libc", 771 | "rand_chacha", 772 | "rand_core", 773 | "rand_hc", 774 | ] 775 | 776 | [[package]] 777 | name = "rand_chacha" 778 | version = "0.2.2" 779 | source = "registry+https://github.com/rust-lang/crates.io-index" 780 | checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" 781 | dependencies = [ 782 | "ppv-lite86", 783 | "rand_core", 784 | ] 785 | 786 | [[package]] 787 | name = "rand_core" 788 | version = "0.5.1" 789 | source = "registry+https://github.com/rust-lang/crates.io-index" 790 | checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" 791 | dependencies = [ 792 | "getrandom", 793 | ] 794 | 795 | [[package]] 796 | name = "rand_hc" 797 | version = "0.2.0" 798 | source = "registry+https://github.com/rust-lang/crates.io-index" 799 | checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" 800 | dependencies = [ 801 | "rand_core", 802 | ] 803 | 804 | [[package]] 805 | name = "redox_syscall" 806 | version = "0.1.57" 807 | source = "registry+https://github.com/rust-lang/crates.io-index" 808 | checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" 809 | 810 | [[package]] 811 | name = "rocket" 812 | version = "0.4.11" 813 | source = "registry+https://github.com/rust-lang/crates.io-index" 814 | checksum = "83b9d9dc08c5dcc1d8126a9dd615545e6a358f8c13c883c8dfed8c0376fa355e" 815 | dependencies = [ 816 | "atty", 817 | "base64 0.13.0", 818 | "log 0.4.17", 819 | "memchr", 820 | "num_cpus", 821 | "pear", 822 | "rocket_codegen", 823 | "rocket_http", 824 | "state", 825 | "time", 826 | "toml 0.4.10", 827 | "version_check 0.9.2", 828 | "yansi", 829 | ] 830 | 831 | [[package]] 832 | name = "rocket_codegen" 833 | version = "0.4.11" 834 | source = "registry+https://github.com/rust-lang/crates.io-index" 835 | checksum = "2810037b5820098af97bd4fdd309e76a8101ceb178147de775c835a2537284fe" 836 | dependencies = [ 837 | "devise", 838 | "glob", 839 | "indexmap", 840 | "quote 0.6.13", 841 | "rocket_http", 842 | "version_check 0.9.2", 843 | "yansi", 844 | ] 845 | 846 | [[package]] 847 | name = "rocket_contrib" 848 | version = "0.4.10" 849 | source = "registry+https://github.com/rust-lang/crates.io-index" 850 | checksum = "6b6303dccab46dce6c7ac26c9b9d8d8cde1b19614b027c3f913be6611bff6d9b" 851 | dependencies = [ 852 | "log 0.4.17", 853 | "notify", 854 | "rocket", 855 | "serde", 856 | "serde_json", 857 | ] 858 | 859 | [[package]] 860 | name = "rocket_http" 861 | version = "0.4.11" 862 | source = "registry+https://github.com/rust-lang/crates.io-index" 863 | checksum = "2bf9cbd128e1f321a2d0bebd2b7cf0aafd89ca43edf69e49b56a5c46e48eb19f" 864 | dependencies = [ 865 | "cookie", 866 | "hyper", 867 | "indexmap", 868 | "pear", 869 | "percent-encoding 1.0.1", 870 | "smallvec 1.4.1", 871 | "state", 872 | "time", 873 | "unicode-xid 0.1.0", 874 | ] 875 | 876 | [[package]] 877 | name = "rustc_version" 878 | version = "0.2.3" 879 | source = "registry+https://github.com/rust-lang/crates.io-index" 880 | checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" 881 | dependencies = [ 882 | "semver", 883 | ] 884 | 885 | [[package]] 886 | name = "rustflake" 887 | version = "0.1.1" 888 | source = "registry+https://github.com/rust-lang/crates.io-index" 889 | checksum = "3fd2a23c7b59744081b34eadc799cda78e9471f333fe265c1dae05ab70d5ac94" 890 | dependencies = [ 891 | "chrono", 892 | "parking_lot", 893 | ] 894 | 895 | [[package]] 896 | name = "ryu" 897 | version = "1.0.5" 898 | source = "registry+https://github.com/rust-lang/crates.io-index" 899 | checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" 900 | 901 | [[package]] 902 | name = "safemem" 903 | version = "0.3.3" 904 | source = "registry+https://github.com/rust-lang/crates.io-index" 905 | checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" 906 | 907 | [[package]] 908 | name = "same-file" 909 | version = "1.0.6" 910 | source = "registry+https://github.com/rust-lang/crates.io-index" 911 | checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" 912 | dependencies = [ 913 | "winapi-util", 914 | ] 915 | 916 | [[package]] 917 | name = "scopeguard" 918 | version = "1.1.0" 919 | source = "registry+https://github.com/rust-lang/crates.io-index" 920 | checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" 921 | 922 | [[package]] 923 | name = "semver" 924 | version = "0.9.0" 925 | source = "registry+https://github.com/rust-lang/crates.io-index" 926 | checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" 927 | dependencies = [ 928 | "semver-parser", 929 | ] 930 | 931 | [[package]] 932 | name = "semver-parser" 933 | version = "0.7.0" 934 | source = "registry+https://github.com/rust-lang/crates.io-index" 935 | checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" 936 | 937 | [[package]] 938 | name = "serde" 939 | version = "1.0.137" 940 | source = "registry+https://github.com/rust-lang/crates.io-index" 941 | checksum = "61ea8d54c77f8315140a05f4c7237403bf38b72704d031543aa1d16abbf517d1" 942 | dependencies = [ 943 | "serde_derive", 944 | ] 945 | 946 | [[package]] 947 | name = "serde_derive" 948 | version = "1.0.137" 949 | source = "registry+https://github.com/rust-lang/crates.io-index" 950 | checksum = "1f26faba0c3959972377d3b2d306ee9f71faee9714294e41bb777f83f88578be" 951 | dependencies = [ 952 | "proc-macro2 1.0.36", 953 | "quote 1.0.7", 954 | "syn 1.0.92", 955 | ] 956 | 957 | [[package]] 958 | name = "serde_json" 959 | version = "1.0.56" 960 | source = "registry+https://github.com/rust-lang/crates.io-index" 961 | checksum = "3433e879a558dde8b5e8feb2a04899cf34fdde1fafb894687e52105fc1162ac3" 962 | dependencies = [ 963 | "itoa", 964 | "ryu", 965 | "serde", 966 | ] 967 | 968 | [[package]] 969 | name = "sha2" 970 | version = "0.8.2" 971 | source = "registry+https://github.com/rust-lang/crates.io-index" 972 | checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" 973 | dependencies = [ 974 | "block-buffer", 975 | "digest", 976 | "fake-simd", 977 | "opaque-debug", 978 | ] 979 | 980 | [[package]] 981 | name = "slab" 982 | version = "0.4.2" 983 | source = "registry+https://github.com/rust-lang/crates.io-index" 984 | checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" 985 | 986 | [[package]] 987 | name = "smallvec" 988 | version = "0.6.13" 989 | source = "registry+https://github.com/rust-lang/crates.io-index" 990 | checksum = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6" 991 | dependencies = [ 992 | "maybe-uninit", 993 | ] 994 | 995 | [[package]] 996 | name = "smallvec" 997 | version = "1.4.1" 998 | source = "registry+https://github.com/rust-lang/crates.io-index" 999 | checksum = "3757cb9d89161a2f24e1cf78efa0c1fcff485d18e3f55e0aa3480824ddaa0f3f" 1000 | 1001 | [[package]] 1002 | name = "state" 1003 | version = "0.4.1" 1004 | source = "registry+https://github.com/rust-lang/crates.io-index" 1005 | checksum = "7345c971d1ef21ffdbd103a75990a15eb03604fc8b8852ca8cb418ee1a099028" 1006 | 1007 | [[package]] 1008 | name = "subtle" 1009 | version = "1.0.0" 1010 | source = "registry+https://github.com/rust-lang/crates.io-index" 1011 | checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" 1012 | 1013 | [[package]] 1014 | name = "subtle" 1015 | version = "2.2.3" 1016 | source = "registry+https://github.com/rust-lang/crates.io-index" 1017 | checksum = "502d53007c02d7605a05df1c1a73ee436952781653da5d0bf57ad608f66932c1" 1018 | 1019 | [[package]] 1020 | name = "syn" 1021 | version = "0.15.44" 1022 | source = "registry+https://github.com/rust-lang/crates.io-index" 1023 | checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" 1024 | dependencies = [ 1025 | "proc-macro2 0.4.30", 1026 | "quote 0.6.13", 1027 | "unicode-xid 0.1.0", 1028 | ] 1029 | 1030 | [[package]] 1031 | name = "syn" 1032 | version = "1.0.92" 1033 | source = "registry+https://github.com/rust-lang/crates.io-index" 1034 | checksum = "7ff7c592601f11445996a06f8ad0c27f094a58857c2f89e97974ab9235b92c52" 1035 | dependencies = [ 1036 | "proc-macro2 1.0.36", 1037 | "quote 1.0.7", 1038 | "unicode-xid 0.2.1", 1039 | ] 1040 | 1041 | [[package]] 1042 | name = "time" 1043 | version = "0.1.43" 1044 | source = "registry+https://github.com/rust-lang/crates.io-index" 1045 | checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" 1046 | dependencies = [ 1047 | "libc", 1048 | "winapi 0.3.9", 1049 | ] 1050 | 1051 | [[package]] 1052 | name = "tinyvec" 1053 | version = "0.3.3" 1054 | source = "registry+https://github.com/rust-lang/crates.io-index" 1055 | checksum = "53953d2d3a5ad81d9f844a32f14ebb121f50b650cd59d0ee2a07cf13c617efed" 1056 | 1057 | [[package]] 1058 | name = "toml" 1059 | version = "0.4.10" 1060 | source = "registry+https://github.com/rust-lang/crates.io-index" 1061 | checksum = "758664fc71a3a69038656bee8b6be6477d2a6c315a6b81f7081f591bffa4111f" 1062 | dependencies = [ 1063 | "serde", 1064 | ] 1065 | 1066 | [[package]] 1067 | name = "toml" 1068 | version = "0.5.9" 1069 | source = "registry+https://github.com/rust-lang/crates.io-index" 1070 | checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" 1071 | dependencies = [ 1072 | "serde", 1073 | ] 1074 | 1075 | [[package]] 1076 | name = "traitobject" 1077 | version = "0.1.0" 1078 | source = "registry+https://github.com/rust-lang/crates.io-index" 1079 | checksum = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" 1080 | 1081 | [[package]] 1082 | name = "typeable" 1083 | version = "0.1.2" 1084 | source = "registry+https://github.com/rust-lang/crates.io-index" 1085 | checksum = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" 1086 | 1087 | [[package]] 1088 | name = "typenum" 1089 | version = "1.12.0" 1090 | source = "registry+https://github.com/rust-lang/crates.io-index" 1091 | checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" 1092 | 1093 | [[package]] 1094 | name = "unicase" 1095 | version = "1.4.2" 1096 | source = "registry+https://github.com/rust-lang/crates.io-index" 1097 | checksum = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" 1098 | dependencies = [ 1099 | "version_check 0.1.5", 1100 | ] 1101 | 1102 | [[package]] 1103 | name = "unicode-bidi" 1104 | version = "0.3.4" 1105 | source = "registry+https://github.com/rust-lang/crates.io-index" 1106 | checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" 1107 | dependencies = [ 1108 | "matches", 1109 | ] 1110 | 1111 | [[package]] 1112 | name = "unicode-normalization" 1113 | version = "0.1.13" 1114 | source = "registry+https://github.com/rust-lang/crates.io-index" 1115 | checksum = "6fb19cf769fa8c6a80a162df694621ebeb4dafb606470b2b2fce0be40a98a977" 1116 | dependencies = [ 1117 | "tinyvec", 1118 | ] 1119 | 1120 | [[package]] 1121 | name = "unicode-xid" 1122 | version = "0.1.0" 1123 | source = "registry+https://github.com/rust-lang/crates.io-index" 1124 | checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" 1125 | 1126 | [[package]] 1127 | name = "unicode-xid" 1128 | version = "0.2.1" 1129 | source = "registry+https://github.com/rust-lang/crates.io-index" 1130 | checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" 1131 | 1132 | [[package]] 1133 | name = "universal-hash" 1134 | version = "0.3.0" 1135 | source = "registry+https://github.com/rust-lang/crates.io-index" 1136 | checksum = "df0c900f2f9b4116803415878ff48b63da9edb268668e08cf9292d7503114a01" 1137 | dependencies = [ 1138 | "generic-array", 1139 | "subtle 2.2.3", 1140 | ] 1141 | 1142 | [[package]] 1143 | name = "url" 1144 | version = "1.7.2" 1145 | source = "registry+https://github.com/rust-lang/crates.io-index" 1146 | checksum = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" 1147 | dependencies = [ 1148 | "idna", 1149 | "matches", 1150 | "percent-encoding 1.0.1", 1151 | ] 1152 | 1153 | [[package]] 1154 | name = "version_check" 1155 | version = "0.1.5" 1156 | source = "registry+https://github.com/rust-lang/crates.io-index" 1157 | checksum = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" 1158 | 1159 | [[package]] 1160 | name = "version_check" 1161 | version = "0.9.2" 1162 | source = "registry+https://github.com/rust-lang/crates.io-index" 1163 | checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" 1164 | 1165 | [[package]] 1166 | name = "walkdir" 1167 | version = "2.3.1" 1168 | source = "registry+https://github.com/rust-lang/crates.io-index" 1169 | checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" 1170 | dependencies = [ 1171 | "same-file", 1172 | "winapi 0.3.9", 1173 | "winapi-util", 1174 | ] 1175 | 1176 | [[package]] 1177 | name = "wasi" 1178 | version = "0.9.0+wasi-snapshot-preview1" 1179 | source = "registry+https://github.com/rust-lang/crates.io-index" 1180 | checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" 1181 | 1182 | [[package]] 1183 | name = "winapi" 1184 | version = "0.2.8" 1185 | source = "registry+https://github.com/rust-lang/crates.io-index" 1186 | checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" 1187 | 1188 | [[package]] 1189 | name = "winapi" 1190 | version = "0.3.9" 1191 | source = "registry+https://github.com/rust-lang/crates.io-index" 1192 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1193 | dependencies = [ 1194 | "winapi-i686-pc-windows-gnu", 1195 | "winapi-x86_64-pc-windows-gnu", 1196 | ] 1197 | 1198 | [[package]] 1199 | name = "winapi-build" 1200 | version = "0.1.1" 1201 | source = "registry+https://github.com/rust-lang/crates.io-index" 1202 | checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" 1203 | 1204 | [[package]] 1205 | name = "winapi-i686-pc-windows-gnu" 1206 | version = "0.4.0" 1207 | source = "registry+https://github.com/rust-lang/crates.io-index" 1208 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1209 | 1210 | [[package]] 1211 | name = "winapi-util" 1212 | version = "0.1.5" 1213 | source = "registry+https://github.com/rust-lang/crates.io-index" 1214 | checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" 1215 | dependencies = [ 1216 | "winapi 0.3.9", 1217 | ] 1218 | 1219 | [[package]] 1220 | name = "winapi-x86_64-pc-windows-gnu" 1221 | version = "0.4.0" 1222 | source = "registry+https://github.com/rust-lang/crates.io-index" 1223 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1224 | 1225 | [[package]] 1226 | name = "ws2_32-sys" 1227 | version = "0.2.1" 1228 | source = "registry+https://github.com/rust-lang/crates.io-index" 1229 | checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" 1230 | dependencies = [ 1231 | "winapi 0.2.8", 1232 | "winapi-build", 1233 | ] 1234 | 1235 | [[package]] 1236 | name = "yansi" 1237 | version = "0.5.0" 1238 | source = "registry+https://github.com/rust-lang/crates.io-index" 1239 | checksum = "9fc79f4a1e39857fc00c3f662cbf2651c771f00e9c15fe2abc341806bd46bd71" 1240 | 1241 | [[package]] 1242 | name = "zeroize" 1243 | version = "1.1.0" 1244 | source = "registry+https://github.com/rust-lang/crates.io-index" 1245 | checksum = "3cbac2ed2ba24cc90f5e06485ac8c7c1e5449fe8911aef4d8877218af021a5b8" 1246 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "myrias" 3 | version = "0.1.0" 4 | authors = ["iCrawl "] 5 | edition = "2018" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | rocket = "0.4.11" 11 | serde = { version = "1.0.137", features = ["derive"] } 12 | log = "0.4.17" 13 | rustflake = "0.1.1" 14 | toml = "0.5.9" 15 | 16 | [dependencies.rocket_contrib] 17 | version = "0.4.10" 18 | default-features = false 19 | features = ["json"] 20 | 21 | [profile.release] 22 | lto = true 23 | codegen-units = 1 24 | -------------------------------------------------------------------------------- /Config.example.toml: -------------------------------------------------------------------------------- 1 | languages = ["rust", "typescript", "javascript"] 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 iCrawl 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Myrias 2 | 3 | Arbitrary code execution server using Docker //in Rust//. 4 | 5 | ## Setup (Linux only) 6 | You have to [install](https://gvisor.dev/docs/user_guide/docker/) [gVisor](https://github.com/google/gvisor) as a runtime for docker to provide an additional isolation boundary between the containers and the host kernel. 7 | 8 | ```sh 9 | ( 10 | set -e 11 | wget https://storage.googleapis.com/gvisor/releases/nightly/latest/runsc 12 | wget https://storage.googleapis.com/gvisor/releases/nightly/latest/runsc.sha512 13 | sha512sum -c runsc.sha512 14 | sudo mv runsc /usr/local/bin 15 | sudo chown root:root /usr/local/bin/runsc 16 | sudo chmod 0755 /usr/local/bin/runsc 17 | ) 18 | ``` 19 | 20 | `/etc/docker/daemon.json`: 21 | ```json 22 | { 23 | "runtimes": { 24 | "runsc": { 25 | "path": "/usr/local/bin/runsc", 26 | "runtimeArgs": [ 27 | "--network=none", 28 | "--overlay" 29 | ] 30 | }, 31 | "runsc-kvm": { 32 | "path": "/usr/local/bin/runsc", 33 | "runtimeArgs": [ 34 | "--platform=kvm", 35 | "--network=none", 36 | "--overlay" 37 | ] 38 | } 39 | } 40 | } 41 | ``` 42 | You may have to create this file if it does not exist. 43 | 44 | ## Installation 45 | [Archives of precompiled binares for Myrias will be available for Windows, macOS and Linux.](https://github.com/iCrawl/myrias/releases) 46 | 47 | Linux binaries are static executables. Windows binaries are available built with Microsoft Visual C++ (MSVC). 48 | 49 | ## Running 50 | 51 | TBD 52 | 53 | ## Motivation 54 | - [Myriad](https://github.com/1Computer1/myriad): I just really can't read/write Haskell. 55 | 56 | ## Endpoints 57 | 58 | ### **GET** `/languages` 59 | List of enabled languages. 60 | Example response: 61 | 62 | ```json 63 | ["rust", "typescript"] 64 | ``` 65 | 66 | ### **POST** `/create_container` 67 | Creates a language container (if not already present). 68 | JSON payload with `language` key. 69 | The `language` is as in the name of a subfolder in the `languages` directory. 70 | Example payload: 71 | 72 | ```json 73 | { "language": "rust" } 74 | ``` 75 | 76 | ### **POST** `/eval` 77 | Evaluate code. 78 | JSON payload with `language` and `code` keys. 79 | The `language` is as in the name of a subfolder in the `languages` directory. 80 | Example payload: 81 | 82 | ```json 83 | { "language": "rust", "code": "fn main() { println!(\"{}\", 1 + 1); }" } 84 | ``` 85 | 86 | Example response: 87 | ```json 88 | { "result": "2\n" } 89 | ``` 90 | 91 | Errors with 404 if `language` is not found, `504` if evaluation timed out, or `500` if evaluation failed for other reasons. 92 | 93 | ### **GET** `/containers` 94 | List of containers being handled by Myrias. 95 | 96 | ### **POST** `/cleanup` 97 | Kill all containers, giving back the names of the containers killed. 98 | -------------------------------------------------------------------------------- /Rocket.toml: -------------------------------------------------------------------------------- 1 | [development] 2 | address = "localhost" 3 | port = 7200 4 | 5 | [production] 6 | address = "localhost" 7 | port = 7200 8 | -------------------------------------------------------------------------------- /languages/apl/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM juergensauermann/gnu-apl 2 | LABEL author="1Computer1" 3 | 4 | COPY run.sh /var/run/ 5 | -------------------------------------------------------------------------------- /languages/apl/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | printf %s "$1" > program.apl 5 | apl --OFF -s -f program.apl || true 6 | -------------------------------------------------------------------------------- /languages/bash/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM bash 2 | LABEL author="1Computer1" 3 | 4 | COPY run.sh /var/run/ 5 | -------------------------------------------------------------------------------- /languages/bash/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | printf %s "$1" > program.sh 5 | bash program.sh || true 6 | -------------------------------------------------------------------------------- /languages/brainfuck/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:latest AS build 2 | 3 | RUN apk update && apk add g++ 4 | COPY bf.cpp . 5 | RUN g++ bf.cpp -o bf 6 | 7 | FROM alpine:latest 8 | LABEL author="1Computer1" 9 | 10 | RUN apk update && apk add libstdc++ 11 | COPY --from=build bf /usr/local/bin/ 12 | COPY run.sh /var/run/ 13 | -------------------------------------------------------------------------------- /languages/brainfuck/bf.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int main(int argc, char **argv) { 7 | std::string ops; 8 | if (argc == 1) { 9 | std::string line; 10 | while (std::getline(std::cin, line)) { 11 | ops.append(line); 12 | } 13 | 14 | if (ops.empty()) { 15 | std::cerr << "No input given"; 16 | return 1; 17 | } 18 | } else { 19 | ops.assign(argv[1], strlen(argv[1])); 20 | } 21 | 22 | int len = ops.length(); 23 | std::vector tape = { 0 }; 24 | int oix = 0; 25 | int tix = 0; 26 | while (oix < len) { 27 | switch (ops[oix]) { 28 | case '>': 29 | tix++; 30 | if (tix >= tape.size()) { 31 | tape.push_back(0); 32 | } 33 | 34 | oix++; 35 | break; 36 | case '<': 37 | tix--; 38 | if (tix < 0) { 39 | std::cerr << "Out of bounds"; 40 | return 1; 41 | } 42 | 43 | oix++; 44 | break; 45 | case '+': 46 | tape[tix]++; 47 | oix++; 48 | break; 49 | case '-': 50 | tape[tix]--; 51 | oix++; 52 | break; 53 | case '.': 54 | std::cout << tape[tix]; 55 | oix++; 56 | break; 57 | case ',': 58 | std::cin >> tape[tix]; 59 | oix++; 60 | break; 61 | case '[': 62 | if (tape[tix] == 0) { 63 | int ls = 0; 64 | int rs = 0; 65 | for (int i = oix; i < len; i++) { 66 | switch (ops[i]) { 67 | case '[': 68 | ls++; 69 | break; 70 | case ']': 71 | rs++; 72 | break; 73 | default: 74 | break; 75 | } 76 | 77 | if (ls == rs) { 78 | oix = i + 1; 79 | break; 80 | } 81 | } 82 | } else { 83 | oix++; 84 | } 85 | 86 | break; 87 | case ']': 88 | if (tape[tix] != 0) { 89 | int ls = 0; 90 | int rs = 0; 91 | for (int i = oix; i >= 0; i--) { 92 | switch (ops[i]) { 93 | case '[': 94 | ls++; 95 | break; 96 | case ']': 97 | rs++; 98 | break; 99 | default: 100 | break; 101 | } 102 | 103 | if (ls == rs) { 104 | oix = i + 1; 105 | break; 106 | } 107 | } 108 | } else { 109 | oix++; 110 | } 111 | 112 | break; 113 | default: 114 | oix++; 115 | } 116 | } 117 | 118 | return 0; 119 | } 120 | -------------------------------------------------------------------------------- /languages/brainfuck/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | printf %s "$1" | bf || true 5 | -------------------------------------------------------------------------------- /languages/c/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:latest 2 | LABEL author="1Computer1" 3 | 4 | RUN apk update 5 | RUN apk add gcc libc-dev 6 | 7 | COPY run.sh /var/run/ 8 | -------------------------------------------------------------------------------- /languages/c/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | printf %s "$1" > program.c 5 | gcc program.c -o program && ./program || true 6 | -------------------------------------------------------------------------------- /languages/clojure/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM clojure:tools-deps-alpine 2 | LABEL author="1Computer1" 3 | 4 | COPY run.sh /var/run/ 5 | -------------------------------------------------------------------------------- /languages/clojure/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | printf %s "$1" > program.clj 5 | clojure program.clj || true 6 | -------------------------------------------------------------------------------- /languages/cpp/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:latest 2 | LABEL author="1Computer1" 3 | 4 | RUN apk update 5 | RUN apk add g++ 6 | 7 | COPY run.sh /var/run/ 8 | -------------------------------------------------------------------------------- /languages/cpp/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | printf %s "$1" > program.cpp 5 | g++ program.cpp -o program && ./program || true 6 | -------------------------------------------------------------------------------- /languages/csharp/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mono:slim 2 | LABEL author="1Computer1" 3 | 4 | COPY run.sh /var/run/ 5 | -------------------------------------------------------------------------------- /languages/csharp/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | printf %s "$1" > program.cs 5 | csc program.cs >/dev/null && mono program.exe || true 6 | -------------------------------------------------------------------------------- /languages/elixir/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM elixir:alpine 2 | LABEL author="1Computer1" 3 | 4 | COPY run.sh /var/run/ 5 | -------------------------------------------------------------------------------- /languages/elixir/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | printf %s "$1" > program.exs 5 | elixir program.exs || true 6 | -------------------------------------------------------------------------------- /languages/fsharp/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM fsharp 2 | LABEL author="1Computer1" 3 | 4 | COPY run.sh /var/run/ 5 | -------------------------------------------------------------------------------- /languages/fsharp/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | printf %s "$1" > program.fs 5 | fsharpc --optimize- program.fs >/dev/null && mono program.exe || true 6 | -------------------------------------------------------------------------------- /languages/go/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:alpine 2 | LABEL author="1Computer1" 3 | 4 | COPY run.sh /var/run/ 5 | -------------------------------------------------------------------------------- /languages/go/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | export GOCACHE=/tmp/"$CODEDIR"/cache 5 | printf %s "$1" > program.go 6 | go run program.go || true 7 | -------------------------------------------------------------------------------- /languages/haskell/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:stretch 2 | LABEL author="1Computer1" 3 | ENV LANG C.UTF-8 4 | 5 | RUN apt-get update && \ 6 | apt-get install -y --no-install-recommends gnupg dirmngr && \ 7 | echo 'deb http://downloads.haskell.org/debian stretch main' > /etc/apt/sources.list.d/ghc.list && \ 8 | apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA3CBA3FFE22B574 && \ 9 | apt-get update && \ 10 | apt-get install -y --no-install-recommends ghc-8.6.5 11 | 12 | ENV PATH /opt/ghc/8.6.5/bin:$PATH 13 | 14 | COPY run.sh /var/run/ 15 | -------------------------------------------------------------------------------- /languages/haskell/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | printf %s "$1" > program.hs 5 | ghc -e main program.hs || true 6 | -------------------------------------------------------------------------------- /languages/idris/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:latest 2 | 3 | RUN echo "@testing http://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \ 4 | apk update && \ 5 | apk add idris@testing 6 | 7 | COPY run.sh /var/run/ 8 | -------------------------------------------------------------------------------- /languages/idris/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | printf %s "$1" > Main.idr 5 | idris --execute ./Main.idr || true 6 | -------------------------------------------------------------------------------- /languages/java/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:13-alpine 2 | LABEL author="1Computer1" 3 | 4 | COPY run.sh /var/run/ 5 | -------------------------------------------------------------------------------- /languages/java/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | printf %s "$1" > Main.java 5 | javac Main.java && java Main || true 6 | -------------------------------------------------------------------------------- /languages/javascript/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:alpine 2 | LABEL author="1Computer1" 3 | 4 | COPY run.sh /var/run/ 5 | -------------------------------------------------------------------------------- /languages/javascript/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | printf %s "$1" | node -p || true 5 | -------------------------------------------------------------------------------- /languages/julia/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM julia 2 | LABEL author="1Computer1" 3 | 4 | COPY run.sh /var/run/ 5 | -------------------------------------------------------------------------------- /languages/julia/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | printf %s "$1" > program.jl 5 | julia program.jl || true 6 | -------------------------------------------------------------------------------- /languages/lua/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:latest 2 | 3 | RUN apk update 4 | RUN apk add lua5.3 5 | 6 | COPY run.sh /var/run/ 7 | -------------------------------------------------------------------------------- /languages/lua/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | printf %s "$1" > program.lua 5 | lua5.3 program.lua || true 6 | -------------------------------------------------------------------------------- /languages/ocaml/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM frolvlad/alpine-ocaml 2 | LABEL author="1Computer1" 3 | 4 | COPY run.sh /var/run/ 5 | -------------------------------------------------------------------------------- /languages/ocaml/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | printf %s "$1" > program.ml 5 | ocamlopt -cclib --static -o program program.ml && ./program || true 6 | -------------------------------------------------------------------------------- /languages/pascal/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM frolvlad/alpine-fpc 2 | LABEL author="1Computer1" 3 | 4 | COPY run.sh /var/run/ 5 | -------------------------------------------------------------------------------- /languages/pascal/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | printf %s "$1" > program.pas 5 | 6 | # fpc does not use stderr, ld however does, capture both 7 | res="$(fpc program.pas 2>&1)" 8 | 9 | if [ $? -eq 0 ]; then 10 | ./program || true 11 | else 12 | printf %s "$res" 13 | fi 14 | -------------------------------------------------------------------------------- /languages/perl/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM perl:slim 2 | LABEL author="1Computer1" 3 | 4 | COPY run.sh /var/run/ 5 | -------------------------------------------------------------------------------- /languages/perl/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | printf %s "$1" > program.pl 5 | perl program.pl || true 6 | -------------------------------------------------------------------------------- /languages/php/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:alpine 2 | LABEL author="1Computer1" 3 | 4 | COPY run.sh /var/run/ 5 | -------------------------------------------------------------------------------- /languages/php/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | printf %s "$1" > program.php 5 | php program.php || true 6 | -------------------------------------------------------------------------------- /languages/prolog/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM swipl:latest 2 | LABEL author="1Computer1" 3 | 4 | COPY run.sh /var/run/ 5 | -------------------------------------------------------------------------------- /languages/prolog/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | printf %s "$1" > program.pl 5 | swipl --quiet program.pl || true 6 | -------------------------------------------------------------------------------- /languages/python/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3-alpine 2 | LABEL author="1Computer1" 3 | 4 | COPY run.sh /var/run/ 5 | -------------------------------------------------------------------------------- /languages/python/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | printf %s "$1" > program.py 5 | python program.py || true 6 | -------------------------------------------------------------------------------- /languages/racket/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM jackfirth/racket 2 | LABEL author="1Computer1" 3 | 4 | COPY run.sh /var/run/ 5 | -------------------------------------------------------------------------------- /languages/racket/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | printf %s "$1" > program.rkt 5 | racket program.rkt || true 6 | -------------------------------------------------------------------------------- /languages/ruby/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ruby:alpine 2 | LABEL author="1Computer1" 3 | 4 | COPY run.sh /var/run/ 5 | -------------------------------------------------------------------------------- /languages/ruby/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | printf %s "$1" > program.rb 5 | ruby program.rb || true 6 | -------------------------------------------------------------------------------- /languages/rust/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rust:slim 2 | LABEL author="1Computer1" 3 | 4 | COPY run.sh /var/run/ 5 | -------------------------------------------------------------------------------- /languages/rust/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | printf %s "$1" > program.rs 5 | rustc -C opt-level=0 --color never program.rs && ./program || true 6 | -------------------------------------------------------------------------------- /languages/typescript/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:alpine 2 | LABEL author="iCrawl" 3 | 4 | RUN yarn global add ts-node typescript 5 | 6 | COPY run.sh /var/run/ 7 | -------------------------------------------------------------------------------- /languages/typescript/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | printf %s "$1" | ts-node -p || true 5 | -------------------------------------------------------------------------------- /src/docker.rs: -------------------------------------------------------------------------------- 1 | use std::process::{Command, Stdio}; 2 | 3 | pub struct Docker; 4 | 5 | impl Docker { 6 | pub fn exec(args: &[&str]) { 7 | Command::new("docker") 8 | .args(args) 9 | .stdin(Stdio::null()) 10 | .stdout(Stdio::null()) 11 | .stderr(Stdio::null()) 12 | .status() 13 | .unwrap(); 14 | } 15 | 16 | pub fn start_container(language: &str) { 17 | let args = &[ 18 | "run", 19 | "--rm", 20 | &format!("--name=myrias_{}", language), 21 | "-u1000:1000", 22 | "-w/tmp/", 23 | "-dt", 24 | "--net=none", 25 | "--cpus=0.25", 26 | "-m=128m", 27 | "--memory-swap=128m", 28 | &format!("myrias_{}:latest", language), 29 | "/bin/sh", 30 | ]; 31 | 32 | #[cfg(target_os = "linux")] 33 | args.insert(1, "--runtime=runsc".to_string()); 34 | 35 | Docker::exec(args); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/lib.rs: -------------------------------------------------------------------------------- 1 | #![feature(proc_macro_hygiene, decl_macro)] 2 | 3 | pub mod docker; 4 | pub mod router; 5 | 6 | use serde::Deserialize; 7 | use std::fs; 8 | 9 | #[derive(Deserialize)] 10 | pub struct Config { 11 | languages: Vec, 12 | } 13 | 14 | impl Config { 15 | pub fn from_file(path: &str) -> Config { 16 | let toml_str = fs::read_to_string(path).unwrap(); 17 | toml::from_str(&toml_str).unwrap() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | #![feature(proc_macro_hygiene, decl_macro)] 2 | 3 | use myrias::{router, Config}; 4 | use rocket::{catchers, routes}; 5 | 6 | fn main() { 7 | std::env::set_var("ROCKET_CLI_COLORS", "off"); 8 | let config = Config::from_file("Config.toml"); 9 | 10 | rocket::ignite() 11 | .manage(config) 12 | .register(catchers![ 13 | router::not_found::index, 14 | router::gateway_timeout::index, 15 | router::internal_server_error::index 16 | ]) 17 | .mount( 18 | "/", 19 | routes![ 20 | router::languages::index, 21 | router::create_container::index, 22 | router::eval::index, 23 | router::containers::index, 24 | router::cleanup::index, 25 | ], 26 | ) 27 | .launch(); 28 | } 29 | -------------------------------------------------------------------------------- /src/router.rs: -------------------------------------------------------------------------------- 1 | pub mod cleanup; 2 | pub mod containers; 3 | pub mod create_container; 4 | pub mod eval; 5 | pub mod gateway_timeout; 6 | pub mod internal_server_error; 7 | pub mod languages; 8 | pub mod not_found; 9 | -------------------------------------------------------------------------------- /src/router/cleanup.rs: -------------------------------------------------------------------------------- 1 | use log::info; 2 | use rocket::post; 3 | use rocket_contrib::{json, json::JsonValue}; 4 | use std::process::Command; 5 | 6 | #[post("/cleanup")] 7 | pub fn index() -> JsonValue { 8 | info!("Getting all myrias container"); 9 | let ouput = Command::new("docker") 10 | .args(&["ps", "--filter", "name=myrias_", "--format", "{{.Names}}"]) 11 | .output() 12 | .unwrap(); 13 | info!("Finished getting all myrias container"); 14 | 15 | let mut res: Vec = if ouput.stderr.is_empty() { 16 | String::from_utf8_lossy(&ouput.stdout) 17 | .lines() 18 | .map(|x| x.trim().to_string()) 19 | .collect() 20 | } else { 21 | return json!([] as [String; 0]); 22 | }; 23 | 24 | res.insert(0, "kill".to_string()); 25 | let output = Command::new("docker").args(res).output().unwrap(); 26 | 27 | let res: Vec = if output.stderr.is_empty() { 28 | String::from_utf8_lossy(&output.stdout) 29 | .lines() 30 | .map(|x| x.trim().to_string()) 31 | .collect() 32 | } else { 33 | return json!([] as [String; 0]); 34 | }; 35 | 36 | json!(res) 37 | } 38 | -------------------------------------------------------------------------------- /src/router/containers.rs: -------------------------------------------------------------------------------- 1 | use log::info; 2 | use rocket::get; 3 | use rocket_contrib::{json, json::JsonValue}; 4 | use std::process::Command; 5 | 6 | #[get("/containers")] 7 | pub fn index() -> JsonValue { 8 | info!("Listing all myrias container"); 9 | let output = Command::new("docker") 10 | .args(&["ps", "--filter", "name=myrias_", "--format", "{{.Names}}"]) 11 | .output() 12 | .unwrap(); 13 | info!("Finished listing all myrias container"); 14 | 15 | let res: Vec = if output.stderr.is_empty() { 16 | String::from_utf8_lossy(&output.stdout) 17 | .lines() 18 | .map(|x| x.trim().to_string()) 19 | .collect() 20 | } else { 21 | return json!([] as [String; 0]); 22 | }; 23 | 24 | json!(res) 25 | } 26 | -------------------------------------------------------------------------------- /src/router/create_container.rs: -------------------------------------------------------------------------------- 1 | use log::info; 2 | use rocket::{http::Status, post}; 3 | use rocket_contrib::json::Json; 4 | use serde::Deserialize; 5 | 6 | use crate::docker::Docker; 7 | 8 | #[derive(Deserialize)] 9 | pub struct CreateContainerInput { 10 | language: String, 11 | } 12 | 13 | #[post("/create_container", format = "json", data = "")] 14 | pub fn index(create: Json) -> Status { 15 | info!("Building container: myrias_{}", create.language); 16 | Docker::start_container(&create.language); 17 | info!("Built container: myrias_{}", create.language); 18 | info!( 19 | "Creating eval directory in container: myrias_{}", 20 | create.language 21 | ); 22 | Docker::exec(&[ 23 | "exec", 24 | &format!("myrias_{}", create.language), 25 | "mkdir", 26 | "eval", 27 | ]); 28 | info!( 29 | "Created eval directory in container: myrias_{}", 30 | create.language 31 | ); 32 | 33 | info!( 34 | "Chmod eval directory to 711 in container: myrias_{}", 35 | create.language 36 | ); 37 | Docker::exec(&[ 38 | "exec", 39 | &format!("myrias_{}", create.language), 40 | "chmod", 41 | "711", 42 | "eval", 43 | ]); 44 | info!( 45 | "Chmod' eval directory in container: myrias_{}", 46 | create.language 47 | ); 48 | 49 | Status::Created 50 | } 51 | -------------------------------------------------------------------------------- /src/router/eval.rs: -------------------------------------------------------------------------------- 1 | use log::info; 2 | use rocket::{http::Status, post, State}; 3 | use rocket_contrib::{ 4 | json, 5 | json::{Json, JsonValue}, 6 | }; 7 | use rustflake::Snowflake; 8 | use serde::{Deserialize, Serialize}; 9 | use std::process::Command; 10 | use std::sync::{mpsc, mpsc::RecvTimeoutError}; 11 | use std::thread; 12 | use std::time::Duration; 13 | 14 | use crate::docker::Docker; 15 | use crate::Config; 16 | 17 | #[derive(Serialize, Deserialize)] 18 | pub struct EvalInput { 19 | language: String, 20 | code: String, 21 | } 22 | 23 | #[post("/eval", format = "json", data = "")] 24 | pub fn index(eval: Json, config: State) -> Result { 25 | if !config.languages.contains(&eval.language) { 26 | return Err(Status::NotFound); 27 | } 28 | 29 | let snowflake = Snowflake::default().generate(); 30 | 31 | info!( 32 | "Creating unique eval folder in container: myrias_{}", 33 | eval.language 34 | ); 35 | Docker::exec(&[ 36 | "exec", 37 | &format!("myrias_{}", eval.language), 38 | "mkdir", 39 | &format!("eval/{}", &snowflake), 40 | ]); 41 | info!( 42 | "Created unique eval folder in container: myrias_{}", 43 | eval.language 44 | ); 45 | 46 | info!( 47 | "Chmod unique eval directory to 711 in container: myrias_{}", 48 | eval.language 49 | ); 50 | Docker::exec(&[ 51 | "exec", 52 | &format!("myrias_{}", eval.language), 53 | "chmod", 54 | "777", 55 | &format!("eval/{}", &snowflake), 56 | ]); 57 | info!( 58 | "Chmod' unique eval directory in container: myrias_{}", 59 | eval.language 60 | ); 61 | 62 | info!("Eval in container: myrias_{}", eval.language); 63 | let e = eval.language.clone(); 64 | let (sender, recv) = mpsc::channel(); 65 | thread::spawn(move || { 66 | if let Ok(()) = sender.send( 67 | Command::new("docker") 68 | .args(&[ 69 | "exec", 70 | "-u1001:1001", 71 | &format!("-w/tmp/eval/{}", &snowflake), 72 | &format!("myrias_{}", eval.language), 73 | "/bin/sh", 74 | "/var/run/run.sh", 75 | &eval.code, 76 | ]) 77 | .output() 78 | .unwrap(), 79 | ) {} 80 | }); 81 | 82 | let output = match recv.recv_timeout(Duration::from_secs(15)) { 83 | Ok(res) => res, 84 | Err(RecvTimeoutError::Timeout) => { 85 | info!("Eval timed out in container: myrias_{}", e); 86 | info!("Killing container: myrias_{}", e); 87 | Docker::exec(&["kill", &format!("myrias_{}", e)]); 88 | info!("Killed container: myrias_{}", e); 89 | info!("Restarting container: myrias_{}", e); 90 | Docker::start_container(&e); 91 | info!("Restarted container: myrias_{}", e); 92 | 93 | return Err(Status::GatewayTimeout); 94 | } 95 | Err(RecvTimeoutError::Disconnected) => { 96 | return Err(Status::InternalServerError); 97 | } 98 | }; 99 | 100 | info!("Finished eval in container: myrias_{}", e); 101 | 102 | let res = if output.stderr.is_empty() { 103 | String::from_utf8_lossy(&output.stdout) 104 | } else { 105 | String::from_utf8_lossy(&output.stderr) 106 | }; 107 | 108 | info!("Removing unique eval folder in container: myrias_{}", e); 109 | Docker::exec(&[ 110 | "exec", 111 | &format!("myrias_{}", e), 112 | "rm", 113 | "-rf", 114 | &format!("eval/{}", &snowflake), 115 | ]); 116 | info!("Removed unique eval folder in container: myrias_{}", e); 117 | 118 | Ok(json!({ "result": res.to_string() })) 119 | } 120 | -------------------------------------------------------------------------------- /src/router/gateway_timeout.rs: -------------------------------------------------------------------------------- 1 | use rocket::catch; 2 | use rocket_contrib::{json, json::JsonValue}; 3 | 4 | #[catch(504)] 5 | pub fn index() -> JsonValue { 6 | json!({ "message": "Evaluation timed out." }) 7 | } 8 | -------------------------------------------------------------------------------- /src/router/internal_server_error.rs: -------------------------------------------------------------------------------- 1 | use rocket::catch; 2 | use rocket_contrib::{json, json::JsonValue}; 3 | 4 | #[catch(504)] 5 | pub fn index() -> JsonValue { 6 | json!({ "message": "Evaluation failed." }) 7 | } 8 | -------------------------------------------------------------------------------- /src/router/languages.rs: -------------------------------------------------------------------------------- 1 | use log::info; 2 | use rocket::{get, State}; 3 | use rocket_contrib::{json, json::JsonValue}; 4 | 5 | use crate::Config; 6 | 7 | #[get("/languages", format = "json")] 8 | pub fn index(config: State) -> JsonValue { 9 | info!("Listing all myrias enabled languages"); 10 | json!(&config.languages) 11 | } 12 | -------------------------------------------------------------------------------- /src/router/not_found.rs: -------------------------------------------------------------------------------- 1 | use rocket::catch; 2 | use rocket_contrib::{json, json::JsonValue}; 3 | 4 | #[catch(404)] 5 | pub fn index() -> JsonValue { 6 | json!({ "message": "Language not found." }) 7 | } 8 | --------------------------------------------------------------------------------