diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f78aff7..96e2158 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,27 +13,22 @@ jobs: strategy: matrix: - os: [ubuntu-20.04] + os: [ubuntu-22.04] steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Cache build artifacts - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: target/** key: ${{ matrix.os }}-cargo - name: Install rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable + run: rustup update stable && rustup default stable - name: Build with cargo - uses: actions-rs/cargo@v1 - with: - command: build - args: --release + run: cargo build --verbose --release - name: Upload artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: nucleoid-backend path: target/release/nucleoid-backend diff --git a/Cargo.lock b/Cargo.lock index ebb7503..86c3a88 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,33 +1,21 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" -version = "0.22.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] [[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "ahash" -version = "0.8.11" +name = "adler2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "aho-corasick" @@ -38,6 +26,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + [[package]] name = "android-tzdata" version = "0.1.1" @@ -54,75 +48,57 @@ dependencies = [ ] [[package]] -name = "async-trait" -version = "0.1.80" +name = "arrayvec" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" dependencies = [ - "proc-macro2", - "quote", - "syn", + "serde", ] [[package]] -name = "async-tungstenite" -version = "0.17.2" +name = "async-trait" +version = "0.1.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1b71b31561643aa8e7df3effe284fa83ab1a840e52294c5f4bd7bfd8b2becbb" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ - "futures-io", - "futures-util", - "log", - "pin-project-lite", - "tokio", - "tokio-rustls 0.23.4", - "tungstenite 0.17.3", - "webpki-roots 0.22.6", + "proc-macro2", + "quote", + "syn 2.0.90", ] [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "backtrace" -version = "0.3.73" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", -] - -[[package]] -name = "barrage" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be5951c75bdabb58753d140dd5802f12ff3a483cb2e16fb5276e111b94b19e87" -dependencies = [ - "concurrent-queue", - "event-listener", - "spin 0.9.8", + "windows-targets 0.52.6", ] [[package]] name = "base64" -version = "0.13.1" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64" -version = "0.21.7" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "bitflags" @@ -132,9 +108,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "block-buffer" @@ -159,15 +135,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" - -[[package]] -name = "cache-padded" -version = "1.3.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "981520c98f422fcc584dc1a95c334e6953900b9106bc47a9839b81790009eb21" +checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" [[package]] name = "catty" @@ -175,14 +145,17 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcf0adb3cc1c06945672f8dcc827e42497ac6d0aff49f459ec918132b82a5cbc" dependencies = [ - "spin 0.9.8", + "spin", ] [[package]] name = "cc" -version = "1.0.100" +version = "1.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c891175c3fb232128f48de6590095e59198bbeb8620c310be349bfc3afd12c7b" +checksum = "c31a0499c1dc64f458ad13872de75c0eb7e3fdb0e67964610c914b034fc5956e" +dependencies = [ + "shlex", +] [[package]] name = "cfg-if" @@ -190,11 +163,17 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "chrono" -version = "0.4.38" +version = "0.4.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" dependencies = [ "android-tzdata", "iana-time-zone", @@ -202,7 +181,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -230,7 +209,7 @@ dependencies = [ [[package]] name = "clickhouse-rs" version = "1.1.0-alpha.1" -source = "git+https://github.com/suharev7/clickhouse-rs?branch=async-await#e47ba334bd1f28de20dd0c85b9af66fe029a6dea" +source = "git+https://github.com/suharev7/clickhouse-rs?branch=async-await#abfe517101eefe36bfdb7da248690659aa284ad3" dependencies = [ "byteorder", "cfg-if", @@ -249,7 +228,7 @@ dependencies = [ "lz4", "percent-encoding", "pin-project", - "thiserror", + "thiserror 1.0.69", "tokio", "url", "uuid", @@ -258,7 +237,7 @@ dependencies = [ [[package]] name = "clickhouse-rs-cityhash-sys" version = "0.1.2" -source = "git+https://github.com/suharev7/clickhouse-rs?branch=async-await#e47ba334bd1f28de20dd0c85b9af66fe029a6dea" +source = "git+https://github.com/suharev7/clickhouse-rs?branch=async-await#abfe517101eefe36bfdb7da248690659aa284ad3" dependencies = [ "cc", ] @@ -273,15 +252,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "concurrent-queue" -version = "1.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af4780a44ab5696ea9e28294517f1fffb421a83a25af521333c838635509db9c" -dependencies = [ - "cache-padded", -] - [[package]] name = "core-foundation" version = "0.9.4" @@ -294,15 +264,15 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" dependencies = [ "libc", ] @@ -331,18 +301,18 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.13" +version = "0.5.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" +checksum = "06ba6d68e24814cb8de6bb986db8222d3a027d15872cabc0d18817bc3c0e4471" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-deque" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" dependencies = [ "crossbeam-epoch", "crossbeam-utils", @@ -359,18 +329,18 @@ dependencies = [ [[package]] name = "crossbeam-queue" -version = "0.3.11" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" +checksum = "0f58bbc28f91df819d0aa2a2c00cd19754769c2fad90579b3592b1c9ba7a3115" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.20" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crypto-common" @@ -404,27 +374,27 @@ checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" [[package]] name = "deadpool" -version = "0.9.5" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "421fe0f90f2ab22016f32a9881be5134fdd71c65298917084b0c7477cbc3856e" +checksum = "6541a3916932fe57768d4be0b1ffb5ec7cbf74ca8c903fdfd5c0fe8aa958f0ed" dependencies = [ - "async-trait", "deadpool-runtime", "num_cpus", - "retain_mut", "tokio", ] [[package]] name = "deadpool-postgres" -version = "0.10.5" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836a24a9d49deefe610b8b60c767a7412e9a931d79a89415cd2d2d71630ca8d7" +checksum = "3d697d376cbfa018c23eb4caab1fd1883dd9c906a8c034e8d9a3cb06a7e0bef9" dependencies = [ + "async-trait", "deadpool", - "log", + "getrandom", "tokio", "tokio-postgres", + "tracing", ] [[package]] @@ -458,31 +428,29 @@ dependencies = [ ] [[package]] -name = "either" -version = "1.12.0" +name = "displaydoc" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] [[package]] -name = "encoding_rs" -version = "0.8.34" +name = "either" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] -name = "env_logger" -version = "0.10.2" +name = "encoding_rs" +version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" dependencies = [ - "humantime", - "is-terminal", - "log", - "regex", - "termcolor", + "cfg-if", ] [[package]] @@ -505,32 +473,26 @@ checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" [[package]] name = "flate2" -version = "1.0.30" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" dependencies = [ "crc32fast", "miniz_oxide", ] -[[package]] -name = "flume" -version = "0.10.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1657b4441c3403d9f7b3409e47575237dac27b1b5726df654a6ecbf92f0f7577" -dependencies = [ - "futures-core", - "futures-sink", - "pin-project", - "spin 0.9.8", -] - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0d2fde1f7b3d48b8395d5f2de76c18a528bd6a9cdde438df747bfcba3e05d6f" + [[package]] name = "form_urlencoded" version = "1.2.1" @@ -542,9 +504,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -557,9 +519,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -567,15 +529,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -584,44 +546,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.90", ] [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" - -[[package]] -name = "futures-timer" -version = "3.0.3" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -635,6 +591,15 @@ dependencies = [ "slab", ] +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + [[package]] name = "generic-array" version = "0.14.7" @@ -652,15 +617,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", + "js-sys", "libc", "wasi", + "wasm-bindgen", ] [[package]] name = "gimli" -version = "0.29.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "h2" @@ -683,18 +650,20 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash", -] +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" [[package]] name = "hashbrown" -version = "0.14.5" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] [[package]] name = "headers" @@ -759,9 +728,9 @@ dependencies = [ [[package]] name = "http" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" dependencies = [ "bytes", "fnv", @@ -779,11 +748,34 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http 1.2.0", +] + +[[package]] +name = "http-body-util" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +dependencies = [ + "bytes", + "futures-util", + "http 1.2.0", + "http-body 1.0.1", + "pin-project-lite", +] + [[package]] name = "httparse" -version = "1.9.4" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "httpdate" @@ -791,17 +783,11 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" -[[package]] -name = "humantime" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" - [[package]] name = "hyper" -version = "0.14.29" +version = "0.14.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f361cde2f109281a220d4307746cdfd5ee3f410da58a70377762396775634b33" +checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7" dependencies = [ "bytes", "futures-channel", @@ -809,7 +795,7 @@ dependencies = [ "futures-util", "h2", "http 0.2.12", - "http-body", + "http-body 0.4.6", "httparse", "httpdate", "itoa", @@ -821,6 +807,25 @@ dependencies = [ "want", ] +[[package]] +name = "hyper" +version = "1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "256fb8d4bd6413123cc9d91832d78325c48ff41677595be797d90f42969beae0" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http 1.2.0", + "http-body 1.0.1", + "httparse", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + [[package]] name = "hyper-rustls" version = "0.24.2" @@ -829,17 +834,54 @@ checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http 0.2.12", - "hyper", + "hyper 0.14.32", "rustls 0.21.12", "tokio", "tokio-rustls 0.24.1", ] +[[package]] +name = "hyper-rustls" +version = "0.27.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" +dependencies = [ + "futures-util", + "http 1.2.0", + "hyper 1.5.2", + "hyper-util", + "rustls 0.23.20", + "rustls-pki-types", + "tokio", + "tokio-rustls 0.26.1", + "tower-service", + "webpki-roots 0.26.7", +] + +[[package]] +name = "hyper-util" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http 1.2.0", + "http-body 1.0.1", + "hyper 1.5.2", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", +] + [[package]] name = "iana-time-zone" -version = "0.1.60" +version = "0.1.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -859,135 +901,268 @@ dependencies = [ ] [[package]] -name = "idna" -version = "0.5.0" +name = "icu_collections" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "displaydoc", + "yoke", + "zerofrom", + "zerovec", ] [[package]] -name = "indexmap" -version = "2.2.6" +name = "icu_locid" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" dependencies = [ - "equivalent", - "hashbrown 0.14.5", + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", ] [[package]] -name = "ipnet" -version = "2.9.0" +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" [[package]] -name = "is-terminal" -version = "0.4.12" +name = "icu_normalizer" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.52.0", + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", ] [[package]] -name = "itoa" -version = "1.0.11" +name = "icu_normalizer_data" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" [[package]] -name = "js-sys" -version = "0.3.69" +name = "icu_properties" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" dependencies = [ - "wasm-bindgen", + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", ] [[package]] -name = "lazy_static" +name = "icu_properties_data" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" [[package]] -name = "libc" -version = "0.2.155" +name = "icu_provider" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] [[package]] -name = "lock_api" -version = "0.4.12" +name = "icu_provider_macros" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ - "autocfg", - "scopeguard", + "proc-macro2", + "quote", + "syn 2.0.90", ] [[package]] -name = "log" -version = "0.4.21" +name = "idna" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ - "serde", + "idna_adapter", + "smallvec", + "utf8_iter", ] [[package]] -name = "lru" -version = "0.9.0" +name = "idna_adapter" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71e7d46de488603ffdd5f30afbc64fbba2378214a2c3a2fb83abf3d33126df17" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" dependencies = [ - "hashbrown 0.13.2", + "icu_normalizer", + "icu_properties", ] [[package]] -name = "lz4" -version = "1.25.0" +name = "indexmap" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6eab492fe7f8651add23237ea56dbf11b3c4ff762ab83d40a47f11433421f91" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ - "libc", - "lz4-sys", + "equivalent", + "hashbrown 0.15.2", ] [[package]] -name = "lz4-sys" -version = "1.9.5" +name = "ipnet" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9764018d143cc854c9f17f0b907de70f14393b1f502da6375dce70f00514eb3" -dependencies = [ - "cc", - "libc", -] +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] -name = "match_cfg" -version = "0.1.0" +name = "itoa" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] -name = "md-5" -version = "0.10.6" +name = "js-sys" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" dependencies = [ - "cfg-if", - "digest", + "once_cell", + "wasm-bindgen", ] [[package]] -name = "memchr" +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.169" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" + +[[package]] +name = "litemap" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +dependencies = [ + "serde", +] + +[[package]] +name = "lru" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" +dependencies = [ + "hashbrown 0.15.2", +] + +[[package]] +name = "lz4" +version = "1.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d1febb2b4a79ddd1980eede06a8f7902197960aa0383ffcfdd62fe723036725" +dependencies = [ + "lz4-sys", +] + +[[package]] +name = "lz4-sys" +version = "1.11.1+lz4-1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bd8c0d6c6ed0cd30b3652886bb8711dc4bb01d637a68105a3d5158039b418e6" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "match_cfg" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "md-5" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +dependencies = [ + "cfg-if", + "digest", +] + +[[package]] +name = "memchr" version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" @@ -1000,9 +1175,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "mime_guess" -version = "2.0.4" +version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" dependencies = [ "mime", "unicase", @@ -1010,22 +1185,22 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.7.4" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394" dependencies = [ - "adler", + "adler2", ] [[package]] name = "mio" -version = "0.8.11" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ "libc", "wasi", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1042,10 +1217,20 @@ dependencies = [ "log", "memchr", "mime", - "spin 0.9.8", + "spin", "version_check", ] +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + [[package]] name = "nucleoid-backend" version = "0.1.0" @@ -1057,21 +1242,21 @@ dependencies = [ "chrono-tz", "clickhouse-rs", "deadpool-postgres", - "env_logger", "futures", "lazy_static", - "log", "lru", "nucleoid-leaderboards", "regex", - "reqwest", + "reqwest 0.12.9", "serde", "serde_json", "serenity", - "thiserror", + "thiserror 2.0.8", "tokio", "tokio-postgres", "tokio-util", + "tracing", + "tracing-subscriber", "uuid", "walkdir", "warp", @@ -1081,7 +1266,7 @@ dependencies = [ [[package]] name = "nucleoid-leaderboards" version = "0.1.0" -source = "git+https://github.com/NucleoidMC/nucleoid-leaderboards.git#f32dd610ede1f29dae9a24de9d8d3dc77352acb6" +source = "git+https://github.com/NucleoidMC/nucleoid-leaderboards.git#a150451b8318377eb368511cf3dff72af7cd924e" dependencies = [ "serde", ] @@ -1113,27 +1298,24 @@ dependencies = [ [[package]] name = "object" -version = "0.36.0" +version = "0.36.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" +checksum = "08dde84f120894086dbb40c7a0257f76fdc72b6f52cdb56c2b5121b2f81b0c83" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] -name = "ordered-float" -version = "2.10.1" +name = "overload" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f19d67e5a2795c94e73e0bb1cc1a7edeb2e28efd39e2e1c9b7a40c1108b11c" -dependencies = [ - "num-traits", -] +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "parking_lot" @@ -1153,9 +1335,9 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.2", + "redox_syscall", "smallvec", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -1213,29 +1395,29 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.5" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.5" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.90", ] [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" @@ -1243,19 +1425,13 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pollster" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5da3b0203fd7ee5720aa0b5e790b591aa5d3f41c3ed2c34a3a393382198af2f7" - [[package]] name = "postgres-protocol" -version = "0.6.6" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49b6c5ef183cd3ab4ba005f1ca64c21e8bd97ce4699cfea9e8d9a2c4958ca520" +checksum = "acda0ebdebc28befa84bee35e651e4c5f09073d668c7aed4cf7e23c3cda84b23" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "byteorder", "bytes", "fallible-iterator", @@ -1269,9 +1445,9 @@ dependencies = [ [[package]] name = "postgres-types" -version = "0.2.6" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d2234cdee9408b523530a9b6d2d6b373d1db34f6a8e51dc03ded1828d7fb67c" +checksum = "f66ea23a2d0e5734297357705193335e0a957696f34bed2f2faefacb2fec336f" dependencies = [ "bytes", "fallible-iterator", @@ -1287,24 +1463,79 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62e96808277ec6f97351a2380e6c25114bc9e67037775464979f3037c92d05ef" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls 0.23.20", + "socket2", + "thiserror 2.0.8", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2fe5ef3495d7d2e377ff17b1a8ce2ee2ec2a18cde8b6ad6619d65d0701c135d" +dependencies = [ + "bytes", + "getrandom", + "rand", + "ring", + "rustc-hash", + "rustls 0.23.20", + "rustls-pki-types", + "slab", + "thiserror 2.0.8", + "tinyvec", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-udp" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c40286217b4ba3a71d644d752e6a0b71f13f1b6a2c5311acfcbe0c2418ed904" +dependencies = [ + "cfg_aliases", + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.59.0", +] + [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -1341,50 +1572,56 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.4.1" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", ] [[package]] -name = "redox_syscall" -version = "0.5.2" +name = "regex" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ - "bitflags 2.5.0", + "aho-corasick", + "memchr", + "regex-automata 0.4.9", + "regex-syntax 0.8.5", ] [[package]] -name = "regex" -version = "1.10.5" +name = "regex-automata" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", + "regex-syntax 0.6.29", ] [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-syntax 0.8.5", ] [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "reqwest" @@ -1399,9 +1636,9 @@ dependencies = [ "futures-util", "h2", "http 0.2.12", - "http-body", - "hyper", - "hyper-rustls", + "http-body 0.4.6", + "hyper 0.14.32", + "hyper-rustls 0.24.2", "ipnet", "js-sys", "log", @@ -1411,11 +1648,11 @@ dependencies = [ "percent-encoding", "pin-project-lite", "rustls 0.21.12", - "rustls-pemfile", + "rustls-pemfile 1.0.4", "serde", "serde_json", "serde_urlencoded", - "sync_wrapper", + "sync_wrapper 0.1.2", "system-configuration", "tokio", "tokio-rustls 0.24.1", @@ -1431,24 +1668,45 @@ dependencies = [ ] [[package]] -name = "retain_mut" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4389f1d5789befaf6029ebd9f7dac4af7f7e3d61b69d4f30e2ac02b57e7712b0" - -[[package]] -name = "ring" -version = "0.16.20" +name = "reqwest" +version = "0.12.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +checksum = "a77c62af46e79de0a562e1a9849205ffcb7fc1238876e9bd743357570e04046f" dependencies = [ - "cc", - "libc", + "base64 0.22.1", + "bytes", + "futures-core", + "futures-util", + "http 1.2.0", + "http-body 1.0.1", + "http-body-util", + "hyper 1.5.2", + "hyper-rustls 0.27.5", + "hyper-util", + "ipnet", + "js-sys", + "log", + "mime", "once_cell", - "spin 0.5.2", - "untrusted 0.7.1", + "percent-encoding", + "pin-project-lite", + "quinn", + "rustls 0.23.20", + "rustls-pemfile 2.2.0", + "rustls-pki-types", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper 1.0.2", + "tokio", + "tokio-rustls 0.26.1", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", "web-sys", - "winapi", + "webpki-roots 0.26.7", + "windows-registry", ] [[package]] @@ -1461,8 +1719,8 @@ dependencies = [ "cfg-if", "getrandom", "libc", - "spin 0.9.8", - "untrusted 0.9.0", + "spin", + "untrusted", "windows-sys 0.52.0", ] @@ -1472,28 +1730,50 @@ version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +[[package]] +name = "rustc-hash" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" + [[package]] name = "rustls" -version = "0.20.9" +version = "0.21.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", - "ring 0.16.20", + "ring", + "rustls-webpki 0.101.7", "sct", - "webpki", ] [[package]] name = "rustls" -version = "0.21.12" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" +checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" dependencies = [ "log", - "ring 0.17.8", - "rustls-webpki", - "sct", + "ring", + "rustls-pki-types", + "rustls-webpki 0.102.8", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls" +version = "0.23.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5065c3f250cbd332cd894be57c40fa52387247659b14a2d6041d121547903b1b" +dependencies = [ + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki 0.102.8", + "subtle", + "zeroize", ] [[package]] @@ -1505,14 +1785,43 @@ dependencies = [ "base64 0.21.7", ] +[[package]] +name = "rustls-pemfile" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2bf47e6ff922db3825eb750c4e2ff784c6ff8fb9e13046ef6a1d1c5401b0b37" +dependencies = [ + "web-time", +] + [[package]] name = "rustls-webpki" version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring 0.17.8", - "untrusted 0.9.0", + "ring", + "untrusted", +] + +[[package]] +name = "rustls-webpki" +version = "0.102.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", ] [[package]] @@ -1548,47 +1857,57 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.17.8", - "untrusted 0.9.0", + "ring", + "untrusted", +] + +[[package]] +name = "secrecy" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" +dependencies = [ + "serde", + "zeroize", ] [[package]] name = "serde" -version = "1.0.203" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" +checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" dependencies = [ "serde_derive", ] [[package]] -name = "serde-value" -version = "0.7.0" +name = "serde_cow" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c" +checksum = "1e7bbbec7196bfde255ab54b65e34087c0849629280028238e67ee25d6a4b7da" dependencies = [ - "ordered-float", "serde", ] [[package]] name = "serde_derive" -version = "1.0.203" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" +checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.90", ] [[package]] name = "serde_json" -version = "1.0.117" +version = "1.0.133" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] @@ -1607,45 +1926,35 @@ dependencies = [ [[package]] name = "serenity" -version = "0.11.7" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a7a89cef23483fc9d4caf2df41e6d3928e18aada84c56abd237439d929622c6" +checksum = "3d72ec4323681bf9a3cabe40fd080abc2435859b502a1b5aa9bf693f125bfa76" dependencies = [ + "arrayvec", "async-trait", - "async-tungstenite", - "base64 0.21.7", - "bitflags 1.3.2", + "base64 0.22.1", + "bitflags 2.6.0", "bytes", - "cfg-if", "dashmap", "flate2", "futures", - "mime", + "fxhash", "mime_guess", "parking_lot", "percent-encoding", - "reqwest", + "reqwest 0.11.27", + "secrecy", "serde", - "serde-value", + "serde_cow", "serde_json", "time", "tokio", + "tokio-tungstenite", "tracing", "typemap_rev", "url", ] -[[package]] -name = "sha-1" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5058ada175748e33390e40e872bd0fe59a19f265d0158daa551c5a88a76009c" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - [[package]] name = "sha1" version = "0.10.6" @@ -1668,6 +1977,21 @@ dependencies = [ "digest", ] +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signal-hook-registry" version = "1.4.2" @@ -1700,9 +2024,9 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" dependencies = [ "libc", "windows-sys 0.52.0", @@ -1710,18 +2034,15 @@ dependencies = [ [[package]] name = "spin" -version = "0.5.2" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" [[package]] -name = "spin" -version = "0.9.8" +name = "stable_deref_trait" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -dependencies = [ - "lock_api", -] +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "stringprep" @@ -1742,9 +2063,20 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" -version = "2.0.68" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" dependencies = [ "proc-macro2", "quote", @@ -1757,6 +2089,26 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + [[package]] name = "system-configuration" version = "0.5.1" @@ -1779,39 +2131,60 @@ dependencies = [ ] [[package]] -name = "termcolor" -version = "1.4.1" +name = "thiserror" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "winapi-util", + "thiserror-impl 1.0.69", ] [[package]] name = "thiserror" -version = "1.0.61" +version = "2.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +checksum = "08f5383f3e0071702bf93ab5ee99b52d26936be9dedd9413067cbdcddcb6141a" dependencies = [ - "thiserror-impl", + "thiserror-impl 2.0.8", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", ] [[package]] name = "thiserror-impl" -version = "1.0.61" +version = "2.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +checksum = "f2f357fcec90b3caef6623a099691be676d033b40a058ac95d2a6ade6fa0c943" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.90", +] + +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", ] [[package]] name = "time" -version = "0.3.36" +version = "0.3.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" dependencies = [ "deranged", "itoa", @@ -1830,19 +2203,29 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" dependencies = [ "num-conv", "time-core", ] +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "022db8904dfa342efe721985167e9fcd16c29b226db4397ed752a761cfce81e8" dependencies = [ "tinyvec_macros", ] @@ -1855,39 +2238,38 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.38.0" +version = "1.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" +checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" dependencies = [ "backtrace", "bytes", "libc", "mio", - "num_cpus", "parking_lot", "pin-project-lite", "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "tokio-macros" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.90", ] [[package]] name = "tokio-postgres" -version = "0.7.10" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d340244b32d920260ae7448cb72b6e238bddc3d4f7603394e7dd46ed8e48f5b8" +checksum = "3b5d3742945bc7d7f210693b0c58ae542c6fd47b17adbbda0885f3dcb34a6bdb" dependencies = [ "async-trait", "byteorder", @@ -1911,22 +2293,32 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.23.4" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.20.9", + "rustls 0.21.12", "tokio", - "webpki", ] [[package]] name = "tokio-rustls" -version = "0.24.1" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" dependencies = [ - "rustls 0.21.12", + "rustls 0.22.4", + "rustls-pki-types", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" +dependencies = [ + "rustls 0.23.20", "tokio", ] @@ -1938,15 +2330,19 @@ checksum = "c83b561d025642014097b66e6c1bb422783339e0909e4429cde4749d1990bc38" dependencies = [ "futures-util", "log", + "rustls 0.22.4", + "rustls-pki-types", "tokio", - "tungstenite 0.21.0", + "tokio-rustls 0.25.0", + "tungstenite", + "webpki-roots 0.26.7", ] [[package]] name = "tokio-util" -version = "0.7.11" +version = "0.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" dependencies = [ "bytes", "futures-core", @@ -1957,15 +2353,15 @@ dependencies = [ [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "log", "pin-project-lite", @@ -1975,51 +2371,60 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.90", ] [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" dependencies = [ "once_cell", + "valuable", ] [[package]] -name = "try-lock" -version = "0.2.5" +name = "tracing-log" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] [[package]] -name = "tungstenite" -version = "0.17.3" +name = "tracing-subscriber" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e27992fd6a8c29ee7eef28fc78349aa244134e10ad447ce3b9f0ac0ed0fa4ce0" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" dependencies = [ - "base64 0.13.1", - "byteorder", - "bytes", - "http 0.2.12", - "httparse", - "log", - "rand", - "rustls 0.20.9", - "sha-1", - "thiserror", - "url", - "utf-8", - "webpki", + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", ] +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + [[package]] name = "tungstenite" version = "0.21.0" @@ -2029,21 +2434,23 @@ dependencies = [ "byteorder", "bytes", "data-encoding", - "http 1.1.0", + "http 1.2.0", "httparse", "log", "rand", + "rustls 0.22.4", + "rustls-pki-types", "sha1", - "thiserror", + "thiserror 1.0.69", "url", "utf-8", ] [[package]] name = "typemap_rev" -version = "0.1.5" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed5b74f0a24b5454580a79abb6994393b09adf0ab8070f15827cb666255de155" +checksum = "74b08b0c1257381af16a5c3605254d529d3e7e109f3c62befc5d168968192998" [[package]] name = "typenum" @@ -2053,45 +2460,36 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicase" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check", -] +checksum = "7e51b68083f157f853b6379db119d1c1be0e6e4dec98101079dec41f6f5cf6df" [[package]] name = "unicode-bidi" -version = "0.3.15" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unicode-normalization" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" dependencies = [ "tinyvec", ] [[package]] name = "unicode-properties" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4259d9d4425d9f0661581b804cb85fe66a4c631cadd8f490d1c13a35d5d9291" - -[[package]] -name = "untrusted" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0" [[package]] name = "untrusted" @@ -2101,9 +2499,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.2" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", "idna", @@ -2117,20 +2515,38 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "uuid" -version = "1.9.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ea73390fe27785838dcbf75b91b1d84799e28f1ce71e6f372a5dc2200c80de5" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" dependencies = [ "serde", ] +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "walkdir" @@ -2162,7 +2578,7 @@ dependencies = [ "futures-util", "headers", "http 0.2.12", - "hyper", + "hyper 0.14.32", "log", "mime", "mime_guess", @@ -2194,46 +2610,47 @@ checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" dependencies = [ "bumpalo", "log", - "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.90", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.42" +version = "0.4.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +checksum = "38176d9b44ea84e9184eff0bc34cc167ed044f816accfe5922e54d84cf48eca2" dependencies = [ "cfg-if", "js-sys", + "once_cell", "wasm-bindgen", "web-sys", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2241,28 +2658,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.90", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" [[package]] name = "wasm-streams" -version = "0.4.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b65dc4c90b63b118468cf747d8bf3566c1913ef60be765b5730ead9e0a3ba129" +checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" dependencies = [ "futures-util", "js-sys", @@ -2273,46 +2690,46 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "04dd7223427d52553d3702c004d3b2fe07c148165faa56313cb00211e31c12bc" dependencies = [ "js-sys", "wasm-bindgen", ] [[package]] -name = "webpki" -version = "0.22.4" +name = "web-time" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" dependencies = [ - "ring 0.17.8", - "untrusted 0.9.0", + "js-sys", + "wasm-bindgen", ] [[package]] name = "webpki-roots" -version = "0.22.6" +version = "0.25.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" -dependencies = [ - "webpki", -] +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "webpki-roots" -version = "0.25.4" +version = "0.26.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" +checksum = "5d642ff16b7e79272ae451b7322067cdc17cadf68c23264be9d94a32319efe7e" +dependencies = [ + "rustls-pki-types", +] [[package]] name = "whoami" -version = "1.5.1" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44ab49fad634e88f55bf8f9bb3abd2f27d7204172a112c7c9987e01c1c94ea9" +checksum = "372d5b87f58ec45c384ba03563b03544dc5fadc3983e434b286913f5b4a9bb6d" dependencies = [ - "redox_syscall 0.4.1", + "redox_syscall", "wasite", "web-sys", ] @@ -2335,11 +2752,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -2354,7 +2771,37 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-registry" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +dependencies = [ + "windows-result", + "windows-strings", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result", + "windows-targets 0.52.6", ] [[package]] @@ -2372,7 +2819,16 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] @@ -2392,18 +2848,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -2414,9 +2870,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -2426,9 +2882,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -2438,15 +2894,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -2456,9 +2912,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -2468,9 +2924,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -2480,9 +2936,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -2492,9 +2948,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winreg" @@ -2506,39 +2962,137 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "xtra" -version = "0.5.2" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bca0a1b28e7cf635b4e961c7330416bf842a89bca42f5c707ab02a065e1ee60f" +checksum = "e1fd2fa83096d6c2e5eae3dcd265d16bb084abbe1391c38baec036a6cc1b7c7c" dependencies = [ - "async-trait", - "barrage", "catty", - "flume", + "event-listener", "futures-core", "futures-sink", - "futures-timer", "futures-util", - "pollster", + "pin-project-lite", + "spin", + "tokio", + "tracing", + "xtra-macros", +] + +[[package]] +name = "xtra-macros" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dfd68acdfa4e363b4dad688a87d5ed462cfb9498398c66520c7dab507dbc591" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", + "synstructure", ] [[package]] name = "zerocopy" -version = "0.7.34" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ + "byteorder", "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.34" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + +[[package]] +name = "zerofrom" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.90", ] diff --git a/Cargo.toml b/Cargo.toml index 52c8dfa..14de86b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,13 +14,14 @@ path = "src/main.rs" tokio = { version = "1", features = ["full"] } tokio-util = { version = "0.7", features = ["codec"] } warp = "0.3" -reqwest = { version = "0.11", features = ["rustls-tls", "json"], default-features = false } -lru = "0.9" +reqwest = { version = "0.12", features = ["rustls-tls", "json"], default-features = false } +lru = "0.12" futures = "0.3" -deadpool-postgres = "0.10" +deadpool-postgres = "0.14" tokio-postgres = { version = "0.7", features = ["with-uuid-1"] } chrono = { version = "0.4", features = ["serde"] } +# Pinned to 0.8 because of clickhouse-rs chrono-tz = "0.8" byteorder = "1" @@ -33,18 +34,17 @@ uuid = { version = "1", features = ["serde"] } regex = "1.7" lazy_static = "1.4" # todo: replace with once_cell/the stdlib implementation -serenity = { version = "0.11", default-features = false, features = ["builder", "cache", "client", "gateway", "model", "http", "rustls_backend"] } +serenity = { version = "0.12", default-features = false, features = ["builder", "cache", "client", "gateway", "model", "http", "rustls_backend"] } async-trait = "0.1" -xtra = "0.5.2" +xtra = { version = "0.6", features = ["instrumentation", "macros", "sink", "tokio"] } -thiserror = "1" - -log = "0.4" # todo: replace with tracing -env_logger = "0.10" +thiserror = "2" walkdir = "2" nucleoid-leaderboards = { git = "https://github.com/NucleoidMC/nucleoid-leaderboards.git" } +tracing-subscriber = { version = "0.3.19", features = ["env-filter"] } +tracing = "0.1.41" # The latest release on crates.io doesn't have support for serialising DateTime [dependencies.clickhouse-rs] diff --git a/flake.lock b/flake.lock index 428a87b..6d2efd2 100644 --- a/flake.lock +++ b/flake.lock @@ -1,17 +1,12 @@ { "nodes": { "crane": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, "locked": { - "lastModified": 1719249093, - "narHash": "sha256-0q1haa3sw6GbmJ+WhogMnducZGjEaCa/iR6hF2vq80I=", + "lastModified": 1734541973, + "narHash": "sha256-1wIgLmhvtfxbJVnhFHUYhPqL3gpLn5JhiS4maaD9RRk=", "owner": "ipetkov", "repo": "crane", - "rev": "9791c77eb7e98b8d8ac5b0305d47282f994411ca", + "rev": "fdd502f921936105869eba53db6593fc2a424c16", "type": "github" }, "original": { @@ -25,11 +20,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "owner": "numtide", "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "type": "github" }, "original": { @@ -40,11 +35,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1719082008, - "narHash": "sha256-jHJSUH619zBQ6WdC21fFAlDxHErKVDJ5fpN0Hgx4sjs=", + "lastModified": 1734435836, + "narHash": "sha256-kMBQ5PRiFLagltK0sH+08aiNt3zGERC2297iB6vrvlU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9693852a2070b398ee123a329e68f0dab5526681", + "rev": "4989a246d7a390a859852baddb1013f825435cee", "type": "github" }, "original": { @@ -56,11 +51,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1718428119, - "narHash": "sha256-WdWDpNaq6u1IPtxtYHHWpl5BmabtpmLnMAx0RdJ/vo8=", + "lastModified": 1728538411, + "narHash": "sha256-f0SBJz1eZ2yOuKUr5CA9BHULGXVSn6miBuUWdTyhUhU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e6cea36f83499eb4e9cd184c8a8e823296b50ad5", + "rev": "b69de56fac8c2b6f8fd27f2eca01dcda8e0a4221", "type": "github" }, "original": { @@ -83,11 +78,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1719195554, - "narHash": "sha256-bFXHMjpYlEERexzXa1gLGJO/1l8dxaAtSNE56YALuTg=", + "lastModified": 1734575524, + "narHash": "sha256-BxQ/4JuHEi0zRjF0P8B5xnbXOLulgsK2gfwVRXGZ4a4=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "577ee84c69ba89894ac622d71a678a14d746b2f7", + "rev": "573c674a3ad06e8a525263185ebef336a411d1d5", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 08fb0cf..f64cf2a 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,6 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; crane.url = "github:ipetkov/crane"; - crane.inputs.nixpkgs.follows = "nixpkgs"; rust-overlay.url = "github:oxalica/rust-overlay"; flake-utils.url = "github:numtide/flake-utils"; }; diff --git a/src/controller.rs b/src/controller.rs index 4e6df70..744c5ec 100644 --- a/src/controller.rs +++ b/src/controller.rs @@ -1,7 +1,6 @@ use std::collections::HashMap; use std::time::SystemTime; -use async_trait::async_trait; use xtra::prelude::*; use crate::database::{self, DatabaseClient}; @@ -12,6 +11,7 @@ use crate::statistics::database::{StatisticDatabaseController, UploadStatsBundle use crate::Config; // TODO: use numerical channel ids internally? +#[derive(Actor)] pub struct Controller { config: Config, discord: Option>, @@ -34,8 +34,6 @@ impl Controller { } } -impl Actor for Controller {} - pub struct RegisterIntegrationsClient { pub channel: String, pub game_version: String, @@ -43,73 +41,37 @@ pub struct RegisterIntegrationsClient { pub client: Address, } -impl Message for RegisterIntegrationsClient { - type Result = (); -} - pub struct UnregisterIntegrationsClient { pub channel: String, } -impl Message for UnregisterIntegrationsClient { - type Result = (); -} - pub struct RegisterDiscordClient { pub client: Address, } -impl Message for RegisterDiscordClient { - type Result = (); -} - pub struct UnregisterDiscordClient; -impl Message for UnregisterDiscordClient { - type Result = (); -} - pub struct RegisterDatabaseClient { pub client: Address, } -impl Message for RegisterDatabaseClient { - type Result = (); -} - pub struct RegisterStatisticsDatabaseController { pub controller: Address, } -impl Message for RegisterStatisticsDatabaseController { - type Result = (); -} - pub struct GetStatisticsDatabaseController; -impl Message for GetStatisticsDatabaseController { - type Result = Option>; -} - pub struct IncomingChat { pub channel: String, pub sender: Player, pub content: String, } -impl Message for IncomingChat { - type Result = (); -} - pub struct OutgoingChat { pub channel: String, pub chat: ChatMessage, } -impl Message for OutgoingChat { - type Result = (); -} - pub struct OutgoingCommand { pub channel: String, pub sender: String, @@ -118,10 +80,6 @@ pub struct OutgoingCommand { pub silent: bool, } -impl Message for OutgoingCommand { - type Result = bool; -} - pub struct OutgoingServerChange { // This should always be sent to a proxy, never a regular server. pub channel: String, @@ -129,118 +87,89 @@ pub struct OutgoingServerChange { pub target_server: String, } -impl Message for OutgoingServerChange { - type Result = (); -} - pub struct StatusUpdate { pub channel: String, pub games: Option>, pub players: Option>, } -impl Message for StatusUpdate { - type Result = (); -} - pub struct PerformanceUpdate { pub channel: String, pub performance: ServerPerformance, } -impl Message for PerformanceUpdate { - type Result = (); -} - pub struct ServerLifecycleStart { pub channel: String, pub server_type: ServerType, } -impl Message for ServerLifecycleStart { - type Result = (); -} - pub struct ServerLifecycleStop { pub channel: String, pub crash: bool, pub server_type: ServerType, } -impl Message for ServerLifecycleStop { - type Result = (); -} - pub struct ServerSystemMessage { pub channel: String, pub content: String, } -impl Message for ServerSystemMessage { - type Result = (); -} - pub struct GetStatus(pub String); -impl Message for GetStatus { - type Result = Option; -} - pub struct BackendError { pub title: String, pub description: String, pub fields: Option>, } -impl Message for BackendError { - type Result = (); -} - -#[async_trait] impl Handler for Controller { + type Return = (); + async fn handle(&mut self, message: RegisterIntegrationsClient, _ctx: &mut Context) { self.integration_clients .insert(message.channel.clone(), message.client); - let status = self - .status_by_channel - .entry(message.channel) - .or_insert_with(ServerStatus::default); + let status = self.status_by_channel.entry(message.channel).or_default(); status.game_version = message.game_version; status.server_ip = message.server_ip; } } -#[async_trait] impl Handler for Controller { + type Return = (); + async fn handle(&mut self, message: UnregisterIntegrationsClient, _ctx: &mut Context) { self.integration_clients.remove(&message.channel); } } -#[async_trait] impl Handler for Controller { + type Return = (); + async fn handle(&mut self, message: RegisterDiscordClient, _ctx: &mut Context) { self.discord = Some(message.client); } } -#[async_trait] impl Handler for Controller { + type Return = (); + async fn handle(&mut self, _: UnregisterDiscordClient, _ctx: &mut Context) { self.discord.take(); } } -#[async_trait] impl Handler for Controller { + type Return = (); + async fn handle(&mut self, message: RegisterDatabaseClient, _ctx: &mut Context) { self.database = Some(message.client); } } -#[async_trait] impl Handler for Controller { + type Return = (); + async fn handle( &mut self, message: RegisterStatisticsDatabaseController, @@ -250,19 +179,21 @@ impl Handler for Controller { } } -#[async_trait] impl Handler for Controller { + type Return = Option>; + async fn handle( &mut self, _message: GetStatisticsDatabaseController, _ctx: &mut Context, - ) -> ::Result { + ) -> Self::Return { self.statistics.clone() } } -#[async_trait] impl Handler for Controller { + type Return = (); + async fn handle(&mut self, message: IncomingChat, _ctx: &mut Context) { println!( "[{}] <{}> {}", @@ -271,7 +202,7 @@ impl Handler for Controller { if let Some(discord) = &self.discord { let _ = discord - .do_send_async(discord::SendChat { + .send(discord::SendChat { channel: message.channel, sender: message.sender, content: message.content, @@ -281,8 +212,9 @@ impl Handler for Controller { } } -#[async_trait] impl Handler for Controller { + type Return = (); + async fn handle(&mut self, message: OutgoingChat, _ctx: &mut Context) { println!( "[{}] <@{}> {}", @@ -291,19 +223,16 @@ impl Handler for Controller { if let Some(integrations) = self.integration_clients.get(&message.channel) { let _ = integrations - .do_send_async(integrations::OutgoingMessage::Chat(message.chat)) + .send(integrations::OutgoingMessage::Chat(message.chat)) .await; } } } -#[async_trait] impl Handler for Controller { - async fn handle( - &mut self, - message: OutgoingCommand, - _ctx: &mut Context, - ) -> ::Result { + type Return = bool; + + async fn handle(&mut self, message: OutgoingCommand, _ctx: &mut Context) -> Self::Return { println!( "[{}] <@{}> /{}", message.channel, message.sender, message.command @@ -311,7 +240,7 @@ impl Handler for Controller { if let Some(integrations) = self.integration_clients.get(&message.channel) { let _ = integrations - .do_send_async(integrations::OutgoingMessage::Command { + .send(integrations::OutgoingMessage::Command { command: message.command, sender: message.sender, roles: message.roles, @@ -325,20 +254,21 @@ impl Handler for Controller { } } -#[async_trait] impl Handler for Controller { + type Return = (); + async fn handle( &mut self, message: OutgoingServerChange, _ctx: &mut Context, - ) -> ::Result { + ) -> Self::Return { println!( "[{}] {} -> {}", message.channel, message.player, message.target_server ); if let Some(integrations) = self.integration_clients.get(&message.channel) { let _ = integrations - .do_send_async(integrations::OutgoingMessage::SendToServer { + .send(integrations::OutgoingMessage::SendToServer { player: message.player, target_server: message.target_server, }) @@ -347,13 +277,14 @@ impl Handler for Controller { } } -#[async_trait] impl Handler for Controller { + type Return = (); + async fn handle(&mut self, message: StatusUpdate, _ctx: &mut Context) { let status = self .status_by_channel .entry(message.channel.clone()) - .or_insert_with(ServerStatus::default); + .or_default(); if let Some(games) = message.games { status.games = games; @@ -372,7 +303,7 @@ impl Handler for Controller { if let Some(discord) = &self.discord { let _ = discord - .do_send_async(discord::UpdateRelayStatus { + .send(discord::UpdateRelayStatus { channel: message.channel.clone(), game_version: status.game_version.clone(), server_ip: status.server_ip.clone(), @@ -383,7 +314,7 @@ impl Handler for Controller { if let Some(database) = &self.database { let _ = database - .do_send_async(database::WriteStatus { + .send(database::WriteStatus { channel: message.channel.clone(), time: SystemTime::now(), status: status.clone(), @@ -393,12 +324,13 @@ impl Handler for Controller { } } -#[async_trait] impl Handler for Controller { + type Return = (); + async fn handle(&mut self, message: PerformanceUpdate, _ctx: &mut Context) { if let Some(database) = &self.database { let _ = database - .do_send_async(database::WritePerformance { + .send(database::WritePerformance { channel: message.channel, time: SystemTime::now(), performance: message.performance, @@ -408,14 +340,15 @@ impl Handler for Controller { } } -#[async_trait] impl Handler for Controller { + type Return = (); + async fn handle(&mut self, message: ServerLifecycleStart, _ctx: &mut Context) { println!("[{}] started", message.channel); if let Some(discord) = &self.discord { let _ = discord - .do_send_async(discord::SendSystem { + .send(discord::SendSystem { channel: message.channel.clone(), content: format!( "{} has started!", @@ -431,7 +364,7 @@ impl Handler for Controller { if let Some(kickback) = self.config.kickbacks.get(&*message.channel) { if let Some(proxy_client) = self.integration_clients.get(&*kickback.proxy_channel) { let _ = proxy_client - .do_send_async(integrations::OutgoingMessage::SendServerToServer { + .send(integrations::OutgoingMessage::SendServerToServer { from_server: kickback.from_server.clone(), to_server: kickback.to_server.clone(), }) @@ -441,8 +374,9 @@ impl Handler for Controller { } } -#[async_trait] impl Handler for Controller { + type Return = (); + async fn handle(&mut self, message: ServerLifecycleStop, _ctx: &mut Context) { println!("[{}] stopped", message.channel); self.status_by_channel.remove(&message.channel); @@ -467,7 +401,7 @@ impl Handler for Controller { }; let _ = discord - .do_send_async(discord::SendSystem { + .send(discord::SendSystem { channel: message.channel, content: content.to_owned(), }) @@ -476,14 +410,15 @@ impl Handler for Controller { } } -#[async_trait] impl Handler for Controller { + type Return = (); + async fn handle(&mut self, message: ServerSystemMessage, _ctx: &mut Context) { println!("[{}] {}", message.channel, message.content); if let Some(discord) = &self.discord { let _ = discord - .do_send_async(discord::SendSystem { + .send(discord::SendSystem { channel: message.channel, content: message.content, }) @@ -492,8 +427,9 @@ impl Handler for Controller { } } -#[async_trait] impl Handler for Controller { + type Return = Option; + async fn handle( &mut self, message: GetStatus, @@ -503,12 +439,13 @@ impl Handler for Controller { } } -#[async_trait] impl Handler for Controller { + type Return = (); + async fn handle(&mut self, message: BackendError, _ctx: &mut Context) { if let Some(discord) = &self.discord { let _ = discord - .do_send_async(ReportError { + .send(ReportError { title: message.title, description: message.description, fields: message.fields, @@ -518,13 +455,14 @@ impl Handler for Controller { } } -#[async_trait] impl Handler for Controller { + type Return = (); + async fn handle( &mut self, message: UploadStatsBundle, _ctx: &mut Context, - ) -> ::Result { + ) -> Self::Return { if let Some(statistics) = &self.statistics { statistics .send(message) diff --git a/src/database.rs b/src/database.rs index 8fdb2e3..24aec3a 100644 --- a/src/database.rs +++ b/src/database.rs @@ -1,14 +1,13 @@ use std::collections::HashMap; use std::time::SystemTime; -use async_trait::async_trait; use deadpool_postgres::Pool; -use log::error; +use tracing::error; use xtra::prelude::*; use crate::controller::*; use crate::model::*; -use crate::{DatabaseConfig, TokioGlobal}; +use crate::DatabaseConfig; pub async fn run(controller: Address, pool: Pool, config: DatabaseConfig) { let database = DatabaseClient { @@ -16,14 +15,15 @@ pub async fn run(controller: Address, pool: Pool, config: DatabaseCo _config: config, channels: HashMap::new(), }; - let database = database.create(None).spawn(&mut TokioGlobal); + let database = xtra::spawn_tokio(database, Mailbox::unbounded()); controller - .do_send_async(RegisterDatabaseClient { client: database }) + .send(RegisterDatabaseClient { client: database }) .await .expect("controller disconnected"); } +#[derive(Actor)] pub struct DatabaseClient { pool: Pool, _config: DatabaseConfig, @@ -48,36 +48,23 @@ impl DatabaseClient { } } -impl Actor for DatabaseClient {} - pub struct WriteStatus { pub channel: String, pub time: SystemTime, pub status: ServerStatus, } -impl Message for WriteStatus { - type Result = (); -} - pub struct WritePerformance { pub channel: String, pub time: SystemTime, pub performance: ServerPerformance, } -impl Message for WritePerformance { - type Result = (); -} - pub struct GetPostgresPool; -impl Message for GetPostgresPool { - type Result = Pool; -} - -#[async_trait] impl Handler for DatabaseClient { + type Return = (); + async fn handle(&mut self, message: WriteStatus, _ctx: &mut Context) { let channel = DatabaseClient::get_or_open_channel( &mut self.channels, @@ -96,8 +83,9 @@ impl Handler for DatabaseClient { } } -#[async_trait] impl Handler for DatabaseClient { + type Return = (); + async fn handle(&mut self, message: WritePerformance, _ctx: &mut Context) { let channel = DatabaseClient::get_or_open_channel( &mut self.channels, @@ -116,13 +104,14 @@ impl Handler for DatabaseClient { } } -#[async_trait] impl Handler for DatabaseClient { + type Return = Pool; + async fn handle( &mut self, _message: GetPostgresPool, _ctx: &mut Context, - ) -> ::Result { + ) -> Self::Return { self.pool.clone() } } diff --git a/src/discord.rs b/src/discord.rs index aa1ed0e..a5a197d 100644 --- a/src/discord.rs +++ b/src/discord.rs @@ -1,38 +1,56 @@ use std::collections::HashMap; use std::sync::Arc; -use async_trait::async_trait; -use log::{error, info, warn}; -use serde_json::json; +use serenity::all::{Cache, CreateEmbed, ExecuteWebhook, Http, Webhook}; use serenity::client::Context as SerenityContext; -use serenity::model::channel::{Embed, Message as SerenityMessage, Reaction}; -use serenity::prelude::*; -use serenity::CacheAndHttp; +use serenity::model::channel::{Message, Reaction}; +use serenity::{async_trait, prelude::*}; +use tracing::{error, info, warn}; use xtra::prelude::*; use xtra::Context as XtraContext; -use xtra::KeepRunning; -use xtra::Message as XtraMessage; use crate::controller::*; use crate::model::*; -use crate::{DiscordConfig, Persistent, TokioGlobal}; +use crate::{DiscordConfig, Persistent}; mod lfp; mod pings; mod relay; +#[derive(Clone)] +struct CacheAndHttp { + http: Arc, + cache: Arc, +} + +impl CacheHttp for CacheAndHttp { + fn http(&self) -> &Http { + &self.http + } + + fn cache(&self) -> Option<&Arc> { + Some(&self.cache) + } +} + +impl AsRef for CacheAndHttp { + fn as_ref(&self) -> &Http { + &self.http + } +} + pub struct DiscordClient { controller: Address, config: DiscordConfig, - cache_and_http: Option>, + cache_and_http: Option, data: Option>>, } -#[async_trait] impl Actor for DiscordClient { - async fn stopping(&mut self, _ctx: &mut XtraContext) -> KeepRunning { - let _ = self.controller.do_send_async(UnregisterDiscordClient).await; - KeepRunning::StopAll + type Stop = (); + + async fn stopped(self) { + let _ = self.controller.send(UnregisterDiscordClient).await; } } @@ -47,7 +65,7 @@ pub async fn run(controller: Address, config: DiscordConfig) { cache_and_http: None, data: None, }; - let address = actor.create(None).spawn(&mut TokioGlobal); + let address = xtra::spawn_tokio(actor, Mailbox::unbounded()); let handler = DiscordHandler { pings: pings::Handler { @@ -55,10 +73,8 @@ pub async fn run(controller: Address, config: DiscordConfig) { }, relay: relay::Handler { controller: controller.clone(), - discord: address.clone(), }, lfp: lfp::Handler { - discord: address.clone(), config: config.clone(), }, }; @@ -81,15 +97,18 @@ pub async fn run(controller: Address, config: DiscordConfig) { } address - .do_send_async(Init { - cache_and_http: client.cache_and_http.clone(), + .send(Init { + cache_and_http: CacheAndHttp { + cache: client.cache.clone(), + http: client.http.clone(), + }, data: client.data.clone(), }) .await .expect("client disconnected"); controller - .do_send_async(RegisterDiscordClient { client: address }) + .send(RegisterDiscordClient { client: address }) .await .expect("controller disconnected"); @@ -97,33 +116,21 @@ pub async fn run(controller: Address, config: DiscordConfig) { } struct Init { - cache_and_http: Arc, + cache_and_http: CacheAndHttp, data: Arc>, } -impl XtraMessage for Init { - type Result = (); -} - pub struct SendChat { pub channel: String, pub sender: Player, pub content: String, } -impl XtraMessage for SendChat { - type Result = (); -} - pub struct SendSystem { pub channel: String, pub content: String, } -impl XtraMessage for SendSystem { - type Result = (); -} - pub struct SendPing { pub ping: String, pub sender_name: String, @@ -131,10 +138,6 @@ pub struct SendPing { pub content: String, } -impl XtraMessage for SendPing { - type Result = (); -} - pub struct UpdateRelayStatus { pub channel: String, pub game_version: String, @@ -142,86 +145,90 @@ pub struct UpdateRelayStatus { pub player_count: usize, } -impl XtraMessage for UpdateRelayStatus { - type Result = (); -} - pub struct ReportError { pub title: String, pub description: String, pub fields: Option>, } -impl XtraMessage for ReportError { - type Result = (); -} - -#[async_trait] impl Handler for DiscordClient { + type Return = (); + async fn handle(&mut self, message: Init, _ctx: &mut XtraContext) { self.cache_and_http = Some(message.cache_and_http); self.data = Some(message.data); } } -#[async_trait] impl Handler for DiscordClient { + type Return = (); + async fn handle(&mut self, send_chat: SendChat, _ctx: &mut XtraContext) { relay::send_chat(self, send_chat).await } } -#[async_trait] impl Handler for DiscordClient { + type Return = (); + async fn handle(&mut self, send_system: SendSystem, _ctx: &mut XtraContext) { relay::send_system(self, send_system).await } } -#[async_trait] impl Handler for DiscordClient { + type Return = (); + async fn handle(&mut self, send_ping: SendPing, _ctx: &mut XtraContext) { pings::send(self, send_ping).await } } -#[async_trait] impl Handler for DiscordClient { + type Return = (); + async fn handle(&mut self, update_relay: UpdateRelayStatus, _ctx: &mut XtraContext) { relay::update_status(self, update_relay).await } } -#[async_trait] impl Handler for DiscordClient { + type Return = (); + async fn handle(&mut self, message: ReportError, _ctx: &mut XtraContext) { if let (Some(cache_and_http), Some(webhook_config)) = (&self.cache_and_http, &self.config.error_webhook) { - if let Ok(webhook) = &cache_and_http - .http - .get_webhook_with_token(webhook_config.id, &webhook_config.token) - .await + if let Ok(webhook) = Webhook::from_id_with_token( + cache_and_http, + webhook_config.id, + &webhook_config.token, + ) + .await { - let embed = Embed::fake(|e| { - e.title(message.title); - e.description(message.description); - if let Some(fields) = message.fields { - for (name, value) in fields { - e.field(name, value, false); - } - } - e - }); - - if let Err(e) = webhook - .execute(&cache_and_http.http, false, |w| { - w.embeds(vec![embed]); - w.username("Backend error reporting"); - w - }) - .await - { + let embed = CreateEmbed::new() + .title(message.title) + .description(message.description) + .fields( + message + .fields + .into_iter() + .flatten() + .map(|(name, value)| (name.clone(), value.clone(), false)) + .collect::>(), + ); + + let res = webhook + .execute( + &cache_and_http, + false, + ExecuteWebhook::new() + .username("Backend Error Reporting") + .embed(embed), + ) + .await; + + if let Err(e) = res { warn!("Failed to report error to discord: {}", e); } } else { @@ -238,12 +245,7 @@ struct DiscordHandler { } impl DiscordHandler { - async fn handle_command( - &self, - tokens: &[&str], - ctx: &SerenityContext, - message: &SerenityMessage, - ) { + async fn handle_command(&self, tokens: &[&str], ctx: &SerenityContext, message: &Message) { let admin = check_message_admin(ctx, message).await; let result = match tokens { @@ -273,14 +275,14 @@ impl DiscordHandler { let _ = message.react(&ctx, reaction).await; if let Err(err) = result { - let _ = message.reply(&ctx, err).await; + let _ = message.reply(&ctx, err.to_string()).await; } } } #[async_trait] impl EventHandler for DiscordHandler { - async fn message(&self, ctx: SerenityContext, message: SerenityMessage) { + async fn message(&self, ctx: SerenityContext, message: Message) { if !message.author.bot { if let Ok(true) = message.mentions_me(&ctx).await { let tokens: Vec<&str> = message.content.split_ascii_whitespace().collect(); @@ -306,9 +308,10 @@ impl EventHandler for DiscordHandler { } } -async fn check_message_admin(ctx: &SerenityContext, message: &SerenityMessage) -> bool { - if let Ok(member) = message.member(&ctx).await { - if let Ok(permissions) = member.permissions(ctx) { +async fn check_message_admin(ctx: &SerenityContext, message: &Message) -> bool { + if let (Ok(channel), Ok(member)) = (message.channel(ctx).await, message.member(&ctx).await) { + if let Some(guild) = message.guild(&ctx.cache) { + let permissions = guild.user_permissions_in(&channel.guild().unwrap(), &member); return permissions.administrator(); } } diff --git a/src/discord/lfp.rs b/src/discord/lfp.rs index 43e9f60..7a7f9a4 100644 --- a/src/discord/lfp.rs +++ b/src/discord/lfp.rs @@ -1,7 +1,8 @@ use std::time::{Duration, SystemTime}; use serde::{Deserialize, Deserializer, Serialize, Serializer}; -use serenity::model::channel::{Channel as SerenityChannel, GuildChannel}; +use serenity::all::{CreateMessage, CreateWebhook, ExecuteWebhook, GuildId}; +use serenity::model::channel::Channel as SerenityChannel; use serenity::model::id::{ChannelId, MessageId, RoleId, UserId}; use serenity::model::webhook::Webhook; @@ -34,11 +35,11 @@ impl Store { webhook: Webhook, ) { self.channels.0.insert( - channel.0, + channel.get(), Channel { - channel_id: channel.0, - role_id: role.0, - register_message: register_message.0, + channel_id: channel.get(), + role_id: role.get(), + register_message: register_message.get(), registrations: Vec::new(), webhook, }, @@ -97,13 +98,17 @@ struct Channel { impl Channel { fn add_registration(&mut self, user: UserId, message: MessageId) { self.registrations.push(Registration { - user_id: user.0, - message_id: message.0, + user_id: user.get(), + message_id: message.get(), }); } fn remove_registration(&mut self, user: UserId) -> Option { - match self.registrations.iter().position(|r| r.user_id == user.0) { + match self + .registrations + .iter() + .position(|r| r.user_id == user.get()) + { Some(idx) => Some(self.registrations.remove(idx)), None => None, } @@ -117,7 +122,6 @@ struct Registration { } pub struct Handler { - pub discord: Address, pub config: DiscordConfig, } @@ -125,7 +129,7 @@ impl Handler { pub async fn setup_for_channel( &self, ctx: &SerenityContext, - message: &SerenityMessage, + message: &Message, ) -> CommandResult { let role = message .mention_roles @@ -140,9 +144,12 @@ impl Handler { let register_message = message .channel_id - .send_message(&ctx.http, |message| { - message.content(description).reactions(vec![REACTION]) - }) + .send_message( + &ctx.http, + CreateMessage::new() + .content(description) + .reactions(vec![REACTION]), + ) .await?; let channel = match message.channel(ctx).await { @@ -151,7 +158,7 @@ impl Handler { }; let webhook = channel - .create_webhook(&ctx.http, "Looking For Players".to_string()) + .create_webhook(&ctx.http, CreateWebhook::new("Looking For Players")) .await?; let mut data = ctx.data.write().await; @@ -172,16 +179,8 @@ impl Handler { pub async fn handle_reaction_add(&self, ctx: &SerenityContext, reaction: Reaction) { if let Some(channel) = self.get_channel(ctx, reaction.channel_id).await { - let guild_channel = ctx - .cache - .channel(reaction.channel_id) - .and_then(|c| c.guild()); - - if let (Some(user), Some(guild_channel)) = (reaction.user_id, guild_channel) { - if let Err(err) = self - .add_registration(ctx, user, guild_channel, channel) - .await - { + if let (Some(user), Some(guild_id)) = (reaction.user_id, reaction.guild_id) { + if let Err(err) = self.add_registration(ctx, user, guild_id, channel).await { error!("Failed to add looking-for-player registration: {:?}", err); } } @@ -192,43 +191,49 @@ impl Handler { &self, ctx: &SerenityContext, user: UserId, - channel: GuildChannel, - channel_data: Channel, + guild_id: GuildId, + channel: Channel, ) -> CommandResult { - let mut member = channel.guild_id.member(&ctx.http, user).await?; + let member = guild_id.member(&ctx.http, user).await?; if member.user.bot { return Ok(()); } - member.add_role(&ctx.http, channel_data.role_id).await?; + member.add_role(&ctx.http, channel.role_id).await?; let mut data = ctx.data.write().await; let store = data.get_mut::().unwrap(); let pings = store.write(|store| store.try_ping(&self.config)).await; - let message = channel_data + let name = member + .nick + .clone() + .unwrap_or_else(|| member.user.name.clone()); + let avatar = member + .user + .avatar_url() + .unwrap_or_else(|| member.user.default_avatar_url()); + let content = if pings { + format!( + "{}: {} is looking for players!", + RoleId::new(channel.role_id).mention(), + member.mention() + ) + } else { + format!("{} is looking for players!", member.mention()) + }; + + let message = channel .webhook - .execute(&ctx.http, true, |message| { - let name = member - .nick - .clone() - .unwrap_or_else(|| member.user.name.clone()); - let avatar = member - .user - .avatar_url() - .unwrap_or_else(|| member.user.default_avatar_url()); - let content = if pings { - format!( - "{}: {} is looking for players!", - RoleId(channel_data.role_id).mention(), - member.mention() - ) - } else { - format!("{} is looking for players!", member.mention()) - }; - message.content(content).username(name).avatar_url(avatar) - }) + .execute( + &ctx.http, + true, + ExecuteWebhook::new() + .content(content) + .username(name) + .avatar_url(avatar), + ) .await?; if let Some(message) = message { @@ -237,7 +242,7 @@ impl Handler { store .channels .0 - .get_mut(&channel.id.0) + .get_mut(&channel.channel_id) .map(|channel| channel.add_registration(user, message.id)) }) .await; @@ -248,14 +253,9 @@ impl Handler { pub async fn handle_reaction_remove(&self, ctx: &SerenityContext, reaction: Reaction) { if let Some(channel) = self.get_channel(ctx, reaction.channel_id).await { - let guild_channel = ctx - .cache - .channel(reaction.channel_id) - .and_then(|c| c.guild()); - - if let (Some(user), Some(guild_channel)) = (reaction.user_id, guild_channel) { + if let (Some(user), Some(guild_id)) = (reaction.user_id, reaction.guild_id) { if let Err(err) = self - .remove_registration(ctx, user, guild_channel, channel) + .remove_registration(ctx, user, reaction.channel_id, guild_id, channel) .await { error!( @@ -271,15 +271,17 @@ impl Handler { &self, ctx: &SerenityContext, user: UserId, - channel: GuildChannel, - channel_data: Channel, + channel_id: ChannelId, + guild_id: GuildId, + channel: Channel, ) -> CommandResult { - let mut member = channel.guild_id.member(&ctx.http, user).await?; + let member = guild_id.member(&ctx, user).await?; + if member.user.bot { return Ok(()); } - member.remove_role(&ctx.http, channel_data.role_id).await?; + member.remove_role(&ctx.http, channel.role_id).await?; let mut data = ctx.data.write().await; let store = data.get_mut::().unwrap(); @@ -289,14 +291,13 @@ impl Handler { store .channels .0 - .get_mut(&channel.id.0) + .get_mut(&channel.channel_id) .and_then(|channel| channel.remove_registration(user)) }) .await; if let Some(registration) = registration { - channel - .id + channel_id .delete_message(&ctx.http, registration.message_id) .await?; } @@ -307,6 +308,6 @@ impl Handler { async fn get_channel(&self, ctx: &SerenityContext, channel: ChannelId) -> Option { let data = ctx.data.read().await; let store = data.get::().unwrap(); - store.channels.0.get(&channel.0).cloned() + store.channels.0.get(&channel.get()).cloned() } } diff --git a/src/discord/pings.rs b/src/discord/pings.rs index 44e8f98..cf0e35f 100644 --- a/src/discord/pings.rs +++ b/src/discord/pings.rs @@ -1,10 +1,10 @@ use std::collections::{HashMap, HashSet}; use std::time::{Duration, SystemTime}; -use log::error; +use tracing::error; use regex::Regex; use serde::{Deserialize, Serialize}; -use serde_json::json; +use serenity::all::{CreateAllowedMentions, CreateWebhook}; use serenity::client::Context as SerenityContext; use serenity::model::channel::{Channel, Message as SerenityMessage}; use serenity::model::id::{ChannelId, RoleId}; @@ -32,13 +32,13 @@ impl Store { pub fn ping_for_channel(&self, ping: &str, channel: ChannelId) -> Option<&Ping> { self.pings .get(ping) - .filter(|ping| ping.discord_channel == channel.0) + .filter(|ping| ping.discord_channel == channel.get()) } pub fn ping_for_channel_mut(&mut self, ping: &str, channel: ChannelId) -> Option<&mut Ping> { self.pings .get_mut(ping) - .filter(|ping| ping.discord_channel == channel.0) + .filter(|ping| ping.discord_channel == channel.get()) } } @@ -77,29 +77,25 @@ pub async fn send(discord: &mut DiscordClient, send_ping: SendPing) { let ping_store = ping_store.get_mut_unchecked(); if let Some(ping) = ping_store.pings.get_mut(&send_ping.ping) { - let role = RoleId(ping.discord_role); + let role = RoleId::new(ping.discord_role); let new_ping = ping.try_new_ping(&discord.config); let result = ping .webhook - .execute(&cache_and_http.http, false, move |message| { - message.0.insert( - "allowed_mentions", - json!({"parse": [], "roles": [role.to_string()]}), - ); - message.username(send_ping.sender_name); - + .execute(&cache_and_http.http, false, { + let mut execute = ExecuteWebhook::new() + .allowed_mentions(CreateAllowedMentions::new().roles([role])) + .username(send_ping.sender_name) + .content(if new_ping { + format!("{}! {}", role.mention(), send_ping.content) + } else { + send_ping.content + }); if let Some(icon) = send_ping.sender_icon { - message.avatar_url(icon); + execute = execute.avatar_url(icon); } - - let content = if new_ping { - format!("{}! {}", role.mention(), send_ping.content) - } else { - send_ping.content - }; - message.content(content) + execute }) .await; @@ -128,42 +124,46 @@ impl Handler { let mut data = ctx.data.write().await; let ping_store = data.get_mut::().unwrap(); - match (message.guild(&ctx.cache), message.channel(ctx).await) { - (Some(guild), Ok(Channel::Guild(channel))) => { - let role_id = RoleId( - role_id - .parse::() - .map_err(|_| CommandError::InvalidRoleId)?, - ); - if !guild.roles.contains_key(&role_id) { - return Err(CommandError::InvalidRoleId); - } + let role_id = RoleId::new( + role_id + .parse::() + .map_err(|_| CommandError::InvalidRoleId)?, + ); - let webhook = channel - .create_webhook(&ctx.http, format!("Ping {}", ping)) - .await?; - - ping_store - .write(|ping_store| { - let ping = ping.to_owned(); - if let std::collections::hash_map::Entry::Vacant(e) = - ping_store.pings.entry(ping) - { - e.insert(Ping { - discord_channel: channel.id.0, - discord_role: role_id.0, - webhook, - last_ping_time: SystemTime::now(), - allowed_roles: HashSet::new(), - }); - Ok(()) - } else { - Err(CommandError::PingAlreadyConnected) - } - }) - .await + if let Some(guild) = message.guild(&ctx.cache) { + if !guild.roles.contains_key(&role_id) { + return Err(CommandError::InvalidRoleId); } - _ => Err(CommandError::CannotRunHere), + } else { + return Err(CommandError::CannotRunHere); + } + + if let Ok(Channel::Guild(channel)) = message.channel(ctx).await { + let webhook = channel + .create_webhook(&ctx.http, CreateWebhook::new(format!("Ping {}", ping))) + .await?; + + ping_store + .write(|ping_store| { + let ping = ping.to_owned(); + if let std::collections::hash_map::Entry::Vacant(e) = + ping_store.pings.entry(ping) + { + e.insert(Ping { + discord_channel: channel.id.get(), + discord_role: role_id.get(), + webhook, + last_ping_time: SystemTime::now(), + allowed_roles: HashSet::new(), + }); + Ok(()) + } else { + Err(CommandError::PingAlreadyConnected) + } + }) + .await + } else { + Err(CommandError::CannotRunHere) } } @@ -192,11 +192,7 @@ impl Handler { }) .await?; - let webhook = ping.webhook; - // the unwrap of the token shouldn't fail as we should always receieve it when creating the webhook - ctx.http - .delete_webhook_with_token(webhook.id.0, &webhook.token.unwrap()) - .await?; + ping.webhook.delete(&ctx.http).await?; Ok(()) } @@ -212,11 +208,13 @@ impl Handler { .parse::() .map_err(|_| CommandError::InvalidRoleId)?; - let guild = message - .guild(&ctx.cache) - .ok_or(CommandError::CannotRunHere)?; - if guild.roles.get(&RoleId(role)).is_none() { - return Err(CommandError::InvalidRoleId); + { + let guild = message + .guild(&ctx.cache) + .ok_or(CommandError::CannotRunHere)?; + if !guild.roles.contains_key(&RoleId::new(role)) { + return Err(CommandError::InvalidRoleId); + } } self.update_ping(ctx, message, ping, |ping| { @@ -292,7 +290,7 @@ impl Handler { Some(ping) => { let allowed = sender_roles .iter() - .any(|role| ping.allowed_roles.contains(&role.0)); + .any(|role| ping.allowed_roles.contains(&role.get())); if !allowed { return Err(CommandError::NotAllowed); } @@ -310,7 +308,7 @@ impl Handler { Some(changelog) => { let _ = self .discord - .do_send_async(SendPing { + .send(SendPing { ping: ping.to_owned(), sender_name: message.author.name.clone(), sender_icon: message.author.avatar_url().clone(), diff --git a/src/discord/relay.rs b/src/discord/relay.rs index 9267353..80f72e7 100644 --- a/src/discord/relay.rs +++ b/src/discord/relay.rs @@ -1,9 +1,10 @@ use std::collections::HashMap; use lazy_static::lazy_static; -use log::error; +use tracing::error; use regex::Regex; use serde::{Deserialize, Deserializer, Serialize, Serializer}; +use serenity::all::{CreateAllowedMentions, CreateMessage, CreateWebhook, EditChannel}; use serenity::client::Context as SerenityContext; use serenity::model::channel::{Channel, Message as SerenityMessage}; use serenity::model::id::ChannelId; @@ -68,6 +69,7 @@ impl<'de> Deserialize<'de> for Store { #[derive(Serialize, Deserialize, Debug, Clone)] pub struct ChannelRelay { + discord_guild: u64, discord_channel: u64, webhook: Webhook, } @@ -81,20 +83,19 @@ pub async fn send_chat(discord: &mut DiscordClient, send_chat: SendChat) { let result = relay .webhook - .execute(&cache_and_http.http, false, move |webhook| { - let mut webhook = webhook + .execute(&cache_and_http.http, false, { + let mut execute = ExecuteWebhook::new() .username(send_chat.sender.name) - .content(send_chat.content); - - webhook.0.insert("allowed_mentions", json!({"parse": []})); + .content(send_chat.content) + .allowed_mentions(CreateAllowedMentions::new()); if let Some(avatar_url) = avatar_url { let id = send_chat.sender.id.replace('-', ""); let avatar_url = format!("{}/{}", avatar_url, id); - webhook = webhook.avatar_url(avatar_url); + execute = execute.avatar_url(avatar_url); } - webhook + execute }) .await; @@ -110,12 +111,13 @@ pub async fn send_system(discord: &mut DiscordClient, send_system: SendSystem) { let data = data.read().await; let relay_store = data.get::().unwrap(); if let Some(relay) = relay_store.channel_to_relay.get(&send_system.channel) { - let result = ChannelId(relay.discord_channel) - .send_message(&cache_and_http.http, move |message| { - message + let result = ChannelId::new(relay.discord_channel) + .send_message( + &cache_and_http.http, + CreateMessage::new() .content(send_system.content) - .allowed_mentions(|m| m.empty_parse()) - }) + .allowed_mentions(CreateAllowedMentions::new()), + ) .await; if let Err(error) = result { @@ -146,16 +148,8 @@ pub async fn update_status(discord: &mut DiscordClient, update_relay: UpdateRela ), }; - if let Some(Channel::Guild(channel)) = - cache_and_http.cache.channel(relay.discord_channel) - { - if channel.topic.as_ref() == Some(&topic) { - return; - } - } - - let edit_result = ChannelId(relay.discord_channel) - .edit(&cache_and_http.http, move |channel| channel.topic(topic)) + let edit_result = ChannelId::new(relay.discord_channel) + .edit(&cache_and_http.http, EditChannel::new().topic(topic)) .await; if let Err(error) = edit_result { @@ -167,7 +161,6 @@ pub async fn update_status(discord: &mut DiscordClient, update_relay: UpdateRela pub struct Handler { pub controller: Address, - pub discord: Address, } impl Handler { @@ -187,11 +180,15 @@ impl Handler { match message.channel(ctx).await { Ok(Channel::Guild(guild_channel)) => { let webhook = guild_channel - .create_webhook(&ctx.http, format!("Relay ({})", channel)) + .create_webhook( + &ctx.http, + CreateWebhook::new(format!("Relay ({})", channel)), + ) .await?; let relay = ChannelRelay { - discord_channel: message.channel_id.0, + discord_channel: message.channel_id.get(), + discord_guild: guild_channel.guild_id.get(), webhook, }; @@ -218,17 +215,14 @@ impl Handler { let (_, relay) = relay_store .write( - |relay_store| match relay_store.remove_relay(message.channel_id.0) { + |relay_store| match relay_store.remove_relay(message.channel_id.get()) { Some(channel) => Ok(channel), None => Err(CommandError::ChannelNotConnected), }, ) .await?; - // the unwrap of the token shouldn't fail as we should always receieve it when creating the webhook - ctx.http - .delete_webhook_with_token(relay.webhook.id.0, &relay.webhook.token.unwrap()) - .await?; + relay.webhook.delete(&ctx.http).await?; Ok(()) } @@ -237,11 +231,14 @@ impl Handler { let data = ctx.data.read().await; let relay_store = data.get::().unwrap(); - if let Some(channel) = relay_store.discord_to_channel.get(&message.channel_id.0) { + if let Some(channel) = relay_store + .discord_to_channel + .get(&message.channel_id.get()) + { let message = self.parse_outgoing_chat_with_reply(ctx, message).await; self.controller - .do_send_async(OutgoingChat { + .send(OutgoingChat { channel: channel.clone(), chat: message, }) @@ -287,7 +284,10 @@ impl Handler { let data = ctx.data.read().await; let relay_store = data.get::().unwrap(); - if let Some(channel) = relay_store.discord_to_channel.get(&message.channel_id.0) { + if let Some(channel) = relay_store + .discord_to_channel + .get(&message.channel_id.get()) + { let command = self.sanitize_message_content(ctx, message).await[2..].to_owned(); let sender = self.sender_name(ctx, message).await; let roles = if let Ok(member) = message.member(&ctx).await { @@ -297,7 +297,7 @@ impl Handler { }; self.controller - .do_send_async(OutgoingCommand { + .send(OutgoingCommand { channel: channel.clone(), command, sender, @@ -331,9 +331,8 @@ impl Handler { ) -> ChatMessage { let sender = self.sender_name(ctx, message).await; let sender_user = DiscordUser { - id: message.author.id.0, + id: message.author.id.get(), name: message.author.name.clone(), - discriminator: message.author.discriminator, }; let name_color = self.get_sender_name_color(ctx, message).await; diff --git a/src/integrations.rs b/src/integrations.rs index 3e51971..e22671c 100644 --- a/src/integrations.rs +++ b/src/integrations.rs @@ -1,21 +1,19 @@ use std::io; use std::pin::Pin; -use async_trait::async_trait; use bytes::Bytes; use futures::{Sink, SinkExt, Stream, StreamExt}; -use log::{error, info, warn}; +use tracing::{debug, error, info, warn}; use serde::{Deserialize, Serialize}; use tokio::net::{TcpListener, TcpStream}; use xtra::prelude::*; -use xtra::KeepRunning; use crate::controller::*; use crate::model::*; use crate::statistics::database::UploadStatsBundle; use crate::statistics::model::GameStatsBundle; -use crate::{IntegrationsConfig, TokioGlobal}; +use crate::IntegrationsConfig; use uuid::Uuid; const MAX_FRAME_LENGTH: usize = 4 * 1024 * 1024; @@ -96,10 +94,10 @@ async fn run_client(controller: Address, stream: TcpStream) -> Resul server_type, }; - let client = client.create(None).spawn(&mut TokioGlobal); + let client = xtra::spawn_tokio(client, Mailbox::unbounded()); controller - .do_send_async(RegisterIntegrationsClient { + .send(RegisterIntegrationsClient { channel, game_version, server_ip, @@ -108,7 +106,10 @@ async fn run_client(controller: Address, stream: TcpStream) -> Resul .await .expect("controller disconnected"); - client.attach_stream(stream).await; + if let Err(e) = stream.map(Ok).forward(client.into_sink()).await { + error!("error in integrations client: {e}"); + } + Ok(()) } @@ -119,14 +120,14 @@ pub struct IntegrationsClient { server_type: ServerType, } -#[async_trait] impl Actor for IntegrationsClient { - async fn stopping(&mut self, _ctx: &mut Context) -> KeepRunning { + type Stop = (); + + async fn stopped(self) -> Self::Stop { let unregister = UnregisterIntegrationsClient { channel: self.channel.clone(), }; - let _ = self.controller.do_send_async(unregister).await; - KeepRunning::StopAll + let _ = self.controller.send(unregister).await; } } @@ -189,18 +190,11 @@ pub enum OutgoingMessage { }, } -impl Message for OutgoingMessage { - type Result = (); -} - struct HandleIncomingMessage(Result); -impl Message for HandleIncomingMessage { - type Result = (); -} - -#[async_trait] impl Handler for IntegrationsClient { + type Return = (); + async fn handle(&mut self, message: HandleIncomingMessage, ctx: &mut Context) { match message.0 { Ok(message) => { @@ -212,7 +206,7 @@ impl Handler for IntegrationsClient { sender, content, }; - self.controller.do_send_async(incoming_chat).await + self.controller.send(incoming_chat).await } Status { games, players } => { let status_update = StatusUpdate { @@ -220,14 +214,14 @@ impl Handler for IntegrationsClient { games, players, }; - self.controller.do_send_async(status_update).await + self.controller.send(status_update).await } LifecycleStart {} => { let lifecycle = ServerLifecycleStart { channel: self.channel.clone(), server_type: self.server_type.clone(), }; - self.controller.do_send_async(lifecycle).await + self.controller.send(lifecycle).await } LifecycleStop { crash } => { let lifecycle = ServerLifecycleStop { @@ -235,28 +229,28 @@ impl Handler for IntegrationsClient { crash, server_type: self.server_type.clone(), }; - self.controller.do_send_async(lifecycle).await + self.controller.send(lifecycle).await } Performance(performance) => { let performance_update = PerformanceUpdate { channel: self.channel.clone(), performance, }; - self.controller.do_send_async(performance_update).await + self.controller.send(performance_update).await } SystemMessage { content } => { let system_message = ServerSystemMessage { channel: self.channel.clone(), content, }; - self.controller.do_send_async(system_message).await + self.controller.send(system_message).await } UploadStatistics { bundle, game_id } => { if let Some(global) = &bundle.stats.global { - log::debug!("server '{}' uploaded {} player statistics and {} global statistics in statistics bundle for {}", + debug!("server '{}' uploaded {} player statistics and {} global statistics in statistics bundle for {}", self.channel, bundle.stats.players.len(), global.len(), bundle.namespace); } else { - log::debug!("server '{}' uploaded {} player statistics in statistics bundle for {}", + debug!("server '{}' uploaded {} player statistics in statistics bundle for {}", self.channel, bundle.stats.players.len(), bundle.namespace); } let upload_bundle_message = UploadStatsBundle { @@ -264,7 +258,7 @@ impl Handler for IntegrationsClient { bundle, server: self.channel.clone(), }; - self.controller.do_send_async(upload_bundle_message).await + self.controller.send(upload_bundle_message).await } _ => { warn!( @@ -276,7 +270,7 @@ impl Handler for IntegrationsClient { }; if result.is_err() { - ctx.stop(); + ctx.stop_self(); } } Err(Error::Json(err)) => { @@ -284,14 +278,15 @@ impl Handler for IntegrationsClient { } Err(err) => { error!("integrations client closing with error: {:?}", err); - ctx.stop(); + ctx.stop_self(); } } } } -#[async_trait] impl Handler for IntegrationsClient { + type Return = (); + async fn handle(&mut self, message: OutgoingMessage, _ctx: &mut Context) { // TODO: how should we handle errors here? let _ = self.sink.send(message).await; diff --git a/src/main.rs b/src/main.rs index e1794c6..ae850ba 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,9 +1,8 @@ use deadpool_postgres::{Pool, Runtime}; -use std::future::Future; use tokio_postgres::NoTls; +use tracing_subscriber::prelude::*; use xtra::prelude::*; -use xtra::spawn::Spawner; pub use config::*; pub use controller::*; @@ -20,23 +19,17 @@ mod persistent; mod statistics; mod web; -pub struct TokioGlobal; - -impl Spawner for TokioGlobal { - fn spawn + Send + 'static>(&mut self, fut: F) { - tokio::spawn(fut); - } -} - #[tokio::main] async fn main() { - env_logger::init(); + tracing_subscriber::registry() + .with(tracing_subscriber::filter::EnvFilter::new( + std::env::var("RUST_LOG").unwrap_or_else(|_| "debug,serenity=info,rustls=info,h2=info,hyper=info".into()), + )) + .with(tracing_subscriber::fmt::layer()) + .init(); let config = config::load(); - let controller = Controller::new(config.clone()) - .await - .create(None) - .spawn(&mut TokioGlobal); + let controller = xtra::spawn_tokio(Controller::new(config.clone()).await, Mailbox::unbounded()); let mut futures = Vec::with_capacity(5); diff --git a/src/model.rs b/src/model.rs index 8e3dfcc..1d537e1 100644 --- a/src/model.rs +++ b/src/model.rs @@ -45,7 +45,6 @@ pub struct ChatMessage { pub struct DiscordUser { pub id: u64, pub name: String, - pub discriminator: u16, } #[derive(Serialize, Debug)] diff --git a/src/mojang_api.rs b/src/mojang_api.rs index 112db8b..417cee9 100644 --- a/src/mojang_api.rs +++ b/src/mojang_api.rs @@ -1,24 +1,22 @@ use std::{num::NonZeroUsize, time::Duration}; -use crate::TokioGlobal; use lru::LruCache; use reqwest::Client; use serde::{Deserialize, Serialize}; use uuid::Uuid; -use xtra::{Actor, Address, Context, Handler, Message}; +use xtra::{Actor, Address, Context, Handler, Mailbox}; const USER_AGENT: &str = "nucleoid-backend (v1, https://github.com/NucleoidMC/nucleoid-backend)"; const MOJANG_PROFILE_URL: &str = "https://sessionserver.mojang.com/session/minecraft/profile"; const CACHE_CLEAR_INTERVAL: Duration = Duration::from_secs(60 * 60 * 24); +#[derive(Actor)] pub struct MojangApiClient { client: Client, username_cache: LruCache, } -impl Actor for MojangApiClient {} - impl MojangApiClient { pub fn start(cache_size: NonZeroUsize) -> Result, ClientError> { let username_cache = LruCache::new(cache_size); @@ -27,7 +25,7 @@ impl MojangApiClient { username_cache, }; - let client = client.create(None).spawn(&mut TokioGlobal); + let client = xtra::spawn_tokio(client, Mailbox::unbounded()); let client_weak = client.downgrade(); // Based on https://github.com/NucleoidMC/player-face-api/blob/main/src/api.rs#L52-L63 @@ -68,23 +66,16 @@ impl MojangApiClient { pub struct GetPlayerUsername(pub Uuid); -impl Message for GetPlayerUsername { - type Result = Result, ClientError>; -} - struct ClearCache; -impl Message for ClearCache { - type Result = (); -} - -#[async_trait::async_trait] impl Handler for MojangApiClient { + type Return = Result, ClientError>; + async fn handle( &mut self, message: GetPlayerUsername, _ctx: &mut Context, - ) -> ::Result { + ) -> Self::Return { let username = self.get_username(&message.0).await?; Ok(username.map(|username| ProfileResponse { id: message.0, @@ -93,13 +84,10 @@ impl Handler for MojangApiClient { } } -#[async_trait::async_trait] impl Handler for MojangApiClient { - async fn handle( - &mut self, - _message: ClearCache, - _ctx: &mut Context, - ) -> ::Result { + type Return = (); + + async fn handle(&mut self, _message: ClearCache, _ctx: &mut Context) -> Self::Return { self.username_cache.clear(); } } diff --git a/src/statistics/database.rs b/src/statistics/database.rs index d58cdaf..e5aba71 100644 --- a/src/statistics/database.rs +++ b/src/statistics/database.rs @@ -1,13 +1,12 @@ use std::collections::HashMap; -use async_trait::async_trait; -use chrono::{DateTime, Utc}; +use chrono::{DateTime, NaiveDate, Utc}; use chrono_tz::Tz; use clickhouse_rs::{row, Block, Pool}; -use log::warn; +use tracing::warn; use nucleoid_leaderboards::model::LeaderboardDefinition; use uuid::Uuid; -use xtra::{Actor, Address, Context, Handler, Message}; +use xtra::{Actor, Address, Context, Handler}; use crate::statistics::leaderboards::database::LeaderboardsDatabase; use crate::statistics::leaderboards::LeaderboardEntry; @@ -19,6 +18,7 @@ use crate::{Controller, StatisticsConfig}; use super::wrapped::{NucleoidWrapped, PlayerWrappedData}; +#[derive(Actor)] pub struct StatisticDatabaseController { _controller: Address, pool: Pool, @@ -407,7 +407,7 @@ impl StatisticDatabaseController { let rows = result.rows(); let mut data = Vec::new(); for row in rows { - let date: DateTime = row.get("date")?; + let date: NaiveDate = row.get("date")?; let value: u64 = row.get("value")?; data.push(Datapoint { date, value }); } @@ -421,24 +421,15 @@ impl StatisticDatabaseController { } } -impl Actor for StatisticDatabaseController {} - pub struct GetPlayerStats { pub uuid: Uuid, pub namespace: Option, } -impl Message for GetPlayerStats { - type Result = StatisticsDatabaseResult>; -} - -#[async_trait] impl Handler for StatisticDatabaseController { - async fn handle( - &mut self, - message: GetPlayerStats, - _ctx: &mut Context, - ) -> ::Result { + type Return = StatisticsDatabaseResult>; + + async fn handle(&mut self, message: GetPlayerStats, _ctx: &mut Context) -> Self::Return { self.get_player_stats(&message.uuid, &message.namespace) .await } @@ -446,17 +437,10 @@ impl Handler for StatisticDatabaseController { pub struct GetGameStats(pub Uuid); -impl Message for GetGameStats { - type Result = StatisticsDatabaseResult>>; -} - -#[async_trait] impl Handler for StatisticDatabaseController { - async fn handle( - &mut self, - message: GetGameStats, - _ctx: &mut Context, - ) -> ::Result { + type Return = StatisticsDatabaseResult>>; + + async fn handle(&mut self, message: GetGameStats, _ctx: &mut Context) -> Self::Return { self.get_game_stats(&message.0).await } } @@ -466,17 +450,10 @@ pub struct GetRecentGames { pub player_id: Option, } -impl Message for GetRecentGames { - type Result = StatisticsDatabaseResult>; -} - -#[async_trait] impl Handler for StatisticDatabaseController { - async fn handle( - &mut self, - message: GetRecentGames, - _ctx: &mut Context, - ) -> ::Result { + type Return = StatisticsDatabaseResult>; + + async fn handle(&mut self, message: GetRecentGames, _ctx: &mut Context) -> Self::Return { self.get_recent_games(message.limit, message.player_id) .await } @@ -489,17 +466,14 @@ pub struct UploadStatsBundle { pub bundle: GameStatsBundle, } -impl Message for UploadStatsBundle { - type Result = (); -} - -#[async_trait] impl Handler for StatisticDatabaseController { + type Return = (); + async fn handle( &mut self, message: UploadStatsBundle, _ctx: &mut Context, - ) -> ::Result { + ) -> Self::Return { if let Err(e) = self .upload_stats_bundle( message.game_id, @@ -515,102 +489,72 @@ impl Handler for StatisticDatabaseController { pub struct GetStatisticsStats; -impl Message for GetStatisticsStats { - type Result = StatisticsDatabaseResult; -} - -#[async_trait] impl Handler for StatisticDatabaseController { + type Return = StatisticsDatabaseResult; + async fn handle( &mut self, _message: GetStatisticsStats, _ctx: &mut Context, - ) -> ::Result { + ) -> Self::Return { self.get_statistics_stats().await } } pub struct GetLeaderboard(pub String); -impl Message for GetLeaderboard { - type Result = StatisticsDatabaseResult>>; -} - -#[async_trait] impl Handler for StatisticDatabaseController { - async fn handle( - &mut self, - message: GetLeaderboard, - _ctx: &mut Context, - ) -> ::Result { + type Return = StatisticsDatabaseResult>>; + + async fn handle(&mut self, message: GetLeaderboard, _ctx: &mut Context) -> Self::Return { self.leaderboards.get_leaderboard(&message.0).await } } pub struct GetAllLeaderboards; -impl Message for GetAllLeaderboards { - type Result = Vec; -} - -#[async_trait] impl Handler for StatisticDatabaseController { + type Return = Vec; + async fn handle( &mut self, _message: GetAllLeaderboards, _ctx: &mut Context, - ) -> ::Result { + ) -> Self::Return { self.leaderboards.list_all_leaderboards() } } pub struct GetPlayerRankings(pub Uuid); -impl Message for GetPlayerRankings { - type Result = StatisticsDatabaseResult>>; -} - -#[async_trait] impl Handler for StatisticDatabaseController { + type Return = StatisticsDatabaseResult>>; + async fn handle( &mut self, message: GetPlayerRankings, _ctx: &mut Context, - ) -> ::Result { + ) -> Self::Return { self.leaderboards.get_player_rankings(&message.0).await } } pub struct DataQuery(pub DataQueryType); -impl Message for DataQuery { - type Result = StatisticsDatabaseResult>; -} - -#[async_trait] impl Handler for StatisticDatabaseController { - async fn handle( - &mut self, - message: DataQuery, - _ctx: &mut Context, - ) -> ::Result { + type Return = StatisticsDatabaseResult>; + + async fn handle(&mut self, message: DataQuery, _ctx: &mut Context) -> Self::Return { self.data_query(message.0).await } } pub struct WrappedData(pub Uuid); -impl Message for WrappedData { - type Result = StatisticsDatabaseResult; -} - -#[async_trait] impl Handler for StatisticDatabaseController { - async fn handle( - &mut self, - message: WrappedData, - _ctx: &mut Context, - ) -> ::Result { + type Return = StatisticsDatabaseResult; + + async fn handle(&mut self, message: WrappedData, _ctx: &mut Context) -> Self::Return { self.wrapped_data(&message.0).await } } diff --git a/src/statistics/leaderboards/mod.rs b/src/statistics/leaderboards/mod.rs index 1d72c38..c06ae27 100644 --- a/src/statistics/leaderboards/mod.rs +++ b/src/statistics/leaderboards/mod.rs @@ -21,7 +21,7 @@ impl LeaderboardGenerator { for definition in definitions { if definitions_map.contains_key(&definition.id) { - log::warn!("Duplicate leaderboard definition for {}", definition.id); + tracing::warn!("Duplicate leaderboard definition for {}", definition.id); } let sql = build_sql(&definition); definitions_map.insert(definition.id.clone(), (definition, sql)); diff --git a/src/statistics/mod.rs b/src/statistics/mod.rs index 404bcda..23d018b 100644 --- a/src/statistics/mod.rs +++ b/src/statistics/mod.rs @@ -2,10 +2,10 @@ use std::fs::File; use nucleoid_leaderboards::model::LeaderboardDefinition; use walkdir::WalkDir; -use xtra::{Actor, Address}; +use xtra::{Address, Mailbox}; use crate::statistics::database::StatisticDatabaseController; -use crate::{Controller, RegisterStatisticsDatabaseController, StatisticsConfig, TokioGlobal}; +use crate::{Controller, RegisterStatisticsDatabaseController, StatisticsConfig}; pub mod database; pub mod leaderboards; @@ -24,12 +24,12 @@ pub async fn run( load_leaderboards(&config), ) .await - .expect("failed to connect to statistics database") - .create(None) - .spawn(&mut TokioGlobal); + .expect("failed to connect to statistics database"); + + let statistics_database = xtra::spawn_tokio(statistics_database, Mailbox::unbounded()); controller - .do_send_async(RegisterStatisticsDatabaseController { + .send(RegisterStatisticsDatabaseController { controller: statistics_database, }) .await @@ -49,13 +49,13 @@ fn load_leaderboards(config: &StatisticsConfig) -> Vec { let file = match File::open(entry.path()) { Ok(f) => f, Err(e) => { - log::error!("Failed to open {:?}: {}", entry.path(), e); + tracing::error!("Failed to open {:?}: {}", entry.path(), e); continue; } }; match serde_json::from_reader::<_, LeaderboardDefinition>(&file) { Ok(definition) => leaderboards.push(definition), - Err(e) => log::error!("Failed to parse {:?}: {}", entry.path(), e), + Err(e) => tracing::error!("Failed to parse {:?}: {}", entry.path(), e), } } } diff --git a/src/statistics/model.rs b/src/statistics/model.rs index 20b580a..6af2005 100644 --- a/src/statistics/model.rs +++ b/src/statistics/model.rs @@ -1,8 +1,8 @@ use std::collections::HashMap; use chrono::DateTime; +use chrono::NaiveDate; use chrono::Utc; -use chrono_tz::Tz; use clickhouse_rs::Pool; use serde::{Deserialize, Serialize}; use uuid::Uuid; @@ -138,7 +138,7 @@ pub struct StatisticCounts { #[derive(Serialize)] pub struct Datapoint { - pub date: DateTime, + pub date: NaiveDate, pub value: u64, } diff --git a/src/web.rs b/src/web.rs index c3b2532..c496553 100644 --- a/src/web.rs +++ b/src/web.rs @@ -169,10 +169,7 @@ async fn get_player_stats( if let Some(namespace) = &namespace { for c in namespace.chars() { - if !(('a'..='z').contains(&c) - || ('A'..='Z').contains(&c) - || ('0'..='9').contains(&c) - || c == '_') + if !(c.is_ascii_lowercase() || c.is_ascii_uppercase() || c.is_ascii_digit() || c == '_') { return Ok(send_http_status(StatusCode::BAD_REQUEST)); } @@ -327,7 +324,7 @@ fn handle_server_error(e: &E) -> Box where E: Error, { - log::warn!("error handling request: {}", e); + tracing::warn!("error handling request: {}", e); send_http_status(StatusCode::INTERNAL_SERVER_ERROR) }