From ec363af8c4f668834ded1b8a727c88f6f2282539 Mon Sep 17 00:00:00 2001 From: Himanshu Neema Date: Sun, 3 Dec 2023 11:21:20 -0800 Subject: [PATCH] System Tray for Desktop Apps / Update depdendencies (#12) * depedency updates * updated dependencies * initial system tray * toggle window: hide or show from system tray * impl disconnect and quit from tray * Working System Tray * updates form macOS * cmd+q and cmd+w works on macOS --- Cargo.lock | 781 ++++++++++++------ upvpn-cli/Cargo.toml | 18 +- upvpn-cli/src/commands/error.rs | 2 +- upvpn-config/Cargo.toml | 14 +- upvpn-controller/Cargo.toml | 10 +- upvpn-daemon/Cargo.toml | 20 +- upvpn-entity/Cargo.toml | 2 +- upvpn-server/Cargo.toml | 12 +- upvpn-types/Cargo.toml | 10 +- upvpn-ui/src-tauri/Cargo.toml | 14 +- .../src-tauri/src/commands/vpn_session.rs | 11 +- upvpn-ui/src-tauri/src/event_forwarder.rs | 3 + upvpn-ui/src-tauri/src/main.rs | 31 +- upvpn-ui/src-tauri/src/state.rs | 34 +- upvpn-ui/src-tauri/src/system_tray.rs | 133 +++ upvpn-ui/src-tauri/tauri.conf.json | 3 + upvpn-ui/src/context/VpnStatusContext.tsx | 67 -- upvpn-ui/src/pages/SignIn.tsx | 2 +- 18 files changed, 777 insertions(+), 390 deletions(-) create mode 100644 upvpn-ui/src-tauri/src/system_tray.rs diff --git a/Cargo.lock b/Cargo.lock index 758eac0..301d1f3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -124,6 +124,12 @@ dependencies = [ "alloc-no-stdlib", ] +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + [[package]] name = "android_system_properties" version = "0.1.5" @@ -135,16 +141,15 @@ dependencies = [ [[package]] name = "anstream" -version = "0.3.2" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", - "is-terminal", "utf8parse", ] @@ -174,9 +179,9 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "1.0.1" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" dependencies = [ "anstyle", "windows-sys 0.48.0", @@ -303,7 +308,7 @@ dependencies = [ "polling", "rustix", "slab", - "socket2", + "socket2 0.4.9", "waker-fn", ] @@ -342,7 +347,7 @@ checksum = "0e97ce7de6cf12de5d7226c73f5ba9811622f4db3a5b91b55c53e987e5f91cba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.39", ] [[package]] @@ -391,7 +396,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.39", ] [[package]] @@ -402,13 +407,13 @@ checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae" [[package]] name = "async-trait" -version = "0.1.68" +version = "0.1.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" +checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.39", ] [[package]] @@ -446,11 +451,11 @@ dependencies = [ [[package]] name = "atomic" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b88d82667eca772c4aa12f0f1348b3ae643424c8876448f3f7bd5787032e234c" +checksum = "8d818003e740b63afc82337e3160717f4f63078720a810b7b903e70a5d1d2994" dependencies = [ - "autocfg", + "bytemuck", ] [[package]] @@ -873,18 +878,17 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.24" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ + "android-tzdata", "iana-time-zone", "js-sys", - "num-integer", "num-traits", "serde", - "time 0.1.45", "wasm-bindgen", - "winapi", + "windows-targets 0.48.0", ] [[package]] @@ -905,32 +909,30 @@ dependencies = [ "bitflags", "clap_derive 3.2.25", "clap_lex 0.2.4", - "indexmap", + "indexmap 1.9.3", "once_cell", "textwrap", ] [[package]] name = "clap" -version = "4.2.7" +version = "4.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34d21f9bf1b425d2968943631ec91202fe5e837264063503708b83013f8fc938" +checksum = "41fffed7514f420abec6d183b1d3acfd9099c79c3a10a06ade4f8203f1411272" dependencies = [ "clap_builder", - "clap_derive 4.2.0", - "once_cell", + "clap_derive 4.4.7", ] [[package]] name = "clap_builder" -version = "4.2.7" +version = "4.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "914c8c79fb560f238ef6429439a30023c862f7a28e688c58f7203f12b29970bd" +checksum = "63361bae7eef3771745f02d8d892bec2fee5f6e34af316ba556e7f97a7069ff1" dependencies = [ "anstream", "anstyle", - "bitflags", - "clap_lex 0.4.1", + "clap_lex 0.6.0", "strsim 0.10.0", ] @@ -949,14 +951,14 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.2.0" +version = "4.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9644cd56d6b87dbe899ef8b053e331c0637664e9e21a33dfcdc36093f5c5c4" +checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.39", ] [[package]] @@ -970,9 +972,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.4.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a2dd5a6fe8c6e3502f568a6353e5273bbb15193ad9a89e457b9970798efbea1" +checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" [[package]] name = "classic-mceliece-rust" @@ -1049,15 +1051,15 @@ dependencies = [ [[package]] name = "console" -version = "0.15.5" +version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d79fbe8970a77e3e34151cc13d3b3e248aa0faaecb9f6091fa07ebefe5ad60" +checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" dependencies = [ "encode_unicode", "lazy_static", "libc", "unicode-width", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] @@ -1211,12 +1213,12 @@ dependencies = [ [[package]] name = "ctor" -version = "0.1.26" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" +checksum = "37e366bff8cd32dd8754b0991fb66b279dc48f598c3a18914852a6673deef583" dependencies = [ "quote", - "syn 1.0.109", + "syn 2.0.39", ] [[package]] @@ -1316,7 +1318,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.10.0", - "syn 2.0.15", + "syn 2.0.39", ] [[package]] @@ -1349,7 +1351,7 @@ checksum = "29a358ff9f12ec09c3e61fef9b5a9902623a695a46a917b07f269bff1445611a" dependencies = [ "darling_core 0.20.1", "quote", - "syn 2.0.15", + "syn 2.0.39", ] [[package]] @@ -1453,14 +1455,15 @@ dependencies = [ [[package]] name = "dialoguer" -version = "0.10.4" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59c6f2989294b9a498d3ad5491a79c6deb604617378e1cdc4bfc1c1361fe2f87" +checksum = "658bce805d770f407bc62102fca7c2c64ceef2fbcb2b8bd19d2765ce093980de" dependencies = [ "console", "fuzzy-matcher", "shell-words", "tempfile", + "thiserror", "zeroize", ] @@ -1525,7 +1528,7 @@ checksum = "3ac133fba3e26a4f8e50d3ab6e3be55da4ae1df34a375d864100b0235bfcfab2" dependencies = [ "anyhow", "bumpalo", - "indexmap", + "indexmap 1.9.3", "rustc-hash", "serde", ] @@ -1716,9 +1719,15 @@ checksum = "5e9a1f9f7d83e59740248a6e14ecf93929ade55027844dfcea78beafccc15745" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.39", ] +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + [[package]] name = "err-context" version = "0.1.0" @@ -1826,14 +1835,14 @@ dependencies = [ [[package]] name = "figment" -version = "0.10.8" +version = "0.10.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e56602b469b2201400dec66a66aec5a9b8761ee97cd1b8c96ab2483fcc16cc9" +checksum = "649f3e5d826594057e9a519626304d8da859ea8a0b18ce99500c586b8d45faee" dependencies = [ "atomic", "pear", "serde", - "toml 0.5.11", + "toml 0.8.8", "uncased", "version_check", ] @@ -1932,9 +1941,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" dependencies = [ "futures-channel", "futures-core", @@ -1947,9 +1956,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" dependencies = [ "futures-core", "futures-sink", @@ -1957,15 +1966,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" [[package]] name = "futures-executor" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" dependencies = [ "futures-core", "futures-task", @@ -1985,9 +1994,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" [[package]] name = "futures-lite" @@ -2006,32 +2015,32 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.39", ] [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" dependencies = [ "futures-channel", "futures-core", @@ -2394,7 +2403,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap", + "indexmap 1.9.3", "slab", "tokio", "tokio-util", @@ -2419,6 +2428,12 @@ dependencies = [ "ahash 0.8.3", ] +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" + [[package]] name = "hashlink" version = "0.8.1" @@ -2504,7 +2519,21 @@ checksum = "e5c13fb08e5d4dfc151ee5e88bae63f7773d61852f3bdc73c9f4b9e1bde03148" dependencies = [ "log", "mac", - "markup5ever", + "markup5ever 0.10.1", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "html5ever" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bea68cab48b8459f17cf1c944c67ddc572d272d9f2b274140f223ecb1da4a3b7" +dependencies = [ + "log", + "mac", + "markup5ever 0.11.0", "proc-macro2", "quote", "syn 1.0.109", @@ -2552,9 +2581,9 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] name = "hyper" -version = "0.14.26" +version = "0.14.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" dependencies = [ "bytes", "futures-channel", @@ -2567,7 +2596,7 @@ dependencies = [ "httpdate", "itoa 1.0.6", "pin-project-lite", - "socket2", + "socket2 0.4.9", "tokio", "tower-service", "tracing", @@ -2659,6 +2688,16 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "idna" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + [[package]] name = "if_chain" version = "1.0.2" @@ -2707,23 +2746,35 @@ dependencies = [ "serde", ] +[[package]] +name = "indexmap" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +dependencies = [ + "equivalent", + "hashbrown 0.14.3", + "serde", +] + [[package]] name = "indicatif" -version = "0.17.3" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cef509aa9bc73864d6756f0d34d35504af3cf0844373afe9b8669a5b8005a729" +checksum = "fb28741c9db9a713d93deb3bb9515c20788cef5815265bee4980e87bde7e0f25" dependencies = [ "console", + "instant", "number_prefix", - "portable-atomic 0.3.20", + "portable-atomic", "unicode-width", ] [[package]] name = "infer" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a898e4b7951673fce96614ce5751d13c40fc5674bc2d759288e46c3ab62598b3" +checksum = "f551f8c3a39f68f986517db0d1759de85881894fdc7db798bd2a9df9cb04b7fc" dependencies = [ "cfb", ] @@ -2794,7 +2845,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd302af1b90f2463a98fa5ad469fc212c8e3175a41c3068601bfa2727591c5be" dependencies = [ - "socket2", + "socket2 0.4.9", "widestring 0.5.1", "winapi", "winreg 0.10.1", @@ -2971,9 +3022,9 @@ dependencies = [ [[package]] name = "json-patch" -version = "1.0.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f54898088ccb91df1b492cc80029a6fdf1c48ca0db7c6822a8babad69c94658" +checksum = "55ff1e1486799e3f64129f8ccad108b38290df9cd7015cd31bed17239f0789d6" dependencies = [ "serde", "serde_json", @@ -3008,7 +3059,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ea8e9c6e031377cff82ee3001dc8026cdf431ed4e2e6b51f98ab8c73484a358" dependencies = [ "cssparser", - "html5ever", + "html5ever 0.25.2", + "matches", + "selectors", +] + +[[package]] +name = "kuchikiki" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f29e4755b7b995046f510a7520c42b2fed58b77bd94d5a87a8eb43d2fd126da8" +dependencies = [ + "cssparser", + "html5ever 0.26.0", + "indexmap 1.9.3", "matches", "selectors", ] @@ -3101,11 +3165,35 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "libappindicator" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2d3cb96d092b4824cb306c9e544c856a4cb6210c1081945187f7f1924b47e8" +dependencies = [ + "glib", + "gtk", + "gtk-sys", + "libappindicator-sys", + "log", +] + +[[package]] +name = "libappindicator-sys" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1b3b6681973cea8cc3bce7391e6d7d5502720b80a581c9a95c9cbaf592826aa" +dependencies = [ + "gtk-sys", + "libloading", + "once_cell", +] + [[package]] name = "libc" -version = "0.2.144" +version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "libdbus-sys" @@ -3116,6 +3204,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 = "libsqlite3-sys" version = "0.24.2" @@ -3160,11 +3258,10 @@ dependencies = [ [[package]] name = "log" -version = "0.4.17" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" dependencies = [ - "cfg-if", "value-bag", ] @@ -3214,7 +3311,7 @@ dependencies = [ "dirs-next", "objc-foundation", "objc_id", - "time 0.3.15", + "time", ] [[package]] @@ -3234,7 +3331,21 @@ checksum = "a24f40fb03852d1cdd84330cddcaf98e9ec08a7b7768e952fad3b4cf048ec8fd" dependencies = [ "log", "phf 0.8.0", - "phf_codegen", + "phf_codegen 0.8.0", + "string_cache", + "string_cache_codegen", + "tendril", +] + +[[package]] +name = "markup5ever" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2629bb1404f3d34c2e921f21fd34ba00b206124c81f65c50b43b6aaefeb016" +dependencies = [ + "log", + "phf 0.10.1", + "phf_codegen 0.10.0", "string_cache", "string_cache_codegen", "tendril", @@ -3352,14 +3463,13 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.6" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" +checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" dependencies = [ "libc", - "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -3754,9 +3864,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.17.1" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "opaque-debug" @@ -3797,7 +3907,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.39", ] [[package]] @@ -4041,7 +4151,7 @@ dependencies = [ "proc-macro2", "proc-macro2-diagnostics", "quote", - "syn 2.0.15", + "syn 2.0.39", ] [[package]] @@ -4080,7 +4190,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.39", ] [[package]] @@ -4101,7 +4211,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" dependencies = [ "fixedbitset", - "indexmap", + "indexmap 1.9.3", ] [[package]] @@ -4135,9 +4245,17 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259" dependencies = [ - "phf_macros 0.10.0", "phf_shared 0.10.0", - "proc-macro-hack", +] + +[[package]] +name = "phf" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +dependencies = [ + "phf_macros 0.11.2", + "phf_shared 0.11.2", ] [[package]] @@ -4150,6 +4268,16 @@ dependencies = [ "phf_shared 0.8.0", ] +[[package]] +name = "phf_codegen" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb1c3a8bc4dd4e5cfce29b44ffc14bedd2ee294559a294e2a4d4c9e9a6a13cd" +dependencies = [ + "phf_generator 0.10.0", + "phf_shared 0.10.0", +] + [[package]] name = "phf_generator" version = "0.8.0" @@ -4170,6 +4298,16 @@ dependencies = [ "rand 0.8.5", ] +[[package]] +name = "phf_generator" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +dependencies = [ + "phf_shared 0.11.2", + "rand 0.8.5", +] + [[package]] name = "phf_macros" version = "0.8.0" @@ -4186,16 +4324,15 @@ dependencies = [ [[package]] name = "phf_macros" -version = "0.10.0" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58fdf3184dd560f160dd73922bea2d5cd6e8f064bf4b13110abd81b03697b4e0" +checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" dependencies = [ - "phf_generator 0.10.0", - "phf_shared 0.10.0", - "proc-macro-hack", + "phf_generator 0.11.2", + "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.39", ] [[package]] @@ -4216,6 +4353,15 @@ dependencies = [ "siphasher", ] +[[package]] +name = "phf_shared" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +dependencies = [ + "siphasher", +] + [[package]] name = "pin-project" version = "1.0.12" @@ -4238,9 +4384,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -4261,11 +4407,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bd9647b268a3d3e14ff09c23201133a62589c658db02bb7388c7246aafe0590" dependencies = [ "base64 0.21.0", - "indexmap", + "indexmap 1.9.3", "line-wrap", "quick-xml 0.28.2", "serde", - "time 0.3.15", + "time", ] [[package]] @@ -4331,15 +4477,6 @@ dependencies = [ "universal-hash", ] -[[package]] -name = "portable-atomic" -version = "0.3.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e30165d31df606f5726b090ec7592c308a0eaf61721ff64c9a3018e344a8753e" -dependencies = [ - "portable-atomic 1.3.2", -] - [[package]] name = "portable-atomic" version = "1.3.2" @@ -4394,7 +4531,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ "once_cell", - "toml_edit", + "toml_edit 0.19.8", ] [[package]] @@ -4429,9 +4566,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.56" +version = "1.0.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" dependencies = [ "unicode-ident", ] @@ -4444,7 +4581,7 @@ checksum = "606c4ba35817e2922a308af55ad51bab3645b59eae5c570d4a6cf07e36bd493b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.39", "version_check", "yansi", ] @@ -4549,9 +4686,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.27" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f4f29d145265ec1c483c7c654450edde0bfe043d3938d6972630663356d9500" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -4728,9 +4865,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.17" +version = "0.11.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13293b639a097af28fc8a90f22add145a9c954e49d77da06263d58cf44d5fb91" +checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" dependencies = [ "base64 0.21.0", "bytes", @@ -4753,6 +4890,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", + "system-configuration", "tokio", "tokio-native-tls", "tower-service", @@ -4760,7 +4898,7 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "winreg 0.10.1", + "winreg 0.50.0", ] [[package]] @@ -5063,7 +5201,7 @@ dependencies = [ "serde_json", "sqlx", "thiserror", - "time 0.3.15", + "time", "tracing", "url", "uuid 1.3.2", @@ -5126,7 +5264,7 @@ dependencies = [ "rust_decimal", "sea-query-derive", "serde_json", - "time 0.3.15", + "time", "uuid 1.3.2", ] @@ -5142,7 +5280,7 @@ dependencies = [ "sea-query", "serde_json", "sqlx", - "time 0.3.15", + "time", "uuid 1.3.2", ] @@ -5258,7 +5396,7 @@ dependencies = [ "log", "matches", "phf 0.8.0", - "phf_codegen", + "phf_codegen 0.8.0", "precomputed-hash", "servo_arc", "smallvec", @@ -5267,9 +5405,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.17" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" dependencies = [ "serde", ] @@ -5286,29 +5424,29 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.163" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2" +checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.163" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" +checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.39", ] [[package]] name = "serde_json" -version = "1.0.96" +version = "1.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" +checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" dependencies = [ "itoa 1.0.6", "ryu", @@ -5323,14 +5461,14 @@ checksum = "bcec881020c684085e55a25f7fd888954d56609ef363479dc5a1305eb0d40cab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.39", ] [[package]] name = "serde_spanned" -version = "0.6.1" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0efd8caf556a6cebd3b285caf480045fcc1ac04f6bd786b09a6f11af30c4fcf4" +checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" dependencies = [ "serde", ] @@ -5349,39 +5487,40 @@ dependencies = [ [[package]] name = "serde_with" -version = "2.3.3" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07ff71d2c147a7b57362cead5e22f772cd52f6ab31cfcd9edcd7f6aeb2a0afbe" +checksum = "64cd236ccc1b7a29e7e2739f27c0b2dd199804abc4290e32f59f3b68d6405c23" dependencies = [ - "base64 0.13.1", + "base64 0.21.0", "chrono", "hex", - "indexmap", + "indexmap 1.9.3", + "indexmap 2.1.0", "serde", "serde_json", "serde_with_macros", - "time 0.3.15", + "time", ] [[package]] name = "serde_with_macros" -version = "2.3.3" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" +checksum = "93634eb5f75a2323b16de4748022ac4297f9e76b6dced2be287a099f41b5e788" dependencies = [ "darling 0.20.1", "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.39", ] [[package]] name = "serde_yaml" -version = "0.9.21" +version = "0.9.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9d684e3ec7de3bf5466b32bd75303ac16f0736426e5a4e0d6e489559ce1249c" +checksum = "3cc7a1570e38322cfe4154732e5110f887ea57e22b76f4bfd32b5bdd3368666c" dependencies = [ - "indexmap", + "indexmap 2.1.0", "itoa 1.0.6", "ryu", "serde", @@ -5484,7 +5623,7 @@ dependencies = [ "serde_json", "serde_urlencoded", "shadowsocks-crypto", - "socket2", + "socket2 0.4.9", "thiserror", "tokio", "tokio-tfo", @@ -5536,7 +5675,7 @@ dependencies = [ "regex", "serde", "shadowsocks", - "socket2", + "socket2 0.4.9", "spin 0.9.8", "thiserror", "tokio", @@ -5645,6 +5784,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "socket2" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "soup2" version = "0.2.1" @@ -5734,7 +5883,7 @@ dependencies = [ "futures-util", "hashlink", "hex", - "indexmap", + "indexmap 1.9.3", "itoa 1.0.6", "libc", "libsqlite3-sys", @@ -5754,7 +5903,7 @@ dependencies = [ "sqlx-rt", "stringprep", "thiserror", - "time 0.3.15", + "time", "tokio-stream", "url", "uuid 1.3.2", @@ -6047,9 +6196,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.15" +version = "2.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" dependencies = [ "proc-macro2", "quote", @@ -6074,11 +6223,24 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "sys-locale" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8a11bd9c338fdba09f7881ab41551932ad42e405f61d01e8406baea71c07aee" +dependencies = [ + "js-sys", + "libc", + "wasm-bindgen", + "web-sys", + "windows-sys 0.45.0", +] + [[package]] name = "system-configuration" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75182f12f490e953596550b65ee31bda7c8e043d9386174b353bda50838c3fd" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ "bitflags", "core-foundation", @@ -6160,7 +6322,7 @@ dependencies = [ "rtnetlink", "shadowsocks-service", "shell-escape", - "socket2", + "socket2 0.4.9", "subslice", "system-configuration", "talpid-dbus", @@ -6221,7 +6383,7 @@ dependencies = [ "prost", "shadowsocks-service", "shell-escape", - "socket2", + "socket2 0.4.9", "talpid-routing", "talpid-tunnel", "talpid-types", @@ -6261,7 +6423,7 @@ dependencies = [ "netlink-packet-route", "netlink-sys", "rtnetlink", - "socket2", + "socket2 0.4.9", "talpid-types", "talpid-windows-net", "tokio", @@ -6341,7 +6503,7 @@ dependencies = [ "err-derive", "futures", "libc", - "socket2", + "socket2 0.4.9", "winapi", "windows-sys 0.45.0", ] @@ -6371,7 +6533,7 @@ dependencies = [ "parking_lot 0.12.1", "rand 0.8.5", "rtnetlink", - "socket2", + "socket2 0.4.9", "talpid-dbus", "talpid-routing", "talpid-tunnel", @@ -6399,6 +6561,7 @@ dependencies = [ "core-foundation", "core-graphics", "crossbeam-channel", + "dirs-next", "dispatch", "gdk", "gdk-pixbuf", @@ -6413,6 +6576,7 @@ dependencies = [ "instant", "jni 0.20.0", "lazy_static", + "libappindicator", "libc", "log", "ndk", @@ -6463,9 +6627,9 @@ checksum = "fd1ba337640d60c3e96bc6f0638a939b9c9a7f2c316a1598c279828b3d1dc8c5" [[package]] name = "tauri" -version = "1.3.0" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d42ba3a2e8556722f31336a0750c10dbb6a81396a1c452977f515da83f69f842" +checksum = "32d563b672acde8d0cc4c1b1f5b855976923f67e8d6fe1eba51df0211e197be2" dependencies = [ "anyhow", "cocoa", @@ -6496,6 +6660,7 @@ dependencies = [ "serde_repr", "serialize-to-javascript", "state", + "sys-locale", "tar", "tauri-macros", "tauri-runtime", @@ -6513,12 +6678,13 @@ dependencies = [ [[package]] name = "tauri-build" -version = "1.3.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "929b3bd1248afc07b63e33a6a53c3f82c32d0b0a5e216e4530e94c467e019389" +checksum = "defbfc551bd38ab997e5f8e458f87396d2559d05ce32095076ad6c30f7fc5f9c" dependencies = [ "anyhow", "cargo_toml", + "dirs-next", "heck 0.4.1", "json-patch", "semver", @@ -6526,14 +6692,14 @@ dependencies = [ "serde_json", "tauri-utils", "tauri-winres", - "winnow", + "walkdir", ] [[package]] name = "tauri-codegen" -version = "1.3.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5a2105f807c6f50b2fa2ce5abd62ef207bc6f14c9fcc6b8caec437f6fb13bde" +checksum = "7b3475e55acec0b4a50fb96435f19631fb58cbcd31923e1a213de5c382536bbb" dependencies = [ "base64 0.21.0", "brotli", @@ -6550,16 +6716,16 @@ dependencies = [ "sha2", "tauri-utils", "thiserror", - "time 0.3.15", + "time", "uuid 1.3.2", "walkdir", ] [[package]] name = "tauri-macros" -version = "1.3.0" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8784cfe6f5444097e93c69107d1ac5e8f13d02850efa8d8f2a40fe79674cef46" +checksum = "acea6445eececebd72ed7720cfcca46eee3b5bad8eb408be8f7ef2e3f7411500" dependencies = [ "heck 0.4.1", "proc-macro2", @@ -6581,7 +6747,7 @@ dependencies = [ "serde_json", "serde_repr", "tauri", - "time 0.3.15", + "time", ] [[package]] @@ -6600,9 +6766,9 @@ dependencies = [ [[package]] name = "tauri-runtime" -version = "0.13.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3b80ea3fcd5fefb60739a3b577b277e8fc30434538a2f5bba82ad7d4368c422" +checksum = "07f8e9e53e00e9f41212c115749e87d5cd2a9eebccafca77a19722eeecd56d43" dependencies = [ "gtk", "http", @@ -6621,9 +6787,9 @@ dependencies = [ [[package]] name = "tauri-runtime-wry" -version = "0.13.0" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1c396950b1ba06aee1b4ffe6c7cd305ff433ca0e30acbc5fa1a2f92a4ce70f1" +checksum = "803a01101bc611ba03e13329951a1bde44287a54234189b9024b78619c1bc206" dependencies = [ "cocoa", "gtk", @@ -6641,20 +6807,22 @@ dependencies = [ [[package]] name = "tauri-utils" -version = "1.3.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a6f9c2dafef5cbcf52926af57ce9561bd33bb41d7394f8bb849c0330260d864" +checksum = "a52165bb340e6f6a75f1f5eeeab1bb49f861c12abe3a176067d53642b5454986" dependencies = [ "brotli", "ctor", + "dunce", "glob", "heck 0.4.1", - "html5ever", + "html5ever 0.26.0", "infer", "json-patch", - "kuchiki", + "kuchikiki", + "log", "memchr", - "phf 0.10.1", + "phf 0.11.2", "proc-macro2", "quote", "semver", @@ -6664,7 +6832,7 @@ dependencies = [ "thiserror", "url", "walkdir", - "windows 0.39.0", + "windows-version", ] [[package]] @@ -6744,22 +6912,22 @@ checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c" [[package]] name = "thiserror" -version = "1.0.40" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.40" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.39", ] [[package]] @@ -6772,17 +6940,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "time" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" -dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi", -] - [[package]] name = "time" version = "0.3.15" @@ -6819,11 +6976,11 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.28.1" +version = "1.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0aa32867d44e6f2ce3385e89dceb990188b8bb0fb25b0cf576647a6f98ac5105" +checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" dependencies = [ - "autocfg", + "backtrace", "bytes", "libc", "mio", @@ -6831,7 +6988,7 @@ dependencies = [ "parking_lot 0.12.1", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.5.5", "tokio-macros", "windows-sys 0.48.0", ] @@ -6848,13 +7005,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.39", ] [[package]] @@ -6912,7 +7069,7 @@ dependencies = [ "log", "once_cell", "pin-project", - "socket2", + "socket2 0.4.9", "tokio", "winapi", ] @@ -6949,14 +7106,26 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit", + "toml_edit 0.19.8", +] + +[[package]] +name = "toml" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.21.0", ] [[package]] name = "toml_datetime" -version = "0.6.1" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ab8ed2edee10b50132aed5f331333428b011c99402b5a534154ed15746f9622" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" dependencies = [ "serde", ] @@ -6967,11 +7136,24 @@ version = "0.19.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "239410c8609e8125456927e6707163a3b1fdb40561e4b803bc041f466ccfdc13" dependencies = [ - "indexmap", + "indexmap 1.9.3", "serde", "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.4.1", +] + +[[package]] +name = "toml_edit" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" +dependencies = [ + "indexmap 2.1.0", + "serde", + "serde_spanned", + "toml_datetime", + "winnow 0.5.19", ] [[package]] @@ -7072,7 +7254,7 @@ checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" dependencies = [ "futures-core", "futures-util", - "indexmap", + "indexmap 1.9.3", "pin-project", "pin-project-lite", "rand 0.8.5", @@ -7098,11 +7280,10 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "log", "pin-project-lite", "tracing-attributes", @@ -7111,31 +7292,32 @@ dependencies = [ [[package]] name = "tracing-appender" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d48f71a791638519505cefafe162606f706c25592e4bde4d97600c0195312e" +checksum = "3566e8ce28cc0a3fe42519fc80e6b4c943cc4c8cef275620eb8dac2d3d4e06cf" dependencies = [ "crossbeam-channel", - "time 0.3.15", + "thiserror", + "time", "tracing-subscriber", ] [[package]] name = "tracing-attributes" -version = "0.1.24" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.39", ] [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", "valuable", @@ -7153,20 +7335,20 @@ dependencies = [ [[package]] name = "tracing-log" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" dependencies = [ - "lazy_static", "log", + "once_cell", "tracing-core", ] [[package]] name = "tracing-subscriber" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ "matchers", "nu-ansi-term", @@ -7219,7 +7401,7 @@ dependencies = [ "radix_trie", "rand 0.8.5", "thiserror", - "time 0.3.15", + "time", "tokio", "tracing", "trust-dns-proto", @@ -7286,7 +7468,7 @@ dependencies = [ "futures-util", "serde", "thiserror", - "time 0.3.15", + "time", "tokio", "toml 0.5.11", "tracing", @@ -7485,7 +7667,7 @@ name = "upvpn-cli" version = "0.1.0" dependencies = [ "async-trait", - "clap 4.2.7", + "clap 4.4.10", "console", "dialoguer", "indicatif", @@ -7507,7 +7689,7 @@ dependencies = [ "serde", "thiserror", "tokio", - "toml 0.7.3", + "toml 0.8.8", ] [[package]] @@ -7536,7 +7718,7 @@ dependencies = [ "async-trait", "backoff", "chrono", - "clap 4.2.7", + "clap 4.4.10", "futures", "futures-channel", "hyper", @@ -7699,11 +7881,11 @@ dependencies = [ [[package]] name = "validator" -version = "0.16.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32ad5bf234c7d3ad1042e5252b7eddb2c4669ee23f32c7dd0e9b7705f07ef591" +checksum = "b92f40481c04ff1f4f61f304d61793c7b56ff76ac1469f1beb199b1445b253bd" dependencies = [ - "idna 0.2.3", + "idna 0.4.0", "lazy_static", "regex", "serde", @@ -7747,13 +7929,9 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "value-bag" -version = "1.0.0-alpha.9" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2209b78d1249f7e6f3293657c9779fe31ced465df091bbd433a1cf88e916ec55" -dependencies = [ - "ctor", - "version_check", -] +checksum = "4a72e1902dde2bd6441347de2b70b7f5d59bf157c6c62f0c44572607a1d55bbe" [[package]] name = "vcpkg" @@ -7837,12 +8015,6 @@ version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -7870,7 +8042,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.39", "wasm-bindgen-shared", ] @@ -7904,7 +8076,7 @@ checksum = "4783ce29f09b9d93134d41297aded3a712b7b979e9c6f28c32cb88c973a94869" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.39", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -8219,12 +8391,36 @@ dependencies = [ "windows_x86_64_msvc 0.48.0", ] +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", +] + [[package]] name = "windows-tokens" version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f838de2fe15fe6bac988e74b798f26499a8b21a9d97edec321e79b28d1d7f597" +[[package]] +name = "windows-version" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75aa004c988e080ad34aff5739c39d0312f4684699d6d71fc8a198d057b8b9b4" +dependencies = [ + "windows-targets 0.52.0", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.42.2" @@ -8237,6 +8433,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + [[package]] name = "windows_aarch64_msvc" version = "0.37.0" @@ -8261,6 +8463,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + [[package]] name = "windows_i686_gnu" version = "0.37.0" @@ -8285,6 +8493,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + [[package]] name = "windows_i686_msvc" version = "0.37.0" @@ -8309,6 +8523,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + [[package]] name = "windows_x86_64_gnu" version = "0.37.0" @@ -8333,6 +8553,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" @@ -8345,6 +8571,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + [[package]] name = "windows_x86_64_msvc" version = "0.37.0" @@ -8369,6 +8601,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + [[package]] name = "winnow" version = "0.4.1" @@ -8378,6 +8616,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "winnow" +version = "0.5.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b" +dependencies = [ + "memchr", +] + [[package]] name = "winreg" version = "0.7.0" @@ -8406,11 +8653,21 @@ dependencies = [ "winapi", ] +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + [[package]] name = "wry" -version = "0.24.3" +version = "0.24.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33748f35413c8a98d45f7a08832d848c0c5915501803d1faade5a4ebcd258cea" +checksum = "64a70547e8f9d85da0f5af609143f7bde3ac7457a6e1073104d9b73d6c5ac744" dependencies = [ "base64 0.13.1", "block", @@ -8422,7 +8679,7 @@ dependencies = [ "gio", "glib", "gtk", - "html5ever", + "html5ever 0.25.2", "http", "kuchiki", "libc", @@ -8552,7 +8809,7 @@ dependencies = [ "quote", "regex", "syn 1.0.109", - "winnow", + "winnow 0.4.1", "zvariant_utils", ] @@ -8584,7 +8841,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.39", ] [[package]] diff --git a/upvpn-cli/Cargo.toml b/upvpn-cli/Cargo.toml index 4ca7412..8e746ed 100644 --- a/upvpn-cli/Cargo.toml +++ b/upvpn-cli/Cargo.toml @@ -14,15 +14,15 @@ name = "upvpn" path = "src/main.rs" [dependencies] -async-trait = "0.1.68" -clap = { version = "4.2.3", features = ["derive"] } -tokio = { version = "1.27.0", features = ["rt-multi-thread", "macros", "signal"] } -validator = { version = "0.16.0", features = ["derive"] } +async-trait = "0.1.74" +clap = { version = "4.4", features = ["derive"] } +tokio = { version = "1.34", features = ["rt-multi-thread", "macros", "signal"] } +validator = { version = "0.16.1", features = ["derive"] } upvpn-controller = {path = "../upvpn-controller"} upvpn-types = {path = "../upvpn-types"} -thiserror = "1.0.40" +thiserror = "1.0" tonic = "0.9.2" -dialoguer = { version = "0.10.4", features = ["fuzzy-select"] } -indicatif = "0.17.3" -tokio-stream = { version = "0.1.12", features = ["sync"] } -console = "0.15.5" +dialoguer = { version = "0.11.0", features = ["fuzzy-select"] } +indicatif = "0.17.7" +tokio-stream = { version = "0.1.14", features = ["sync"] } +console = "0.15.7" diff --git a/upvpn-cli/src/commands/error.rs b/upvpn-cli/src/commands/error.rs index 3d7dec9..7bb30dc 100644 --- a/upvpn-cli/src/commands/error.rs +++ b/upvpn-cli/src/commands/error.rs @@ -7,7 +7,7 @@ pub enum CliError { #[error("{}", .0.message())] Grpc(#[from] Status), #[error("{0}")] - Io(#[from] std::io::Error), + Io(#[from] dialoguer::Error), #[error("{0}")] InvalidArgument(String), } diff --git a/upvpn-config/Cargo.toml b/upvpn-config/Cargo.toml index 38c7e61..63c89fd 100644 --- a/upvpn-config/Cargo.toml +++ b/upvpn-config/Cargo.toml @@ -9,12 +9,12 @@ homepage = "https://upvpn.app" repository = "https://github.com/upvpn/upvpn-app" [dependencies] -figment = { version = "0.10.8", features = ["env", "toml"] } -once_cell = "1.17.1" -serde = { version = "1.0.160", features = ["derive"] } -thiserror = "1.0.40" -tokio = { version = "1.27.0", features = ["fs"] } +figment = { version = "0.10.12", features = ["env", "toml"] } +once_cell = "1.18.0" +serde = { version = "1.0", features = ["derive"] } +thiserror = "1.0" +tokio = { version = "1.34", features = ["fs"] } [build-dependencies] -toml = "0.7.3" -serde = "1.0.160" +toml = "0.8.8" +serde = "1.0" diff --git a/upvpn-controller/Cargo.toml b/upvpn-controller/Cargo.toml index 65fcb72..df1ae3a 100644 --- a/upvpn-controller/Cargo.toml +++ b/upvpn-controller/Cargo.toml @@ -9,18 +9,18 @@ homepage = "https://upvpn.app" repository = "https://github.com/upvpn/upvpn-app" [dependencies] -futures = "0.3.28" -hyper = "0.14.26" +futures = "0.3.29" +hyper = "0.14.27" parity-tokio-ipc = "0.9.0" prost = "0.11.9" prost-types = "0.11.9" -thiserror = "1.0.40" -tokio = "1.27.0" +thiserror = "1.0" +tokio = "1.34" tonic = "0.9.2" tower = "0.4.13" upvpn-config = { path = "../upvpn-config" } upvpn-types = {path = "../upvpn-types"} # grpc types to upvpn-types conversions -chrono = { version = "0.4.24", features = ["serde"] } +chrono = { version = "0.4.31", features = ["serde"] } [build-dependencies] tonic-build = "0.9.2" diff --git a/upvpn-daemon/Cargo.toml b/upvpn-daemon/Cargo.toml index 39f1735..2f44afb 100644 --- a/upvpn-daemon/Cargo.toml +++ b/upvpn-daemon/Cargo.toml @@ -9,18 +9,18 @@ homepage = "https://upvpn.app" repository = "https://github.com/upvpn/upvpn-app" [dependencies] -clap = "4.2.7" -async-trait = "0.1.68" -futures = "0.3.28" -hyper = "0.14.26" -thiserror = "1.0.40" -tokio = { version = "1.27.0", features = ["rt-multi-thread", "signal", "macros", "sync", "fs"] } +clap = "4.4.10" +async-trait = "0.1.74" +futures = "0.3.29" +hyper = "0.14.27" +thiserror = "1.0" +tokio = { version = "1.34", features = ["rt-multi-thread", "signal", "macros", "sync", "fs"] } tokio-stream = { version = "0.1.12", features = ["sync"] } tonic = "0.9.2" tower = "0.4.13" -tracing = "0.1.37" -tracing-appender = "0.2.2" -tracing-subscriber = { version = "0.3.16", features = ["default", "env-filter", "tracing-log"] } +tracing = "0.1.40" +tracing-appender = "0.2.3" +tracing-subscriber = { version = "0.3.18", features = ["default", "env-filter", "tracing-log"] } upvpn-config = {path = "../upvpn-config"} upvpn-controller = {path = "../upvpn-controller"} upvpn-server = {path = "../upvpn-server"} @@ -28,7 +28,7 @@ upvpn-types = {path = "../upvpn-types"} upvpn-entity = {path = "../upvpn-entity"} upvpn-migration = {path = "../upvpn-migration"} sea-orm = { version = "0.11.2", features = ["sqlx-sqlite", "runtime-tokio-rustls"] } -chrono = "0.4.24" +chrono = "0.4.31" talpid-core = {git = "ssh://git@github.com/upvpn/mullvadvpn-app.git", rev = "2023.3.upvpn"} talpid-types = {git = "ssh://git@github.com/upvpn/mullvadvpn-app.git", rev = "2023.3.upvpn"} talpid-platform-metadata = {git = "ssh://git@github.com/upvpn/mullvadvpn-app.git", rev = "2023.3.upvpn"} diff --git a/upvpn-entity/Cargo.toml b/upvpn-entity/Cargo.toml index 50b0ad0..5a8254e 100644 --- a/upvpn-entity/Cargo.toml +++ b/upvpn-entity/Cargo.toml @@ -26,4 +26,4 @@ features = [ [dependencies] upvpn-types = {path = "../upvpn-types"} uuid = { version = "1.3.1", features = ["v4", "serde"] } -serde_json = "1.0.96" +serde_json = "1.0" diff --git a/upvpn-server/Cargo.toml b/upvpn-server/Cargo.toml index b11c9e2..3b0f58b 100644 --- a/upvpn-server/Cargo.toml +++ b/upvpn-server/Cargo.toml @@ -9,11 +9,11 @@ homepage = "https://upvpn.app" repository = "https://github.com/upvpn/upvpn-app" [dependencies] -futures = "0.3.28" -hyper = "0.14.26" +futures = "0.3.29" +hyper = "0.14.27" prost = "0.11.9" -serde = { version = "1.0.160", features = ["derive"] } -thiserror = "1.0.40" +serde = { version = "1.0", features = ["derive"] } +thiserror = "1.0" # todo: handle certs: remove dependency on tls-roots tonic = { version = "0.9.2", features = ["tls", "tls-roots"] } tower = "0.4.13" @@ -22,7 +22,7 @@ upvpn-types = {path = "../upvpn-types"} talpid-types = {git = "ssh://git@github.com/upvpn/mullvadvpn-app.git", rev = "2023.3.upvpn"} uuid = { version = "1.3.1", features = ["serde", "v4"] } # todo: use rustls? instead of OS TLS -reqwest = { version = "0.11.16", features = ["json"] } +reqwest = { version = "0.11.22", features = ["json"] } ipnetwork = "0.20.0" backoff = { version = "0.4.0", features = ["tokio"] } @@ -30,4 +30,4 @@ backoff = { version = "0.4.0", features = ["tokio"] } tonic-build = "0.9.2" [dev-dependencies] -tokio = "1.27.0" +tokio = "1.34" diff --git a/upvpn-types/Cargo.toml b/upvpn-types/Cargo.toml index 75a92eb..7edc3fc 100644 --- a/upvpn-types/Cargo.toml +++ b/upvpn-types/Cargo.toml @@ -9,14 +9,14 @@ homepage = "https://upvpn.app" repository = "https://github.com/upvpn/upvpn-app" [dependencies] -tokio = "1.27.0" +tokio = "1.34" upvpn-config = {path="../upvpn-config"} talpid-types = {git = "ssh://git@github.com/upvpn/mullvadvpn-app.git", rev = "2023.3.upvpn"} -serde = { version = "1.0.160", features = ["derive"] } +serde = { version = "1.0", features = ["derive"] } ipnetwork = "0.20.0" -chrono = { version = "0.4.24", features = ["serde"] } +chrono = { version = "0.4.31", features = ["serde"] } uuid = { version = "1.3.1", features = ["serde", "v4"] } -thiserror = "1.0.40" -serde_yaml = "0.9.21" +thiserror = "1.0" +serde_yaml = "0.9" ts-rs = { git = "https://github.com/Aleph-Alpha/ts-rs", rev = "b4ba8b81fd8833296e99285eae7608864c52e51e", features = ["serde-compat", "chrono-impl", "uuid-impl", "format"] } diff --git a/upvpn-ui/src-tauri/Cargo.toml b/upvpn-ui/src-tauri/Cargo.toml index 2f85f14..286a87a 100644 --- a/upvpn-ui/src-tauri/Cargo.toml +++ b/upvpn-ui/src-tauri/Cargo.toml @@ -11,24 +11,24 @@ homepage = "https://upvpn.app" repository = "https://github.com/upvpn/upvpn-app" [build-dependencies] -tauri-build = { version = "1.2", features = [] } +tauri-build = { version = "1.5.0", features = [] } [dependencies] serde_json = "1.0" serde = { version = "1.0", features = ["derive"] } -tauri = { version = "1.3.0", features = ["clipboard-all", "fs-all", "notification-all", "os-all", "shell-open", "window-all"] } +tauri = { version = "1.5.3", features = ["clipboard-all", "fs-all", "notification-all", "os-all", "shell-open", "system-tray", "window-all"] } upvpn-controller = {path = "../../upvpn-controller"} upvpn-types = {path = "../../upvpn-types"} upvpn-config = {path = "../../upvpn-config"} -tokio-stream = "0.1.12" +tokio-stream = "0.1.14" tauri-plugin-log = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "dev" } tauri-plugin-single-instance = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "dev" } log = "^0.4" -tokio = { version = "1.27.0", features = ["time"] } -futures = "0.3.28" -thiserror = "1.0.40" +tokio = { version = "1.34", features = ["time"] } +futures = "0.3.29" +thiserror = "1.0" tonic = "0.9.2" -semver = "1.0.17" +semver = "1.0.20" [features] # by default Tauri runs in production mode diff --git a/upvpn-ui/src-tauri/src/commands/vpn_session.rs b/upvpn-ui/src-tauri/src/commands/vpn_session.rs index 8b38892..35d9d76 100644 --- a/upvpn-ui/src-tauri/src/commands/vpn_session.rs +++ b/upvpn-ui/src-tauri/src/commands/vpn_session.rs @@ -1,6 +1,7 @@ +use tauri::AppHandle; use upvpn_types::{location::Location, vpn_session::VpnStatus}; -use crate::error::Error; +use crate::{error::Error, state::update_app_state}; #[tauri::command] pub async fn connect(location: Location) -> Result { @@ -25,10 +26,14 @@ pub async fn disconnect() -> Result { } #[tauri::command] -pub async fn get_vpn_status() -> Result { +pub async fn get_vpn_status(app_handle: AppHandle) -> Result { let mut client = upvpn_controller::new_grpc_client() .await .map_err(|_| Error::DaemonIsOffline)?; - Ok(client.get_vpn_status(()).await?.into_inner().into()) + let vpn_status: VpnStatus = client.get_vpn_status(()).await?.into_inner().into(); + + update_app_state(app_handle, vpn_status.clone()).await; + + Ok(vpn_status) } diff --git a/upvpn-ui/src-tauri/src/event_forwarder.rs b/upvpn-ui/src-tauri/src/event_forwarder.rs index 221f9a0..c35358f 100644 --- a/upvpn-ui/src-tauri/src/event_forwarder.rs +++ b/upvpn-ui/src-tauri/src/event_forwarder.rs @@ -6,6 +6,8 @@ use tokio::sync::oneshot; use tokio_stream::StreamExt; use upvpn_types::notification::Notification; +use crate::state::update_app_state; + #[derive(Debug)] pub struct EventForwarderHandler { _shutdown_tx: oneshot::Sender<()>, @@ -49,6 +51,7 @@ impl EventForwarder { match event { upvpn_controller::proto::daemon_event::Event::VpnStatus(vpn_status) => { let vpn_status: upvpn_types::vpn_session::VpnStatus = vpn_status.into(); + update_app_state(app_handle.clone(), vpn_status.clone()).await; let _ = app_handle.emit_all("vpn_status", vpn_status); }, upvpn_controller::proto::daemon_event::Event::Notification(notification) => { diff --git a/upvpn-ui/src-tauri/src/main.rs b/upvpn-ui/src-tauri/src/main.rs index 41bac67..e02c372 100644 --- a/upvpn-ui/src-tauri/src/main.rs +++ b/upvpn-ui/src-tauri/src/main.rs @@ -7,6 +7,7 @@ mod commands; mod error; mod event_forwarder; mod state; +mod system_tray; use commands::auth::{is_signed_in, sign_in, sign_out}; use commands::desktop_notification::send_desktop_notification; @@ -17,6 +18,8 @@ use commands::version::{current_app_version, update_available}; use commands::vpn_session::{connect, disconnect, get_vpn_status}; use log::LevelFilter; use state::AppState; +use system_tray::{create_default_system_tray, handle_system_tray_event, toggle_window_visibility}; +use tauri::Manager; use tauri_plugin_log::LogTarget; use upvpn_config::config; @@ -32,18 +35,22 @@ fn main() { #[cfg(target_os = "macos")] { + use tauri::CustomMenuItem; use tauri::Menu; use tauri::MenuItem; use tauri::Submenu; + + let quit_item = CustomMenuItem::new("macos_quit", "Quit").accelerator("Cmd+Q"); let menu = Menu::new().add_submenu(Submenu::new( - "upvpn", + "UpVPN", Menu::new() .add_native_item(MenuItem::Copy) .add_native_item(MenuItem::Paste) .add_native_item(MenuItem::SelectAll) .add_native_item(MenuItem::Cut) .add_native_item(MenuItem::Separator) - .add_native_item(MenuItem::CloseWindow), + .add_native_item(MenuItem::CloseWindow) + .add_item(quit_item), )); builder = builder.menu(menu); } @@ -76,6 +83,26 @@ fn main() { .build(), ) .plugin(tauri_plugin_single_instance::init(|_, _, _| {})) + .system_tray(create_default_system_tray()) + .on_system_tray_event(handle_system_tray_event) + .on_window_event(|event| { + match event.event() { + // Run frontend in the background + tauri::WindowEvent::CloseRequested { api, .. } => { + api.prevent_close(); + let app_handle = event.window().app_handle(); + toggle_window_visibility(app_handle); + } + _ => {} + } + }) + .on_menu_event(|event| match event.menu_item_id() { + "macos_quit" => { + let _ = tauri::async_runtime::block_on(commands::vpn_session::disconnect()); + event.window().app_handle().exit(0); + } + _ => {} + }) .setup(|_app| Ok(())) .run(tauri::generate_context!()) .expect("error while running tauri application"); diff --git a/upvpn-ui/src-tauri/src/state.rs b/upvpn-ui/src-tauri/src/state.rs index 89a1417..a4215f3 100644 --- a/upvpn-ui/src-tauri/src/state.rs +++ b/upvpn-ui/src-tauri/src/state.rs @@ -1,16 +1,29 @@ use std::sync::Arc; -use tauri::AppHandle; -use upvpn_types::location::Location; +use tauri::{AppHandle, Manager}; +use upvpn_types::{location::Location, vpn_session::VpnStatus}; -use crate::event_forwarder::EventForwarderHandler; +use crate::{event_forwarder::EventForwarderHandler, system_tray::update_system_tray}; pub type AppState = Arc>; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct UiState { pub event_fwd_handler: Option, pub locations: Vec, + pub vpn_status: Option, + pub window_visible: bool, +} + +impl Default for UiState { + fn default() -> Self { + Self { + event_fwd_handler: Default::default(), + locations: Default::default(), + vpn_status: None, + window_visible: true, + } + } } impl UiState { @@ -29,3 +42,16 @@ impl UiState { } } } + +pub async fn update_app_state(app_handle: AppHandle, vpn_status: VpnStatus) { + { + // block so that guard is dropped, and lock can be taken again + let state: tauri::State<'_, AppState> = app_handle.state(); + let new_vpn_status = vpn_status.clone(); + + let mut state = state.lock().await; + state.vpn_status = Some(new_vpn_status); + } + + update_system_tray(app_handle.clone()).await; +} diff --git a/upvpn-ui/src-tauri/src/system_tray.rs b/upvpn-ui/src-tauri/src/system_tray.rs new file mode 100644 index 0000000..f271f46 --- /dev/null +++ b/upvpn-ui/src-tauri/src/system_tray.rs @@ -0,0 +1,133 @@ +use tauri::{ + AppHandle, CustomMenuItem, Manager, SystemTray, SystemTrayEvent, SystemTrayMenu, + SystemTrayMenuItem, +}; +use upvpn_types::vpn_session::VpnStatus; + +use crate::{commands, state::AppState}; + +fn create_default_system_tray_menu(window_visible: bool) -> SystemTrayMenu { + let quit = CustomMenuItem::new("quit".to_string(), "Quit"); + let hide_or_show_title = if window_visible { "Hide" } else { "Show" }; + let hide_or_show = CustomMenuItem::new("hide_or_show".to_string(), hide_or_show_title); + SystemTrayMenu::new().add_item(hide_or_show).add_item(quit) +} + +pub fn create_default_system_tray() -> SystemTray { + SystemTray::new() + .with_id("upvpn") + .with_menu(create_default_system_tray_menu(true)) +} + +pub fn toggle_window_visibility(app_handle: AppHandle) { + let window = app_handle.get_window("main").unwrap(); + let item_handle = app_handle.tray_handle().try_get_item("hide_or_show"); + let state: tauri::State<'_, AppState> = app_handle.state(); + + tauri::async_runtime::block_on(async move { + let mut state = state.lock().await; + let new_window_visible = !state.window_visible; + state.window_visible = new_window_visible; + + let new_title = match new_window_visible { + true => { + window.show().unwrap(); + "Hide" + } + false => { + window.hide().unwrap(); + "Show" + } + }; + + if let Some(item_handle) = item_handle { + item_handle.set_title(new_title).unwrap(); + } + }) +} + +pub fn handle_system_tray_event(app: &AppHandle, event: SystemTrayEvent) { + match event { + SystemTrayEvent::MenuItemClick { id, .. } => match id.as_str() { + "hide_or_show" => { + toggle_window_visibility(app.app_handle()); + } + "disconnect" => { + let _ = tauri::async_runtime::block_on(commands::vpn_session::disconnect()); + } + "quit" => { + let _ = tauri::async_runtime::block_on(commands::vpn_session::disconnect()); + app.exit(0) + } + _ => {} + }, + _ => {} + } +} + +fn get_vpn_status_title(vpn_status: &VpnStatus) -> String { + match vpn_status { + VpnStatus::Accepted(location) => format!("Accepted, {}", location.city), + VpnStatus::ServerCreated(location) => format!("Server Created, {}", location.city), + VpnStatus::ServerRunning(location) => format!("Server Running, {}", location.city), + VpnStatus::ServerReady(location) => format!("Server Ready, {}", location.city), + VpnStatus::Connecting(location) => format!("Connecting, {}", location.city), + VpnStatus::Connected(location, _) => format!("Connected, {}", location.city), + VpnStatus::Disconnecting(location) => format!("Disconnecting, {}", location.city), + VpnStatus::Disconnected => format!("Disconnected"), + } +} + +fn show_disconnect(vpn_status: &VpnStatus) -> bool { + match vpn_status { + VpnStatus::Accepted(_) + | VpnStatus::ServerCreated(_) + | VpnStatus::ServerRunning(_) + | VpnStatus::ServerReady(_) + | VpnStatus::Connecting(_) + | VpnStatus::Connected(_, _) => true, + VpnStatus::Disconnecting(_) | VpnStatus::Disconnected => false, + } +} + +fn create_system_tray_menu_internal( + vpn_status: &VpnStatus, + window_visible: bool, +) -> SystemTrayMenu { + let mut tray_menu = SystemTrayMenu::new() + .add_item(CustomMenuItem::new("vpn_status", get_vpn_status_title(vpn_status)).disabled()); + + if show_disconnect(vpn_status) { + tray_menu = tray_menu.add_item(CustomMenuItem::new("disconnect", "Disconnect")); + } + + let quit = CustomMenuItem::new("quit".to_string(), "Quit"); + + let hide_or_show_title = if window_visible { "Hide" } else { "Show" }; + + let hide_or_show = CustomMenuItem::new("hide_or_show".to_string(), hide_or_show_title); + + tray_menu = tray_menu + .add_native_item(SystemTrayMenuItem::Separator) + .add_item(hide_or_show) + .add_item(quit); + + tray_menu +} + +fn create_system_tray_menu(vpn_status: &Option, window_visible: bool) -> SystemTrayMenu { + if let Some(vpn_status) = vpn_status { + create_system_tray_menu_internal(vpn_status, window_visible) + } else { + create_default_system_tray_menu(window_visible) + } +} + +pub async fn update_system_tray(app_handle: AppHandle) { + tauri::async_runtime::spawn(async move { + let state: tauri::State<'_, AppState> = app_handle.state(); + let state = state.lock().await; + let new_system_tray_menu = create_system_tray_menu(&state.vpn_status, state.window_visible); + let _ = app_handle.tray_handle().set_menu(new_system_tray_menu); + }); +} diff --git a/upvpn-ui/src-tauri/tauri.conf.json b/upvpn-ui/src-tauri/tauri.conf.json index df3fc6b..5b8d7e7 100644 --- a/upvpn-ui/src-tauri/tauri.conf.json +++ b/upvpn-ui/src-tauri/tauri.conf.json @@ -10,6 +10,9 @@ "version": "0.0.0" }, "tauri": { + "systemTray": { + "iconPath": "icons/icon.png" + }, "allowlist": { "fs": { "all": true diff --git a/upvpn-ui/src/context/VpnStatusContext.tsx b/upvpn-ui/src/context/VpnStatusContext.tsx index 91f0979..d59e2cc 100644 --- a/upvpn-ui/src/context/VpnStatusContext.tsx +++ b/upvpn-ui/src/context/VpnStatusContext.tsx @@ -142,73 +142,6 @@ export const VpnStatusProvider = ({ children }: { children: ReactNode }) => { }; }, []); - // if vpn session is in progress ask prevent window close - useEffect(() => { - const listen = async () => { - return await appWindow.listen( - TauriEvent.WINDOW_CLOSE_REQUESTED, - (event) => { - if (state.vpnStatus !== undefined) { - const getMessage = () => { - switch (state.vpnStatus.type) { - case "Disconnected": - case "Disconnecting": - return ""; - case "Accepted": - case "ServerCreated": - case "ServerRunning": - case "ServerReady": - case "Connecting": - return "App closed, but your VPN request is in progress"; - case "Connected": - return "App closed. You're still connected to VPN"; - default: - return ""; - } - }; - - const message = getMessage(); - if (message.length > 0) { - // There is a message for user, only close window if notification was successful - // otherwise keep window open and show toast - try { - (async () => { - let sent = await send_desktop_notification(message); - - if (sent) { - appWindow.close(); - } else { - toast.error( - "Please end vpn session in progress before closing upvpn app." - ); - } - })(); - } catch (e) { - toast.error( - "Please end vpn session in progress before closing upvpn app." - ); - } - } else { - appWindow.close(); - } - } else { - appWindow.close(); - } - } - ); - }; - - const unlisten = listen(); - - const unlistener = async () => { - (await unlisten)(); - }; - - return () => { - unlistener(); - }; - }, [state.vpnStatus]); - return ( {

A Modern Serverless VPN

-
+