diff --git a/.dockerignore b/.dockerignore index 33a5794..8bd1571 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,3 +2,5 @@ target/ .git/ web/node_modules/ web/dist/ +web/dist-desktop/ +desktop/node_modules/ diff --git a/Cargo.lock b/Cargo.lock index c0e518c..b1ede2a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,6 +17,21 @@ dependencies = [ "memchr", ] +[[package]] +name = "alloc-no-stdlib" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2fb6cfd47bf496ff64095c20eaba0c201404ee38714d4142fcfa1dc334fcc7a" + +[[package]] +name = "alloc-stdlib" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b5c1865780388bfa186411ab5f247819487fc4864c6e9c3106611fa347586e1" +dependencies = [ + "alloc-no-stdlib", +] + [[package]] name = "android_system_properties" version = "0.1.6" @@ -82,12 +97,180 @@ version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" +[[package]] +name = "async-broadcast" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532" +dependencies = [ + "event-listener", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-channel" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "924ed96dd52d1b75e9c1a3e6275715fd320f5f9439fb5a4a11fa51f4221158d2" +dependencies = [ + "concurrent-queue", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-executor" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c96bf972d85afc50bf5ab8fe2d54d1586b4e0b46c97c50a0c9e71e2f7bcd812a" +dependencies = [ + "async-task", + "concurrent-queue", + "fastrand", + "futures-lite", + "pin-project-lite", + "slab", +] + +[[package]] +name = "async-io" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "456b8a8feb6f42d237746d4b3e9a178494627745c3c56c6ea55d92ba50d026fc" +dependencies = [ + "autocfg", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite", + "parking", + "polling", + "rustix", + "slab", + "windows-sys 0.61.2", +] + +[[package]] +name = "async-lock" +version = "3.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f7f2596bd5b78a9fec8088ccd89180d7f9f55b94b0576823bbbdc72ee8311" +dependencies = [ + "event-listener", + "event-listener-strategy", + "pin-project-lite", +] + +[[package]] +name = "async-process" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc50921ec0055cdd8a16de48773bfeec5c972598674347252c0399676be7da75" +dependencies = [ + "async-channel", + "async-io", + "async-lock", + "async-signal", + "async-task", + "blocking", + "cfg-if", + "event-listener", + "futures-lite", + "rustix", +] + +[[package]] +name = "async-recursion" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f8abc12baad266b1c8cec146854c195b5864b4221d4b2ca7296a7ae82d9e451" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "async-signal" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52b5aaafa020cf5053a01f2a60e8ff5dccf550f0f77ec54a4e47285ac2bab485" +dependencies = [ + "async-io", + "async-lock", + "atomic-waker", + "cfg-if", + "futures-core", + "futures-io", + "rustix", + "signal-hook-registry", + "slab", + "windows-sys 0.61.2", +] + +[[package]] +name = "async-task" +version = "4.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" + +[[package]] +name = "async-trait" +version = "0.1.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82f6aeea286b8eb4dd3431a1be1b59d290ace00f5bfd8e2a159bc2a05e2c1667" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "atk" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "241b621213072e993be4f6f3a9e4b45f65b7e6faad43001be957184b7bb1824b" +dependencies = [ + "atk-sys", + "glib", + "libc", +] + +[[package]] +name = "atk-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5e48b684b0ca77d2bbadeef17424c2ea3c897d44d566a1617e7e8f30614d086" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + [[package]] name = "atomic-waker" version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" +[[package]] +name = "auto-launch" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17918dba7ecf78b9a14507ec9f984e7977d13fad87dc86d61038980a45d128cf" +dependencies = [ + "dirs 6.0.0", + "os_info", + "smappservice-rs", + "thiserror 2.0.21", + "windows-registry", + "windows-result", +] + [[package]] name = "autocfg" version = "1.5.1" @@ -146,17 +329,56 @@ dependencies = [ "tracing", ] +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + [[package]] name = "base64" version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac07cdecf99051d9a5238b80f35af32cdeba5b336e55d957b318b50137e18da5" +[[package]] +name = "bit-set" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + [[package]] name = "bitflags" version = "2.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06" +dependencies = [ + "serde_core", +] + +[[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 = "block-buffer" @@ -167,17 +389,158 @@ dependencies = [ "hybrid-array", ] +[[package]] +name = "block2" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdeb9d870516001442e364c5220d3574d2da8dc765554b4a617230d33fa58ef5" +dependencies = [ + "objc2", +] + +[[package]] +name = "blocking" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a70e4329df6cb94385eed412ec92375c3cdd8a6e502493d1229b6414e4036dfa" +dependencies = [ + "async-channel", + "async-task", + "futures-io", + "futures-lite", + "piper", +] + +[[package]] +name = "brotli" +version = "9.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "627b7cfb0578f0eafce087a90fcd40add1231900b69e4d4de2d456260a4f5d81" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli-decompressor" +version = "6.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34c6783f42c21c952ad7112b354f0ba2f10760e9decea5b1b60523d6e270faaf" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + +[[package]] +name = "bs58" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" +dependencies = [ + "tinyvec", +] + [[package]] name = "bumpalo" version = "3.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" +[[package]] +name = "bytemuck" +version = "1.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95832e849adfb21180ccb6826a99da14e5d266ae5c2e668e1602cf234f153797" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "byteorder-lite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" + [[package]] name = "bytes" version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" +dependencies = [ + "serde", +] + +[[package]] +name = "cairo-rs" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ca26ef0159422fb77631dc9d17b102f253b876fe1586b03b803e63a309b4ee2" +dependencies = [ + "bitflags 2.13.2", + "cairo-sys-rs", + "glib", + "libc", + "once_cell", + "thiserror 1.0.69", +] + +[[package]] +name = "cairo-sys-rs" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "685c9fa8e590b8b3d678873528d83411db17242a73fccaed827770ea0fedda51" +dependencies = [ + "glib-sys", + "libc", + "system-deps", +] + +[[package]] +name = "camino" +version = "1.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbbad30e4b4c14a39e3cc8aed085a12a327257c316619c93581e017bc52be591" +dependencies = [ + "serde_core", +] + +[[package]] +name = "cargo-platform" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd5eb614ed4c27c5d706420e4320fbe3216ab31fa1c33cd8246ac36dae4479ba" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror 2.0.21", +] + +[[package]] +name = "cargo_toml" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82f4b26e751e711a5302649417f2da046dce6391b2ea30a4820f37462314f0b9" +dependencies = [ + "semver", + "serde", + "toml 1.1.8+spec-1.1.0", +] [[package]] name = "cc" @@ -191,12 +554,45 @@ dependencies = [ "shlex", ] +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + +[[package]] +name = "cfb" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a347dcabdae9c31b0825fd6a8bed285ec9c2acb89c47827126d52fa4f59cece3" +dependencies = [ + "fnv", + "uuid", + "web-time", +] + +[[package]] +name = "cfg-expr" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" +dependencies = [ + "smallvec", + "target-lexicon", +] + [[package]] name = "cfg-if" version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600" +[[package]] +name = "cfg_aliases" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527" + [[package]] name = "chrono" version = "0.4.45" @@ -206,10 +602,21 @@ dependencies = [ "iana-time-zone", "js-sys", "num-traits", + "serde", "wasm-bindgen", "windows-link", ] +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common 0.1.7", + "inout", +] + [[package]] name = "clap" version = "4.6.7" @@ -238,7 +645,7 @@ version = "4.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9c751b79415d4e559e3d1fcf128e09e720eb673a06d26cf6f392d37d75b66e0" dependencies = [ - "heck", + "heck 0.5.0", "proc-macro2", "quote", "syn 3.0.9", @@ -256,12 +663,51 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" +[[package]] +name = "combine" +version = "4.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4356eba6976435498d05a311ee9fc486da3bc81c200d3f0d7dd9703b41913f92" +dependencies = [ + "bytes", + "memchr", +] + +[[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.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a6ef517f0926dd24a1582492c791b6a4818a4d94e789a334894aa15b0d12f55c" +[[package]] +name = "const-random" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87e00182fe74b066627d63b85fd550ac2998d4b0bd86bfed477a0ae4c7c71359" +dependencies = [ + "const-random-macro", +] + +[[package]] +name = "const-random-macro" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" +dependencies = [ + "getrandom 0.2.17", + "once_cell", + "tiny-keccak", +] + [[package]] name = "cookie" version = "0.18.2" @@ -282,7 +728,7 @@ dependencies = [ "cookie", "document-features", "idna", - "indexmap", + "indexmap 2.14.2", "log", "serde", "serde_derive", @@ -291,12 +737,65 @@ dependencies = [ "url", ] +[[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" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +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 = "core-graphics" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "064badf302c3194842cf2c5d61f56cc88e54a759313879cdf03abdd27d0c3b97" +dependencies = [ + "bitflags 2.13.2", + "core-foundation 0.10.1", + "core-graphics-types", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics-types" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb" +dependencies = [ + "bitflags 2.13.2", + "core-foundation 0.10.1", + "libc", +] + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + [[package]] name = "cpufeatures" version = "0.3.1" @@ -315,6 +814,37 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "crossbeam-channel" +version = "0.5.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98b0cc327b5bc766e7fda9c9260cc0fa81b43a8e240440422dff70788e3f9ef1" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6" + +[[package]] +name = "crunchy" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" + +[[package]] +name = "crypto-common" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +dependencies = [ + "generic-array", + "typenum", +] + [[package]] name = "crypto-common" version = "0.2.2" @@ -324,11 +854,157 @@ dependencies = [ "hybrid-array", ] +[[package]] +name = "cssparser" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c9cdaae01d5ed7882b04d795e7f752f46ff52d2fa3b50a20d28c464510bba98" +dependencies = [ + "cssparser-macros", + "dtoa-short", + "itoa", + "phf", + "smallvec", +] + +[[package]] +name = "cssparser-macros" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d045de693cb712d0b22c6a64be5b953f67b3ce00ab5ad3dd5d8b441886ab8e1a" +dependencies = [ + "quote", + "syn 3.0.9", +] + +[[package]] +name = "ct-codecs" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd9f3db6f2cfef61c10613071955154ffdc9e515daebff26de4b54e35038fdd" + +[[package]] +name = "ctor" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "914a755b7c2d4af2bdcff7ce1739e2db9a1b81a9b07123d8015786ae03c0980d" + +[[package]] +name = "darling" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed17f5901b6630b993ca003def43f2f8ef4014fc13b047b57aad617ff32bc2ec" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6837e2cf7485aaae18f86181d2f0e9a7ed297a025e220aeabf63fdebd3a2ddff" +dependencies = [ + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 3.0.9", +] + +[[package]] +name = "darling_macro" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ac7135c3ef02b2f7833bbeb1be5ba7f966dcde8a87c6b87f65a778d71a02785" +dependencies = [ + "darling_core", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "dbus" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ab69f03cc8c4340c9c8e315114e1658e6775a9b16a04357973aa21cec22b32e" +dependencies = [ + "libc", + "libdbus-sys", + "windows-sys 0.61.2", +] + +[[package]] +name = "defmt" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4a0795ac740cb54d7b3775c9c17345f6aaecf884c01733b39d6017738e0e3e1" +dependencies = [ + "bitflags 1.3.2", + "defmt-macros", +] + +[[package]] +name = "defmt-macros" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "840bb056bd99c495c9188198a258ab787c79f306d864db3e6e8451442d6d8366" +dependencies = [ + "defmt-parser", + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "defmt-parser" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71958f69fb2de856c5dd51ac9377e986ca1aa5919f931bf5395a807277f889a0" +dependencies = [ + "thiserror 2.0.21", +] + [[package]] name = "deranged" version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e9de72ce2ad1f90dc62fa25f0f430ef85eb4b0d8fa0be4f30373bc40a21d28e" +dependencies = [ + "serde_core", +] + +[[package]] +name = "derive_more" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb" +dependencies = [ + "proc-macro2", + "quote", + "rustc_version", + "syn 2.0.119", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer 0.10.4", + "crypto-common 0.1.7", + "subtle", +] [[package]] name = "digest" @@ -336,9 +1012,18 @@ version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1dd6dbb5841937940781866fa1281a1ff7bd3bf827091440879f9994983d5c2" dependencies = [ - "block-buffer", + "block-buffer 0.12.1", "const-oid", - "crypto-common", + "crypto-common 0.2.2", +] + +[[package]] +name = "dirs" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" +dependencies = [ + "dirs-sys", ] [[package]] @@ -362,6 +1047,18 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "dispatch2" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e0e367e4e7da84520dedcac1901e4da967309406d1e51017ae1abfb97adbd38" +dependencies = [ + "bitflags 2.13.2", + "block2", + "libc", + "objc2", +] + [[package]] name = "displaydoc" version = "0.2.7" @@ -373,6 +1070,38 @@ dependencies = [ "syn 3.0.9", ] +[[package]] +name = "dlopen2" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e2c5bd4158e66d1e215c49b837e11d62f3267b30c92f1d171c4d3105e3dc4d4" +dependencies = [ + "dlopen2_derive", + "libc", + "once_cell", + "winapi", +] + +[[package]] +name = "dlopen2_derive" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fbbb781877580993a8707ec48672673ec7b81eeba04cfd2310bd28c08e47c8f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "dlv-list" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "442039f5147480ba31067cb00ada1adae6892028e40e45fc5de7b7df6dcc1b5f" +dependencies = [ + "const-random", +] + [[package]] name = "document-features" version = "0.2.12" @@ -382,12 +1111,121 @@ dependencies = [ "litrs", ] +[[package]] +name = "dom_query" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fac5fca71e65e94cc718a6e2af65d6e0f9c6027751c2aa562fbb5087fda639bc" +dependencies = [ + "bit-set", + "cssparser", + "foldhash", + "html5ever", + "precomputed-hash", + "selectors", + "tendril", +] + +[[package]] +name = "dpi" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8b14ccef22fc6f5a8f4d7d768562a182c04ce9a3b3157b91390b52ddfdf1a76" +dependencies = [ + "serde", +] + +[[package]] +name = "dtoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c3cf4824e2d5f025c7b531afcb2325364084a16806f6d47fbc1f5fbd9960590" + +[[package]] +name = "dtoa-short" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd1511a7b6a56299bd043a9c167a6d2bfb37bf84a6dfceaba651168adfb43c87" +dependencies = [ + "dtoa", +] + +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + +[[package]] +name = "dyn-clone" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" + +[[package]] +name = "embed-resource" +version = "3.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6168487b5e7eb2673e6efe1200b1848016e436a6ca0b8031bf04bd9d493a249f" +dependencies = [ + "cc", + "memchr", + "rustc_version", + "toml 1.1.8+spec-1.1.0", + "vswhom", + "winreg", +] + +[[package]] +name = "embed_plist" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ef6b89e5b37196644d8796de5268852ff179b44e96276cf4290264843743bb7" + +[[package]] +name = "endi" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66b7e2430c6dff6a955451e2cfc438f09cea1965a9d6f87f7e3b90decc014099" + +[[package]] +name = "enumflags2" +version = "0.7.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1027f7680c853e056ebcec683615fb6fbbc07dbaa13b4d5d9442b146ded4ecef" +dependencies = [ + "enumflags2_derive", + "serde", +] + +[[package]] +name = "enumflags2_derive" +version = "0.7.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67c78a4d8fdf9953a5c9d458f9efe940fd97a0cab0941c075a813ac594733827" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + [[package]] name = "equivalent" version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00d174d5400e5e8fd687ad1049e2f578285fa914201b1af7e8b112a4546bd826" +[[package]] +name = "erased-serde" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e59b668157f32d3459d4bd634861a06ffa2503a461ca5f0916b9f0252605e66" +dependencies = [ + "serde", + "serde_core", + "typeid", +] + [[package]] name = "errno" version = "0.3.14" @@ -398,6 +1236,26 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "event-listener" +version = "5.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a23add41df1562121a9393cb065eab5146a1242410f23a644851e90cfd669d2" +dependencies = [ + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" +dependencies = [ + "event-listener", + "pin-project-lite", +] + [[package]] name = "fallible-iterator" version = "0.3.0" @@ -416,6 +1274,35 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223" +[[package]] +name = "fdeflate" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e6853b52649d4ac5c0bd02320cddc5ba956bdb407c4b75a2c6b75bf51500f8c" +dependencies = [ + "simd-adler32", +] + +[[package]] +name = "field-offset" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f" +dependencies = [ + "memoffset", + "rustc_version", +] + +[[package]] +name = "filetime" +version = "0.2.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c287a33c7f0a620c38e641e7f60827713987b3c0f26e8ddc9462cc69cf75759" +dependencies = [ + "cfg-if", + "libc", +] + [[package]] name = "find-msvc-tools" version = "0.1.15" @@ -429,16 +1316,49 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e634e2e0ebac1ee034020da1ca582e17ffe4e0f5e985823721e168928136dcb" dependencies = [ "crc32fast", - "miniz_oxide", + "miniz_oxide 0.9.1", "zlib-rs", ] +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + [[package]] name = "foldhash" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" +[[package]] +name = "foreign-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-macros" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea5190182e6915eb873ddbc16e23b711b6eb1f9c00a0d0a3a91b5f6228475225" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + [[package]] name = "form_urlencoded" version = "1.2.2" @@ -448,12 +1368,68 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "futures-channel" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f9e3d69d39e4862ffed03ed071a76f9a13ba1d9109d355b0f0aa6b15e393c4" +dependencies = [ + "futures-core", +] + [[package]] name = "futures-core" version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e" +[[package]] +name = "futures-executor" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "031b47cf1a3c6cc8bc2fc76cd437f521619387907d469316e7c0bc278f1f5432" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53c0fa8157de1303bfffdaa1cc2a673bfffb60102f76b0ef4441659124373fed" + +[[package]] +name = "futures-lite" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f78e10609fe0e0b3f4157ffab1876319b5b0db102a2c60dc4626306dc46b44ad" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", +] + +[[package]] +name = "futures-macro" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb9654ba8355388abeb8dcb4fc62f511300867002afc858860463bdd9fe0c44" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "futures-sink" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1944426bf7d03f1d14f708785e4b33efd750b36d48a157b836b3efc15ede8e1d" + [[package]] name = "futures-task" version = "0.3.34" @@ -467,11 +1443,124 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc" dependencies = [ "futures-core", + "futures-io", + "futures-macro", + "futures-sink", "futures-task", + "memchr", "pin-project-lite", "slab", ] +[[package]] +name = "gdk" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9f245958c627ac99d8e529166f9823fb3b838d1d41fd2b297af3075093c2691" +dependencies = [ + "cairo-rs", + "gdk-pixbuf", + "gdk-sys", + "gio", + "glib", + "libc", + "pango", +] + +[[package]] +name = "gdk-pixbuf" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50e1f5f1b0bfb830d6ccc8066d18db35c487b1b2b1e8589b5dfe9f07e8defaec" +dependencies = [ + "gdk-pixbuf-sys", + "gio", + "glib", + "libc", + "once_cell", +] + +[[package]] +name = "gdk-pixbuf-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9839ea644ed9c97a34d129ad56d38a25e6756f99f3a88e15cd39c20629caf7" +dependencies = [ + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "gdk-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c2d13f38594ac1e66619e188c6d5a1adb98d11b2fcf7894fc416ad76aa2f3f7" +dependencies = [ + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "pkg-config", + "system-deps", +] + +[[package]] +name = "gdkwayland-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "140071d506d223f7572b9f09b5e155afbd77428cd5cc7af8f2694c41d98dfe69" +dependencies = [ + "gdk-sys", + "glib-sys", + "gobject-sys", + "libc", + "pkg-config", + "system-deps", +] + +[[package]] +name = "gdkx11" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3caa00e14351bebbc8183b3c36690327eb77c49abc2268dd4bd36b856db3fbfe" +dependencies = [ + "gdk", + "gdkx11-sys", + "gio", + "glib", + "libc", + "x11", +] + +[[package]] +name = "gdkx11-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e2e7445fe01ac26f11601db260dd8608fe172514eb63b3b5e261ea6b0f4428d" +dependencies = [ + "gdk-sys", + "glib-sys", + "libc", + "system-deps", + "x11", +] + +[[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 = "gethostname" version = "1.1.0" @@ -493,6 +1582,18 @@ dependencies = [ "wasi", ] +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "libc", + "r-efi 5.3.0", + "wasip2", +] + [[package]] name = "getrandom" version = "0.4.3" @@ -500,8 +1601,42 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" dependencies = [ "cfg-if", + "js-sys", "libc", - "r-efi", + "r-efi 6.0.0", + "wasm-bindgen", +] + +[[package]] +name = "gio" +version = "0.18.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4fc8f532f87b79cbc51a79748f16a6828fb784be93145a322fa14d06d354c73" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "gio-sys", + "glib", + "libc", + "once_cell", + "pin-project-lite", + "smallvec", + "thiserror 1.0.69", +] + +[[package]] +name = "gio-sys" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37566df850baf5e4cb0dfb78af2e4b9898d817ed9263d1090a2df958c64737d2" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", + "winapi", ] [[package]] @@ -510,15 +1645,143 @@ version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ddddbf932745a6be37109b6112d3ee09696106f848449069d3a57bba937ab82e" dependencies = [ - "bitflags", + "bitflags 2.13.2", "libc", "libgit2-sys", "log", - "openssl-probe", + "openssl-probe 0.1.6", "openssl-sys", "url", ] +[[package]] +name = "glib" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "233daaf6e83ae6a12a52055f568f9d7cf4671dabb78ff9560ab6da230ce00ee5" +dependencies = [ + "bitflags 2.13.2", + "futures-channel", + "futures-core", + "futures-executor", + "futures-task", + "futures-util", + "gio-sys", + "glib-macros", + "glib-sys", + "gobject-sys", + "libc", + "memchr", + "once_cell", + "smallvec", + "thiserror 1.0.69", +] + +[[package]] +name = "glib-macros" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb0228f477c0900c880fd78c8759b95c7636dbd7842707f49e132378aa2acdc" +dependencies = [ + "heck 0.4.1", + "proc-macro-crate 2.0.2", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "glib-sys" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063ce2eb6a8d0ea93d2bf8ba1957e78dbab6be1c2220dd3daca57d5a9d869898" +dependencies = [ + "libc", + "system-deps", +] + +[[package]] +name = "glob" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4eba85ea1d0a966a983acd07deee566e67395d2d96b6fb39e62b5a833f1eb0b" + +[[package]] +name = "gobject-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0850127b514d1c4a4654ead6dedadb18198999985908e6ffe4436f53c785ce44" +dependencies = [ + "glib-sys", + "libc", + "system-deps", +] + +[[package]] +name = "gtk" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd56fb197bfc42bd5d2751f4f017d44ff59fbb58140c6b49f9b3b2bdab08506a" +dependencies = [ + "atk", + "cairo-rs", + "field-offset", + "futures-channel", + "gdk", + "gdk-pixbuf", + "gio", + "glib", + "gtk-sys", + "gtk3-macros", + "libc", + "pango", + "pkg-config", +] + +[[package]] +name = "gtk-sys" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f29a1c21c59553eb7dd40e918be54dccd60c52b049b75119d5d96ce6b624414" +dependencies = [ + "atk-sys", + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gdk-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "system-deps", +] + +[[package]] +name = "gtk3-macros" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ff3c5b21f14f0736fed6dcfc0bfb4225ebf5725f3c0209edeec181e4d73e9d" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[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" + [[package]] name = "hashbrown" version = "0.17.1" @@ -534,15 +1797,52 @@ version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a596f1b20ed2cc5ecac41a164aaebc7258057060f06c0cf7a2ba3991ee7990fb" dependencies = [ - "hashbrown", + "hashbrown 0.17.1", ] +[[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 = "hermit-abi" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17592d60ebacc7d5e169f4663c5f84f9161cc90328abcfe8456f41e4dfcb284" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "html5ever" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46a1761807faccc9a19e86944bbf40610014066306f96edcdedc2fb714bcb7b8" +dependencies = [ + "log", + "markup5ever", +] + [[package]] name = "http" version = "1.5.0" @@ -614,6 +1914,22 @@ dependencies = [ "pin-project-lite", "smallvec", "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfa8e654703247911e29c23fbeaa261834bd9bb74efba2f9acddc37bfb127f53" +dependencies = [ + "http", + "hyper", + "hyper-util", + "rustls", + "tokio", + "tokio-rustls", + "tower-service", ] [[package]] @@ -622,13 +1938,24 @@ version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ddc03d96684f9226b8a787cdb71488417b53ab5ea8fdb1dac946cb9431cc8bff" dependencies = [ + "base64 0.23.1", "bytes", + "futures-channel", + "futures-util", "http", "http-body", + "httparse", "hyper", + "ipnet", + "libc", + "percent-encoding", "pin-project-lite", + "socket2", + "system-configuration", "tokio", "tower-service", + "tracing", + "windows-registry", ] [[package]] @@ -655,6 +1982,16 @@ dependencies = [ "cc", ] +[[package]] +name = "ico" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75e94d66081e4d8dcd098bd8dc5254800fea14a26389b298410158d834de167" +dependencies = [ + "byteorder", + "png", +] + [[package]] name = "icu_collections" version = "2.4.0" @@ -738,6 +2075,12 @@ dependencies = [ "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" @@ -759,6 +2102,30 @@ dependencies = [ "icu_properties", ] +[[package]] +name = "image" +version = "0.25.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85ab80394333c02fe689eaf900ab500fbd0c2213da414687ebf995a65d5a6104" +dependencies = [ + "bytemuck", + "byteorder-lite", + "moxcms", + "num-traits", + "png", +] + +[[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", + "serde", +] + [[package]] name = "indexmap" version = "2.14.2" @@ -766,7 +2133,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc4e190f5d26ca7051642629da2c52fc03bde85a03197c99408dcd291734c855" dependencies = [ "equivalent", - "hashbrown", + "hashbrown 0.17.1", + "serde", + "serde_core", +] + +[[package]] +name = "infer" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4200d433cbd5178df7797c9c2e75b348b728e39631cf14520d1e2fc424201f4" +dependencies = [ + "cfb", ] [[package]] @@ -775,7 +2153,7 @@ version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cc00ea907cab49550b7da656f80ebb97be1b997d931fbcd28d39734e17ce592" dependencies = [ - "bitflags", + "bitflags 2.13.2", "inotify-sys", "libc", ] @@ -789,6 +2167,40 @@ dependencies = [ "libc", ] +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "generic-array", +] + +[[package]] +name = "ipnet" +version = "2.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "791930b43c0d5973160d90a8f3894509f2b273430f5c5c73b668636d0287c5c0" + +[[package]] +name = "is-docker" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "928bae27f42bc99b60d9ac7334e3a21d10ad8f1835a4e12ec3ec0464765ed1b3" +dependencies = [ + "once_cell", +] + +[[package]] +name = "is-wsl" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "173609498df190136aa7dea1a91db051746d339e18476eed5ca40521f02d7aa5" +dependencies = [ + "is-docker", + "once_cell", +] + [[package]] name = "is_terminal_polyfill" version = "1.70.2" @@ -801,6 +2213,157 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" +[[package]] +name = "javascriptcore-rs" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca5671e9ffce8ffba57afc24070e906da7fc4b1ba66f2cabebf61bf2ea257fcc" +dependencies = [ + "bitflags 1.3.2", + "glib", + "javascriptcore-rs-sys", +] + +[[package]] +name = "javascriptcore-rs-sys" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af1be78d14ffa4b75b66df31840478fef72b51f8c2465d4ca7c194da9f7a5124" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "jiff" +version = "0.2.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2b005715dcbeb0089a3c0dab99f2ff1cc3b2525323552703d648585d342a383" +dependencies = [ + "defmt", + "jiff-core", + "jiff-static", + "jiff-tzdb-platform", + "log", + "portable-atomic", + "portable-atomic-util", + "serde_core", + "windows-link", +] + +[[package]] +name = "jiff-core" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e52fe76043ccecc9005d2305ebaadf7d7fc0cc89ca6baa10a94d6bc68c7128c" +dependencies = [ + "defmt", + "log", +] + +[[package]] +name = "jiff-static" +version = "0.2.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cc9817253cf7c7ee4684451bd327e88d6f3658014e54a29198625590650695c" +dependencies = [ + "jiff-core", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "jiff-tzdb" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa8377070c6bae868759445e5a77f66d84f0b72f3a054bfb00e6d038b8282da7" + +[[package]] +name = "jiff-tzdb-platform" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "875a5a69ac2bab1a891711cf5eccbec1ce0341ea805560dcd90b7a2e925132e8" +dependencies = [ + "jiff-tzdb", +] + +[[package]] +name = "jni" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +dependencies = [ + "cesu8", + "cfg-if", + "combine", + "jni-sys 0.3.1", + "log", + "thiserror 1.0.69", + "walkdir", + "windows-sys 0.45.0", +] + +[[package]] +name = "jni" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5efd9a482cf3a427f00d6b35f14332adc7902ce91efb778580e180ff90fa3498" +dependencies = [ + "cfg-if", + "combine", + "jni-macros", + "jni-sys 0.4.1", + "log", + "simd_cesu8", + "thiserror 2.0.21", + "walkdir", + "windows-link", +] + +[[package]] +name = "jni-macros" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a00109accc170f0bdb141fed3e393c565b6f5e072365c3bd58f5b062591560a3" +dependencies = [ + "proc-macro2", + "quote", + "rustc_version", + "simd_cesu8", + "syn 2.0.119", +] + +[[package]] +name = "jni-sys" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41a652e1f9b6e0275df1f15b32661cf0d4b78d4d87ddec5e0c3c20f097433258" +dependencies = [ + "jni-sys 0.4.1", +] + +[[package]] +name = "jni-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6377a88cb3910bee9b0fa88d4f42e1d2da8e79915598f65fb0c7ee14c878af2" +dependencies = [ + "jni-sys-macros", +] + +[[package]] +name = "jni-sys-macros" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264" +dependencies = [ + "quote", + "syn 2.0.119", +] + [[package]] name = "jobserver" version = "0.1.35" @@ -822,6 +2385,38 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "json-patch" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7421438de105a0827e44fadd05377727847d717c80ce29a229f85fd04c427b72" +dependencies = [ + "jsonptr", + "serde", + "serde_json", + "thiserror 2.0.21", +] + +[[package]] +name = "jsonptr" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5a3cc660ba5d72bce0b3bb295bf20847ccbb40fd423f3f05b61273672e561fe" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "keyboard-types" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fbe853b403ae61a04233030ae8a79d94975281ed9770a1f9e246732b534b28d" +dependencies = [ + "bitflags 2.13.2", + "serde", +] + [[package]] name = "kqueue" version = "1.2.1" @@ -838,16 +2433,49 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07293a4e297ac234359b510362495713f75ea345d5307140414f20c69ffeb087" dependencies = [ - "bitflags", + "bitflags 2.13.2", "libc", ] +[[package]] +name = "libappindicator" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03589b9607c868cc7ae54c0b2a22c8dc03dd41692d48f2d7df73615c6a95dc0a" +dependencies = [ + "glib", + "gtk", + "gtk-sys", + "libappindicator-sys", + "log", +] + +[[package]] +name = "libappindicator-sys" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e9ec52138abedcc58dc17a7c6c0c00a2bdb4f3427c7f63fa97fd0d859155caf" +dependencies = [ + "gtk-sys", + "libloading", + "once_cell", +] + [[package]] name = "libc" version = "0.2.191" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a" +[[package]] +name = "libdbus-sys" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "328c4789d42200f1eeec05bd86c9c13c7f091d2ba9a6ea35acdf51f31bc0f043" +dependencies = [ + "pkg-config", +] + [[package]] name = "libgit2-sys" version = "0.18.8+1.9.7" @@ -862,6 +2490,16 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "libloading" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +dependencies = [ + "cfg-if", + "winapi", +] + [[package]] name = "libredox" version = "0.1.25" @@ -946,35 +2584,57 @@ name = "lune-core" version = "0.1.0" dependencies = [ "anyhow", - "base64", + "base64 0.23.1", "chrono", - "dirs", + "dirs 7.0.0", "gethostname", "git2", + "libgit2-sys", "notify", "regex", "serde", "serde_json", "tempfile", - "toml", + "toml 1.1.8+spec-1.1.0", "ureq", ] +[[package]] +name = "lune-desktop" +version = "0.1.0" +dependencies = [ + "anyhow", + "chrono", + "lune-core", + "serde", + "serde_json", + "tauri", + "tauri-build", + "tauri-plugin-autostart", + "tauri-plugin-deep-link", + "tauri-plugin-dialog", + "tauri-plugin-opener", + "tauri-plugin-updater", + "trash", + "url", +] + [[package]] name = "lunehub" version = "0.1.0" dependencies = [ "anyhow", "axum", - "base64", + "base64 0.23.1", "chrono", "getrandom 0.4.3", "lune-core", + "minisign", "rusqlite", "rust-embed", "serde", "serde_json", - "sha2", + "sha2 0.11.1", "tempfile", "tokio", "ureq", @@ -990,6 +2650,17 @@ dependencies = [ "lune-core", ] +[[package]] +name = "markup5ever" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7122d987ec5f704ee56f6e5b41a7d93722e9aae27ae07cafa4036c4d3f9757de" +dependencies = [ + "log", + "tendril", + "web_atoms", +] + [[package]] name = "matchit" version = "0.8.4" @@ -1002,6 +2673,15 @@ version = "2.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + [[package]] name = "mime" version = "0.3.17" @@ -1018,6 +2698,34 @@ dependencies = [ "unicase", ] +[[package]] +name = "minisign" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3062dbbf4d8f57899e2252804f7512a4fd89c8211c58fa6c786d38794a0c809d" +dependencies = [ + "ct-codecs", + "getrandom 0.4.3", + "rpassword", + "scrypt", +] + +[[package]] +name = "minisign-verify" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "871285dc19d8d0ebe0eef3d0e99a205f2a71363b122632cbbfa4a6c370a960ce" + +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", + "simd-adler32", +] + [[package]] name = "miniz_oxide" version = "0.9.1" @@ -1040,13 +2748,92 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "moxcms" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb85c154ba489f01b25c0d36ae69a87e4a1c73a72631fc6c0eb6dde34a73e44b" +dependencies = [ + "num-traits", + "pxfm", +] + +[[package]] +name = "muda" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cca139e57da4383727f189e43e66e84fa372347027fc996f9f1a007ec0a37996" +dependencies = [ + "crossbeam-channel", + "dpi", + "gtk", + "keyboard-types", + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-foundation", + "once_cell", + "png", + "serde", + "thiserror 2.0.21", + "windows-sys 0.61.2", +] + +[[package]] +name = "ndk" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" +dependencies = [ + "bitflags 2.13.2", + "jni-sys 0.3.1", + "log", + "ndk-sys", + "num_enum", + "raw-window-handle", + "thiserror 1.0.69", +] + +[[package]] +name = "ndk-context" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" + +[[package]] +name = "ndk-sys" +version = "0.6.0+11769913" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee6cda3051665f1fb8d9e08fc35c96d5a244fb1be711a03b71118828afc9a873" +dependencies = [ + "jni-sys 0.3.1", +] + +[[package]] +name = "new_debug_unreachable" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" + +[[package]] +name = "nix" +version = "0.31.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf20d2fde8ff38632c426f1165ed7436270b44f199fc55284c38276f9db47c3d" +dependencies = [ + "bitflags 2.13.2", + "cfg-if", + "cfg_aliases", + "libc", +] + [[package]] name = "notify" version = "8.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "82f812702fbc75d35416d3f884e04925be7e9498f4eceea2e24ba34559284674" dependencies = [ - "bitflags", + "bitflags 2.13.2", "inotify", "kqueue", "libc", @@ -1065,7 +2852,7 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a437a9308232ce794b1e7fdf540d38ea37efc3c73492640c13b4c8568b8f108" dependencies = [ - "bitflags", + "bitflags 2.13.2", ] [[package]] @@ -1083,13 +2870,115 @@ dependencies = [ "autocfg", ] +[[package]] +name = "num_enum" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d0bca838442ec211fa11de3a8b0e0e8f3a4522575b5c4c06ed722e005036f26" +dependencies = [ + "num_enum_derive", + "rustversion", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "680998035259dcfcafe653688bf2aa6d3e2dc05e98be6ab46afb089dc84f1df8" +dependencies = [ + "proc-macro-crate 3.5.0", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "objc2" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08849bbd4767dfae9457696856ae1c84fe4e0281bbe4a7abff2d0e06fb7981f8" +dependencies = [ + "objc2-encode", + "objc2-exception-helper", +] + +[[package]] +name = "objc2-app-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d49e936b501e5c5bf01fda3a9452ff86dc3ea98ad5f283e1455153142d97518c" +dependencies = [ + "bitflags 2.13.2", + "block2", + "objc2", + "objc2-core-foundation", + "objc2-foundation", + "objc2-quartz-core", +] + +[[package]] +name = "objc2-cloud-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73ad74d880bb43877038da939b7427bba67e9dd42004a18b809ba7d87cee241c" +dependencies = [ + "bitflags 2.13.2", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-core-data" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b402a653efbb5e82ce4df10683b6b28027616a2715e90009947d50b8dd298fa" +dependencies = [ + "objc2", + "objc2-foundation", +] + [[package]] name = "objc2-core-foundation" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" dependencies = [ - "bitflags", + "bitflags 2.13.2", + "dispatch2", + "objc2", +] + +[[package]] +name = "objc2-core-graphics" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e022c9d066895efa1345f8e33e584b9f958da2fd4cd116792e15e07e4720a807" +dependencies = [ + "bitflags 2.13.2", + "dispatch2", + "objc2", + "objc2-core-foundation", + "objc2-io-surface", +] + +[[package]] +name = "objc2-core-image" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d563b38d2b97209f8e861173de434bd0214cf020e3423a52624cd1d989f006" +dependencies = [ + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-core-location" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca347214e24bc973fc025fd0d36ebb179ff30536ed1f80252706db19ee452009" +dependencies = [ + "objc2", + "objc2-foundation", ] [[package]] @@ -1102,6 +2991,150 @@ dependencies = [ "objc2-core-foundation", ] +[[package]] +name = "objc2-core-text" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cde0dfb48d25d2b4862161a4d5fcc0e3c24367869ad306b0c9ec0073bfed92d" +dependencies = [ + "bitflags 2.13.2", + "objc2", + "objc2-core-foundation", + "objc2-core-graphics", +] + +[[package]] +name = "objc2-encode" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33" + +[[package]] +name = "objc2-exception-helper" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7a1c5fbb72d7735b076bb47b578523aedc40f3c439bea6dfd595c089d79d98a" +dependencies = [ + "cc", +] + +[[package]] +name = "objc2-foundation" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272" +dependencies = [ + "bitflags 2.13.2", + "block2", + "libc", + "objc2", + "objc2-core-foundation", +] + +[[package]] +name = "objc2-io-surface" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180788110936d59bab6bd83b6060ffdfffb3b922ba1396b312ae795e1de9d81d" +dependencies = [ + "bitflags 2.13.2", + "objc2", + "objc2-core-foundation", +] + +[[package]] +name = "objc2-osa-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f112d1746737b0da274ef79a23aac283376f335f4095a083a267a082f21db0c0" +dependencies = [ + "bitflags 2.13.2", + "objc2", + "objc2-app-kit", + "objc2-foundation", +] + +[[package]] +name = "objc2-quartz-core" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96c1358452b371bf9f104e21ec536d37a650eb10f7ee379fff67d2e08d537f1f" +dependencies = [ + "bitflags 2.13.2", + "objc2", + "objc2-core-foundation", + "objc2-foundation", +] + +[[package]] +name = "objc2-security" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "709fe137109bd1e8b5a99390f77a7d8b2961dafc1a1c5db8f2e60329ad6d895a" +dependencies = [ + "bitflags 2.13.2", + "objc2", + "objc2-core-foundation", +] + +[[package]] +name = "objc2-service-management" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b213642d6959cc6023ceb1217aa595eaaf09b8094ce95127c103cab611fe65e8" +dependencies = [ + "block2", + "objc2", + "objc2-core-foundation", + "objc2-foundation", + "objc2-security", +] + +[[package]] +name = "objc2-ui-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d87d638e33c06f577498cbcc50491496a3ed4246998a7fbba7ccb98b1e7eab22" +dependencies = [ + "bitflags 2.13.2", + "block2", + "objc2", + "objc2-cloud-kit", + "objc2-core-data", + "objc2-core-foundation", + "objc2-core-graphics", + "objc2-core-image", + "objc2-core-location", + "objc2-core-text", + "objc2-foundation", + "objc2-quartz-core", + "objc2-user-notifications", +] + +[[package]] +name = "objc2-user-notifications" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9df9128cbbfef73cda168416ccf7f837b62737d748333bfe9ab71c245d76613e" +dependencies = [ + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-web-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2e5aaab980c433cf470df9d7af96a7b46a9d892d521a2cbbb2f8a4c16751e7f" +dependencies = [ + "bitflags 2.13.2", + "block2", + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-foundation", +] + [[package]] name = "once_cell" version = "1.21.4" @@ -1114,12 +3147,29 @@ version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" +[[package]] +name = "open" +version = "5.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d8c8b8e725ad26404d6896eb2f064294a0a7b4f1d9120210d85544684c4ca95" +dependencies = [ + "dunce", + "is-wsl", + "libc", +] + [[package]] name = "openssl-probe" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" +[[package]] +name = "openssl-probe" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e036b411754132fd6b74e94b74e9a13c5cf606fa93d1885c35860d3060820b1" + [[package]] name = "openssl-src" version = "300.6.1+3.6.3" @@ -1148,6 +3198,86 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" +[[package]] +name = "ordered-multimap" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49203cdcae0030493bad186b28da2fa25645fa276a51b6fec8010d281e02ef79" +dependencies = [ + "dlv-list", + "hashbrown 0.14.5", +] + +[[package]] +name = "ordered-stream" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50" +dependencies = [ + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "os_info" +version = "3.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf20a545b305cf1da722b236b5155c9bb35f1d5ceb28c048bd96ca842f41b5b" +dependencies = [ + "android_system_properties", + "log", + "nix", + "objc2", + "objc2-foundation", + "objc2-ui-kit", + "windows-sys 0.61.2", +] + +[[package]] +name = "osakit" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "732c71caeaa72c065bb69d7ea08717bd3f4863a4f451402fc9513e29dbd5261b" +dependencies = [ + "objc2", + "objc2-foundation", + "objc2-osa-kit", + "serde", + "serde_json", + "thiserror 2.0.21", +] + +[[package]] +name = "pango" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ca27ec1eb0457ab26f3036ea52229edbdb74dee1edd29063f5b9b010e7ebee4" +dependencies = [ + "gio", + "glib", + "libc", + "once_cell", + "pango-sys", +] + +[[package]] +name = "pango-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436737e391a843e5933d6d9aa102cb126d501e815b83601365a948a518555dc5" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[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.5" @@ -1171,24 +3301,153 @@ dependencies = [ "windows-link", ] +[[package]] +name = "pbkdf2" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" +dependencies = [ + "digest 0.10.7", + "hmac", +] + [[package]] name = "percent-encoding" version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" +[[package]] +name = "phf" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf" +dependencies = [ + "phf_macros", + "phf_shared", + "serde", +] + +[[package]] +name = "phf_codegen" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49aa7f9d80421bca176ca8dbfebe668cc7a2684708594ec9f3c0db0805d5d6e1" +dependencies = [ + "phf_generator", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737" +dependencies = [ + "fastrand", + "phf_shared", +] + +[[package]] +name = "phf_macros" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "812f032b54b1e759ccd5f8b6677695d5268c588701effba24601f6932f8269ef" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "phf_shared" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266" +dependencies = [ + "siphasher", +] + [[package]] name = "pin-project-lite" version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" +[[package]] +name = "piper" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c835479a4443ded371d6c535cbfd8d31ad92c5d23ae9770a61bc155e4992a3c1" +dependencies = [ + "atomic-waker", + "fastrand", + "futures-io", +] + [[package]] name = "pkg-config" version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548" +[[package]] +name = "plist" +version = "1.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327a4cb2ad49dc48adfdc9da89e22c64d488b508c67a044d71ba729e4521a285" +dependencies = [ + "base64 0.23.1", + "indexmap 2.14.2", + "quick-xml", + "serde", + "time", +] + +[[package]] +name = "png" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60769b8b31b2a9f263dae2776c37b1b28ae246943cf719eb6946a1db05128a61" +dependencies = [ + "bitflags 2.13.2", + "crc32fast", + "fdeflate", + "flate2", + "miniz_oxide 0.8.9", +] + +[[package]] +name = "polling" +version = "3.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d0e4f59085d47d8241c88ead0f274e8a0cb551f3625263c05eb8dd897c34218" +dependencies = [ + "cfg-if", + "concurrent-queue", + "hermit-abi", + "pin-project-lite", + "rustix", + "windows-sys 0.61.2", +] + +[[package]] +name = "portable-atomic" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85" + +[[package]] +name = "portable-atomic-util" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10ab3eb7f3becc3a1cbc4f2c6f20267996cfc1a6467a873763411b136a122715" +dependencies = [ + "portable-atomic", +] + [[package]] name = "potential_utf" version = "0.1.6" @@ -1204,6 +3463,65 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a6394b9e965e73d0a289ee54f589087e2c676aedf60885baf52c76b771e4958" +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" + +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit 0.19.15", +] + +[[package]] +name = "proc-macro-crate" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24" +dependencies = [ + "toml_datetime 0.6.3", + "toml_edit 0.20.2", +] + +[[package]] +name = "proc-macro-crate" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" +dependencies = [ + "toml_edit 0.25.17+spec-1.1.0", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + [[package]] name = "proc-macro2" version = "1.0.107" @@ -1213,6 +3531,21 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "pxfm" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d55d956fa96f5ec02be2e13af0e20391a5aa83d6a074e3ad368959d0fab299ea" + +[[package]] +name = "quick-xml" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41b1177fdf999d2321d3fb46ff47159d9c1fb9ad66a4879f8c50a0b504615e9b" +dependencies = [ + "memchr", +] + [[package]] name = "quote" version = "1.0.47" @@ -1222,19 +3555,31 @@ 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 = "r-efi" version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" +[[package]] +name = "raw-window-handle" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" + [[package]] name = "redox_syscall" version = "0.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" dependencies = [ - "bitflags", + "bitflags 2.13.2", ] [[package]] @@ -1244,7 +3589,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60dc65c0ff1a7ae1294b0c67b9f14baf70b644404010370171787bfac1038fc0" dependencies = [ "libredox", - "thiserror", + "thiserror 2.0.21", +] + +[[package]] +name = "ref-cast" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e440fb4e4b4147295338efb76001ab9e4efc0e5839df2c47fc5ac2381d365c3" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92ecd8964f8453721699a1ed72037b0db49ce2f5a5138486ee89bed6f67cdf3a" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", ] [[package]] @@ -1276,6 +3641,71 @@ version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" +[[package]] +name = "reqwest" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16a1cfa75cc186dd73d5818e510e042e40927bccc9c236b061cea97e1eb08029" +dependencies = [ + "base64 0.23.1", + "bytes", + "futures-core", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-util", + "js-sys", + "log", + "percent-encoding", + "pin-project-lite", + "rustls", + "rustls-pki-types", + "rustls-platform-verifier", + "serde", + "serde_json", + "sync_wrapper", + "tokio", + "tokio-rustls", + "tokio-util", + "tower", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", +] + +[[package]] +name = "rfd" +version = "0.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20dafead71c16a34e1ff357ddefc8afc11e7d51d6d2b9fbd07eaa48e3e540220" +dependencies = [ + "block2", + "dispatch2", + "glib-sys", + "gobject-sys", + "gtk-sys", + "js-sys", + "libc", + "log", + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-foundation", + "percent-encoding", + "raw-window-handle", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "windows-sys 0.61.2", +] + [[package]] name = "ring" version = "0.17.14" @@ -1290,13 +3720,34 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "rpassword" +version = "7.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2da316a15f47e3d053de9cb2c439650bd8fa4aaeb9365f2e5f27f492ff73c196" +dependencies = [ + "libc", + "rtoolbox", + "windows-sys 0.61.2", +] + [[package]] name = "rsqlite-vfs" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "353b74f9810d5b085b6c42c9d86a5f0fdb795553235cdd48753b32e3809d18a7" dependencies = [ - "thiserror", + "thiserror 2.0.21", +] + +[[package]] +name = "rtoolbox" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a1efe12a1469752d0e6ff5ebec0b6ef4924cc5c4c71046b0ec730040535819d" +dependencies = [ + "libc", + "windows-sys 0.61.2", ] [[package]] @@ -1305,7 +3756,7 @@ version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c026b4444579e8d754556c6c75d040d69c4a44283cdb648ab8a8d5965c2cfa8" dependencies = [ - "bitflags", + "bitflags 2.13.2", "fallible-iterator", "fallible-streaming-iterator", "hashlink", @@ -1346,17 +3797,42 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d84e8ba78bd384263e5922f084cbe1b081c3b7e69add59c8fb097b879ba968a" dependencies = [ "mime_guess", - "sha2", + "sha2 0.11.1", "walkdir", ] +[[package]] +name = "rust-ini" +version = "0.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "796e8d2b6696392a43bea58116b667fb4c29727dc5abd27d6acf338bb4f688c7" +dependencies = [ + "cfg-if", + "ordered-multimap", +] + +[[package]] +name = "rustc-hash" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + [[package]] name = "rustix" version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5e76742e5294153d4dde1207dbec5bdd81eef6fabdc0d2118babadabfd858aa" dependencies = [ - "bitflags", + "bitflags 2.13.2", "errno", "libc", "linux-raw-sys", @@ -1378,6 +3854,18 @@ dependencies = [ "zeroize", ] +[[package]] +name = "rustls-native-certs" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a073f5dc7469f984c52ad2752b63b0807745133b6de880b7b64c1ac4c48aec4" +dependencies = [ + "openssl-probe 0.2.2", + "rustls-pki-types", + "schannel", + "security-framework", +] + [[package]] name = "rustls-pki-types" version = "1.15.1" @@ -1387,6 +3875,33 @@ dependencies = [ "zeroize", ] +[[package]] +name = "rustls-platform-verifier" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1167586491e2b18b8bfbb293e8180ec17c201c4f076d7cb3070ca964e7598f98" +dependencies = [ + "core-foundation 0.10.1", + "core-foundation-sys", + "jni 0.22.4", + "log", + "once_cell", + "rustls", + "rustls-native-certs", + "rustls-platform-verifier-android", + "rustls-webpki", + "security-framework", + "security-framework-sys", + "webpki-root-certs", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustls-platform-verifier-android" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eec689c0bc40ff2458a5977b6619cb718087084a18e02a131c599b62d05e1a5f" + [[package]] name = "rustls-webpki" version = "0.103.16" @@ -1410,6 +3925,15 @@ version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" +[[package]] +name = "salsa20" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213" +dependencies = [ + "cipher", +] + [[package]] name = "same-file" version = "1.0.6" @@ -1419,12 +3943,135 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "schannel" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cb23c424d8ee841bb4d813677ca237e2a610067d594fec130f87d6093495ab5" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "schemars" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615" +dependencies = [ + "dyn-clone", + "indexmap 1.9.3", + "schemars_derive", + "serde", + "serde_json", + "url", + "uuid", +] + +[[package]] +name = "schemars" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd191f9397d57d581cddd31014772520aa448f65ef991055d7f61582c65165f" +dependencies = [ + "dyn-clone", + "ref-cast", + "serde", + "serde_json", +] + +[[package]] +name = "schemars" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab508826f74a77ca9d5aba6ff19b522583ee3eaf28a19384ff3d0e5835fadf6e" +dependencies = [ + "dyn-clone", + "ref-cast", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32e265784ad618884abaea0600a9adf15393368d840e0222d101a072f3f7534d" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.119", +] + [[package]] name = "scopeguard" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "scrypt" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0516a385866c09368f0b5bcd1caff3366aace790fcd46e2bb032697bb172fd1f" +dependencies = [ + "pbkdf2", + "salsa20", + "sha2 0.10.9", +] + +[[package]] +name = "security-framework" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" +dependencies = [ + "bitflags 2.13.2", + "core-foundation 0.10.1", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "selectors" +version = "0.38.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8adfa1c298912827b8a28b223b3b874357397ae706e6190acd9bf28cee99114d" +dependencies = [ + "bitflags 2.13.2", + "cssparser", + "derive_more", + "log", + "new_debug_unreachable", + "phf", + "phf_codegen", + "precomputed-hash", + "rustc-hash", + "servo_arc", + "smallvec", +] + +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" +dependencies = [ + "serde", + "serde_core", +] + [[package]] name = "serde" version = "1.0.229" @@ -1435,6 +4082,18 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "serde-untagged" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9faf48a4a2d2693be24c6289dbe26552776eb7737074e6722891fadbe6c5058" +dependencies = [ + "erased-serde", + "serde", + "serde_core", + "typeid", +] + [[package]] name = "serde_core" version = "1.0.229" @@ -1455,6 +4114,17 @@ dependencies = [ "syn 3.0.9", ] +[[package]] +name = "serde_derive_internals" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + [[package]] name = "serde_json" version = "1.0.154" @@ -1479,6 +4149,26 @@ dependencies = [ "serde_core", ] +[[package]] +name = "serde_repr" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d3b1629de253c70a0508c3899572da79ca359fdab27c7920ff00406df418906" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[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_spanned" version = "1.1.2" @@ -1500,6 +4190,81 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_with" +version = "3.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df9adc193c780ef8f159aee8b61e2d5801aaa555e6eb0947fe45530ec506296f" +dependencies = [ + "base64 0.23.1", + "bs58", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.14.2", + "jiff", + "schemars 0.9.0", + "schemars 1.2.3", + "serde_core", + "serde_json", + "serde_with_macros", + "time", +] + +[[package]] +name = "serde_with_macros" +version = "3.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e17bbc68e28663bbbb90df47e058aa7eda4fb445b89fe70457bb94fbccf6e49" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "serialize-to-javascript" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04f3666a07a197cdb77cdf306c32be9b7f598d7060d50cfd4d5aa04bfd92f6c5" +dependencies = [ + "serde", + "serde_json", + "serialize-to-javascript-impl", +] + +[[package]] +name = "serialize-to-javascript-impl" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "772ee033c0916d670af7860b6e1ef7d658a4629a6d0b4c8c3e67f09b3765b75d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "servo_arc" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "170fb83ab34de17dc69aa7c67482b22218ddb85da56546f9bd6b929e32a05930" +dependencies = [ + "stable_deref_trait", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures 0.2.17", + "digest 0.10.7", +] + [[package]] name = "sha2" version = "0.11.1" @@ -1507,8 +4272,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "47d7069beb7d6ac7b9acd1039986e73443f24234f41074da099d6f994ac9ad19" dependencies = [ "cfg-if", - "cpufeatures", - "digest", + "cpufeatures 0.3.1", + "digest 0.11.3", ] [[package]] @@ -1533,6 +4298,28 @@ version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a219298ac11a56ea9a6d2120044824d6f01aeb034955e7af7bc16858527deea" +[[package]] +name = "simd_cesu8" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11031e251abf8611c80f460e19dbdeb54a66db918e49c65a7065b46ac7aec520" +dependencies = [ + "rustc_version", + "simdutf8", +] + +[[package]] +name = "simdutf8" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" + +[[package]] +name = "siphasher" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33f4fe9184a62d842c9ef383018f3306d8ba224fd9d836f56d7288308847c256" + [[package]] name = "slab" version = "0.4.12" @@ -1545,6 +4332,18 @@ version = "1.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b3dc8af474f516a851ff4bd12db780f948b9250ad37211e4eec0bccea54e01b" +[[package]] +name = "smappservice-rs" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52703b97a53101cf5d4580e0737aaa634ce1fdcfc123c16b2a9658e358013488" +dependencies = [ + "objc2", + "objc2-foundation", + "objc2-service-management", + "thiserror 2.0.21", +] + [[package]] name = "socket2" version = "0.6.5" @@ -1555,6 +4354,54 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "softbuffer" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aac18da81ebbf05109ab275b157c22a653bb3c12cf884450179942f81bcbf6c3" +dependencies = [ + "bytemuck", + "js-sys", + "ndk", + "objc2", + "objc2-core-foundation", + "objc2-core-graphics", + "objc2-foundation", + "objc2-quartz-core", + "raw-window-handle", + "redox_syscall", + "tracing", + "wasm-bindgen", + "web-sys", + "windows-sys 0.61.2", +] + +[[package]] +name = "soup3" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "471f924a40f31251afc77450e781cb26d55c0b650842efafc9c6cbd2f7cc4f9f" +dependencies = [ + "futures-channel", + "gio", + "glib", + "libc", + "soup3-sys", +] + +[[package]] +name = "soup3-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ebe8950a680a12f24f15ebe1bf70db7af98ad242d9db43596ad3108aab86c27" +dependencies = [ + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + [[package]] name = "sqlite-wasm-rs" version = "0.6.2" @@ -1571,6 +4418,36 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" +[[package]] +name = "static_vcruntime" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff7589a1859b09232522bb9edf076ca7fcf14ded96685d3fa629db73023ffbb7" + +[[package]] +name = "string_cache" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a18596f8c785a729f2819c0f6a7eae6ebeebdfffbfe4214ae6b087f690e31901" +dependencies = [ + "new_debug_unreachable", + "parking_lot", + "phf_shared", + "precomputed-hash", +] + +[[package]] +name = "string_cache_codegen" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "585635e46db231059f76c5849798146164652513eb9e8ab2685939dd90f29b69" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", +] + [[package]] name = "strsim" version = "0.11.1" @@ -1583,6 +4460,27 @@ version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" +[[package]] +name = "swift-rs" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cefd87076fd385308ee4aff597256c902f1fbb4d031de1558efc12f8ffefadd9" +dependencies = [ + "base64 0.21.7", + "serde", + "serde_json", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "unicode-ident", +] + [[package]] name = "syn" version = "2.0.119" @@ -1610,6 +4508,9 @@ name = "sync_wrapper" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] [[package]] name = "synstructure" @@ -1622,6 +4523,472 @@ dependencies = [ "syn 3.0.9", ] +[[package]] +name = "system-configuration" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a13f3d0daba03132c0aa9767f98351b3488edc2c100cda2d2ec2b04f3d8d3c8b" +dependencies = [ + "bitflags 2.13.2", + "core-foundation 0.9.4", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "system-deps" +version = "6.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" +dependencies = [ + "cfg-expr", + "heck 0.5.0", + "pkg-config", + "toml 0.8.2", + "version-compare", +] + +[[package]] +name = "tao" +version = "0.37.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5777b06fe6435126ae8d816eba269e050e1e10d302cf5461e9c49eccabc3548" +dependencies = [ + "bitflags 2.13.2", + "block2", + "core-foundation 0.10.1", + "core-graphics", + "crossbeam-channel", + "dbus", + "dispatch2", + "dlopen2", + "dpi", + "gdkwayland-sys", + "gdkx11-sys", + "gtk", + "jni 0.21.1", + "libc", + "log", + "ndk", + "ndk-context", + "ndk-sys", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "objc2-ui-kit", + "parking_lot", + "percent-encoding", + "raw-window-handle", + "tao-macros", + "unicode-segmentation", + "url", + "windows", + "windows-core", + "windows-version", + "x11-dl", +] + +[[package]] +name = "tao-macros" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f7eeb6d99155545da6150a1795945f16ac9c178deb2a5f2e74d776107bd5849" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "tar" +version = "0.4.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f6221d9a6003c78398e3b239969f352578258df48c8eb051caadae0015bc840" +dependencies = [ + "filetime", + "libc", + "xattr", +] + +[[package]] +name = "target-lexicon" +version = "0.12.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" + +[[package]] +name = "tauri" +version = "2.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fb0244332cfb9cee7e2a568bf5da29a36ed8fdbd717f6f47a66b6b7b358c072" +dependencies = [ + "anyhow", + "bytes", + "cookie", + "dirs 7.0.0", + "dunce", + "embed_plist", + "getrandom 0.3.4", + "glob", + "gtk", + "heck 0.5.0", + "http", + "image", + "jni 0.21.1", + "libc", + "log", + "mime", + "muda", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "objc2-ui-kit", + "objc2-web-kit", + "percent-encoding", + "plist", + "raw-window-handle", + "reqwest", + "serde", + "serde_json", + "serde_repr", + "serialize-to-javascript", + "swift-rs", + "tauri-build", + "tauri-macros", + "tauri-runtime", + "tauri-runtime-wry", + "tauri-utils", + "thiserror 2.0.21", + "tokio", + "tray-icon", + "url", + "webkit2gtk", + "webview2-com", + "window-vibrancy", + "windows", +] + +[[package]] +name = "tauri-build" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adddb0e648752aaac5da9c3c3c6a68e1e87cab55e3b757b18a9441ef8c3ac614" +dependencies = [ + "anyhow", + "cargo_toml", + "dirs 7.0.0", + "glob", + "heck 0.5.0", + "json-patch", + "schemars 0.8.22", + "semver", + "serde", + "serde_json", + "static_vcruntime", + "strsim", + "tauri-utils", + "tauri-winres", + "walkdir", +] + +[[package]] +name = "tauri-codegen" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb37631cf71dab5e8ab55e1bdd701e18a52653d90b78e71d0e5598b1e0a61316" +dependencies = [ + "base64 0.23.1", + "brotli", + "ico", + "json-patch", + "plist", + "png", + "proc-macro2", + "quote", + "semver", + "serde", + "serde_json", + "sha2 0.10.9", + "syn 2.0.119", + "tauri-utils", + "thiserror 2.0.21", + "time", + "url", + "uuid", + "walkdir", +] + +[[package]] +name = "tauri-macros" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cc38db58854c10fb5f91a887ed8bf82d3239bb92b5d8db86eda09e96d9963d1" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.119", + "tauri-codegen", + "tauri-utils", +] + +[[package]] +name = "tauri-plugin" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67fb21a77e8f94e8beb3325e583102488659365af0a3948b7ea244c5b779c291" +dependencies = [ + "anyhow", + "glob", + "plist", + "schemars 0.8.22", + "serde", + "serde_json", + "tauri-utils", + "walkdir", +] + +[[package]] +name = "tauri-plugin-autostart" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bce56ceb0a99b8ab5eebc977ba9ffc62391b862648cb9ab76fc8bc7231b8f7e2" +dependencies = [ + "auto-launch", + "serde", + "serde_json", + "tauri", + "tauri-plugin", + "thiserror 2.0.21", +] + +[[package]] +name = "tauri-plugin-deep-link" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab551d9bec27bb79d1c7fe5ed38c5cfd1cebb86efa745acc65f5853f345f6e56" +dependencies = [ + "dunce", + "plist", + "rust-ini", + "serde", + "serde_json", + "tauri", + "tauri-plugin", + "tauri-utils", + "thiserror 2.0.21", + "tracing", + "url", + "windows-registry", + "windows-result", +] + +[[package]] +name = "tauri-plugin-dialog" +version = "2.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce0fb9c2b6d34a9720627ed930ebc8af26f61e648695aecaeb03d5c33c5896f5" +dependencies = [ + "log", + "raw-window-handle", + "rfd", + "serde", + "serde_json", + "tauri", + "tauri-plugin", + "tauri-plugin-fs", + "thiserror 2.0.21", + "url", +] + +[[package]] +name = "tauri-plugin-fs" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d58eb1d4984e535f47a642ffec09a2da6f5c18a12b5902d12126cb7626d628b" +dependencies = [ + "anyhow", + "dunce", + "glob", + "log", + "objc2-foundation", + "percent-encoding", + "schemars 0.8.22", + "serde", + "serde_json", + "serde_repr", + "tauri", + "tauri-plugin", + "tauri-utils", + "thiserror 2.0.21", + "toml 1.1.8+spec-1.1.0", + "url", +] + +[[package]] +name = "tauri-plugin-opener" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53810be1b4fed22bb6ac3f4cab5a2b80d9391d1af436bda145607532bc0bb219" +dependencies = [ + "dunce", + "glob", + "objc2-app-kit", + "objc2-foundation", + "open", + "schemars 0.8.22", + "serde", + "serde_json", + "tauri", + "tauri-plugin", + "thiserror 2.0.21", + "url", + "windows", + "zbus", +] + +[[package]] +name = "tauri-plugin-updater" +version = "2.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d957abbcb3f9f6c76d22a3a0f012f30880640d0bccb5634d2b12a9937e4c872b" +dependencies = [ + "base64 0.23.1", + "dirs 7.0.0", + "flate2", + "futures-util", + "http", + "infer", + "libc", + "log", + "minisign-verify", + "osakit", + "percent-encoding", + "reqwest", + "rustls", + "semver", + "serde", + "serde_json", + "tar", + "tauri", + "tauri-plugin", + "tempfile", + "thiserror 2.0.21", + "time", + "tokio", + "url", + "windows-sys 0.61.2", + "zip", +] + +[[package]] +name = "tauri-runtime" +version = "2.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c55766d99cea69055904d1735b93c2049302b2e09effd462120deb5581d78e9" +dependencies = [ + "cookie", + "dpi", + "gtk", + "http", + "jni 0.21.1", + "objc2", + "objc2-ui-kit", + "objc2-web-kit", + "raw-window-handle", + "serde", + "serde_json", + "tauri-utils", + "thiserror 2.0.21", + "url", + "webkit2gtk", + "webview2-com", + "windows", +] + +[[package]] +name = "tauri-runtime-wry" +version = "2.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1aa9d8b7a120f879f44fdc1053f7b7dbf416bf0bbc6a72b714dec46b782b52f" +dependencies = [ + "gtk", + "http", + "jni 0.21.1", + "log", + "objc2", + "objc2-app-kit", + "percent-encoding", + "raw-window-handle", + "softbuffer", + "tao", + "tauri-runtime", + "tauri-utils", + "url", + "webkit2gtk", + "webview2-com", + "windows", + "wry", +] + +[[package]] +name = "tauri-utils" +version = "2.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "362ab21cd4cc713f2a02b1a9b5688198b1541cfb6907c4281e9190e0f0ef4aa3" +dependencies = [ + "anyhow", + "brotli", + "cargo_metadata", + "ctor", + "dom_query", + "dunce", + "glob", + "http", + "infer", + "json-patch", + "log", + "memchr", + "phf", + "plist", + "proc-macro2", + "quote", + "regex", + "schemars 0.8.22", + "semver", + "serde", + "serde-untagged", + "serde_json", + "serde_with", + "swift-rs", + "thiserror 2.0.21", + "toml 1.1.8+spec-1.1.0", + "url", + "urlpattern", + "uuid", + "walkdir", +] + +[[package]] +name = "tauri-winres" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c52bb6904475a6ca662f15ef787f18ade61d5740a1ee12c45d3b748efdb6f796" +dependencies = [ + "dunce", + "embed-resource", + "toml 1.1.8+spec-1.1.0", +] + [[package]] name = "tempfile" version = "3.27.0" @@ -1635,13 +5002,42 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "tendril" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fed54709c5b3a53d09bb1c113ea4f5ceafd1e772ddcb0030a82e1d56c087b08" +dependencies = [ + "new_debug_unreachable", +] + +[[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.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09e52cb86a36cede5cb101bf8908837b3e4c6e5e59fe7fd85c23fb56200d189e" dependencies = [ - "thiserror-impl", + "thiserror-impl 2.0.21", +] + +[[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.119", ] [[package]] @@ -1685,6 +5081,15 @@ dependencies = [ "time-core", ] +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + [[package]] name = "tinystr" version = "0.8.5" @@ -1695,6 +5100,12 @@ dependencies = [ "zerovec", ] +[[package]] +name = "tinyvec" +version = "1.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd3ca314f692efd6c868f8408f53fe444634a845f96c028b97d35f6a1f79f0ee" + [[package]] name = "tokio" version = "1.54.1" @@ -1723,19 +5134,63 @@ dependencies = [ "syn 3.0.9", ] +[[package]] +name = "tokio-rustls" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9cc2678c2cdd569ef8215e2afd7954ada2ae20b4fdd2c5fe6139a3b02d105db" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e464cf451ba96ebfc6f9b6542f17ee8b8956e33f1e40d9690624e59d7a7f8a4b" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" +dependencies = [ + "serde", + "serde_spanned 0.6.9", + "toml_datetime 0.6.3", + "toml_edit 0.20.2", +] + [[package]] name = "toml" version = "1.1.8+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20489e00e4d8741d6be680764cc12e270655e375a20d1011e844a9c3379e678d" dependencies = [ - "indexmap", + "indexmap 2.14.2", "serde_core", - "serde_spanned", - "toml_datetime", + "serde_spanned 1.1.2", + "toml_datetime 1.1.2+spec-1.1.0", "toml_parser", "toml_writer", - "winnow", + "winnow 1.0.4", +] + +[[package]] +name = "toml_datetime" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +dependencies = [ + "serde", ] [[package]] @@ -1747,13 +5202,49 @@ dependencies = [ "serde_core", ] +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.14.2", + "toml_datetime 0.6.3", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" +dependencies = [ + "indexmap 2.14.2", + "serde", + "serde_spanned 0.6.9", + "toml_datetime 0.6.3", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.25.17+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3641d5bbb5349a79e1020a242d251efbc546ad8048d133958323ce9c40a9c9c" +dependencies = [ + "indexmap 2.14.2", + "toml_datetime 1.1.2+spec-1.1.0", + "toml_parser", + "winnow 1.0.4", +] + [[package]] name = "toml_parser" version = "1.1.5+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baa693a8032d7e1cada7d0041e96126df243179ff061456783ac7f12bda4744c" dependencies = [ - "winnow", + "winnow 1.0.4", ] [[package]] @@ -1778,6 +5269,24 @@ dependencies = [ "tracing", ] +[[package]] +name = "tower-http" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cfcf7e2740e6fc6d4d688b4ef00650406bb94adf4731e43c096c3a19fe40840" +dependencies = [ + "bitflags 2.13.2", + "bytes", + "futures-util", + "http", + "http-body", + "pin-project-lite", + "tower", + "tower-layer", + "tower-service", + "url", +] + [[package]] name = "tower-layer" version = "0.3.3" @@ -1798,9 +5307,21 @@ checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" dependencies = [ "log", "pin-project-lite", + "tracing-attributes", "tracing-core", ] +[[package]] +name = "tracing-attributes" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + [[package]] name = "tracing-core" version = "0.1.36" @@ -1810,12 +5331,81 @@ dependencies = [ "once_cell", ] +[[package]] +name = "trash" +version = "5.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be89b3fe156965d29ac4f8522f3a640c655affdd9f21cb4f36857f0c92c00317" +dependencies = [ + "chrono", + "libc", + "log", + "objc2", + "objc2-foundation", + "once_cell", + "percent-encoding", + "scopeguard", + "urlencoding", + "windows", +] + +[[package]] +name = "tray-icon" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2b9c52859a94554803ccd4a24b98f74148ebc73b90676d783f3490b1bff9d72" +dependencies = [ + "crossbeam-channel", + "dirs 7.0.0", + "libappindicator", + "muda", + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-core-graphics", + "objc2-foundation", + "once_cell", + "png", + "serde", + "thiserror 2.0.21", + "windows-sys 0.61.2", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "typed-path" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce898823d8cd0f028662d2f349694b1af0a5cc9be83f1d213a00d3147445e1e" + +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + [[package]] name = "typenum" version = "1.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" +[[package]] +name = "uds_windows" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f6fb2847f6742cd76af783a2a2c49e9375d0a111c7bef6f71cd9e738c72d6e" +dependencies = [ + "memoffset", + "tempfile", + "windows-sys 0.61.2", +] + [[package]] name = "unicase" version = "2.10.0" @@ -1828,6 +5418,12 @@ version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563" +[[package]] +name = "unicode-segmentation" +version = "1.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8" + [[package]] name = "untrusted" version = "0.9.0" @@ -1840,7 +5436,7 @@ version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cde93ff05758a36a851a398a772b0b79a82fbe3c186a46f2696baaeaf84c966b" dependencies = [ - "base64", + "base64 0.23.1", "cookie_store", "flate2", "log", @@ -1860,7 +5456,7 @@ version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "841583fc36089d7d59419568ae157f43a5a03a2e5a81ba87c77d1596ef46e922" dependencies = [ - "base64", + "base64 0.23.1", "http", "httparse", "log", @@ -1876,6 +5472,25 @@ dependencies = [ "idna", "percent-encoding", "serde", + "serde_derive", +] + +[[package]] +name = "urlencoding" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" + +[[package]] +name = "urlpattern" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df16f50ef4cc145211879a3867ba757076b25dfee812040dcb0658bd9ae7904b" +dependencies = [ + "icu_properties", + "regex", + "serde", + "url", ] [[package]] @@ -1896,18 +5511,56 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" +[[package]] +name = "uuid" +version = "1.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a0e2d11620c50695fe12bbbfde96b3477fe606e7284c22d505c12ce51214514" +dependencies = [ + "getrandom 0.4.3", + "js-sys", + "serde_core", + "wasm-bindgen", +] + [[package]] name = "vcpkg" version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" +[[package]] +name = "version-compare" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c2856837ef78f57382f06b2b8563a2f512f7185d732608fd9176cb3b8edf0e" + [[package]] name = "version_check" version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" +[[package]] +name = "vswhom" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be979b7f07507105799e854203b470ff7c78a1639e330a58f183b5fea574608b" +dependencies = [ + "libc", + "vswhom-sys", +] + +[[package]] +name = "vswhom-sys" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb067e4cbd1ff067d1df46c9194b5de0e98efd2810bbc95c5d5e5f25a3231150" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "walkdir" version = "2.5.0" @@ -1918,12 +5571,30 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "want" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec4cdd0dd910afe868b7ef477227d8d538b46b3075031afee8a9f2acb0a2ed0b" +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 = "wasip2" +version = "1.0.4+wasi-0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67efb37e106e55ce722a510d6b5f9c17f083e5fc79afc2badeb12cc313d9487" +dependencies = [ + "wit-bindgen", +] + [[package]] name = "wasm-bindgen" version = "0.2.129" @@ -1937,6 +5608,17 @@ dependencies = [ "wasm-bindgen-shared", ] +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cbab34de2d982e9b48e18d216d04c4a6f641066ff19ffb699980f591ee3610e" +dependencies = [ + "js-sys", + "tokio", + "wasm-bindgen", +] + [[package]] name = "wasm-bindgen-macro" version = "0.2.129" @@ -1969,6 +5651,104 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "wasm-streams" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1ec4f6517c9e11ae630e200b2b65d193279042e28edd4a2cda233e46670bbb" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "web-sys" +version = "0.3.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88261b9deccee56594c11a3460c462c41f58d148598fe70ad77070126a68aba4" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web_atoms" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba8b815c1b593dc0baf78dd0f4fc8fdb2de53198fb1163738093e9a311c33fb3" +dependencies = [ + "phf", + "phf_codegen", + "string_cache", + "string_cache_codegen", +] + +[[package]] +name = "webkit2gtk" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1027150013530fb2eaf806408df88461ae4815a45c541c8975e61d6f2fc4793" +dependencies = [ + "bitflags 1.3.2", + "cairo-rs", + "gdk", + "gdk-sys", + "gio", + "gio-sys", + "glib", + "glib-sys", + "gobject-sys", + "gtk", + "gtk-sys", + "javascriptcore-rs", + "libc", + "once_cell", + "soup3", + "webkit2gtk-sys", +] + +[[package]] +name = "webkit2gtk-sys" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "916a5f65c2ef0dfe12fff695960a2ec3d4565359fdbb2e9943c974e06c734ea5" +dependencies = [ + "bitflags 1.3.2", + "cairo-sys-rs", + "gdk-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "gtk-sys", + "javascriptcore-rs-sys", + "libc", + "pkg-config", + "soup3-sys", + "system-deps", +] + +[[package]] +name = "webpki-root-certs" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e49d0e65abc00c142e8f9428da991da9f1a250c39be97459901eb12b9b49f62a" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "webpki-roots" version = "1.0.11" @@ -1978,6 +5758,56 @@ dependencies = [ "rustls-pki-types", ] +[[package]] +name = "webview2-com" +version = "0.39.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f89fca7a704cee10dcb3654c1dbb8941d1783132f1917358af75bec37a7d7e6" +dependencies = [ + "webview2-com-macros", + "webview2-com-sys", + "windows", + "windows-core", +] + +[[package]] +name = "webview2-com-macros" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a921c1b6914c367b2b823cd4cde6f96beec77d30a939c8199bb377cf9b9b54" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "webview2-com-sys" +version = "0.39.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3a07132775117d6065853d9d1178157b8c90e228de47129d6bce2c7edebedfb" +dependencies = [ + "thiserror 2.0.21", + "windows", + "windows-core", +] + +[[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-util" version = "0.1.11" @@ -1987,6 +5817,49 @@ dependencies = [ "windows-sys 0.61.2", ] +[[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 = "window-vibrancy" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "111e51caca442cafd9bab396628ac4d814880eaea4e63dfd76a12e9f342b5580" +dependencies = [ + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-foundation", + "objc2-quartz-core", + "raw-window-handle", + "windows-sys 0.61.2", + "windows-version", +] + +[[package]] +name = "windows" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "527fadee13e0c05939a6a05d5bd6eec6cd2e3dbd648b9f8e447c6518133d8580" +dependencies = [ + "windows-collections", + "windows-core", + "windows-future", + "windows-numerics", +] + +[[package]] +name = "windows-collections" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b2d95af1a8a14a3c7367e1ed4fc9c20e0a26e79551b1454d72583c97cc6610" +dependencies = [ + "windows-core", +] + [[package]] name = "windows-core" version = "0.62.2" @@ -2000,6 +5873,17 @@ dependencies = [ "windows-strings", ] +[[package]] +name = "windows-future" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb" +dependencies = [ + "windows-core", + "windows-link", + "windows-threading", +] + [[package]] name = "windows-implement" version = "0.60.2" @@ -2028,6 +5912,27 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" +[[package]] +name = "windows-numerics" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e2e40844ac143cdb44aead537bbf727de9b044e107a0f1220392177d15b0f26" +dependencies = [ + "windows-core", + "windows-link", +] + +[[package]] +name = "windows-registry" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720" +dependencies = [ + "windows-link", + "windows-result", + "windows-strings", +] + [[package]] name = "windows-result" version = "0.4.1" @@ -2046,13 +5951,22 @@ dependencies = [ "windows-link", ] +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + [[package]] name = "windows-sys" 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]] @@ -2064,34 +5978,85 @@ dependencies = [ "windows-link", ] +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + [[package]] name = "windows-targets" version = "0.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_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "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-threading" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3949bd5b99cafdf1c7ca86b43ca564028dfe27d66958f2470940f73d86d75b37" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-version" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4060a1da109b9d0326b7262c8e12c84df67cc0dbc9e33cf49e01ccc2eb63631" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + [[package]] name = "windows_aarch64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + [[package]] name = "windows_i686_gnu" version = "0.52.6" @@ -2104,35 +6069,87 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + [[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + [[package]] name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "winnow" +version = "0.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] + [[package]] name = "winnow" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23b97319f7b8343df12cc98938e5c3eb436064524c8d2b4e30a1d3a36eecdf81" +dependencies = [ + "memchr", +] + +[[package]] +name = "winreg" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d6f32a0ff4a9f6f01231eb2059cc85479330739333e0e58cadf03b6af2cca10" +dependencies = [ + "cfg-if", + "windows-sys 0.61.2", +] + +[[package]] +name = "wit-bindgen" +version = "0.57.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" [[package]] name = "writeable" @@ -2140,6 +6157,80 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc" +[[package]] +name = "wry" +version = "0.57.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "759c50ddad0ef9913bb5496cb9d509a50433a3b78cb0238d61105526589cf0e9" +dependencies = [ + "base64 0.23.1", + "block2", + "cookie", + "crossbeam-channel", + "dirs 7.0.0", + "dom_query", + "dpi", + "dunce", + "gdkx11", + "gtk", + "http", + "javascriptcore-rs", + "jni 0.21.1", + "libc", + "ndk", + "objc2", + "objc2-app-kit", + "objc2-core-foundation", + "objc2-foundation", + "objc2-ui-kit", + "objc2-web-kit", + "percent-encoding", + "raw-window-handle", + "sha2 0.10.9", + "soup3", + "tao-macros", + "thiserror 2.0.21", + "url", + "webkit2gtk", + "webkit2gtk-sys", + "webview2-com", + "windows", + "windows-core", + "windows-version", + "x11-dl", +] + +[[package]] +name = "x11" +version = "2.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "502da5464ccd04011667b11c435cb992822c2c0dbde1770c988480d312a0db2e" +dependencies = [ + "libc", + "pkg-config", +] + +[[package]] +name = "x11-dl" +version = "2.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38735924fedd5314a6e548792904ed8c6de6636285cb9fec04d5b1db85c1516f" +dependencies = [ + "libc", + "once_cell", + "pkg-config", +] + +[[package]] +name = "xattr" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "963d6fab92d5504b971dc8bd90ca743c2575e590bc8071ea5bc571598667ae08" +dependencies = [ + "libc", + "rustix", +] + [[package]] name = "yoke" version = "0.8.4" @@ -2163,6 +6254,76 @@ dependencies = [ "synstructure", ] +[[package]] +name = "zbus" +version = "5.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5db4be7c075cb421e4b7ee645541604239bd243ba7c357511f4ff3a74b555907" +dependencies = [ + "async-broadcast", + "async-executor", + "async-io", + "async-lock", + "async-process", + "async-recursion", + "async-task", + "async-trait", + "blocking", + "enumflags2", + "event-listener", + "futures-core", + "futures-lite", + "hex", + "libc", + "ordered-stream", + "rustix", + "serde", + "serde_repr", + "tracing", + "uds_windows", + "uuid", + "windows-sys 0.61.2", + "winnow 1.0.4", + "zbus_macros", + "zbus_names", + "zvariant", +] + +[[package]] +name = "zbus_macros" +version = "5.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2990635d09ade6df1868f72f8cac69a876a90981e8bd3c40b1be413f8dc88f40" +dependencies = [ + "proc-macro-crate 3.5.0", + "proc-macro2", + "quote", + "syn 3.0.9", + "zbus_names", + "zvariant", + "zvariant_utils", +] + +[[package]] +name = "zbus_names" +version = "4.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "812a12be4ead7a59e18ea8f047d08add0066b73bc62fc1467066a2472ae088dd" +dependencies = [ + "serde", + "winnow 1.0.4", + "zvariant", +] + +[[package]] +name = "zcheapstr" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1afec51604565183aeb5c54c20aeab286120d4e4460f7f76e3e8bb8c0d99473" +dependencies = [ + "serde", +] + [[package]] name = "zerofrom" version = "0.1.8" @@ -2223,6 +6384,21 @@ dependencies = [ "syn 3.0.9", ] +[[package]] +name = "zip" +version = "9.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1156b39d142a34b999c2310a50455e0cb3760bf7efad0122f796d813bee26ccb" +dependencies = [ + "crc32fast", + "getrandom 0.4.3", + "indexmap 2.14.2", + "memchr", + "nix", + "typed-path", + "windows-sys 0.61.2", +] + [[package]] name = "zlib-rs" version = "0.6.8" @@ -2234,3 +6410,44 @@ name = "zmij" version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" + +[[package]] +name = "zvariant" +version = "5.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80bf6d6cd6a4b601acb64cfb8284cdc643fcfa75ef26ae3c46ec8aa4e8a1fbb7" +dependencies = [ + "endi", + "enumflags2", + "serde", + "winnow 1.0.4", + "zcheapstr", + "zvariant_derive", + "zvariant_utils", +] + +[[package]] +name = "zvariant_derive" +version = "5.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef2672456ba1cb54b5eaec136e63135b3c7495fb938e53b28a62e633496d486d" +dependencies = [ + "proc-macro-crate 3.5.0", + "proc-macro2", + "quote", + "syn 3.0.9", + "zvariant_utils", +] + +[[package]] +name = "zvariant_utils" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bad0294361a320b694a328460dc73add56c306150f5cb6bfafc44446120008a3" +dependencies = [ + "proc-macro2", + "quote", + "serde", + "syn 3.0.9", + "winnow 1.0.4", +] diff --git a/Cargo.toml b/Cargo.toml index bc31795..5d01fe8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,3 +1,7 @@ [workspace] resolver = "3" -members = ["core", "cli", "hub"] +members = ["core", "cli", "hub", "desktop"] + +# One version for every part: the hub offers clients by it (D3). +[workspace.package] +version = "0.1.0" diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 1958a98..2f00339 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lunesync" -version = "0.1.0" +version.workspace = true edition = "2024" [dependencies] diff --git a/cli/src/main.rs b/cli/src/main.rs index 73ce24a..6cff332 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -7,20 +7,20 @@ use clap::{Parser, Subcommand, ValueEnum}; use lune_core::config::{Config, VaultConfig}; use lune_core::guard; use lune_core::secrets; -use lune_core::runner::{self, Timing}; use lune_core::state::{self, SyncState}; use lune_core::tidy::{self, Keep}; use lune_core::vault::{self, Added, Vault}; use lune_core::remote; -use std::collections::HashSet; use std::path::{Path, PathBuf}; -use std::time::{Duration, Instant}; #[derive(Parser)] #[command(name = "lunesync", version, about = "Keeps every copy of your vaults in sync.")] struct Cli { #[command(subcommand)] command: Command, + /// Which team's hub, when this device is on more than one (part of its address, e.g. its host name) + #[arg(long, global = true)] + team: Option, } #[derive(Subcommand)] @@ -280,6 +280,7 @@ fn run_cli(cli: Cli) -> Result<()> { let mut config = Config::load()?; config.use_hub_credentials(); let cwd = std::env::current_dir()?; + team::choose(cli.team); match cli.command { Command::Device { action: None } => println!("This device is \"{}\".", config.device_label()), Command::Device { action: Some(DeviceCmd::Name { label }) } => { @@ -287,7 +288,7 @@ fn run_cli(cli: Cli) -> Result<()> { if label.is_empty() { bail!("the label can't be empty"); } - if let Some(h) = &config.hub { + for h in &config.hubs { h.set_label(&label)?; } config.device_name = Some(label.clone()); @@ -346,7 +347,7 @@ fn run_cli(cli: Cli) -> Result<()> { println!("No vaults yet. Add one with `lunesync add --remote `."); } println!("Device: {}", config.device_label()); - if let Some(h) = &config.hub { + for h in &config.hubs { match h.me() { Ok(me) => println!("Hub: {} as {}{}", h.url, me.person, if me.owner { " (team owner)" } else { "" }), Err(e) => println!("Hub: {} — can't reach it right now ({e})", h.url), @@ -506,7 +507,7 @@ fn held(config: &Config, cwd: &Path, vault: Option<&str>, cmd: HeldCmd) -> Resul let _op = state::op_lock(&v.git_dir)?; for h in held_hits(&v, &rel, line)? { secrets::allow(&v.git_dir, &h, &rel)?; - if let (Some(hub), Some(id)) = (&config.hub, cfg.hub_vault) { + if let (Some(hub), Some(id)) = (config.hub_of(cfg), cfg.hub_vault) { hub.not_a_secret(id, &h.line_hash)?; } println!("OK — line {} of {rel} won't be held again on this device.", h.line); @@ -569,59 +570,11 @@ fn log_line(vault: &str, msg: &str) { /// Syncs every vault, picks up vaults added meanwhile, and checks the hub for new memberships. fn run() -> Result<()> { - let mut started: HashSet = HashSet::new(); - let mut hub_check = Instant::now(); - let mut hub_said = String::new(); - loop { - let mut config = Config::load()?; - config.use_hub_credentials(); - if config.vaults.is_empty() && config.hub.is_none() { - bail!("no vaults yet — add one with `lunesync add --remote ` or join a hub"); - } - if config.hub.is_some() && Instant::now() >= hub_check { - hub_check = Instant::now() + Duration::from_secs(30); - match team::arrive(&mut config) { - Ok(msgs) => { - hub_said.clear(); - msgs.iter().for_each(|m| log_line("hub", m)); - if let Err(e) = lune_core::membership::report(&config) { - log_line("hub", &format!("couldn't report health: {e:#}")); - } - } - Err(e) => { - let msg = format!("can't check the hub: {e:#}"); - if msg != hub_said { - log_line("hub", &msg); - hub_said = msg; - } - } - } - } - // A vault that left (access ended) can come back later at the same place. - started.retain(|p| config.vaults.iter().any(|v| &v.path == p)); - for cfg in &config.vaults { - if !started.insert(cfg.path.clone()) { - continue; - } - let (cfg, label, poll) = (cfg.clone(), config.device_label(), config.poll_interval()); - std::thread::spawn(move || { - loop { - match runner::run(&cfg, &label, poll, Timing::default(), &log_line) { - Ok(()) => return, - Err(e) if format!("{e}").contains("already being synced") => { - log_line(&cfg.name, &format!("{e:#}")); - return; - } - Err(e) => { - log_line(&cfg.name, &format!("stopped: {e:#} — retrying in 30 s")); - std::thread::sleep(Duration::from_secs(30)); - } - } - } - }); - } - std::thread::sleep(Duration::from_secs(2)); + let config = Config::load()?; + if config.vaults.is_empty() && config.hubs.is_empty() { + bail!("no vaults yet — add one with `lunesync add --remote ` or join a hub"); } + lune_core::supervisor::supervise(log_line) } /// After a one-off command, try to share right away; the runner picks it up otherwise. @@ -645,48 +598,32 @@ fn share_now(v: &Vault) { fn print_status(cfg: &VaultConfig, label: &str) { println!("\n{} — {}", cfg.name, cfg.path.display()); - let v = match Vault::open(cfg, label) { - Ok(v) => v, - Err(e) => { - println!(" Can't open: {e:#}"); - return; - } - }; - let st = SyncState::load(&v.git_dir); - let read_only = v.role().is_some_and(|r| !lune_core::hub::can_edit(&r)); - let waiting = v.waiting_files().unwrap_or(0); - let changes = format!("{waiting} change{}", if waiting == 1 { "" } else { "s" }); - let headline = match &st.last_error { - None if read_only && waiting > 0 => format!("Up to date · {changes} kept here, not shared (you have read access)"), - None if read_only => "Up to date (read access)".to_string(), - Some(e) if e.starts_with("offline") => format!("Offline · waiting to sync · {changes}"), - Some(e) => format!("Can't sync: {e}{}", if waiting > 0 { format!(" · {changes} waiting") } else { String::new() }), - None if waiting > 0 => format!("Waiting to sync · {changes}"), - None if st.last_synced.is_some() => format!("Synced {}", ago(st.last_synced.unwrap())), - None => "Not synced yet".to_string(), - }; - println!(" {headline}"); + let st = lune_core::status::of(cfg, label); + match st.last_synced { + Some(t) if st.headline == "Synced" => println!(" Synced {}", ago(t)), + _ => println!(" {}", st.headline), + } if let Some(t) = st.last_synced { println!(" Last sync: {} ({})", Local.timestamp_opt(t, 0).unwrap().format("%Y-%m-%d %H:%M:%S"), ago(t)); } - for h in guard::load(&v.git_dir) { + for h in &st.held { println!(" Holding back a big change: \"{}\" — nothing from here is shared until you decide (`lunesync held`)", h.message); } - let secret_notes = v.secret_holds().map(|l| l.len()).unwrap_or(0); + let secret_notes = st.secrets.len(); if secret_notes > 0 { println!( " {secret_notes} note{} not shared: looks like a secret (`lunesync held`)", if secret_notes == 1 { "" } else { "s" } ); } - let to_tidy = tidy::list(&v).map(|l| l.len()).unwrap_or(0); + let to_tidy = st.tidy.len(); if to_tidy > 0 { println!(" {to_tidy} note{} to tidy — see `lunesync tidy`", if to_tidy == 1 { "" } else { "s" }); } if !st.case_clashes.is_empty() { println!(" Names differing only by case: {}", st.case_clashes.join(", ")); } - if !state::is_running(&v.git_dir) { + if !st.running && !st.headline.starts_with("Can't open") { println!(" Not running — start `lunesync run` or `lunesync service install`"); } } diff --git a/cli/src/team.rs b/cli/src/team.rs index a9d72b7..9ffe5a5 100644 --- a/cli/src/team.rs +++ b/cli/src/team.rs @@ -9,12 +9,20 @@ use lune_core::state; use lune_core::vault::Vault; use std::path::PathBuf; +static TEAM: std::sync::OnceLock> = std::sync::OnceLock::new(); + +/// The `--team` choice for this command. +pub fn choose(team: Option) { + let _ = TEAM.set(team); +} + +/// The hub this command talks to: the one `--team` names, or the only one. pub fn link(config: &Config) -> Result<&HubLink> { - config.hub.as_ref().context("this device isn't on a hub yet — `lunesync join ` or `lunesync login`") + config.pick_hub(TEAM.get().cloned().flatten().as_deref()) } fn connect(config: &mut Config, url: String, w: hub::Welcome, label: &str, vaults_dir: Option) -> Result<()> { - config.hub = Some(HubLink { url, device_id: w.device_id, key: w.key }); + config.hubs.push(HubLink { url, device_id: w.device_id, key: w.key }); config.device_name = Some(label.to_string()); if vaults_dir.is_some() { config.vaults_dir = vaults_dir; @@ -30,16 +38,17 @@ fn connect(config: &mut Config, url: String, w: hub::Welcome, label: &str, vault } pub fn join(config: &mut Config, invite: &str, label: &str, vaults_dir: Option) -> Result<()> { - if let Some(h) = &config.hub { - bail!("this device is already on the hub at {}", h.url); + let url = invite.split("/join/").next().unwrap_or_default().trim_end_matches('/'); + if config.hub(url).is_some() { + bail!("this device is already on the hub at {url}"); } let (url, w) = hub::join(invite, label)?; connect(config, url, w, label, vaults_dir) } pub fn login(config: &mut Config, url: &str, code: &str, label: &str, vaults_dir: Option) -> Result<()> { - if let Some(h) = &config.hub { - bail!("this device is already on the hub at {}", h.url); + if config.hub(url.trim_end_matches('/')).is_some() { + bail!("this device is already on the hub at {url}"); } let w = hub::login(url, code, label)?; connect(config, url.trim_end_matches('/').to_string(), w, label, vaults_dir) @@ -94,6 +103,7 @@ pub fn vault_upload(config: &mut Config, name: &str, fresh: bool) -> Result<()> let vc = config.vaults.iter_mut().find(|x| x.path == cfg.path).unwrap(); vc.remote = hv.git_url.clone(); vc.hub_vault = Some(hv.id); + vc.hub_url = Some(h.url.clone()); config.save()?; println!("{} now syncs through the hub{}.", cfg.name, if fresh { ", starting fresh" } else { ", history included" }); println!("Other devices with this vault: `lunesync pair` here, then `lunesync login …` there — it moves over on its own."); diff --git a/core/Cargo.toml b/core/Cargo.toml index 9df36ce..cd8c733 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lune-core" -version = "0.1.0" +version.workspace = true edition = "2024" [dependencies] @@ -10,6 +10,7 @@ chrono = "0.4.45" dirs = "7.0.0" gethostname = "1.1.0" git2 = { version = "0.21.0", features = ["ssh", "https", "vendored-libgit2", "vendored-openssl"] } +libgit2-sys = "0.18.8" notify = "8.2.1" regex = "1.13.1" serde = { version = "1.0.229", features = ["derive"] } diff --git a/core/src/config.rs b/core/src/config.rs index e873a45..e62e662 100644 --- a/core/src/config.rs +++ b/core/src/config.rs @@ -15,9 +15,13 @@ pub struct Config { /// Where vaults from the hub are placed (default ~/Vaults). #[serde(default)] pub vaults_dir: Option, - /// This device's hub sign-in, once it has joined or logged in. + /// This device's hub sign-ins: one per team it belongs to (a person's own hub, a workplace hub). #[serde(default)] - pub hub: Option, + pub hubs: Vec, + /// Before M7 a device had one hub, stored as `[hub]`; read once and moved into `hubs`. + #[serde(default, rename = "hub", skip_serializing)] + #[doc(hidden)] + pub legacy_hub: Option, #[serde(default, rename = "vault")] pub vaults: Vec, } @@ -28,9 +32,12 @@ pub struct VaultConfig { pub path: PathBuf, pub remote: String, pub branch: String, - /// The hub's id for this vault, when it syncs through the hub. + /// The hub's id for this vault, when it syncs through a hub. #[serde(default)] pub hub_vault: Option, + /// Which hub that is (ids are per hub). + #[serde(default)] + pub hub_url: Option, } /// Directory holding `config.toml`. `LUNE_HOME` overrides it (handy for running two devices on one machine). @@ -50,7 +57,18 @@ impl Config { pub fn load() -> Result { let path = Self::path()?; match std::fs::read_to_string(&path) { - Ok(text) => toml::from_str(&text).with_context(|| format!("can't read {}", path.display())), + Ok(text) => { + let mut c: Config = toml::from_str(&text).with_context(|| format!("can't read {}", path.display()))?; + if let Some(h) = c.legacy_hub.take() { + for v in c.vaults.iter_mut().filter(|v| v.hub_vault.is_some() && v.hub_url.is_none()) { + v.hub_url = Some(h.url.clone()); + } + if !c.hubs.iter().any(|x| x.url == h.url) { + c.hubs.insert(0, h); + } + } + Ok(c) + } Err(e) if e.kind() == std::io::ErrorKind::NotFound => Ok(Config::default()), Err(e) => Err(e).with_context(|| format!("can't read {}", path.display())), } @@ -77,10 +95,34 @@ impl Config { .unwrap_or_else(|| dirs::home_dir().unwrap_or_default().join("Vaults")) } - /// Makes the hub's device key available to Git requests in this process. + /// Makes each hub's device key available to Git requests in this process. pub fn use_hub_credentials(&self) { - if let Some(h) = &self.hub { - crate::remote::set_hub(h.clone()); + crate::remote::set_hubs(&self.hubs); + } + + pub fn hub(&self, url: &str) -> Option<&crate::hub::HubLink> { + self.hubs.iter().find(|h| h.url == url) + } + + /// The hub a vault syncs through, if any. + pub fn hub_of(&self, v: &VaultConfig) -> Option<&crate::hub::HubLink> { + v.hub_vault?; + self.hub(v.hub_url.as_deref()?) + } + + /// Picks a hub: the one whose address contains `sel` (e.g. its host name), else the only one. + pub fn pick_hub(&self, sel: Option<&str>) -> Result<&crate::hub::HubLink> { + match (sel, self.hubs.as_slice()) { + (_, []) => bail!("this device isn't on a hub yet — `lunesync join ` or `lunesync login`"), + (Some(s), all) => all + .iter() + .find(|h| h.url.contains(s)) + .with_context(|| format!("this device isn't on a hub matching \"{s}\"")), + (None, [only]) => Ok(only), + (None, all) => { + let names: Vec<&str> = all.iter().map(|h| h.url.as_str()).collect(); + bail!("this device is on several hubs ({}) — say which with --team ", names.join(", ")) + } } } diff --git a/core/src/hub.rs b/core/src/hub.rs index 5b5aae0..75dca54 100644 --- a/core/src/hub.rs +++ b/core/src/hub.rs @@ -97,6 +97,7 @@ fn agent() -> ureq::Agent { ureq::Agent::config_builder() .http_status_as_error(false) .timeout_global(Some(Duration::from_secs(30))) + .user_agent(crate::remote::user_agent()) .build() .into() } diff --git a/core/src/lib.rs b/core/src/lib.rs index 70c0e75..e501a0b 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -11,5 +11,7 @@ pub mod remote; pub mod runner; pub mod secrets; pub mod state; +pub mod status; +pub mod supervisor; pub mod tidy; pub mod vault; diff --git a/core/src/membership.rs b/core/src/membership.rs index 3ad5b3a..0dacf15 100644 --- a/core/src/membership.rs +++ b/core/src/membership.rs @@ -7,36 +7,69 @@ use crate::secrets; use crate::state; use crate::vault::{self, Vault}; use anyhow::{Result, bail}; -use std::path::Path; +use serde::Serialize; +use std::collections::{HashMap, HashSet}; +use std::path::{Path, PathBuf}; use std::time::{Duration, Instant}; /// What a leaving note gets instead of a secret: the secret itself is never sent or kept (P1). const REDACTED: &str = "[secret removed when leaving]"; -/// New vaults arrive, same-named local vaults move onto the hub, roles refresh, and vaults whose access -/// ended are handed over and leave. Returns what happened, in plain words. +/// For every hub this device is on: new vaults arrive, same-named local vaults move onto the hub, roles +/// refresh, and vaults whose access ended are handed over and leave. Returns what happened, in plain words. +/// One hub failing doesn't stop the others; the first error comes back after the rest have run. pub fn arrive(config: &mut Config) -> Result> { - let Some(h) = config.hub.clone() else { return Ok(vec![]) }; + let mut said = vec![]; + let mut failed = None; + for (_, result) in arrive_each(config) { + match result { + Ok(mut msgs) => said.append(&mut msgs), + Err(e) => failed = failed.or(Some(e)), + } + } + match failed { + Some(e) if said.is_empty() => Err(e), + Some(e) => { + said.push(format!("can't check the hub: {e:#}")); + Ok(said) + } + None => Ok(said), + } +} + +/// `arrive`, hub by hub: (hub address, what happened there). +pub fn arrive_each(config: &mut Config) -> Vec<(String, Result>)> { + let several = config.hubs.len() > 1; + let mut out = vec![]; + for h in config.hubs.clone() { + let result = arrive_from(config, &h).map_err(|e| if several { e.context(h.url.clone()) } else { e }); + out.push((h.url, result)); + } + out +} + +fn arrive_from(config: &mut Config, h: &HubLink) -> Result> { let me = match h.me() { Ok(me) => me, Err(e) if format!("{e}").contains("isn't signed in") => { // The hub no longer knows this device: it was removed and has nothing left to hand over. - config.hub = None; - config.vaults.retain(|v| v.hub_vault.is_none()); + config.hubs.retain(|x| x.url != h.url); + config.vaults.retain(|v| v.hub_url.as_deref() != Some(&h.url)); config.save()?; - return Ok(vec!["This device was removed from the hub. Vaults on other remotes keep syncing.".into()]); + return Ok(vec![format!("This device was removed from the hub at {}. Other vaults keep syncing.", h.url)]); } Err(e) => return Err(e), }; let label = config.device_label(); + let mine = |v: &crate::config::VaultConfig, id: i64| v.hub_vault == Some(id) && v.hub_url.as_deref() == Some(&h.url); let mut said = vec![]; for d in &me.leaving { - said.push(leave(config, &h, d)?); + said.push(leave(config, h, d)?); } if me.nudge { - // Each vault's runner sees this and shares at once. - for vc in config.vaults.iter().filter(|v| v.hub_vault.is_some()) { + // Each of this hub's vault runners sees this and shares at once. + for vc in config.vaults.iter().filter(|v| v.hub_vault.is_some() && v.hub_url.as_deref() == Some(&h.url)) { let dir = state::lune_dir(&vc.path.join(".git")); if dir.exists() { std::fs::write(dir.join("nudge"), "")?; @@ -46,7 +79,7 @@ pub fn arrive(config: &mut Config) -> Result> { } for hv in me.vaults { - if let Some(vc) = config.vaults.iter().find(|v| v.hub_vault == Some(hv.id)) { + if let Some(vc) = config.vaults.iter().find(|v| mine(v, hv.id)) { let v = Vault::open(vc, &label)?; state::write_role(&v.git_dir, &hv.role)?; continue; @@ -59,17 +92,25 @@ pub fn arrive(config: &mut Config) -> Result> { v.join_unrelated()?; vc.remote = hv.git_url.clone(); vc.hub_vault = Some(hv.id); + vc.hub_url = Some(h.url.clone()); config.save()?; said.push(format!("{} now syncs through the hub", hv.name)); continue; } - let path = config.vaults_dir().join(&hv.name); + // Two teams can each have a "Notes": the second one gets the team's address in its folder name. + let mut path = config.vaults_dir().join(&hv.name); + let real = |p: &Path| std::fs::canonicalize(p).unwrap_or_else(|_| p.to_path_buf()); + if config.vaults.iter().any(|v| real(&v.path) == real(&path)) { + let host = h.url.split("://").last().unwrap_or(&h.url).replace([':', '/'], "-"); + path = config.vaults_dir().join(format!("{} ({host})", hv.name)); + } if path.exists() && std::fs::read_dir(&path)?.next().is_some() && !path.join(".git").exists() { said.push(format!("{} can't arrive: {} already has other files in it", hv.name, path.display())); continue; } let (mut cfg, _, err) = vault::add(&hv.name, &path, &hv.git_url, &label)?; cfg.hub_vault = Some(hv.id); + cfg.hub_url = Some(h.url.clone()); state::write_role(&path.join(".git"), &hv.role)?; config.vaults.push(cfg); config.save()?; @@ -82,29 +123,36 @@ pub fn arrive(config: &mut Config) -> Result> { Ok(said) } -/// Tells the hub how each of this device's hub vaults is doing (M6 freshness). +/// Tells each hub how this device's vaults on it are doing (M6 freshness). pub fn report(config: &Config) -> Result<()> { - let Some(h) = &config.hub else { return Ok(()) }; let label = config.device_label(); - let mut out = vec![]; - for vc in config.vaults.iter().filter(|v| v.hub_vault.is_some()) { - let Ok(v) = Vault::open(vc, &label) else { continue }; - out.push(hub::VaultHealth { - vault_id: vc.hub_vault.unwrap(), - last_synced: state::SyncState::load(&v.git_dir).last_synced, - waiting: v.waiting_files().unwrap_or(0), - held_secrets: v.secret_holds().map(|n| n.len()).unwrap_or(0), - holding: !crate::guard::load(&v.git_dir).is_empty(), - }); + let mut failed = None; + for h in &config.hubs { + let mut out = vec![]; + for vc in config.vaults.iter().filter(|v| v.hub_vault.is_some() && v.hub_url.as_deref() == Some(&h.url)) { + let Ok(v) = Vault::open(vc, &label) else { continue }; + out.push(hub::VaultHealth { + vault_id: vc.hub_vault.unwrap(), + last_synced: state::SyncState::load(&v.git_dir).last_synced, + waiting: v.waiting_files().unwrap_or(0), + held_secrets: v.secret_holds().map(|n| n.len()).unwrap_or(0), + holding: !crate::guard::load(&v.git_dir).is_empty(), + }); + } + if let Err(e) = h.report(&out) { + failed = Some(e); + } } - h.report(&out) + failed.map_or(Ok(()), Err) } /// Leaves one vault: stop syncing, save, make read-only, hand over what wasn't shared, and once the /// hub has it, delete the folder if the app created it. pub fn leave(config: &mut Config, link: &HubLink, d: &Departure) -> Result { let label = config.device_label(); - let Some(vc) = config.vaults.iter().find(|v| v.hub_vault == Some(d.vault_id)).cloned() else { + let Some(vc) = + config.vaults.iter().find(|v| v.hub_vault == Some(d.vault_id) && v.hub_url.as_deref() == Some(&link.url)).cloned() + else { link.departure_done(d.id, None)?; return Ok(format!("Access to {} ended (it wasn't on this device)", d.vault)); }; @@ -162,6 +210,117 @@ pub fn leave(config: &mut Config, link: &HubLink, d: &Departure) -> Result, + /// Folders left in place, each with why ("path — reason"). + pub kept: Vec, + /// Set when the hub couldn't be told this device is gone. + pub hub_problem: Option, +} + +/// Uninstall (D5). Every runner must already be stopped (`runner::STOP`). Shares what it can, hands the rest +/// over through the hub (A6) and signs this device out, then deletes the vault folders Lune created. A folder +/// still holding work that is neither shared nor handed over stays, and so does one the person added (A9). +pub fn uninstall(config: &mut Config) -> Result { + let label = config.device_label(); + let all = config.vaults.clone(); + let mut out = Uninstalled::default(); + let mut unshared: HashMap = HashMap::new(); + + for vc in &all { + let Ok(v) = Vault::open(vc, &label) else { continue }; + wait_for_runner(&v)?; + let _op = state::op_lock(&v.git_dir)?; + let _ = v.save_changes(None, &HashSet::new()); + if v.role().is_none_or(|r| hub::can_edit(&r)) { + let _ = v.sync(); + } + if let Some(why) = unshared_work(&v) { + unshared.insert(vc.path.clone(), why); + } + } + + for link in config.hubs.clone() { + let signed_out = link.remove_device(&label, None).and_then(|_| link.me()); + match signed_out { + Ok(me) => { + for d in &me.leaving { + match leave(config, &link, d) { + // Whatever wasn't shared is with the vault's managers now. + Ok(_) => { + let left = all.iter().find(|v| v.hub_vault == Some(d.vault_id) && v.hub_url.as_deref() == Some(&link.url)); + if let Some(vc) = left { + unshared.remove(&vc.path); + } + } + Err(e) => out.hub_problem = Some(format!("couldn't hand over {}: {e:#}", d.vault)), + } + } + } + Err(e) => { + out.hub_problem = Some(format!( + "couldn't reach the hub at {} ({e:#}) — this device still shows on its canvas; remove it there", + link.url + )) + } + } + } + + for vc in &all { + let shown = vc.path.display().to_string(); + if !vc.path.exists() { + out.removed.push(shown); + continue; + } + let _ = set_read_only(&vc.path, false); + let created = + state::read_marker(&vc.path.join(".git")).is_some_and(|m| m.created_folder && m.managed_by == "lune"); + if let Some(why) = unshared.get(&vc.path) { + out.kept.push(format!("{shown} — {why}")); + } else if !created { + out.kept.push(format!("{shown} — you added this folder yourself")); + } else { + // remove_dir_all removes links themselves, never what they point to (A9). + std::fs::remove_dir_all(&vc.path)?; + out.removed.push(shown); + } + } + config.vaults.clear(); + config.hubs.clear(); + config.save()?; + Ok(out) +} + +/// Waits until the vault's runner has let go of it. +fn wait_for_runner(v: &Vault) -> Result<()> { + let deadline = Instant::now() + Duration::from_secs(60); + while state::try_run_lock(&v.git_dir)?.is_none() { + if Instant::now() > deadline { + bail!("{} is still busy syncing; try again in a moment", v.name); + } + std::thread::sleep(Duration::from_millis(250)); + } + Ok(()) +} + +/// Why a vault still holds work nobody else has, if it does. +fn unshared_work(v: &Vault) -> Option { + if !v.secret_holds().unwrap_or_default().is_empty() { + return Some("a note was held back as a possible secret".into()); + } + if !crate::guard::load(&v.git_dir).is_empty() { + return Some("a big change is waiting for you to confirm it".into()); + } + match v.waiting_files().unwrap_or(0) { + 0 => None, + n if v.role().is_some_and(|r| !hub::can_edit(&r)) => Some(format!("{n} changed notes you can't share (read access)")), + n => Some(format!("{n} changed notes couldn't be shared (offline?)")), + } +} + /// Adds or removes write permission on everything in the vault folder except `.git`. fn set_read_only(root: &Path, read_only: bool) -> Result<()> { fn walk(dir: &Path, read_only: bool, top: bool) -> Result<()> { diff --git a/core/src/remote.rs b/core/src/remote.rs index be8c814..1a2a495 100644 --- a/core/src/remote.rs +++ b/core/src/remote.rs @@ -4,17 +4,57 @@ use git2::{Cred, CredentialType, ErrorClass, ErrorCode, RemoteCallbacks}; use std::path::PathBuf; use std::sync::RwLock; -static HUB: RwLock> = RwLock::new(None); +static HUBS: RwLock> = RwLock::new(Vec::new()); +static VERSION: RwLock> = RwLock::new(None); -/// Git requests to this hub sign in with the device key. +/// What the hub says to a client too old to sync (D3). +pub const TOO_OLD: &str = "update Lune to keep syncing"; + +/// Sets the version this client tells the hub (the desktop app's own version; the crate version otherwise). +pub fn set_client_version(version: &str) { + *VERSION.write().unwrap() = Some(version.to_string()); + set_git_user_agent(); +} + +pub fn client_version() -> String { + VERSION.read().unwrap().clone().unwrap_or_else(|| env!("CARGO_PKG_VERSION").to_string()) +} + +/// `lune/`: how every request says which client it is, so the hub can turn away versions it no +/// longer supports. +pub fn user_agent() -> String { + format!("lune/{}", client_version()) +} + +/// Git requests carry the same User-Agent (libgit2 can't add headers to every request, but it can name itself). +pub fn set_git_user_agent() { + let product = std::ffi::CString::new(user_agent()).unwrap(); + // SAFETY: a documented libgit2 option; libgit2 copies the string. + unsafe { + libgit2_sys::init(); + libgit2_sys::git_libgit2_opts(libgit2_sys::GIT_OPT_SET_USER_AGENT_PRODUCT as std::ffi::c_int, product.as_ptr()); + } +} + +/// Git requests to this hub sign in with this device key (replacing any earlier key for the same hub). pub fn set_hub(link: crate::hub::HubLink) { - *HUB.write().unwrap() = Some(link); + set_git_user_agent(); + let mut hubs = HUBS.write().unwrap(); + hubs.retain(|h| h.url != link.url); + hubs.push(link); +} + +/// Git requests to each of these hubs sign in with that hub's device key. +pub fn set_hubs(links: &[crate::hub::HubLink]) { + set_git_user_agent(); + *HUBS.write().unwrap() = links.to_vec(); } fn hub_credentials(url: &str) -> Option<(String, String)> { - let hub = HUB.read().unwrap(); - let h = hub.as_ref()?; - url.starts_with(&h.url).then(|| (h.device_id.clone(), h.key.clone())) + let hubs = HUBS.read().unwrap(); + // The longest matching address wins (two hubs could share a host). + let h = hubs.iter().filter(|h| url.starts_with(&format!("{}/", h.url))).max_by_key(|h| h.url.len())?; + Some((h.device_id.clone(), h.key.clone())) } pub fn callbacks<'a>() -> RemoteCallbacks<'a> { @@ -67,6 +107,9 @@ fn default_key_files() -> Vec { /// Turns a remote failure into plain words for `status` and the run log. pub fn describe_error(e: &anyhow::Error) -> String { if let Some(g) = e.downcast_ref::() { + if g.message().contains("status code: 426") { + return TOO_OLD.into(); + } if g.message().contains("status code: 403") { return "the hub says this device has no access to this vault (if access ended, it will leave shortly)".into(); } diff --git a/core/src/runner.rs b/core/src/runner.rs index 5e272a7..ffbe1cd 100644 --- a/core/src/runner.rs +++ b/core/src/runner.rs @@ -8,6 +8,7 @@ use anyhow::{Result, bail}; use notify::{EventKind, RecursiveMode, Watcher}; use std::collections::{HashMap, HashSet}; use std::path::Path; +use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::mpsc; use std::time::{Duration, Instant}; @@ -71,6 +72,9 @@ impl Burst { pub type Log<'a> = &'a (dyn Fn(&str, &str) + Sync); +/// Set to stop every runner in this process (the desktop app uninstalling); each lets go of its vault. +pub static STOP: AtomicBool = AtomicBool::new(false); + /// Runs forever for one vault. `log(vault, message)` prints progress. pub fn run(cfg: &VaultConfig, label: &str, poll: Duration, timing: Timing, log: Log) -> Result<()> { let vault = Vault::open(cfg, label)?; @@ -101,6 +105,9 @@ pub fn run(cfg: &VaultConfig, label: &str, poll: Duration, timing: Timing, log: say("access to this vault ended — stopped syncing it"); return Ok(()); } + if STOP.load(Ordering::Relaxed) { + return Ok(()); + } if nudge.exists() { // Nudged from the canvas: save what has settled and share right away. let _ = std::fs::remove_file(&nudge); diff --git a/core/src/status.rs b/core/src/status.rs new file mode 100644 index 0000000..b804445 --- /dev/null +++ b/core/src/status.rs @@ -0,0 +1,136 @@ +//! How a vault is doing on this device, in plain words: for `lunesync status` and the desktop app. + +use crate::config::VaultConfig; +use crate::state::{self, SyncState}; +use crate::vault::Vault; +use crate::{guard, hub, remote, tidy}; +use serde::Serialize; + +#[derive(Debug, Clone, Serialize)] +pub struct VaultStatus { + pub name: String, + pub path: String, + /// The hub's address, for vaults that sync through one. + pub team: Option, + /// current, behind, offline or secret: the status colours (X6). + pub level: &'static str, + pub headline: String, + pub last_synced: Option, + pub waiting: usize, + pub read_only: bool, + pub running: bool, + pub held: Vec, + pub secrets: Vec, + pub tidy: Vec, + pub case_clashes: Vec, +} + +#[derive(Debug, Clone, Serialize)] +pub struct HeldChange { + pub message: String, + pub removed: usize, + pub rewritten: usize, + pub total: usize, +} + +#[derive(Debug, Clone, Serialize)] +pub struct HeldSecret { + pub path: String, + /// "line 3: possible AWS access key (AKIA…7Q)" + pub found: Vec, +} + +#[derive(Debug, Clone, Serialize)] +pub struct ToTidy { + pub note: String, + pub copy: String, + pub label: String, +} + +/// The order status colours are worst-first in: one red dot outranks everything. +pub fn worst<'a>(levels: impl IntoIterator) -> &'static str { + let rank = |l: &str| match l { + "secret" => 3, + "behind" => 2, + "offline" => 1, + _ => 0, + }; + match levels.into_iter().map(rank).max().unwrap_or(0) { + 3 => "secret", + 2 => "behind", + 1 => "offline", + _ => "current", + } +} + +pub fn of(cfg: &VaultConfig, label: &str) -> VaultStatus { + let mut out = VaultStatus { + name: cfg.name.clone(), + path: cfg.path.display().to_string(), + team: cfg.hub_url.clone(), + level: "behind", + headline: String::new(), + last_synced: None, + waiting: 0, + read_only: false, + running: false, + held: vec![], + secrets: vec![], + tidy: vec![], + case_clashes: vec![], + }; + let v = match Vault::open(cfg, label) { + Ok(v) => v, + Err(e) => { + out.headline = format!("Can't open: {e:#}"); + return out; + } + }; + let st = SyncState::load(&v.git_dir); + out.last_synced = st.last_synced; + out.read_only = v.role().is_some_and(|r| !hub::can_edit(&r)); + out.running = state::is_running(&v.git_dir); + out.waiting = v.waiting_files().unwrap_or(0); + out.case_clashes = st.case_clashes.clone(); + out.held = guard::load(&v.git_dir) + .into_iter() + .map(|h| HeldChange { message: h.message, removed: h.removed, rewritten: h.rewritten, total: h.total }) + .collect(); + out.secrets = v + .secret_holds() + .unwrap_or_default() + .into_iter() + .map(|n| HeldSecret { + found: n.hits.iter().map(|h| format!("line {}: possible {} ({})", h.line, h.rule, h.hint)).collect(), + path: n.path, + }) + .collect(); + out.tidy = tidy::list(&v) + .unwrap_or_default() + .into_iter() + .map(|k| ToTidy { note: k.note, copy: k.copy, label: k.label }) + .collect(); + + let waiting = out.waiting; + let changes = format!("{waiting} change{}", if waiting == 1 { "" } else { "s" }); + let (level, headline) = match &st.last_error { + None if out.read_only && waiting > 0 => ("current", format!("Up to date · {changes} kept here, not shared (you have read access)")), + None if out.read_only => ("current", "Up to date (read access)".to_string()), + Some(e) if e == remote::TOO_OLD => ("behind", format!("Update Lune to keep syncing · {changes} saved here")), + Some(e) if e.starts_with("offline") => ("offline", format!("Offline · waiting to sync · {changes}")), + Some(e) => ("behind", format!("Can't sync: {e}{}", if waiting > 0 { format!(" · {changes} waiting") } else { String::new() })), + None if waiting > 0 => ("behind", format!("Waiting to sync · {changes}")), + None if st.last_synced.is_some() => ("current", "Synced".to_string()), + None => ("behind", "Not synced yet".to_string()), + }; + out.level = if !out.secrets.is_empty() { + "secret" + } else if (!out.held.is_empty() || !out.tidy.is_empty()) && level == "current" { + // Waiting for a decision is amber too (X6). + "behind" + } else { + level + }; + out.headline = headline; + out +} diff --git a/core/src/supervisor.rs b/core/src/supervisor.rs new file mode 100644 index 0000000..124fe05 --- /dev/null +++ b/core/src/supervisor.rs @@ -0,0 +1,95 @@ +//! Keeps every vault in the config syncing: one runner thread per vault, vaults added meanwhile picked up, +//! and the hub checked every 30 s (memberships, departures, nudges, health). Used by `lunesync run` and the +//! desktop app. + +use crate::config::Config; +use crate::membership; +use crate::runner::{self, STOP, Timing}; +use anyhow::Result; +use std::collections::{HashMap, HashSet}; +use std::path::PathBuf; +use std::sync::atomic::{AtomicBool, Ordering}; +use std::time::{Duration, Instant}; + +/// Set to check the hub on the next round instead of waiting up to 30 s (just connected). +pub static CHECK_HUB: AtomicBool = AtomicBool::new(false); + +/// Runs until `runner::STOP` is set. `log(vault, message)` reports what happens; "hub" for hub messages. +pub fn supervise(log: fn(&str, &str)) -> Result<()> { + let mut started: HashSet = HashSet::new(); + let mut hub_check = Instant::now(); + // Each hub's last complaint, so an unreachable hub isn't logged every 30 s. + let mut hub_said: HashMap = HashMap::new(); + while !STOP.load(Ordering::Relaxed) { + let mut config = Config::load()?; + config.use_hub_credentials(); + if CHECK_HUB.swap(false, Ordering::Relaxed) { + hub_check = Instant::now(); + } + if !config.hubs.is_empty() && Instant::now() >= hub_check { + hub_check = Instant::now() + Duration::from_secs(30); + for (url, result) in membership::arrive_each(&mut config) { + match result { + Ok(msgs) => { + hub_said.remove(&url); + msgs.iter().for_each(|m| log("hub", m)); + } + Err(e) => { + let msg = format!("can't check the hub: {e:#}"); + if hub_said.get(&url) != Some(&msg) { + log("hub", &msg); + hub_said.insert(url, msg); + } + } + } + } + match membership::report(&config) { + Ok(()) => { + hub_said.remove("report"); + } + Err(e) => { + let msg = format!("couldn't report health: {e:#}"); + if hub_said.get("report") != Some(&msg) { + log("hub", &msg); + hub_said.insert("report".into(), msg); + } + } + } + } + // A vault that left (access ended) can come back later at the same place. + started.retain(|p| config.vaults.iter().any(|v| &v.path == p)); + for cfg in &config.vaults { + if !started.insert(cfg.path.clone()) { + continue; + } + let (cfg, label, poll) = (cfg.clone(), config.device_label(), config.poll_interval()); + std::thread::spawn(move || { + while !STOP.load(Ordering::Relaxed) { + match runner::run(&cfg, &label, poll, Timing::default(), &log) { + Ok(()) => return, + Err(e) if format!("{e}").contains("already being synced") => { + log(&cfg.name, &format!("{e:#}")); + return; + } + Err(e) => { + log(&cfg.name, &format!("stopped: {e:#} — retrying in 30 s")); + std::thread::sleep(Duration::from_secs(30)); + } + } + } + }); + } + std::thread::sleep(Duration::from_secs(2)); + } + Ok(()) +} + +/// Asks every running vault to save what has settled and share now (the menu's "Share now"). +pub fn share_now(config: &Config) { + for vc in &config.vaults { + let dir = crate::state::lune_dir(&vc.path.join(".git")); + if dir.exists() { + let _ = std::fs::write(dir.join("nudge"), ""); + } + } +} diff --git a/core/src/vault.rs b/core/src/vault.rs index fe05ce2..16113b9 100644 --- a/core/src/vault.rs +++ b/core/src/vault.rs @@ -768,7 +768,7 @@ pub fn add(name: &str, path: &Path, remote_url: &str, label: &str) -> Result<(Va state::write_marker(&git_dir, name, !existed)?; drop(repo); - let cfg = VaultConfig { name: name.into(), path: path.clone(), remote: remote_url.into(), branch, hub_vault: None }; + let cfg = VaultConfig { name: name.into(), path: path.clone(), remote: remote_url.into(), branch, hub_vault: None, hub_url: None }; let vault = Vault::open(&cfg, label)?; let _op = state::op_lock(&git_dir)?; vault.save_changes(Some(&format!("Added the vault on {label}")), &HashSet::new())?; diff --git a/core/tests/sync.rs b/core/tests/sync.rs index 7d64ba5..0c99c2d 100644 --- a/core/tests/sync.rs +++ b/core/tests/sync.rs @@ -515,3 +515,54 @@ fn moves_and_appends_are_not_runaway() { } assert!(a.save_changes(None, &HashSet::new()).unwrap().unwrap().held.is_some()); } + +#[test] +fn uninstall_deletes_only_folders_it_made_and_never_unshared_work() { + let w = World::new(); + // Uninstall rewrites the config; keep it inside this test's folder. + unsafe { std::env::set_var("LUNE_HOME", w.folder("home")) }; + let other = w.device("Hermes"); + let made = w.device_at("Codex", &w.folder("made")); + write(&made, "note.md", "shared\n"); + save_and_sync(&made); + // A folder the person already had: Lune adopted it, so it never deletes it. + let own = w.folder("own"); + fs::create_dir_all(&own).unwrap(); + fs::write(own.join("mine.md"), "mine\n").unwrap(); + let remote2 = w.folder("remote2.git"); + Repository::init_bare(&remote2).unwrap(); + let (own_cfg, _, _) = vault::add("Own", &own, remote2.to_str().unwrap(), "Codex").unwrap(); + // A folder Lune made that holds a note with a secret: it can't be shared, so it must stay. + let remote3 = w.folder("remote3.git"); + Repository::init_bare(&remote3).unwrap(); + let (held_cfg, _, _) = vault::add("Held", &w.folder("held"), remote3.to_str().unwrap(), "Codex").unwrap(); + fs::write(w.folder("held").join("aws.md"), format!("# AWS\n{FAKE_KEY}")).unwrap(); + + let mut config = lune_core::config::Config { + device_name: Some("Codex".into()), + vaults: vec![made_cfg(&w), own_cfg, held_cfg], + ..Default::default() + }; + let done = lune_core::membership::uninstall(&mut config).unwrap(); + + assert!(!w.folder("made").exists(), "{done:?}"); + assert_eq!(fs::read(own.join("mine.md")).unwrap(), b"mine\n"); + assert!(w.folder("held").join("aws.md").exists()); + assert_eq!(done.removed.len(), 1); + assert_eq!(done.kept.len(), 2, "{:?}", done.kept); + assert!(config.vaults.is_empty()); + // What was shared before uninstalling is still with everyone else. + other.sync().unwrap(); + assert_eq!(read(&other, "note.md"), b"shared\n"); +} + +fn made_cfg(w: &World) -> lune_core::config::VaultConfig { + lune_core::config::VaultConfig { + name: "Test".into(), + path: w.folder("made"), + remote: w.remote.to_str().unwrap().into(), + branch: "main".into(), + hub_vault: None, + hub_url: None, + } +} diff --git a/desktop/.gitignore b/desktop/.gitignore new file mode 100644 index 0000000..4059f2f --- /dev/null +++ b/desktop/.gitignore @@ -0,0 +1,2 @@ +node_modules/ +gen/ diff --git a/desktop/Cargo.toml b/desktop/Cargo.toml new file mode 100644 index 0000000..880d925 --- /dev/null +++ b/desktop/Cargo.toml @@ -0,0 +1,27 @@ +[package] +name = "lune-desktop" +version.workspace = true +edition = "2024" +description = "Lune: the menu-bar app" + +[[bin]] +name = "lune" +path = "src/main.rs" + +[build-dependencies] +tauri-build = { version = "2.7.4", features = [] } + +[dependencies] +anyhow = "1.0.104" +chrono = "0.4.45" +lune-core = { version = "0.1.0", path = "../core" } +serde = { version = "1.0.229", features = ["derive"] } +serde_json = "1.0.154" +tauri = { version = "2.12.5", features = ["tray-icon", "image-png"] } +tauri-plugin-autostart = "2.7.0" +tauri-plugin-deep-link = "2.6.3" +tauri-plugin-dialog = "2.8.4" +tauri-plugin-opener = "2.7.2" +tauri-plugin-updater = "2.14.1" +trash = "5.2.2" +url = "2.5.4" diff --git a/desktop/build.rs b/desktop/build.rs new file mode 100644 index 0000000..d860e1e --- /dev/null +++ b/desktop/build.rs @@ -0,0 +1,3 @@ +fn main() { + tauri_build::build() +} diff --git a/desktop/build.sh b/desktop/build.sh new file mode 100755 index 0000000..7e698ff --- /dev/null +++ b/desktop/build.sh @@ -0,0 +1,18 @@ +#!/bin/sh +# Builds Lune for the Mac: desktop/build.sh [extra tauri --config ...] +# Makes the .dmg people download and the .app.tar.gz the updater installs; then publish both on the hub that holds +# the signing key: lunehub release publish +set -eu +cd "$(dirname "$0")" +v=${1:?usage: desktop/build.sh } +shift +if grep -q '"pubkey": ""' tauri.conf.json; then + echo "note: no update key in tauri.conf.json yet — this build won't accept updates (run lunehub release keygen)" >&2 +fi +npx tauri build --bundles app,dmg --config "{\"version\":\"$v\"}" "$@" +b=../target/release/bundle +# macOS tar would add ._ resource-fork entries that the updater can't unpack. +COPYFILE_DISABLE=1 tar --no-mac-metadata -czf "$b/Lune_${v}_aarch64.app.tar.gz" -C "$b/macos" Lune.app +echo "Built:" +echo " $(cd "$b" && pwd)/dmg/Lune_${v}_aarch64.dmg" +echo " $(cd "$b" && pwd)/Lune_${v}_aarch64.app.tar.gz" diff --git a/desktop/capabilities/default.json b/desktop/capabilities/default.json new file mode 100644 index 0000000..b446267 --- /dev/null +++ b/desktop/capabilities/default.json @@ -0,0 +1,7 @@ +{ + "$schema": "../gen/schemas/desktop-schema.json", + "identifier": "default", + "description": "The Lune window: its own commands and events only.", + "windows": ["main"], + "permissions": ["core:default"] +} diff --git a/desktop/icons/128x128.png b/desktop/icons/128x128.png new file mode 100644 index 0000000..c1d46e1 Binary files /dev/null and b/desktop/icons/128x128.png differ diff --git a/desktop/icons/128x128@2x.png b/desktop/icons/128x128@2x.png new file mode 100644 index 0000000..00711b9 Binary files /dev/null and b/desktop/icons/128x128@2x.png differ diff --git a/desktop/icons/32x32.png b/desktop/icons/32x32.png new file mode 100644 index 0000000..1e8599d Binary files /dev/null and b/desktop/icons/32x32.png differ diff --git a/desktop/icons/icon.icns b/desktop/icons/icon.icns new file mode 100644 index 0000000..db1a531 Binary files /dev/null and b/desktop/icons/icon.icns differ diff --git a/desktop/icons/icon.ico b/desktop/icons/icon.ico new file mode 100644 index 0000000..59f8773 Binary files /dev/null and b/desktop/icons/icon.ico differ diff --git a/desktop/icons/icon.png b/desktop/icons/icon.png new file mode 100644 index 0000000..350f0b6 Binary files /dev/null and b/desktop/icons/icon.png differ diff --git a/desktop/icons/tray-amber.png b/desktop/icons/tray-amber.png new file mode 100644 index 0000000..b7d369f Binary files /dev/null and b/desktop/icons/tray-amber.png differ diff --git a/desktop/icons/tray-green.png b/desktop/icons/tray-green.png new file mode 100644 index 0000000..e6de5fa Binary files /dev/null and b/desktop/icons/tray-green.png differ diff --git a/desktop/icons/tray-grey.png b/desktop/icons/tray-grey.png new file mode 100644 index 0000000..6d53080 Binary files /dev/null and b/desktop/icons/tray-grey.png differ diff --git a/desktop/icons/tray-red.png b/desktop/icons/tray-red.png new file mode 100644 index 0000000..f7f933b Binary files /dev/null and b/desktop/icons/tray-red.png differ diff --git a/desktop/package-lock.json b/desktop/package-lock.json new file mode 100644 index 0000000..043b5ca --- /dev/null +++ b/desktop/package-lock.json @@ -0,0 +1,230 @@ +{ + "name": "lune-desktop", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "lune-desktop", + "devDependencies": { + "@tauri-apps/cli": "2.12.4" + } + }, + "node_modules/@tauri-apps/cli": { + "version": "2.12.4", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli/-/cli-2.12.4.tgz", + "integrity": "sha512-JI9bHfudSRJikGOrjbXEm6RjzzvmKuLc+JixB1NE8hNzQkNlCCIC3pTES3uypkR9lxHrsbxzcnSwhI2IxBQphw==", + "dev": true, + "license": "Apache-2.0 OR MIT", + "bin": { + "tauri": "tauri.js" + }, + "engines": { + "node": ">= 10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/tauri" + }, + "optionalDependencies": { + "@tauri-apps/cli-darwin-arm64": "2.12.4", + "@tauri-apps/cli-darwin-x64": "2.12.4", + "@tauri-apps/cli-linux-arm-gnueabihf": "2.12.4", + "@tauri-apps/cli-linux-arm64-gnu": "2.12.4", + "@tauri-apps/cli-linux-arm64-musl": "2.12.4", + "@tauri-apps/cli-linux-riscv64-gnu": "2.12.4", + "@tauri-apps/cli-linux-x64-gnu": "2.12.4", + "@tauri-apps/cli-linux-x64-musl": "2.12.4", + "@tauri-apps/cli-win32-arm64-msvc": "2.12.4", + "@tauri-apps/cli-win32-ia32-msvc": "2.12.4", + "@tauri-apps/cli-win32-x64-msvc": "2.12.4" + } + }, + "node_modules/@tauri-apps/cli-darwin-arm64": { + "version": "2.12.4", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-darwin-arm64/-/cli-darwin-arm64-2.12.4.tgz", + "integrity": "sha512-OxqKSckIkoJ6vX2AjifIJpTasFC0Hbdoo7gEiCmAjauABO3U8m2MRsLWe+QTiBwDx1mIrvgA+rvI7tvDnbnHVg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-darwin-x64": { + "version": "2.12.4", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-darwin-x64/-/cli-darwin-x64-2.12.4.tgz", + "integrity": "sha512-fz76/77wMMJOaaUN6n3CybRG0P/MTEjjqYk81mGPyhi9m6Ue5T+LWBnJP/AkPooNatBPI2vtulGqomyMJ44lCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-linux-arm-gnueabihf": { + "version": "2.12.4", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm-gnueabihf/-/cli-linux-arm-gnueabihf-2.12.4.tgz", + "integrity": "sha512-K0w8Bof6Lt8QKLAYhRy0yy36ZH5iA/35VuSOvnxyjvCUZ+A3JKsUTlALviH/sVgAlisaPzzmeJSH8XOn4Q2HBA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-linux-arm64-gnu": { + "version": "2.12.4", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm64-gnu/-/cli-linux-arm64-gnu-2.12.4.tgz", + "integrity": "sha512-j5rOnjmRUwWrm1oosf0zBYl4D+fqydgUROFCk0hvKZxvbTT8SOERes0QB7rBV/XWNy+kM6pCKzb3oSm2sRglzg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-linux-arm64-musl": { + "version": "2.12.4", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.12.4.tgz", + "integrity": "sha512-aOue3Fy6Jb7+oWcfAVUsVHfeTybSCt2CZoU06aO4jv4d2Ks/KnaTPwMAK3CLEduGOvBLY1lbBBrIyomqLLH5Sg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-linux-riscv64-gnu": { + "version": "2.12.4", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-riscv64-gnu/-/cli-linux-riscv64-gnu-2.12.4.tgz", + "integrity": "sha512-Fx6GShY/RvST+t6LMlTHAwd66+1tEaAAGrnU7cysVfaiRP1BKng5Vl6rVmO6rSLOA1Sp1dRzNYM4f0OWQGb7qA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-linux-x64-gnu": { + "version": "2.12.4", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-x64-gnu/-/cli-linux-x64-gnu-2.12.4.tgz", + "integrity": "sha512-tNzZSa79Z1nRpHxEpQ38lsAFpKlFlYvoXzjTV+lRRn/zSf3wrdUC3wnLcq2XEadchPu4ttK0zivhYzr+XGD19Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-linux-x64-musl": { + "version": "2.12.4", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-x64-musl/-/cli-linux-x64-musl-2.12.4.tgz", + "integrity": "sha512-jmZ1pr0xEqUhuEusWtt9Yt+GF6lCnGHUmIL+KIknpbjK/XQ2qkhDBhaxK/JMHM2A8dAacVXCxXJk2EXpwhQUfA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-win32-arm64-msvc": { + "version": "2.12.4", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-arm64-msvc/-/cli-win32-arm64-msvc-2.12.4.tgz", + "integrity": "sha512-fGo8pgEHZxdSYgZ/J98m1usJ7NHKmKbq7k6uT0x1rpOq6Bg2YVzzpaAblWk710f5LHYBJIL5QIFS5IrD+4gmTg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-win32-ia32-msvc": { + "version": "2.12.4", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-ia32-msvc/-/cli-win32-ia32-msvc-2.12.4.tgz", + "integrity": "sha512-ezl8sQIcjYsye3TUnTH5VcWmWzccZASlQm7hlZt0dYyj1XD0qpVW47u2xYVrIKui0F8uQv/7QGZixdWiClBsbg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tauri-apps/cli-win32-x64-msvc": { + "version": "2.12.4", + "resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-x64-msvc/-/cli-win32-x64-msvc-2.12.4.tgz", + "integrity": "sha512-DJhDeCqjLDNMWYFy7ZS8cfeAHX2RK0RbQMLiA3bMVVkXRDJ4NBYiHriGqsUhsr9iG41aTb+dJGkFPmPw1gWwVw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0 OR MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + } + } +} diff --git a/desktop/package.json b/desktop/package.json new file mode 100644 index 0000000..4565d75 --- /dev/null +++ b/desktop/package.json @@ -0,0 +1,10 @@ +{ + "name": "lune-desktop", + "private": true, + "scripts": { + "tauri": "tauri" + }, + "devDependencies": { + "@tauri-apps/cli": "2.12.4" + } +} diff --git a/desktop/src/commands.rs b/desktop/src/commands.rs new file mode 100644 index 0000000..7dd0ea9 --- /dev/null +++ b/desktop/src/commands.rs @@ -0,0 +1,271 @@ +//! What the Lune window can ask for: status, connecting, and the decisions only a person makes. + +use crate::{AppState, Connect}; +use lune_core::config::{Config, default_device_name}; +use lune_core::hub::{self, HubLink}; +use lune_core::state; +use lune_core::status::{self, VaultStatus}; +use lune_core::tidy::{self, Keep}; +use lune_core::vault::Vault; +use lune_core::{secrets, supervisor}; +use serde::Serialize; +use std::sync::atomic::Ordering; +use tauri::{AppHandle, State}; +use tauri_plugin_autostart::ManagerExt as _; +use tauri_plugin_dialog::DialogExt; +use tauri_plugin_opener::OpenerExt; + +type Answer = Result; + +fn plain(e: anyhow::Error) -> String { + format!("{e:#}").replace("the hub said: ", "") +} + +#[derive(Serialize)] +pub struct Pending { + kind: &'static str, + hub: String, +} + +#[derive(Serialize)] +pub struct Overview { + version: String, + connected: bool, + /// The hubs this Mac is on, by address. + teams: Vec, + device: String, + folder: String, + level: String, + summary: String, + vaults: Vec, + pending: Option, + update: Option, + recent: Vec, +} + +/// The name people gave this Mac ("Sen's MacBook Air"), rather than its network host name. +fn mac_name() -> String { + std::process::Command::new("scutil") + .args(["--get", "ComputerName"]) + .output() + .ok() + .and_then(|o| String::from_utf8(o.stdout).ok()) + .map(|n| n.trim().chars().take(40).collect::()) + .filter(|n| !n.is_empty()) + .unwrap_or_else(default_device_name) +} + +#[tauri::command(async)] +pub fn overview(app: AppHandle, state: State) -> Answer { + let config = Config::load().map_err(plain)?; + let label = config.device_label(); + let (level, summary) = crate::summary(&config); + let pending = state.pending.lock().unwrap().as_ref().map(|c| Pending { + kind: if matches!(c, Connect::Join { .. }) { "join" } else { "pair" }, + hub: c.hub(), + }); + Ok(Overview { + version: app.package_info().version.to_string(), + connected: !config.hubs.is_empty(), + teams: config.hubs.iter().map(|h| h.url.clone()).collect(), + device: config.device_name.clone().unwrap_or_else(mac_name), + folder: config.vaults_dir().display().to_string(), + level, + summary, + vaults: config.vaults.iter().map(|v| status::of(v, &label)).collect(), + pending, + update: state.update_ready.lock().unwrap().clone(), + recent: crate::recent_log(), + }) +} + +/// Connects this Mac to a team: from the link the website opened, or from a hub address and pairing code typed +/// by hand. A Mac can be on several teams' hubs at once. +#[tauri::command(async)] +pub fn connect( + app: AppHandle, + state: State, + name: String, + folder: String, + hub_url: Option, + code: Option, +) -> Answer { + let label = name.trim(); + if label.is_empty() { + return Err("give this Mac a name your team will see".into()); + } + let mut config = Config::load().map_err(plain)?; + let request = match (hub_url, code) { + (Some(hub), Some(code)) if !hub.trim().is_empty() && !code.trim().is_empty() => { + let hub = hub.trim().trim_end_matches('/'); + let hub = if hub.starts_with("http") { hub.to_string() } else { format!("https://{hub}") }; + Connect::Pair { hub, code: code.trim().to_string() } + } + _ => state.pending.lock().unwrap().clone().ok_or("open the link from your team's website, or enter a code")?, + }; + if config.hub(request.hub().trim_end_matches('/')).is_some() { + *state.pending.lock().unwrap() = None; + return Err(format!("this Mac is already connected to {}", request.hub())); + } + let (url, welcome) = match &request { + Connect::Join { link } => hub::join(link, label).map_err(plain)?, + Connect::Pair { hub, code } => (hub.clone(), hub::login(hub, code, label).map_err(plain)?), + }; + *state.pending.lock().unwrap() = None; + config.device_name = Some(label.to_string()); + config.vaults_dir = Some(folder.into()); + config.hubs.push(HubLink { url, device_id: welcome.device_id, key: welcome.key }); + config.save().map_err(plain)?; + supervisor::CHECK_HUB.store(true, Ordering::Relaxed); + // Start with the Mac from now on (not for test setups that point LUNE_HOME elsewhere). + if std::env::var_os("LUNE_HOME").is_none() { + let _ = app.autolaunch().enable(); + } + Ok(format!("Connected as {} — your vaults are on their way", welcome.person)) +} + +#[tauri::command(async)] +pub fn choose_folder(app: AppHandle) -> Option { + let start = Config::load().unwrap_or_default().vaults_dir(); + let start = start.ancestors().find(|p| p.exists()).map(|p| p.to_path_buf()).unwrap_or_default(); + app.dialog() + .file() + .set_title("Where should shared vaults live?") + .set_directory(start) + .blocking_pick_folder() + .and_then(|p| p.into_path().ok()) + .map(|p| p.display().to_string()) +} + +#[tauri::command(async)] +pub fn share_now() { + supervisor::share_now(&Config::load().unwrap_or_default()); +} + +/// Opens a vault and holds its op lock for one decision; afterwards the runner shares at once. +fn with_vault(name: &str, f: impl FnOnce(&Config, &Vault) -> anyhow::Result) -> Answer { + let config = Config::load().map_err(plain)?; + config.use_hub_credentials(); + let cfg = config.find(name).ok_or(format!("no vault named {name}"))?; + let v = Vault::open(cfg, &config.device_label()).map_err(plain)?; + let out = { + let _op = state::op_lock(&v.git_dir).map_err(plain)?; + f(&config, &v).map_err(plain)? + }; + let _ = std::fs::write(state::lune_dir(&v.git_dir).join("nudge"), ""); + Ok(out) +} + +#[tauri::command(async)] +pub fn held_share(vault: String) -> Answer<()> { + with_vault(&vault, |_, v| v.share_held().map(|_| ())) +} + +#[tauri::command(async)] +pub fn held_undo(vault: String) -> Answer { + with_vault(&vault, |_, v| v.undo_held().map(|kept| kept.len())) +} + +fn held_hits(v: &Vault, path: &str) -> anyhow::Result> { + let note = v.secret_holds()?.into_iter().find(|n| n.path == path); + note.map(|n| n.hits).filter(|h| !h.is_empty()).ok_or_else(|| anyhow::anyhow!("nothing is held in {path} any more")) +} + +/// Replace with a pointer (P2): the secret goes, a note on where to find it stays. +#[tauri::command(async)] +pub fn secret_pointer(vault: String, path: String, pointer: String) -> Answer<()> { + if pointer.trim().is_empty() { + return Err("say where to get it, e.g. \"search prod-deploy in Secrets Manager\"".into()); + } + with_vault(&vault, |_, v| { + let hits = held_hits(v, &path)?; + let file = v.root.join(&path); + let text = std::fs::read_to_string(&file)?; + std::fs::write(&file, secrets::replace_with_pointer(&text, &hits, None, pointer.trim()))?; + Ok(()) + }) +} + +#[tauri::command(async)] +pub fn not_a_secret(vault: String, path: String) -> Answer<()> { + with_vault(&vault, |config, v| { + let cfg = config.find(&vault).unwrap(); + for h in held_hits(v, &path)? { + secrets::allow(&v.git_dir, &h, &path)?; + if let (Some(hub), Some(id)) = (config.hub_of(cfg), cfg.hub_vault) { + hub.not_a_secret(id, &h.line_hash)?; + } + } + Ok(()) + }) +} + +#[derive(Serialize)] +pub struct Comparison { + note: String, + copy: String, + label: String, + /// The copy beside the note is this Mac's version (the usual case after a clash here). + copy_is_mine: bool, + note_text: Option, + copy_text: Option, +} + +fn as_text(bytes: Option>) -> Option { + bytes.filter(|b| b.len() <= 200_000 && !b.iter().take(8000).any(|&c| c == 0)).map(|b| String::from_utf8_lossy(&b).into_owned()) +} + +#[tauri::command(async)] +pub fn compare(vault: String, copy: String) -> Answer { + let config = Config::load().map_err(plain)?; + let cfg = config.find(&vault).ok_or(format!("no vault named {vault}"))?; + let v = Vault::open(cfg, &config.device_label()).map_err(plain)?; + let k = tidy::list(&v).map_err(plain)?.into_iter().find(|k| k.copy == copy).ok_or("that was tidied already")?; + Ok(Comparison { + note_text: as_text(std::fs::read(v.root.join(&k.note)).ok()), + copy_text: as_text(std::fs::read(v.root.join(&k.copy)).ok()), + copy_is_mine: k.label.eq_ignore_ascii_case(&v.label), + note: k.note, + copy: k.copy, + label: k.label, + }) +} + +/// Keeps the version in place ("note"), the one beside it ("copy"), or both as separate notes. +#[tauri::command(async)] +pub fn tidy(vault: String, copy: String, keep: String) -> Answer<()> { + with_vault(&vault, |_, v| { + let k = tidy::list(v)?.into_iter().find(|k| k.copy == copy).ok_or_else(|| anyhow::anyhow!("that was tidied already"))?; + let copy_is_mine = k.label.eq_ignore_ascii_case(&v.label); + let choice = match (keep.as_str(), copy_is_mine) { + ("both", _) => Keep::Both, + ("copy", true) | ("note", false) => Keep::Mine, + _ => Keep::Theirs, + }; + tidy::keep(v, ©, choice).map(|_| ()) + }) +} + +pub fn open_canvas_now(app: &AppHandle, team: Option<&str>) -> Answer<()> { + let config = Config::load().map_err(plain)?; + let hub = config.pick_hub(team).map_err(plain)?; + let link = hub.web_link().map_err(plain)?; + app.opener().open_url(link, None::<&str>).map_err(|e| e.to_string()) +} + +#[tauri::command(async)] +pub fn open_canvas(app: AppHandle, team: Option) -> Answer<()> { + open_canvas_now(&app, team.as_deref()) +} + +#[tauri::command(async)] +pub fn open_folder(app: AppHandle, vault: String) -> Answer<()> { + let config = Config::load().map_err(plain)?; + let cfg = config.find(&vault).ok_or(format!("no vault named {vault}"))?; + app.opener().open_path(cfg.path.display().to_string(), None::<&str>).map_err(|e| e.to_string()) +} + +#[tauri::command] +pub fn restart(app: AppHandle) { + app.restart(); +} diff --git a/desktop/src/main.rs b/desktop/src/main.rs new file mode 100644 index 0000000..9e51704 --- /dev/null +++ b/desktop/src/main.rs @@ -0,0 +1,419 @@ +//! Lune for the Mac (M7): the sync engine in the menu bar, a small window for what needs a person, connecting +//! from a link, signed updates from the hub, and a clean uninstall. + +mod commands; + +use lune_core::config::{self, Config}; +use lune_core::{membership, remote, runner, status, supervisor}; +use std::collections::VecDeque; +use std::io::Write; +use std::sync::atomic::Ordering; +use std::sync::{Mutex, OnceLock}; +use std::time::Duration; +use tauri::image::Image; +use tauri::menu::{Menu, MenuItem, PredefinedMenuItem}; +use tauri::tray::{TrayIcon, TrayIconBuilder}; +use tauri::{AppHandle, Manager, WindowEvent}; +use tauri_plugin_autostart::{MacosLauncher, ManagerExt as _}; +use tauri_plugin_deep_link::DeepLinkExt; +use tauri_plugin_dialog::{DialogExt, MessageDialogButtons, MessageDialogKind}; +use tauri_plugin_updater::UpdaterExt; + +/// A request to connect this Mac, from a `lune://` link the website opened. +#[derive(Clone)] +pub enum Connect { + /// An invite link: creates the person's account and this device. + Join { link: String }, + /// A pairing code made for a signed-in person. + Pair { hub: String, code: String }, +} + +impl Connect { + pub fn hub(&self) -> String { + match self { + Connect::Join { link } => link.split("/join/").next().unwrap_or_default().to_string(), + Connect::Pair { hub, .. } => hub.clone(), + } + } + + fn from_url(url: &url::Url) -> Option { + let param = |name: &str| url.query_pairs().find(|(k, _)| k == name).map(|(_, v)| v.into_owned()); + match url.host_str()? { + "join" => Some(Connect::Join { link: param("link")? }), + "pair" => Some(Connect::Pair { hub: param("hub")?, code: param("code")? }), + _ => None, + } + } +} + +#[derive(Default)] +pub struct AppState { + pub pending: Mutex>, + /// A newer version, downloaded and installed; it runs after a restart. + pub update_ready: Mutex>, + tray: Mutex>, +} + +struct TrayParts { + icon: TrayIcon, + status: MenuItem, + canvas: MenuItem, + update: MenuItem, + level: String, +} + +static APP: OnceLock = OnceLock::new(); +static RECENT: Mutex> = Mutex::new(VecDeque::new()); + +/// The engine's log: kept briefly for the window and appended to `lune.log` next to the config. +fn log_line(vault: &str, msg: &str) { + let line = format!("{} {vault:<10} {msg}", chrono::Local::now().format("%H:%M:%S")); + { + let mut recent = RECENT.lock().unwrap(); + recent.push_back(line.clone()); + while recent.len() > 50 { + recent.pop_front(); + } + } + if let Ok(dir) = config::config_dir() { + let path = dir.join("lune.log"); + if std::fs::metadata(&path).is_ok_and(|m| m.len() > 2_000_000) { + let _ = std::fs::remove_file(&path); + } + if let Ok(mut f) = std::fs::OpenOptions::new().create(true).append(true).open(path) { + let _ = writeln!(f, "{line}"); + } + } +} + +pub fn recent_log() -> Vec { + RECENT.lock().unwrap().iter().rev().take(12).cloned().collect() +} + +pub fn show_window(app: &AppHandle) { + if let Some(w) = app.get_webview_window("main") { + let _ = w.show(); + let _ = w.unminimize(); + let _ = w.set_focus(); + } + // Opening the window is a good moment to look for an update. + let app = app.clone(); + tauri::async_runtime::spawn(async move { check_for_update(&app).await }); +} + +fn tray_image(level: &str) -> Image<'static> { + let bytes: &[u8] = match level { + "secret" => include_bytes!("../icons/tray-red.png"), + "behind" => include_bytes!("../icons/tray-amber.png"), + "offline" => include_bytes!("../icons/tray-grey.png"), + _ => include_bytes!("../icons/tray-green.png"), + }; + Image::from_bytes(bytes).expect("tray icons are valid PNGs") +} + +/// One line for the menu bar: the worst thing going on, in plain words. +pub fn summary(config: &Config) -> (String, String) { + if config.hubs.is_empty() && config.vaults.is_empty() { + return ("offline".into(), "Not connected to a team yet".into()); + } + let label = config.device_label(); + let all: Vec = config.vaults.iter().map(|v| status::of(v, &label)).collect(); + let level = status::worst(all.iter().map(|s| s.level)).to_string(); + let text = match all.iter().find(|s| s.level == level && level != "current") { + Some(s) if !s.secrets.is_empty() => format!("{}: a note was held back (possible secret)", s.name), + Some(s) if !s.held.is_empty() => format!("{}: a big change is waiting for you", s.name), + Some(s) if !s.tidy.is_empty() && s.headline == "Synced" => { + format!("{}: {} to tidy", s.name, if s.tidy.len() == 1 { "1 note".to_string() } else { format!("{} notes", s.tidy.len()) }) + } + Some(s) => format!("{}: {}", s.name, s.headline), + None if all.is_empty() => "Waiting for vaults to arrive".into(), + None => "All synced".into(), + }; + (level, text) +} + +fn refresh_tray(app: &AppHandle) { + let config = Config::load().unwrap_or_default(); + let (level, text) = summary(&config); + let state = app.state::(); + let update = state.update_ready.lock().unwrap().clone(); + let mut tray = state.tray.lock().unwrap(); + let Some(t) = tray.as_mut() else { return }; + if t.level != level { + let _ = t.icon.set_icon(Some(tray_image(&level))); + t.level = level; + } + let _ = t.status.set_text(&text); + let _ = t.icon.set_tooltip(Some(format!("Lune — {text}"))); + let _ = t.canvas.set_enabled(!config.hubs.is_empty()); + match update { + Some(v) => { + let _ = t.update.set_text(format!("Restart to update (Lune {v})")); + let _ = t.update.set_enabled(true); + } + None => { + let _ = t.update.set_text(format!("Lune {}", app.package_info().version)); + let _ = t.update.set_enabled(false); + } + } +} + +fn build_tray(app: &AppHandle) -> tauri::Result<()> { + let status = MenuItem::with_id(app, "status", "Starting…", false, None::<&str>)?; + let open = MenuItem::with_id(app, "open", "Open Lune", true, None::<&str>)?; + let canvas = MenuItem::with_id(app, "canvas", "Open team canvas", false, None::<&str>)?; + let share = MenuItem::with_id(app, "share", "Share now", true, None::<&str>)?; + let update = MenuItem::with_id(app, "update", "", false, None::<&str>)?; + let uninstall_item = MenuItem::with_id(app, "uninstall", "Uninstall Lune…", true, None::<&str>)?; + let quit = MenuItem::with_id(app, "quit", "Quit Lune", true, None::<&str>)?; + let sep = || PredefinedMenuItem::separator(app); + let menu = Menu::with_items(app, &[&status, &sep()?, &open, &canvas, &share, &sep()?, &update, &uninstall_item, &quit])?; + let icon = TrayIconBuilder::with_id("lune") + .icon(tray_image("offline")) + .icon_as_template(false) + .menu(&menu) + .show_menu_on_left_click(true) + .on_menu_event(|app, event| match event.id.as_ref() { + "open" => show_window(app), + "canvas" => { + // One team: straight to its canvas. Several: the window lists them. + if Config::load().unwrap_or_default().hubs.len() > 1 { + show_window(app); + } else { + let app = app.clone(); + std::thread::spawn(move || { + if let Err(e) = commands::open_canvas_now(&app, None) { + log_line("hub", &format!("couldn't open the canvas: {e}")); + } + }); + } + } + "share" => supervisor::share_now(&Config::load().unwrap_or_default()), + "update" => app.restart(), + "uninstall" => { + let app = app.clone(); + std::thread::spawn(move || uninstall(&app)); + } + "quit" => app.exit(0), + _ => {} + }) + .build(app)?; + let state = app.state::(); + *state.tray.lock().unwrap() = Some(TrayParts { icon, status, canvas, update, level: "offline".into() }); + Ok(()) +} + +/// Looks for a newer version on this Mac's hubs (they all serve releases signed with the one key); downloads and +/// installs it, ready for a restart (D3). +pub async fn check_for_update(app: &AppHandle) { + let hubs = Config::load().map(|c| c.hubs).unwrap_or_default(); + if hubs.is_empty() { + return; + } + if app.state::().update_ready.lock().unwrap().is_some() { + return; + } + let configured = app + .config() + .plugins + .0 + .get("updater") + .and_then(|u| u.get("pubkey")) + .and_then(|k| k.as_str()) + .is_some_and(|k| !k.is_empty()); + if !configured { + return; // a build without the hub's public key can't verify updates, so it doesn't take any + } + let endpoints = hubs.iter().filter_map(|h| format!("{}/api/update/{{{{target}}}}/{{{{arch}}}}/{{{{current_version}}}}", h.url).parse().ok()); + let result = async { + let updater = app + .updater_builder() + .endpoints(endpoints.collect())? + .header("User-Agent", remote::user_agent())? + .build()?; + if let Some(update) = updater.check().await? { + log_line("app", &format!("downloading Lune {}", update.version)); + update.download_and_install(|_, _| {}, || {}).await?; + return Ok::<_, anyhow::Error>(Some(update.version)); + } + Ok(None) + } + .await; + match result { + Ok(Some(version)) => { + log_line("app", &format!("Lune {version} is ready — restart to use it")); + *app.state::().update_ready.lock().unwrap() = Some(version); + refresh_tray(app); + } + Ok(None) => {} + Err(e) => log_line("app", &format!("couldn't check for an update: {e:#}")), + } +} + +/// Uninstall Lune… (D5): asks once, then shares, hands over, removes what Lune made, and moves itself to the Trash. +fn uninstall(app: &AppHandle) { + let ok = app + .dialog() + .message( + "Lune first shares anything not yet shared and hands the rest to your team, then removes:\n\n\ + • the vault folders Lune created\n• this Mac from your team\n• Lune's settings and login item\n• the app itself\n\n\ + Folders you added yourself stay, and so does any folder whose changes couldn't be shared.", + ) + .title("Uninstall Lune from this Mac?") + .kind(MessageDialogKind::Warning) + .buttons(MessageDialogButtons::OkCancelCustom("Uninstall".into(), "Cancel".into())) + .blocking_show(); + if !ok { + return; + } + runner::STOP.store(true, Ordering::Relaxed); + let mut config = Config::load().unwrap_or_default(); + config.use_hub_credentials(); + let done = membership::uninstall(&mut config); + let _ = app.autolaunch().disable(); + let mut leftovers = vec![]; + if let Ok(dir) = config::config_dir() { + leftovers.push(dir); + } + let paths = app.path(); + leftovers.extend([paths.app_data_dir(), paths.app_cache_dir(), paths.app_log_dir(), paths.app_config_dir()].into_iter().flatten()); + if let Some(home) = std::env::home_dir() { + let id = &app.config().identifier; + leftovers.push(home.join("Library/WebKit").join(id)); + leftovers.push(home.join("Library/Caches").join(id)); + } + let message = match done { + Ok(done) => { + for dir in leftovers.iter().filter(|d| d.exists()) { + let _ = std::fs::remove_dir_all(dir); + } + let bundle = std::env::current_exe() + .ok() + .and_then(|exe| exe.ancestors().find(|p| p.extension().is_some_and(|e| e == "app")).map(|p| p.to_path_buf())); + let mut text = String::from("Lune is uninstalled."); + if let Some(bundle) = bundle + && let Err(e) = move_to_trash(&bundle) + { + log_line("app", &format!("couldn't move the app to the Trash: {e}")); + text = format!("Lune is uninstalled. Drag {} to the Trash to finish.", bundle.display()); + } + if !done.removed.is_empty() { + text.push_str(&format!("\n\nRemoved:\n{}", done.removed.join("\n"))); + } + if !done.kept.is_empty() { + text.push_str(&format!("\n\nKept:\n{}", done.kept.join("\n"))); + } + if let Some(p) = done.hub_problem { + text.push_str(&format!("\n\nNote: {p}")); + } + text + } + Err(e) => format!("Uninstall stopped before removing anything else: {e:#}\n\nOpen Lune again to keep syncing."), + }; + app.dialog().message(message).title("Lune").buttons(MessageDialogButtons::Ok).blocking_show(); + app.exit(0); +} + +/// The system's own "move to Trash" (Finder's way needs an extra permission and fails quietly without it). +fn move_to_trash(path: &std::path::Path) -> Result<(), trash::Error> { + let mut ctx = trash::TrashContext::default(); + #[cfg(target_os = "macos")] + { + use trash::macos::{DeleteMethod, TrashContextExtMacos}; + ctx.set_delete_method(DeleteMethod::NsFileManager); + } + ctx.delete(path) +} + +fn handle_links(app: &AppHandle, urls: Vec) { + for url in urls { + if let Some(c) = Connect::from_url(&url) { + *app.state::().pending.lock().unwrap() = Some(c); + show_window(app); + } + } +} + +fn main() { + tauri::Builder::default() + .plugin(tauri_plugin_deep_link::init()) + .plugin(tauri_plugin_dialog::init()) + .plugin(tauri_plugin_opener::init()) + .plugin(tauri_plugin_updater::Builder::new().build()) + .plugin(tauri_plugin_autostart::init(MacosLauncher::LaunchAgent, None)) + .manage(AppState::default()) + .invoke_handler(tauri::generate_handler![ + commands::overview, + commands::connect, + commands::choose_folder, + commands::share_now, + commands::held_share, + commands::held_undo, + commands::secret_pointer, + commands::not_a_secret, + commands::compare, + commands::tidy, + commands::open_canvas, + commands::open_folder, + commands::restart, + ]) + .setup(|app| { + let handle = app.handle().clone(); + let _ = APP.set(handle.clone()); + remote::set_client_version(&app.package_info().version.to_string()); + #[cfg(target_os = "macos")] + app.set_activation_policy(tauri::ActivationPolicy::Accessory); + build_tray(&handle)?; + + // The engine: the same one `lunesync run` uses, in this process. + std::thread::spawn(|| { + loop { + if let Err(e) = supervisor::supervise(log_line) { + log_line("app", &format!("sync stopped: {e:#} — restarting in 10 s")); + } + if runner::STOP.load(Ordering::Relaxed) { + return; + } + std::thread::sleep(Duration::from_secs(10)); + } + }); + let tray_handle = handle.clone(); + std::thread::spawn(move || { + loop { + refresh_tray(&tray_handle); + std::thread::sleep(Duration::from_secs(3)); + } + }); + let update_handle = handle.clone(); + tauri::async_runtime::spawn(async move { + tokio_sleep(Duration::from_secs(15)).await; + loop { + check_for_update(&update_handle).await; + tokio_sleep(Duration::from_secs(6 * 3600)).await; + } + }); + + let link_handle = handle.clone(); + app.deep_link().on_open_url(move |event| handle_links(&link_handle, event.urls())); + if let Ok(Some(urls)) = app.deep_link().get_current() { + handle_links(&handle, urls); + } + if Config::load().map(|c| c.hubs.is_empty() && c.vaults.is_empty()).unwrap_or(true) { + show_window(&handle); + } + Ok(()) + }) + .on_window_event(|window, event| { + // Closing the window keeps Lune running in the menu bar. + if let WindowEvent::CloseRequested { api, .. } = event { + api.prevent_close(); + let _ = window.hide(); + } + }) + .run(tauri::generate_context!()) + .expect("Lune couldn't start"); +} + +async fn tokio_sleep(d: Duration) { + let _ = tauri::async_runtime::spawn_blocking(move || std::thread::sleep(d)).await; +} diff --git a/desktop/tauri.conf.json b/desktop/tauri.conf.json new file mode 100644 index 0000000..e537291 --- /dev/null +++ b/desktop/tauri.conf.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://schema.tauri.app/config/2", + "productName": "Lune", + "mainBinaryName": "lune", + "identifier": "space.senkensha.lune", + "build": { + "frontendDist": "../web/dist-desktop", + "beforeBuildCommand": "npm --prefix ../web run build:desktop" + }, + "app": { + "windows": [ + { + "label": "main", + "title": "Lune", + "url": "desktop.html", + "width": 440, + "height": 620, + "minWidth": 360, + "minHeight": 420, + "visible": false + } + ], + "security": { + "csp": "default-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:" + } + }, + "bundle": { + "active": true, + "targets": ["app", "dmg"], + "icon": ["icons/32x32.png", "icons/128x128.png", "icons/128x128@2x.png", "icons/icon.icns", "icons/icon.png"], + "category": "Productivity", + "shortDescription": "Keeps shared vaults in sync", + "macOS": { "minimumSystemVersion": "12.0", "signingIdentity": "-" } + }, + "plugins": { + "deep-link": { "desktop": { "schemes": ["lune"] } }, + "updater": { "pubkey": "", "requireSignedVersion": true } + } +} diff --git a/docs/SPEC.md b/docs/SPEC.md index 5c3c91f..f860a13 100644 --- a/docs/SPEC.md +++ b/docs/SPEC.md @@ -153,38 +153,44 @@ Only the current milestone gets detailed below. The next one is detailed when th --- -## 6. Milestone 6 — Canvas for health and leaving +## 6. Milestone 7 — The app normal people install -Milestones 1–5 (sync, safety checks, the hub, taking access back, the canvas for access) are built; their detail lives in the code and tests now. +Milestones 1–6 (sync, safety checks, the hub, taking access back, the canvas) are built; their detail lives in the code and tests now. ### Goal -Before you need someone's work, you can see whether it has reached the team, and ask for it. Everything that needs a human decision — a note changed in two places, a handover, removing someone from the team — can be done on the canvas, including from a phone. +Someone who has never opened a terminal installs Lune on a Mac from the team's website, connects without typing a code, and from then on only notices it in the menu bar. Updates arrive on their own, signed. Uninstalling leaves nothing behind except notes that never got shared. -### What Sen does (on the canvas) -- Sees each person ringed by freshness and each device dotted the same way: green current, amber behind, grey offline (X6). A red dot means a possible secret was held back on that device. -- Opens a behind device: "4 changes not shared · 2 days" → **Nudge**. -- A vault shows "1 note to tidy" → **Compare** shows both versions side by side → keep one, or keep both. -- A vault shows a handover → see which notes it changes → **Keep** / **Discard**. A device that never came back → **Delete without saving**. -- A person → **Remove from team** (owner, asks to confirm, says how much unshared work will come back first). A removed person stays visible to the owner, dimmed, with **Restore** (gives a one-time sign-in link). +This milestone ships **macOS (Apple silicon) only** (§8). The code stays portable; Windows, Linux and Intel Macs come after the pilot. + +### What a person does +- Opens their invite link (or the team canvas → **Get the Mac app**) → downloads `Lune.dmg` → drags Lune to Applications → opens it. +- Back on the page, clicks **Open Lune to join** (invite) or **Connect this Mac** (already on the team). Lune opens, shows the device name it will use (editable) → **Join** / **Connect**. No code to copy. +- Picks where shared vaults live (default `~/Vaults`) → vaults arrive. +- The menu-bar icon shows the worst status: synced, waiting, offline, held secret (same colours as X6). Its menu: status line, **Open Lune**, **Open team canvas**, **Share now**, **Uninstall Lune…**, **Quit**. +- The Lune window lists vaults with plain status and anything that needs them: a held big change (**Share anyway** / **Undo**), a possible secret (**Replace with a pointer** / **Not a secret**), notes to tidy (**Compare** side by side → keep this Mac's, the other, or both). +- When a new version is published, Lune downloads it quietly and the menu says **Restart to update**. +- **Uninstall Lune…** asks once, then: shares what it can, removes the vault folders Lune created, signs this Mac out of the hub, removes its settings and login item, and moves the app to the Trash. ### Behavior -- **Health reports**: while `lunesync run` is going, each device tells the hub every ~30 s, per vault: when it last synced, how many changes are waiting, and whether something is held (a big change, or a possible secret — counts only, never content). The hub knows work exists, not what it is. -- **Freshness**: current = reported in the last 2 minutes with nothing waiting; behind = something waiting or held; offline = not heard from in 2 minutes (shown with when it was last seen). A person's ring shows their worst device. -- **Nudge** reaches the device on its next check-in (~30 s): it saves what has settled and syncs at once. If something is held, the panel says so instead of pretending a nudge will help. -- **Tidy on the canvas** reads the two versions from the hub's copy of the vault (members only; Edit to decide). Keeping one, or both as separate notes, is a normal change on the hub that every device receives — same outcome as `lunesync tidy keep`. -- **Handovers on the canvas** are the M4 review (show / keep / discard / delete without saving), shown in the vault and person panels. -- **Remove from team / Restore** are the M4 flows; this is the only gesture on the canvas that asks for confirmation (X2). -- Status colors are used only for status; red only for a held secret (X6). +- **One engine**: the app runs the same sync engine as `lunesync run`, in-process. Both share one config, so the CLI still works next to the app. Lune starts at login once connected. +- **Connecting without a code**: the web page asks the hub for a short-lived pairing code (signed-in person) or uses the invite token, and opens `lune://pair?…` / `lune://join?…`. Typing a hub address and code in the window stays as a fallback. +- **Releases** (D3): `lunehub release keygen` creates the update-signing key on the hub's server (password-protected, never leaves it). `lunehub release publish` takes a built app, signs it there, and makes it the version the hub offers for download and update. The app trusts only that public key. +- **Too-old clients** (D3): every client says its version in its User-Agent. The hub serves the newest published version and the one before it. Older clients are refused with "Update Lune to keep syncing" and keep saving locally. Clients that don't say a version (0.1.x CLI, plain Git) are let through. +- **Several hubs on one device**: a Mac (or server) can belong to more than one team, e.g. Sen's own hub and a workplace hub. Each connection has its own device key; vaults from all of them sync side by side, and leaving one team never touches another's vaults. +- **One signing key for every hub**: releases are signed once where the key lives; other hubs `lunehub release import` an already-signed release and never hold the key. +- **Uninstall** never loses work: a vault with changes that couldn't be shared (offline, held, read-only) keeps its folder, and the dialog says which. Folders Lune didn't create are never deleted (A9). +- **Unsigned pilot** (D4): the first open needs "Open Anyway" in System Settings; the download page says so. OS code signing comes before a wider rollout. ### Acceptance — Sen acts this out -1. Laptop offline with edits: its ring turns amber, then grey with "last seen"; back online it turns green on its own. -2. A behind laptop that's online but idle: **Nudge** → green within a minute. -3. Same lines edited on two devices: the vault shows 1 to tidy; compare side by side on the canvas; keep one; the copy disappears on every device. -4. Remove someone from a vault with unshared work: review and keep the handover on the canvas. -5. From a phone: remove someone from the team (confirm), see their devices leave; restore them. +1. From an invite link on a Mac that has never run Lune: download, install, **Open Lune to join**, pick a folder; the team's vaults arrive and the menu bar shows synced. +2. On the canvas of an existing member: **Connect this Mac** pairs it with no code typed. +3. A possible secret: the menu bar turns red; resolve it from the window. +4. Same lines edited on two devices: compare side by side in the window, keep one. +5. Publish a new version on the hub: the app picks it up, **Restart to update**, and comes back as the new version still synced. +6. **Uninstall Lune…**: vault folders it created and its settings are gone, the device disappears from the canvas, and a folder you added yourself is untouched. -### Out of scope for M6 -Desktop app, tray, installers, updates (M7). Push notifications for Nudge (the next check-in is enough for now). +### Out of scope for M7 +Windows and Linux installers, Intel Macs, server install script (D2), OS code signing (D4), security audit and release evidence (before a wider rollout, not the pilot). ## 7. Open questions None open. @@ -196,3 +202,7 @@ Record here: date, what changed, why, which decision number. Example: - 2026-10-28 — Secret detection (open question, P2): our own short list of ~20 high-confidence rules, not an embedded gitleaks-style set. Fewer false alarms, easy to read. (Sen) - 2026-10-29 — Hub storage (open question): plain bare repos on the hub's volume served by the hub itself (device key + role check, then Git's own HTTP backend); no Gitea underneath. (Sen) - 2026-10-29 — Web canvas sign-in (new): no passwords; a one-time link from `lunesync open` or a pairing code typed on the hub's sign-in page; 30-day session cookie. (Sen) +- 2026-10-29 — Milestone 7 ships macOS (Apple silicon) only; Windows, Linux and Intel Macs after the pilot (D1). (Sen) +- 2026-10-29 — The update-signing key lives on the hub's server and `lunehub` signs releases there, so losing a laptop doesn't lose the key (D3). (Sen) +- 2026-10-29 — A device can connect to several hubs at once (Sen's own and a workplace hub), each with its own device key (A1, new in M7). (Sen) +- 2026-10-29 — One update-signing key, on Sen's VPS, signs releases for every hub; other hubs import signed releases (D3). Accepted trade-off: that server is trusted by every hub's Macs. (Sen) diff --git a/hub/Cargo.toml b/hub/Cargo.toml index 10bdcef..0adf23c 100644 --- a/hub/Cargo.toml +++ b/hub/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lunehub" -version = "0.1.0" +version.workspace = true edition = "2024" [dependencies] @@ -10,6 +10,7 @@ base64 = "0.23.1" chrono = "0.4.45" getrandom = "0.4.3" lune-core = { version = "0.1.0", path = "../core" } +minisign = "0.10.0" rusqlite = { version = "0.41.0", features = ["bundled"] } rust-embed = { version = "8.13.0", features = ["mime-guess"] } serde = { version = "1.0.229", features = ["derive"] } diff --git a/hub/src/api.rs b/hub/src/api.rs index 207b250..ba7cc07 100644 --- a/hub/src/api.rs +++ b/hub/src/api.rs @@ -96,6 +96,7 @@ pub fn authenticate(hub: &Hub, headers: &HeaderMap) -> Result if !caller.active { return Err(denied("this device was removed from the hub")); } + crate::release::check_client(&hub.data, headers)?; Ok(caller) } @@ -220,6 +221,9 @@ pub async fn pair(State(hub): State, headers: HeaderMap) -> ApiResult { pub async fn me(State(hub): State, headers: HeaderMap) -> ApiResult { let caller = authenticate_any(&hub, &headers)?; + if caller.active { + crate::release::check_client(&hub.data, &headers)?; + } let conn = hub.db.lock().unwrap(); let mut stmt = conn.prepare( "SELECT d.id, d.vault_id, v.name, d.delete_files, d.without_saving FROM departures d JOIN vaults v ON v.id = d.vault_id diff --git a/hub/src/git.rs b/hub/src/git.rs index 65f1d8b..ddda4a3 100644 --- a/hub/src/git.rs +++ b/hub/src/git.rs @@ -76,6 +76,10 @@ async fn handle( let (caller, role, handover, vault_name) = { let conn = hub.db.lock().unwrap(); let Some(caller) = db::caller(&conn, &id, &key)? else { return Ok(ask_for_key()) }; + if caller.active { + // A device that's leaving may still hand over, whatever its version. + crate::release::check_client(&hub.data, &headers)?; + } let role = if caller.active { db::role(&conn, caller.account_id, vault_id)? } else { None }; // A device whose access ended may still send its handover, and nothing else (A6). let handover: Option = conn diff --git a/hub/src/main.rs b/hub/src/main.rs index 95139e9..ab24a64 100644 --- a/hub/src/main.rs +++ b/hub/src/main.rs @@ -6,6 +6,7 @@ mod git; mod health; mod hook; mod leave; +mod release; mod web; use anyhow::Result; @@ -36,17 +37,31 @@ fn main() -> Result<()> { s.read_to_string(&mut answer)?; std::process::exit(if answer.ends_with("ok") { 0 } else { 1 }); } + ["release", "keygen"] => release::keygen(&data_dir()), + ["release", "list"] => { + release::list(&data_dir()); + Ok(()) + } + ["release", "import", folder] => release::import(&data_dir(), folder.as_ref()), + ["release", "publish", version, update, dmg, notes @ ..] => { + release::publish(&data_dir(), version, update.as_ref(), dmg.as_ref(), ¬es.join(" ")) + } [] | ["serve"] => serve(), _ => { eprintln!("usage: lunehub [serve] | lunehub health | lunehub hook pre-receive"); + eprintln!(" lunehub release keygen | list | publish [notes] | import "); std::process::exit(2); } } } +fn data_dir() -> PathBuf { + PathBuf::from(env("LUNE_HUB_DATA", "/data")) +} + #[tokio::main] async fn serve() -> Result<()> { - let data = PathBuf::from(env("LUNE_HUB_DATA", "/data")); + let data = data_dir(); let url = env("LUNE_HUB_URL", "http://localhost:8080").trim_end_matches('/').to_string(); let listen = env("LUNE_HUB_LISTEN", "0.0.0.0:8080"); std::fs::create_dir_all(data.join("repos"))?; @@ -109,6 +124,10 @@ async fn serve() -> Result<()> { .route("/api/tidy/resolve", post(health::resolve)) .route("/api/invites/grant", post(web::invite_grant)) .route("/api/devices/rename", post(web::rename_device)) + .route("/api/update/{target}/{arch}/{current}", get(release::check)) + .route("/api/release", get(release::latest)) + .route("/download/mac", get(release::download_mac)) + .route("/releases/{version}/{file}", get(release::file)) .route("/signin/{token}", get(web::signin_link)) .route("/git/{repo}/{*rest}", any(git::serve)) .route("/health", get(|| async { "ok" })) diff --git a/hub/src/release.rs b/hub/src/release.rs new file mode 100644 index 0000000..cfb923a --- /dev/null +++ b/hub/src/release.rs @@ -0,0 +1,259 @@ +//! Desktop releases (M7, D3): the update-signing key lives here on the hub's server, `lunehub release publish` +//! signs a build, and the hub offers the newest version for download and update. Clients older than the +//! version before it are asked to update. + +use crate::api::{ApiError, Shared}; +use anyhow::{Context, Result, bail}; +use axum::Json; +use axum::extract::{Path, State}; +use axum::http::{HeaderMap, StatusCode, header}; +use axum::response::{IntoResponse, Redirect, Response}; +use base64::Engine; +use minisign::{KeyPair, PublicKeyBox, SecretKey, SecretKeyBox}; +use serde::{Deserialize, Serialize}; +use serde_json::json; +use std::path::{Path as FsPath, PathBuf}; + +/// What a published version holds; written next to its files as `release.json`. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct Release { + pub version: String, + pub notes: String, + pub pub_date: String, + /// The installer people download. + pub dmg: String, + /// The app bundle the updater installs, and its signature (base64 minisign, as Tauri expects). + pub update: String, + pub signature: String, +} + +pub fn parse_version(v: &str) -> Option<(u64, u64, u64)> { + let mut parts = v.trim().trim_start_matches('v').split('.').map(|p| p.parse::().ok()); + let version = (parts.next()??, parts.next()??, parts.next()??); + parts.next().is_none().then_some(version) +} + +fn key_dir(data: &FsPath) -> PathBuf { + data.join("release") +} + +fn releases_dir(data: &FsPath) -> PathBuf { + data.join("releases") +} + +/// Published releases, newest first. +pub fn published(data: &FsPath) -> Vec { + let Ok(dirs) = std::fs::read_dir(releases_dir(data)) else { return vec![] }; + let mut out: Vec = dirs + .flatten() + .filter_map(|d| std::fs::read_to_string(d.path().join("release.json")).ok()) + .filter_map(|s| serde_json::from_str::(&s).ok()) + .filter(|r| parse_version(&r.version).is_some()) + .collect(); + out.sort_by_key(|r| std::cmp::Reverse(parse_version(&r.version))); + out +} + +/// The oldest client version still served: the one before the newest release (D3). None until there are two. +pub fn oldest_supported(data: &FsPath) -> Option<(u64, u64, u64)> { + published(data).get(1).and_then(|r| parse_version(&r.version)) +} + +/// The client version a request carries in its User-Agent (`lune/`), if it says one. +pub fn client_version(headers: &HeaderMap) -> Option<(u64, u64, u64)> { + let ua = headers.get(header::USER_AGENT)?.to_str().ok()?; + let rest = &ua[ua.find("lune/")? + 5..]; + parse_version(rest.split(|c: char| c.is_whitespace() || c == ')' || c == ';').next()?) +} + +/// Refuses clients older than the hub supports. Clients that don't say a version are let through. +pub fn check_client(data: &FsPath, headers: &HeaderMap) -> Result<(), ApiError> { + match (client_version(headers), oldest_supported(data)) { + (Some(v), Some(oldest)) if v < oldest => { + Err(ApiError(StatusCode::UPGRADE_REQUIRED, lune_core::remote::TOO_OLD.into())) + } + _ => Ok(()), + } +} + +fn password() -> Option { + // Unset: minisign asks on the terminal. + std::env::var("LUNE_RELEASE_PASSWORD").ok() +} + +/// What Tauri's updater config wants as `pubkey`: the minisign public key file, base64-encoded. +fn tauri_pubkey(pk_box: &str) -> String { + base64::engine::general_purpose::STANDARD.encode(pk_box) +} + +pub fn keygen(data: &FsPath) -> Result<()> { + let dir = key_dir(data); + let sk_path = dir.join("update.key"); + if sk_path.exists() { + bail!("an update-signing key already exists at {} — keep using it (apps only trust that key)", sk_path.display()); + } + std::fs::create_dir_all(&dir)?; + let KeyPair { pk, sk } = KeyPair::generate_encrypted_keypair(password()).context("couldn't create the key")?; + let sk_box = sk.to_box(Some("Lune update-signing key"))?.into_string(); + let pk_box = pk.to_box()?.into_string(); + write_private(&sk_path, &sk_box)?; + std::fs::write(dir.join("update.pub"), &pk_box)?; + println!("Created the update-signing key at {} (password-protected; back it up with the hub's data).", sk_path.display()); + println!("Put this public key in desktop/tauri.conf.json → plugins.updater.pubkey, then build the app:"); + println!("{}", tauri_pubkey(&pk_box)); + Ok(()) +} + +fn write_private(path: &FsPath, text: &str) -> Result<()> { + use std::io::Write; + let mut opts = std::fs::OpenOptions::new(); + opts.write(true).create_new(true); + #[cfg(unix)] + { + use std::os::unix::fs::OpenOptionsExt; + opts.mode(0o600); + } + opts.open(path)?.write_all(text.as_bytes())?; + Ok(()) +} + +/// `lunehub release publish [notes]`: signs the update here and makes it +/// the version the hub offers. +pub fn publish(data: &FsPath, version: &str, update: &FsPath, dmg: &FsPath, notes: &str) -> Result<()> { + let v = parse_version(version).context("the version should look like 1.2.3")?; + if let Some(newest) = published(data).first() + && parse_version(&newest.version).is_some_and(|n| n >= v) + { + bail!("{} is already published; a new release needs a higher version", newest.version); + } + let dir = key_dir(data); + let sk_box = std::fs::read_to_string(dir.join("update.key")) + .context("no update-signing key yet — run `lunehub release keygen` first")?; + let pk_box = std::fs::read_to_string(dir.join("update.pub"))?; + let sk = SecretKey::from_box(SecretKeyBox::from_string(&sk_box)?, password()).context("couldn't unlock the key")?; + let pk = PublicKeyBox::from_string(&pk_box)?.into_public_key()?; + + let version = format!("{}.{}.{}", v.0, v.1, v.2); + let out = releases_dir(data).join(&version); + std::fs::create_dir_all(&out)?; + let update_name = format!("Lune_{version}_aarch64.app.tar.gz"); + let dmg_name = format!("Lune_{version}_aarch64.dmg"); + std::fs::copy(update, out.join(&update_name)).with_context(|| format!("can't read {}", update.display()))?; + std::fs::copy(dmg, out.join(&dmg_name)).with_context(|| format!("can't read {}", dmg.display()))?; + + // The trusted comment is signed too; the app checks the version in it against the one offered. + let now = chrono::Utc::now(); + let trusted = format!("timestamp:{}\tfile:{update_name}\tversion:{version}", now.timestamp()); + let file = std::fs::File::open(out.join(&update_name))?; + let sig = minisign::sign(Some(&pk), &sk, file, Some(&trusted), Some("signature from the Lune hub"))?; + let release = Release { + version: version.clone(), + notes: notes.to_string(), + pub_date: now.to_rfc3339_opts(chrono::SecondsFormat::Secs, true), + dmg: dmg_name, + update: update_name, + signature: base64::engine::general_purpose::STANDARD.encode(sig.into_string()), + }; + std::fs::write(out.join("release.json"), serde_json::to_string_pretty(&release)?)?; + println!("Published Lune {version}. Apps pick it up within a few hours, or at their next start."); + Ok(()) +} + +/// `lunehub release import `: offers a release signed on another hub (one key signs for every hub). +/// The folder is what `publish` made there: `releases//` with release.json and both files. +pub fn import(data: &FsPath, from: &FsPath) -> Result<()> { + let r: Release = serde_json::from_str(&std::fs::read_to_string(from.join("release.json")).context("that folder has no release.json")?) + .context("that release.json doesn't make sense")?; + let v = parse_version(&r.version).context("that release has no proper version")?; + if let Some(newest) = published(data).first() + && parse_version(&newest.version).is_some_and(|n| n >= v) + { + bail!("{} is already offered here; only newer releases can be added", newest.version); + } + // If this hub knows the public key, check the signature now rather than letting every app refuse it later. + if let Ok(pk_box) = std::fs::read_to_string(key_dir(data).join("update.pub")) { + let pk = PublicKeyBox::from_string(&pk_box)?.into_public_key()?; + let sig_box = String::from_utf8(base64::engine::general_purpose::STANDARD.decode(&r.signature)?)?; + let sig = minisign::SignatureBox::from_string(&sig_box)?; + let file = std::fs::File::open(from.join(&r.update))?; + minisign::verify(&pk, &sig, file, true, false, false).context("the signature doesn't match this hub's key")?; + } + let out = releases_dir(data).join(&r.version); + std::fs::create_dir_all(&out)?; + for name in [&r.dmg, &r.update] { + std::fs::copy(from.join(name), out.join(name)).with_context(|| format!("can't read {name}"))?; + } + std::fs::write(out.join("release.json"), serde_json::to_string_pretty(&r)?)?; + println!("Now offering Lune {} (signed elsewhere).", r.version); + Ok(()) +} + +pub fn list(data: &FsPath) { + let all = published(data); + if all.is_empty() { + println!("Nothing published yet."); + } + for (i, r) in all.iter().enumerate() { + let note = match i { + 0 => " (offered)", + 1 => " (oldest still syncing)", + _ => "", + }; + println!("{} {}{note}", r.version, r.pub_date); + } +} + +/// Tauri's updater asks here: `/api/update/{target}/{arch}/{current_version}`. 204 means up to date. +pub async fn check(State(hub): State, Path((target, arch, current)): Path<(String, String, String)>) -> Response { + let Some(newest) = published(&hub.data).into_iter().next() else { return StatusCode::NO_CONTENT.into_response() }; + let newer = match (parse_version(&newest.version), parse_version(¤t)) { + (Some(n), Some(c)) => n > c, + _ => false, + }; + if target != "darwin" || arch != "aarch64" || !newer { + return StatusCode::NO_CONTENT.into_response(); + } + Json(json!({ + "version": newest.version, + "notes": newest.notes, + "pub_date": newest.pub_date, + "url": format!("{}/releases/{}/{}", hub.url, newest.version, newest.update), + "signature": newest.signature, + })) + .into_response() +} + +/// What the download page offers. +pub async fn latest(State(hub): State) -> Json { + match published(&hub.data).into_iter().next() { + Some(r) => Json(json!({ "version": r.version, "mac": "/download/mac" })), + None => Json(json!({ "version": null, "mac": null })), + } +} + +pub async fn download_mac(State(hub): State) -> Response { + match published(&hub.data).into_iter().next() { + Some(r) => Redirect::to(&format!("/releases/{}/{}", r.version, r.dmg)).into_response(), + None => (StatusCode::NOT_FOUND, "no Mac app published yet").into_response(), + } +} + +pub async fn file(State(hub): State, Path((version, name)): Path<(String, String)>) -> Response { + let not_found = || (StatusCode::NOT_FOUND, "no such file").into_response(); + let Some(r) = published(&hub.data).into_iter().find(|r| r.version == version) else { return not_found() }; + if name != r.dmg && name != r.update { + return not_found(); + } + let kind = if name.ends_with(".dmg") { "application/x-apple-diskimage" } else { "application/gzip" }; + match tokio::fs::read(releases_dir(&hub.data).join(&r.version).join(&name)).await { + Ok(bytes) => ( + [ + (header::CONTENT_TYPE, kind.to_string()), + (header::CONTENT_DISPOSITION, format!("attachment; filename=\"{name}\"")), + ], + bytes, + ) + .into_response(), + Err(_) => not_found(), + } +} diff --git a/hub/tests/hub.rs b/hub/tests/hub.rs index c5754c3..0a59f93 100644 --- a/hub/tests/hub.rs +++ b/hub/tests/hub.rs @@ -120,7 +120,7 @@ fn device(url: &str, w: &hub::Welcome, label: &str, dir: &std::path::Path) -> Co Config { device_name: Some(label.into()), vaults_dir: Some(dir.to_path_buf()), - hub: Some(HubLink { url: url.into(), device_id: w.device_id.clone(), key: w.key.clone() }), + hubs: vec![HubLink { url: url.into(), device_id: w.device_id.clone(), key: w.key.clone() }], ..Default::default() } } @@ -151,7 +151,7 @@ fn taking_access_back() { let (_hub, url, owner_link) = start_hub(&tmp.path().join("data")); let (_, sen_w) = hub::join(&owner_link, "Codex").unwrap(); let mut sen = device(&url, &sen_w, "Codex", &tmp.path().join("sen")); - let sen_hub = sen.hub.clone().unwrap(); + let sen_hub = sen.hubs[0].clone(); sen.use_hub_credentials(); sen_hub.create_vault("DevOps").unwrap(); sen_hub.create_vault("Notes").unwrap(); @@ -206,7 +206,7 @@ fn taking_access_back() { assert!(!tmp.path().join("bob/DevOps").exists() && !tmp.path().join("bob/Notes").exists()); let said = check_in(&mut bob); assert!(said[0].contains("removed from the hub"), "{said:?}"); - assert!(bob.hub.is_none()); + assert!(bob.hubs.is_empty()); sen.use_hub_credentials(); let bob_handover = sen_hub.handovers().unwrap().into_iter().find(|h| h.person == "Bob" && h.state == "received").unwrap(); sen_hub.handover_decide(bob_handover.id, "discard").unwrap(); @@ -389,3 +389,160 @@ fn health_nudge_and_tidy() { assert!(!a.root.join(©).exists()); assert!(get("/api/canvas")["vaults"][0]["tidy"].as_array().unwrap().is_empty()); } + +fn lunehub(data: &std::path::Path, args: &[&str]) -> std::process::Output { + Command::new(env!("CARGO_BIN_EXE_lunehub")) + .args(args) + .env("LUNE_HUB_DATA", data) + .env("LUNE_RELEASE_PASSWORD", "test only") + .output() + .unwrap() +} + +#[test] +fn releases_are_signed_on_the_hub_and_old_clients_are_asked_to_update() { + use base64::Engine; + let _turn = SERIAL.lock().unwrap_or_else(|e| e.into_inner()); + let tmp = tempfile::TempDir::new().unwrap(); + let data = tmp.path().join("data"); + let (_hub, url, owner_link) = start_hub(&data); + + // The key is made on the hub; only the public half leaves it. + let made = lunehub(&data, &["release", "keygen"]); + assert!(made.status.success(), "{}", String::from_utf8_lossy(&made.stderr)); + let pubkey = String::from_utf8(made.stdout).unwrap().lines().last().unwrap().trim().to_string(); + assert!(!lunehub(&data, &["release", "keygen"]).status.success(), "a second key would orphan every app"); + + let update = tmp.path().join("Lune.app.tar.gz"); + let dmg = tmp.path().join("Lune.dmg"); + for v in ["0.1.0", "0.2.0", "0.3.0"] { + std::fs::write(&update, format!("app {v}")).unwrap(); + std::fs::write(&dmg, format!("dmg {v}")).unwrap(); + let out = lunehub(&data, &["release", "publish", v, update.to_str().unwrap(), dmg.to_str().unwrap(), "Notes"]); + assert!(out.status.success(), "{}", String::from_utf8_lossy(&out.stderr)); + } + let again = lunehub(&data, &["release", "publish", "0.2.5", update.to_str().unwrap(), dmg.to_str().unwrap()]); + assert!(!again.status.success(), "versions only go up"); + + // The updater's question: 0.2.0 gets 0.3.0, signed with the hub's key, version bound in the signature. + let agent = ureq::Agent::config_builder().http_status_as_error(false).build().new_agent(); + let mut res = agent.get(format!("{url}/api/update/darwin/aarch64/0.2.0")).call().unwrap(); + assert_eq!(res.status(), 200); + let offer: serde_json::Value = res.body_mut().read_json().unwrap(); + assert_eq!(offer["version"], "0.3.0"); + let bytes = agent.get(offer["url"].as_str().unwrap()).call().unwrap().body_mut().read_to_vec().unwrap(); + assert_eq!(bytes, b"app 0.3.0"); + let b64 = |s: &str| String::from_utf8(base64::engine::general_purpose::STANDARD.decode(s).unwrap()).unwrap(); + let pk = minisign::PublicKeyBox::from_string(&b64(&pubkey)).unwrap().into_public_key().unwrap(); + let sig = minisign::SignatureBox::from_string(&b64(offer["signature"].as_str().unwrap())).unwrap(); + assert!(sig.trusted_comment().unwrap().contains("\tversion:0.3.0")); + minisign::verify(&pk, &sig, std::io::Cursor::new(&bytes), true, false, false).unwrap(); + assert_eq!(agent.get(format!("{url}/api/update/darwin/aarch64/0.3.0")).call().unwrap().status(), 204); + let mut dl = agent.get(format!("{url}/download/mac")).call().unwrap(); + assert_eq!(dl.body_mut().read_to_vec().unwrap(), b"dmg 0.3.0"); + + // A second hub (a workplace) offers the same signed release without ever holding the key. + let work = tmp.path().join("work"); + std::fs::create_dir_all(&work).unwrap(); + let imported = lunehub(&work, &["release", "import", data.join("releases/0.3.0").to_str().unwrap()]); + assert!(imported.status.success(), "{}", String::from_utf8_lossy(&imported.stderr)); + assert!(!work.join("release/update.key").exists()); + assert_eq!(std::fs::read(work.join("releases/0.3.0/release.json")).unwrap(), std::fs::read(data.join("releases/0.3.0/release.json")).unwrap()); + + // 0.1.0 is two releases behind: it keeps its place on the team but can't sync until it updates. + remote::set_client_version("0.3.0"); + let (_, sen) = hub::join(&owner_link, "Codex").unwrap(); + let codex = as_device(&url, &sen); + let devops = codex.create_vault("DevOps").unwrap(); + let (cfg, _, _) = vault::add("DevOps", &tmp.path().join("codex"), &devops.git_url, "Codex").unwrap(); + let v = Vault::open(&cfg, "Codex").unwrap(); + remote::set_client_version("0.1.0"); + assert!(format!("{:#}", codex.me().unwrap_err()).contains(remote::TOO_OLD)); + std::fs::write(v.root.join("note.md"), "kept while outdated\n").unwrap(); + assert!(v.save_changes(None, &HashSet::new()).unwrap().is_some(), "saving locally goes on"); + assert_eq!(remote::describe_error(&v.sync().unwrap_err()), remote::TOO_OLD); + // One release behind still syncs. + remote::set_client_version("0.2.0"); + assert_eq!(codex.me().unwrap().vaults.len(), 1); + v.sync().unwrap(); + assert_eq!(v.waiting_files().unwrap(), 0); + remote::set_client_version(env!("CARGO_PKG_VERSION")); +} + +#[test] +fn one_device_on_two_hubs_keeps_the_teams_apart() { + let _turn = SERIAL.lock().unwrap_or_else(|e| e.into_inner()); + let tmp = tempfile::TempDir::new().unwrap(); + let (_own, own_url, own_link) = start_hub(&tmp.path().join("own")); + let (_work, work_url, work_link) = start_hub(&tmp.path().join("work")); + + // Sen's own hub, with a Notes vault and a second device to read it from. + let (_, sen_w) = hub::join(&own_link, "Mac").unwrap(); + let mut mac = device(&own_url, &sen_w, "Mac", &tmp.path().join("mac")); + mac.use_hub_credentials(); + mac.hubs[0].create_vault("Notes").unwrap(); + let code = mac.hubs[0].pair().unwrap(); + let hermes_w = hub::login(&own_url, &code, "Hermes").unwrap(); + let mut hermes = device(&own_url, &hermes_w, "Hermes", &tmp.path().join("hermes")); + + // The workplace hub (its owner is also called Sen by the test hub) has a Notes too; it invites Mov Sen. + let (_, boss_w) = hub::join(&work_link, "Boss pc").unwrap(); + let mut boss = device(&work_url, &boss_w, "Boss pc", &tmp.path().join("boss")); + boss.use_hub_credentials(); + boss.hubs[0].create_vault("Notes").unwrap(); + let invite = boss.hubs[0].invite("Mov Sen", &[("Notes".into(), "edit".into())]).unwrap(); + let (url, w) = hub::join(&invite, "Mac").unwrap(); + mac.hubs.push(HubLink { url, device_id: w.device_id, key: w.key }); + + // Both arrive, in separate folders, each tied to its own hub. + let said = check_in(&mut mac); + assert_eq!(mac.vaults.len(), 2, "{said:?}"); + let own_notes = mac.vaults.iter().find(|v| v.hub_url.as_deref() == Some(own_url.as_str())).unwrap().clone(); + let work_notes = mac.vaults.iter().find(|v| v.hub_url.as_deref() == Some(work_url.as_str())).unwrap().clone(); + assert_ne!(own_notes.path, work_notes.path); + mac.use_hub_credentials(); + let label = mac.device_label(); + let (a, b) = (Vault::open(&own_notes, &label).unwrap(), Vault::open(&work_notes, &label).unwrap()); + write_and_save(&a, "home.md", "mine\n"); + write_and_save(&b, "work.md", "the company's\n"); + a.sync().unwrap(); + b.sync().unwrap(); + + check_in(&mut hermes); + let h = open(&hermes, "Notes"); + h.sync().unwrap(); + assert!(h.root.join("home.md").exists() && !h.root.join("work.md").exists()); + check_in(&mut boss); + let bn = open(&boss, "Notes"); + bn.sync().unwrap(); + assert!(bn.root.join("work.md").exists() && !bn.root.join("home.md").exists()); + + // The workplace takes Sen's access back: only that folder leaves. + boss.use_hub_credentials(); + boss.hubs[0].remove("Mov Sen", "Notes", false).unwrap(); + check_in(&mut mac); + assert!(!work_notes.path.exists()); + assert_eq!(std::fs::read(own_notes.path.join("home.md")).unwrap(), b"mine\n"); + assert_eq!(mac.vaults.len(), 1); + let a = open(&mac, "Notes"); + write_and_save(&a, "home.md", "still mine\n"); + a.sync().unwrap(); +} + +#[test] +fn a_single_hub_config_from_before_moves_into_the_list() { + let tmp = tempfile::TempDir::new().unwrap(); + std::fs::write( + tmp.path().join("config.toml"), + "device_name = \"Mac\"\n\n[hub]\nurl = \"https://hub.example\"\ndevice_id = \"dev_1\"\nkey = \"k\"\n\n\ + [[vault]]\nname = \"Notes\"\npath = \"/tmp/notes\"\nremote = \"https://hub.example/git/1.git\"\nbranch = \"main\"\nhub_vault = 1\n", + ) + .unwrap(); + let _turn = SERIAL.lock().unwrap_or_else(|e| e.into_inner()); + unsafe { std::env::set_var("LUNE_HOME", tmp.path()) }; + let c = Config::load().unwrap(); + unsafe { std::env::remove_var("LUNE_HOME") }; + assert_eq!(c.hubs.len(), 1); + assert_eq!(c.vaults[0].hub_url.as_deref(), Some("https://hub.example")); + assert_eq!(c.hub_of(&c.vaults[0]).unwrap().device_id, "dev_1"); +} diff --git a/web/.gitignore b/web/.gitignore index b947077..32818e7 100644 --- a/web/.gitignore +++ b/web/.gitignore @@ -1,2 +1,3 @@ node_modules/ dist/ +dist-desktop/ diff --git a/web/desktop.html b/web/desktop.html new file mode 100644 index 0000000..5075fb6 --- /dev/null +++ b/web/desktop.html @@ -0,0 +1,12 @@ + + + + + +Lune + + +
+ + + diff --git a/web/package-lock.json b/web/package-lock.json index 4c7b848..ed4aa94 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -8,6 +8,7 @@ "name": "lune-canvas", "version": "0.1.0", "dependencies": { + "@tauri-apps/api": "2.12.4", "react": "18.3.1", "react-dom": "18.3.1" }, @@ -1109,6 +1110,16 @@ "win32" ] }, + "node_modules/@tauri-apps/api": { + "version": "2.12.4", + "resolved": "https://registry.npmjs.org/@tauri-apps/api/-/api-2.12.4.tgz", + "integrity": "sha512-pVmfis+4zT8H0Qhp3xPZx9Ju7kpzvA6rr/PSJPyuwfvucTQ8sVt61NYU9KMkK703UFlYadFmjKA4HhybOtN0gg==", + "license": "Apache-2.0 OR MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/tauri" + } + }, "node_modules/@types/babel__core": { "version": "7.20.5", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", diff --git a/web/package.json b/web/package.json index a592db6..008e476 100644 --- a/web/package.json +++ b/web/package.json @@ -6,9 +6,11 @@ "scripts": { "dev": "vite", "build": "tsc -b && vite build", - "check": "tsc -b" + "check": "tsc -b", + "build:desktop": "tsc -b && vite build --config vite.desktop.config.ts" }, "dependencies": { + "@tauri-apps/api": "2.12.4", "react": "18.3.1", "react-dom": "18.3.1" }, diff --git a/web/src/Canvas.tsx b/web/src/Canvas.tsx index f6f2cea..3cc9efc 100644 --- a/web/src/Canvas.tsx +++ b/web/src/Canvas.tsx @@ -3,6 +3,7 @@ // also has a button in the details panel (X3). import { useEffect, useMemo, useRef, useState } from 'react'; +import { MacSection } from './MacApp'; import { api, type CanvasData, type Comparison, type Health, type LogEntry, type Member, type Person, type Role, type Status, type Vault } from './api'; import { HANDLE_T, W, boardHeight, circle, easeBack, lerp, personColor, positions, ribbon, roundRect, vaultColor, @@ -668,6 +669,7 @@ function Overview({ data, members, log, open, close, newVault, signOut }: { )} +
Signed in as {data.me.person} diff --git a/web/src/MacApp.tsx b/web/src/MacApp.tsx new file mode 100644 index 0000000..311186e --- /dev/null +++ b/web/src/MacApp.tsx @@ -0,0 +1,58 @@ +// Getting the Mac app (M7): download it from this hub, then hand it the invite or a fresh pairing code through a +// lune:// link, so nobody copies a code by hand. +import { useEffect, useState } from 'react'; +import { api } from './api'; + +interface Release { version: string | null; mac: string | null } + +function useRelease() { + const [r, setR] = useState(null); + useEffect(() => { fetch('/api/release').then((x) => x.json()).then(setR).catch(() => setR({ version: null, mac: null })); }, []); + return r; +} + +const FIRST_OPEN = 'This pilot build isn’t signed by Apple yet: the first time, macOS may say it can’t check Lune. Open System Settings → Privacy & Security and choose Open Anyway.'; + +/** On an invite page: download, then join from the app with this link. */ +export function JoinWithApp({ link }: { link: string }) { + const r = useRelease(); + return ( + <> +
    +
  1. + {r?.mac ? Download Lune for Mac : The Mac app isn't published on this hub yet.} + {r?.mac && Open the download and drag Lune to Applications, then open it. {FIRST_OPEN}} +
  2. +
  3. + Open Lune to join + Lune asks for a name for this Mac and where shared vaults should go. This link works once. +
  4. +
+ + ); +} + +/** On the canvas: get the app, or connect a Mac that has it, without typing a code. */ +export function MacSection() { + const r = useRelease(); + const [error, setError] = useState(''); + const connect = async () => { + setError(''); + try { + const { code } = await api.pair(); + location.href = `lune://pair?hub=${encodeURIComponent(location.origin)}&code=${encodeURIComponent(code)}`; + } catch (e) { + setError((e as Error).message); + } + }; + return ( +
+

Lune for Mac{r?.version ? ` · ${r.version}` : ''}

+
+ {r?.mac && Get the Mac app} + +
+ {error &&

{error}

} +
+ ); +} diff --git a/web/src/api.ts b/web/src/api.ts index 6156d7d..98b1f1d 100644 --- a/web/src/api.ts +++ b/web/src/api.ts @@ -90,6 +90,7 @@ async function call(method: string, path: string, body?: unknown): Promise export const api = { canvas: () => call('GET', '/api/canvas'), log: (count = 8) => call('GET', `/api/log?count=${count}`), + pair: () => call<{ code: string }>('POST', '/api/pair'), signin: (code: string) => call('POST', '/api/web/signin', { code }), signout: () => call('POST', '/api/web/signout'), grant: (person: string, vault: string, role: Role) => call('POST', '/api/grants', { person, vault, role }), diff --git a/web/src/desktop/desktop.css b/web/src/desktop/desktop.css new file mode 100644 index 0000000..1327f30 --- /dev/null +++ b/web/src/desktop/desktop.css @@ -0,0 +1,48 @@ +/* The Lune window: same ink-on-lavender as the canvas, sized for a small menu-bar window. Status colours as X6. */ +:root { + --current: #2E8B5F; + --behind: #E09A2B; + --offline: #A9A5B6; + --secret: #C8323B; +} +body { background: var(--paper); user-select: none; -webkit-user-select: none; } +input, pre { user-select: text; -webkit-user-select: text; } +.app { min-height: 100vh; display: flex; flex-direction: column; gap: 14px; padding: 16px; } +.top { display: flex; align-items: center; gap: 10px; } +.top-text { display: flex; flex-direction: column; min-width: 0; } +.top-text b { font-size: 18px; } +.moon-small { width: 32px; height: 32px; } +.moon { width: 64px; height: 64px; align-self: center; } +.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; vertical-align: baseline; } +.dot-current { background: var(--current); } +.dot-behind { background: var(--behind); } +.dot-offline { background: var(--offline); } +.dot-secret { background: var(--secret); } +.banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--accent-soft); border: 1px solid var(--accent-tint); border-radius: 14px; padding: 8px 8px 8px 14px; font-size: 14px; } +.welcome { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 10px; } +.welcome h1 { margin: 0; font-size: 22px; line-height: 1.2; } +.welcome p { margin: 0; line-height: 1.5; } +.welcome label { font-weight: 700; font-size: 14px; margin-top: 4px; } +.folder-row { display: flex; align-items: center; gap: 8px; } +.folder { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: rtl; text-align: left; font-size: 14px; background: #F8F6FC; border: 1px solid #ECE8F5; border-radius: 10px; padding: 7px 10px; } +.vaults { display: flex; flex-direction: column; gap: 10px; } +.vault { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 12px; display: flex; flex-direction: column; gap: 10px; } +.vault-head { display: flex; align-items: center; gap: 10px; } +.vault-name { display: flex; flex-direction: column; flex: 1; min-width: 0; } +.vault-name .muted { overflow-wrap: anywhere; } +.need { background: #F8F6FC; border: 1px solid #ECE8F5; border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; } +.need-secret { background: #FBEDED; border-color: #F0CDCF; } +.need .lbl { font-size: 13px; font-weight: 700; margin-top: 4px; } +.need .field { font-size: 14px; padding: 8px 10px; } +.need .actions { margin-top: 2px; } +.center { text-align: center; padding: 24px 8px; } +.foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; } +.foot > .actions { justify-content: flex-start; } +.recent summary { cursor: pointer; font-size: 13px; color: var(--muted); } +.recent pre { font-size: 11px; line-height: 1.5; white-space: pre-wrap; color: var(--muted); max-height: 160px; overflow-y: auto; } +.cmp-body { max-height: 22vh; } +.dialog .actions { position: sticky; bottom: -24px; background: #FFFFFF; padding: 10px 0 2px; } +.team-tag { font-weight: 400; font-size: 12px; color: var(--muted); background: var(--accent-soft); border-radius: 999px; padding: 1px 8px; margin-left: 8px; } +.teams { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; } +.teams li { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 2px 4px 2px 12px; } +.toast-d { position: fixed; left: 16px; right: 16px; bottom: 16px; background: var(--ink); color: #FFFFFF; border-radius: 14px; padding: 10px 14px; font-size: 14px; box-shadow: 0 10px 30px rgba(34, 30, 51, 0.25); } diff --git a/web/src/desktop/main.tsx b/web/src/desktop/main.tsx new file mode 100644 index 0000000..6255b2d --- /dev/null +++ b/web/src/desktop/main.tsx @@ -0,0 +1,318 @@ +// The Lune window in the Mac app: connect this Mac, see each vault plainly, and make the few decisions only a person +// can (a held big change, a possible secret, a note changed in two places). Talks to the app, not to the hub. +import { StrictMode, useCallback, useEffect, useState } from 'react'; +import { createRoot } from 'react-dom/client'; +import { invoke } from '@tauri-apps/api/core'; +import '../styles.css'; +import './desktop.css'; +import moon from './moon.svg'; + +type Level = 'current' | 'behind' | 'offline' | 'secret'; + +interface VaultStatus { + name: string; + path: string; + team: string | null; + level: Level; + headline: string; + last_synced: number | null; + waiting: number; + read_only: boolean; + running: boolean; + held: { message: string; removed: number; rewritten: number; total: number }[]; + secrets: { path: string; found: string[] }[]; + tidy: { note: string; copy: string; label: string }[]; + case_clashes: string[]; +} + +interface Overview { + version: string; + connected: boolean; + teams: string[]; + device: string; + folder: string; + level: Level; + summary: string; + vaults: VaultStatus[]; + pending: { kind: 'join' | 'pair'; hub: string } | null; + update: string | null; + recent: string[]; +} + +interface Comparison { + note: string; + copy: string; + label: string; + copy_is_mine: boolean; + note_text: string | null; + copy_text: string | null; +} + +const host = (url: string | null) => (url ? url.replace(/^https?:\/\//, '') : ''); +const plural = (n: number, word: string) => `${n} ${word}${n === 1 ? '' : 's'}`; + +function Dot({ level }: { level: Level }) { + return