From 7e27f2ed60831a1f562e290ed35c0c2a1c597303 Mon Sep 17 00:00:00 2001 From: LegitYew0108 Date: Mon, 6 Oct 2025 01:44:46 +0900 Subject: [PATCH 1/7] feat: detect commit update --- .gitignore | 1 + controller/Cargo.lock | 1331 ++++++++++++++++++++++++++++++- controller/Cargo.toml | 6 + controller/src/config.rs | 22 +- controller/src/github_access.rs | 38 + controller/src/main.rs | 50 +- 6 files changed, 1398 insertions(+), 50 deletions(-) create mode 100644 .gitignore create mode 100644 controller/src/github_access.rs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dab3c2f --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +**.env diff --git a/controller/Cargo.lock b/controller/Cargo.lock index 9d663fe..a09ac71 100644 --- a/controller/Cargo.lock +++ b/controller/Cargo.lock @@ -67,6 +67,18 @@ dependencies = [ "windows-sys 0.60.2", ] +[[package]] +name = "anyhow" +version = "1.0.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "autocfg" version = "1.5.0" @@ -88,18 +100,40 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + [[package]] name = "bitflags" version = "2.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2261d10cca569e4643e526d8dc2e62e433cc8aba21ab764233731f8d369bf394" +[[package]] +name = "bumpalo" +version = "3.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" + [[package]] name = "bytes" version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" +[[package]] +name = "cc" +version = "1.2.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80f41ae168f955c12fb8960b057d70d0ca153fb83182b57d86380443527be7e9" +dependencies = [ + "find-msvc-tools", + "shlex", +] + [[package]] name = "cfg-if" version = "1.0.3" @@ -152,18 +186,451 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[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 = "dotenvy" +version = "0.15.7" +source = "git+https://github.com/allan2/dotenvy#86c0d6dd2938e615135813df9e3274bf8f42c455" + +[[package]] +name = "dotenvy-macros" +version = "0.15.7" +source = "git+https://github.com/allan2/dotenvy#86c0d6dd2938e615135813df9e3274bf8f42c455" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "encoding_rs" +version = "0.8.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[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.0", +] + +[[package]] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + +[[package]] +name = "find-msvc-tools" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ced73b1dacfc750a6db6c0a0c3a3853c8b41997e2e2c563dc90804ae6867959" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-sink" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-core", + "futures-task", + "pin-project-lite", + "pin-utils", +] + +[[package]] +name = "getrandom" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.1+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasi 0.14.7+wasi-0.2.4", +] + [[package]] name = "gimli" version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" +[[package]] +name = "h2" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3c0b69cfcb4e1b9f1bf2f53f95f766e4661169728ec61cd3fe5a0166f2d1386" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d" + [[package]] name = "heck" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" +[[package]] +name = "http" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "hyper" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb3aa54a13a0dfe7fbe3a59e0c76093041720fdc77b110cc0fc260fafb4dc51e" +dependencies = [ + "atomic-waker", + "bytes", + "futures-channel", + "futures-core", + "h2", + "http", + "http-body", + "httparse", + "itoa", + "pin-project-lite", + "pin-utils", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58" +dependencies = [ + "http", + "hyper", + "hyper-util", + "rustls", + "rustls-pki-types", + "tokio", + "tokio-rustls", + "tower-service", +] + +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c6995591a8f1380fcb4ba966a252a4b29188d51d2b89e3a252f5305be65aea8" +dependencies = [ + "base64", + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "http", + "http-body", + "hyper", + "ipnet", + "libc", + "percent-encoding", + "pin-project-lite", + "socket2", + "system-configuration", + "tokio", + "tower-service", + "tracing", + "windows-registry", +] + +[[package]] +name = "icu_collections" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" +dependencies = [ + "displaydoc", + "potential_utf", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" + +[[package]] +name = "icu_properties" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "potential_utf", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" + +[[package]] +name = "icu_provider" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" +dependencies = [ + "displaydoc", + "icu_locale_core", + "stable_deref_trait", + "tinystr", + "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.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b0f83760fb341a774ed326568e19f5a863af4a952def8c39f9ab92fd95b88e5" +dependencies = [ + "equivalent", + "hashbrown", +] + [[package]] name = "io-uring" version = "0.7.10" @@ -175,12 +642,44 @@ dependencies = [ "libc", ] +[[package]] +name = "ipnet" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" + +[[package]] +name = "iri-string" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbc5ebe9c3a1a7a5127f920a418f7585e9e758e911d0466ed004f393b0e380b2" +dependencies = [ + "memchr", + "serde", +] + [[package]] name = "is_terminal_polyfill" version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "js-sys" +version = "0.3.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec48937a97411dcb524a265206ccd4c90bb711fca92b2792c407f268825b9305" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + [[package]] name = "lazy_static" version = "1.5.0" @@ -193,6 +692,18 @@ version = "0.2.175" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543" +[[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.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" + [[package]] name = "lock_api" version = "0.4.13" @@ -213,8 +724,14 @@ checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" name = "mdcs-controller" version = "0.1.0" dependencies = [ + "anyhow", "clap", + "dotenvy", + "dotenvy-macros", + "reqwest", "serde", + "serde_json", + "thiserror", "tokio", "tracing", "tracing-subscriber", @@ -226,6 +743,12 @@ version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + [[package]] name = "miniz_oxide" version = "0.8.9" @@ -242,10 +765,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" dependencies = [ "libc", - "wasi", + "wasi 0.11.1+wasi-snapshot-preview1", "windows-sys 0.59.0", ] +[[package]] +name = "native-tls" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + [[package]] name = "nu-ansi-term" version = "0.50.1" @@ -276,6 +816,50 @@ version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" +[[package]] +name = "openssl" +version = "0.10.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8505734d46c8ab1e19a1dce3aef597ad87dcb4c37e7188231769bd6bd51cebf8" +dependencies = [ + "bitflags", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "openssl-probe" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" + +[[package]] +name = "openssl-sys" +version = "0.9.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90096e2e47630d78b7d1c20952dc621f957103f8bc2c8359ec81290d75238571" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + [[package]] name = "parking_lot" version = "0.12.4" @@ -299,12 +883,39 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + [[package]] name = "pin-project-lite" version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + +[[package]] +name = "potential_utf" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84df19adbe5b5a0782edcab45899906947ab039ccf4573713735ee7de1e6b08a" +dependencies = [ + "zerovec", +] + [[package]] name = "proc-macro2" version = "1.0.101" @@ -323,6 +934,12 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + [[package]] name = "redox_syscall" version = "0.5.17" @@ -332,18 +949,162 @@ dependencies = [ "bitflags", ] +[[package]] +name = "reqwest" +version = "0.12.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d429f34c8092b2d42c7c93cec323bb4adeb7c67698f70839adec842ec10c7ceb" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-core", + "h2", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-tls", + "hyper-util", + "js-sys", + "log", + "mime", + "native-tls", + "percent-encoding", + "pin-project-lite", + "rustls-pki-types", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tokio-native-tls", + "tower", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.16", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + [[package]] name = "rustc-demangle" version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace" +[[package]] +name = "rustix" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.61.0", +] + +[[package]] +name = "rustls" +version = "0.23.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd3c25631629d034ce7cd9940adc9d45762d46de2b0f57193c4443b92c6d4d40" +dependencies = [ + "once_cell", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pki-types" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "229a4a4c221013e7e1f1a043678c5cc39fe5171437c88fb47151a21e6f5b5c79" +dependencies = [ + "zeroize", +] + +[[package]] +name = "rustls-webpki" +version = "0.103.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8572f3c2cb9934231157b45499fc41e1f58c589fdfb81a844ba873265e80f8eb" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "schannel" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "891d81b926048e76efe18581bf793546b4c0eaf8448d72be8de2bbee5fd166e1" +dependencies = [ + "windows-sys 0.61.0", +] + [[package]] name = "scopeguard" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "security-framework" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +dependencies = [ + "bitflags", + "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 = "serde" version = "1.0.225" @@ -355,19 +1116,139 @@ dependencies = [ ] [[package]] -name = "serde_core" -version = "1.0.225" +name = "serde_core" +version = "1.0.225" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "659356f9a0cb1e529b24c01e43ad2bdf520ec4ceaf83047b83ddcc2251f96383" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.225" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ea936adf78b1f766949a4977b91d2f5595825bd6ec079aa9543ad2685fc4516" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.145" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", + "serde_core", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook-registry" +version = "1.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a4719bff48cee6b39d12c020eeb490953ad2443b7055bd0b21fca26bd8c28b" +dependencies = [ + "libc", +] + +[[package]] +name = "slab" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "socket2" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "233504af464074f9d066d7b5416c5f9b894a5862a6506e306f7b816cdd6f1807" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "2.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "659356f9a0cb1e529b24c01e43ad2bdf520ec4ceaf83047b83ddcc2251f96383" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" dependencies = [ - "serde_derive", + "futures-core", ] [[package]] -name = "serde_derive" -version = "1.0.225" +name = "synstructure" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea936adf78b1f766949a4977b91d2f5595825bd6ec079aa9543ad2685fc4516" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", @@ -375,60 +1256,57 @@ dependencies = [ ] [[package]] -name = "sharded-slab" -version = "0.1.7" +name = "system-configuration" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ - "lazy_static", + "bitflags", + "core-foundation", + "system-configuration-sys", ] [[package]] -name = "signal-hook-registry" -version = "1.4.6" +name = "system-configuration-sys" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2a4719bff48cee6b39d12c020eeb490953ad2443b7055bd0b21fca26bd8c28b" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" dependencies = [ + "core-foundation-sys", "libc", ] [[package]] -name = "slab" -version = "0.4.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" - -[[package]] -name = "smallvec" -version = "1.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" - -[[package]] -name = "socket2" -version = "0.6.0" +name = "tempfile" +version = "3.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233504af464074f9d066d7b5416c5f9b894a5862a6506e306f7b816cdd6f1807" +checksum = "2d31c77bdf42a745371d260a26ca7163f1e0924b64afa0b688e61b5a9fa02f16" dependencies = [ - "libc", - "windows-sys 0.59.0", + "fastrand", + "getrandom 0.3.3", + "once_cell", + "rustix", + "windows-sys 0.61.0", ] [[package]] -name = "strsim" -version = "0.11.1" +name = "thiserror" +version = "2.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8" +dependencies = [ + "thiserror-impl", +] [[package]] -name = "syn" -version = "2.0.106" +name = "thiserror-impl" +version = "2.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" +checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" dependencies = [ "proc-macro2", "quote", - "unicode-ident", + "syn", ] [[package]] @@ -440,6 +1318,16 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "tinystr" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tokio" version = "1.47.1" @@ -471,6 +1359,84 @@ dependencies = [ "syn", ] +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f63835928ca123f1bef57abbcd23bb2ba0ac9ae1235f1e65bda0d06e7786bd" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14307c986784f72ef81c89db7d9e28d6ac26d16213b109ea501696195e6e3ce5" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tower" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-http" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adc82fd73de2a9722ac5da747f12383d2bfdb93591ee6c58486e0097890f05f2" +dependencies = [ + "bitflags", + "bytes", + "futures-util", + "http", + "http-body", + "iri-string", + "pin-project-lite", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + [[package]] name = "tracing" version = "0.1.41" @@ -528,12 +1494,42 @@ dependencies = [ "tracing-log", ] +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + [[package]] name = "unicode-ident" version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d" +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b" +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.2" @@ -546,18 +1542,168 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + [[package]] name = "wasi" version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" +[[package]] +name = "wasi" +version = "0.14.7+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "883478de20367e224c0090af9cf5f9fa85bed63a95c1abf3afc5c083ebc06e8c" +dependencies = [ + "wasip2", +] + +[[package]] +name = "wasip2" +version = "1.0.1+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1da10c01ae9f1ae40cbfac0bac3b1e724b320abfcf52229f80b547c0d250e2d" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "671c9a5a66f49d8a47345ab942e2cb93c7d1d0339065d4f8139c486121b43b19" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e038d41e478cc73bae0ff9b36c60cff1c98b8f38f8d7e8061e79ee63608ac5c" +dependencies = [ + "cfg-if", + "js-sys", + "once_cell", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ca60477e4c59f5f2986c50191cd972e3a50d8a95603bc9434501cf156a9a119" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f07d2f20d4da7b26400c9f4a0511e6e0345b040694e8a75bd41d578fa4421d7" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bad67dc8b2a1a6e5448428adec4c3e84c43e561d8c9ee8a9e5aabeb193ec41d1" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "web-sys" +version = "0.3.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9367c417a924a74cae129e6a2ae3b47fabb1f8995595ab474029da749a8be120" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + [[package]] name = "windows-link" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" +[[package]] +name = "windows-link" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45e46c0661abb7180e7b9c281db115305d49ca1709ab8242adf09666d2173c65" + +[[package]] +name = "windows-registry" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b8a9ed28765efc97bbc954883f4e6796c33a06546ebafacbabee9696967499e" +dependencies = [ + "windows-link 0.1.3", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-result" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" +dependencies = [ + "windows-link 0.1.3", +] + +[[package]] +name = "windows-strings" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" +dependencies = [ + "windows-link 0.1.3", +] + [[package]] name = "windows-sys" version = "0.52.0" @@ -585,6 +1731,15 @@ dependencies = [ "windows-targets 0.53.3", ] +[[package]] +name = "windows-sys" +version = "0.61.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e201184e40b2ede64bc2ea34968b28e33622acdbbf37104f0e4a33f7abe657aa" +dependencies = [ + "windows-link 0.2.0", +] + [[package]] name = "windows-targets" version = "0.52.6" @@ -607,7 +1762,7 @@ version = "0.53.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91" dependencies = [ - "windows-link", + "windows-link 0.1.3", "windows_aarch64_gnullvm 0.53.0", "windows_aarch64_msvc 0.53.0", "windows_i686_gnu 0.53.0", @@ -713,3 +1868,99 @@ name = "windows_x86_64_msvc" version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + +[[package]] +name = "wit-bindgen" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" + +[[package]] +name = "writeable" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" + +[[package]] +name = "yoke" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[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.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" + +[[package]] +name = "zerotrie" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7aa2bd55086f1ab526693ecbe444205da57e25f4489879da80635a46d90e73b" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/controller/Cargo.toml b/controller/Cargo.toml index 5ee734b..2df56da 100644 --- a/controller/Cargo.toml +++ b/controller/Cargo.toml @@ -4,8 +4,14 @@ version = "0.1.0" edition = "2024" [dependencies] +anyhow = "1.0.100" clap = { version = "4.5.47", features = ["derive", "env"] } +dotenvy = { git = "https://github.com/allan2/dotenvy" } +dotenvy-macros = { git = "https://github.com/allan2/dotenvy" } +reqwest = { version = "0.12.23", features = ["json"] } serde = { version = "1.0.225", features = ["derive"] } +serde_json = "1.0.145" +thiserror = "2.0.17" tokio = { version = "1.47.1", features = ["full"] } tracing = "0.1.41" tracing-subscriber = "0.3.20" diff --git a/controller/src/config.rs b/controller/src/config.rs index f79a4ad..3b55516 100644 --- a/controller/src/config.rs +++ b/controller/src/config.rs @@ -2,10 +2,14 @@ use clap::{Parser, ValueEnum}; #[derive(Debug, Parser, PartialEq)] pub struct Config{ - #[arg(long, env)] - pub github_repository_url: String, #[arg(long, env)] pub github_username: String, + #[arg(long, env)] + pub github_repository_owner_name: String, + #[arg(long, env)] + pub github_repository_name: String, + #[arg(long, env)] + pub github_branch_name: Option, #[arg(long, env, hide_env_values = true)] pub github_password: String, #[arg(long, env)] @@ -33,12 +37,16 @@ mod test{ use super::*; #[test] fn parse_arguments(){ - let configs = Config::try_parse_from(&[ + let configs = Config::try_parse_from([ "mdcs-controller", - "--github-repository-url", - "https://github.com/example_user/example_repo", "--github-username", "example_user", + "--github-repository-owner-name", + "example_user", + "--github-repository-name", + "example_repo", + "--github-branch-name", + "main", "--github-password", "example_password", "--server-name", @@ -58,8 +66,10 @@ mod test{ assert_eq!( configs, Config{ - github_repository_url: "https://github.com/example_user/example_repo".to_string(), github_username: "example_user".to_string(), + github_repository_owner_name: "example_name".to_string(), + github_repository_name: "example_repo".to_string(), + github_branch_name: Some("main".to_string()), github_password: "example_password".to_string(), server_name: "example_server".to_string(), server_type: ServerType::Paper, diff --git a/controller/src/github_access.rs b/controller/src/github_access.rs new file mode 100644 index 0000000..11bab2d --- /dev/null +++ b/controller/src/github_access.rs @@ -0,0 +1,38 @@ +use reqwest::header::{HeaderMap, HeaderValue, ACCEPT, AUTHORIZATION, USER_AGENT}; +use tracing::error; +use crate::config::Config; + +pub async fn fetch_commits(config: &Config, req_client: &reqwest::Client)->anyhow::Result{ + // modify header value + let mut headers = HeaderMap::new(); + + let Ok(auth_header_value) = HeaderValue::from_str(&format!("Bearer {}", config.github_password))else{ + error!("GITHUB_PASSWORD value was invalid."); + panic!(); + }; + headers.insert(AUTHORIZATION, auth_header_value); + let accept_header_value = HeaderValue::from_static("application/vnd.github+json"); + headers.insert(ACCEPT,accept_header_value); + let agent_header_value = HeaderValue::from_static("mdcs-controller"); + headers.insert(USER_AGENT,agent_header_value); + let gh_version_header_value = HeaderValue::from_static("2022-11-28"); + headers.insert("X-GitHub-Api-Version",gh_version_header_value); + + // create request url + let url:String; + if let Some(branch_name) = &config.github_branch_name{ + url = format!("https://api.github.com/repos/{}/{}/commits/{}",config.github_repository_owner_name,config.github_repository_name,branch_name); + }else{ + url = format!("https://api.github.com/repos/{}/{}/commits",config.github_repository_owner_name,config.github_repository_name); + }; + + // request to github api + let response = req_client + .get(url) + .headers(headers) + .send() + .await? + .json::() + .await?; + Ok(response) +} diff --git a/controller/src/main.rs b/controller/src/main.rs index 50250bb..39f9141 100644 --- a/controller/src/main.rs +++ b/controller/src/main.rs @@ -1,18 +1,60 @@ pub mod config; +pub mod github_access; + +use std::time::Duration; use clap::Parser; use config::Config; -use tracing::{debug, info}; +use tokio::sync::mpsc; +use tracing::{debug, info, warn,error}; +#[dotenvy_macros::load] #[tokio::main] -async fn main() { +async fn main() -> anyhow::Result<()>{ // tracing_subscriberの初期化 tracing_subscriber::fmt().init(); info!("MDCS Controller Created!"); // Configを環境変数またはコマンド引数から取得 - let config = Config::parse(); + let env_config = Config::parse(); // デバッグ用 Configを表示する - debug!("{:?}",config); + debug!("{:?}",env_config); + + let req_client = reqwest::Client::new(); + + let (tx, rx) = mpsc::channel::<()>(32); + + tokio::spawn(async move{get_new_commit_task(&env_config,&req_client,rx).await}); + + loop{ + // sleep 3 minutes + let _ = tokio::time::sleep(Duration::new(10,0)).await; + let _ = tx.send(()).await; + } +} + +async fn get_new_commit_task(env_config: &Config, req_client: &reqwest::Client,mut mpsc_rx: mpsc::Receiver<()>){ + let mut prev_commit_sha = "".to_string(); + loop{ + mpsc_rx.recv().await; + + let response = match github_access::fetch_commits(env_config, req_client).await{ + Ok(response) => response, + Err(e) => { + error!("Error Occured while fetch commit from github: {}",e); + return; + } + }; + + let Some(sha_value) = response.get("sha")else{ + warn!("'sha' key was not exist in response."); + continue; + }; + println!("{:?}",sha_value.to_string()); + if *sha_value.to_string()!=prev_commit_sha{ + info!("commit updated!"); + } + prev_commit_sha = sha_value.to_string(); + } } From 137833326d51badd51bd2e04e80c47e588fb5458 Mon Sep 17 00:00:00 2001 From: LegitYew0108 Date: Mon, 6 Oct 2025 02:10:30 +0900 Subject: [PATCH 2/7] fix: remove pointless mpsc channel --- controller/src/github_access.rs | 2 +- controller/src/main.rs | 30 +++++++++++++++--------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/controller/src/github_access.rs b/controller/src/github_access.rs index 11bab2d..4d7ff06 100644 --- a/controller/src/github_access.rs +++ b/controller/src/github_access.rs @@ -8,7 +8,7 @@ pub async fn fetch_commits(config: &Config, req_client: &reqwest::Client)->anyho let Ok(auth_header_value) = HeaderValue::from_str(&format!("Bearer {}", config.github_password))else{ error!("GITHUB_PASSWORD value was invalid."); - panic!(); + return Err(anyhow::anyhow!("GITHUB_PASSWORD value was invalid.")); }; headers.insert(AUTHORIZATION, auth_header_value); let accept_header_value = HeaderValue::from_static("application/vnd.github+json"); diff --git a/controller/src/main.rs b/controller/src/main.rs index 39f9141..5ceff44 100644 --- a/controller/src/main.rs +++ b/controller/src/main.rs @@ -5,7 +5,6 @@ use std::time::Duration; use clap::Parser; use config::Config; -use tokio::sync::mpsc; use tracing::{debug, info, warn,error}; #[dotenvy_macros::load] @@ -23,21 +22,17 @@ async fn main() -> anyhow::Result<()>{ let req_client = reqwest::Client::new(); - let (tx, rx) = mpsc::channel::<()>(32); + tokio::spawn(async move{get_new_commit_task(&env_config,&req_client).await}); - tokio::spawn(async move{get_new_commit_task(&env_config,&req_client,rx).await}); - - loop{ - // sleep 3 minutes - let _ = tokio::time::sleep(Duration::new(10,0)).await; - let _ = tx.send(()).await; - } + std::future::pending::<()>().await; + Ok(()) } -async fn get_new_commit_task(env_config: &Config, req_client: &reqwest::Client,mut mpsc_rx: mpsc::Receiver<()>){ +async fn get_new_commit_task(env_config: &Config, req_client: &reqwest::Client){ let mut prev_commit_sha = "".to_string(); loop{ - mpsc_rx.recv().await; + // sleep 3 minutes + let _ = tokio::time::sleep(Duration::new(60*3,0)).await; let response = match github_access::fetch_commits(env_config, req_client).await{ Ok(response) => response, @@ -47,13 +42,18 @@ async fn get_new_commit_task(env_config: &Config, req_client: &reqwest::Client,m } }; - let Some(sha_value) = response.get("sha")else{ - warn!("'sha' key was not exist in response."); + let latest_commit = if response.is_array(){ + response.get(0) + }else{ + Some(&response) + }; + + let Some(sha_value) = latest_commit.and_then(|commit| commit.get("sha")).and_then(|sha| sha.as_str()) else{ + warn!("Could not extract commit 'sha' from response."); continue; }; - println!("{:?}",sha_value.to_string()); if *sha_value.to_string()!=prev_commit_sha{ - info!("commit updated!"); + info!("commit updated! new SHA: {}",sha_value); } prev_commit_sha = sha_value.to_string(); } From c03d4cf4975a67f48b1abb1b0273201641f6e24e Mon Sep 17 00:00:00 2001 From: LegitYew0108 <83275150+LegitYew0108@users.noreply.github.com> Date: Mon, 6 Oct 2025 02:12:23 +0900 Subject: [PATCH 3/7] Update controller/src/main.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- controller/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controller/src/main.rs b/controller/src/main.rs index 5ceff44..dc57321 100644 --- a/controller/src/main.rs +++ b/controller/src/main.rs @@ -38,7 +38,7 @@ async fn get_new_commit_task(env_config: &Config, req_client: &reqwest::Client){ Ok(response) => response, Err(e) => { error!("Error Occured while fetch commit from github: {}",e); - return; + continue; } }; From f09f4aa71137d6f6d06632ab2e1a6eff89e527b0 Mon Sep 17 00:00:00 2001 From: LegitYew0108 <83275150+LegitYew0108@users.noreply.github.com> Date: Mon, 6 Oct 2025 02:12:36 +0900 Subject: [PATCH 4/7] Update controller/src/main.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- controller/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controller/src/main.rs b/controller/src/main.rs index dc57321..9dbb17c 100644 --- a/controller/src/main.rs +++ b/controller/src/main.rs @@ -5,7 +5,7 @@ use std::time::Duration; use clap::Parser; use config::Config; -use tracing::{debug, info, warn,error}; +use tracing::{debug, info, warn, error}; #[dotenvy_macros::load] #[tokio::main] From 78cb4cefc9004a5ae2420ec7f48fbb68906eee4e Mon Sep 17 00:00:00 2001 From: LegitYew0108 <83275150+LegitYew0108@users.noreply.github.com> Date: Mon, 6 Oct 2025 02:13:18 +0900 Subject: [PATCH 5/7] Update controller/src/main.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- controller/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controller/src/main.rs b/controller/src/main.rs index 9dbb17c..2870d46 100644 --- a/controller/src/main.rs +++ b/controller/src/main.rs @@ -52,7 +52,7 @@ async fn get_new_commit_task(env_config: &Config, req_client: &reqwest::Client){ warn!("Could not extract commit 'sha' from response."); continue; }; - if *sha_value.to_string()!=prev_commit_sha{ + if sha_value != prev_commit_sha { info!("commit updated! new SHA: {}",sha_value); } prev_commit_sha = sha_value.to_string(); From 429143b69d61fc81e695c71da61ee4db29d3d8b0 Mon Sep 17 00:00:00 2001 From: LegitYew0108 <83275150+LegitYew0108@users.noreply.github.com> Date: Mon, 6 Oct 2025 02:13:40 +0900 Subject: [PATCH 6/7] Update controller/src/config.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- controller/src/config.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controller/src/config.rs b/controller/src/config.rs index 3b55516..2dd0ce1 100644 --- a/controller/src/config.rs +++ b/controller/src/config.rs @@ -67,7 +67,7 @@ mod test{ configs, Config{ github_username: "example_user".to_string(), - github_repository_owner_name: "example_name".to_string(), + github_repository_owner_name: "example_user".to_string(), github_repository_name: "example_repo".to_string(), github_branch_name: Some("main".to_string()), github_password: "example_password".to_string(), From 1a3013c439cbb8ccb7e7f70f71fdaed2088390ae Mon Sep 17 00:00:00 2001 From: LegitYew0108 Date: Tue, 7 Oct 2025 01:15:44 +0900 Subject: [PATCH 7/7] fix: apply cargo fmt --- controller/src/config.rs | 13 ++++++------ controller/src/github_access.rs | 35 ++++++++++++++++++++++----------- controller/src/main.rs | 29 +++++++++++++++------------ 3 files changed, 46 insertions(+), 31 deletions(-) diff --git a/controller/src/config.rs b/controller/src/config.rs index 2dd0ce1..8b2fef3 100644 --- a/controller/src/config.rs +++ b/controller/src/config.rs @@ -1,7 +1,7 @@ use clap::{Parser, ValueEnum}; #[derive(Debug, Parser, PartialEq)] -pub struct Config{ +pub struct Config { #[arg(long, env)] pub github_username: String, #[arg(long, env)] @@ -27,16 +27,16 @@ pub struct Config{ } #[derive(Debug, Clone, ValueEnum, PartialEq)] -pub enum ServerType{ +pub enum ServerType { Paper, Velocity, } #[cfg(test)] -mod test{ +mod test { use super::*; #[test] - fn parse_arguments(){ + fn parse_arguments() { let configs = Config::try_parse_from([ "mdcs-controller", "--github-username", @@ -61,11 +61,12 @@ mod test{ "./start.sh", "--stop-command", "./stop.sh", - ]).unwrap(); + ]) + .unwrap(); assert_eq!( configs, - Config{ + Config { github_username: "example_user".to_string(), github_repository_owner_name: "example_user".to_string(), github_repository_name: "example_repo".to_string(), diff --git a/controller/src/github_access.rs b/controller/src/github_access.rs index 4d7ff06..64d03d8 100644 --- a/controller/src/github_access.rs +++ b/controller/src/github_access.rs @@ -1,29 +1,40 @@ -use reqwest::header::{HeaderMap, HeaderValue, ACCEPT, AUTHORIZATION, USER_AGENT}; -use tracing::error; use crate::config::Config; +use reqwest::header::{ACCEPT, AUTHORIZATION, HeaderMap, HeaderValue, USER_AGENT}; +use tracing::error; -pub async fn fetch_commits(config: &Config, req_client: &reqwest::Client)->anyhow::Result{ +pub async fn fetch_commits( + config: &Config, + req_client: &reqwest::Client, +) -> anyhow::Result { // modify header value let mut headers = HeaderMap::new(); - let Ok(auth_header_value) = HeaderValue::from_str(&format!("Bearer {}", config.github_password))else{ + let Ok(auth_header_value) = + HeaderValue::from_str(&format!("Bearer {}", config.github_password)) + else { error!("GITHUB_PASSWORD value was invalid."); return Err(anyhow::anyhow!("GITHUB_PASSWORD value was invalid.")); }; headers.insert(AUTHORIZATION, auth_header_value); let accept_header_value = HeaderValue::from_static("application/vnd.github+json"); - headers.insert(ACCEPT,accept_header_value); + headers.insert(ACCEPT, accept_header_value); let agent_header_value = HeaderValue::from_static("mdcs-controller"); - headers.insert(USER_AGENT,agent_header_value); + headers.insert(USER_AGENT, agent_header_value); let gh_version_header_value = HeaderValue::from_static("2022-11-28"); - headers.insert("X-GitHub-Api-Version",gh_version_header_value); + headers.insert("X-GitHub-Api-Version", gh_version_header_value); // create request url - let url:String; - if let Some(branch_name) = &config.github_branch_name{ - url = format!("https://api.github.com/repos/{}/{}/commits/{}",config.github_repository_owner_name,config.github_repository_name,branch_name); - }else{ - url = format!("https://api.github.com/repos/{}/{}/commits",config.github_repository_owner_name,config.github_repository_name); + let url: String; + if let Some(branch_name) = &config.github_branch_name { + url = format!( + "https://api.github.com/repos/{}/{}/commits/{}", + config.github_repository_owner_name, config.github_repository_name, branch_name + ); + } else { + url = format!( + "https://api.github.com/repos/{}/{}/commits", + config.github_repository_owner_name, config.github_repository_name + ); }; // request to github api diff --git a/controller/src/main.rs b/controller/src/main.rs index 2870d46..7fbeede 100644 --- a/controller/src/main.rs +++ b/controller/src/main.rs @@ -5,11 +5,11 @@ use std::time::Duration; use clap::Parser; use config::Config; -use tracing::{debug, info, warn, error}; +use tracing::{debug, error, info, warn}; #[dotenvy_macros::load] #[tokio::main] -async fn main() -> anyhow::Result<()>{ +async fn main() -> anyhow::Result<()> { // tracing_subscriberの初期化 tracing_subscriber::fmt().init(); info!("MDCS Controller Created!"); @@ -18,42 +18,45 @@ async fn main() -> anyhow::Result<()>{ let env_config = Config::parse(); // デバッグ用 Configを表示する - debug!("{:?}",env_config); + debug!("{:?}", env_config); let req_client = reqwest::Client::new(); - tokio::spawn(async move{get_new_commit_task(&env_config,&req_client).await}); + tokio::spawn(async move { get_new_commit_task(&env_config, &req_client).await }); std::future::pending::<()>().await; Ok(()) } -async fn get_new_commit_task(env_config: &Config, req_client: &reqwest::Client){ +async fn get_new_commit_task(env_config: &Config, req_client: &reqwest::Client) { let mut prev_commit_sha = "".to_string(); - loop{ + loop { // sleep 3 minutes - let _ = tokio::time::sleep(Duration::new(60*3,0)).await; + let _ = tokio::time::sleep(Duration::new(60 * 3, 0)).await; - let response = match github_access::fetch_commits(env_config, req_client).await{ + let response = match github_access::fetch_commits(env_config, req_client).await { Ok(response) => response, Err(e) => { - error!("Error Occured while fetch commit from github: {}",e); + error!("Error Occured while fetch commit from github: {}", e); continue; } }; - let latest_commit = if response.is_array(){ + let latest_commit = if response.is_array() { response.get(0) - }else{ + } else { Some(&response) }; - let Some(sha_value) = latest_commit.and_then(|commit| commit.get("sha")).and_then(|sha| sha.as_str()) else{ + let Some(sha_value) = latest_commit + .and_then(|commit| commit.get("sha")) + .and_then(|sha| sha.as_str()) + else { warn!("Could not extract commit 'sha' from response."); continue; }; if sha_value != prev_commit_sha { - info!("commit updated! new SHA: {}",sha_value); + info!("commit updated! new SHA: {}", sha_value); } prev_commit_sha = sha_value.to_string(); }