diff --git a/Cargo.lock b/Cargo.lock index 3d1e0a3..9a8f7bb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -13,9 +13,47 @@ dependencies = [ [[package]] name = "adler2" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "ahash" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy 0.8.26", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "android-tzdata" @@ -33,16 +71,100 @@ dependencies = [ ] [[package]] -name = "autocfg" -version = "1.4.0" +name = "anyhow" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" + +[[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", +] + +[[package]] +name = "async-trait" +version = "0.1.88" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "axum" +version = "0.6.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" +dependencies = [ + "async-trait", + "axum-core", + "bitflags 1.3.2", + "bytes", + "futures-util", + "http", + "http-body", + "hyper", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "sync_wrapper", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-core" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http", + "http-body", + "mime", + "rustversion", + "tower-layer", + "tower-service", +] [[package]] name = "backtrace" -version = "0.3.74" +version = "0.3.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" dependencies = [ "addr2line", "cfg-if", @@ -50,9 +172,15 @@ dependencies = [ "miniz_oxide", "object", "rustc-demangle", - "windows-targets", + "windows-targets 0.52.6", ] +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + [[package]] name = "bcd-convert" version = "0.1.0" @@ -63,10 +191,48 @@ dependencies = [ ] [[package]] -name = "bitflags" -version = "2.9.0" +name = "bincode" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bindgen" +version = "0.66.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2b84e06fc203107bfbad243f4aba2af864eb7db3b1cf46ea0a023b0b433d2a7" +dependencies = [ + "bitflags 2.9.1", + "cexpr", + "clang-sys", + "lazy_static", + "lazycell", + "log", + "peeking_take_while", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn", + "which", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" [[package]] name = "bitvec" @@ -81,37 +247,73 @@ dependencies = [ ] [[package]] -name = "bumpalo" -version = "3.17.0" +name = "block-padding" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" +checksum = "a8894febbff9f758034a5b8e12d87918f56dfc64a8e1fe757d65e29041538d93" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bumpalo" +version = "3.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" + +[[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" +dependencies = [ + "serde", +] + +[[package]] +name = "cbc" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b52a9543ae338f279b96b0b9fed9c8093744685043739079ce85cd58f289a6" +dependencies = [ + "cipher", +] [[package]] name = "cc" -version = "1.2.18" +version = "1.2.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525046617d8376e3db1deffb079e91cef90a89fc3ca5c185bbf8c9ecdd15cd5c" +checksum = "deec109607ca693028562ed836a5f1c4b8bd77755c4e132fc5ce11b0b6211ae7" dependencies = [ "shlex", ] [[package]] -name = "cfg-if" -version = "1.0.0" +name = "cexpr" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-if" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" [[package]] name = "chrono" -version = "0.4.40" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" +checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" dependencies = [ "android-tzdata", "iana-time-zone", @@ -121,12 +323,86 @@ dependencies = [ "windows-link", ] +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "cmake" +version = "0.1.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7caa3f9de89ddbe2c607f4101924c5abec803763ae9534e4f4d7d8f84aa81f0" +dependencies = [ + "cc", +] + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" +dependencies = [ + "cfg-if", +] + +[[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 = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + [[package]] name = "encoding_rs" version = "0.8.35" @@ -136,6 +412,28 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" +dependencies = [ + "libc", + "windows-sys 0.60.2", +] + +[[package]] +name = "fallible-iterator" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" + [[package]] name = "fallible-iterator" version = "0.3.0" @@ -148,6 +446,12 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" +[[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" @@ -161,10 +465,120 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] -name = "getrandom" -version = "0.3.2" +name = "futures" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0" +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-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", +] + +[[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", @@ -179,21 +593,174 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] -name = "hashbrown" -version = "0.15.2" +name = "glob" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" + +[[package]] +name = "h2" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0beca50380b1fc32983fc1cb4587bfa4bb9e78fc259aad4a0032d2080309222d" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap 2.10.0", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hashbrown" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" dependencies = [ "foldhash", ] +[[package]] +name = "hashlink" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" +dependencies = [ + "hashbrown 0.14.5", +] + [[package]] name = "hashlink" version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1" dependencies = [ - "hashbrown", + "hashbrown 0.15.4", +] + +[[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 = "http" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "http-range-header" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" + +[[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 = "0.14.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "399c78f9338483cb7e630c8474b07268983c6bd5acee012e4211f9f7bb21b070" +dependencies = [ + "futures-util", + "http", + "hyper", + "log", + "rustls", + "rustls-native-certs", + "rustls-pki-types", + "tokio", + "tokio-rustls", + "webpki-roots 0.26.11", +] + +[[package]] +name = "hyper-timeout" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" +dependencies = [ + "hyper", + "pin-project-lite", + "tokio", + "tokio-io-timeout", ] [[package]] @@ -220,6 +787,62 @@ dependencies = [ "cc", ] +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", +] + +[[package]] +name = "indexmap" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" +dependencies = [ + "equivalent", + "hashbrown 0.15.4", +] + +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "block-padding", + "generic-array", +] + +[[package]] +name = "io-uring" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d93587f37623a1a17d94ef2bc9ada592f5465fe7732084ab7beefabe5c77c0c4" +dependencies = [ + "bitflags 2.9.1", + "cfg-if", + "libc", +] + +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + +[[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" @@ -237,16 +860,168 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] -name = "libc" -version = "0.2.171" +name = "lazycell" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "libc" +version = "0.2.174" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" + +[[package]] +name = "libloading" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667" +dependencies = [ + "cfg-if", + "windows-targets 0.53.2", +] + +[[package]] +name = "libsql" +version = "0.9.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c92f460194a673c29e82520a061a82f83892faca9ce6881db93d591cd38cb3dc" +dependencies = [ + "anyhow", + "async-stream", + "async-trait", + "base64", + "bincode", + "bitflags 2.9.1", + "bytes", + "chrono", + "crc32fast", + "fallible-iterator 0.3.0", + "futures", + "http", + "hyper", + "hyper-rustls", + "libsql-hrana", + "libsql-sqlite3-parser", + "libsql-sys", + "libsql_replication", + "parking_lot", + "serde", + "serde_json", + "thiserror", + "tokio", + "tokio-stream", + "tokio-util", + "tonic", + "tonic-web", + "tower", + "tower-http", + "tracing", + "uuid", + "zerocopy 0.7.35", +] + +[[package]] +name = "libsql-ffi" +version = "0.9.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64691b229b9d5c0754115f59a0e5c0d1bcc102bfe402b96f2bbf9d5150a4ab3c" +dependencies = [ + "bindgen", + "cc", + "cmake", + "glob", +] + +[[package]] +name = "libsql-hrana" +version = "0.9.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c18b78daf4af8603c048f584faada18c8970f4f3af16df0c3319a92c90d0d696" +dependencies = [ + "base64", + "bytes", + "prost", + "serde", +] + +[[package]] +name = "libsql-rusqlite" +version = "0.9.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c502ebc6fd1a7ba1b686c47226016fb8e913080c4021491bda33ca33c6fa1ab4" +dependencies = [ + "bitflags 2.9.1", + "fallible-iterator 0.2.0", + "fallible-streaming-iterator", + "hashlink 0.8.4", + "libsql-ffi", + "smallvec", +] + +[[package]] +name = "libsql-sqlite3-parser" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15a90128c708356af8f7d767c9ac2946692c9112b4f74f07b99a01a60680e413" +dependencies = [ + "bitflags 2.9.1", + "cc", + "fallible-iterator 0.3.0", + "indexmap 2.10.0", + "log", + "memchr", + "phf", + "phf_codegen", + "phf_shared", + "uncased", +] + +[[package]] +name = "libsql-sys" +version = "0.9.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e7b9ab82fa6122efe2b2fe066043d6330aa4a7aa656b4ec0df9768ffd1ea6a0" +dependencies = [ + "bytes", + "libsql-ffi", + "libsql-rusqlite", + "once_cell", + "tracing", + "zerocopy 0.7.35", +] + +[[package]] +name = "libsql_replication" +version = "0.9.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa911faee7c1e039a44aeced5e61b5106fb714782e26d89216c87c83eb1ce410" +dependencies = [ + "aes", + "async-stream", + "async-trait", + "bytes", + "cbc", + "libsql-rusqlite", + "libsql-sys", + "parking_lot", + "prost", + "serde", + "thiserror", + "tokio", + "tokio-stream", + "tokio-util", + "tonic", + "tracing", + "uuid", + "zerocopy 0.7.35", +] [[package]] name = "libsqlite3-sys" -version = "0.32.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbb8270bb4060bd76c6e96f20c52d80620f1d82a3470885694e41e0f81ef6fe7" +checksum = "133c182a6a2c87864fe97778797e46c7e999672690dc9fa3ee8e241aa4a9c13f" dependencies = [ "cc", "pkg-config", @@ -254,10 +1029,16 @@ dependencies = [ ] [[package]] -name = "lock_api" -version = "0.4.12" +name = "linux-raw-sys" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "lock_api" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" dependencies = [ "autocfg", "scopeguard", @@ -270,10 +1051,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] -name = "memchr" -version = "2.7.4" +name = "matchit" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" + +[[package]] +name = "memchr" +version = "2.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" [[package]] name = "micodus_server" @@ -284,29 +1071,52 @@ dependencies = [ "chrono", "encoding_rs", "lazy_static", - "rand", + "libsql", + "rand 0.9.2", "rusqlite", "tokio", ] [[package]] -name = "miniz_oxide" -version = "0.8.7" +name = "mime" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff70ce3e48ae43fa075863cef62e8b43b71a4f2382229920e0df362592919430" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" dependencies = [ "adler2", ] [[package]] name = "mio" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" +checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" dependencies = [ "libc", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys", + "wasi 0.11.1+wasi-snapshot-preview1", + "windows-sys 0.59.0", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", ] [[package]] @@ -334,10 +1144,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] -name = "parking_lot" -version = "0.12.3" +name = "openssl-probe" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" + +[[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", @@ -345,15 +1161,86 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.10" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-targets", + "windows-targets 0.52.6", +] + +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "phf" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" +dependencies = [ + "phf_shared", +] + +[[package]] +name = "phf_codegen" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a" +dependencies = [ + "phf_generator", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" +dependencies = [ + "phf_shared", + "rand 0.8.5", +] + +[[package]] +name = "phf_shared" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" +dependencies = [ + "siphasher", + "uncased", +] + +[[package]] +name = "pin-project" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" +dependencies = [ + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -362,6 +1249,12 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + [[package]] name = "pkg-config" version = "0.3.32" @@ -374,18 +1267,51 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" dependencies = [ - "zerocopy", + "zerocopy 0.8.26", +] + +[[package]] +name = "prettyplease" +version = "0.2.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff24dfcda44452b9816fff4cd4227e1bb73ff5a2f1bc1105aa92fb8565ce44d2" +dependencies = [ + "proc-macro2", + "syn", ] [[package]] name = "proc-macro2" -version = "1.0.94" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ "unicode-ident", ] +[[package]] +name = "prost" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-derive" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "quote" version = "1.0.40" @@ -397,9 +1323,9 @@ dependencies = [ [[package]] name = "r-efi" -version = "5.2.0" +version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" [[package]] name = "radium" @@ -409,13 +1335,33 @@ checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" [[package]] name = "rand" -version = "0.9.0" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ - "rand_chacha", - "rand_core", - "zerocopy", + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.3", +] + +[[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 0.6.4", ] [[package]] @@ -425,7 +1371,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.9.3", +] + +[[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]] @@ -434,43 +1389,176 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" dependencies = [ - "getrandom", + "getrandom 0.3.3", ] [[package]] name = "redox_syscall" -version = "0.5.11" +version = "0.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2f103c6d277498fbceb16e84d317e2a400f160f46904d5f5410848c829511a3" +checksum = "7e8af0dde094006011e6a740d4879319439489813bd0bcdc7d821beaeeff48ec" dependencies = [ - "bitflags", + "bitflags 2.9.1", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[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 = "rusqlite" -version = "0.34.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37e34486da88d8e051c7c0e23c3f15fd806ea8546260aa2fec247e97242ec143" +checksum = "165ca6e57b20e1351573e3729b958bc62f0e48025386970b6e4d29e7a7e71f3f" dependencies = [ - "bitflags", - "fallible-iterator", + "bitflags 2.9.1", + "fallible-iterator 0.3.0", "fallible-streaming-iterator", - "hashlink", + "hashlink 0.10.0", "libsqlite3-sys", "smallvec", ] [[package]] name = "rustc-demangle" -version = "0.1.24" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustix" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags 2.9.1", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustls" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" +dependencies = [ + "log", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-native-certs" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5bfb394eeed242e909609f56089eecfe5fda225042e8b171791b9c95f5931e5" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "rustls-pki-types", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pemfile" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "229a4a4c221013e7e1f1a043678c5cc39fe5171437c88fb47151a21e6f5b5c79" +dependencies = [ + "zeroize", +] + +[[package]] +name = "rustls-webpki" +version = "0.102.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] [[package]] name = "rustversion" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" + +[[package]] +name = "ryu" version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "schannel" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" +dependencies = [ + "windows-sys 0.59.0", +] [[package]] name = "scopeguard" @@ -478,6 +1566,61 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "security-framework" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +dependencies = [ + "bitflags 2.9.1", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[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", +] + +[[package]] +name = "serde_json" +version = "1.0.141" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30b9eff21ebe718216c6ec64e1d9ac57087aad11efc64e32002bce4a0d4c03d3" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + [[package]] name = "shlex" version = "1.3.0" @@ -486,40 +1629,64 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" -version = "1.4.2" +version = "1.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +checksum = "9203b8055f63a2a00e2f593bb0510367fe707d7ff1e5c872de2f537b339e5410" dependencies = [ "libc", ] +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + +[[package]] +name = "slab" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04dc19736151f35336d325007ac991178d504a119863a2fcb3758cdb5e52c50d" + [[package]] name = "smallvec" -version = "1.15.0" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "socket2" -version = "0.5.9" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f5fd57c80058a56cf5c777ab8a126398ece8e442983605d280a44ce79d0edef" +checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] -name = "syn" -version = "2.0.100" +name = "subtle" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "2.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + [[package]] name = "tap" version = "1.0.1" @@ -548,20 +1715,32 @@ dependencies = [ [[package]] name = "tokio" -version = "1.44.2" +version = "1.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6b88822cbe49de4185e3a4cbf8321dd487cf5fe0c5c65695fef6346371e9c48" +checksum = "0cc3a2344dafbe23a245241fe8b09735b521110d30fcefbbd5feb1797ca35d17" dependencies = [ "backtrace", "bytes", + "io-uring", "libc", "mio", "parking_lot", "pin-project-lite", "signal-hook-registry", + "slab", "socket2", "tokio-macros", - "windows-sys", + "windows-sys 0.52.0", +] + +[[package]] +name = "tokio-io-timeout" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bd86198d9ee903fedd2f9a2e72014287c0d9167e4ae43b5853007205dda1b76" +dependencies = [ + "pin-project-lite", + "tokio", ] [[package]] @@ -575,12 +1754,217 @@ dependencies = [ "syn", ] +[[package]] +name = "tokio-rustls" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" +dependencies = [ + "rustls", + "rustls-pki-types", + "tokio", +] + +[[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-util" +version = "0.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66a539a9ad6d5d281510d5bd368c973d636c02dbf8a67300bfb6b950696ad7df" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tonic" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76c4eb7a4e9ef9d4763600161f12f5070b92a578e1b634db88a6887844c91a13" +dependencies = [ + "async-stream", + "async-trait", + "axum", + "base64", + "bytes", + "h2", + "http", + "http-body", + "hyper", + "hyper-timeout", + "percent-encoding", + "pin-project", + "prost", + "tokio", + "tokio-stream", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tonic-web" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc3b0e1cedbf19fdfb78ef3d672cb9928e0a91a9cb4629cc0c916e8cff8aaaa1" +dependencies = [ + "base64", + "bytes", + "http", + "http-body", + "hyper", + "pin-project", + "tokio-stream", + "tonic", + "tower-http", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "indexmap 1.9.3", + "pin-project", + "pin-project-lite", + "rand 0.8.5", + "slab", + "tokio", + "tokio-util", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-http" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" +dependencies = [ + "bitflags 2.9.1", + "bytes", + "futures-core", + "futures-util", + "http", + "http-body", + "http-range-header", + "pin-project-lite", + "tower", + "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", +] + +[[package]] +name = "tracing-core" +version = "0.1.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" +dependencies = [ + "once_cell", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "typenum" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "uncased" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1b88fcfe09e89d3866a5c11019378088af2d24c3fbd4f0543f96b479ec90697" +dependencies = [ + "version_check", +] + [[package]] name = "unicode-ident" version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "uuid" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cf4199d1e5d15ddd86a694e4d0dffa9c323ce759fea589f00fef9d81cc1931d" +dependencies = [ + "getrandom 0.3.3", + "js-sys", + "serde", + "wasm-bindgen", +] + [[package]] name = "vcpkg" version = "0.2.15" @@ -588,10 +1972,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +name = "version_check" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasi" @@ -661,10 +2060,40 @@ dependencies = [ ] [[package]] -name = "windows-core" -version = "0.61.0" +name = "webpki-roots" +version = "0.26.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4763c1de310c86d75a878046489e2e5ba02c649d185f21c67d4cf8a56d098980" +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 = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix", +] + +[[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", @@ -697,24 +2126,24 @@ dependencies = [ [[package]] name = "windows-link" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" [[package]] name = "windows-result" -version = "0.3.2" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c64fd11a4fd95df68efcfee5f44a294fe71b8bc6a91993e2791938abcc712252" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" dependencies = [ "windows-link", ] [[package]] name = "windows-strings" -version = "0.4.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a2ba9642430ee452d5a7aa78d72907ebe8cfda358e8cb7918a2050581322f97" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" dependencies = [ "windows-link", ] @@ -725,7 +2154,25 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets", + "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.2", ] [[package]] @@ -734,14 +2181,30 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "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.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef" +dependencies = [ + "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]] @@ -750,55 +2213,103 @@ 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.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.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.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.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.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.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 = "wit-bindgen-rt" version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" dependencies = [ - "bitflags", + "bitflags 2.9.1", ] [[package]] @@ -812,20 +2323,47 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.24" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "zerocopy-derive", + "byteorder", + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f" +dependencies = [ + "zerocopy-derive 0.8.26", ] [[package]] name = "zerocopy-derive" -version = "0.8.24" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", "syn", ] + +[[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", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/Cargo.toml b/Cargo.toml index 63a6bca..75046b4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,6 +9,7 @@ bitvec = { version = "1.0" } chrono = { version = "0.4" } encoding_rs = { version = "0.8" } lazy_static = { version = "1.5" } +libsql = { version = "0.9", features = ["replication"] } rand = { version = "0.9" } -rusqlite = { version = "0.34", features = ["bundled"] } -tokio = { version = "1.44", features = ["full", "sync"] } +rusqlite = { version = "0.37", features = ["bundled"] } +tokio = { version = "1.46", features = ["full", "sync"] } diff --git a/html/const.lua b/html/const.lua new file mode 100644 index 0000000..5fa287a --- /dev/null +++ b/html/const.lua @@ -0,0 +1,10 @@ +basepath = "/home/paul/git/micodus_server" +dbfile = string.format("%s/data/tracker.db",basepath) +query = [[ + SELECT time,latitude,longitude,height,speed,direction,serial + FROM log + ORDER BY id DESC, serial DESC + LIMIT 1; +]] + +return {["basepath"]=basepath, ["dbfile"]=dbfile, ["query"]=query} diff --git a/html/engine.js b/html/engine.js index 6c5e187..89a2c64 100644 --- a/html/engine.js +++ b/html/engine.js @@ -1,14 +1,12 @@ -/* -*/ +//engine.js let map; let point; const arrows = ["↑", "↗", "→", "↘", "↓", "↙", "←", "↖"]; +const socket = new WebSocket("wss://trackme.ovh/ws"); -const socket = new WebSocket("wss://geo.paulbsd.com/ws"); - -function create_location(coords,text) { +function create_location(coords, text) { point = L.marker(coords, { color: 'red', fillColor: '#f03', @@ -26,8 +24,9 @@ function create_map(coords) { }); L.tileLayer(`https://tile.openstreetmap.org/{z}/{x}/{y}.png`, { maxZoom: 19, - attribution: '© OpenStreetMap / PaulBSD' + attribution: `© OpenStreetMap / PaulBSD` }).addTo(map); + map.zoomControl.setPosition('bottomright'); } function update(data) { @@ -35,27 +34,62 @@ function update(data) { const speed = data.speed/10; let section = parseInt(data.direction/45 + 0.5); section = section % 8; - console.log(arrows[section]); - const text = `time: ${data.time}
latitude: ${data.latitude}
longitude: ${data.longitude}
height: ${data.height}
speed: ${speed}
direction: ${arrows[section]} ${data.direction}`; - if (!map) { - create_map(coords); - } else { + const text = `time: ${data.time}
latitude: ${data.latitude}
longitude: ${data.longitude}
height: ${data.height}
speed: ${speed}
direction: ${arrows[section]} ${data.direction}°
serial: ${data.serial}`; + if (map) { map.setView(coords); map.flyTo(coords); - } - if (!point) { - create_location(coords, text); } else { + create_map(coords); + } + if (point) { point.setLatLng(coords); point.setPopupContent(text); + } else { + create_location(coords, text); } } +function ping() { + socket.send("ping"); +} + socket.addEventListener("message", (event) => { const data = JSON.parse(event.data); update(data); }); socket.addEventListener("open", (event) => { + console.log(event); socket.send("ping"); }); + +setInterval(ping, 1000) + +// service worker +if ('serviceWorker' in navigator) { + navigator.serviceWorker.register('/engine.js') + .then((reg) => { + console.log('Enregistrement réussi'); + }).catch((error) => { + console.log('Erreur : ' + error); + }); +} + +const CACHE_NAME = 'my-site-cache-v1'; +const urlsToCache = [ + '/', + '/leaflet/leaflet.js', + '/engine.js', + '/style.css', +]; + +self.addEventListener('install', function(event) { + // Perform install steps + event.waitUntil( + caches.open(CACHE_NAME) + .then(function(cache) { + console.log('Opened cache'); + return cache.addAll(urlsToCache); + }) + ); +}); diff --git a/html/favicon.ico b/html/favicon.ico new file mode 100644 index 0000000..c26b236 Binary files /dev/null and b/html/favicon.ico differ diff --git a/html/index.html b/html/index.html index 43416cc..5971c8f 100644 --- a/html/index.html +++ b/html/index.html @@ -1,6 +1,6 @@ - PaulBSD geo - + Trackme + + diff --git a/html/old/ws_test.lua b/html/old/ws_test.lua new file mode 100644 index 0000000..e4df5c7 --- /dev/null +++ b/html/old/ws_test.lua @@ -0,0 +1,54 @@ +local server = require "nginx.websocket.server" + +function geows() + local wb, err = server:new { + timeout = 5000, + max_payload_len = 65535 + } + if not wb then + ngx.log(ngx.ERR, "failed to new websocket: ", err) + return ngx.exit(444) + end + + while true do + local bytes, err = wb:send_text(string.format("%s haha!",data)) + if not bytes then + ngx.log(ngx.ERR, "failed to send text: ", err) + return ngx.exit(444) + end + ngx.sleep(1) + end + + --[[while true do + local data, typ, err = wb:recv_frame() + if wb.fatal then + ngx.log(ngx.ERR, "failed to receive frame: ", err) + return ngx.exit(444) + end + if not data then + local bytes, err = wb:send_ping() + if not bytes then + ngx.log(ngx.ERR, "failed to send ping: ", err) + return ngx.exit(444) + end + elseif typ == "close" then break + elseif typ == "ping" then + local bytes, err = wb:send_pong() + if not bytes then + ngx.log(ngx.ERR, "failed to send pong: ", err) + return ngx.exit(444) + end + elseif typ == "pong" then + ngx.log(ngx.INFO, "client ponged") + elseif typ == "text" then + local bytes, err = wb:send_text(string.format("%s haha!",data)) + if not bytes then + ngx.log(ngx.ERR, "failed to send text: ", err) + return ngx.exit(444) + end + end + end--]] + wb:send_close() +end + +geows() diff --git a/html/ws.js b/html/ws.js index 4c618c3..d54475a 100644 --- a/html/ws.js +++ b/html/ws.js @@ -1,8 +1,8 @@ // Create WebSocket connection. -const socket = new WebSocket("wss://geo.paulbsd.com/ws"); +const socket = new WebSocket("wss://trackme.ovh/ws"); // Connection opened -socket.addEventListener("open", (event) => { +socket.addEventListener("open", (_event) => { socket.send("Hello Server!"); }); diff --git a/html/ws.lua b/html/ws.lua index d6fe2ef..e610912 100644 --- a/html/ws.lua +++ b/html/ws.lua @@ -1,36 +1,30 @@ #!/usr/bin/lua +package.path = package.path..";/home/paul/git/micodus_server/html/?.lua" + +local const = require("const") local json = require("json") local server = require("nginx.websocket.server") local sqlite = require("lsqlite3") -local basepath = "/home/paul/git/micodus_server" -local dbfile = string.format("%s/data/tracker.db",basepath) -local query = [[ - SELECT time,latitude,longitude,height,speed,direction,serial - FROM log - ORDER BY time DESC - LIMIT 1; -]] - --ngx.shared.geo:set("last_time","") +local db = sqlite.open(const.dbfile, sqlite.OPEN_READONLY) function getdata() - local db = sqlite.open(dbfile,sqlite3.OPEN_READONLY) - local res, vm = db:nrows(query) - local data + local res, vm = db:nrows(const.query) + local data = {} for row in res, vm do data = { - ["time"]=row.time, - ["latitude"]=row.latitude, - ["longitude"]=row.longitude, - ["height"]=row.height, - ["speed"]=row.speed, - ["direction"]=row.direction, - ["serial"]=row.serial, + ["time"] = row.time, + ["latitude"] = row.latitude, + ["longitude"] = row.longitude, + ["height"] = row.height, + ["speed"] = row.speed, + ["direction"] = row.direction, + ["serial"] = row.serial, } end - db:close() + -- db:close() return data end @@ -49,6 +43,7 @@ function geows() while true do local data = getdata() if data.time ~= last_time then + --do local locstr = json.encode(data) local bytes, err = wb:send_text(locstr) if not bytes then @@ -57,7 +52,7 @@ function geows() end last_time = data.time end - ngx.sleep(1) + ngx.sleep(0.5) end wb:send_close() end diff --git a/src/db.rs b/src/db.rs deleted file mode 100644 index 5522dd0..0000000 --- a/src/db.rs +++ /dev/null @@ -1,103 +0,0 @@ -use rusqlite::{types::*, *}; - -const DBPATH: &'static str = "data/tracker.db"; -const STATEMENTS: &'static [&str] = &[ - "CREATE TABLE log ( - id integer primary key autoincrement, - time text, - serial integer, - latitude float, - longitude float, - speed integer, - height integer, - direction integer, - is_satellite bool);", - "CREATE INDEX idx_time ON log (time);", - "CREATE INDEX idx_serial ON log (serial);", -]; -const QUERY_INSERT: &'static str = " -INSERT INTO log ( - time, - latitude, - longitude, - speed, - height, - direction, - serial, - is_satellite -) -VALUES ( - :time, - :latitude, - :longitude, - :speed, - :height, - :direction, - :serial, - :is_satellite -)"; - -pub fn connectdb() -> Result { - let conn = Connection::open(DBPATH)?; - Ok(conn) -} - -pub fn initdb(conn: &Connection) -> Result<()> { - create_tables(&conn)?; - set_pragmas(&conn)?; - Ok(()) -} - -fn create_tables(conn: &Connection) -> Result<()> { - for s in STATEMENTS { - match conn.execute(s, ()) { - Ok(_) => {} - Err(err) => println!("update failed: {}", err), - } - } - Ok(()) -} - -fn set_pragmas(conn: &Connection) -> Result<()> { - conn.pragma_update(Some(DatabaseName::Main), "journal_mode", "WAL")?; - Ok(()) -} - -pub fn prepare_insert(conn: &Connection) -> Statement { - conn.prepare(QUERY_INSERT).unwrap() -} - -pub fn insert(conn: &Connection, dblog: &DbLog) -> Result<()> { - let mut stmt = prepare_insert(&conn); - match stmt.execute(params![ - dblog.time, - dblog.latitude, - dblog.longitude, - dblog.speed, - dblog.height, - dblog.direction, - dblog.serial, - dblog.is_satellite, - ]) { - Ok(i) => println!("{} rows were inserted", i), - Err(err) => println!("insert failed: {}", err), - } - Ok(()) -} - -pub struct DbLog { - pub time: String, - pub latitude: f64, - pub longitude: f64, - pub speed: u16, - pub height: u16, - pub direction: u16, - pub serial: u16, - pub is_satellite: bool, -} - -impl ToSql for DbLog { - fn to_sql(&self) -> Result> { - Ok(self.time.to_sql().unwrap()) - } -} diff --git a/src/db/libsql_engine.rs b/src/db/libsql_engine.rs new file mode 100644 index 0000000..e5d4128 --- /dev/null +++ b/src/db/libsql_engine.rs @@ -0,0 +1,114 @@ +use super::*; + +use libsql::*; + +impl LibSQLEngine { + pub const TABLE_STATEMENTS: &'static [&str] = &[ + "CREATE TABLE log ( + id integer primary key autoincrement, + time text, + serial integer, + latitude float, + longitude float, + speed integer, + height integer, + direction integer, + is_satellite bool + );", + "CREATE INDEX idx_time ON log (time);", + "CREATE INDEX idx_serial ON log (serial);", + ]; + + pub const QUERY_INSERT: &'static str = " + INSERT INTO log ( + time, + latitude, + longitude, + speed, + height, + direction, + serial, + is_satellite + ) + VALUES ( + :time, + :latitude, + :longitude, + :speed, + :height, + :direction, + :serial, + :is_satellite + );"; + + pub const DBPATH: &'static str = "data/tracker.db"; + + async fn initdb(&self) { + self.create_tables().await; + } + + async fn create_tables(&self) -> Result<()> { + for stmt in Self::TABLE_STATEMENTS { + match self.conn.as_ref().unwrap().execute(stmt, ()).await { + Ok(_) => {} + Err(err) => println!("update failed: {}", err), + } + } + Ok(()) + } + + async fn prepare_insert(&self) -> Statement { + self.conn + .as_ref() + .unwrap() + .prepare(Self::QUERY_INSERT) + .await + .unwrap() + } +} + +impl super::Engine for LibSQLEngine { + #[tokio::main] + async fn connect(&mut self) { + println!("{}", self.path.clone().unwrap_or("".to_string())); + let path = match self.path.clone() { + Some(o) => o, + None => Self::DBPATH.to_string(), + }; + let b = Builder::new_remote_replica(path, "".into(), "".into()) + .build() + .await + .unwrap(); + self.conn = Some(b.connect().unwrap()); + self.initdb().await + } + + #[tokio::main] + async fn insert(&mut self, dblog: &DbLog) { + let mut stmt = self.prepare_insert().await; + match stmt + .execute(params![ + dblog.time.clone(), + dblog.latitude, + dblog.longitude, + dblog.speed, + dblog.height, + dblog.direction, + dblog.serial, + dblog.is_satellite, + ]) + .await + { + Ok(i) => println!("{} rows were inserted", i), + Err(err) => println!("insert failed: {}", err), + } + } +} + +#[derive(Default, Clone)] +pub struct LibSQLEngine { + pub conn: Option, + pub path: Option, + pub url: Option, + pub token: Option, +} diff --git a/src/db/mod.rs b/src/db/mod.rs new file mode 100644 index 0000000..aec5a2c --- /dev/null +++ b/src/db/mod.rs @@ -0,0 +1,77 @@ +//pub mod libsql_engine; +pub mod sqlite_engine; + +pub enum SQLEngine { + SQLite(sqlite_engine::SQLiteEngine), + //LibSQL(libsql_engine::LibSQLEngine), +} + +pub trait Engine { + fn connect(&mut self); + fn init(&mut self); + fn insert(&mut self, dblog: &DbLog); +} + +impl Engine for SQLEngine { + fn connect(&mut self) { + match self { + Self::SQLite(engine) => engine.connect(), + //Self::LibSQL(engine) => engine.connect(), + } + } + + fn init(&mut self) { + match self { + Self::SQLite(engine) => engine.init(), + //Self::LibSQL(engine) => engine.connect(), + } + } + + fn insert(&mut self, dblog: &DbLog) { + match self { + Self::SQLite(engine) => engine.insert(&dblog), + //Self::LibSQL(engine) => engine.connect(), + } + } +} + +impl From for SQLEngine { + fn from(store: sqlite_engine::SQLiteEngine) -> Self { + Self::SQLite(store) + } +} + +/*impl From for SQLEngine { + fn from(store: libsql_engine::LibSQLEngine) -> Self { + Self::LibSQL(store) + } +}*/ + +#[derive(Default, Clone)] +pub struct DbLog { + pub time: String, + pub latitude: f64, + pub longitude: f64, + pub speed: u16, + pub height: u16, + pub direction: u16, + pub serial: u16, + pub is_satellite: bool, +} + +impl std::fmt::Display for DbLog { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + write!( + f, + "{} {} {} {} {} {} {} {} ", + self.time, + self.latitude, + self.longitude, + self.speed, + self.height, + self.direction, + self.serial, + self.is_satellite, + ) + } +} diff --git a/src/db/sqlite_engine.rs b/src/db/sqlite_engine.rs new file mode 100644 index 0000000..868d45a --- /dev/null +++ b/src/db/sqlite_engine.rs @@ -0,0 +1,115 @@ +use super::*; + +use rusqlite::{types::*, *}; + +impl SQLiteEngine { + pub const DBPATH: &'static str = "data/tracker.db"; + + pub const TABLE_STATEMENTS: &'static [&str] = &[ + "CREATE TABLE IF NOT EXISTS log ( + id integer primary key autoincrement, + time text, + serial integer, + latitude float, + longitude float, + speed integer, + height integer, + direction integer, + is_satellite bool + );", + "CREATE INDEX IF NOT EXISTS idx_time ON log (time);", + "CREATE INDEX IF NOT EXISTS idx_serial ON log (serial);", + ]; + + pub const QUERY_INSERT: &'static str = " + INSERT INTO log ( + time, + latitude, + longitude, + speed, + height, + direction, + serial, + is_satellite + ) + VALUES ( + :time, + :latitude, + :longitude, + :speed, + :height, + :direction, + :serial, + :is_satellite + );"; + + fn create_tables(&mut self) -> Result<()> { + for s in Self::TABLE_STATEMENTS { + match self.conn.as_ref().unwrap().execute(s, ()) { + Ok(_) => {} + Err(err) => println!("update failed: {}", err), + } + } + Ok(()) + } + + fn set_pragmas(&self) -> Result<()> { + self.conn + .as_ref() + .unwrap() + .pragma_update(None, "journal_mode", "WAL")?; + Ok(()) + } + + fn prepare_insert(&self) -> Statement { + self.conn + .as_ref() + .unwrap() + .prepare(Self::QUERY_INSERT) + .unwrap() + } +} + +impl ToSql for DbLog { + fn to_sql(&self) -> Result> { + Ok(self.time.to_sql().unwrap()) + } +} + +impl super::Engine for SQLiteEngine { + fn connect(&mut self) { + let path = match self.path.clone() { + Some(o) => o, + None => Self::DBPATH.to_string(), + }; + self.conn = Some(Connection::open(path).unwrap()); + } + + fn init(&mut self) { + self.create_tables().unwrap(); + self.set_pragmas().unwrap(); + } + + fn insert(&mut self, dblog: &DbLog) { + let mut stmt = self.prepare_insert(); + match stmt.execute(params![ + dblog.time, + dblog.latitude, + dblog.longitude, + dblog.speed, + dblog.height, + dblog.direction, + dblog.serial, + dblog.is_satellite, + ]) { + Ok(_) => {} + Err(err) => println!("insert failed: {}", err), + } + } +} + +#[derive(Default)] +pub struct SQLiteEngine { + pub conn: Option, + pub path: Option, +} diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/main.rs b/src/main.rs index 224d8a8..3bce6ec 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,23 +1,20 @@ -mod db; -mod parser; +pub mod db; +pub mod parser; +pub mod serve; -use crate::db::*; -use crate::parser::*; - -use std::io; - -use tokio::net::TcpListener; - -const ADDR: &'static str = "0.0.0.0"; -const PORT: u64 = 7701; -const BUFSIZE: usize = 1024; +//pub use db::libsql_engine::LibSQLEngine; +pub use db::sqlite_engine::SQLiteEngine; +pub use db::*; +pub use parser::*; #[tokio::main] async fn main() { - //test(); - let conn = connectdb().unwrap(); - initdb(&conn).unwrap(); - apiserver().await.unwrap(); + let mut s: SQLEngine = SQLEngine::SQLite(SQLiteEngine::default()); + s.connect(); + s.init(); + + let receiver = serve::control_server().await; + serve::micodus_protocol_server(receiver).await; } #[allow(dead_code)] @@ -28,85 +25,3 @@ fn test() { println!("{code}"); std::process::exit(0); } - -async fn apiserver() -> io::Result<()> { - let listener = match TcpListener::bind(format!("{}:{}", ADDR, PORT)).await { - Ok(o) => o, - Err(e) => { - println!("error: {e}"); - std::process::exit(1); - } - }; - - loop { - let (socket, _remote_addr) = listener.accept().await?; - tokio::spawn(async move { - let mut buf = vec![0; BUFSIZE]; - 'nest: loop { - #[allow(unused_variables)] - let terminal_id = 0; - match socket.readable().await { - Ok(_) => { - match socket.try_read(&mut buf) { - Ok(_) => match handle(&buf) { - Some(o) => match socket.try_write(&o) { - Ok(_) => {} - Err(e) => { - println!("error: {e}"); - break 'nest; - } - }, - None => { - break 'nest; - } - }, - Err(e) => { - println!("error read: {e}"); - if e.kind() == io::ErrorKind::WouldBlock { - continue 'nest; - } - } - }; - } - Err(e) => { - println!("error socket readable: {e}"); - } - } - match socket.writable().await { - Ok(_) => {} - Err(e) => { - println!("error socket writable: {e}") - } - } - } - }); - } -} - -fn handle(buf: &Vec) -> Option> { - let mut rawdata = InboundDataWrapper::new(buf.to_vec()); - let reply = match parse_inbound_msg(&mut rawdata) { - Ok(o) => { - println!("query: {}", o); - //println!("raw query: {:X?}", o.to_raw()); - Message::store(&o); - Message::set_reply(o) - } - Err(e) => { - println!("parse inbound message error: {}", e); - return None; - } - }; - - match reply { - Some(o) => { - println!("reply: {}", o); - //println!("raw reply {:X?}", o.to_raw()); - println!("--------------"); - return Some(o.to_raw().into()); - } - None => { - return None; - } - } -} diff --git a/src/parser/body.rs b/src/parser/body.rs index a0b8cec..823eb18 100644 --- a/src/parser/body.rs +++ b/src/parser/body.rs @@ -376,7 +376,6 @@ impl LocationInformationReport { fn parse_time(&mut self, timeslice: [u8; 6]) { let code = BcdNumber::try_from(×lice as &[u8]).unwrap(); - println!("{}", code); let time = format!("{}", code.to_u64().unwrap()); match NaiveDateTime::parse_from_str(time.as_str(), "%y%m%d%H%M%S") { Ok(o) => { @@ -521,6 +520,26 @@ impl From for LocationInformationReportStatus { } } +#[derive(Default, Debug, Clone)] +pub struct LocationInformationQuery {} +impl LocationInformationQuery { + pub const ID: u16 = 0x8201; +} + +impl BodyMessage for LocationInformationQuery { + fn parse(&mut self, rawbody: &Vec) {} +} + +#[derive(Default, Debug, Clone)] +pub struct LocationInformationQueryResponse {} +impl LocationInformationQueryResponse { + pub const ID: u16 = 0x0201; +} + +impl BodyMessage for LocationInformationQueryResponse { + fn parse(&mut self, rawbody: &Vec) {} +} + #[derive(Default, Debug, Clone)] pub struct StartOfTrip {} impl StartOfTrip { @@ -583,6 +602,8 @@ generate_impl!( QueryTerminalParameterResponse, TerminalControl, LocationInformationReport, + LocationInformationQuery, + LocationInformationQueryResponse, StartOfTrip, EndOfTrip ); diff --git a/src/parser/header.rs b/src/parser/header.rs index 25068f9..0aad8ad 100644 --- a/src/parser/header.rs +++ b/src/parser/header.rs @@ -89,7 +89,7 @@ impl std::fmt::Display for MessageHeader { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { write!( f, - "id: {:X?}, length: {}, terminal id: {}, serial: {:X?}", + "id: {:#06x}, length: {}, terminal id: {}, serial: {:X?}", self.id, self.bodylength, self.terminal_id, self.serial_number ) } diff --git a/src/parser/mod.rs b/src/parser/mod.rs index 4379b65..a32a613 100644 --- a/src/parser/mod.rs +++ b/src/parser/mod.rs @@ -1,13 +1,13 @@ #![allow(unused_variables)] -mod body; -mod error; -mod header; +pub mod body; +pub mod error; +pub mod header; -use body::*; -use error::*; -use header::*; +pub use body::*; +pub use error::*; +pub use header::*; -use crate::db::*; +pub use super::db::*; use std::collections::VecDeque; @@ -253,100 +253,91 @@ impl Message { } } - pub fn set_reply(inmsg: Message) -> Option { + pub fn send_reply(inmsg: Option) -> Option { let mut reply: Message = Message::default(); - let terminal_id = inmsg.header.get_raw_terminal_id().clone(); - match inmsg.content { - MessageType::TerminalRegistration(t) => { - let cnt = t.generate_reply(terminal_id.into(), inmsg.header.serial_number); - reply.header.build( - TerminalRegistrationReply::ID, - cnt.to_raw().len(), - terminal_id, - ); - reply.content = MessageType::TerminalRegistrationReply(cnt); - } - MessageType::TerminalAuthentication(t) => { - let cnt = t.generate_reply(TerminalAuthentication::ID, inmsg.header.serial_number); - reply.header.build( - PlatformUniversalResponse::ID, - cnt.to_raw().len(), - terminal_id, - ); - reply.content = MessageType::PlatformUniversalResponse(cnt); - } - MessageType::LocationInformationReport(t) => { - let cnt = - t.generate_reply(LocationInformationReport::ID, inmsg.header.serial_number); - reply.header.build( - PlatformUniversalResponse::ID, - cnt.to_raw().len(), - terminal_id, - ); - reply.content = MessageType::PlatformUniversalResponse(cnt); - } - MessageType::TerminalHeartbeat(t) => { - let cnt = t.generate_reply(TerminalHeartbeat::ID, inmsg.header.serial_number); - reply.header.build( - PlatformUniversalResponse::ID, - cnt.to_raw().len(), - terminal_id, - ); - reply.content = MessageType::PlatformUniversalResponse(cnt); - } - MessageType::TerminalLogout(t) => { - let cnt = t.generate_reply(TerminalHeartbeat::ID, inmsg.header.serial_number); - reply.header.build( - PlatformUniversalResponse::ID, - cnt.to_raw().len(), - terminal_id, - ); - reply.content = MessageType::PlatformUniversalResponse(cnt); - } - _ => { - println!("no type"); - return None; + match inmsg { + Some(inmsg) => { + let terminal_id = inmsg.header.get_raw_terminal_id().clone(); + match inmsg.content { + MessageType::TerminalRegistration(t) => { + let content = + t.generate_reply(terminal_id.into(), inmsg.header.serial_number); + reply.header.build( + TerminalRegistrationReply::ID, + content.to_raw().len(), + terminal_id, + ); + reply.content = MessageType::TerminalRegistrationReply(content); + } + MessageType::TerminalAuthentication(t) => { + let content = t + .generate_reply(TerminalAuthentication::ID, inmsg.header.serial_number); + reply.header.build( + PlatformUniversalResponse::ID, + content.to_raw().len(), + terminal_id, + ); + reply.content = MessageType::PlatformUniversalResponse(content); + } + MessageType::LocationInformationReport(t) => { + let content = t.generate_reply( + LocationInformationReport::ID, + inmsg.header.serial_number, + ); + reply.header.build( + PlatformUniversalResponse::ID, + content.to_raw().len(), + terminal_id, + ); + reply.content = MessageType::PlatformUniversalResponse(content); + } + MessageType::TerminalHeartbeat(t) => { + let content = + t.generate_reply(TerminalHeartbeat::ID, inmsg.header.serial_number); + reply.header.build( + PlatformUniversalResponse::ID, + content.to_raw().len(), + terminal_id, + ); + reply.content = MessageType::PlatformUniversalResponse(content); + } + MessageType::TerminalLogout(t) => { + let content = + t.generate_reply(TerminalHeartbeat::ID, inmsg.header.serial_number); + reply.header.build( + PlatformUniversalResponse::ID, + content.to_raw().len(), + terminal_id, + ); + reply.content = MessageType::PlatformUniversalResponse(content); + } + _ => { + println!("no type"); + return None; + } + } } + None => {} } reply.outbound_finalize(); Some(reply) } - pub fn store(inmsg: &Message) { - match inmsg.content { - MessageType::LocationInformationReport(ref t) => { - /*{ - use std::fs::OpenOptions; - use std::io::prelude::*; - - let mut file = OpenOptions::new() - .write(true) - .append(true) - .open("data/log.txt") - .unwrap(); - - //if let Err(e) = writeln!(file, ) { - // eprintln!("Couldn't write to file: {}", e); - //} - file.write(format!("{},{},{}\n", t.time, t.latitude, t.longitude).as_bytes()) - .unwrap(); - }*/ - - let conn = connectdb().unwrap(); - let dblog = crate::db::DbLog { - serial: inmsg.header.serial_number, - time: t.time.format("%Y-%m-%d %H:%M:%S").to_string(), - latitude: t.latitude, - longitude: t.longitude, - speed: t.speed, - height: t.height, - direction: t.direction, - is_satellite: t.is_satellite(), - }; - insert(&conn, &dblog).unwrap(); - } - _ => {} - } + pub fn store(inmsg: &Message) -> Option { + let res = match inmsg.content { + MessageType::LocationInformationReport(ref t) => Some(DbLog { + serial: inmsg.header.serial_number, + time: t.time.format("%Y-%m-%d %H:%M:%S").to_string(), + latitude: t.latitude, + longitude: t.longitude, + speed: t.speed, + height: t.height, + direction: t.direction, + is_satellite: t.is_satellite(), + }), + _ => None, + }; + res } pub fn outbound_finalize(&mut self) { @@ -457,3 +448,22 @@ impl std::fmt::Display for MessageType { res } } + +/* +{ + use std::fs::OpenOptions; + use std::io::prelude::*; + + let mut file = OpenOptions::new() + .write(true) + .append(true) + .open("data/log.txt") + .unwrap(); + + //if let Err(e) = writeln!(file, ) { + // eprintln!("Couldn't write to file: {}", e); + //} + file.write(format!("{},{},{}\n", t.time, t.latitude, t.longitude).as_bytes()) + .unwrap(); +} +*/ diff --git a/src/serve.rs b/src/serve.rs new file mode 100644 index 0000000..4817154 --- /dev/null +++ b/src/serve.rs @@ -0,0 +1,165 @@ +pub use crate::db::sqlite_engine::SQLiteEngine; +pub use crate::db::*; +pub use crate::parser::*; + +use std::io; + +use std::sync::Arc; + +use tokio::net::{TcpListener, TcpStream}; +use tokio::sync::mpsc::{channel, Receiver, Sender}; +use tokio::sync::RwLock; + +const ADDR: &'static str = "0.0.0.0"; +const PORT: u64 = 7701; +const BUFSIZE: usize = 1024; + +pub async fn control_server() -> Receiver { + let listener = TcpListener::bind("127.0.0.1:7702").await.unwrap(); + let (sender, receiver): (Sender, Receiver) = channel(100); + + tokio::spawn(async move { + loop { + let (socket, _) = listener.accept().await.unwrap(); + socket.readable().await.unwrap(); + let mut buf = [0; 16]; + match socket.try_read(&mut buf) { + Ok(0) => {} + Ok(n) => { + let mut data = str::from_utf8(&buf).unwrap(); + data = data.trim(); + if data.starts_with("test") { + sender.send(1).await.unwrap(); + println!("ok"); + } else { + println!("n: {n}, msg: '{data}'"); + } + } + Err(e) => { + println!("{e}") + } + } + } + }); + receiver +} + +pub async fn micodus_protocol_server(receiver: Receiver) { + let mut sql: SQLEngine = SQLEngine::SQLite(SQLiteEngine::default()); + sql.connect(); + + let arc_recv = Arc::new(RwLock::new(receiver)); + + let listener = match TcpListener::bind(format!("{}:{}", ADDR, PORT)).await { + Ok(o) => o, + Err(e) => { + println!("error: {e}"); + std::process::exit(1); + } + }; + + //let sql_ref = Arc::clone(&arc_s); + loop { + let recv_clone = Arc::clone(&arc_recv); + let (socket, _remote_addr) = listener.accept().await.unwrap(); + tokio::spawn(async move { + serve(&socket, &recv_clone).await; + }); + } +} + +async fn serve(socket: &TcpStream, a: &Arc>>) { + let mut buf = vec![0; BUFSIZE]; + let aa = Arc::clone(&a); + loop { + let mut bb = aa.write().await; + //let terminal_id = 0; + + tokio::select! { + readable = socket.readable() => { + match readable { + Ok(_) => { + match socket.try_read(&mut buf) { + Ok(_) => match handle(&buf) { + Some(o) => match socket.try_write(&o) { + Ok(_) => {} + Err(e) => { + println!("error: {e}"); + } + }, + None => { + println!("none"); + } + }, + Err(e) => { + if e.kind() == io::ErrorKind::WouldBlock { + println!("{e}"); + } + } + } + } + Err(e) => { + println!("error socket readable: {e}"); + } + } + } + + send = bb.recv() => { + match socket.writable().await { + Ok(_) => { + match send { + Some(o) => match o { + 1 => { + socket.try_write(&[o, 0x01]).unwrap(); + println!("sent"); + } + _ => {}, + }, + None => { + } + } + } + Err(e) => { + println!("error socket not writable: {e}") + } + } + } + } + } +} + +fn handle(buf: &Vec) -> Option> { + let mut rawdata = InboundDataWrapper::new(buf.to_vec()); + //let sql = Arc::clone(s); + let reply = match parse_inbound_msg(&mut rawdata) { + Ok(o) => { + println!("query: {}", o); + //println!("raw query: {:X?}", o.to_raw()); + match Message::store(&o) { + Some(log) => { + let mut s: SQLEngine = SQLEngine::SQLite(SQLiteEngine::default()); + s.connect(); + s.insert(&log); + } + None => {} + }; + Message::send_reply(Some(o)) + } + Err(e) => { + println!("parse inbound message error: {}", e); + return None; + } + }; + + match reply { + Some(o) => { + println!("reply: {}", o); + //println!("raw reply {:X?}", o.to_raw()); + println!("--------------"); + return Some(o.to_raw().into()); + } + None => { + return None; + } + } +} diff --git a/tools/sql.lua b/tools/sql.lua new file mode 100755 index 0000000..b5eeaa7 --- /dev/null +++ b/tools/sql.lua @@ -0,0 +1,26 @@ +#!/usr/bin/lua + +local sqlite = require("lsqlite3") +local basepath = "/home/paul/git/micodus_server" +local dbfile = string.format("%s/data/tracker.db",basepath) +local output = string.format("%s/html/lastloc.json",basepath) +local query = [[ + SELECT latitude,longitude + FROM log + ORDER BY time DESC + LIMIT 1; +]] + +function main() + local db = sqlite.open(dbfile) + + local res, vm = db:nrows(query) + for row in res, vm do + local locstr = string.format("{\"latitude\": %s, \"longitude\": %s}", row.latitude, row.longitude) + f = io.open(output, "w") + f:write(locstr) + end + db:close() +end + +main() diff --git a/tools/systemd_run.sh b/tools/systemd_run.sh new file mode 100644 index 0000000..121cf69 --- /dev/null +++ b/tools/systemd_run.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env zsh + +sudo systemd-run --uid=paul --working-directory=/home/paul/git/micodus_server ./target/release/micodus_server