From 79b26a1dda69c796fcb75109c35b132a06ab0170 Mon Sep 17 00:00:00 2001 From: asonix Date: Wed, 10 Feb 2021 16:57:42 -0600 Subject: [PATCH] Update to actix-web 4.0.0-beta.3 --- Cargo.lock | 927 +++++++++++++----------------------------- Cargo.toml | 19 +- src/error.rs | 15 +- src/main.rs | 39 +- src/middleware.rs | 31 +- src/processor.rs | 9 +- src/upload_manager.rs | 82 ++-- src/validate/mod.rs | 2 +- 8 files changed, 376 insertions(+), 748 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b2931d4..04dd3f5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,52 +2,29 @@ # It is not intended for manual editing. [[package]] name = "actix-codec" -version = "0.3.0" +version = "0.4.0-beta.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78d1833b3838dbe990df0f1f87baf640cf6146e898166afe401839d1b001e570" +checksum = "90673465c6187bd0829116b02be465dc0195a74d7719f76ffff0effef934a92e" dependencies = [ "bitflags", "bytes", "futures-core", "futures-sink", "log", - "pin-project 0.4.27", + "pin-project-lite", "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", - "rustls", - "tokio-rustls", - "trust-dns-proto", - "trust-dns-resolver", - "webpki", -] - [[package]] name = "actix-form-data" -version = "0.5.0" +version = "0.6.0-beta.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4693ffd29f7f9d5cc1f3d67702900f6110044169ff18d59f7063bd16dbf80bd" +checksum = "76e5b6fbbcda7b442a99b526f5d01a15c8b522e709275ddedf73d4f47ef72432" dependencies = [ "actix-multipart", "actix-rt", "actix-web", - "bytes", "futures", "mime", "thiserror", @@ -58,9 +35,9 @@ dependencies = [ [[package]] name = "actix-fs" version = "0.1.0" -source = "git+https://git.asonix.dog/asonix/actix-fs?branch=main#dc37026b9f1a8016304b71af34802a1ec52a318b" +source = "git+https://git.asonix.dog/asonix/actix-fs?branch=asonix/actix-rt-2#f28d287468e53ab3a36dca5ef336586a64b3e4f6" dependencies = [ - "actix-threadpool", + "actix-rt", "bytes", "futures", "log", @@ -69,31 +46,28 @@ dependencies = [ [[package]] name = "actix-http" -version = "2.2.0" +version = "3.0.0-beta.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "452299e87817ae5673910e53c243484ca38be3828db819b6011736fc6982e874" +checksum = "8a12706e793a92377f85cec219514b72625b3b89f9b4912d8bfb53ab6a615bf0" dependencies = [ "actix-codec", - "actix-connect", "actix-rt", "actix-service", - "actix-threadpool", "actix-tls", "actix-utils", - "base64 0.13.0", + "ahash", + "base64", "bitflags", "brotli2", "bytes", + "bytestring", "cookie", - "copyless", "derive_more", - "either", "encoding_rs", "flate2", "futures-channel", "futures-core", "futures-util", - "fxhash", "h2", "http", "httparse", @@ -104,7 +78,7 @@ dependencies = [ "log", "mime", "percent-encoding", - "pin-project 1.0.3", + "pin-project 1.0.5", "rand", "regex", "serde", @@ -112,14 +86,15 @@ dependencies = [ "serde_urlencoded", "sha-1", "slab", - "time 0.2.23", + "smallvec", + "time 0.2.25", ] [[package]] name = "actix-macros" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ca8ce00b267af8ccebbd647de0d61e0674b6e61185cc7a592ff88772bed655" +checksum = "dbcb2b608f0accc2f5bcf3dd872194ce13d94ee45b571487035864cf966b04ef" dependencies = [ "quote", "syn", @@ -127,11 +102,10 @@ dependencies = [ [[package]] name = "actix-multipart" -version = "0.3.0" +version = "0.4.0-beta.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "774bfeb11b54bf9c857a005b8ab893293da4eaff79261a66a9200dab7f5ab6e3" +checksum = "86ab64e50108d5fd6af120d3595fadbd86001bc654392926e84b26bac282bce9" dependencies = [ - "actix-service", "actix-utils", "actix-web", "bytes", @@ -145,9 +119,9 @@ dependencies = [ [[package]] name = "actix-router" -version = "0.2.5" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd1f7dbda1645bf7da33554db60891755f6c01c1b2169e2f4c492098d30c235" +checksum = "2ad299af73649e1fc893e333ccf86f377751eb95ff875d095131574c6f43452c" dependencies = [ "bytestring", "http", @@ -158,119 +132,82 @@ dependencies = [ [[package]] name = "actix-rt" -version = "1.1.1" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143fcc2912e0d1de2bcf4e2f720d2a60c28652ab4179685a1ee159e0fb3db227" +checksum = "c88cf46527e27f66efcd5831f60b3d9c2dac795b6d255ed17791752d6c36a8ea" dependencies = [ "actix-macros", - "actix-threadpool", - "copyless", - "futures-channel", - "futures-util", - "smallvec", + "futures-core", "tokio", ] [[package]] name = "actix-server" -version = "1.0.4" +version = "2.0.0-beta.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45407e6e672ca24784baa667c5d32ef109ccdd8d5e0b5ebb9ef8a67f4dfb708e" +checksum = "a99198727204a48f82559c18e4b0ba3197b97d5f4576a32bdbef371f3b4599c1" dependencies = [ "actix-codec", "actix-rt", "actix-service", "actix-utils", - "futures-channel", - "futures-util", + "futures-core", "log", "mio", - "mio-uds", "num_cpus", "slab", - "socket2", + "tokio", ] [[package]] name = "actix-service" -version = "1.0.6" +version = "2.0.0-beta.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0052435d581b5be835d11f4eb3bce417c8af18d87ddf8ace99f8e67e595882bb" +checksum = "ca9756f4d32984ac454ae3155a276f6be69b424197bd3f0ca3c87cde72f41d63" dependencies = [ - "futures-util", - "pin-project 0.4.27", -] - -[[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", + "futures-core", + "pin-project-lite", ] [[package]] name = "actix-tls" -version = "2.0.0" +version = "3.0.0-beta.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24789b7d7361cf5503a504ebe1c10806896f61e96eca9a7350e23001aca715fb" +checksum = "322b22e9238d065f331af0585089de8c36978fcc56f888054add4e4365b9916b" dependencies = [ "actix-codec", + "actix-rt", "actix-service", "actix-utils", - "futures-util", - "rustls", + "derive_more", + "futures-core", + "http", + "log", "tokio-rustls", - "webpki", + "tokio-util", "webpki-roots", ] [[package]] name = "actix-utils" -version = "2.0.0" +version = "3.0.0-beta.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e9022dec56632d1d7979e59af14f0597a28a830a9c1c7fec8b2327eb9f16b5a" +checksum = "458795e09a29bc5557604f9ff6f32236fd0ee457d631672e4ec8f6a0103bb292" dependencies = [ "actix-codec", "actix-rt", "actix-service", - "bitflags", - "bytes", - "either", - "futures-channel", + "futures-core", "futures-sink", - "futures-util", "log", - "pin-project 0.4.27", - "slab", + "pin-project-lite", ] [[package]] name = "actix-web" -version = "3.3.2" +version = "4.0.0-beta.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e641d4a172e7faa0862241a20ff4f1f5ab0ab7c279f00c2d4587b77483477b86" +checksum = "bc9683dc8c3037ea524e0fec6032d34e1cb1ee72c4eb8689f428a60c2a544ea3" dependencies = [ "actix-codec", "actix-http", @@ -279,59 +216,59 @@ dependencies = [ "actix-rt", "actix-server", "actix-service", - "actix-testing", - "actix-threadpool", "actix-tls", "actix-utils", "actix-web-codegen", + "ahash", "awc", "bytes", "derive_more", + "either", "encoding_rs", - "futures-channel", "futures-core", "futures-util", - "fxhash", "log", "mime", - "pin-project 1.0.3", + "pin-project 1.0.5", "regex", "rustls", "serde", "serde_json", "serde_urlencoded", + "smallvec", "socket2", - "time 0.2.23", - "tinyvec", + "time 0.2.25", "url", ] [[package]] name = "actix-web-codegen" -version = "0.4.0" +version = "0.5.0-beta.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad26f77093333e0e7c6ffe54ebe3582d908a104e448723eec6d43d08b07143fb" +checksum = "8313dc4cbcae1785a7f14c3dfb7dfeb25fe96a03b20e5c38fe026786def5aa70" dependencies = [ "proc-macro2", "quote", "syn", ] -[[package]] -name = "addr2line" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a55f82cfe485775d02112886f4169bde0c5894d75e79ead7eafe7e40a25e45f7" -dependencies = [ - "gimli", -] - [[package]] name = "adler" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e" +[[package]] +name = "ahash" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efa60d2eadd8b12a996add391db32bd1153eac697ba4869660c0016353611426" +dependencies = [ + "getrandom", + "once_cell", + "version_check", +] + [[package]] name = "aho-corasick" version = "0.7.15" @@ -347,7 +284,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -356,14 +293,14 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] name = "anyhow" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee67c11feeac938fae061b232e38e0b6d94f97a9df10e6271319325ac4c56a86" +checksum = "afddf7f520a80dbf76e6f50a35bca42a2331ef227a28b3b6dc5c2e2338d114b1" [[package]] name = "async-stream" @@ -386,17 +323,6 @@ dependencies = [ "syn", ] -[[package]] -name = "async-trait" -version = "0.1.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d3a45e77e34375a7923b1e8febb049bb011f064714a8e17a1a616fef01da13d" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "atty" version = "0.2.14" @@ -405,7 +331,7 @@ checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ "hermit-abi", "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -416,17 +342,17 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "awc" -version = "2.0.3" +version = "3.0.0-beta.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b381e490e7b0cfc37ebc54079b0413d8093ef43d14a4e4747083f7fa47a9e691" +checksum = "da7225ad81fbad09ef56ccc61e0688abe8494a68722c5d0df5e2fc8b724a200b" dependencies = [ "actix-codec", "actix-http", "actix-rt", "actix-service", - "base64 0.13.0", + "base64", "bytes", - "cfg-if 1.0.0", + "cfg-if", "derive_more", "futures-core", "log", @@ -439,32 +365,12 @@ dependencies = [ "serde_urlencoded", ] -[[package]] -name = "backtrace" -version = "0.3.55" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef5140344c85b01f9bbb4d4b7288a8aa4b3287ccef913a14bcc78a1063623598" -dependencies = [ - "addr2line", - "cfg-if 1.0.0", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] - [[package]] name = "base-x" version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4521f3e3d031370679b3b140beb36dfe4801b09ac77e30c61941f97df3ef28b" -[[package]] -name = "base64" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" - [[package]] name = "base64" version = "0.13.0" @@ -473,13 +379,12 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] name = "bindgen" -version = "0.53.3" +version = "0.56.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c72a978d268b1d70b0e963217e60fdabd9523a941457a6c42a7315d15c7e89e5" +checksum = "2da379dbebc0b76ef63ca68d8fc6e71c0f13e59432e0987e508c1820e6ab5239" dependencies = [ "bitflags", "cexpr", - "cfg-if 0.1.10", "clang-sys", "clap", "env_logger", @@ -495,26 +400,6 @@ dependencies = [ "which", ] -[[package]] -name = "bindgen" -version = "0.54.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66c0bb6167449588ff70803f4127f0684f9063097eca5016f37eb52b92c2cf36" -dependencies = [ - "bitflags", - "cexpr", - "cfg-if 0.1.10", - "clang-sys", - "lazy_static", - "lazycell", - "peeking_take_while", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", -] - [[package]] name = "bitflags" version = "1.2.1" @@ -552,27 +437,27 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.4.0" +version = "3.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820" +checksum = "099e596ef14349721d9016f6b80dd3419ea1bf289ab9b44df8e4dfd3a005d5d9" [[package]] name = "byteorder" -version = "1.3.4" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" +checksum = "ae44d1a3d5a19df61dd0c8beb138458ac2a53a7ac09eba97d55592540004306b" [[package]] name = "bytes" -version = "0.5.6" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" +checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040" [[package]] name = "bytestring" -version = "0.1.5" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7c05fa5172da78a62d9949d662d2ac89d4cc7355d7b49adee5163f1fb3f363" +checksum = "90706ba19e97b90786e19dc0d5e2abd80008d99d4c0c5d1ad0b5e72cec7c494d" dependencies = [ "bytes", ] @@ -592,12 +477,6 @@ dependencies = [ "nom", ] -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -613,15 +492,15 @@ dependencies = [ "libc", "num-integer", "num-traits", - "time 0.1.44", - "winapi 0.3.9", + "time 0.1.43", + "winapi", ] [[package]] name = "clang-sys" -version = "0.29.3" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe6837df1d5cba2397b835c8530f51723267e16abbf83892e9e5af4f0e5dd10a" +checksum = "5cb92721cb37482245ed88428f72253ce422b3b4ee169c70a0642521bb5db4cc" dependencies = [ "glob", "libc", @@ -656,16 +535,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "784ad0fbab4f3e9cef09f20e0aea6000ae08d2cb98ac4c0abc53df18803d702f" dependencies = [ "percent-encoding", - "time 0.2.23", + "time 0.2.25", "version_check", ] -[[package]] -name = "copyless" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2df960f5d869b2dd8532793fde43eb5427cceb126c929747a26823ab0eeb536" - [[package]] name = "cpuid-bool" version = "0.1.2" @@ -678,7 +551,7 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -687,7 +560,7 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1aaa739f95311c2c7887a76863f500026092fb1dce0161dab577e559ef3569d" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "const_fn", "crossbeam-utils", "lazy_static", @@ -702,7 +575,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02d96d1e189ef58269ebe5b97953da3274d83a93af647c2ddd6f9dab28cedb8d" dependencies = [ "autocfg", - "cfg-if 1.0.0", + "cfg-if", "lazy_static", ] @@ -740,30 +613,18 @@ checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" [[package]] name = "encoding_rs" -version = "0.8.26" +version = "0.8.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "801bbab217d7f79c0062f4f7205b5d4427c6d1a7bd7aafdd1475f7c59d62b283" +checksum = "80df024fbc5ac80f87dfef0d9f5209a252f2a497f7f42944cff24d8253cac065" 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", + "cfg-if", ] [[package]] name = "env_logger" -version = "0.7.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" +checksum = "f26ecb66b4bdca6c1409b40fb255eefc2bd4f6d135dab3c3124f80ffa2a9661e" dependencies = [ "atty", "humantime", @@ -786,10 +647,9 @@ dependencies = [ [[package]] name = "ffmpeg-sys-next" version = "4.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fde8cbf91a1b044b86d9e9e944c33806a68f5e34e4281033594ceaab47a3746" +source = "git+https://github.com/baadc0de/rust-ffmpeg-sys?branch=master#e0ad2856d866075b3b902555b2de16e6af745110" dependencies = [ - "bindgen 0.54.0", + "bindgen", "cc", "libc", "num_cpus", @@ -799,11 +659,11 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7411863d55df97a419aa64cb4d2f167103ea9d767e2c54a1868b7ac3f6b47129" +checksum = "cd3aec53de10fe96d7d8c565eb17f2c687bb5518a2ec453b5b1252964526abe0" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crc32fast", "libc", "miniz_oxide", @@ -832,30 +692,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" dependencies = [ "libc", - "winapi 0.3.9", + "winapi", ] -[[package]] -name = "fuchsia-zircon" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" -dependencies = [ - "bitflags", - "fuchsia-zircon-sys", -] - -[[package]] -name = "fuchsia-zircon-sys" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" - [[package]] name = "futures" -version = "0.3.8" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b3b0c040a1fe6529d30b3c5944b280c7f0dcb2930d2c3062bca967b602583d0" +checksum = "da9052a1a50244d8d5aa9bf55cbc2fb6f357c86cc52e46c62ed390a7180cf150" dependencies = [ "futures-channel", "futures-core", @@ -868,9 +712,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.8" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b7109687aa4e177ef6fe84553af6280ef2778bdb7783ba44c9dc3399110fe64" +checksum = "f2d31b7ec7efab6eefc7c57233bb10b847986139d88cc2f5a02a1ae6871a1846" dependencies = [ "futures-core", "futures-sink", @@ -878,15 +722,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.8" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "847ce131b72ffb13b6109a221da9ad97a64cbe48feb1028356b836b47b8f1748" +checksum = "79e5145dde8da7d1b3892dad07a9c98fc04bc39892b1ecc9692cf53e2b780a65" [[package]] name = "futures-executor" -version = "0.3.8" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4caa2b2b68b880003057c1dd49f1ed937e38f22fcf6c212188a121f08cf40a65" +checksum = "e9e59fdc009a4b3096bf94f740a0f2424c082521f20a9b08c5c07c48d90fd9b9" dependencies = [ "futures-core", "futures-task", @@ -895,15 +739,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.8" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "611834ce18aaa1bd13c4b374f5d653e1027cf99b6b502584ff8c9a64413b30bb" +checksum = "28be053525281ad8259d47e4de5de657b25e7bac113458555bb4b70bc6870500" [[package]] name = "futures-macro" -version = "0.3.8" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77408a692f1f97bcc61dc001d752e00643408fbc922e4d634c655df50d595556" +checksum = "c287d25add322d9f9abdcdc5927ca398917996600182178774032e9f8258fedd" dependencies = [ "proc-macro-hack", "proc-macro2", @@ -913,24 +757,24 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.8" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f878195a49cee50e006b02b93cf7e0a95a38ac7b776b4c4d9cc1207cd20fcb3d" +checksum = "caf5c69029bda2e743fddd0582d1083951d65cc9539aebf8812f36c3491342d6" [[package]] name = "futures-task" -version = "0.3.8" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c554eb5bf48b2426c4771ab68c6b14468b6e76cc90996f528c3338d761a4d0d" +checksum = "13de07eb8ea81ae445aca7b69f5f7bf15d7bf4912d8ca37d6645c77ae8a58d86" dependencies = [ "once_cell", ] [[package]] name = "futures-util" -version = "0.3.8" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d304cff4a7b99cfb7986f7d43fbe93d175e72e704a8860787cc95e9ffd85cbd2" +checksum = "632a8cd0f2a4b3fdea1657f08bde063848c3bd00f9bbf6e256b8be78802e624b" dependencies = [ "futures-channel", "futures-core", @@ -939,7 +783,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project 1.0.3", + "pin-project-lite", "pin-utils", "proc-macro-hack", "proc-macro-nested", @@ -967,13 +811,13 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.1.16" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", - "wasi 0.9.0+wasi-snapshot-preview1", + "wasi", ] [[package]] @@ -986,12 +830,6 @@ dependencies = [ "pkg-config", ] -[[package]] -name = "gimli" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce" - [[package]] name = "glob" version = "0.3.0" @@ -1000,9 +838,9 @@ checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" [[package]] name = "h2" -version = "0.2.7" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e4728fd124914ad25e99e3d15a9361a879f6620f63cb56bbb08f95abb97a535" +checksum = "6b67e66362108efccd8ac053abafc8b7a8d86a37e6e48fc4f6f7485eb5e9e6a5" dependencies = [ "bytes", "fnv", @@ -1035,29 +873,18 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.1.17" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8" +checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c" 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.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84129d298a6d57d246960ff8eb831ca4af3f96d29e2e28848dae275408658e26" +checksum = "7245cd7449cc792608c3c8a9eaf69bd4eabbabf802713748fd739c98b82f0747" dependencies = [ "bytes", "fnv", @@ -1066,24 +893,21 @@ dependencies = [ [[package]] name = "httparse" -version = "1.3.4" +version = "1.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" +checksum = "615caabe2c3160b313d52ccc905335f4ed5f10881dd63dc5699d47e90be85691" [[package]] name = "humantime" -version = "1.3.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" -dependencies = [ - "quick-error", -] +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "idna" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" +checksum = "de910d521f7cc3135c4de8db1cb910e0b5ed1dc6f57c381cd07e8e661ce10094" dependencies = [ "matches", "unicode-bidi", @@ -1106,28 +930,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61124eeebbd69b8190558df225adf7e4caafce0d743919e5d6b19652314ec5ec" dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "iovec" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" -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", + "cfg-if", ] [[package]] @@ -1138,23 +941,13 @@ checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" [[package]] name = "js-sys" -version = "0.3.46" +version = "0.3.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf3d7383929f7c9c7c2d0fa596f325832df98c3704f2c60553080f7127a58175" +checksum = "5cfb73131c35423a367daf8cbd24100af0d077668c8c2943f0e7dd775fef0f65" dependencies = [ "wasm-bindgen", ] -[[package]] -name = "kernel32-sys" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] - [[package]] name = "language-tags" version = "0.2.2" @@ -1175,26 +968,20 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.81" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1482821306169ec4d07f6aca392a4681f66c75c9918aa49641a2595db64053cb" +checksum = "b7282d924be3275cec7f6756ff4121987bc6481325397dde6ba3e7802b1a8b1c" [[package]] name = "libloading" -version = "0.5.2" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" +checksum = "351a32417a12d5f7e82c368a66781e307834dae04c6ce0cd4456d52989229883" dependencies = [ - "cc", - "winapi 0.3.9", + "cfg-if", + "winapi", ] -[[package]] -name = "linked-hash-map" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dd5a6d5999d9907cda8ed67bbd137d3af8085216c2ac62de5be860bd41f304a" - [[package]] name = "lock_api" version = "0.4.2" @@ -1206,38 +993,23 @@ dependencies = [ [[package]] name = "log" -version = "0.4.11" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" +checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" dependencies = [ - "cfg-if 0.1.10", -] - -[[package]] -name = "lru-cache" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" -dependencies = [ - "linked-hash-map", + "cfg-if", ] [[package]] name = "magick_rust" version = "0.14.0" -source = "git+https://github.com/nlfiedler/magick-rust#7d233633a9684eefb4e9be38523e107c468842e4" +source = "git+https://github.com/nlfiedler/magick-rust#82778e69f5c130e5adac019528b72618b198e4cb" dependencies = [ - "bindgen 0.53.3", + "bindgen", "libc", "pkg-config", ] -[[package]] -name = "match_cfg" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" - [[package]] name = "matchers" version = "0.0.1" @@ -1286,55 +1058,25 @@ dependencies = [ [[package]] name = "mio" -version = "0.6.23" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" +checksum = "e50ae3f04d169fcc9bde0b547d1c205219b7157e07ded9c5aff03e0637cb3ed7" dependencies = [ - "cfg-if 0.1.10", - "fuchsia-zircon", - "fuchsia-zircon-sys", - "iovec", - "kernel32-sys", "libc", "log", "miow", - "net2", - "slab", - "winapi 0.2.8", -] - -[[package]] -name = "mio-uds" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afcb699eb26d4332647cc848492bbc15eafb26f08d0304550d5aa1f612e066f0" -dependencies = [ - "iovec", - "libc", - "mio", + "ntapi", + "winapi", ] [[package]] name = "miow" -version = "0.2.2" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" +checksum = "5a33c1b55807fbed163481b5ba66db4b2fa6cde694a5027be10fb724206c5897" dependencies = [ - "kernel32-sys", - "net2", - "winapi 0.2.8", - "ws2_32-sys", -] - -[[package]] -name = "net2" -version = "0.2.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "391630d12b68002ae1e25e8f974306474966550ad82dac6886fb8910c19568ae" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "winapi 0.3.9", + "socket2", + "winapi", ] [[package]] @@ -1347,6 +1089,15 @@ dependencies = [ "version_check", ] +[[package]] +name = "ntapi" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" +dependencies = [ + "winapi", +] + [[package]] name = "num-integer" version = "0.1.44" @@ -1387,12 +1138,6 @@ dependencies = [ "libc", ] -[[package]] -name = "object" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d3b63360ec3cb337817c2dbd47ab4a0f170d285d8e5a2064600f3def1402397" - [[package]] name = "once_cell" version = "1.5.2" @@ -1422,12 +1167,12 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ccb628cad4f84851442432c60ad8e1f607e29752d0bf072cbd0baf28aa34272" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "instant", "libc", "redox_syscall", "smallvec", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1444,7 +1189,7 @@ checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] name = "pict-rs" -version = "0.3.0-alpha.6" +version = "0.3.0-alpha.7" dependencies = [ "actix-form-data", "actix-fs", @@ -1452,8 +1197,7 @@ dependencies = [ "actix-web", "anyhow", "async-stream", - "base64 0.13.0", - "bytes", + "base64", "ffmpeg-next", "ffmpeg-sys-next", "futures", @@ -1468,7 +1212,7 @@ dependencies = [ "sled", "structopt", "thiserror", - "time 0.2.23", + "time 0.2.25", "tracing", "tracing-futures", "tracing-subscriber", @@ -1486,11 +1230,11 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.0.3" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a83804639aad6ba65345661744708855f9fbcb71176ea8d28d05aeb11d975e7" +checksum = "96fa8ebb90271c4477f144354485b8068bd8f6b78b428b01ba892ca26caf0b63" dependencies = [ - "pin-project-internal 1.0.3", + "pin-project-internal 1.0.5", ] [[package]] @@ -1506,9 +1250,9 @@ dependencies = [ [[package]] name = "pin-project-internal" -version = "1.0.3" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7bcc46b8f73443d15bc1c5fecbb315718491fa9187fa483f0e359323cde8b3a" +checksum = "758669ae3558c6f74bd2a18b41f7ac0b5a195aea6639d6a9b5e5d1ad5ba24c0b" dependencies = [ "proc-macro2", "quote", @@ -1517,15 +1261,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.1.11" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c917123afa01924fc84bb20c4c03f004d9c38e5127e3c039bbf7f4b9c76a2f6b" - -[[package]] -name = "pin-project-lite" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e36743d754ccdf9954c2e352ce2d4b106e024c814f6499c2dadff80da9a442d8" +checksum = "439697af366c49a6d0a010c56a0d97685bc140ce0d377b13a2ea2aa42d64a827" [[package]] name = "pin-utils" @@ -1577,9 +1315,9 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" [[package]] name = "proc-macro-nested" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eba180dafb9038b050a4c280019bbedf9f2467b61e5d892dcad585bb57aadc5a" +checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" [[package]] name = "proc-macro2" @@ -1590,12 +1328,6 @@ dependencies = [ "unicode-xid", ] -[[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" - [[package]] name = "quote" version = "1.0.8" @@ -1607,11 +1339,10 @@ dependencies = [ [[package]] name = "rand" -version = "0.7.3" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e" dependencies = [ - "getrandom", "libc", "rand_chacha", "rand_core", @@ -1620,9 +1351,9 @@ dependencies = [ [[package]] name = "rand_chacha" -version = "0.2.2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" dependencies = [ "ppv-lite86", "rand_core", @@ -1630,18 +1361,18 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.5.1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +checksum = "c026d7df8b298d90ccbbc5190bd04d85e159eaf5576caeacf8741da93ccbd2e5" dependencies = [ "getrandom", ] [[package]] name = "rand_hc" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" dependencies = [ "rand_core", ] @@ -1654,9 +1385,9 @@ checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" [[package]] name = "regex" -version = "1.4.2" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38cf2c13ed4745de91a5eb834e11c00bcc3709e773173b2ce4c56c9fbde04b9c" +checksum = "d9251239e129e16308e70d853559389de218ac275b515068abc96829d05b948a" dependencies = [ "aho-corasick", "memchr", @@ -1676,19 +1407,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.21" +version = "0.6.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b181ba2dcf07aaccad5448e8ead58db5b742cf85dfe035e2227f137a539a189" - -[[package]] -name = "resolv-conf" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" -dependencies = [ - "hostname", - "quick-error", -] +checksum = "b5eb417147ba9860a96cfe72a0b93bf88fee1744b5636ec99ab20c1aa9376581" [[package]] name = "rexiv2" @@ -1703,9 +1424,9 @@ dependencies = [ [[package]] name = "ring" -version = "0.16.19" +version = "0.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "024a1e66fea74c66c66624ee5622a7ff0e4b73a13b4f5c326ddb50c708944226" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" dependencies = [ "cc", "libc", @@ -1713,15 +1434,9 @@ dependencies = [ "spin", "untrusted", "web-sys", - "winapi 0.3.9", + "winapi", ] -[[package]] -name = "rustc-demangle" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e3bad0ee36814ca07d7968269dd4b7ec89ec2da10c4bb613928d3077083c232" - [[package]] name = "rustc-hash" version = "1.1.0" @@ -1739,11 +1454,11 @@ dependencies = [ [[package]] name = "rustls" -version = "0.18.1" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d1126dcf58e93cee7d098dbda643b5f92ed724f1f6a63007c1116eed6700c81" +checksum = "064fd21ff87c6e87ed4506e68beb42459caa4a0e2eb144932e6776768556980b" dependencies = [ - "base64 0.12.3", + "base64", "log", "ring", "sct", @@ -1789,18 +1504,18 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.118" +version = "1.0.123" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06c64263859d87aa2eb554587e2d23183398d617427327cf2b3d0ed8c69e4800" +checksum = "92d5161132722baa40d802cc70b15262b98258453e85e5d1d365c757c73869ae" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.118" +version = "1.0.123" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c84d3526699cd55261af4b941e4e725444df67aa4f9e6a3564f18030d12672df" +checksum = "9391c295d64fc0abb2c556bad848f33cb8296276b1ad2677d1ae1ace4f258f31" dependencies = [ "proc-macro2", "quote", @@ -1809,9 +1524,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.61" +version = "1.0.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fceb2595057b6891a4ee808f70054bd2d12f0e97f1cbb78689b59f676df325a" +checksum = "ea1c6153794552ea7cf7cf63b1231a25de00ec90db326ba6264440fa08e31486" dependencies = [ "itoa", "ryu", @@ -1832,12 +1547,12 @@ dependencies = [ [[package]] name = "sha-1" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce3cdf1b5e620a498ee6f2a171885ac7e22f0e12089ec4b3d22b84921792507c" +checksum = "f4b312c3731e3fe78a185e6b9b911a7aa715b8e31cce117975219aab2acf285d" dependencies = [ "block-buffer", - "cfg-if 1.0.0", + "cfg-if", "cpuid-bool", "digest", "opaque-debug", @@ -1851,12 +1566,12 @@ checksum = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" [[package]] name = "sha2" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e7aab86fe2149bad8c507606bdb3f4ef5e7b2380eb92350f56122cca72a42a8" +checksum = "fa827a14b29ab7f44778d14a88d3cb76e949c45083f7dbfa507d0cb699dc12de" dependencies = [ "block-buffer", - "cfg-if 1.0.0", + "cfg-if", "cpuid-bool", "digest", "opaque-debug", @@ -1910,9 +1625,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a55ca5f3b68e41c979bf8c46a6f1da892ca4db8f94023ce0bd32407573b1ac0" +checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" [[package]] name = "socket2" @@ -1920,9 +1635,9 @@ version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "122e570113d28d773067fab24266b66753f6ea915758651696b6e35e49f88d6e" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1933,9 +1648,9 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "standback" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c66a8cff4fa24853fdf6b51f75c6d7f8206d7c75cab4e467bcd7f25c2b1febe0" +checksum = "a2beb4d1860a61f571530b3f855a1b538d0200f7871c63331ecd6f17b1f014f8" dependencies = [ "version_check", ] @@ -2021,9 +1736,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.57" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4211ce9909eb971f111059df92c45640aad50a619cf55cd76476be803c4c68e6" +checksum = "c700597eca8a5a762beb35753ef6b94df201c81cca676604f547495a0d7f0081" dependencies = [ "proc-macro2", "quote", @@ -2070,38 +1785,28 @@ dependencies = [ [[package]] name = "thread_local" -version = "1.0.1" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" +checksum = "8018d24e04c95ac8790716a5987d0fec4f8b27249ffa0f7d33f1369bdfb88cbd" dependencies = [ - "lazy_static", -] - -[[package]] -name = "threadpool" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" -dependencies = [ - "num_cpus", + "once_cell", ] [[package]] name = "time" -version = "0.1.44" +version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" +checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" dependencies = [ "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi 0.3.9", + "winapi", ] [[package]] name = "time" -version = "0.2.23" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcdaeea317915d59b2b4cd3b5efcd156c309108664277793f5351700c02ce98b" +checksum = "1195b046942c221454c2539395f85413b33383a067449d78aab2b7b052a142f7" dependencies = [ "const_fn", "libc", @@ -2110,7 +1815,7 @@ dependencies = [ "stdweb", "time-macros", "version_check", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2138,9 +1843,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccf8dbc19eb42fba10e8feaaec282fb50e2c14b2726d6301dbfeed0f73306a6f" +checksum = "317cca572a0e89c3ce0ca1f1bdc9369547fe318a683418e42ac8f59d14701023" dependencies = [ "tinyvec_macros", ] @@ -2153,32 +1858,28 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "0.2.24" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099837d3464c16a808060bb3f02263b412f6fafcb5d01c533d309985fbeebe48" +checksum = "e8190d04c665ea9e6b6a0dc45523ade572c088d2e6566244c1122671dbf4ae3a" dependencies = [ + "autocfg", "bytes", - "fnv", - "futures-core", - "iovec", - "lazy_static", "libc", "memchr", "mio", - "mio-uds", - "pin-project-lite 0.1.11", + "once_cell", + "parking_lot", + "pin-project-lite", "signal-hook-registry", - "slab", - "winapi 0.3.9", + "winapi", ] [[package]] name = "tokio-rustls" -version = "0.14.1" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e12831b255bcfa39dc0436b01e19fea231a37db570686c06ee72c423479f889a" +checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6" dependencies = [ - "futures-core", "rustls", "tokio", "webpki", @@ -2186,36 +1887,35 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.3.1" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499" +checksum = "ebb7cb2f00c5ae8df755b252306272cd1790d39728363936e01827e11f0b017b" dependencies = [ "bytes", "futures-core", "futures-sink", "log", - "pin-project-lite 0.1.11", + "pin-project-lite", "tokio", ] [[package]] name = "tracing" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f47026cdc4080c07e49b37087de021820269d996f581aac150ef9e5583eefe3" +checksum = "f7d40a22fd029e33300d8d89a5cc8ffce18bb7c587662f54629e94c9de5487f3" dependencies = [ - "cfg-if 1.0.0", - "log", - "pin-project-lite 0.2.1", + "cfg-if", + "pin-project-lite", "tracing-attributes", "tracing-core", ] [[package]] name = "tracing-attributes" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e0ccfc3378da0cce270c946b676a376943f5cd16aeba64568e7939806f4ada" +checksum = "43f080ea7e4107844ef4766459426fa2d5c1ada2e47edba05dc7fa99d9629f47" dependencies = [ "proc-macro2", "quote", @@ -2284,46 +1984,6 @@ dependencies = [ "tracing-serde", ] -[[package]] -name = "trust-dns-proto" -version = "0.19.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53861fcb288a166aae4c508ae558ed18b53838db728d4d310aad08270a7d4c2b" -dependencies = [ - "async-trait", - "backtrace", - "enum-as-inner", - "futures", - "idna", - "lazy_static", - "log", - "rand", - "smallvec", - "thiserror", - "tokio", - "url", -] - -[[package]] -name = "trust-dns-resolver" -version = "0.19.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6759e8efc40465547b0dfce9500d733c65f969a4cbbfbe3ccf68daaa46ef179e" -dependencies = [ - "backtrace", - "cfg-if 0.1.10", - "futures", - "ipconfig", - "lazy_static", - "log", - "lru-cache", - "resolv-conf", - "smallvec", - "thiserror", - "tokio", - "trust-dns-proto", -] - [[package]] name = "twoway" version = "0.2.1" @@ -2357,9 +2017,9 @@ dependencies = [ [[package]] name = "unicode-normalization" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a13e63ab62dbe32aeee58d1c5408d35c36c392bba5d9d3142287219721afe606" +checksum = "07fbfce1c8a97d547e8b5334978438d9d6ec8c20e38f56d4a4374d181493eaef" dependencies = [ "tinyvec", ] @@ -2402,11 +2062,11 @@ dependencies = [ [[package]] name = "uuid" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fde2f6a4bea1d6e007c4ad38c6839fa71cbb63b6dbf5b595aa38dc9b1093c11" +checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" dependencies = [ - "rand", + "getrandom", ] [[package]] @@ -2429,31 +2089,25 @@ checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" [[package]] name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" +version = "0.10.2+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" - -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" [[package]] name = "wasm-bindgen" -version = "0.2.69" +version = "0.2.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cd364751395ca0f68cafb17666eee36b63077fb5ecd972bbcd74c90c4bf736e" +checksum = "55c0f7123de74f0dab9b7d00fd614e7b19349cd1e2f5252bbe9b1754b59433be" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.69" +version = "0.2.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1114f89ab1f4106e5b55e688b828c0ab0ea593a1ea7c094b141b14cbaaec2d62" +checksum = "7bc45447f0d4573f3d65720f636bbcc3dd6ce920ed704670118650bcd47764c7" dependencies = [ "bumpalo", "lazy_static", @@ -2466,9 +2120,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.69" +version = "0.2.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6ac8995ead1f084a8dea1e65f194d0973800c7f571f6edd70adf06ecf77084" +checksum = "3b8853882eef39593ad4174dd26fc9865a64e84026d223f63bb2c42affcbba2c" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2476,9 +2130,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.69" +version = "0.2.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5a48c72f299d80557c7c62e37e7225369ecc0c963964059509fbafe917c7549" +checksum = "4133b5e7f2a531fa413b3a1695e925038a05a71cf67e87dafa295cb645a01385" dependencies = [ "proc-macro2", "quote", @@ -2489,15 +2143,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.69" +version = "0.2.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e7811dd7f9398f14cc76efd356f98f03aa30419dea46aa810d71e819fc97158" +checksum = "dd4945e4943ae02d15c13962b38a5b1e81eadd4b71214eee75af64a4d6a4fd64" [[package]] name = "web-sys" -version = "0.3.46" +version = "0.3.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222b1ef9334f92a21d3fb53dc3fd80f30836959a90f9274a626d7e06315ba3c3" +checksum = "c40dc691fc48003eba817c38da7113c15698142da971298003cac3ef175680b3" dependencies = [ "js-sys", "wasm-bindgen", @@ -2515,9 +2169,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f20dea7535251981a9670857150d571846545088359b28e4951d350bdaf179f" +checksum = "82015b7e0b8bad8185994674a13a93306bea76cf5a16c5a181382fd3a5ec2376" dependencies = [ "webpki", ] @@ -2531,18 +2185,6 @@ dependencies = [ "libc", ] -[[package]] -name = "widestring" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c168940144dd21fd8046987c16a46a33d5fc84eec29ef9dcddc2ac9e31526b7c" - -[[package]] -name = "winapi" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" - [[package]] name = "winapi" version = "0.3.9" @@ -2553,12 +2195,6 @@ dependencies = [ "winapi-x86_64-pc-windows-gnu", ] -[[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" - [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" @@ -2571,7 +2207,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2579,22 +2215,3 @@ name = "winapi-x86_64-pc-windows-gnu" 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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] diff --git a/Cargo.toml b/Cargo.toml index 03135a8..4ac063c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "pict-rs" description = "A simple image hosting service" -version = "0.3.0-alpha.6" +version = "0.3.0-alpha.7" authors = ["asonix "] license = "AGPL-3.0" readme = "README.md" @@ -11,24 +11,23 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -actix-form-data = "0.5.0" -actix-fs = { git = "https://git.asonix.dog/asonix/actix-fs", branch = "main" } -actix-rt = "1.1.1" -actix-web = { version = "3.0.1", default-features = false, features = ["rustls"] } +actix-form-data = "0.6.0-beta.1" +actix-fs = { git = "https://git.asonix.dog/asonix/actix-fs", branch = "asonix/actix-rt-2" } +actix-rt = "2.0.2" +actix-web = { version = "4.0.0-beta.3", default-features = false, features = ["rustls", "compress"] } anyhow = "1.0" async-stream = "0.3.0" base64 = "0.13.0" -bytes = "0.5" futures = "0.3.4" magick_rust = { version = "0.14.0", git = "https://github.com/nlfiedler/magick-rust" } mime = "0.3.1" once_cell = "1.4.0" -rand = "0.7.3" +rand = "0.8.0" rexiv2 = "0.9.1" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" sha2 = "0.9.0" -sled = { version = "0.34.4" } +sled = { version = "0.34.6" } structopt = "0.3.14" thiserror = "1.0" time = { version = "0.2.23", features = ["serde"] } @@ -44,3 +43,7 @@ features = ["codec", "filter", "device", "format", "resampling", "postprocessing [dependencies.ffmpeg-sys-next] version = "4.3.5" +git = "https://github.com/baadc0de/rust-ffmpeg-sys" + +[patch.crates-io] +ffmpeg-sys-next = { git = "https://github.com/baadc0de/rust-ffmpeg-sys", branch = "master" } diff --git a/src/error.rs b/src/error.rs index e29643c..93e8b9f 100644 --- a/src/error.rs +++ b/src/error.rs @@ -100,15 +100,9 @@ impl From for UploadError { } } -impl From> for UploadError -where - T: Into + std::fmt::Debug, -{ - fn from(e: actix_web::error::BlockingError) -> Self { - match e { - actix_web::error::BlockingError::Error(e) => e.into(), - _ => UploadError::Canceled, - } +impl From for UploadError { + fn from(_: actix_web::error::BlockingError) -> Self { + UploadError::Canceled } } @@ -128,6 +122,7 @@ impl ResponseError for UploadError { } fn error_response(&self) -> HttpResponse { - HttpResponse::build(self.status_code()).json(serde_json::json!({ "msg": self.to_string() })) + HttpResponse::build(self.status_code()) + .json(&serde_json::json!({ "msg": self.to_string() })) } } diff --git a/src/main.rs b/src/main.rs index f772a7c..623a64d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,7 +7,6 @@ use actix_web::{ middleware::{Compress, Logger}, web, App, HttpResponse, HttpServer, }; -use bytes::Bytes; use futures::stream::{once, Stream, TryStreamExt}; use once_cell::sync::Lazy; use std::{ @@ -50,6 +49,7 @@ static TMP_DIR: Lazy = Lazy::new(|| { let tmp_nonce = Alphanumeric .sample_iter(&mut rng) .take(7) + .map(char::from) .collect::(); let mut path = std::env::temp_dir(); @@ -93,7 +93,7 @@ async fn safe_create_parent(path: PathBuf) -> Result<(), UploadError> { // Try writing to a file #[instrument(skip(bytes))] -async fn safe_save_file(path: PathBuf, bytes: bytes::Bytes) -> Result<(), UploadError> { +async fn safe_save_file(path: PathBuf, bytes: web::Bytes) -> Result<(), UploadError> { if let Some(path) = path.parent() { // create the directory for the file debug!("Creating directory {:?}", path); @@ -132,7 +132,11 @@ pub(crate) fn tmp_file() -> PathBuf { let limit: usize = 10; let rng = rand::thread_rng(); - let s: String = Alphanumeric.sample_iter(rng).take(limit).collect(); + let s: String = Alphanumeric + .sample_iter(rng) + .take(limit) + .map(char::from) + .collect(); let name = format!("{}.tmp", s); @@ -203,7 +207,7 @@ async fn upload( } } - Ok(HttpResponse::Created().json(serde_json::json!({ + Ok(HttpResponse::Created().json(&serde_json::json!({ "msg": "ok", "files": files }))) @@ -250,7 +254,7 @@ async fn download( new_details }; - Ok(HttpResponse::Created().json(serde_json::json!({ + Ok(HttpResponse::Created().json(&serde_json::json!({ "msg": "ok", "files": [{ "file": alias, @@ -334,7 +338,7 @@ async fn process_details( let details = details.ok_or(UploadError::NoFiles)?; - Ok(HttpResponse::Ok().json(details)) + Ok(HttpResponse::Ok().json(&details)) } /// Process files @@ -447,7 +451,7 @@ async fn process( let range = range_header.ranges().next().unwrap(); let mut builder = HttpResponse::PartialContent(); - builder.set(range.to_content_range(img_bytes.len() as u64)); + builder.insert_header(range.to_content_range(img_bytes.len() as u64)); (builder, range.chop_bytes(img_bytes)) } else { return Err(UploadError::Range); @@ -499,7 +503,7 @@ async fn details( new_details }; - Ok(HttpResponse::Ok().json(details)) + Ok(HttpResponse::Ok().json(&details)) } /// Serve files @@ -550,7 +554,7 @@ async fn ranged_file_resp( let range = range_header.ranges().next().unwrap(); let mut builder = HttpResponse::PartialContent(); - builder.set(range.to_content_range(meta.len())); + builder.insert_header(range.to_content_range(meta.len())); (builder, range.chop_file(file).await?) } else { @@ -562,7 +566,8 @@ async fn ranged_file_resp( let stream = actix_fs::read_to_stream(path) .await? .map_err(UploadError::from); - let stream: Pin>>> = Box::pin(stream); + let stream: Pin>>> = + Box::pin(stream); (HttpResponse::Ok(), stream) } }; @@ -585,18 +590,18 @@ fn srv_response( modified: SystemTime, ) -> HttpResponse where - S: Stream> + Unpin + 'static, + S: Stream> + Unpin + 'static, E: 'static, actix_web::Error: From, { builder - .set(LastModified(modified.into())) - .set(CacheControl(vec![ + .insert_header(LastModified(modified.into())) + .insert_header(CacheControl(vec![ CacheDirective::Public, CacheDirective::MaxAge(expires), CacheDirective::Extension("immutable".to_owned(), None), ])) - .set_header(ACCEPT_RANGES, "bytes") + .insert_header((ACCEPT_RANGES, "bytes")) .content_type(ext.to_string()) .streaming(stream) } @@ -623,7 +628,7 @@ async fn purge( .await?; } - Ok(HttpResponse::Ok().json(serde_json::json!({ + Ok(HttpResponse::Ok().json(&serde_json::json!({ "msg": "ok", "aliases": aliases }))) @@ -638,7 +643,7 @@ async fn aliases( FileOrAlias::Alias { alias } => upload_manager.aliases_by_alias(alias).await?, }; - Ok(HttpResponse::Ok().json(serde_json::json!({ + Ok(HttpResponse::Ok().json(&serde_json::json!({ "msg": "ok", "aliases": aliases, }))) @@ -655,7 +660,7 @@ async fn filename_by_alias( ) -> Result { let filename = upload_manager.from_alias(query.into_inner().alias).await?; - Ok(HttpResponse::Ok().json(serde_json::json!({ + Ok(HttpResponse::Ok().json(&serde_json::json!({ "msg": "ok", "filename": filename, }))) diff --git a/src/middleware.rs b/src/middleware.rs index d7ada3a..ab663be 100644 --- a/src/middleware.rs +++ b/src/middleware.rs @@ -26,16 +26,16 @@ impl ResponseError for ApiError { } fn error_response(&self) -> HttpResponse { - HttpResponse::build(self.status_code()).json(serde_json::json!({ "msg": self.to_string() })) + HttpResponse::build(self.status_code()) + .json(&serde_json::json!({ "msg": self.to_string() })) } } -impl Transform for Tracing +impl Transform for Tracing where - S: Service, + S: Service, S::Future: 'static, { - type Request = S::Request; type Response = S::Response; type Error = S::Error; type InitError = (); @@ -47,21 +47,20 @@ where } } -impl Service for TracingMiddleware +impl Service for TracingMiddleware where - S: Service, + S: Service, S::Future: 'static, { - type Request = S::Request; type Response = S::Response; type Error = S::Error; type Future = Instrumented; - fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll> { + fn poll_ready(&self, cx: &mut Context<'_>) -> Poll> { self.inner.poll_ready(cx) } - fn call(&mut self, req: S::Request) -> Self::Future { + fn call(&self, req: Request) -> Self::Future { let uuid = Uuid::new_v4(); self.inner @@ -70,12 +69,11 @@ where } } -impl Transform for Internal +impl Transform for Internal where - S: Service, + S: Service, S::Future: 'static, { - type Request = S::Request; type Response = S::Response; type Error = S::Error; type InitError = (); @@ -87,21 +85,20 @@ where } } -impl Service for InternalMiddleware +impl Service for InternalMiddleware where - S: Service, + S: Service, S::Future: 'static, { - type Request = S::Request; type Response = S::Response; type Error = S::Error; type Future = LocalBoxFuture<'static, Result>; - fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll> { + fn poll_ready(&self, cx: &mut Context<'_>) -> Poll> { self.1.poll_ready(cx) } - fn call(&mut self, req: S::Request) -> Self::Future { + fn call(&self, req: ServiceRequest) -> Self::Future { if let Some(value) = req.headers().get("x-api-token") { if value.to_str().is_ok() && value.to_str().ok() == self.0.as_deref() { let fut = self.1.call(req); diff --git a/src/processor.rs b/src/processor.rs index 661c625..b1eaad8 100644 --- a/src/processor.rs +++ b/src/processor.rs @@ -4,7 +4,6 @@ use crate::{ validate::{ptos, Op}, }; use actix_web::web; -use bytes::Bytes; use magick_rust::MagickWand; use std::path::PathBuf; use tracing::{debug, error, instrument, Span}; @@ -372,7 +371,7 @@ pub(crate) async fn prepare_image( transcode(orig_path, tmpfile, Target::Jpeg).map_err(UploadError::Transcode) }) - .await; + .await?; if let Err(e) = res { error!("transcode error: {:?}", e); @@ -395,7 +394,7 @@ pub(crate) async fn process_image( original_file: PathBuf, chain: ProcessChain, format: Format, -) -> Result { +) -> Result { let original_path_str = ptos(&original_file)?; let span = Span::current(); @@ -414,9 +413,9 @@ pub(crate) async fn process_image( let vec = wand.op(|w| w.write_image_blob(format.to_magick_format()))?; drop(entered); - Ok(Bytes::from(vec)) as Result + Ok(web::Bytes::from(vec)) as Result }) - .await?; + .await??; Ok(bytes) } diff --git a/src/upload_manager.rs b/src/upload_manager.rs index a278da8..5da3f79 100644 --- a/src/upload_manager.rs +++ b/src/upload_manager.rs @@ -44,7 +44,7 @@ impl std::fmt::Debug for UploadManager { } } -type UploadStream = Pin>>>; +type UploadStream = Pin>>>; #[derive(Clone)] pub(crate) struct Serde { @@ -134,7 +134,7 @@ impl Details { }) }) }) - .await?; + .await??; Ok(Details::now(width as usize, height as usize, mime_type)) } @@ -213,7 +213,7 @@ impl UploadManager { ) -> Result { let root_clone = root_dir.clone(); // sled automatically creates it's own directories - let db = web::block(move || LatestDb::exists(root_clone).migrate()).await?; + let db = web::block(move || LatestDb::exists(root_clone).migrate()).await??; root_dir.push("files"); @@ -245,13 +245,13 @@ impl UploadManager { let fname_tree = self.inner.filename_tree.clone(); debug!("Getting hash"); let hash: sled::IVec = web::block(move || fname_tree.get(filename.as_bytes())) - .await? + .await?? .ok_or(UploadError::MissingFilename)?; let key = variant_key(&hash, &path_string); let main_tree = self.inner.main_tree.clone(); debug!("Storing variant"); - web::block(move || main_tree.insert(key, path_string.as_bytes())).await?; + web::block(move || main_tree.insert(key, path_string.as_bytes())).await??; debug!("Stored variant"); Ok(()) @@ -268,13 +268,13 @@ impl UploadManager { let fname_tree = self.inner.filename_tree.clone(); debug!("Getting hash"); let hash: sled::IVec = web::block(move || fname_tree.get(filename.as_bytes())) - .await? + .await?? .ok_or(UploadError::MissingFilename)?; let key = variant_details_key(&hash, &path_string); let main_tree = self.inner.main_tree.clone(); debug!("Getting details"); - let opt = match web::block(move || main_tree.get(key)).await? { + let opt = match web::block(move || main_tree.get(key)).await?? { Some(ivec) => match serde_json::from_slice(&ivec) { Ok(details) => Some(details), Err(_) => None, @@ -297,14 +297,14 @@ impl UploadManager { let fname_tree = self.inner.filename_tree.clone(); debug!("Getting hash"); let hash: sled::IVec = web::block(move || fname_tree.get(filename.as_bytes())) - .await? + .await?? .ok_or(UploadError::MissingFilename)?; let key = variant_details_key(&hash, &path_string); let main_tree = self.inner.main_tree.clone(); let details_value = serde_json::to_string(details)?; debug!("Storing details"); - web::block(move || main_tree.insert(key, details_value.as_bytes())).await?; + web::block(move || main_tree.insert(key, details_value.as_bytes())).await??; debug!("Stored details"); Ok(()) @@ -317,7 +317,7 @@ impl UploadManager { ) -> Result, UploadError> { let fname_tree = self.inner.filename_tree.clone(); let hash = web::block(move || fname_tree.get(filename.as_bytes())) - .await? + .await?? .ok_or(UploadError::MissingAlias)?; self.aliases_by_hash(&hash).await @@ -327,7 +327,7 @@ impl UploadManager { pub(crate) async fn aliases_by_alias(&self, alias: String) -> Result, UploadError> { let alias_tree = self.inner.alias_tree.clone(); let hash = web::block(move || alias_tree.get(alias.as_bytes())) - .await? + .await?? .ok_or(UploadError::MissingFilename)?; self.aliases_by_hash(&hash).await @@ -342,7 +342,7 @@ impl UploadManager { .values() .collect::, _>>() }) - .await?; + .await??; debug!("Got {} aliases for hash", aliases.len()); let aliases = aliases @@ -362,7 +362,7 @@ impl UploadManager { let token_key = delete_key(&alias); let alias_tree = self.inner.alias_tree.clone(); let token = web::block(move || alias_tree.get(token_key.as_bytes())) - .await? + .await?? .ok_or(UploadError::MissingAlias)?; self.delete(alias, String::from_utf8(token.to_vec())?).await @@ -415,7 +415,7 @@ impl UploadManager { Ok(hash) }) }) - .await?; + .await??; // -- CHECK IF ANY OTHER ALIASES EXIST -- let main_tree = self.inner.main_tree.clone(); @@ -424,7 +424,7 @@ impl UploadManager { let any_aliases = web::block(move || { Ok(main_tree.range(start..end).next().is_some()) as Result }) - .await?; + .await??; // Bail if there are existing aliases if any_aliases { @@ -437,7 +437,7 @@ impl UploadManager { let hash2 = hash.clone(); debug!("Deleting hash -> filename mapping"); let filename = web::block(move || main_tree.remove(&hash2)) - .await? + .await?? .ok_or(UploadError::MissingFile)?; // -- DELETE FILES -- @@ -468,7 +468,11 @@ impl UploadManager { debug!("Generating delete token"); use rand::distributions::{Alphanumeric, Distribution}; let rng = rand::thread_rng(); - let s: String = Alphanumeric.sample_iter(rng).take(10).collect(); + let s: String = Alphanumeric + .sample_iter(rng) + .take(10) + .map(char::from) + .collect(); let delete_token = s.clone(); debug!("Saving delete token"); @@ -481,7 +485,7 @@ impl UploadManager { Some(s.as_bytes()), ) }) - .await?; + .await??; if let Err(sled::CompareAndSwapError { current: Some(ivec), @@ -579,13 +583,13 @@ impl UploadManager { let tree = self.inner.alias_tree.clone(); debug!("Getting hash from alias"); let hash = web::block(move || tree.get(alias.as_bytes())) - .await? + .await?? .ok_or(UploadError::MissingAlias)?; let main_tree = self.inner.main_tree.clone(); debug!("Getting filename from hash"); let filename = web::block(move || main_tree.get(hash)) - .await? + .await?? .ok_or(UploadError::MissingFile)?; let filename = String::from_utf8(filename.to_vec())?; @@ -610,7 +614,7 @@ impl UploadManager { let fname_tree = self.inner.filename_tree.clone(); debug!("Deleting filename -> hash mapping"); let hash = web::block(move || fname_tree.remove(filename)) - .await? + .await?? .ok_or(UploadError::MissingFile)?; let (start, end) = variant_key_bounds(&hash); @@ -624,13 +628,13 @@ impl UploadManager { Ok(keys) as Result, UploadError> }) - .await?; + .await??; debug!("{} files prepared for deletion", keys.len()); for key in keys { let main_tree = self.inner.main_tree.clone(); - if let Some(path) = web::block(move || main_tree.remove(key)).await? { + if let Some(path) = web::block(move || main_tree.remove(key)).await?? { let s = String::from_utf8_lossy(&path); debug!("Deleting {}", s); // ignore json objects @@ -685,12 +689,12 @@ impl UploadManager { hasher.update(&bytes); Ok(hasher) as Result<_, UploadError> }) - .await?; + .await??; } let hash = web::block(move || Ok(hasher.finalize_reset().to_vec()) as Result<_, UploadError>) - .await?; + .await??; Ok(Hash::new(hash)) } @@ -715,7 +719,7 @@ impl UploadManager { Some(filename2.as_bytes()), ) }) - .await?; + .await??; if let Err(sled::CompareAndSwapError { current: Some(ivec), @@ -730,7 +734,7 @@ impl UploadManager { let fname_tree = self.inner.filename_tree.clone(); let filename2 = filename.clone(); debug!("Saving filename -> hash relation"); - web::block(move || fname_tree.insert(filename2, hash.inner)).await?; + web::block(move || fname_tree.insert(filename2, hash.inner)).await??; Ok((Dup::New, filename)) } @@ -741,11 +745,15 @@ impl UploadManager { let image_dir = self.image_dir(); use rand::distributions::{Alphanumeric, Distribution}; let mut limit: usize = 10; - let rng = rand::thread_rng(); + let mut rng = rand::thread_rng(); loop { debug!("Filename generation loop"); let mut path = image_dir.clone(); - let s: String = Alphanumeric.sample_iter(rng).take(limit).collect(); + let s: String = Alphanumeric + .sample_iter(&mut rng) + .take(limit) + .map(char::from) + .collect(); let filename = file_name(s, content_type.clone())?; @@ -799,7 +807,7 @@ impl UploadManager { loop { debug!("hash -> alias save loop"); let db = self.inner.db.clone(); - let id = web::block(move || db.generate_id()).await?.to_string(); + let id = web::block(move || db.generate_id()).await??.to_string(); let key = alias_key(&hash.inner, &id); let main_tree = self.inner.main_tree.clone(); @@ -808,13 +816,13 @@ impl UploadManager { let res = web::block(move || { main_tree.compare_and_swap(key, None as Option, Some(alias2.as_bytes())) }) - .await?; + .await??; if res.is_ok() { let alias_tree = self.inner.alias_tree.clone(); let key = alias_id_key(&alias); debug!("Saving alias -> id mapping"); - web::block(move || alias_tree.insert(key.as_bytes(), id.as_bytes())).await?; + web::block(move || alias_tree.insert(key.as_bytes(), id.as_bytes())).await??; break; } @@ -834,10 +842,14 @@ impl UploadManager { ) -> Result { use rand::distributions::{Alphanumeric, Distribution}; let mut limit: usize = 10; - let rng = rand::thread_rng(); + let mut rng = rand::thread_rng(); loop { debug!("Alias gen loop"); - let s: String = Alphanumeric.sample_iter(rng).take(limit).collect(); + let s: String = Alphanumeric + .sample_iter(&mut rng) + .take(limit) + .map(char::from) + .collect(); let alias = file_name(s, content_type.clone())?; let res = self.save_alias(hash, &alias).await?; @@ -866,7 +878,7 @@ impl UploadManager { let res = web::block(move || { tree.compare_and_swap(alias.as_bytes(), None as Option, Some(vec)) }) - .await?; + .await??; if res.is_err() { warn!("Duplicate alias"); diff --git a/src/validate/mod.rs b/src/validate/mod.rs index 380c389..56f1bd0 100644 --- a/src/validate/mod.rs +++ b/src/validate/mod.rs @@ -199,7 +199,7 @@ pub(crate) async fn validate_image( drop(entered); Ok(content_type) as Result }) - .await?; + .await??; Ok(content_type) }