diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 031c3c1..14784a0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -60,7 +60,7 @@ jobs: command: build use-cross: ${{ matrix.job.use-cross }} toolchain: ${{ matrix.rust }} - args: --release --features=all,metrics --target ${{ matrix.job.target }} + args: --release --features=all --target ${{ matrix.job.target }} - name: install strip command shell: bash diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 64c437a..1c35608 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,6 @@ repos: - id: trailing-whitespace - repo: local hooks: - - id: fmt types: - rust @@ -40,13 +39,23 @@ repos: - -D - warnings - - id: build + - id: check + types: + - rust + name: cargo check + language: system + entry: cargo + pass_filenames: false + args: + - check + + - id: check-all types: - rust - name: cargo build + name: cargo check all language: system entry: cargo pass_filenames: false args: - - build + - check - --features=all diff --git a/Cargo.lock b/Cargo.lock index 9afabe9..c3ab0dd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -16,14 +16,14 @@ dependencies = [ "memchr", "pin-project-lite", "tokio", - "tokio-util 0.7.3", + "tokio-util 0.7.4", ] [[package]] name = "actix-cors" -version = "0.6.1" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "414360eed71ba2d5435b185ba43ecbe281dfab5df3898286d6b7be8074372c92" +checksum = "684a6ce1562a5fcca49bc9302896c63547eea78a1e405e837e7416affd8b6eb9" dependencies = [ "actix-utils", "actix-web", @@ -59,9 +59,9 @@ dependencies = [ [[package]] name = "actix-http" -version = "3.2.1" +version = "3.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f9ffb6db08c1c3a1f4aef540f1a63193adc73c4fbd40b75a95fc8c5258f6e51" +checksum = "0c83abf9903e1f0ad9973cc4f7b9767fd5a03a583f51a5b7a339e07987cd2724" dependencies = [ "actix-codec", "actix-rt", @@ -81,14 +81,14 @@ dependencies = [ "http", "httparse", "httpdate", - "itoa 1.0.2", + "itoa 1.0.4", "language-tags", "local-channel", "mime", "percent-encoding", "pin-project-lite", "rand 0.8.5", - "sha1 0.10.1", + "sha1 0.10.5", "smallvec", "tracing", "zstd", @@ -106,16 +106,15 @@ dependencies = [ [[package]] name = "actix-router" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb60846b52c118f2f04a56cc90880a274271c489b2498623d58176f8ca21fa80" +checksum = "d66ff4d247d2b160861fa2866457e85706833527840e4133f8f49aa423a38799" dependencies = [ "bytestring", - "firestorm", "http", - "log", "regex", "serde", + "tracing", ] [[package]] @@ -170,9 +169,9 @@ dependencies = [ [[package]] name = "actix-web" -version = "4.1.0" +version = "4.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a27e8fe9ba4ae613c21f677c2cfaf0696c3744030c6f485b34634e502d6bb379" +checksum = "d48f7b6534e06c7bfc72ee91db7917d4af6afe23e7d223b51e68fffbb21e96b9" dependencies = [ "actix-codec", "actix-http", @@ -192,7 +191,8 @@ dependencies = [ "encoding_rs", "futures-core", "futures-util", - "itoa 1.0.2", + "http", + "itoa 1.0.4", "language-tags", "log", "mime", @@ -204,15 +204,15 @@ dependencies = [ "serde_urlencoded", "smallvec", "socket2", - "time 0.3.11", + "time 0.3.15", "url", ] [[package]] name = "actix-web-codegen" -version = "4.0.1" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f270541caec49c15673b0af0e9a00143421ad4f118d2df7edcb68b627632f56" +checksum = "1fa9362663c8643d67b2d5eafba49e4cb2c8a053a29ed00a0bea121f17c76b13" dependencies = [ "actix-router", "proc-macro2", @@ -251,24 +251,24 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "0.7.18" +version = "0.7.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e" dependencies = [ "memchr", ] [[package]] name = "alloc-no-stdlib" -version = "2.0.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35ef4730490ad1c4eae5c4325b2a95f521d023e5c885853ff7aca0a6a1631db3" +checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" [[package]] name = "alloc-stdlib" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "697ed7edc0f1711de49ce108c541623a0af97c6c60b2f6e2b65229847ac843c2" +checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" dependencies = [ "alloc-no-stdlib", ] @@ -319,6 +319,15 @@ dependencies = [ "url", ] +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + [[package]] name = "ansi_term" version = "0.12.1" @@ -348,9 +357,9 @@ checksum = "7a40729d2133846d9ed0ea60a8b9541bccddab49cd30f0715a1da672fe9a2524" [[package]] name = "async-trait" -version = "0.1.56" +version = "0.1.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96cf8829f67d2eab0b2dfa42c5d0ef737e0724e4a82b01b3e292456202b19716" +checksum = "1e805d94e6b5001b651426cf4cd446b1ab5f319d27bab5c644f61de0a804360c" dependencies = [ "proc-macro2", "quote", @@ -397,9 +406,9 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] name = "base64ct" -version = "1.5.1" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bdca834647821e0b13d9539a8634eb62d3501b6b6c2cec1722786ee6671b851" +checksum = "b645a089122eccb6111b4f81cbc1a49f5900ac4666bb93ac027feaecf15607bf" [[package]] name = "bigdecimal" @@ -430,32 +439,11 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "block-buffer" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" -dependencies = [ - "block-padding", - "byte-tools", - "byteorder", - "generic-array 0.12.4", -] - -[[package]] -name = "block-buffer" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" -dependencies = [ - "generic-array 0.14.5", -] - -[[package]] -name = "block-padding" -version = "0.1.5" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" +checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" dependencies = [ - "byte-tools", + "generic-array", ] [[package]] @@ -492,15 +480,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3" - -[[package]] -name = "byte-tools" -version = "0.3.1" +version = "3.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" +checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" [[package]] name = "byteorder" @@ -510,9 +492,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0b3de4a0c5e67e16066a0715723abd91edc2f9001d09c46e1dca929351e130e" +checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" [[package]] name = "bytestring" @@ -540,15 +522,17 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.19" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" +checksum = "bfd4d1b31faaa3a89d7934dbded3111da0d2ef28e3ebccdb4f0179f5929d1ef1" dependencies = [ - "libc", + "iana-time-zone", + "js-sys", "num-integer", "num-traits", "serde", "time 0.1.44", + "wasm-bindgen", "winapi", ] @@ -567,6 +551,16 @@ dependencies = [ "vec_map", ] +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] + [[package]] name = "colored" version = "1.9.3" @@ -580,16 +574,16 @@ dependencies = [ [[package]] name = "combine" -version = "4.6.4" +version = "4.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a604e93b79d1808327a6fca85a6f2d69de66461e7620f5a4cbf5fb4d1d7c948" +checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" dependencies = [ "bytes", "futures-core", "memchr", "pin-project-lite", "tokio", - "tokio-util 0.7.3", + "tokio-util 0.7.4", ] [[package]] @@ -612,12 +606,12 @@ checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] name = "cookie" -version = "0.16.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94d4706de1b0fa5b132270cddffa8585166037822e260a944fe161acd137ca05" +checksum = "344adc371239ef32293cb1c4fe519592fcf21206c79c02854320afcdf3ab4917" dependencies = [ "percent-encoding", - "time 0.3.11", + "time 0.3.15", "version_check", ] @@ -645,9 +639,9 @@ checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" [[package]] name = "cpufeatures" -version = "0.2.2" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" +checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" dependencies = [ "libc", ] @@ -698,12 +692,11 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.11" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51887d4adc7b564537b15adcfb307936f8075dfcd5f00dde9a9f1d29383682bc" +checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac" dependencies = [ "cfg-if", - "once_cell", ] [[package]] @@ -712,7 +705,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03c6a1d5fa1de37e071642dfa44ec552ca5b299adb128fab16138e24b548fd21" dependencies = [ - "generic-array 0.14.5", + "generic-array", "subtle", ] @@ -722,10 +715,54 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "generic-array 0.14.5", + "generic-array", "typenum", ] +[[package]] +name = "cxx" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f83d0ebf42c6eafb8d7c52f7e5f2d3003b89c7aa4fd2b79229209459a849af8" +dependencies = [ + "cc", + "cxxbridge-flags", + "cxxbridge-macro", + "link-cplusplus", +] + +[[package]] +name = "cxx-build" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07d050484b55975889284352b0ffc2ecbda25c0c55978017c132b29ba0818a86" +dependencies = [ + "cc", + "codespan-reporting", + "once_cell", + "proc-macro2", + "quote", + "scratch", + "syn", +] + +[[package]] +name = "cxxbridge-flags" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d2199b00553eda8012dfec8d3b1c75fce747cf27c169a270b3b99e3448ab78" + +[[package]] +name = "cxxbridge-macro" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcb67a6de1f602736dd7eaead0080cf3435df806c61b24b13328db128c58868f" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "der" version = "0.5.1" @@ -752,20 +789,11 @@ dependencies = [ [[package]] name = "digest" -version = "0.8.1" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +checksum = "adfbc57365a37acbd2ebf2b64d7e69bb766e2fea813521ed536f5d0520dcf86c" dependencies = [ - "generic-array 0.12.4", -] - -[[package]] -name = "digest" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" -dependencies = [ - "block-buffer 0.10.2", + "block-buffer", "crypto-common", "subtle", ] @@ -810,15 +838,15 @@ checksum = "56899898ce76aaf4a0f24d914c97ea6ed976d42fec6ad33fcbb0a1103e07b2b0" [[package]] name = "dyn-clone" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d07a982d1fb29db01e5a59b1918e03da4df7297eaeee7686ac45542fd4e59c8" +checksum = "4f94fa09c2aeea5b8839e414b7b841bf429fd25b9c522116ac97ee87856d88b2" [[package]] name = "either" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f107b87b6afc2a64fd13cac55fe06d6c8859f12d4b14cbcdd2c67d0976781be" +checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" dependencies = [ "serde", ] @@ -834,15 +862,9 @@ dependencies = [ [[package]] name = "event-listener" -version = "2.5.2" +version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77f3309417938f28bf8228fcff79a4a37103981e3e186d2ccd19c74b38f4eb71" - -[[package]] -name = "fake-simd" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "fastrand" @@ -863,12 +885,6 @@ dependencies = [ "log", ] -[[package]] -name = "firestorm" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c5f6c2c942da57e2aaaa84b8a521489486f14e75e7fa91dab70aba913975f98" - [[package]] name = "flate2" version = "1.0.24" @@ -914,11 +930,10 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" dependencies = [ - "matches", "percent-encoding", ] @@ -930,9 +945,9 @@ checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" [[package]] name = "futures" -version = "0.3.21" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f73fe65f54d1e12b726f517d3e2135ca3125a437b6d998caf1962961f7172d9e" +checksum = "38390104763dc37a5145a53c29c63c1290b5d316d6086ec32c293f6736051bb0" dependencies = [ "futures-channel", "futures-core", @@ -945,9 +960,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.21" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" +checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" dependencies = [ "futures-core", "futures-sink", @@ -955,15 +970,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.21" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" +checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" [[package]] name = "futures-executor" -version = "0.3.21" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9420b90cfa29e327d0429f19be13e7ddb68fa1cccb09d65e5706b8c7a749b8a6" +checksum = "7acc85df6714c176ab5edf386123fafe217be88c0840ec11f199441134a074e2" dependencies = [ "futures-core", "futures-task", @@ -983,15 +998,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.21" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" +checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" [[package]] name = "futures-macro" -version = "0.3.21" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" +checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" dependencies = [ "proc-macro2", "quote", @@ -1000,15 +1015,15 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.21" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" +checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" [[package]] name = "futures-task" -version = "0.3.21" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" +checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" [[package]] name = "futures-timer" @@ -1018,9 +1033,9 @@ checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" [[package]] name = "futures-util" -version = "0.3.21" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" +checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" dependencies = [ "futures-channel", "futures-core", @@ -1036,18 +1051,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.12.4" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" -dependencies = [ - "typenum", -] - -[[package]] -name = "generic-array" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" dependencies = [ "typenum", "version_check", @@ -1066,9 +1072,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37a82c6d637fc9515a4694bbf1cb2457b79d81ce52b3108bdeea58b07dd34a57" +checksum = "5ca32592cf21ac7ccab1825cd87f6c9b3d9022c44d086172ed0966bec8af30be" dependencies = [ "bytes", "fnv", @@ -1079,7 +1085,7 @@ dependencies = [ "indexmap", "slab", "tokio", - "tokio-util 0.7.3", + "tokio-util 0.7.4", "tracing", ] @@ -1152,7 +1158,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.3", + "digest", ] [[package]] @@ -1177,7 +1183,7 @@ checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" dependencies = [ "bytes", "fnv", - "itoa 1.0.2", + "itoa 1.0.4", ] [[package]] @@ -1199,9 +1205,9 @@ checksum = "21dec9db110f5f872ed9699c3ecf50cf16f423502706ba5c72462e28d3157573" [[package]] name = "httparse" -version = "1.7.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "496ce29bb5a52785b44e0f7ca2847ae0bb839c9bd28f69acac9b99d461c0c04c" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" @@ -1246,7 +1252,7 @@ dependencies = [ "http-body", "httparse", "httpdate", - "itoa 1.0.2", + "itoa 1.0.4", "pin-project-lite", "socket2", "tokio", @@ -1268,13 +1274,36 @@ dependencies = [ "tokio-native-tls", ] +[[package]] +name = "iana-time-zone" +version = "0.1.51" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5a6ef98976b22b3b7f2f3a806f858cb862044cfa66805aa3ad84cb3d3b785ed" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "winapi", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +dependencies = [ + "cxx", + "cxx-build", +] + [[package]] name = "idna" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" dependencies = [ - "matches", "unicode-bidi", "unicode-normalization", ] @@ -1315,9 +1344,9 @@ dependencies = [ [[package]] name = "itertools" -version = "0.10.3" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" dependencies = [ "either", ] @@ -1330,24 +1359,24 @@ checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" [[package]] name = "itoa" -version = "1.0.2" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" +checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" [[package]] name = "jobserver" -version = "0.1.24" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa" +checksum = "068b1ee6743e4d11fb9c6a1e6064b3693a1b600e7f5f5988047d98b3dc9fb90b" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.58" +version = "0.3.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3fac17f7123a73ca62df411b1bf727ccc805daa070338fda671c86dac1bdc27" +checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" dependencies = [ "wasm-bindgen", ] @@ -1386,15 +1415,15 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.126" +version = "0.2.135" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" +checksum = "68783febc7782c6c5cb401fbda4de5a9898be1762314da0bb2c10ced61f18b0c" [[package]] name = "libm" -version = "0.2.2" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33a33a362ce288760ec6a508b94caaec573ae7d3bbbd91b87aa0bad4456839db" +checksum = "292a948cd991e376cf75541fe5b97a1081d713c618b4f1b9500f8844e49eb565" [[package]] name = "libsqlite3-sys" @@ -1407,6 +1436,15 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "link-cplusplus" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9272ab7b96c9046fbc5bc56c06c117cb639fe2d509df0c421cad82d2915cf369" +dependencies = [ + "cc", +] + [[package]] name = "local-channel" version = "0.1.3" @@ -1427,9 +1465,9 @@ checksum = "e34f76eb3611940e0e7d53a9aaa4e6a3151f69541a282fd0dad5571420c53ff1" [[package]] name = "lock_api" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" dependencies = [ "autocfg", "scopeguard", @@ -1444,25 +1482,13 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "maplit" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" - -[[package]] -name = "matches" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" - [[package]] name = "md-5" -version = "0.10.1" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658646b21e0b72f7866c7038ab086d3d5e1cd6271f060fd37defb241949d0582" +checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" dependencies = [ - "digest 0.10.3", + "digest", ] [[package]] @@ -1495,9 +1521,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc" +checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" dependencies = [ "adler", ] @@ -1524,7 +1550,7 @@ dependencies = [ "libc", "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys", + "windows-sys 0.36.1", ] [[package]] @@ -1688,21 +1714,15 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1" - -[[package]] -name = "opaque-debug" -version = "0.2.3" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" +checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" [[package]] name = "openssl" -version = "0.10.41" +version = "0.10.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "618febf65336490dfcf20b73f885f5651a0c89c64c2d4a8c3662585a70bf5bd0" +checksum = "12fc0523e3bd51a692c8850d075d74dc062ccf251c0110668cbd921917118a13" dependencies = [ "bitflags", "cfg-if", @@ -1741,9 +1761,9 @@ dependencies = [ [[package]] name = "openssl-sys" -version = "0.9.75" +version = "0.9.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5f9bd0c2710541a3cda73d6f9ac4f1b240de4ae261065d309dbe73d9dceb42f" +checksum = "5230151e44c0f05157effb743e8d517472843121cf9243e8b81393edb5acd9ce" dependencies = [ "autocfg", "cc", @@ -1771,7 +1791,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core 0.9.3", + "parking_lot_core 0.9.4", ] [[package]] @@ -1790,22 +1810,22 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" +checksum = "4dc9e0dc2adc1c69d09143aff38d3d30c5c3f0df0dad82e6d25547af174ebec0" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] name = "paste" -version = "1.0.7" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c520e05135d6e763148b6426a837e239041653ba7becd2e538c076c738025fc" +checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1" [[package]] name = "pem" @@ -1829,24 +1849,25 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "pest" -version = "2.1.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53" +checksum = "dbc7bc69c062e492337d74d59b120c274fd3d261b6bf6d3207d499b4b379c41a" dependencies = [ + "thiserror", "ucd-trie", ] [[package]] name = "pest_derive" -version = "2.1.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "833d1ae558dc601e9a60366421196a8d94bc0ac980476d0b67e1d0988d72b2d0" +checksum = "60b75706b9642ebcb34dab3bc7750f811609a0eb1dd8b88c2d15bf628c1c65b2" dependencies = [ "pest", "pest_generator", @@ -1854,9 +1875,9 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.1.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99b8db626e31e5b81787b9783425769681b347011cc59471e33ea46d2ea0cf55" +checksum = "f4f9272122f5979a6511a749af9db9bfc810393f63119970d7085fed1c4ea0db" dependencies = [ "pest", "pest_meta", @@ -1867,29 +1888,29 @@ dependencies = [ [[package]] name = "pest_meta" -version = "2.1.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54be6e404f5317079812fc8f9f5279de376d8856929e21c184ecf6bbd692a11d" +checksum = "4c8717927f9b79515e565a64fe46c38b8cd0427e64c40680b14a7365ab09ac8d" dependencies = [ - "maplit", + "once_cell", "pest", - "sha-1 0.8.2", + "sha1 0.10.5", ] [[package]] name = "pin-project" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78203e83c48cffbe01e4a2d35d566ca4de445d79a85372fc64e378bfc812a260" +checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "710faf75e1b33345361201d36d04e98ac1ed8909151a017ed384700836104c74" +checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ "proc-macro2", "quote", @@ -1985,18 +2006,18 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" [[package]] name = "proc-macro2" -version = "1.0.40" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7" +checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" dependencies = [ "unicode-ident", ] [[package]] name = "prometheus" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cface98dfa6d645ea4c789839f176e4b072265d085bfcc48eaa8d137f58d3c39" +checksum = "45c8babc29389186697fe5a2a4859d697825496b83db5d0b65271cdc0488e88c" dependencies = [ "cfg-if", "fnv", @@ -2009,15 +2030,15 @@ dependencies = [ [[package]] name = "protobuf" -version = "2.27.1" +version = "2.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf7e6d18738ecd0902d30d1ad232c9125985a3422929b16c65517b38adc14f96" +checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" [[package]] name = "quote" -version = "1.0.20" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804" +checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" dependencies = [ "proc-macro2", ] @@ -2043,7 +2064,7 @@ checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha", - "rand_core 0.6.3", + "rand_core 0.6.4", ] [[package]] @@ -2053,7 +2074,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.3", + "rand_core 0.6.4", ] [[package]] @@ -2073,18 +2094,18 @@ checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" [[package]] name = "rand_core" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ "getrandom", ] [[package]] name = "rbatis" -version = "3.1.15" +version = "3.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65a9dadaed6cc3a87c888cdd1cb0ba39c11d9c9adc421f8a9ada94eb3fe3fb18" +checksum = "457fd9d51f0c9fa7445171c580532c9d5e62a76ed1488e8203fe91c818f89068" dependencies = [ "async-trait", "chrono", @@ -2126,9 +2147,9 @@ dependencies = [ [[package]] name = "rbatis-macro-driver" -version = "3.1.2" +version = "3.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6225b16237f6cf2618b06346a07b2ee53769e65a4f872f99f7418d719b2ee943" +checksum = "0c6c87b61272806fbb246e9089c3088e50b7f95126bcab47dc1b053cea6ed2b4" dependencies = [ "html_parser", "proc-macro2", @@ -2212,9 +2233,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534cfe58d6a18cc17120fbf4635d53d14691c1fe4d951064df9bd326178d7d5a" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ "bitflags", ] @@ -2264,9 +2285,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.11" +version = "0.11.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b75aa69a3f06bbcc66ede33af2af253c6f7a86b1ca0033f60c580a27074fbf92" +checksum = "431949c384f4e2ae07605ccaa56d1d9d2ecdb5cadd4f9577ccfab29f2e5149fc" dependencies = [ "base64", "bytes", @@ -2280,10 +2301,10 @@ dependencies = [ "hyper-tls", "ipnet", "js-sys", - "lazy_static", "log", "mime", "native-tls", + "once_cell", "percent-encoding", "pin-project-lite", "serde", @@ -2321,14 +2342,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cf22754c49613d2b3b119f0e5d46e34a2c628a937e3024b8762de4e7d8c710b" dependencies = [ "byteorder", - "digest 0.10.3", + "digest", "num-bigint-dig", "num-integer", "num-iter", "num-traits", "pkcs1", "pkcs8", - "rand_core 0.6.3", + "rand_core 0.6.4", "smallvec", "subtle", "zeroize", @@ -2336,9 +2357,9 @@ dependencies = [ [[package]] name = "rust_decimal" -version = "1.25.0" +version = "1.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34a3bb58e85333f1ab191bf979104b586ebd77475bc6681882825f4532dfe87c" +checksum = "ee9164faf726e4f3ece4978b25ca877ddc6802fa77f38cdccb32c7f805ecd70c" dependencies = [ "arrayvec", "num-traits", @@ -2360,7 +2381,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.12", + "semver 1.0.14", ] [[package]] @@ -2382,6 +2403,7 @@ version = "0.5.10" dependencies = [ "actix-cors", "actix-files", + "actix-http", "actix-rt", "actix-web", "actix-web-prom", @@ -2390,7 +2412,7 @@ dependencies = [ "bytes", "chrono", "derive_more", - "digest 0.10.3", + "digest", "dyn-clone", "fern", "futures", @@ -2407,7 +2429,7 @@ dependencies = [ "reqwest", "serde", "serde_json", - "sha1 0.10.1", + "sha1 0.10.5", "sha2", "structopt", "strum", @@ -2416,21 +2438,21 @@ dependencies = [ "tokio", "tokio-amqp", "url", - "uuid 1.1.2", + "uuid 1.2.1", "wildmatch", ] [[package]] name = "rustversion" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24c8ad4f0c00e1eb5bc7614d236a7f1300e3dbd76b68cac8e06fb00b015ad8d8" +checksum = "97477e48b4cf8603ad5f7aaf897467cf42ab4218a38ef76fb14c2d6773a6d6a8" [[package]] name = "ryu" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" +checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" [[package]] name = "schannel" @@ -2439,7 +2461,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" dependencies = [ "lazy_static", - "windows-sys", + "windows-sys 0.36.1", ] [[package]] @@ -2448,6 +2470,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +[[package]] +name = "scratch" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" + [[package]] name = "sct" version = "0.6.1" @@ -2460,9 +2488,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.6.1" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dc14f172faf8a0194a3aded622712b0de276821addc574fa54fc0a1167e10dc" +checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" dependencies = [ "bitflags", "core-foundation", @@ -2492,9 +2520,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.12" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2333e6df6d6598f2b1974829f853c2b4c5f4a6e503c10af918081aa6f8564e1" +checksum = "e25dfac463d778e353db5be2449d1cce89bd6fd23c9f1ea21310ce6e5a1b29c4" [[package]] name = "semver-parser" @@ -2504,27 +2532,27 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.140" +version = "1.0.145" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc855a42c7967b7c369eb5860f7164ef1f6f81c20c7cc1141f2a604e18723b03" +checksum = "728eb6351430bccb993660dfffc5a72f91ccc1295abaa8ce19b27ebe4f75568b" dependencies = [ "serde_derive", ] [[package]] name = "serde_bytes" -version = "0.11.6" +version = "0.11.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "212e73464ebcde48d723aa02eb270ba62eff38a9b732df31f33f1b4e145f3a54" +checksum = "cfc50e8183eeeb6178dcb167ae34a8051d63535023ae38b5d8d12beae193d37b" dependencies = [ "serde", ] [[package]] name = "serde_derive" -version = "1.0.140" +version = "1.0.145" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f2122636b9fe3b81f1cb25099fcf2d3f542cdb1d45940d56c713158884a05da" +checksum = "81fa1584d3d1bcacd84c277a0dfe21f5b0f6accf4a23d04d4c6d61f1af522b4c" dependencies = [ "proc-macro2", "quote", @@ -2533,12 +2561,12 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.82" +version = "1.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82c2c1fdcd807d1098552c5b9a36e425e42e9fbd7c6a37a8425f390f781f7fa7" +checksum = "6ce777b7b150d76b9cf60d28b55f5847135a003f7d7350c6be7a773508ce7d45" dependencies = [ "indexmap", - "itoa 1.0.2", + "itoa 1.0.4", "ryu", "serde", ] @@ -2550,23 +2578,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ "form_urlencoded", - "itoa 1.0.2", + "itoa 1.0.4", "ryu", "serde", ] -[[package]] -name = "sha-1" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" -dependencies = [ - "block-buffer 0.7.3", - "digest 0.8.1", - "fake-simd", - "opaque-debug", -] - [[package]] name = "sha-1" version = "0.10.0" @@ -2575,7 +2591,7 @@ checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.3", + "digest", ] [[package]] @@ -2589,13 +2605,13 @@ dependencies = [ [[package]] name = "sha1" -version = "0.10.1" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c77f4e7f65455545c2153c1253d25056825e77ee2533f0e41deb65a93a34852f" +checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.3", + "digest", ] [[package]] @@ -2606,13 +2622,13 @@ checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" [[package]] name = "sha2" -version = "0.10.2" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55deaec60f81eefe3cce0dc50bda92d6d8e88f2a27df7c5033b42afeb1ed2676" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.3", + "digest", ] [[package]] @@ -2635,15 +2651,15 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" [[package]] name = "socket2" -version = "0.4.4" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" +checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" dependencies = [ "libc", "winapi", @@ -2702,7 +2718,7 @@ dependencies = [ "chrono", "crc", "crossbeam-queue", - "digest 0.10.3", + "digest", "dirs", "either", "encoding_rs", @@ -2713,13 +2729,13 @@ dependencies = [ "futures-executor", "futures-intrusive", "futures-util", - "generic-array 0.14.5", + "generic-array", "hashlink", "hex", "hkdf", "hmac", "indexmap", - "itoa 1.0.2", + "itoa 1.0.4", "libc", "libsqlite3-sys", "log", @@ -2736,7 +2752,7 @@ dependencies = [ "rustls", "serde", "serde_json", - "sha-1 0.10.0", + "sha-1", "sha2", "smallvec", "sqlformat", @@ -2871,9 +2887,9 @@ dependencies = [ [[package]] name = "strum_macros" -version = "0.24.2" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4faebde00e8ff94316c01800f9054fd2ba77d30d9e922541913051d1d978918b" +checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" dependencies = [ "heck 0.4.0", "proc-macro2", @@ -2890,9 +2906,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.98" +version = "1.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd" +checksum = "3fcd952facd492f9be3ef0d0b7032a6e442ee9b361d4acc2b1d0c4aaa5f613a1" dependencies = [ "proc-macro2", "quote", @@ -2935,6 +2951,15 @@ dependencies = [ "winapi", ] +[[package]] +name = "termcolor" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +dependencies = [ + "winapi-util", +] + [[package]] name = "textwrap" version = "0.11.0" @@ -2946,18 +2971,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.31" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" +checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.31" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" +checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" dependencies = [ "proc-macro2", "quote", @@ -2993,11 +3018,11 @@ dependencies = [ [[package]] name = "time" -version = "0.3.11" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72c91f41dcb2f096c05f0873d667dceec1087ce5bcf984ec8ffb19acddbb3217" +checksum = "d634a985c4d4238ec39cacaed2e7ae552fbd3c476b552c1deac3021b7d7eaf0c" dependencies = [ - "itoa 1.0.2", + "itoa 1.0.4", "libc", "num_threads", "time-macros 0.2.4", @@ -3049,9 +3074,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.20.0" +version = "1.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57aec3cfa4c296db7255446efb4928a6be304b431a806216105542a67b6ca82e" +checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" dependencies = [ "autocfg", "bytes", @@ -3059,7 +3084,6 @@ dependencies = [ "memchr", "mio 0.8.4", "num_cpus", - "once_cell", "parking_lot 0.12.1", "pin-project-lite", "signal-hook-registry", @@ -3113,9 +3137,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.9" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df54d54117d6fdc4e4fea40fe1e4e566b3505700e148a6827e59b34b0d2600d9" +checksum = "d660770404473ccd7bc9f8b28494a811bc18542b915c0855c51e8f419d5223ce" dependencies = [ "futures-core", "pin-project-lite", @@ -3138,9 +3162,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc463cd8deddc3770d20f9852143d50bf6094e640b485cb2e189a2099085ff45" +checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" dependencies = [ "bytes", "futures-core", @@ -3158,9 +3182,9 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.35" +version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a400e31aa60b9d44a52a8ee0343b5b18566b03a8321e0d321f695cf56e940160" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if", "log", @@ -3170,9 +3194,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.28" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b7358be39f2f274f322d2aaed611acc57f382e8eb1e5b48cb9ae30933495ce7" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" dependencies = [ "once_cell", ] @@ -3191,9 +3215,9 @@ checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" [[package]] name = "ucd-trie" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89570599c4fe5585de2b388aab47e99f7fa4e9238a1399f707a02e356058141c" +checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" [[package]] name = "unicase" @@ -3212,30 +3236,30 @@ checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" [[package]] name = "unicode-ident" -version = "1.0.2" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c61ba63f9235225a22310255a29b806b907c9b8c964bcbd0a2c70f3f2deea7" +checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" [[package]] name = "unicode-normalization" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854cbdc4f7bc6ae19c820d44abdc3277ac3e1b2b93db20a636825d9322fb60e6" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" dependencies = [ "tinyvec", ] [[package]] name = "unicode-segmentation" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" +checksum = "0fdbf052a0783de01e944a6ce7a8cb939e295b1e7be835a1112c3b9a7f047a5a" [[package]] name = "unicode-width" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" [[package]] name = "unicode_categories" @@ -3251,13 +3275,12 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "url" -version = "2.2.2" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" dependencies = [ "form_urlencoded", "idna", - "matches", "percent-encoding", ] @@ -3273,9 +3296,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.1.2" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd6469f4314d5f1ffec476e05f17cc9a78bc7a27a6a857842170bdf8d6f98d2f" +checksum = "feb41e78f93363bb2df8b0e86a2ca30eed7806ea16ea0c790d757cf93f79be83" dependencies = [ "getrandom", ] @@ -3322,9 +3345,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.81" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c53b543413a17a202f4be280a7e5c62a1c69345f5de525ee64f8cfdbc954994" +checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -3332,13 +3355,13 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.81" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5491a68ab4500fa6b4d726bd67408630c3dbe9c4fe7bda16d5c82a1fd8c7340a" +checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" dependencies = [ "bumpalo", - "lazy_static", "log", + "once_cell", "proc-macro2", "quote", "syn", @@ -3347,9 +3370,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.31" +version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de9a9cec1733468a8c657e57fa2413d2ae2c0129b95e87c5b72b8ace4d13f31f" +checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" dependencies = [ "cfg-if", "js-sys", @@ -3359,9 +3382,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.81" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c441e177922bc58f1e12c022624b6216378e5febc2f0533e41ba443d505b80aa" +checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3369,9 +3392,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.81" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d94ac45fcf608c1f45ef53e748d35660f168490c10b23704c7779ab8f5c3048" +checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" dependencies = [ "proc-macro2", "quote", @@ -3382,15 +3405,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.81" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a89911bd99e5f3659ec4acf9c4d93b0a90fe4a2a11f15328472058edc5261be" +checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" [[package]] name = "web-sys" -version = "0.3.58" +version = "0.3.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fed94beee57daf8dd7d51f2b15dc2bcde92d7a72304cdf662a4371008b71b90" +checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" dependencies = [ "js-sys", "wasm-bindgen", @@ -3417,10 +3440,11 @@ dependencies = [ [[package]] name = "whoami" -version = "1.2.1" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524b58fa5a20a2fb3014dd6358b70e6579692a56ef6fce928834e488f42f65e8" +checksum = "d6631b6a2fd59b1841b622e8f1a7ad241ef0a46f2d580464ce8140ac94cbd571" dependencies = [ + "bumpalo", "wasm-bindgen", "web-sys", ] @@ -3447,6 +3471,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -3459,43 +3492,100 @@ version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" dependencies = [ - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_msvc", + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", +] + +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc 0.42.0", + "windows_i686_gnu 0.42.0", + "windows_i686_msvc 0.42.0", + "windows_x86_64_gnu 0.42.0", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc 0.42.0", ] +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" + [[package]] name = "windows_aarch64_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" + [[package]] name = "windows_i686_gnu" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" +[[package]] +name = "windows_i686_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" + [[package]] name = "windows_i686_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" +[[package]] +name = "windows_i686_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" + [[package]] name = "windows_x86_64_gnu" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" + [[package]] name = "windows_x86_64_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" + [[package]] name = "winreg" version = "0.10.1" diff --git a/Cargo.toml b/Cargo.toml index 1e16a64..a50e6ff 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -137,7 +137,6 @@ default = [] http_notifier = ["reqwest"] redis_info_storage = ["mobc-redis"] hashers = ["md-5", "sha1", "sha2", "digest"] -metrics = [] ### For testing test_redis = [] @@ -149,6 +148,7 @@ integration_tests = ["test_redis", "test_db", "test_rmq"] tempdir = "0.3.7" actix-rt = "2.6.0" httptest = "0.15.4" +actix-http = "3.2.2" [profile] [profile.release] diff --git a/README.md b/README.md index 4065206..4cf9342 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Preferred version is 1.59.0. ```bash git clone https://github.com/s3rius/rustus.git cd rustus -cargo install --path . --features=all,metrics +cargo install --path . --features=all ``` Also you can speedup build by disabling some features. @@ -44,8 +44,7 @@ Available features: * `http_notifier` - adds support for notifying about upload status via http protocol; * `redis_info_storage` - adds support for storing information about upload in redis database; * `hashers` - adds support for checksum verification; -* `metrics` - adds rustus specific metrics to prometheus endpoint; -* `all` - enables all rustus features except `metrics`. +* `all` - enables all rustus features. All precompiled binaries have all features enabled. diff --git a/deploy/Dockerfile b/deploy/Dockerfile index 18726fd..19dc864 100644 --- a/deploy/Dockerfile +++ b/deploy/Dockerfile @@ -1,17 +1,10 @@ -FROM lukemathwalker/cargo-chef:latest-rust-1.57.0 AS chef -WORKDIR app +FROM rust:1.64.0-bullseye AS builder -FROM chef AS planner -COPY . . -RUN cargo chef prepare --recipe-path recipe.json - -FROM chef AS builder -COPY --from=planner /app/recipe.json recipe.json -# Build dependencies - this is the caching Docker layer! -RUN cargo chef cook --release --features=all,metrics --recipe-path recipe.json -# Build application -COPY . . -RUN cargo build --release --bin rustus --features=all,metrics +WORKDIR /app +COPY Cargo.toml Cargo.lock ./ +COPY src ./src +COPY imgs ./imgs +RUN cargo build --release --bin rustus --features=all FROM debian:bullseye-20211201-slim AS base COPY --from=builder /app/target/release/rustus /usr/local/bin/ diff --git a/docs/index.md b/docs/index.md index 8a66816..e0adab0 100644 --- a/docs/index.md +++ b/docs/index.md @@ -42,8 +42,7 @@ Available features: * `http_notifier` - adds support for notifying about upload status via `HTTP` protocol; * `redis_info_storage` - adds support for storing information about upload in `Redis` database; * `hashers` - adds support for checksum verification; -* `metrics` - adds rustus specific metrics to prometheus endpoint; -* `all` - enables all rustus features except `metrics`. +* `all` - enables all rustus features. All precompiled binaries have all features enabled. diff --git a/src/errors.rs b/src/errors.rs index 7eaf514..8719a87 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -9,8 +9,8 @@ pub type RustusResult = Result; pub enum RustusError { #[error("Not found")] FileNotFound, - #[error("File with id {0} already exists")] - FileAlreadyExists(String), + #[error("File already exists")] + FileAlreadyExists, #[error("Given offset is incorrect.")] WrongOffset, #[error("Unknown error")] diff --git a/src/info_storages/redis_info_storage.rs b/src/info_storages/redis_info_storage.rs index dd9f495..014dc0c 100644 --- a/src/info_storages/redis_info_storage.rs +++ b/src/info_storages/redis_info_storage.rs @@ -13,6 +13,7 @@ pub struct RedisStorage { } impl RedisStorage { + #[allow(clippy::unused_async)] pub async fn new(db_dsn: &str) -> RustusResult { let client = redis::Client::open(db_dsn)?; let manager = RedisConnectionManager::new(client); diff --git a/src/main.rs b/src/main.rs index c887343..d51d8b8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,6 @@ #![cfg_attr(coverage, feature(no_coverage))] -use std::str::FromStr; +use std::{collections::HashMap, str::FromStr}; use actix_cors::Cors; use actix_web::{ @@ -15,6 +15,8 @@ use fern::{ use log::{error, LevelFilter}; use config::RustusConf; + +use metrics::{ActiveUploads, FinishedUploads, StartedUploads, TerminatedUploads, UploadSizes}; use wildmatch::WildMatch; use crate::{ @@ -29,6 +31,7 @@ use crate::{ mod config; mod errors; mod info_storages; +mod metrics; mod notifiers; mod protocol; mod routes; @@ -137,6 +140,7 @@ fn create_cors(origins: Vec, additional_headers: Vec) -> Cors { /// if the server can't be bound to the /// given address. #[cfg_attr(coverage, no_coverage)] +#[allow(clippy::too_many_lines)] pub fn create_server(state: State) -> RustusResult { let host = state.config.host.clone(); let port = state.config.port; @@ -157,23 +161,46 @@ pub fn create_server(state: State) -> RustusResult { error!("{}", err); RustusError::Unknown })?; - let active_uploads = - prometheus::IntGauge::new("active_uploads", "Number of active file uploads")?; - let file_sizes = prometheus::Histogram::with_opts( - prometheus::HistogramOpts::new("uploads_sizes", "Size of uploaded files in bytes") - .buckets(prometheus::exponential_buckets(2., 2., 40)?), + let active_uploads = ActiveUploads::new()?; + let upload_sizes = UploadSizes::new()?; + let started_uploads = StartedUploads::new()?; + let finished_uploads = FinishedUploads::new()?; + let terminated_uploads = TerminatedUploads::new()?; + let found_errors = prometheus::IntCounterVec::new( + prometheus::Opts { + namespace: "".into(), + subsystem: "".into(), + name: "errors".into(), + help: "Found errors".into(), + const_labels: HashMap::new(), + variable_labels: Vec::new(), + }, + &["path", "description"], )?; - #[cfg(feature = "metrics")] - { - metrics - .registry - .register(Box::new(active_uploads.clone()))?; - metrics.registry.register(Box::new(file_sizes.clone()))?; - } + metrics + .registry + .register(Box::new(active_uploads.gauge.clone()))?; + metrics + .registry + .register(Box::new(upload_sizes.hist.clone()))?; + metrics + .registry + .register(Box::new(started_uploads.counter.clone()))?; + metrics + .registry + .register(Box::new(finished_uploads.counter.clone()))?; + metrics + .registry + .register(Box::new(terminated_uploads.counter.clone()))?; + metrics.registry.register(Box::new(found_errors.clone()))?; let mut server = HttpServer::new(move || { + let error_metrics = found_errors.clone(); App::new() .app_data(web::Data::new(active_uploads.clone())) - .app_data(web::Data::new(file_sizes.clone())) + .app_data(web::Data::new(started_uploads.clone())) + .app_data(web::Data::new(finished_uploads.clone())) + .app_data(web::Data::new(terminated_uploads.clone())) + .app_data(web::Data::new(upload_sizes.clone())) .route("/health", web::get().to(routes::health_check)) .configure(rustus_service(state.clone())) .wrap(metrics.clone()) @@ -191,6 +218,28 @@ pub fn create_server(state: State) -> RustusResult { } srv.call(req) }) + // This is middleware that registers found errors. + .wrap_fn(move |req, srv| { + // Call the service to resolve handler and return response. + let fut = srv.call(req); + // We need this copy, since we use it in moved closure later. + let error_counter = error_metrics.clone(); + async move { + let srv_response = fut.await?; + if let Some(err) = srv_response.response().error() { + let url = match srv_response.request().match_pattern() { + Some(pattern) => pattern, + None => "".into(), + }; + let err_desc = format!("{}", err); + error_counter + .clone() + .with_label_values(&[url.as_str(), err_desc.as_str()]) + .inc(); + } + Ok(srv_response) + } + }) // Default response for unknown requests. // It returns 404 status_code. .default_service(web::route().to(routes::not_found)) diff --git a/src/metrics.rs b/src/metrics.rs new file mode 100644 index 0000000..43fc727 --- /dev/null +++ b/src/metrics.rs @@ -0,0 +1,70 @@ +use crate::errors::RustusResult; + +#[derive(Clone)] +pub struct StartedUploads { + pub counter: prometheus::IntCounter, +} + +impl StartedUploads { + pub fn new() -> RustusResult { + Ok(Self { + counter: prometheus::IntCounter::new("started_uploads", "Number of created uploads")?, + }) + } +} +#[derive(Clone)] +pub struct FinishedUploads { + pub counter: prometheus::IntCounter, +} + +impl FinishedUploads { + pub fn new() -> RustusResult { + Ok(Self { + counter: prometheus::IntCounter::new("finished_uploads", "Number of finished uploads")?, + }) + } +} + +#[derive(Clone)] +pub struct ActiveUploads { + pub gauge: prometheus::IntGauge, +} +impl ActiveUploads { + pub fn new() -> RustusResult { + Ok(Self { + gauge: prometheus::IntGauge::new("active_uploads", "Number of active file uploads")?, + }) + } +} + +#[derive(Clone)] +pub struct UploadSizes { + pub hist: prometheus::Histogram, +} + +impl UploadSizes { + pub fn new() -> RustusResult { + Ok(Self { + hist: prometheus::Histogram::with_opts( + prometheus::HistogramOpts::new("uploads_sizes", "Size of uploaded files in bytes") + .buckets(prometheus::exponential_buckets(2., 2., 40)?), + )?, + }) + } +} + +#[derive(Clone)] +pub struct TerminatedUploads { + pub counter: prometheus::IntCounter, +} + +impl TerminatedUploads { + pub fn new() -> RustusResult { + Ok(Self { + counter: prometheus::IntCounter::new( + "terminated_uploads", + "Number of terminated uploads", + )?, + }) + } +} diff --git a/src/protocol/core/get_info.rs b/src/protocol/core/get_info.rs index df40e6c..bd1874b 100644 --- a/src/protocol/core/get_info.rs +++ b/src/protocol/core/get_info.rs @@ -61,16 +61,13 @@ pub async fn get_file_info( mod tests { use actix_web::http::{Method, StatusCode}; - use crate::{rustus_service, State}; - use actix_web::{ - test::{call_service, init_service, TestRequest}, - App, - }; + use crate::{server::test::get_service, State}; + use actix_web::test::{call_service, TestRequest}; #[actix_rt::test] async fn success() { let state = State::test_new().await; - let mut rustus = init_service(App::new().configure(rustus_service(state.clone()))).await; + let mut rustus = get_service(state.clone()).await; let mut file_info = state.create_test_file().await; file_info.offset = 100; file_info.length = Some(100); @@ -97,7 +94,7 @@ mod tests { #[actix_rt::test] async fn success_metadata() { let state = State::test_new().await; - let mut rustus = init_service(App::new().configure(rustus_service(state.clone()))).await; + let mut rustus = get_service(state.clone()).await; let mut file_info = state.create_test_file().await; file_info.offset = 100; file_info.length = Some(100); @@ -126,7 +123,7 @@ mod tests { #[actix_rt::test] async fn success_defer_len() { let state = State::test_new().await; - let mut rustus = init_service(App::new().configure(rustus_service(state.clone()))).await; + let mut rustus = get_service(state.clone()).await; let mut file_info = state.create_test_file().await; file_info.deferred_size = true; file_info.length = None; @@ -153,7 +150,7 @@ mod tests { #[actix_rt::test] async fn test_get_file_info_partial() { let state = State::test_new().await; - let mut rustus = init_service(App::new().configure(rustus_service(state.clone()))).await; + let mut rustus = get_service(state.clone()).await; let mut file_info = state.create_test_file().await; file_info.is_partial = true; state @@ -179,7 +176,7 @@ mod tests { #[actix_rt::test] async fn success_final() { let state = State::test_new().await; - let mut rustus = init_service(App::new().configure(rustus_service(state.clone()))).await; + let mut rustus = get_service(state.clone()).await; let mut file_info = state.create_test_file().await; file_info.is_partial = false; file_info.is_final = true; @@ -212,7 +209,7 @@ mod tests { #[actix_rt::test] async fn no_file() { let state = State::test_new().await; - let mut rustus = init_service(App::new().configure(rustus_service(state.clone()))).await; + let mut rustus = get_service(state.clone()).await; let request = TestRequest::with_uri(state.config.file_url("unknknown").as_str()) .method(Method::HEAD) .to_request(); @@ -223,7 +220,7 @@ mod tests { #[actix_rt::test] async fn test_get_file_info_wrong_storage() { let state = State::test_new().await; - let mut rustus = init_service(App::new().configure(rustus_service(state.clone()))).await; + let mut rustus = get_service(state.clone()).await; let mut file_info = state.create_test_file().await; file_info.storage = String::from("unknown"); state diff --git a/src/protocol/core/server_info.rs b/src/protocol/core/server_info.rs index f6f38ef..dc2561b 100644 --- a/src/protocol/core/server_info.rs +++ b/src/protocol/core/server_info.rs @@ -25,15 +25,15 @@ pub async fn server_info(state: web::Data) -> HttpResponse { #[cfg(test)] mod tests { - use crate::{protocol::extensions::Extensions, rustus_service, State}; - use actix_web::test::{call_service, init_service, TestRequest}; + use crate::{protocol::extensions::Extensions, server::test::get_service, State}; + use actix_web::test::{call_service, TestRequest}; - use actix_web::{http::Method, App}; + use actix_web::http::Method; #[actix_rt::test] async fn test_server_info() { let mut state = State::test_new().await; - let mut rustus = init_service(App::new().configure(rustus_service(state.clone()))).await; + let mut rustus = get_service(state.clone()).await; state.config.tus_extensions = vec![ Extensions::Creation, Extensions::Concatenation, diff --git a/src/protocol/core/write_bytes.rs b/src/protocol/core/write_bytes.rs index 24c92b3..d802638 100644 --- a/src/protocol/core/write_bytes.rs +++ b/src/protocol/core/write_bytes.rs @@ -9,6 +9,7 @@ use actix_web::{ use crate::utils::hashes::verify_chunk_checksum; use crate::{ errors::RustusError, + metrics, notifiers::Hook, protocol::extensions::Extensions, utils::headers::{check_header, parse_header}, @@ -19,7 +20,8 @@ pub async fn write_bytes( request: HttpRequest, bytes: Bytes, state: web::Data, - #[cfg(feature = "metrics")] active_uploads: web::Data, + active_uploads: web::Data, + finished_uploads: web::Data, ) -> RustusResult { // Checking if request has required headers. let check_content_type = |val: &str| val == "application/offset+octet-stream"; @@ -134,9 +136,9 @@ pub async fn write_bytes( }); } - #[cfg(feature = "metrics")] if hook == Hook::PostFinish { - active_uploads.dec(); + active_uploads.gauge.dec(); + finished_uploads.counter.inc(); } Ok(HttpResponse::NoContent() @@ -147,11 +149,10 @@ pub async fn write_bytes( #[cfg(test)] mod tests { - use crate::{rustus_service, State}; + use crate::{server::test::get_service, State}; use actix_web::{ http::StatusCode, - test::{call_service, init_service, TestRequest}, - App, + test::{call_service, TestRequest}, }; #[actix_rt::test] @@ -160,7 +161,7 @@ mod tests { /// This test creates file and writes bytes to it. async fn success() { let state = State::test_new().await; - let mut rustus = init_service(App::new().configure(rustus_service(state.clone()))).await; + let mut rustus = get_service(state.clone()).await; let mut file = state.create_test_file().await; file.length = Some(100); file.offset = 0; @@ -198,7 +199,7 @@ mod tests { /// file's length while writing bytes to it. async fn success_update_file_length() { let state = State::test_new().await; - let mut rustus = init_service(App::new().configure(rustus_service(state.clone()))).await; + let mut rustus = get_service(state.clone()).await; let mut file = state.create_test_file().await; file.length = None; file.deferred_size = true; @@ -238,7 +239,7 @@ mod tests { /// is less than current offset, error is thrown. async fn new_file_length_lt_offset() { let state = State::test_new().await; - let mut rustus = init_service(App::new().configure(rustus_service(state.clone()))).await; + let mut rustus = get_service(state.clone()).await; let mut file = state.create_test_file().await; file.length = None; file.deferred_size = true; @@ -262,7 +263,7 @@ mod tests { /// error is thrown. async fn new_file_length_size_already_known() { let state = State::test_new().await; - let mut rustus = init_service(App::new().configure(rustus_service(state.clone()))).await; + let mut rustus = get_service(state.clone()).await; let mut file = state.create_test_file().await; file.length = Some(100); file.deferred_size = false; @@ -285,7 +286,7 @@ mod tests { /// wrong status code is returned. async fn no_content_header() { let state = State::test_new().await; - let mut rustus = init_service(App::new().configure(rustus_service(state.clone()))).await; + let mut rustus = get_service(state.clone()).await; let mut file = state.create_test_file().await; file.length = Some(100); file.offset = 0; @@ -303,7 +304,7 @@ mod tests { /// Tests that method will return error if no offset header specified. async fn no_offset_header() { let state = State::test_new().await; - let mut rustus = init_service(App::new().configure(rustus_service(state.clone()))).await; + let mut rustus = get_service(state.clone()).await; let mut file = state.create_test_file().await; file.length = Some(100); file.offset = 0; @@ -321,7 +322,7 @@ mod tests { /// Tests that method will return error if wrong offset is passed. async fn wrong_offset_header() { let state = State::test_new().await; - let mut rustus = init_service(App::new().configure(rustus_service(state.clone()))).await; + let mut rustus = get_service(state.clone()).await; let mut file = state.create_test_file().await; file.length = Some(100); file.offset = 0; @@ -340,7 +341,7 @@ mod tests { /// Tests that method would return error if file was already uploaded. async fn final_upload() { let state = State::test_new().await; - let mut rustus = init_service(App::new().configure(rustus_service(state.clone()))).await; + let mut rustus = get_service(state.clone()).await; let mut file = state.create_test_file().await; file.is_final = true; state.info_storage.set_info(&file, false).await.unwrap(); @@ -358,7 +359,7 @@ mod tests { /// Tests that method would return 404 if file was saved in other storage. async fn wrong_storage() { let state = State::test_new().await; - let mut rustus = init_service(App::new().configure(rustus_service(state.clone()))).await; + let mut rustus = get_service(state.clone()).await; let mut file = state.create_test_file().await; file.storage = "unknown".into(); state.info_storage.set_info(&file, false).await.unwrap(); @@ -377,7 +378,7 @@ mod tests { /// file if it's offset already equal to length. async fn frozen_file() { let state = State::test_new().await; - let mut rustus = init_service(App::new().configure(rustus_service(state.clone()))).await; + let mut rustus = get_service(state.clone()).await; let mut file = state.create_test_file().await; file.offset = 10; file.length = Some(10); @@ -389,6 +390,7 @@ mod tests { .set_payload("memes") .to_request(); let resp = call_service(&mut rustus, request).await; + println!("{:?}", resp.response().body()); assert_eq!(resp.status(), StatusCode::BAD_REQUEST); } @@ -397,7 +399,7 @@ mod tests { /// unknown file_id is passed. async fn unknown_file_id() { let state = State::test_new().await; - let mut rustus = init_service(App::new().configure(rustus_service(state.clone()))).await; + let mut rustus = get_service(state.clone()).await; let request = TestRequest::patch() .uri(state.config.file_url("unknown").as_str()) .insert_header(("Upload-Offset", "0")) @@ -412,7 +414,7 @@ mod tests { /// Tests checksum validation. async fn wrong_checksum() { let state = State::test_new().await; - let mut rustus = init_service(App::new().configure(rustus_service(state.clone()))).await; + let mut rustus = get_service(state.clone()).await; let mut file = state.create_test_file().await; file.offset = 0; file.length = Some(10); diff --git a/src/protocol/creation/routes.rs b/src/protocol/creation/routes.rs index 3ab188c..1225330 100644 --- a/src/protocol/creation/routes.rs +++ b/src/protocol/creation/routes.rs @@ -4,6 +4,7 @@ use actix_web::{web, web::Bytes, HttpRequest, HttpResponse}; use crate::{ info_storages::FileInfo, + metrics, notifiers::Hook, protocol::extensions::Extensions, utils::headers::{check_header, parse_header}, @@ -71,8 +72,9 @@ fn get_upload_parts(request: &HttpRequest) -> Vec { /// extension is enabled. #[allow(clippy::too_many_lines)] pub async fn create_file( - #[cfg(feature = "metrics")] active_uploads: web::Data, - #[cfg(feature = "metrics")] file_sizes: web::Data, + active_uploads: web::Data, + file_sizes: web::Data, + started_uploads: web::Data, state: web::Data, request: HttpRequest, bytes: Bytes, @@ -148,13 +150,13 @@ pub async fn create_file( file_info.path = Some(state.data_storage.create_file(&file_info).await?); // Incrementing number of active uploads - #[cfg(feature = "metrics")] - active_uploads.inc(); - #[cfg(feature = "metrics")] + active_uploads.gauge.inc(); + started_uploads.counter.inc(); + if let Some(length) = file_info.length { #[allow(clippy::cast_precision_loss)] - file_sizes.observe(length as f64); + file_sizes.hist.observe(length as f64); } if file_info.is_final { @@ -250,17 +252,17 @@ pub async fn create_file( #[cfg(test)] mod tests { - use crate::{server::rustus_service, State}; + use crate::{server::test::get_service, State}; use actix_web::{ http::StatusCode, - test::{call_service, init_service, TestRequest}, - web, App, + test::{call_service, TestRequest}, + web, }; #[actix_rt::test] async fn success() { let state = State::test_new().await; - let mut rustus = init_service(App::new().configure(rustus_service(state.clone()))).await; + let mut rustus = get_service(state.clone()).await; let request = TestRequest::post() .uri(state.config.test_url().as_str()) .insert_header(("Upload-Length", 100)) @@ -285,7 +287,7 @@ mod tests { #[actix_rt::test] async fn success_with_bytes() { let state = State::test_new().await; - let mut rustus = init_service(App::new().configure(rustus_service(state.clone()))).await; + let mut rustus = get_service(state.clone()).await; let test_data = "memes"; let request = TestRequest::post() .uri(state.config.test_url().as_str()) @@ -313,7 +315,7 @@ mod tests { #[actix_rt::test] async fn with_bytes_wrong_content_type() { let state = State::test_new().await; - let mut rustus = init_service(App::new().configure(rustus_service(state.clone()))).await; + let mut rustus = get_service(state.clone()).await; let test_data = "memes"; let request = TestRequest::post() .uri(state.config.test_url().as_str()) @@ -341,7 +343,7 @@ mod tests { #[actix_rt::test] async fn success_defer_size() { let state = State::test_new().await; - let mut rustus = init_service(App::new().configure(rustus_service(state.clone()))).await; + let mut rustus = get_service(state.clone()).await; let request = TestRequest::post() .uri(state.config.test_url().as_str()) .insert_header(("Upload-Defer-Length", "1")) @@ -366,7 +368,7 @@ mod tests { #[actix_rt::test] async fn success_partial_upload() { let state = State::test_new().await; - let mut rustus = init_service(App::new().configure(rustus_service(state.clone()))).await; + let mut rustus = get_service(state.clone()).await; let request = TestRequest::post() .uri(state.config.test_url().as_str()) .insert_header(("Upload-Length", 100)) @@ -393,7 +395,7 @@ mod tests { #[actix_rt::test] async fn success_final_upload() { let state = State::test_new().await; - let mut rustus = init_service(App::new().configure(rustus_service(state.clone()))).await; + let mut rustus = get_service(state.clone()).await; let mut part1 = state.create_test_file().await; let mut part2 = state.create_test_file().await; part1.is_partial = true; @@ -435,7 +437,7 @@ mod tests { #[actix_rt::test] async fn invalid_final_upload_no_parts() { let state = State::test_new().await; - let mut rustus = init_service(App::new().configure(rustus_service(state.clone()))).await; + let mut rustus = get_service(state.clone()).await; let request = TestRequest::post() .uri(state.config.test_url().as_str()) @@ -449,7 +451,7 @@ mod tests { #[actix_rt::test] async fn success_with_metadata() { let state = State::test_new().await; - let mut rustus = init_service(App::new().configure(rustus_service(state.clone()))).await; + let mut rustus = get_service(state.clone()).await; let request = TestRequest::post() .uri(state.config.test_url().as_str()) .insert_header(("Upload-Length", 100)) @@ -484,7 +486,7 @@ mod tests { #[actix_rt::test] async fn success_with_metadata_wrong_encoding() { let state = State::test_new().await; - let mut rustus = init_service(App::new().configure(rustus_service(state.clone()))).await; + let mut rustus = get_service(state.clone()).await; let request = TestRequest::post() .uri(state.config.test_url().as_str()) .insert_header(("Upload-Length", 100)) @@ -515,7 +517,7 @@ mod tests { #[actix_rt::test] async fn no_length_header() { let state = State::test_new().await; - let mut rustus = init_service(App::new().configure(rustus_service(state.clone()))).await; + let mut rustus = get_service(state.clone()).await; let request = TestRequest::post() .uri(state.config.test_url().as_str()) .to_request(); diff --git a/src/protocol/getting/routes.rs b/src/protocol/getting/routes.rs index 37c51f1..10577f5 100644 --- a/src/protocol/getting/routes.rs +++ b/src/protocol/getting/routes.rs @@ -21,18 +21,17 @@ pub async fn get_file(request: HttpRequest, state: web::Data) -> RustusRe #[cfg(test)] mod test { - use crate::{rustus_service, State}; + use crate::{server::test::get_service, State}; use actix_web::{ http::StatusCode, - test::{call_service, init_service, TestRequest}, - App, + test::{call_service, TestRequest}, }; use bytes::Bytes; #[actix_rt::test] async fn success() { let state = State::test_new().await; - let mut rustus = init_service(App::new().configure(rustus_service(state.clone()))).await; + let mut rustus = get_service(state.clone()).await; let file_info = state.create_test_file().await; state .data_storage @@ -49,7 +48,7 @@ mod test { #[actix_rt::test] async fn unknown_file_id() { let state = State::test_new().await; - let mut rustus = init_service(App::new().configure(rustus_service(state.clone()))).await; + let mut rustus = get_service(state.clone()).await; let request = TestRequest::get() .uri(state.config.file_url("random_str").as_str()) .to_request(); @@ -60,7 +59,7 @@ mod test { #[actix_rt::test] async fn unknown_storage() { let state = State::test_new().await; - let mut rustus = init_service(App::new().configure(rustus_service(state.clone()))).await; + let mut rustus = get_service(state.clone()).await; let mut file_info = state.create_test_file().await; file_info.storage = "unknown_storage".into(); state diff --git a/src/protocol/termination/routes.rs b/src/protocol/termination/routes.rs index 7a2ffb7..2221819 100644 --- a/src/protocol/termination/routes.rs +++ b/src/protocol/termination/routes.rs @@ -2,6 +2,7 @@ use actix_web::{web, HttpRequest, HttpResponse}; use crate::{ errors::{RustusError, RustusResult}, + metrics, notifiers::Hook, State, }; @@ -13,6 +14,7 @@ use crate::{ pub async fn terminate( request: HttpRequest, state: web::Data, + terminated_uploads: web::Data, ) -> RustusResult { let file_id_opt = request.match_info().get("file_id").map(String::from); if let Some(file_id) = file_id_opt { @@ -34,6 +36,7 @@ pub async fn terminate( } state.info_storage.remove_info(file_id.as_str()).await?; state.data_storage.remove_file(&file_info).await?; + terminated_uploads.counter.inc(); if state.config.hook_is_active(Hook::PostTerminate) { let message = state.config.notification_opts.hooks_format.format( &request, @@ -54,18 +57,17 @@ pub async fn terminate( #[cfg(test)] mod tests { - use crate::{rustus_service, State}; + use crate::{server::test::get_service, State}; use actix_web::{ http::StatusCode, - test::{call_service, init_service, TestRequest}, - App, + test::{call_service, TestRequest}, }; use std::path::PathBuf; #[actix_rt::test] async fn success() { let state = State::test_new().await; - let mut rustus = init_service(App::new().configure(rustus_service(state.clone()))).await; + let mut rustus = get_service(state.clone()).await; let file_info = state.create_test_file().await; let request = TestRequest::delete() .uri(state.config.file_url(file_info.id.as_str()).as_str()) @@ -83,7 +85,7 @@ mod tests { #[actix_rt::test] async fn unknown_file_id() { let state = State::test_new().await; - let mut rustus = init_service(App::new().configure(rustus_service(state.clone()))).await; + let mut rustus = get_service(state.clone()).await; let request = TestRequest::delete() .param("file_id", "not_exists") .to_request(); @@ -94,7 +96,7 @@ mod tests { #[actix_rt::test] async fn wrong_storage() { let state = State::test_new().await; - let mut rustus = init_service(App::new().configure(rustus_service(state.clone()))).await; + let mut rustus = get_service(state.clone()).await; let mut file_info = state.create_test_file().await; file_info.storage = "unknown_storage".into(); state diff --git a/src/server.rs b/src/server.rs index 6e86a8c..050ef4e 100644 --- a/src/server.rs +++ b/src/server.rs @@ -20,3 +20,29 @@ pub fn rustus_service(state: State) -> Box { ); }) } + +#[cfg(test)] +pub mod test { + use super::rustus_service; + use crate::{metrics, state::State}; + use actix_web::{dev::ServiceResponse, test::init_service, web, App}; + + pub async fn get_service( + state: State, + ) -> impl actix_web::dev::Service< + actix_http::Request, + Response = ServiceResponse, + Error = actix_web::Error, + > { + init_service( + App::new() + .app_data(web::Data::new(metrics::ActiveUploads::new().unwrap())) + .app_data(web::Data::new(metrics::StartedUploads::new().unwrap())) + .app_data(web::Data::new(metrics::FinishedUploads::new().unwrap())) + .app_data(web::Data::new(metrics::TerminatedUploads::new().unwrap())) + .app_data(web::Data::new(metrics::UploadSizes::new().unwrap())) + .configure(rustus_service(state.clone())), + ) + .await + } +} diff --git a/src/storages/file_storage.rs b/src/storages/file_storage.rs index af6757b..8f1951d 100644 --- a/src/storages/file_storage.rs +++ b/src/storages/file_storage.rs @@ -129,7 +129,7 @@ impl Storage for FileStorage { .open(file_path.as_path()) .map_err(|err| { error!("{:?}", err); - RustusError::FileAlreadyExists(info.id.clone()) + RustusError::FileAlreadyExists })?; Ok(file_path.display().to_string()) })