From 09c1781653e422d55c240a727903cb2f651ddd4b Mon Sep 17 00:00:00 2001 From: smallerqiu Date: Thu, 29 Jan 2026 20:59:32 +0800 Subject: [PATCH 01/12] feat: update core lib --- Cargo.lock | 2086 ++++++++++++++++++++++------------------ client/Cargo.toml | 54 +- client/src/grpc.rs | 82 +- client/src/sys_info.rs | 25 +- common/Cargo.toml | 18 +- common/build.rs | 8 +- server/Cargo.toml | 68 +- 7 files changed, 1288 insertions(+), 1053 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 59f4e568..de69b4f8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,15 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "addr2line" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" -dependencies = [ - "gimli", -] - [[package]] name = "adler" version = "1.0.2" @@ -25,7 +16,7 @@ checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", "const-random", - "getrandom", + "getrandom 0.2.14", "once_cell", "version_check", "zerocopy", @@ -61,12 +52,6 @@ version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - [[package]] name = "android_system_properties" version = "0.1.5" @@ -92,9 +77,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.6" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" +checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" [[package]] name = "anstyle-parse" @@ -126,9 +111,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.82" +version = "1.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" +checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" [[package]] name = "arrayvec" @@ -150,28 +135,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "async-stream" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" -dependencies = [ - "async-stream-impl", - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "async-stream-impl" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "async-trait" version = "0.1.80" @@ -184,89 +147,53 @@ dependencies = [ ] [[package]] -name = "autocfg" -version = "1.2.0" +name = "atomic-waker" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] -name = "autotools" -version = "0.2.7" +name = "autocfg" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef941527c41b0fc0dd48511a8154cd5fc7e29200a0ff8b7203c5d777dbc795cf" -dependencies = [ - "cc", -] +checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" [[package]] name = "aws-lc-rs" -version = "1.7.0" +version = "1.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5509d663b2c00ee421bda8d6a24d6c42e15970957de1701b8df9f6fbe5707df1" +checksum = "7b7b6141e96a8c160799cc2d5adecd5cbbe5054cb8c7c4af53da0f83bb7ad256" dependencies = [ "aws-lc-sys", - "mirai-annotations", - "paste", "zeroize", ] [[package]] name = "aws-lc-sys" -version = "0.15.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d5d317212c2a78d86ba6622e969413c38847b62f48111f8b763af3dac2f9840" +checksum = "5c34dda4df7017c8db52132f0f8a2e0f8161649d15723ed63fc00c82d0f2081a" dependencies = [ - "bindgen", "cc", "cmake", "dunce", "fs_extra", - "libc", - "paste", -] - -[[package]] -name = "axum" -version = "0.6.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" -dependencies = [ - "async-trait", - "axum-core 0.3.4", - "bitflags 1.3.2", - "bytes", - "futures-util", - "http 0.2.12", - "http-body 0.4.6", - "hyper 0.14.28", - "itoa", - "matchit", - "memchr", - "mime", - "percent-encoding", - "pin-project-lite", - "rustversion", - "serde", - "sync_wrapper 0.1.2", - "tower", - "tower-layer", - "tower-service", ] [[package]] name = "axum" -version = "0.7.5" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a6c9af12842a67734c9a2e355436e5d03b22383ed60cf13cd0c18fbfe3dcbcf" +checksum = "8b52af3cb4058c895d37317bb27508dccc8e5f2d39454016b297bf4a400597b8" dependencies = [ - "async-trait", - "axum-core 0.4.3", + "axum-core", "bytes", + "form_urlencoded", "futures-util", - "http 1.1.0", - "http-body 1.0.0", + "http", + "http-body", "http-body-util", - "hyper 1.3.1", + "hyper", "hyper-util", "itoa", "matchit", @@ -274,12 +201,11 @@ dependencies = [ "mime", "percent-encoding", "pin-project-lite", - "rustversion", - "serde", + "serde_core", "serde_json", "serde_path_to_error", "serde_urlencoded", - "sync_wrapper 1.0.1", + "sync_wrapper", "tokio", "tower", "tower-layer", @@ -289,37 +215,18 @@ dependencies = [ [[package]] name = "axum-core" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" -dependencies = [ - "async-trait", - "bytes", - "futures-util", - "http 0.2.12", - "http-body 0.4.6", - "mime", - "rustversion", - "tower-layer", - "tower-service", -] - -[[package]] -name = "axum-core" -version = "0.4.3" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a15c63fd72d41492dc4f497196f5da1fb04fb7529e631d73630d1b491e47a2e3" +checksum = "08c78f31d7b1291f7ee735c1c6780ccde7785daae9a9206026862dab7d8792d1" dependencies = [ - "async-trait", "bytes", - "futures-util", - "http 1.1.0", - "http-body 1.0.0", + "futures-core", + "http", + "http-body", "http-body-util", "mime", "pin-project-lite", - "rustversion", - "sync_wrapper 0.1.2", + "sync_wrapper", "tower-layer", "tower-service", "tracing", @@ -327,42 +234,26 @@ dependencies = [ [[package]] name = "axum-extra" -version = "0.9.3" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0be6ea09c9b96cb5076af0de2e383bd2bc0c18f827cf1967bdd353e0b910d733" +checksum = "fef252edff26ddba56bbcdf2ee3307b8129acb86f5749b68990c168a6fcc9c76" dependencies = [ - "axum 0.7.5", - "axum-core 0.4.3", + "axum", + "axum-core", "bytes", + "futures-core", "futures-util", "headers", - "http 1.1.0", - "http-body 1.0.0", + "http", + "http-body", "http-body-util", "mime", "pin-project-lite", - "serde", - "tower", "tower-layer", "tower-service", "tracing", ] -[[package]] -name = "backtrace" -version = "0.3.71" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" -dependencies = [ - "addr2line", - "cc", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] - [[package]] name = "base64" version = "0.21.7" @@ -375,29 +266,6 @@ version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" -[[package]] -name = "bindgen" -version = "0.69.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" -dependencies = [ - "bitflags 2.5.0", - "cexpr", - "clang-sys", - "itertools", - "lazy_static", - "lazycell", - "log", - "prettyplease", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", - "syn", - "which", -] - [[package]] name = "bitflags" version = "1.3.2" @@ -406,9 +274,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" [[package]] name = "block-buffer" @@ -448,32 +316,30 @@ checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytes" -version = "1.6.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3" dependencies = [ "serde", ] [[package]] name = "cc" -version = "1.0.95" +version = "1.2.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32a725bc159af97c3e629873bb9f88fb8cf8a4867175f76dc987815ea07c83b" +checksum = "6354c81bbfd62d9cfa9cb3c773c2b7b2a3a482d569de977fd0e961f6e7c00583" dependencies = [ + "find-msvc-tools", "jobserver", "libc", - "once_cell", + "shlex", ] [[package]] -name = "cexpr" -version = "0.6.0" +name = "cesu8" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" -dependencies = [ - "nom", -] +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" [[package]] name = "cfg-if" @@ -481,18 +347,23 @@ 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.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +checksum = "fac4744fb15ae8337dc853fee7fb3f4e48c0fbaa23d0afe49c447b4fab126118" dependencies = [ - "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "wasm-bindgen", - "windows-targets 0.52.5", + "windows-link", ] [[package]] @@ -505,22 +376,11 @@ dependencies = [ "stacker", ] -[[package]] -name = "clang-sys" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" -dependencies = [ - "glob", - "libc", - "libloading", -] - [[package]] name = "clap" -version = "4.5.4" +version = "4.5.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" +checksum = "3e34525d5bbbd55da2bb745d34b36121baac88d07619a9a09cfcf4a6c0832785" dependencies = [ "clap_builder", "clap_derive", @@ -528,23 +388,23 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.2" +version = "4.5.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" +checksum = "59a20016a20a3da95bef50ec7238dbd09baeef4311dcdd38ec15aba69812fb61" dependencies = [ "anstream", "anstyle", "clap_lex", "strsim", "unicase", - "unicode-width", + "unicode-width 0.2.2", ] [[package]] name = "clap_derive" -version = "4.5.4" +version = "4.5.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" +checksum = "a92793da1a46a5f2a02a6f4c46c6496b28c43638adea8306fcb0caa1634f24e5" dependencies = [ "heck", "proc-macro2", @@ -554,15 +414,15 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.0" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" +checksum = "c3e64b0cc0439b12df2fa678eae89a1c56a529fd067a9115f7827f1fffd22b32" [[package]] name = "cmake" -version = "0.1.50" +version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" +checksum = "75443c44cd6b379beb8c5b45d85d0773baf31cce901fe7bb252f4eff3008ef7d" dependencies = [ "cc", ] @@ -573,6 +433,16 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr", +] + [[package]] name = "const-random" version = "0.1.18" @@ -588,16 +458,16 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" dependencies = [ - "getrandom", + "getrandom 0.2.14", "once_cell", "tiny-keccak", ] [[package]] name = "core-foundation" -version = "0.9.4" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" dependencies = [ "core-foundation-sys", "libc", @@ -627,31 +497,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" - [[package]] name = "crunchy" version = "0.2.2" @@ -729,11 +574,22 @@ dependencies = [ "winapi", ] +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "dunce" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "either" @@ -743,9 +599,9 @@ checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" [[package]] name = "email-encoding" -version = "0.3.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60d1d33cdaede7e24091f039632eb5d3c7469fe5b066a985281a34fc70fa317f" +checksum = "9298e6504d9b9e780ed3f7dfd43a61be8cd0e09eb07f7706a945b0072b6670b6" dependencies = [ "base64 0.22.0", "memchr", @@ -763,15 +619,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - [[package]] name = "env_logger" version = "0.10.2" @@ -791,27 +638,17 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" -[[package]] -name = "errno" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - [[package]] name = "fastrand" -version = "2.0.2" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] -name = "fixedbitset" -version = "0.4.2" +name = "find-msvc-tools" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" +checksum = "8591b0bcc8a98a64310a2fae1bb3e9b8564dd10e381e6e28010fde8e8e8568db" [[package]] name = "flate2" @@ -831,9 +668,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.2.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" dependencies = [ "percent-encoding", ] @@ -855,21 +692,21 @@ 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-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", @@ -878,21 +715,21 @@ dependencies = [ [[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" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +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-core", "futures-io", @@ -929,34 +766,17 @@ dependencies = [ ] [[package]] -name = "gimli" -version = "0.28.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" - -[[package]] -name = "glob" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" - -[[package]] -name = "h2" -version = "0.3.26" +name = "getrandom" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http 0.2.12", - "indexmap 2.2.6", - "slab", - "tokio", - "tokio-util", - "tracing", + "cfg-if", + "js-sys", + "libc", + "r-efi", + "wasip2", + "wasm-bindgen", ] [[package]] @@ -970,20 +790,14 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http 1.1.0", - "indexmap 2.2.6", + "http", + "indexmap", "slab", "tokio", "tokio-util", "tracing", ] -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - [[package]] name = "hashbrown" version = "0.14.3" @@ -994,6 +808,12 @@ dependencies = [ "allocator-api2", ] +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" + [[package]] name = "headers" version = "0.4.0" @@ -1003,7 +823,7 @@ dependencies = [ "base64 0.21.7", "bytes", "headers-core", - "http 1.1.0", + "http", "httpdate", "mime", "sha1", @@ -1015,7 +835,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "54b4a22553d4242c49fddb9ba998a99962b5cc6f22cb5a3482bec22522403ce4" dependencies = [ - "http 1.1.0", + "http", ] [[package]] @@ -1030,35 +850,15 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" -[[package]] -name = "home" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" -dependencies = [ - "windows-sys 0.52.0", -] - [[package]] name = "hostname" -version = "0.3.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" +checksum = "617aaa3557aef3810a6369d0a99fac8a080891b68bd9f9812a1eeda0c0730cbd" dependencies = [ + "cfg-if", "libc", - "match_cfg", - "winapi", -] - -[[package]] -name = "http" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" -dependencies = [ - "bytes", - "fnv", - "itoa", + "windows-link", ] [[package]] @@ -1072,17 +872,6 @@ dependencies = [ "itoa", ] -[[package]] -name = "http-body" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" -dependencies = [ - "bytes", - "http 0.2.12", - "pin-project-lite", -] - [[package]] name = "http-body" version = "1.0.0" @@ -1090,27 +879,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" dependencies = [ "bytes", - "http 1.1.0", + "http", ] [[package]] name = "http-body-util" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" dependencies = [ "bytes", "futures-core", - "http 1.1.0", - "http-body 1.0.0", + "http", + "http-body", "pin-project-lite", ] [[package]] name = "httparse" -version = "1.8.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" [[package]] name = "httpdate" @@ -1126,89 +915,78 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.28" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "2ab2d4f250c3d7b1c9fcdff1cece94ea4e2dfbec68614f7b87cb205f24ca9d11" dependencies = [ + "atomic-waker", "bytes", "futures-channel", "futures-core", - "futures-util", - "h2 0.3.26", - "http 0.2.12", - "http-body 0.4.6", + "h2", + "http", + "http-body", "httparse", "httpdate", "itoa", "pin-project-lite", - "socket2", + "pin-utils", + "smallvec", "tokio", - "tower-service", - "tracing", "want", ] [[package]] -name = "hyper" -version = "1.3.1" +name = "hyper-rustls" +version = "0.27.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" +checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58" dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "h2 0.4.4", - "http 1.1.0", - "http-body 1.0.0", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "smallvec", - "tokio", - "want", -] - -[[package]] -name = "hyper-rustls" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" -dependencies = [ - "futures-util", - "http 0.2.12", - "hyper 0.14.28", - "rustls 0.21.11", + "http", + "hyper", + "hyper-util", + "rustls", + "rustls-pki-types", "tokio", - "tokio-rustls 0.24.1", + "tokio-rustls", + "tower-service", ] [[package]] name = "hyper-timeout" -version = "0.4.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" +checksum = "2b90d566bffbce6a75bd8b09a05aa8c2cb1fabb6cb348f8840c9e4c90a0d83b0" dependencies = [ - "hyper 0.14.28", + "hyper", + "hyper-util", "pin-project-lite", "tokio", - "tokio-io-timeout", + "tower-service", ] [[package]] name = "hyper-util" -version = "0.1.3" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa" +checksum = "727805d60e7938b76b826a6ef209eb70eaa1812794f9424d4a4e2d740662df5f" dependencies = [ + "base64 0.22.0", "bytes", + "futures-channel", + "futures-core", "futures-util", - "http 1.1.0", - "http-body 1.0.0", - "hyper 1.3.1", + "http", + "http-body", + "hyper", + "ipnet", + "libc", + "percent-encoding", "pin-project-lite", "socket2", "tokio", + "tower-service", + "tracing", ] [[package]] @@ -1222,7 +1000,7 @@ dependencies = [ "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows-core", + "windows-core 0.52.0", ] [[package]] @@ -1235,42 +1013,115 @@ dependencies = [ ] [[package]] -name = "idna" -version = "0.5.0" +name = "icu_collections" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "displaydoc", + "potential_utf", + "yoke", + "zerofrom", + "zerovec", ] [[package]] -name = "indexmap" -version = "1.9.3" +name = "icu_locale_core" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6" dependencies = [ - "autocfg", - "hashbrown 0.12.3", + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", ] [[package]] -name = "indexmap" -version = "2.2.6" +name = "icu_normalizer" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599" dependencies = [ - "equivalent", - "hashbrown 0.14.3", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", ] [[package]] -name = "instant" -version = "0.1.12" +name = "icu_normalizer_data" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" + +[[package]] +name = "icu_properties" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec" dependencies = [ - "cfg-if", + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af" + +[[package]] +name = "icu_provider" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indexmap" +version = "2.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" +dependencies = [ + "equivalent", + "hashbrown 0.16.1", ] [[package]] @@ -1279,6 +1130,16 @@ version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +[[package]] +name = "iri-string" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c91338f0783edbd6195decb37bae672fd3b165faffb89bf7b9e6942f8b1a731a" +dependencies = [ + "memchr", + "serde", +] + [[package]] name = "is-terminal" version = "0.4.12" @@ -1305,6 +1166,28 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +[[package]] +name = "jni" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +dependencies = [ + "cesu8", + "cfg-if", + "combine", + "jni-sys", + "log", + "thiserror 1.0.58", + "walkdir", + "windows-sys 0.45.0", +] + +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + [[package]] name = "jobserver" version = "0.1.30" @@ -1316,45 +1199,41 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "8c942ebf8e95485ca0d52d97da7c5a2c387d0e7f0ba4c35e93bfcaee045955b3" dependencies = [ + "once_cell", "wasm-bindgen", ] [[package]] name = "jsonwebtoken" -version = "9.3.0" +version = "10.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ae10193d25051e74945f1ea2d0b42e03cc3b890f7e4cc5faa44997d808193f" +checksum = "0529410abe238729a60b108898784df8984c87f6054c9c4fcacc47e4803c1ce1" dependencies = [ - "base64 0.21.7", + "base64 0.22.0", + "getrandom 0.2.14", "js-sys", "pem", - "ring", "serde", "serde_json", + "signature", "simple_asn1", ] [[package]] name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "lazycell" -version = "1.3.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "lettre" -version = "0.11.6" +version = "0.11.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47460276655930189e0919e4fbf46e46476b14f934f18a63dd726a5fb7b60e2e" +checksum = "9e13e10e8818f8b2a60f52cb127041d388b89f3a96a62be9ceaffa22262fef7f" dependencies = [ "async-trait", "base64 0.22.0", @@ -1371,30 +1250,19 @@ dependencies = [ "nom", "percent-encoding", "quoted_printable", - "rustls 0.23.5", - "rustls-pemfile 2.1.2", + "rustls", "socket2", "tokio", - "tokio-rustls 0.26.0", + "tokio-rustls", "url", - "webpki-roots 0.26.1", + "webpki-roots", ] [[package]] name = "libc" -version = "0.2.153" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" - -[[package]] -name = "libloading" -version = "0.8.3" +version = "0.2.180" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" -dependencies = [ - "cfg-if", - "windows-targets 0.52.5", -] +checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc" [[package]] name = "libredox" @@ -1402,15 +1270,15 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.10.0", "libc", ] [[package]] -name = "linux-raw-sys" -version = "0.4.13" +name = "litemap" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" [[package]] name = "lock_api" @@ -1424,27 +1292,27 @@ dependencies = [ [[package]] name = "log" -version = "0.4.21" +version = "0.4.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" [[package]] -name = "match_cfg" -version = "0.1.0" +name = "lru-slab" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" +checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" [[package]] name = "matchit" -version = "0.7.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" +checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" [[package]] name = "md5" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" +checksum = "ae960838283323069879657ca3de837e9f7bbb4c7bf6ea7f1b290d5e9476d2e0" [[package]] name = "memchr" @@ -1466,9 +1334,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", @@ -1476,9 +1344,9 @@ dependencies = [ [[package]] name = "minijinja" -version = "1.0.20" +version = "2.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5c5e3d2b4c0a6832bd3d571f7c19a7c1c1f05f11a6e85ae1a29f76be5f9455" +checksum = "b479616bb6f0779fb0f3964246beda02d4b01144e1b0d5519616e012ccc2a245" dependencies = [ "memo-map", "self_cell", @@ -1486,12 +1354,6 @@ dependencies = [ "serde_json", ] -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - [[package]] name = "miniz_oxide" version = "0.7.2" @@ -1503,35 +1365,31 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.11" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc" dependencies = [ "libc", "wasi", - "windows-sys 0.48.0", + "windows-sys 0.61.2", ] [[package]] -name = "mirai-annotations" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9be0862c1b3f26a88803c4a49de6889c10e608b3ee9344e6ef5b45fb37ad3d1" - -[[package]] -name = "multimap" -version = "0.10.0" +name = "no-std-compat" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" +checksum = "b93853da6d84c2e3c7d730d6473e8817692dd89be387eb01b94d7f108ecb5b8c" +dependencies = [ + "spin 0.5.2", +] [[package]] name = "nom" -version = "7.1.3" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +checksum = "df9761775871bdef83bee530e60050f7e54b1105350d6884eb0fb4f46c2f9405" dependencies = [ "memchr", - "minimal-lexical", ] [[package]] @@ -1579,29 +1437,38 @@ dependencies = [ ] [[package]] -name = "num_cpus" -version = "1.16.0" +name = "objc2-core-foundation" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" dependencies = [ - "hermit-abi", - "libc", + "bitflags 2.10.0", ] [[package]] -name = "object" -version = "0.32.2" +name = "objc2-io-kit" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "33fafba39597d6dc1fb709123dfa8289d39406734be322956a69f0931c73bb15" dependencies = [ - "memchr", + "libc", + "objc2-core-foundation", ] [[package]] name = "once_cell" -version = "1.19.0" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" +dependencies = [ + "portable-atomic", +] + +[[package]] +name = "openssl-probe" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" [[package]] name = "parking_lot" @@ -1626,12 +1493,6 @@ dependencies = [ "windows-targets 0.48.5", ] -[[package]] -name = "paste" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" - [[package]] name = "pem" version = "3.0.4" @@ -1644,19 +1505,9 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - -[[package]] -name = "petgraph" -version = "0.6.4" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" -dependencies = [ - "fixedbitset", - "indexmap 2.2.6", -] +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "pin-project" @@ -1690,6 +1541,21 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "portable-atomic" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f89776e4d69bb58bc6993e99ffa1d11f228b839984854c7daeb5d37f87cbe950" + +[[package]] +name = "potential_utf" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77" +dependencies = [ + "zerovec", +] + [[package]] name = "powerfmt" version = "0.2.0" @@ -1733,87 +1599,113 @@ dependencies = [ "is-terminal", "lazy_static", "term", - "unicode-width", + "unicode-width 0.1.11", ] [[package]] name = "proc-macro2" -version = "1.0.81" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" dependencies = [ "unicode-ident", ] [[package]] name = "prost" -version = "0.12.4" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0f5d036824e4761737860779c906171497f6d55681139d8312388f8fe398922" +checksum = "d2ea70524a2f82d518bce41317d0fae74151505651af45faf1ffbd6fd33f0568" dependencies = [ "bytes", "prost-derive", ] [[package]] -name = "prost-build" -version = "0.12.4" +name = "prost-derive" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80b776a1b2dc779f5ee0641f8ade0125bc1298dd41a9a0c16d8bd57b42d222b1" +checksum = "27c6023962132f4b30eb4c172c91ce92d933da334c59c23cddee82358ddafb0b" dependencies = [ - "bytes", - "heck", + "anyhow", "itertools", - "log", - "multimap", - "once_cell", - "petgraph", - "prettyplease", - "prost", - "prost-types", - "regex", + "proc-macro2", + "quote", "syn", - "tempfile", ] [[package]] -name = "prost-derive" -version = "0.12.4" +name = "protobuf-src" +version = "2.1.1+27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19de2de2a00075bf566bee3bd4db014b11587e84184d3f7a791bc17f1a8e9e48" +checksum = "6217c3504da19b85a3a4b2e9a5183d635822d83507ba0986624b5c05b83bfc40" dependencies = [ - "anyhow", - "itertools", - "proc-macro2", - "quote", - "syn", + "cmake", ] [[package]] -name = "prost-types" -version = "0.12.4" +name = "psm" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3235c33eb02c1f1e212abdbe34c78b264b038fb58ca612664343271e36e55ffe" +checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" dependencies = [ - "prost", + "cc", ] [[package]] -name = "protobuf-src" -version = "1.1.0+21.5" +name = "quinn" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7ac8852baeb3cc6fb83b93646fb93c0ffe5d14bf138c945ceb4b9948ee0e3c1" +checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" dependencies = [ - "autotools", + "bytes", + "cfg_aliases", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror 2.0.18", + "tokio", + "tracing", + "web-time", ] [[package]] -name = "psm" -version = "0.1.21" +name = "quinn-proto" +version = "0.11.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" +checksum = "f1906b49b0c3bc04b5fe5d86a77925ae6524a19b816ae38ce1e426255f1d8a31" dependencies = [ - "cc", + "aws-lc-rs", + "bytes", + "getrandom 0.3.4", + "lru-slab", + "rand", + "ring", + "rustc-hash", + "rustls", + "rustls-pki-types", + "slab", + "thiserror 2.0.18", + "tinyvec", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-udp" +version = "0.5.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" +dependencies = [ + "cfg_aliases", + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.60.2", ] [[package]] @@ -1831,25 +1723,30 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79ec282e887b434b68c18fe5c121d38e72a5cf35119b59e54ec5b992ea9c8eb0" +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + [[package]] name = "rand" -version = "0.8.5" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" dependencies = [ - "libc", "rand_chacha", - "rand_core", + "rand_core 0.9.5", ] [[package]] name = "rand_chacha" -version = "0.3.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.9.5", ] [[package]] @@ -1858,27 +1755,16 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", + "getrandom 0.2.14", ] [[package]] -name = "rayon-core" -version = "1.12.1" +name = "rand_core" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" dependencies = [ - "crossbeam-deque", - "crossbeam-utils", + "getrandom 0.3.4", ] [[package]] @@ -1896,16 +1782,16 @@ version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" dependencies = [ - "getrandom", + "getrandom 0.2.14", "libredox", - "thiserror", + "thiserror 1.0.58", ] [[package]] name = "regex" -version = "1.10.4" +version = "1.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4" dependencies = [ "aho-corasick", "memchr", @@ -1915,9 +1801,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.6" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c" dependencies = [ "aho-corasick", "memchr", @@ -1926,64 +1812,59 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.3" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" +checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" [[package]] name = "reqwest" -version = "0.11.27" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +checksum = "04e9018c9d814e5f30cc16a0f03271aeab3571e609612d9fe78c1aa8d11c2f62" dependencies = [ - "async-compression", - "base64 0.21.7", + "base64 0.22.0", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2 0.3.26", - "http 0.2.12", - "http-body 0.4.6", - "hyper 0.14.28", + "http", + "http-body", + "http-body-util", + "hyper", "hyper-rustls", - "ipnet", + "hyper-util", "js-sys", "log", - "mime", - "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.21.11", - "rustls-pemfile 1.0.4", + "quinn", + "rustls", + "rustls-pki-types", + "rustls-platform-verifier", "serde", "serde_json", - "serde_urlencoded", - "sync_wrapper 0.1.2", - "system-configuration", + "sync_wrapper", "tokio", - "tokio-rustls 0.24.1", - "tokio-socks", + "tokio-rustls", "tokio-util", + "tower", + "tower-http", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "wasm-streams", "web-sys", - "webpki-roots 0.25.4", - "winreg", ] [[package]] name = "rhai" -version = "1.18.0" +version = "1.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a7d88770120601ba1e548bb6bc2a05019e54ff01b51479e38e64ec3b59d4759" +checksum = "1f9ef5dabe4c0b43d8f1187dc6beb67b53fe607fff7e30c5eb7f71b814b8c2c1" dependencies = [ "ahash", - "bitflags 2.5.0", - "instant", + "bitflags 2.10.0", + "no-std-compat", "num-traits", "once_cell", "rhai_codegen", @@ -1993,13 +1874,14 @@ dependencies = [ "smallvec", "smartstring", "thin-vec", + "web-time", ] [[package]] name = "rhai_codegen" -version = "2.1.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59aecf17969c04b9c0c5d21f6bc9da9fec9dd4980e64d1871443a476589d8c86" +checksum = "d4322a2a4e8cf30771dd9f27f7f37ca9ac8fe812dddd811096a98483080dabe6" dependencies = [ "proc-macro2", "quote", @@ -2014,18 +1896,18 @@ checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", "cfg-if", - "getrandom", + "getrandom 0.2.14", "libc", - "spin", + "spin 0.9.8", "untrusted", "windows-sys 0.52.0", ] [[package]] name = "rust-embed" -version = "8.3.0" +version = "8.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb78f46d0066053d16d4ca7b898e9343bc3530f71c61d5ad84cd404ada068745" +checksum = "04113cb9355a377d83f06ef1f0a45b8ab8cd7d8b1288160717d66df5c7988d27" dependencies = [ "rust-embed-impl", "rust-embed-utils", @@ -2034,9 +1916,9 @@ dependencies = [ [[package]] name = "rust-embed-impl" -version = "8.3.0" +version = "8.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91ac2a3c6c0520a3fb3dd89321177c3c692937c4eb21893378219da10c44fc8" +checksum = "da0902e4c7c8e997159ab384e6d0fc91c221375f6894346ae107f47dd0f3ccaa" dependencies = [ "proc-macro2", "quote", @@ -2047,9 +1929,9 @@ dependencies = [ [[package]] name = "rust-embed-utils" -version = "8.3.0" +version = "8.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f69089032567ffff4eada41c573fc43ff466c7db7c5688b2e7969584345581" +checksum = "5bcdef0be6fe7f6fa333b1073c949729274b05f123a0ad7efcb8efd878e5c3b1" dependencies = [ "mime_guess", "sha2", @@ -2066,113 +1948,91 @@ dependencies = [ "num-traits", ] -[[package]] -name = "rustc-demangle" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" - [[package]] name = "rustc-hash" -version = "1.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "rustix" -version = "0.38.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" -dependencies = [ - "bitflags 2.5.0", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" [[package]] name = "rustls" -version = "0.21.11" +version = "0.23.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fecbfb7b1444f477b345853b1fce097a2c6fb637b2bfb87e6bc5db0f043fae4" +checksum = "c665f33d38cea657d9614f766881e4d510e0eda4239891eea56b4cadcf01801b" dependencies = [ + "aws-lc-rs", "log", + "once_cell", "ring", - "rustls-webpki 0.101.7", - "sct", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", ] [[package]] -name = "rustls" -version = "0.22.4" +name = "rustls-native-certs" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" +checksum = "612460d5f7bea540c490b2b6395d8e34a953e52b491accd6c86c8164c5932a63" dependencies = [ - "log", - "ring", + "openssl-probe", "rustls-pki-types", - "rustls-webpki 0.102.2", - "subtle", - "zeroize", + "schannel", + "security-framework", ] [[package]] -name = "rustls" -version = "0.23.5" +name = "rustls-pemfile" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afabcee0551bd1aa3e18e5adbf2c0544722014b899adb31bd186ec638d3da97e" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" dependencies = [ - "aws-lc-rs", - "log", - "once_cell", - "ring", "rustls-pki-types", - "rustls-webpki 0.102.2", - "subtle", - "zeroize", ] [[package]] -name = "rustls-pemfile" -version = "1.0.4" +name = "rustls-pki-types" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd" dependencies = [ - "base64 0.21.7", + "web-time", + "zeroize", ] [[package]] -name = "rustls-pemfile" -version = "2.1.2" +name = "rustls-platform-verifier" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" +checksum = "1d99feebc72bae7ab76ba994bb5e121b8d83d910ca40b36e0921f53becc41784" dependencies = [ - "base64 0.22.0", - "rustls-pki-types", + "core-foundation", + "core-foundation-sys", + "jni", + "log", + "once_cell", + "rustls", + "rustls-native-certs", + "rustls-platform-verifier-android", + "rustls-webpki", + "security-framework", + "security-framework-sys", + "webpki-root-certs", + "windows-sys 0.61.2", ] [[package]] -name = "rustls-pki-types" -version = "1.4.1" +name = "rustls-platform-verifier-android" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd36cc4259e3e4514335c4a138c6b43171a8d61d8f5c9348f9fc7529416f247" +checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" [[package]] name = "rustls-webpki" -version = "0.101.7" +version = "0.103.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "rustls-webpki" -version = "0.102.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" +checksum = "d7df23109aa6c1567d1c575b9952556388da57401e4ace1d15f79eedad0d8f53" dependencies = [ "aws-lc-rs", "ring", @@ -2201,6 +2061,15 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "schannel" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "891d81b926048e76efe18581bf793546b4c0eaf8448d72be8de2bbee5fd166e1" +dependencies = [ + "windows-sys 0.61.2", +] + [[package]] name = "scopeguard" version = "1.2.0" @@ -2208,35 +2077,58 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] -name = "sct" -version = "0.7.1" +name = "security-framework" +version = "3.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +checksum = "b3297343eaf830f66ede390ea39da1d462b6b0c1b000f420d0a83f898bbbe6ef" dependencies = [ - "ring", - "untrusted", + "bitflags 2.10.0", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc1f0cbffaac4852523ce30d8bd3c5cdc873501d96ff467ca09b6767bb8cd5c0" +dependencies = [ + "core-foundation-sys", + "libc", ] [[package]] name = "self_cell" -version = "1.0.3" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58bf37232d3bb9a2c4e641ca2a11d83b5062066f88df7fed36c28772046d65ba" +checksum = "b12e76d157a900eb52e81bc6e9f3069344290341720e9178cde2407113ac8d89" [[package]] name = "serde" -version = "1.0.198" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9846a40c979031340571da2545a4e5b7c4163bdae79b301d5f86d03979451fcc" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.198" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88edab869b01783ba905e7d0153f9fc1a6505a96e4ad3018011eedb838566d9" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", @@ -2245,13 +2137,15 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.116" +version = "1.0.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" dependencies = [ "itoa", - "ryu", + "memchr", "serde", + "serde_core", + "zmij", ] [[package]] @@ -2266,11 +2160,11 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.5" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +checksum = "f8bbf91e5a4d6315eee45e704372590b30e260ee83af6639d64557f51b067776" dependencies = [ - "serde", + "serde_core", ] [[package]] @@ -2322,6 +2216,15 @@ dependencies = [ "libc", ] +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "rand_core 0.6.4", +] + [[package]] name = "simple_asn1" version = "0.6.2" @@ -2330,7 +2233,7 @@ checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" dependencies = [ "num-bigint", "num-traits", - "thiserror", + "thiserror 1.0.58", "time", ] @@ -2366,20 +2269,32 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.6" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +checksum = "86f4aa3ad99f2088c990dfa82d367e19cb29268ed67c574d10d0a4bfe71f07e0" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.60.2", ] +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + [[package]] name = "spin" version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + [[package]] name = "stacker" version = "0.1.15" @@ -2402,7 +2317,7 @@ dependencies = [ "chrono", "clap", "fastrand", - "hyper 1.3.1", + "hyper", "lazy_static", "log", "md5", @@ -2412,18 +2327,18 @@ dependencies = [ "prost", "regex", "reqwest", - "rustls 0.23.5", - "rustls-pemfile 2.1.2", + "rustls", + "rustls-pemfile", "serde", "serde_json", "stat_common", "sysinfo", "tokio", - "tokio-rustls 0.26.0", + "tokio-rustls", "tonic", "tower", "url", - "webpki-roots 0.26.1", + "webpki-roots", ] [[package]] @@ -2444,13 +2359,13 @@ name = "stat_server" version = "1.8.1" dependencies = [ "anyhow", - "axum 0.7.5", + "axum", "axum-extra", "bytes", "chrono", "clap", "futures-util", - "hyper 1.3.1", + "hyper", "jsonwebtoken", "lazy_static", "lettre", @@ -2465,13 +2380,13 @@ dependencies = [ "reqwest", "rhai", "rust-embed", - "rustls-pemfile 2.1.2", + "rustls-pemfile", "rustls-pki-types", "serde", "serde_json", "stat_common", "tokio", - "tokio-rustls 0.26.0", + "tokio-rustls", "toml", "tonic", "tower-http", @@ -2499,9 +2414,9 @@ checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "syn" -version = "2.0.60" +version = "2.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" +checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a" dependencies = [ "proc-macro2", "quote", @@ -2510,62 +2425,36 @@ dependencies = [ [[package]] name = "sync_wrapper" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" - -[[package]] -name = "sync_wrapper" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" - -[[package]] -name = "sysinfo" -version = "0.30.11" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87341a165d73787554941cd5ef55ad728011566fe714e987d1b976c15dbc3a83" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" dependencies = [ - "cfg-if", - "core-foundation-sys", - "libc", - "ntapi", - "once_cell", - "rayon", - "windows", + "futures-core", ] [[package]] -name = "system-configuration" -version = "0.5.1" +name = "synstructure" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "system-configuration-sys", + "proc-macro2", + "quote", + "syn", ] [[package]] -name = "system-configuration-sys" -version = "0.5.0" +name = "sysinfo" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +checksum = "fe840c5b1afe259a5657392a4dbb74473a14c8db999c3ec2f4ae812e028a94da" dependencies = [ - "core-foundation-sys", "libc", -] - -[[package]] -name = "tempfile" -version = "3.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" -dependencies = [ - "cfg-if", - "fastrand", - "rustix", - "windows-sys 0.52.0", + "memchr", + "ntapi", + "objc2-core-foundation", + "objc2-io-kit", + "windows", ] [[package]] @@ -2603,7 +2492,16 @@ version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.58", +] + +[[package]] +name = "thiserror" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" +dependencies = [ + "thiserror-impl 2.0.18", ] [[package]] @@ -2617,6 +2515,17 @@ dependencies = [ "syn", ] +[[package]] +name = "thiserror-impl" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "time" version = "0.3.36" @@ -2657,6 +2566,16 @@ dependencies = [ "crunchy", ] +[[package]] +name = "tinystr" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinyvec" version = "1.6.0" @@ -2674,38 +2593,26 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.37.0" +version = "1.49.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +checksum = "72a2903cd7736441aac9df9d7688bd0ce48edccaadf181c3b90be801e81d3d86" dependencies = [ - "backtrace", "bytes", "libc", "mio", - "num_cpus", "parking_lot", "pin-project-lite", "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys 0.48.0", -] - -[[package]] -name = "tokio-io-timeout" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" -dependencies = [ - "pin-project-lite", - "tokio", + "windows-sys 0.61.2", ] [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5" dependencies = [ "proc-macro2", "quote", @@ -2714,53 +2621,19 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.24.1" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" dependencies = [ - "rustls 0.21.11", - "tokio", -] - -[[package]] -name = "tokio-rustls" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" -dependencies = [ - "rustls 0.22.4", - "rustls-pki-types", - "tokio", -] - -[[package]] -name = "tokio-rustls" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" -dependencies = [ - "rustls 0.23.5", - "rustls-pki-types", - "tokio", -] - -[[package]] -name = "tokio-socks" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51165dfa029d2a65969413a6cc96f354b86b464498702f174a4efa13608fd8c0" -dependencies = [ - "either", - "futures-util", - "thiserror", + "rustls", "tokio", ] [[package]] name = "tokio-stream" -version = "0.1.15" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +checksum = "32da49809aab5c3bc678af03902d4ccddea2a87d028d86392a4b1560c6906c70" dependencies = [ "futures-core", "pin-project-lite", @@ -2783,96 +2656,97 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.12" +version = "0.9.11+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" +checksum = "f3afc9a848309fe1aaffaed6e1546a7a14de1f935dc9d89d32afd9a44bab7c46" dependencies = [ - "serde", + "indexmap", + "serde_core", "serde_spanned", "toml_datetime", - "toml_edit", + "toml_parser", + "toml_writer", + "winnow", ] [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.7.5+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" dependencies = [ - "serde", + "serde_core", ] [[package]] -name = "toml_edit" -version = "0.22.12" +name = "toml_parser" +version = "1.0.6+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3328d4f68a705b2a4498da1d580585d39a6510f98318a2cec3018a7ec61ddef" +checksum = "a3198b4b0a8e11f09dd03e133c0280504d0801269e9afa46362ffde1cbeebf44" dependencies = [ - "indexmap 2.2.6", - "serde", - "serde_spanned", - "toml_datetime", "winnow", ] +[[package]] +name = "toml_writer" +version = "1.0.6+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab16f14aed21ee8bfd8ec22513f7287cd4a91aa92e44edfe2c17ddd004e92607" + [[package]] name = "tonic" -version = "0.11.0" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76c4eb7a4e9ef9d4763600161f12f5070b92a578e1b634db88a6887844c91a13" +checksum = "a286e33f82f8a1ee2df63f4fa35c0becf4a85a0cb03091a15fd7bf0b402dc94a" dependencies = [ - "async-stream", "async-trait", - "axum 0.6.20", - "base64 0.21.7", + "axum", + "base64 0.22.0", "bytes", "flate2", - "h2 0.3.26", - "http 0.2.12", - "http-body 0.4.6", - "hyper 0.14.28", + "h2", + "http", + "http-body", + "http-body-util", + "hyper", "hyper-timeout", + "hyper-util", "percent-encoding", "pin-project", - "prost", - "rustls-pemfile 2.1.2", - "rustls-pki-types", + "socket2", + "sync_wrapper", "tokio", - "tokio-rustls 0.25.0", "tokio-stream", "tower", "tower-layer", "tower-service", "tracing", - "webpki-roots 0.26.1", ] [[package]] name = "tonic-build" -version = "0.11.0" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4ef6dd70a610078cb4e338a0f79d06bc759ff1b22d2120c2ff02ae264ba9c2" +checksum = "27aac809edf60b741e2d7db6367214d078856b8a5bff0087e94ff330fb97b6fc" dependencies = [ "prettyplease", "proc-macro2", - "prost-build", "quote", "syn", ] [[package]] name = "tower" -version = "0.4.13" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" dependencies = [ "futures-core", "futures-util", - "indexmap 1.9.3", - "pin-project", + "indexmap", "pin-project-lite", - "rand", "slab", + "sync_wrapper", "tokio", "tokio-util", "tower-layer", @@ -2882,31 +2756,38 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.5.2" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" +checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" dependencies = [ - "bitflags 2.5.0", + "async-compression", + "bitflags 2.10.0", "bytes", - "http 1.1.0", - "http-body 1.0.0", + "futures-core", + "futures-util", + "http", + "http-body", "http-body-util", + "iri-string", "pin-project-lite", + "tokio", + "tokio-util", + "tower", "tower-layer", "tower-service", ] [[package]] name = "tower-layer" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[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" @@ -2961,12 +2842,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - [[package]] name = "unicode-ident" version = "1.0.12" @@ -2974,19 +2849,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] -name = "unicode-normalization" -version = "0.1.23" +name = "unicode-width" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" -dependencies = [ - "tinyvec", -] +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "unicode-width" -version = "0.1.11" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" [[package]] name = "untrusted" @@ -2996,15 +2868,22 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.0" +version = "2.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" dependencies = [ "form_urlencoded", "idna", "percent-encoding", + "serde", ] +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" version = "0.2.1" @@ -3013,12 +2892,12 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "1.8.0" +version = "1.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" +checksum = "ee48d38b119b0cd71fe4141b30f5ba9c7c5d9f4e7a3a8b4a674e4b6ef789976f" dependencies = [ - "getrandom", - "serde", + "getrandom 0.3.4", + "serde_core", ] [[package]] @@ -3053,27 +2932,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] -name = "wasm-bindgen" -version = "0.2.92" +name = "wasip2" +version = "1.0.2+wasi-0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" dependencies = [ - "cfg-if", - "wasm-bindgen-macro", + "wit-bindgen", ] [[package]] -name = "wasm-bindgen-backend" -version = "0.2.92" +name = "wasm-bindgen" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "64024a30ec1e37399cf85a7ffefebdb72205ca1c972291c51512360d90bd8566" dependencies = [ - "bumpalo", - "log", + "cfg-if", "once_cell", - "proc-macro2", - "quote", - "syn", + "rustversion", + "wasm-bindgen-macro", "wasm-bindgen-shared", ] @@ -3091,9 +2967,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "008b239d9c740232e71bd39e8ef6429d27097518b6b30bdf9086833bd5b6d608" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3101,22 +2977,25 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "5256bae2d58f54820e6490f9839c49780dff84c65aeab9e772f15d5f0e913a55" dependencies = [ + "bumpalo", "proc-macro2", "quote", "syn", - "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "1f01b580c9ac74c8d8f0c0e4afb04eeef2acf145458e52c03845ee9cd23e3d12" +dependencies = [ + "unicode-ident", +] [[package]] name = "wasm-streams" @@ -3142,30 +3021,31 @@ dependencies = [ ] [[package]] -name = "webpki-roots" -version = "0.25.4" +name = "web-time" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] [[package]] -name = "webpki-roots" -version = "0.26.1" +name = "webpki-root-certs" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3de34ae270483955a94f4b21bdaaeb83d508bb84a01435f393818edb0012009" +checksum = "36a29fc0408b113f68cf32637857ab740edfafdf460c326cd2afaa2d84cc05dc" dependencies = [ "rustls-pki-types", ] [[package]] -name = "which" -version = "4.4.2" +name = "webpki-roots" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +checksum = "12bed680863276c63889429bfd6cab3b99943659923822de1c8a39c49e4d722c" dependencies = [ - "either", - "home", - "once_cell", - "rustix", + "rustls-pki-types", ] [[package]] @@ -3201,12 +3081,23 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.52.0" +version = "0.62.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" +checksum = "527fadee13e0c05939a6a05d5bd6eec6cd2e3dbd648b9f8e447c6518133d8580" dependencies = [ - "windows-core", - "windows-targets 0.52.5", + "windows-collections", + "windows-core 0.62.2", + "windows-future", + "windows-numerics", +] + +[[package]] +name = "windows-collections" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b2d95af1a8a14a3c7367e1ed4fc9c20e0a26e79551b1454d72583c97cc6610" +dependencies = [ + "windows-core 0.62.2", ] [[package]] @@ -3218,13 +3109,93 @@ dependencies = [ "windows-targets 0.52.5", ] +[[package]] +name = "windows-core" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-future" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb" +dependencies = [ + "windows-core 0.62.2", + "windows-link", + "windows-threading", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-numerics" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e2e40844ac143cdb44aead537bbf727de9b044e107a0f1220392177d15b0f26" +dependencies = [ + "windows-core 0.62.2", + "windows-link", +] + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link", +] + [[package]] name = "windows-sys" -version = "0.48.0" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" dependencies = [ - "windows-targets 0.48.5", + "windows-targets 0.42.2", ] [[package]] @@ -3236,6 +3207,39 @@ dependencies = [ "windows-targets 0.52.5", ] +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.5", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + [[package]] name = "windows-targets" version = "0.48.5" @@ -3260,13 +3264,45 @@ dependencies = [ "windows_aarch64_gnullvm 0.52.5", "windows_aarch64_msvc 0.52.5", "windows_i686_gnu 0.52.5", - "windows_i686_gnullvm", + "windows_i686_gnullvm 0.52.5", "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", ] +[[package]] +name = "windows-targets" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm 0.53.1", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", +] + +[[package]] +name = "windows-threading" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3949bd5b99cafdf1c7ca86b43ca564028dfe27d66958f2470940f73d86d75b37" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -3279,6 +3315,18 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -3291,6 +3339,18 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -3303,12 +3363,30 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" +[[package]] +name = "windows_i686_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + [[package]] name = "windows_i686_gnullvm" version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -3321,6 +3399,18 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +[[package]] +name = "windows_i686_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -3333,6 +3423,18 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -3345,6 +3447,18 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -3357,23 +3471,51 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" + [[package]] name = "winnow" -version = "0.6.6" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c976aaaa0e1f90dbb21e9587cdaf1d9679a1cde8875c0d6bd83ab96a208352" +checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829" + +[[package]] +name = "wit-bindgen" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" + +[[package]] +name = "writeable" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" + +[[package]] +name = "yoke" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954" dependencies = [ - "memchr", + "stable_deref_trait", + "yoke-derive", + "zerofrom", ] [[package]] -name = "winreg" -version = "0.50.0" +name = "yoke-derive" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" dependencies = [ - "cfg-if", - "windows-sys 0.48.0", + "proc-macro2", + "quote", + "syn", + "synstructure", ] [[package]] @@ -3396,8 +3538,68 @@ dependencies = [ "syn", ] +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + [[package]] name = "zeroize" -version = "1.7.0" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" + +[[package]] +name = "zerotrie" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zmij" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "02aae0f83f69aafc94776e879363e9771d7ecbffe2c7fbb6c14c5e00dfe88439" diff --git a/client/Cargo.toml b/client/Cargo.toml index d234a0e4..27357928 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -17,36 +17,36 @@ repository = "https://github.com/zdz/ServerStatus-Rust" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [build-dependencies] -chrono = "0.4" +chrono = "0.4.43" [dependencies] -anyhow = "1" -bytes = {version = "1", features = ["serde"]} -chrono = "0.4" -clap = {version = "4.5", features = ["derive", "unicode", "env"]} -fastrand = "2.0.1" -hyper = {version = "1.2", features = ["full"]} -lazy_static = "1.4" -log = "0.4" -md5 = "0.7.0" -once_cell = "1" -pretty_env_logger = "0.5" -prettytable-rs = "^0.10" -prost = "0.12" -regex = "1.10" -reqwest = {version = "0.11", features = ["json", "rustls-tls", "brotli", "gzip", "deflate", "stream", "socks"], default-features = false} -rustls = { version = "0.23.5", default-features = false } -rustls-pemfile = { version = "2" } -serde = {version = "1.0", default-features = false, features = ["derive", "alloc"]} -serde_json = {version = "1.0", default-features = false, features = ["alloc"]} +anyhow = "1.0.100" +bytes = {version = "1.11.0", features = ["serde"]} +chrono = "0.4.43" +clap = {version = "4.5.55", features = ["derive", "unicode", "env"]} +fastrand = "2.3.0" +hyper = {version = "1.8.1", features = ["full"]} +lazy_static = "1.5.0" +log = "0.4.29" +md5 = "0.8.0" +once_cell = "1.21.3" +pretty_env_logger = "0.5.0" +prettytable-rs = "^0.10.0" +prost = "0.14.3" +regex = "1.12.2" +reqwest = {version = "0.13.1", features = ["json", "rustls", "brotli", "gzip", "deflate", "stream", "socks"], default-features = false} +rustls = { version = "0.23.36", default-features = false } +rustls-pemfile = { version = "2.2.0" } +serde = {version = "1.0.228", default-features = false, features = ["derive", "alloc"]} +serde_json = {version = "1.0.149", default-features = false, features = ["alloc"]} stat_common = {path = "../common", version = "1.1.4"} -sysinfo = "0.30.7" -tokio = {version = "1", features = ["full"]} -tokio-rustls = { version = "0.26" } -tonic = {version = "0.11", features = ["tls", "tls-webpki-roots", "gzip"]} -tower = { version = "0.4" } -webpki-roots = "0.26" -url = "2.5.0" +sysinfo = "0.38.0" +tokio = {version = "1.49.0", features = ["full"]} +tokio-rustls = { version = "0.26.4" } +tonic = {version = "0.14.3", features = ["gzip"]} +tower = { version = "0.5.3" } +webpki-roots = "1.0.5" +url = "2.5.8" [features] default = ["sysinfo"] diff --git a/client/src/grpc.rs b/client/src/grpc.rs index 8b5e2578..43129dc0 100644 --- a/client/src/grpc.rs +++ b/client/src/grpc.rs @@ -2,7 +2,7 @@ use std::str::FromStr; use std::thread; use std::time::Duration; -use tonic::transport::{Certificate, Channel, ClientTlsConfig, Identity}; +use tonic::transport::Channel; use tonic::{metadata::MetadataValue, Request}; use tower::timeout::Timeout; use url::Url; @@ -13,6 +13,15 @@ use stat_common::server_status::StatRequest; use crate::sample_all; use crate::Args; +// ===== 新增导入 ===== +use rustls::{ + ClientConfig, RootCertStore, + pki_types::{CertificateDer, PrivateKeyDer} +}; +use rustls_pemfile::{certs, pkcs8_private_keys}; +use std::sync::Arc; +use std::io::BufReader; + pub async fn report(args: &Args, stat_base: &mut StatRequest) -> anyhow::Result<()> { let auth_user: String; let ssr_auth: &[u8]; @@ -26,39 +35,61 @@ pub async fn report(args: &Args, stat_base: &mut StatRequest) -> anyhow::Result< let token = MetadataValue::try_from(format!("{}@_@{}", auth_user, args.pass))?; let addr = args.addr.replace("grpcs://", "https://"); - let channel: Channel; - // mTLS - if args.mtls { - let u = Url::parse(addr.as_str())?; + let u = Url::parse(&addr)?; + let client_config = if args.mtls { + // ===== mTLS 模式 ===== let tls_dir = std::path::PathBuf::from_str(&args.tls_dir)?; - let ca = std::fs::read_to_string(tls_dir.join("ca.pem"))?; - let client_cert = std::fs::read_to_string(tls_dir.join("client.pem"))?; - let client_key = std::fs::read_to_string(tls_dir.join("client.key"))?; - let client_identity = Identity::from_pem(client_cert, client_key); - let ca = Certificate::from_pem(ca); + + // 加载 CA 证书 + let ca_pem = std::fs::read_to_string(tls_dir.join("ca.pem"))?; + let mut root_store = RootCertStore::empty(); + for cert_result in certs(&mut BufReader::new(ca_pem.as_bytes())) { + let cert = cert_result?; + root_store.add(CertificateDer::from(cert))?; + } - let tls = ClientTlsConfig::new() - .domain_name(u.host_str().expect("invalid domain")) - .ca_certificate(ca) - .identity(client_identity); - channel = Channel::from_shared(addr)?.tls_config(tls)?.connect().await?; - } else { - // TLS - if addr.starts_with("https://") { - let tls = ClientTlsConfig::new(); - channel = Channel::from_shared(addr)?.tls_config(tls)?.connect().await?; - } else { - channel = Channel::from_shared(addr)?.connect().await?; + // 加载客户端证书 + let client_cert_pem = std::fs::read_to_string(tls_dir.join("client.pem"))?; + let client_certs: Vec = certs(&mut BufReader::new(client_cert_pem.as_bytes()))? + .into_iter() + .map(CertificateDer::from) + .collect(); + + // 加载客户端私钥 (PKCS#8) + let client_key_pem = std::fs::read_to_string(tls_dir.join("client.key"))?; + let keys: Vec> = pkcs8_private_keys(&mut BufReader::new(client_key_pem.as_bytes()))?; + if keys.is_empty() { + anyhow::bail!("No PKCS#8 private key found in client.key"); } - } + let client_key = PrivateKeyDer::Pkcs8(keys[0].clone().into()); + + ClientConfig::builder() + .with_root_certificates(root_store) + .with_client_auth_cert(client_certs, client_key)? + } else if addr.starts_with("https://") { + // ===== 普通 TLS 模式 ===== + let mut root_store = RootCertStore::empty(); + root_store.extend(webpki_roots::TLS_SERVER_ROOTS.iter().cloned()); + ClientConfig::builder() + .with_root_certificates(root_store) + .with_no_client_auth() + } else { + // 明文 gRPC(不推荐,但保留兼容性) + anyhow::bail!("Plaintext gRPC is not supported. Use grpcs:// or enable mTLS."); + }; + + // ✅ 关键:使用 https:// + .tls_config(Arc::new(...)) + let channel = Channel::from_shared(addr)? + .tls_config(Arc::new(client_config))? // ← 这个方法仍然存在! + .connect() + .await?; let timeout_channel = Timeout::new(channel, Duration::from_millis(3000)); let grpc_client = ServerStatusClient::with_interceptor(timeout_channel, move |mut req: Request<()>| { req.metadata_mut().insert("authorization", token.clone()); req.metadata_mut() .insert("ssr-auth", MetadataValue::try_from(ssr_auth).unwrap()); - Ok(req) }); @@ -68,7 +99,6 @@ pub async fn report(args: &Args, stat_base: &mut StatRequest) -> anyhow::Result< tokio::spawn(async move { let request = tonic::Request::new(stat_rt); - match client.report(request).await { Ok(resp) => { info!("grpc report resp => {:?}", resp); @@ -81,4 +111,4 @@ pub async fn report(args: &Args, stat_base: &mut StatRequest) -> anyhow::Result< thread::sleep(Duration::from_secs(args.report_interval)); } -} +} \ No newline at end of file diff --git a/client/src/sys_info.rs b/client/src/sys_info.rs index 7652dabf..debadefa 100644 --- a/client/src/sys_info.rs +++ b/client/src/sys_info.rs @@ -10,7 +10,7 @@ use std::thread; use std::time::Duration; use sysinfo::CpuRefreshKind; use sysinfo::{Components, Disks, MemoryRefreshKind, Networks, RefreshKind, System}; - +use std::env::consts::ARCH; use crate::status; use crate::vnstat; use crate::Args; @@ -45,11 +45,11 @@ lazy_static! { pub static ref G_CPU_PERCENT: Arc> = Arc::new(Default::default()); } pub fn start_cpu_percent_collect_t() { - let mut sys = System::new_with_specifics(RefreshKind::new().with_cpu(CpuRefreshKind::new().with_cpu_usage())); + let mut sys = System::new_with_specifics(RefreshKind::nothing().with_cpu(CpuRefreshKind::nothing().with_cpu_usage())); thread::spawn(move || loop { sys.refresh_cpu(); - let global_cpu = sys.global_cpu_info(); + let global_cpu = sys.global_cpu_usage(); if let Ok(mut cpu_percent) = G_CPU_PERCENT.lock() { *cpu_percent = global_cpu.cpu_usage().round() as f64; } @@ -86,7 +86,7 @@ pub fn start_net_speed_collect_t(args: &Args) { t.net_tx = net_tx; } - networks.refresh_list(); + networks.refresh(true); thread::sleep(Duration::from_millis(SAMPLE_PERIOD)); }); } @@ -105,7 +105,7 @@ pub fn sample(args: &Args, stat: &mut StatRequest) { unit = 1000; } - let mut sys = System::new_with_specifics(RefreshKind::new().with_memory(MemoryRefreshKind::everything())); + let mut sys = System::new_with_specifics(RefreshKind::nothing().with_memory(MemoryRefreshKind::everything())); // uptime stat.uptime = System::uptime(); @@ -132,7 +132,8 @@ pub fn sample(args: &Args, stat: &mut StatRequest) { let (mut hdd_total, mut hdd_avail) = (0_u64, 0_u64); #[cfg(not(target_os = "windows"))] - let mut uniq_disk_set = HashSet::new(); + // let mut uniq_disk_set = HashSet::new(); + let mut uniq_disk_set: HashSet = HashSet::new(); let disks = Disks::new_with_refreshed_list(); for disk in &disks { @@ -149,10 +150,14 @@ pub fn sample(args: &Args, stat: &mut StatRequest) { if G_EXPECT_FS.iter().any(|&k| fs.contains(k)) { #[cfg(not(target_os = "windows"))] { - if uniq_disk_set.contains(disk.name()) { + // if uniq_disk_set.contains(disk.name()) { + // continue; + let disk_name = disk.name().to_string_lossy().to_string(); + if uniq_disk_set.contains(&disk_name) { continue; } - uniq_disk_set.insert(disk.name()); + // uniq_disk_set.insert(disk.name()); + uniq_disk_set.insert(disk_name); } hdd_total += disk.total_space(); @@ -233,7 +238,7 @@ pub fn collect_sys_info(args: &Args) -> SysInfo { let mut info_pb = SysInfo::default(); let mut sys = System::new(); - sys.refresh_cpu(); + sys.refresh_cpu_all(); info_pb.name = args.user.to_owned(); info_pb.version = env!("CARGO_PKG_VERSION").to_string(); @@ -345,7 +350,7 @@ pub fn print_sysinfo() { system_t.add_row(row!["Long OS version", System::long_os_version().unwrap_or_default()]); system_t.add_row(row!["Distribution ID", System::distribution_id()]); system_t.add_row(row!["Host name", System::host_name().unwrap_or_default()]); - system_t.add_row(row!["CPU arch", System::cpu_arch().unwrap_or_default()]); + system_t.add_row(row!["CPU arch", ARCH]); let mut cpu_t = Table::new(); cpu_t.set_format(*prettytable::format::consts::FORMAT_NO_BORDER_LINE_SEPARATOR); diff --git a/common/Cargo.toml b/common/Cargo.toml index d0150751..9674b853 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -15,16 +15,16 @@ repository = "https://github.com/zdz/ServerStatus-Rust" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -bytes = {version = "1", features = ["serde"]} -prost = "0.12" -serde = {version = "1.0", default-features = false, features = ["derive", "alloc"]} -tonic = {version = "0.11", features = ["tls"]} +bytes = {version = "1.11.0", features = ["serde"]} +prost = "0.14.3" +serde = {version = "1.0.228", default-features = false, features = ["derive", "alloc"]} +tonic = {version = "0.14.3"} [target.'cfg(not(target_env = "msvc"))'.build-dependencies] -chrono = "0.4" -protobuf-src = "1" -tonic-build = "0.11" +chrono = "0.4.43" +protobuf-src = "2.1.1" +tonic-build = "0.14.3" [build-dependencies] -chrono = "0.4" -tonic-build = "0.11" +chrono = "0.4.43" +tonic-build = "0.14.3" diff --git a/common/build.rs b/common/build.rs index 5b6f643b..e8d0e86d 100644 --- a/common/build.rs +++ b/common/build.rs @@ -24,9 +24,7 @@ fn main() { #[cfg(not(target_env = "msvc"))] std::env::set_var("PROTOC", protobuf_src::protoc()); - - tonic_build::configure() - .type_attribute(".", "#[derive(serde::Serialize, serde::Deserialize)]") - .compile(&["proto/server_status.proto"], &["proto"]) - .unwrap(); + + tonic_build::compile_protos("proto/server_status.proto") + .unwrap_or_else(|e| panic!("Failed to compile protos: {}", e)); } diff --git a/server/Cargo.toml b/server/Cargo.toml index 79277fcc..1bd8f237 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -17,43 +17,43 @@ repository = "https://github.com/zdz/ServerStatus-Rust" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [build-dependencies] -chrono = "0.4" +chrono = "0.4.43" [dependencies] -anyhow = "1" -axum = {version = "0.7.4"} -axum-extra = {version = "0.9.2", features = ["typed-header"]} -bytes = {version = "1", features = ["serde"]} -chrono = "0.4" -clap = {version = "4.5", features = ["derive", "unicode"]} -futures-util = {version = "0.3", default-features = false} -hyper = {version = "1.2", features = ["full"]} -jsonwebtoken = "9.2" -lazy_static = "1.4" -lettre = {version = "0.11", default-features = false, features = ["smtp-transport", "pool", "hostname", "builder", "rustls-tls", "tokio1-rustls-tls"]} -log = "0.4" -md5 = "0.7.0" -minijinja = {version = "1.0", features = ["json", "loader"]} -mime_guess = { version = "2" } -once_cell = "1" -pki-types = { package = "rustls-pki-types", version = "1" } -pretty_env_logger = "0.5" -prettytable-rs = "^0.10" -prost = "0.12" -reqwest = {version = "0.11", features = ["json", "rustls-tls"], default-features = false} -rhai = {version = "1.17", features = ["sync", "metadata", "decimal", "no_function", "no_module", "no_closure", "unchecked"]} -rust-embed = {version = "8.3", features = ["mime-guess"]} -rustls-pemfile = { version = "2" } -serde = {version = "1.0", default-features = false, features = ["derive", "alloc"]} -serde_json = {version = "1.0", default-features = false, features = ["alloc"]} +anyhow = "1.0.100" +axum = {version = "0.8.8"} +axum-extra = {version = "0.12.5", features = ["typed-header"]} +bytes = {version = "1.11.0", features = ["serde"]} +chrono = "0.4.43" +clap = {version = "4.5.55", features = ["derive", "unicode"]} +futures-util = {version = "0.3.31", default-features = false} +hyper = {version = "1.8.1", features = ["full"]} +jsonwebtoken = "10.3.0" +lazy_static = "1.5.0" +lettre = {version = "0.11.19", default-features = false, features = ["smtp-transport", "pool", "hostname", "builder", "rustls-tls", "tokio1-rustls-tls"]} +log = "0.4.29" +md5 = "0.8.0" +minijinja = {version = "2.15.1", features = ["json", "loader"]} +mime_guess = { version = "2.0.5" } +once_cell = "1.21.3" +pki-types = { package = "rustls-pki-types", version = "1.14.0" } +pretty_env_logger = "0.5.0" +prettytable-rs = "^0.10.0" +prost = "0.14.3" +reqwest = {version = "0.13.1", features = ["json", "rustls"], default-features = false} +rhai = {version = "1.24.0", features = ["sync", "metadata", "decimal", "no_function", "no_module", "no_closure", "unchecked"]} +rust-embed = {version = "8.11.0", features = ["mime-guess"]} +rustls-pemfile = { version = "2.2.0" } +serde = {version = "1.0.228", default-features = false, features = ["derive", "alloc"]} +serde_json = {version = "1.0.149", default-features = false, features = ["alloc"]} stat_common = {path = "../common", version = "1.1.4"} -tokio = {version = "1", features = ["full"]} -tokio-rustls = { version = "0.26" } -toml = "0.8" -tonic = {version = "0.11", features = ["tls", "tls-webpki-roots", "gzip"]} -tower-http = { version = "0.5", features = ["cors", "add-extension"] } -url = "2.5.0" -uuid = {version = "1.7", default-features = false, features = ["serde", "v4"]} +tokio = {version = "1.49.0", features = ["full"]} +tokio-rustls = { version = "0.26.4" } +toml = "0.9.8" +tonic = "0.14.3" +tower-http = { version = "0.6.8", features = ["cors", "add-extension"] } +url = "2.5.8" +uuid = {version = "1.20.0", default-features = false, features = ["serde", "v4"]} [package.metadata.deb] maintainer = "zdz " From a7a804d07f9c00981a2b55fcbb4cde6feb8f7e29 Mon Sep 17 00:00:00 2001 From: smallerqiu Date: Fri, 30 Jan 2026 17:40:12 +0800 Subject: [PATCH 02/12] =?UTF-8?q?feat:=20=20=E5=8D=87=E7=BA=A7=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=E5=88=B0=E6=9C=80=E6=96=B0=E7=89=88=E6=9C=AC=E5=B9=B6?= =?UTF-8?q?=E9=80=82=E9=85=8D,=20=E4=BF=AE=E5=A4=8D=E7=A3=81=E7=9B=98?= =?UTF-8?q?=E8=AF=BB=E5=8F=96=E6=8C=82=E5=9C=A8=E9=97=AE=E9=A2=98.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.lock | 172 ++++++++++++++++++++++++++++++++++++++++- client/Cargo.toml | 7 +- client/src/grpc.rs | 78 ++++++------------- client/src/sys_info.rs | 69 ++++++++++------- common/Cargo.toml | 10 ++- common/build.rs | 9 ++- server/Cargo.toml | 6 +- server/src/auth.rs | 4 - server/src/jwt.rs | 2 - 9 files changed, 256 insertions(+), 101 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index de69b4f8..603cbee0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -137,9 +137,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.80" +version = "0.1.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" +checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" dependencies = [ "proc-macro2", "quote", @@ -638,6 +638,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + [[package]] name = "fastrand" version = "2.3.0" @@ -650,6 +660,12 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8591b0bcc8a98a64310a2fae1bb3e9b8564dd10e381e6e28010fde8e8e8568db" +[[package]] +name = "fixedbitset" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" + [[package]] name = "flate2" version = "1.0.28" @@ -666,6 +682,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + [[package]] name = "form_urlencoded" version = "1.2.2" @@ -808,6 +830,15 @@ dependencies = [ "allocator-api2", ] +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "foldhash", +] + [[package]] name = "hashbrown" version = "0.16.1" @@ -1274,6 +1305,12 @@ dependencies = [ "libc", ] +[[package]] +name = "linux-raw-sys" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" + [[package]] name = "litemap" version = "0.8.1" @@ -1374,6 +1411,12 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "multimap" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d87ecb2933e8aeadb3e3a02b828fed80a7528047e68b4f424523a0981a3a084" + [[package]] name = "no-std-compat" version = "0.4.1" @@ -1509,6 +1552,17 @@ version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" +[[package]] +name = "petgraph" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8701b58ea97060d5e5b155d383a69952a60943f0e6dfe30b04c287beb0b27455" +dependencies = [ + "fixedbitset", + "hashbrown 0.15.5", + "indexmap", +] + [[package]] name = "pin-project" version = "1.1.5" @@ -1621,6 +1675,27 @@ dependencies = [ "prost-derive", ] +[[package]] +name = "prost-build" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "343d3bd7056eda839b03204e68deff7d1b13aba7af2b2fd16890697274262ee7" +dependencies = [ + "heck", + "itertools", + "log", + "multimap", + "petgraph", + "prettyplease", + "prost", + "prost-types", + "pulldown-cmark", + "pulldown-cmark-to-cmark", + "regex", + "syn", + "tempfile", +] + [[package]] name = "prost-derive" version = "0.14.3" @@ -1634,6 +1709,15 @@ dependencies = [ "syn", ] +[[package]] +name = "prost-types" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8991c4cbdb8bc5b11f0b074ffe286c30e523de90fee5ba8132f1399f23cb3dd7" +dependencies = [ + "prost", +] + [[package]] name = "protobuf-src" version = "2.1.1+27.1" @@ -1652,6 +1736,26 @@ dependencies = [ "cc", ] +[[package]] +name = "pulldown-cmark" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e8bbe1a966bd2f362681a44f6edce3c2310ac21e4d5067a6e7ec396297a6ea0" +dependencies = [ + "bitflags 2.10.0", + "memchr", + "unicase", +] + +[[package]] +name = "pulldown-cmark-to-cmark" +version = "22.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50793def1b900256624a709439404384204a5dc3a6ec580281bfaac35e882e90" +dependencies = [ + "pulldown-cmark", +] + [[package]] name = "quinn" version = "0.11.9" @@ -1954,6 +2058,19 @@ version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" +[[package]] +name = "rustix" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34" +dependencies = [ + "bitflags 2.10.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.61.2", +] + [[package]] name = "rustls" version = "0.23.36" @@ -2328,6 +2445,7 @@ dependencies = [ "regex", "reqwest", "rustls", + "rustls-native-certs", "rustls-pemfile", "serde", "serde_json", @@ -2336,6 +2454,9 @@ dependencies = [ "tokio", "tokio-rustls", "tonic", + "tonic-build", + "tonic-prost", + "tonic-prost-build", "tower", "url", "webpki-roots", @@ -2348,10 +2469,13 @@ dependencies = [ "bytes", "chrono", "prost", + "prost-build", "protobuf-src", "serde", "tonic", "tonic-build", + "tonic-prost", + "tonic-prost-build", ] [[package]] @@ -2359,6 +2483,7 @@ name = "stat_server" version = "1.8.1" dependencies = [ "anyhow", + "async-trait", "axum", "axum-extra", "bytes", @@ -2389,6 +2514,8 @@ dependencies = [ "tokio-rustls", "toml", "tonic", + "tonic-prost", + "tonic-prost-build", "tower-http", "url", "uuid", @@ -2457,6 +2584,19 @@ dependencies = [ "windows", ] +[[package]] +name = "tempfile" +version = "3.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "655da9c7eb6305c55742045d5a8d2037996d61d8de95806335c7c86ce0f82e9c" +dependencies = [ + "fastrand", + "getrandom 0.3.4", + "once_cell", + "rustix", + "windows-sys 0.61.2", +] + [[package]] name = "term" version = "0.7.0" @@ -2716,6 +2856,7 @@ dependencies = [ "socket2", "sync_wrapper", "tokio", + "tokio-rustls", "tokio-stream", "tower", "tower-layer", @@ -2735,6 +2876,33 @@ dependencies = [ "syn", ] +[[package]] +name = "tonic-prost" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6c55a2d6a14174563de34409c9f92ff981d006f56da9c6ecd40d9d4a31500b0" +dependencies = [ + "bytes", + "prost", + "tonic", +] + +[[package]] +name = "tonic-prost-build" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4556786613791cfef4ed134aa670b61a85cfcacf71543ef33e8d801abae988f" +dependencies = [ + "prettyplease", + "proc-macro2", + "prost-build", + "prost-types", + "quote", + "syn", + "tempfile", + "tonic-build", +] + [[package]] name = "tower" version = "0.5.3" diff --git a/client/Cargo.toml b/client/Cargo.toml index 27357928..5041abca 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -18,6 +18,8 @@ repository = "https://github.com/zdz/ServerStatus-Rust" [build-dependencies] chrono = "0.4.43" +tonic-prost-build = "0.14.3" + [dependencies] anyhow = "1.0.100" @@ -43,10 +45,13 @@ stat_common = {path = "../common", version = "1.1.4"} sysinfo = "0.38.0" tokio = {version = "1.49.0", features = ["full"]} tokio-rustls = { version = "0.26.4" } -tonic = {version = "0.14.3", features = ["gzip"]} +tonic = {version = "0.14.3", features = ["gzip","codegen", "transport","tls-ring"]} tower = { version = "0.5.3" } webpki-roots = "1.0.5" url = "2.5.8" +tonic-build = "0.14.3" +rustls-native-certs="0.8.3" +tonic-prost="0.14.3" [features] default = ["sysinfo"] diff --git a/client/src/grpc.rs b/client/src/grpc.rs index 43129dc0..9172fc1a 100644 --- a/client/src/grpc.rs +++ b/client/src/grpc.rs @@ -2,25 +2,18 @@ use std::str::FromStr; use std::thread; use std::time::Duration; -use tonic::transport::Channel; + use tonic::{metadata::MetadataValue, Request}; use tower::timeout::Timeout; use url::Url; use stat_common::server_status::server_status_client::ServerStatusClient; use stat_common::server_status::StatRequest; - +use tonic::transport::Channel; +use tonic::transport::{ClientTlsConfig,Identity,Certificate}; use crate::sample_all; use crate::Args; -// ===== 新增导入 ===== -use rustls::{ - ClientConfig, RootCertStore, - pki_types::{CertificateDer, PrivateKeyDer} -}; -use rustls_pemfile::{certs, pkcs8_private_keys}; -use std::sync::Arc; -use std::io::BufReader; pub async fn report(args: &Args, stat_base: &mut StatRequest) -> anyhow::Result<()> { let auth_user: String; @@ -35,56 +28,35 @@ pub async fn report(args: &Args, stat_base: &mut StatRequest) -> anyhow::Result< let token = MetadataValue::try_from(format!("{}@_@{}", auth_user, args.pass))?; let addr = args.addr.replace("grpcs://", "https://"); - let u = Url::parse(&addr)?; + let channel: Channel; + if args.mtls { + // === mTLS 模式 === + let u = Url::parse(&addr)?; + let domain_name = u.host_str().ok_or_else(|| anyhow::anyhow!("invalid URL: missing host"))?; - let client_config = if args.mtls { - // ===== mTLS 模式 ===== let tls_dir = std::path::PathBuf::from_str(&args.tls_dir)?; - - // 加载 CA 证书 - let ca_pem = std::fs::read_to_string(tls_dir.join("ca.pem"))?; - let mut root_store = RootCertStore::empty(); - for cert_result in certs(&mut BufReader::new(ca_pem.as_bytes())) { - let cert = cert_result?; - root_store.add(CertificateDer::from(cert))?; - } + let ca_pem = std::fs::read(tls_dir.join("ca.pem"))?; + let client_cert_pem = std::fs::read(tls_dir.join("client.pem"))?; + let client_key_pem = std::fs::read(tls_dir.join("client.key"))?; + let client_identity = Identity::from_pem(client_cert_pem, client_key_pem); + let ca = Certificate::from_pem(ca_pem); - // 加载客户端证书 - let client_cert_pem = std::fs::read_to_string(tls_dir.join("client.pem"))?; - let client_certs: Vec = certs(&mut BufReader::new(client_cert_pem.as_bytes()))? - .into_iter() - .map(CertificateDer::from) - .collect(); - - // 加载客户端私钥 (PKCS#8) - let client_key_pem = std::fs::read_to_string(tls_dir.join("client.key"))?; - let keys: Vec> = pkcs8_private_keys(&mut BufReader::new(client_key_pem.as_bytes()))?; - if keys.is_empty() { - anyhow::bail!("No PKCS#8 private key found in client.key"); - } - let client_key = PrivateKeyDer::Pkcs8(keys[0].clone().into()); - - ClientConfig::builder() - .with_root_certificates(root_store) - .with_client_auth_cert(client_certs, client_key)? + let tls_config = ClientTlsConfig::new() + .domain_name(domain_name) + .ca_certificate(ca) + .identity(client_identity); + + channel = Channel::from_shared(addr)? + .tls_config(tls_config)? + .connect().await?; } else if addr.starts_with("https://") { - // ===== 普通 TLS 模式 ===== - let mut root_store = RootCertStore::empty(); - root_store.extend(webpki_roots::TLS_SERVER_ROOTS.iter().cloned()); - ClientConfig::builder() - .with_root_certificates(root_store) - .with_no_client_auth() + // TLS + let tls_config = ClientTlsConfig::new(); + channel = Channel::from_shared(addr)?.tls_config(tls_config)?.connect().await?; } else { - // 明文 gRPC(不推荐,但保留兼容性) - anyhow::bail!("Plaintext gRPC is not supported. Use grpcs:// or enable mTLS."); + channel = Channel::from_shared(addr)?.connect().await?; }; - // ✅ 关键:使用 https:// + .tls_config(Arc::new(...)) - let channel = Channel::from_shared(addr)? - .tls_config(Arc::new(client_config))? // ← 这个方法仍然存在! - .connect() - .await?; - let timeout_channel = Timeout::new(channel, Duration::from_millis(3000)); let grpc_client = ServerStatusClient::with_interceptor(timeout_channel, move |mut req: Request<()>| { req.metadata_mut().insert("authorization", token.clone()); diff --git a/client/src/sys_info.rs b/client/src/sys_info.rs index debadefa..a7d0ccc0 100644 --- a/client/src/sys_info.rs +++ b/client/src/sys_info.rs @@ -47,11 +47,11 @@ lazy_static! { pub fn start_cpu_percent_collect_t() { let mut sys = System::new_with_specifics(RefreshKind::nothing().with_cpu(CpuRefreshKind::nothing().with_cpu_usage())); thread::spawn(move || loop { - sys.refresh_cpu(); + sys.refresh_cpu_all(); let global_cpu = sys.global_cpu_usage(); if let Ok(mut cpu_percent) = G_CPU_PERCENT.lock() { - *cpu_percent = global_cpu.cpu_usage().round() as f64; + *cpu_percent = global_cpu.round() as f64; } thread::sleep(Duration::from_millis(SAMPLE_PERIOD)); @@ -133,42 +133,51 @@ pub fn sample(args: &Args, stat: &mut StatRequest) { #[cfg(not(target_os = "windows"))] // let mut uniq_disk_set = HashSet::new(); - let mut uniq_disk_set: HashSet = HashSet::new(); + // let mut uniq_disk_set: HashSet = HashSet::new(); + + // ++ + let mut hdd_total_bytes = 0_u64; + let mut hdd_avail_bytes = 0_u64; + let mut seen_phys_disks = HashSet::new(); // 使用挂载点去重,防止 LVM 重复统计 + + stat.disks.clear(); + // ++ let disks = Disks::new_with_refreshed_list(); for disk in &disks { - let di = DiskInfo { - name: disk.name().to_str().unwrap().to_string(), - mount_point: disk.mount_point().to_str().unwrap().to_string(), - file_system: disk.file_system().to_str().unwrap().to_string(), - total: disk.total_space(), - used: disk.total_space() - disk.available_space(), - free: disk.available_space(), - }; - - let fs = di.file_system.to_lowercase(); - if G_EXPECT_FS.iter().any(|&k| fs.contains(k)) { - #[cfg(not(target_os = "windows"))] - { - // if uniq_disk_set.contains(disk.name()) { - // continue; - let disk_name = disk.name().to_string_lossy().to_string(); - if uniq_disk_set.contains(&disk_name) { - continue; - } - // uniq_disk_set.insert(disk.name()); - uniq_disk_set.insert(disk_name); + let mount_point = disk.mount_point().to_string_lossy().to_string(); + let fs_type = disk.file_system().to_string_lossy().to_lowercase(); + let total_space = disk.total_space(); + + if G_EXPECT_FS.iter().any(|&k| fs_type.contains(k)) { + // 唯一标识:总大小 + 文件系统类型 + let disk_id = format!("{}-{}", total_space, fs_type); + // println!("Checking: {} | FS: {} | Size: {} B", mount_point, fs_type, disk.total_space()); + + if !seen_phys_disks.contains(&disk_id) { + seen_phys_disks.insert(disk_id); + + hdd_total_bytes += total_space; + hdd_avail_bytes += disk.available_space(); } - hdd_total += disk.total_space(); - hdd_avail += disk.available_space(); + // 但 stat.disks 列表里可以保留所有挂载点展示 + stat.disks.push(DiskInfo { + name: disk.name().to_string_lossy().to_string(), + mount_point, + file_system: fs_type, + total: total_space, + used: total_space - disk.available_space(), + free: disk.available_space(), + }); } - - stat.disks.push(di); } - stat.hdd_total = hdd_total / unit.pow(2); - stat.hdd_used = (hdd_total - hdd_avail) / unit.pow(2); + stat.hdd_total = (hdd_total_bytes / 1024 / 1024) as u64; + stat.hdd_used = ((hdd_total_bytes - hdd_avail_bytes) / 1024 / 1024) as u64; + + // stat.hdd_total = hdd_total / unit.pow(2); + // stat.hdd_used = (hdd_total - hdd_avail) / unit.pow(2); // t/u/p/d let (t, u, p, d) = if args.disable_tupd { diff --git a/common/Cargo.toml b/common/Cargo.toml index 9674b853..474e30d7 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -15,16 +15,18 @@ repository = "https://github.com/zdz/ServerStatus-Rust" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -bytes = {version = "1.11.0", features = ["serde"]} +tonic = {version = "0.14.3"} prost = "0.14.3" +bytes = {version = "1.11.0", features = ["serde"]} serde = {version = "1.0.228", default-features = false, features = ["derive", "alloc"]} -tonic = {version = "0.14.3"} +tonic-prost="0.14.3" [target.'cfg(not(target_env = "msvc"))'.build-dependencies] chrono = "0.4.43" protobuf-src = "2.1.1" -tonic-build = "0.14.3" +prost-build = "0.14.3" [build-dependencies] chrono = "0.4.43" -tonic-build = "0.14.3" +tonic-build = "0.14.3" +tonic-prost-build="0.14.3" diff --git a/common/build.rs b/common/build.rs index e8d0e86d..409136c9 100644 --- a/common/build.rs +++ b/common/build.rs @@ -1,6 +1,5 @@ use chrono::Utc; use std::process::Command; - fn commit_hash() -> Option { Command::new("git") .args(["rev-parse", "--short", "HEAD"]) @@ -24,7 +23,9 @@ fn main() { #[cfg(not(target_env = "msvc"))] std::env::set_var("PROTOC", protobuf_src::protoc()); - - tonic_build::compile_protos("proto/server_status.proto") - .unwrap_or_else(|e| panic!("Failed to compile protos: {}", e)); + + tonic_prost_build::configure() + .type_attribute(".", "#[derive(serde::Serialize, serde::Deserialize)]") + .compile_protos(&["proto/server_status.proto"], &["proto"]) + .unwrap(); } diff --git a/server/Cargo.toml b/server/Cargo.toml index 1bd8f237..6169ef6a 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -18,6 +18,8 @@ repository = "https://github.com/zdz/ServerStatus-Rust" [build-dependencies] chrono = "0.4.43" +tonic-prost-build = "0.14.3" + [dependencies] anyhow = "1.0.100" @@ -50,10 +52,12 @@ stat_common = {path = "../common", version = "1.1.4"} tokio = {version = "1.49.0", features = ["full"]} tokio-rustls = { version = "0.26.4" } toml = "0.9.8" -tonic = "0.14.3" +tonic = {version="0.14.3",features = ["_tls-any"]} tower-http = { version = "0.6.8", features = ["cors", "add-extension"] } url = "2.5.8" uuid = {version = "1.20.0", default-features = false, features = ["serde", "v4"]} +async-trait = "0.1.89" +tonic-prost="0.14.3" [package.metadata.deb] maintainer = "zdz " diff --git a/server/src/auth.rs b/server/src/auth.rs index 1b400e78..a07b6ec3 100644 --- a/server/src/auth.rs +++ b/server/src/auth.rs @@ -1,5 +1,4 @@ use axum::{ - async_trait, extract::FromRequestParts, http::{header, request::Parts, StatusCode}, response::{IntoResponse, Response}, @@ -24,7 +23,6 @@ pub struct AdminAuth(BasicAuth); #[derive(Debug, Serialize, Deserialize)] pub struct HostAuth(BasicAuth); -#[async_trait] impl FromRequestParts for BasicAuth where S: Send + Sync, @@ -45,7 +43,6 @@ where } } -#[async_trait] impl FromRequestParts for AdminAuth where S: Send + Sync, @@ -87,7 +84,6 @@ where } } -#[async_trait] impl FromRequestParts for HostAuth where S: Send + Sync, diff --git a/server/src/jwt.rs b/server/src/jwt.rs index 35963ba0..cdc347df 100644 --- a/server/src/jwt.rs +++ b/server/src/jwt.rs @@ -1,5 +1,4 @@ use axum::{ - async_trait, extract::FromRequestParts, http::{request::Parts, StatusCode}, response::{IntoResponse, Response}, @@ -104,7 +103,6 @@ impl AuthBody { } } -#[async_trait] impl FromRequestParts for Claims where S: Send + Sync, From e6479b1218fd10ba39d83db9f326d4dc15b105a3 Mon Sep 17 00:00:00 2001 From: smallerqiu Date: Fri, 30 Jan 2026 17:44:21 +0800 Subject: [PATCH 03/12] update version --- Cargo.lock | 6 +++--- client/Cargo.toml | 2 +- common/Cargo.toml | 2 +- server/Cargo.toml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 603cbee0..17baa3e2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2427,7 +2427,7 @@ dependencies = [ [[package]] name = "stat_client" -version = "1.8.1" +version = "1.8.2" dependencies = [ "anyhow", "bytes", @@ -2464,7 +2464,7 @@ dependencies = [ [[package]] name = "stat_common" -version = "1.1.4" +version = "1.1.5" dependencies = [ "bytes", "chrono", @@ -2480,7 +2480,7 @@ dependencies = [ [[package]] name = "stat_server" -version = "1.8.1" +version = "1.8.2" dependencies = [ "anyhow", "async-trait", diff --git a/client/Cargo.toml b/client/Cargo.toml index 5041abca..e2f6a2b0 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -1,7 +1,7 @@ [package] edition = "2021" name = "stat_client" -version = "1.8.1" +version = "1.8.2" rust-version = "1.76" diff --git a/common/Cargo.toml b/common/Cargo.toml index 474e30d7..a3a08725 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -1,7 +1,7 @@ [package] edition = "2021" name = "stat_common" -version = "1.1.4" +version = "1.1.5" authors = ["doge "] categories = ["monitoring-tools"] diff --git a/server/Cargo.toml b/server/Cargo.toml index 6169ef6a..8d18326d 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -1,7 +1,7 @@ [package] edition = "2021" name = "stat_server" -version = "1.8.1" +version = "1.8.2" rust-version = "1.76" From 39a2d5f6db4e533cd9b5b0f3f3e33cbe9d019234 Mon Sep 17 00:00:00 2001 From: smallerqiu Date: Fri, 30 Jan 2026 18:15:12 +0800 Subject: [PATCH 04/12] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20cfg=20?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E8=AF=86=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 10 ++++----- client/src/sys_info.rs | 38 ++++++++++++++++++++--------------- 2 files changed, 27 insertions(+), 21 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1ec0887a..a8b5df49 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,7 +47,7 @@ jobs: sccache: "true" - name: Upload wheels - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: wheels path: target/wheels/stat*.whl @@ -184,19 +184,19 @@ jobs: cargo generate-rpm -p client --target=${{ matrix.platform.target }} - name: Upload wheels - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: wheels path: target/wheels/stat*.whl if-no-files-found: error - name: Upload deb artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ matrix.platform.target }}-deb path: target/${{ matrix.platform.target }}/debian/stat*.deb if-no-files-found: error - name: Upload RPM artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ matrix.platform.target }}-rpm path: target/${{ matrix.platform.target }}/generate-rpm/stat*.rpm @@ -448,7 +448,7 @@ jobs: if: startsWith(github.ref, 'refs/tags/') needs: [linux, macos] steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: wheels - uses: actions/setup-python@v4 diff --git a/client/src/sys_info.rs b/client/src/sys_info.rs index a7d0ccc0..6e2db3d3 100644 --- a/client/src/sys_info.rs +++ b/client/src/sys_info.rs @@ -130,38 +130,44 @@ pub fn sample(args: &Args, stat: &mut StatRequest) { // hdd KB -> KiB let (mut hdd_total, mut hdd_avail) = (0_u64, 0_u64); + let (mut hdd_total_bytes, mut hdd_avail_bytes) = (0_u64, 0_u64); - #[cfg(not(target_os = "windows"))] + // #[cfg(not(target_os = "windows"))] // let mut uniq_disk_set = HashSet::new(); // let mut uniq_disk_set: HashSet = HashSet::new(); - // ++ - let mut hdd_total_bytes = 0_u64; - let mut hdd_avail_bytes = 0_u64; - let mut seen_phys_disks = HashSet::new(); // 使用挂载点去重,防止 LVM 重复统计 + let disks = Disks::new_with_refreshed_list(); + let mut seen_phys_disks = HashSet::new(); stat.disks.clear(); - // ++ - let disks = Disks::new_with_refreshed_list(); for disk in &disks { let mount_point = disk.mount_point().to_string_lossy().to_string(); let fs_type = disk.file_system().to_string_lossy().to_lowercase(); let total_space = disk.total_space(); if G_EXPECT_FS.iter().any(|&k| fs_type.contains(k)) { - // 唯一标识:总大小 + 文件系统类型 + // 生成唯一标识 let disk_id = format!("{}-{}", total_space, fs_type); - // println!("Checking: {} | FS: {} | Size: {} B", mount_point, fs_type, disk.total_space()); - - if !seen_phys_disks.contains(&disk_id) { - seen_phys_disks.insert(disk_id); - + let mut is_new_phys_disk = true; + + #[cfg(not(target_os = "windows"))] + { + // Linux 下检查是否是重复的物理分区 + if seen_phys_disks.contains(&disk_id) { + is_new_phys_disk = false; + } else { + seen_phys_disks.insert(disk_id); + } + } + + // 如果是新的物理磁盘(Windows 默认都是新的,Linux 经过上面去重判断) + if is_new_phys_disk { hdd_total_bytes += total_space; hdd_avail_bytes += disk.available_space(); } - // 但 stat.disks 列表里可以保留所有挂载点展示 + // 无论是否是重复物理磁盘,挂载点信息都要存入列表供前端展示 stat.disks.push(DiskInfo { name: disk.name().to_string_lossy().to_string(), mount_point, @@ -173,8 +179,8 @@ pub fn sample(args: &Args, stat: &mut StatRequest) { } } - stat.hdd_total = (hdd_total_bytes / 1024 / 1024) as u64; - stat.hdd_used = ((hdd_total_bytes - hdd_avail_bytes) / 1024 / 1024) as u64; + stat.hdd_total = hdd_total_bytes / 1024 / 1024; + stat.hdd_used = (hdd_total_bytes - hdd_avail_bytes) / 1024 / 1024; // stat.hdd_total = hdd_total / unit.pow(2); // stat.hdd_used = (hdd_total - hdd_avail) / unit.pow(2); From ea4df67e0ddae3e96e1493f15f872c30835f30e6 Mon Sep 17 00:00:00 2001 From: smallerqiu Date: Fri, 30 Jan 2026 18:47:43 +0800 Subject: [PATCH 05/12] fix: HashSet --- .github/workflows/release.yml | 12 +++++++----- client/src/sys_info.rs | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a8b5df49..afe10d54 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: - target: "aarch64-apple-darwin" - target: "x86_64-apple-darwin" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: 3.11 @@ -49,7 +49,7 @@ jobs: - name: Upload wheels uses: actions/upload-artifact@v4 with: - name: wheels + name: wheels-macos-${{ matrix.platform.target }} path: target/wheels/stat*.whl if-no-files-found: error @@ -186,7 +186,7 @@ jobs: - name: Upload wheels uses: actions/upload-artifact@v4 with: - name: wheels + name: wheels-linux-${{ matrix.platform.target }} path: target/wheels/stat*.whl if-no-files-found: error - name: Upload deb artifacts @@ -450,7 +450,9 @@ jobs: steps: - uses: actions/download-artifact@v4 with: - name: wheels + path: dist/ + pattern: wheels-* + merge-multiple: true - uses: actions/setup-python@v4 with: python-version: 3.11 @@ -460,4 +462,4 @@ jobs: TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} run: | pip install --upgrade twine - twine upload --skip-existing * + twine upload --skip-existing dist/*.whl diff --git a/client/src/sys_info.rs b/client/src/sys_info.rs index 6e2db3d3..1021a743 100644 --- a/client/src/sys_info.rs +++ b/client/src/sys_info.rs @@ -137,7 +137,7 @@ pub fn sample(args: &Args, stat: &mut StatRequest) { // let mut uniq_disk_set: HashSet = HashSet::new(); let disks = Disks::new_with_refreshed_list(); - let mut seen_phys_disks = HashSet::new(); + let mut seen_phys_disks: HashSet = HashSet::new(); stat.disks.clear(); From 77fe44024f6bdca5fa8bca22a3ec633f0a80bbae Mon Sep 17 00:00:00 2001 From: smallerqiu Date: Fri, 30 Jan 2026 19:00:06 +0800 Subject: [PATCH 06/12] fix: remove cfg --- client/src/sys_info.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/client/src/sys_info.rs b/client/src/sys_info.rs index 1021a743..cbef8af9 100644 --- a/client/src/sys_info.rs +++ b/client/src/sys_info.rs @@ -132,9 +132,6 @@ pub fn sample(args: &Args, stat: &mut StatRequest) { let (mut hdd_total, mut hdd_avail) = (0_u64, 0_u64); let (mut hdd_total_bytes, mut hdd_avail_bytes) = (0_u64, 0_u64); - // #[cfg(not(target_os = "windows"))] - // let mut uniq_disk_set = HashSet::new(); - // let mut uniq_disk_set: HashSet = HashSet::new(); let disks = Disks::new_with_refreshed_list(); let mut seen_phys_disks: HashSet = HashSet::new(); From d84a399b626c482a1c0fc6d3d179bd79ec8e420c Mon Sep 17 00:00:00 2001 From: smallerqiu Date: Thu, 5 Feb 2026 18:13:54 +0800 Subject: [PATCH 07/12] feat: actions --- .github/workflows/release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index afe10d54..81d77d44 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -106,7 +106,7 @@ jobs: - name: Upload binaries to GitHub Release uses: softprops/action-gh-release@v2 - if: startsWith(github.ref, 'refs/tags/') + if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: @@ -258,7 +258,7 @@ jobs: - name: Upload binaries to GitHub Release uses: softprops/action-gh-release@v2 - if: startsWith(github.ref, 'refs/tags/') + if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: @@ -429,7 +429,7 @@ jobs: - name: Upload binaries to GitHub Release uses: softprops/action-gh-release@v2 - if: startsWith(github.ref, 'refs/tags/') + if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: @@ -445,7 +445,7 @@ jobs: environment: name: PyPI url: https://pypi.org/project/ServerStatus-Rust/ - if: startsWith(github.ref, 'refs/tags/') + if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' needs: [linux, macos] steps: - uses: actions/download-artifact@v4 From d873eb3fa9dad221b2fc55b39dd79085524742ed Mon Sep 17 00:00:00 2001 From: smallerqiu Date: Thu, 5 Feb 2026 18:23:26 +0800 Subject: [PATCH 08/12] feat: actions --- .github/workflows/release.yml | 316 ++++------------------------------ 1 file changed, 30 insertions(+), 286 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 81d77d44..73b32143 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,7 +4,6 @@ on: push: tags: - "v*" - workflow_dispatch: env: @@ -24,34 +23,12 @@ jobs: - target: "x86_64-apple-darwin" steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 - with: - python-version: 3.11 - uses: dtolnay/rust-toolchain@stable with: targets: ${{ matrix.platform.target }} - - name: Build python wheels - server - uses: PyO3/maturin-action@v1 - with: - working-directory: server - target: ${{ matrix.platform.target }} - args: --release --strip - sccache: "true" - - name: Build python wheels - client - uses: PyO3/maturin-action@v1 - with: - working-directory: client - target: ${{ matrix.platform.target }} - args: --release --strip - sccache: "true" - - - name: Upload wheels - uses: actions/upload-artifact@v4 - with: - name: wheels-macos-${{ matrix.platform.target }} - path: target/wheels/stat*.whl - if-no-files-found: error + - name: Build release + run: cargo build --release --target ${{ matrix.platform.target }} - name: Strip continue-on-error: true @@ -63,10 +40,7 @@ jobs: cp systemd/stat_client.service target/${{ matrix.platform.target }}/release/ - name: Compress binaries - # Upx may not support some platforms. Ignore the errors continue-on-error: true - # Disable upx for mips. See https://github.com/upx/upx/issues/387 - if: true && !contains(matrix.platform.target, 'mips') uses: svenstaro/upx-action@v2 with: strip: false @@ -75,16 +49,6 @@ jobs: target/${{ matrix.platform.target }}/release/stat_server target/${{ matrix.platform.target }}/release/stat_client - - uses: actions/upload-artifact@v4 - with: - name: ServerStatusRust-${{ matrix.platform.target }} - path: | - target/${{ matrix.platform.target }}/release/stat_server - target/${{ matrix.platform.target }}/release/stat_client - target/${{ matrix.platform.target }}/release/config.toml - target/${{ matrix.platform.target }}/release/stat_server.service - target/${{ matrix.platform.target }}/release/stat_client.service - - name: Zip Release - Server uses: TheDoctor0/zip-release@0.7.6 with: @@ -107,16 +71,16 @@ jobs: - name: Upload binaries to GitHub Release uses: softprops/action-gh-release@v2 if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: + # 手动运行时指定一个 tag 名字,否则可能失败 + tag_name: ${{ github.ref_name }} files: | target/${{ matrix.platform.target }}/release/server-${{ matrix.platform.target }}.zip target/${{ matrix.platform.target }}/release/client-${{ matrix.platform.target }}.zip generate_release_notes: true - draft: true + draft: false - linux: # (x86_64, aarch64) x (pypi, deb, rpm) + linux: runs-on: ubuntu-latest name: linux (${{ matrix.platform.target }}) permissions: @@ -126,14 +90,7 @@ jobs: matrix: platform: - target: "x86_64-unknown-linux-musl" - cargo-flags: "--no-default-features --features stat_client/native" - client-flags: "--no-default-features --features native" - server-flags: "" - target: "aarch64-unknown-linux-musl" - cargo-flags: "--no-default-features --features stat_client/native" - client-flags: "--no-default-features --features native" - server-flags: "" - container: image: docker://ghcr.io/rust-cross/rust-musl-cross:${{ matrix.platform.target }} steps: @@ -145,96 +102,21 @@ jobs: - name: Install packages run: | - pip install cargo-generate-rpm cargo-deb - sudo apt-get update -y -qq - sudo apt-get install zip git -y -qq - echo $PWD - git config --global --add safe.directory $PWD - git rev-parse --short HEAD - - # wheels - - name: Build python wheels - server - uses: PyO3/maturin-action@v1 - with: - container: off - manylinux: auto - working-directory: server - target: ${{ matrix.platform.target }} - args: --release --strip ${{matrix.platform.server-flags}} - sccache: "true" - - - name: Build python wheels - client - uses: PyO3/maturin-action@v1 - with: - container: off - manylinux: auto - working-directory: client - target: ${{ matrix.platform.target }} - args: --release --strip ${{matrix.platform.client-flags}} - sccache: "true" - - - name: Build Debian package - run: | - cargo deb -p stat_server --target=${{ matrix.platform.target }} --no-build --no-strip - cargo deb -p stat_client --target=${{ matrix.platform.target }} --no-build --no-strip - - - name: Build RPM package - run: | - cargo generate-rpm -p server --target=${{ matrix.platform.target }} - cargo generate-rpm -p client --target=${{ matrix.platform.target }} + apt-get update -y -qq + apt-get install zip git llvm -y -qq - - name: Upload wheels - uses: actions/upload-artifact@v4 - with: - name: wheels-linux-${{ matrix.platform.target }} - path: target/wheels/stat*.whl - if-no-files-found: error - - name: Upload deb artifacts - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.platform.target }}-deb - path: target/${{ matrix.platform.target }}/debian/stat*.deb - if-no-files-found: error - - name: Upload RPM artifacts - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.platform.target }}-rpm - path: target/${{ matrix.platform.target }}/generate-rpm/stat*.rpm - if-no-files-found: error + - name: Build release + run: cargo build --release --target ${{ matrix.platform.target }} - - name: LLVM Strip (Linux) + - name: LLVM Strip continue-on-error: true run: | - sudo apt-get install -y llvm llvm-strip target/${{ matrix.platform.target }}/release/stat_server llvm-strip target/${{ matrix.platform.target }}/release/stat_client cp config.toml target/${{ matrix.platform.target }}/release/ cp systemd/stat_server.service target/${{ matrix.platform.target }}/release/ cp systemd/stat_client.service target/${{ matrix.platform.target }}/release/ - - name: Compress binaries - # Upx may not support some platforms. Ignore the errors - continue-on-error: true - # Disable upx for mips. See https://github.com/upx/upx/issues/387 - if: true && !contains(matrix.platform.target, 'mips') - uses: svenstaro/upx-action@v2 - with: - strip: false - args: -q --best --lzma - files: | - target/${{ matrix.platform.target }}/release/stat_server - target/${{ matrix.platform.target }}/release/stat_client - - - uses: actions/upload-artifact@v4 - with: - name: ServerStatusRust-${{ matrix.platform.target }} - path: | - target/${{ matrix.platform.target }}/release/stat_server - target/${{ matrix.platform.target }}/release/stat_client - target/${{ matrix.platform.target }}/release/config.toml - target/${{ matrix.platform.target }}/release/stat_server.service - target/${{ matrix.platform.target }}/release/stat_client.service - - name: Zip Release - Server uses: TheDoctor0/zip-release@0.7.6 with: @@ -259,16 +141,13 @@ jobs: - name: Upload binaries to GitHub Release uses: softprops/action-gh-release@v2 if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: + tag_name: ${{ github.ref_name }} files: | target/${{ matrix.platform.target }}/release/server-${{ matrix.platform.target }}.zip target/${{ matrix.platform.target }}/release/client-${{ matrix.platform.target }}.zip - target/${{ matrix.platform.target }}/debian/stat*.deb - target/${{ matrix.platform.target }}/generate-rpm/stat*.rpm generate_release_notes: true - draft: true + draft: false windows-or-linux-others: name: Cross build for ${{ matrix.platform.target }} @@ -282,184 +161,49 @@ jobs: target: aarch64-linux-android suffix: "" use-cross: true - cargo-flags: "" - # 32bit - - os: ubuntu-latest - target: armv7-linux-androideabi - suffix: "" - use-cross: true - cargo-flags: "" - - os: ubuntu-latest target: armv7-unknown-linux-musleabihf suffix: "" use-cross: true - cargo-flags: "" - - os: windows-latest target: x86_64-pc-windows-msvc suffix: .exe use-cross: false - cargo-flags: "" - # - os: windows-latest - # target: x86_64-pc-windows-gnu - # suffix: .exe - # use-cross: false - # cargo-flags: "" steps: - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 - with: - override: true - profile: minimal - toolchain: stable - target: ${{ matrix.platform.target }} - - - name: Install Protoc - if: matrix.platform.os == 'windows-latest' - uses: arduino/setup-protoc@v1 + - uses: dtolnay/rust-toolchain@stable with: - version: "3.x" - repo-token: ${{ secrets.GITHUB_TOKEN }} + targets: ${{ matrix.platform.target }} - # https://blog.rust-lang.org/2023/01/09/android-ndk-update-r25.html - # https://github.com/cross-rs/cross/issues/1222 - - name: Update Cross - uses: actions-rs/cargo@v1 - with: - command: install - use-cross: false - args: cross --git https://github.com/cross-rs/cross + - name: Install Cross + if: matrix.platform.use-cross + run: cargo install cross --git https://github.com/cross-rs/cross - name: Build release - uses: actions-rs/cargo@v1 - with: - command: build - use-cross: ${{ matrix.platform.use-cross }} - args: --locked --release --target=${{ matrix.platform.target }} ${{ matrix.platform.cargo-flags }} - - - name: Strip (MacOS/Window) - if: matrix.platform.os != 'ubuntu-latest' - continue-on-error: true run: | - strip target/${{ matrix.platform.target }}/release/stat_server${{matrix.platform.suffix}} - strip target/${{ matrix.platform.target }}/release/stat_client${{matrix.platform.suffix}} - cp config.toml target/${{ matrix.platform.target }}/release/ - cp systemd/stat_server.service target/${{ matrix.platform.target }}/release/ - cp systemd/stat_client.service target/${{ matrix.platform.target }}/release/ - - - name: LLVM Strip (Linux) - if: matrix.platform.os == 'ubuntu-latest' - continue-on-error: true - run: | - sudo apt-get install -y llvm - llvm-strip target/${{ matrix.platform.target }}/release/stat_server${{matrix.platform.suffix}} - llvm-strip target/${{ matrix.platform.target }}/release/stat_client${{matrix.platform.suffix}} - cp config.toml target/${{ matrix.platform.target }}/release/ - cp systemd/stat_server.service target/${{ matrix.platform.target }}/release/ - cp systemd/stat_client.service target/${{ matrix.platform.target }}/release/ - - - name: Compress binaries - # Upx may not support some platforms. Ignore the errors - continue-on-error: true - # Disable upx for mips. See https://github.com/upx/upx/issues/387 - if: true && !contains(matrix.platform.target, 'mips') - uses: svenstaro/upx-action@v2 - with: - strip: false - args: -q --best --lzma - files: | - target/${{ matrix.platform.target }}/release/stat_server${{matrix.platform.suffix}} - target/${{ matrix.platform.target }}/release/stat_client${{matrix.platform.suffix}} - - - uses: actions/upload-artifact@v4 - with: - name: ServerStatus-${{ matrix.platform.target }} - path: | - target/${{ matrix.platform.target }}/release/stat_server${{matrix.platform.suffix}} - target/${{ matrix.platform.target }}/release/stat_client${{matrix.platform.suffix}} - target/${{ matrix.platform.target }}/release/config.toml - target/${{ matrix.platform.target }}/release/stat_server.service - target/${{ matrix.platform.target }}/release/stat_client.service - - - name: Zip Release - Server (Linux) - if: matrix.platform.os == 'ubuntu-latest' && contains(matrix.platform.target, 'linux') + if [ "${{ matrix.platform.use-cross }}" = "true" ]; then + cross build --release --target=${{ matrix.platform.target }} + else + cargo build --release --target=${{ matrix.platform.target }} + fi + shell: bash + + - name: Zip Release uses: TheDoctor0/zip-release@0.7.6 with: type: zip - filename: server-${{ matrix.platform.target }}.zip + filename: bin-${{ matrix.platform.target }}.zip directory: target/${{ matrix.platform.target }}/release/ path: | stat_server${{matrix.platform.suffix}} - stat_server.service - config.toml - - - name: Zip Release - Client (Linux) - if: matrix.platform.os == 'ubuntu-latest' && contains(matrix.platform.target, 'linux') - uses: TheDoctor0/zip-release@0.7.6 - with: - type: zip - filename: client-${{ matrix.platform.target }}.zip - directory: target/${{ matrix.platform.target }}/release/ - path: | - stat_client${{matrix.platform.suffix}} - stat_client.service - - - name: Zip Release - Server (MacOS/Window) - if: true && !contains(matrix.platform.target, 'linux') - uses: TheDoctor0/zip-release@0.7.6 - with: - type: zip - filename: server-${{ matrix.platform.target }}.zip - directory: target/${{ matrix.platform.target }}/release/ - path: | - stat_server${{matrix.platform.suffix}} - config.toml - - - name: Zip Release - Client (MacOS/Window) - if: true && !contains(matrix.platform.target, 'linux') - uses: TheDoctor0/zip-release@0.7.6 - with: - type: zip - filename: client-${{ matrix.platform.target }}.zip - directory: target/${{ matrix.platform.target }}/release/ - path: | stat_client${{matrix.platform.suffix}} - name: Upload binaries to GitHub Release uses: softprops/action-gh-release@v2 if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - files: | - target/${{ matrix.platform.target }}/release/server-${{ matrix.platform.target }}.zip - target/${{ matrix.platform.target }}/release/client-${{ matrix.platform.target }}.zip + tag_name: ${{ github.ref_name }} + files: target/${{ matrix.platform.target }}/release/bin-${{ matrix.platform.target }}.zip generate_release_notes: true - draft: true - - release: - name: PyPI Release - runs-on: ubuntu-latest - environment: - name: PyPI - url: https://pypi.org/project/ServerStatus-Rust/ - if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' - needs: [linux, macos] - steps: - - uses: actions/download-artifact@v4 - with: - path: dist/ - pattern: wheels-* - merge-multiple: true - - uses: actions/setup-python@v4 - with: - python-version: 3.11 - - name: Publish to PyPI - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - pip install --upgrade twine - twine upload --skip-existing dist/*.whl + draft: false \ No newline at end of file From 3975554e08a0574dbd24ca877e9890b0e294c716 Mon Sep 17 00:00:00 2001 From: smallerqiu Date: Thu, 5 Feb 2026 18:36:31 +0800 Subject: [PATCH 09/12] feat: action --- .github/workflows/release.yml | 101 ++++++++++++---------------------- 1 file changed, 35 insertions(+), 66 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 73b32143..13cf37ea 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,6 +10,7 @@ env: CARGO_TERM_COLOR: always jobs: + # --- macOS 编译 --- macos: runs-on: macos-latest name: macos (${{ matrix.platform.target }}) @@ -23,6 +24,13 @@ jobs: - target: "x86_64-apple-darwin" steps: - uses: actions/checkout@v4 + + - name: Install Protoc + uses: arduino/setup-protoc@v1 + with: + version: "3.x" + repo-token: ${{ secrets.GITHUB_TOKEN }} + - uses: dtolnay/rust-toolchain@stable with: targets: ${{ matrix.platform.target }} @@ -30,56 +38,27 @@ jobs: - name: Build release run: cargo build --release --target ${{ matrix.platform.target }} - - name: Strip - continue-on-error: true - run: | - strip target/${{ matrix.platform.target }}/release/stat_server - strip target/${{ matrix.platform.target }}/release/stat_client - cp config.toml target/${{ matrix.platform.target }}/release/ - cp systemd/stat_server.service target/${{ matrix.platform.target }}/release/ - cp systemd/stat_client.service target/${{ matrix.platform.target }}/release/ - - - name: Compress binaries - continue-on-error: true - uses: svenstaro/upx-action@v2 - with: - strip: false - args: -q --best --lzma - files: | - target/${{ matrix.platform.target }}/release/stat_server - target/${{ matrix.platform.target }}/release/stat_client - - - name: Zip Release - Server + - name: Zip Release uses: TheDoctor0/zip-release@0.7.6 with: type: zip - filename: server-${{ matrix.platform.target }}.zip + filename: ServerStatus-${{ matrix.platform.target }}.zip directory: target/${{ matrix.platform.target }}/release/ path: | stat_server - config.toml - - - name: Zip Release - Client - uses: TheDoctor0/zip-release@0.7.6 - with: - type: zip - filename: client-${{ matrix.platform.target }}.zip - directory: target/${{ matrix.platform.target }}/release/ - path: | stat_client + config.toml - name: Upload binaries to GitHub Release uses: softprops/action-gh-release@v2 if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' with: - # 手动运行时指定一个 tag 名字,否则可能失败 tag_name: ${{ github.ref_name }} - files: | - target/${{ matrix.platform.target }}/release/server-${{ matrix.platform.target }}.zip - target/${{ matrix.platform.target }}/release/client-${{ matrix.platform.target }}.zip + files: target/${{ matrix.platform.target }}/release/ServerStatus-${{ matrix.platform.target }}.zip generate_release_notes: true draft: false + # --- Linux (musl) 编译 --- linux: runs-on: ubuntu-latest name: linux (${{ matrix.platform.target }}) @@ -95,60 +74,42 @@ jobs: image: docker://ghcr.io/rust-cross/rust-musl-cross:${{ matrix.platform.target }} steps: - uses: actions/checkout@v4 + + # 容器内也需要 protoc + - name: Install Protoc + run: | + apt-get update -y -qq + apt-get install -y -qq protobuf-compiler zip git llvm + - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable with: targets: ${{ matrix.platform.target }} - - name: Install packages - run: | - apt-get update -y -qq - apt-get install zip git llvm -y -qq - - name: Build release run: cargo build --release --target ${{ matrix.platform.target }} - - name: LLVM Strip - continue-on-error: true - run: | - llvm-strip target/${{ matrix.platform.target }}/release/stat_server - llvm-strip target/${{ matrix.platform.target }}/release/stat_client - cp config.toml target/${{ matrix.platform.target }}/release/ - cp systemd/stat_server.service target/${{ matrix.platform.target }}/release/ - cp systemd/stat_client.service target/${{ matrix.platform.target }}/release/ - - - name: Zip Release - Server + - name: Zip Release uses: TheDoctor0/zip-release@0.7.6 with: type: zip - filename: server-${{ matrix.platform.target }}.zip + filename: ServerStatus-${{ matrix.platform.target }}.zip directory: target/${{ matrix.platform.target }}/release/ path: | stat_server - stat_server.service - config.toml - - - name: Zip Release - Client - uses: TheDoctor0/zip-release@0.7.6 - with: - type: zip - filename: client-${{ matrix.platform.target }}.zip - directory: target/${{ matrix.platform.target }}/release/ - path: | stat_client - stat_client.service + config.toml - name: Upload binaries to GitHub Release uses: softprops/action-gh-release@v2 if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' with: tag_name: ${{ github.ref_name }} - files: | - target/${{ matrix.platform.target }}/release/server-${{ matrix.platform.target }}.zip - target/${{ matrix.platform.target }}/release/client-${{ matrix.platform.target }}.zip + files: target/${{ matrix.platform.target }}/release/ServerStatus-${{ matrix.platform.target }}.zip generate_release_notes: true draft: false + # --- Windows & Android 交叉编译 --- windows-or-linux-others: name: Cross build for ${{ matrix.platform.target }} runs-on: ${{ matrix.platform.os }} @@ -172,6 +133,13 @@ jobs: steps: - uses: actions/checkout@v4 + + - name: Install Protoc + uses: arduino/setup-protoc@v1 + with: + version: "3.x" + repo-token: ${{ secrets.GITHUB_TOKEN }} + - uses: dtolnay/rust-toolchain@stable with: targets: ${{ matrix.platform.target }} @@ -193,17 +161,18 @@ jobs: uses: TheDoctor0/zip-release@0.7.6 with: type: zip - filename: bin-${{ matrix.platform.target }}.zip + filename: ServerStatus-${{ matrix.platform.target }}.zip directory: target/${{ matrix.platform.target }}/release/ path: | stat_server${{matrix.platform.suffix}} stat_client${{matrix.platform.suffix}} + config.toml - name: Upload binaries to GitHub Release uses: softprops/action-gh-release@v2 if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' with: tag_name: ${{ github.ref_name }} - files: target/${{ matrix.platform.target }}/release/bin-${{ matrix.platform.target }}.zip + files: target/${{ matrix.platform.target }}/release/ServerStatus-${{ matrix.platform.target }}.zip generate_release_notes: true draft: false \ No newline at end of file From adfeb097f69292c79a4610b1e35c0d87285a23ac Mon Sep 17 00:00:00 2001 From: smallerqiu Date: Thu, 5 Feb 2026 18:40:50 +0800 Subject: [PATCH 10/12] actions --- .github/workflows/release.yml | 36 ++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 13cf37ea..3e8bb4ee 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,14 +3,14 @@ name: Release on: push: tags: - - "v*" - workflow_dispatch: + - "v*" # 推送 v 开头的 tag 自动触发 + workflow_dispatch: # 支持手动点击 Run workflow 触发 env: CARGO_TERM_COLOR: always jobs: - # --- macOS 编译 --- + # --- macOS 编译 (支持 x86 和 M1/M2 架构) --- macos: runs-on: macos-latest name: macos (${{ matrix.platform.target }}) @@ -26,10 +26,7 @@ jobs: - uses: actions/checkout@v4 - name: Install Protoc - uses: arduino/setup-protoc@v1 - with: - version: "3.x" - repo-token: ${{ secrets.GITHUB_TOKEN }} + run: brew install protobuf - uses: dtolnay/rust-toolchain@stable with: @@ -58,7 +55,7 @@ jobs: generate_release_notes: true draft: false - # --- Linux (musl) 编译 --- + # --- Linux Musl 编译 (静态链接,兼容性最好) --- linux: runs-on: ubuntu-latest name: linux (${{ matrix.platform.target }}) @@ -75,8 +72,7 @@ jobs: steps: - uses: actions/checkout@v4 - # 容器内也需要 protoc - - name: Install Protoc + - name: Install Protoc & Utils run: | apt-get update -y -qq apt-get install -y -qq protobuf-compiler zip git llvm @@ -109,7 +105,7 @@ jobs: generate_release_notes: true draft: false - # --- Windows & Android 交叉编译 --- + # --- Windows & Android 编译 --- windows-or-linux-others: name: Cross build for ${{ matrix.platform.target }} runs-on: ${{ matrix.platform.os }} @@ -134,11 +130,15 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install Protoc - uses: arduino/setup-protoc@v1 - with: - version: "3.x" - repo-token: ${{ secrets.GITHUB_TOKEN }} + - name: Install Protoc (Windows) + if: matrix.platform.os == 'windows-latest' + run: choco install protoc --no-progress + + - name: Install Protoc (Linux/Android) + if: matrix.platform.os == 'ubuntu-latest' + run: | + sudo apt-get update + sudo apt-get install -y protobuf-compiler - uses: dtolnay/rust-toolchain@stable with: @@ -150,7 +150,9 @@ jobs: - name: Build release run: | - if [ "${{ matrix.platform.use-cross }}" = "true" ]; then + if [ "${{ matrix.platform.os }}" = "windows-latest" ]; then + cargo build --release --target=${{ matrix.platform.target }} + elif [ "${{ matrix.platform.use-cross }}" = "true" ]; then cross build --release --target=${{ matrix.platform.target }} else cargo build --release --target=${{ matrix.platform.target }} From b43844b1c7216dcf00cdcb1103be922511306ee1 Mon Sep 17 00:00:00 2001 From: smallerqiu Date: Thu, 5 Feb 2026 19:13:02 +0800 Subject: [PATCH 11/12] add Strip & UPX --- .github/workflows/release.yml | 86 +++++++++++++++++++++++------------ Cargo.lock | 8 ++-- client/Cargo.toml | 8 ++++ server/Cargo.toml | 11 ++++- 4 files changed, 79 insertions(+), 34 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3e8bb4ee..a2653a2d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,14 +3,14 @@ name: Release on: push: tags: - - "v*" # 推送 v 开头的 tag 自动触发 - workflow_dispatch: # 支持手动点击 Run workflow 触发 + - "v*" + workflow_dispatch: env: CARGO_TERM_COLOR: always jobs: - # --- macOS 编译 (支持 x86 和 M1/M2 架构) --- + # --- macOS 编译 --- macos: runs-on: macos-latest name: macos (${{ matrix.platform.target }}) @@ -35,15 +35,22 @@ jobs: - name: Build release run: cargo build --release --target ${{ matrix.platform.target }} + - name: Strip & UPX + continue-on-error: true + run: | + strip target/${{ matrix.platform.target }}/release/stat_server + strip target/${{ matrix.platform.target }}/release/stat_client + shell: bash + - name: Zip Release uses: TheDoctor0/zip-release@0.7.6 with: type: zip filename: ServerStatus-${{ matrix.platform.target }}.zip - directory: target/${{ matrix.platform.target }}/release/ + directory: ./ path: | - stat_server - stat_client + target/${{ matrix.platform.target }}/release/stat_server + target/${{ matrix.platform.target }}/release/stat_client config.toml - name: Upload binaries to GitHub Release @@ -51,11 +58,11 @@ jobs: if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' with: tag_name: ${{ github.ref_name }} - files: target/${{ matrix.platform.target }}/release/ServerStatus-${{ matrix.platform.target }}.zip + files: ServerStatus-${{ matrix.platform.target }}.zip generate_release_notes: true draft: false - # --- Linux Musl 编译 (静态链接,兼容性最好) --- + # --- Linux Musl 编译 --- linux: runs-on: ubuntu-latest name: linux (${{ matrix.platform.target }}) @@ -85,15 +92,24 @@ jobs: - name: Build release run: cargo build --release --target ${{ matrix.platform.target }} + - name: Strip & UPX + continue-on-error: true + uses: svenstaro/upx-action@v2 + with: + files: | + target/${{ matrix.platform.target }}/release/stat_server + target/${{ matrix.platform.target }}/release/stat_client + args: --best --lzma + - name: Zip Release uses: TheDoctor0/zip-release@0.7.6 with: type: zip filename: ServerStatus-${{ matrix.platform.target }}.zip - directory: target/${{ matrix.platform.target }}/release/ + directory: ./ path: | - stat_server - stat_client + target/${{ matrix.platform.target }}/release/stat_server + target/${{ matrix.platform.target }}/release/stat_client config.toml - name: Upload binaries to GitHub Release @@ -101,7 +117,7 @@ jobs: if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' with: tag_name: ${{ github.ref_name }} - files: target/${{ matrix.platform.target }}/release/ServerStatus-${{ matrix.platform.target }}.zip + files: ServerStatus-${{ matrix.platform.target }}.zip generate_release_notes: true draft: false @@ -130,15 +146,14 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install Protoc (Windows) - if: matrix.platform.os == 'windows-latest' - run: choco install protoc --no-progress - - - name: Install Protoc (Linux/Android) - if: matrix.platform.os == 'ubuntu-latest' + - name: Install Protoc run: | - sudo apt-get update - sudo apt-get install -y protobuf-compiler + if [ "${{ matrix.platform.os }}" = "windows-latest" ]; then + choco install protoc --no-progress + else + sudo apt-get update && sudo apt-get install -y protobuf-compiler + fi + shell: bash - uses: dtolnay/rust-toolchain@stable with: @@ -150,31 +165,44 @@ jobs: - name: Build release run: | - if [ "${{ matrix.platform.os }}" = "windows-latest" ]; then - cargo build --release --target=${{ matrix.platform.target }} - elif [ "${{ matrix.platform.use-cross }}" = "true" ]; then + if [ "${{ matrix.platform.use-cross }}" = "true" ]; then cross build --release --target=${{ matrix.platform.target }} else cargo build --release --target=${{ matrix.platform.target }} fi shell: bash + - name: Strip & UPX + continue-on-error: true + uses: svenstaro/upx-action@v2 + with: + files: | + target/${{ matrix.platform.target }}/release/stat_server${{matrix.platform.suffix}} + target/${{ matrix.platform.target }}/release/stat_client${{matrix.platform.suffix}} + args: --best --lzma + + # 修复:显式拷贝文件到统一目录,避免 Windows 打包找不到路径 + - name: Prepare Assets + run: | + mkdir -p ./assets/ + cp target/${{ matrix.platform.target }}/release/stat_server${{matrix.platform.suffix}} ./assets/ + cp target/${{ matrix.platform.target }}/release/stat_client${{matrix.platform.suffix}} ./assets/ + cp config.toml ./assets/ + shell: bash + - name: Zip Release uses: TheDoctor0/zip-release@0.7.6 with: type: zip filename: ServerStatus-${{ matrix.platform.target }}.zip - directory: target/${{ matrix.platform.target }}/release/ - path: | - stat_server${{matrix.platform.suffix}} - stat_client${{matrix.platform.suffix}} - config.toml + directory: ./assets/ + path: . - name: Upload binaries to GitHub Release uses: softprops/action-gh-release@v2 if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' with: tag_name: ${{ github.ref_name }} - files: target/${{ matrix.platform.target }}/release/ServerStatus-${{ matrix.platform.target }}.zip + files: ./assets/ServerStatus-${{ matrix.platform.target }}.zip generate_release_notes: true draft: false \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 17baa3e2..c27005d6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -378,9 +378,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.55" +version = "4.5.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e34525d5bbbd55da2bb745d34b36121baac88d07619a9a09cfcf4a6c0832785" +checksum = "6899ea499e3fb9305a65d5ebf6e3d2248c5fab291f300ad0a704fbe142eae31a" dependencies = [ "clap_builder", "clap_derive", @@ -388,9 +388,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.55" +version = "4.5.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59a20016a20a3da95bef50ec7238dbd09baeef4311dcdd38ec15aba69812fb61" +checksum = "7b12c8b680195a62a8364d16b8447b01b6c2c8f9aaf68bee653be34d4245e238" dependencies = [ "anstream", "anstyle", diff --git a/client/Cargo.toml b/client/Cargo.toml index e2f6a2b0..a087a39c 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -77,3 +77,11 @@ assets = [ { source = "LICENSE", dest = "/usr/share/doc/ServerStatus/LICENSE", doc = true, mode = "0644" }, { source = "../systemd/stat_client.service", dest = "/opt/ServerStatus/stat_client.service", config = true, mode = "0644" }, ] + + +[profile.release] +opt-level = "z" # 优化文件大小 (s 是优化速度和体积,z 是极致体积) +lto = true # 开启链接时优化 (跨模块删除无用代码) +codegen-units = 1 # 限制并行编译单元,增加优化空间 +panic = "abort" # 发生 panic 时直接退出,不包含回溯栈信息 (减小体积明显) +strip = true # 自动从生成的二进制文件中剥离符号信息 \ No newline at end of file diff --git a/server/Cargo.toml b/server/Cargo.toml index 8d18326d..f21e30fb 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -27,7 +27,7 @@ axum = {version = "0.8.8"} axum-extra = {version = "0.12.5", features = ["typed-header"]} bytes = {version = "1.11.0", features = ["serde"]} chrono = "0.4.43" -clap = {version = "4.5.55", features = ["derive", "unicode"]} +clap = {version = "4.5.57", features = ["derive", "unicode"]} futures-util = {version = "0.3.31", default-features = false} hyper = {version = "1.8.1", features = ["full"]} jsonwebtoken = "10.3.0" @@ -80,3 +80,12 @@ assets = [ { source = "LICENSE", dest = "/usr/share/doc/ServerStatus/LICENSE", doc = true, mode = "0644" }, { source = "../systemd/stat_server.service", dest = "/opt/ServerStatus/stat_server.service", config = true, mode = "0644" }, ] + + + +[profile.release] +opt-level = "z" # 优化文件大小 (s 是优化速度和体积,z 是极致体积) +lto = true # 开启链接时优化 (跨模块删除无用代码) +codegen-units = 1 # 限制并行编译单元,增加优化空间 +panic = "abort" # 发生 panic 时直接退出,不包含回溯栈信息 (减小体积明显) +strip = true # 自动从生成的二进制文件中剥离符号信息 \ No newline at end of file From b72917689529c2b28b8e7bcc90e853ef1a04f03f Mon Sep 17 00:00:00 2001 From: Qiu <154054190+smallerqiu@users.noreply.github.com> Date: Thu, 5 Feb 2026 21:36:18 +0800 Subject: [PATCH 12/12] fix:router --- server/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/main.rs b/server/src/main.rs index ceaa45ee..d05ce6a8 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -62,7 +62,7 @@ fn create_app_router() -> Router { .route("/json/stats.json", get(http::get_stats_json)) // 兼容就旧主题 // .route("/config.pub.json", get(http::get_site_config_json)) // TODO .route("/api/admin/authorize", post(jwt::authorize)) - .route("/api/admin/:path", get(http::admin_api)) // stats.json || config.json + .route("/api/admin/{path}", get(http::admin_api)) // stats.json || config.json // .route("/admin", get(assets::admin_index_handler)) .route("/detail", get(http::get_detail)) .route("/map", get(http::get_map))