diff --git a/Cargo.lock b/Cargo.lock index c842c2e..c116e28 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -30,6 +30,12 @@ dependencies = [ "winapi 0.3.8", ] +[[package]] +name = "anyhow" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7825f6833612eb2414095684fcf6c635becf3ce97fe48cf6421321e93bfbd53c" + [[package]] name = "arc-swap" version = "0.4.4" @@ -130,6 +136,12 @@ dependencies = [ "byteorder", ] +[[package]] +name = "base64" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" + [[package]] name = "bitflags" version = "1.2.1" @@ -190,6 +202,12 @@ dependencies = [ "serde", ] +[[package]] +name = "bumpalo" +version = "3.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fb8038c1ddc0a5f73787b130f4cc75151e96ed33e417fde765eb5a81e3532f4" + [[package]] name = "byte-tools" version = "0.3.1" @@ -202,17 +220,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" -[[package]] -name = "bytes" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" -dependencies = [ - "byteorder", - "either", - "iovec", -] - [[package]] name = "bytes" version = "0.5.3" @@ -281,34 +288,6 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "995a44c877f9212528ccc74b21a232f66ad69001e40ede5bcee2ac9ef2657120" -[[package]] -name = "cookie" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "888604f00b3db336d2af898ec3c1d5d0ddf5e6d462220f2ededc33a87ac4bbd5" -dependencies = [ - "time 0.1.42", - "url 1.7.2", -] - -[[package]] -name = "cookie_store" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46750b3f362965f197996c4448e4a0935e791bf7d6631bfce9ee0af3d24c919c" -dependencies = [ - "cookie", - "failure", - "idna 0.1.5", - "log", - "publicsuffix", - "serde", - "serde_json", - "time 0.1.42", - "try_from", - "url 1.7.2", -] - [[package]] name = "core-foundation" version = "0.6.4" @@ -340,40 +319,7 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8ec7fcd21571dc78f96cc96243cab8d8f035247c3efd16c687be154c3fa9efa" dependencies = [ - "crossbeam-utils 0.6.6", -] - -[[package]] -name = "crossbeam-deque" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3aa945d63861bfe624b55d153a39684da1e8c0bc8fba932f7ee3a3c16cea3ca" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils 0.7.0", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5064ebdbf05ce3cb95e45c8b086f72263f4166b29b97f6baff7ef7fe047b55ac" -dependencies = [ - "autocfg", - "cfg-if", - "crossbeam-utils 0.7.0", - "lazy_static", - "memoffset", - "scopeguard", -] - -[[package]] -name = "crossbeam-queue" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c979cd6cfe72335896575c6b5688da489e420d36a27a0b9eb0c73db574b4a4b" -dependencies = [ - "crossbeam-utils 0.6.6", + "crossbeam-utils", ] [[package]] @@ -386,17 +332,6 @@ dependencies = [ "lazy_static", ] -[[package]] -name = "crossbeam-utils" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce446db02cdc3165b94ae73111e570793400d0794e46125cc4056c81cbb039f4" -dependencies = [ - "autocfg", - "cfg-if", - "lazy_static", -] - [[package]] name = "crypto-mac" version = "0.7.0" @@ -742,12 +677,6 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" -[[package]] -name = "futures" -version = "0.1.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef" - [[package]] name = "futures" version = "0.3.1" @@ -779,16 +708,6 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79564c427afefab1dfb3298535b21eda083ef7935b4f0ecbfcb121f0aec10866" -[[package]] -name = "futures-cpupool" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" -dependencies = [ - "futures 0.1.29", - "num_cpus", -] - [[package]] name = "futures-executor" version = "0.3.1" @@ -875,40 +794,22 @@ dependencies = [ "wasi", ] -[[package]] -name = "h2" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5b34c246847f938a410a03c5458c7fee2274436675e76d8b903c08efc29c462" -dependencies = [ - "byteorder", - "bytes 0.4.12", - "fnv", - "futures 0.1.29", - "http 0.1.21", - "indexmap", - "log", - "slab", - "string", - "tokio-io", -] - [[package]] name = "h2" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9433d71e471c1736fd5a61b671fc0b148d7a2992f666c958d03cd8feb3b88d1" dependencies = [ - "bytes 0.5.3", + "bytes", "fnv", "futures-core", "futures-sink", "futures-util", - "http 0.2.0", + "http", "indexmap", "log", "slab", - "tokio 0.2.6", + "tokio", "tokio-util", ] @@ -946,48 +847,25 @@ dependencies = [ "digest", ] -[[package]] -name = "http" -version = "0.1.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6ccf5ede3a895d8856620237b2f02972c1bbc78d2965ad7fe8838d4a0ed41f0" -dependencies = [ - "bytes 0.4.12", - "fnv", - "itoa", -] - [[package]] name = "http" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b708cc7f06493459026f53b9a61a7a121a5d1ec6238dee58ea4941132b30156b" dependencies = [ - "bytes 0.5.3", + "bytes", "fnv", "itoa", ] -[[package]] -name = "http-body" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6741c859c1b2463a423a1dbce98d418e6c3c3fc720fb0d45528657320920292d" -dependencies = [ - "bytes 0.4.12", - "futures 0.1.29", - "http 0.1.21", - "tokio-buf", -] - [[package]] name = "http-body" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" dependencies = [ - "bytes 0.5.3", - "http 0.2.0", + "bytes", + "http", ] [[package]] @@ -996,16 +874,16 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03782df25e951e511f22e5ba6189f63a297b5e69c9814d45d3e6ac8f2811916a" dependencies = [ - "bytes 0.5.3", + "bytes", "flate2", - "futures 0.3.1", - "http 0.2.0", - "http-body 0.3.1", + "futures", + "http", + "http-body", "httpdate", "mime", "smallvec 1.1.0", "time 0.2.1", - "tokio 0.2.6", + "tokio", "winapi 0.3.8", ] @@ -1021,71 +899,41 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47" -[[package]] -name = "hyper" -version = "0.12.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dbe6ed1438e1f8ad955a4701e9a944938e9519f6888d12d8558b645e247d5f6" -dependencies = [ - "bytes 0.4.12", - "futures 0.1.29", - "futures-cpupool", - "h2 0.1.26", - "http 0.1.21", - "http-body 0.1.0", - "httparse", - "iovec", - "itoa", - "log", - "net2", - "rustc_version", - "time 0.1.42", - "tokio 0.1.22", - "tokio-buf", - "tokio-executor", - "tokio-io", - "tokio-reactor", - "tokio-tcp", - "tokio-threadpool", - "tokio-timer", - "want 0.2.0", -] - [[package]] name = "hyper" version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8bf49cfb32edee45d890537d9057d1b02ed55f53b7b6a30bae83a38c9231749e" dependencies = [ - "bytes 0.5.3", + "bytes", "futures-channel", "futures-core", "futures-util", - "h2 0.2.1", - "http 0.2.0", - "http-body 0.3.1", + "h2", + "http", + "http-body", "httparse", "itoa", "log", "net2", "pin-project", "time 0.1.42", - "tokio 0.2.6", + "tokio", "tower-service", - "want 0.3.0", + "want", ] [[package]] name = "hyper-tls" -version = "0.3.2" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a800d6aa50af4b5850b2b0f659625ce9504df908e9733b635720483be26174f" +checksum = "3adcd308402b9553630734e9c36b77a7e48b3821251ca2493e8cd596763aafaa" dependencies = [ - "bytes 0.4.12", - "futures 0.1.29", - "hyper 0.12.35", + "bytes", + "hyper", "native-tls", - "tokio-io", + "tokio", + "tokio-tls", ] [[package]] @@ -1094,17 +942,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" -[[package]] -name = "idna" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" -dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "idna" version = "0.2.0" @@ -1149,6 +986,15 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f" +[[package]] +name = "js-sys" +version = "0.3.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7889c7c36282151f6bf465be4700359318aef36baa951462382eae49e9577cf9" +dependencies = [ + "wasm-bindgen", +] + [[package]] name = "kernel32-sys" version = "0.2.2" @@ -1194,9 +1040,9 @@ dependencies = [ [[package]] name = "libsqlite3-sys" -version = "0.15.0" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b1e07fcc60484f42e246f0cf1f133940c98117c81b2cefcdf71be288069680" +checksum = "266eb8c361198e8d1f682bc974e5d9e2ae90049fb1943890904d11dad7d4a77d" dependencies = [ "cc", "pkg-config", @@ -1273,15 +1119,6 @@ dependencies = [ "winapi 0.3.8", ] -[[package]] -name = "memoffset" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75189eb85871ea5c2e2c15abbdd541185f63b408415e5051f5cac122d8c774b9" -dependencies = [ - "rustc_version", -] - [[package]] name = "mime" version = "0.3.14" @@ -1366,7 +1203,7 @@ dependencies = [ name = "moonfire-db" version = "0.0.1" dependencies = [ - "base64 0.10.1", + "base64 0.11.0", "blake2-rfc", "cstr", "failure", @@ -1388,7 +1225,7 @@ dependencies = [ "protobuf-codegen-pure", "regex", "rusqlite", - "smallvec 0.6.13", + "smallvec 1.1.0", "tempdir", "time 0.1.42", "uuid", @@ -1409,18 +1246,18 @@ dependencies = [ name = "moonfire-nvr" version = "0.1.0" dependencies = [ - "base64 0.10.1", + "base64 0.11.0", "byteorder", - "bytes 0.5.3", + "bytes", "cstr", "cursive", "docopt", "failure", "fnv", - "futures 0.3.1", - "http 0.2.0", + "futures", + "http", "http-serve", - "hyper 0.13.1", + "hyper", "lazy_static", "libc", "log", @@ -1441,11 +1278,11 @@ dependencies = [ "rusqlite", "serde", "serde_json", - "smallvec 0.6.13", + "smallvec 1.1.0", "tempdir", "time 0.1.42", - "tokio 0.2.6", - "url 1.7.2", + "tokio", + "url", "uuid", ] @@ -1518,6 +1355,16 @@ version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" +[[package]] +name = "nom" +version = "4.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6" +dependencies = [ + "memchr", + "version_check 0.1.5", +] + [[package]] name = "num" version = "0.2.0" @@ -1687,12 +1534,6 @@ dependencies = [ "crypto-mac", ] -[[package]] -name = "percent-encoding" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" - [[package]] name = "percent-encoding" version = "2.1.0" @@ -1831,19 +1672,6 @@ dependencies = [ "protobuf-codegen", ] -[[package]] -name = "publicsuffix" -version = "1.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bbaa49075179162b49acac1c6aa45fb4dafb5f13cf6794276d77bc7fd95757b" -dependencies = [ - "error-chain 0.12.1", - "idna 0.2.0", - "lazy_static", - "regex", - "url 2.1.0", -] - [[package]] name = "quote" version = "0.6.13" @@ -1898,25 +1726,6 @@ dependencies = [ "winapi 0.3.8", ] -[[package]] -name = "rand" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" -dependencies = [ - "autocfg", - "libc", - "rand_chacha 0.1.1", - "rand_core 0.4.2", - "rand_hc 0.1.0", - "rand_isaac", - "rand_jitter", - "rand_os", - "rand_pcg", - "rand_xorshift", - "winapi 0.3.8", -] - [[package]] name = "rand" version = "0.7.2" @@ -1925,19 +1734,9 @@ checksum = "3ae1b169243eaf61759b8475a998f0a385e42042370f3a7dbaf35246eacc8412" dependencies = [ "getrandom", "libc", - "rand_chacha 0.2.1", + "rand_chacha", "rand_core 0.5.1", - "rand_hc 0.2.0", -] - -[[package]] -name = "rand_chacha" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" -dependencies = [ - "autocfg", - "rand_core 0.3.1", + "rand_hc", ] [[package]] @@ -1974,15 +1773,6 @@ dependencies = [ "getrandom", ] -[[package]] -name = "rand_hc" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" -dependencies = [ - "rand_core 0.3.1", -] - [[package]] name = "rand_hc" version = "0.2.0" @@ -1992,26 +1782,6 @@ dependencies = [ "rand_core 0.5.1", ] -[[package]] -name = "rand_isaac" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "rand_jitter" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" -dependencies = [ - "libc", - "rand_core 0.4.2", - "winapi 0.3.8", -] - [[package]] name = "rand_os" version = "0.1.3" @@ -2026,25 +1796,6 @@ dependencies = [ "winapi 0.3.8", ] -[[package]] -name = "rand_pcg" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" -dependencies = [ - "autocfg", - "rand_core 0.4.2", -] - -[[package]] -name = "rand_xorshift" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" -dependencies = [ - "rand_core 0.3.1", -] - [[package]] name = "rawpointer" version = "0.1.0" @@ -2089,9 +1840,9 @@ dependencies = [ [[package]] name = "reffers" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3b765c544398b56cb85f1c77c6e1d963930b8b5c9678b2cc93195795a6fc32" +checksum = "20b08f8f2aada5c4435926c63a9e4318f1ca843cc1e0e0ece1a3f40c65ba7b77" dependencies = [ "stable_deref_trait", ] @@ -2134,35 +1885,37 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.9.24" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f88643aea3c1343c804950d7bf983bd2067f5ab59db6d613a08e05572f2714ab" +checksum = "c0e798e19e258bf6c30a304622e3e9ac820e483b06a1857a026e1f109b113fe4" dependencies = [ - "base64 0.10.1", - "bytes 0.4.12", - "cookie", - "cookie_store", + "base64 0.11.0", + "bytes", "encoding_rs", - "flate2", - "futures 0.1.29", - "http 0.1.21", - "hyper 0.12.35", + "futures-core", + "futures-util", + "http", + "http-body", + "hyper", "hyper-tls", + "js-sys", + "lazy_static", "log", "mime", "mime_guess", "native-tls", + "percent-encoding", + "pin-project-lite", "serde", "serde_json", "serde_urlencoded", "time 0.1.42", - "tokio 0.1.22", - "tokio-executor", - "tokio-io", - "tokio-threadpool", - "tokio-timer", - "url 1.7.2", - "uuid", + "tokio", + "tokio-tls", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", "winreg", ] @@ -2193,9 +1946,9 @@ dependencies = [ [[package]] name = "rusqlite" -version = "0.19.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ebca2e7e3deb7241b7fa5929c088548c590728b1b740c479594c23f813eb8a7" +checksum = "64a656821bb6317a84b257737b7934f79c0dbb7eb694710475908280ebad3e64" dependencies = [ "bitflags", "fallible-iterator", @@ -2214,7 +1967,7 @@ checksum = "4ca4eaef519b494d1f2848fc602d18816fed808a981aedf4f1f00ceb7c9d32cf" dependencies = [ "base64 0.10.1", "blake2b_simd", - "crossbeam-utils 0.6.6", + "crossbeam-utils", ] [[package]] @@ -2396,14 +2149,14 @@ dependencies = [ [[package]] name = "serde_urlencoded" -version = "0.5.5" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "642dd69105886af2efd227f75a520ec9b44a820d65bc133a9131f7d229fd165a" +checksum = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97" dependencies = [ "dtoa", "itoa", "serde", - "url 1.7.2", + "url", ] [[package]] @@ -2471,6 +2224,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44e59e0c9fa00817912ae6e4e6e3c4fe04455e75699d06eedc7d85917ed8e8f4" +[[package]] +name = "sourcefile" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bf77cb82ba8453b42b6ae1d692e4cdc92f9a47beaf89a847c8be83f4e328ad3" + [[package]] name = "spin" version = "0.5.2" @@ -2483,15 +2242,6 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" -[[package]] -name = "string" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d24114bfcceb867ca7f71a0d3fe45d45619ec47a6fbfa98cb14e14250bfa5d6d" -dependencies = [ - "bytes 0.4.12", -] - [[package]] name = "strsim" version = "0.8.0" @@ -2647,32 +2397,13 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac6de5d6171ae395cd957a9cfdcf9a41e39fe23e558b29043104a896a79021b6" -[[package]] -name = "tokio" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" -dependencies = [ - "bytes 0.4.12", - "futures 0.1.29", - "mio", - "num_cpus", - "tokio-current-thread", - "tokio-executor", - "tokio-io", - "tokio-reactor", - "tokio-tcp", - "tokio-threadpool", - "tokio-timer", -] - [[package]] name = "tokio" version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e1bef565a52394086ecac0a6fa3b8ace4cb3a138ee1d96bd2b93283b56824e3" dependencies = [ - "bytes 0.5.3", + "bytes", "fnv", "iovec", "lazy_static", @@ -2688,48 +2419,6 @@ dependencies = [ "winapi 0.3.8", ] -[[package]] -name = "tokio-buf" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb220f46c53859a4b7ec083e41dec9778ff0b1851c0942b211edb89e0ccdc46" -dependencies = [ - "bytes 0.4.12", - "either", - "futures 0.1.29", -] - -[[package]] -name = "tokio-current-thread" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16217cad7f1b840c5a97dfb3c43b0c871fef423a6e8d2118c604e843662a443" -dependencies = [ - "futures 0.1.29", - "tokio-executor", -] - -[[package]] -name = "tokio-executor" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6df436c42b0c3330a82d855d2ef017cd793090ad550a6bc2184f4b933532ab" -dependencies = [ - "crossbeam-utils 0.6.6", - "futures 0.1.29", -] - -[[package]] -name = "tokio-io" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5090db468dad16e1a7a54c8c67280c5e4b544f3d3e018f0b913b400261f85926" -dependencies = [ - "bytes 0.4.12", - "futures 0.1.29", - "log", -] - [[package]] name = "tokio-macros" version = "0.2.1" @@ -2741,75 +2430,13 @@ dependencies = [ ] [[package]] -name = "tokio-reactor" -version = "0.1.11" +name = "tokio-tls" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6732fe6b53c8d11178dcb77ac6d9682af27fc6d4cb87789449152e5377377146" +checksum = "7bde02a3a5291395f59b06ec6945a3077602fac2b07eeeaf0dee2122f3619828" dependencies = [ - "crossbeam-utils 0.6.6", - "futures 0.1.29", - "lazy_static", - "log", - "mio", - "num_cpus", - "parking_lot", - "slab", - "tokio-executor", - "tokio-io", - "tokio-sync", -] - -[[package]] -name = "tokio-sync" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d06554cce1ae4a50f42fba8023918afa931413aded705b560e29600ccf7c6d76" -dependencies = [ - "fnv", - "futures 0.1.29", -] - -[[package]] -name = "tokio-tcp" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d14b10654be682ac43efee27401d792507e30fd8d26389e1da3b185de2e4119" -dependencies = [ - "bytes 0.4.12", - "futures 0.1.29", - "iovec", - "mio", - "tokio-io", - "tokio-reactor", -] - -[[package]] -name = "tokio-threadpool" -version = "0.1.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c32ffea4827978e9aa392d2f743d973c1dfa3730a2ed3f22ce1e6984da848c" -dependencies = [ - "crossbeam-deque", - "crossbeam-queue", - "crossbeam-utils 0.6.6", - "futures 0.1.29", - "lazy_static", - "log", - "num_cpus", - "slab", - "tokio-executor", -] - -[[package]] -name = "tokio-timer" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1739638e364e558128461fc1ad84d997702c8e31c2e6b18fb99842268199e827" -dependencies = [ - "crossbeam-utils 0.6.6", - "futures 0.1.29", - "slab", - "tokio-executor", + "native-tls", + "tokio", ] [[package]] @@ -2818,12 +2445,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "571da51182ec208780505a32528fc5512a8fe1443ab960b3f2f3ef093cd16930" dependencies = [ - "bytes 0.5.3", + "bytes", "futures-core", "futures-sink", "log", "pin-project-lite", - "tokio 0.2.6", + "tokio", ] [[package]] @@ -2856,15 +2483,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" -[[package]] -name = "try_from" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "283d3b89e1368717881a9d51dad843cc435380d8109c9e47d38780a324698d8b" -dependencies = [ - "cfg-if", -] - [[package]] name = "typenum" version = "1.11.2" @@ -2936,33 +2554,22 @@ checksum = "55cd1f4b4e96b46aeb8d4855db4a7a9bd96eeeb5c6a1ab54593328761642ce2f" [[package]] name = "url" -version = "1.7.2" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" +checksum = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" dependencies = [ - "idna 0.1.5", + "idna", "matches", - "percent-encoding 1.0.1", -] - -[[package]] -name = "url" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75b414f6c464c879d7f9babf951f23bc3743fb7313c081b2e6ca719067ea9d61" -dependencies = [ - "idna 0.2.0", - "matches", - "percent-encoding 2.1.0", + "percent-encoding", ] [[package]] name = "uuid" -version = "0.7.4" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90dbc611eb48397705a6b0f6e917da23ae517e4d127123d2cf7674206627d32a" +checksum = "9fde2f6a4bea1d6e007c4ad38c6839fa71cbb63b6dbf5b595aa38dc9b1093c11" dependencies = [ - "rand 0.6.5", + "rand 0.7.2", "serde", ] @@ -2996,17 +2603,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" -[[package]] -name = "want" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6395efa4784b027708f7451087e647ec73cc74f5d9bc2e418404248d679a230" -dependencies = [ - "futures 0.1.29", - "log", - "try-lock", -] - [[package]] name = "want" version = "0.3.0" @@ -3023,6 +2619,112 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b89c3ce4ce14bdc6fb6beaf9ec7928ca331de5df7e5ea278375642a2f478570d" +[[package]] +name = "wasm-bindgen" +version = "0.2.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5205e9afdf42282b192e2310a5b463a6d1c1d774e30dc3c791ac37ab42d2616c" +dependencies = [ + "cfg-if", + "serde", + "serde_json", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11cdb95816290b525b32587d76419facd99662a07e59d3cdb560488a819d9a45" +dependencies = [ + "bumpalo", + "lazy_static", + "log", + "proc-macro2 1.0.6", + "quote 1.0.2", + "syn 1.0.11", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bbdd49e3e28b40dec6a9ba8d17798245ce32b019513a845369c641b275135d9" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "574094772ce6921576fb6f2e3f7497b8a76273b6db092be18fc48a082de09dc3" +dependencies = [ + "quote 1.0.2", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e85031354f25eaebe78bb7db1c3d86140312a911a106b2e29f9cc440ce3e7668" +dependencies = [ + "proc-macro2 1.0.6", + "quote 1.0.2", + "syn 1.0.11", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5e7e61fc929f4c0dddb748b102ebf9f632e2b8d739f2016542b4de2965a9601" + +[[package]] +name = "wasm-bindgen-webidl" +version = "0.2.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef012a0d93fc0432df126a8eaf547b2dce25a8ce9212e1d3cbeef5c11157975d" +dependencies = [ + "anyhow", + "heck", + "log", + "proc-macro2 1.0.6", + "quote 1.0.2", + "syn 1.0.11", + "wasm-bindgen-backend", + "weedle", +] + +[[package]] +name = "web-sys" +version = "0.3.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aaf97caf6aa8c2b1dac90faf0db529d9d63c93846cca4911856f78a83cebf53b" +dependencies = [ + "anyhow", + "js-sys", + "sourcefile", + "wasm-bindgen", + "wasm-bindgen-webidl", +] + +[[package]] +name = "weedle" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bb43f70885151e629e2a19ce9e50bd730fd436cfd4b666894c9ce4de9141164" +dependencies = [ + "nom", +] + [[package]] name = "winapi" version = "0.2.8" diff --git a/Cargo.toml b/Cargo.toml index aced621..7199832 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ members = ["base", "db", "ffmpeg"] [dependencies] base = { package = "moonfire-base", path = "base" } -base64 = "0.10.0" +base64 = "0.11.0" bytes = "0.5.3" byteorder = "1.0" cstr = "0.1.7" @@ -43,20 +43,20 @@ nix = "0.16.1" openssl = "0.10" parking_lot = { version = "0.9", features = [] } protobuf = { git = "https://github.com/stepancheg/rust-protobuf" } -reffers = "0.5.1" +reffers = "0.6.0" regex = "1.0" ring = "0.14.6" -rusqlite = "0.19.0" +rusqlite = "0.21.0" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" -smallvec = "0.6" +smallvec = "1.0" time = "0.1" tokio = { version = "0.2.0", features = ["blocking", "macros", "rt-threaded", "signal"] } -url = "1.4" -uuid = { version = "0.7", features = ["serde", "std", "v4"] } +url = "2.1.1" +uuid = { version = "0.8", features = ["serde", "std", "v4"] } [dev-dependencies] -reqwest = "0.9.5" +reqwest = { version = "0.10.1", features = ["json"] } tempdir = "0.3" [profile.release] diff --git a/db/Cargo.toml b/db/Cargo.toml index 88a29e1..1ecfe14 100644 --- a/db/Cargo.toml +++ b/db/Cargo.toml @@ -13,7 +13,7 @@ path = "lib.rs" [dependencies] base = { package = "moonfire-base", path = "../base" } -base64 = "0.10.0" +base64 = "0.11.0" blake2-rfc = "0.2.18" cstr = "0.1.7" failure = "0.1.1" @@ -31,11 +31,11 @@ parking_lot = { version = "0.9", features = [] } prettydiff = "0.3.1" protobuf = { git = "https://github.com/stepancheg/rust-protobuf" } regex = "1.0" -rusqlite = "0.19.0" -smallvec = "0.6" +rusqlite = "0.21.0" +smallvec = "1.0" tempdir = "0.3" time = "0.1" -uuid = { version = "0.7", features = ["std", "v4"] } +uuid = { version = "0.8", features = ["std", "v4"] } itertools = "0.8.0" [build-dependencies] diff --git a/src/web.rs b/src/web.rs index 9b0f6b0..4c4ee4b 100644 --- a/src/web.rs +++ b/src/web.rs @@ -1057,17 +1057,20 @@ mod tests { move |req| std::pin::Pin::from(s.serve(req)) })) }); - let mut rt = tokio::runtime::Runtime::new().unwrap(); - let srv = rt.enter(|| { + let (tx, rx) = std::sync::mpsc::channel(); + let handle = ::std::thread::spawn(move || { let addr = ([127, 0, 0, 1], 0).into(); - hyper::server::Server::bind(&addr) + let mut rt = tokio::runtime::Runtime::new().unwrap(); + let srv = rt.enter(|| { + hyper::server::Server::bind(&addr) .tcp_nodelay(true) .serve(make_svc) - }); - let addr = srv.local_addr(); // resolve port 0 to a real ephemeral port number. - let handle = ::std::thread::spawn(move || { + }); + let addr = srv.local_addr(); // resolve port 0 to a real ephemeral port number. + tx.send(addr).unwrap(); rt.block_on(srv.with_graceful_shutdown(shutdown_rx.map(|_| ()))).unwrap(); }); + let addr = rx.recv().unwrap(); // Create a user. let mut c = db::UserChange::add_user("slamb".to_owned()); @@ -1203,36 +1206,36 @@ mod tests { Segments::parse("1-5.26-42").unwrap()); } - #[test] - fn unauthorized_without_cookie() { + #[tokio::test] + async fn unauthorized_without_cookie() { testutil::init(); let s = Server::new(None); let cli = reqwest::Client::new(); - let resp = cli.get(&format!("{}/api/", &s.base_url)).send().unwrap(); + let resp = cli.get(&format!("{}/api/", &s.base_url)).send().await.unwrap(); assert_eq!(resp.status(), reqwest::StatusCode::UNAUTHORIZED); } - #[test] - fn login() { + #[tokio::test] + async fn login() { testutil::init(); let s = Server::new(None); let cli = reqwest::Client::new(); let login_url = format!("{}/api/login", &s.base_url); - let resp = cli.get(&login_url).send().unwrap(); + let resp = cli.get(&login_url).send().await.unwrap(); assert_eq!(resp.status(), reqwest::StatusCode::METHOD_NOT_ALLOWED); - let resp = cli.post(&login_url).send().unwrap(); + let resp = cli.post(&login_url).send().await.unwrap(); assert_eq!(resp.status(), reqwest::StatusCode::BAD_REQUEST); let mut p = HashMap::new(); p.insert("username", "slamb"); p.insert("password", "asdf"); - let resp = cli.post(&login_url).json(&p).send().unwrap(); + let resp = cli.post(&login_url).json(&p).send().await.unwrap(); assert_eq!(resp.status(), reqwest::StatusCode::UNAUTHORIZED); p.insert("password", "hunter2"); - let resp = cli.post(&login_url).json(&p).send().unwrap(); + let resp = cli.post(&login_url).json(&p).send().await.unwrap(); assert_eq!(resp.status(), reqwest::StatusCode::NO_CONTENT); let cookie = SessionCookie::new(resp.headers()); info!("cookie: {:?}", cookie); @@ -1241,19 +1244,20 @@ mod tests { let resp = cli.get(&format!("{}/api/", &s.base_url)) .header(reqwest::header::COOKIE, cookie.header()) .send() + .await .unwrap(); assert_eq!(resp.status(), reqwest::StatusCode::OK); } - #[test] - fn logout() { + #[tokio::test] + async fn logout() { testutil::init(); let s = Server::new(None); let cli = reqwest::Client::new(); let mut p = HashMap::new(); p.insert("username", "slamb"); p.insert("password", "hunter2"); - let resp = cli.post(&format!("{}/api/login", &s.base_url)).json(&p).send().unwrap(); + let resp = cli.post(&format!("{}/api/login", &s.base_url)).json(&p).send().await.unwrap(); assert_eq!(resp.status(), reqwest::StatusCode::NO_CONTENT); let cookie = SessionCookie::new(resp.headers()); @@ -1261,6 +1265,7 @@ mod tests { let resp = cli.get(&format!("{}/api/logout", &s.base_url)) .header(reqwest::header::COOKIE, cookie.header()) .send() + .await .unwrap(); assert_eq!(resp.status(), reqwest::StatusCode::METHOD_NOT_ALLOWED); @@ -1268,6 +1273,7 @@ mod tests { let resp = cli.post(&format!("{}/api/logout", &s.base_url)) .header(reqwest::header::COOKIE, cookie.header()) .send() + .await .unwrap(); assert_eq!(resp.status(), reqwest::StatusCode::BAD_REQUEST); @@ -1275,8 +1281,8 @@ mod tests { // Retrieve that from the toplevel API request. let toplevel: serde_json::Value = cli.post(&format!("{}/api/", &s.base_url)) .header(reqwest::header::COOKIE, cookie.header()) - .send().unwrap() - .json().unwrap(); + .send().await.unwrap() + .json().await.unwrap(); let csrf = toplevel.get("session").unwrap().get("csrf").unwrap().as_str(); let mut p = HashMap::new(); p.insert("csrf", csrf); @@ -1284,6 +1290,7 @@ mod tests { .header(reqwest::header::COOKIE, cookie.header()) .json(&p) .send() + .await .unwrap(); assert_eq!(resp.status(), reqwest::StatusCode::NO_CONTENT); let mut updated_cookie = cookie.clone(); @@ -1296,12 +1303,13 @@ mod tests { let resp = cli.get(&format!("{}/api/", &s.base_url)) .header(reqwest::header::COOKIE, cookie.header()) .send() + .await .unwrap(); assert_eq!(resp.status(), reqwest::StatusCode::UNAUTHORIZED); } - #[test] - fn view_without_segments() { + #[tokio::test] + async fn view_without_segments() { testutil::init(); let mut permissions = db::Permissions::new(); permissions.view_video = true; @@ -1309,7 +1317,7 @@ mod tests { let cli = reqwest::Client::new(); let resp = cli.get( &format!("{}/api/cameras/{}/main/view.mp4", &s.base_url, s.db.test_camera_uuid)) - .send().unwrap(); + .send().await.unwrap(); assert_eq!(resp.status(), reqwest::StatusCode::BAD_REQUEST); } }