From 9f940c317a542ed2a8695eebdafe2f4fe11c5248 Mon Sep 17 00:00:00 2001 From: realaravinth Date: Wed, 30 Jun 2021 20:13:12 +0530 Subject: [PATCH] upgrading to actix-v4-beta --- Cargo.lock | 1442 +++++------------ Cargo.toml | 27 +- config/default.toml | 11 +- src/api/v1/auth.rs | 3 +- src/api/v1/notifications/get.rs | 20 +- src/api/v1/pow/get_config.rs | 2 +- src/docs.rs | 6 +- src/email/verification.rs | 89 +- src/errors.rs | 56 +- src/main.rs | 7 +- src/middleware/auth.rs | 55 +- src/pages/errors.rs | 2 +- src/pages/mod.rs | 10 +- src/pages/panel/sitekey/view.rs | 2 +- src/settings.rs | 1 + src/static_assets/static_files.rs | 8 +- src/tests/mod.rs | 8 +- src/widget/mod.rs | 4 +- templates/email/components/footer/index.html | 59 + templates/email/components/footer/main.css | 38 + templates/email/css/base.css | 15 + templates/email/css/message-text.css | 1 + .../verification/css/verification__link.css | 4 + templates/email/verification/index.html | 50 + 24 files changed, 728 insertions(+), 1192 deletions(-) create mode 100644 templates/email/components/footer/index.html create mode 100644 templates/email/components/footer/main.css create mode 100644 templates/email/css/base.css create mode 100644 templates/email/css/message-text.css create mode 100644 templates/email/verification/css/verification__link.css create mode 100644 templates/email/verification/index.html diff --git a/Cargo.lock b/Cargo.lock index a633a5ce..13d4e684 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,130 +4,108 @@ version = 3 [[package]] name = "actix" -version = "0.10.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1be241f88f3b1e7e9a3fbe3b5a8a0f6915b5a1d7ee0d9a248d3376d01068cc60" +checksum = "3720d0064a0ce5c0de7bd93bdb0a6caebab2a9b5668746145d7b3b0c5da02914" dependencies = [ "actix-rt", "actix_derive", "bitflags", - "bytes 0.5.6", - "crossbeam-channel 0.4.4", - "derive_more", - "futures-channel", + "bytes", + "crossbeam-channel", + "futures-core", + "futures-sink", + "futures-task", "futures-util", "log", "once_cell", "parking_lot", - "pin-project 0.4.28", + "pin-project-lite", "smallvec", - "tokio 0.2.25", + "tokio", "tokio-util", - "trust-dns-proto", - "trust-dns-resolver", ] [[package]] name = "actix-codec" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78d1833b3838dbe990df0f1f87baf640cf6146e898166afe401839d1b001e570" +checksum = "1d5dbeb2d9e51344cb83ca7cc170f1217f9fe25bfc50160e6e200b5c31c1019a" dependencies = [ "bitflags", - "bytes 0.5.6", + "bytes", "futures-core", "futures-sink", "log", - "pin-project 0.4.28", - "tokio 0.2.25", + "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", - "trust-dns-proto", - "trust-dns-resolver", -] - [[package]] name = "actix-cors" -version = "0.5.4" +version = "0.6.0-beta.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36b133d8026a9f209a9aeeeacd028e7451bcca975f592881b305d37983f303d7" +checksum = "01552b8facccd5d7a4cc5d8e2b07d306160c97a4968181c2db965533389c8725" dependencies = [ + "actix-service", "actix-web", "derive_more", "futures-util", "log", "once_cell", - "tinyvec", + "smallvec", ] [[package]] name = "actix-http" -version = "2.2.0" +version = "3.0.0-beta.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "452299e87817ae5673910e53c243484ca38be3828db819b6011736fc6982e874" +checksum = "3cd16d6b846983ffabfd081e1a67abd7698094fcbe7b3d9bcf1acbc6f546a516" dependencies = [ "actix-codec", - "actix-connect", "actix-rt", "actix-service", - "actix-threadpool", + "actix-tls", "actix-utils", - "base64 0.13.0", + "ahash", + "base64", "bitflags", "brotli2", - "bytes 0.5.6", - "cookie", - "copyless", + "bytes", + "bytestring", "derive_more", - "either", "encoding_rs", "flate2", - "futures-channel", "futures-core", "futures-util", - "fxhash", "h2", "http", "httparse", - "indexmap", "itoa", "language-tags", - "lazy_static", + "local-channel", "log", "mime", + "once_cell", "percent-encoding", - "pin-project 1.0.7", - "rand 0.7.3", + "pin-project", + "pin-project-lite", + "rand 0.8.4", "regex", "serde 1.0.126", - "serde_json", - "serde_urlencoded", "sha-1", - "slab", + "smallvec", "time 0.2.27", + "tokio", + "zstd", ] [[package]] name = "actix-identity" -version = "0.3.1" +version = "0.4.0-beta.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3263fe74cf505c6f9e18209c89fbdba5569cfd3905a7e907b42aa1c85c18fae5" +checksum = "50b26f099c3b3bd459a547abf391c3cbecdc077df757f56856e31e8cd5757f28" dependencies = [ "actix-service", "actix-web", @@ -139,9 +117,9 @@ dependencies = [ [[package]] name = "actix-macros" -version = "0.1.3" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ca8ce00b267af8ccebbd647de0d61e0674b6e61185cc7a592ff88772bed655" +checksum = "c2f86cd6857c135e6e9fe57b1619a88d1f94a7df34c00e11fe13e64fd3438837" dependencies = [ "quote", "syn", @@ -162,115 +140,75 @@ dependencies = [ [[package]] name = "actix-rt" -version = "1.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143fcc2912e0d1de2bcf4e2f720d2a60c28652ab4179685a1ee159e0fb3db227" +checksum = "bc7d7cd957c9ed92288a7c3c96af81fa5291f65247a76a34dac7b6af74e52ba0" dependencies = [ "actix-macros", - "actix-threadpool", - "copyless", - "futures-channel", - "futures-util", - "smallvec", - "tokio 0.2.25", + "futures-core", + "tokio", ] [[package]] name = "actix-server" -version = "1.0.4" +version = "2.0.0-beta.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45407e6e672ca24784baa667c5d32ef109ccdd8d5e0b5ebb9ef8a67f4dfb708e" +checksum = "26369215fcc3b0176018b3b68756a8bcc275bb000e6212e454944913a1f9bf87" dependencies = [ - "actix-codec", "actix-rt", "actix-service", "actix-utils", - "futures-channel", - "futures-util", + "futures-core", "log", - "mio 0.6.23", - "mio-uds", + "mio", "num_cpus", "slab", - "socket2 0.3.19", + "tokio", ] [[package]] name = "actix-service" -version = "1.0.6" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0052435d581b5be835d11f4eb3bce417c8af18d87ddf8ace99f8e67e595882bb" +checksum = "77f5f9d66a8730d0fae62c26f3424f5751e5518086628a40b7ab6fca4a705034" dependencies = [ - "futures-util", - "pin-project 0.4.28", -] - -[[package]] -name = "actix-testing" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47239ca38799ab74ee6a8a94d1ce857014b2ac36f242f70f3f75a66f691e791c" -dependencies = [ - "actix-macros", - "actix-rt", - "actix-server", - "actix-service", - "log", - "socket2 0.3.19", -] - -[[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", + "paste", + "pin-project-lite", ] [[package]] name = "actix-tls" -version = "2.0.0" +version = "3.0.0-beta.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24789b7d7361cf5503a504ebe1c10806896f61e96eca9a7350e23001aca715fb" -dependencies = [ - "actix-codec", - "actix-service", - "actix-utils", - "futures-util", -] - -[[package]] -name = "actix-utils" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e9022dec56632d1d7979e59af14f0597a28a830a9c1c7fec8b2327eb9f16b5a" +checksum = "65b7bb60840962ef0332f7ea01a57d73a24d2cb663708511ff800250bbfef569" dependencies = [ "actix-codec", "actix-rt", "actix-service", - "bitflags", - "bytes 0.5.6", - "either", - "futures-channel", - "futures-sink", - "futures-util", + "actix-utils", + "derive_more", + "futures-core", + "http", "log", - "pin-project 0.4.28", - "slab", + "tokio-util", +] + +[[package]] +name = "actix-utils" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e491cbaac2e7fc788dfff99ff48ef317e23b3cf63dbaf7aaab6418f40f92aa94" +dependencies = [ + "local-waker", + "pin-project-lite", ] [[package]] name = "actix-web" -version = "3.3.2" +version = "4.0.0-beta.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e641d4a172e7faa0862241a20ff4f1f5ab0ab7c279f00c2d4587b77483477b86" +checksum = "c503f726f895e55dac39adeafd14b5ee00cc956796314e9227fc7ae2e176f443" dependencies = [ "actix-codec", "actix-http", @@ -279,37 +217,39 @@ dependencies = [ "actix-rt", "actix-server", "actix-service", - "actix-testing", - "actix-threadpool", - "actix-tls", "actix-utils", - "actix-web-codegen 0.4.0", - "awc", - "bytes 0.5.6", + "actix-web-codegen 0.5.0-beta.3 (registry+https://github.com/rust-lang/crates.io-index)", + "ahash", + "bytes", + "cfg-if", + "cookie", "derive_more", + "either", "encoding_rs", - "futures-channel", "futures-core", "futures-util", - "fxhash", + "itoa", + "language-tags", "log", "mime", - "pin-project 1.0.7", + "once_cell", + "paste", + "pin-project", "regex", "serde 1.0.126", "serde_json", "serde_urlencoded", - "socket2 0.3.19", + "smallvec", + "socket2", "time 0.2.27", - "tinyvec", "url", ] [[package]] name = "actix-web-codegen" -version = "0.4.0" +version = "0.5.0-beta.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad26f77093333e0e7c6ffe54ebe3582d908a104e448723eec6d43d08b07143fb" +checksum = "0d048c6986743105c1e8e9729fbc8d5d1667f2f62393a58be8d85a7d9a5a6c8d" dependencies = [ "proc-macro2", "quote", @@ -318,8 +258,8 @@ dependencies = [ [[package]] name = "actix-web-codegen" -version = "0.5.0-beta.2" -source = "git+https://github.com/realaravinth/actix-web#437a15d3230402b8b8b8343afc48128513814ac9" +version = "0.5.0-beta.3" +source = "git+https://github.com/realaravinth/actix-web#4a15747242bb113cc7ec22992ab2b3e539c7386a" dependencies = [ "proc-macro2", "quote", @@ -328,9 +268,9 @@ dependencies = [ [[package]] name = "actix_derive" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b95aceadaf327f18f0df5962fedc1bde2f870566a0b9f65c89508a3b1f79334c" +checksum = "6d44b8fee1ced9671ba043476deddef739dd0959bf77030b26b738cc591737a7" dependencies = [ "proc-macro2", "quote", @@ -399,15 +339,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.4.7" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16e" - -[[package]] -name = "ahash" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "796540673305a66d127804eef19ad696f1f204b8c1025aaca4958c17eab32877" +checksum = "43bb833f0bf979d8475d38fbf09ed3b8a55e1885fe93ad3f93239fc6a4f17b98" dependencies = [ "getrandom 0.2.3", "once_cell", @@ -441,13 +375,13 @@ dependencies = [ [[package]] name = "argon2-creds" version = "0.2.1" -source = "git+https://github.com/realaravinth/argon2-creds?branch=master#3330634832150ad2af1c31768ed3b84e69f4c8ad" +source = "git+https://github.com/realaravinth/argon2-creds?branch=master#2a3df16a6148ac1f48121b87232f24975f45a9c0" dependencies = [ "ammonia", - "derive_builder 0.10.2", + "derive_builder", "derive_more", "lazy_static", - "rand 0.8.3", + "rand 0.8.4", "regex", "rust-argon2", "unicode-normalization", @@ -466,118 +400,6 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" -[[package]] -name = "async-channel" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2114d64672151c0c5eaa5e131ec84a74f06e1e559830dabba01ca30605d66319" -dependencies = [ - "concurrent-queue", - "event-listener", - "futures-core", -] - -[[package]] -name = "async-executor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "871f9bb5e0a22eeb7e8cf16641feb87c9dc67032ccf8ff49e772eb9941d3a965" -dependencies = [ - "async-task", - "concurrent-queue", - "fastrand", - "futures-lite", - "once_cell", - "slab", -] - -[[package]] -name = "async-global-executor" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9586ec52317f36de58453159d48351bc244bc24ced3effc1fce22f3d48664af6" -dependencies = [ - "async-channel", - "async-executor", - "async-io", - "async-mutex", - "blocking", - "futures-lite", - "num_cpus", - "once_cell", -] - -[[package]] -name = "async-io" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bbfd5cf2794b1e908ea8457e6c45f8f8f1f6ec5f74617bf4662623f47503c3b" -dependencies = [ - "concurrent-queue", - "fastrand", - "futures-lite", - "libc", - "log", - "once_cell", - "parking", - "polling", - "slab", - "socket2 0.4.0", - "waker-fn", - "winapi 0.3.9", -] - -[[package]] -name = "async-lock" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6a8ea61bf9947a1007c5cada31e647dbc77b103c679858150003ba697ea798b" -dependencies = [ - "event-listener", -] - -[[package]] -name = "async-mutex" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479db852db25d9dbf6204e6cb6253698f175c15726470f78af0d918e99d6156e" -dependencies = [ - "event-listener", -] - -[[package]] -name = "async-std" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9f06685bad74e0570f5213741bea82158279a4103d988e57bfada11ad230341" -dependencies = [ - "async-channel", - "async-global-executor", - "async-io", - "async-lock", - "crossbeam-utils 0.8.5", - "futures-channel", - "futures-core", - "futures-io", - "futures-lite", - "gloo-timers", - "kv-log-macro", - "log", - "memchr", - "num_cpus", - "once_cell", - "pin-project-lite 0.2.6", - "pin-utils", - "slab", - "wasm-bindgen-futures", -] - -[[package]] -name = "async-task" -version = "4.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91831deabf0d6d7ec49552e489aed63b7456a7a3c46cff62adad428110b0af0" - [[package]] name = "async-trait" version = "0.1.50" @@ -598,12 +420,6 @@ dependencies = [ "num-traits 0.2.14", ] -[[package]] -name = "atomic-waker" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "065374052e7df7ee4047b1160cca5e1467a12351a40b3da123c870ba0b8eda2a" - [[package]] name = "atty" version = "0.2.14" @@ -612,7 +428,7 @@ checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ "hermit-abi", "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -621,42 +437,12 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" -[[package]] -name = "awc" -version = "2.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b381e490e7b0cfc37ebc54079b0413d8093ef43d14a4e4747083f7fa47a9e691" -dependencies = [ - "actix-codec", - "actix-http", - "actix-rt", - "actix-service", - "base64 0.13.0", - "bytes 0.5.6", - "cfg-if 1.0.0", - "derive_more", - "futures-core", - "log", - "mime", - "percent-encoding", - "rand 0.7.3", - "serde 1.0.126", - "serde_json", - "serde_urlencoded", -] - [[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" @@ -710,20 +496,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "blocking" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5e170dbede1f740736619b776d7251cb1b9095c435c34d8ca9f57fcd2f335e9" -dependencies = [ - "async-channel", - "async-task", - "atomic-waker", - "fastrand", - "futures-lite", - "once_cell", -] - [[package]] name = "brotli-sys" version = "0.3.2" @@ -762,12 +534,6 @@ version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" -[[package]] -name = "bytes" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" - [[package]] name = "bytes" version = "1.0.1" @@ -780,7 +546,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90706ba19e97b90786e19dc0d5e2abd80008d99d4c0c5d1ad0b5e72cec7c494d" dependencies = [ - "bytes 1.0.1", + "bytes", ] [[package]] @@ -789,7 +555,7 @@ version = "0.2.0" source = "git+https://github.com/realaravinth/cache-buster#d970b7031cd90649e30dc297eb5eba74832153e8" dependencies = [ "data-encoding", - "derive_builder 0.10.2", + "derive_builder", "mime", "mime_guess", "serde 1.0.126", @@ -798,45 +564,14 @@ dependencies = [ "walkdir", ] -[[package]] -name = "cache-padded" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631ae5198c9be5e753e5cc215e1bd73c2b466a3565173db433f52bb9d3e66dba" - -[[package]] -name = "cargo-platform" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0226944a63d1bf35a3b5f948dd7c59e263db83695c9e8bffc4037de02e30f1d7" -dependencies = [ - "serde 1.0.126", -] - -[[package]] -name = "cargo_metadata" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7714a157da7991e23d90686b9524b9e12e0407a108647f52e9328f4b3d51ac7f" -dependencies = [ - "cargo-platform", - "semver 0.11.0", - "semver-parser 0.10.2", - "serde 1.0.126", - "serde_json", -] - [[package]] name = "cc" version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a72c244c1ff497a746a7e1fb3d14bd08420ecda70c8f25c7112f2781652d787" - -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +dependencies = [ + "jobserver", +] [[package]] name = "cfg-if" @@ -855,25 +590,15 @@ dependencies = [ [[package]] name = "combine" -version = "4.5.2" +version = "4.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc4369b5e4c0cddf64ad8981c0111e7df4f7078f4d6ba98fb31f2e17c4c57b7e" +checksum = "a2d47c1b11006b87e492b53b313bb699ce60e16613c4dddaa91f8f7c220ab2fa" dependencies = [ - "bytes 0.5.6", - "bytes 1.0.1", + "bytes", "futures-util", "memchr", - "pin-project-lite 0.2.6", - "tokio 0.2.25", -] - -[[package]] -name = "concurrent-queue" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ed07550be01594c6026cff2a1d7fe9c8f683caa798e12b68694ac9e88286a3" -dependencies = [ - "cache-padded", + "pin-project-lite", + "tokio", ] [[package]] @@ -912,27 +637,22 @@ checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] name = "cookie" -version = "0.14.4" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03a5d7b21829bc7b4bf4754a978a241ae54ea55a40f92bb20216e54096f4b951" +checksum = "ffdf8865bac3d9a3bde5bde9088ca431b11f5d37c7a578b8086af77248b76627" dependencies = [ "aes-gcm", - "base64 0.13.0", + "base64", "hkdf", "hmac", "percent-encoding", - "rand 0.8.3", + "rand 0.8.4", "sha2", + "subtle", "time 0.2.27", "version_check", ] -[[package]] -name = "copyless" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2df960f5d869b2dd8532793fde43eb5427cceb126c929747a26823ab0eeb536" - [[package]] name = "core-foundation" version = "0.9.1" @@ -951,9 +671,9 @@ checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b" [[package]] name = "cpufeatures" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed00c67cb5d0a7d64a44f6ad2668db7e7530311dd53ea79bcd4fb022c64911c8" +checksum = "66c99696f6c9dd7f35d486b9d04d7e6e202aa3e8c40d553f2fdf5e7e0c6a71ef" dependencies = [ "libc", ] @@ -985,17 +705,7 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "crossbeam-channel" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b153fe7cbef478c567df0f972e02e6d736db11affe43dfc9c56a9374d1adfb87" -dependencies = [ - "crossbeam-utils 0.7.2", - "maybe-uninit", + "cfg-if", ] [[package]] @@ -1004,8 +714,8 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" dependencies = [ - "cfg-if 1.0.0", - "crossbeam-utils 0.8.5", + "cfg-if", + "crossbeam-utils", ] [[package]] @@ -1014,19 +724,8 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b10ddc024425c88c2ad148c1b0fd53f4c6d38db9697c9f1588381212fa657c9" dependencies = [ - "cfg-if 1.0.0", - "crossbeam-utils 0.8.5", -] - -[[package]] -name = "crossbeam-utils" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" -dependencies = [ - "autocfg", - "cfg-if 0.1.10", - "lazy_static", + "cfg-if", + "crossbeam-utils", ] [[package]] @@ -1035,7 +734,7 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "lazy_static", ] @@ -1049,16 +748,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "ctor" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e98e2ad1a782e33928b96fc3948e7c355e5af34ba4de7670fe8bac2a3b2006d" -dependencies = [ - "quote", - "syn", -] - [[package]] name = "ctr" version = "0.6.0" @@ -1068,38 +757,14 @@ dependencies = [ "cipher", ] -[[package]] -name = "darling" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d706e75d87e35569db781a9b5e2416cff1236a47ed380831f959382ccd5f858" -dependencies = [ - "darling_core 0.10.2", - "darling_macro 0.10.2", -] - [[package]] name = "darling" version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f2c43f534ea4b0b049015d00269734195e6d3f0f6635cb692251aca6f9f8b3c" dependencies = [ - "darling_core 0.12.4", - "darling_macro 0.12.4", -] - -[[package]] -name = "darling_core" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c960ae2da4de88a91b2d920c2a7233b400bc33cb28453a2987822d8392519b" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.9.3", - "syn", + "darling_core", + "darling_macro", ] [[package]] @@ -1112,18 +777,7 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.10.0", - "syn", -] - -[[package]] -name = "darling_macro" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" -dependencies = [ - "darling_core 0.10.2", - "quote", + "strsim", "syn", ] @@ -1133,7 +787,7 @@ version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29b5acf0dea37a7f66f7b25d2c5e93fd46f8f6968b1a5d7a3e02e97768afc95a" dependencies = [ - "darling_core 0.12.4", + "darling_core", "quote", "syn", ] @@ -1144,19 +798,6 @@ version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" -[[package]] -name = "derive_builder" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2658621297f2cf68762a6f7dc0bb7e1ff2cfd6583daef8ee0fed6f7ec468ec0" -dependencies = [ - "darling 0.10.2", - "derive_builder_core 0.9.0", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "derive_builder" version = "0.10.2" @@ -1166,25 +807,13 @@ dependencies = [ "derive_builder_macro", ] -[[package]] -name = "derive_builder_core" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2791ea3e372c8495c0bc2033991d76b512cd799d07491fbd6890124db9458bef" -dependencies = [ - "darling 0.10.2", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "derive_builder_core" version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "66e616858f6187ed828df7c64a6d71720d83767a7f19740b2d1b6fe6327b36e5" dependencies = [ - "darling 0.12.4", + "darling", "proc-macro2", "quote", "syn", @@ -1196,7 +825,7 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58a94ace95092c5acb1e97a7e846b310cfbd499652f72297da7493f618a98d73" dependencies = [ - "derive_builder_core 0.10.2", + "derive_builder_core", "syn", ] @@ -1221,6 +850,26 @@ dependencies = [ "generic-array", ] +[[package]] +name = "dirs" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30baa043103c9d0c2a57cf537cc2f35623889dc0d405e6c3cccfadbc81c71309" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03d86534ed367a67548dc68113a0f5db55432fdfbb6e6f9d77704397d95d5780" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + [[package]] name = "discard" version = "1.0.4" @@ -1254,19 +903,7 @@ version = "0.8.28" source = "registry+https://github.com/rust-lang/crates.io-index" 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]] @@ -1282,12 +919,6 @@ dependencies = [ "termcolor", ] -[[package]] -name = "event-listener" -version = "2.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7531096570974c3a9dcf9e4b8e1cede1ec26cf5046219fb3b9d897503b9be59" - [[package]] name = "fastrand" version = "1.4.1" @@ -1303,10 +934,10 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d34cfa13a63ae058bfa601fe9e313bbdb3746427c1459185464ce0fcf62e1e8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "redox_syscall", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1315,7 +946,7 @@ version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd3aec53de10fe96d7d8c565eb17f2c687bb5518a2ec453b5b1252964526abe0" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crc32fast", "libc", "miniz_oxide", @@ -1352,22 +983,6 @@ dependencies = [ "percent-encoding", ] -[[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 = "funty" version = "1.1.0" @@ -1432,21 +1047,6 @@ version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acc499defb3b348f8d8f3f66415835a9131856ff7714bf10dadfc4ec4bdb29a1" -[[package]] -name = "futures-lite" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" -dependencies = [ - "fastrand", - "futures-core", - "futures-io", - "memchr", - "parking", - "pin-project-lite 0.2.6", - "waker-fn", -] - [[package]] name = "futures-macro" version = "0.3.15" @@ -1486,22 +1086,13 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite 0.2.6", + "pin-project-lite", "pin-utils", "proc-macro-hack", "proc-macro-nested", "slab", ] -[[package]] -name = "fxhash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -dependencies = [ - "byteorder", -] - [[package]] name = "generic-array" version = "0.14.4" @@ -1518,7 +1109,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "wasi 0.9.0+wasi-snapshot-preview1", ] @@ -1529,7 +1120,7 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "wasi 0.10.2+wasi-snapshot-preview1", ] @@ -1544,26 +1135,13 @@ dependencies = [ "polyval", ] -[[package]] -name = "gloo-timers" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47204a46aaff920a1ea58b11d03dec6f704287d27561724a4631e450654a891f" -dependencies = [ - "futures-channel", - "futures-core", - "js-sys", - "wasm-bindgen", - "web-sys", -] - [[package]] name = "h2" -version = "0.2.7" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e4728fd124914ad25e99e3d15a9361a879f6620f63cb56bbb08f95abb97a535" +checksum = "825343c4eef0b63f541f8903f395dc5beb362a979b5799a84062527ef1e37726" dependencies = [ - "bytes 0.5.6", + "bytes", "fnv", "futures-core", "futures-sink", @@ -1571,26 +1149,25 @@ dependencies = [ "http", "indexmap", "slab", - "tokio 0.2.25", + "tokio", "tokio-util", "tracing", - "tracing-futures", ] [[package]] name = "hashbrown" -version = "0.9.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" dependencies = [ - "ahash 0.4.7", + "ahash", ] [[package]] name = "hashlink" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d99cf782f0dc4372d26846bec3de7804ceb5df083c2d4462c0b8d2330e894fa8" +checksum = "7249a3129cbc1ffccd74857f81464a323a152173cdb134e0fd81bc803b29facf" dependencies = [ "hashbrown", ] @@ -1606,9 +1183,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.1.18" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" dependencies = [ "libc", ] @@ -1645,7 +1222,7 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2456aef2e6b6a9784192ae780c0f15bc57df0e918585282325e8c8ac27737654" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1656,7 +1233,7 @@ checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" dependencies = [ "libc", "match_cfg", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1679,7 +1256,7 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "527e8c9ac747e28542699a951517aa9a6945af506cd1f2e1b53a576c17b6cc11" dependencies = [ - "bytes 1.0.1", + "bytes", "fnv", "itoa", ] @@ -1730,9 +1307,9 @@ checksum = "1f7280c75fb2e2fc47080ec80ccc481376923acb04501957fc38f935c3de5088" [[package]] name = "indexmap" -version = "1.6.2" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824845a0bf897a9042383849b02c1bc219c2383772efcd5c6f9766fa4b81aef3" +checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" dependencies = [ "autocfg", "hashbrown", @@ -1744,28 +1321,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 0.3.19", - "widestring", - "winapi 0.3.9", - "winreg", + "cfg-if", ] [[package]] @@ -1780,6 +1336,15 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9028f49264629065d057f340a86acb84867925865f73bbf8d47b4d149a7e88b8" +[[package]] +name = "jobserver" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "972f5ae5d1cb9c6ae417789196c803205313edde988685da5e3aae0827b9e7fd" +dependencies = [ + "libc", +] + [[package]] name = "js-sys" version = "0.3.51" @@ -1789,30 +1354,11 @@ 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 = "kv-log-macro" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" -dependencies = [ - "log", -] - [[package]] name = "language-tags" -version = "0.2.2" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" +checksum = "d4345964bb142484797b161f473a503a434de77149dd8c7427788c6e13379388" [[package]] name = "lazy_static" @@ -1827,7 +1373,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d8697ded52353bdd6fec234b3135972433397e86d0493d9fc38fbf407b7c106a" dependencies = [ "async-trait", - "base64 0.13.0", + "base64", "fastrand", "futures-io", "futures-util", @@ -1841,7 +1387,7 @@ dependencies = [ "quoted_printable", "r2d2", "regex", - "tokio 1.7.1", + "tokio", "tokio-native-tls", ] @@ -1853,7 +1399,7 @@ checksum = "6607c62aa161d23d17a9072cc5da0be67cdfc89d3afb1e8d9c842bebc2525ffe" dependencies = [ "arrayvec", "bitflags", - "cfg-if 1.0.0", + "cfg-if", "ryu", "static_assertions", ] @@ -1867,19 +1413,19 @@ checksum = "12b8adadd720df158f4d70dfe7ccc6adb0472d7c55ca83445f6a5ab3e36f8fb6" [[package]] name = "libmcaptcha" version = "0.1.4" -source = "git+https://github.com/mCaptcha/libmcaptcha?branch=master#52b7ebe4ca1263ad163ef6f36dcfaaa69610e637" +source = "git+https://github.com/mCaptcha/libmcaptcha?branch=master#60107a2b6f5b1b80c7351a42e05c8c0c6cdbf5de" dependencies = [ "actix", - "derive_builder 0.9.0", + "derive_builder", "derive_more", "log", "pow_sha256", "pretty_env_logger", - "rand 0.8.3", + "rand 0.8.4", "redis", "serde 1.0.126", "serde_json", - "tokio 0.2.25", + "tokio", ] [[package]] @@ -1888,6 +1434,24 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" +[[package]] +name = "local-channel" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6246c68cf195087205a0512559c97e15eaf95198bf0e206d662092cdcb03fe9f" +dependencies = [ + "futures-core", + "futures-sink", + "futures-util", + "local-waker", +] + +[[package]] +name = "local-waker" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84f9a2d3e27ce99ce2c3aad0b09b1a7b916293ea9b2bf624c13fe646fadd8da4" + [[package]] name = "lock_api" version = "0.4.4" @@ -1903,17 +1467,7 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" dependencies = [ - "cfg-if 1.0.0", - "value-bag", -] - -[[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]] @@ -1966,12 +1520,6 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" -[[package]] -name = "maybe-uninit" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" - [[package]] name = "mcaptcha" version = "0.1.0" @@ -1983,11 +1531,11 @@ dependencies = [ "actix-rt", "actix-service", "actix-web", - "actix-web-codegen 0.5.0-beta.2", + "actix-web-codegen 0.5.0-beta.3 (git+https://github.com/realaravinth/actix-web)", "argon2-creds", "cache-buster", "config", - "derive_builder 0.10.2", + "derive_builder", "derive_more", "futures", "lazy_static", @@ -1998,7 +1546,7 @@ dependencies = [ "mime_guess", "pow_sha256", "pretty_env_logger", - "rand 0.8.3", + "rand 0.8.4", "rust-embed", "sailfish", "serde 1.0.126", @@ -2053,25 +1601,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "mio" -version = "0.6.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" -dependencies = [ - "cfg-if 0.1.10", - "fuchsia-zircon", - "fuchsia-zircon-sys", - "iovec", - "kernel32-sys", - "libc", - "log", - "miow 0.2.2", - "net2", - "slab", - "winapi 0.2.8", -] - [[package]] name = "mio" version = "0.7.13" @@ -2080,32 +1609,9 @@ checksum = "8c2bdb6314ec10835cd3293dd268473a835c02b7b352e788be788b3c6ca6bb16" dependencies = [ "libc", "log", - "miow 0.3.7", + "miow", "ntapi", - "winapi 0.3.9", -] - -[[package]] -name = "mio-uds" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afcb699eb26d4332647cc848492bbc15eafb26f08d0304550d5aa1f612e066f0" -dependencies = [ - "iovec", - "libc", - "mio 0.6.23", -] - -[[package]] -name = "miow" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" -dependencies = [ - "kernel32-sys", - "net2", - "winapi 0.2.8", - "ws2_32-sys", + "winapi", ] [[package]] @@ -2114,7 +1620,7 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2135,17 +1641,6 @@ dependencies = [ "tempfile", ] -[[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", -] - [[package]] name = "new_debug_unreachable" version = "1.0.4" @@ -2182,7 +1677,7 @@ version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2284,9 +1779,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.7.2" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af8b08b04175473088b46763e51ee54da5f9a164bc162f615b91bc179dbf15a3" +checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" [[package]] name = "opaque-debug" @@ -2301,7 +1796,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "549430950c79ae24e6d02e0b7404534ecf311d94cc9f861e9e4020187d13d885" dependencies = [ "bitflags", - "cfg-if 1.0.0", + "cfg-if", "foreign-types", "libc", "once_cell", @@ -2327,12 +1822,6 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "parking" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" - [[package]] name = "parking_lot" version = "0.11.1" @@ -2350,29 +1839,26 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "instant", "libc", "redox_syscall", "smallvec", - "winapi 0.3.9", + "winapi", ] +[[package]] +name = "paste" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf547ad0c65e31259204bd90935776d1c693cec2f4ff7abb7a1bbbd40dfe58" + [[package]] name = "percent-encoding" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" -[[package]] -name = "pest" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53" -dependencies = [ - "ucd-trie", -] - [[package]] name = "phf" version = "0.8.0" @@ -2411,33 +1897,13 @@ dependencies = [ "siphasher", ] -[[package]] -name = "pin-project" -version = "0.4.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "918192b5c59119d51e0cd221f4d49dde9112824ba717369e903c97d076083d0f" -dependencies = [ - "pin-project-internal 0.4.28", -] - [[package]] name = "pin-project" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7509cc106041c40a4518d2af7a61530e1eed0e6285296a3d8c5472806ccc4a4" dependencies = [ - "pin-project-internal 1.0.7", -] - -[[package]] -name = "pin-project-internal" -version = "0.4.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be26700300be6d9d23264c73211d8190e755b6b5ca7a1b28230025511b52a5e" -dependencies = [ - "proc-macro2", - "quote", - "syn", + "pin-project-internal", ] [[package]] @@ -2453,15 +1919,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.1.12" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" - -[[package]] -name = "pin-project-lite" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc0e1f259c92177c30a4c9d177246edd0a3568b25756a977d0632cf8fa37e905" +checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" [[package]] name = "pin-utils" @@ -2475,19 +1935,6 @@ version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" -[[package]] -name = "polling" -version = "2.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fc12d774e799ee9ebae13f4076ca003b40d18a11ac0f3641e6f899618580b7b" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "log", - "wepoll-sys", - "winapi 0.3.9", -] - [[package]] name = "polyval" version = "0.4.5" @@ -2502,10 +1949,10 @@ dependencies = [ [[package]] name = "pow_sha256" version = "0.2.1" -source = "git+https://github.com/mcaptcha/pow_sha256#8df560aaa85530f7824070d7d9d839d8cf6d0411" +source = "git+https://github.com/mcaptcha/pow_sha256#807fa7c75284f6d8d488a6f66a3a1b3301f2f412" dependencies = [ "bincode", - "derive_builder 0.10.2", + "derive_builder", "num", "serde 1.0.126", "sha2", @@ -2632,14 +2079,14 @@ dependencies = [ [[package]] name = "rand" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e" +checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" dependencies = [ "libc", "rand_chacha 0.3.1", - "rand_core 0.6.2", - "rand_hc 0.3.0", + "rand_core 0.6.3", + "rand_hc 0.3.1", ] [[package]] @@ -2659,7 +2106,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.2", + "rand_core 0.6.3", ] [[package]] @@ -2673,9 +2120,9 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" dependencies = [ "getrandom 0.2.3", ] @@ -2691,11 +2138,11 @@ dependencies = [ [[package]] name = "rand_hc" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" +checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" dependencies = [ - "rand_core 0.6.2", + "rand_core 0.6.3", ] [[package]] @@ -2709,36 +2156,45 @@ dependencies = [ [[package]] name = "redis" -version = "0.17.0" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95357caf2640abc54651b93c98a8df4fe1ccbf44b8e601ccdf43d5c1451f29ac" +checksum = "d4f0ceb2ec0dd769483ecd283f6615aa83dcd0be556d5294c6e659caefe7cc54" dependencies = [ - "async-std", "async-trait", - "bytes 0.5.6", + "bytes", "combine", "crc16", "dtoa", "futures-util", "itoa", "percent-encoding", - "pin-project-lite 0.1.12", - "rand 0.7.3", + "pin-project-lite", + "rand 0.8.4", "sha1", - "tokio 0.2.25", + "tokio", "tokio-util", "url", ] [[package]] name = "redox_syscall" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "742739e41cd49414de871ea5e549afb7e2a3ac77b589bcbebe8c82fab37147fc" +checksum = "5ab49abadf3f9e1c4bc499e8845e152ad87d2ad2d30371841171169e9d75feee" dependencies = [ "bitflags", ] +[[package]] +name = "redox_users" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" +dependencies = [ + "getrandom 0.2.3", + "redox_syscall", +] + [[package]] name = "regex" version = "1.5.4" @@ -2762,17 +2218,7 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" dependencies = [ - "winapi 0.3.9", -] - -[[package]] -name = "resolv-conf" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" -dependencies = [ - "hostname", - "quick-error", + "winapi", ] [[package]] @@ -2787,7 +2233,7 @@ dependencies = [ "spin", "untrusted", "web-sys", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2796,10 +2242,10 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b18820d944b33caa75a71378964ac46f58517c92b6ae5f762636247c09e78fb" dependencies = [ - "base64 0.13.0", + "base64", "blake2b_simd", "constant_time_eq", - "crossbeam-utils 0.8.5", + "crossbeam-utils", ] [[package]] @@ -2847,16 +2293,16 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" dependencies = [ - "semver 0.9.0", + "semver", ] [[package]] name = "rustls" -version = "0.18.1" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d1126dcf58e93cee7d098dbda643b5f92ed724f1f6a63007c1116eed6700c81" +checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" dependencies = [ - "base64 0.12.3", + "base64", "log", "ring", "sct", @@ -2922,7 +2368,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" dependencies = [ "lazy_static", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2979,17 +2425,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" dependencies = [ - "semver-parser 0.7.0", -] - -[[package]] -name = "semver" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" -dependencies = [ - "semver-parser 0.10.2", - "serde 1.0.126", + "semver-parser", ] [[package]] @@ -2998,15 +2434,6 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" -[[package]] -name = "semver-parser" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" -dependencies = [ - "pest", -] - [[package]] name = "serde" version = "0.8.23" @@ -3088,7 +2515,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c4cfa741c5832d0ef7fab46cabed29c2aae926db0b11bb2069edd8db5e64e16" dependencies = [ "block-buffer", - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest", "opaque-debug", @@ -3107,7 +2534,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b362ae5752fd2137731f9fa25fd4d9058af34666ca1966fb969119cc35719f12" dependencies = [ "block-buffer", - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest", "opaque-debug", @@ -3140,17 +2567,6 @@ version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" -[[package]] -name = "socket2" -version = "0.3.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "122e570113d28d773067fab24266b66753f6ea915758651696b6e35e49f88d6e" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "winapi 0.3.9", -] - [[package]] name = "socket2" version = "0.4.0" @@ -3158,7 +2574,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e3dfc207c526015c632472a77be09cf1b6e46866581aecae5cc38fb4235dea2" dependencies = [ "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -3182,9 +2598,9 @@ dependencies = [ [[package]] name = "sqlx" -version = "0.4.2" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1a98f9bf17b690f026b6fec565293a995b46dfbd6293debcb654dcffd2d1b34" +checksum = "ba82f79b31f30acebf19905bcd8b978f46891b9d0723f578447361a8910b6584" dependencies = [ "sqlx-core", "sqlx-macros", @@ -3192,20 +2608,21 @@ dependencies = [ [[package]] name = "sqlx-core" -version = "0.4.2" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36bb6a2ca3345a86493bc3b71eabc2c6c16a8bb1aa476cf5303bee27f67627d7" +checksum = "7f23af36748ec8ea8d49ef8499839907be41b0b1178a4e82b8cb45d29f531dc9" dependencies = [ - "ahash 0.6.3", + "ahash", "atoi", - "base64 0.13.0", + "base64", "bitflags", "byteorder", - "bytes 0.5.6", + "bytes", "crc", - "crossbeam-channel 0.5.1", + "crossbeam-channel", "crossbeam-queue", - "crossbeam-utils 0.8.5", + "crossbeam-utils", + "dirs", "either", "futures-channel", "futures-core", @@ -3221,9 +2638,10 @@ dependencies = [ "once_cell", "parking_lot", "percent-encoding", - "rand 0.7.3", + "rand 0.8.4", "rustls", "serde 1.0.126", + "serde_json", "sha-1", "sha2", "smallvec", @@ -3232,6 +2650,7 @@ dependencies = [ "stringprep", "thiserror", "time 0.2.27", + "tokio-stream", "url", "webpki", "webpki-roots", @@ -3240,17 +2659,16 @@ dependencies = [ [[package]] name = "sqlx-macros" -version = "0.4.2" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b5ada8b3b565331275ce913368565a273a74faf2a34da58c4dc010ce3286844" +checksum = "47e4a2349d1ffd60a03ca0de3f116ba55d7f406e55a0d84c64a5590866d94c06" dependencies = [ - "cargo_metadata", "dotenv", "either", "futures", "heck", "hex", - "lazy_static", + "once_cell", "proc-macro2", "quote", "serde 1.0.126", @@ -3264,14 +2682,13 @@ dependencies = [ [[package]] name = "sqlx-rt" -version = "0.2.0" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63fc5454c9dd7aaea3a0eeeb65ca40d06d0d8e7413a8184f7c3a3ffa5056190b" +checksum = "8199b421ecf3493ee9ef3e7bc90c904844cfb2ea7ea2f57347a93f52bfd3e057" dependencies = [ "actix-rt", - "actix-threadpool", "once_cell", - "tokio 0.2.25", + "tokio", "tokio-rustls", ] @@ -3374,12 +2791,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "strsim" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" - [[package]] name = "strsim" version = "0.10.0" @@ -3415,12 +2826,12 @@ version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", - "rand 0.8.3", + "rand 0.8.4", "redox_syscall", "remove_dir_all", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -3463,15 +2874,6 @@ dependencies = [ "syn", ] -[[package]] -name = "threadpool" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" -dependencies = [ - "num_cpus", -] - [[package]] name = "time" version = "0.1.43" @@ -3479,7 +2881,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" dependencies = [ "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -3494,7 +2896,7 @@ dependencies = [ "stdweb", "time-macros", "version_check", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -3535,29 +2937,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" -[[package]] -name = "tokio" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6703a273949a90131b290be1fe7b039d0fc884aa1935860dfcbe056f28cd8092" -dependencies = [ - "bytes 0.5.6", - "fnv", - "futures-core", - "iovec", - "lazy_static", - "libc", - "memchr", - "mio 0.6.23", - "mio-uds", - "num_cpus", - "pin-project-lite 0.1.12", - "signal-hook-registry", - "slab", - "tokio-macros", - "winapi 0.3.9", -] - [[package]] name = "tokio" version = "1.7.1" @@ -3565,25 +2944,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5fb2ed024293bb19f7a5dc54fe83bf86532a44c12a2bb8ba40d64a4509395ca2" dependencies = [ "autocfg", - "bytes 1.0.1", + "bytes", "libc", "memchr", - "mio 0.7.13", + "mio", + "num_cpus", "once_cell", - "pin-project-lite 0.2.6", + "parking_lot", + "pin-project-lite", "signal-hook-registry", - "winapi 0.3.9", -] - -[[package]] -name = "tokio-macros" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e44da00bfc73a25f814cd8d7e57a68a5c31b74b3152a0a1d1f590c97ed06265a" -dependencies = [ - "proc-macro2", - "quote", - "syn", + "winapi", ] [[package]] @@ -3593,34 +2963,43 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" dependencies = [ "native-tls", - "tokio 1.7.1", + "tokio", ] [[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 0.2.25", + "tokio", "webpki", ] [[package]] -name = "tokio-util" -version = "0.3.1" +name = "tokio-stream" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499" +checksum = "f8864d706fdb3cc0843a49647ac892720dac98a6eeb818b77190592cf4994066" dependencies = [ - "bytes 0.5.6", "futures-core", - "futures-io", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1caa0b0c8d94a049db56b5acf8cba99dc0623aab1b26d5b5f5e2d945846b3592" +dependencies = [ + "bytes", + "futures-core", "futures-sink", "log", - "pin-project-lite 0.1.12", - "tokio 0.2.25", + "pin-project-lite", + "tokio", ] [[package]] @@ -3638,9 +3017,8 @@ version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d" dependencies = [ - "cfg-if 1.0.0", - "log", - "pin-project-lite 0.2.6", + "cfg-if", + "pin-project-lite", "tracing-core", ] @@ -3653,67 +3031,12 @@ dependencies = [ "lazy_static", ] -[[package]] -name = "tracing-futures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" -dependencies = [ - "pin-project 1.0.7", - "tracing", -] - -[[package]] -name = "trust-dns-proto" -version = "0.19.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cad71a0c0d68ab9941d2fb6e82f8fb2e86d9945b94e1661dd0aaea2b88215a9" -dependencies = [ - "async-trait", - "cfg-if 1.0.0", - "enum-as-inner", - "futures", - "idna", - "lazy_static", - "log", - "rand 0.7.3", - "smallvec", - "thiserror", - "tokio 0.2.25", - "url", -] - -[[package]] -name = "trust-dns-resolver" -version = "0.19.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "710f593b371175db53a26d0b38ed2978fafb9e9e8d3868b1acd753ea18df0ceb" -dependencies = [ - "cfg-if 0.1.10", - "futures", - "ipconfig", - "lazy_static", - "log", - "lru-cache", - "resolv-conf", - "smallvec", - "thiserror", - "tokio 0.2.25", - "trust-dns-proto", -] - [[package]] name = "typenum" version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "879f6906492a7cd215bfa4cf595b600146ccfac0c79bcbd1f3000162af5e8b06" -[[package]] -name = "ucd-trie" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" - [[package]] name = "unicase" version = "2.6.0" @@ -3795,9 +3118,9 @@ checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" [[package]] name = "validator" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be110dc66fa015b8b1d2c4eae40c495a27fae55f82b9cae3efb8178241ed20eb" +checksum = "6d0f08911ab0fee2c5009580f04615fa868898ee57de10692a45da0c3bcc3e5e" dependencies = [ "idna", "lazy_static", @@ -3812,9 +3135,9 @@ dependencies = [ [[package]] name = "validator_derive" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f14fe757e2894ce4271991901567be07fbc3eac6b24246122214e1d5a16554" +checksum = "d85135714dba11a1bd0b3eb1744169266f1a38977bf4e3ff5e2e1acb8c2b7eee" dependencies = [ "if_chain", "lazy_static", @@ -3828,18 +3151,12 @@ dependencies = [ [[package]] name = "validator_types" -version = "0.12.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad9680608df133af2c1ddd5eaf1ddce91d60d61b6bc51494ef326458365a470a" - -[[package]] -name = "value-bag" -version = "1.0.0-alpha.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd320e1520f94261153e96f7534476ad869c14022aee1e59af7c778075d840ae" +checksum = "ded9d97e1d42327632f5f3bae6403c04886e2de3036261ef42deebd931a6a291" dependencies = [ - "ctor", - "version_check", + "proc-macro2", + "syn", ] [[package]] @@ -3854,12 +3171,6 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" -[[package]] -name = "waker-fn" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" - [[package]] name = "walkdir" version = "2.3.2" @@ -3867,7 +3178,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" dependencies = [ "same-file", - "winapi 0.3.9", + "winapi", "winapi-util", ] @@ -3889,7 +3200,7 @@ version = "0.2.74" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d54ee1d4ed486f78874278e63e4069fc1ab9f6a18ca492076ffb90c5eb2997fd" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "wasm-bindgen-macro", ] @@ -3908,18 +3219,6 @@ dependencies = [ "wasm-bindgen-shared", ] -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fba7978c679d53ce2d0ac80c8c175840feb849a161664365d1287b41f2e67f1" -dependencies = [ - "cfg-if 1.0.0", - "js-sys", - "wasm-bindgen", - "web-sys", -] - [[package]] name = "wasm-bindgen-macro" version = "0.2.74" @@ -3978,15 +3277,6 @@ dependencies = [ "webpki", ] -[[package]] -name = "wepoll-sys" -version = "3.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcb14dea929042224824779fbc82d9fab8d2e6d3cbc0ac404de8edf489e77ff" -dependencies = [ - "cc", -] - [[package]] name = "whoami" version = "1.1.2" @@ -3997,18 +3287,6 @@ dependencies = [ "web-sys", ] -[[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" @@ -4019,12 +3297,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" @@ -4037,7 +3309,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -4046,25 +3318,6 @@ 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", -] - [[package]] name = "wyz" version = "0.2.0" @@ -4091,3 +3344,32 @@ checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" dependencies = [ "linked-hash-map", ] + +[[package]] +name = "zstd" +version = "0.7.0+zstd.1.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9428752481d8372e15b1bf779ea518a179ad6c771cca2d2c60e4fbff3cc2cd52" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "3.1.0+zstd.1.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa1926623ad7fe406e090555387daf73db555b948134b4d73eac5eb08fb666d" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "1.5.0+zstd.1.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e6c094340240369025fc6b731b054ee2a834328fa584310ac96aa4baebdc465" +dependencies = [ + "cc", + "libc", +] diff --git a/Cargo.toml b/Cargo.toml index 0e02eacb..9c67af2b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,27 +22,31 @@ name = "tests-migrate" path = "./src/tests-migrate.rs" [dependencies] -actix-web = "3.3.2" -actix = "0.10" -actix-identity = "0.3" -actix-http = "2.2" -actix-rt = "1" -actix-cors= "0.5.4" -actix-service = "1.0.6" +#actix-web = "3.3.2" +actix-web = "4.0.0-beta.8" +actix = "0.12" +#actix-identity = "0.3" +actix-identity = "0.4.0-beta.2" +actix-http = "3.0.0-beta.8" +#actix-http = "2.2" +actix-rt = "2" +#actix-cors= "0.5.4" +actix-cors = "0.6.0-beta.2" +#actix-service = "0.0.6" +actix-service = "2.0.0" my-codegen = {package = "actix-web-codegen", git ="https://github.com/realaravinth/actix-web"} - mime_guess = "2.0.3" rust-embed = "5.9.0" cache-buster = { version = "0.2.0", git = "https://github.com/realaravinth/cache-buster" } -futures = "0.3.14" +futures = "0.3.15" -sqlx = { version = "0.4.0", features = [ "runtime-actix-rustls", "postgres", "time", "offline" ] } +sqlx = { version = "0.5.5", features = [ "runtime-actix-rustls", "postgres", "time", "offline" ] } argon2-creds = { branch = "master", git = "https://github.com/realaravinth/argon2-creds"} #argon2-creds = { version="*", path = "../../argon2-creds/" } config = "0.11" -validator = { version = "0.13", features = ["derive"]} +validator = { version = "0.14", features = ["derive"]} derive_builder = "0.10" derive_more = "0.99" @@ -59,7 +63,6 @@ log = "0.4" lazy_static = "1.4" -# m_captcha = { version = "0.1.2", git = "https://github.com/mCaptcha/mCaptcha" } libmcaptcha = { branch = "master", git = "https://github.com/mCaptcha/libmcaptcha", features = ["full"] } #libmcaptcha = { path = "../libmcaptcha", features = ["full"]} diff --git a/config/default.toml b/config/default.toml index 41ac2e3d..8c6acce8 100644 --- a/config/default.toml +++ b/config/default.toml @@ -49,8 +49,9 @@ pool = 4 url = "redis://127.0.0.1" pool = 4 -#[smtp] -#from = "admin@domain.com" -#url = "smtp.domain.com" -#username = "admin" -#password = "password" +[smtp] +from = "admin@localhost" +reply_to = "admin@localhost" +url = "localhost:10025" +username = "admin" +password = "password" diff --git a/src/api/v1/auth.rs b/src/api/v1/auth.rs index 83ce9a4d..508d1b57 100644 --- a/src/api/v1/auth.rs +++ b/src/api/v1/auth.rs @@ -226,7 +226,6 @@ async fn signout(id: Identity) -> impl Responder { id.forget(); } HttpResponse::Found() - .header(header::LOCATION, "/login") + .append_header((header::LOCATION, "/login")) .finish() - .into_body() } diff --git a/src/api/v1/notifications/get.rs b/src/api/v1/notifications/get.rs index 904bb7d8..0ef9f830 100644 --- a/src/api/v1/notifications/get.rs +++ b/src/api/v1/notifications/get.rs @@ -24,11 +24,11 @@ use crate::errors::*; use crate::AppData; pub struct Notification { - pub name: String, - pub heading: String, - pub message: String, - pub received: OffsetDateTime, - pub id: i32, + pub name: Option, + pub heading: Option, + pub message: Option, + pub received: Option, + pub id: Option, } #[derive(Deserialize, Serialize)] @@ -43,11 +43,11 @@ pub struct NotificationResp { impl From for NotificationResp { fn from(n: Notification) -> Self { NotificationResp { - name: n.name, - heading: n.heading, - received: n.received.unix_timestamp(), - id: n.id, - message: n.message, + name: n.name.unwrap(), + heading: n.heading.unwrap(), + received: n.received.unwrap().unix_timestamp(), + id: n.id.unwrap(), + message: n.message.unwrap(), } } } diff --git a/src/api/v1/pow/get_config.rs b/src/api/v1/pow/get_config.rs index b6087b10..cc95f39a 100644 --- a/src/api/v1/pow/get_config.rs +++ b/src/api/v1/pow/get_config.rs @@ -161,7 +161,7 @@ mod tests { #[test] fn feature() { - actix_rt::System::new("trest") + actix_rt::System::new() .block_on(async move { get_pow_config_works().await }); } diff --git a/src/docs.rs b/src/docs.rs index dfce3059..d0f6f13b 100644 --- a/src/docs.rs +++ b/src/docs.rs @@ -62,7 +62,7 @@ pub fn handle_embedded_file(path: &str) -> HttpResponse { Cow::Owned(bytes) => bytes.into(), }; HttpResponse::Ok() - .set(header::CacheControl(vec![header::CacheDirective::MaxAge( + .insert_header(header::CacheControl(vec![header::CacheDirective::MaxAge( CACHE_AGE, )])) .content_type(from_path(path).first_or_octet_stream().as_ref()) @@ -73,7 +73,7 @@ pub fn handle_embedded_file(path: &str) -> HttpResponse { } async fn dist(path: web::Path) -> impl Responder { - handle_embedded_file(&path.0) + handle_embedded_file(&path) } async fn spec() -> HttpResponse { @@ -101,7 +101,7 @@ mod tests { let mut app = test::init_service( App::new() .wrap(actix_middleware::NormalizePath::new( - actix_middleware::normalize::TrailingSlash::Trim, + actix_middleware::TrailingSlash::Trim, )) .configure(services), ) diff --git a/src/email/verification.rs b/src/email/verification.rs index 3768156e..7b3f7b06 100644 --- a/src/email/verification.rs +++ b/src/email/verification.rs @@ -19,57 +19,92 @@ use lettre::{ message::{header, MultiPart, SinglePart}, AsyncTransport, Message, }; +use sailfish::TemplateOnce; -use crate::AppData; +use crate::errors::*; +use crate::Data; use crate::SETTINGS; -// The html we want to send. -const HTML: &str = r#" - - - - - Hello from Lettre! - - -
-

Hello from Lettre!

-

A mailer library for Rust

-
- -"#; +const PAGE: &str = "Login"; -async fn verification(data: &AppData) { +#[derive(Clone, TemplateOnce)] +#[template(path = "email/verification/index.html")] +struct IndexPage<'a> { + verification_link: &'a str, +} + +impl<'a> IndexPage<'a> { + fn new(verification_link: &'a str) -> Self { + Self { verification_link } + } +} + +async fn verification( + data: &Data, + to: &str, + verification_link: &str, +) -> ServiceResult<()> { if let Some(smtp) = SETTINGS.smtp.as_ref() { let from = format!("mCaptcha Admin <{}>", smtp.from); + let reply_to = format!("mCaptcha Admin <{}>", smtp.reply_to); const SUBJECT: &str = "[mCaptcha] Please verify your email"; + let plain_text = format!( + " +Welcome to mCaptcha! + +Please verify your email address to continue. + +VERIFICATION LINK: {} + +Please ignore this email if you weren't expecting it. + +With best regards, +Admin +instance: {} +project website: {}", + verification_link, + SETTINGS.server.domain, + crate::PKG_HOMEPAGE + ); + + let html = IndexPage::new(verification_link).render_once().unwrap(); + let email = Message::builder() .from(from.parse().unwrap()) - .reply_to("Yuin ".parse().unwrap()) - .to("Hei ".parse().unwrap()) + .reply_to(reply_to.parse().unwrap()) + .to(to.parse().unwrap()) .subject(SUBJECT) .multipart( MultiPart::alternative() // This is composed of two parts. .singlepart( SinglePart::builder() .header(header::ContentType::TEXT_PLAIN) - .body(String::from( - "Hello from Lettre! A mailer library for Rust", - )), // Every message should have a plain text fallback. + .body(plain_text), // Every message should have a plain text fallback. ) .singlepart( SinglePart::builder() .header(header::ContentType::TEXT_HTML) - .body(String::from(HTML)), + .body(html), ), ) .unwrap(); // unwrap is OK as SETTINGS.smtp is check at the start - match data.mailer.as_ref().unwrap().send(email).await { - Ok(_) => println!("Email sent successfully!"), - Err(e) => panic!("Could not send email: {:?}", e), - } + data.mailer.as_ref().unwrap().send(email).await?; + } + Ok(()) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[actix_rt::test] + async fn email_verification_works() { + const TO_ADDR: &str = "Hello "; + const VERIFICATION_LINK: &str = "https://localhost"; + let data = Data::new().await; + verification(&data, TO_ADDR, VERIFICATION_LINK).await.unwrap(); } } diff --git a/src/errors.rs b/src/errors.rs index da5fda5d..4cad0803 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -18,18 +18,28 @@ use std::convert::From; use actix_web::{ - dev::HttpResponseBuilder, + dev::BaseHttpResponseBuilder as HttpResponseBuilder, error::ResponseError, http::{header, StatusCode}, HttpResponse, }; use argon2_creds::errors::CredsError; use derive_more::{Display, Error}; +use lettre::transport::smtp::Error as SmtpError; use libmcaptcha::errors::CaptchaError; use serde::{Deserialize, Serialize}; use url::ParseError; use validator::ValidationErrors; +#[derive(Debug, Display, Error)] +pub struct SmtpErrorWrapper(SmtpError); + +impl std::cmp::PartialEq for SmtpErrorWrapper { + fn eq(&self, other: &Self) -> bool { + self.0.status() == other.0.status() + } +} + #[derive(Debug, Display, PartialEq, Error)] #[cfg(not(tarpaulin_include))] pub enum ServiceError { @@ -81,6 +91,10 @@ pub enum ServiceError { #[display(fmt = "Email not available")] EmailTaken, + /// Unable to send email + #[display(fmt = "Unable to send email, contact admin")] + UnableToSendEmail(SmtpErrorWrapper), + /// when the a token name is already taken /// token not found #[display(fmt = "Token not found. Is token registered?")] @@ -101,10 +115,14 @@ impl ResponseError for ServiceError { #[cfg(not(tarpaulin_include))] fn error_response(&self) -> HttpResponse { HttpResponseBuilder::new(self.status_code()) - .set_header(header::CONTENT_TYPE, "application/json; charset=UTF-8") - .json(ErrorToResponse { - error: self.to_string(), - }) + .append_header((header::CONTENT_TYPE, "application/json; charset=UTF-8")) + .body( + serde_json::to_string(&ErrorToResponse { + error: self.to_string(), + }) + .unwrap(), + ) + .into() } #[cfg(not(tarpaulin_include))] @@ -130,10 +148,18 @@ impl ResponseError for ServiceError { ServiceError::EmailTaken => StatusCode::BAD_REQUEST, ServiceError::TokenNotFound => StatusCode::NOT_FOUND, - ServiceError::CaptchaError(e) => match e { - CaptchaError::MailboxError => StatusCode::INTERNAL_SERVER_ERROR, - _ => StatusCode::BAD_REQUEST, - }, + ServiceError::CaptchaError(e) => { + log::error!("{}", e); + match e { + CaptchaError::MailboxError => StatusCode::INTERNAL_SERVER_ERROR, + _ => StatusCode::BAD_REQUEST, + } + } + + ServiceError::UnableToSendEmail(e) => { + log::error!("{}", e.0); + StatusCode::INTERNAL_SERVER_ERROR + } } } } @@ -189,6 +215,14 @@ impl From for ServiceError { } } +#[cfg(not(tarpaulin_include))] +impl From for ServiceError { + #[cfg(not(tarpaulin_include))] + fn from(e: SmtpError) -> Self { + ServiceError::UnableToSendEmail(SmtpErrorWrapper(e)) + } +} + #[cfg(not(tarpaulin_include))] pub type ServiceResult = std::result::Result; @@ -223,10 +257,10 @@ impl ResponseError for PageError { use crate::PAGES; match self.status_code() { StatusCode::INTERNAL_SERVER_ERROR => HttpResponse::Found() - .header(header::LOCATION, PAGES.errors.internal_server_error) + .append_header((header::LOCATION, PAGES.errors.internal_server_error)) .finish(), _ => HttpResponse::Found() - .header(header::LOCATION, PAGES.errors.unknown_error) + .append_header((header::LOCATION, PAGES.errors.unknown_error)) .finish(), } } diff --git a/src/main.rs b/src/main.rs index ace81308..e0884248 100644 --- a/src/main.rs +++ b/src/main.rs @@ -105,6 +105,7 @@ async fn main() -> std::io::Result<()> { let data = Data::new().await; sqlx::migrate!("./migrations/").run(&data.db).await.unwrap(); + let data = actix_web::web::Data::new(data); println!("Starting server on: http://{}", SETTINGS.server.get_ip()); @@ -117,9 +118,9 @@ async fn main() -> std::io::Result<()> { ) .wrap(get_identity_service()) .wrap(actix_middleware::Compress::default()) - .data(data.clone()) + .app_data(data.clone()) .wrap(actix_middleware::NormalizePath::new( - actix_middleware::normalize::TrailingSlash::Trim, + actix_middleware::TrailingSlash::Trim, )) .configure(v1::services) .configure(widget::services) @@ -149,7 +150,7 @@ pub fn get_identity_service() -> IdentityService { CookieIdentityPolicy::new(cookie_secret.as_bytes()) .name("Authorization") //TODO change cookie age - .max_age(216000) + .max_age_secs(216000) .domain(&SETTINGS.server.domain) .secure(false), ) diff --git a/src/middleware/auth.rs b/src/middleware/auth.rs index e1aa22f6..c702da0d 100644 --- a/src/middleware/auth.rs +++ b/src/middleware/auth.rs @@ -16,8 +16,9 @@ */ #![allow(clippy::type_complexity)] -use std::task::{Context, Poll}; +//use std::task::{Context, Poll}; +use actix_http::body::AnyBody; use actix_identity::Identity; use actix_service::{Service, Transform}; use actix_web::dev::{ServiceRequest, ServiceResponse}; @@ -29,13 +30,12 @@ use crate::PAGES; pub struct CheckLogin; -impl Transform for CheckLogin +impl Transform for CheckLogin where - S: Service, Error = Error>, + S: Service, Error = Error>, S::Future: 'static, { - type Request = ServiceRequest; - type Response = ServiceResponse; + type Response = ServiceResponse; type Error = Error; type Transform = CheckLoginMiddleware; type InitError = (); @@ -49,21 +49,41 @@ pub struct CheckLoginMiddleware { service: S, } -impl Service for CheckLoginMiddleware +impl Service for CheckLoginMiddleware where - S: Service, Error = Error>, + S: Service, Error = Error>, S::Future: 'static, { - type Request = ServiceRequest; - type Response = ServiceResponse; + type Response = ServiceResponse; type Error = Error; type Future = Either>>; - fn poll_ready(&mut self, cx: &mut Context) -> Poll> { - self.service.poll_ready(cx) - } + // fn poll_ready(&mut self, cx: &mut Context) -> Poll> { + // self.service.poll_ready(cx) + // } + // + actix_service::forward_ready!(service); + + fn call(&self, req: ServiceRequest) -> Self::Future { + // let (r, mut pl) = req.into_parts(); + + // // TODO investigate when the bellow statement will + // // return error + // if let Ok(Some(_)) = Identity::from_request(&r, &mut pl) + // .into_inner() + // .map(|x| x.identity()) + // { + // let req = ServiceRequest::from_parts(r, pl); + // Either::Left(self.service.call(req)) + // } else { + // let resp = actix_http::ResponseBuilder::new(http::StatusCode::FOUND) + // .insert_header((http::header::LOCATION, PAGES.auth.login)) + // .finish(); + + // let req = ServiceRequest::from_parts(r, pl); + // Either::Right(ok(req.into_response(resp))) + // } - fn call(&mut self, req: ServiceRequest) -> Self::Future { let (r, mut pl) = req.into_parts(); // TODO investigate when the bellow statement will @@ -72,15 +92,14 @@ where .into_inner() .map(|x| x.identity()) { - let req = ServiceRequest::from_parts(r, pl).ok().unwrap(); + let req = ServiceRequest::from_parts(r, pl); Either::Left(self.service.call(req)) } else { - let req = ServiceRequest::from_parts(r, pl).ok().unwrap(); + let req = ServiceRequest::from_parts(r, pl); //.ok().unwrap(); Either::Right(ok(req.into_response( HttpResponse::Found() - .header(http::header::LOCATION, PAGES.auth.login) - .finish() - .into_body(), + .insert_header((http::header::LOCATION, PAGES.auth.login)) + .finish(), ))) } } diff --git a/src/pages/errors.rs b/src/pages/errors.rs index 9495c473..54784034 100644 --- a/src/pages/errors.rs +++ b/src/pages/errors.rs @@ -50,7 +50,7 @@ lazy_static! { } async fn error(path: web::Path) -> impl Responder { - let resp = match path.0 { + let resp = match path.into_inner() { 500 => HttpResponse::InternalServerError() .content_type("text/html; charset=utf-8") .body(&*INTERNAL_SERVER_ERROR_BODY), diff --git a/src/pages/mod.rs b/src/pages/mod.rs index 05ebc0ba..9e7d64c8 100644 --- a/src/pages/mod.rs +++ b/src/pages/mod.rs @@ -54,14 +54,8 @@ mod tests { let (data, _, signin_resp) = register_and_signin(NAME, EMAIL, PASSWORD).await; let cookies = get_cookie!(signin_resp); - let mut app = test::init_service( - App::new() - .wrap(get_identity_service()) - .configure(crate::api::v1::services) - .configure(services) - .data(data.clone()), - ) - .await; + + let mut app = get_app!(data).await; let urls = vec![ PAGES.home, diff --git a/src/pages/panel/sitekey/view.rs b/src/pages/panel/sitekey/view.rs index 75fda7b4..e8244af1 100644 --- a/src/pages/panel/sitekey/view.rs +++ b/src/pages/panel/sitekey/view.rs @@ -66,7 +66,7 @@ pub async fn view_sitekey( id: Identity, ) -> PageResult { let username = id.identity().unwrap(); - let key = path.0; + let key = path.into_inner(); let config = sqlx::query_as!( McaptchaConfig, diff --git a/src/settings.rs b/src/settings.rs index 4241d382..8daf8ac8 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -41,6 +41,7 @@ pub struct Captcha { #[derive(Debug, Clone, Deserialize)] pub struct Smtp { pub from: String, + pub reply_to: String, pub url: String, pub username: String, pub password: String, diff --git a/src/static_assets/static_files.rs b/src/static_assets/static_files.rs index f04ddee4..ebaba401 100644 --- a/src/static_assets/static_files.rs +++ b/src/static_assets/static_files.rs @@ -37,7 +37,7 @@ fn handle_assets(path: &str) -> HttpResponse { }; HttpResponse::Ok() - .set(header::CacheControl(vec![ + .insert_header(header::CacheControl(vec![ header::CacheDirective::Public, header::CacheDirective::Extension("immutable".into(), None), header::CacheDirective::MaxAge(CACHE_AGE), @@ -51,7 +51,7 @@ fn handle_assets(path: &str) -> HttpResponse { #[get("/assets/{_:.*}")] pub async fn static_files(path: web::Path) -> impl Responder { - handle_assets(&path.0) + handle_assets(&path) } #[derive(RustEmbed)] @@ -67,7 +67,7 @@ fn handle_favicons(path: &str) -> HttpResponse { }; HttpResponse::Ok() - .set(header::CacheControl(vec![ + .insert_header(header::CacheControl(vec![ header::CacheDirective::Public, header::CacheDirective::Extension("immutable".into(), None), header::CacheDirective::MaxAge(CACHE_AGE), @@ -82,7 +82,7 @@ fn handle_favicons(path: &str) -> HttpResponse { #[get("/{file}")] pub async fn favicons(path: web::Path) -> impl Responder { debug!("searching favicons"); - handle_favicons(&path.0) + handle_favicons(&path) } #[cfg(test)] diff --git a/src/tests/mod.rs b/src/tests/mod.rs index 55362cd6..8012ba37 100644 --- a/src/tests/mod.rs +++ b/src/tests/mod.rs @@ -43,7 +43,7 @@ macro_rules! post_request { ($serializable:expr, $uri:expr) => { test::TestRequest::post() .uri($uri) - .header(header::CONTENT_TYPE, "application/json") + .insert_header((header::CONTENT_TYPE, "application/json")) .set_payload(serde_json::to_string($serializable).unwrap()) }; } @@ -67,7 +67,7 @@ macro_rules! get_app { App::new() .wrap(get_identity_service()) .wrap(actix_middleware::NormalizePath::new( - actix_middleware::normalize::TrailingSlash::Trim, + actix_middleware::TrailingSlash::Trim, )) .configure(crate::api::v1::services) .configure(crate::widget::services) @@ -81,7 +81,7 @@ macro_rules! get_app { App::new() .wrap(get_identity_service()) .wrap(actix_middleware::NormalizePath::new( - actix_middleware::normalize::TrailingSlash::Trim, + actix_middleware::TrailingSlash::Trim, )) .configure(crate::api::v1::services) .configure(crate::widget::services) @@ -89,7 +89,7 @@ macro_rules! get_app { .configure(crate::pages::services) .configure(crate::static_assets::services) //.data(std::sync::Arc::new(crate::data::Data::new().await)) - .data($data.clone()), + .app_data(actix_web::web::Data::new($data.clone())), ) }; } diff --git a/src/widget/mod.rs b/src/widget/mod.rs index 4de6975e..be29db48 100644 --- a/src/widget/mod.rs +++ b/src/widget/mod.rs @@ -82,7 +82,7 @@ fn handle_widget_assets(path: &str) -> HttpResponse { }; HttpResponse::Ok() - .set(header::CacheControl(vec![header::CacheDirective::MaxAge( + .insert_header(header::CacheControl(vec![header::CacheDirective::MaxAge( crate::CACHE_AGE, )])) .content_type(from_path(path).first_or_octet_stream().as_ref()) @@ -94,7 +94,7 @@ fn handle_widget_assets(path: &str) -> HttpResponse { #[get("/widget/{_:.*}")] pub async fn widget_assets(path: web::Path) -> impl Responder { - handle_widget_assets(&path.0) + handle_widget_assets(&path) } pub fn services(cfg: &mut web::ServiceConfig) { diff --git a/templates/email/components/footer/index.html b/templates/email/components/footer/index.html new file mode 100644 index 00000000..dfcee43f --- /dev/null +++ b/templates/email/components/footer/index.html @@ -0,0 +1,59 @@ +
+
+
+ diff --git a/templates/email/components/footer/main.css b/templates/email/components/footer/main.css new file mode 100644 index 00000000..44a0d240 --- /dev/null +++ b/templates/email/components/footer/main.css @@ -0,0 +1,38 @@ +.details__container { + display: flex; + font-size: 14px; + flex-direction: column; +} + +.details__copyright { + font-size: 14px; + flex: 2; +} + +.details { + list-style: none; + bottom: 0px; + box-sizing: border-box; + display: flex; + font-size: 14px; + margin: auto; + padding: 0; +} + +.details__item { + margin: auto 10px; + list-style: none; + flex: 1; +} + +.details__link { + color: rgb(3, 102, 214); +} + +.details__row1 { + display: flex; +} + +.details__row1 > .details { + flex: 1; +} diff --git a/templates/email/css/base.css b/templates/email/css/base.css new file mode 100644 index 00000000..7df65861 --- /dev/null +++ b/templates/email/css/base.css @@ -0,0 +1,15 @@ +* { + font-family: Arial, Helvetica, sans-serif; + background-color: #f0f0f0; +} + +.container { + display: flex; + flex-direction: column; + max-width: 450px; + margin: auto; +} + +h1 { + align-self: center; +} diff --git a/templates/email/css/message-text.css b/templates/email/css/message-text.css new file mode 100644 index 00000000..00848a69 --- /dev/null +++ b/templates/email/css/message-text.css @@ -0,0 +1 @@ +font-size: 1.2rem; font-weight: 500; diff --git a/templates/email/verification/css/verification__link.css b/templates/email/verification/css/verification__link.css new file mode 100644 index 00000000..6a48f4e1 --- /dev/null +++ b/templates/email/verification/css/verification__link.css @@ -0,0 +1,4 @@ +.verification__link { + align-self: center; + font-size: 1.2rem; +} diff --git a/templates/email/verification/index.html b/templates/email/verification/index.html new file mode 100644 index 00000000..2a1d9a2b --- /dev/null +++ b/templates/email/verification/index.html @@ -0,0 +1,50 @@ + + + + + + <.= PAGE .> | <.= crate::pages::NAME .> + + + +
+

+ Welcome to mCaptcha! +

+

+ Please verify your email address to continue. +

+ + +

+ If you were not able to see the verification button, click the following + link: +

+ + <.= verification_link .> + +

+ The link expires in 15 minutes. Please ignore this email if you weren't + expecting it. +

+ +

+ With best regards,
+ Admin
+

+ <. include!("../components/footer/index.html"); .> +
+ +