From 98ba8846c38d206030c4342a564bcba298cc0597 Mon Sep 17 00:00:00 2001 From: Ultradesu Date: Mon, 25 Aug 2025 21:48:59 +0300 Subject: [PATCH] first commit --- .gitignore | 3 + Cargo.lock | 3671 +++++++++++++++++++++++++++++++++ Cargo.toml | 43 + config.example.toml | 24 + src/agent.rs | 254 +++ src/cli.rs | 140 ++ src/config/mod.rs | 169 ++ src/core/app.rs | 53 + src/core/context.rs | 14 + src/core/mod.rs | 3 + src/core/module.rs | 57 + src/database/connection.rs | 64 + src/database/entities/mod.rs | 1 + src/database/entities/node.rs | 82 + src/database/mod.rs | 4 + src/error.rs | 15 + src/main.rs | 63 + src/modules/example.rs | 40 + src/modules/mod.rs | 3 + src/modules/web.rs | 273 +++ src/modules/websocket.rs | 164 ++ src/node_manager.rs | 222 ++ src/websocket_state.rs | 72 + src/yggdrasil/mod.rs | 54 + static/index.html | 912 ++++++++ 25 files changed, 6400 insertions(+) create mode 100644 .gitignore create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 config.example.toml create mode 100644 src/agent.rs create mode 100644 src/cli.rs create mode 100644 src/config/mod.rs create mode 100644 src/core/app.rs create mode 100644 src/core/context.rs create mode 100644 src/core/mod.rs create mode 100644 src/core/module.rs create mode 100644 src/database/connection.rs create mode 100644 src/database/entities/mod.rs create mode 100644 src/database/entities/node.rs create mode 100644 src/database/mod.rs create mode 100644 src/error.rs create mode 100644 src/main.rs create mode 100644 src/modules/example.rs create mode 100644 src/modules/mod.rs create mode 100644 src/modules/web.rs create mode 100644 src/modules/websocket.rs create mode 100644 src/node_manager.rs create mode 100644 src/websocket_state.rs create mode 100644 src/yggdrasil/mod.rs create mode 100644 static/index.html diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7fc2389 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/target +yggman.db + diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..3a20722 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,3671 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "addr2line" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + +[[package]] +name = "ahash" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" +dependencies = [ + "getrandom 0.2.16", + "once_cell", + "version_check", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "aliasable" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anstream" +version = "0.6.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ae563653d1938f79b1ab1b5e668c87c76a9930414574a6583a7b7e11a8e6192" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" + +[[package]] +name = "anstyle-parse" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2" +dependencies = [ + "windows-sys 0.60.2", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys 0.60.2", +] + +[[package]] +name = "anyhow" +version = "1.0.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0674a1ddeecb70197781e945de4b3b8ffb61fa939a5597bcf48503737663100" + +[[package]] +name = "arc-swap" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "async-stream" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" +dependencies = [ + "async-stream-impl", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "async-trait" +version = "0.1.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "atoi" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28d99ec8bfea296261ca1af174f24225171fea9664ba9003cbebee704810528" +dependencies = [ + "num-traits", +] + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "axum" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" +dependencies = [ + "async-trait", + "axum-core", + "base64", + "bytes", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-util", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", + "sha1", + "sync_wrapper", + "tokio", + "tokio-tungstenite", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "axum-core" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http", + "http-body", + "http-body-util", + "mime", + "pin-project-lite", + "rustversion", + "sync_wrapper", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "backtrace" +version = "0.3.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "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 = "base64ct" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55248b47b0caf0546f7988906588779981c43bb1bc9d0c44087278f80cdb44ba" + +[[package]] +name = "bigdecimal" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a22f228ab7a1b23027ccc6c350b72868017af7ea8356fbdf19f8d991c690013" +dependencies = [ + "autocfg", + "libm", + "num-bigint", + "num-integer", + "num-traits", + "serde", +] + +[[package]] +name = "bitflags" +version = "2.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34efbcccd345379ca2868b2b2c9d3782e9cc58ba87bc7d79d5b53d9c9ae6f25d" +dependencies = [ + "serde", +] + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "borsh" +version = "1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad8646f98db542e39fc66e68a20b2144f6a732636df7c2354e74645faaa433ce" +dependencies = [ + "borsh-derive", + "cfg_aliases", +] + +[[package]] +name = "borsh-derive" +version = "1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdd1d3c0c2f5833f22386f252fe8ed005c7f59fdcddeef025c01b4c3b9fd9ac3" +dependencies = [ + "once_cell", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "bumpalo" +version = "3.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" + +[[package]] +name = "bytecheck" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23cdc57ce23ac53c931e88a43d06d070a6fd142f2617be5855eb75efc9beb1c2" +dependencies = [ + "bytecheck_derive", + "ptr_meta", + "simdutf8", +] + +[[package]] +name = "bytecheck_derive" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[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.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42bc4aea80032b7bf409b0bc7ccad88853858911b7713a8062fdc0623867bedc" +dependencies = [ + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9" + +[[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.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "serde", + "wasm-bindgen", + "windows-link", +] + +[[package]] +name = "clap" +version = "4.5.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc0e74a703892159f5ae7d3aac52c8e6c392f5ae5f359c70b5881d60aaac318" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3e7f4214277f3c7aa526a59dd3fbe306a370daee1f8b7b8c987069cd8e888a8" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.5.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14cb31bb0a7d536caef2639baa7fad459e15c3144efefa6dbd1c84562c4739f6" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "clap_lex" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" + +[[package]] +name = "colorchoice" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" + +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crc" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9710d3b3739c2e349eb44fe848ad0b7c8cb1e42bd87ee49371df2f7acaf3e675" +dependencies = [ + "crc-catalog", +] + +[[package]] +name = "crc-catalog" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" + +[[package]] +name = "crossbeam-queue" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f58bbc28f91df819d0aa2a2c00cd19754769c2fad90579b3592b1c9ba7a3115" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "curve25519-dalek" +version = "4.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "rustc_version", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "darling" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "darling_macro" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "data-encoding" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" + +[[package]] +name = "der" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" +dependencies = [ + "const-oid", + "pem-rfc7468", + "zeroize", +] + +[[package]] +name = "deranged" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" +dependencies = [ + "powerfmt", + "serde", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "dotenvy" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" + +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "pkcs8", + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70e796c081cee67dc755e1a36a0a172b897fab85fc3f6bc48307991f64e4eca9" +dependencies = [ + "curve25519-dalek", + "ed25519", + "serde", + "sha2", + "subtle", + "zeroize", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" +dependencies = [ + "serde", +] + +[[package]] +name = "envy" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f47e0157f2cb54f5ae1bd371b30a2ae4311e1c028f575cd4e81de7353215965" +dependencies = [ + "serde", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "etcetera" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "136d1b5283a1ab77bd9257427ffd09d8667ced0570b6f938942bc7568ed5b943" +dependencies = [ + "cfg-if", + "home", + "windows-sys 0.48.0", +] + +[[package]] +name = "event-listener" +version = "5.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13b66accf52311f30a0db42147dadea9850cb48cd070028831ae5f5d4b856ab" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + +[[package]] +name = "flume" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da0e4dd2a88388a1f4ccc7c9ce104604dab68d9f408dc34cd45823d5a9069095" +dependencies = [ + "futures-core", + "futures-sink", + "spin", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[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 = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-executor" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", + "parking_lot", +] + +[[package]] +name = "futures-io" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[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-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[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.2+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 = "glob" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] + +[[package]] +name = "hashlink" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1" +dependencies = [ + "hashbrown 0.15.5", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "home" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "hostname" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a56f203cd1c76362b69e3863fd987520ac36cf70a8c92627449b2f64a8cf7d65" +dependencies = [ + "cfg-if", + "libc", + "windows-link", +] + +[[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 = "http-range-header" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9171a2ea8a68358193d15dd5d70c1c10a2afc3e7e4c5bc92bc9f025cebd7359c" + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[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", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "pin-utils", + "smallvec", + "tokio", +] + +[[package]] +name = "hyper-util" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d9b05277c7e8da2c93a568989bb6207bef0112e8d17df7a6eda4a3cf143bc5e" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "hyper", + "pin-project-lite", + "tokio", + "tower-service", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[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 = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[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.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2481980430f9f78649238835720ddccc57e52df14ffce1c6f37391d61b563e9" +dependencies = [ + "equivalent", + "hashbrown 0.15.5", +] + +[[package]] +name = "inherent" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c38228f24186d9cc68c729accb4d413be9eaed6ad07ff79e0270d9e56f3de13" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "io-uring" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "046fa2d4d00aea763528b4950358d0ead425372445dc8ff86312b3c69ff7727b" +dependencies = [ + "bitflags", + "cfg-if", + "libc", +] + +[[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.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +dependencies = [ + "spin", +] + +[[package]] +name = "libc" +version = "0.2.175" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543" + +[[package]] +name = "libm" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" + +[[package]] +name = "libredox" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "391290121bad3d37fbddad76d8f5d1c1c314cfc646d143d7e07a3086ddff0ce3" +dependencies = [ + "bitflags", + "libc", + "redox_syscall", +] + +[[package]] +name = "libsqlite3-sys" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149" +dependencies = [ + "cc", + "pkg-config", + "vcpkg", +] + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "matchit" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" + +[[package]] +name = "md-5" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +dependencies = [ + "cfg-if", + "digest", +] + +[[package]] +name = "memchr" +version = "2.7.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 = "mime_guess" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", +] + +[[package]] +name = "mio" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" +dependencies = [ + "libc", + "wasi 0.11.1+wasi-snapshot-preview1", + "windows-sys 0.59.0", +] + +[[package]] +name = "network-interface" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07709a6d4eba90ab10ec170a0530b3aafc81cb8a2d380e4423ae41fc55fe5745" +dependencies = [ + "cc", + "libc", + "thiserror 2.0.16", + "winapi", +] + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-bigint-dig" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" +dependencies = [ + "byteorder", + "lazy_static", + "libm", + "num-integer", + "num-iter", + "num-traits", + "rand", + "smallvec", + "zeroize", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "object" +version = "0.36.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" + +[[package]] +name = "ordered-float" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bb71e1b3fa6ca1c61f383464aaf2bb0e2f8e772a1f01d486832464de363b951" +dependencies = [ + "num-traits", +] + +[[package]] +name = "ouroboros" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e0f050db9c44b97a94723127e6be766ac5c340c48f2c4bb3ffa11713744be59" +dependencies = [ + "aliasable", + "ouroboros_macro", + "static_assertions", +] + +[[package]] +name = "ouroboros_macro" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c7028bdd3d43083f6d8d4d5187680d0d3560d54df4cc9d752005268b41e64d0" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "proc-macro2-diagnostics", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "parking" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" + +[[package]] +name = "parking_lot" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.6", +] + +[[package]] +name = "pem-rfc7468" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" +dependencies = [ + "base64ct", +] + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "pgvector" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc58e2d255979a31caa7cabfa7aac654af0354220719ab7a68520ae7a91e8c0b" +dependencies = [ + "serde", +] + +[[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 = "pkcs1" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" +dependencies = [ + "der", + "pkcs8", + "spki", +] + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + +[[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.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5a7c30837279ca13e7c867e9e40053bc68740f988cb07f7ca6df43cc734b585" +dependencies = [ + "zerovec", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "proc-macro-crate" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" +dependencies = [ + "toml_edit", +] + +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "proc-macro2" +version = "1.0.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "proc-macro2-diagnostics" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", + "version_check", + "yansi", +] + +[[package]] +name = "ptr_meta" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" +dependencies = [ + "ptr_meta_derive", +] + +[[package]] +name = "ptr_meta_derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +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 = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.16", +] + +[[package]] +name = "redox_syscall" +version = "0.5.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5407465600fb0548f1442edf71dd20683c6ed326200ace4b1ef0763521bb3b77" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23d7fd106d8c02486a8d64e778353d1cffe08ce79ac2e82f540c86d0facf6912" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.4.10", + "regex-syntax 0.8.6", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b9458fa0bfeeac22b5ca447c63aaf45f28439a709ccd244698632f9aa6394d6" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.6", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caf4aa5b0f434c91fe5c7f1ecb6a5ece2130b02ad2a590589dda5146df959001" + +[[package]] +name = "rend" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71fe3824f5629716b1589be05dacd749f6aa084c87e00e016714a8cdfccc997c" +dependencies = [ + "bytecheck", +] + +[[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 = "rkyv" +version = "0.7.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9008cd6385b9e161d8229e1f6549dd23c3d022f132a2ea37ac3a10ac4935779b" +dependencies = [ + "bitvec", + "bytecheck", + "bytes", + "hashbrown 0.12.3", + "ptr_meta", + "rend", + "rkyv_derive", + "seahash", + "tinyvec", + "uuid", +] + +[[package]] +name = "rkyv_derive" +version = "0.7.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "503d1d27590a2b0a3a4ca4c94755aa2875657196ecbf401a42eff41d7de532c0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "rsa" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78928ac1ed176a5ca1d17e578a1825f3d81ca54cf41053a592584b020cfd691b" +dependencies = [ + "const-oid", + "digest", + "num-bigint-dig", + "num-integer", + "num-traits", + "pkcs1", + "pkcs8", + "rand_core", + "signature", + "spki", + "subtle", + "zeroize", +] + +[[package]] +name = "rust_decimal" +version = "1.37.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b203a6425500a03e0919c42d3c47caca51e79f1132046626d2c8871c5092035d" +dependencies = [ + "arrayvec", + "borsh", + "bytes", + "num-traits", + "rand", + "rkyv", + "serde", + "serde_json", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustls" +version = "0.23.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ebcbd2f03de0fc1122ad9bb24b127a5a6cd51d72604a3f3c50ac459762b6cc" +dependencies = [ + "once_cell", + "ring", + "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.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a17884ae0c1b773f1ccd2bd4a8c72f16da897310a98b0e84bf349ad5ead92fc" +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 = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "sea-bae" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f694a6ab48f14bc063cfadff30ab551d3c7e46d8f81836c51989d548f44a2a25" +dependencies = [ + "heck 0.4.1", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "sea-orm" +version = "1.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34963b2d68331ef5fbc8aa28a53781471c15f90ba1ad4f2689d21ce8b9a9d1f1" +dependencies = [ + "async-stream", + "async-trait", + "bigdecimal", + "chrono", + "futures-util", + "log", + "ouroboros", + "pgvector", + "rust_decimal", + "sea-orm-macros", + "sea-query", + "sea-query-binder", + "serde", + "serde_json", + "sqlx", + "strum", + "thiserror 2.0.16", + "time", + "tracing", + "url", + "uuid", +] + +[[package]] +name = "sea-orm-cli" +version = "1.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edc17cb2b24e93fc1d56de7751a12222f2303c06e83ed4d7a1e929e39f30c7d7" +dependencies = [ + "chrono", + "clap", + "dotenvy", + "glob", + "regex", + "tracing", + "tracing-subscriber", + "url", +] + +[[package]] +name = "sea-orm-macros" +version = "1.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a489127c872766445b4e28f846825f89a076ac3af2591d1365503a68f93e974c" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "sea-bae", + "syn 2.0.106", + "unicode-ident", +] + +[[package]] +name = "sea-orm-migration" +version = "1.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "695e830a1332a4e3e57b5972eee00574a36060e1938afca7041a524e0955d5ba" +dependencies = [ + "async-trait", + "clap", + "dotenvy", + "sea-orm", + "sea-orm-cli", + "sea-schema", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "sea-query" +version = "0.32.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a5d1c518eaf5eda38e5773f902b26ab6d5e9e9e2bb2349ca6c64cf96f80448c" +dependencies = [ + "bigdecimal", + "chrono", + "inherent", + "ordered-float", + "rust_decimal", + "sea-query-derive", + "serde_json", + "time", + "uuid", +] + +[[package]] +name = "sea-query-binder" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0019f47430f7995af63deda77e238c17323359af241233ec768aba1faea7608" +dependencies = [ + "bigdecimal", + "chrono", + "rust_decimal", + "sea-query", + "serde_json", + "sqlx", + "time", + "uuid", +] + +[[package]] +name = "sea-query-derive" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bae0cbad6ab996955664982739354128c58d16e126114fe88c2a493642502aab" +dependencies = [ + "darling", + "heck 0.4.1", + "proc-macro2", + "quote", + "syn 2.0.106", + "thiserror 2.0.16", +] + +[[package]] +name = "sea-schema" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2239ff574c04858ca77485f112afea1a15e53135d3097d0c86509cef1def1338" +dependencies = [ + "futures", + "sea-query", + "sea-schema-derive", +] + +[[package]] +name = "sea-schema-derive" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "debdc8729c37fdbf88472f97fd470393089f997a909e535ff67c544d18cfccf0" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "seahash" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" + +[[package]] +name = "semver" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "serde_json" +version = "1.0.143" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d401abef1d108fbd9cbaebc3e46611f4b1021f714a0597a71f41ee463f5f4a5a" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_path_to_error" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59fab13f937fa393d08645bf3a84bdfe86e296747b506ada67bb15f10f218b2a" +dependencies = [ + "itoa", + "serde", +] + +[[package]] +name = "serde_spanned" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" +dependencies = [ + "serde", +] + +[[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 = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook-registry" +version = "1.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a4719bff48cee6b39d12c020eeb490953ad2443b7055bd0b21fca26bd8c28b" +dependencies = [ + "libc", +] + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest", + "rand_core", +] + +[[package]] +name = "simdutf8" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" + +[[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" +dependencies = [ + "serde", +] + +[[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 = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "sqlx" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fefb893899429669dcdd979aff487bd78f4064e5e7907e4269081e0ef7d97dc" +dependencies = [ + "sqlx-core", + "sqlx-macros", + "sqlx-mysql", + "sqlx-postgres", + "sqlx-sqlite", +] + +[[package]] +name = "sqlx-core" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee6798b1838b6a0f69c007c133b8df5866302197e404e8b6ee8ed3e3a5e68dc6" +dependencies = [ + "base64", + "bigdecimal", + "bytes", + "chrono", + "crc", + "crossbeam-queue", + "either", + "event-listener", + "futures-core", + "futures-intrusive", + "futures-io", + "futures-util", + "hashbrown 0.15.5", + "hashlink", + "indexmap", + "log", + "memchr", + "once_cell", + "percent-encoding", + "rust_decimal", + "rustls", + "serde", + "serde_json", + "sha2", + "smallvec", + "thiserror 2.0.16", + "time", + "tokio", + "tokio-stream", + "tracing", + "url", + "uuid", + "webpki-roots 0.26.11", +] + +[[package]] +name = "sqlx-macros" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2d452988ccaacfbf5e0bdbc348fb91d7c8af5bee192173ac3636b5fb6e6715d" +dependencies = [ + "proc-macro2", + "quote", + "sqlx-core", + "sqlx-macros-core", + "syn 2.0.106", +] + +[[package]] +name = "sqlx-macros-core" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19a9c1841124ac5a61741f96e1d9e2ec77424bf323962dd894bdb93f37d5219b" +dependencies = [ + "dotenvy", + "either", + "heck 0.5.0", + "hex", + "once_cell", + "proc-macro2", + "quote", + "serde", + "serde_json", + "sha2", + "sqlx-core", + "sqlx-mysql", + "sqlx-postgres", + "sqlx-sqlite", + "syn 2.0.106", + "tokio", + "url", +] + +[[package]] +name = "sqlx-mysql" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa003f0038df784eb8fecbbac13affe3da23b45194bd57dba231c8f48199c526" +dependencies = [ + "atoi", + "base64", + "bigdecimal", + "bitflags", + "byteorder", + "bytes", + "chrono", + "crc", + "digest", + "dotenvy", + "either", + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "generic-array", + "hex", + "hkdf", + "hmac", + "itoa", + "log", + "md-5", + "memchr", + "once_cell", + "percent-encoding", + "rand", + "rsa", + "rust_decimal", + "serde", + "sha1", + "sha2", + "smallvec", + "sqlx-core", + "stringprep", + "thiserror 2.0.16", + "time", + "tracing", + "uuid", + "whoami", +] + +[[package]] +name = "sqlx-postgres" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db58fcd5a53cf07c184b154801ff91347e4c30d17a3562a635ff028ad5deda46" +dependencies = [ + "atoi", + "base64", + "bigdecimal", + "bitflags", + "byteorder", + "chrono", + "crc", + "dotenvy", + "etcetera", + "futures-channel", + "futures-core", + "futures-util", + "hex", + "hkdf", + "hmac", + "home", + "itoa", + "log", + "md-5", + "memchr", + "num-bigint", + "once_cell", + "rand", + "rust_decimal", + "serde", + "serde_json", + "sha2", + "smallvec", + "sqlx-core", + "stringprep", + "thiserror 2.0.16", + "time", + "tracing", + "uuid", + "whoami", +] + +[[package]] +name = "sqlx-sqlite" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2d12fe70b2c1b4401038055f90f151b78208de1f9f89a7dbfd41587a10c3eea" +dependencies = [ + "atoi", + "chrono", + "flume", + "futures-channel", + "futures-core", + "futures-executor", + "futures-intrusive", + "futures-util", + "libsqlite3-sys", + "log", + "percent-encoding", + "serde", + "serde_urlencoded", + "sqlx-core", + "thiserror 2.0.16", + "time", + "tracing", + "url", + "uuid", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "stringprep" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b4df3d392d81bd458a8a621b8bffbd2302a12ffe288a9d931670948749463b1" +dependencies = [ + "unicode-bidi", + "unicode-normalization", + "unicode-properties", +] + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "strum" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.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 = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3467d614147380f2e4e374161426ff399c91084acd2363eaf549172b3d5e60c0" +dependencies = [ + "thiserror-impl 2.0.16", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c5e1be1c48b9172ee610da68fd9cd2770e7a4056cb3fc98710ee6906f0c7960" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "thread_local" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "time" +version = "0.3.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" + +[[package]] +name = "time-macros" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tinystr" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.47.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89e49afdadebb872d3145a5638b59eb0691ea23e46ca484037cfab3b76b95038" +dependencies = [ + "backtrace", + "bytes", + "io-uring", + "libc", + "mio", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "slab", + "socket2", + "tokio-macros", + "windows-sys 0.59.0", +] + +[[package]] +name = "tokio-macros" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "tokio-stream" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-tungstenite" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edc5f74e248dc973e0dbb7b74c7e0d6fcc301c694ff50049504004ef4d0cdcd9" +dependencies = [ + "futures-util", + "log", + "tokio", + "tungstenite", +] + +[[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 = "toml" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "toml_write", + "winnow", +] + +[[package]] +name = "toml_write" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" + +[[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", + "tracing", +] + +[[package]] +name = "tower-http" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adc82fd73de2a9722ac5da747f12383d2bfdb93591ee6c58486e0097890f05f2" +dependencies = [ + "bitflags", + "bytes", + "futures-core", + "futures-util", + "http", + "http-body", + "http-body-util", + "http-range-header", + "httpdate", + "mime", + "mime_guess", + "percent-encoding", + "pin-project-lite", + "tokio", + "tokio-util", + "tower-layer", + "tower-service", + "tracing", +] + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +dependencies = [ + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "tracing-core" +version = "0.1.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "tungstenite" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18e5b8366ee7a95b16d32197d0b2604b43a0be89dc5fac9f8e96ccafbaedda8a" +dependencies = [ + "byteorder", + "bytes", + "data-encoding", + "http", + "httparse", + "log", + "rand", + "sha1", + "thiserror 1.0.69", + "utf-8", +] + +[[package]] +name = "typenum" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "unicase" +version = "2.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" + +[[package]] +name = "unicode-bidi" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "unicode-normalization" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-properties" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0" + +[[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 = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "uuid" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f33196643e165781c20a5ead5582283a7dacbb87855d867fbc2df3f81eddc1be" +dependencies = [ + "getrandom 0.3.3", + "js-sys", + "serde", + "wasm-bindgen", +] + +[[package]] +name = "valuable" +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 = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[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.2+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +dependencies = [ + "wit-bindgen-rt", +] + +[[package]] +name = "wasite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" + +[[package]] +name = "wasm-bindgen" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn 2.0.106", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "webpki-roots" +version = "0.26.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "521bc38abb08001b01866da9f51eb7c5d647a19260e00054a8c7fd5f9e57f7a9" +dependencies = [ + "webpki-roots 1.0.2", +] + +[[package]] +name = "webpki-roots" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e8983c3ab33d6fb807cfcdad2491c4ea8cbc8ed839181c7dfd9c67c83e261b2" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "whoami" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d4a4db5077702ca3015d3d02d74974948aba2ad9e12ab7df718ee64ccd7e97d" +dependencies = [ + "libredox", + "wasite", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-core" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-implement" +version = "0.60.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "windows-interface" +version = "0.59.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "windows-link" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" + +[[package]] +name = "windows-result" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.3", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + +[[package]] +name = "winnow" +version = "0.7.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21a0236b59786fed61e2a80582dd500fe61f18b5dca67a4a067d0bc9039339cf" +dependencies = [ + "memchr", +] + +[[package]] +name = "wit-bindgen-rt" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" +dependencies = [ + "bitflags", +] + +[[package]] +name = "writeable" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "yansi" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" + +[[package]] +name = "yggman" +version = "0.1.0" +dependencies = [ + "anyhow", + "arc-swap", + "async-trait", + "axum", + "base64", + "chrono", + "clap", + "ed25519-dalek", + "envy", + "futures", + "futures-util", + "hex", + "hostname", + "lazy_static", + "network-interface", + "rand", + "sea-orm", + "sea-orm-migration", + "serde", + "serde_json", + "thiserror 2.0.16", + "tokio", + "tokio-tungstenite", + "toml", + "tower", + "tower-http", + "tracing", + "tracing-subscriber", + "uuid", +] + +[[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 2.0.106", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[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 2.0.106", + "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 2.0.106", +] diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..75d55a1 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,43 @@ +[package] +name = "yggman" +version = "0.1.0" +edition = "2021" + +[[bin]] +name = "yggman" +path = "src/main.rs" + +[[bin]] +name = "yggman-agent" +path = "src/agent.rs" + +[dependencies] +tokio = { version = "1.41", features = ["full"] } +anyhow = "1.0" +thiserror = "2.0" +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" +toml = "0.8" +tracing = "0.1" +tracing-subscriber = { version = "0.3", features = ["env-filter"] } +arc-swap = "1.7" +async-trait = "0.1" +futures = "0.3" +axum = { version = "0.7", features = ["ws"] } +tower = "0.5" +tower-http = { version = "0.6", features = ["cors", "fs"] } +ed25519-dalek = "2.1" +rand = "0.8" +base64 = "0.22" +hex = "0.4" +clap = { version = "4.5", features = ["derive", "env"] } +envy = "0.4" +sea-orm = { version = "1.1", features = ["sqlx-sqlite", "sqlx-postgres", "runtime-tokio-rustls", "macros"] } +migration = { version = "1.1", package = "sea-orm-migration" } +uuid = { version = "1.10", features = ["v4", "serde"] } +chrono = { version = "0.4", features = ["serde"] } +tokio-tungstenite = "0.24" +futures-util = "0.3" +network-interface = "2.0" +hostname = "0.4" +lazy_static = "1.5" diff --git a/config.example.toml b/config.example.toml new file mode 100644 index 0000000..c6608d3 --- /dev/null +++ b/config.example.toml @@ -0,0 +1,24 @@ +[server] +bind_address = "0.0.0.0" +port = 8080 +workers = 4 + +[database] +url = "sqlite://yggman.db" +max_connections = 10 +connect_timeout = 30 +acquire_timeout = 30 +idle_timeout = 600 +max_lifetime = 3600 + +[nodes] +max_peers_per_node = 3 +topology_update_interval = 60 + +[modules.web_api] +enabled = true +port = 8081 + +[modules.web_ui] +enabled = true +static_dir = "./static" \ No newline at end of file diff --git a/src/agent.rs b/src/agent.rs new file mode 100644 index 0000000..6a4339e --- /dev/null +++ b/src/agent.rs @@ -0,0 +1,254 @@ +use anyhow::Result; +use clap::Parser; +use futures_util::{SinkExt, StreamExt}; +use network_interface::{NetworkInterface, NetworkInterfaceConfig}; +use serde::{Deserialize, Serialize}; +use std::time::Duration; +use tokio::time::sleep; +use tokio_tungstenite::{connect_async, tungstenite::Message}; +use tracing::{error, info, warn, debug}; + +#[derive(Parser, Debug)] +#[command( + name = "yggman-agent", + about = "Yggdrasil network agent for automatic node configuration" +)] +struct Args { + /// Control plane server URL (e.g., ws://localhost:8080/ws/agent) + #[arg(short, long)] + server: String, + + /// Node name (optional, will use hostname if not provided) + #[arg(short, long)] + name: Option, + + /// Log level (trace, debug, info, warn, error) + #[arg(long, default_value = "info")] + log_level: String, + + /// Reconnect interval in seconds + #[arg(long, default_value = "5")] + reconnect_interval: u64, +} + +#[derive(Debug, Serialize, Deserialize)] +#[serde(tag = "type")] +enum AgentMessage { + Register { + name: String, + addresses: Vec, + }, + Heartbeat, + UpdateAddresses { + addresses: Vec, + }, +} + +#[derive(Debug, Serialize, Deserialize)] +#[serde(tag = "type")] +enum ServerMessage { + Config { + node_id: String, + private_key: String, + listen: Vec, + peers: Vec, + allowed_public_keys: Vec, + }, + Update { + peers: Vec, + allowed_public_keys: Vec, + }, + Error { + message: String, + }, +} + +#[tokio::main] +async fn main() -> Result<()> { + let args = Args::parse(); + + // Initialize tracing + tracing_subscriber::fmt() + .with_max_level(args.log_level.parse::()?) + .init(); + + info!("Starting yggman-agent v{}", env!("CARGO_PKG_VERSION")); + info!("Connecting to control plane: {}", args.server); + + // Main loop with reconnection logic + loop { + match run_agent(&args).await { + Ok(_) => { + info!("Agent connection closed normally"); + } + Err(e) => { + error!("Agent error: {}", e); + } + } + + info!( + "Reconnecting in {} seconds...", + args.reconnect_interval + ); + sleep(Duration::from_secs(args.reconnect_interval)).await; + } +} + +async fn run_agent(args: &Args) -> Result<()> { + // Get node name + let node_name = args.name.clone().unwrap_or_else(|| { + hostname::get() + .map(|h| h.to_string_lossy().to_string()) + .unwrap_or_else(|_| "unknown".to_string()) + }); + + // Discover network interfaces + let addresses = discover_addresses()?; + info!("Discovered addresses: {:?}", addresses); + + // Connect to WebSocket + let (ws_stream, _) = connect_async(&args.server).await?; + info!("Connected to control plane"); + + let (mut write, mut read) = ws_stream.split(); + + // Send registration message + let register_msg = AgentMessage::Register { + name: node_name.clone(), + addresses: addresses.clone(), + }; + + let json = serde_json::to_string(®ister_msg)?; + write.send(Message::Text(json)).await?; + info!("Sent registration for node: {}", node_name); + + // Spawn heartbeat task + let (heartbeat_tx, mut heartbeat_rx) = tokio::sync::mpsc::channel(1); + tokio::spawn(async move { + let mut interval = tokio::time::interval(Duration::from_secs(30)); + loop { + interval.tick().await; + if heartbeat_tx.send(()).await.is_err() { + break; + } + } + }); + + // Main message loop + loop { + tokio::select! { + msg = read.next() => { + match msg { + Some(Ok(Message::Text(text))) => { + match serde_json::from_str::(&text) { + Ok(server_msg) => handle_server_message(server_msg).await?, + Err(e) => warn!("Failed to parse server message: {}", e), + } + } + Some(Ok(Message::Close(_))) => { + info!("Server closed connection"); + break; + } + Some(Err(e)) => { + error!("WebSocket error: {}", e); + break; + } + None => { + info!("WebSocket stream ended"); + break; + } + _ => {} + } + } + _ = heartbeat_rx.recv() => { + let heartbeat = serde_json::to_string(&AgentMessage::Heartbeat)?; + if let Err(e) = write.send(Message::Text(heartbeat)).await { + error!("Failed to send heartbeat: {}", e); + break; + } + debug!("Sent heartbeat"); + } + } + } + + Ok(()) +} + +async fn handle_server_message(msg: ServerMessage) -> Result<()> { + match msg { + ServerMessage::Config { + node_id, + private_key, + listen, + peers, + allowed_public_keys, + } => { + info!("Received initial configuration:"); + info!(" Node ID: {}", node_id); + info!(" Private Key: {}...", &private_key[..16]); + info!(" Listen endpoints: {:?}", listen); + info!(" Peers: {} configured", peers.len()); + for peer in &peers { + debug!(" - {}", peer); + } + info!(" Allowed keys: {} configured", allowed_public_keys.len()); + + // TODO: Apply configuration to Yggdrasil + info!("Configuration received (not yet applied)"); + } + ServerMessage::Update { + peers, + allowed_public_keys, + } => { + info!("Received configuration update:"); + info!(" Updated peers: {} configured", peers.len()); + for peer in &peers { + debug!(" - {}", peer); + } + info!(" Updated allowed keys: {} configured", allowed_public_keys.len()); + + // TODO: Apply configuration update to Yggdrasil + info!("Configuration update received (not yet applied)"); + } + ServerMessage::Error { message } => { + error!("Server error: {}", message); + } + } + + Ok(()) +} + +fn discover_addresses() -> Result> { + let interfaces = NetworkInterface::show()?; + let mut addresses = Vec::new(); + + for interface in interfaces { + // Skip loopback and down interfaces + if interface.name.starts_with("lo") { + continue; + } + + for addr in interface.addr { + match addr { + network_interface::Addr::V4(v4) => { + let ip = v4.ip.to_string(); + // Skip link-local and private addresses for now + // In production, you might want to be more selective + if !ip.starts_with("127.") && !ip.starts_with("169.254.") { + addresses.push(ip); + } + } + network_interface::Addr::V6(v6) => { + let ip = v6.ip.to_string(); + // Skip link-local IPv6 + if !ip.starts_with("fe80:") && !ip.starts_with("::1") { + addresses.push(ip); + } + } + } + } + } + + // If no addresses found, return empty vec (will use localhost) + Ok(addresses) +} \ No newline at end of file diff --git a/src/cli.rs b/src/cli.rs new file mode 100644 index 0000000..f1b5177 --- /dev/null +++ b/src/cli.rs @@ -0,0 +1,140 @@ +use clap::Parser; +use serde::{Deserialize, Serialize}; + +#[derive(Parser, Debug)] +#[command( + name = "yggman", + version = env!("CARGO_PKG_VERSION"), + about = "Yggdrasil Network Control Plane Manager", + long_about = "A centralized control plane for managing Yggdrasil node configurations and mesh topology" +)] +pub struct CliArgs { + /// Configuration file path + #[arg(short, long, default_value = "config.toml", env = "YGGMAN_CONFIG")] + pub config: String, + + /// Server bind address + #[arg(long, env = "YGGMAN_BIND_ADDRESS")] + pub bind_address: Option, + + /// Server port + #[arg(short, long, env = "YGGMAN_PORT")] + pub port: Option, + + /// Number of worker threads + #[arg(long, env = "YGGMAN_WORKERS")] + pub workers: Option, + + /// Database URL (SQLite: sqlite://path.db, PostgreSQL: postgresql://user:pass@host:port/db) + #[arg(long, env = "YGGMAN_DATABASE_URL")] + pub database_url: Option, + + /// Maximum database connections + #[arg(long, env = "YGGMAN_MAX_DB_CONNECTIONS")] + pub max_db_connections: Option, + + /// Maximum peers per node + #[arg(long, env = "YGGMAN_MAX_PEERS")] + pub max_peers: Option, + + /// Topology update interval in seconds + #[arg(long, env = "YGGMAN_TOPOLOGY_UPDATE_INTERVAL")] + pub topology_update_interval: Option, + + /// Log level (trace, debug, info, warn, error) + #[arg(long, default_value = "info", env = "YGGMAN_LOG_LEVEL")] + pub log_level: String, + + /// Enable debug mode + #[arg(long, env = "YGGMAN_DEBUG")] + pub debug: bool, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct EnvConfig { + #[serde(default)] + pub server: EnvServerConfig, + + #[serde(default)] + pub database: EnvDatabaseConfig, + + #[serde(default)] + pub nodes: EnvNodesConfig, + + #[serde(default)] + pub log_level: Option, + + #[serde(default)] + pub debug: Option, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct EnvServerConfig { + pub bind_address: Option, + pub port: Option, + pub workers: Option, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct EnvDatabaseConfig { + pub url: Option, + pub max_connections: Option, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct EnvNodesConfig { + pub max_peers_per_node: Option, + pub topology_update_interval: Option, +} + +impl Default for EnvConfig { + fn default() -> Self { + Self { + server: EnvServerConfig::default(), + database: EnvDatabaseConfig::default(), + nodes: EnvNodesConfig::default(), + log_level: None, + debug: None, + } + } +} + +impl Default for EnvServerConfig { + fn default() -> Self { + Self { + bind_address: None, + port: None, + workers: None, + } + } +} + +impl Default for EnvDatabaseConfig { + fn default() -> Self { + Self { + url: None, + max_connections: None, + } + } +} + +impl Default for EnvNodesConfig { + fn default() -> Self { + Self { + max_peers_per_node: None, + topology_update_interval: None, + } + } +} + +impl CliArgs { + pub fn parse_args() -> Self { + Self::parse() + } +} + +/// Load environment variables with YGGMAN_ prefix +pub fn load_env_config() -> Result { + envy::prefixed("YGGMAN_").from_env::() +} + diff --git a/src/config/mod.rs b/src/config/mod.rs new file mode 100644 index 0000000..bb7efda --- /dev/null +++ b/src/config/mod.rs @@ -0,0 +1,169 @@ +use serde::{Deserialize, Serialize}; +use std::collections::HashMap; +use arc_swap::ArcSwap; +use std::sync::Arc; +use crate::cli::{CliArgs, EnvConfig}; + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct AppConfig { + #[serde(default)] + pub server: ServerConfig, + + #[serde(default)] + pub database: DatabaseConfig, + + #[serde(default)] + pub nodes: NodesConfig, + + #[serde(default)] + pub modules: HashMap, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct ServerConfig { + pub bind_address: String, + pub port: u16, + pub workers: usize, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct DatabaseConfig { + pub url: String, + pub max_connections: u32, + pub connect_timeout: u64, + pub acquire_timeout: u64, + pub idle_timeout: u64, + pub max_lifetime: u64, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct NodesConfig { + pub max_peers_per_node: usize, + pub topology_update_interval: u64, + pub default_listen_endpoints: Vec, +} + +impl Default for ServerConfig { + fn default() -> Self { + Self { + bind_address: "127.0.0.1".to_string(), + port: 8080, + workers: 4, + } + } +} + +impl Default for DatabaseConfig { + fn default() -> Self { + Self { + url: "sqlite://yggman.db".to_string(), + max_connections: 10, + connect_timeout: 30, + acquire_timeout: 30, + idle_timeout: 600, + max_lifetime: 3600, + } + } +} + +impl Default for NodesConfig { + fn default() -> Self { + Self { + max_peers_per_node: 3, + topology_update_interval: 60, + default_listen_endpoints: vec!["tcp://0.0.0.0:9001".to_string()], + } + } +} + +impl Default for AppConfig { + fn default() -> Self { + Self { + server: ServerConfig::default(), + database: DatabaseConfig::default(), + nodes: NodesConfig::default(), + modules: HashMap::new(), + } + } +} + +pub struct ConfigManager { + config: Arc>, +} + +impl ConfigManager { + pub fn new(config: AppConfig) -> Self { + Self { + config: Arc::new(ArcSwap::from_pointee(config)), + } + } + + pub fn get(&self) -> Arc { + self.config.load_full() + } + + + /// Load configuration from multiple sources with precedence: + /// CLI args > Environment variables > Config file > Defaults + pub fn load_merged_config(cli_args: &CliArgs, env_config: &EnvConfig) -> Result { + // Start with default config + let mut config = AppConfig::default(); + + // Load from config file if it exists + if std::path::Path::new(&cli_args.config).exists() { + let content = std::fs::read_to_string(&cli_args.config) + .map_err(|e| crate::error::AppError::Config(format!("Failed to read config file: {}", e)))?; + + config = toml::from_str(&content) + .map_err(|e| crate::error::AppError::Config(format!("Failed to parse config file: {}", e)))?; + } + + // Override with environment variables + if let Some(bind_address) = &env_config.server.bind_address { + config.server.bind_address = bind_address.clone(); + } + if let Some(port) = env_config.server.port { + config.server.port = port; + } + if let Some(workers) = env_config.server.workers { + config.server.workers = workers; + } + if let Some(db_url) = &env_config.database.url { + config.database.url = db_url.clone(); + } + if let Some(max_connections) = env_config.database.max_connections { + config.database.max_connections = max_connections; + } + if let Some(max_peers) = env_config.nodes.max_peers_per_node { + config.nodes.max_peers_per_node = max_peers; + } + if let Some(topology_update) = env_config.nodes.topology_update_interval { + config.nodes.topology_update_interval = topology_update; + } + + // Override with CLI arguments (highest priority) + if let Some(bind_address) = &cli_args.bind_address { + config.server.bind_address = bind_address.clone(); + } + if let Some(port) = cli_args.port { + config.server.port = port; + } + if let Some(workers) = cli_args.workers { + config.server.workers = workers; + } + if let Some(db_url) = &cli_args.database_url { + config.database.url = db_url.clone(); + } + if let Some(max_connections) = cli_args.max_db_connections { + config.database.max_connections = max_connections; + } + if let Some(max_peers) = cli_args.max_peers { + config.nodes.max_peers_per_node = max_peers; + } + if let Some(topology_update) = cli_args.topology_update_interval { + config.nodes.topology_update_interval = topology_update; + } + + Ok(config) + } +} \ No newline at end of file diff --git a/src/core/app.rs b/src/core/app.rs new file mode 100644 index 0000000..c70fb58 --- /dev/null +++ b/src/core/app.rs @@ -0,0 +1,53 @@ +use std::sync::Arc; +use crate::config::{AppConfig, ConfigManager}; +use crate::core::context::AppContext; +use crate::core::module::ModuleManager; +use crate::error::Result; +use tokio::signal; + +pub struct Application { + module_manager: ModuleManager, +} + +impl Application { + pub fn new(config: AppConfig) -> Self { + let config_manager = Arc::new(ConfigManager::new(config)); + let context = Arc::new(AppContext::new(config_manager)); + let module_manager = ModuleManager::new(context); + + Self { + module_manager, + } + } + + pub fn register_module(&mut self, module: Box) { + self.module_manager.register(module); + } + + pub async fn run(mut self) -> Result<()> { + tracing::info!("Starting application"); + + self.module_manager.init_all().await?; + + self.module_manager.start_all().await?; + + tokio::select! { + _ = signal::ctrl_c() => { + tracing::info!("Received SIGINT, shutting down"); + } + } + + self.shutdown().await?; + + Ok(()) + } + + async fn shutdown(self) -> Result<()> { + tracing::info!("Shutting down application"); + + self.module_manager.stop_all().await?; + + tracing::info!("Application shutdown complete"); + Ok(()) + } +} \ No newline at end of file diff --git a/src/core/context.rs b/src/core/context.rs new file mode 100644 index 0000000..c54020a --- /dev/null +++ b/src/core/context.rs @@ -0,0 +1,14 @@ +use std::sync::Arc; +use crate::config::ConfigManager; + +pub struct AppContext { + pub config_manager: Arc, +} + +impl AppContext { + pub fn new(config_manager: Arc) -> Self { + Self { + config_manager, + } + } +} \ No newline at end of file diff --git a/src/core/mod.rs b/src/core/mod.rs new file mode 100644 index 0000000..cc5a795 --- /dev/null +++ b/src/core/mod.rs @@ -0,0 +1,3 @@ +pub mod app; +pub mod context; +pub mod module; \ No newline at end of file diff --git a/src/core/module.rs b/src/core/module.rs new file mode 100644 index 0000000..5da35ba --- /dev/null +++ b/src/core/module.rs @@ -0,0 +1,57 @@ +use async_trait::async_trait; +use std::sync::Arc; +use crate::core::context::AppContext; +use crate::error::Result; + +#[async_trait] +pub trait Module: Send + Sync { + fn name(&self) -> &str; + + async fn init(&mut self, context: Arc) -> Result<()>; + + async fn start(&self) -> Result<()>; + + async fn stop(&self) -> Result<()>; +} + +pub struct ModuleManager { + modules: Vec>, + context: Arc, +} + +impl ModuleManager { + pub fn new(context: Arc) -> Self { + Self { + modules: Vec::new(), + context, + } + } + + pub fn register(&mut self, module: Box) { + self.modules.push(module); + } + + pub async fn init_all(&mut self) -> Result<()> { + for module in &mut self.modules { + tracing::info!("Initializing module: {}", module.name()); + module.init(self.context.clone()).await?; + } + Ok(()) + } + + pub async fn start_all(&self) -> Result<()> { + for module in &self.modules { + tracing::info!("Starting module: {}", module.name()); + module.start().await?; + } + Ok(()) + } + + pub async fn stop_all(&self) -> Result<()> { + for module in self.modules.iter().rev() { + tracing::info!("Stopping module: {}", module.name()); + module.stop().await?; + } + Ok(()) + } +} \ No newline at end of file diff --git a/src/database/connection.rs b/src/database/connection.rs new file mode 100644 index 0000000..f14be3f --- /dev/null +++ b/src/database/connection.rs @@ -0,0 +1,64 @@ +use sea_orm::{Database, DatabaseConnection, DbErr, ConnectionTrait}; +use sea_orm::{Schema, DbBackend, Statement}; +use migration::prelude::{SqliteQueryBuilder, PostgresQueryBuilder, MysqlQueryBuilder}; +use std::time::Duration; +use std::path::Path; +use crate::config::DatabaseConfig; + +pub async fn create_connection(config: &DatabaseConfig) -> Result { + // Create SQLite database file if it doesn't exist + if config.url.starts_with("sqlite://") { + let db_path = config.url.strip_prefix("sqlite://").unwrap_or(&config.url); + + // Create parent directories if they don't exist + if let Some(parent) = Path::new(db_path).parent() { + if !parent.exists() { + std::fs::create_dir_all(parent) + .map_err(|e| DbErr::Custom(format!("Failed to create database directory: {}", e)))?; + } + } + + // Create empty database file if it doesn't exist + if !Path::new(db_path).exists() { + std::fs::File::create(db_path) + .map_err(|e| DbErr::Custom(format!("Failed to create database file: {}", e)))?; + tracing::info!("Created SQLite database file: {}", db_path); + } + } + + let mut options = sea_orm::ConnectOptions::new(&config.url); + + options + .max_connections(config.max_connections) + .min_connections(1) + .connect_timeout(Duration::from_secs(config.connect_timeout)) + .acquire_timeout(Duration::from_secs(config.acquire_timeout)) + .idle_timeout(Duration::from_secs(config.idle_timeout)) + .max_lifetime(Duration::from_secs(config.max_lifetime)) + .sqlx_logging(true) + .sqlx_logging_level(tracing::log::LevelFilter::Debug); + + Database::connect(options).await +} + +pub async fn migrate_database(db: &DatabaseConnection) -> Result<(), DbErr> { + // Get the database backend + let backend = db.get_database_backend(); + let schema = Schema::new(backend); + + // Create nodes table if it doesn't exist + let mut create_table_stmt = schema.create_table_from_entity(crate::database::entities::node::Entity); + + // Convert to SQL + let sql = match backend { + DbBackend::Sqlite => create_table_stmt.if_not_exists().to_string(SqliteQueryBuilder), + DbBackend::Postgres => create_table_stmt.if_not_exists().to_string(PostgresQueryBuilder), + DbBackend::MySql => create_table_stmt.if_not_exists().to_string(MysqlQueryBuilder), + }; + + // Execute the statement + db.execute(Statement::from_string(backend, sql)).await?; + + tracing::info!("Database migration completed"); + Ok(()) +} \ No newline at end of file diff --git a/src/database/entities/mod.rs b/src/database/entities/mod.rs new file mode 100644 index 0000000..12e2c60 --- /dev/null +++ b/src/database/entities/mod.rs @@ -0,0 +1 @@ +pub mod node; \ No newline at end of file diff --git a/src/database/entities/node.rs b/src/database/entities/node.rs new file mode 100644 index 0000000..e178b60 --- /dev/null +++ b/src/database/entities/node.rs @@ -0,0 +1,82 @@ +use sea_orm::entity::prelude::*; +use sea_orm::Set; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)] +#[sea_orm(table_name = "nodes")] +pub struct Model { + #[sea_orm(primary_key, auto_increment = false)] + pub id: String, + pub name: String, + pub public_key: String, + pub private_key: String, + pub listen: String, // JSON array stored as string + pub addresses: String, // JSON array stored as string + pub created_at: DateTimeUtc, + pub updated_at: DateTimeUtc, +} + +#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] +pub enum Relation {} + +impl ActiveModelBehavior for ActiveModel { + fn new() -> Self { + Self { + id: Set(uuid::Uuid::new_v4().to_string()), + created_at: Set(chrono::Utc::now()), + updated_at: Set(chrono::Utc::now()), + ..ActiveModelTrait::default() + } + } + + fn before_save<'life0, 'async_trait, C>( + mut self, + _db: &'life0 C, + _insert: bool, + ) -> core::pin::Pin> + core::marker::Send + 'async_trait>> + where + 'life0: 'async_trait, + C: 'async_trait + ConnectionTrait, + Self: 'async_trait, + { + Box::pin(async move { + self.updated_at = Set(chrono::Utc::now()); + Ok(self) + }) + } +} + +// Conversion functions between database model and domain model +impl From for crate::yggdrasil::Node { + fn from(model: Model) -> Self { + let listen: Vec = serde_json::from_str(&model.listen).unwrap_or_default(); + let addresses: Vec = serde_json::from_str(&model.addresses).unwrap_or_default(); + + crate::yggdrasil::Node { + id: model.id, + name: model.name, + public_key: model.public_key, + private_key: model.private_key, + listen, + addresses, + } + } +} + +impl From<&crate::yggdrasil::Node> for ActiveModel { + fn from(node: &crate::yggdrasil::Node) -> Self { + let listen = serde_json::to_string(&node.listen).unwrap_or_default(); + let addresses = serde_json::to_string(&node.addresses).unwrap_or_default(); + + ActiveModel { + id: Set(node.id.clone()), + name: Set(node.name.clone()), + public_key: Set(node.public_key.clone()), + private_key: Set(node.private_key.clone()), + listen: Set(listen), + addresses: Set(addresses), + created_at: Set(chrono::Utc::now()), + updated_at: Set(chrono::Utc::now()), + } + } +} \ No newline at end of file diff --git a/src/database/mod.rs b/src/database/mod.rs new file mode 100644 index 0000000..09d2126 --- /dev/null +++ b/src/database/mod.rs @@ -0,0 +1,4 @@ +pub mod entities; +pub mod connection; + +pub use connection::*; \ No newline at end of file diff --git a/src/error.rs b/src/error.rs new file mode 100644 index 0000000..2f61021 --- /dev/null +++ b/src/error.rs @@ -0,0 +1,15 @@ +use thiserror::Error; + +#[derive(Error, Debug)] +pub enum AppError { + #[error("Configuration error: {0}")] + Config(String), + + #[error("IO error: {0}")] + Io(#[from] std::io::Error), + + #[error("Serialization error: {0}")] + Serialization(#[from] serde_json::Error), +} + +pub type Result = std::result::Result; \ No newline at end of file diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..e5fa4c3 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,63 @@ +mod cli; +mod config; +mod core; +mod database; +mod error; +mod modules; +mod node_manager; +mod yggdrasil; +mod websocket_state; + +use anyhow::Result; +use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt}; + +#[tokio::main] +async fn main() -> Result<()> { + // Parse command line arguments + let cli_args = cli::CliArgs::parse_args(); + + // Load environment variables with YGGMAN_ prefix + let env_config = cli::load_env_config() + .unwrap_or_else(|_| cli::EnvConfig::default()); + + // Initialize tracing with log level from CLI or env + let log_level = if cli_args.debug { + "debug" + } else { + &cli_args.log_level + }; + + tracing_subscriber::registry() + .with( + tracing_subscriber::EnvFilter::try_from_default_env() + .unwrap_or_else(|_| format!("yggman={},info", log_level).into()), + ) + .with(tracing_subscriber::fmt::layer()) + .init(); + + tracing::info!("Starting yggman v{}", env!("CARGO_PKG_VERSION")); + tracing::debug!("CLI args: {:?}", cli_args); + tracing::debug!("Environment config: {:?}", env_config); + + // Load merged configuration + let config = config::ConfigManager::load_merged_config(&cli_args, &env_config)?; + tracing::info!("Configuration loaded from: CLI args, env vars, config file: {}", cli_args.config); + tracing::info!("Database URL: {}", config.database.url); + + // Initialize database connection + let db = database::create_connection(&config.database).await + .map_err(|e| anyhow::anyhow!("Failed to connect to database: {}", e))?; + tracing::info!("Database connection established"); + + // Run migrations + database::migrate_database(&db).await + .map_err(|e| anyhow::anyhow!("Failed to migrate database: {}", e))?; + + let mut app = core::app::Application::new(config); + + app.register_module(Box::new(modules::web::WebModule::new(db))); + + app.run().await?; + + Ok(()) +} diff --git a/src/modules/example.rs b/src/modules/example.rs new file mode 100644 index 0000000..ac29267 --- /dev/null +++ b/src/modules/example.rs @@ -0,0 +1,40 @@ +use async_trait::async_trait; +use std::sync::Arc; +use crate::core::context::AppContext; +use crate::core::module::Module; +use crate::error::Result; + +pub struct ExampleModule { + name: String, + context: Option>, +} + + +#[async_trait] +impl Module for ExampleModule { + fn name(&self) -> &str { + &self.name + } + + async fn init(&mut self, context: Arc) -> Result<()> { + self.context = Some(context); + tracing::debug!("Example module initialized"); + Ok(()) + } + + async fn start(&self) -> Result<()> { + tracing::debug!("Example module started"); + + if let Some(ctx) = &self.context { + let config = ctx.config_manager.get(); + tracing::debug!("Current config: {:?}", config); + } + + Ok(()) + } + + async fn stop(&self) -> Result<()> { + tracing::debug!("Example module stopped"); + Ok(()) + } +} \ No newline at end of file diff --git a/src/modules/mod.rs b/src/modules/mod.rs new file mode 100644 index 0000000..6eb7283 --- /dev/null +++ b/src/modules/mod.rs @@ -0,0 +1,3 @@ +pub mod example; +pub mod web; +pub mod websocket; \ No newline at end of file diff --git a/src/modules/web.rs b/src/modules/web.rs new file mode 100644 index 0000000..7818129 --- /dev/null +++ b/src/modules/web.rs @@ -0,0 +1,273 @@ +use async_trait::async_trait; +use axum::{ + extract::{State, Path, WebSocketUpgrade}, + http::StatusCode, + response::{Html, Json, Response}, + routing::{get, post, put, delete}, + Router, +}; +use std::sync::Arc; +use tower_http::cors::CorsLayer; +use sea_orm::DatabaseConnection; + +use crate::core::context::AppContext; +use crate::core::module::Module; +use crate::error::Result; +use crate::node_manager::NodeManager; +use crate::yggdrasil::{Node, YggdrasilConfig}; + +pub struct WebModule { + name: String, + context: Option>, + node_manager: Arc, +} + +impl WebModule { + pub fn new(db: DatabaseConnection) -> Self { + Self { + name: "web".to_string(), + context: None, + node_manager: Arc::new(NodeManager::new(db)), + } + } +} + +#[async_trait] +impl Module for WebModule { + fn name(&self) -> &str { + &self.name + } + + async fn init(&mut self, context: Arc) -> Result<()> { + self.context = Some(context); + tracing::info!("Web module initialized"); + Ok(()) + } + + async fn start(&self) -> Result<()> { + let context = self.context.as_ref().unwrap(); + let config = context.config_manager.get(); + let port = config.server.port; + + tracing::info!("Starting web server on port {}", port); + + let node_manager = self.node_manager.clone(); + + let app = Router::new() + .route("/", get(index_handler)) + .route("/api/nodes", get(get_nodes_handler)) + .route("/api/nodes", post(add_node_handler)) + .route("/api/nodes/:id", get(get_node_handler)) + .route("/api/nodes/:id", put(update_node_handler)) + .route("/api/nodes/:id", delete(delete_node_handler)) + .route("/api/configs", get(get_configs_handler)) + .route("/api/nodes/:id/config", get(get_node_config_handler)) + .route("/ws/agent", get(ws_agent_handler)) + .layer(CorsLayer::permissive()) + .with_state(node_manager); + + let bind_addr = format!("{}:{}", config.server.bind_address, port); + let listener = tokio::net::TcpListener::bind(&bind_addr) + .await + .map_err(|e| crate::error::AppError::Io(e))?; + + tokio::spawn(async move { + axum::serve(listener, app) + .await + .expect("Failed to run web server"); + }); + + Ok(()) + } + + async fn stop(&self) -> Result<()> { + tracing::info!("Web module stopped"); + Ok(()) + } +} + +async fn index_handler() -> Html<&'static str> { + Html(include_str!("../../static/index.html")) +} + +#[derive(serde::Serialize)] +struct NodesResponse { + nodes: Vec, +} + +async fn get_nodes_handler( + State(node_manager): State>, +) -> Json { + let nodes = node_manager.get_all_nodes().await; + Json(NodesResponse { nodes }) +} + +#[derive(serde::Deserialize)] +struct AddNodeRequest { + name: String, + listen: Vec, + addresses: Vec, +} + +#[derive(serde::Serialize)] +struct AddNodeResponse { + success: bool, + message: String, +} + +async fn add_node_handler( + State(node_manager): State>, + Json(payload): Json, +) -> Json { + match node_manager.add_node(payload.name, payload.listen, payload.addresses).await { + Ok(_) => { + // Broadcast update to all connected agents + crate::websocket_state::broadcast_configuration_update(&node_manager).await; + + Json(AddNodeResponse { + success: true, + message: "Node added successfully".to_string(), + }) + } + Err(e) => Json(AddNodeResponse { + success: false, + message: format!("Failed to add node: {}", e), + }), + } +} + +#[derive(serde::Serialize)] +struct ConfigsResponse { + configs: Vec, +} + +#[derive(serde::Serialize)] +struct NodeConfig { + node_id: String, + node_name: String, + node_addresses: Vec, + config: YggdrasilConfig, +} + +async fn get_configs_handler( + State(node_manager): State>, +) -> Json { + let nodes = node_manager.get_all_nodes().await; + let configs_map = node_manager.generate_configs().await; + + let mut configs = Vec::new(); + for node in nodes { + if let Some(config) = configs_map.get(&node.id) { + configs.push(NodeConfig { + node_id: node.id.clone(), + node_name: node.name.clone(), + node_addresses: node.addresses.clone(), + config: config.clone(), + }); + } + } + + Json(ConfigsResponse { configs }) +} + +// Get single node handler +async fn get_node_handler( + State(node_manager): State>, + Path(node_id): Path, +) -> std::result::Result, StatusCode> { + match node_manager.get_node_by_id(&node_id).await { + Some(node) => Ok(Json(node)), + None => Err(StatusCode::NOT_FOUND), + } +} + +// Update node handler +async fn update_node_handler( + State(node_manager): State>, + Path(node_id): Path, + Json(payload): Json, +) -> std::result::Result, StatusCode> { + match node_manager.update_node(&node_id, payload.name, payload.listen, payload.addresses).await { + Ok(_) => { + // Broadcast update to all connected agents + crate::websocket_state::broadcast_configuration_update(&node_manager).await; + + Ok(Json(AddNodeResponse { + success: true, + message: "Node updated successfully".to_string(), + })) + } + Err(e) => { + if e.to_string().contains("Node not found") { + Err(StatusCode::NOT_FOUND) + } else { + Ok(Json(AddNodeResponse { + success: false, + message: format!("Failed to update node: {}", e), + })) + } + } + } +} + +// Delete node handler +async fn delete_node_handler( + State(node_manager): State>, + Path(node_id): Path, +) -> std::result::Result, StatusCode> { + match node_manager.remove_node(&node_id).await { + Ok(_) => { + // Broadcast update to all connected agents + crate::websocket_state::broadcast_configuration_update(&node_manager).await; + + Ok(Json(AddNodeResponse { + success: true, + message: "Node deleted successfully".to_string(), + })) + } + Err(e) => { + if e.to_string().contains("Node not found") { + Err(StatusCode::NOT_FOUND) + } else { + Ok(Json(AddNodeResponse { + success: false, + message: format!("Failed to delete node: {}", e), + })) + } + } + } +} + +// Get node configuration for agent +async fn get_node_config_handler( + State(node_manager): State>, + Path(node_id): Path, +) -> std::result::Result, StatusCode> { + // Get the node + let node = match node_manager.get_node_by_id(&node_id).await { + Some(node) => node, + None => return Err(StatusCode::NOT_FOUND), + }; + + // Generate configurations for all nodes + let configs_map = node_manager.generate_configs().await; + + // Get config for this specific node + match configs_map.get(&node_id) { + Some(config) => Ok(Json(NodeConfig { + node_id: node.id.clone(), + node_name: node.name.clone(), + node_addresses: node.addresses.clone(), + config: config.clone(), + })), + None => Err(StatusCode::INTERNAL_SERVER_ERROR), + } +} + +// WebSocket handler for agents +async fn ws_agent_handler( + ws: WebSocketUpgrade, + State(node_manager): State>, +) -> Response { + ws.on_upgrade(move |socket| crate::modules::websocket::handle_agent_socket(socket, node_manager)) +} \ No newline at end of file diff --git a/src/modules/websocket.rs b/src/modules/websocket.rs new file mode 100644 index 0000000..d47947e --- /dev/null +++ b/src/modules/websocket.rs @@ -0,0 +1,164 @@ +use axum::extract::ws::{Message, WebSocket}; +use futures_util::{SinkExt, StreamExt}; +use serde::{Deserialize, Serialize}; +use std::sync::Arc; +use tracing::{debug, error, info, warn}; + +use crate::node_manager::NodeManager; + +#[derive(Debug, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum AgentMessage { + Register { + name: String, + addresses: Vec, + }, + Heartbeat, + UpdateAddresses { + addresses: Vec, + }, +} + +#[derive(Debug, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ServerMessage { + Config { + node_id: String, + private_key: String, + listen: Vec, + peers: Vec, + allowed_public_keys: Vec, + }, + Update { + peers: Vec, + allowed_public_keys: Vec, + }, + Error { + message: String, + }, +} + + +pub async fn handle_agent_socket( + socket: WebSocket, + node_manager: Arc, +) { + let (mut sender, mut receiver) = socket.split(); + let (tx, mut rx) = tokio::sync::mpsc::channel::(100); + + let mut node_id: Option = None; + + // Spawn task to forward messages from channel to WebSocket + let send_task = tokio::spawn(async move { + while let Some(msg) = rx.recv().await { + if let Ok(json) = serde_json::to_string(&msg) { + if sender.send(Message::Text(json)).await.is_err() { + break; + } + } + } + }); + + // Handle incoming messages + while let Some(msg) = receiver.next().await { + if let Ok(Message::Text(text)) = msg { + match serde_json::from_str::(&text) { + Ok(agent_msg) => { + match agent_msg { + AgentMessage::Register { name, addresses } => { + info!("Agent registration: {} with addresses {:?}", name, addresses); + + // Get default endpoints from config + // TODO: Get from actual config, for now use hardcoded + let default_listen = vec!["tcp://0.0.0.0:9001".to_string()]; + + // Check if node already exists + let node = if let Some(existing_node) = node_manager.get_node_by_name(&name).await { + info!("Reusing existing node: {} ({})", existing_node.name, existing_node.id); + // Update addresses for existing node + match node_manager.update_node(&existing_node.id, name.clone(), default_listen.clone(), addresses).await { + Ok(_) => { + // Get the updated node + node_manager.get_node_by_id(&existing_node.id).await + } + Err(e) => { + warn!("Failed to update existing node addresses: {}", e); + Some(existing_node) + } + } + } else { + // Create new node + info!("Creating new node: {}", name); + match node_manager.add_node(name.clone(), default_listen.clone(), addresses).await { + Ok(_) => { + // Get the newly created node + node_manager.get_node_by_name(&name).await + } + Err(e) => { + let error_msg = ServerMessage::Error { + message: format!("Failed to register node: {}", e), + }; + let _ = tx.send(error_msg).await; + None + } + } + }; + + if let Some(node) = node { + node_id = Some(node.id.clone()); + + // Register connection + crate::websocket_state::register_agent_connection(node.id.clone(), tx.clone()).await; + + // Generate config for this node + let configs = node_manager.generate_configs().await; + if let Some(config) = configs.get(&node.id) { + let peers: Vec = config.peers.clone(); + let allowed_keys: Vec = config.allowed_public_keys.clone(); + + let response = ServerMessage::Config { + node_id: node.id.clone(), + private_key: node.private_key.clone(), + listen: default_listen, + peers, + allowed_public_keys: allowed_keys, + }; + + if let Err(e) = tx.send(response).await { + error!("Failed to send config to agent: {}", e); + } + + // Notify other agents about node connection + crate::websocket_state::broadcast_configuration_update(&node_manager).await; + } + } + } + AgentMessage::Heartbeat => { + debug!("Heartbeat from {:?}", node_id); + } + AgentMessage::UpdateAddresses { addresses } => { + if let Some(id) = &node_id { + info!("Address update for {}: {:?}", id, addresses); + // TODO: Update node addresses in database + } + } + } + } + Err(e) => { + warn!("Failed to parse agent message: {}", e); + } + } + } + } + + // Clean up + if let Some(id) = node_id { + crate::websocket_state::unregister_agent_connection(&id).await; + info!("Agent {} disconnected", id); + } + + // Abort send task + send_task.abort(); +} + + diff --git a/src/node_manager.rs b/src/node_manager.rs new file mode 100644 index 0000000..209a415 --- /dev/null +++ b/src/node_manager.rs @@ -0,0 +1,222 @@ +use crate::yggdrasil::{Node, YggdrasilConfig}; +use crate::database::entities::node as node_entity; +use ed25519_dalek::{SigningKey, VerifyingKey}; +use sea_orm::{DatabaseConnection, EntityTrait, ActiveModelTrait}; +use std::collections::HashMap; + +pub struct NodeManager { + db: DatabaseConnection, +} + +impl NodeManager { + pub fn new(db: DatabaseConnection) -> Self { + Self { db } + } + + pub async fn add_node(&self, name: String, listen: Vec, addresses: Vec) -> Result<(), crate::error::AppError> { + let signing_key = SigningKey::from_bytes(&rand::random()); + let verifying_key: VerifyingKey = signing_key.verifying_key(); + + let private_seed = signing_key.to_bytes(); + let public_key_bytes = verifying_key.to_bytes(); + + // Yggdrasil expects a 64-byte private key (32-byte seed + 32-byte public key) + let mut full_private_key = Vec::with_capacity(64); + full_private_key.extend_from_slice(&private_seed); + full_private_key.extend_from_slice(&public_key_bytes); + + let private_key = hex::encode(full_private_key); + let public_key = hex::encode(public_key_bytes); + + let node = Node { + id: format!("node-{}", uuid_simple()), + name: name.clone(), + public_key: public_key.clone(), + private_key, + listen, + addresses, + }; + + // Save to database + let active_model = node_entity::ActiveModel::from(&node); + active_model.insert(&self.db).await + .map_err(|e| crate::error::AppError::Config(format!("Database error: {}", e)))?; + + Ok(()) + } + + pub async fn update_node(&self, node_id: &str, name: String, listen: Vec, addresses: Vec) -> Result<(), crate::error::AppError> { + // Check if node exists + let existing_node = node_entity::Entity::find_by_id(node_id) + .one(&self.db) + .await + .map_err(|e| crate::error::AppError::Config(format!("Database error: {}", e)))?; + + if existing_node.is_none() { + return Err(crate::error::AppError::Config("Node not found".to_string())); + } + + // Update the node + let mut active_model: node_entity::ActiveModel = existing_node.unwrap().into(); + active_model.name = sea_orm::Set(name); + active_model.listen = sea_orm::Set(serde_json::to_string(&listen).unwrap_or_default()); + active_model.addresses = sea_orm::Set(serde_json::to_string(&addresses).unwrap_or_default()); + + active_model.update(&self.db).await + .map_err(|e| crate::error::AppError::Config(format!("Database error: {}", e)))?; + + Ok(()) + } + + pub async fn remove_node(&self, node_id: &str) -> Result<(), crate::error::AppError> { + let result = node_entity::Entity::delete_by_id(node_id) + .exec(&self.db) + .await + .map_err(|e| crate::error::AppError::Config(format!("Database error: {}", e)))?; + + if result.rows_affected == 0 { + return Err(crate::error::AppError::Config("Node not found".to_string())); + } + + Ok(()) + } + + pub async fn get_node_by_id(&self, node_id: &str) -> Option { + match node_entity::Entity::find_by_id(node_id).one(&self.db).await { + Ok(Some(model)) => Some(Node::from(model)), + _ => None, + } + } + + pub async fn get_node_by_name(&self, name: &str) -> Option { + use sea_orm::{ColumnTrait, QueryFilter}; + match node_entity::Entity::find() + .filter(node_entity::Column::Name.eq(name)) + .one(&self.db).await { + Ok(Some(model)) => Some(Node::from(model)), + _ => None, + } + } + + + pub async fn get_all_nodes(&self) -> Vec { + match node_entity::Entity::find().all(&self.db).await { + Ok(models) => models.into_iter().map(Node::from).collect(), + Err(e) => { + tracing::error!("Failed to fetch nodes from database: {}", e); + Vec::new() + } + } + } + + pub async fn generate_configs(&self) -> HashMap { + let nodes = self.get_all_nodes().await; + let mut configs = HashMap::new(); + + let all_public_keys: Vec = nodes + .iter() + .map(|n| n.public_key.clone()) + .collect(); + + for node in &nodes { + let mut config = YggdrasilConfig::default(); + + config.private_key = node.private_key.clone(); + config.listen = node.listen.clone(); + + let mut other_keys = all_public_keys.clone(); + other_keys.retain(|k| k != &node.public_key); + config.allowed_public_keys = other_keys; + + // Build peers from other nodes' listen endpoints + let mut peers: Vec = Vec::new(); + for other_node in &nodes { + if other_node.id != node.id { + // For each listen endpoint, create peers for all node addresses + for listen_addr in &other_node.listen { + // If no addresses provided, use localhost + let addresses_to_use = if other_node.addresses.is_empty() { + vec!["127.0.0.1".to_string()] + } else { + other_node.addresses.clone() + }; + + for address in &addresses_to_use { + if let Some(peer_addr) = convert_listen_to_peer_with_address(listen_addr, &other_node.public_key, address) { + peers.push(peer_addr); + } + } + } + } + } + config.peers = peers; + + let mut node_info = HashMap::new(); + node_info.insert("name".to_string(), serde_json::Value::String(node.name.clone())); + config.node_info = node_info; + + configs.insert(node.id.clone(), config); + } + + configs + } + +} + +fn uuid_simple() -> String { + use rand::Rng; + let mut rng = rand::thread_rng(); + let bytes: Vec = (0..16).map(|_| rng.r#gen()).collect(); + hex::encode(bytes) +} + +fn convert_listen_to_peer_with_address(listen_addr: &str, public_key: &str, address: &str) -> Option { + // Parse the listen address and convert to peer format + // Listen format: tcp://[::]:1234 or tcp://0.0.0.0:1234 + // Peer format: tcp://REAL_IP:1234?key=PUBLIC_KEY + + if listen_addr.contains("unix://") { + // Unix sockets are local only, skip + return None; + } + + // Extract protocol and port + let parts: Vec<&str> = listen_addr.split("://").collect(); + if parts.len() != 2 { + return None; + } + + let protocol = parts[0]; + let addr_part = parts[1]; + + // Extract port from address + let port = if addr_part.contains("]:") { + // IPv6 format [::]:port + addr_part.split("]:").nth(1) + } else { + // IPv4 format 0.0.0.0:port + addr_part.split(':').nth(1) + }; + + let port = port?; + + // Check for query parameters in the original listen address + let (port_clean, params) = if port.contains('?') { + let parts: Vec<&str> = port.split('?').collect(); + (parts[0], Some(parts[1])) + } else { + (port, None) + }; + + // Build the peer address with the specified IP + let mut peer_addr = format!("{}://{}:{}?key={}", protocol, address, port_clean, public_key); + + // Add any additional parameters from the listen address + if let Some(params) = params { + peer_addr.push('&'); + peer_addr.push_str(params); + } + + Some(peer_addr) +} + diff --git a/src/websocket_state.rs b/src/websocket_state.rs new file mode 100644 index 0000000..0a27eda --- /dev/null +++ b/src/websocket_state.rs @@ -0,0 +1,72 @@ +use std::collections::HashMap; +use std::sync::Arc; +use tokio::sync::RwLock; +use tracing::{info, warn}; + +use crate::modules::websocket::ServerMessage; +use crate::node_manager::NodeManager; + +type ConnectionMap = Arc>>>; + +lazy_static::lazy_static! { + static ref AGENT_CONNECTIONS: ConnectionMap = Arc::new(RwLock::new(HashMap::new())); +} + +pub async fn register_agent_connection(node_id: String, tx: tokio::sync::mpsc::Sender) { + let mut connections = AGENT_CONNECTIONS.write().await; + connections.insert(node_id.clone(), tx); + info!("Registered agent connection for node: {}", node_id); +} + +pub async fn unregister_agent_connection(node_id: &str) { + let mut connections = AGENT_CONNECTIONS.write().await; + connections.remove(node_id); + info!("Unregistered agent connection for node: {}", node_id); +} + +pub async fn broadcast_configuration_update(node_manager: &Arc) { + let mut connections = AGENT_CONNECTIONS.write().await; + let configs = node_manager.generate_configs().await; + + info!("Broadcasting configuration update to {} connected agents", connections.len()); + + let mut failed_connections = Vec::new(); + + for (node_id, tx) in connections.iter() { + if let Some(config) = configs.get(node_id) { + let update = ServerMessage::Update { + peers: config.peers.clone(), + allowed_public_keys: config.allowed_public_keys.clone(), + }; + + if let Err(e) = tx.send(update).await { + warn!("Failed to send update to node {}: {}", node_id, e); + failed_connections.push(node_id.clone()); + } + } else { + // Node was deleted, send empty configuration to disconnect agent gracefully + let update = ServerMessage::Update { + peers: vec![], + allowed_public_keys: vec![], + }; + + if let Err(e) = tx.send(update).await { + warn!("Failed to send final update to deleted node {}: {}", node_id, e); + failed_connections.push(node_id.clone()); + } else { + info!("Sent final empty config to deleted node {}", node_id); + failed_connections.push(node_id.clone()); + } + } + } + + // Remove failed connections + for node_id in failed_connections { + connections.remove(&node_id); + info!("Removed failed connection for node: {}", node_id); + } +} + +pub async fn get_connected_agents_count() -> usize { + AGENT_CONNECTIONS.read().await.len() +} \ No newline at end of file diff --git a/src/yggdrasil/mod.rs b/src/yggdrasil/mod.rs new file mode 100644 index 0000000..de62e9d --- /dev/null +++ b/src/yggdrasil/mod.rs @@ -0,0 +1,54 @@ +use serde::{Deserialize, Serialize}; +use std::collections::HashMap; + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct YggdrasilConfig { + #[serde(rename = "PrivateKey")] + pub private_key: String, + + pub peers: Vec, + + #[serde(skip_serializing_if = "Vec::is_empty")] + pub listen: Vec, + + #[serde(skip_serializing_if = "Vec::is_empty")] + pub allowed_public_keys: Vec, + + #[serde(rename = "IfName")] + pub if_name: String, + + #[serde(rename = "IfMTU")] + pub if_mtu: u16, + + #[serde(skip_serializing_if = "Option::is_none")] + pub node_info_privacy: Option, + + #[serde(skip_serializing_if = "HashMap::is_empty")] + pub node_info: HashMap, +} + +impl Default for YggdrasilConfig { + fn default() -> Self { + Self { + private_key: String::new(), + peers: Vec::new(), + listen: Vec::new(), + allowed_public_keys: Vec::new(), + if_name: "auto".to_string(), + if_mtu: 65535, + node_info_privacy: Some(false), + node_info: HashMap::new(), + } + } +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct Node { + pub id: String, + pub name: String, + pub public_key: String, + pub private_key: String, + pub listen: Vec, + pub addresses: Vec, // Real IP addresses of the node +} \ No newline at end of file diff --git a/static/index.html b/static/index.html new file mode 100644 index 0000000..fcf09b8 --- /dev/null +++ b/static/index.html @@ -0,0 +1,912 @@ + + + + + + Yggdrasil Node Manager + + + +
+

Yggdrasil Node Manager

+ +
+ +
+

Add New Node

+
+ + +
+ + +
+ +
Configure endpoints for this node to listen on for incoming connections
+ +
+
+ + + + + + + +
+
+ + +
+ +
+ + +
+
+ +
+
No nodes configured. Add a node to get started.
+
+
+ + + + \ No newline at end of file