├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── LICENSE-APACHE ├── LICENSE-MIT ├── README.md ├── Rocket.toml ├── deploy ├── build.sh └── docker │ ├── Dockerfile │ ├── entrypoint.sh │ └── rustc-wasm └── src ├── main.rs └── sandbox.rs /.gitignore: -------------------------------------------------------------------------------- 1 | .git-private 2 | /target 3 | *.*~ 4 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "aead" 5 | version = "0.3.2" 6 | source = "registry+https://github.com/rust-lang/crates.io-index" 7 | checksum = "7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331" 8 | dependencies = [ 9 | "generic-array", 10 | ] 11 | 12 | [[package]] 13 | name = "aes" 14 | version = "0.4.0" 15 | source = "registry+https://github.com/rust-lang/crates.io-index" 16 | checksum = "f7001367fde4c768a19d1029f0a8be5abd9308e1119846d5bd9ad26297b8faf5" 17 | dependencies = [ 18 | "aes-soft", 19 | "aesni", 20 | "block-cipher", 21 | ] 22 | 23 | [[package]] 24 | name = "aes-gcm" 25 | version = "0.6.0" 26 | source = "registry+https://github.com/rust-lang/crates.io-index" 27 | checksum = "86f5007801316299f922a6198d1d09a0bae95786815d066d5880d13f7c45ead1" 28 | dependencies = [ 29 | "aead", 30 | "aes", 31 | "block-cipher", 32 | "ghash", 33 | "subtle", 34 | ] 35 | 36 | [[package]] 37 | name = "aes-soft" 38 | version = "0.4.0" 39 | source = "registry+https://github.com/rust-lang/crates.io-index" 40 | checksum = "4925647ee64e5056cf231608957ce7c81e12d6d6e316b9ce1404778cc1d35fa7" 41 | dependencies = [ 42 | "block-cipher", 43 | "byteorder", 44 | "opaque-debug 0.2.3", 45 | ] 46 | 47 | [[package]] 48 | name = "aesni" 49 | version = "0.7.0" 50 | source = "registry+https://github.com/rust-lang/crates.io-index" 51 | checksum = "d050d39b0b7688b3a3254394c3e30a9d66c41dcf9b05b0e2dbdc623f6505d264" 52 | dependencies = [ 53 | "block-cipher", 54 | "opaque-debug 0.2.3", 55 | ] 56 | 57 | [[package]] 58 | name = "arc-swap" 59 | version = "0.4.7" 60 | source = "registry+https://github.com/rust-lang/crates.io-index" 61 | checksum = "4d25d88fd6b8041580a654f9d0c581a047baee2b3efee13275f2fc392fc75034" 62 | 63 | [[package]] 64 | name = "async-trait" 65 | version = "0.1.36" 66 | source = "registry+https://github.com/rust-lang/crates.io-index" 67 | checksum = "a265e3abeffdce30b2e26b7a11b222fe37c6067404001b434101457d0385eb92" 68 | dependencies = [ 69 | "proc-macro2", 70 | "quote", 71 | "syn", 72 | ] 73 | 74 | [[package]] 75 | name = "atomic" 76 | version = "0.4.6" 77 | source = "registry+https://github.com/rust-lang/crates.io-index" 78 | checksum = "64f46ca51dca4837f1520754d1c8c36636356b81553d928dc9c177025369a06e" 79 | 80 | [[package]] 81 | name = "atty" 82 | version = "0.2.14" 83 | source = "registry+https://github.com/rust-lang/crates.io-index" 84 | checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" 85 | dependencies = [ 86 | "hermit-abi", 87 | "libc", 88 | "winapi 0.3.9", 89 | ] 90 | 91 | [[package]] 92 | name = "autocfg" 93 | version = "1.0.0" 94 | source = "registry+https://github.com/rust-lang/crates.io-index" 95 | checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" 96 | 97 | [[package]] 98 | name = "base-x" 99 | version = "0.2.6" 100 | source = "registry+https://github.com/rust-lang/crates.io-index" 101 | checksum = "1b20b618342cf9891c292c4f5ac2cde7287cc5c87e87e9c769d617793607dec1" 102 | 103 | [[package]] 104 | name = "base64" 105 | version = "0.12.3" 106 | source = "registry+https://github.com/rust-lang/crates.io-index" 107 | checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" 108 | 109 | [[package]] 110 | name = "binascii" 111 | version = "0.1.4" 112 | source = "registry+https://github.com/rust-lang/crates.io-index" 113 | checksum = "383d29d513d8764dcdc42ea295d979eb99c3c9f00607b3692cf68a431f7dca72" 114 | 115 | [[package]] 116 | name = "bitflags" 117 | version = "1.2.1" 118 | source = "registry+https://github.com/rust-lang/crates.io-index" 119 | checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" 120 | 121 | [[package]] 122 | name = "block-buffer" 123 | version = "0.9.0" 124 | source = "registry+https://github.com/rust-lang/crates.io-index" 125 | checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" 126 | dependencies = [ 127 | "generic-array", 128 | ] 129 | 130 | [[package]] 131 | name = "block-cipher" 132 | version = "0.7.1" 133 | source = "registry+https://github.com/rust-lang/crates.io-index" 134 | checksum = "fa136449e765dc7faa244561ccae839c394048667929af599b5d931ebe7b7f10" 135 | dependencies = [ 136 | "generic-array", 137 | ] 138 | 139 | [[package]] 140 | name = "bumpalo" 141 | version = "3.4.0" 142 | source = "registry+https://github.com/rust-lang/crates.io-index" 143 | checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820" 144 | 145 | [[package]] 146 | name = "byteorder" 147 | version = "1.3.4" 148 | source = "registry+https://github.com/rust-lang/crates.io-index" 149 | checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" 150 | 151 | [[package]] 152 | name = "bytes" 153 | version = "0.5.6" 154 | source = "registry+https://github.com/rust-lang/crates.io-index" 155 | checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" 156 | 157 | [[package]] 158 | name = "cfg-if" 159 | version = "0.1.10" 160 | source = "registry+https://github.com/rust-lang/crates.io-index" 161 | checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" 162 | 163 | [[package]] 164 | name = "cookie" 165 | version = "0.14.2" 166 | source = "registry+https://github.com/rust-lang/crates.io-index" 167 | checksum = "1373a16a4937bc34efec7b391f9c1500c30b8478a701a4f44c9165cc0475a6e0" 168 | dependencies = [ 169 | "aes-gcm", 170 | "base64", 171 | "hkdf", 172 | "percent-encoding", 173 | "rand 0.7.3", 174 | "sha2", 175 | "time 0.2.16", 176 | "version_check", 177 | ] 178 | 179 | [[package]] 180 | name = "cpuid-bool" 181 | version = "0.1.2" 182 | source = "registry+https://github.com/rust-lang/crates.io-index" 183 | checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634" 184 | 185 | [[package]] 186 | name = "crypto-mac" 187 | version = "0.8.0" 188 | source = "registry+https://github.com/rust-lang/crates.io-index" 189 | checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" 190 | dependencies = [ 191 | "generic-array", 192 | "subtle", 193 | ] 194 | 195 | [[package]] 196 | name = "devise" 197 | version = "0.3.0" 198 | source = "git+https://github.com/SergioBenitez/Devise.git?rev=1e42a2691#1e42a2691ef9934a446b8ed0ca1c4c8cf283f8bf" 199 | dependencies = [ 200 | "devise_codegen", 201 | "devise_core", 202 | ] 203 | 204 | [[package]] 205 | name = "devise_codegen" 206 | version = "0.3.0" 207 | source = "git+https://github.com/SergioBenitez/Devise.git?rev=1e42a2691#1e42a2691ef9934a446b8ed0ca1c4c8cf283f8bf" 208 | dependencies = [ 209 | "devise_core", 210 | "quote", 211 | ] 212 | 213 | [[package]] 214 | name = "devise_core" 215 | version = "0.3.0" 216 | source = "git+https://github.com/SergioBenitez/Devise.git?rev=1e42a2691#1e42a2691ef9934a446b8ed0ca1c4c8cf283f8bf" 217 | dependencies = [ 218 | "bitflags", 219 | "proc-macro2", 220 | "proc-macro2-diagnostics", 221 | "quote", 222 | "syn", 223 | ] 224 | 225 | [[package]] 226 | name = "digest" 227 | version = "0.9.0" 228 | source = "registry+https://github.com/rust-lang/crates.io-index" 229 | checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" 230 | dependencies = [ 231 | "generic-array", 232 | ] 233 | 234 | [[package]] 235 | name = "discard" 236 | version = "1.0.4" 237 | source = "registry+https://github.com/rust-lang/crates.io-index" 238 | checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" 239 | 240 | [[package]] 241 | name = "doc-comment" 242 | version = "0.3.3" 243 | source = "registry+https://github.com/rust-lang/crates.io-index" 244 | checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" 245 | 246 | [[package]] 247 | name = "fnv" 248 | version = "1.0.7" 249 | source = "registry+https://github.com/rust-lang/crates.io-index" 250 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 251 | 252 | [[package]] 253 | name = "fuchsia-cprng" 254 | version = "0.1.1" 255 | source = "registry+https://github.com/rust-lang/crates.io-index" 256 | checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" 257 | 258 | [[package]] 259 | name = "fuchsia-zircon" 260 | version = "0.3.3" 261 | source = "registry+https://github.com/rust-lang/crates.io-index" 262 | checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" 263 | dependencies = [ 264 | "bitflags", 265 | "fuchsia-zircon-sys", 266 | ] 267 | 268 | [[package]] 269 | name = "fuchsia-zircon-sys" 270 | version = "0.3.3" 271 | source = "registry+https://github.com/rust-lang/crates.io-index" 272 | checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" 273 | 274 | [[package]] 275 | name = "futures" 276 | version = "0.3.5" 277 | source = "registry+https://github.com/rust-lang/crates.io-index" 278 | checksum = "1e05b85ec287aac0dc34db7d4a569323df697f9c55b99b15d6b4ef8cde49f613" 279 | dependencies = [ 280 | "futures-channel", 281 | "futures-core", 282 | "futures-executor", 283 | "futures-io", 284 | "futures-sink", 285 | "futures-task", 286 | "futures-util", 287 | ] 288 | 289 | [[package]] 290 | name = "futures-channel" 291 | version = "0.3.5" 292 | source = "registry+https://github.com/rust-lang/crates.io-index" 293 | checksum = "f366ad74c28cca6ba456d95e6422883cfb4b252a83bed929c83abfdbbf2967d5" 294 | dependencies = [ 295 | "futures-core", 296 | "futures-sink", 297 | ] 298 | 299 | [[package]] 300 | name = "futures-core" 301 | version = "0.3.5" 302 | source = "registry+https://github.com/rust-lang/crates.io-index" 303 | checksum = "59f5fff90fd5d971f936ad674802482ba441b6f09ba5e15fd8b39145582ca399" 304 | 305 | [[package]] 306 | name = "futures-executor" 307 | version = "0.3.5" 308 | source = "registry+https://github.com/rust-lang/crates.io-index" 309 | checksum = "10d6bb888be1153d3abeb9006b11b02cf5e9b209fda28693c31ae1e4e012e314" 310 | dependencies = [ 311 | "futures-core", 312 | "futures-task", 313 | "futures-util", 314 | ] 315 | 316 | [[package]] 317 | name = "futures-io" 318 | version = "0.3.5" 319 | source = "registry+https://github.com/rust-lang/crates.io-index" 320 | checksum = "de27142b013a8e869c14957e6d2edeef89e97c289e69d042ee3a49acd8b51789" 321 | 322 | [[package]] 323 | name = "futures-macro" 324 | version = "0.3.5" 325 | source = "registry+https://github.com/rust-lang/crates.io-index" 326 | checksum = "d0b5a30a4328ab5473878237c447333c093297bded83a4983d10f4deea240d39" 327 | dependencies = [ 328 | "proc-macro-hack", 329 | "proc-macro2", 330 | "quote", 331 | "syn", 332 | ] 333 | 334 | [[package]] 335 | name = "futures-sink" 336 | version = "0.3.5" 337 | source = "registry+https://github.com/rust-lang/crates.io-index" 338 | checksum = "3f2032893cb734c7a05d85ce0cc8b8c4075278e93b24b66f9de99d6eb0fa8acc" 339 | 340 | [[package]] 341 | name = "futures-task" 342 | version = "0.3.5" 343 | source = "registry+https://github.com/rust-lang/crates.io-index" 344 | checksum = "bdb66b5f09e22019b1ab0830f7785bcea8e7a42148683f99214f73f8ec21a626" 345 | dependencies = [ 346 | "once_cell", 347 | ] 348 | 349 | [[package]] 350 | name = "futures-util" 351 | version = "0.3.5" 352 | source = "registry+https://github.com/rust-lang/crates.io-index" 353 | checksum = "8764574ff08b701a084482c3c7031349104b07ac897393010494beaa18ce32c6" 354 | dependencies = [ 355 | "futures-channel", 356 | "futures-core", 357 | "futures-io", 358 | "futures-macro", 359 | "futures-sink", 360 | "futures-task", 361 | "memchr", 362 | "pin-project", 363 | "pin-utils", 364 | "proc-macro-hack", 365 | "proc-macro-nested", 366 | "slab", 367 | ] 368 | 369 | [[package]] 370 | name = "generic-array" 371 | version = "0.14.3" 372 | source = "registry+https://github.com/rust-lang/crates.io-index" 373 | checksum = "60fb4bb6bba52f78a471264d9a3b7d026cc0af47b22cd2cffbc0b787ca003e63" 374 | dependencies = [ 375 | "typenum", 376 | "version_check", 377 | ] 378 | 379 | [[package]] 380 | name = "getrandom" 381 | version = "0.1.14" 382 | source = "registry+https://github.com/rust-lang/crates.io-index" 383 | checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" 384 | dependencies = [ 385 | "cfg-if", 386 | "libc", 387 | "wasi", 388 | ] 389 | 390 | [[package]] 391 | name = "ghash" 392 | version = "0.3.0" 393 | source = "registry+https://github.com/rust-lang/crates.io-index" 394 | checksum = "d6e27f0689a6e15944bdce7e45425efb87eaa8ab0c6e87f11d0987a9133e2531" 395 | dependencies = [ 396 | "polyval", 397 | ] 398 | 399 | [[package]] 400 | name = "glob" 401 | version = "0.3.0" 402 | source = "registry+https://github.com/rust-lang/crates.io-index" 403 | checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" 404 | 405 | [[package]] 406 | name = "h2" 407 | version = "0.2.6" 408 | source = "registry+https://github.com/rust-lang/crates.io-index" 409 | checksum = "993f9e0baeed60001cf565546b0d3dbe6a6ad23f2bd31644a133c641eccf6d53" 410 | dependencies = [ 411 | "bytes", 412 | "fnv", 413 | "futures-core", 414 | "futures-sink", 415 | "futures-util", 416 | "http", 417 | "indexmap", 418 | "slab", 419 | "tokio", 420 | "tokio-util", 421 | "tracing", 422 | ] 423 | 424 | [[package]] 425 | name = "hashbrown" 426 | version = "0.8.1" 427 | source = "registry+https://github.com/rust-lang/crates.io-index" 428 | checksum = "34f595585f103464d8d2f6e9864682d74c1601fed5e07d62b1c9058dba8246fb" 429 | dependencies = [ 430 | "autocfg", 431 | ] 432 | 433 | [[package]] 434 | name = "hermit-abi" 435 | version = "0.1.15" 436 | source = "registry+https://github.com/rust-lang/crates.io-index" 437 | checksum = "3deed196b6e7f9e44a2ae8d94225d80302d81208b1bb673fd21fe634645c85a9" 438 | dependencies = [ 439 | "libc", 440 | ] 441 | 442 | [[package]] 443 | name = "hkdf" 444 | version = "0.9.0" 445 | source = "registry+https://github.com/rust-lang/crates.io-index" 446 | checksum = "fe1149865383e4526a43aee8495f9a325f0b806c63ce6427d06336a590abbbc9" 447 | dependencies = [ 448 | "digest", 449 | "hmac", 450 | ] 451 | 452 | [[package]] 453 | name = "hmac" 454 | version = "0.8.1" 455 | source = "registry+https://github.com/rust-lang/crates.io-index" 456 | checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" 457 | dependencies = [ 458 | "crypto-mac", 459 | "digest", 460 | ] 461 | 462 | [[package]] 463 | name = "http" 464 | version = "0.2.1" 465 | source = "registry+https://github.com/rust-lang/crates.io-index" 466 | checksum = "28d569972648b2c512421b5f2a405ad6ac9666547189d0c5477a3f200f3e02f9" 467 | dependencies = [ 468 | "bytes", 469 | "fnv", 470 | "itoa", 471 | ] 472 | 473 | [[package]] 474 | name = "http-body" 475 | version = "0.3.1" 476 | source = "registry+https://github.com/rust-lang/crates.io-index" 477 | checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" 478 | dependencies = [ 479 | "bytes", 480 | "http", 481 | ] 482 | 483 | [[package]] 484 | name = "httparse" 485 | version = "1.3.4" 486 | source = "registry+https://github.com/rust-lang/crates.io-index" 487 | checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" 488 | 489 | [[package]] 490 | name = "hyper" 491 | version = "0.13.7" 492 | source = "registry+https://github.com/rust-lang/crates.io-index" 493 | checksum = "3e68a8dd9716185d9e64ea473ea6ef63529252e3e27623295a0378a19665d5eb" 494 | dependencies = [ 495 | "bytes", 496 | "futures-channel", 497 | "futures-core", 498 | "futures-util", 499 | "h2", 500 | "http", 501 | "http-body", 502 | "httparse", 503 | "itoa", 504 | "pin-project", 505 | "time 0.1.43", 506 | "tokio", 507 | "tower-service", 508 | "tracing", 509 | "want", 510 | ] 511 | 512 | [[package]] 513 | name = "indexmap" 514 | version = "1.5.0" 515 | source = "registry+https://github.com/rust-lang/crates.io-index" 516 | checksum = "5b88cd59ee5f71fea89a62248fc8f387d44400cefe05ef548466d61ced9029a7" 517 | dependencies = [ 518 | "autocfg", 519 | "hashbrown", 520 | ] 521 | 522 | [[package]] 523 | name = "inlinable_string" 524 | version = "0.1.11" 525 | source = "registry+https://github.com/rust-lang/crates.io-index" 526 | checksum = "cb6ee2a7da03bfc3b66ca47c92c2e392fcc053ea040a85561749b026f7aad09a" 527 | 528 | [[package]] 529 | name = "iovec" 530 | version = "0.1.4" 531 | source = "registry+https://github.com/rust-lang/crates.io-index" 532 | checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" 533 | dependencies = [ 534 | "libc", 535 | ] 536 | 537 | [[package]] 538 | name = "itoa" 539 | version = "0.4.6" 540 | source = "registry+https://github.com/rust-lang/crates.io-index" 541 | checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" 542 | 543 | [[package]] 544 | name = "kernel32-sys" 545 | version = "0.2.2" 546 | source = "registry+https://github.com/rust-lang/crates.io-index" 547 | checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" 548 | dependencies = [ 549 | "winapi 0.2.8", 550 | "winapi-build", 551 | ] 552 | 553 | [[package]] 554 | name = "lazy_static" 555 | version = "1.4.0" 556 | source = "registry+https://github.com/rust-lang/crates.io-index" 557 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 558 | 559 | [[package]] 560 | name = "libc" 561 | version = "0.2.74" 562 | source = "registry+https://github.com/rust-lang/crates.io-index" 563 | checksum = "a2f02823cf78b754822df5f7f268fb59822e7296276d3e069d8e8cb26a14bd10" 564 | 565 | [[package]] 566 | name = "log" 567 | version = "0.4.11" 568 | source = "registry+https://github.com/rust-lang/crates.io-index" 569 | checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" 570 | dependencies = [ 571 | "cfg-if", 572 | ] 573 | 574 | [[package]] 575 | name = "memchr" 576 | version = "2.3.3" 577 | source = "registry+https://github.com/rust-lang/crates.io-index" 578 | checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" 579 | 580 | [[package]] 581 | name = "mime" 582 | version = "0.3.16" 583 | source = "registry+https://github.com/rust-lang/crates.io-index" 584 | checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" 585 | 586 | [[package]] 587 | name = "mio" 588 | version = "0.6.22" 589 | source = "registry+https://github.com/rust-lang/crates.io-index" 590 | checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430" 591 | dependencies = [ 592 | "cfg-if", 593 | "fuchsia-zircon", 594 | "fuchsia-zircon-sys", 595 | "iovec", 596 | "kernel32-sys", 597 | "libc", 598 | "log", 599 | "miow 0.2.1", 600 | "net2", 601 | "slab", 602 | "winapi 0.2.8", 603 | ] 604 | 605 | [[package]] 606 | name = "mio-named-pipes" 607 | version = "0.1.7" 608 | source = "registry+https://github.com/rust-lang/crates.io-index" 609 | checksum = "0840c1c50fd55e521b247f949c241c9997709f23bd7f023b9762cd561e935656" 610 | dependencies = [ 611 | "log", 612 | "mio", 613 | "miow 0.3.5", 614 | "winapi 0.3.9", 615 | ] 616 | 617 | [[package]] 618 | name = "mio-uds" 619 | version = "0.6.8" 620 | source = "registry+https://github.com/rust-lang/crates.io-index" 621 | checksum = "afcb699eb26d4332647cc848492bbc15eafb26f08d0304550d5aa1f612e066f0" 622 | dependencies = [ 623 | "iovec", 624 | "libc", 625 | "mio", 626 | ] 627 | 628 | [[package]] 629 | name = "miow" 630 | version = "0.2.1" 631 | source = "registry+https://github.com/rust-lang/crates.io-index" 632 | checksum = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" 633 | dependencies = [ 634 | "kernel32-sys", 635 | "net2", 636 | "winapi 0.2.8", 637 | "ws2_32-sys", 638 | ] 639 | 640 | [[package]] 641 | name = "miow" 642 | version = "0.3.5" 643 | source = "registry+https://github.com/rust-lang/crates.io-index" 644 | checksum = "07b88fb9795d4d36d62a012dfbf49a8f5cf12751f36d31a9dbe66d528e58979e" 645 | dependencies = [ 646 | "socket2", 647 | "winapi 0.3.9", 648 | ] 649 | 650 | [[package]] 651 | name = "net2" 652 | version = "0.2.34" 653 | source = "registry+https://github.com/rust-lang/crates.io-index" 654 | checksum = "2ba7c918ac76704fb42afcbbb43891e72731f3dcca3bef2a19786297baf14af7" 655 | dependencies = [ 656 | "cfg-if", 657 | "libc", 658 | "winapi 0.3.9", 659 | ] 660 | 661 | [[package]] 662 | name = "num_cpus" 663 | version = "1.13.0" 664 | source = "registry+https://github.com/rust-lang/crates.io-index" 665 | checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" 666 | dependencies = [ 667 | "hermit-abi", 668 | "libc", 669 | ] 670 | 671 | [[package]] 672 | name = "once_cell" 673 | version = "1.4.0" 674 | source = "registry+https://github.com/rust-lang/crates.io-index" 675 | checksum = "0b631f7e854af39a1739f401cf34a8a013dfe09eac4fa4dba91e9768bd28168d" 676 | 677 | [[package]] 678 | name = "opaque-debug" 679 | version = "0.2.3" 680 | source = "registry+https://github.com/rust-lang/crates.io-index" 681 | checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" 682 | 683 | [[package]] 684 | name = "opaque-debug" 685 | version = "0.3.0" 686 | source = "registry+https://github.com/rust-lang/crates.io-index" 687 | checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" 688 | 689 | [[package]] 690 | name = "pear" 691 | version = "0.2.0-dev" 692 | source = "git+https://github.com/SergioBenitez/Pear.git?rev=4b68055#4b680556063568a42fcd4328335cdfdf7608be49" 693 | dependencies = [ 694 | "inlinable_string", 695 | "pear_codegen", 696 | "yansi", 697 | ] 698 | 699 | [[package]] 700 | name = "pear_codegen" 701 | version = "0.2.0-dev" 702 | source = "git+https://github.com/SergioBenitez/Pear.git?rev=4b68055#4b680556063568a42fcd4328335cdfdf7608be49" 703 | dependencies = [ 704 | "proc-macro2", 705 | "proc-macro2-diagnostics", 706 | "quote", 707 | "syn", 708 | ] 709 | 710 | [[package]] 711 | name = "percent-encoding" 712 | version = "2.1.0" 713 | source = "registry+https://github.com/rust-lang/crates.io-index" 714 | checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" 715 | 716 | [[package]] 717 | name = "pin-project" 718 | version = "0.4.23" 719 | source = "registry+https://github.com/rust-lang/crates.io-index" 720 | checksum = "ca4433fff2ae79342e497d9f8ee990d174071408f28f726d6d83af93e58e48aa" 721 | dependencies = [ 722 | "pin-project-internal", 723 | ] 724 | 725 | [[package]] 726 | name = "pin-project-internal" 727 | version = "0.4.23" 728 | source = "registry+https://github.com/rust-lang/crates.io-index" 729 | checksum = "2c0e815c3ee9a031fdf5af21c10aa17c573c9c6a566328d99e3936c34e36461f" 730 | dependencies = [ 731 | "proc-macro2", 732 | "quote", 733 | "syn", 734 | ] 735 | 736 | [[package]] 737 | name = "pin-project-lite" 738 | version = "0.1.7" 739 | source = "registry+https://github.com/rust-lang/crates.io-index" 740 | checksum = "282adbf10f2698a7a77f8e983a74b2d18176c19a7fd32a45446139ae7b02b715" 741 | 742 | [[package]] 743 | name = "pin-utils" 744 | version = "0.1.0" 745 | source = "registry+https://github.com/rust-lang/crates.io-index" 746 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 747 | 748 | [[package]] 749 | name = "polyval" 750 | version = "0.4.0" 751 | source = "registry+https://github.com/rust-lang/crates.io-index" 752 | checksum = "d9a50142b55ab3ed0e9f68dfb3709f1d90d29da24e91033f28b96330643107dc" 753 | dependencies = [ 754 | "cfg-if", 755 | "universal-hash", 756 | ] 757 | 758 | [[package]] 759 | name = "ppv-lite86" 760 | version = "0.2.8" 761 | source = "registry+https://github.com/rust-lang/crates.io-index" 762 | checksum = "237a5ed80e274dbc66f86bd59c1e25edc039660be53194b5fe0a482e0f2612ea" 763 | 764 | [[package]] 765 | name = "proc-macro-hack" 766 | version = "0.5.18" 767 | source = "registry+https://github.com/rust-lang/crates.io-index" 768 | checksum = "99c605b9a0adc77b7211c6b1f722dcb613d68d66859a44f3d485a6da332b0598" 769 | 770 | [[package]] 771 | name = "proc-macro-nested" 772 | version = "0.1.6" 773 | source = "registry+https://github.com/rust-lang/crates.io-index" 774 | checksum = "eba180dafb9038b050a4c280019bbedf9f2467b61e5d892dcad585bb57aadc5a" 775 | 776 | [[package]] 777 | name = "proc-macro2" 778 | version = "1.0.19" 779 | source = "registry+https://github.com/rust-lang/crates.io-index" 780 | checksum = "04f5f085b5d71e2188cb8271e5da0161ad52c3f227a661a3c135fdf28e258b12" 781 | dependencies = [ 782 | "unicode-xid", 783 | ] 784 | 785 | [[package]] 786 | name = "proc-macro2-diagnostics" 787 | version = "0.1.0" 788 | source = "git+https://github.com/SergioBenitez/proc-macro2-diagnostics.git?rev=13fbb43#13fbb43db72034b6f9660a9b00e338cebd8dcf44" 789 | dependencies = [ 790 | "proc-macro2", 791 | "quote", 792 | "syn", 793 | "version_check", 794 | "yansi", 795 | ] 796 | 797 | [[package]] 798 | name = "quote" 799 | version = "1.0.7" 800 | source = "registry+https://github.com/rust-lang/crates.io-index" 801 | checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" 802 | dependencies = [ 803 | "proc-macro2", 804 | ] 805 | 806 | [[package]] 807 | name = "rand" 808 | version = "0.4.6" 809 | source = "registry+https://github.com/rust-lang/crates.io-index" 810 | checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" 811 | dependencies = [ 812 | "fuchsia-cprng", 813 | "libc", 814 | "rand_core 0.3.1", 815 | "rdrand", 816 | "winapi 0.3.9", 817 | ] 818 | 819 | [[package]] 820 | name = "rand" 821 | version = "0.7.3" 822 | source = "registry+https://github.com/rust-lang/crates.io-index" 823 | checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" 824 | dependencies = [ 825 | "getrandom", 826 | "libc", 827 | "rand_chacha", 828 | "rand_core 0.5.1", 829 | "rand_hc", 830 | ] 831 | 832 | [[package]] 833 | name = "rand_chacha" 834 | version = "0.2.2" 835 | source = "registry+https://github.com/rust-lang/crates.io-index" 836 | checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" 837 | dependencies = [ 838 | "ppv-lite86", 839 | "rand_core 0.5.1", 840 | ] 841 | 842 | [[package]] 843 | name = "rand_core" 844 | version = "0.3.1" 845 | source = "registry+https://github.com/rust-lang/crates.io-index" 846 | checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" 847 | dependencies = [ 848 | "rand_core 0.4.2", 849 | ] 850 | 851 | [[package]] 852 | name = "rand_core" 853 | version = "0.4.2" 854 | source = "registry+https://github.com/rust-lang/crates.io-index" 855 | checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" 856 | 857 | [[package]] 858 | name = "rand_core" 859 | version = "0.5.1" 860 | source = "registry+https://github.com/rust-lang/crates.io-index" 861 | checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" 862 | dependencies = [ 863 | "getrandom", 864 | ] 865 | 866 | [[package]] 867 | name = "rand_hc" 868 | version = "0.2.0" 869 | source = "registry+https://github.com/rust-lang/crates.io-index" 870 | checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" 871 | dependencies = [ 872 | "rand_core 0.5.1", 873 | ] 874 | 875 | [[package]] 876 | name = "rdrand" 877 | version = "0.4.0" 878 | source = "registry+https://github.com/rust-lang/crates.io-index" 879 | checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" 880 | dependencies = [ 881 | "rand_core 0.3.1", 882 | ] 883 | 884 | [[package]] 885 | name = "redox_syscall" 886 | version = "0.1.57" 887 | source = "registry+https://github.com/rust-lang/crates.io-index" 888 | checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" 889 | 890 | [[package]] 891 | name = "ref-cast" 892 | version = "1.0.2" 893 | source = "registry+https://github.com/rust-lang/crates.io-index" 894 | checksum = "745c1787167ddae5569661d5ffb8b25ae5fedbf46717eaa92d652221cec72623" 895 | dependencies = [ 896 | "ref-cast-impl", 897 | ] 898 | 899 | [[package]] 900 | name = "ref-cast-impl" 901 | version = "1.0.2" 902 | source = "registry+https://github.com/rust-lang/crates.io-index" 903 | checksum = "7d21b475ab879ef0e315ad99067fa25778c3b0377f57f1b00207448dac1a3144" 904 | dependencies = [ 905 | "proc-macro2", 906 | "quote", 907 | "syn", 908 | ] 909 | 910 | [[package]] 911 | name = "remove_dir_all" 912 | version = "0.5.3" 913 | source = "registry+https://github.com/rust-lang/crates.io-index" 914 | checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" 915 | dependencies = [ 916 | "winapi 0.3.9", 917 | ] 918 | 919 | [[package]] 920 | name = "rocket" 921 | version = "0.5.0-dev" 922 | source = "git+https://github.com/SergioBenitez/Rocket.git#45b4436ed3a7ab913d96c2b69ee4df7fd8c0c618" 923 | dependencies = [ 924 | "async-trait", 925 | "atomic", 926 | "atty", 927 | "binascii", 928 | "futures", 929 | "log", 930 | "memchr", 931 | "num_cpus", 932 | "pear", 933 | "ref-cast", 934 | "rocket_codegen", 935 | "rocket_http", 936 | "state", 937 | "time 0.2.16", 938 | "tokio", 939 | "toml", 940 | "version_check", 941 | "yansi", 942 | ] 943 | 944 | [[package]] 945 | name = "rocket_codegen" 946 | version = "0.5.0-dev" 947 | source = "git+https://github.com/SergioBenitez/Rocket.git#45b4436ed3a7ab913d96c2b69ee4df7fd8c0c618" 948 | dependencies = [ 949 | "devise", 950 | "glob", 951 | "indexmap", 952 | "quote", 953 | "rocket_http", 954 | ] 955 | 956 | [[package]] 957 | name = "rocket_contrib" 958 | version = "0.5.0-dev" 959 | source = "git+https://github.com/SergioBenitez/Rocket.git#45b4436ed3a7ab913d96c2b69ee4df7fd8c0c618" 960 | dependencies = [ 961 | "log", 962 | "rocket", 963 | "serde", 964 | "serde_json", 965 | "tokio", 966 | ] 967 | 968 | [[package]] 969 | name = "rocket_http" 970 | version = "0.5.0-dev" 971 | source = "git+https://github.com/SergioBenitez/Rocket.git#45b4436ed3a7ab913d96c2b69ee4df7fd8c0c618" 972 | dependencies = [ 973 | "cookie", 974 | "http", 975 | "hyper", 976 | "indexmap", 977 | "log", 978 | "mime", 979 | "pear", 980 | "percent-encoding", 981 | "ref-cast", 982 | "smallvec", 983 | "state", 984 | "time 0.2.16", 985 | "tokio", 986 | "unicode-xid", 987 | ] 988 | 989 | [[package]] 990 | name = "rustc_version" 991 | version = "0.2.3" 992 | source = "registry+https://github.com/rust-lang/crates.io-index" 993 | checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" 994 | dependencies = [ 995 | "semver", 996 | ] 997 | 998 | [[package]] 999 | name = "ryu" 1000 | version = "1.0.5" 1001 | source = "registry+https://github.com/rust-lang/crates.io-index" 1002 | checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" 1003 | 1004 | [[package]] 1005 | name = "semver" 1006 | version = "0.9.0" 1007 | source = "registry+https://github.com/rust-lang/crates.io-index" 1008 | checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" 1009 | dependencies = [ 1010 | "semver-parser", 1011 | ] 1012 | 1013 | [[package]] 1014 | name = "semver-parser" 1015 | version = "0.7.0" 1016 | source = "registry+https://github.com/rust-lang/crates.io-index" 1017 | checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" 1018 | 1019 | [[package]] 1020 | name = "serde" 1021 | version = "1.0.114" 1022 | source = "registry+https://github.com/rust-lang/crates.io-index" 1023 | checksum = "5317f7588f0a5078ee60ef675ef96735a1442132dc645eb1d12c018620ed8cd3" 1024 | dependencies = [ 1025 | "serde_derive", 1026 | ] 1027 | 1028 | [[package]] 1029 | name = "serde_derive" 1030 | version = "1.0.114" 1031 | source = "registry+https://github.com/rust-lang/crates.io-index" 1032 | checksum = "2a0be94b04690fbaed37cddffc5c134bf537c8e3329d53e982fe04c374978f8e" 1033 | dependencies = [ 1034 | "proc-macro2", 1035 | "quote", 1036 | "syn", 1037 | ] 1038 | 1039 | [[package]] 1040 | name = "serde_json" 1041 | version = "1.0.57" 1042 | source = "registry+https://github.com/rust-lang/crates.io-index" 1043 | checksum = "164eacbdb13512ec2745fb09d51fd5b22b0d65ed294a1dcf7285a360c80a675c" 1044 | dependencies = [ 1045 | "itoa", 1046 | "ryu", 1047 | "serde", 1048 | ] 1049 | 1050 | [[package]] 1051 | name = "server" 1052 | version = "0.1.0" 1053 | dependencies = [ 1054 | "log", 1055 | "rocket", 1056 | "rocket_contrib", 1057 | "serde", 1058 | "snafu", 1059 | "tempdir", 1060 | "tokio", 1061 | ] 1062 | 1063 | [[package]] 1064 | name = "sha1" 1065 | version = "0.6.0" 1066 | source = "registry+https://github.com/rust-lang/crates.io-index" 1067 | checksum = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" 1068 | 1069 | [[package]] 1070 | name = "sha2" 1071 | version = "0.9.1" 1072 | source = "registry+https://github.com/rust-lang/crates.io-index" 1073 | checksum = "2933378ddfeda7ea26f48c555bdad8bb446bf8a3d17832dc83e380d444cfb8c1" 1074 | dependencies = [ 1075 | "block-buffer", 1076 | "cfg-if", 1077 | "cpuid-bool", 1078 | "digest", 1079 | "opaque-debug 0.3.0", 1080 | ] 1081 | 1082 | [[package]] 1083 | name = "signal-hook-registry" 1084 | version = "1.2.0" 1085 | source = "registry+https://github.com/rust-lang/crates.io-index" 1086 | checksum = "94f478ede9f64724c5d173d7bb56099ec3e2d9fc2774aac65d34b8b890405f41" 1087 | dependencies = [ 1088 | "arc-swap", 1089 | "libc", 1090 | ] 1091 | 1092 | [[package]] 1093 | name = "slab" 1094 | version = "0.4.2" 1095 | source = "registry+https://github.com/rust-lang/crates.io-index" 1096 | checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" 1097 | 1098 | [[package]] 1099 | name = "smallvec" 1100 | version = "1.4.1" 1101 | source = "registry+https://github.com/rust-lang/crates.io-index" 1102 | checksum = "3757cb9d89161a2f24e1cf78efa0c1fcff485d18e3f55e0aa3480824ddaa0f3f" 1103 | 1104 | [[package]] 1105 | name = "snafu" 1106 | version = "0.6.8" 1107 | source = "registry+https://github.com/rust-lang/crates.io-index" 1108 | checksum = "c7f5aed652511f5c9123cf2afbe9c244c29db6effa2abb05c866e965c82405ce" 1109 | dependencies = [ 1110 | "doc-comment", 1111 | "snafu-derive", 1112 | ] 1113 | 1114 | [[package]] 1115 | name = "snafu-derive" 1116 | version = "0.6.8" 1117 | source = "registry+https://github.com/rust-lang/crates.io-index" 1118 | checksum = "ebf8f7d5720104a9df0f7076a8682024e958bba0fe9848767bb44f251f3648e9" 1119 | dependencies = [ 1120 | "proc-macro2", 1121 | "quote", 1122 | "syn", 1123 | ] 1124 | 1125 | [[package]] 1126 | name = "socket2" 1127 | version = "0.3.15" 1128 | source = "registry+https://github.com/rust-lang/crates.io-index" 1129 | checksum = "b1fa70dc5c8104ec096f4fe7ede7a221d35ae13dcd19ba1ad9a81d2cab9a1c44" 1130 | dependencies = [ 1131 | "cfg-if", 1132 | "libc", 1133 | "redox_syscall", 1134 | "winapi 0.3.9", 1135 | ] 1136 | 1137 | [[package]] 1138 | name = "standback" 1139 | version = "0.2.9" 1140 | source = "registry+https://github.com/rust-lang/crates.io-index" 1141 | checksum = "b0437cfb83762844799a60e1e3b489d5ceb6a650fbacb86437badc1b6d87b246" 1142 | dependencies = [ 1143 | "version_check", 1144 | ] 1145 | 1146 | [[package]] 1147 | name = "state" 1148 | version = "0.4.1" 1149 | source = "registry+https://github.com/rust-lang/crates.io-index" 1150 | checksum = "7345c971d1ef21ffdbd103a75990a15eb03604fc8b8852ca8cb418ee1a099028" 1151 | 1152 | [[package]] 1153 | name = "stdweb" 1154 | version = "0.4.20" 1155 | source = "registry+https://github.com/rust-lang/crates.io-index" 1156 | checksum = "d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5" 1157 | dependencies = [ 1158 | "discard", 1159 | "rustc_version", 1160 | "stdweb-derive", 1161 | "stdweb-internal-macros", 1162 | "stdweb-internal-runtime", 1163 | "wasm-bindgen", 1164 | ] 1165 | 1166 | [[package]] 1167 | name = "stdweb-derive" 1168 | version = "0.5.3" 1169 | source = "registry+https://github.com/rust-lang/crates.io-index" 1170 | checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef" 1171 | dependencies = [ 1172 | "proc-macro2", 1173 | "quote", 1174 | "serde", 1175 | "serde_derive", 1176 | "syn", 1177 | ] 1178 | 1179 | [[package]] 1180 | name = "stdweb-internal-macros" 1181 | version = "0.2.9" 1182 | source = "registry+https://github.com/rust-lang/crates.io-index" 1183 | checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11" 1184 | dependencies = [ 1185 | "base-x", 1186 | "proc-macro2", 1187 | "quote", 1188 | "serde", 1189 | "serde_derive", 1190 | "serde_json", 1191 | "sha1", 1192 | "syn", 1193 | ] 1194 | 1195 | [[package]] 1196 | name = "stdweb-internal-runtime" 1197 | version = "0.1.5" 1198 | source = "registry+https://github.com/rust-lang/crates.io-index" 1199 | checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" 1200 | 1201 | [[package]] 1202 | name = "subtle" 1203 | version = "2.2.3" 1204 | source = "registry+https://github.com/rust-lang/crates.io-index" 1205 | checksum = "502d53007c02d7605a05df1c1a73ee436952781653da5d0bf57ad608f66932c1" 1206 | 1207 | [[package]] 1208 | name = "syn" 1209 | version = "1.0.36" 1210 | source = "registry+https://github.com/rust-lang/crates.io-index" 1211 | checksum = "4cdb98bcb1f9d81d07b536179c269ea15999b5d14ea958196413869445bb5250" 1212 | dependencies = [ 1213 | "proc-macro2", 1214 | "quote", 1215 | "unicode-xid", 1216 | ] 1217 | 1218 | [[package]] 1219 | name = "tempdir" 1220 | version = "0.3.7" 1221 | source = "registry+https://github.com/rust-lang/crates.io-index" 1222 | checksum = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" 1223 | dependencies = [ 1224 | "rand 0.4.6", 1225 | "remove_dir_all", 1226 | ] 1227 | 1228 | [[package]] 1229 | name = "time" 1230 | version = "0.1.43" 1231 | source = "registry+https://github.com/rust-lang/crates.io-index" 1232 | checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" 1233 | dependencies = [ 1234 | "libc", 1235 | "winapi 0.3.9", 1236 | ] 1237 | 1238 | [[package]] 1239 | name = "time" 1240 | version = "0.2.16" 1241 | source = "registry+https://github.com/rust-lang/crates.io-index" 1242 | checksum = "3a51cadc5b1eec673a685ff7c33192ff7b7603d0b75446fb354939ee615acb15" 1243 | dependencies = [ 1244 | "cfg-if", 1245 | "libc", 1246 | "standback", 1247 | "stdweb", 1248 | "time-macros", 1249 | "version_check", 1250 | "winapi 0.3.9", 1251 | ] 1252 | 1253 | [[package]] 1254 | name = "time-macros" 1255 | version = "0.1.0" 1256 | source = "registry+https://github.com/rust-lang/crates.io-index" 1257 | checksum = "9ae9b6e9f095bc105e183e3cd493d72579be3181ad4004fceb01adbe9eecab2d" 1258 | dependencies = [ 1259 | "proc-macro-hack", 1260 | "time-macros-impl", 1261 | ] 1262 | 1263 | [[package]] 1264 | name = "time-macros-impl" 1265 | version = "0.1.1" 1266 | source = "registry+https://github.com/rust-lang/crates.io-index" 1267 | checksum = "e5c3be1edfad6027c69f5491cf4cb310d1a71ecd6af742788c6ff8bced86b8fa" 1268 | dependencies = [ 1269 | "proc-macro-hack", 1270 | "proc-macro2", 1271 | "quote", 1272 | "standback", 1273 | "syn", 1274 | ] 1275 | 1276 | [[package]] 1277 | name = "tokio" 1278 | version = "0.2.22" 1279 | source = "registry+https://github.com/rust-lang/crates.io-index" 1280 | checksum = "5d34ca54d84bf2b5b4d7d31e901a8464f7b60ac145a284fba25ceb801f2ddccd" 1281 | dependencies = [ 1282 | "bytes", 1283 | "fnv", 1284 | "futures-core", 1285 | "iovec", 1286 | "lazy_static", 1287 | "libc", 1288 | "memchr", 1289 | "mio", 1290 | "mio-named-pipes", 1291 | "mio-uds", 1292 | "num_cpus", 1293 | "pin-project-lite", 1294 | "signal-hook-registry", 1295 | "slab", 1296 | "tokio-macros", 1297 | "winapi 0.3.9", 1298 | ] 1299 | 1300 | [[package]] 1301 | name = "tokio-macros" 1302 | version = "0.2.5" 1303 | source = "registry+https://github.com/rust-lang/crates.io-index" 1304 | checksum = "f0c3acc6aa564495a0f2e1d59fab677cd7f81a19994cfc7f3ad0e64301560389" 1305 | dependencies = [ 1306 | "proc-macro2", 1307 | "quote", 1308 | "syn", 1309 | ] 1310 | 1311 | [[package]] 1312 | name = "tokio-util" 1313 | version = "0.3.1" 1314 | source = "registry+https://github.com/rust-lang/crates.io-index" 1315 | checksum = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499" 1316 | dependencies = [ 1317 | "bytes", 1318 | "futures-core", 1319 | "futures-sink", 1320 | "log", 1321 | "pin-project-lite", 1322 | "tokio", 1323 | ] 1324 | 1325 | [[package]] 1326 | name = "toml" 1327 | version = "0.5.6" 1328 | source = "registry+https://github.com/rust-lang/crates.io-index" 1329 | checksum = "ffc92d160b1eef40665be3a05630d003936a3bc7da7421277846c2613e92c71a" 1330 | dependencies = [ 1331 | "serde", 1332 | ] 1333 | 1334 | [[package]] 1335 | name = "tower-service" 1336 | version = "0.3.0" 1337 | source = "registry+https://github.com/rust-lang/crates.io-index" 1338 | checksum = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" 1339 | 1340 | [[package]] 1341 | name = "tracing" 1342 | version = "0.1.18" 1343 | source = "registry+https://github.com/rust-lang/crates.io-index" 1344 | checksum = "f0aae59226cf195d8e74d4b34beae1859257efb4e5fed3f147d2dc2c7d372178" 1345 | dependencies = [ 1346 | "cfg-if", 1347 | "log", 1348 | "tracing-core", 1349 | ] 1350 | 1351 | [[package]] 1352 | name = "tracing-core" 1353 | version = "0.1.12" 1354 | source = "registry+https://github.com/rust-lang/crates.io-index" 1355 | checksum = "b2734b5a028fa697686f16c6d18c2c6a3c7e41513f9a213abb6754c4acb3c8d7" 1356 | dependencies = [ 1357 | "lazy_static", 1358 | ] 1359 | 1360 | [[package]] 1361 | name = "try-lock" 1362 | version = "0.2.3" 1363 | source = "registry+https://github.com/rust-lang/crates.io-index" 1364 | checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" 1365 | 1366 | [[package]] 1367 | name = "typenum" 1368 | version = "1.12.0" 1369 | source = "registry+https://github.com/rust-lang/crates.io-index" 1370 | checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" 1371 | 1372 | [[package]] 1373 | name = "unicode-xid" 1374 | version = "0.2.1" 1375 | source = "registry+https://github.com/rust-lang/crates.io-index" 1376 | checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" 1377 | 1378 | [[package]] 1379 | name = "universal-hash" 1380 | version = "0.4.0" 1381 | source = "registry+https://github.com/rust-lang/crates.io-index" 1382 | checksum = "8326b2c654932e3e4f9196e69d08fdf7cfd718e1dc6f66b347e6024a0c961402" 1383 | dependencies = [ 1384 | "generic-array", 1385 | "subtle", 1386 | ] 1387 | 1388 | [[package]] 1389 | name = "version_check" 1390 | version = "0.9.2" 1391 | source = "registry+https://github.com/rust-lang/crates.io-index" 1392 | checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" 1393 | 1394 | [[package]] 1395 | name = "want" 1396 | version = "0.3.0" 1397 | source = "registry+https://github.com/rust-lang/crates.io-index" 1398 | checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" 1399 | dependencies = [ 1400 | "log", 1401 | "try-lock", 1402 | ] 1403 | 1404 | [[package]] 1405 | name = "wasi" 1406 | version = "0.9.0+wasi-snapshot-preview1" 1407 | source = "registry+https://github.com/rust-lang/crates.io-index" 1408 | checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" 1409 | 1410 | [[package]] 1411 | name = "wasm-bindgen" 1412 | version = "0.2.67" 1413 | source = "registry+https://github.com/rust-lang/crates.io-index" 1414 | checksum = "f0563a9a4b071746dd5aedbc3a28c6fe9be4586fb3fbadb67c400d4f53c6b16c" 1415 | dependencies = [ 1416 | "cfg-if", 1417 | "wasm-bindgen-macro", 1418 | ] 1419 | 1420 | [[package]] 1421 | name = "wasm-bindgen-backend" 1422 | version = "0.2.67" 1423 | source = "registry+https://github.com/rust-lang/crates.io-index" 1424 | checksum = "bc71e4c5efa60fb9e74160e89b93353bc24059999c0ae0fb03affc39770310b0" 1425 | dependencies = [ 1426 | "bumpalo", 1427 | "lazy_static", 1428 | "log", 1429 | "proc-macro2", 1430 | "quote", 1431 | "syn", 1432 | "wasm-bindgen-shared", 1433 | ] 1434 | 1435 | [[package]] 1436 | name = "wasm-bindgen-macro" 1437 | version = "0.2.67" 1438 | source = "registry+https://github.com/rust-lang/crates.io-index" 1439 | checksum = "97c57cefa5fa80e2ba15641578b44d36e7a64279bc5ed43c6dbaf329457a2ed2" 1440 | dependencies = [ 1441 | "quote", 1442 | "wasm-bindgen-macro-support", 1443 | ] 1444 | 1445 | [[package]] 1446 | name = "wasm-bindgen-macro-support" 1447 | version = "0.2.67" 1448 | source = "registry+https://github.com/rust-lang/crates.io-index" 1449 | checksum = "841a6d1c35c6f596ccea1f82504a192a60378f64b3bb0261904ad8f2f5657556" 1450 | dependencies = [ 1451 | "proc-macro2", 1452 | "quote", 1453 | "syn", 1454 | "wasm-bindgen-backend", 1455 | "wasm-bindgen-shared", 1456 | ] 1457 | 1458 | [[package]] 1459 | name = "wasm-bindgen-shared" 1460 | version = "0.2.67" 1461 | source = "registry+https://github.com/rust-lang/crates.io-index" 1462 | checksum = "93b162580e34310e5931c4b792560108b10fd14d64915d7fff8ff00180e70092" 1463 | 1464 | [[package]] 1465 | name = "winapi" 1466 | version = "0.2.8" 1467 | source = "registry+https://github.com/rust-lang/crates.io-index" 1468 | checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" 1469 | 1470 | [[package]] 1471 | name = "winapi" 1472 | version = "0.3.9" 1473 | source = "registry+https://github.com/rust-lang/crates.io-index" 1474 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1475 | dependencies = [ 1476 | "winapi-i686-pc-windows-gnu", 1477 | "winapi-x86_64-pc-windows-gnu", 1478 | ] 1479 | 1480 | [[package]] 1481 | name = "winapi-build" 1482 | version = "0.1.1" 1483 | source = "registry+https://github.com/rust-lang/crates.io-index" 1484 | checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" 1485 | 1486 | [[package]] 1487 | name = "winapi-i686-pc-windows-gnu" 1488 | version = "0.4.0" 1489 | source = "registry+https://github.com/rust-lang/crates.io-index" 1490 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1491 | 1492 | [[package]] 1493 | name = "winapi-x86_64-pc-windows-gnu" 1494 | version = "0.4.0" 1495 | source = "registry+https://github.com/rust-lang/crates.io-index" 1496 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1497 | 1498 | [[package]] 1499 | name = "ws2_32-sys" 1500 | version = "0.2.1" 1501 | source = "registry+https://github.com/rust-lang/crates.io-index" 1502 | checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" 1503 | dependencies = [ 1504 | "winapi 0.2.8", 1505 | "winapi-build", 1506 | ] 1507 | 1508 | [[package]] 1509 | name = "yansi" 1510 | version = "0.5.0" 1511 | source = "registry+https://github.com/rust-lang/crates.io-index" 1512 | checksum = "9fc79f4a1e39857fc00c3f662cbf2651c771f00e9c15fe2abc341806bd46bd71" 1513 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "server" 3 | version = "0.1.0" 4 | authors = ["Nikita Baksalyar ", "Jake Goulding "] 5 | edition = "2018" 6 | license = "MIT OR Apache-2.0" 7 | 8 | [dependencies] 9 | rocket = { git = "https://github.com/SergioBenitez/Rocket.git" } 10 | rocket_contrib = { git = "https://github.com/SergioBenitez/Rocket.git" } 11 | serde = { version = "1.0.114", features = ["derive"] } 12 | tempdir = "0.3.7" 13 | snafu = "0.6.8" 14 | log = "0.4.11" 15 | tokio = { version = "0.2.9", features = ["macros", "time", "process", "rt-threaded"] } 16 | -------------------------------------------------------------------------------- /LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. -------------------------------------------------------------------------------- /LICENSE-MIT: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016-2017 Jake Goulding 4 | Copyright (c) 2020 Nikita Baksalyar 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Low-Level Academy backend 2 | 3 | This repository contains the code for the [Low-Level Academy](https://lowlvl.org) backend. 4 | 5 | Related repositories: 6 | 7 | - [Front-end code](https://github.com/LowLevelAcademy/LowLevelAcademy) 8 | - [WebAssembly modules](https://github.com/LowLevelAcademy/wasm-modules) 9 | 10 | It handles users' compilation requests and returns resulting WebAssembly files. 11 | 12 | ## Build instructions 13 | 14 | Before starting the server, you might need to pull the Docker image used for compilation: 15 | 16 | ``` 17 | docker pull lowlvl/playground 18 | ``` 19 | 20 | You can also build it locally from [sources](./deploy): 21 | 22 | ``` 23 | cd deploy && bash build.sh 24 | ``` 25 | 26 | You can start the backend using the following command: 27 | 28 | ``` 29 | cargo run --release 30 | ``` 31 | 32 | If you want to run it in the development mode, use 33 | 34 | ``` 35 | ROCKET_ENV=development cargo run --release 36 | ``` 37 | 38 | ## License 39 | 40 | This code is partially based on the [Rust playground backend](https://github.com/integer32llc/rust-playground/) which is authored by Jake Goulding. 41 | 42 | Code in this repository is licensed under either of 43 | 44 | - Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) 45 | - MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) 46 | 47 | at your option. 48 | -------------------------------------------------------------------------------- /Rocket.toml: -------------------------------------------------------------------------------- 1 | [development] 2 | address = "0.0.0.0" 3 | 4 | [production] 5 | address = "127.0.0.1" 6 | -------------------------------------------------------------------------------- /deploy/build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | docker build -t lowlvl/playground . 4 | -------------------------------------------------------------------------------- /deploy/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | # This code is based on rust-playground container: 2 | # https://github.com/integer32llc/rust-playground/blob/master/compiler/base/Dockerfile 3 | 4 | FROM ubuntu:20.04 as toolchain 5 | 6 | ENV DEBIAN_FRONTEND="noninteractive" 7 | 8 | # `build-essential` and `file` are needed for backtrace-sys 9 | # `cmake`, `git`, `python` are needed for wasm tools 10 | RUN apt-get update && apt-get install -y \ 11 | build-essential \ 12 | cmake \ 13 | curl \ 14 | file \ 15 | gcc \ 16 | git \ 17 | libssl-dev \ 18 | pkg-config \ 19 | python \ 20 | && rm -rf /var/lib/apt/lists/* 21 | 22 | RUN useradd -m playground -d /playground 23 | RUN usermod -p '!!' root # Disable all passwords for root 24 | USER playground 25 | ENV USER=playground 26 | ENV PATH=/playground/.cargo/bin:$PATH 27 | WORKDIR /playground 28 | 29 | # Ensure that we are using the latest stable version of rustup and the 30 | # latest version of the current channel. A new manifest will trigger 31 | # these lines to run again, forcing a new download of rustup and 32 | # installation of Rust. 33 | ADD --chown=playground https://static.rust-lang.org/rustup/release-stable.toml /playground/tools/rustup-manifest.toml 34 | ADD --chown=playground https://static.rust-lang.org/dist/channel-rust-stable-date.txt /playground/tools/rust-channel-version 35 | RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-toolchain "stable" 36 | 37 | # Install wasm target and tools 38 | RUN rustup target add wasm32-unknown-unknown 39 | RUN cd /tmp && \ 40 | git clone https://github.com/WebAssembly/wabt && \ 41 | cd /tmp/wabt/ && \ 42 | cmake -DBUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release && \ 43 | make wasm-strip && \ 44 | cp ./wasm-strip $HOME/.cargo/bin && \ 45 | rm -rf /tmp/wabt/ 46 | 47 | ADD --chown=playground rustc-wasm /playground/.cargo/bin/ 48 | ADD --chown=playground entrypoint.sh /playground/tools/ 49 | 50 | ENTRYPOINT ["/playground/tools/entrypoint.sh"] 51 | -------------------------------------------------------------------------------- /deploy/docker/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -eu 4 | 5 | timeout=${PLAYGROUND_TIMEOUT:-10} 6 | 7 | # Don't use `exec` here. The shell is what prints out the useful 8 | # "Killed" message 9 | timeout --signal=KILL ${timeout} "$@" 10 | -------------------------------------------------------------------------------- /deploy/docker/rustc-wasm: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -eu 4 | 5 | # Build and optimise wasm 6 | 7 | rustc "-C" "debuginfo=0" "-C" "opt-level=s" "--target=wasm32-unknown-unknown" "--crate-type" "cdylib" $@ 8 | 9 | for wasm in $(find /playground-result/ -name '*wasm'); do 10 | wasm-strip "${wasm}" 11 | done 12 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | //! This is a simple server that compiles snippets into WebAssembly code. 2 | //! It is heavily based on the [rust-playground code][rust-playground] 3 | //! 4 | //! [rust-playground]: (https://github.com/integer32llc/rust-playground/tree/master/ui 5 | 6 | mod sandbox; 7 | 8 | use rocket::{ 9 | config::Environment, 10 | http::ContentType, 11 | post, 12 | response::{content, status}, 13 | }; 14 | use rocket_contrib::json::Json; 15 | use rocket_contrib::serve::StaticFiles; 16 | use sandbox::Sandbox; 17 | use serde::Deserialize; 18 | use std::{env, fs::File, io::prelude::*}; 19 | 20 | #[derive(Deserialize, Debug)] 21 | struct ExecuteCommand { 22 | code: String, 23 | } 24 | 25 | #[post("/", data = "")] 26 | async fn execute( 27 | req: Json, 28 | ) -> Result, status::BadRequest> { 29 | let mut source_path = env::temp_dir(); 30 | source_path.push("req.rs"); 31 | 32 | { 33 | let mut source_file = File::create(source_path.clone()).expect("could not create file"); 34 | source_file 35 | .write_all(req.code.as_bytes()) 36 | .expect("could not write source text"); 37 | } 38 | 39 | let output = Sandbox::new() 40 | .map_err(|e| status::BadRequest(Some(e.to_string())))? // todo internal server error 41 | .compile(&req.code) 42 | .await 43 | .map_err(|e| status::BadRequest(Some(e.to_string())))?; 44 | 45 | if !output.success { 46 | return Err(status::BadRequest(Some(output.stderr))); 47 | } 48 | 49 | Ok(content::Content(ContentType::WASM, output.wasm.unwrap())) 50 | } 51 | 52 | #[rocket::launch] 53 | fn rocket() -> rocket::Rocket { 54 | let mut rocket = rocket::ignite(); 55 | 56 | if Environment::active().unwrap().is_dev() { 57 | // Serve static files 58 | let static_files_path = env::var("STATIC_FILES").unwrap(); 59 | rocket = rocket.mount("/", StaticFiles::from(static_files_path)); 60 | } 61 | 62 | rocket.mount("/compile", rocket::routes![execute]) 63 | } 64 | -------------------------------------------------------------------------------- /src/sandbox.rs: -------------------------------------------------------------------------------- 1 | //! This code is heavily based on the [rust-playground code][rust-playground] 2 | //! 3 | //! [rust-playground]: (https://github.com/integer32llc/rust-playground/tree/master/ui 4 | 5 | use log; 6 | use snafu::{ResultExt, Snafu}; 7 | use std::{ 8 | fmt, 9 | fs::{self, File}, 10 | io, 11 | os::unix::fs::PermissionsExt, 12 | path::{Path, PathBuf}, 13 | string, 14 | time::Duration, 15 | }; 16 | use tempdir::TempDir; 17 | use tokio::process::Command; 18 | 19 | const DOCKER_CONTAINER_NAME: &str = "lowlvl/playground"; 20 | const DOCKER_PROCESS_TIMEOUT_SOFT: Duration = Duration::from_secs(10); 21 | const DOCKER_PROCESS_TIMEOUT_HARD: Duration = Duration::from_secs(12); 22 | 23 | #[derive(Debug, Snafu)] 24 | pub enum Error { 25 | #[snafu(display("Unable to create temporary directory: {}", source))] 26 | UnableToCreateTempDir { source: io::Error }, 27 | #[snafu(display("Unable to create output directory: {}", source))] 28 | UnableToCreateOutputDir { source: io::Error }, 29 | #[snafu(display("Unable to set permissions for output directory: {}", source))] 30 | UnableToSetOutputPermissions { source: io::Error }, 31 | #[snafu(display("Unable to create source file: {}", source))] 32 | UnableToCreateSourceFile { source: io::Error }, 33 | #[snafu(display("Unable to set permissions for source file: {}", source))] 34 | UnableToSetSourcePermissions { source: io::Error }, 35 | #[snafu(display("Unable to execute the compiler: {}", source))] 36 | UnableToExecuteCompiler { source: io::Error }, 37 | #[snafu(display("Compiler execution took longer than {} ms", timeout.as_millis()))] 38 | CompilerExecutionTimedOut { 39 | source: tokio::time::Elapsed, 40 | timeout: Duration, 41 | }, 42 | #[snafu(display("Unable to read output file: {}", source))] 43 | UnableToReadOutput { source: io::Error }, 44 | #[snafu(display("Output was not valid UTF-8: {}", source))] 45 | OutputNotUtf8 { source: string::FromUtf8Error }, 46 | #[snafu(display("Output was missing"))] 47 | OutputMissing, 48 | #[snafu(display("Release was missing from the version output"))] 49 | VersionReleaseMissing, 50 | #[snafu(display("Commit hash was missing from the version output"))] 51 | VersionHashMissing, 52 | #[snafu(display("Commit date was missing from the version output"))] 53 | VersionDateMissing, 54 | } 55 | 56 | pub type Result = ::std::result::Result; 57 | 58 | #[derive(Debug)] 59 | pub struct CompileResponse { 60 | pub success: bool, 61 | pub wasm: Option, 62 | pub stdout: String, 63 | pub stderr: String, 64 | } 65 | 66 | pub struct Sandbox { 67 | // This is a phantom var to hold a temporary dir 68 | #[allow(dead_code)] 69 | scratch: TempDir, 70 | input_file: PathBuf, 71 | output_dir: PathBuf, 72 | } 73 | 74 | // We must create a world-writable files (rustfmt) and directories 75 | // (LLVM IR) so that the process inside the Docker container can write 76 | // into it. 77 | // 78 | // This problem does *not* occur when using the indirection of 79 | // docker-machine. 80 | fn wide_open_permissions() -> std::fs::Permissions { 81 | PermissionsExt::from_mode(0o777) 82 | } 83 | 84 | async fn run_command_with_timeout(mut command: Command) -> Result { 85 | let timeout = DOCKER_PROCESS_TIMEOUT_HARD; 86 | 87 | tokio::time::timeout(timeout, command.output()) 88 | .await 89 | .context(CompilerExecutionTimedOut { timeout })? 90 | .context(UnableToExecuteCompiler) 91 | } 92 | 93 | impl Sandbox { 94 | pub fn new() -> Result { 95 | let scratch = TempDir::new("playground").context(UnableToCreateTempDir)?; 96 | let input_file = scratch.path().join("input.rs"); 97 | let output_dir = scratch.path().join("output"); 98 | 99 | fs::create_dir(&output_dir).context(UnableToCreateOutputDir)?; 100 | fs::set_permissions(&output_dir, wide_open_permissions()) 101 | .context(UnableToSetOutputPermissions)?; 102 | 103 | Ok(Sandbox { 104 | scratch, 105 | input_file, 106 | output_dir, 107 | }) 108 | } 109 | 110 | pub async fn compile(&self, code: &str) -> Result { 111 | self.write_source_code(code)?; 112 | 113 | let command = self.compile_command(); 114 | 115 | let output = run_command_with_timeout(command).await?; 116 | 117 | // The compiler writes the file to a name like 118 | // `req.wasm`, so we just find the first with the right extension. 119 | let mut file = PathBuf::new(); 120 | file.push(&self.output_dir); 121 | file.push("result.wasm"); 122 | 123 | let stdout = vec_to_str(output.stdout)?; 124 | let mut stderr = vec_to_str(output.stderr)?; 125 | 126 | let wasm = if file.exists() { 127 | Some(read(&file)?) 128 | } else { 129 | // If we didn't find the file, it's *most* likely that 130 | // the user's code was invalid. Tack on our own error 131 | // to the compiler's error instead of failing the 132 | // request. 133 | use self::fmt::Write; 134 | write!(&mut stderr, "\nUnable to locate output file",) 135 | .expect("Unable to write to a string"); 136 | None 137 | }; 138 | 139 | Ok(CompileResponse { 140 | success: output.status.success(), 141 | wasm, 142 | stdout, 143 | stderr, 144 | }) 145 | } 146 | 147 | fn write_source_code(&self, code: &str) -> Result<()> { 148 | fs::write(&self.input_file, code).context(UnableToCreateSourceFile)?; 149 | fs::set_permissions(&self.input_file, wide_open_permissions()) 150 | .context(UnableToSetSourcePermissions)?; 151 | 152 | log::debug!( 153 | "Wrote {} bytes of source to {}", 154 | code.len(), 155 | self.input_file.display() 156 | ); 157 | Ok(()) 158 | } 159 | 160 | fn compile_command(&self) -> Command { 161 | let mut cmd = self.docker_command(); 162 | 163 | cmd.arg(DOCKER_CONTAINER_NAME) 164 | .arg("rustc-wasm") 165 | .args(&["-o", "/playground-result/result.wasm"]) 166 | .arg("input.rs"); 167 | 168 | log::debug!("Compilation command is {:?}", cmd); 169 | 170 | cmd 171 | } 172 | 173 | fn docker_command(&self) -> Command { 174 | let mut mount_input_file = self.input_file.as_os_str().to_os_string(); 175 | mount_input_file.push(":"); 176 | mount_input_file.push("/playground/input.rs"); 177 | 178 | let mut mount_output_dir = self.output_dir.as_os_str().to_os_string(); 179 | mount_output_dir.push(":"); 180 | mount_output_dir.push("/playground-result"); 181 | 182 | let mut cmd = basic_secure_docker_command(); 183 | 184 | cmd.arg("--volume") 185 | .arg(&mount_input_file) 186 | .arg("--volume") 187 | .arg(&mount_output_dir); 188 | 189 | cmd 190 | } 191 | } 192 | 193 | fn read(path: &Path) -> Result { 194 | let f = match File::open(path) { 195 | Ok(f) => f, 196 | e => e.context(UnableToReadOutput)?, 197 | }; 198 | Ok(f) 199 | } 200 | 201 | fn basic_secure_docker_command() -> Command { 202 | let mut cmd = Command::new("docker"); 203 | 204 | cmd.arg("run") 205 | .arg("--rm") 206 | .arg("--cap-drop=ALL") 207 | .arg("--cap-add=DAC_OVERRIDE") 208 | .arg("--security-opt=no-new-privileges") 209 | .args(&["--workdir", "/playground"]) 210 | .args(&["--net", "none"]) 211 | .args(&["--memory", "256m"]) 212 | .args(&["--memory-swap", "320m"]) 213 | .args(&[ 214 | "--env", 215 | &format!( 216 | "PLAYGROUND_TIMEOUT={}", 217 | DOCKER_PROCESS_TIMEOUT_SOFT.as_secs() 218 | ), 219 | ]) 220 | .args(&["--pids-limit", "512"]); 221 | 222 | cmd.kill_on_drop(true); 223 | 224 | cmd 225 | } 226 | 227 | fn vec_to_str(v: Vec) -> Result { 228 | String::from_utf8(v).context(OutputNotUtf8) 229 | } 230 | --------------------------------------------------------------------------------