diff --git a/Cargo.lock b/Cargo.lock index dc2cced..e953997 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,310 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "actix-codec" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78d1833b3838dbe990df0f1f87baf640cf6146e898166afe401839d1b001e570" +dependencies = [ + "bitflags", + "bytes 0.5.6", + "futures-core", + "futures-sink", + "log", + "pin-project 0.4.28", + "tokio", + "tokio-util", +] + +[[package]] +name = "actix-connect" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "177837a10863f15ba8d3ae3ec12fac1099099529ed20083a27fdfe247381d0dc" +dependencies = [ + "actix-codec", + "actix-rt", + "actix-service", + "actix-utils", + "derive_more", + "either", + "futures-util", + "http", + "log", + "openssl", + "tokio-openssl", + "trust-dns-proto", + "trust-dns-resolver", +] + +[[package]] +name = "actix-files" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c51e8a9146c12fce92a6e4c24b8c4d9b05268130bfd8d61bc587e822c32ce689" +dependencies = [ + "actix-service", + "actix-web", + "bitflags", + "bytes 0.5.6", + "derive_more", + "futures-core", + "futures-util", + "log", + "mime", + "mime_guess", + "percent-encoding", + "v_htmlescape", +] + +[[package]] +name = "actix-http" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cb8958da437716f3f31b0e76f8daf36554128517d7df37ceba7df00f09622ee" +dependencies = [ + "actix-codec", + "actix-connect", + "actix-rt", + "actix-service", + "actix-threadpool", + "actix-tls", + "actix-utils", + "base64", + "bitflags", + "brotli2", + "bytes 0.5.6", + "cookie", + "copyless", + "derive_more", + "either", + "encoding_rs", + "flate2", + "futures-channel", + "futures-core", + "futures-util", + "fxhash", + "h2", + "http", + "httparse", + "indexmap", + "itoa", + "language-tags", + "lazy_static", + "log", + "mime", + "percent-encoding", + "pin-project 1.0.8", + "rand 0.7.3", + "regex", + "serde", + "serde_json", + "serde_urlencoded", + "sha-1 0.9.7", + "slab", + "time 0.2.27", +] + +[[package]] +name = "actix-macros" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ca8ce00b267af8ccebbd647de0d61e0674b6e61185cc7a592ff88772bed655" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "actix-router" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ad299af73649e1fc893e333ccf86f377751eb95ff875d095131574c6f43452c" +dependencies = [ + "bytestring", + "http", + "log", + "regex", + "serde", +] + +[[package]] +name = "actix-rt" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "143fcc2912e0d1de2bcf4e2f720d2a60c28652ab4179685a1ee159e0fb3db227" +dependencies = [ + "actix-macros", + "actix-threadpool", + "copyless", + "futures-channel", + "futures-util", + "smallvec", + "tokio", +] + +[[package]] +name = "actix-server" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45407e6e672ca24784baa667c5d32ef109ccdd8d5e0b5ebb9ef8a67f4dfb708e" +dependencies = [ + "actix-codec", + "actix-rt", + "actix-service", + "actix-utils", + "futures-channel", + "futures-util", + "log", + "mio", + "mio-uds", + "num_cpus", + "slab", + "socket2", +] + +[[package]] +name = "actix-service" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0052435d581b5be835d11f4eb3bce417c8af18d87ddf8ace99f8e67e595882bb" +dependencies = [ + "futures-util", + "pin-project 0.4.28", +] + +[[package]] +name = "actix-testing" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47239ca38799ab74ee6a8a94d1ce857014b2ac36f242f70f3f75a66f691e791c" +dependencies = [ + "actix-macros", + "actix-rt", + "actix-server", + "actix-service", + "log", + "socket2", +] + +[[package]] +name = "actix-threadpool" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d209f04d002854b9afd3743032a27b066158817965bf5d036824d19ac2cc0e30" +dependencies = [ + "derive_more", + "futures-channel", + "lazy_static", + "log", + "num_cpus", + "parking_lot", + "threadpool", +] + +[[package]] +name = "actix-tls" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24789b7d7361cf5503a504ebe1c10806896f61e96eca9a7350e23001aca715fb" +dependencies = [ + "actix-codec", + "actix-service", + "actix-utils", + "futures-util", + "openssl", + "tokio-openssl", +] + +[[package]] +name = "actix-utils" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e9022dec56632d1d7979e59af14f0597a28a830a9c1c7fec8b2327eb9f16b5a" +dependencies = [ + "actix-codec", + "actix-rt", + "actix-service", + "bitflags", + "bytes 0.5.6", + "either", + "futures-channel", + "futures-sink", + "futures-util", + "log", + "pin-project 0.4.28", + "slab", +] + +[[package]] +name = "actix-web" +version = "3.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e641d4a172e7faa0862241a20ff4f1f5ab0ab7c279f00c2d4587b77483477b86" +dependencies = [ + "actix-codec", + "actix-http", + "actix-macros", + "actix-router", + "actix-rt", + "actix-server", + "actix-service", + "actix-testing", + "actix-threadpool", + "actix-tls", + "actix-utils", + "actix-web-codegen", + "awc", + "bytes 0.5.6", + "derive_more", + "encoding_rs", + "futures-channel", + "futures-core", + "futures-util", + "fxhash", + "log", + "mime", + "openssl", + "pin-project 1.0.8", + "regex", + "serde", + "serde_json", + "serde_urlencoded", + "socket2", + "time 0.2.27", + "tinyvec", + "url", +] + +[[package]] +name = "actix-web-codegen" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad26f77093333e0e7c6ffe54ebe3582d908a104e448723eec6d43d08b07143fb" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "actix-web-httpauth" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c3b11a07a3df3f7970fd8bd38cc66998b5549f507c54cc64c6e843bc82d6358" +dependencies = [ + "actix-web", + "base64", + "futures-util", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + [[package]] name = "aho-corasick" version = "0.7.18" @@ -11,27 +315,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "async-stream" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "171374e7e3b2504e0e5236e3b59260560f9fe94bfe9ac39ba5e4e929c5590625" -dependencies = [ - "async-stream-impl", - "futures-core", -] - -[[package]] -name = "async-stream-impl" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "648ed8c8d2ce5409ccd57453d9d1b214b342a0d69376a6feda1fd6cae3299308" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "async-trait" version = "0.1.51" @@ -43,15 +326,6 @@ dependencies = [ "syn", ] -[[package]] -name = "atomic" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3410529e8288c463bedb5930f82833bc0c90e5d2fe639a56582a4d09220b281" -dependencies = [ - "autocfg", -] - [[package]] name = "atty" version = "0.2.14" @@ -69,6 +343,31 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +[[package]] +name = "awc" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b381e490e7b0cfc37ebc54079b0413d8093ef43d14a4e4747083f7fa47a9e691" +dependencies = [ + "actix-codec", + "actix-http", + "actix-rt", + "actix-service", + "base64", + "bytes 0.5.6", + "cfg-if 1.0.0", + "derive_more", + "futures-core", + "log", + "mime", + "openssl", + "percent-encoding", + "rand 0.7.3", + "serde", + "serde_json", + "serde_urlencoded", +] + [[package]] name = "base-x" version = "0.2.8" @@ -81,17 +380,11 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" -[[package]] -name = "binascii" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "383d29d513d8764dcdc42ea295d979eb99c3c9f00607b3692cf68a431f7dca72" - [[package]] name = "bitflags" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "block-buffer" @@ -102,7 +395,16 @@ dependencies = [ "block-padding", "byte-tools", "byteorder", - "generic-array", + "generic-array 0.12.4", +] + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array 0.14.4", ] [[package]] @@ -114,6 +416,26 @@ dependencies = [ "byte-tools", ] +[[package]] +name = "brotli-sys" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4445dea95f4c2b41cde57cc9fee236ae4dbae88d8fcbdb4750fc1bb5d86aaecd" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "brotli2" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cb036c3eade309815c15ddbacec5b22c4d1f3983a774ab2eac2e3e9ea85568e" +dependencies = [ + "brotli-sys", + "libc", +] + [[package]] name = "bstr" version = "0.2.16" @@ -123,6 +445,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "buf-min" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa17aa1cf56bdd6bb30518767d00e58019d326f3f05d8c3e0730b549d332ea83" +dependencies = [ + "bytes 0.5.6", +] + [[package]] name = "bumpalo" version = "3.7.0" @@ -141,12 +472,27 @@ version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +[[package]] +name = "bytes" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" + [[package]] name = "bytes" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040" +[[package]] +name = "bytestring" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90706ba19e97b90786e19dc0d5e2abd80008d99d4c0c5d1ad0b5e72cec7c494d" +dependencies = [ + "bytes 1.0.1", +] + [[package]] name = "cc" version = "1.0.69" @@ -174,7 +520,7 @@ dependencies = [ "libc", "num-integer", "num-traits", - "time 0.1.43", + "time 0.1.44", "winapi 0.3.9", ] @@ -190,9 +536,9 @@ dependencies = [ [[package]] name = "clap" -version = "3.0.0-beta.2" +version = "3.0.0-beta.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bd1061998a501ee7d4b6d449020df3266ca3124b941ec56cf2005c3779ca142" +checksum = "fcd70aa5597dbc42f7217a543f9ef2768b2ef823ba29036072d30e1d88e98406" dependencies = [ "atty", "bitflags", @@ -204,15 +550,14 @@ dependencies = [ "termcolor", "terminal_size", "textwrap", - "unicode-width", "vec_map", ] [[package]] name = "clap_derive" -version = "3.0.0-beta.2" +version = "3.0.0-beta.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "370f715b81112975b1b69db93e0b56ea4cd4e5002ac43b2da8474106a54096a1" +checksum = "0b5bb0d655624a0b8770d1c178fb8ffcb1f91cc722cb08f451e3dc72465421ac" dependencies = [ "heck", "proc-macro-error", @@ -221,17 +566,6 @@ dependencies = [ "syn", ] -[[package]] -name = "colored" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3616f750b84d8f0de8a58bda93e08e2a81ad3f523089b05f1dffecab48c6cbd" -dependencies = [ - "atty", - "lazy_static", - "winapi 0.3.9", -] - [[package]] name = "const_fn" version = "0.4.8" @@ -246,13 +580,37 @@ checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] name = "cookie" -version = "0.15.1" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f1c7727e460397e56abc4bddc1d49e07a1ad78fc98eb2e1c8f032a58a2f80d" +checksum = "03a5d7b21829bc7b4bf4754a978a241ae54ea55a40f92bb20216e54096f4b951" dependencies = [ "percent-encoding", "time 0.2.27", - "version_check", + "version_check 0.9.3", +] + +[[package]] +name = "copyless" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2df960f5d869b2dd8532793fde43eb5427cceb126c929747a26823ab0eeb536" + +[[package]] +name = "cpufeatures" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66c99696f6c9dd7f35d486b9d04d7e6e202aa3e8c40d553f2fdf5e7e0c6a71ef" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" +dependencies = [ + "cfg-if 1.0.0", ] [[package]] @@ -284,46 +642,22 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "850878694b7933ca4c9569d30a34b55031b9b139ee1fc7b94a527c4ef960d690" -[[package]] -name = "devise" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50c7580b072f1c8476148f16e0a0d5dedddab787da98d86c5082c5e9ed8ab595" -dependencies = [ - "devise_codegen", - "devise_core", -] - -[[package]] -name = "devise_codegen" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "123c73e7a6e51b05c75fe1a1b2f4e241399ea5740ed810b0e3e6cacd9db5e7b2" -dependencies = [ - "devise_core", - "quote", -] - -[[package]] -name = "devise_core" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841ef46f4787d9097405cac4e70fb8644fc037b526e8c14054247c0263c400d0" -dependencies = [ - "bitflags", - "proc-macro2", - "proc-macro2-diagnostics", - "quote", - "syn", -] - [[package]] name = "digest" version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" dependencies = [ - "generic-array", + "generic-array 0.12.4", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array 0.14.4", ] [[package]] @@ -347,6 +681,31 @@ dependencies = [ "cfg-if 1.0.0", ] +[[package]] +name = "enum-as-inner" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c5f0096a91d210159eceb2ff5e1c4da18388a170e1e3ce948aac9c8fdbbf595" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "env_logger" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + [[package]] name = "fake-simd" version = "0.1.2" @@ -354,29 +713,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" [[package]] -name = "figment" -version = "0.10.6" +name = "flate2" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "790b4292c72618abbab50f787a477014fe15634f96291de45672ce46afe122df" -dependencies = [ - "atomic", - "pear", - "serde", - "toml", - "uncased", - "version_check", -] - -[[package]] -name = "filetime" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "975ccf83d8d9d0d84682850a38c8169027be83368805971cc4f238c2b245bc98" +checksum = "cd3aec53de10fe96d7d8c565eb17f2c687bb5518a2ec453b5b1252964526abe0" dependencies = [ "cfg-if 1.0.0", + "crc32fast", "libc", - "redox_syscall", - "winapi 0.3.9", + "miniz_oxide", ] [[package]] @@ -386,22 +731,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] -name = "fsevent" -version = "0.4.0" +name = "foreign-types" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab7d1bd1bd33cc98b0889831b72da23c0aa4df9cec7e0702f46ecea04b35db6" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" dependencies = [ - "bitflags", - "fsevent-sys", + "foreign-types-shared", ] [[package]] -name = "fsevent-sys" -version = "2.0.1" +name = "foreign-types-shared" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f41b048a94555da0f42f1d632e2e19510084fb8e303b0daa2816e733fb3644a0" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" dependencies = [ - "libc", + "matches", + "percent-encoding", ] [[package]] @@ -428,7 +779,6 @@ checksum = "1adc00f486adfc9ce99f77d717836f0c5aa84965eb0b4f051f4e83f7cab53f8b" dependencies = [ "futures-channel", "futures-core", - "futures-executor", "futures-io", "futures-sink", "futures-task", @@ -451,17 +801,6 @@ version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af51b1b4a7fdff033703db39de8802c673eb91855f2e0d47dcf3bf2c0ef01f99" -[[package]] -name = "futures-executor" -version = "0.3.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d0d535a57b87e1ae31437b892713aee90cd2d7b0ee48727cd11fc72ef54761c" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - [[package]] name = "futures-io" version = "0.3.16" @@ -507,7 +846,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite", + "pin-project-lite 0.2.7", "pin-utils", "proc-macro-hack", "proc-macro-nested", @@ -515,16 +854,12 @@ dependencies = [ ] [[package]] -name = "generator" -version = "0.7.0" +name = "fxhash" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1d9279ca822891c1a4dae06d185612cf8fc6acfe5dff37781b41297811b12ee" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" dependencies = [ - "cc", - "libc", - "log", - "rustversion", - "winapi 0.3.9", + "byteorder", ] [[package]] @@ -536,6 +871,27 @@ dependencies = [ "typenum", ] +[[package]] +name = "generic-array" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" +dependencies = [ + "typenum", + "version_check 0.9.3", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + [[package]] name = "getrandom" version = "0.2.3" @@ -544,15 +900,9 @@ checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" dependencies = [ "cfg-if 1.0.0", "libc", - "wasi", + "wasi 0.10.0+wasi-snapshot-preview1", ] -[[package]] -name = "glob" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" - [[package]] name = "globset" version = "0.4.8" @@ -579,11 +929,11 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.3" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "825343c4eef0b63f541f8903f395dc5beb362a979b5799a84062527ef1e37726" +checksum = "5e4728fd124914ad25e99e3d15a9361a879f6620f63cb56bbb08f95abb97a535" dependencies = [ - "bytes", + "bytes 0.5.6", "fnv", "futures-core", "futures-sink", @@ -594,6 +944,7 @@ dependencies = [ "tokio", "tokio-util", "tracing", + "tracing-futures", ] [[package]] @@ -620,39 +971,33 @@ dependencies = [ "libc", ] +[[package]] +name = "hostname" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" +dependencies = [ + "libc", + "match_cfg", + "winapi 0.3.9", +] + [[package]] name = "http" version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "527e8c9ac747e28542699a951517aa9a6945af506cd1f2e1b53a576c17b6cc11" dependencies = [ - "bytes", + "bytes 1.0.1", "fnv", "itoa", ] -[[package]] -name = "http-body" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60daa14be0e0786db0f03a9e57cb404c9d756eed2b6c62b9ea98ec5743ec75a9" -dependencies = [ - "bytes", - "http", - "pin-project-lite", -] - [[package]] name = "httparse" -version = "1.4.1" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3a87b616e37e93c22fb19bcd386f02f3af5ea98a25670ad0fce773de23c5e68" - -[[package]] -name = "httpdate" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6456b8a6c8f33fee7d958fcd1b60d55b11940a79e63ae87013e6d22e26034440" +checksum = "acd94fdbe1d4ff688b67b04eee2e17bd50995534a61539e45adfefb45e5e5503" [[package]] name = "humansize" @@ -661,27 +1006,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02296996cb8796d7c6e3bc2d9211b7802812d36999a51bb754123ead7d37d026" [[package]] -name = "hyper" -version = "0.14.11" +name = "humantime" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b61cf2d1aebcf6e6352c97b81dc2244ca29194be1b276f5d8ad5c6330fffb11" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "idna" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", - "want", + "matches", + "unicode-bidi", + "unicode-normalization", ] [[package]] @@ -710,33 +1048,6 @@ checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" dependencies = [ "autocfg", "hashbrown", - "serde", -] - -[[package]] -name = "inlinable_string" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3094308123a0e9fd59659ce45e22de9f53fc1d2ac6e1feb9fef988e4f76cad77" - -[[package]] -name = "inotify" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4816c66d2c8ae673df83366c18341538f234a26d65a9ecea5c348b453ac1d02f" -dependencies = [ - "bitflags", - "inotify-sys", - "libc", -] - -[[package]] -name = "inotify-sys" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" -dependencies = [ - "libc", ] [[package]] @@ -757,21 +1068,24 @@ dependencies = [ "libc", ] +[[package]] +name = "ipconfig" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7e2f18aece9709094573a9f24f483c4f65caa4298e2f7ae1b71cc65d853fad7" +dependencies = [ + "socket2", + "widestring", + "winapi 0.3.9", + "winreg", +] + [[package]] name = "itoa" version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" -[[package]] -name = "js-sys" -version = "0.3.51" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83bdfbace3a0e81a4253f73b49e960b053e396a11012cbd49b9b74d6a2b67062" -dependencies = [ - "wasm-bindgen", -] - [[package]] name = "kernel32-sys" version = "0.2.2" @@ -782,6 +1096,12 @@ dependencies = [ "winapi-build", ] +[[package]] +name = "language-tags" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" + [[package]] name = "lazy_static" version = "1.4.0" @@ -789,16 +1109,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] -name = "lazycell" -version = "1.3.0" +name = "libc" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" +checksum = "a1fa8cddc8fbbee11227ef194b5317ed014b8acbf15139bd716a18ad3fe99ec5" [[package]] -name = "libc" -version = "0.2.98" +name = "linked-hash-map" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "320cfe77175da3a483efed4bc0adc1968ca050b098ce4f2f1c13a56626128790" +checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" [[package]] name = "lock_api" @@ -819,16 +1139,12 @@ dependencies = [ ] [[package]] -name = "loom" -version = "0.5.1" +name = "lru-cache" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2111607c723d7857e0d8299d5ce7a0bf4b844d3e44f8de136b13da513eaf8fc4" +checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" dependencies = [ - "cfg-if 1.0.0", - "generator", - "scoped-tls", - "serde", - "serde_json", + "linked-hash-map", ] [[package]] @@ -838,10 +1154,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" [[package]] -name = "memchr" -version = "2.4.0" +name = "match_cfg" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc" +checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" + +[[package]] +name = "matches" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" + +[[package]] +name = "memchr" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" [[package]] name = "mime" @@ -859,6 +1187,16 @@ dependencies = [ "unicase", ] +[[package]] +name = "miniz_oxide" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" +dependencies = [ + "adler", + "autocfg", +] + [[package]] name = "mio" version = "0.6.23" @@ -872,35 +1210,21 @@ dependencies = [ "kernel32-sys", "libc", "log", - "miow 0.2.2", + "miow", "net2", "slab", "winapi 0.2.8", ] [[package]] -name = "mio" -version = "0.7.13" +name = "mio-uds" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c2bdb6314ec10835cd3293dd268473a835c02b7b352e788be788b3c6ca6bb16" +checksum = "afcb699eb26d4332647cc848492bbc15eafb26f08d0304550d5aa1f612e066f0" dependencies = [ + "iovec", "libc", - "log", - "miow 0.3.7", - "ntapi", - "winapi 0.3.9", -] - -[[package]] -name = "mio-extras" -version = "2.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" -dependencies = [ - "lazycell", - "log", - "mio 0.6.23", - "slab", + "mio", ] [[package]] @@ -915,36 +1239,6 @@ dependencies = [ "ws2_32-sys", ] -[[package]] -name = "miow" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" -dependencies = [ - "winapi 0.3.9", -] - -[[package]] -name = "multer" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fdd568fea4758b30d6423f013f7171e193c34aa97828d1bd9f924fb3af30a8c" -dependencies = [ - "bytes", - "derive_more", - "encoding_rs", - "futures-util", - "http", - "httparse", - "log", - "mime", - "spin 0.9.2", - "tokio", - "tokio-util", - "twoway", - "version_check", -] - [[package]] name = "net2" version = "0.2.37" @@ -957,39 +1251,13 @@ dependencies = [ ] [[package]] -name = "normpath" -version = "0.3.0" +name = "nom" +version = "4.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27e6e8f70e9fbbe3752d330d769e3424f24b9458ce266df93a3b456902fd696a" +checksum = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6" dependencies = [ - "winapi 0.3.9", -] - -[[package]] -name = "notify" -version = "4.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae03c8c853dba7bfd23e571ff0cff7bc9dceb40a4cd684cd1681824183f45257" -dependencies = [ - "bitflags", - "filetime", - "fsevent", - "fsevent-sys", - "inotify", - "libc", - "mio 0.6.23", - "mio-extras", - "walkdir", - "winapi 0.3.9", -] - -[[package]] -name = "ntapi" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" -dependencies = [ - "winapi 0.3.9", + "memchr", + "version_check 0.1.5", ] [[package]] @@ -1034,10 +1302,43 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" [[package]] -name = "os_str_bytes" -version = "2.4.0" +name = "opaque-debug" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afb2e1c3ee07430c2cf76151675e583e0f19985fa6efae47d6848a3e2c824f85" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "openssl" +version = "0.10.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d9facdb76fec0b73c406f125d44d86fdad818d66fef0531eec9233ca425ff4a" +dependencies = [ + "bitflags", + "cfg-if 1.0.0", + "foreign-types", + "libc", + "once_cell", + "openssl-sys", +] + +[[package]] +name = "openssl-sys" +version = "0.9.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1996d2d305e561b70d1ee0c53f1542833f4e1ac6ce9a6708b6ff2738ca67dc82" +dependencies = [ + "autocfg", + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "os_str_bytes" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6acbef58a60fe69ab50510a55bc8cdd4d6cf2283d27ad338f54cb52747a9cf2d" [[package]] name = "parking_lot" @@ -1073,29 +1374,6 @@ dependencies = [ "regex", ] -[[package]] -name = "pear" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e44241c5e4c868e3eaa78b7c1848cadd6344ed4f54d029832d32b415a58702" -dependencies = [ - "inlinable_string", - "pear_codegen", - "yansi", -] - -[[package]] -name = "pear_codegen" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82a5ca643c2303ecb740d506539deba189e16f2754040a42901cd8105d0282d0" -dependencies = [ - "proc-macro2", - "proc-macro2-diagnostics", - "quote", - "syn", -] - [[package]] name = "percent-encoding" version = "2.1.0" @@ -1142,9 +1420,55 @@ checksum = "54be6e404f5317079812fc8f9f5279de376d8856929e21c184ecf6bbd692a11d" dependencies = [ "maplit", "pest", - "sha-1", + "sha-1 0.8.2", ] +[[package]] +name = "pin-project" +version = "0.4.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "918192b5c59119d51e0cd221f4d49dde9112824ba717369e903c97d076083d0f" +dependencies = [ + "pin-project-internal 0.4.28", +] + +[[package]] +name = "pin-project" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "576bc800220cc65dac09e99e97b08b358cfab6e17078de8dc5fee223bd2d0c08" +dependencies = [ + "pin-project-internal 1.0.8", +] + +[[package]] +name = "pin-project-internal" +version = "0.4.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3be26700300be6d9d23264c73211d8190e755b6b5ca7a1b28230025511b52a5e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pin-project-internal" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e8fe8163d14ce7f0cdac2e040116f22eac817edabff0be91e8aff7e9accf389" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pin-project-lite" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" + [[package]] name = "pin-project-lite" version = "0.2.7" @@ -1157,6 +1481,12 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "pkg-config" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" + [[package]] name = "ppv-lite86" version = "0.2.10" @@ -1173,7 +1503,7 @@ dependencies = [ "proc-macro2", "quote", "syn", - "version_check", + "version_check 0.9.3", ] [[package]] @@ -1184,7 +1514,7 @@ checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ "proc-macro2", "quote", - "version_check", + "version_check 0.9.3", ] [[package]] @@ -1209,17 +1539,10 @@ dependencies = [ ] [[package]] -name = "proc-macro2-diagnostics" -version = "0.9.1" +name = "quick-error" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bf29726d67464d49fa6224a1d07936a8c08bb3fba727c7493f6cf1616fdaada" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "version_check", - "yansi", -] +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" @@ -1230,6 +1553,19 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc 0.2.0", +] + [[package]] name = "rand" version = "0.8.4" @@ -1237,9 +1573,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" dependencies = [ "libc", - "rand_chacha", - "rand_core", - "rand_hc", + "rand_chacha 0.3.1", + "rand_core 0.6.3", + "rand_hc 0.3.1", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", ] [[package]] @@ -1249,7 +1595,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.6.3", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", ] [[package]] @@ -1258,7 +1613,16 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" dependencies = [ - "getrandom", + "getrandom 0.2.3", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", ] [[package]] @@ -1267,38 +1631,18 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" dependencies = [ - "rand_core", + "rand_core 0.6.3", ] [[package]] name = "redox_syscall" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab49abadf3f9e1c4bc499e8845e152ad87d2ad2d30371841171169e9d75feee" +checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" dependencies = [ "bitflags", ] -[[package]] -name = "ref-cast" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "300f2a835d808734ee295d45007adacb9ebb29dd3ae2424acfa17930cae541da" -dependencies = [ - "ref-cast-impl", -] - -[[package]] -name = "ref-cast-impl" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c38e3aecd2b21cb3959637b883bb3714bc7e43f0268b9a29d3743ee3e55cdd2" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "regex" version = "1.5.4" @@ -1317,125 +1661,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" [[package]] -name = "remove_dir_all" -version = "0.5.3" +name = "resolv-conf" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" dependencies = [ - "winapi 0.3.9", -] - -[[package]] -name = "ring" -version = "0.16.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" -dependencies = [ - "cc", - "libc", - "once_cell", - "spin 0.5.2", - "untrusted", - "web-sys", - "winapi 0.3.9", -] - -[[package]] -name = "rocket" -version = "0.5.0-rc.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a71c18c42a0eb15bf3816831caf0dad11e7966f2a41aaf486a701979c4dd1f2" -dependencies = [ - "async-stream", - "async-trait", - "atomic", - "atty", - "binascii", - "bytes", - "either", - "figment", - "futures", - "indexmap", - "log", - "memchr", - "multer", - "num_cpus", - "parking_lot", - "pin-project-lite", - "rand", - "ref-cast", - "rocket_codegen", - "rocket_http", - "serde", - "state", - "tempfile", - "time 0.2.27", - "tokio", - "tokio-stream", - "tokio-util", - "ubyte", - "version_check", - "yansi", -] - -[[package]] -name = "rocket_codegen" -version = "0.5.0-rc.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66f5fa462f7eb958bba8710c17c5d774bbbd59809fa76fb1957af7e545aea8bb" -dependencies = [ - "devise", - "glob", - "indexmap", - "proc-macro2", - "quote", - "rocket_http", - "syn", - "unicode-xid", -] - -[[package]] -name = "rocket_dyn_templates" -version = "0.1.0-rc.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c83f1287ad8fa034410928297a91db37518d5c46d7cc7e1e1b4a77aec0cd8807" -dependencies = [ - "glob", - "normpath", - "notify", - "rocket", - "serde", - "serde_json", - "tera", -] - -[[package]] -name = "rocket_http" -version = "0.5.0-rc.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23c8b7d512d2fcac2316ebe590cde67573844b99e6cc9ee0f53375fa16e25ebd" -dependencies = [ - "cookie", - "either", - "http", - "hyper", - "indexmap", - "log", - "memchr", - "mime", - "parking_lot", - "pear", - "percent-encoding", - "pin-project-lite", - "ref-cast", - "serde", - "smallvec", - "stable-pattern", - "state", - "time 0.2.27", - "tokio", - "tokio-rustls", - "uncased", + "hostname", + "quick-error", ] [[package]] @@ -1456,25 +1688,6 @@ dependencies = [ "semver 0.11.0", ] -[[package]] -name = "rustls" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" -dependencies = [ - "base64", - "log", - "ring", - "sct", - "webpki", -] - -[[package]] -name = "rustversion" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61b3909d758bb75c79f23d4736fac9433868679d3ad2ea7a61e3c25cfda9a088" - [[package]] name = "ryu" version = "1.0.5" @@ -1490,28 +1703,12 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "scoped-tls" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" - [[package]] name = "scopeguard" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" -[[package]] -name = "sct" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "semver" version = "0.9.0" @@ -1576,16 +1773,41 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_urlencoded" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edfa57a7f8d9c1d260a549e7224100f6c43d43f9103e06dd8b4095a9b2b43ce9" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + [[package]] name = "sha-1" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" dependencies = [ - "block-buffer", - "digest", + "block-buffer 0.7.3", + "digest 0.8.1", "fake-simd", - "opaque-debug", + "opaque-debug 0.2.3", +] + +[[package]] +name = "sha-1" +version = "0.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a0c8611594e2ab4ebbf06ec7cbbf0a99450b8570e96cbf5188b5d5f6ef18d81" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.9.0", + "opaque-debug 0.3.0", ] [[package]] @@ -1594,6 +1816,19 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" +[[package]] +name = "sha2" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b362ae5752fd2137731f9fa25fd4d9058af34666ca1966fb969119cc35719f12" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.9.0", + "opaque-debug 0.3.0", +] + [[package]] name = "signal-hook-registry" version = "1.4.0" @@ -1605,9 +1840,9 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f173ac3d1a7e3b28003f40de0b5ce7fe2710f9b9dc3fc38664cebee46b3b6527" +checksum = "c307a32c1c5c437f38c7fd45d753050587732ba8628319fbdf12a7e289ccc590" [[package]] name = "slug" @@ -1626,51 +1861,22 @@ checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" [[package]] name = "socket2" -version = "0.4.1" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "765f090f0e423d2b55843402a07915add955e7d60657db13707a159727326cad" +checksum = "122e570113d28d773067fab24266b66753f6ea915758651696b6e35e49f88d6e" dependencies = [ + "cfg-if 1.0.0", "libc", "winapi 0.3.9", ] -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - -[[package]] -name = "spin" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "511254be0c5bcf062b019a6c89c01a664aa359ded62f78aa72c6fc137c0590e5" - -[[package]] -name = "stable-pattern" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4564168c00635f88eaed410d5efa8131afa8d8699a612c80c455a0ba05c21045" -dependencies = [ - "memchr", -] - [[package]] name = "standback" version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e113fb6f3de07a243d434a56ec6f186dfd51cb08448239fe7bcae73f87ff28ff" dependencies = [ - "version_check", -] - -[[package]] -name = "state" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cf4f5369e6d3044b5e365c9690f451516ac8f0954084622b49ea3fde2f6de5" -dependencies = [ - "loom", + "version_check 0.9.3", ] [[package]] @@ -1730,29 +1936,15 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "syn" -version = "1.0.74" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1873d832550d4588c3dbc20f01361ab00bfe741048f71e3fecf145a7cc18b29c" +checksum = "b7f58f7e8eaa0009c5fec437aabf511bd9933e4b2d7407bd05273c01a8906ea7" dependencies = [ "proc-macro2", "quote", "unicode-xid", ] -[[package]] -name = "tempfile" -version = "3.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "rand", - "redox_syscall", - "remove_dir_all", - "winapi 0.3.9", -] - [[package]] name = "tera" version = "1.12.1" @@ -1767,7 +1959,7 @@ dependencies = [ "percent-encoding", "pest", "pest_derive", - "rand", + "rand 0.8.4", "regex", "serde", "serde_json", @@ -1796,14 +1988,34 @@ dependencies = [ [[package]] name = "textwrap" -version = "0.12.1" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "203008d98caf094106cfaba70acfed15e18ed3ddb7d94e49baec153a2b462789" +checksum = "0066c8d12af8b5acd21e00547c3797fde4e8677254a7ee429176ccebbe93dd80" dependencies = [ "terminal_size", "unicode-width", ] +[[package]] +name = "thiserror" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93119e4feac1cbe6c798c34d3a53ea0026b0b1de6a120deef895137c0529bfe2" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "060d69a0afe7796bf42e9e2ff91f5ee691fb15c53d38b4b62a9a53eb23164745" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "thread_local" version = "1.1.3" @@ -1814,12 +2026,22 @@ dependencies = [ ] [[package]] -name = "time" -version = "0.1.43" +name = "threadpool" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" +checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" +dependencies = [ + "num_cpus", +] + +[[package]] +name = "time" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" dependencies = [ "libc", + "wasi 0.10.0+wasi-snapshot-preview1", "winapi 0.3.9", ] @@ -1834,7 +2056,7 @@ dependencies = [ "standback", "stdweb", "time-macros", - "version_check", + "version_check 0.9.3", "winapi 0.3.9", ] @@ -1862,86 +2084,64 @@ dependencies = [ ] [[package]] -name = "tokio" -version = "1.9.0" +name = "tinyvec" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b7b349f11a7047e6d1276853e612d152f5e8a352c61917887cc2169e2366b4c" +checksum = "848a1e1181b9f6753b5e96a092749e29b11d19ede67dfbbd6c7dc7e0f49b5338" dependencies = [ - "autocfg", - "bytes", + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" + +[[package]] +name = "tokio" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6703a273949a90131b290be1fe7b039d0fc884aa1935860dfcbe056f28cd8092" +dependencies = [ + "bytes 0.5.6", + "futures-core", + "iovec", + "lazy_static", "libc", "memchr", - "mio 0.7.13", - "num_cpus", - "once_cell", - "pin-project-lite", + "mio", + "mio-uds", + "pin-project-lite 0.1.12", "signal-hook-registry", - "tokio-macros", + "slab", "winapi 0.3.9", ] [[package]] -name = "tokio-macros" -version = "1.3.0" +name = "tokio-openssl" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54473be61f4ebe4efd09cec9bd5d16fa51d70ea0192213d754d2d500457db110" +checksum = "3c4b08c5f4208e699ede3df2520aca2e82401b2de33f45e96696a074480be594" dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tokio-rustls" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6" -dependencies = [ - "rustls", - "tokio", - "webpki", -] - -[[package]] -name = "tokio-stream" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b2f3f698253f03119ac0102beaa64f67a67e08074d03a22d18784104543727f" -dependencies = [ - "futures-core", - "pin-project-lite", + "openssl", "tokio", ] [[package]] name = "tokio-util" -version = "0.6.7" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1caa0b0c8d94a049db56b5acf8cba99dc0623aab1b26d5b5f5e2d945846b3592" +checksum = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499" dependencies = [ - "bytes", + "bytes 0.5.6", "futures-core", "futures-sink", "log", - "pin-project-lite", + "pin-project-lite 0.1.12", "tokio", ] -[[package]] -name = "toml" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" -dependencies = [ - "serde", -] - -[[package]] -name = "tower-service" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" - [[package]] name = "tracing" version = "0.1.26" @@ -1949,33 +2149,67 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d" dependencies = [ "cfg-if 1.0.0", - "pin-project-lite", + "log", + "pin-project-lite 0.2.7", "tracing-core", ] [[package]] name = "tracing-core" -version = "0.1.18" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9ff14f98b1a4b289c6248a023c1c2fa1491062964e9fed67ab29c4e4da4a052" +checksum = "2ca517f43f0fb96e0c3072ed5c275fe5eece87e8cb52f4a77b69226d3b1c9df8" dependencies = [ "lazy_static", ] [[package]] -name = "try-lock" -version = "0.2.3" +name = "tracing-futures" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project 1.0.8", + "tracing", +] [[package]] -name = "twoway" -version = "0.2.2" +name = "trust-dns-proto" +version = "0.19.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c57ffb460d7c24cd6eda43694110189030a3d1dfe418416d9468fd1c1d290b47" +checksum = "1cad71a0c0d68ab9941d2fb6e82f8fb2e86d9945b94e1661dd0aaea2b88215a9" dependencies = [ - "memchr", - "unchecked-index", + "async-trait", + "cfg-if 1.0.0", + "enum-as-inner", + "futures", + "idna", + "lazy_static", + "log", + "rand 0.7.3", + "smallvec", + "thiserror", + "tokio", + "url", +] + +[[package]] +name = "trust-dns-resolver" +version = "0.19.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "710f593b371175db53a26d0b38ed2978fafb9e9e8d3868b1acd753ea18df0ceb" +dependencies = [ + "cfg-if 0.1.10", + "futures", + "ipconfig", + "lazy_static", + "log", + "lru-cache", + "resolv-conf", + "smallvec", + "thiserror", + "tokio", + "trust-dns-proto", ] [[package]] @@ -1984,37 +2218,12 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "879f6906492a7cd215bfa4cf595b600146ccfac0c79bcbd1f3000162af5e8b06" -[[package]] -name = "ubyte" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42756bb9e708855de2f8a98195643dff31a97f0485d90d8467b39dc24be9e8fe" -dependencies = [ - "serde", -] - [[package]] name = "ucd-trie" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" -[[package]] -name = "uncased" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5baeed7327e25054889b9bd4f975f32e5f4c5d434042d59ab6cd4142c0a76ed0" -dependencies = [ - "serde", - "version_check", -] - -[[package]] -name = "unchecked-index" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeba86d422ce181a719445e51872fa30f1f7413b62becb52e95ec91aa262d85c" - [[package]] name = "unic-char-property" version = "0.9.0" @@ -2071,7 +2280,22 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" dependencies = [ - "version_check", + "version_check 0.9.3", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "246f4c42e67e7a4e3c6106ff716a5d067d4132a642840b242e357e468a2a0085" + +[[package]] +name = "unicode-normalization" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" +dependencies = [ + "tinyvec", ] [[package]] @@ -2093,10 +2317,54 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" [[package]] -name = "untrusted" -version = "0.7.1" +name = "url" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" +dependencies = [ + "form_urlencoded", + "idna", + "matches", + "percent-encoding", +] + +[[package]] +name = "v_escape" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3e0ab5fab1db278a9413d2ea794cb66f471f898c5b020c3c394f6447625d9d4" +dependencies = [ + "buf-min", + "v_escape_derive", +] + +[[package]] +name = "v_escape_derive" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c860ad1273f4eee7006cee05db20c9e60e5d24cba024a32e1094aa8e574f3668" +dependencies = [ + "nom", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "v_htmlescape" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f9a8af610ad6f7fc9989c9d2590d9764bc61f294884e9ee93baa58795174572" +dependencies = [ + "cfg-if 1.0.0", + "v_escape", +] + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "vec_map" @@ -2104,6 +2372,12 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" +[[package]] +name = "version_check" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" + [[package]] name = "version_check" version = "0.9.3" @@ -2122,26 +2396,22 @@ dependencies = [ ] [[package]] -name = "want" -version = "0.3.0" +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" -dependencies = [ - "log", - "try-lock", -] +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" +version = "0.10.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" [[package]] name = "wasm-bindgen" -version = "0.2.74" +version = "0.2.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54ee1d4ed486f78874278e63e4069fc1ab9f6a18ca492076ffb90c5eb2997fd" +checksum = "8ce9b1b516211d33767048e5d47fa2a381ed8b76fc48d2ce4aa39877f9f183e0" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -2149,9 +2419,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.74" +version = "0.2.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b33f6a0694ccfea53d94db8b2ed1c3a8a4c86dd936b13b9f0a15ec4a451b900" +checksum = "cfe8dc78e2326ba5f845f4b5bf548401604fa20b1dd1d365fb73b6c1d6364041" dependencies = [ "bumpalo", "lazy_static", @@ -2164,9 +2434,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.74" +version = "0.2.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "088169ca61430fe1e58b8096c24975251700e7b1f6fd91cc9d59b04fb9b18bd4" +checksum = "44468aa53335841d9d6b6c023eaab07c0cd4bddbcfdee3e2bb1e8d2cb8069fef" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2174,9 +2444,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.74" +version = "0.2.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be2241542ff3d9f241f5e2cb6dd09b37efe786df8851c54957683a49f0987a97" +checksum = "0195807922713af1e67dc66132c7328206ed9766af3858164fb583eedc25fbad" dependencies = [ "proc-macro2", "quote", @@ -2187,42 +2457,35 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.74" +version = "0.2.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7cff876b8f18eed75a66cf49b65e7f967cb354a7aa16003fb55dbfd25b44b4f" +checksum = "acdb075a845574a1fa5f09fd77e43f7747599301ea3417a9fbffdeedfc1f4a29" [[package]] name = "web" -version = "0.2.1-beta" +version = "0.6.5-beta" dependencies = [ + "actix-files", + "actix-web", + "actix-web-httpauth", "chrono", "clap", - "colored", + "env_logger", "lazy_static", + "log", "mime_guess", - "rocket", - "rocket_dyn_templates", + "openssl", + "regex", + "serde", + "sha2", + "tera", ] [[package]] -name = "web-sys" -version = "0.3.51" +name = "widestring" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e828417b379f3df7111d3a2a9e5753706cae29c41f7c4029ee9fd77f3e09e582" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "webpki" -version = "0.21.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" -dependencies = [ - "ring", - "untrusted", -] +checksum = "c168940144dd21fd8046987c16a46a33d5fc84eec29ef9dcddc2ac9e31526b7c" [[package]] name = "winapi" @@ -2267,6 +2530,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "winreg" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2986deb581c4fe11b621998a5e53361efe6b48a151178d0cd9eeffa4dc6acc9" +dependencies = [ + "winapi 0.3.9", +] + [[package]] name = "ws2_32-sys" version = "0.2.1" @@ -2276,9 +2548,3 @@ dependencies = [ "winapi 0.2.8", "winapi-build", ] - -[[package]] -name = "yansi" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc79f4a1e39857fc00c3f662cbf2651c771f00e9c15fe2abc341806bd46bd71" diff --git a/Cargo.toml b/Cargo.toml index 0f2babc..0a8656b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,13 +3,24 @@ authors = ["Tim_Paik "] description = "simple http server written in rust" edition = "2018" name = "web" -version = "0.2.1-beta" +version = "0.6.5-beta" [dependencies] +actix-files = "0.5" +actix-web = {version = "3.3", features = ["openssl"]} +actix-web-httpauth = "0.5" chrono = "0.4" clap = {version = "3.0.0-beta.2", features = ["wrap_help", "color"]} -colored = "2" -lazy_static = "1.4.0" +env_logger = "0.9" +lazy_static = "1.4" +log = "0.4" mime_guess = "2.0.3" -rocket = {version = "0.5.0-rc.1", features = ["tls"]} -rocket_dyn_templates = {version = "0.1.0-rc.1", features = ["tera"]} +openssl = {version = "0.10"} +regex = "1.5" +serde = "1" +sha2 = "0.9" +tera = "1" + +[profile.release] +opt-level = "z" +lto = true \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 7492d99..2cd47ec 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,46 +1,163 @@ #[macro_use] extern crate clap; #[macro_use] -extern crate rocket; +extern crate lazy_static; -use colored::*; -use rocket::fairing::{Fairing, Info, Kind}; -use rocket::figment::providers::{Env, Format, Toml}; -use rocket::response::Redirect; -use rocket::{config::TlsConfig, fs::NamedFile}; -use rocket_dyn_templates::Template; -use std::hash::{Hash, Hasher}; -use std::net::IpAddr; -use std::path::Path; -use std::str::FromStr; +use actix_files as fs; +use actix_web::{ + dev::{Service, ServiceResponse}, + http, middleware, App, HttpResponse, HttpServer, +}; +use env_logger::fmt::Color; +use log::error; +use sha2::Digest; +use std::{ + env::{set_var, var}, + fs::read_dir, + io::{Error, ErrorKind, Write}, + net::IpAddr, + path::{Path, PathBuf}, + str::FromStr, +}; + +lazy_static! { + pub static ref TEMPLATE: tera::Tera = { + let mut tera = tera::Tera::default(); + tera.add_raw_template("index", include_str!("../templates/index.html.tera.embed")) + .unwrap(); + tera + }; +} #[inline] -fn url_decode(data: &str) -> String { - match rocket::http::RawStr::url_decode_lossy(rocket::http::RawStr::new(data)) { - std::borrow::Cow::Borrowed(data) => data.to_string(), - std::borrow::Cow::Owned(data) => data.to_string(), +fn get_file_type(from: &Path) -> String { + match from.extension() { + Some(os_str) => match os_str.to_str().unwrap_or("") { + "7z" => "archive", + "bz" => "archive", + "bz2" => "archive", + "cab" => "archive", + "gz" => "archive", + "iso" => "archive", + "rar" => "archive", + "xz" => "archive", + "zip" => "archive", + "zst" => "archive", + "zstd" => "archive", + "doc" => "word", + "docx" => "word", + "ppt" => "powerpoint", + "pptx" => "powerpoint", + "xls" => "excel", + "xlsx" => "excel", + "heic" => "image", + "pdf" => "pdf", + // JavaScript / TypeScript + "js" => "code", + "cjs" => "code", + "mjs" => "code", + "jsx" => "code", + "ts" => "code", + "tsx" => "code", + "json" => "code", + "coffee" => "code", + // HTML / CSS + "html" => "code", + "htm" => "code", + "xml" => "code", + "xhtml" => "code", + "vue" => "code", + "ejs" => "code", + "template" => "code", + "tmpl" => "code", + "pug" => "code", + "art" => "code", + "hbs" => "code", + "tera" => "code", + "css" => "code", + "scss" => "code", + "sass" => "code", + "less" => "code", + // Python + "py" => "code", + "pyc" => "code", + // JVM + "java" => "code", + "kt" => "code", + "kts" => "code", + "gradle" => "code", + "groovy" => "code", + "scala" => "code", + "jsp" => "code", + // Shell + "sh" => "code", + // Php + "php" => "code", + // C / C++ + "c" => "code", + "cc" => "code", + "cpp" => "code", + "h" => "code", + "cmake" => "code", + // C# + "cs" => "code", + "xaml" => "code", + "sln" => "code", + "csproj" => "code", + // Golang + "go" => "code", + "mod" => "code", + "sum" => "code", + // Swift + "swift" => "code", + "plist" => "code", + "xib" => "code", + "xcconfig" => "code", + "entitlements" => "code", + "xcworkspacedata" => "code", + "pbxproj" => "code", + // Ruby + "rb" => "code", + // Rust + "rs" => "code", + // Objective-C + "m" => "code", + // Dart + "dart" => "code", + // Microsoft + "manifest" => "code", + "rc" => "code", + "cmd" => "code", + "bat" => "code", + "ps1" => "code", + // Config + "ini" => "code", + "yaml" => "code", + "toml" => "code", + "conf" => "code", + "properties" => "code", + "lock" => "alt", + _ => match mime_guess::from_path(from).first_or_octet_stream().type_() { + mime_guess::mime::AUDIO => "audio", + mime_guess::mime::IMAGE => "image", + mime_guess::mime::PDF => "pdf", + mime_guess::mime::VIDEO => "video", + mime_guess::mime::TEXT => "alt", + _ => "file", + }, + }, + None => "file", } + .to_string() } -#[get("/")] -async fn file_server(path: std::path::PathBuf) -> Option { - let mut path = Path::new(&std::env::var("ROOT").unwrap_or(".".to_string())) - .join(url_decode(path.to_str().unwrap_or(""))); - if path.is_dir() { - path.push("index.html") - } - NamedFile::open(path).await.ok() -} - -#[derive(Eq, Ord, PartialEq, PartialOrd, rocket::serde::Serialize)] -#[serde(crate = "rocket::serde")] +#[derive(Eq, Ord, PartialEq, PartialOrd, serde::Serialize)] struct Dir { name: String, modified: String, } -#[derive(Eq, Ord, PartialEq, PartialOrd, rocket::serde::Serialize)] -#[serde(crate = "rocket::serde")] +#[derive(Eq, Ord, PartialEq, PartialOrd, serde::Serialize)] struct File { name: String, size: u64, @@ -48,8 +165,7 @@ struct File { modified: String, } -#[derive(rocket::serde::Serialize)] -#[serde(crate = "rocket::serde")] +#[derive(serde::Serialize)] struct IndexContext<'r> { title: &'r str, paths: Vec<&'r str>, @@ -57,70 +173,58 @@ struct IndexContext<'r> { files: Vec, } -#[derive(Responder)] -enum Resp { - #[response(status = 200, content_type = "text/html; charset=utf-8")] - Index(Template), - #[response(status = 404)] - NotFound(&'static str), - #[response(status = 200)] - File(Option), - #[response(status = 302)] - Redirect(Redirect), -} - -#[catch(404)] -async fn not_found(request: &rocket::Request<'_>) -> Resp { - let path = url_decode(request.uri().path().as_str()); - let root = std::env::var("ROOT").unwrap_or(".".to_string()); - let root = Path::new(&root); - let localpath = path[1..path.len()].to_string(); - // Remove the / in front of the path, if the path with / is spliced, the previous path will be ignored - let localpath = &root.join(localpath); - // Show dotfiles, std::path::PathBuf does not match the url beginning with the dot - let show_dot_files = std::env::var("DOTFILES").unwrap_or("false".to_string()) == "true"; - if localpath.is_file() && show_dot_files { - return Resp::File(NamedFile::open(localpath).await.ok()); +fn render_index( + dir: &actix_files::Directory, + req: &actix_web::HttpRequest, +) -> Result { + let mut index = dir.path.clone(); + index.push("index.html"); + if index.exists() && index.is_file() { + let res = match actix_files::NamedFile::open(index)? + .set_content_type(mime_guess::mime::TEXT_HTML_UTF_8) + .into_response(req) + { + Ok(res) => res, + Err(e) => return Err(Error::new(ErrorKind::Other, e.to_string())), + }; + return Ok(ServiceResponse::new(req.clone(), res)); } - // Single-Page Application support - if root.join("index.html").is_file() - && std::env::var("SPA").unwrap_or("false".to_string()) == "true" - { - return Resp::File(NamedFile::open(&root.join("index.html")).await.ok()); - } - if !localpath.is_dir() || std::env::var("NOINDEX").unwrap_or("false".to_string()) == "true" { - return Resp::NotFound(""); - } - if !path.ends_with("/") { - return Resp::Redirect(Redirect::to(path.to_string() + "/")); + if var("NOINDEX").unwrap_or("false".to_string()) == "true" { + return Ok(ServiceResponse::new( + req.clone(), + HttpResponse::NotFound().body(""), + )); } + let show_dot_files = var("DOTFILES").unwrap_or("false".to_string()) == "true"; let mut context = IndexContext { title: "", paths: vec![], dirs: vec![], files: vec![], }; - for path in path.split('/') { + for path in req.path().split('/') { if path == "" { continue; } context.paths.push(path); } - match std::fs::read_dir(localpath) { - Err(e) => println!("{} {}", "Error".bright_red(), e.to_string()), + match read_dir(&dir.path) { + Err(e) => { + error!(target: "read_dir", "[ERROR] Read dir error: {}", e.to_string()); + } Ok(paths) => { for path in paths { let path = match path { - Ok(a) => a, + Ok(path) => path, Err(e) => { - println!("{} {}", "Error".bright_red(), e.to_string()); + error!(target: "read_dir", "[ERROR] Read path error: {}", e.to_string()); continue; } }; let name = match path.file_name().to_str() { Some(str) => str.to_string(), None => { - println!("{} {}", "Error".bright_red(), "Read filename error"); + error!(target: "read_dir", "[ERROR] Read filename error"); continue; } }; @@ -130,16 +234,16 @@ async fn not_found(request: &rocket::Request<'_>) -> Resp { let metadata = match path.metadata() { Ok(data) => data, Err(e) => { - println!("{} {}", "Error".bright_red(), e.to_string()); + error!(target: "read_dir", "[ERROR] Read metadata error: {}", e.to_string()); continue; } }; let modified = match metadata.modified() { Ok(time) => chrono::DateTime::::from(time) - .format("%Y-%m-%d %H:%M:%S") + .format("%Y/%m/%d %H:%M:%S") .to_string(), Err(e) => { - println!("{} {}", "Error".bright_red(), e.to_string()); + error!(target: "read_dir", "[ERROR] Read modified time error: {}", e.to_string()); continue; } }; @@ -147,129 +251,7 @@ async fn not_found(request: &rocket::Request<'_>) -> Resp { context.dirs.push(Dir { name, modified }); } else if metadata.is_file() { let size = metadata.len(); - let filetype = match path.path().extension() { - Some(os_str) => match os_str.to_str().unwrap_or("") { - "7z" => "archive", - "bz" => "archive", - "bz2" => "archive", - "cab" => "archive", - "gz" => "archive", - "iso" => "archive", - "rar" => "archive", - "xz" => "archive", - "zip" => "archive", - "zst" => "archive", - "zstd" => "archive", - "doc" => "word", - "docx" => "word", - "ppt" => "powerpoint", - "pptx" => "powerpoint", - "xls" => "excel", - "xlsx" => "excel", - "heic" => "image", - "pdf" => "pdf", - // JavaScript / TypeScript - "js" => "code", - "cjs" => "code", - "mjs" => "code", - "jsx" => "code", - "ts" => "code", - "tsx" => "code", - "json" => "code", - "coffee" => "code", - // HTML / CSS - "html" => "code", - "htm" => "code", - "xml" => "code", - "xhtml" => "code", - "vue" => "code", - "ejs" => "code", - "template" => "code", - "tmpl" => "code", - "pug" => "code", - "art" => "code", - "hbs" => "code", - "tera" => "code", - "css" => "code", - "scss" => "code", - "sass" => "code", - "less" => "code", - // Python - "py" => "code", - "pyc" => "code", - // JVM - "java" => "code", - "kt" => "code", - "kts" => "code", - "gradle" => "code", - "groovy" => "code", - "scala" => "code", - "jsp" => "code", - // Shell - "sh" => "code", - // Php - "php" => "code", - // C / C++ - "c" => "code", - "cc" => "code", - "cpp" => "code", - "h" => "code", - "cmake" => "code", - // C# - "cs" => "code", - "xaml" => "code", - "sln" => "code", - "csproj" => "code", - // Golang - "go" => "code", - "mod" => "code", - "sum" => "code", - // Swift - "swift" => "code", - "plist" => "code", - "xib" => "code", - "xcconfig" => "code", - "entitlements" => "code", - "xcworkspacedata" => "code", - "pbxproj" => "code", - // Ruby - "rb" => "code", - // Rust - "rs" => "code", - // Objective-C - "m" => "code", - // Dart - "dart" => "code", - // Microsoft - "manifest" => "code", - "rc" => "code", - "cmd" => "code", - "bat" => "code", - "ps1" => "code", - // Config - "ini" => "code", - "yaml" => "code", - "toml" => "code", - "conf" => "code", - "properties" => "code", - "lock" => "alt", - _ => { - match mime_guess::from_path(path.path()) - .first_or_octet_stream() - .type_() - { - mime_guess::mime::AUDIO => "audio", - mime_guess::mime::IMAGE => "image", - mime_guess::mime::PDF => "pdf", - mime_guess::mime::VIDEO => "video", - mime_guess::mime::TEXT => "alt", - _ => "file", - } - } - }, - None => "file", - } - .to_string(); + let filetype = get_file_type(&path.path()); context.files.push(File { name, size, @@ -283,93 +265,25 @@ async fn not_found(request: &rocket::Request<'_>) -> Resp { context.title = context.paths.last().unwrap_or(&"/"); context.dirs.sort(); context.files.sort(); - Resp::Index(Template::render("index", &context)) -} - -#[catch(500)] -fn internal_server_error() {} - -struct Logger {} - -#[rocket::async_trait] -impl Fairing for Logger { - fn info(&self) -> Info { - Info { - name: "Logger", - kind: Kind::Liftoff | Kind::Response, + let content = tera::Context::from_serialize(&context); + let content = match content { + Ok(ctx) => ctx, + Err(e) => { + error!(target: "tera::Context::from_serialize", "[ERROR] Read modified time error: {}", e.to_string()); + return Err(Error::new(ErrorKind::Other, e.to_string())); } - } - async fn on_liftoff(&self, rocket: &rocket::Rocket) { - println!( - "{}", - format!( - "Serving {} on {}{}:{}", - std::env::var("ROOT").unwrap_or("[Get Path Error]".to_string()), - if rocket.config().tls_enabled() { - "https://" - } else { - "http://" - }, - rocket.config().address.to_string(), - rocket.config().port.to_string() - ) - .bright_green() - ); - } - async fn on_response<'r>( - &self, - request: &'r rocket::Request<'_>, - response: &mut rocket::Response<'r>, - ) { - println!( - "[{}] {} | {} | {} {}", - chrono::Local::now() - .format("%Y/%m/%d %H:%M:%S") - .to_string() - .bright_blue(), - request - .client_ip() - .unwrap_or(IpAddr::from([0, 0, 0, 0])) - .to_string() - .bright_blue(), - if response.status().code < 400 { - response.status().code.to_string().bright_green() - } else { - response.status().code.to_string().bright_red() - }, - request.method().to_string().bright_blue(), - request.uri().to_string().bright_blue() - ); - } -} - -struct CORS {} - -#[rocket::async_trait] - -impl Fairing for CORS { - fn info(&self) -> Info { - Info { - name: "CORS", - kind: Kind::Response, - } - } - async fn on_response<'r>( - &self, - _request: &'r rocket::Request<'_>, - response: &mut rocket::Response<'r>, - ) { - if std::env::var("ENABLE_CORS").unwrap_or("false".to_string()) == "true" { - response.adjoin_header(rocket::http::Header::new( - "Access-Control-Allow-Origin", - std::env::var("CORS").unwrap_or("*".to_string()), - )); - } - } + }; + let index = TEMPLATE + .render("index", &content) + .unwrap_or("TEMPLATE RENDER ERROR".to_string()); + let res = HttpResponse::Ok() + .content_type("text/html; charset=utf-8") + .body(index); + Ok(ServiceResponse::new(req.clone(), res)) } #[inline] -fn display_path(path: &std::path::Path) -> String { +fn display_path(path: &Path) -> String { let root = Path::canonicalize(path).unwrap().display().to_string(); if root.starts_with("\\\\?\\") { root[4..root.len()].to_string() @@ -378,19 +292,46 @@ fn display_path(path: &std::path::Path) -> String { } } -#[rocket::main] -async fn main() { +#[inline] +fn hash(from: &str) -> String { + let mut hasher = sha2::Sha512::new(); + hasher.update(from); + format!("{:?}", hasher.finalize()) +} + +#[inline] +async fn validator( + req: actix_web::dev::ServiceRequest, + auth: actix_web_httpauth::extractors::basic::BasicAuth, +) -> Result { + if auth.user_id() == var("AUTH_USERNAME").unwrap_or("".to_string()).as_str() + && hash(auth.password().unwrap_or(&std::borrow::Cow::from(""))) + == var("AUTH_PASSWORD").unwrap_or("".to_string()).as_str() + { + return Ok(req); + } + let err = actix_web_httpauth::extractors::AuthenticationError::new( + actix_web_httpauth::headers::www_authenticate::basic::Basic::with_realm( + "Incorrect username or password", + ), + ); + Err(actix_web::Error::from(err)) +} + +#[actix_web::main] +async fn main() -> std::io::Result<()> { let matches = clap_app!((crate_name!()) => (version: crate_version!()) (author: crate_authors!()) (about: crate_description!()) (@arg noindex: --noindex "Disable automatic index page generation") - (@arg upload: -u --upload "Enable file upload") - // (@arg nocache: --nocache "Disable HTTP cache") // Not support now + (@arg compress: -c --compress "Enable streaming compression (Content-length/segment download will be disabled)") + // (@arg upload: -u --upload "Enable file upload") + (@arg nocache: --nocache "Disable HTTP cache") (@arg nocolor: --nocolor "Disable cli colors") (@arg cors: --cors [VALUE] min_values(0) max_values(1) "Enable CORS") (@arg spa: --spa "Enable Single-Page Application mode (always serve /index.html when the file is not found)") - (@arg dotfiles: --dotfiles "Show dotfiles") + (@arg dotfiles: -d --dotfiles "Show dotfiles") (@arg open: -o --open "Open the page in the default browser") (@arg ROOT: default_value["."] { |path| match std::fs::metadata(path) { @@ -455,90 +396,69 @@ async fn main() { ) .get_matches(); - std::env::set_var( + set_var( "ROOT", display_path(Path::new(matches.value_of("ROOT").unwrap_or("."))), ); - std::env::set_var("NOINDEX", matches.is_present("noindex").to_string()); - std::env::set_var("SPA", matches.is_present("spa").to_string()); - std::env::set_var("DOTFILES", matches.is_present("dotfiles").to_string()); + set_var("NOINDEX", matches.is_present("noindex").to_string()); + set_var("SPA", matches.is_present("spa").to_string()); + set_var("DOTFILES", matches.is_present("dotfiles").to_string()); + set_var("NOCACHE", matches.is_present("nocache").to_string()); + set_var("COMPRESS", matches.is_present("compress").to_string()); if matches.is_present("nocolor") { - colored::control::set_override(false); + set_var("RUST_LOG_STYLE", "never"); } match matches.value_of("auth") { Some(s) => { + set_var("ENABLE_AUTH", matches.is_present("auth").to_string()); let parts = s.splitn(2, ':').collect::>(); - let mut hash = std::collections::hash_map::DefaultHasher::new(); - parts[1].hash(&mut hash); - std::env::set_var("USERNAME", parts[0]); - std::env::set_var("PASSWORD", hash.finish().to_string()); + set_var("AUTH_USERNAME", parts[0]); + set_var("AUTH_PASSWORD", hash(parts[1])); } None => {} } if matches.is_present("cors") { - std::env::set_var("ENABLE_CORS", "true"); + set_var("ENABLE_CORS", matches.is_present("cors").to_string()); match matches.value_of("cors") { Some(str) => { - std::env::set_var("CORS", str.to_string()); + set_var("CORS", str.to_string()); } None => { - std::env::set_var("CORS", "*"); + set_var("CORS", "*"); } } } - let figment = rocket::Config::figment() - .merge(( - "address", - IpAddr::from_str(matches.value_of("address").unwrap_or("0.0.0.0")).unwrap(), - )) - .merge(( - "port", - matches - .value_of("port") - .unwrap_or("8000") - .parse::() - .unwrap(), - )) - .merge(( - "ident", - std::env::var("WEB_SERVER_NAME").unwrap_or("timpaik'web server".to_string()), - )) - .merge(("cli_colors", matches.is_present("color"))) - .merge(("log_level", "off")) - .merge(("template_dir", ".")) - // The default is "templates/", an error will be reported if the folder is not found - .merge(Toml::file(Env::var_or("WEB_CONFIG", "web.toml")).nested()) - .merge(Env::prefixed("WEB_").ignore(&["PROFILE"]).global()); - let enable_tls = matches.is_present("cert") && matches.is_present("key"); - - let figment = if enable_tls { - let cert = Path::new(matches.value_of("cert").unwrap()); - let key = Path::new(matches.value_of("key").unwrap()); - figment.merge(("tls", TlsConfig::from_paths(cert, key))) - } else { - figment - }; + let ip = matches + .value_of("address") + .unwrap_or("127.0.0.1") + .to_string(); + let addr = format!( + "{}:{}", + ip, + matches.value_of("port").unwrap_or("8000").to_string() + ); + let url = format!( + "{}{}:{}", + if enable_tls { + "https://".to_string() + } else { + "http://".to_string() + }, + if ip == "0.0.0.0" { + "127.0.0.1" + } else { + ip.as_str() + }, + matches.value_of("port").unwrap_or("8000").to_string() + ); if matches.is_present("open") { - let url = format!( - "{}{}:{}", - if enable_tls { - "https://".to_string() - } else { - "http://".to_string() - }, - matches - .value_of("address") - .unwrap_or("127.0.0.1") - .to_string(), - matches.value_of("port").unwrap_or("8000").to_string() - ); if cfg!(target_os = "windows") { std::process::Command::new("explorer").arg(url).spawn().ok(); } else if cfg!(target_os = "macos") { @@ -548,23 +468,151 @@ async fn main() { } } - match rocket::custom(figment) - .attach(Template::custom(|engines| { - engines - .tera - .add_raw_template("index", include_str!("../templates/index.html.tera")) + env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("info")) + .format(|buf, record| { + let data = record.args().to_string(); + let mut style = buf.style(); + let blue = style.set_color(Color::Rgb(52, 152, 219)); + let mut style = buf.style(); + let red = style.set_color(Color::Rgb(231, 76, 60)); + let mut style = buf.style(); + let green = style.set_color(Color::Rgb(76, 175, 80)); + if record.target() == "actix_web::middleware::logger" { + let data: Vec<&str> = data.splitn(5, "^").collect(); + let time = blue.value( + chrono::NaiveDateTime::from_str(data[0]) + .unwrap() + .format("%Y/%m/%d %H:%M:%S") + .to_string(), + ); + let ipaddr = blue.value(data[1]); + let status_code = data[2].parse().unwrap_or(500); + let status_code = if status_code < 400 { + green.value(status_code) + } else { + red.value(status_code) + }; + let process_time: Vec<&str> = data[3].splitn(2, ".").collect(); + let process_time = process_time[0].to_string() + "ms"; + let process_time = blue.value(if process_time.len() == 3 { + " ".to_string() + process_time.as_str() + } else if process_time.len() == 4 { + " ".to_string() + process_time.as_str() + } else { + process_time + }); + let content = blue.value(data[4]); + return writeln!( + buf, + "\r[{}] {} | {} | {} | {}", + time, ipaddr, status_code, process_time, content + ); + // Add '\r' to remove the input ^C + } else if record.target() == "actix_server::builder" { + if data.starts_with("SIGINT received, exiting") { + return writeln!(buf, "\r{}", green.value("[INFO] SIGINT received, exiting")); + } else { + let data = data.replace("actix-web-service-", ""); + let re1 = regex::Regex::new("Starting (.*) workers").unwrap(); + if re1.is_match(&data) { + return Ok(()); + } + let re2 = regex::Regex::new("Starting \"(.*)\" service on (.*)").unwrap(); + if re2.is_match(&data) { + let addr = re2 + .captures(&data) + .unwrap() + .get(1) + .map_or("", |m| m.as_str()); + let data = format!( + "[INFO] Serving {} on {}", + var("ROOT").unwrap_or(".".to_string()).as_str(), + addr + ); + return writeln!(buf, "\r{}", green.value(data)); + } + } + } + if data.starts_with("[ERROR]") { + writeln!(buf, "\r{}", red.value(data)) + } else { + writeln!(buf, "\r{}", green.value(data)) + } + }) + .init(); + + let server = HttpServer::new(move || { + let compress = if var("COMPRESS").unwrap_or("false".to_string()) == "true" { + http::header::ContentEncoding::Auto + } else { + http::header::ContentEncoding::Identity + }; + let app = App::new() + .wrap(middleware::Compress::new(compress)) + .wrap(middleware::Condition::new( + true, + middleware::NormalizePath::default(), + )) + .wrap(middleware::Condition::new( + var("ENABLE_AUTH").unwrap_or("false".to_string()) == "true", + actix_web_httpauth::middleware::HttpAuthentication::basic(validator), + )) + .wrap_fn(|req, srv| { + let paths = PathBuf::from_str(req.path()).unwrap_or(PathBuf::default()); + let mut isdotfile = false; + for path in paths.iter() { + if path.to_string_lossy().starts_with('.') { + isdotfile = true; + } + } + let fut = srv.call(req); + async move { + let res = fut.await?.map_body(|head, mut body| { + if var("NOCACHE").unwrap_or("false".to_string()) == "true" { + head.headers_mut().insert( + http::header::CACHE_CONTROL, + http::HeaderValue::from_static("no-store"), + ); + } + if var("ENABLE_CORS").unwrap_or("false".to_string()) == "true" { + let cors = var("CORS").unwrap_or("*".to_string()); + let cors = http::HeaderValue::from_str(cors.as_str()) + .unwrap_or(http::HeaderValue::from_static("*")); + head.headers_mut() + .insert(http::header::ACCESS_CONTROL_ALLOW_ORIGIN, cors); + } + if isdotfile && !(var("DOTFILES").unwrap_or("false".to_string()) == "true") + { + head.status = http::StatusCode::FORBIDDEN; + *head.headers_mut() = http::HeaderMap::new(); + let _ = body.take_body(); + } + body + }); + Ok(res) + } + }) + .wrap(middleware::Logger::new("%t^%a^%s^%D^%r")); + let files = fs::Files::new("/", var("ROOT").unwrap_or(".".to_string())) + .use_hidden_files() + .prefer_utf8(true) + .show_files_listing() + .files_listing_renderer(render_index); + return app.service(files); + }); + let server = if enable_tls { + let cert = Path::new(matches.value_of("cert").unwrap()); + let key = Path::new(matches.value_of("key").unwrap()); + let mut builder = + openssl::ssl::SslAcceptor::mozilla_intermediate(openssl::ssl::SslMethod::tls()) .unwrap(); - })) - .attach(CORS {}) - .attach(Logger {}) - .mount("/", routes![file_server]) - .register("/", catchers![not_found, internal_server_error]) - .launch() - .await - { - Ok(_) => {} - Err(e) => { - println!("{}", format!("[Error] {}", e.to_string()).bright_red()); - } + builder + .set_private_key_file(key, openssl::ssl::SslFiletype::PEM) + .unwrap(); + builder.set_certificate_chain_file(cert).unwrap(); + server.bind_openssl(addr, builder) + } else { + server.bind(addr) }; + server?.run().await } diff --git a/templates/index.html.tera.embed b/templates/index.html.tera.embed new file mode 100644 index 0000000..db0d162 --- /dev/null +++ b/templates/index.html.tera.embed @@ -0,0 +1 @@ +{{ title }} {% set paths_length = paths | length -%}
{% set dir_length = dirs | length -%} {% set file_length = files | length -%} {{ dir_length }} directories {{ file_length }} files
{% for dir in dirs -%}{% endfor -%} {% for file in files -%}{% endfor -%}
NameSizeModified
Go up--
{{ dir.name }}-
{{ file.name }}{{ file.size | filesizeformat | replace(from="KB", to="KiB") | replace(from="MB", to="MiB") | replace(from="GB", to="GiB") | replace(from="TB", to="TiB") | replace(from="PB", to="PiB") | replace(from="EB", to="EiB") | replace(from="ZB", to="ZiB") | replace(from="YB", to="YiB") }}
{% if dir_length + file_length == 0 -%}
Nothing here
{% endif -%}
\ No newline at end of file