From 708e7da301df831882f7844a0e796de9af3954d5 Mon Sep 17 00:00:00 2001 From: asonix Date: Sat, 25 Nov 2023 19:59:28 -0600 Subject: [PATCH 01/27] Update opentelemetry, ring, http-signature-normalization, tracing-log --- Cargo.lock | 916 +++++++++++++++++++++++++++++------------------- Cargo.toml | 24 +- src/main.rs | 28 +- src/requests.rs | 2 +- 4 files changed, 577 insertions(+), 393 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3dd5d19..837c342 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -65,9 +65,9 @@ dependencies = [ "actix-service", "actix-tls", "actix-utils", - "ahash 0.8.3", - "base64 0.21.3", - "bitflags 2.4.0", + "ahash 0.8.6", + "base64 0.21.5", + "bitflags 2.4.1", "brotli", "bytes", "bytestring", @@ -100,7 +100,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" dependencies = [ "quote", - "syn 2.0.31", + "syn 2.0.39", ] [[package]] @@ -139,7 +139,7 @@ dependencies = [ "futures-core", "futures-util", "mio", - "socket2 0.5.3", + "socket2 0.5.5", "tokio", "tracing", ] @@ -200,7 +200,7 @@ dependencies = [ "actix-service", "actix-tls", "actix-utils", - "ahash 0.8.3", + "ahash 0.8.6", "bytes", "bytestring", "cfg-if", @@ -219,7 +219,7 @@ dependencies = [ "serde_json", "serde_urlencoded", "smallvec", - "socket2 0.5.3", + "socket2 0.5.5", "time", "url", ] @@ -254,9 +254,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" dependencies = [ "getrandom", "once_cell", @@ -265,14 +265,15 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if", "getrandom", "once_cell", "version_check", + "zerocopy", ] [[package]] @@ -286,9 +287,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.0.5" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c378d78423fdad8089616f827526ee33c19f2fddbd5de1629152c9593ba4783" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] @@ -329,9 +330,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.5.0" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f58811cfac344940f1a400b6e6231ce35171f614f26439e80f8c1465c5cc0c" +checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" dependencies = [ "anstyle", "anstyle-parse", @@ -343,15 +344,15 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.2" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c4c2c83f81532e5845a733998b6971faca23490340a418e9b72a3ec9de12ea" +checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" [[package]] name = "anstyle-parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" dependencies = [ "utf8parse", ] @@ -367,9 +368,9 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "2.1.0" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58f54d10c6dfa51283a066ceab3ec1ab78d13fae00aa49243a45e4571fb79dfd" +checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" dependencies = [ "anstyle", "windows-sys", @@ -392,8 +393,9 @@ dependencies = [ "actix-webfinger", "ammonia", "anyhow", + "async-cpupool", "background-jobs", - "base64 0.21.3", + "base64 0.21.5", "bcrypt", "clap", "config", @@ -411,6 +413,7 @@ dependencies = [ "minify-html", "opentelemetry", "opentelemetry-otlp", + "opentelemetry_sdk", "pin-project-lite", "quanta", "rand", @@ -426,12 +429,12 @@ dependencies = [ "serde", "serde_json", "sled", - "streem", + "streem 0.1.1", "teloxide", "thiserror", "time", "tokio", - "toml 0.7.8", + "toml 0.8.8", "tracing", "tracing-actix-web", "tracing-error", @@ -461,15 +464,47 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" +[[package]] +name = "async-cpupool" +version = "0.1.0" +source = "git+https://git.asonix.dog/safe-async/async-cpupool#2884d854fff83e96ad70b8dc06e947377d53e1b7" +dependencies = [ + "flume", + "metrics", + "tracing", +] + +[[package]] +name = "async-stream" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" +dependencies = [ + "async-stream-impl", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + [[package]] name = "async-trait" -version = "0.1.73" +version = "0.1.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" +checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.39", ] [[package]] @@ -596,9 +631,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.3" +version = "0.21.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "414dcefbc63d77c526a76b3afcf6fbb9b5e2791c19c3aa2297733208750c6e53" +checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" [[package]] name = "base64ct" @@ -612,7 +647,7 @@ version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28d1c9c15093eb224f0baa400f38fcd713fc1391a6f1c389d886beef146d60a3" dependencies = [ - "base64 0.21.3", + "base64 0.21.5", "blowfish", "getrandom", "subtle", @@ -627,9 +662,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" [[package]] name = "block-buffer" @@ -652,9 +687,9 @@ dependencies = [ [[package]] name = "brotli" -version = "3.3.4" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1a0b1dbcc8ae29329621f8d4f0d835787c1c38bb1401979b49d13b0b305ff68" +checksum = "516074a47ef4bce09577a3b379392300159ce5b1ba2e501ff1c819950066100f" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -663,9 +698,9 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "2.3.4" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b6561fd3f895a11e8f72af2cb7d22e08366bebc2b6b57f7744c4bda27034744" +checksum = "4e2e4afe60d7dd600fdd3de8d0f08c2b7ec039712e3b6137ff98b7004e82de4f" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -673,21 +708,21 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "bytecount" -version = "0.6.3" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c676a478f63e9fa2dd5368a42f28bba0d6c560b775f38583c8bbaa7fcd67c9c" +checksum = "e1e5f035d16fc623ae5f74981db80a439803888314e3a555fd6f04acd51a3205" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" @@ -697,9 +732,9 @@ checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "bytestring" -version = "1.3.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "238e4886760d98c4f899360c834fa93e62cf7f721ac3c2da375cbdf4b8679aae" +checksum = "74d80203ea6b29df88012294f62733de21cfeab47f17b41af3a38bc30a03ee72" dependencies = [ "bytes", ] @@ -721,9 +756,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.30" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defd4e7873dbddba6c7c91e199c7fcb946abc4a6a4ac3195400bcfb01b5de877" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ "num-traits", ] @@ -740,9 +775,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.2" +version = "4.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a13b88d2c62ff462f88e4a121f17a82c1af05693a2f192b5c38d14de73c19f6" +checksum = "2275f18819641850fa26c89acc84d465c1bf91ce57bc2748b28c420473352f64" dependencies = [ "clap_builder", "clap_derive", @@ -750,9 +785,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.2" +version = "4.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bb9faaa7c2ef94b2743a21f5a29e6f0010dff4caa69ac8e9d6cf8b6fa74da08" +checksum = "07cdf1b148b25c1e1f7a42225e30a0d99a615cd4637eae7365548dd4529b95bc" dependencies = [ "anstream", "anstyle", @@ -762,21 +797,21 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.4.2" +version = "4.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" +checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.39", ] [[package]] name = "clap_lex" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" +checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" [[package]] name = "colorchoice" @@ -786,9 +821,9 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "config" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d379af7f68bfc21714c6c7dea883544201741d2ce8274bb12fa54f89507f52a7" +checksum = "23738e11972c7643e4ec947840fc463b6a571afcd3e735bdfce7d03c7a784aca" dependencies = [ "async-trait", "json5", @@ -805,26 +840,27 @@ dependencies = [ [[package]] name = "console-api" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2895653b4d9f1538a83970077cb01dfc77a4810524e51a110944688e916b18e" +checksum = "fd326812b3fd01da5bb1af7d340d0d555fd3d4b641e7f1dfcf5962a902952787" dependencies = [ - "prost", + "futures-core", + "prost 0.12.3", "prost-types", - "tonic", + "tonic 0.10.2", "tracing-core", ] [[package]] name = "console-subscriber" -version = "0.1.10" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4cf42660ac07fcebed809cfe561dd8730bcd35b075215e6479c516bcd0d11cb" +checksum = "7481d4c57092cd1c19dd541b92bdce883de840df30aa5d03fd48a3935c01842e" dependencies = [ "console-api", "crossbeam-channel", "crossbeam-utils", - "futures", + "futures-task", "hdrhistogram", "humantime", "prost-types", @@ -833,7 +869,7 @@ dependencies = [ "thread_local", "tokio", "tokio-stream", - "tonic", + "tonic 0.10.2", "tracing", "tracing-core", "tracing-subscriber", @@ -851,11 +887,27 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" + [[package]] name = "cpufeatures" -version = "0.2.9" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" dependencies = [ "libc", ] @@ -964,10 +1016,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if", - "hashbrown 0.14.0", + "hashbrown 0.14.2", "lock_api", "once_cell", - "parking_lot_core 0.9.8", + "parking_lot_core 0.9.9", ] [[package]] @@ -983,10 +1035,11 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" +checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" dependencies = [ + "powerfmt", "serde", ] @@ -1080,15 +1133,15 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "fastrand" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "flate2" -version = "1.0.27" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" dependencies = [ "crc32fast", "miniz_oxide", @@ -1114,9 +1167,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] @@ -1143,9 +1196,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" dependencies = [ "futures-channel", "futures-core", @@ -1158,9 +1211,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" dependencies = [ "futures-core", "futures-sink", @@ -1168,15 +1221,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" [[package]] name = "futures-executor" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" dependencies = [ "futures-core", "futures-task", @@ -1185,38 +1238,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" [[package]] name = "futures-macro" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.39", ] [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" dependencies = [ "futures-channel", "futures-core", @@ -1251,9 +1304,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" dependencies = [ "cfg-if", "js-sys", @@ -1264,15 +1317,21 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "h2" -version = "0.3.21" +version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" +checksum = "4d6250322ef6e60f93f9a2162799302cd6f68f79f6e5d85c8c16f14d1d958178" dependencies = [ "bytes", "fnv", @@ -1280,7 +1339,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 1.9.3", + "indexmap 2.1.0", "slab", "tokio", "tokio-util", @@ -1293,7 +1352,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash 0.7.6", + "ahash 0.7.7", ] [[package]] @@ -1302,26 +1361,26 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ff8ae62cd3a9102e5637afc8452c55acf3844001bd5374e0b0bd7b6616c038" dependencies = [ - "ahash 0.8.3", + "ahash 0.8.6", ] [[package]] name = "hashbrown" -version = "0.14.0" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" dependencies = [ - "ahash 0.8.3", + "ahash 0.8.6", "allocator-api2", ] [[package]] name = "hdrhistogram" -version = "7.5.2" +version = "7.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f19b9f54f7c7f55e31401bb647626ce0cf0f67b0004982ce815b3ee72a02aa8" +checksum = "765c9198f173dd59ce26ff9f95ef0aafd0a0fe01fb9d72841bc5066a4c06511d" dependencies = [ - "base64 0.13.1", + "base64 0.21.5", "byteorder", "flate2", "nom", @@ -1336,9 +1395,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "html5ever" @@ -1356,9 +1415,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.9" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" dependencies = [ "bytes", "fnv", @@ -1387,18 +1446,18 @@ dependencies = [ [[package]] name = "http-signature-normalization-actix" -version = "0.10.4" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8d7de237db731e75fbfa0ebeeb70e366f5f9cdcf45af4a41eca8516b80162ca" +checksum = "e0fb2730dc2a3a91b3386b6f7bd2b0414a707f33f5617cf7e1cba8562b1ea557" dependencies = [ "actix-http", "actix-rt", "actix-web", - "base64 0.13.1", + "base64 0.21.5", "futures-core", "http-signature-normalization", "ring", - "streem", + "streem 0.2.0", "thiserror", "tokio", "tracing", @@ -1408,12 +1467,12 @@ dependencies = [ [[package]] name = "http-signature-normalization-reqwest" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10cfb84663420ec12c4422820bfdf5e8e5e57467892587f43ac432e73ebce880" +checksum = "86048ef6b1d59bcb2cdde0100bb16b1a29ce78ab6dd4a90706ba0791a2831b5a" dependencies = [ "async-trait", - "base64 0.13.1", + "base64 0.21.5", "http-signature-normalization", "httpdate", "reqwest", @@ -1457,7 +1516,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.9", + "socket2 0.4.10", "tokio", "tower-service", "tracing", @@ -1466,9 +1525,9 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.24.1" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http", @@ -1498,9 +1557,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -1524,12 +1583,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ "equivalent", - "hashbrown 0.14.0", + "hashbrown 0.14.2", ] [[package]] @@ -1552,9 +1611,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "iri-string" @@ -1601,9 +1660,9 @@ checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" dependencies = [ "wasm-bindgen", ] @@ -1636,15 +1695,15 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.147" +version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "libm" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "linked-hash-map" @@ -1654,27 +1713,26 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "local-channel" -version = "0.1.3" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f303ec0e94c6c54447f84f3b0ef7af769858a9c4ef56ef2a986d3dcd4c3fc9c" +checksum = "b6cbc85e69b8df4b8bb8b89ec634e7189099cea8927a276b7384ce5488e53ec8" dependencies = [ "futures-core", "futures-sink", - "futures-util", "local-waker", ] [[package]] name = "local-waker" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e34f76eb3611940e0e7d53a9aaa4e6a3151f69541a282fd0dad5571420c53ff1" +checksum = "4d873d7c67ce09b42110d801813efbc9364414e356be9935700d368351657487" [[package]] name = "lock_api" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ "autocfg", "scopeguard", @@ -1692,7 +1750,7 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4a83fb7698b3643a0e34f9ae6f2e8f0178c0fd42f8b59d493aa271ff3a5bf21" dependencies = [ - "hashbrown 0.14.0", + "hashbrown 0.14.2", ] [[package]] @@ -1741,9 +1799,9 @@ dependencies = [ [[package]] name = "matchit" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed1202b2a6f884ae56f04cff409ab315c5ce26b5e58d7412e484f01fd52f52ef" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" [[package]] name = "md5" @@ -1753,9 +1811,9 @@ checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" [[package]] name = "memchr" -version = "2.6.3" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "memoffset" @@ -1772,7 +1830,7 @@ version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fde3af1a009ed76a778cb84fdef9e7dbbdf5775ae3e4cc1f434a6a307f6f76c5" dependencies = [ - "ahash 0.8.3", + "ahash 0.8.6", "metrics-macros", "portable-atomic", ] @@ -1783,7 +1841,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a4964177ddfdab1e3a2b37aec7cf320e14169abb0ed73999f558136409178d5" dependencies = [ - "base64 0.21.3", + "base64 0.21.5", "hyper", "indexmap 1.9.3", "ipnet", @@ -1802,7 +1860,7 @@ checksum = "ddece26afd34c31585c74a4db0630c376df271c285d682d1e55012197830b6df" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.39", ] [[package]] @@ -1811,14 +1869,14 @@ version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4de2ed6e491ed114b40b732e4d1659a9d53992ebd87490c44a6ffe23739d973e" dependencies = [ - "aho-corasick 1.0.5", + "aho-corasick 1.1.2", "crossbeam-epoch", "crossbeam-utils", "hashbrown 0.13.1", "indexmap 1.9.3", "metrics", "num_cpus", - "ordered-float", + "ordered-float 3.9.2", "quanta", "radix_trie", "sketches-ddsketch", @@ -1881,9 +1939,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" dependencies = [ "libc", "log", @@ -1891,6 +1949,12 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "mutually_exclusive_features" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d02c0b00610773bb7fc61d85e13d86c7858cbdf00e1a120bfc41bc055dbaa0e" + [[package]] name = "nanorand" version = "0.7.0" @@ -2005,9 +2069,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", "libm", @@ -2040,88 +2104,77 @@ checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "opentelemetry" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9591d937bc0e6d2feb6f71a559540ab300ea49955229c347a517a28d27784c54" +checksum = "1e32339a5dc40459130b3bd269e9892439f55b33e772d2a9d402a789baaf4e8a" dependencies = [ - "opentelemetry_api", - "opentelemetry_sdk", + "futures-core", + "futures-sink", + "indexmap 2.1.0", + "js-sys", + "once_cell", + "pin-project-lite", + "thiserror", + "urlencoding", ] [[package]] name = "opentelemetry-otlp" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e5e5a5c4135864099f3faafbe939eb4d7f9b80ebf68a8448da961b32a7c1275" +checksum = "f24cda83b20ed2433c68241f918d0f6fdec8b1d43b7a9590ab4420c5095ca930" dependencies = [ "async-trait", "futures-core", "http", + "opentelemetry", "opentelemetry-proto", "opentelemetry-semantic-conventions", - "opentelemetry_api", "opentelemetry_sdk", - "prost", + "prost 0.11.9", "thiserror", "tokio", - "tonic", + "tonic 0.9.2", ] [[package]] name = "opentelemetry-proto" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1e3f814aa9f8c905d0ee4bde026afd3b2577a97c10e1699912e3e44f0c4cbeb" +checksum = "a2e155ce5cc812ea3d1dffbd1539aed653de4bf4882d60e6e04dcf0901d674e1" dependencies = [ - "opentelemetry_api", + "opentelemetry", "opentelemetry_sdk", - "prost", - "tonic", + "prost 0.11.9", + "tonic 0.9.2", ] [[package]] name = "opentelemetry-semantic-conventions" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73c9f9340ad135068800e7f1b24e9e09ed9e7143f5bf8518ded3d3ec69789269" +checksum = "f5774f1ef1f982ef2a447f6ee04ec383981a3ab99c8e77a1a7b30182e65bbc84" dependencies = [ "opentelemetry", ] -[[package]] -name = "opentelemetry_api" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a81f725323db1b1206ca3da8bb19874bbd3f57c3bcd59471bfb04525b265b9b" -dependencies = [ - "futures-channel", - "futures-util", - "indexmap 1.9.3", - "js-sys", - "once_cell", - "pin-project-lite", - "thiserror", - "urlencoding", -] - [[package]] name = "opentelemetry_sdk" -version = "0.20.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa8e705a0612d48139799fcbaba0d4a90f06277153e43dd2bdc16c6f0edd8026" +checksum = "968ba3f2ca03e90e5187f5e4f46c791ef7f2c163ae87789c8ce5f5ca3b7b7de5" dependencies = [ "async-trait", "crossbeam-channel", "futures-channel", "futures-executor", "futures-util", + "glob", "once_cell", - "opentelemetry_api", - "ordered-float", + "opentelemetry", + "ordered-float 4.1.1", "percent-encoding", "rand", - "regex", - "serde_json", "thiserror", "tokio", "tokio-stream", @@ -2129,9 +2182,18 @@ dependencies = [ [[package]] name = "ordered-float" -version = "3.9.1" +version = "3.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a54938017eacd63036332b4ae5c8a49fc8c0c1d6d629893057e4f13609edd06" +checksum = "f1e1c390732d15f1d48471625cd92d154e66db2c56645e29a9cd26f4699f72dc" +dependencies = [ + "num-traits", +] + +[[package]] +name = "ordered-float" +version = "4.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "536900a8093134cf9ccf00a27deb3532421099e958d9dd431135d0c7543ca1e8" dependencies = [ "num-traits", ] @@ -2170,7 +2232,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core 0.9.8", + "parking_lot_core 0.9.9", ] [[package]] @@ -2189,13 +2251,13 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.8" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.3.5", + "redox_syscall 0.4.1", "smallvec", "windows-targets", ] @@ -2234,15 +2296,15 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.3" +version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a4d085fd991ac8d5b05a147b437791b4260b76326baf0fc60cf7c9c27ecd33" +checksum = "ae9cee2a55a544be8b89dc6848072af97a20f2422603c10865be2a42b580fff5" dependencies = [ "memchr", "thiserror", @@ -2251,9 +2313,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.3" +version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bee7be22ce7918f641a33f08e3f43388c7656772244e2bbb2477f44cc9021a" +checksum = "81d78524685f5ef2a3b3bd1cafbc9fcabb036253d9b1463e726a91cd16e2dfc2" dependencies = [ "pest", "pest_generator", @@ -2261,22 +2323,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.3" +version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1511785c5e98d79a05e8a6bc34b4ac2168a0e3e92161862030ad84daa223141" +checksum = "68bd1206e71118b5356dae5ddc61c8b11e28b09ef6a31acbd15ea48a28e0c227" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.39", ] [[package]] name = "pest_meta" -version = "2.7.3" +version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42f0394d3123e33353ca5e1e89092e533d2cc490389f2bd6131c43c634ebc5f" +checksum = "7c747191d4ad9e4a4ab9c8798f1e82a39affe7ef9648390b7e5548d18e099de6" dependencies = [ "once_cell", "pest", @@ -2338,7 +2400,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.39", ] [[package]] @@ -2376,9 +2438,15 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.4.3" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bccab0e7fd7cc19f820a1c8c91720af652d0c88dc9664dd72aef2614f04af3b" + +[[package]] +name = "powerfmt" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31114a898e107c51bb1609ffaf55a0e011cf6a4d7f1170d0015a165082c0338b" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" @@ -2418,9 +2486,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" dependencies = [ "unicode-ident", ] @@ -2432,7 +2500,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" dependencies = [ "bytes", - "prost-derive", + "prost-derive 0.11.9", +] + +[[package]] +name = "prost" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" +dependencies = [ + "bytes", + "prost-derive 0.12.3", ] [[package]] @@ -2448,13 +2526,26 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "prost-derive" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" +dependencies = [ + "anyhow", + "itertools 0.11.0", + "proc-macro2", + "quote", + "syn 2.0.39", +] + [[package]] name = "prost-types" -version = "0.11.9" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" +checksum = "193898f59edcf43c26227dcd4c8427f00d99d61e95dcde58dabd49fa291d470e" dependencies = [ - "prost", + "prost 0.12.3", ] [[package]] @@ -2551,23 +2642,23 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.3.5" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ "bitflags 1.3.2", ] [[package]] name = "regex" -version = "1.9.5" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" dependencies = [ - "aho-corasick 1.0.5", + "aho-corasick 1.1.2", "memchr", - "regex-automata 0.3.8", - "regex-syntax 0.7.5", + "regex-automata 0.4.3", + "regex-syntax 0.8.2", ] [[package]] @@ -2581,13 +2672,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.8" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" dependencies = [ - "aho-corasick 1.0.5", + "aho-corasick 1.1.2", "memchr", - "regex-syntax 0.7.5", + "regex-syntax 0.8.2", ] [[package]] @@ -2598,17 +2689,17 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.5" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "reqwest" -version = "0.11.20" +version = "0.11.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e9ad3fe7488d7e34558a2033d45a0c90b72d97b4f80705666fea71472e2e6a1" +checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" dependencies = [ - "base64 0.21.3", + "base64 0.21.5", "bytes", "encoding_rs", "futures-core", @@ -2631,6 +2722,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", + "system-configuration", "tokio", "tokio-rustls", "tokio-util", @@ -2646,9 +2738,9 @@ dependencies = [ [[package]] name = "reqwest-middleware" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff44108c7925d082f2861e683a88618b68235ad9cdc60d64d9d1188efc951cdb" +checksum = "88a3e86aa6053e59030e7ce2d2a3b258dd08fc2d337d52f73f6cb480f5858690" dependencies = [ "anyhow", "async-trait", @@ -2677,17 +2769,16 @@ dependencies = [ [[package]] name = "ring" -version = "0.16.20" +version = "0.17.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +checksum = "fb0205304757e5d899b9c2e448b867ffd03ae7f988002e47cd24954391394d0b" dependencies = [ "cc", + "getrandom", "libc", - "once_cell", - "spin 0.5.2", + "spin 0.9.8", "untrusted", - "web-sys", - "winapi", + "windows-sys", ] [[package]] @@ -2703,16 +2794,14 @@ dependencies = [ [[package]] name = "rsa" -version = "0.9.2" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ab43bb47d23c1a631b4b680199a45255dce26fa9ab2fa902581f624ff13e6a8" +checksum = "6a3211b01eea83d80687da9eef70e39d65144a3894866a5153a2723e425a157f" dependencies = [ - "byteorder", "const-oid", "digest", "num-bigint-dig", "num-integer", - "num-iter", "num-traits", "pkcs1", "pkcs8", @@ -2729,7 +2818,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "88ca6a6947c6fe6454c93c3bb65b92f9680e6f9e906e75e30631110f2227344c" dependencies = [ - "base64 0.21.3", + "base64 0.21.5", "num-bigint-dig", "rsa", "thiserror", @@ -2737,9 +2826,9 @@ dependencies = [ [[package]] name = "rsass" -version = "0.28.2" +version = "0.28.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e5c4ce6e9720b51f90dbd5f38c011d0e409fab722ee6b9bb15f5e5550500353" +checksum = "7c952ecc29562e37ad8921caa8f6f6a8bc40614f78ac2e2e29f5ea7c00ce47d5" dependencies = [ "arc-swap", "fastrand", @@ -2758,7 +2847,7 @@ version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b0a930679d54e46fa4e66be3d9a333026da04d2b659e42aab4dfd1586452815" dependencies = [ - "base64 0.21.3", + "base64 0.21.5", "bytecount", "itertools 0.11.0", "md5", @@ -2800,9 +2889,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.7" +version = "0.21.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" +checksum = "629648aced5775d558af50b2b4c7b02983a04b312126d45eeead26e7caa498b9" dependencies = [ "log", "ring", @@ -2812,18 +2901,18 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "base64 0.21.3", + "base64 0.21.5", ] [[package]] name = "rustls-webpki" -version = "0.101.4" +version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d93931baf2d282fff8d3a532bbfd7653f734643161b87e3e01e59a04439bf0d" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ "ring", "untrusted", @@ -2849,9 +2938,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sct" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ "ring", "untrusted", @@ -2859,35 +2948,35 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.18" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" [[package]] name = "serde" -version = "1.0.188" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.188" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.39", ] [[package]] name = "serde_json" -version = "1.0.106" +version = "1.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cc66a619ed80bf7a0f6b17dd063a84b88f6dea1813737cf469aef1d081142c2" +checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" dependencies = [ "itoa", "ryu", @@ -2896,9 +2985,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186" +checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" dependencies = [ "serde", ] @@ -2929,9 +3018,9 @@ dependencies = [ [[package]] name = "sha1" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", "cpufeatures", @@ -2940,9 +3029,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.7" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", @@ -2951,9 +3040,9 @@ dependencies = [ [[package]] name = "sharded-slab" -version = "0.1.4" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" dependencies = [ "lazy_static", ] @@ -2969,9 +3058,9 @@ dependencies = [ [[package]] name = "signature" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest", "rand_core", @@ -3016,15 +3105,15 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.0" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" [[package]] name = "socket2" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ "libc", "winapi", @@ -3032,9 +3121,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.3" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" dependencies = [ "libc", "windows-sys", @@ -3075,6 +3164,16 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "streem" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8b0c8184b0fe05b37dd75d66205195cd57563c6c87cb92134a025a34a6ab34" +dependencies = [ + "futures-core", + "pin-project-lite", +] + [[package]] name = "string_cache" version = "0.8.7" @@ -3126,9 +3225,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.31" +version = "2.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718fa2415bcb8d8bd775917a1bf12a7931b6dfa890753378538118181e0cb398" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" dependencies = [ "proc-macro2", "quote", @@ -3141,6 +3240,27 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "take_mut" version = "0.2.2" @@ -3244,22 +3364,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.48" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" +checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.48" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" +checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.39", ] [[package]] @@ -3274,12 +3394,13 @@ dependencies = [ [[package]] name = "time" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f6bb557fd245c28e6411aa56b6403c689ad95061f50e4be16c274e70a17e48" +checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" dependencies = [ "deranged", "itoa", + "powerfmt", "serde", "time-core", "time-macros", @@ -3287,15 +3408,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a942f44339478ef67935ab2bbaec2fb0322496cf3cbe84b261e06ac3814c572" +checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" dependencies = [ "time-core", ] @@ -3317,9 +3438,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.32.0" +version = "1.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" +checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" dependencies = [ "backtrace", "bytes", @@ -3328,7 +3449,7 @@ dependencies = [ "parking_lot 0.12.1", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.3", + "socket2 0.5.5", "tokio-macros", "tracing", "windows-sys", @@ -3346,13 +3467,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.39", ] [[package]] @@ -3378,9 +3499,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.8" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ "bytes", "futures-core", @@ -3401,9 +3522,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.8" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" +checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" dependencies = [ "serde", "serde_spanned", @@ -3413,20 +3534,20 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.19.15" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" dependencies = [ - "indexmap 2.0.0", + "indexmap 2.1.0", "serde", "serde_spanned", "toml_datetime", @@ -3441,7 +3562,7 @@ checksum = "3082666a3a6433f7f511c7192923fa1fe07c69332d3c6a2e6bb040b569199d5a" dependencies = [ "async-trait", "axum", - "base64 0.21.3", + "base64 0.21.5", "bytes", "futures-core", "futures-util", @@ -3452,7 +3573,34 @@ dependencies = [ "hyper-timeout", "percent-encoding", "pin-project", - "prost", + "prost 0.11.9", + "tokio", + "tokio-stream", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tonic" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d560933a0de61cf715926b9cac824d4c883c2c43142f787595e48280c40a1d0e" +dependencies = [ + "async-stream", + "async-trait", + "axum", + "base64 0.21.5", + "bytes", + "h2", + "http", + "http-body", + "hyper", + "hyper-timeout", + "percent-encoding", + "pin-project", + "prost 0.12.3", "tokio", "tokio-stream", "tower", @@ -3495,11 +3643,10 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "log", "pin-project-lite", "tracing-attributes", @@ -3508,11 +3655,12 @@ dependencies = [ [[package]] name = "tracing-actix-web" -version = "0.7.6" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c0b08ce08cbde6a96fc1e4ebb8132053e53ec7a5cd27eef93ede6b73ebbda06" +checksum = "1fe0d5feac3f4ca21ba33496bcb1ccab58cca6412b1405ae80f0581541e0ca78" dependencies = [ "actix-web", + "mutually_exclusive_features", "pin-project", "tracing", "uuid", @@ -3520,20 +3668,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.39", ] [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", "valuable", @@ -3561,21 +3709,22 @@ dependencies = [ [[package]] name = "tracing-log" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" dependencies = [ - "lazy_static", "log", + "once_cell", "tracing-core", ] [[package]] name = "tracing-opentelemetry" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75327c6b667828ddc28f5e3f169036cb793c3f588d83bf0f262a7f062ffed3c8" +checksum = "c67ac25c5407e7b961fafc6f7e9aa5958fd297aada2d20fa2ae1737357e55596" dependencies = [ + "js-sys", "once_cell", "opentelemetry", "opentelemetry_sdk", @@ -3584,13 +3733,14 @@ dependencies = [ "tracing-core", "tracing-log", "tracing-subscriber", + "web-time", ] [[package]] name = "tracing-subscriber" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ "matchers", "nu-ansi-term", @@ -3612,9 +3762,9 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ucd-trie" @@ -3639,9 +3789,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" @@ -3654,15 +3804,15 @@ dependencies = [ [[package]] name = "untrusted" -version = "0.7.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", "idna", @@ -3690,9 +3840,9 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "1.4.1" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" +checksum = "5e395fcf16a7a3d8127ec99782007af141946b4795001f876d54fb0d55978560" dependencies = [ "getrandom", "serde", @@ -3727,9 +3877,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -3737,24 +3887,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.39", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.37" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +checksum = "9afec9963e3d0994cac82455b2b3502b81a7f40f9a0d32181f7528d9f4b43e02" dependencies = [ "cfg-if", "js-sys", @@ -3764,9 +3914,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3774,22 +3924,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.39", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" [[package]] name = "wasm-streams" @@ -3806,9 +3956,19 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "57099a701fb3a8043f993e8228dc24229c7b942e2b009a1b962e54489ba1d3bf" dependencies = [ "js-sys", "wasm-bindgen", @@ -3816,9 +3976,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.25.2" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" +checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" [[package]] name = "winapi" @@ -3910,9 +4070,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winnow" -version = "0.5.15" +version = "0.5.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc" +checksum = "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b" dependencies = [ "memchr", ] @@ -3936,8 +4096,28 @@ dependencies = [ "linked-hash-map", ] +[[package]] +name = "zerocopy" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + [[package]] name = "zeroize" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" diff --git a/Cargo.toml b/Cargo.toml index 603b5ce..ac798f8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ name = "relay" path = "src/main.rs" [features] -console = ["console-subscriber"] +console = ["dep:console-subscriber"] default = [] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -28,11 +28,12 @@ actix-webfinger = { version = "0.5.0", default-features = false } activitystreams = "0.7.0-alpha.25" activitystreams-ext = "0.1.0-alpha.3" ammonia = "3.1.0" +async-cpupool = { version = "0.1.0", git = "https://git.asonix.dog/safe-async/async-cpupool" } bcrypt = "0.15" base64 = "0.21" clap = { version = "4.0.0", features = ["derive"] } config = "0.13.0" -console-subscriber = { version = "0.1", optional = true } +console-subscriber = { version = "0.2", optional = true } dashmap = "5.1.0" dotenv = "0.15.0" flume = "0.11.0" @@ -44,15 +45,16 @@ metrics-exporter-prometheus = { version = "0.12.0", default-features = false, fe metrics-util = "0.15.0" mime = "0.3.16" minify-html = "0.11.0" -opentelemetry = { version = "0.20", features = ["rt-tokio"] } -opentelemetry-otlp = "0.13" +opentelemetry = "0.21" +opentelemetry_sdk = { version = "0.21", features = ["rt-tokio"] } +opentelemetry-otlp = "0.14" pin-project-lite = "0.2.9" quanta = "0.11.0" rand = "0.8" reqwest = { version = "0.11", default-features = false, features = ["rustls-tls", "stream"]} reqwest-middleware = "0.2" reqwest-tracing = "0.4.5" -ring = "0.16.20" +ring = "0.17.5" rsa = { version = "0.9" } rsa-magic-public-key = "0.8.0" rustls = "0.21.0" @@ -70,8 +72,8 @@ time = { version = "0.3.17", features = ["serde"] } tracing = "0.1" tracing-error = "0.2" tracing-futures = "0.2" -tracing-log = "0.1" -tracing-opentelemetry = "0.21" +tracing-log = "0.2" +tracing-opentelemetry = "0.22" tracing-subscriber = { version = "0.3", features = [ "ansi", "env-filter", @@ -87,23 +89,23 @@ default-features = false features = ["background-jobs-actix", "error-logging"] [dependencies.http-signature-normalization-actix] -version = "0.10.1" +version = "0.11.0" default-features = false features = ["server", "ring"] [dependencies.http-signature-normalization-reqwest] -version = "0.10.0" +version = "0.11.0" default-features = false features = ["middleware", "ring"] [dependencies.tracing-actix-web] -version = "0.7.6" +version = "0.7.9" [build-dependencies] anyhow = "1.0" dotenv = "0.15.0" ructe = { version = "0.17.0", features = ["sass", "mime03"] } -toml = "0.7.0" +toml = "0.8.0" [profile.dev.package.rsa] opt-level = 3 diff --git a/src/main.rs b/src/main.rs index 0373afb..427ca29 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,8 +13,9 @@ use error::Error; use http_signature_normalization_actix::middleware::VerifySignature; use metrics_exporter_prometheus::PrometheusBuilder; use metrics_util::layers::FanoutBuilder; -use opentelemetry::{sdk::Resource, KeyValue}; +use opentelemetry::KeyValue; use opentelemetry_otlp::WithExportConfig; +use opentelemetry_sdk::Resource; use reqwest_middleware::ClientWithMiddleware; use rustls::ServerConfig; use tracing_actix_web::TracingLogger; @@ -81,18 +82,19 @@ fn init_subscriber( let subscriber = subscriber.with(console_layer); if let Some(url) = opentelemetry_url { - let tracer = - opentelemetry_otlp::new_pipeline() - .tracing() - .with_trace_config(opentelemetry::sdk::trace::config().with_resource( - Resource::new(vec![KeyValue::new("service.name", software_name)]), - )) - .with_exporter( - opentelemetry_otlp::new_exporter() - .tonic() - .with_endpoint(url.as_str()), - ) - .install_batch(opentelemetry::runtime::Tokio)?; + let tracer = opentelemetry_otlp::new_pipeline() + .tracing() + .with_trace_config( + opentelemetry_sdk::trace::config().with_resource(Resource::new(vec![ + KeyValue::new("service.name", software_name), + ])), + ) + .with_exporter( + opentelemetry_otlp::new_exporter() + .tonic() + .with_endpoint(url.as_str()), + ) + .install_batch(opentelemetry_sdk::runtime::Tokio)?; let otel_layer = tracing_opentelemetry::layer() .with_tracer(tracer) diff --git a/src/requests.rs b/src/requests.rs index 08c1002..60cc9af 100644 --- a/src/requests.rs +++ b/src/requests.rs @@ -432,7 +432,7 @@ struct Signer { impl Signer { fn sign(&self, signing_string: &str) -> Result { - let mut signature = vec![0; self.private_key.public_modulus_len()]; + let mut signature = vec![0; self.private_key.public().modulus_len()]; self.private_key .sign( From 8540e93469ebda44cef78bbe3b6d7df533aff9cd Mon Sep 17 00:00:00 2001 From: asonix Date: Sat, 25 Nov 2023 20:14:18 -0600 Subject: [PATCH 02/27] Use async-cpupool --- Cargo.lock | 4 +- Cargo.toml | 3 +- src/main.rs | 11 ++-- src/spawner.rs | 144 ++++++++----------------------------------------- 4 files changed, 34 insertions(+), 128 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 837c342..1531253 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1746,9 +1746,9 @@ checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "lru" -version = "0.11.1" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a83fb7698b3643a0e34f9ae6f2e8f0178c0fd42f8b59d493aa271ff3a5bf21" +checksum = "2994eeba8ed550fd9b47a0b38f0242bc3344e496483c6180b69139cc2fa5d1d7" dependencies = [ "hashbrown 0.14.2", ] diff --git a/Cargo.toml b/Cargo.toml index ac798f8..cdd5737 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,7 +37,7 @@ console-subscriber = { version = "0.2", optional = true } dashmap = "5.1.0" dotenv = "0.15.0" flume = "0.11.0" -lru = "0.11.0" +lru = "0.12.0" metrics = "0.21.0" metrics-exporter-prometheus = { version = "0.12.0", default-features = false, features = [ "http-listener", @@ -49,6 +49,7 @@ opentelemetry = "0.21" opentelemetry_sdk = { version = "0.21", features = ["rt-tokio"] } opentelemetry-otlp = "0.14" pin-project-lite = "0.2.9" +# pinned to metrics-util quanta = "0.11.0" rand = "0.8" reqwest = { version = "0.11", default-features = false, features = ["rustls-tls", "stream"]} diff --git a/src/main.rs b/src/main.rs index 427ca29..085aca3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -311,11 +311,11 @@ async fn do_server_main( } }; - let verify_spawner = Spawner::build("verify-cpu", verify_threads)?; - let sign_spawner = Spawner::build("sign-cpu", signature_threads)?; + let verify_spawner = Spawner::build("verify-cpu", verify_threads.try_into()?); + let sign_spawner = Spawner::build("sign-cpu", signature_threads.try_into()?); let key_id = config.generate_url(UrlKind::MainKey).to_string(); - let state = State::build(db.clone(), key_id, sign_spawner, client).await?; + let state = State::build(db.clone(), key_id, sign_spawner.clone(), client).await?; if let Some((token, admin_handle)) = config.telegram_info() { tracing::warn!("Creating telegram handler"); @@ -325,6 +325,8 @@ async fn do_server_main( let keys = config.open_keys()?; let bind_address = config.bind_address(); + let sign_spawner2 = sign_spawner.clone(); + let verify_spawner2 = verify_spawner.clone(); let server = HttpServer::new(move || { let job_server = create_workers(state.clone(), actors.clone(), media.clone(), config.clone()); @@ -410,6 +412,9 @@ async fn do_server_main( server.bind(bind_address)?.run().await?; } + sign_spawner2.close().await; + verify_spawner2.close().await; + tracing::warn!("Server closed"); Ok(()) diff --git a/src/spawner.rs b/src/spawner.rs index 3b611d7..c9f8d1b 100644 --- a/src/spawner.rs +++ b/src/spawner.rs @@ -1,107 +1,31 @@ +use async_cpupool::CpuPool; use http_signature_normalization_actix::{Canceled, Spawn}; -use std::{ - panic::AssertUnwindSafe, - sync::Arc, - thread::JoinHandle, - time::{Duration, Instant}, -}; - -fn spawner_thread( - receiver: flume::Receiver>, - name: &'static str, - id: usize, -) { - let guard = MetricsGuard::guard(name, id); - - while let Ok(f) = receiver.recv() { - let start = Instant::now(); - metrics::increment_counter!(format!("relay.{name}.operation.start"), "id" => id.to_string()); - let res = std::panic::catch_unwind(AssertUnwindSafe(f)); - metrics::increment_counter!(format!("relay.{name}.operation.end"), "complete" => res.is_ok().to_string(), "id" => id.to_string()); - metrics::histogram!(format!("relay.{name}.operation.duration"), start.elapsed().as_secs_f64(), "complete" => res.is_ok().to_string(), "id" => id.to_string()); - - if let Err(e) = res { - tracing::warn!("{name} fn panicked: {e:?}"); - } - } - - guard.disarm(); -} +use std::time::Duration; -#[derive(Clone, Debug)] +#[derive(Clone)] pub(crate) struct Spawner { - name: &'static str, - sender: Option>>, - threads: Option>>>, -} - -struct MetricsGuard { - name: &'static str, - id: usize, - start: Instant, - armed: bool, -} - -impl MetricsGuard { - fn guard(name: &'static str, id: usize) -> Self { - metrics::increment_counter!(format!("relay.{name}.launched"), "id" => id.to_string()); - - Self { - name, - id, - start: Instant::now(), - armed: true, - } - } - - fn disarm(mut self) { - self.armed = false; - } + pool: CpuPool, } -impl Drop for MetricsGuard { - fn drop(&mut self) { - metrics::increment_counter!(format!("relay.{}.closed", self.name), "clean" => (!self.armed).to_string(), "id" => self.id.to_string()); - metrics::histogram!(format!("relay.{}.duration", self.name), self.start.elapsed().as_secs_f64(), "clean" => (!self.armed).to_string(), "id" => self.id.to_string()); - tracing::warn!("Stopping {} - {}", self.name, self.id); +impl Spawner { + pub(crate) fn build(name: &'static str, threads: u16) -> Self { + let pool = CpuPool::configure() + .name(name) + .max_threads(threads) + .build() + .expect("valid configuration"); + + Spawner { pool } } -} -impl Spawner { - pub(crate) fn build(name: &'static str, threads: usize) -> std::io::Result { - let (sender, receiver) = flume::bounded(8); - - tracing::warn!("Launching {threads} {name}s"); - - let threads = (0..threads) - .map(|i| { - let receiver = receiver.clone(); - std::thread::Builder::new() - .name(format!("{name}-{i}")) - .spawn(move || { - spawner_thread(receiver, name, i); - }) - }) - .collect::, _>>()?; - - Ok(Spawner { - name, - sender: Some(sender), - threads: Some(Arc::new(threads)), - }) + pub(crate) async fn close(self) { + self.pool.close().await; } } -impl Drop for Spawner { - fn drop(&mut self) { - self.sender.take(); - - if let Some(threads) = self.threads.take().and_then(Arc::into_inner) { - tracing::warn!("Joining {}s", self.name); - for thread in threads { - let _ = thread.join(); - } - } +impl std::fmt::Debug for Spawner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("Spawner").finish() } } @@ -144,22 +68,9 @@ impl Spawn for Spawner { Func: FnOnce() -> Out + Send + 'static, Out: Send + 'static, { - let sender = self.sender.as_ref().expect("Sender exists").clone(); + let pool = self.pool.clone(); - Box::pin(async move { - let (tx, rx) = flume::bounded(1); - - let _ = sender - .send_async(Box::new(move || { - if tx.try_send((func)()).is_err() { - tracing::warn!("Requestor hung up"); - metrics::increment_counter!("relay.spawner.disconnected"); - } - })) - .await; - - timer(rx.recv_async()).await.map_err(|_| Canceled) - }) + Box::pin(async move { timer(pool.spawn(func)).await.map_err(|_| Canceled) }) } } @@ -171,21 +82,10 @@ impl http_signature_normalization_reqwest::Spawn for Spawner { Func: FnOnce() -> Out + Send + 'static, Out: Send + 'static, { - let sender = self.sender.as_ref().expect("Sender exists").clone(); + let pool = self.pool.clone(); Box::pin(async move { - let (tx, rx) = flume::bounded(1); - - let _ = sender - .send_async(Box::new(move || { - if tx.try_send((func)()).is_err() { - tracing::warn!("Requestor hung up"); - metrics::increment_counter!("relay.spawner.disconnected"); - } - })) - .await; - - timer(rx.recv_async()) + timer(pool.spawn(func)) .await .map_err(|_| http_signature_normalization_reqwest::Canceled) }) From 8bce3d172f64855c27c7ec885ffb6d4aeed50b72 Mon Sep 17 00:00:00 2001 From: asonix Date: Sat, 25 Nov 2023 20:20:38 -0600 Subject: [PATCH 03/27] Update streem --- Cargo.lock | 14 ++------------ Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1531253..3dbaf7e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -429,7 +429,7 @@ dependencies = [ "serde", "serde_json", "sled", - "streem 0.1.1", + "streem", "teloxide", "thiserror", "time", @@ -1457,7 +1457,7 @@ dependencies = [ "futures-core", "http-signature-normalization", "ring", - "streem 0.2.0", + "streem", "thiserror", "tokio", "tracing", @@ -3154,16 +3154,6 @@ dependencies = [ "der", ] -[[package]] -name = "streem" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "641396a5ae90767cb12d21832444ab760841ee887717d802b2c456c4f8199114" -dependencies = [ - "futures-core", - "pin-project-lite", -] - [[package]] name = "streem" version = "0.2.0" diff --git a/Cargo.toml b/Cargo.toml index cdd5737..ccff3b5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -82,7 +82,7 @@ tracing-subscriber = { version = "0.3", features = [ ] } tokio = { version = "1", features = ["macros", "sync"] } uuid = { version = "1", features = ["v4", "serde"] } -streem = "0.1.0" +streem = "0.2.0" [dependencies.background-jobs] version = "0.15.0" From f70af22c6a26692bb54fa4a9159e3c1e14ab8f15 Mon Sep 17 00:00:00 2001 From: asonix Date: Sat, 25 Nov 2023 20:27:11 -0600 Subject: [PATCH 04/27] clippy --- src/collector.rs | 2 +- src/extractors.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/collector.rs b/src/collector.rs index b5674c7..200095c 100644 --- a/src/collector.rs +++ b/src/collector.rs @@ -289,7 +289,7 @@ impl Inner { } let mut d = self.distributions.write().unwrap(); - let outer_entry = d.entry(name.clone()).or_insert_with(BTreeMap::new); + let outer_entry = d.entry(name.clone()).or_default(); let entry = outer_entry .entry(labels) diff --git a/src/extractors.rs b/src/extractors.rs index 385ce9a..5725402 100644 --- a/src/extractors.rs +++ b/src/extractors.rs @@ -28,7 +28,7 @@ impl AdminConfig { } fn verify(&self, token: XApiToken) -> Result { - bcrypt::verify(&token.0, &self.hashed_api_token).map_err(Error::bcrypt_verify) + bcrypt::verify(token.0, &self.hashed_api_token).map_err(Error::bcrypt_verify) } } From 4383357abed84f6e93b93ba08dc4d7c7ad1c163c Mon Sep 17 00:00:00 2001 From: asonix Date: Sat, 25 Nov 2023 20:27:20 -0600 Subject: [PATCH 05/27] update flake --- flake.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index 2a20bfa..b79aca5 100644 --- a/flake.lock +++ b/flake.lock @@ -5,11 +5,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1692799911, - "narHash": "sha256-3eihraek4qL744EvQXsK1Ha6C3CR7nnT8X2qWap4RNk=", + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", "owner": "numtide", "repo": "flake-utils", - "rev": "f9e7cf818399d17d347f847525c5a5a8032e4e44", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", "type": "github" }, "original": { @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1693003285, - "narHash": "sha256-5nm4yrEHKupjn62MibENtfqlP6pWcRTuSKrMiH9bLkc=", + "lastModified": 1700794826, + "narHash": "sha256-RyJTnTNKhO0yqRpDISk03I/4A67/dp96YRxc86YOPgU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5690c4271f2998c304a45c91a0aeb8fb69feaea7", + "rev": "5a09cb4b393d58f9ed0d9ca1555016a8543c2ac8", "type": "github" }, "original": { From e4f665d75fd118c495e31fda8417f37ed1792937 Mon Sep 17 00:00:00 2001 From: asonix Date: Sat, 25 Nov 2023 21:17:59 -0600 Subject: [PATCH 06/27] use stable async-cpupool --- Cargo.lock | 3 ++- Cargo.toml | 2 +- src/main.rs | 4 ++-- src/spawner.rs | 7 +++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3dbaf7e..07a24de 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -467,7 +467,8 @@ checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" [[package]] name = "async-cpupool" version = "0.1.0" -source = "git+https://git.asonix.dog/safe-async/async-cpupool#2884d854fff83e96ad70b8dc06e947377d53e1b7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba06506d5e5f2e45254bfb3175d5ca14b7dbb817cf0651cc2cc3a8b18a12c5a5" dependencies = [ "flume", "metrics", diff --git a/Cargo.toml b/Cargo.toml index ccff3b5..761a40e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,7 @@ actix-webfinger = { version = "0.5.0", default-features = false } activitystreams = "0.7.0-alpha.25" activitystreams-ext = "0.1.0-alpha.3" ammonia = "3.1.0" -async-cpupool = { version = "0.1.0", git = "https://git.asonix.dog/safe-async/async-cpupool" } +async-cpupool = "0.1.0" bcrypt = "0.15" base64 = "0.21" clap = { version = "4.0.0", features = ["derive"] } diff --git a/src/main.rs b/src/main.rs index 085aca3..897878d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -311,8 +311,8 @@ async fn do_server_main( } }; - let verify_spawner = Spawner::build("verify-cpu", verify_threads.try_into()?); - let sign_spawner = Spawner::build("sign-cpu", signature_threads.try_into()?); + let verify_spawner = Spawner::build("verify-cpu", verify_threads.try_into()?)?; + let sign_spawner = Spawner::build("sign-cpu", signature_threads.try_into()?)?; let key_id = config.generate_url(UrlKind::MainKey).to_string(); let state = State::build(db.clone(), key_id, sign_spawner.clone(), client).await?; diff --git a/src/spawner.rs b/src/spawner.rs index c9f8d1b..9f5cbba 100644 --- a/src/spawner.rs +++ b/src/spawner.rs @@ -8,14 +8,13 @@ pub(crate) struct Spawner { } impl Spawner { - pub(crate) fn build(name: &'static str, threads: u16) -> Self { + pub(crate) fn build(name: &'static str, threads: u16) -> anyhow::Result { let pool = CpuPool::configure() .name(name) .max_threads(threads) - .build() - .expect("valid configuration"); + .build()?; - Spawner { pool } + Ok(Spawner { pool }) } pub(crate) async fn close(self) { From 8c811710ace2cf85457b165c138c5a9294c5fdb6 Mon Sep 17 00:00:00 2001 From: asonix Date: Sat, 25 Nov 2023 21:27:05 -0600 Subject: [PATCH 07/27] Bump version --- Cargo.lock | 2 +- Cargo.toml | 2 +- relay.nix | 5 +---- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 07a24de..beb6672 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -384,7 +384,7 @@ checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "ap-relay" -version = "0.3.104" +version = "0.3.105" dependencies = [ "activitystreams", "activitystreams-ext", diff --git a/Cargo.toml b/Cargo.toml index 761a40e..4862d94 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "ap-relay" description = "A simple activitypub relay" -version = "0.3.104" +version = "0.3.105" authors = ["asonix "] license = "AGPL-3.0" readme = "README.md" diff --git a/relay.nix b/relay.nix index 487fa65..2cc07f2 100644 --- a/relay.nix +++ b/relay.nix @@ -1,17 +1,14 @@ { lib , nixosTests -, protobuf , rustPlatform }: rustPlatform.buildRustPackage { pname = "relay"; - version = "0.3.104"; + version = "0.3.105"; src = ./.; cargoLock.lockFile = ./Cargo.lock; - PROTOC = "${protobuf}/bin/protoc"; - PROTOC_INCLUDE = "${protobuf}/include"; RUSTFLAGS = "--cfg tokio_unstable"; nativeBuildInputs = [ ]; From e377f3988b0dae0301c50badec9e8509ee3f8769 Mon Sep 17 00:00:00 2001 From: asonix Date: Sun, 7 Jan 2024 12:10:43 -0600 Subject: [PATCH 08/27] Update minify-html, dependencies (minor & point) --- Cargo.lock | 945 ++++++++++++++++++++++++++++++++------------ Cargo.toml | 2 +- src/routes/index.rs | 7 +- 3 files changed, 697 insertions(+), 257 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index beb6672..3aca1c9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -56,16 +56,16 @@ dependencies = [ [[package]] name = "actix-http" -version = "3.4.0" +version = "3.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92ef85799cba03f76e4f7c10f533e66d87c9a7e7055f3391f09000ad8351bc9" +checksum = "129d4c88e98860e1758c5de288d1632b07970a16d59bdf7b8d66053d582bb71f" dependencies = [ "actix-codec", "actix-rt", "actix-service", "actix-tls", "actix-utils", - "ahash 0.8.6", + "ahash 0.8.7", "base64 0.21.5", "bitflags 2.4.1", "brotli", @@ -100,14 +100,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" dependencies = [ "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] name = "actix-router" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d66ff4d247d2b160861fa2866457e85706833527840e4133f8f49aa423a38799" +checksum = "d22475596539443685426b6bdadb926ad0ecaefdfc5fb05e5e3441f15463c511" dependencies = [ "bytestring", "http", @@ -139,7 +139,7 @@ dependencies = [ "futures-core", "futures-util", "mio", - "socket2 0.5.5", + "socket2", "tokio", "tracing", ] @@ -188,9 +188,9 @@ dependencies = [ [[package]] name = "actix-web" -version = "4.4.0" +version = "4.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4a5b5e29603ca8c94a77c65cf874718ceb60292c5a5c3e5f4ace041af462b9" +checksum = "e43428f3bf11dee6d166b00ec2df4e3aa8cc1606aaa0b7433c146852e2f4e03b" dependencies = [ "actix-codec", "actix-http", @@ -200,7 +200,7 @@ dependencies = [ "actix-service", "actix-tls", "actix-utils", - "ahash 0.8.6", + "ahash 0.8.7", "bytes", "bytestring", "cfg-if", @@ -219,7 +219,7 @@ dependencies = [ "serde_json", "serde_urlencoded", "smallvec", - "socket2 0.5.5", + "socket2", "time", "url", ] @@ -265,9 +265,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" dependencies = [ "cfg-if", "getrandom", @@ -330,9 +330,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" +checksum = "d664a92ecae85fd0a7392615844904654d1d5f5514837f471ddef4a057aba1b6" dependencies = [ "anstyle", "anstyle-parse", @@ -350,37 +350,37 @@ checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" [[package]] name = "anstyle-parse" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" dependencies = [ - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.1" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" dependencies = [ "anstyle", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "anyhow" -version = "1.0.75" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" [[package]] name = "ap-relay" @@ -494,18 +494,18 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] name = "async-trait" -version = "0.1.74" +version = "0.1.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" +checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -636,6 +636,15 @@ version = "0.21.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" +[[package]] +name = "base64-simd" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "781dd20c3aff0bd194fe7d2a977dd92f21c173891f3a03b677359e5fa457e5d5" +dependencies = [ + "simd-abstraction", +] + [[package]] name = "base64ct" version = "1.6.0" @@ -667,6 +676,18 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + [[package]] name = "block-buffer" version = "0.10.4" @@ -713,6 +734,28 @@ version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +[[package]] +name = "bytecheck" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6372023ac861f6e6dc89c8344a8f398fb42aaba2b5dbc649ca0c0e9dbcb627" +dependencies = [ + "bytecheck_derive", + "ptr_meta", + "simdutf8", +] + +[[package]] +name = "bytecheck_derive" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7ec4c6f261935ad534c0c22dbef2201b45918860eb1c574b972bd213a76af61" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "bytecount" version = "0.6.7" @@ -776,9 +819,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.8" +version = "4.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2275f18819641850fa26c89acc84d465c1bf91ce57bc2748b28c420473352f64" +checksum = "52bdc885e4cacc7f7c9eedc1ef6da641603180c783c41a15c264944deeaab642" dependencies = [ "clap_builder", "clap_derive", @@ -786,9 +829,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.8" +version = "4.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07cdf1b148b25c1e1f7a42225e30a0d99a615cd4637eae7365548dd4529b95bc" +checksum = "fb7fb5e4e979aec3be7791562fcba452f94ad85e954da024396433e0e25a79e9" dependencies = [ "anstream", "anstyle", @@ -805,7 +848,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -878,9 +921,29 @@ dependencies = [ [[package]] name = "const-oid" -version = "0.9.5" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "const-str" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21077772762a1002bb421c3af42ac1725fa56066bfc53d9a55bb79905df2aaf3" +dependencies = [ + "const-str-proc-macro", +] + +[[package]] +name = "const-str-proc-macro" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" +checksum = "5e1e0fdd2e5d3041e530e1b21158aeeef8b5d0e306bc5c1e3d6cf0930d10e25a" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] [[package]] name = "convert_case" @@ -890,9 +953,9 @@ checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] name = "core-foundation" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", @@ -900,15 +963,15 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cpufeatures" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] @@ -924,32 +987,41 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.8" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82a9b73a36529d9c47029b9fb3a6f0ea3cc916a261195352ba19e770fc1748b2" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +checksum = "fca89a0e215bab21874660c67903c5f143333cab1da83d041c7ded6053774751" dependencies = [ "cfg-if", + "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.15" +version = "0.9.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +checksum = "0e3681d554572a651dda4186cd47240627c3d0114d45a95f6ad27f2f22e7548d" dependencies = [ "autocfg", "cfg-if", "crossbeam-utils", - "memoffset", - "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +checksum = "c3a430a770ebd84726f584a90ee7f020d28db52c6d02138900f22341f866d39c" dependencies = [ "cfg-if", ] @@ -965,14 +1037,35 @@ dependencies = [ ] [[package]] -name = "css-minify" -version = "0.3.1" +name = "cssparser" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "874c6e2d19f8d4a285083b11a3241bfbe01ac3ed85f26e1e6b34888d960552bd" +checksum = "9be934d936a0fbed5bcdc01042b770de1398bf79d0e192f49fa7faea0e99281e" dependencies = [ - "derive_more", - "indexmap 1.9.3", - "nom", + "cssparser-macros", + "dtoa-short", + "itoa", + "phf 0.11.2", + "smallvec", +] + +[[package]] +name = "cssparser-color" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "556c099a61d85989d7af52b692e35a8d68a57e7df8c6d07563dc0778b3960c9f" +dependencies = [ + "cssparser", +] + +[[package]] +name = "cssparser-macros" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" +dependencies = [ + "quote", + "syn 2.0.48", ] [[package]] @@ -1017,12 +1110,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if", - "hashbrown 0.14.2", + "hashbrown 0.14.3", "lock_api", "once_cell", "parking_lot_core 0.9.9", ] +[[package]] +name = "data-encoding" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" + +[[package]] +name = "data-url" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a30bfce702bcfa94e906ef82421f2c0e61c076ad76030c16ee5d2e9a32fe193" +dependencies = [ + "matches", +] + [[package]] name = "der" version = "0.7.8" @@ -1036,9 +1144,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.9" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", "serde", @@ -1089,6 +1197,21 @@ dependencies = [ "futures", ] +[[package]] +name = "dtoa" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" + +[[package]] +name = "dtoa-short" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbaceec3c6e4211c79e7b1800fb9680527106beb2f9c51904a3210c03a448c74" +dependencies = [ + "dtoa", +] + [[package]] name = "either" version = "1.9.0" @@ -1185,6 +1308,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + [[package]] name = "futf" version = "0.1.5" @@ -1197,9 +1326,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -1212,9 +1341,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -1222,15 +1351,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -1239,38 +1368,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-macro" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] name = "futures-sink" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-channel", "futures-core", @@ -1362,16 +1491,17 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ff8ae62cd3a9102e5637afc8452c55acf3844001bd5374e0b0bd7b6616c038" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.7", + "bumpalo", ] [[package]] name = "hashbrown" -version = "0.14.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.7", "allocator-api2", ] @@ -1427,9 +1557,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", "http", @@ -1502,9 +1632,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.27" +version = "0.14.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" dependencies = [ "bytes", "futures-channel", @@ -1517,7 +1647,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.10", + "socket2", "tokio", "tower-service", "tracing", @@ -1589,7 +1719,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ "equivalent", - "hashbrown 0.14.2", + "hashbrown 0.14.3", ] [[package]] @@ -1653,17 +1783,26 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25db6b064527c5d482d0423354fcd07a89a2dfe07b67892e62411946db7f07b0" +dependencies = [ + "either", +] + [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "js-sys" -version = "0.3.65" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" +checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" dependencies = [ "wasm-bindgen", ] @@ -1696,9 +1835,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.150" +version = "0.2.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" [[package]] name = "libm" @@ -1706,6 +1845,30 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +[[package]] +name = "lightningcss" +version = "1.0.0-alpha.51" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d6ad516c08b24c246b339159dc2ee2144c012e8ebdf4db4bddefb8734b2b69" +dependencies = [ + "ahash 0.7.7", + "bitflags 2.4.1", + "const-str", + "cssparser", + "cssparser-color", + "dashmap", + "data-encoding", + "itertools 0.10.5", + "lazy_static", + "parcel_selectors", + "parcel_sourcemap", + "paste", + "pathdiff", + "rayon", + "serde", + "smallvec", +] + [[package]] name = "linked-hash-map" version = "0.5.6" @@ -1751,7 +1914,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2994eeba8ed550fd9b47a0b38f0242bc3344e496483c6180b69139cc2fa5d1d7" dependencies = [ - "hashbrown 0.14.2", + "hashbrown 0.14.3", ] [[package]] @@ -1762,9 +1925,9 @@ checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" [[package]] name = "mach2" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d0d1830bcd151a6fc4aea1369af235b36c1528fe976b8ff678683c9995eade8" +checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" dependencies = [ "libc", ] @@ -1782,7 +1945,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a2629bb1404f3d34c2e921f21fd34ba00b206124c81f65c50b43b6aaefeb016" dependencies = [ "log", - "phf", + "phf 0.10.1", "phf_codegen", "string_cache", "string_cache_codegen", @@ -1798,6 +1961,12 @@ dependencies = [ "regex-automata 0.1.10", ] +[[package]] +name = "matches" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" + [[package]] name = "matchit" version = "0.7.3" @@ -1812,18 +1981,9 @@ checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" [[package]] name = "memchr" -version = "2.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" - -[[package]] -name = "memoffset" -version = "0.9.0" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" -dependencies = [ - "autocfg", -] +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "metrics" @@ -1831,16 +1991,16 @@ version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fde3af1a009ed76a778cb84fdef9e7dbbdf5775ae3e4cc1f434a6a307f6f76c5" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.7", "metrics-macros", "portable-atomic", ] [[package]] name = "metrics-exporter-prometheus" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a4964177ddfdab1e3a2b37aec7cf320e14169abb0ed73999f558136409178d5" +checksum = "1d4fa7ce7c4862db464a37b0b31d89bca874562f034bd7993895572783d02950" dependencies = [ "base64 0.21.5", "hyper", @@ -1855,13 +2015,13 @@ dependencies = [ [[package]] name = "metrics-macros" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddece26afd34c31585c74a4db0630c376df271c285d682d1e55012197830b6df" +checksum = "38b4faf00617defe497754acde3024865bc143d44a86799b24e191ecff91354f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -1901,23 +2061,40 @@ dependencies = [ [[package]] name = "minify-html" -version = "0.11.1" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc4d9147754a49e80557df835eb59e743eab1bf75410a134f55dc4b9dbb692ad" +checksum = "1cd4517942a8e7425c990b14977f86a63e4996eed7b15cfcca1540126ac5ff25" dependencies = [ "aho-corasick 0.7.20", - "css-minify", "lazy_static", + "lightningcss", "memchr", + "minify-html-common", "minify-js", + "once_cell", "rustc-hash", ] +[[package]] +name = "minify-html-common" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "697a6b40dffdc5de10c0cbd709dc2bc2039cea9dab8aaa636eb9a49d6b411780" +dependencies = [ + "aho-corasick 0.7.20", + "itertools 0.12.0", + "lazy_static", + "memchr", + "rustc-hash", + "serde", + "serde_json", +] + [[package]] name = "minify-js" -version = "0.4.3" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c300f90ba1138b5c5daf5d9441dc9bdc67b808aac22cf638362a2647bc213be4" +checksum = "22d6c512a82abddbbc13b70609cb2beff01be2c7afff534d6e5e1c85e438fc8b" dependencies = [ "lazy_static", "parse-js", @@ -1940,14 +2117,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.9" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", "log", "wasi", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -2090,18 +2267,18 @@ dependencies = [ [[package]] name = "object" -version = "0.32.1" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "opentelemetry" @@ -2161,9 +2338,9 @@ dependencies = [ [[package]] name = "opentelemetry_sdk" -version = "0.21.1" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "968ba3f2ca03e90e5187f5e4f46c791ef7f2c163ae87789c8ce5f5ca3b7b7de5" +checksum = "2f16aec8a98a457a52664d69e0091bac3a0abd18ead9b641cb00202ba4e0efe4" dependencies = [ "async-trait", "crossbeam-channel", @@ -2173,7 +2350,7 @@ dependencies = [ "glob", "once_cell", "opentelemetry", - "ordered-float 4.1.1", + "ordered-float 4.2.0", "percent-encoding", "rand", "thiserror", @@ -2192,9 +2369,9 @@ dependencies = [ [[package]] name = "ordered-float" -version = "4.1.1" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "536900a8093134cf9ccf00a27deb3532421099e958d9dd431135d0c7543ca1e8" +checksum = "a76df7075c7d4d01fdcb46c912dd17fba5b60c78ea480b475f2b6ab6f666584e" dependencies = [ "num-traits", ] @@ -2209,12 +2386,48 @@ dependencies = [ "hashbrown 0.12.3", ] +[[package]] +name = "outref" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f222829ae9293e33a9f5e9f440c6760a3d450a64affe1846486b140db81c1f4" + [[package]] name = "overload" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" +[[package]] +name = "parcel_selectors" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05d74befe2d076330d9a58bf9ca2da424568724ab278adf15fb5718253133887" +dependencies = [ + "bitflags 2.4.1", + "cssparser", + "fxhash", + "log", + "phf 0.10.1", + "phf_codegen", + "precomputed-hash", + "smallvec", +] + +[[package]] +name = "parcel_sourcemap" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "485b74d7218068b2b7c0e3ff12fbc61ae11d57cb5d8224f525bd304c6be05bbb" +dependencies = [ + "base64-simd", + "data-url", + "rkyv", + "serde", + "serde_json", + "vlq", +] + [[package]] name = "parking_lot" version = "0.11.2" @@ -2260,16 +2473,18 @@ dependencies = [ "libc", "redox_syscall 0.4.1", "smallvec", - "windows-targets", + "windows-targets 0.48.5", ] [[package]] name = "parse-js" -version = "0.10.3" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30534759e6ad87aa144c396544747e1c25b1020bd133356fd758c8facec764e5" +checksum = "9ec3b11d443640ec35165ee8f6f0559f1c6f41878d70330fe9187012b5935f02" dependencies = [ "aho-corasick 0.7.20", + "bumpalo", + "hashbrown 0.13.1", "lazy_static", "memchr", ] @@ -2303,9 +2518,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.5" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae9cee2a55a544be8b89dc6848072af97a20f2422603c10865be2a42b580fff5" +checksum = "1f200d8d83c44a45b21764d1916299752ca035d15ecd46faca3e9a2a2bf6ad06" dependencies = [ "memchr", "thiserror", @@ -2314,9 +2529,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.5" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81d78524685f5ef2a3b3bd1cafbc9fcabb036253d9b1463e726a91cd16e2dfc2" +checksum = "bcd6ab1236bbdb3a49027e920e693192ebfe8913f6d60e294de57463a493cfde" dependencies = [ "pest", "pest_generator", @@ -2324,22 +2539,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.5" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68bd1206e71118b5356dae5ddc61c8b11e28b09ef6a31acbd15ea48a28e0c227" +checksum = "2a31940305ffc96863a735bef7c7994a00b325a7138fdbc5bda0f1a0476d3275" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] name = "pest_meta" -version = "2.7.5" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c747191d4ad9e4a4ab9c8798f1e82a39affe7ef9648390b7e5548d18e099de6" +checksum = "a7ff62f5259e53b78d1af898941cdcdccfae7385cf7d793a6e55de5d05bb4b7d" dependencies = [ "once_cell", "pest", @@ -2352,7 +2567,17 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259" dependencies = [ - "phf_shared", + "phf_shared 0.10.0", +] + +[[package]] +name = "phf" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +dependencies = [ + "phf_macros", + "phf_shared 0.11.2", ] [[package]] @@ -2361,8 +2586,8 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fb1c3a8bc4dd4e5cfce29b44ffc14bedd2ee294559a294e2a4d4c9e9a6a13cd" dependencies = [ - "phf_generator", - "phf_shared", + "phf_generator 0.10.0", + "phf_shared 0.10.0", ] [[package]] @@ -2371,10 +2596,33 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" dependencies = [ - "phf_shared", + "phf_shared 0.10.0", "rand", ] +[[package]] +name = "phf_generator" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +dependencies = [ + "phf_shared 0.11.2", + "rand", +] + +[[package]] +name = "phf_macros" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +dependencies = [ + "phf_generator 0.11.2", + "phf_shared 0.11.2", + "proc-macro2", + "quote", + "syn 2.0.48", +] + [[package]] name = "phf_shared" version = "0.10.0" @@ -2384,6 +2632,15 @@ dependencies = [ "siphasher", ] +[[package]] +name = "phf_shared" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +dependencies = [ + "siphasher", +] + [[package]] name = "pin-project" version = "1.1.3" @@ -2401,7 +2658,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -2439,9 +2696,9 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.5.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bccab0e7fd7cc19f820a1c8c91720af652d0c88dc9664dd72aef2614f04af3b" +checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" [[package]] name = "powerfmt" @@ -2487,9 +2744,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.70" +version = "1.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" +checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" dependencies = [ "unicode-ident", ] @@ -2537,7 +2794,7 @@ dependencies = [ "itertools 0.11.0", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -2549,6 +2806,26 @@ dependencies = [ "prost 0.12.3", ] +[[package]] +name = "ptr_meta" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" +dependencies = [ + "ptr_meta_derive", +] + +[[package]] +name = "ptr_meta_derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "quanta" version = "0.11.1" @@ -2567,13 +2844,19 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + [[package]] name = "radix_trie" version = "0.2.1" @@ -2623,6 +2906,26 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "rayon" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + [[package]] name = "rc-box" version = "1.2.0" @@ -2694,11 +2997,20 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +[[package]] +name = "rend" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2571463863a6bd50c32f94402933f03457a3fbaf697a707c5be741e459f08fd" +dependencies = [ + "bytecheck", +] + [[package]] name = "reqwest" -version = "0.11.22" +version = "0.11.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" +checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" dependencies = [ "base64 0.21.5", "bytes", @@ -2770,16 +3082,45 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.5" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb0205304757e5d899b9c2e448b867ffd03ae7f988002e47cd24954391394d0b" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" dependencies = [ "cc", "getrandom", "libc", "spin 0.9.8", "untrusted", - "windows-sys", + "windows-sys 0.48.0", +] + +[[package]] +name = "rkyv" +version = "0.7.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "527a97cdfef66f65998b5f3b637c26f5a5ec09cc52a3f9932313ac645f4190f5" +dependencies = [ + "bitvec", + "bytecheck", + "bytes", + "hashbrown 0.12.3", + "ptr_meta", + "rend", + "rkyv_derive", + "seahash", + "tinyvec", + "uuid", +] + +[[package]] +name = "rkyv_derive" +version = "0.7.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5c462a1328c8e67e4d6dbad1eb0355dd43e8ab432c6e227a43657f16ade5033" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] @@ -2795,9 +3136,9 @@ dependencies = [ [[package]] name = "rsa" -version = "0.9.4" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a3211b01eea83d80687da9eef70e39d65144a3894866a5153a2723e425a157f" +checksum = "5d0e5124fcb30e76a7e79bfee683a2746db83784b86289f6251b54b7950a0dfc" dependencies = [ "const-oid", "digest", @@ -2827,9 +3168,9 @@ dependencies = [ [[package]] name = "rsass" -version = "0.28.6" +version = "0.28.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c952ecc29562e37ad8921caa8f6f6a8bc40614f78ac2e2e29f5ea7c00ce47d5" +checksum = "cdf903247e7165156378cd1a7deda977b8e8567683ed97ad7330376dbf92f473" dependencies = [ "arc-swap", "fastrand", @@ -2890,9 +3231,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.9" +version = "0.21.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "629648aced5775d558af50b2b4c7b02983a04b312126d45eeead26e7caa498b9" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" dependencies = [ "log", "ring", @@ -2927,9 +3268,9 @@ checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "scopeguard" @@ -2947,37 +3288,43 @@ dependencies = [ "untrusted", ] +[[package]] +name = "seahash" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" + [[package]] name = "semver" -version = "1.0.20" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" +checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" [[package]] name = "serde" -version = "1.0.193" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.193" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] name = "serde_json" -version = "1.0.108" +version = "1.0.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" dependencies = [ "itoa", "ryu", @@ -2986,9 +3333,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" dependencies = [ "serde", ] @@ -3067,6 +3414,21 @@ dependencies = [ "rand_core", ] +[[package]] +name = "simd-abstraction" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cadb29c57caadc51ff8346233b5cec1d240b68ce55cf1afc764818791876987" +dependencies = [ + "outref", +] + +[[package]] +name = "simdutf8" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" + [[package]] name = "siphasher" version = "0.3.11" @@ -3110,16 +3472,6 @@ version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" -[[package]] -name = "socket2" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "socket2" version = "0.5.5" @@ -3127,7 +3479,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -3147,9 +3499,9 @@ dependencies = [ [[package]] name = "spki" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", "der", @@ -3174,7 +3526,7 @@ dependencies = [ "new_debug_unreachable", "once_cell", "parking_lot 0.12.1", - "phf_shared", + "phf_shared 0.10.0", "precomputed-hash", "serde", ] @@ -3185,17 +3537,17 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6bb30289b722be4ff74a408c3cc27edeaad656e06cb1fe8fa9231fa59c728988" dependencies = [ - "phf_generator", - "phf_shared", + "phf_generator 0.10.0", + "phf_shared 0.10.0", "proc-macro2", "quote", ] [[package]] name = "strsim" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "ccbca6f34534eb78dbee83f6b2c9442fea7113f43d9e80ea320f0972ae5dc08d" [[package]] name = "subtle" @@ -3216,9 +3568,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.39" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", @@ -3264,6 +3616,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20f34339676cdcab560c9a82300c4c2581f68b9369aedf0fae86f2ff9565ff3e" +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + [[package]] name = "task-local-extensions" version = "0.1.4" @@ -3355,22 +3713,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.50" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.50" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -3385,9 +3743,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" +checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" dependencies = [ "deranged", "itoa", @@ -3405,9 +3763,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" +checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" dependencies = [ "time-core", ] @@ -3429,9 +3787,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.34.0" +version = "1.35.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" +checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" dependencies = [ "backtrace", "bytes", @@ -3440,10 +3798,10 @@ dependencies = [ "parking_lot 0.12.1", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.5", + "socket2", "tokio-macros", "tracing", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -3464,7 +3822,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -3665,7 +4023,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -3747,9 +4105,9 @@ dependencies = [ [[package]] name = "try-lock" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "typenum" @@ -3774,9 +4132,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" [[package]] name = "unicode-ident" @@ -3851,6 +4209,12 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "vlq" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65dd7eed29412da847b0f78bcec0ac98588165988a8cfe41d4ea1d429f8ccfff" + [[package]] name = "want" version = "0.3.1" @@ -3868,9 +4232,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" +checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -3878,24 +4242,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" +checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.38" +version = "0.4.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afec9963e3d0994cac82455b2b3502b81a7f40f9a0d32181f7528d9f4b43e02" +checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" dependencies = [ "cfg-if", "js-sys", @@ -3905,9 +4269,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" +checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3915,22 +4279,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" +checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" +checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" [[package]] name = "wasm-streams" @@ -3947,9 +4311,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.65" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" +checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f" dependencies = [ "js-sys", "wasm-bindgen", @@ -3957,9 +4321,9 @@ dependencies = [ [[package]] name = "web-time" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57099a701fb3a8043f993e8228dc24229c7b942e2b009a1b962e54489ba1d3bf" +checksum = "aa30049b1c872b72c89866d458eae9f20380ab280ffd1b1e18df2d3e2d98cfe0" dependencies = [ "js-sys", "wasm-bindgen", @@ -3999,7 +4363,16 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets", + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.0", ] [[package]] @@ -4008,13 +4381,28 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", ] [[package]] @@ -4023,47 +4411,89 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + [[package]] name = "windows_i686_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + [[package]] name = "windows_i686_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + [[package]] name = "winnow" -version = "0.5.19" +version = "0.5.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b" +checksum = "b7520bbdec7211caa7c4e682eb1fbe07abe20cee6756b6e00f537c82c11816aa" dependencies = [ "memchr", ] @@ -4075,7 +4505,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ "cfg-if", - "windows-sys", + "windows-sys 0.48.0", +] + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", ] [[package]] @@ -4089,22 +4528,22 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.26" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.26" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 4862d94..bc6017f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,7 +44,7 @@ metrics-exporter-prometheus = { version = "0.12.0", default-features = false, fe ] } metrics-util = "0.15.0" mime = "0.3.16" -minify-html = "0.11.0" +minify-html = "0.15.0" opentelemetry = "0.21" opentelemetry_sdk = { version = "0.21", features = ["rt-tokio"] } opentelemetry-otlp = "0.14" diff --git a/src/routes/index.rs b/src/routes/index.rs index 7c94759..0448208 100644 --- a/src/routes/index.rs +++ b/src/routes/index.rs @@ -14,10 +14,11 @@ const MINIFY_CONFIG: minify_html::Cfg = minify_html::Cfg { keep_html_and_head_opening_tags: false, keep_spaces_between_attributes: true, keep_comments: false, + keep_input_type_text_attr: true, + keep_ssi_comments: false, + preserve_brace_template_syntax: false, + preserve_chevron_percent_template_syntax: false, minify_css: true, - minify_css_level_1: true, - minify_css_level_2: false, - minify_css_level_3: false, minify_js: true, remove_bangs: true, remove_processing_instructions: true, From 36aa9120ea9bd5ef65a6e71adecbb52351e1ca58 Mon Sep 17 00:00:00 2001 From: asonix Date: Sun, 7 Jan 2024 12:43:58 -0600 Subject: [PATCH 09/27] Update metrics --- Cargo.lock | 73 +++++++++++---------------------------- Cargo.toml | 12 +++---- src/collector.rs | 12 +++---- src/extractors.rs | 6 ++-- src/main.rs | 2 +- src/middleware/timings.rs | 2 +- src/spawner.rs | 6 ++-- 7 files changed, 40 insertions(+), 73 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3aca1c9..fdfa345 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -466,9 +466,9 @@ checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" [[package]] name = "async-cpupool" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba06506d5e5f2e45254bfb3175d5ca14b7dbb817cf0651cc2cc3a8b18a12c5a5" +checksum = "6e8033cee1f97627591df5401e0f20496c1940dc935f3de8ddc642bf9cf836c9" dependencies = [ "flume", "metrics", @@ -561,9 +561,9 @@ dependencies = [ [[package]] name = "background-jobs" -version = "0.15.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0788884be043a6ea4812f533b53f47180f1fb68a45d6a1e7c9f55369f187bd9" +checksum = "220c1b532c3b8532a43282f0871cf43d6238421f0e72084cb1f6ddb65fc0e8e6" dependencies = [ "background-jobs-actix", "background-jobs-core", @@ -571,9 +571,9 @@ dependencies = [ [[package]] name = "background-jobs-actix" -version = "0.15.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6918aac07d254c283e83e74d94d2a4137eb8eb2bb35749553b2aeedefc13243d" +checksum = "d084a3dec6f0bd656a7c388e255e988a340b397985bfe7bebdb0ebebb34b50b6" dependencies = [ "actix-rt", "anyhow", @@ -591,9 +591,9 @@ dependencies = [ [[package]] name = "background-jobs-core" -version = "0.15.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19188ccc4964d2d7ac0349ec05290b079c49a6218dc9a70516c9084790efc039" +checksum = "c585c87a70e090f8f0b52cd25951ba156e7faca26464e11611fc6ab0d700815c" dependencies = [ "actix-rt", "anyhow", @@ -1923,15 +1923,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" -[[package]] -name = "mach2" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" -dependencies = [ - "libc", -] - [[package]] name = "maplit" version = "1.0.2" @@ -1987,20 +1978,19 @@ checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "metrics" -version = "0.21.1" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fde3af1a009ed76a778cb84fdef9e7dbbdf5775ae3e4cc1f434a6a307f6f76c5" +checksum = "77b9e10a211c839210fd7f99954bda26e5f8e26ec686ad68da6a32df7c80e782" dependencies = [ "ahash 0.8.7", - "metrics-macros", "portable-atomic", ] [[package]] name = "metrics-exporter-prometheus" -version = "0.12.2" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d4fa7ce7c4862db464a37b0b31d89bca874562f034bd7993895572783d02950" +checksum = "83a4c4718a371ddfb7806378f23617876eea8b82e5ff1324516bcd283249d9ea" dependencies = [ "base64 0.21.5", "hyper", @@ -2013,22 +2003,11 @@ dependencies = [ "tokio", ] -[[package]] -name = "metrics-macros" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b4faf00617defe497754acde3024865bc143d44a86799b24e191ecff91354f" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - [[package]] name = "metrics-util" -version = "0.15.1" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4de2ed6e491ed114b40b732e4d1659a9d53992ebd87490c44a6ffe23739d973e" +checksum = "2670b8badcc285d486261e2e9f1615b506baff91427b61bd336a472b65bbf5ed" dependencies = [ "aho-corasick 1.1.2", "crossbeam-epoch", @@ -2037,7 +2016,7 @@ dependencies = [ "indexmap 1.9.3", "metrics", "num_cpus", - "ordered-float 3.9.2", + "ordered-float", "quanta", "radix_trie", "sketches-ddsketch", @@ -2350,7 +2329,7 @@ dependencies = [ "glob", "once_cell", "opentelemetry", - "ordered-float 4.2.0", + "ordered-float", "percent-encoding", "rand", "thiserror", @@ -2358,15 +2337,6 @@ dependencies = [ "tokio-stream", ] -[[package]] -name = "ordered-float" -version = "3.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1e1c390732d15f1d48471625cd92d154e66db2c56645e29a9cd26f4699f72dc" -dependencies = [ - "num-traits", -] - [[package]] name = "ordered-float" version = "4.2.0" @@ -2828,13 +2798,12 @@ dependencies = [ [[package]] name = "quanta" -version = "0.11.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17e662a7a8291a865152364c20c7abc5e60486ab2001e8ec10b24862de0b9ab" +checksum = "9ca0b7bac0b97248c40bb77288fc52029cf1459c0461ea1b05ee32ccf011de2c" dependencies = [ "crossbeam-utils", "libc", - "mach2", "once_cell", "raw-cpuid", "wasi", @@ -2899,11 +2868,11 @@ dependencies = [ [[package]] name = "raw-cpuid" -version = "10.7.0" +version = "11.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c297679cb867470fa8c9f67dbba74a78d78e3e98d7cf2b08d6d71540f797332" +checksum = "9d86a7c4638d42c44551f4791a20e687dbb4c3de1f33c43dd71e355cd429def1" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.1", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index bc6017f..b04f937 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,7 @@ actix-webfinger = { version = "0.5.0", default-features = false } activitystreams = "0.7.0-alpha.25" activitystreams-ext = "0.1.0-alpha.3" ammonia = "3.1.0" -async-cpupool = "0.1.0" +async-cpupool = "0.2.0" bcrypt = "0.15" base64 = "0.21" clap = { version = "4.0.0", features = ["derive"] } @@ -38,11 +38,11 @@ dashmap = "5.1.0" dotenv = "0.15.0" flume = "0.11.0" lru = "0.12.0" -metrics = "0.21.0" -metrics-exporter-prometheus = { version = "0.12.0", default-features = false, features = [ +metrics = "0.22.0" +metrics-exporter-prometheus = { version = "0.13.0", default-features = false, features = [ "http-listener", ] } -metrics-util = "0.15.0" +metrics-util = "0.16.0" mime = "0.3.16" minify-html = "0.15.0" opentelemetry = "0.21" @@ -50,7 +50,7 @@ opentelemetry_sdk = { version = "0.21", features = ["rt-tokio"] } opentelemetry-otlp = "0.14" pin-project-lite = "0.2.9" # pinned to metrics-util -quanta = "0.11.0" +quanta = "0.12.0" rand = "0.8" reqwest = { version = "0.11", default-features = false, features = ["rustls-tls", "stream"]} reqwest-middleware = "0.2" @@ -85,7 +85,7 @@ uuid = { version = "1", features = ["v4", "serde"] } streem = "0.2.0" [dependencies.background-jobs] -version = "0.15.0" +version = "0.16.0" default-features = false features = ["background-jobs-actix", "error-logging"] diff --git a/src/collector.rs b/src/collector.rs index 200095c..6e79bcb 100644 --- a/src/collector.rs +++ b/src/collector.rs @@ -1,4 +1,4 @@ -use metrics::{Key, Recorder, SetRecorderError}; +use metrics::{Key, Metadata, Recorder, SetRecorderError}; use metrics_util::{ registry::{AtomicStorage, GenerationalStorage, Recency, Registry}, MetricKindMask, Summary, @@ -360,8 +360,8 @@ impl MemoryCollector { d.entry(key.as_str().to_owned()).or_insert(description); } - pub(crate) fn install(&self) -> Result<(), SetRecorderError> { - metrics::set_boxed_recorder(Box::new(self.clone())) + pub(crate) fn install(&self) -> Result<(), SetRecorderError> { + metrics::set_global_recorder(self.clone()) } } @@ -393,19 +393,19 @@ impl Recorder for MemoryCollector { self.add_description_if_missing(&key, description) } - fn register_counter(&self, key: &Key) -> metrics::Counter { + fn register_counter(&self, key: &Key, _: &Metadata<'_>) -> metrics::Counter { self.inner .registry .get_or_create_counter(key, |c| c.clone().into()) } - fn register_gauge(&self, key: &Key) -> metrics::Gauge { + fn register_gauge(&self, key: &Key, _: &Metadata<'_>) -> metrics::Gauge { self.inner .registry .get_or_create_gauge(key, |c| c.clone().into()) } - fn register_histogram(&self, key: &Key) -> metrics::Histogram { + fn register_histogram(&self, key: &Key, _: &Metadata<'_>) -> metrics::Histogram { self.inner .registry .get_or_create_histogram(key, |c| c.clone().into()) diff --git a/src/extractors.rs b/src/extractors.rs index 5725402..3d97ab2 100644 --- a/src/extractors.rs +++ b/src/extractors.rs @@ -200,10 +200,8 @@ impl FromRequest for Admin { Box::pin(async move { let (db, c, s, t) = res?; Self::verify(c, s, t).await?; - metrics::histogram!( - "relay.admin.verify", - now.elapsed().as_micros() as f64 / 1_000_000_f64 - ); + metrics::histogram!("relay.admin.verify") + .record(now.elapsed().as_micros() as f64 / 1_000_000_f64); Ok(Admin { db }) }) } diff --git a/src/main.rs b/src/main.rs index 897878d..b286f3e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -167,7 +167,7 @@ async fn main() -> Result<(), anyhow::Error> { .add_recorder(recorder) .add_recorder(collector.clone()) .build(); - metrics::set_boxed_recorder(Box::new(recorder))?; + metrics::set_global_recorder(recorder).map_err(|e| anyhow::anyhow!("{e}"))?; } else { collector.install()?; } diff --git a/src/middleware/timings.rs b/src/middleware/timings.rs index a311a75..4394a48 100644 --- a/src/middleware/timings.rs +++ b/src/middleware/timings.rs @@ -40,7 +40,7 @@ impl Drop for LogOnDrop { fn drop(&mut self) { if self.arm { let duration = self.begin.elapsed(); - metrics::histogram!("relay.request.complete", duration, "path" => self.path.clone(), "method" => self.method.clone()); + metrics::histogram!("relay.request.complete", "path" => self.path.clone(), "method" => self.method.clone()).record(duration); } } } diff --git a/src/spawner.rs b/src/spawner.rs index 9f5cbba..b967e9b 100644 --- a/src/spawner.rs +++ b/src/spawner.rs @@ -34,7 +34,7 @@ where { let id = uuid::Uuid::new_v4(); - metrics::increment_counter!("relay.spawner.wait-timer.start"); + metrics::counter!("relay.spawner.wait-timer.start").increment(1); let mut interval = actix_rt::time::interval(Duration::from_secs(5)); @@ -47,12 +47,12 @@ where loop { tokio::select! { out = &mut fut => { - metrics::increment_counter!("relay.spawner.wait-timer.end"); + metrics::counter!("relay.spawner.wait-timer.end").increment(1); return out; } _ = interval.tick() => { counter += 1; - metrics::increment_counter!("relay.spawner.wait-timer.pending"); + metrics::counter!("relay.spawner.wait-timer.pending").increment(1); tracing::warn!("Blocking operation {id} is taking a long time, {} seconds", counter * 5); } } From c64056720692b06f4e5843afa32ac4b517bda23a Mon Sep 17 00:00:00 2001 From: asonix Date: Mon, 8 Jan 2024 17:00:15 -0600 Subject: [PATCH 10/27] Update to newest background-jobs, implement Job rather than ActixJob --- Cargo.lock | 129 ++++++++++++++++++++------------- Cargo.toml | 6 +- src/future.rs | 1 + src/jobs.rs | 22 +++--- src/jobs/apub/announce.rs | 8 +- src/jobs/apub/follow.rs | 8 +- src/jobs/apub/forward.rs | 8 +- src/jobs/apub/reject.rs | 8 +- src/jobs/apub/undo.rs | 8 +- src/jobs/contact.rs | 8 +- src/jobs/deliver.rs | 8 +- src/jobs/deliver_many.rs | 8 +- src/jobs/instance.rs | 8 +- src/jobs/nodeinfo.rs | 10 +-- src/jobs/process_listeners.rs | 8 +- src/jobs/record_last_online.rs | 9 +-- 16 files changed, 144 insertions(+), 113 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fdfa345..bd3900a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -66,7 +66,7 @@ dependencies = [ "actix-tls", "actix-utils", "ahash 0.8.7", - "base64 0.21.5", + "base64 0.21.6", "bitflags 2.4.1", "brotli", "bytes", @@ -395,7 +395,7 @@ dependencies = [ "anyhow", "async-cpupool", "background-jobs", - "base64 0.21.5", + "base64 0.21.6", "bcrypt", "clap", "config", @@ -438,7 +438,6 @@ dependencies = [ "tracing", "tracing-actix-web", "tracing-error", - "tracing-futures", "tracing-log", "tracing-opentelemetry", "tracing-subscriber", @@ -508,6 +507,12 @@ dependencies = [ "syn 2.0.48", ] +[[package]] +name = "atomic" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59bdb34bc650a32731b31bd8f0829cc15d24a708ee31559e0bb34f2bc320cba" + [[package]] name = "autocfg" version = "1.1.0" @@ -561,19 +566,18 @@ dependencies = [ [[package]] name = "background-jobs" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "220c1b532c3b8532a43282f0871cf43d6238421f0e72084cb1f6ddb65fc0e8e6" +version = "0.17.0" +source = "git+https://git.asonix.dog/asonix/background-jobs#e02de4a15340eefd41d130d785ed59019558986f" dependencies = [ "background-jobs-actix", "background-jobs-core", + "background-jobs-metrics", ] [[package]] name = "background-jobs-actix" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d084a3dec6f0bd656a7c388e255e988a340b397985bfe7bebdb0ebebb34b50b6" +version = "0.17.0" +source = "git+https://git.asonix.dog/asonix/background-jobs#e02de4a15340eefd41d130d785ed59019558986f" dependencies = [ "actix-rt", "anyhow", @@ -585,17 +589,14 @@ dependencies = [ "thiserror", "tokio", "tracing", - "tracing-futures", "uuid", ] [[package]] name = "background-jobs-core" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c585c87a70e090f8f0b52cd25951ba156e7faca26464e11611fc6ab0d700815c" +version = "0.17.0" +source = "git+https://git.asonix.dog/asonix/background-jobs#e02de4a15340eefd41d130d785ed59019558986f" dependencies = [ - "actix-rt", "anyhow", "async-trait", "event-listener", @@ -605,7 +606,19 @@ dependencies = [ "thiserror", "time", "tracing", - "tracing-futures", + "uuid", +] + +[[package]] +name = "background-jobs-metrics" +version = "0.17.0" +source = "git+https://git.asonix.dog/asonix/background-jobs#e02de4a15340eefd41d130d785ed59019558986f" +dependencies = [ + "async-trait", + "background-jobs-core", + "metrics", + "metrics-util", + "tracing", "uuid", ] @@ -632,9 +645,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.5" +version = "0.21.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" +checksum = "c79fed4cdb43e993fcdadc7e58a09fd0e3e649c4436fa11da71c9f1f3ee7feb9" [[package]] name = "base64-simd" @@ -657,7 +670,7 @@ version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28d1c9c15093eb224f0baa400f38fcd713fc1391a6f1c389d886beef146d60a3" dependencies = [ - "base64 0.21.5", + "base64 0.21.6", "blowfish", "getrandom", "subtle", @@ -819,9 +832,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.13" +version = "4.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52bdc885e4cacc7f7c9eedc1ef6da641603180c783c41a15c264944deeaab642" +checksum = "33e92c5c1a78c62968ec57dbc2440366a2d6e5a23faf829970ff1585dc6b18e2" dependencies = [ "clap_builder", "clap_derive", @@ -829,9 +842,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.12" +version = "4.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb7fb5e4e979aec3be7791562fcba452f94ad85e954da024396433e0e25a79e9" +checksum = "f4323769dc8a61e2c39ad7dc26f6f2800524691a44d74fe3d1071a5c24db6370" dependencies = [ "anstream", "anstyle", @@ -863,6 +876,15 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +[[package]] +name = "concurrent-queue" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "config" version = "0.13.4" @@ -987,44 +1009,37 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.10" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82a9b73a36529d9c47029b9fb3a6f0ea3cc916a261195352ba19e770fc1748b2" +checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b" dependencies = [ - "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-deque" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fca89a0e215bab21874660c67903c5f143333cab1da83d041c7ded6053774751" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.17" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e3681d554572a651dda4186cd47240627c3d0114d45a95f6ad27f2f22e7548d" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "autocfg", - "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.18" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3a430a770ebd84726f584a90ee7f020d28db52c6d02138900f22341f866d39c" -dependencies = [ - "cfg-if", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "crypto-common" @@ -1251,9 +1266,14 @@ dependencies = [ [[package]] name = "event-listener" -version = "2.5.3" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" +checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] [[package]] name = "fastrand" @@ -1511,7 +1531,7 @@ version = "7.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "765c9198f173dd59ce26ff9f95ef0aafd0a0fe01fb9d72841bc5066a4c06511d" dependencies = [ - "base64 0.21.5", + "base64 0.21.6", "byteorder", "flate2", "nom", @@ -1584,7 +1604,7 @@ dependencies = [ "actix-http", "actix-rt", "actix-web", - "base64 0.21.5", + "base64 0.21.6", "futures-core", "http-signature-normalization", "ring", @@ -1603,7 +1623,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86048ef6b1d59bcb2cdde0100bb16b1a29ce78ab6dd4a90706ba0791a2831b5a" dependencies = [ "async-trait", - "base64 0.21.5", + "base64 0.21.6", "http-signature-normalization", "httpdate", "reqwest", @@ -1992,7 +2012,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83a4c4718a371ddfb7806378f23617876eea8b82e5ff1324516bcd283249d9ea" dependencies = [ - "base64 0.21.5", + "base64 0.21.6", "hyper", "indexmap 1.9.3", "ipnet", @@ -2398,6 +2418,12 @@ dependencies = [ "vlq", ] +[[package]] +name = "parking" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" + [[package]] name = "parking_lot" version = "0.11.2" @@ -2981,7 +3007,7 @@ version = "0.11.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" dependencies = [ - "base64 0.21.5", + "base64 0.21.6", "bytes", "encoding_rs", "futures-core", @@ -3129,7 +3155,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "88ca6a6947c6fe6454c93c3bb65b92f9680e6f9e906e75e30631110f2227344c" dependencies = [ - "base64 0.21.5", + "base64 0.21.6", "num-bigint-dig", "rsa", "thiserror", @@ -3158,7 +3184,7 @@ version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b0a930679d54e46fa4e66be3d9a333026da04d2b659e42aab4dfd1586452815" dependencies = [ - "base64 0.21.5", + "base64 0.21.6", "bytecount", "itertools 0.11.0", "md5", @@ -3216,7 +3242,7 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "base64 0.21.5", + "base64 0.21.6", ] [[package]] @@ -3514,9 +3540,9 @@ dependencies = [ [[package]] name = "strsim" -version = "0.10.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccbca6f34534eb78dbee83f6b2c9442fea7113f43d9e80ea320f0972ae5dc08d" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "subtle" @@ -3880,7 +3906,7 @@ checksum = "3082666a3a6433f7f511c7192923fa1fe07c69332d3c6a2e6bb040b569199d5a" dependencies = [ "async-trait", "axum", - "base64 0.21.5", + "base64 0.21.6", "bytes", "futures-core", "futures-util", @@ -3909,7 +3935,7 @@ dependencies = [ "async-stream", "async-trait", "axum", - "base64 0.21.5", + "base64 0.21.6", "bytes", "h2", "http", @@ -4162,6 +4188,7 @@ version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e395fcf16a7a3d8127ec99782007af141946b4795001f876d54fb0d55978560" dependencies = [ + "atomic", "getrandom", "serde", ] diff --git a/Cargo.toml b/Cargo.toml index b04f937..ba1cdcf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -72,7 +72,6 @@ thiserror = "1.0" time = { version = "0.3.17", features = ["serde"] } tracing = "0.1" tracing-error = "0.2" -tracing-futures = "0.2" tracing-log = "0.2" tracing-opentelemetry = "0.22" tracing-subscriber = { version = "0.3", features = [ @@ -85,9 +84,10 @@ uuid = { version = "1", features = ["v4", "serde"] } streem = "0.2.0" [dependencies.background-jobs] -version = "0.16.0" +version = "0.17.0" +git = "https://git.asonix.dog/asonix/background-jobs" default-features = false -features = ["background-jobs-actix", "error-logging"] +features = ["background-jobs-actix", "background-jobs-metrics", "error-logging"] [dependencies.http-signature-normalization-actix] version = "0.11.0" diff --git a/src/future.rs b/src/future.rs index 905a931..4fb7763 100644 --- a/src/future.rs +++ b/src/future.rs @@ -1,3 +1,4 @@ use std::{future::Future, pin::Pin}; pub(crate) type LocalBoxFuture<'a, T> = Pin + 'a>>; +pub(crate) type BoxFuture<'a, T> = Pin + Send + 'a>>; diff --git a/src/jobs.rs b/src/jobs.rs index 6298938..4e3ed39 100644 --- a/src/jobs.rs +++ b/src/jobs.rs @@ -20,6 +20,7 @@ use crate::{ }; use background_jobs::{ memory_storage::{ActixTimer, Storage}, + metrics::MetricsStorage, Job, QueueHandle, WorkerConfig, }; use std::time::Duration; @@ -46,15 +47,18 @@ pub(crate) fn create_workers( ) -> JobServer { let deliver_concurrency = config.deliver_concurrency(); - let queue_handle = WorkerConfig::new(Storage::new(ActixTimer), move |queue_handle| { - JobState::new( - state.clone(), - actors.clone(), - JobServer::new(queue_handle), - media.clone(), - config.clone(), - ) - }) + let queue_handle = WorkerConfig::new( + MetricsStorage::wrap(Storage::new(ActixTimer)), + move |queue_handle| { + JobState::new( + state.clone(), + actors.clone(), + JobServer::new(queue_handle), + media.clone(), + config.clone(), + ) + }, + ) .register::() .register::() .register::() diff --git a/src/jobs/apub/announce.rs b/src/jobs/apub/announce.rs index 480f8db..833c483 100644 --- a/src/jobs/apub/announce.rs +++ b/src/jobs/apub/announce.rs @@ -2,14 +2,14 @@ use crate::{ config::{Config, UrlKind}, db::Actor, error::Error, + future::BoxFuture, jobs::{ apub::{get_inboxes, prepare_activity}, DeliverMany, JobState, }, }; use activitystreams::{activity::Announce as AsAnnounce, iri_string::types::IriString}; -use background_jobs::ActixJob; -use std::{future::Future, pin::Pin}; +use background_jobs::Job; #[derive(Clone, serde::Deserialize, serde::Serialize)] pub(crate) struct Announce { @@ -62,9 +62,9 @@ fn generate_announce( ) } -impl ActixJob for Announce { +impl Job for Announce { type State = JobState; - type Future = Pin>>>; + type Future = BoxFuture<'static, anyhow::Result<()>>; const NAME: &'static str = "relay::jobs::apub::Announce"; const QUEUE: &'static str = "apub"; diff --git a/src/jobs/apub/follow.rs b/src/jobs/apub/follow.rs index 10cae22..d916ffc 100644 --- a/src/jobs/apub/follow.rs +++ b/src/jobs/apub/follow.rs @@ -3,6 +3,7 @@ use crate::{ config::{Config, UrlKind}, db::Actor, error::{Error, ErrorKind}, + future::BoxFuture, jobs::{apub::prepare_activity, Deliver, JobState, QueryInstance, QueryNodeinfo}, }; use activitystreams::{ @@ -10,8 +11,7 @@ use activitystreams::{ iri_string::types::IriString, prelude::*, }; -use background_jobs::ActixJob; -use std::{future::Future, pin::Pin}; +use background_jobs::Job; #[derive(Clone, serde::Deserialize, serde::Serialize)] pub(crate) struct Follow { @@ -111,9 +111,9 @@ fn generate_accept_follow( ) } -impl ActixJob for Follow { +impl Job for Follow { type State = JobState; - type Future = Pin>>>; + type Future = BoxFuture<'static, anyhow::Result<()>>; const NAME: &'static str = "relay::jobs::apub::Follow"; const QUEUE: &'static str = "apub"; diff --git a/src/jobs/apub/forward.rs b/src/jobs/apub/forward.rs index f5e191b..7336fe8 100644 --- a/src/jobs/apub/forward.rs +++ b/src/jobs/apub/forward.rs @@ -2,11 +2,11 @@ use crate::{ apub::AcceptedActivities, db::Actor, error::{Error, ErrorKind}, + future::BoxFuture, jobs::{apub::get_inboxes, DeliverMany, JobState}, }; use activitystreams::prelude::*; -use background_jobs::ActixJob; -use std::{future::Future, pin::Pin}; +use background_jobs::Job; #[derive(Clone, serde::Deserialize, serde::Serialize)] pub(crate) struct Forward { @@ -47,9 +47,9 @@ impl Forward { } } -impl ActixJob for Forward { +impl Job for Forward { type State = JobState; - type Future = Pin>>>; + type Future = BoxFuture<'static, anyhow::Result<()>>; const NAME: &'static str = "relay::jobs::apub::Forward"; const QUEUE: &'static str = "apub"; diff --git a/src/jobs/apub/reject.rs b/src/jobs/apub/reject.rs index 2384426..7a1bf40 100644 --- a/src/jobs/apub/reject.rs +++ b/src/jobs/apub/reject.rs @@ -2,10 +2,10 @@ use crate::{ config::UrlKind, db::Actor, error::Error, + future::BoxFuture, jobs::{apub::generate_undo_follow, Deliver, JobState}, }; -use background_jobs::ActixJob; -use std::{future::Future, pin::Pin}; +use background_jobs::Job; #[derive(Clone, serde::Deserialize, serde::Serialize)] pub(crate) struct Reject(pub(crate) Actor); @@ -33,9 +33,9 @@ impl Reject { } } -impl ActixJob for Reject { +impl Job for Reject { type State = JobState; - type Future = Pin>>>; + type Future = BoxFuture<'static, anyhow::Result<()>>; const NAME: &'static str = "relay::jobs::apub::Reject"; const QUEUE: &'static str = "apub"; diff --git a/src/jobs/apub/undo.rs b/src/jobs/apub/undo.rs index b55d4ae..e45f06c 100644 --- a/src/jobs/apub/undo.rs +++ b/src/jobs/apub/undo.rs @@ -3,11 +3,11 @@ use crate::{ config::UrlKind, db::Actor, error::Error, + future::BoxFuture, jobs::{apub::generate_undo_follow, Deliver, JobState}, }; use activitystreams::prelude::BaseExt; -use background_jobs::ActixJob; -use std::{future::Future, pin::Pin}; +use background_jobs::Job; #[derive(Clone, serde::Deserialize, serde::Serialize)] pub(crate) struct Undo { @@ -48,9 +48,9 @@ impl Undo { } } -impl ActixJob for Undo { +impl Job for Undo { type State = JobState; - type Future = Pin>>>; + type Future = BoxFuture<'static, anyhow::Result<()>>; const NAME: &'static str = "relay::jobs::apub::Undo"; const QUEUE: &'static str = "apub"; diff --git a/src/jobs/contact.rs b/src/jobs/contact.rs index c3c3765..7e475f3 100644 --- a/src/jobs/contact.rs +++ b/src/jobs/contact.rs @@ -1,12 +1,12 @@ use crate::{ apub::AcceptedActors, error::{Error, ErrorKind}, + future::BoxFuture, jobs::JobState, requests::BreakerStrategy, }; use activitystreams::{iri_string::types::IriString, object::Image, prelude::*}; -use background_jobs::ActixJob; -use std::{future::Future, pin::Pin}; +use background_jobs::Job; #[derive(Clone, serde::Deserialize, serde::Serialize)] pub(crate) struct QueryContact { @@ -85,9 +85,9 @@ fn to_contact(contact: AcceptedActors) -> Option<(String, String, IriString, Iri Some((username, display_name, url, avatar)) } -impl ActixJob for QueryContact { +impl Job for QueryContact { type State = JobState; - type Future = Pin>>>; + type Future = BoxFuture<'static, anyhow::Result<()>>; const NAME: &'static str = "relay::jobs::QueryContact"; const QUEUE: &'static str = "maintenance"; diff --git a/src/jobs/deliver.rs b/src/jobs/deliver.rs index 0f936e4..74af9f7 100644 --- a/src/jobs/deliver.rs +++ b/src/jobs/deliver.rs @@ -1,11 +1,11 @@ use crate::{ error::Error, + future::BoxFuture, jobs::{debug_object, JobState}, requests::BreakerStrategy, }; use activitystreams::iri_string::types::IriString; -use background_jobs::{ActixJob, Backoff}; -use std::{future::Future, pin::Pin}; +use background_jobs::{Backoff, Job}; #[derive(Clone, serde::Deserialize, serde::Serialize)] pub(crate) struct Deliver { @@ -56,9 +56,9 @@ impl Deliver { } } -impl ActixJob for Deliver { +impl Job for Deliver { type State = JobState; - type Future = Pin>>>; + type Future = BoxFuture<'static, anyhow::Result<()>>; const NAME: &'static str = "relay::jobs::Deliver"; const QUEUE: &'static str = "deliver"; diff --git a/src/jobs/deliver_many.rs b/src/jobs/deliver_many.rs index f932a12..8f7b413 100644 --- a/src/jobs/deliver_many.rs +++ b/src/jobs/deliver_many.rs @@ -1,10 +1,10 @@ use crate::{ error::Error, - future::LocalBoxFuture, + future::BoxFuture, jobs::{debug_object, Deliver, JobState}, }; use activitystreams::iri_string::types::IriString; -use background_jobs::ActixJob; +use background_jobs::Job; #[derive(Clone, serde::Deserialize, serde::Serialize)] pub(crate) struct DeliverMany { @@ -45,9 +45,9 @@ impl DeliverMany { } } -impl ActixJob for DeliverMany { +impl Job for DeliverMany { type State = JobState; - type Future = LocalBoxFuture<'static, Result<(), anyhow::Error>>; + type Future = BoxFuture<'static, anyhow::Result<()>>; const NAME: &'static str = "relay::jobs::DeliverMany"; const QUEUE: &'static str = "deliver"; diff --git a/src/jobs/instance.rs b/src/jobs/instance.rs index a0f3da1..c7bb12f 100644 --- a/src/jobs/instance.rs +++ b/src/jobs/instance.rs @@ -1,12 +1,12 @@ use crate::{ config::UrlKind, error::{Error, ErrorKind}, + future::BoxFuture, jobs::{Boolish, JobState}, requests::BreakerStrategy, }; use activitystreams::{iri, iri_string::types::IriString}; -use background_jobs::ActixJob; -use std::{future::Future, pin::Pin}; +use background_jobs::Job; #[derive(Clone, serde::Deserialize, serde::Serialize)] pub(crate) struct QueryInstance { @@ -165,9 +165,9 @@ impl QueryInstance { } } -impl ActixJob for QueryInstance { +impl Job for QueryInstance { type State = JobState; - type Future = Pin>>>; + type Future = BoxFuture<'static, anyhow::Result<()>>; const NAME: &'static str = "relay::jobs::QueryInstance"; const QUEUE: &'static str = "maintenance"; diff --git a/src/jobs/nodeinfo.rs b/src/jobs/nodeinfo.rs index f9d78a3..7094852 100644 --- a/src/jobs/nodeinfo.rs +++ b/src/jobs/nodeinfo.rs @@ -1,18 +1,18 @@ use crate::{ error::{Error, ErrorKind}, + future::BoxFuture, jobs::{Boolish, JobState, QueryContact}, requests::BreakerStrategy, }; use activitystreams::{iri, iri_string::types::IriString, primitives::OneOrMany}; -use background_jobs::ActixJob; -use std::{fmt::Debug, future::Future, pin::Pin}; +use background_jobs::Job; #[derive(Clone, serde::Deserialize, serde::Serialize)] pub(crate) struct QueryNodeinfo { actor_id: IriString, } -impl Debug for QueryNodeinfo { +impl std::fmt::Debug for QueryNodeinfo { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.debug_struct("QueryNodeinfo") .field("actor_id", &self.actor_id.to_string()) @@ -104,9 +104,9 @@ impl QueryNodeinfo { } } -impl ActixJob for QueryNodeinfo { +impl Job for QueryNodeinfo { type State = JobState; - type Future = Pin>>>; + type Future = BoxFuture<'static, anyhow::Result<()>>; const NAME: &'static str = "relay::jobs::QueryNodeinfo"; const QUEUE: &'static str = "maintenance"; diff --git a/src/jobs/process_listeners.rs b/src/jobs/process_listeners.rs index 1cad2e4..96435b3 100644 --- a/src/jobs/process_listeners.rs +++ b/src/jobs/process_listeners.rs @@ -1,9 +1,9 @@ use crate::{ error::Error, + future::BoxFuture, jobs::{instance::QueryInstance, nodeinfo::QueryNodeinfo, JobState}, }; -use background_jobs::ActixJob; -use std::{future::Future, pin::Pin}; +use background_jobs::Job; #[derive(Clone, Debug, serde::Deserialize, serde::Serialize)] pub(crate) struct Listeners; @@ -23,9 +23,9 @@ impl Listeners { } } -impl ActixJob for Listeners { +impl Job for Listeners { type State = JobState; - type Future = Pin>>>; + type Future = BoxFuture<'static, anyhow::Result<()>>; const NAME: &'static str = "relay::jobs::Listeners"; const QUEUE: &'static str = "maintenance"; diff --git a/src/jobs/record_last_online.rs b/src/jobs/record_last_online.rs index 3c81b31..59333f4 100644 --- a/src/jobs/record_last_online.rs +++ b/src/jobs/record_last_online.rs @@ -1,6 +1,5 @@ -use crate::{error::Error, jobs::JobState}; -use background_jobs::{ActixJob, Backoff}; -use std::{future::Future, pin::Pin}; +use crate::{error::Error, future::BoxFuture, jobs::JobState}; +use background_jobs::{Backoff, Job}; #[derive(Clone, Debug, serde::Deserialize, serde::Serialize)] pub(crate) struct RecordLastOnline; @@ -14,9 +13,9 @@ impl RecordLastOnline { } } -impl ActixJob for RecordLastOnline { +impl Job for RecordLastOnline { type State = JobState; - type Future = Pin>>>; + type Future = BoxFuture<'static, anyhow::Result<()>>; const NAME: &'static str = "relay::jobs::RecordLastOnline"; const QUEUE: &'static str = "maintenance"; From 18f109622151817929f27322f8059b8606d8bd5a Mon Sep 17 00:00:00 2001 From: asonix Date: Mon, 8 Jan 2024 17:06:02 -0600 Subject: [PATCH 11/27] Update version --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bd3900a..dd4b04f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -384,7 +384,7 @@ checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" [[package]] name = "ap-relay" -version = "0.3.105" +version = "0.3.106-beta.1" dependencies = [ "activitystreams", "activitystreams-ext", diff --git a/Cargo.toml b/Cargo.toml index ba1cdcf..549351f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "ap-relay" description = "A simple activitypub relay" -version = "0.3.105" +version = "0.3.106-beta.1" authors = ["asonix "] license = "AGPL-3.0" readme = "README.md" From 2b3cb8db92a86ae2a293325d560506b477d2380e Mon Sep 17 00:00:00 2001 From: asonix Date: Mon, 8 Jan 2024 17:10:31 -0600 Subject: [PATCH 12/27] clippy --- src/jobs/nodeinfo.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jobs/nodeinfo.rs b/src/jobs/nodeinfo.rs index 7094852..41de14c 100644 --- a/src/jobs/nodeinfo.rs +++ b/src/jobs/nodeinfo.rs @@ -92,7 +92,7 @@ impl QueryNodeinfo { .metadata .and_then(|meta| meta.into_iter().next().and_then(|meta| meta.staff_accounts)) { - if let Some(contact_id) = accounts.get(0) { + if let Some(contact_id) = accounts.first() { state .job_server .queue(QueryContact::new(self.actor_id, contact_id.clone())) From a2456c3d5fce4f076999fe8d009f16bb94795b5d Mon Sep 17 00:00:00 2001 From: asonix Date: Tue, 9 Jan 2024 18:08:10 -0600 Subject: [PATCH 13/27] Update dependencies (minor & point) --- Cargo.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dd4b04f..1d86d99 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -567,7 +567,7 @@ dependencies = [ [[package]] name = "background-jobs" version = "0.17.0" -source = "git+https://git.asonix.dog/asonix/background-jobs#e02de4a15340eefd41d130d785ed59019558986f" +source = "git+https://git.asonix.dog/asonix/background-jobs#2727645ca9d44ceefcc7e954694323eb55fd38ef" dependencies = [ "background-jobs-actix", "background-jobs-core", @@ -577,7 +577,7 @@ dependencies = [ [[package]] name = "background-jobs-actix" version = "0.17.0" -source = "git+https://git.asonix.dog/asonix/background-jobs#e02de4a15340eefd41d130d785ed59019558986f" +source = "git+https://git.asonix.dog/asonix/background-jobs#2727645ca9d44ceefcc7e954694323eb55fd38ef" dependencies = [ "actix-rt", "anyhow", @@ -595,7 +595,7 @@ dependencies = [ [[package]] name = "background-jobs-core" version = "0.17.0" -source = "git+https://git.asonix.dog/asonix/background-jobs#e02de4a15340eefd41d130d785ed59019558986f" +source = "git+https://git.asonix.dog/asonix/background-jobs#2727645ca9d44ceefcc7e954694323eb55fd38ef" dependencies = [ "anyhow", "async-trait", @@ -612,7 +612,7 @@ dependencies = [ [[package]] name = "background-jobs-metrics" version = "0.17.0" -source = "git+https://git.asonix.dog/asonix/background-jobs#e02de4a15340eefd41d130d785ed59019558986f" +source = "git+https://git.asonix.dog/asonix/background-jobs#2727645ca9d44ceefcc7e954694323eb55fd38ef" dependencies = [ "async-trait", "background-jobs-core", @@ -1454,9 +1454,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", "js-sys", From 417553e6439b94045a2150e885813c6221c63a47 Mon Sep 17 00:00:00 2001 From: asonix Date: Tue, 9 Jan 2024 18:09:51 -0600 Subject: [PATCH 14/27] Bump version --- Cargo.lock | 2 +- Cargo.toml | 2 +- relay.nix | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1d86d99..16dcd31 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -384,7 +384,7 @@ checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" [[package]] name = "ap-relay" -version = "0.3.106-beta.1" +version = "0.3.106-beta.2" dependencies = [ "activitystreams", "activitystreams-ext", diff --git a/Cargo.toml b/Cargo.toml index 549351f..20559dc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "ap-relay" description = "A simple activitypub relay" -version = "0.3.106-beta.1" +version = "0.3.106-beta.2" authors = ["asonix "] license = "AGPL-3.0" readme = "README.md" diff --git a/relay.nix b/relay.nix index 2cc07f2..97a255b 100644 --- a/relay.nix +++ b/relay.nix @@ -5,7 +5,7 @@ rustPlatform.buildRustPackage { pname = "relay"; - version = "0.3.105"; + version = "0.3.106-beta.2"; src = ./.; cargoLock.lockFile = ./Cargo.lock; From d862bf81062c3eac503e1bed26dc12b402ae9f35 Mon Sep 17 00:00:00 2001 From: asonix Date: Sun, 14 Jan 2024 15:56:07 -0500 Subject: [PATCH 15/27] Use tokio rather than actix-rt --- Cargo.lock | 36 +++++++++++++++++------------------- Cargo.toml | 5 ++--- src/db.rs | 7 ++++++- src/error.rs | 2 +- src/jobs.rs | 27 ++++++++++++++++----------- src/main.rs | 28 ++++++++-------------------- src/spawner.rs | 2 +- src/telegram.rs | 2 +- 8 files changed, 52 insertions(+), 57 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 16dcd31..ebce92f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -388,7 +388,6 @@ version = "0.3.106-beta.2" dependencies = [ "activitystreams", "activitystreams-ext", - "actix-rt", "actix-web", "actix-webfinger", "ammonia", @@ -567,57 +566,55 @@ dependencies = [ [[package]] name = "background-jobs" version = "0.17.0" -source = "git+https://git.asonix.dog/asonix/background-jobs#2727645ca9d44ceefcc7e954694323eb55fd38ef" +source = "git+https://git.asonix.dog/asonix/background-jobs#5a95a71b7c450dc0e303316f43572d0916eeef93" dependencies = [ - "background-jobs-actix", "background-jobs-core", "background-jobs-metrics", + "background-jobs-tokio", ] [[package]] -name = "background-jobs-actix" +name = "background-jobs-core" version = "0.17.0" -source = "git+https://git.asonix.dog/asonix/background-jobs#2727645ca9d44ceefcc7e954694323eb55fd38ef" +source = "git+https://git.asonix.dog/asonix/background-jobs#5a95a71b7c450dc0e303316f43572d0916eeef93" dependencies = [ - "actix-rt", "anyhow", "async-trait", - "background-jobs-core", + "event-listener", "metrics", "serde", "serde_json", "thiserror", - "tokio", + "time", "tracing", "uuid", ] [[package]] -name = "background-jobs-core" +name = "background-jobs-metrics" version = "0.17.0" -source = "git+https://git.asonix.dog/asonix/background-jobs#2727645ca9d44ceefcc7e954694323eb55fd38ef" +source = "git+https://git.asonix.dog/asonix/background-jobs#5a95a71b7c450dc0e303316f43572d0916eeef93" dependencies = [ - "anyhow", "async-trait", - "event-listener", + "background-jobs-core", "metrics", - "serde", - "serde_json", - "thiserror", - "time", + "metrics-util", "tracing", "uuid", ] [[package]] -name = "background-jobs-metrics" +name = "background-jobs-tokio" version = "0.17.0" -source = "git+https://git.asonix.dog/asonix/background-jobs#2727645ca9d44ceefcc7e954694323eb55fd38ef" +source = "git+https://git.asonix.dog/asonix/background-jobs#5a95a71b7c450dc0e303316f43572d0916eeef93" dependencies = [ + "anyhow", "async-trait", "background-jobs-core", "metrics", - "metrics-util", + "serde", + "serde_json", + "tokio", "tracing", "uuid", ] @@ -3790,6 +3787,7 @@ dependencies = [ "bytes", "libc", "mio", + "num_cpus", "parking_lot 0.12.1", "pin-project-lite", "signal-hook-registry", diff --git a/Cargo.toml b/Cargo.toml index 20559dc..0355957 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,6 @@ default = [] [dependencies] anyhow = "1.0" -actix-rt = "2.7.0" actix-web = { version = "4.4.0", default-features = false, features = ["compress-brotli", "compress-gzip", "rustls-0_21"] } actix-webfinger = { version = "0.5.0", default-features = false } activitystreams = "0.7.0-alpha.25" @@ -79,7 +78,7 @@ tracing-subscriber = { version = "0.3", features = [ "env-filter", "fmt", ] } -tokio = { version = "1", features = ["macros", "sync"] } +tokio = { version = "1", features = ["full", "tracing"] } uuid = { version = "1", features = ["v4", "serde"] } streem = "0.2.0" @@ -87,7 +86,7 @@ streem = "0.2.0" version = "0.17.0" git = "https://git.asonix.dog/asonix/background-jobs" default-features = false -features = ["background-jobs-actix", "background-jobs-metrics", "error-logging"] +features = ["error-logging", "metrics", "tokio"] [dependencies.http-signature-normalization-actix] version = "0.11.0" diff --git a/src/db.rs b/src/db.rs index edf00c1..ba3b7fb 100644 --- a/src/db.rs +++ b/src/db.rs @@ -750,6 +750,11 @@ mod tests { { let db = Db::build_inner(true, sled::Config::new().temporary(true).open().unwrap()).unwrap(); - actix_rt::System::new().block_on((f)(db)); + + tokio::runtime::Builder::new_current_thread() + .enable_all() + .build() + .unwrap() + .block_on((f)(db)); } } diff --git a/src/error.rs b/src/error.rs index e1461db..f83d931 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,5 +1,4 @@ use activitystreams::checked::CheckError; -use actix_rt::task::JoinError; use actix_web::{ error::{BlockingError, ResponseError}, http::StatusCode, @@ -7,6 +6,7 @@ use actix_web::{ }; use http_signature_normalization_reqwest::SignError; use std::{convert::Infallible, fmt::Debug, io}; +use tokio::task::JoinError; use tracing_error::SpanTrace; pub(crate) struct Error { diff --git a/src/jobs.rs b/src/jobs.rs index 4e3ed39..7307b3c 100644 --- a/src/jobs.rs +++ b/src/jobs.rs @@ -19,9 +19,10 @@ use crate::{ jobs::{process_listeners::Listeners, record_last_online::RecordLastOnline}, }; use background_jobs::{ - memory_storage::{ActixTimer, Storage}, + memory_storage::{Storage, TokioTimer}, metrics::MetricsStorage, - Job, QueueHandle, WorkerConfig, + tokio::{QueueHandle, WorkerConfig}, + Job, }; use std::time::Duration; @@ -44,11 +45,15 @@ pub(crate) fn create_workers( actors: ActorCache, media: MediaCache, config: Config, -) -> JobServer { +) -> std::io::Result { + let parallelism = std::thread::available_parallelism() + .map(usize::from) + .unwrap_or(1) as u64; + let deliver_concurrency = config.deliver_concurrency(); let queue_handle = WorkerConfig::new( - MetricsStorage::wrap(Storage::new(ActixTimer)), + MetricsStorage::wrap(Storage::new(TokioTimer)), move |queue_handle| { JobState::new( state.clone(), @@ -71,15 +76,15 @@ pub(crate) fn create_workers( .register::() .register::() .register::() - .set_worker_count("maintenance", 2) - .set_worker_count("apub", 2) - .set_worker_count("deliver", deliver_concurrency) - .start(); + .set_worker_count("maintenance", 2 * parallelism) + .set_worker_count("apub", 2 * parallelism) + .set_worker_count("deliver", deliver_concurrency * parallelism) + .start()?; - queue_handle.every(Duration::from_secs(60 * 5), Listeners); - queue_handle.every(Duration::from_secs(60 * 10), RecordLastOnline); + queue_handle.every(Duration::from_secs(60 * 5), Listeners)?; + queue_handle.every(Duration::from_secs(60 * 10), RecordLastOnline)?; - JobServer::new(queue_handle) + Ok(JobServer::new(queue_handle)) } #[derive(Clone, Debug)] diff --git a/src/main.rs b/src/main.rs index b286f3e..13fc32c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,7 +4,6 @@ use std::time::Duration; use activitystreams::iri_string::types::IriString; -use actix_rt::task::JoinHandle; use actix_web::{middleware::Compress, web, App, HttpServer}; use collector::MemoryCollector; #[cfg(feature = "console")] @@ -18,6 +17,7 @@ use opentelemetry_otlp::WithExportConfig; use opentelemetry_sdk::Resource; use reqwest_middleware::ClientWithMiddleware; use rustls::ServerConfig; +use tokio::task::JoinHandle; use tracing_actix_web::TracingLogger; use tracing_error::ErrorLayer; use tracing_log::LogTracer; @@ -141,7 +141,7 @@ fn build_client( Ok(client_with_middleware) } -#[actix_rt::main] +#[tokio::main] async fn main() -> Result<(), anyhow::Error> { dotenv::dotenv().ok(); @@ -162,7 +162,7 @@ async fn main() -> Result<(), anyhow::Error> { .with_http_listener(bind_addr) .build()?; - actix_rt::spawn(exporter); + tokio::spawn(exporter); let recorder = FanoutBuilder::default() .add_recorder(recorder) .add_recorder(collector.clone()) @@ -179,7 +179,7 @@ async fn main() -> Result<(), anyhow::Error> { let actors = ActorCache::new(db.clone()); let media = MediaCache::new(db.clone()); - server_main(db, actors, media, collector, config).await??; + server_main(db, actors, media, collector, config).await?; tracing::warn!("Application exit"); @@ -187,7 +187,7 @@ async fn main() -> Result<(), anyhow::Error> { } fn client_main(config: Config, args: Args) -> JoinHandle> { - actix_rt::spawn(do_client_main(config, args)) + tokio::spawn(do_client_main(config, args)) } async fn do_client_main(config: Config, args: Args) -> Result<(), anyhow::Error> { @@ -273,19 +273,9 @@ async fn do_client_main(config: Config, args: Args) -> Result<(), anyhow::Error> Ok(()) } -fn server_main( - db: Db, - actors: ActorCache, - media: MediaCache, - collector: MemoryCollector, - config: Config, -) -> JoinHandle> { - actix_rt::spawn(do_server_main(db, actors, media, collector, config)) -} - const VERIFY_RATIO: usize = 7; -async fn do_server_main( +async fn server_main( db: Db, actors: ActorCache, media: MediaCache, @@ -327,10 +317,8 @@ async fn do_server_main( let bind_address = config.bind_address(); let sign_spawner2 = sign_spawner.clone(); let verify_spawner2 = verify_spawner.clone(); + let job_server = create_workers(state.clone(), actors.clone(), media.clone(), config.clone())?; let server = HttpServer::new(move || { - let job_server = - create_workers(state.clone(), actors.clone(), media.clone(), config.clone()); - let app = App::new() .app_data(web::Data::new(db.clone())) .app_data(web::Data::new(state.clone())) @@ -339,7 +327,7 @@ async fn do_server_main( )) .app_data(web::Data::new(actors.clone())) .app_data(web::Data::new(config.clone())) - .app_data(web::Data::new(job_server)) + .app_data(web::Data::new(job_server.clone())) .app_data(web::Data::new(media.clone())) .app_data(web::Data::new(collector.clone())) .app_data(web::Data::new(verify_spawner.clone())); diff --git a/src/spawner.rs b/src/spawner.rs index b967e9b..b19aeff 100644 --- a/src/spawner.rs +++ b/src/spawner.rs @@ -36,7 +36,7 @@ where metrics::counter!("relay.spawner.wait-timer.start").increment(1); - let mut interval = actix_rt::time::interval(Duration::from_secs(5)); + let mut interval = tokio::time::interval(Duration::from_secs(5)); // pass the first tick (instant) interval.tick().await; diff --git a/src/telegram.rs b/src/telegram.rs index f3cce43..9a80edc 100644 --- a/src/telegram.rs +++ b/src/telegram.rs @@ -46,7 +46,7 @@ pub(crate) fn start(admin_handle: String, db: Db, token: &str) { let bot = Bot::new(token); let admin_handle = Arc::new(admin_handle); - actix_rt::spawn(async move { + tokio::spawn(async move { let command_handler = teloxide::filter_command::().endpoint( move |bot: Bot, msg: Message, cmd: Command| { let admin_handle = admin_handle.clone(); From 9090bb5c620dbb38516327ac6507e137cfa10699 Mon Sep 17 00:00:00 2001 From: asonix Date: Sun, 14 Jan 2024 15:59:16 -0500 Subject: [PATCH 16/27] Bump version --- Cargo.lock | 2 +- Cargo.toml | 2 +- relay.nix | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ebce92f..ec64d72 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -384,7 +384,7 @@ checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" [[package]] name = "ap-relay" -version = "0.3.106-beta.2" +version = "0.3.106-beta.3" dependencies = [ "activitystreams", "activitystreams-ext", diff --git a/Cargo.toml b/Cargo.toml index 0355957..ad7cfd4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "ap-relay" description = "A simple activitypub relay" -version = "0.3.106-beta.2" +version = "0.3.106-beta.3" authors = ["asonix "] license = "AGPL-3.0" readme = "README.md" diff --git a/relay.nix b/relay.nix index 97a255b..f9b2e40 100644 --- a/relay.nix +++ b/relay.nix @@ -5,7 +5,7 @@ rustPlatform.buildRustPackage { pname = "relay"; - version = "0.3.106-beta.2"; + version = "0.3.106-beta.3"; src = ./.; cargoLock.lockFile = ./Cargo.lock; From 83e5619eb482ed3e70dbb0d7c48bea9a8adad7a7 Mon Sep 17 00:00:00 2001 From: asonix Date: Sun, 14 Jan 2024 16:10:19 -0500 Subject: [PATCH 17/27] Update flake.lock --- flake.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index b79aca5..e987670 100644 --- a/flake.lock +++ b/flake.lock @@ -5,11 +5,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1694529238, - "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", "owner": "numtide", "repo": "flake-utils", - "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", "type": "github" }, "original": { @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1700794826, - "narHash": "sha256-RyJTnTNKhO0yqRpDISk03I/4A67/dp96YRxc86YOPgU=", + "lastModified": 1705133751, + "narHash": "sha256-rCIsyE80jgiOU78gCWN3A0wE0tR2GI5nH6MlS+HaaSQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5a09cb4b393d58f9ed0d9ca1555016a8543c2ac8", + "rev": "9b19f5e77dd906cb52dade0b7bd280339d2a1f3d", "type": "github" }, "original": { From 6dcdf2fc87fc3d0caa4f7b55911e925a76d3e187 Mon Sep 17 00:00:00 2001 From: asonix Date: Sun, 14 Jan 2024 16:10:32 -0500 Subject: [PATCH 18/27] clippy --- src/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 13fc32c..925cf04 100644 --- a/src/main.rs +++ b/src/main.rs @@ -152,7 +152,8 @@ async fn main() -> Result<(), anyhow::Error> { let args = Args::new(); if args.any() { - return client_main(config, args).await?; + client_main(config, args).await??; + return Ok(()); } let collector = MemoryCollector::new(); From b53b34c515670bb2aa93740c8fd113eeb7902996 Mon Sep 17 00:00:00 2001 From: asonix Date: Sun, 14 Jan 2024 16:16:56 -0500 Subject: [PATCH 19/27] Update dependencies (minor & point) --- Cargo.lock | 86 +++++++++++++++++++++++++++--------------------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ec64d72..8b363a6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -66,7 +66,7 @@ dependencies = [ "actix-tls", "actix-utils", "ahash 0.8.7", - "base64 0.21.6", + "base64 0.21.7", "bitflags 2.4.1", "brotli", "bytes", @@ -330,9 +330,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.5" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d664a92ecae85fd0a7392615844904654d1d5f5514837f471ddef4a057aba1b6" +checksum = "4cd2405b3ac1faab2990b74d728624cd9fd115651fcecc7c2d8daf01376275ba" dependencies = [ "anstyle", "anstyle-parse", @@ -394,7 +394,7 @@ dependencies = [ "anyhow", "async-cpupool", "background-jobs", - "base64 0.21.6", + "base64 0.21.7", "bcrypt", "clap", "config", @@ -642,9 +642,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.6" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c79fed4cdb43e993fcdadc7e58a09fd0e3e649c4436fa11da71c9f1f3ee7feb9" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64-simd" @@ -667,7 +667,7 @@ version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28d1c9c15093eb224f0baa400f38fcd713fc1391a6f1c389d886beef146d60a3" dependencies = [ - "base64 0.21.6", + "base64 0.21.7", "blowfish", "getrandom", "subtle", @@ -829,9 +829,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.14" +version = "4.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33e92c5c1a78c62968ec57dbc2440366a2d6e5a23faf829970ff1585dc6b18e2" +checksum = "58e54881c004cec7895b0068a0a954cd5d62da01aef83fa35b1e594497bf5445" dependencies = [ "clap_builder", "clap_derive", @@ -839,9 +839,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.14" +version = "4.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4323769dc8a61e2c39ad7dc26f6f2800524691a44d74fe3d1071a5c24db6370" +checksum = "59cb82d7f531603d2fd1f507441cdd35184fa81beff7bd489570de7f773460bb" dependencies = [ "anstream", "anstyle", @@ -1476,9 +1476,9 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "h2" -version = "0.3.22" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d6250322ef6e60f93f9a2162799302cd6f68f79f6e5d85c8c16f14d1d958178" +checksum = "b553656127a00601c8ae5590fcfdc118e4083a7924b6cf4ffc1ea4b99dc429d7" dependencies = [ "bytes", "fnv", @@ -1528,7 +1528,7 @@ version = "7.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "765c9198f173dd59ce26ff9f95ef0aafd0a0fe01fb9d72841bc5066a4c06511d" dependencies = [ - "base64 0.21.6", + "base64 0.21.7", "byteorder", "flate2", "nom", @@ -1601,7 +1601,7 @@ dependencies = [ "actix-http", "actix-rt", "actix-web", - "base64 0.21.6", + "base64 0.21.7", "futures-core", "http-signature-normalization", "ring", @@ -1620,7 +1620,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86048ef6b1d59bcb2cdde0100bb16b1a29ce78ab6dd4a90706ba0791a2831b5a" dependencies = [ "async-trait", - "base64 0.21.6", + "base64 0.21.7", "http-signature-normalization", "httpdate", "reqwest", @@ -1817,9 +1817,9 @@ checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "js-sys" -version = "0.3.66" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" +checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" dependencies = [ "wasm-bindgen", ] @@ -2009,7 +2009,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83a4c4718a371ddfb7806378f23617876eea8b82e5ff1324516bcd283249d9ea" dependencies = [ - "base64 0.21.6", + "base64 0.21.7", "hyper", "indexmap 1.9.3", "ipnet", @@ -3004,7 +3004,7 @@ version = "0.11.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" dependencies = [ - "base64 0.21.6", + "base64 0.21.7", "bytes", "encoding_rs", "futures-core", @@ -3152,7 +3152,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "88ca6a6947c6fe6454c93c3bb65b92f9680e6f9e906e75e30631110f2227344c" dependencies = [ - "base64 0.21.6", + "base64 0.21.7", "num-bigint-dig", "rsa", "thiserror", @@ -3181,7 +3181,7 @@ version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b0a930679d54e46fa4e66be3d9a333026da04d2b659e42aab4dfd1586452815" dependencies = [ - "base64 0.21.6", + "base64 0.21.7", "bytecount", "itertools 0.11.0", "md5", @@ -3239,7 +3239,7 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "base64 0.21.6", + "base64 0.21.7", ] [[package]] @@ -3460,9 +3460,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.2" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" +checksum = "2593d31f82ead8df961d8bd23a64c2ccf2eb5dd34b0a34bfb4dd54011c72009e" [[package]] name = "socket2" @@ -3904,7 +3904,7 @@ checksum = "3082666a3a6433f7f511c7192923fa1fe07c69332d3c6a2e6bb040b569199d5a" dependencies = [ "async-trait", "axum", - "base64 0.21.6", + "base64 0.21.7", "bytes", "futures-core", "futures-util", @@ -3933,7 +3933,7 @@ dependencies = [ "async-stream", "async-trait", "axum", - "base64 0.21.6", + "base64 0.21.7", "bytes", "h2", "http", @@ -4226,9 +4226,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" +checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -4236,9 +4236,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" +checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" dependencies = [ "bumpalo", "log", @@ -4251,9 +4251,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.39" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" +checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" dependencies = [ "cfg-if", "js-sys", @@ -4263,9 +4263,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" +checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4273,9 +4273,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" +checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" dependencies = [ "proc-macro2", "quote", @@ -4286,9 +4286,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" +checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" [[package]] name = "wasm-streams" @@ -4305,9 +4305,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.66" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f" +checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" dependencies = [ "js-sys", "wasm-bindgen", @@ -4485,9 +4485,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.33" +version = "0.5.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7520bbdec7211caa7c4e682eb1fbe07abe20cee6756b6e00f537c82c11816aa" +checksum = "b7cf47b659b318dccbd69cc4797a39ae128f533dce7902a1096044d1967b9c16" dependencies = [ "memchr", ] From 53939f8ae821f44a891bab7cac4791042106e3c5 Mon Sep 17 00:00:00 2001 From: asonix Date: Thu, 18 Jan 2024 12:31:26 -0500 Subject: [PATCH 20/27] Go back to job-server per core --- src/jobs.rs | 10 +++------- src/main.rs | 7 +++++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/jobs.rs b/src/jobs.rs index 7307b3c..7c19efe 100644 --- a/src/jobs.rs +++ b/src/jobs.rs @@ -46,10 +46,6 @@ pub(crate) fn create_workers( media: MediaCache, config: Config, ) -> std::io::Result { - let parallelism = std::thread::available_parallelism() - .map(usize::from) - .unwrap_or(1) as u64; - let deliver_concurrency = config.deliver_concurrency(); let queue_handle = WorkerConfig::new( @@ -76,9 +72,9 @@ pub(crate) fn create_workers( .register::() .register::() .register::() - .set_worker_count("maintenance", 2 * parallelism) - .set_worker_count("apub", 2 * parallelism) - .set_worker_count("deliver", deliver_concurrency * parallelism) + .set_worker_count("maintenance", 2) + .set_worker_count("apub", 2) + .set_worker_count("deliver", deliver_concurrency) .start()?; queue_handle.every(Duration::from_secs(60 * 5), Listeners)?; diff --git a/src/main.rs b/src/main.rs index 925cf04..4172e17 100644 --- a/src/main.rs +++ b/src/main.rs @@ -318,8 +318,11 @@ async fn server_main( let bind_address = config.bind_address(); let sign_spawner2 = sign_spawner.clone(); let verify_spawner2 = verify_spawner.clone(); - let job_server = create_workers(state.clone(), actors.clone(), media.clone(), config.clone())?; let server = HttpServer::new(move || { + let job_server = + create_workers(state.clone(), actors.clone(), media.clone(), config.clone()) + .expect("Failed to create job server"); + let app = App::new() .app_data(web::Data::new(db.clone())) .app_data(web::Data::new(state.clone())) @@ -328,7 +331,7 @@ async fn server_main( )) .app_data(web::Data::new(actors.clone())) .app_data(web::Data::new(config.clone())) - .app_data(web::Data::new(job_server.clone())) + .app_data(web::Data::new(job_server)) .app_data(web::Data::new(media.clone())) .app_data(web::Data::new(collector.clone())) .app_data(web::Data::new(verify_spawner.clone())); From 6b8f15ee0822e6a307083ba85e8a3d4ced4a7750 Mon Sep 17 00:00:00 2001 From: asonix Date: Thu, 18 Jan 2024 13:34:10 -0500 Subject: [PATCH 21/27] Use stable background-jobs --- Cargo.lock | 66 ++++++++++++++++++++++++++++-------------------------- Cargo.toml | 1 - 2 files changed, 34 insertions(+), 33 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8b363a6..2094787 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -67,7 +67,7 @@ dependencies = [ "actix-utils", "ahash 0.8.7", "base64 0.21.7", - "bitflags 2.4.1", + "bitflags 2.4.2", "brotli", "bytes", "bytestring", @@ -157,9 +157,9 @@ dependencies = [ [[package]] name = "actix-tls" -version = "3.1.1" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72616e7fbec0aa99c6f3164677fa48ff5a60036d0799c98cab894a44f3e0efc3" +checksum = "929e47cc23865cdb856e59673cfba2d28f00b3bbd060dfc80e33a00a3cea8317" dependencies = [ "actix-rt", "actix-service", @@ -167,8 +167,6 @@ dependencies = [ "futures-core", "impl-more", "pin-project-lite", - "rustls", - "rustls-webpki", "tokio", "tokio-rustls", "tokio-util", @@ -330,9 +328,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.7" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd2405b3ac1faab2990b74d728624cd9fd115651fcecc7c2d8daf01376275ba" +checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" dependencies = [ "anstyle", "anstyle-parse", @@ -566,7 +564,8 @@ dependencies = [ [[package]] name = "background-jobs" version = "0.17.0" -source = "git+https://git.asonix.dog/asonix/background-jobs#5a95a71b7c450dc0e303316f43572d0916eeef93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65f83277b60c9c889210ef54207cca1a8f7e6de916ad616ce4140d477c8a6094" dependencies = [ "background-jobs-core", "background-jobs-metrics", @@ -576,7 +575,8 @@ dependencies = [ [[package]] name = "background-jobs-core" version = "0.17.0" -source = "git+https://git.asonix.dog/asonix/background-jobs#5a95a71b7c450dc0e303316f43572d0916eeef93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50ac54b76a9cb9bdf6bdb7a485181e9f9ab95e930aa34b6a74ebda76d04d6b11" dependencies = [ "anyhow", "async-trait", @@ -593,7 +593,8 @@ dependencies = [ [[package]] name = "background-jobs-metrics" version = "0.17.0" -source = "git+https://git.asonix.dog/asonix/background-jobs#5a95a71b7c450dc0e303316f43572d0916eeef93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "119b921bdadd3bd666f8418054933e33b9d279203b8029c5881e3174c2821f79" dependencies = [ "async-trait", "background-jobs-core", @@ -606,7 +607,8 @@ dependencies = [ [[package]] name = "background-jobs-tokio" version = "0.17.0" -source = "git+https://git.asonix.dog/asonix/background-jobs#5a95a71b7c450dc0e303316f43572d0916eeef93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d18cbc0bda6c07ffca4146ac88d93f93f93f374012a0c425c3a8b7fd34ccce4e" dependencies = [ "anyhow", "async-trait", @@ -682,9 +684,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.1" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" [[package]] name = "bitvec" @@ -829,9 +831,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.16" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58e54881c004cec7895b0068a0a954cd5d62da01aef83fa35b1e594497bf5445" +checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" dependencies = [ "clap_builder", "clap_derive", @@ -839,9 +841,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.16" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59cb82d7f531603d2fd1f507441cdd35184fa81beff7bd489570de7f773460bb" +checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" dependencies = [ "anstream", "anstyle", @@ -1476,9 +1478,9 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "h2" -version = "0.3.23" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b553656127a00601c8ae5590fcfdc118e4083a7924b6cf4ffc1ea4b99dc429d7" +checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" dependencies = [ "bytes", "fnv", @@ -1543,9 +1545,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" [[package]] name = "html5ever" @@ -1864,12 +1866,12 @@ checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "lightningcss" -version = "1.0.0-alpha.51" +version = "1.0.0-alpha.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99d6ad516c08b24c246b339159dc2ee2144c012e8ebdf4db4bddefb8734b2b69" +checksum = "771a62dedf5ec563bbfea9760f6c6a6bc546e67355eba0cd7d00c0dc34b11d90" dependencies = [ "ahash 0.7.7", - "bitflags 2.4.1", + "bitflags 2.4.2", "const-str", "cssparser", "cssparser-color", @@ -2391,7 +2393,7 @@ version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05d74befe2d076330d9a58bf9ca2da424568724ab278adf15fb5718253133887" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "cssparser", "fxhash", "log", @@ -2895,14 +2897,14 @@ version = "11.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d86a7c4638d42c44551f4791a20e687dbb4c3de1f33c43dd71e355cd429def1" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", ] [[package]] name = "rayon" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" +checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" dependencies = [ "either", "rayon-core", @@ -2910,9 +2912,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.12.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ "crossbeam-deque", "crossbeam-utils", @@ -4125,9 +4127,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.14" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" diff --git a/Cargo.toml b/Cargo.toml index ad7cfd4..570719d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -84,7 +84,6 @@ streem = "0.2.0" [dependencies.background-jobs] version = "0.17.0" -git = "https://git.asonix.dog/asonix/background-jobs" default-features = false features = ["error-logging", "metrics", "tokio"] From 603fcc6e57b6f02ee7dcf6ca2b427b3eedc23a6b Mon Sep 17 00:00:00 2001 From: asonix Date: Thu, 18 Jan 2024 13:35:00 -0500 Subject: [PATCH 22/27] Bump version --- Cargo.lock | 2 +- Cargo.toml | 2 +- relay.nix | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2094787..f1aaa07 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -382,7 +382,7 @@ checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" [[package]] name = "ap-relay" -version = "0.3.106-beta.3" +version = "0.3.106" dependencies = [ "activitystreams", "activitystreams-ext", diff --git a/Cargo.toml b/Cargo.toml index 570719d..86e2d02 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "ap-relay" description = "A simple activitypub relay" -version = "0.3.106-beta.3" +version = "0.3.106" authors = ["asonix "] license = "AGPL-3.0" readme = "README.md" diff --git a/relay.nix b/relay.nix index f9b2e40..f37ab32 100644 --- a/relay.nix +++ b/relay.nix @@ -5,7 +5,7 @@ rustPlatform.buildRustPackage { pname = "relay"; - version = "0.3.106-beta.3"; + version = "0.3.106"; src = ./.; cargoLock.lockFile = ./Cargo.lock; From 78795148469181b82b65ded0c25b0c25d474b68a Mon Sep 17 00:00:00 2001 From: perillamint Date: Fri, 26 Jan 2024 17:32:57 +0900 Subject: [PATCH 23/27] [fix] Roll dice once per egress activity, not per sharedinbox --- src/jobs/deliver_many.rs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/jobs/deliver_many.rs b/src/jobs/deliver_many.rs index f7d6ff8..21d6763 100644 --- a/src/jobs/deliver_many.rs +++ b/src/jobs/deliver_many.rs @@ -5,7 +5,7 @@ use crate::{ }; use activitystreams::iri_string::types::IriString; use background_jobs::Job; -use rand::{rngs::ThreadRng, Rng}; +use rand::Rng; use crate::data::NodeConfig; @@ -39,9 +39,7 @@ impl DeliverMany { }) } - fn apply_filter(rng: &mut ThreadRng, authority: &str, config: &NodeConfig) -> bool { - let dice = rng.gen::(); - + fn apply_filter(dice: u8, authority: &str, config: &NodeConfig) -> bool { if config.enable_probability && config.probability < dice { return false; } @@ -56,10 +54,7 @@ impl DeliverMany { } #[tracing::instrument(name = "Deliver many", skip(state))] - async fn perform(self, state: JobState) -> Result<(), Error> { - let mut thread_rng = rand::thread_rng(); - - + async fn perform(self, dice: u8, state: JobState) -> Result<(), Error> { for inbox in self.to { if self.filterable { // All inbox should have... authority... but... @@ -74,7 +69,7 @@ impl DeliverMany { }; if let Some(cfg) = node_config.get(inbox_authority) { - if !Self::apply_filter(&mut thread_rng, &self.actor_authority, cfg) { + if !Self::apply_filter(dice, &self.actor_authority, cfg) { tracing::info!("Skipping egress to {} due to given criteria", inbox_authority); continue; } @@ -99,6 +94,9 @@ impl Job for DeliverMany { const QUEUE: &'static str = "deliver"; fn run(self, state: Self::State) -> Self::Future { - Box::pin(async move { self.perform(state).await.map_err(Into::into) }) + let mut thread_rng = rand::thread_rng(); + let dice = thread_rng.gen::(); + + Box::pin(async move { self.perform(dice, state).await.map_err(Into::into) }) } } From 973352b09abedbde93cea5db857a173d48b89a7c Mon Sep 17 00:00:00 2001 From: Jaehong Kang Date: Fri, 26 Jan 2024 16:59:17 +0900 Subject: [PATCH 24/27] Update Dockerfile Update alpine to 3.19 Remove openssl which is not used anymore Follow alpine semantic which is dynamic link instead of static link --- Dockerfile | 51 +++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 39 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index de1a0c0..7aa2317 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,37 @@ # syntax=docker/dockerfile:1.4 +FROM alpine:3.19 AS alpine + +RUN \ + --mount=type=cache,id=$TARGETPLATFORM-alpine,target=/var/cache/apk,sharing=locked \ + set -eux; \ + apk add -U libgcc; + +################################################################################ + +FROM alpine AS alpine-dev + +RUN \ + --mount=type=cache,id=$TARGETPLATFORM-alpine,target=/var/cache/apk,sharing=locked \ + set -eux; \ + apk add -U musl-dev; + +################################################################################ + FROM --platform=$BUILDPLATFORM rust:1 AS builder -ARG BUILDPLATFORM ARG TARGETPLATFORM RUN \ - --mount=type=cache,target=/var/cache,sharing=locked \ - --mount=type=cache,target=/var/lib/apt,sharing=locked \ - --mount=type=tmpfs,target=/var/log \ + --mount=type=cache,id=$BUILDPLATFORM-debian,target=/var/cache,sharing=locked \ + --mount=type=cache,id=$BUILDPLATFORM-debian,target=/var/lib/apt,sharing=locked \ set -eux; \ case "${TARGETPLATFORM}" in \ linux/i386) \ - rustArch='i686'; \ dpkgArch='i386'; \ ;; \ linux/amd64) \ - rustArch='x86_64'; \ dpkgArch='amd64'; \ ;; \ linux/arm64) \ - rustArch='aarch64'; \ dpkgArch='arm64'; \ ;; \ *) echo "unsupported architecture"; exit 1 ;; \ @@ -28,15 +41,25 @@ RUN \ apt-get install -y --no-install-recommends \ musl-dev:$dpkgArch \ musl-tools:$dpkgArch \ - ; \ - rustup target add "${rustArch}-unknown-linux-musl"; + ; WORKDIR /opt/aode-relay +RUN set -eux; \ + case "${TARGETPLATFORM}" in \ + linux/i386) rustArch='i686';; \ + linux/amd64) rustArch='x86_64';; \ + linux/arm64) rustArch='aarch64';; \ + *) echo "unsupported architecture"; exit 1 ;; \ + esac; \ + rustup target add "${rustArch}-unknown-linux-musl"; + ADD Cargo.lock Cargo.toml /opt/aode-relay/ RUN cargo fetch; ADD . /opt/aode-relay +COPY --link --from=alpine-dev / /opt/alpine/ + RUN set -eux; \ case "${TARGETPLATFORM}" in \ linux/i386) rustArch='i686';; \ @@ -46,13 +69,17 @@ RUN set -eux; \ esac; \ ln -s "target/${rustArch}-unknown-linux-musl/release/relay" "aode-relay"; \ # Workaround to use gnu-gcc instead of musl-gcc: https://github.com/rust-lang/rust/issues/95926 - RUSTFLAGS="-C target-cpu=generic -C linker=${rustArch}-linux-gnu-gcc" cargo build --frozen --release --target="${rustArch}-unknown-linux-musl"; + export RUSTFLAGS="-C target-cpu=generic -C linker=${rustArch}-linux-musl-gcc -C relocation-model=static -C target-feature=-crt-static -C link-self-contained=no -L /opt/alpine/lib -L /opt/alpine/usr/lib"; \ + cargo build --frozen --release --target="${rustArch}-unknown-linux-musl"; ################################################################################ -FROM alpine:3.18 +FROM alpine -RUN apk add --no-cache openssl ca-certificates curl tini +RUN \ + --mount=type=cache,id=$TARGETPLATFORM-alpine,target=/var/cache/apk,sharing=locked \ + set -eux; \ + apk add -U ca-certificates curl tini; COPY --link --from=builder /opt/aode-relay/aode-relay /usr/local/bin/aode-relay From 269ecaf5471034a996acec33ab272966261867cc Mon Sep 17 00:00:00 2001 From: Jaehong Kang Date: Fri, 26 Jan 2024 18:03:52 +0900 Subject: [PATCH 25/27] Remove workaround --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7aa2317..53b9b1f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -68,8 +68,7 @@ RUN set -eux; \ *) echo "unsupported architecture"; exit 1 ;; \ esac; \ ln -s "target/${rustArch}-unknown-linux-musl/release/relay" "aode-relay"; \ - # Workaround to use gnu-gcc instead of musl-gcc: https://github.com/rust-lang/rust/issues/95926 - export RUSTFLAGS="-C target-cpu=generic -C linker=${rustArch}-linux-musl-gcc -C relocation-model=static -C target-feature=-crt-static -C link-self-contained=no -L /opt/alpine/lib -L /opt/alpine/usr/lib"; \ + export RUSTFLAGS="-C target-cpu=generic -C linker=${rustArch}-linux-musl-gcc -C target-feature=-crt-static -C link-self-contained=no -L /opt/alpine/lib -L /opt/alpine/usr/lib"; \ cargo build --frozen --release --target="${rustArch}-unknown-linux-musl"; ################################################################################ From 8133d0c367be3fe89100650f598838483a0ec770 Mon Sep 17 00:00:00 2001 From: Jaehong Kang Date: Fri, 26 Jan 2024 18:04:15 +0900 Subject: [PATCH 26/27] Rename rustArch to arch --- Dockerfile | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 53b9b1f..a81aae2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,12 +47,12 @@ WORKDIR /opt/aode-relay RUN set -eux; \ case "${TARGETPLATFORM}" in \ - linux/i386) rustArch='i686';; \ - linux/amd64) rustArch='x86_64';; \ - linux/arm64) rustArch='aarch64';; \ + linux/i386) arch='i686';; \ + linux/amd64) arch='x86_64';; \ + linux/arm64) arch='aarch64';; \ *) echo "unsupported architecture"; exit 1 ;; \ esac; \ - rustup target add "${rustArch}-unknown-linux-musl"; + rustup target add "${arch}-unknown-linux-musl"; ADD Cargo.lock Cargo.toml /opt/aode-relay/ RUN cargo fetch; @@ -62,14 +62,14 @@ COPY --link --from=alpine-dev / /opt/alpine/ RUN set -eux; \ case "${TARGETPLATFORM}" in \ - linux/i386) rustArch='i686';; \ - linux/amd64) rustArch='x86_64';; \ - linux/arm64) rustArch='aarch64';; \ + linux/i386) arch='i686';; \ + linux/amd64) arch='x86_64';; \ + linux/arm64) arch='aarch64';; \ *) echo "unsupported architecture"; exit 1 ;; \ esac; \ - ln -s "target/${rustArch}-unknown-linux-musl/release/relay" "aode-relay"; \ - export RUSTFLAGS="-C target-cpu=generic -C linker=${rustArch}-linux-musl-gcc -C target-feature=-crt-static -C link-self-contained=no -L /opt/alpine/lib -L /opt/alpine/usr/lib"; \ - cargo build --frozen --release --target="${rustArch}-unknown-linux-musl"; + ln -s "target/${arch}-unknown-linux-musl/release/relay" "aode-relay"; \ + export RUSTFLAGS="-C target-cpu=generic -C linker=${arch}-linux-musl-gcc -C target-feature=-crt-static -C link-self-contained=no -L /opt/alpine/lib -L /opt/alpine/usr/lib"; \ + cargo build --frozen --release --target="${arch}-unknown-linux-musl"; ################################################################################ From aaf3795544e208cb1bd098c5ea6b97242c5573d9 Mon Sep 17 00:00:00 2001 From: Jaehong Kang Date: Fri, 26 Jan 2024 18:06:27 +0900 Subject: [PATCH 27/27] Adds missing ARGs --- Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index a81aae2..e09561e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ # syntax=docker/dockerfile:1.4 FROM alpine:3.19 AS alpine +ARG TARGETPLATFORM RUN \ --mount=type=cache,id=$TARGETPLATFORM-alpine,target=/var/cache/apk,sharing=locked \ @@ -9,6 +10,7 @@ RUN \ ################################################################################ FROM alpine AS alpine-dev +ARG TARGETPLATFORM RUN \ --mount=type=cache,id=$TARGETPLATFORM-alpine,target=/var/cache/apk,sharing=locked \ @@ -18,6 +20,7 @@ RUN \ ################################################################################ FROM --platform=$BUILDPLATFORM rust:1 AS builder +ARG BUILDPLATFORM ARG TARGETPLATFORM RUN \ @@ -74,6 +77,7 @@ RUN set -eux; \ ################################################################################ FROM alpine +ARG TARGETPLATFORM RUN \ --mount=type=cache,id=$TARGETPLATFORM-alpine,target=/var/cache/apk,sharing=locked \