diff --git a/Cargo.lock b/Cargo.lock index 8c0e57b1..b291f7a1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ "gimli", ] @@ -64,31 +64,20 @@ dependencies = [ [[package]] name = "ahash" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" dependencies = [ - "getrandom 0.2.10", + "getrandom 0.2.11", "once_cell", - "version_check 0.9.4", -] - -[[package]] -name = "ahash" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" -dependencies = [ - "cfg-if", - "once_cell", - "version_check 0.9.4", + "version_check", ] [[package]] name = "aho-corasick" -version = "1.0.2" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] @@ -134,9 +123,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.72" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "anymap2" @@ -192,18 +181,18 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.39", ] [[package]] name = "async-trait" -version = "0.1.72" +version = "0.1.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc6dde6e4ed435a4c1ee4e73592f5ba9da2151af10076cc04858746af9352d09" +checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.39", ] [[package]] @@ -227,7 +216,7 @@ dependencies = [ "glib-sys", "gobject-sys", "libc", - "system-deps 6.1.1", + "system-deps 6.2.0", ] [[package]] @@ -263,56 +252,11 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" -[[package]] -name = "axum" -version = "0.6.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a1de45611fdb535bfde7b7de4fd54f4fd2b17b1737c0a59b69bf9b92074b8c" -dependencies = [ - "async-trait", - "axum-core", - "bitflags 1.3.2", - "bytes 1.4.0", - "futures-util", - "http", - "http-body", - "hyper", - "itoa 1.0.9", - "matchit", - "memchr", - "mime", - "percent-encoding", - "pin-project-lite", - "rustversion", - "serde", - "sync_wrapper", - "tower", - "tower-layer", - "tower-service", -] - -[[package]] -name = "axum-core" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" -dependencies = [ - "async-trait", - "bytes 1.4.0", - "futures-util", - "http", - "http-body", - "mime", - "rustversion", - "tower-layer", - "tower-service", -] - [[package]] name = "backtrace" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line", "cc", @@ -358,9 +302,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.2" +version = "0.21.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" +checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" [[package]] name = "base64ct" @@ -370,10 +314,12 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "bigdecimal" -version = "0.3.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6773ddc0eafc0e509fb60e48dff7f450f8e674a0686ae8605e8d9901bd5eefa" +checksum = "c06619be423ea5bb86c95f087d5707942791a08a85530df0db2209a3ecfb8bc9" dependencies = [ + "autocfg", + "libm 0.2.8", "num-bigint", "num-integer", "num-traits", @@ -407,12 +353,6 @@ dependencies = [ "shlex", ] -[[package]] -name = "bitfield" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46afbd2983a5d5a7bd740ccb198caf5b82f45c40c09c0eed36052d91cb92e719" - [[package]] name = "bitflags" version = "0.9.1" @@ -427,9 +367,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.3.3" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" [[package]] name = "bitstring" @@ -494,42 +434,21 @@ dependencies = [ "generic-array", ] -[[package]] -name = "block-modes" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cb03d1bed155d89dce0f845b7899b18a9a163e148fd004e1c28421a783e2d8e" -dependencies = [ - "block-padding", - "cipher 0.3.0", -] - [[package]] name = "block-padding" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" -[[package]] -name = "blowfish" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe3ff3fc1de48c1ac2e3341c4df38b0d1bfb8fdf04632a187c8b75aaa319a7ab" -dependencies = [ - "byteorder", - "cipher 0.3.0", - "opaque-debug", -] - [[package]] name = "bollard" version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af254ed2da4936ef73309e9597180558821cb16ae9bba4cb24ce6b612d8d80ed" dependencies = [ - "base64 0.21.2", + "base64 0.21.5", "bollard-stubs", - "bytes 1.4.0", + "bytes 1.5.0", "futures-core", "futures-util", "hex", @@ -545,7 +464,7 @@ dependencies = [ "serde_urlencoded", "thiserror", "tokio", - "tokio-util 0.7.8", + "tokio-util 0.7.10", "url", "winapi", ] @@ -578,12 +497,12 @@ dependencies = [ [[package]] name = "borsh" -version = "0.10.3" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4114279215a005bc675e386011e594e1d9b800918cea18fcadadcce864a2046b" +checksum = "bf617fabf5cdbdc92f774bfe5062d870f228b80056d41180797abf48bed4056e" dependencies = [ - "borsh-derive 0.10.3", - "hashbrown 0.13.2", + "borsh-derive 1.2.0", + "cfg_aliases", ] [[package]] @@ -592,8 +511,8 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6441c552f230375d18e3cc377677914d2ca2b0d36e52129fe15450a2dce46775" dependencies = [ - "borsh-derive-internal 0.9.3", - "borsh-schema-derive-internal 0.9.3", + "borsh-derive-internal", + "borsh-schema-derive-internal", "proc-macro-crate 0.1.5", "proc-macro2", "syn 1.0.109", @@ -601,15 +520,16 @@ dependencies = [ [[package]] name = "borsh-derive" -version = "0.10.3" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0754613691538d51f329cce9af41d7b7ca150bc973056f1156611489475f54f7" +checksum = "f404657a7ea7b5249e36808dff544bc88a28f26e0ac40009f674b7a009d14be3" dependencies = [ - "borsh-derive-internal 0.10.3", - "borsh-schema-derive-internal 0.10.3", - "proc-macro-crate 0.1.5", + "once_cell", + "proc-macro-crate 2.0.0", "proc-macro2", - "syn 1.0.109", + "quote", + "syn 2.0.39", + "syn_derive", ] [[package]] @@ -623,17 +543,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "borsh-derive-internal" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afb438156919598d2c7bad7e1c0adf3d26ed3840dbc010db1a882a65583ca2fb" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "borsh-schema-derive-internal" version = "0.9.3" @@ -645,22 +554,11 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "borsh-schema-derive-internal" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634205cc43f74a1b9046ef87c4540ebda95696ec0f315024860cad7c5b0f5ccd" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "brotli" -version = "3.3.4" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1a0b1dbcc8ae29329621f8d4f0d835787c1c38bb1401979b49d13b0b305ff68" +checksum = "516074a47ef4bce09577a3b379392300159ce5b1ba2e501ff1c819950066100f" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -669,9 +567,9 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "2.3.4" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b6561fd3f895a11e8f72af2cb7d22e08366bebc2b6b57f7744c4bda27034744" +checksum = "4e2e4afe60d7dd600fdd3de8d0f08c2b7ec039712e3b6137ff98b7004e82de4f" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -685,29 +583,19 @@ checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" [[package]] name = "bstr" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6798148dccfbff0fae41c7574d2fa8f1ef3492fba0face179de5d8d447d67b05" +checksum = "542f33a8835a0884b006a0c3df3dadd99c0c3f296ed26c2fdc8028e01ad6230c" dependencies = [ "memchr", "serde", ] -[[package]] -name = "buf_redux" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b953a6887648bb07a535631f2bc00fbdb2a2216f135552cb3f534ed136b9c07f" -dependencies = [ - "memchr", - "safemem", -] - [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "byte-unit" @@ -743,15 +631,15 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.13.1" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea" +checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" @@ -761,9 +649,9 @@ checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" [[package]] name = "bytes" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" dependencies = [ "serde", ] @@ -789,7 +677,7 @@ checksum = "3c55d429bef56ac9172d25fecb85dc8068307d17acd74b377866b7a1ef25d3c8" dependencies = [ "glib-sys", "libc", - "system-deps 6.1.1", + "system-deps 6.2.0", ] [[package]] @@ -799,7 +687,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "599aa35200ffff8f04c1925aa1acc92fa2e08874379ef42e210a80e527e60838" dependencies = [ "serde", - "toml 0.7.6", + "toml 0.7.8", ] [[package]] @@ -808,17 +696,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53" -[[package]] -name = "cast5" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f69790da27038b52ffcf09e7874e1aae353c674d65242549a733ad9372e7281f" -dependencies = [ - "byteorder", - "cipher 0.3.0", - "opaque-debug", -] - [[package]] name = "cbindgen" version = "0.17.0" @@ -840,11 +717,11 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.79" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ - "jobserver", + "libc", ] [[package]] @@ -873,15 +750,6 @@ dependencies = [ "uuid", ] -[[package]] -name = "cfb-mode" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "750dfbb1b1f84475c1a92fed10fa5e76cb11adc0cda5225f137c5cac84e80860" -dependencies = [ - "cipher 0.3.0", -] - [[package]] name = "cfg-expr" version = "0.9.1" @@ -893,9 +761,9 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.15.3" +version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "215c0072ecc28f92eeb0eea38ba63ddfcb65c2828c46311d646f1a3ff5f9841c" +checksum = "03915af431787e6ffdcc74c645077518c6b6e01f80b761e0fbbfa288536311b3" dependencies = [ "smallvec", "target-lexicon", @@ -907,6 +775,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + [[package]] name = "chacha20" version = "0.7.3" @@ -967,26 +841,19 @@ dependencies = [ "zeroize", ] -[[package]] -name = "checked_int_cast" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17cc5e6b5ab06331c33589842070416baa137e8b0eb912b008cfd4a78ada7919" - [[package]] name = "chrono" -version = "0.4.26" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "serde", - "time 0.1.45", "wasm-bindgen", - "winapi", + "windows-targets", ] [[package]] @@ -1019,12 +886,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "circular" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fc239e0f6cb375d2402d48afb92f76f5404fd1df208a41930ec81eda078bea" - [[package]] name = "clang-sys" version = "1.6.1" @@ -1059,28 +920,13 @@ checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" dependencies = [ "atty", "bitflags 1.3.2", - "clap_derive", "clap_lex", "indexmap 1.9.3", - "once_cell", "strsim 0.10.0", "termcolor", "textwrap 0.16.0", ] -[[package]] -name = "clap_derive" -version = "3.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" -dependencies = [ - "heck 0.4.1", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "clap_lex" version = "0.2.4" @@ -1090,26 +936,6 @@ dependencies = [ "os_str_bytes", ] -[[package]] -name = "clear_on_drop" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38508a63f4979f0048febc9966fadbd48e5dab31fd0ec6a3f151bbf4a74f7423" -dependencies = [ - "cc", -] - -[[package]] -name = "clipboard-win" -version = "4.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7191c27c2357d9b7ef96baac1773290d4ca63b24205b82a3fd8a0637afcf0362" -dependencies = [ - "error-code", - "str-buf", - "winapi", -] - [[package]] name = "cocoa" version = "0.24.1" @@ -1128,15 +954,14 @@ dependencies = [ [[package]] name = "cocoa-foundation" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "931d3837c286f56e3c58423ce4eba12d08db2374461a785c86f672b08b5650d6" +checksum = "8c6234cbb2e4c785b456c0644748b1ac416dd045799740356f8363dfe00c93f7" dependencies = [ "bitflags 1.3.2", "block", "core-foundation", "core-graphics-types", - "foreign-types", "libc", "objc", ] @@ -1153,63 +978,22 @@ version = "4.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" dependencies = [ - "bytes 1.4.0", + "bytes 1.5.0", "memchr", ] [[package]] name = "config" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d379af7f68bfc21714c6c7dea883544201741d2ce8274bb12fa54f89507f52a7" +checksum = "23738e11972c7643e4ec947840fc463b6a571afcd3e735bdfce7d03c7a784aca" dependencies = [ "async-trait", - "json5", "lazy_static", "nom 7.1.3", "pathdiff", - "ron", - "rust-ini", "serde", - "serde_json", "toml 0.5.11", - "yaml-rust", -] - -[[package]] -name = "console-api" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2895653b4d9f1538a83970077cb01dfc77a4810524e51a110944688e916b18e" -dependencies = [ - "prost 0.11.9", - "prost-types 0.11.9", - "tonic 0.9.2", - "tracing-core", -] - -[[package]] -name = "console-subscriber" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4cf42660ac07fcebed809cfe561dd8730bcd35b075215e6479c516bcd0d11cb" -dependencies = [ - "console-api", - "crossbeam-channel", - "crossbeam-utils", - "futures 0.3.28", - "hdrhistogram", - "humantime", - "prost-types 0.11.9", - "serde", - "serde_json", - "thread_local", - "tokio", - "tokio-stream", - "tonic 0.9.2", - "tracing", - "tracing-core", - "tracing-subscriber", ] [[package]] @@ -1222,12 +1006,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "const-oid" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" - [[package]] name = "convert_case" version = "0.4.0" @@ -1285,19 +1063,13 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.9" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" dependencies = [ "libc", ] -[[package]] -name = "crc24" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd121741cf3eb82c08dd3023eb55bf2665e5f60ec20f89760cf836ae4562e6a0" - [[package]] name = "crc32fast" version = "1.3.2" @@ -1348,23 +1120,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "crossterm" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2102ea4f781910f8a5b98dd061f4c2023f479ce7bb1236330099ceb5a93cf17" -dependencies = [ - "bitflags 1.3.2", - "crossterm_winapi", - "futures-core", - "libc", - "mio", - "parking_lot", - "signal-hook", - "signal-hook-mio", - "winapi", -] - [[package]] name = "crossterm" version = "0.26.1" @@ -1387,7 +1142,7 @@ version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" dependencies = [ - "bitflags 2.3.3", + "bitflags 2.4.1", "crossterm_winapi", "libc", "mio", @@ -1412,16 +1167,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" -[[package]] -name = "crypto-bigint" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03c6a1d5fa1de37e071642dfa44ec552ca5b299adb128fab16138e24b548fd21" -dependencies = [ - "generic-array", - "subtle", -] - [[package]] name = "crypto-common" version = "0.1.6" @@ -1467,7 +1212,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" dependencies = [ "quote", - "syn 2.0.27", + "syn 2.0.39", ] [[package]] @@ -1489,12 +1234,6 @@ dependencies = [ "cipher 0.3.0", ] -[[package]] -name = "cty" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" - [[package]] name = "curve25519-dalek" version = "3.2.0" @@ -1523,38 +1262,14 @@ dependencies = [ "zeroize", ] -[[package]] -name = "darling" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d706e75d87e35569db781a9b5e2416cff1236a47ed380831f959382ccd5f858" -dependencies = [ - "darling_core 0.10.2", - "darling_macro 0.10.2", -] - [[package]] name = "darling" version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" dependencies = [ - "darling_core 0.20.3", - "darling_macro 0.20.3", -] - -[[package]] -name = "darling_core" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c960ae2da4de88a91b2d920c2a7233b400bc33cb28453a2987822d8392519b" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.9.3", - "syn 1.0.109", + "darling_core", + "darling_macro", ] [[package]] @@ -1568,18 +1283,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.10.0", - "syn 2.0.27", -] - -[[package]] -name = "darling_macro" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" -dependencies = [ - "darling_core 0.10.2", - "quote", - "syn 1.0.109", + "syn 2.0.39", ] [[package]] @@ -1588,16 +1292,16 @@ version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ - "darling_core 0.20.3", + "darling_core", "quote", - "syn 2.0.27", + "syn 2.0.39", ] [[package]] name = "data-encoding" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" +checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" [[package]] name = "dbus" @@ -1620,14 +1324,12 @@ dependencies = [ ] [[package]] -name = "der" -version = "0.5.1" +name = "deranged" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c" +checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" dependencies = [ - "const-oid", - "crypto-bigint", - "pem-rfc7468", + "serde", ] [[package]] @@ -1641,31 +1343,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "derive_builder" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2658621297f2cf68762a6f7dc0bb7e1ff2cfd6583daef8ee0fed6f7ec468ec0" -dependencies = [ - "darling 0.10.2", - "derive_builder_core", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "derive_builder_core" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2791ea3e372c8495c0bc2033991d76b512cd799d07491fbd6890124db9458bef" -dependencies = [ - "darling 0.10.2", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "derive_more" version = "0.99.17" @@ -1679,17 +1356,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "des" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac41dd49fb554432020d52c875fc290e110113f864c6b1b525cd62c7e7747a5d" -dependencies = [ - "byteorder", - "cipher 0.3.0", - "opaque-debug", -] - [[package]] name = "destructure_traitobject" version = "0.2.0" @@ -1698,9 +1364,9 @@ checksum = "3c877555693c14d2f84191cfd3ad8582790fc52b5e2274b40b59cf5f5cea25c7" [[package]] name = "diesel" -version = "2.1.0" +version = "2.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7a532c1f99a0f596f6960a60d1e119e91582b24b39e2d83a190e61262c3ef0c" +checksum = "62c6fcf842f17f8c78ecf7c81d75c5ce84436b41ee07e03f490fbb5f5a8731d8" dependencies = [ "bigdecimal", "chrono", @@ -1711,19 +1377,19 @@ dependencies = [ "num-traits", "r2d2", "serde_json", - "time 0.3.23", + "time", ] [[package]] name = "diesel_derives" -version = "2.1.0" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74398b79d81e52e130d991afeed9c86034bb1b7735f46d2f5bf7deb261d80303" +checksum = "ef8337737574f55a468005a83499da720f20c65586241ffea339db9ecdfd2b44" dependencies = [ "diesel_table_macro_syntax", "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.39", ] [[package]] @@ -1743,7 +1409,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc5557efc453706fed5e4fa85006fe9817c224c3f480a34c7e5959fd700921c5" dependencies = [ - "syn 2.0.27", + "syn 2.0.39", ] [[package]] @@ -1803,12 +1469,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" -[[package]] -name = "dlv-list" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0688c2a7f92e427f44895cd63841bff7b29f8d7a1648b9e7e07a4a365b2e1257" - [[package]] name = "dtoa" version = "1.0.9" @@ -1830,29 +1490,6 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" -[[package]] -name = "ed25519" -version = "1.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" -dependencies = [ - "signature", -] - -[[package]] -name = "ed25519-dalek" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" -dependencies = [ - "curve25519-dalek 3.2.0", - "ed25519", - "rand 0.7.3", - "serde", - "sha2 0.9.9", - "zeroize", -] - [[package]] name = "either" version = "1.9.0" @@ -1869,7 +1506,7 @@ dependencies = [ "rustc_version", "toml 0.8.8", "vswhom", - "winreg 0.51.0", + "winreg", ] [[package]] @@ -1880,9 +1517,9 @@ checksum = "4ef6b89e5b37196644d8796de5268852ff179b44e96276cf4290264843743bb7" [[package]] name = "encoding_rs" -version = "0.8.32" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" dependencies = [ "cfg-if", ] @@ -1913,57 +1550,25 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.1" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +checksum = "f258a7194e7f7c2a7837a8913aeab7fd8c383457034fa20ce4dd3dcb813e8eb8" dependencies = [ - "errno-dragonfly", "libc", "windows-sys 0.48.0", ] -[[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", - "libc", -] - -[[package]] -name = "error-code" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64f18991e7bf11e7ffee451b5318b5c1a73c52d0d0ada6e5a3017c8c1ced6a21" -dependencies = [ - "libc", - "str-buf", -] - [[package]] name = "fastrand" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" - -[[package]] -name = "fd-lock" -version = "3.0.13" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef033ed5e9bad94e55838ca0ca906db0e043f517adda0c8b79c7a8c66c93c1b5" -dependencies = [ - "cfg-if", - "rustix", - "windows-sys 0.48.0", -] +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "fdeflate" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d329bdeac514ee06249dabc27877490f17f5d371ec693360768b838e19f3ae10" +checksum = "64d6dafc854908ff5da46ff3f8f473c6984119a2876a383a860246dd7841a868" dependencies = [ "simd-adler32", ] @@ -1980,19 +1585,19 @@ version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f" dependencies = [ - "memoffset 0.9.0", + "memoffset", "rustc_version", ] [[package]] name = "filetime" -version = "0.2.21" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cbc844cecaee9d4443931972e1289c8ff485cb4cc2767cb03ca139ed6885153" +checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.2.16", + "redox_syscall 0.3.5", "windows-sys 0.48.0", ] @@ -2016,9 +1621,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.26" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" dependencies = [ "crc32fast", "miniz_oxide", @@ -2047,9 +1652,9 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] @@ -2060,7 +1665,7 @@ version = "0.1.0" dependencies = [ "anyhow", "derive_more", - "futures 0.3.28", + "futures 0.3.29", "js-sys", "log", "once_cell", @@ -2110,9 +1715,9 @@ checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" [[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", @@ -2125,9 +1730,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", @@ -2135,15 +1740,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", @@ -2152,38 +1757,38 @@ 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-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.27", + "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 0.1.31", "futures-channel", @@ -2252,7 +1857,7 @@ dependencies = [ "glib-sys", "gobject-sys", "libc", - "system-deps 6.1.1", + "system-deps 6.2.0", ] [[package]] @@ -2269,7 +1874,7 @@ dependencies = [ "libc", "pango-sys", "pkg-config", - "system-deps 6.1.1", + "system-deps 6.2.0", ] [[package]] @@ -2281,7 +1886,7 @@ dependencies = [ "gdk-sys", "glib-sys", "libc", - "system-deps 6.1.1", + "system-deps 6.2.0", "x11", ] @@ -2305,7 +1910,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", - "version_check 0.9.4", + "version_check", ] [[package]] @@ -2321,9 +1926,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" dependencies = [ "cfg-if", "libc", @@ -2342,9 +1947,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.27.3" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "gio" @@ -2372,23 +1977,10 @@ dependencies = [ "glib-sys", "gobject-sys", "libc", - "system-deps 6.1.1", + "system-deps 6.2.0", "winapi", ] -[[package]] -name = "git2" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2994bee4a3a6a51eb90c218523be382fd7ea09b16380b9312e9dbe955ff7c7d1" -dependencies = [ - "bitflags 1.3.2", - "libc", - "libgit2-sys", - "log", - "url", -] - [[package]] name = "glib" version = "0.15.12" @@ -2431,7 +2023,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef4b192f8e65e9cf76cbf4ea71fa8e3be4a0e18ffe3d68b8da6836974cc5bad4" dependencies = [ "libc", - "system-deps 6.1.1", + "system-deps 6.2.0", ] [[package]] @@ -2442,9 +2034,9 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "globset" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aca8bbd8e0707c1887a8bbb7e6b40e228f251ff5d62c8220a4a7a53c73aff006" +checksum = "759c97c1e17c55525b57192c06a267cda0ac5210b222d6b82189a2338fa1c13d" dependencies = [ "aho-corasick", "bstr", @@ -2545,7 +2137,7 @@ dependencies = [ "gloo-utils", "http", "js-sys", - "pin-project 1.1.2", + "pin-project 1.1.3", "serde", "serde_json", "thiserror", @@ -2627,7 +2219,7 @@ checksum = "0d57ce44246becd17153bd035ab4d32cfee096a657fc01f2231c9278378d1e0a" dependencies = [ "glib-sys", "libc", - "system-deps 6.1.1", + "system-deps 6.2.0", ] [[package]] @@ -2668,7 +2260,7 @@ dependencies = [ "gobject-sys", "libc", "pango-sys", - "system-deps 6.1.1", + "system-deps 6.2.0", ] [[package]] @@ -2687,20 +2279,20 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.20" +version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" +checksum = "4d6250322ef6e60f93f9a2162799302cd6f68f79f6e5d85c8c16f14d1d958178" dependencies = [ - "bytes 1.4.0", + "bytes 1.5.0", "fnv", "futures-core", "futures-sink", "futures-util", "http", - "indexmap 1.9.3", + "indexmap 2.1.0", "slab", "tokio", - "tokio-util 0.7.8", + "tokio-util 0.7.10", "tracing", ] @@ -2710,7 +2302,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" dependencies = [ - "ahash 0.7.6", + "ahash", ] [[package]] @@ -2719,62 +2311,25 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash 0.7.6", + "ahash", ] [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash 0.8.3", -] - -[[package]] -name = "hashbrown" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" [[package]] name = "hdrhistogram" -version = "7.5.2" +version = "7.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f19b9f54f7c7f55e31401bb647626ce0cf0f67b0004982ce815b3ee72a02aa8" +checksum = "765c9198f173dd59ce26ff9f95ef0aafd0a0fe01fb9d72841bc5066a4c06511d" dependencies = [ - "base64 0.13.1", "byteorder", - "flate2", - "nom 7.1.3", "num-traits", ] -[[package]] -name = "headers" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3e372db8e5c0d213e0cd0b9be18be2aca3d44cf2fe30a9d46a65581cd454584" -dependencies = [ - "base64 0.13.1", - "bitflags 1.3.2", - "bytes 1.4.0", - "headers-core", - "http", - "httpdate", - "mime", - "sha1 0.10.5", -] - -[[package]] -name = "headers-core" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" -dependencies = [ - "http", -] - [[package]] name = "heck" version = "0.3.3" @@ -2801,9 +2356,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "hex" @@ -2817,6 +2372,15 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +[[package]] +name = "home" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +dependencies = [ + "windows-sys 0.48.0", +] + [[package]] name = "html5ever" version = "0.25.2" @@ -2847,11 +2411,11 @@ dependencies = [ [[package]] name = "http" -version = "0.2.9" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" dependencies = [ - "bytes 1.4.0", + "bytes 1.5.0", "fnv", "itoa 1.0.9", ] @@ -2862,7 +2426,7 @@ version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ - "bytes 1.4.0", + "bytes 1.5.0", "http", "pin-project-lite", ] @@ -2881,9 +2445,9 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "humantime" @@ -2897,7 +2461,7 @@ version = "0.14.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" dependencies = [ - "bytes 1.4.0", + "bytes 1.5.0", "futures-channel", "futures-core", "futures-util", @@ -2908,7 +2472,7 @@ dependencies = [ "httpdate", "itoa 1.0.9", "pin-project-lite", - "socket2 0.4.9", + "socket2 0.4.10", "tokio", "tower-service", "tracing", @@ -2927,19 +2491,6 @@ dependencies = [ "tokio-io-timeout", ] -[[package]] -name = "hyper-tls" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" -dependencies = [ - "bytes 1.4.0", - "hyper", - "native-tls", - "tokio", - "tokio-native-tls", -] - [[package]] name = "hyperlocal" version = "0.8.0" @@ -2949,22 +2500,22 @@ dependencies = [ "futures-util", "hex", "hyper", - "pin-project 1.1.2", + "pin-project 1.1.3", "tokio", ] [[package]] name = "iana-time-zone" -version = "0.1.57" +version = "0.1.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" +checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows 0.48.0", + "windows-core", ] [[package]] @@ -3005,9 +2556,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -3033,28 +2584,14 @@ dependencies = [ [[package]] name = "image" -version = "0.23.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24ffcb7e7244a9bf19d35bf2883b9c080c4ced3c07a9895572178cdb8f13f6a1" -dependencies = [ - "bytemuck", - "byteorder", - "color_quant", - "num-iter", - "num-rational 0.3.2", - "num-traits", -] - -[[package]] -name = "image" -version = "0.24.6" +version = "0.24.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "527909aa81e20ac3a44803521443a765550f09b5130c2c2fa1ea59c2f8f50a3a" +checksum = "6f3dfdbdd72063086ff443e297b61695500514b1e41095b6fb9a5ab48a70a711" dependencies = [ "bytemuck", "byteorder", "color_quant", - "num-rational 0.4.1", + "num-rational", "num-traits", ] @@ -3080,19 +2617,20 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ "equivalent", - "hashbrown 0.14.0", + "hashbrown 0.14.2", + "serde", ] [[package]] name = "indoc" -version = "2.0.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c785eefb63ebd0e33416dfcb8d6da0bf27ce752843a45632a67bf10d4d4b5c4" +checksum = "1e186cfbae8084e513daff4240b4797e342f988cecda4fb6c939150f96315fd8" [[package]] name = "infer" @@ -3129,9 +2667,9 @@ checksum = "8bb03732005da905c88227371639bf1ad885cc712789c011c31c5fb3ab3ccf02" [[package]] name = "ipnet" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "itertools" @@ -3206,29 +2744,20 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" -[[package]] -name = "jobserver" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" -dependencies = [ - "libc", -] - [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" dependencies = [ "wasm-bindgen", ] [[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", @@ -3236,17 +2765,6 @@ dependencies = [ "treediff", ] -[[package]] -name = "json5" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b0db21af676c1ce64250b5f40f3ce2cf27e4e47cb91ed91eb6fe9350b430c1" -dependencies = [ - "pest", - "pest_derive", - "serde", -] - [[package]] name = "keccak" version = "0.1.4" @@ -3286,9 +2804,6 @@ name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -dependencies = [ - "spin", -] [[package]] name = "lazycell" @@ -3311,18 +2826,6 @@ dependencies = [ "pkg-config", ] -[[package]] -name = "libgit2-sys" -version = "0.14.2+1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f3d95f6b51075fe9810a7ae22c7095f12b98005ab364d8544797a825ce946a4" -dependencies = [ - "cc", - "libc", - "libz-sys", - "pkg-config", -] - [[package]] name = "liblmdb-sys" version = "0.2.2" @@ -3351,28 +2854,27 @@ checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" [[package]] name = "libm" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] -name = "libsqlite3-sys" -version = "0.26.0" +name = "libredox" +version = "0.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc22eff61b133b115c6e8c74e818c628d6d5e7a502afea6f64dee076dd94326" +checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" dependencies = [ - "pkg-config", - "vcpkg", + "bitflags 2.4.1", + "libc", + "redox_syscall 0.4.1", ] [[package]] -name = "libz-sys" -version = "1.1.12" +name = "libsqlite3-sys" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d97137b25e321a73eef1418d1d5d2eda4d77e12813f8e6dead84bc52c5870a7b" +checksum = "cf4e226dcd58b4be396f7bd3c20da8fdee2911400705297ba7d2d7cc2c30f716" dependencies = [ - "cc", - "libc", "pkg-config", "vcpkg", ] @@ -3394,9 +2896,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.4.3" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0" +checksum = "969488b55f8ac402214f3f5fd243ebb7206cf82de60d3172994707a4bcc2b829" [[package]] name = "lmdb-zero" @@ -3412,9 +2914,9 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ "autocfg", "scopeguard", @@ -3468,21 +2970,15 @@ source = "git+https://github.com/tari-project/log4rs.git#e1051fd3a1bec9c55d055f6 dependencies = [ "anyhow", "arc-swap", - "chrono", "derivative", "fnv", "humantime", - "libc", "log", - "log-mdc", - "parking_lot", "serde", "serde-value", "serde_yaml 0.8.26", "thiserror", - "thread-id", "typemap-ors", - "winapi", ] [[package]] @@ -3508,15 +3004,15 @@ checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" [[package]] name = "mac-notification-sys" -version = "0.5.8" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abc434554ad0e640d772f7f262aa28e61d485212533d3673abe5f3d1729bd42a" +checksum = "51fca4d74ff9dbaac16a01b924bc3693fa2bba0862c2c633abc73f9a8ea21f64" dependencies = [ "cc", "dirs-next 2.0.0", "objc-foundation", "objc_id", - "time 0.3.23", + "time", ] [[package]] @@ -3571,37 +3067,11 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" -[[package]] -name = "matchit" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b87248edafb776e59e6ee64a79086f65890d3510f2c656c000bf2a7e8a0aea40" - -[[package]] -name = "md-5" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5a279bb9607f9f53c22d496eade00d138d1bdcccd07d74650387cf94942a15" -dependencies = [ - "block-buffer 0.9.0", - "digest 0.9.0", - "opaque-debug", -] - [[package]] name = "memchr" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" - -[[package]] -name = "memoffset" -version = "0.6.5" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" -dependencies = [ - "autocfg", -] +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "memoffset" @@ -3631,7 +3101,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f23f71580015254b020e856feac3df5878c2c7a8812297edd6c0a485ac9dada" dependencies = [ "serde", - "toml 0.7.6", + "toml 0.7.8", ] [[package]] @@ -3645,22 +3115,6 @@ dependencies = [ "quote", ] -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - -[[package]] -name = "mime_guess" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" -dependencies = [ - "mime", - "unicase", -] - [[package]] name = "minimal-lexical" version = "0.2.1" @@ -3679,9 +3133,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" dependencies = [ "libc", "log", @@ -3823,19 +3277,6 @@ dependencies = [ "smallvec", ] -[[package]] -name = "nix" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3790c00a0150112de0f4cd161e3d7fc4b2d8a5542ffc35f099a2562aecb35c" -dependencies = [ - "bitflags 1.3.2", - "cc", - "cfg-if", - "libc", - "memoffset 0.6.5", -] - [[package]] name = "nodrop" version = "0.1.14" @@ -3848,16 +3289,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" -[[package]] -name = "nom" -version = "4.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6" -dependencies = [ - "memchr", - "version_check 0.1.5", -] - [[package]] name = "nom" version = "5.1.3" @@ -3865,7 +3296,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08959a387a676302eebf4ddbcbc611da04285579f76f88ee0506c63b1a61dd4b" dependencies = [ "memchr", - "version_check 0.9.4", + "version_check", ] [[package]] @@ -3880,11 +3311,12 @@ dependencies = [ [[package]] name = "notify-rust" -version = "4.6.0" +version = "4.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc2e370356160e41aba3fd0fbac26d86a89ddd2ac4300c03de999a77cfa2509" +checksum = "827c5edfa80235ded4ab3fe8e9dc619b4f866ef16fe9b1c6b8a7f8692c0f2226" dependencies = [ "dbus", + "log", "mac-notification-sys", "tauri-winrt-notification", ] @@ -3901,33 +3333,15 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" dependencies = [ "autocfg", "num-integer", "num-traits", ] -[[package]] -name = "num-bigint-dig" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" -dependencies = [ - "byteorder", - "lazy_static", - "libm 0.2.7", - "num-integer", - "num-iter", - "num-traits", - "rand 0.8.5", - "serde", - "smallvec", - "zeroize", -] - [[package]] name = "num-derive" version = "0.3.3" @@ -3959,28 +3373,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-iter" -version = "0.1.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - [[package]] name = "num-rational" version = "0.4.1" @@ -3994,12 +3386,11 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", - "libm 0.2.7", ] [[package]] @@ -4008,7 +3399,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.2", + "hermit-abi 0.3.3", "libc", ] @@ -4074,9 +3465,9 @@ dependencies = [ [[package]] name = "object" -version = "0.31.1" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" dependencies = [ "memchr", ] @@ -4105,11 +3496,11 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.55" +version = "0.10.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "345df152bc43501c5eb9e4654ff05f794effb78d4efe3d53abc158baddc0703d" +checksum = "79a4c6c3a2b158f7f8f2a2fc5a969fa3a068df6fc9dbb4a43845436e3af7c800" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.1", "cfg-if", "foreign-types", "libc", @@ -4126,7 +3517,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.39", ] [[package]] @@ -4137,18 +3528,18 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-src" -version = "111.26.0+1.1.1u" +version = "300.1.6+3.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efc62c9f12b22b8f5208c23a7200a442b2e5999f8bdf80233852122b5a4f6f37" +checksum = "439fac53e092cd7442a3660c85dde4643ab3b5bd39040912388dcdabf6b88085" dependencies = [ "cc", ] [[package]] name = "openssl-sys" -version = "0.9.90" +version = "0.9.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374533b0e45f3a7ced10fcaeccca020e66656bc03dac384f852e4e5a7a8104a6" +checksum = "3812c071ba60da8b5677cc12bcb1d42989a65553772897a7e0355545a819838f" dependencies = [ "cc", "libc", @@ -4159,23 +3550,13 @@ dependencies = [ [[package]] name = "ordered-float" -version = "2.10.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7940cf2ca942593318d07fcf2596cdca60a85c9e7fab408a5e21a4f9dcd40d87" +checksum = "68f19d67e5a2795c94e73e0bb1cc1a7edeb2e28efd39e2e1c9b7a40c1108b11c" dependencies = [ "num-traits", ] -[[package]] -name = "ordered-multimap" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccd746e37177e1711c20dd619a1620f34f5c8b569c53590a72dedd5344d8924a" -dependencies = [ - "dlv-list", - "hashbrown 0.12.3", -] - [[package]] name = "os_info" version = "3.7.0" @@ -4199,9 +3580,9 @@ dependencies = [ [[package]] name = "os_str_bytes" -version = "6.5.1" +version = "6.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d5d9eb14b174ee9aa2ef96dc2b94637a2d4b6e7cb873c7e171f0c20c6cf3eac" +checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" [[package]] name = "overload" @@ -4241,7 +3622,7 @@ dependencies = [ "glib-sys", "gobject-sys", "libc", - "system-deps 6.1.1", + "system-deps 6.2.0", ] [[package]] @@ -4256,13 +3637,13 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.8" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.3.5", + "redox_syscall 0.4.1", "smallvec", "windows-targets", ] @@ -4302,122 +3683,20 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" -[[package]] -name = "pem-rfc7468" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01de5d978f34aa4b2296576379fcc416034702fd94117c56ffd8a1a767cefb30" -dependencies = [ - "base64ct", -] - [[package]] name = "percent-encoding" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" - -[[package]] -name = "pest" -version = "2.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d2d1d55045829d65aad9d389139882ad623b33b904e7c9f1b10c5b8927298e5" -dependencies = [ - "thiserror", - "ucd-trie", -] - -[[package]] -name = "pest_derive" -version = "2.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f94bca7e7a599d89dea5dfa309e217e7906c3c007fb9c3299c40b10d6a315d3" -dependencies = [ - "pest", - "pest_generator", -] - -[[package]] -name = "pest_generator" -version = "2.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99d490fe7e8556575ff6911e45567ab95e71617f43781e5c05490dc8d75c965c" -dependencies = [ - "pest", - "pest_meta", - "proc-macro2", - "quote", - "syn 2.0.27", -] - -[[package]] -name = "pest_meta" -version = "2.7.1" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2674c66ebb4b4d9036012091b537aae5878970d6999f81a265034d85b136b341" -dependencies = [ - "once_cell", - "pest", - "sha2 0.10.7", -] +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "petgraph" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 1.9.3", -] - -[[package]] -name = "pgp" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0c63db779c3f090b540dfa0484f8adc2d380e3aa60cdb0f3a7a97454e22edc5" -dependencies = [ - "aes", - "base64 0.13.1", - "bitfield", - "block-modes", - "block-padding", - "blowfish", - "buf_redux", - "byteorder", - "cast5", - "cfb-mode", - "chrono", - "cipher 0.3.0", - "circular", - "clear_on_drop", - "crc24", - "derive_builder", - "des", - "digest 0.9.0", - "ed25519-dalek", - "flate2", - "generic-array", - "hex", - "lazy_static", - "log", - "md-5", - "nom 4.2.3", - "num-bigint-dig", - "num-derive", - "num-traits", - "rand 0.8.5", - "ripemd160", - "rsa", - "sha-1", - "sha2 0.9.9", - "sha3", - "signature", - "smallvec", - "thiserror", - "twofish", - "x25519-dalek", - "zeroize", + "indexmap 2.1.0", ] [[package]] @@ -4539,11 +3818,11 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "030ad2bc4db10a8944cb0d837f158bdfec4d4a4873ab701a95046770d11f8842" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" dependencies = [ - "pin-project-internal 1.1.2", + "pin-project-internal 1.1.3", ] [[package]] @@ -4559,13 +3838,13 @@ dependencies = [ [[package]] name = "pin-project-internal" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec2e072ecce94ec471b13398d5402c188e76ac03cf74dd1a975161b23a3f6d9c" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.39", ] [[package]] @@ -4586,33 +3865,11 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a829027bd95e54cfe13e3e258a1ae7b645960553fb82b75ff852c29688ee595b" dependencies = [ - "futures 0.3.28", + "futures 0.3.29", "rustversion", "thiserror", ] -[[package]] -name = "pkcs1" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a78f66c04ccc83dd4486fd46c33896f4e17b24a7a3a6400dedc48ed0ddd72320" -dependencies = [ - "der", - "pkcs8", - "zeroize", -] - -[[package]] -name = "pkcs8" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0" -dependencies = [ - "der", - "spki", - "zeroize", -] - [[package]] name = "pkg-config" version = "0.3.27" @@ -4621,29 +3878,29 @@ checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "platforms" -version = "3.0.2" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d7ddaed09e0eb771a79ab0fd64609ba0afb0a8366421957936ad14cbd13630" +checksum = "14e6ab3f592e6fb464fc9712d8d6e6912de6473954635fd76a589d832cffcbb0" [[package]] name = "plist" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdc0001cfea3db57a2e24bc0d818e9e20e554b5f97fabb9bc231dc240269ae06" +checksum = "9a4a0cfc5fb21a09dc6af4bf834cf10d4a32fccd9e2ea468c4b1751a097487aa" dependencies = [ - "base64 0.21.2", + "base64 0.21.5", "indexmap 1.9.3", "line-wrap", - "quick-xml 0.29.0", + "quick-xml", "serde", - "time 0.3.23", + "time", ] [[package]] name = "png" -version = "0.17.9" +version = "0.17.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59871cc5b6cce7eaccca5a802b4173377a1c2ba90654246789a8fa2334426d11" +checksum = "dd75bf2d8dd3702b9707cdbc56a5b9ef42cec752eb8b3bafc01234558442aa64" dependencies = [ "bitflags 1.3.2", "crc32fast", @@ -4727,6 +3984,15 @@ dependencies = [ "toml 0.5.11", ] +[[package]] +name = "proc-macro-crate" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" +dependencies = [ + "toml_edit 0.20.7", +] + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -4737,7 +4003,7 @@ dependencies = [ "proc-macro2", "quote", "syn 1.0.109", - "version_check 0.9.4", + "version_check", ] [[package]] @@ -4748,7 +4014,7 @@ checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ "proc-macro2", "quote", - "version_check 0.9.4", + "version_check", ] [[package]] @@ -4759,9 +4025,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] @@ -4772,11 +4038,11 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03b55e106e5791fa5a13abd13c85d6127312e8e09098059ca2bc9b03ca4cf488" dependencies = [ - "futures 0.3.28", + "futures 0.3.29", "gloo", "num_cpus", "once_cell", - "pin-project 1.1.2", + "pin-project 1.1.3", "pinned", "tokio", "tokio-stream", @@ -4804,18 +4070,8 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "444879275cb4fd84958b1a1d5420d15e6fcf7c235fe47f053c9c2a80aceb6001" dependencies = [ - "bytes 1.4.0", - "prost-derive 0.9.0", -] - -[[package]] -name = "prost" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" -dependencies = [ - "bytes 1.4.0", - "prost-derive 0.11.9", + "bytes 1.5.0", + "prost-derive", ] [[package]] @@ -4824,15 +4080,15 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62941722fb675d463659e49c4f3fe1fe792ff24fe5bbaa9c08cd3b98a1c354f5" dependencies = [ - "bytes 1.4.0", + "bytes 1.5.0", "heck 0.3.3", "itertools 0.10.5", "lazy_static", "log", "multimap", "petgraph", - "prost 0.9.0", - "prost-types 0.9.0", + "prost", + "prost-types", "regex", "tempfile", "which", @@ -4851,36 +4107,14 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "prost-derive" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" -dependencies = [ - "anyhow", - "itertools 0.10.5", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "prost-types" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "534b7a0e836e3c482d2693070f982e39e7611da9695d4d1f5a4b186b51faef0a" dependencies = [ - "bytes 1.4.0", - "prost 0.9.0", -] - -[[package]] -name = "prost-types" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" -dependencies = [ - "prost 0.11.9", + "bytes 1.5.0", + "prost", ] [[package]] @@ -4909,39 +4143,20 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "qrcode" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16d2f1455f3630c6e5107b4f2b94e74d76dea80736de0981fd27644216cff57f" -dependencies = [ - "checked_int_cast", - "image 0.23.14", -] - -[[package]] -name = "quick-xml" -version = "0.23.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11bafc859c6815fbaffbbbf4229ecb767ac913fecb27f9ad4343662e9ef099ea" -dependencies = [ - "memchr", -] - [[package]] name = "quick-xml" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81b9228215d82c7b61490fec1de287136b5de6f5700f6e58ea9ad61a7964ca51" +checksum = "eff6510e86862b57b210fd8cbe8ed3f0d7d600b9c2863cd4549a2e033c66e956" dependencies = [ "memchr", ] [[package]] name = "quote" -version = "1.0.32" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -5033,7 +4248,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.10", + "getrandom 0.2.11", ] [[package]] @@ -5070,7 +4285,7 @@ version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e2e4cd95294a85c3b4446e63ef054eea43e0205b1fd60120c16b74ff7ff96ad" dependencies = [ - "bitflags 2.3.3", + "bitflags 2.4.1", "cassowary", "crossterm 0.27.0", "indoc", @@ -5083,52 +4298,49 @@ dependencies = [ [[package]] name = "raw-window-handle" -version = "0.5.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed7e3d950b66e19e0c372f3fa3fbbcf85b1746b571f74e0c2af6042a5c93420a" -dependencies = [ - "cty", -] +checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" [[package]] name = "redox_syscall" -version = "0.2.16" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" dependencies = [ "bitflags 1.3.2", ] [[package]] name = "redox_syscall" -version = "0.3.5" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ "bitflags 1.3.2", ] [[package]] name = "redox_users" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" dependencies = [ - "getrandom 0.2.10", - "redox_syscall 0.2.16", + "getrandom 0.2.11", + "libredox", "thiserror", ] [[package]] name = "regex" -version = "1.9.1" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.3.3", - "regex-syntax 0.7.4", + "regex-automata 0.4.3", + "regex-syntax 0.8.2", ] [[package]] @@ -5142,13 +4354,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.3" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39354c10dd07468c2e73926b23bb9c2caca74c5501e38a35da70406f1d923310" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.4", + "regex-syntax 0.8.2", ] [[package]] @@ -5159,56 +4371,19 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.4" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "rend" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581008d2099240d37fb08d77ad713bcaec2c4d89d50b5b21a8bb1996bbab68ab" +checksum = "a2571463863a6bd50c32f94402933f03457a3fbaf697a707c5be741e459f08fd" dependencies = [ "bytecheck", ] -[[package]] -name = "reqwest" -version = "0.11.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" -dependencies = [ - "base64 0.21.2", - "bytes 1.4.0", - "encoding_rs", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "hyper", - "hyper-tls", - "ipnet", - "js-sys", - "log", - "mime", - "native-tls", - "once_cell", - "percent-encoding", - "pin-project-lite", - "serde", - "serde_json", - "serde_urlencoded", - "tokio", - "tokio-native-tls", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "winreg 0.10.1", -] - [[package]] name = "rfd" version = "0.10.0" @@ -5242,21 +4417,24 @@ dependencies = [ "cc", "libc", "once_cell", - "spin", - "untrusted", + "spin 0.5.2", + "untrusted 0.7.1", "web-sys", "winapi", ] [[package]] -name = "ripemd160" -version = "0.9.1" +name = "ring" +version = "0.17.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eca4ecc81b7f313189bf73ce724400a07da2a6dac19588b03c8bd76a2dcc251" +checksum = "fb0205304757e5d899b9c2e448b867ffd03ae7f988002e47cd24954391394d0b" dependencies = [ - "block-buffer 0.9.0", - "digest 0.9.0", - "opaque-debug", + "cc", + "getrandom 0.2.11", + "libc", + "spin 0.9.8", + "untrusted 0.9.0", + "windows-sys 0.48.0", ] [[package]] @@ -5287,58 +4465,15 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "ron" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88073939a61e5b7680558e6be56b419e208420c2adb92be54921fa6b72283f1a" -dependencies = [ - "base64 0.13.1", - "bitflags 1.3.2", - "serde", -] - -[[package]] -name = "rsa" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cf22754c49613d2b3b119f0e5d46e34a2c628a937e3024b8762de4e7d8c710b" -dependencies = [ - "byteorder", - "digest 0.10.7", - "num-bigint-dig", - "num-integer", - "num-iter", - "num-traits", - "pkcs1", - "pkcs8", - "rand_core 0.6.4", - "smallvec", - "subtle", - "zeroize", -] - -[[package]] -name = "rust-ini" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6d5f2436026b4f6e79dc829837d467cc7e9a55ee40e750d716713540715a2df" -dependencies = [ - "cfg-if", - "ordered-multimap", -] - [[package]] name = "rust_decimal" -version = "1.30.0" +version = "1.33.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0446843641c69436765a35a5a77088e28c2e6a12da93e84aa3ab1cd4aa5a042" +checksum = "06676aec5ccb8fc1da723cc8c0f9a46549f21ebb8753d3915c6c41db1e7f1dc4" dependencies = [ "arrayvec", - "borsh 0.10.3", - "bytecheck", - "byteorder", - "bytes 1.4.0", + "borsh 1.2.0", + "bytes 1.5.0", "num-traits", "rand 0.8.5", "rkyv", @@ -5375,11 +4510,11 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.4" +version = "0.38.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a962918ea88d644592894bc6dc55acc6c0956488adcebbfb6e273506b7fd6e5" +checksum = "dc99bc2d4f1fed22595588a013687477aedf3cdcfb26558c559edb67b4d9b22e" dependencies = [ - "bitflags 2.3.3", + "bitflags 2.4.1", "errno", "libc", "linux-raw-sys", @@ -5388,14 +4523,14 @@ dependencies = [ [[package]] name = "rustls" -version = "0.20.8" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" +checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" dependencies = [ "log", - "ring", + "ring 0.16.20", "sct", - "webpki 0.22.0", + "webpki 0.22.4", ] [[package]] @@ -5407,55 +4542,12 @@ dependencies = [ "base64 0.13.1", ] -[[package]] -name = "rustls-pemfile" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" -dependencies = [ - "base64 0.21.2", -] - [[package]] name = "rustversion" version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" -[[package]] -name = "rustyline" -version = "9.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db7826789c0e25614b03e5a54a0717a86f9ff6e6e5247f92b369472869320039" -dependencies = [ - "bitflags 1.3.2", - "cfg-if", - "clipboard-win", - "dirs-next 2.0.0", - "fd-lock", - "libc", - "log", - "memchr", - "nix", - "radix_trie", - "scopeguard", - "smallvec", - "unicode-segmentation", - "unicode-width", - "utf8parse", - "winapi", -] - -[[package]] -name = "rustyline-derive" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "688599bdab9f42105d0ae1494335a9ffafdeb7d36325e6b10fd4abc5829d6284" -dependencies = [ - "quote", - "syn 1.0.109", -] - [[package]] name = "ryu" version = "1.0.15" @@ -5509,12 +4601,12 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sct" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring", - "untrusted", + "ring 0.17.5", + "untrusted 0.9.0", ] [[package]] @@ -5580,9 +4672,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.18" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" dependencies = [ "serde", ] @@ -5645,14 +4737,14 @@ checksum = "b69b106b68bc8054f0e974e70d19984040f8a5cf9215ca82626ea4853f82c4b9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.39", ] [[package]] name = "serde_json" -version = "1.0.104" +version = "1.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "076066c5f1078eac5b722a31827a8832fe108bed65dfa75e233c89f8206e976c" +checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" dependencies = [ "itoa 1.0.9", "ryu", @@ -5661,13 +4753,13 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8725e1dfadb3a50f7e5ce0b1a540466f6ed3fe7a0fca2ac2b8b831d31316bd00" +checksum = "3081f5ffbb02284dda55132aa26daecedd7372a42417bbbab6f14ab7d6bb9145" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.39", ] [[package]] @@ -5703,35 +4795,36 @@ dependencies = [ "indexmap 1.9.3", "serde", "serde_json", - "time 0.3.23", + "time", ] [[package]] name = "serde_with" -version = "3.1.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21e47d95bc83ed33b2ecf84f4187ad1ab9685d18ff28db000c99deac8ce180e3" +checksum = "64cd236ccc1b7a29e7e2739f27c0b2dd199804abc4290e32f59f3b68d6405c23" dependencies = [ - "base64 0.21.2", + "base64 0.21.5", "chrono", "hex", "indexmap 1.9.3", + "indexmap 2.1.0", "serde", "serde_json", "serde_with_macros", - "time 0.3.23", + "time", ] [[package]] name = "serde_with_macros" -version = "3.1.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea3cee93715c2e266b9338b7544da68a9f24e227722ba482bd1c024367c77c65" +checksum = "93634eb5f75a2323b16de4748022ac4297f9e76b6dced2be287a099f41b5e788" dependencies = [ - "darling 0.20.3", + "darling", "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.39", ] [[package]] @@ -5752,7 +4845,7 @@ version = "0.9.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a49e178e4452f45cb61d0cd8cebc1b0fafd3e41929e996cef79aa3aca91f574" dependencies = [ - "indexmap 2.0.0", + "indexmap 2.1.0", "itoa 1.0.9", "ryu", "serde", @@ -5791,36 +4884,12 @@ dependencies = [ "stable_deref_trait", ] -[[package]] -name = "sha-1" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if", - "cpufeatures", - "digest 0.9.0", - "opaque-debug", -] - [[package]] name = "sha1" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" -[[package]] -name = "sha1" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest 0.10.7", -] - [[package]] name = "sha2" version = "0.9.9" @@ -5836,9 +4905,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.7" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", @@ -5859,9 +4928,9 @@ dependencies = [ [[package]] name = "sharded-slab" -version = "0.1.4" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" dependencies = [ "lazy_static", ] @@ -5878,9 +4947,9 @@ dependencies = [ [[package]] name = "shlex" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" +checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380" [[package]] name = "signal-hook" @@ -5912,12 +4981,6 @@ dependencies = [ "libc", ] -[[package]] -name = "signature" -version = "1.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" - [[package]] name = "simd-adler32" version = "0.3.7" @@ -5932,24 +4995,24 @@ checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" [[package]] name = "siphasher" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] name = "slab" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] [[package]] name = "smallvec" -version = "1.11.0" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" [[package]] name = "snow" @@ -5963,15 +5026,15 @@ dependencies = [ "curve25519-dalek 4.0.0-rc.0", "rand_core 0.6.4", "rustc_version", - "sha2 0.10.7", + "sha2 0.10.8", "subtle", ] [[package]] name = "socket2" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ "libc", "winapi", @@ -6022,14 +5085,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] -name = "spki" -version = "0.5.4" +name = "spin" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27" -dependencies = [ - "base64ct", - "der", -] +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" [[package]] name = "stable_deref_trait" @@ -6058,12 +5117,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "str-buf" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e08d8363704e6c71fc928674353e6b7c23dcea9d82d7012c8faf2a3a025f8d0" - [[package]] name = "string_cache" version = "0.8.7" @@ -6096,12 +5149,6 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" -[[package]] -name = "strsim" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" - [[package]] name = "strsim" version = "0.10.0" @@ -6156,7 +5203,7 @@ version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" dependencies = [ - "strum_macros 0.25.1", + "strum_macros 0.25.3", ] [[package]] @@ -6186,15 +5233,15 @@ dependencies = [ [[package]] name = "strum_macros" -version = "0.25.1" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6069ca09d878a33f883cc06aaa9718ede171841d3832450354410b718b097232" +checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" dependencies = [ "heck 0.4.1", "proc-macro2", "quote", "rustversion", - "syn 2.0.27", + "syn 2.0.39", ] [[package]] @@ -6222,9 +5269,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.27" +version = "2.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b60f673f44a8255b9c8c657daf66a596d435f2da81a555b06dc644d080ba45e0" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" dependencies = [ "proc-macro2", "quote", @@ -6232,10 +5279,16 @@ dependencies = [ ] [[package]] -name = "sync_wrapper" -version = "0.1.2" +name = "syn_derive" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +checksum = "1329189c02ff984e9736652b1631330da25eaa6bc639089ed4915d25446cbe7b" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.39", +] [[package]] name = "synstructure" @@ -6264,14 +5317,14 @@ dependencies = [ [[package]] name = "system-deps" -version = "6.1.1" +version = "6.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30c2de8a4d8f4b823d634affc9cd2a74ec98c53a756f317e529a48046cbf71f3" +checksum = "2a2d580ff6a20c55dfb86be5f9c238f67835d0e81cbdea8bf5680e0897320331" dependencies = [ - "cfg-expr 0.15.3", + "cfg-expr 0.15.5", "heck 0.4.1", "pkg-config", - "toml 0.7.6", + "toml 0.8.8", "version-compare 0.1.1", ] @@ -6281,8 +5334,7 @@ version = "0.1.0" dependencies = [ "anyhow", "async-trait", - "derive_more", - "futures 0.3.28", + "futures 0.3.29", "log", "thiserror", "tokio", @@ -6310,7 +5362,7 @@ dependencies = [ "glib", "glib-sys", "gtk", - "image 0.24.6", + "image", "instant", "jni", "lazy_static", @@ -6342,9 +5394,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tar" -version = "0.4.39" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec96d2ffad078296368d46ff1cb309be1c23c513b4ab0e22a45de0185275ac96" +checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb" dependencies = [ "filetime", "libc", @@ -6353,9 +5405,9 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.10" +version = "0.12.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2faeef5759ab89935255b1a4cd98e0baf99d1085e37d36599c625dac49ae8e" +checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a" [[package]] name = "tari-curve25519-dalek" @@ -6376,113 +5428,47 @@ name = "tari-lp-cli" version = "0.1.0" dependencies = [ "anyhow", - "async-trait", - "crossterm 0.26.1", - "derive_more", - "log", - "log4rs 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ratatui", - "rust_decimal", - "strum 0.24.1", - "tact", - "tari_launchpad_protocol", - "tari_sdm", - "tari_sdm_assets", - "tari_sdm_launchpad", - "tari_sim_launchpad", - "thiserror", - "tokio", -] - -[[package]] -name = "tari_app_grpc" -version = "0.51.0-pre.4" -source = "git+https://github.com/tari-project/tari?tag=v0.51.0-pre.4#87c070305951152c62a0179e13fadc55065cc318" -dependencies = [ - "argon2", - "base64 0.13.1", - "borsh 0.9.3", - "chrono", - "log", - "prost 0.9.0", - "prost-types 0.9.0", - "rand 0.8.5", - "tari_common_types", - "tari_comms", - "tari_core", - "tari_crypto", - "tari_script", - "tari_utilities 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", - "thiserror", - "tonic 0.6.2", - "tonic-build", - "zeroize", -] - -[[package]] -name = "tari_app_utilities" -version = "0.51.0-pre.4" -source = "git+https://github.com/tari-project/tari?tag=v0.51.0-pre.4#87c070305951152c62a0179e13fadc55065cc318" -dependencies = [ - "clap 3.2.25", - "futures 0.3.28", - "json5", + "async-trait", + "crossterm 0.26.1", + "derive_more", "log", - "rand 0.7.3", - "serde", - "tari_common", - "tari_common_types", - "tari_comms", - "tari_features", - "tari_utilities 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "log4rs 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ratatui", + "rust_decimal", + "strum 0.24.1", + "tact", + "tari_launchpad_protocol", + "tari_sdm", + "tari_sdm_assets", + "tari_sdm_launchpad", + "tari_sim_launchpad", "thiserror", "tokio", ] [[package]] -name = "tari_base_node" +name = "tari_app_grpc" version = "0.51.0-pre.4" source = "git+https://github.com/tari-project/tari?tag=v0.51.0-pre.4#87c070305951152c62a0179e13fadc55065cc318" dependencies = [ - "anyhow", - "async-trait", - "bincode", + "argon2", + "base64 0.13.1", "borsh 0.9.3", "chrono", - "clap 3.2.25", - "config", - "console-subscriber", - "crossterm 0.23.2", - "derive_more", - "either", - "futures 0.3.28", "log", - "log-mdc", - "log4rs 1.2.0 (git+https://github.com/tari-project/log4rs.git)", - "nom 7.1.3", - "qrcode", - "rustyline", - "rustyline-derive", - "serde", - "strum 0.22.0", - "tari_app_grpc", - "tari_app_utilities", - "tari_common", + "prost", + "prost-types", + "rand 0.8.5", "tari_common_types", "tari_comms", - "tari_comms_dht", "tari_core", "tari_crypto", - "tari_features", - "tari_metrics", - "tari_p2p", - "tari_service_framework", - "tari_shutdown", - "tari_storage", - "tari_utilities 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tari_script", + "tari_utilities", "thiserror", - "tokio", - "tonic 0.6.2", + "tonic", + "tonic-build", + "zeroize", ] [[package]] @@ -6561,7 +5547,6 @@ dependencies = [ "blake2 0.9.2", "config", "dirs-next 1.0.2", - "git2", "log", "log4rs 1.2.0 (git+https://github.com/tari-project/log4rs.git)", "multiaddr", @@ -6588,7 +5573,7 @@ dependencies = [ "diesel_migrations", "log", "serde", - "tari_utilities 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tari_utilities", "thiserror", "tokio", ] @@ -6598,7 +5583,7 @@ name = "tari_common_types" version = "0.51.0-pre.4" source = "git+https://github.com/tari-project/tari?tag=v0.51.0-pre.4#87c070305951152c62a0179e13fadc55065cc318" dependencies = [ - "base64 0.21.2", + "base64 0.21.5", "borsh 0.9.3", "chacha20poly1305 0.10.1", "digest 0.9.0", @@ -6608,7 +5593,7 @@ dependencies = [ "serde", "tari_common", "tari_crypto", - "tari_utilities 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tari_utilities", "thiserror", "tokio", ] @@ -6622,13 +5607,13 @@ dependencies = [ "async-trait", "bitflags 1.3.2", "blake2 0.10.6", - "bytes 1.4.0", + "bytes 1.5.0", "chrono", "cidr", "data-encoding", "derivative", "digest 0.9.0", - "futures 0.3.28", + "futures 0.3.29", "lazy_static", "lmdb-zero", "log", @@ -6636,8 +5621,8 @@ dependencies = [ "multiaddr", "nom 5.1.3", "once_cell", - "pin-project 1.1.2", - "prost 0.9.0", + "pin-project 1.1.3", + "prost", "rand 0.7.3", "serde", "serde_derive", @@ -6648,7 +5633,7 @@ dependencies = [ "tari_metrics", "tari_shutdown", "tari_storage", - "tari_utilities 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tari_utilities", "thiserror", "tokio", "tokio-stream", @@ -6672,12 +5657,12 @@ dependencies = [ "diesel", "diesel_migrations", "digest 0.9.0", - "futures 0.3.28", + "futures 0.3.29", "log", "log-mdc", "pin-project 0.4.30", - "prost 0.9.0", - "prost-types 0.9.0", + "prost", + "prost-types", "rand 0.7.3", "serde", "tari_common", @@ -6687,7 +5672,7 @@ dependencies = [ "tari_crypto", "tari_shutdown", "tari_storage", - "tari_utilities 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tari_utilities", "thiserror", "tokio", "tower", @@ -6722,7 +5707,7 @@ dependencies = [ "derivative", "digest 0.9.0", "fs2", - "futures 0.3.28", + "futures 0.3.29", "hex", "integer-encoding", "lmdb-zero", @@ -6734,8 +5719,8 @@ dependencies = [ "num-format", "num-traits", "once_cell", - "prost 0.9.0", - "prost-types 0.9.0", + "prost", + "prost-types", "rand 0.7.3", "randomx-rs", "serde", @@ -6760,7 +5745,7 @@ dependencies = [ "tari_shutdown", "tari_storage", "tari_test_utils", - "tari_utilities 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tari_utilities", "thiserror", "tokio", "tracing", @@ -6792,7 +5777,7 @@ dependencies = [ "tari-curve25519-dalek", "tari_bulletproofs", "tari_bulletproofs_plus", - "tari_utilities 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tari_utilities", "thiserror", "zeroize", ] @@ -6818,7 +5803,7 @@ dependencies = [ "diesel", "diesel_migrations", "digest 0.9.0", - "futures 0.3.28", + "futures 0.3.29", "log", "rand 0.7.3", "serde", @@ -6829,7 +5814,7 @@ dependencies = [ "tari_common_types", "tari_crypto", "tari_service_framework", - "tari_utilities 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tari_utilities", "thiserror", "tokio", "zeroize", @@ -6845,7 +5830,6 @@ dependencies = [ "serde", "serde_repr", "strum 0.25.0", - "tari_utilities 0.4.10 (git+https://github.com/tari-project/tari_utilities.git?tag=v0.4.10)", "thiserror", "toml 0.8.8", ] @@ -6855,15 +5839,9 @@ name = "tari_metrics" version = "0.1.0" source = "git+https://github.com/tari-project/tari?tag=v0.51.0-pre.4#87c070305951152c62a0179e13fadc55065cc318" dependencies = [ - "anyhow", - "futures 0.3.28", - "log", "once_cell", "prometheus", - "reqwest", "thiserror", - "tokio", - "warp", ] [[package]] @@ -6878,7 +5856,7 @@ dependencies = [ "serde", "tari_common", "tari_crypto", - "tari_utilities 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tari_utilities", "thiserror", ] @@ -6889,15 +5867,12 @@ source = "git+https://github.com/tari-project/tari?tag=v0.51.0-pre.4#87c07030595 dependencies = [ "anyhow", "fs2", - "futures 0.3.28", + "futures 0.3.29", "lmdb-zero", "log", - "pgp", - "prost 0.9.0", + "prost", "rand 0.7.3", - "reqwest", "rustls", - "semver", "serde", "tari_common", "tari_comms", @@ -6906,7 +5881,7 @@ dependencies = [ "tari_service_framework", "tari_shutdown", "tari_storage", - "tari_utilities 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tari_utilities", "thiserror", "tokio", "tokio-stream", @@ -6928,7 +5903,7 @@ dependencies = [ "sha2 0.9.9", "sha3", "tari_crypto", - "tari_utilities 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tari_utilities", "thiserror", ] @@ -6941,8 +5916,9 @@ dependencies = [ "bollard", "chrono", "derive_more", - "futures 0.3.28", + "futures 0.3.29", "log", + "rand 0.8.5", "tari_launchpad_protocol", "thiserror", "tokio", @@ -6964,7 +5940,7 @@ version = "0.1.0" dependencies = [ "anyhow", "async-trait", - "futures 0.3.28", + "futures 0.3.29", "log", "openssl", "rand 0.8.5", @@ -6972,19 +5948,17 @@ dependencies = [ "serde", "serde_json", "tari_app_grpc", - "tari_base_node", "tari_base_node_grpc_client", "tari_common_types", "tari_launchpad_protocol", "tari_sdm", "tari_sdm_assets", - "tari_utilities 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tari_utilities", "tari_wallet_grpc_client", "tauri", "thiserror", "tokio", - "toml 0.7.6", - "tonic 0.9.2", + "toml 0.7.8", "tor-hash-passwd", ] @@ -6995,7 +5969,7 @@ source = "git+https://github.com/tari-project/tari?tag=v0.51.0-pre.4#87c07030595 dependencies = [ "anyhow", "async-trait", - "futures 0.3.28", + "futures 0.3.29", "log", "tari_shutdown", "thiserror", @@ -7008,7 +5982,7 @@ name = "tari_shutdown" version = "0.51.0-pre.4" source = "git+https://github.com/tari-project/tari?tag=v0.51.0-pre.4#87c070305951152c62a0179e13fadc55065cc318" dependencies = [ - "futures 0.3.28", + "futures 0.3.29", ] [[package]] @@ -7041,7 +6015,7 @@ name = "tari_test_utils" version = "0.51.0-pre.4" source = "git+https://github.com/tari-project/tari?tag=v0.51.0-pre.4#87c070305951152c62a0179e13fadc55065cc318" dependencies = [ - "futures 0.3.28", + "futures 0.3.29", "rand 0.7.3", "tari_comms", "tari_shutdown", @@ -7068,23 +6042,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "tari_utilities" -version = "0.4.10" -source = "git+https://github.com/tari-project/tari_utilities.git?tag=v0.4.10#1fd912bd69ac4980a96d7863632c69779a295ce9" -dependencies = [ - "base58-monero 0.3.2", - "base64 0.13.1", - "bincode", - "generic-array", - "newtype-ops", - "serde", - "serde_json", - "subtle", - "thiserror", - "zeroize", -] - [[package]] name = "tari_wallet_grpc_client" version = "0.1.0" @@ -7093,7 +6050,7 @@ dependencies = [ "tari_app_grpc", "tari_common_types", "thiserror", - "tonic 0.6.2", + "tonic", ] [[package]] @@ -7171,11 +6128,11 @@ dependencies = [ [[package]] name = "tauri-codegen" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54ad2d49fdeab4a08717f5b49a163bdc72efc3b1950b6758245fcde79b645e1a" +checksum = "7b3475e55acec0b4a50fb96435f19631fb58cbcd31923e1a213de5c382536bbb" dependencies = [ - "base64 0.21.2", + "base64 0.21.5", "brotli", "ico", "json-patch", @@ -7187,19 +6144,19 @@ dependencies = [ "semver", "serde", "serde_json", - "sha2 0.10.7", + "sha2 0.10.8", "tauri-utils", "thiserror", - "time 0.3.23", + "time", "uuid", "walkdir", ] [[package]] name = "tauri-macros" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eb12a2454e747896929338d93b0642144bb51e0dddbb36e579035731f0d76b7" +checksum = "613740228de92d9196b795ac455091d3a5fbdac2654abb8bb07d010b62ab43af" dependencies = [ "heck 0.4.1", "proc-macro2", @@ -7274,7 +6231,7 @@ dependencies = [ "semver", "serde", "serde_json", - "serde_with 3.1.0", + "serde_with 3.4.0", "thiserror", "url", "walkdir", @@ -7288,28 +6245,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5993dc129e544393574288923d1ec447c857f3f644187f4fbf7d9a875fbfc4fb" dependencies = [ "embed-resource", - "toml 0.7.6", + "toml 0.7.8", ] [[package]] name = "tauri-winrt-notification" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f5bff1d532fead7c43324a0fa33643b8621a47ce2944a633be4cb6c0240898f" +checksum = "006851c9ccefa3c38a7646b8cec804bb429def3da10497bfa977179869c3e8e2" dependencies = [ - "quick-xml 0.23.1", - "windows 0.39.0", + "quick-xml", + "windows 0.51.1", ] [[package]] name = "tempfile" -version = "3.7.0" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5486094ee78b2e5038a6382ed7645bc084dc2ec433426ca4c3cb61e2007b8998" +checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" dependencies = [ "cfg-if", "fastrand", - "redox_syscall 0.3.5", + "redox_syscall 0.4.1", "rustix", "windows-sys 0.48.0", ] @@ -7327,9 +6284,9 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.2.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +checksum = "ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449" dependencies = [ "winapi-util", ] @@ -7357,32 +6314,31 @@ checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c" [[package]] name = "thiserror" -version = "1.0.44" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" +checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.44" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" +checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.39", ] [[package]] name = "thread-id" -version = "4.1.0" +version = "4.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ee93aa2b8331c0fec9091548843f2c90019571814057da3b783f9de09349d73" +checksum = "f0ec81c46e9eb50deaa257be2f148adf052d1fb7701cfd55ccfab2525280b70b" dependencies = [ "libc", - "redox_syscall 0.2.16", "winapi", ] @@ -7398,21 +6354,11 @@ dependencies = [ [[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.23" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59e399c068f43a5d116fedaf73b203fa4f9c519f17e2b34f63221d3792f81446" +checksum = "a79d09ac6b08c1ab3906a2f7cc2e81a0e27c7ae89c63812df75e52bef0751e07" dependencies = [ + "deranged", "itoa 1.0.9", "serde", "time-core", @@ -7427,9 +6373,9 @@ checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" [[package]] name = "time-macros" -version = "0.2.10" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96ba15a897f3c86766b757e5ac7221554c6750054d74d5b28844fce5fb36a6c4" +checksum = "75c65469ed6b3a4809d987a41eb1dc918e9bc1d92211cbad7ae82931846f7451" dependencies = [ "time-core", ] @@ -7460,12 +6406,12 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.33.0" +version = "1.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" +checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" dependencies = [ "backtrace", - "bytes 1.4.0", + "bytes 1.5.0", "libc", "mio", "num_cpus", @@ -7474,7 +6420,6 @@ dependencies = [ "signal-hook-registry", "socket2 0.5.5", "tokio-macros", - "tracing", "windows-sys 0.48.0", ] @@ -7490,23 +6435,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.27", -] - -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", + "syn 2.0.39", ] [[package]] @@ -7517,7 +6452,7 @@ checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" dependencies = [ "rustls", "tokio", - "webpki 0.22.0", + "webpki 0.22.4", ] [[package]] @@ -7529,7 +6464,7 @@ dependencies = [ "futures-core", "pin-project-lite", "tokio", - "tokio-util 0.7.8", + "tokio-util 0.7.10", ] [[package]] @@ -7538,7 +6473,7 @@ version = "0.6.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507" dependencies = [ - "bytes 1.4.0", + "bytes 1.5.0", "futures-core", "futures-io", "futures-sink", @@ -7549,11 +6484,11 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.8" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ - "bytes 1.4.0", + "bytes 1.5.0", "futures-core", "futures-sink", "pin-project-lite", @@ -7572,14 +6507,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.6" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17e963a819c331dcacd7ab957d80bc2b9a9c1e71c804826d2f283dd65306542" +checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.19.14", + "toml_edit 0.19.15", ] [[package]] @@ -7605,24 +6540,35 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.19.14" +version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.0.0", + "indexmap 2.1.0", "serde", "serde_spanned", "toml_datetime", "winnow", ] +[[package]] +name = "toml_edit" +version = "0.20.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" +dependencies = [ + "indexmap 2.1.0", + "toml_datetime", + "winnow", +] + [[package]] name = "toml_edit" version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" dependencies = [ - "indexmap 2.0.0", + "indexmap 2.1.0", "serde", "serde_spanned", "toml_datetime", @@ -7638,7 +6584,7 @@ dependencies = [ "async-stream", "async-trait", "base64 0.13.1", - "bytes 1.4.0", + "bytes 1.5.0", "futures-core", "futures-util", "h2", @@ -7647,9 +6593,9 @@ dependencies = [ "hyper", "hyper-timeout", "percent-encoding", - "pin-project 1.1.2", - "prost 0.9.0", - "prost-derive 0.9.0", + "pin-project 1.1.3", + "prost", + "prost-derive", "tokio", "tokio-stream", "tokio-util 0.6.10", @@ -7660,34 +6606,6 @@ dependencies = [ "tracing-futures", ] -[[package]] -name = "tonic" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3082666a3a6433f7f511c7192923fa1fe07c69332d3c6a2e6bb040b569199d5a" -dependencies = [ - "async-trait", - "axum", - "base64 0.21.2", - "bytes 1.4.0", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "hyper", - "hyper-timeout", - "percent-encoding", - "pin-project 1.1.2", - "prost 0.11.9", - "tokio", - "tokio-stream", - "tower", - "tower-layer", - "tower-service", - "tracing", -] - [[package]] name = "tonic-build" version = "0.6.2" @@ -7709,7 +6627,7 @@ dependencies = [ "hex", "hex-literal", "rand 0.8.5", - "sha1 0.6.0", + "sha1", "thiserror", ] @@ -7723,12 +6641,12 @@ dependencies = [ "futures-util", "hdrhistogram", "indexmap 1.9.3", - "pin-project 1.1.2", + "pin-project 1.1.3", "pin-project-lite", "rand 0.8.5", "slab", "tokio", - "tokio-util 0.7.8", + "tokio-util 0.7.10", "tower-layer", "tower-service", "tracing", @@ -7748,11 +6666,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", @@ -7761,20 +6678,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "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", @@ -7786,26 +6703,26 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" dependencies = [ - "pin-project 1.1.2", + "pin-project 1.1.3", "tracing", ] [[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", @@ -7842,13 +6759,13 @@ dependencies = [ "log", "radix_trie", "rand 0.8.5", - "ring", + "ring 0.16.20", "rustls", "thiserror", - "time 0.3.23", + "time", "tokio", "trust-dns-proto", - "webpki 0.22.0", + "webpki 0.22.4", ] [[package]] @@ -7869,16 +6786,16 @@ dependencies = [ "lazy_static", "log", "rand 0.8.5", - "ring", + "ring 0.16.20", "rustls", - "rustls-pemfile 0.3.0", + "rustls-pemfile", "smallvec", "thiserror", "tinyvec", "tokio", "tokio-rustls", "url", - "webpki 0.22.0", + "webpki 0.22.4", ] [[package]] @@ -7887,17 +6804,6 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" -[[package]] -name = "twofish" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "728f6b7e784825d272fe9d2a77e44063f4197a570cbedc6fdcc90a6ddac91296" -dependencies = [ - "byteorder", - "cipher 0.3.0", - "opaque-debug", -] - [[package]] name = "typemap-ors" version = "1.0.0" @@ -7909,15 +6815,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" - -[[package]] -name = "ucd-trie" -version = "0.1.6" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "uint" @@ -7931,15 +6831,6 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "unicase" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" -dependencies = [ - "version_check 0.9.4", -] - [[package]] name = "unicode-bidi" version = "0.3.13" @@ -7948,9 +6839,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" @@ -7969,9 +6860,9 @@ checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "unicode-xid" @@ -8016,9 +6907,9 @@ checksum = "f28467d3e1d3c6586d8f25fa243f544f5800fec42d97032474e17222c2b75cfa" [[package]] name = "unsigned-varint" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d86a8dc7f45e4c1b0d30e43038c38f274e77af056aa5f74b93c2cf9eb3c1c836" +checksum = "6889a77d49f1f013504cec6bf97a2c730394adedaeb1deb5ea08949a50541105" [[package]] name = "untrusted" @@ -8026,14 +6917,20 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + [[package]] name = "url" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", - "idna 0.4.0", + "idna 0.5.0", "percent-encoding", "serde", ] @@ -8046,23 +6943,17 @@ checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" [[package]] name = "utf8-width" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5190c9442dcdaf0ddd50f37420417d219ae5261bbf5db120d0f9bab996c9cba1" - -[[package]] -name = "utf8parse" -version = "0.2.1" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "86bd8d4e895da8537e5315b8254664e6b769c4ff3db18321b297a1e7004392e3" [[package]] name = "uuid" -version = "1.4.1" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" +checksum = "5e395fcf16a7a3d8127ec99782007af141946b4795001f876d54fb0d55978560" dependencies = [ - "getrandom 0.2.10", + "getrandom 0.2.11", ] [[package]] @@ -8095,12 +6986,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "579a42fc0b8e0c63b76519a339be31bed574929511fa53c1a3acae26eb258f29" -[[package]] -name = "version_check" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" - [[package]] name = "version_check" version = "0.9.4" @@ -8129,9 +7014,9 @@ dependencies = [ [[package]] name = "walkdir" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" dependencies = [ "same-file", "winapi-util", @@ -8146,47 +7031,12 @@ dependencies = [ "try-lock", ] -[[package]] -name = "warp" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba431ef570df1287f7f8b07e376491ad54f84d26ac473489427231e1718e1f69" -dependencies = [ - "bytes 1.4.0", - "futures-channel", - "futures-util", - "headers", - "http", - "hyper", - "log", - "mime", - "mime_guess", - "percent-encoding", - "pin-project 1.1.2", - "rustls-pemfile 1.0.3", - "scoped-tls", - "serde", - "serde_json", - "serde_urlencoded", - "tokio", - "tokio-stream", - "tokio-util 0.7.8", - "tower-service", - "tracing", -] - [[package]] name = "wasi" 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" @@ -8195,9 +7045,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -8205,24 +7055,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.39", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.37" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +checksum = "9afec9963e3d0994cac82455b2b3502b81a7f40f9a0d32181f7528d9f4b43e02" dependencies = [ "cfg-if", "js-sys", @@ -8232,9 +7082,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -8242,22 +7092,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.39", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" [[package]] name = "wasm-logger" @@ -8272,9 +7122,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" dependencies = [ "js-sys", "wasm-bindgen", @@ -8324,7 +7174,7 @@ dependencies = [ "pango-sys", "pkg-config", "soup2-sys", - "system-deps 6.1.1", + "system-deps 6.2.0", ] [[package]] @@ -8333,18 +7183,18 @@ version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" dependencies = [ - "ring", - "untrusted", + "ring 0.16.20", + "untrusted 0.7.1", ] [[package]] name = "webpki" -version = "0.22.0" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" dependencies = [ - "ring", - "untrusted", + "ring 0.17.5", + "untrusted 0.9.0", ] [[package]] @@ -8387,13 +7237,14 @@ dependencies = [ [[package]] name = "which" -version = "4.4.0" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" dependencies = [ "either", - "libc", + "home", "once_cell", + "rustix", ] [[package]] @@ -8414,9 +7265,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi", ] @@ -8463,6 +7314,16 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "windows" +version = "0.51.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" +dependencies = [ + "windows-core", + "windows-targets", +] + [[package]] name = "windows-bindgen" version = "0.39.0" @@ -8473,6 +7334,15 @@ dependencies = [ "windows-tokens", ] +[[package]] +name = "windows-core" +version = "0.51.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +dependencies = [ + "windows-targets", +] + [[package]] name = "windows-implement" version = "0.39.0" @@ -8515,17 +7385,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] @@ -8542,9 +7412,9 @@ checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" @@ -8566,9 +7436,9 @@ checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" @@ -8590,9 +7460,9 @@ checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" @@ -8614,9 +7484,9 @@ checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" @@ -8638,9 +7508,9 @@ checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" @@ -8650,9 +7520,9 @@ checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" @@ -8674,28 +7544,19 @@ checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winnow" -version = "0.5.1" +version = "0.5.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25b5872fa2e10bd067ae946f927e726d7d603eaeb6e02fa6a350e0722d2b8c11" +checksum = "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b" dependencies = [ "memchr", ] -[[package]] -name = "winreg" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" -dependencies = [ - "winapi", -] - [[package]] name = "winreg" version = "0.51.0" @@ -8732,7 +7593,7 @@ dependencies = [ "once_cell", "serde", "serde_json", - "sha2 0.10.7", + "sha2 0.10.8", "soup2", "tao", "thiserror", @@ -8774,22 +7635,11 @@ dependencies = [ "pkg-config", ] -[[package]] -name = "x25519-dalek" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a0c105152107e3b96f6a00a65e86ce82d9b125230e1c4302940eca58ff71f4f" -dependencies = [ - "curve25519-dalek 3.2.0", - "rand_core 0.5.1", - "zeroize", -] - [[package]] name = "xattr" -version = "0.2.3" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d1526bbe5aaeb5eb06885f4d987bcdfa5e23187055de9b83fe00156a821fabc" +checksum = "f4686009f71ff3e5c4dbcf1a282d0a44db3f021ba69350cd42086b3e5f1c6985" dependencies = [ "libc", ] @@ -8809,7 +7659,7 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5d9ba232399af1783a58d8eb26f6b5006fbefe2dc9ef36bd283324792d03ea5" dependencies = [ - "futures 0.3.28", + "futures 0.3.29", "log", "nohash-hasher", "parking_lot", @@ -8824,7 +7674,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5dbecfe44343b70cc2932c3eb445425969ae21754a8ab3a0966981c1cf7af1cc" dependencies = [ "console_error_panic_hook", - "futures 0.3.28", + "futures 0.3.29", "gloo", "implicit-clone", "indexmap 1.9.3", @@ -8859,9 +7709,9 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" dependencies = [ "zeroize_derive", ] @@ -8874,5 +7724,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.39", ] diff --git a/backend/src/api/base_node_api.rs b/backend/src/api/base_node_api.rs deleted file mode 100644 index c1bc9dc1..00000000 --- a/backend/src/api/base_node_api.rs +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2021. The Tari Project -// -// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the -// following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following -// disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the -// following disclaimer in the documentation and/or other materials provided with the dist&mut ribution. -// -// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote -// products derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE -// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// - -use std::convert::TryFrom; - -use futures::StreamExt; -use log::*; -use tauri::{AppHandle, Manager, Wry}; - -use crate::{ - commands::status, - docker::ImageType, - grpc::{BaseNodeIdentity, GrpcBaseNodeClient}, -}; - -pub const ONBOARDING_PROGRESS_DESTINATION: &str = "tari://onboarding_progress"; - -const LOG_TARGET: &str = "tari_launchpad::base_node_api"; - -#[tauri::command] -pub async fn base_node_sync_progress(app: AppHandle) -> Result<(), String> { - info!(target: LOG_TARGET, "Setting up progress info stream"); - let mut client = GrpcBaseNodeClient::new(); - let mut stream = client.stream().await.map_err(|e| e.chained_message())?; - - let app_clone = app.clone(); - tauri::async_runtime::spawn(async move { - info!(target: LOG_TARGET, "Syncing blocks progress is started...."); - while let Some(progress) = stream.next().await { - debug!(target: LOG_TARGET, "Blockchain sync progress: {:?}", progress); - if let Err(err) = app_clone.emit_all(ONBOARDING_PROGRESS_DESTINATION, progress) { - warn!(target: LOG_TARGET, "Could not emit event to front-end, {:?}", err); - } - } - }); - Ok(()) -} - -#[tauri::command] -pub async fn node_identity() -> Result { - // Check if wallet container is running. - let status = status(ImageType::BaseNode).await; - if "running" == status.to_lowercase() { - let mut node_client = GrpcBaseNodeClient::new(); - let identity = node_client.identity().await.map_err(|e| e.to_string())?; - info!(target: LOG_TARGET, "SUCCESS: IDENTITY: {:?}", identity); - BaseNodeIdentity::try_from(identity) - } else { - error!( - target: LOG_TARGET, - "Base node container[image = {}] is not running", - ImageType::BaseNode - ); - Err("tari_base_node is not running".to_string()) - } -} diff --git a/backend/src/api/mod.rs b/backend/src/api/mod.rs deleted file mode 100644 index f40c087c..00000000 --- a/backend/src/api/mod.rs +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright 2021. The Tari Project -// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the -// following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following -// disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the -// following disclaimer in the documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote -// products derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE -// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -pub mod base_node_api; -pub mod wallet_api; -use std::convert::TryFrom; - -pub use base_node_api::{base_node_sync_progress, node_identity}; -use serde::Serialize; -pub use wallet_api::{ - delete_seed_words, - get_seed_words, - transaction_fee, - transfer, - wallet_balance, - wallet_events, - wallet_identity, -}; - -use crate::{ - commands::{status, ServiceSettings, DEFAULT_IMAGES}, - docker::{ImageType, TariNetwork, TariWorkspace}, - rest::quay_io::get_tag_info, -}; - -pub static TARI_NETWORKS: [TariNetwork; 4] = [ - TariNetwork::Esmeralda, - TariNetwork::Dibbler, - TariNetwork::Igor, - TariNetwork::Mainnet, -]; - -#[derive(Debug, Serialize, Default)] -#[serde(rename_all = "camelCase")] -pub struct ImageInfo { - image_name: String, - container_name: String, - display_name: String, - docker_image: String, - updated: bool, - created_on: Option, -} - -async fn from_image_type(image: ImageType, registry: Option<&str>) -> ImageInfo { - let mut info = ImageInfo { - image_name: image.image_name().to_string(), - container_name: image.container_name().to_string(), - display_name: image.display_name().to_string(), - docker_image: TariWorkspace::fully_qualified_image(image, registry), - ..Default::default() - }; - if let Ok(tag) = get_tag_info(image).await { - info.updated = tag.latest; - info.created_on = Some(tag.created_on); - } - info -} - -#[derive(Debug, Serialize)] -#[serde(rename_all = "camelCase")] -pub struct ImageListDto { - image_info: Vec, - service_recipes: Vec>, -} - -pub fn enum_to_list(enums: &[T]) -> Vec { - enums.iter().map(|enum_value| enum_value.to_string()).collect() -} - -#[tauri::command] -pub fn network_list() -> Vec { - enum_to_list::(&TARI_NETWORKS) -} - -/// Provide information about docker images and service recipes in Tari "ecosystem" -#[tauri::command] -pub async fn image_info(settings: ServiceSettings) -> ImageListDto { - let registry = settings.docker_registry.as_deref(); - let mut images: Vec = vec![]; - for image in DEFAULT_IMAGES { - images.push(from_image_type(image, registry).await); - } - - let recipes: Vec> = [ - [ImageType::BaseNode, ImageType::Tor] - .iter() - .map(|image_type| image_type.container_name().to_string()) - .collect(), - [ImageType::Wallet, ImageType::BaseNode, ImageType::Tor] - .iter() - .map(|image_type| image_type.container_name().to_string()) - .collect(), - [ - ImageType::Sha3Miner, - ImageType::Wallet, - ImageType::BaseNode, - ImageType::Tor, - ] - .iter() - .map(|image_type| image_type.container_name().to_string()) - .collect(), - [ - ImageType::MmProxy, - ImageType::XmRig, - ImageType::Wallet, - ImageType::BaseNode, - ImageType::Tor, - ] - .iter() - .map(|image_type| image_type.container_name().to_string()) - .collect(), - ] - .to_vec(); - - ImageListDto { - image_info: images, - service_recipes: recipes, - } -} - -#[tauri::command] -pub async fn health_check(image: String) -> String { - match ImageType::try_from(image.as_str()) { - Ok(img) => status(img).await, - Err(_err) => format!("image {} not found", image), - } -} diff --git a/backend/src/api/wallet_api.rs b/backend/src/api/wallet_api.rs deleted file mode 100644 index 20924347..00000000 --- a/backend/src/api/wallet_api.rs +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright 2021. The Tari Project -// -// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the -// following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following -// disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the -// following disclaimer in the documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote -// products derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE -// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -use std::convert::TryFrom; - -use futures::StreamExt; -use log::{debug, error, info, warn}; -use tauri::{AppHandle, Manager, Wry}; - -use crate::{ - commands::status, - docker::{ImageType, TariWorkspace}, - grpc::{GrpcWalletClient, TransferFunds, TransferFundsResult, WalletBalance, WalletIdentity, WalletTransaction}, - AppState, -}; - -#[tauri::command] -pub async fn wallet_identity() -> Result { - // Check if wallet container is running. - let status = status(ImageType::Wallet).await; - if "running" == status.to_lowercase() { - let mut wallet_client = GrpcWalletClient::new(); - let identity = wallet_client.identity().await.map_err(|e| e.to_string())?; - info!("SUCCESS: IDENTITY: {:?}", identity); - WalletIdentity::try_from(identity) - } else { - error!("Wallet container[image = {}] is not running", ImageType::Wallet); - Err("Wallet is not running".to_string()) - } -} - -#[tauri::command] -pub async fn wallet_balance() -> Result { - // Check if wallet container is running. - let status = status(ImageType::Wallet).await; - if "running" == status.to_lowercase() { - let mut wallet_client = GrpcWalletClient::new(); - let balance = wallet_client.balance().await.map_err(|e| e.to_string())?; - Ok(WalletBalance::from(balance)) - } else { - error!("Wallet container[image = {}] is not running", ImageType::Wallet); - Err("Wallet is not running".to_string()) - } -} - -#[tauri::command] -pub async fn wallet_events(app: AppHandle) -> Result<(), String> { - info!("Setting up event stream"); - let mut wallet_client = GrpcWalletClient::new(); - let mut stream = wallet_client.stream().await.map_err(|e| e.chained_message())?; - let app_clone = app.clone(); - tauri::async_runtime::spawn(async move { - while let Some(response) = stream.next().await { - if let Some(value) = response.transaction { - let wt = WalletTransaction { - event: value.event, - tx_id: value.tx_id, - source_pk: value.source_pk, - dest_pk: value.dest_pk, - status: value.status, - direction: value.direction, - amount: value.amount, - message: value.message, - is_coinbase: value.is_coinbase, - }; - - if let Err(err) = app_clone.emit_all("tari://wallet_event", wt) { - warn!("Could not emit event to front-end, {:?}", err); - } - } - } - info!("Event stream has closed."); - }); - Ok(()) -} - -#[tauri::command] -pub async fn transfer(app: AppHandle, funds: TransferFunds) -> Result { - // Check if wallet container is running. - debug!("Transfer funds: {:?}", funds); - let app_clone = app.clone(); - let status = status(ImageType::Wallet).await; - if "running" == status.to_lowercase() { - let mut wallet_client = GrpcWalletClient::new(); - let response = wallet_client - .transfer_funds(funds.clone()) - .await - .map_err(|e| e.to_string())?; - info!("Transfering funds {:?} succeeded: {:?}", funds, response); - - if let Err(err) = app_clone.emit_all("tari://wallet_transaction", response.clone()) { - warn!("Could not emit transaction event to front-end, {:?}", err); - } - Ok(response) - } else { - error!("Wallet container[image = {}] is not running", ImageType::Wallet); - Err("Wallet is not running".to_string()) - } -} - -#[tauri::command] -pub async fn get_seed_words(app: AppHandle) -> Result, String> { - // Check if wallet container is running. - let status = status(ImageType::Wallet).await; - if "running" == status.to_lowercase() { - let state = app.state::(); - let mut wrapper = state.workspaces.write().await; - - let workspace: &mut TariWorkspace = wrapper.get_workspace_mut("default").expect("This should be fine"); - - let seed_words = workspace.get_seed_words().unwrap().unwrap(); - - Ok(seed_words) - } else { - error!("Wallet container[image = {}] is not running", ImageType::Wallet); - Err("Wallet is not running".to_string()) - } -} - -#[tauri::command] -pub async fn delete_seed_words(app: AppHandle) -> Result<(), String> { - // Check if wallet container is running. - let status = status(ImageType::Wallet).await; - if "running" == status.to_lowercase() { - let state = app.state::(); - let mut wrapper = state.workspaces.write().await; - - let workspace: &mut TariWorkspace = wrapper.get_workspace_mut("default").expect("This should be fine"); - - workspace.delete_seed_words().map_err(|e| e.to_string()) - } else { - error!("Wallet container[image = {}] is not running", ImageType::Wallet); - Err("Wallet is not running".to_string()) - } -} - -#[tauri::command] -pub async fn transaction_fee() -> Result { - // @TODO - replace with real transaction fees [microT] - Ok(1790) -} diff --git a/backend/src/commands/cleanup.rs b/backend/src/commands/cleanup.rs deleted file mode 100644 index d5e4d3eb..00000000 --- a/backend/src/commands/cleanup.rs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2022. The Tari Project -// -// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the -// following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following -// disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the -// following disclaimer in the documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote -// products derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE -// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// - -use std::convert::TryFrom; - -use anyhow::Error; -use tauri::{AppHandle, Manager, Wry}; - -use crate::{ - commands::ServiceSettings, - docker::{remove_all_containers, remove_all_volumes, shutdown_all_containers, LaunchpadConfig}, - AppState, - DEFAULT_WORKSPACE_NAME, -}; - -#[tauri::command] -pub async fn clean_docker(app: AppHandle, settings: ServiceSettings) -> Result<(), String> { - clean_docker_impl(app, settings).await.map_err(|err| err.to_string()) -} - -async fn clean_docker_impl(app: AppHandle, settings: ServiceSettings) -> Result<(), Error> { - let state = app.state::(); - let config = LaunchpadConfig::try_from(settings)?; - shutdown_all_containers(DEFAULT_WORKSPACE_NAME, &state.docker) - .await - .ok(); - remove_all_containers(DEFAULT_WORKSPACE_NAME, &state.docker).await.ok(); - remove_all_volumes(DEFAULT_WORKSPACE_NAME, config.tari_network, &state.docker) - .await - .ok(); - Ok(()) -} diff --git a/backend/src/commands/create_workspace.rs b/backend/src/commands/create_workspace.rs deleted file mode 100644 index 3add084f..00000000 --- a/backend/src/commands/create_workspace.rs +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2021. The Tari Project -// -// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the -// following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following -// disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the -// following disclaimer in the documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote -// products derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE -// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// - -use std::{ - env, - path::{Path, PathBuf}, - str::FromStr, -}; - -use log::*; -use tauri::{ - api::path::{resolve_path, BaseDirectory}, - AppHandle, - Config, - Manager, - PackageInfo, - Wry, -}; - -use crate::{commands::AppState, docker::create_workspace_folders, error::LauncherError}; - -/// Create a new workspace environment by creating a folder hierarchy (if required) at the `root_folder`, and copying -/// the default config files into it. -#[tauri::command] -pub fn create_new_workspace(app: AppHandle, root_path: Option) -> Result<(), String> { - let config = app.config(); - let package_info = &app.state::().package_info; - let path = root_path - .as_ref() - .map(|r| PathBuf::from_str(r.as_str()).unwrap()) - .unwrap_or_else(|| env::temp_dir().join("tari")); - debug!("Creating workspace at {:?}", path); - create_workspace_folders(&path).map_err(|e| e.chained_message())?; - copy_config_file(path.as_path(), config.as_ref(), package_info, "log4rs.yml").map_err(|e| e.chained_message())?; - copy_config_file(path.as_path(), config.as_ref(), package_info, "config.toml").map_err(|e| e.chained_message())?; - copy_config_file(path.as_path(), config.as_ref(), package_info, "promtail.config.yml") - .map_err(|e| e.chained_message())?; - copy_config_file(path.as_path(), config.as_ref(), package_info, "sources_provision.yml") - .map_err(|e| e.chained_message())?; - copy_config_file(path.as_path(), config.as_ref(), package_info, "defaults.ini").map_err(|e| e.chained_message())?; - copy_config_file(path.as_path(), config.as_ref(), package_info, "loki_config.yml") - .map_err(|e| e.chained_message())?; - info!("Workspace at {:?} complete!", path); - Ok(()) -} - -pub fn copy_config_file>( - root_path: S, - config: &Config, - package_info: &PackageInfo, - file: &str, -) -> Result<(), LauncherError> { - let path = Path::new("assets").join(file); - let config_path = resolve_path( - config, - package_info, - &Default::default(), - &path, - Some(BaseDirectory::Resource), - )?; - let cfg = std::fs::read_to_string(&config_path).expect("The config assets were not bundled with the App"); - info!("Configuration file ({}) loaded", file); - debug!("{}", cfg); - let dest = root_path.as_ref().join("config").join(file); - std::fs::write(&dest, &cfg)?; - info!("Configuration file ({}) saved to workspace", file); - Ok(()) -} diff --git a/backend/src/commands/events.rs b/backend/src/commands/events.rs deleted file mode 100644 index 01859483..00000000 --- a/backend/src/commands/events.rs +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2021. The Tari Project -// -// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the -// following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following -// disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the -// following disclaimer in the documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote -// products derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE -// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// - -use futures::StreamExt; -use log::*; -use tauri::{AppHandle, Manager, Wry}; - -use crate::commands::AppState; - -/// Subscribe to system-level docker events, such as container creation, volume, network events etc. -/// This function does not actually return a result, but async commands have a [bug](https://github.com/tauri-apps/tauri/issues/2533) -/// which is avoided by returning a `Result`. -/// -/// A side effect of this command is that events are emitted to the `tari://docker-system-event` channel. Front-ends -/// can listen to this event stream to read in the event messages. -#[tauri::command] -pub async fn events(app: AppHandle) -> Result<(), ()> { - info!("Setting up event stream"); - let state = app.state::(); - let mut stream = state.docker.events().await; - let app_clone = app.clone(); - tauri::async_runtime::spawn(async move { - while let Some(event_result) = stream.next().await { - match event_result { - Ok(event) => { - debug!("Event received: {:?}", event); - if let Err(err) = app_clone.emit_all(event_name(), event) { - warn!("Could not emit event to front-end, {:?}", err); - } - }, - Err(err) => { - warn!("Error in event stream: {:#?}", err) - }, - }; - } - info!("Event stream has closed."); - }); - Ok(()) -} - -/// Extract data from the event object so we know which channel to emit the payload to -pub fn event_name() -> &'static str { - "tari://docker-system-event" -} diff --git a/backend/src/commands/health_check.rs b/backend/src/commands/health_check.rs deleted file mode 100644 index d10bd6f7..00000000 --- a/backend/src/commands/health_check.rs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2021. The Tari Project -// -// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the -// following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following -// disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the -// following disclaimer in the documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote -// products derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE -// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// - -use bollard::Docker; - -use crate::docker::{container_state, DockerWrapperError, ImageType, DOCKER_INSTANCE}; - -pub const NOT_FOUND: &str = "not found"; - -/// Read current container's status from Docker. -/// If container is not found then not.found is returned. -pub async fn container_status(container_id_or_name: &str) -> String { - let container_status = docker_info(&DOCKER_INSTANCE, container_id_or_name).await; - match container_status { - Ok(status) => status, - Err(_) => NOT_FOUND.to_string(), - } -} - -/// Returns the status for the image. If container is not created not found is -pub async fn status(image: ImageType) -> String { - let current_state = match container_state(image.container_name()) { - Some(state) => state, - None => return NOT_FOUND.to_string(), - }; - container_status(current_state.id().as_str()).await -} - -async fn docker_info(docker: &Docker, container_id: &str) -> Result { - use DockerWrapperError::*; - let status = docker - .inspect_container(container_id, None) - .await? - .state - .ok_or(StateIsEmpty)? - .status - .ok_or(StatusIsEmpty)? - .to_string(); - Ok(status) -} diff --git a/backend/src/commands/host.rs b/backend/src/commands/host.rs deleted file mode 100644 index efb04043..00000000 --- a/backend/src/commands/host.rs +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright 2021. The Tari Project -// -// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the -// following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following -// disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the -// following disclaimer in the documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote -// products derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE -// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// - -use std::process::Command; - -use bollard::system::Version; -use log::*; -use tauri::{api::path::home_dir, AppHandle, Wry}; - -use crate::docker::DOCKER_INSTANCE; - -const LOG_TARGET: &str = "tari_launchpad::host"; - -#[tauri::command] -pub async fn check_docker() -> Result { - let version: Version = DOCKER_INSTANCE.clone().version().await.map_err(|e| { - error!(target: LOG_TARGET, "Failed check docker version: {}", e); - "The docker version cannot be run" - })?; - - Ok(version) -} - -#[tauri::command] -pub async fn open_terminal(_app: AppHandle, platform: String) -> Result<(), String> { - let terminal_path = if let Some(home_dir_path) = home_dir() { - match home_dir_path.into_os_string().into_string() { - Ok(path) => path, - Err(_oss_err) => { - error!(target: LOG_TARGET, "Failed to convert home directory path to string"); - return Err("Failed to convert home directory path to string".to_string()); - }, - } - } else { - return Err("Failed to get home directory".to_string()); - }; - - if platform.to_lowercase().trim() == "darwin" { - Command::new("open") - .arg("-a") - .arg("Terminal") - .arg(&terminal_path) - .spawn() - .map_err(|e| { - error!( - target: LOG_TARGET, - "Failed to open terminal with path {}. Error: {}", terminal_path, e - ); - format!("Terminal cannot be opened. cmd: open -a Terminal {}", terminal_path) - })?; - } else if platform.to_lowercase().trim() == "windows_nt" { - Command::new("powershell") - .arg("-command") - .arg("start") - .arg("powershell") - .spawn() - .map_err(|e| { - error!("Failed to start powershell Error: {}", e); - "Terminal cannot be opened. cmd: powershell -command start powershell".to_string() - })?; - } else if platform.to_lowercase().trim() == "linux" { - Command::new("gnome-terminal") - .arg("--working-directory") - .arg(&terminal_path) - .spawn() - .map_err(|e| { - error!("Failed to open terminal with path {}. Error: {}", terminal_path, e); - format!( - "Terminal cannot be opened. cmd: gnome-terminal --working-directory {}", - terminal_path - ) - })?; - } else { - return Err(format!("Unsupported platform: {}", platform)); - }; - - Ok(()) -} - -#[tauri::command] -pub async fn check_internet_connection() -> Result { - // @TODO - add https://crates.io/crates/online - // Return 'true' if online, 'false' if offline - Ok(true) -} diff --git a/backend/src/commands/launch_docker.rs b/backend/src/commands/launch_docker.rs deleted file mode 100644 index e971efb8..00000000 --- a/backend/src/commands/launch_docker.rs +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright 2021. The Tari Project -// -// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the -// following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following -// disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the -// following disclaimer in the documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote -// products derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE -// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// - -use std::{convert::TryFrom, path::PathBuf, time::Duration}; - -use derivative::Derivative; -use log::*; -use serde::{Deserialize, Serialize}; -use tauri::{AppHandle, Manager, Wry}; - -use crate::{ - commands::AppState, - docker::{ - helpers::create_password, - BaseNodeConfig, - DockerWrapperError, - LaunchpadConfig, - MmProxyConfig, - Sha3MinerConfig, - TariNetwork, - TariWorkspace, - WalletConfig, - XmRigConfig, - DEFAULT_MINING_ADDRESS, - }, - error::LauncherError, -}; - -#[derive(Derivative, Serialize, Deserialize)] -#[derivative(Debug)] -#[allow(clippy::struct_excessive_bools)] -pub struct WorkspaceLaunchOptions { - root_folder: String, - tari_network: String, - has_base_node: bool, - has_wallet: bool, - has_sha3_miner: bool, - has_mm_proxy: bool, - has_xmrig: bool, - wait_for_tor: Option, - #[derivative(Debug = "ignore")] - #[serde(skip_serializing)] - wallet_password: Option, - sha3_mining_threads: Option, - monerod_url: Option, - monero_username: Option, - #[derivative(Debug = "ignore")] - #[serde(skip_serializing)] - monero_password: Option, - monero_use_auth: Option, - monero_mining_address: Option, - docker_registry: Option, - docker_tag: Option, -} - -impl TryFrom for LaunchpadConfig { - type Error = LauncherError; - - fn try_from(options: WorkspaceLaunchOptions) -> Result { - let tari_network = TariNetwork::try_from(options.tari_network.to_lowercase().as_str())?; - let tor_control_password = create_password(16); - let tor_delay = Duration::from_secs(options.wait_for_tor.unwrap_or(10)); - let base_node = if options.has_base_node { - Some(BaseNodeConfig { delay: tor_delay }) - } else { - None - }; - let wallet = if options.has_wallet { - if options.wallet_password.is_none() { - return Err(LauncherError::ConfigVariableRequired( - "wallet".to_string(), - "wallet_password".to_string(), - )); - } - Some(WalletConfig { - delay: tor_delay, - password: options.wallet_password.unwrap(), - }) - } else { - None - }; - let sha3_miner = if options.has_sha3_miner { - Some(Sha3MinerConfig { - delay: Duration::from_secs(options.wait_for_tor.unwrap_or(15)), - num_mining_threads: options.sha3_mining_threads.unwrap_or(1), - }) - } else { - None - }; - let mm_proxy = if options.has_mm_proxy { - let mut config = MmProxyConfig { - delay: Duration::from_secs(options.wait_for_tor.unwrap_or(15)), - ..Default::default() - }; - if let Some(val) = options.monerod_url { - config.monerod_url = val; - } - if let Some(val) = options.monero_username { - config.monero_username = val; - } - if let Some(val) = options.monero_password { - config.monero_password = val; - } - if let Some(val) = options.monero_use_auth { - config.monero_use_auth = val; - } - Some(config) - } else { - None - }; - let xmrig = if options.has_xmrig { - let monero_mining_address = options - .monero_mining_address - .unwrap_or_else(|| DEFAULT_MINING_ADDRESS.to_string()); - Some(XmRigConfig { - delay: Duration::from_secs(options.wait_for_tor.unwrap_or(20)), - monero_mining_address, - }) - } else { - None - }; - Ok(LaunchpadConfig { - data_directory: PathBuf::from(options.root_folder), - tari_network, - tor_control_password, - base_node, - wallet, - sha3_miner, - mm_proxy, - xmrig, - registry: options.docker_registry, - tag: options.docker_tag, - }) - } -} - -/// This is an example of how we might launch a recipe. It's not currently used in the front-end, but essentially it -/// launches all the containers in a choreographed fashion to stand up the entire mining infra. -#[tauri::command] -pub async fn launch_docker(app: AppHandle, name: String, config: WorkspaceLaunchOptions) -> Result<(), String> { - launch_docker_impl(app, name, config) - .await - .map_err(|e| e.chained_message()) -} - -async fn launch_docker_impl( - app: AppHandle, - name: String, - config: WorkspaceLaunchOptions, -) -> Result<(), LauncherError> { - debug!("Starting docker launch sequence"); - let state = app.state::(); - let should_create_workspace = { - let wrapper = state.workspaces.read().await; - !wrapper.workspace_exists(name.as_str()) - }; // drop read-only lock - { - let mut wrapper = state.workspaces.write().await; - // Now that we have a write lock, we can create a new workspace if required - if should_create_workspace { - let config = LaunchpadConfig::try_from(config)?; - info!( - "Docker workspace does not exist. Creating one with config, {:#?}", - config - ); - wrapper.create_workspace(name.as_str(), config)?; - } - info!("Launching Tari workspace, {}", name); - let workspace: &mut TariWorkspace = wrapper - .get_workspace_mut(name.as_str()) - .ok_or(DockerWrapperError::UnexpectedError)?; - // Pipe docker container logs to Tauri using namespaced events - workspace.start_recipe(&state.docker).await?; - } // Drop write lock - info!("Tari system, {} has launched", name); - Ok(()) -} diff --git a/backend/src/commands/mod.rs b/backend/src/commands/mod.rs deleted file mode 100644 index 5f5f4d42..00000000 --- a/backend/src/commands/mod.rs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2021. The Tari Project -// -// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the -// following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following -// disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the -// following disclaimer in the documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote -// products derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE -// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// - -/// ! This module defines all the Tauri commands we expose to the front-end. -/// ! These are generally constructed as wrappers around the lower-level methods in the `docker` module. -/// ! All the commands follow roughly the same pattern: -/// ! - handle input parameters -/// ! - call the the underlying function -/// ! - Map results to JSON and errors to String. -mod cleanup; -mod create_workspace; -mod events; -mod health_check; -mod host; -mod launch_docker; -mod pull_images; -mod service; -mod shutdown; -mod state; - -pub use cleanup::clean_docker; -pub use create_workspace::create_new_workspace; -pub use events::events; -pub use health_check::status; -pub use host::{check_docker, check_internet_connection, open_terminal}; -pub use launch_docker::launch_docker; -pub use pull_images::{pull_image, pull_images, DEFAULT_IMAGES}; -pub use service::{create_default_workspace, start_service, stop_service, ServiceSettings}; -pub use shutdown::shutdown; -pub use state::AppState; diff --git a/backend/src/commands/pull_images.rs b/backend/src/commands/pull_images.rs deleted file mode 100644 index bbda7ad0..00000000 --- a/backend/src/commands/pull_images.rs +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright 2021. The Tari Project -// -// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the -// following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following -// disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the -// following disclaimer in the documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote -// products derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE -// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// - -use std::convert::TryFrom; - -use bollard::models::CreateImageInfo; -use futures::{future::join_all, stream::StreamExt, TryFutureExt}; -use log::{debug, error, warn}; -use serde::Serialize; -use tauri::{AppHandle, Manager, Wry}; - -use crate::{docker::ImageType, AppState}; - -const LOG_TARGET: &str = "tari::launchpad::commands::pull_images"; - -#[derive(Debug, Clone, Serialize)] -pub struct Payload { - image: String, - name: String, - info: CreateImageInfo, -} - -pub static DEFAULT_IMAGES: [ImageType; 9] = [ - ImageType::Tor, - ImageType::BaseNode, - ImageType::Wallet, - ImageType::Sha3Miner, - ImageType::XmRig, - ImageType::MmProxy, - ImageType::Loki, - ImageType::Promtail, - ImageType::Grafana, -]; - -#[derive(Debug, Clone, Serialize)] -pub struct PullProgressInfo { - image_name: Option, - id: Option, - status: Option, - error: Option, - progress: Option, - current: Option, - total: Option, -} - -fn from(image_name: String, source: CreateImageInfo) -> PullProgressInfo { - PullProgressInfo { - image_name: Some(image_name), - id: source.id, - status: source.status, - error: source.error, - progress: source.progress, - current: if let Some(details) = source.progress_detail.clone() { - details.current - } else { - None - }, - total: if let Some(details) = source.progress_detail { - details.total - } else { - None - }, - } -} - -/// Pulls all the images concurrently using the docker API. -#[tauri::command] -pub async fn pull_images(app: AppHandle) -> Result<(), String> { - debug!(target: LOG_TARGET, "Command pull_images invoked"); - let futures = DEFAULT_IMAGES - .iter() - .map(|image| pull_image(app.clone(), image.image_name()).map_err(|e| format!("error pulling image: {}", e))); - let results: Vec> = join_all(futures).await; - let errors = results - .into_iter() - .filter(|r| r.is_err()) - .map(|e| e.unwrap_err()) - .collect::>(); - if !errors.is_empty() { - error!(target: LOG_TARGET, "Error pulling images:{}", errors.join("\n")); - return Err(errors.join("\n")); - } - Ok(()) -} - -#[tauri::command] -pub async fn pull_image(app: AppHandle, image_name: &str) -> Result<(), String> { - let image = ImageType::try_from(image_name).map_err(|_err| format!("invalid image name: {}", image_name))?; - let full_image_name = image.pull_name(); - let state = app.state::(); - let mut stream = state.docker.pull_latest_image(full_image_name.clone()).await; - while let Some(update) = stream.next().await { - match update { - Ok(source) => { - let progress = from(full_image_name.clone(), source); - debug!(target: LOG_TARGET, "Image pull progress:{:?}", progress); - if let Err(err) = app.emit_all("tari://image_pull_progress", progress) { - warn!(target: LOG_TARGET, "Could not emit event to front-end, {:?}", err); - } - }, - Err(err) => return Err(format!("Error reading docker progress: {}", err)), - }; - } - Ok(()) -} - -#[tokio::test] -#[ignore] -async fn pull_image_test() { - use crate::docker::{DockerWrapper, TariWorkspace}; - let fully_qualified_image = TariWorkspace::fully_qualified_image(ImageType::BaseNode, None); - let docker = DockerWrapper::connect().unwrap(); - let mut stream = docker.pull_latest_image(fully_qualified_image.clone()).await; - while let Some(update) = stream.next().await { - match update { - Ok(source) => println!("Image pull progress:{:?}", from(fully_qualified_image.clone(), source)), - Err(_err) => (), - }; - } -} diff --git a/backend/src/commands/service.rs b/backend/src/commands/service.rs deleted file mode 100644 index 03c8aeb1..00000000 --- a/backend/src/commands/service.rs +++ /dev/null @@ -1,376 +0,0 @@ -// Copyright 2021. The Tari Project -// -// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the -// following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following -// disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the -// following disclaimer in the documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote -// products derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE -// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// - -use std::{convert::TryFrom, path::PathBuf, time::Duration}; - -use bollard::Docker; -use derivative::Derivative; -use futures::StreamExt; -use log::*; -use serde::{Deserialize, Serialize}; -use tauri::{AppHandle, Manager, State, Wry}; - -use crate::{ - commands::{create_workspace::copy_config_file, AppState}, - docker::{ - container_state, - create_workspace_folders, - helpers::create_password, - BaseNodeConfig, - ContainerId, - DockerWrapperError, - ImageType, - LaunchpadConfig, - MmProxyConfig, - Sha3MinerConfig, - TariNetwork, - TariWorkspace, - WalletConfig, - XmRigConfig, - DEFAULT_MINING_ADDRESS, - DEFAULT_MONEROD_URL, - DEFAULT_WORKSPACE_NAME, - }, - error::LauncherError, -}; - -/// "Global" settings from the launcher front-end -#[derive(Clone, Derivative, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct ServiceSettings { - pub tari_network: String, - pub root_folder: String, - #[derivative(Debug = "ignore")] - pub parole: Option, - pub wallet_password: Option, - pub monero_mining_address: Option, - pub num_mining_threads: i64, - pub docker_registry: Option, - pub docker_tag: Option, - pub monerod_url: Option, - pub monero_username: Option, - #[derivative(Debug = "ignore")] - pub monero_password: Option, - pub monero_use_auth: Option, -} - -impl TryFrom for LaunchpadConfig { - type Error = LauncherError; - - fn try_from(settings: ServiceSettings) -> Result { - let tari_network = TariNetwork::try_from(settings.tari_network.to_lowercase().as_str())?; - let tor_control_password = create_password(16); - // Since most services are launched manually, we set the delay value to zero. - let zero_delay = Duration::from_secs(0); - let base_node = BaseNodeConfig { delay: zero_delay }; - let wallet = WalletConfig { - delay: zero_delay, - password: settings.wallet_password.unwrap_or_else(|| "".to_string()), - }; - let sha3_miner = Sha3MinerConfig { - delay: zero_delay, - num_mining_threads: usize::try_from(settings.num_mining_threads).unwrap(), - }; - let mut mm_proxy = MmProxyConfig { - delay: zero_delay, - monerod_url: settings.monerod_url.unwrap_or_else(|| DEFAULT_MONEROD_URL.to_string()), - ..Default::default() - }; - if let Some(val) = settings.monero_use_auth { - mm_proxy.monero_use_auth = val; - mm_proxy.monero_username = settings.monero_username.unwrap_or_else(|| "".to_string()); - mm_proxy.monero_password = settings.monero_password.unwrap_or_else(|| "".to_string()); - } - let monero_mining_address = settings - .monero_mining_address - .unwrap_or_else(|| DEFAULT_MINING_ADDRESS.to_string()); - let xmrig = XmRigConfig { - delay: Duration::from_secs(15), // Needs to wait for mm_proxy to be ready - monero_mining_address, - }; - Ok(LaunchpadConfig { - data_directory: PathBuf::from(settings.root_folder), - tari_network, - tor_control_password, - base_node: Some(base_node), - wallet: Some(wallet), - sha3_miner: Some(sha3_miner), - mm_proxy: Some(mm_proxy), - xmrig: Some(xmrig), - registry: settings.docker_registry, - tag: settings.docker_tag, - }) - } -} - -/// [`start_service`] returns some useful info that the front-end can use to control the docker environment. -/// In particular, the log and stats event names tell the front end which channels events will be broadcast on. -#[derive(Clone, Debug, Serialize)] -#[serde(rename_all(serialize = "camelCase"))] -pub struct StartServiceResult { - /// The name of the service that was created - name: String, - /// The docker id of the container. Some commands need an id rather than the name. - id: String, - /// What action was taken. Currently not used. - action: String, - /// The name of the event stream to subscribe to for log events. These are the _docker_ logs and not the base node - /// _et. al._ logs. Those are saved to disk and accessible using the usual means, or with grafana. - log_events_name: String, - /// The name of the event stream to subscribe to for resource events (CPU, memory etc). - stats_events_name: String, -} - -/// Starts the specified service -/// -/// The workspace will be created if this is the first call to `start_service`. Otherwise, the settings from the first -/// call will be used and `settings` will be ignored. -/// -/// Starting a service also: -/// - creates a new workspace, if required -/// - creates a network for the network, if required -/// - creates new volumes, if required -/// - creates new node identities, if required -/// - launches the container -/// - creates the log stream -/// - creates the resource stats stream -#[tauri::command] -pub async fn start_service( - app: AppHandle, - service_name: String, - settings: ServiceSettings, -) -> Result { - debug!("start_service called {}", service_name); - start_service_impl(app, service_name, settings).await.map_err(|e| { - let error = e.chained_message(); - error!("{}", error); - error - }) -} - -/// Stops the specified service -/// -/// Stops the container, if it is running. action is " -/// Then, deletes the container. -/// Returns the container id -#[tauri::command] -pub async fn stop_service(state: State<'_, AppState>, service_name: String) -> Result<(), String> { - stop_service_impl(state, service_name).await.map_err(|e| e.to_string()) -} - -/// The "default" workspace is one that is used in the manual front-end configuration (each container is started and -/// stopped manually) -#[tauri::command] -pub async fn create_default_workspace(app: AppHandle, settings: ServiceSettings) -> Result { - create_default_workspace_impl(app, settings).await.map_err(|e| { - let error = e.chained_message(); - error!("{}", error); - error - }) -} - -async fn create_default_workspace_impl(app: AppHandle, settings: ServiceSettings) -> Result { - let config = LaunchpadConfig::try_from(settings)?; - let state = app.state::(); - let app_config = app.config(); - let should_create_workspace = { - let wrapper = state.workspaces.read().await; - !wrapper.workspace_exists(DEFAULT_WORKSPACE_NAME) - }; // drop read-only lock - if should_create_workspace { - let package_info = &state.package_info; - create_workspace_folders(&config.data_directory)?; - copy_config_file(&config.data_directory, app_config.as_ref(), package_info, "log4rs.yml")?; - copy_config_file(&config.data_directory, app_config.as_ref(), package_info, "config.toml")?; - copy_config_file( - &config.data_directory, - app_config.as_ref(), - package_info, - "promtail.config.yml", - )?; - copy_config_file( - &config.data_directory, - app_config.as_ref(), - package_info, - "sources_provision.yml", - )?; - copy_config_file( - &config.data_directory, - app_config.as_ref(), - package_info, - "defaults.ini", - )?; - copy_config_file( - &config.data_directory, - app_config.as_ref(), - package_info, - "loki_config.yml", - )?; - // Only get a write-lock if we need one - let mut wrapper = state.workspaces.write().await; - wrapper.create_workspace(DEFAULT_WORKSPACE_NAME, config)?; - } - Ok(should_create_workspace) -} - -async fn start_service_impl( - app: AppHandle, - service_name: String, - settings: ServiceSettings, -) -> Result { - debug!("Starting {} service", service_name); - let state = app.state::(); - let docker = &state.docker; - let _ = create_default_workspace_impl(app.clone(), settings).await?; - let mut wrapper = state.workspaces.write().await; - // We've just checked this, so it should never fail: - let workspace: &mut TariWorkspace = wrapper - .get_workspace_mut("default") - .ok_or(DockerWrapperError::UnexpectedError)?; - // Check the identity requirements for the service - let ids = workspace.create_or_load_identities()?; - for id in ids.values() { - debug!("Identity loaded: {}", id); - } - // Check network requirements for the service - if !workspace.network_exists(docker).await? { - workspace.create_network(docker).await?; - } - // Launch the container - let image = ImageType::try_from(service_name.as_str())?; - let container_name = workspace.start_service(image, docker).await?; - let state = container_state(container_name.as_str()).ok_or(DockerWrapperError::UnexpectedError)?; - let id = state.id().to_string(); - let stats_events_name = stats_event_name(state.id()); - let log_events_name = log_event_name(state.name()); - // Set up event streams - container_logs( - app.clone(), - log_events_name.as_str(), - container_name.as_str(), - docker, - workspace, - ); - container_stats( - app.clone(), - stats_events_name.as_str(), - container_name.as_str(), - docker, - workspace, - ); - // Collect data for the return object - let result = StartServiceResult { - name: service_name, - id, - action: "unimplemented".to_string(), - log_events_name, - stats_events_name, - }; - info!("Tari service {} has launched", image.container_name()); - Ok(result) -} - -pub fn log_event_name(container_name: &str) -> String { - format!("tari://docker_log_{}", container_name) -} - -pub fn stats_event_name(container_id: &ContainerId) -> String { - format!("tari://docker_stats_{}", container_id.as_str()) -} - -fn container_logs( - app: AppHandle, - event_name: &str, - container_name: &str, - docker: &Docker, - workspace: &mut TariWorkspace, -) { - info!("Setting up log events for {}", container_name); - if let Some(mut stream) = workspace.logs(container_name, docker) { - let event_name = event_name.to_string(); - tauri::async_runtime::spawn(async move { - while let Some(message) = stream.next().await { - trace!("log event: {:?}", message); - let emit_result = match message { - Ok(payload) => app.emit_all(event_name.as_str(), payload), - Err(err) => app.emit_all(format!("{}_error", event_name).as_str(), err.chained_message()), - }; - if let Err(err) = emit_result { - warn!("Error emitting event: {}", err.to_string()); - } - } - info!("Log stream for {} has closed.", event_name); - }); - info!("Container log events configured."); - } else { - info!( - "Log events could not be configured: {} is not a running container", - container_name - ); - } -} - -fn container_stats( - app: AppHandle, - event_name: &str, - container_name: &str, - docker: &Docker, - workspace: &mut TariWorkspace, -) { - info!("Setting up Resource stats events for {}", container_name); - if let Some(mut stream) = workspace.resource_stats(container_name, docker) { - let event_name = event_name.to_string(); - tauri::async_runtime::spawn(async move { - while let Some(message) = stream.next().await { - trace!("log event: {:?}", message); - let emit_result = match message { - Ok(payload) => app.emit_all(event_name.as_str(), payload), - Err(err) => app.emit_all(format!("{}_error", event_name).as_str(), err.chained_message()), - }; - if let Err(err) = emit_result { - warn!("Error emitting event: {}", err.to_string()); - } - } - info!("Resource stats stream for {} has closed.", event_name); - }); - info!("Resource stats events configured."); - } else { - info!( - "Resource stats events could not be configured: {} is not a running container", - container_name - ); - } -} - -async fn stop_service_impl(state: State<'_, AppState>, service_name: String) -> Result<(), LauncherError> { - let mut wrapper = state.workspaces.write().await; - debug!("Stopping {} service", service_name); - // We've just checked this, so it should never fail: - let workspace: &mut TariWorkspace = wrapper - .get_workspace_mut("default") - .ok_or_else(|| DockerWrapperError::WorkspaceDoesNotExist("default".into()))?; - workspace - .stop_container(service_name.as_str(), true, &state.docker) - .await; - Ok(()) -} diff --git a/backend/src/commands/shutdown.rs b/backend/src/commands/shutdown.rs deleted file mode 100644 index c9d0c2e0..00000000 --- a/backend/src/commands/shutdown.rs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2021. The Tari Project -// -// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the -// following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following -// disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the -// following disclaimer in the documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote -// products derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE -// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// - -use log::*; -use tauri::State; - -use crate::commands::AppState; - -/// Gracefully shutdown all containers and delete them. Blockchain volumes are preserved. -#[tauri::command] -// Return a Result until https://github.com/tauri-apps/tauri/issues/2533 is fixed -pub async fn shutdown(state: State<'_, AppState>) -> Result { - info!("Shutting down"); - let mut workspaces = state.workspaces.write().await; - let msg = match workspaces.shutdown(&state.docker).await { - Ok(()) => { - info!("Docker has shut down"); - "Docker has shut down" - }, - Err(e) => { - warn!("Docker may not have shut down gracefully. {}", e.chained_message()); - "Docker was not cleanly shut down. See logs for details" - }, - }; - Ok(msg.to_string()) -} diff --git a/backend/src/commands/state.rs b/backend/src/commands/state.rs deleted file mode 100644 index 8e1fc90a..00000000 --- a/backend/src/commands/state.rs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2021. The Tari Project -// -// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the -// following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the -// following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the -// following disclaimer in the documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote -// products derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED -// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY -// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH -// DAMAGE. - -use tauri::PackageInfo; -use tokio::sync::RwLock; - -use crate::docker::{DockerWrapper, Workspaces}; - -/// The state variables that are managed by Tauri. Since the whole app is asynchronous, we need to store -/// * the [`Workspaces`] object. This tracks global config settings, which containers we are running, and what their -/// status is. -/// * A handle to the docker API, via the [`DockerWrapper`] struct. The convenience function [`docker_handle`] gives you -/// a cheap, thread-safe clone to the underlying docker API. -/// * Package info, because Tauri doesn't give us an easy way to get at that in command callbacks for some reason. -/// -/// Things that are mutable (docker, workspaces) are behind an [`RwLock`] for thread safety. -pub struct AppState { - pub docker: DockerWrapper, - pub workspaces: RwLock, - pub package_info: PackageInfo, -} - -impl AppState { - pub fn new(docker: DockerWrapper, workspaces: Workspaces, package_info: PackageInfo) -> Self { - Self { - docker, - workspaces: RwLock::new(workspaces), - package_info, - } - } -} diff --git a/backend/src/docker/cleanup.rs b/backend/src/docker/cleanup.rs deleted file mode 100644 index c918b947..00000000 --- a/backend/src/docker/cleanup.rs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2022. The Tari Project -// -// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the -// following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following -// disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the -// following disclaimer in the documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote -// products derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE -// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// - -use bollard::Docker; - -use super::{DockerWrapperError, TariNetwork, DEFAULT_IMAGES}; - -pub async fn remove_all_containers(_workspace_name: &str, docker: &Docker) -> Result<(), DockerWrapperError> { - for image in DEFAULT_IMAGES { - let full_image_name = image.pull_name(); - docker.remove_image(&full_image_name, None, None).await.ok(); - } - Ok(()) -} - -pub async fn remove_all_volumes( - workspace_name: &str, - network: TariNetwork, - docker: &Docker, -) -> Result<(), DockerWrapperError> { - let name = super::tari_blockchain_volume_name(workspace_name, network); - docker.remove_volume(&name, None).await?; - Ok(()) -} diff --git a/backend/src/docker/container.rs b/backend/src/docker/container.rs deleted file mode 100644 index 773f3b11..00000000 --- a/backend/src/docker/container.rs +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2021. The Tari Project -// -// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the -// following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following -// disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the -// following disclaimer in the documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote -// products derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE -// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// - -use log::debug; - -use super::{ContainerState, ContainerStatus, DockerWrapperError, CONTAINERS}; - -/// Add the container info to the list of containers the wrapper is managing -pub fn add_container(id: &str, state: ContainerState) { - // let id = ContainerId::from(container.id.clone()); - // let state = ContainerState::new(name.to_string(), id, container); - CONTAINERS.write().unwrap().insert(id.to_string(), state); -} - -// Tag the container with name/id `id` as Running -pub fn change_container_status(id: &str, status: ContainerStatus) -> Result<(), DockerWrapperError> { - if let Some(container) = CONTAINERS.write().unwrap().get_mut(id) { - if status == container.status() { - debug!("Status is already set to: {:?}", status.clone()); - } else { - match status { - ContainerStatus::Created => (), - ContainerStatus::Running => container.running(), - ContainerStatus::Stopped => container.set_stop(), - ContainerStatus::Deleted => container.set_deleted(), - } - } - Ok(()) - } else { - Err(DockerWrapperError::ContainerNotFound(id.to_string())) - } -} -/// Get the state of the container by name or id. -pub fn container_state(id: &str) -> Option { - CONTAINERS.read().unwrap().get(id).cloned() -} diff --git a/backend/src/docker/error.rs b/backend/src/docker/error.rs deleted file mode 100644 index 93eae0c1..00000000 --- a/backend/src/docker/error.rs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2021. The Tari Project -// -// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the -// following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following -// disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the -// following disclaimer in the documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote -// products derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE -// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// - -use std::error::Error; - -use tari_common::exit_codes::ExitError; -use thiserror::Error; - -#[derive(Debug, Error)] -pub enum DockerWrapperError { - #[error("Something went wrong with the Docker API")] - DockerError(#[from] bollard::errors::Error), - #[error("Something went wrong on your filesystem")] - FileSystemError(#[from] std::io::Error), - #[error("The requested container id, {0} is not being managed by the wrapper")] - ContainerNotFound(String), - #[error("The designated workspace, {0}, already exists")] - WorkspaceAlreadyExists(String), - #[error("The designated workspace, {0}, does not exist")] - WorkspaceDoesNotExist(String), - #[error("The network is not supported")] - UnsupportedNetwork, - #[error("It should not be possible to be in this error state")] - UnexpectedError, - #[error("Could not create an identity file")] - IdentityError(#[from] ExitError), - #[error("The specified image type is not supported")] - InvalidImageType, - #[error("Could not remove the seed file")] - SeedFileRemovalError, - #[error("Could not read the seed file")] - SeedFileReadError, - #[error("State is empty")] - StateIsEmpty, - #[error("Status is empty")] - StatusIsEmpty, -} - -impl DockerWrapperError { - /// Combine all error messages down the chain into one string. - pub fn chained_message(&self) -> String { - let mut messages = vec![self.to_string()]; - let mut this = self as &dyn Error; - while let Some(next) = this.source() { - messages.push(next.to_string()); - this = next; - } - messages.join(" caused by:\n") - } -} diff --git a/backend/src/docker/filesystem.rs b/backend/src/docker/filesystem.rs deleted file mode 100644 index 53892861..00000000 --- a/backend/src/docker/filesystem.rs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2021. The Tari Project -// -// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the -// following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following -// disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the -// following disclaimer in the documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote -// products derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE -// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// - -//! This module does setup and clean up of the host's file system. -//! -//! The docker environment places some files in a volume, e.g. the blockchain db, but other files need to be accessible -//! from the host system, such as logs, and identity files. These all live in a 'workspace' folder, with several sub- -//! directories for the individual components living under it. - -use std::{fs, path::Path}; - -use log::*; -use strum::IntoEnumIterator; - -use crate::docker::{DockerWrapperError, ImageType}; - -/// Creates the folders required for a new workspace off of the given root folder. -/// IF the folders already exist, then nothing happens. -/// On Linux, the permissions are also set to allow world access -pub fn create_workspace_folders>(root: P) -> Result<(), DockerWrapperError> { - if !root.as_ref().exists() { - info!("Creating new workspace at {}", root.as_ref().to_str().unwrap_or("???")); - fs::create_dir_all(&root)?; - } - let make_subfolder = |folder: &str| -> Result<(), std::io::Error> { - let p = root.as_ref().join(folder); - let p_str = p.as_path().to_str().unwrap_or("???"); - if p.exists() { - info!("{} already exists", p_str); - Ok(()) - } else { - info!("Creating new data folder, {}", p_str); - fs::create_dir_all(&p)?; - #[cfg(any(target_os = "linux", target_os = "macos"))] - { - use std::os::unix::fs::PermissionsExt; - let mut perms = std::fs::metadata(&p)?.permissions(); - perms.set_mode(0o777); - fs::set_permissions(&p, perms)?; - } - Ok(()) - } - }; - info!("Making config folder"); - make_subfolder("config")?; - for image in ImageType::iter() { - debug!("Making folder for image:{:?}", image); - make_subfolder(image.data_folder())?; - } - Ok(()) -} diff --git a/backend/src/docker/helpers.rs b/backend/src/docker/helpers.rs deleted file mode 100644 index 3c32bbb1..00000000 --- a/backend/src/docker/helpers.rs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2021. The Tari Project -// -// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the -// following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following -// disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the -// following disclaimer in the documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote -// products derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE -// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// - -use rand::distributions::{Alphanumeric, Distribution}; - -/// Create a cryptographically secure password on length `len` -pub fn create_password(len: usize) -> String { - let mut rng = rand::thread_rng(); - Alphanumeric.sample_iter(&mut rng).take(len).map(char::from).collect() -} diff --git a/backend/src/docker/mod.rs b/backend/src/docker/mod.rs deleted file mode 100644 index d27e17b5..00000000 --- a/backend/src/docker/mod.rs +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright 2021. The Tari Project -// -// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the -// following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following -// disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the -// following disclaimer in the documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote -// products derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE -// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// - -mod cleanup; -mod container; -mod error; -mod filesystem; -mod models; -pub mod mounts; -mod settings; -mod workspace; -mod wrapper; - -pub mod helpers; -use std::{collections::HashMap, sync::RwLock}; - -use bollard::{ - container::{Config, CreateContainerOptions, ListContainersOptions, NetworkingConfig, RemoveContainerOptions}, - models::{ContainerCreateResponse, EndpointSettings, HostConfig}, - Docker, -}; -pub use cleanup::{remove_all_containers, remove_all_volumes}; -pub use container::{add_container, change_container_status, container_state}; -pub use error::DockerWrapperError; -pub use filesystem::create_workspace_folders; -use log::{debug, info}; -pub use models::{ContainerId, ContainerState, ContainerStatus, ImageType, LogMessage, TariNetwork}; -pub use settings::{ - BaseNodeConfig, - LaunchpadConfig, - MmProxyConfig, - Sha3MinerConfig, - WalletConfig, - XmRigConfig, - BASE_NODE_GRPC_ADDRESS_URL, - DEFAULT_MINING_ADDRESS, - DEFAULT_MONEROD_URL, - WALLET_GRPC_ADDRESS_URL, -}; -pub use workspace::{TariWorkspace, Workspaces}; -pub use wrapper::DockerWrapper; - -use crate::commands::DEFAULT_IMAGES; - -lazy_static! { - pub static ref DOCKER_INSTANCE: Docker = Docker::connect_with_local_defaults().unwrap(); -} - -lazy_static! { - pub static ref CONTAINERS: RwLock> = RwLock::new(HashMap::new()); -} - -pub static DEFAULT_WORKSPACE_NAME: &str = "default"; - -fn tari_blockchain_volume_name(tari_workspace: &str, tari_network: TariNetwork) -> String { - format!("{}_{}_volume", tari_workspace, tari_network.lower_case()) -} - -pub async fn try_create_container( - image: ImageType, - fully_qualified_image_name: String, - tari_workspace: String, - config: &LaunchpadConfig, - docker: &DockerWrapper, -) -> Result { - debug!("{} has configuration object: {:#?}", fully_qualified_image_name, config); - let args = config.command(image).await; - let envars = config.environment(image); - let volumes = config.volumes(image); - let ports = config.ports(image); - let port_map = config.port_map(image); - let mounts = config.mounts(image, tari_blockchain_volume_name(&tari_workspace, config.tari_network)); - let mut endpoints = HashMap::new(); - let endpoint = EndpointSettings { - aliases: Some(vec![image.container_name().to_string()]), - ..Default::default() - }; - endpoints.insert(format!("{}_network", tari_workspace), endpoint); - let options = Some(CreateContainerOptions { - name: format!("{}_{}", tari_workspace, image.image_name()), - platform: None, - }); - let config = Config:: { - image: Some(fully_qualified_image_name.to_string()), - attach_stdin: Some(false), - attach_stdout: Some(false), - attach_stderr: Some(false), - exposed_ports: Some(ports), - open_stdin: Some(true), - stdin_once: Some(false), - tty: Some(true), - env: Some(envars), - volumes: Some(volumes), - cmd: Some(args), - host_config: Some(HostConfig { - binds: Some(vec![]), - network_mode: Some("bridge".to_string()), - port_bindings: Some(port_map), - mounts: Some(mounts), - ..Default::default() - }), - networking_config: Some(NetworkingConfig { - endpoints_config: endpoints, - }), - ..Default::default() - }; - - Ok(docker.create_container(options, config).await?) -} - -pub async fn try_destroy_container(image_name: &str, docker: &DockerWrapper) -> Result<(), DockerWrapperError> { - let mut list_container_filters = HashMap::new(); - list_container_filters.insert("name".to_string(), vec![image_name.to_string()]); - debug!("Searching for container {}", image_name); - let containers = &docker - .list_containers(Some(ListContainersOptions { - all: true, - filters: list_container_filters, - ..Default::default() - })) - .await?; - - for c_id in containers.iter() { - if let Some(id) = c_id.id.clone() { - debug!("Removing countainer {}", id); - docker - .remove_container( - id.as_str(), - Some(RemoveContainerOptions { - force: true, - ..Default::default() - }), - ) - .await?; - } - } - Ok(()) -} - -pub async fn shutdown_all_containers(workspace_name: &str, docker: &DockerWrapper) -> Result<(), DockerWrapperError> { - for image in DEFAULT_IMAGES { - let image_name = format!("{}_{}", workspace_name, image.image_name()); - match try_destroy_container(image_name.as_str(), docker).await { - Ok(_) => info!("Docker image {} is being stopped.", image_name), - Err(_) => debug!("Docker image {} has not been found", image_name), - } - } - Ok(()) -} diff --git a/backend/src/docker/models.rs b/backend/src/docker/models.rs deleted file mode 100644 index 50d93e47..00000000 --- a/backend/src/docker/models.rs +++ /dev/null @@ -1,308 +0,0 @@ -// Copyright 2021. The Tari Project -// -// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the -// following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following -// disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the -// following disclaimer in the documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote -// products derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE -// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// - -use core::fmt; -use std::{ - convert::TryFrom, - fmt::{Display, Formatter}, -}; - -use bollard::{container::LogOutput, models::ContainerCreateResponse}; -use serde::{Deserialize, Serialize}; -use strum::EnumIter; - -use super::TariWorkspace; -use crate::docker::DockerWrapperError; - -//------------------------------------------- ContainerId ---------------------------------------------- -#[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub struct ContainerId(pub String); - -impl From for ContainerId { - fn from(s: String) -> Self { - Self(s) - } -} - -impl AsRef for ContainerId { - fn as_ref(&self) -> &str { - self.0.as_str() - } -} - -impl Display for ContainerId { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - f.write_str(self.0.as_str()) - } -} - -impl ContainerId { - pub fn as_str(&self) -> &str { - self.0.as_str() - } -} - -//------------------------------------------- ContainerStatus ---------------------------------------------- - -#[derive(Debug, PartialEq, Eq, Clone, Copy)] -pub enum ContainerStatus { - Created, - Running, - Stopped, - Deleted, -} - -//------------------------------------------- ContainerState ---------------------------------------------- - -#[derive(Debug, Clone, PartialEq)] -pub struct ContainerState { - name: String, - id: ContainerId, - info: ContainerCreateResponse, - status: ContainerStatus, -} - -impl ContainerState { - pub fn new(name: String, id: ContainerId, info: ContainerCreateResponse) -> Self { - Self { - name, - id, - info, - status: ContainerStatus::Created, - } - } - - pub fn running(&mut self) { - self.status = ContainerStatus::Running; - } - - pub fn set_stop(&mut self) { - self.status = ContainerStatus::Stopped; - } - - pub fn set_deleted(&mut self) { - self.status = ContainerStatus::Deleted; - } - - pub fn name(&self) -> &str { - self.name.as_str() - } - - pub fn id(&self) -> &ContainerId { - &self.id - } - - pub fn status(&self) -> ContainerStatus { - self.status - } -} - -//------------------------------------------- LogMessage ---------------------------------------------- - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct LogMessage { - pub message: String, - pub source: String, -} - -impl From for LogMessage { - fn from(log: LogOutput) -> Self { - let (source, message) = match log { - LogOutput::StdErr { message } => ("StdErr".to_string(), String::from_utf8_lossy(&message).into_owned()), - LogOutput::StdOut { message } => ("StdOut".to_string(), String::from_utf8_lossy(&message).into_owned()), - LogOutput::Console { message } => ("Console".to_string(), String::from_utf8_lossy(&message).into_owned()), - LogOutput::StdIn { message } => ("StdIn".to_string(), String::from_utf8_lossy(&message).into_owned()), - }; - Self { source, message } - } -} - -//------------------------------------------- TariNetwork ---------------------------------------------- - -/// Supported networks for the launchpad -#[derive(Serialize, Debug, Deserialize, Clone, Copy)] -pub enum TariNetwork { - Igor, - Nextnet, - Stagenet, - Mainnet, -} - -impl TariNetwork { - pub fn lower_case(self) -> &'static str { - match self { - Self::Igor => "igor", - Self::Nextnet => "nextnet", - Self::Stagenet => "stagenet", - Self::Mainnet => "mainnet", - } - } - - pub fn upper_case(self) -> &'static str { - match self { - Self::Igor => "IGOR", - Self::Nextnet => "NEXTNET", - Self::Stagenet => "STAGENET", - Self::Mainnet => "MAINNET", - } - } -} - -/// Default network is Stagenet. This will change after mainnet launch -impl Default for TariNetwork { - fn default() -> Self { - Self::Stagenet - } -} - -impl TryFrom<&str> for TariNetwork { - type Error = DockerWrapperError; - - fn try_from(value: &str) -> Result { - match value { - "igor" => Ok(TariNetwork::Igor), - "nextnet" => Ok(TariNetwork::Nextnet), - "stagenet" => Ok(TariNetwork::Stagenet), - "mainnet" => Ok(TariNetwork::Mainnet), - _ => Err(DockerWrapperError::UnsupportedNetwork), - } - } -} - -//------------------------------------------- ImageType ---------------------------------------------- - -#[derive(Debug, Clone, Copy, EnumIter, PartialEq, Eq, Hash, Serialize)] -pub enum ImageType { - Tor, - BaseNode, - Wallet, - XmRig, - Sha3Miner, - MmProxy, - Monerod, - Loki, - Promtail, - Grafana, -} - -impl ImageType { - pub fn image_name(&self) -> &str { - match self { - Self::Tor => "tor", - Self::BaseNode => "tari_base_node", - Self::Wallet => "tari_wallet", - Self::XmRig => "xmrig", - Self::Sha3Miner => "tari_sha3_miner", - Self::MmProxy => "tari_mm_proxy", - Self::Monerod => "monerod", - Self::Loki => "loki", - Self::Promtail => "promtail", - Self::Grafana => "grafana", - } - } - - pub fn display_name(&self) -> &str { - match self { - Self::Tor => "Tor", - Self::BaseNode => "Base Node", - Self::Wallet => "Wallet", - Self::XmRig => "Xmrig", - Self::Sha3Miner => "SHA3 miner", - Self::MmProxy => "MM proxy", - Self::Monerod => "Monerod", - Self::Loki => "Loki", - Self::Promtail => "Promtail", - Self::Grafana => "Grafana", - } - } - - pub fn container_name(&self) -> &str { - match self { - Self::Tor => "tor", - Self::BaseNode => "base_node", - Self::Wallet => "wallet", - Self::XmRig => "xmrig", - Self::Sha3Miner => "sha3_miner", - Self::MmProxy => "mm_proxy", - Self::Monerod => "monerod", - Self::Loki => "loki", - Self::Promtail => "promtail", - Self::Grafana => "grafana", - } - } - - pub fn data_folder(&self) -> &str { - match self { - Self::Tor => "tor", - Self::BaseNode => "base_node", - Self::Wallet => "wallet", - Self::XmRig => "xmrig", - Self::Sha3Miner => "sha3_miner", - Self::MmProxy => "mm_proxy", - Self::Monerod => "monerod", - Self::Loki => "grafana", - Self::Promtail => "grafana", - Self::Grafana => "grafana", - } - } - - pub fn pull_name(self) -> String { - match self { - Self::Loki | Self::Promtail | Self::Grafana => format!("grafana/{}:latest", self.image_name()), - _ => TariWorkspace::fully_qualified_image(self, None), - } - } -} - -impl TryFrom<&str> for ImageType { - type Error = DockerWrapperError; - - fn try_from(value: &str) -> Result { - let s = value.to_lowercase(); - match s.as_str() { - "tor" => Ok(Self::Tor), - "base_node" | "base node" => Ok(Self::BaseNode), - "wallet" => Ok(Self::Wallet), - "xmrig" => Ok(Self::XmRig), - "sha3_miner" | "sha3 miner" => Ok(Self::Sha3Miner), - "mm_proxy" | "mm proxy" => Ok(Self::MmProxy), - "monerod" | "monero" => Ok(Self::Monerod), - "loki" => Ok(Self::Loki), - "promtail" => Ok(Self::Promtail), - "grafana" => Ok(Self::Grafana), - _ => Err(DockerWrapperError::InvalidImageType), - } - } -} - -impl fmt::Display for TariNetwork { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{:?}", self) - } -} - -impl fmt::Display for ImageType { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{:?}", self) - } -} diff --git a/backend/src/docker/mounts.rs b/backend/src/docker/mounts.rs deleted file mode 100644 index 42d95b24..00000000 --- a/backend/src/docker/mounts.rs +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2022 The Tari Project -// SPDX-License-Identifier: BSD-3-Clause - -use std::path::Path; - -use bollard::models::{Mount, MountTypeEnum}; - -pub struct Mounts { - mounts: Vec, -} - -impl Mounts { - pub fn empty() -> Self { - Self { mounts: Vec::new() } - } - - pub fn into_docker_mounts(self) -> Vec { - self.mounts - } - - pub fn with_blockchain(mut self, volume_name: String) -> Self { - let mount = Mount { - target: Some("/blockchain".to_string()), - source: Some(volume_name), - typ: Some(MountTypeEnum::VOLUME), - volume_options: None, - ..Default::default() - }; - self.mounts.push(mount); - self - } - - pub fn bind>(mut self, source: P, target: &str) -> Self { - let source = canonicalize(source); - let mount = Mount { - target: Some(target.to_string()), - source: Some(source), - typ: Some(MountTypeEnum::BIND), - bind_options: None, - ..Default::default() - }; - self.mounts.push(mount); - self - } - - pub fn with_general>(data_dir: P) -> Self { - Mounts::empty().bind(data_dir, "/var/tari") - } - - pub fn with_grafana(mut self, volume_name: String) -> Self { - let mount = Mount { - target: Some("/grafana".to_string()), - source: Some(volume_name), - typ: Some(MountTypeEnum::VOLUME), - volume_options: None, - ..Default::default() - }; - self.mounts.push(mount); - self - } -} - -// FIXME: This might be replaceable by std::fs::canonicalize, but I don't have a windows machine to check -fn canonicalize>(path: P) -> String { - #[cfg(target_os = "windows")] - let path = format!( - "//{}", - path.as_ref() - .iter() - .filter_map(|part| { - use std::{ffi::OsStr, path}; - - use regex::Regex; - - if part == OsStr::new(&path::MAIN_SEPARATOR.to_string()) { - None - } else { - let drive = Regex::new(r"(?P[A-Za-z]):").unwrap(); - let part = part.to_string_lossy().to_string(); - if drive.is_match(part.as_str()) { - Some(drive.replace(part.as_str(), "$letter").to_lowercase()) - } else { - Some(part) - } - } - }) - .collect::>() - .join("/") - ); - #[cfg(target_os = "macos")] - let path = format!("/host_mnt{}", path.as_ref().to_string_lossy()); - #[cfg(target_os = "linux")] - let path = path.as_ref().to_string_lossy().to_string(); - path -} diff --git a/backend/src/docker/settings.rs b/backend/src/docker/settings.rs deleted file mode 100644 index 9fb85dee..00000000 --- a/backend/src/docker/settings.rs +++ /dev/null @@ -1,543 +0,0 @@ -// Copyright 2021. The Tari Project -// -// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the -// following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following -// disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the -// following disclaimer in the documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote -// products derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE -// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// - -use std::{collections::HashMap, path::PathBuf, time::Duration}; - -use bollard::models::{Mount, PortBinding, PortMap}; -use derivative::Derivative; -use serde::{Deserialize, Serialize}; -use tari_common_types::types::PublicKey; -use tari_utilities::{byte_array::ByteArray, hex::Hex}; -use thiserror::Error; -use tor_hash_passwd::EncryptedKey; - -use crate::{ - api::node_identity, - docker::{models::ImageType, mounts::Mounts, TariNetwork}, -}; - -// TODO get a proper mining address for each network -pub const DEFAULT_MINING_ADDRESS: &str = - "5AJ8FwQge4UjT9Gbj4zn7yYcnpVQzzkqr636pKto59jQcu85CFsuYVeFgbhUdRpiPjUCkA4sQtWApUzCyTMmSigFG2hDo48"; - -pub const DEFAULT_MONEROD_URL: &str = "http://stagenet.xmr-tw.org:38081,\ -http://stagenet.community.xmr.to:38081,\ -http://monero-stagenet.exan.tech:38081,\ -http://xmr-lux.boldsuck.org:38081,\ -http://singapore.node.xmr.pm:38081"; - -pub const WALLET_GRPC_ADDRESS_URL: &str = "http://127.0.0.1:18143"; -pub const BASE_NODE_GRPC_ADDRESS_URL: &str = "http://127.0.0.1:18142"; - -#[derive(Default, Debug, Serialize, Deserialize)] -pub struct BaseNodeConfig { - /// The time delay before starting the container and running the base node executable - pub delay: Duration, -} - -#[derive(Default, Derivative, Serialize, Deserialize)] -#[derivative(Debug)] -pub struct WalletConfig { - /// The time delay before starting the container and running the wallet executable - pub delay: Duration, - /// The password to de/en-crypt the wallet database - #[serde(skip_serializing)] - #[derivative(Debug = "ignore")] - pub password: String, -} - -#[derive(Default, Debug, Serialize, Deserialize)] -pub struct XmRigConfig { - /// The time delay before starting the container and running the monero miner executable - pub delay: Duration, - /// The address that will accept Monero mining rewards - pub monero_mining_address: String, -} - -#[derive(Default, Debug, Serialize, Deserialize)] -pub struct Sha3MinerConfig { - /// The time delay before starting the container and running the SHA3 CPU miner executable - pub delay: Duration, - /// The number of threads to employ for SHA3 mining - pub num_mining_threads: usize, -} - -#[derive(Derivative, Serialize, Deserialize)] -#[derivative(Debug)] -pub struct MmProxyConfig { - /// The time delay before starting the container and running the proxy executable - pub delay: Duration, - /// A URL specifying the Monero daemon to connect to - pub monerod_url: String, - /// If required, the monero username for the monero daemon - pub monero_username: String, - /// If required, the password needed to access the monero deamon - #[serde(skip_serializing)] - #[derivative(Debug = "ignore")] - pub monero_password: String, - /// If true, provide the monero username and password to the daemon. Otherwise those strings are ignored. - pub monero_use_auth: bool, -} - -impl Default for MmProxyConfig { - fn default() -> Self { - MmProxyConfig { - delay: Duration::from_secs(5), - monerod_url: DEFAULT_MONEROD_URL.to_string(), - monero_username: "".to_string(), - monero_password: "".to_string(), - monero_use_auth: false, - } - } -} - -impl MmProxyConfig { - pub fn monero_use_auth(&self) -> usize { - if self.monero_use_auth { - 1 - } else { - 0 - } - } -} - -/// Tari Launchpad configuration struct. This will generally be populated from some front-end or persistent storage -/// file and is used to generate the environment variables needed to configure and run the various docker containers. -#[derive(Default, Debug, Serialize, Deserialize)] -pub struct LaunchpadConfig { - /// The directory to use for config, id files and logs - pub data_directory: PathBuf, - /// The Tari network to use. Default = dibbler - pub tari_network: TariNetwork, - /// The tor control password to share among containers. - pub tor_control_password: String, - /// Whether to spin up a base node or not, with the given configuration. Usually you want this. - pub base_node: Option, - /// Whether to spin up a console wallet daemon, with the given configuration. Optional. - pub wallet: Option, - /// Whether to spin up a SHA3 miner or not, with the given configuration. If you want to mine Tari natively, - /// include this. - pub sha3_miner: Option, - /// Whether to spin up a merge-mine proxy or not, with the given configuration. If included, you must also include - /// xmrig - pub mm_proxy: Option, - /// Whether to spin up a Monero miner or not, with the given configuration. If included you should also include - /// mm_proxy - pub xmrig: Option, - /// The Docker registry to use to download images. By default we use quay.io - pub registry: Option, - /// The docker tag to use. By default, we use 'latest' - pub tag: Option, -} - -impl LaunchpadConfig { - /// Returns a list of environment variables that need to be set in the running container. For Tari containers, we - /// use this to override settings in the `config.yml` file that are generated on the fly here (the tor control - /// port password for example). - pub fn environment(&self, image_type: ImageType) -> Vec { - match image_type { - ImageType::BaseNode => self.base_node_environment(), - ImageType::Wallet => self.wallet_environment(), - ImageType::XmRig => self.xmrig_environment(), - ImageType::Sha3Miner => self.sha3_miner_environment(), - ImageType::MmProxy => self.mm_proxy_environment(), - ImageType::Tor => self.tor_environment(), - ImageType::Monerod => self.monerod_environment(), - ImageType::Loki => self.grafana_environment(), - ImageType::Promtail => self.grafana_environment(), - ImageType::Grafana => self.grafana_environment(), - } - } - - /// Provides a hashmap that bollard needs to mount the volumes we want for each image type. - pub fn volumes(&self, image_type: ImageType) -> HashMap> { - match image_type { - ImageType::BaseNode => self.build_volumes(true, true), - ImageType::Wallet => self.build_volumes(true, false), - ImageType::XmRig => self.build_volumes(true, false), - ImageType::Sha3Miner => self.build_volumes(true, false), - ImageType::MmProxy => self.build_volumes(true, false), - ImageType::Tor => self.build_volumes(false, false), - ImageType::Monerod => self.build_volumes(false, false), - ImageType::Loki => self.build_grafana_volumes(), - ImageType::Promtail => self.build_grafana_volumes(), - ImageType::Grafana => self.build_grafana_volumes(), - } - } - - /// Similar to [`volumes`], provides a bollard configuration for mounting volumes. - pub fn mounts(&self, image_type: ImageType, volume_name: String) -> Vec { - let mounts = match image_type { - ImageType::BaseNode => Mounts::with_general(&self.data_directory).with_blockchain(volume_name), - ImageType::Wallet => Mounts::with_general(&self.data_directory).with_blockchain(volume_name), - ImageType::XmRig => Mounts::with_general(&self.data_directory), - ImageType::Sha3Miner => Mounts::with_general(&self.data_directory), - ImageType::MmProxy => Mounts::with_general(&self.data_directory), - ImageType::Tor => Mounts::empty(), - ImageType::Monerod => Mounts::empty(), - ImageType::Loki => Mounts::with_general(&self.data_directory).bind( - self.data_directory.join("config").join("loki_config.yml"), - "/etc/loki/local-config.yaml", - ), - ImageType::Promtail => Mounts::with_general(&self.data_directory) - .with_grafana(volume_name) - .bind( - self.data_directory.join("config").join("promtail.config.yml"), - "/etc/promtail/config.yml", - ), - ImageType::Grafana => Mounts::with_general(&self.data_directory) - .bind( - self.data_directory.join("config").join("defaults.ini"), - "/usr/share/grafana/conf/defaults.ini", - ) - .bind( - self.data_directory.join("config").join("sources_provision.yml"), - "/etc/grafana/provisioning/datasources/all.yml", - ), - }; - mounts.into_docker_mounts() - } - - /// Returns a map of ports to expose to the host system. TODO - remove the hardcoding so that multiple workspaces - /// don't have colliding exposed ports. - pub fn ports(&self, image_type: ImageType) -> HashMap> { - match image_type { - ImageType::BaseNode => create_port_map(&["18142", "18189"]), - ImageType::Wallet => create_port_map(&["18143", "18188"]), - ImageType::XmRig => create_port_map(&[]), - ImageType::Sha3Miner => create_port_map(&[]), - ImageType::MmProxy => create_port_map(&[]), - ImageType::Tor => create_port_map(&[]), - ImageType::Monerod => create_port_map(&[]), - ImageType::Loki => create_port_map(&["18310"]), - ImageType::Promtail => create_port_map(&["18980"]), - ImageType::Grafana => create_port_map(&["18300"]), - } - } - - /// As for [`ports`] returns a bollard configuration for port mappings. - pub fn port_map(&self, image_type: ImageType) -> PortMap { - let ports = self.ports(image_type); - ports - .into_iter() - .map(|(k, _)| { - let binding = vec![PortBinding { - host_ip: Some("".to_string()), - host_port: Some(k.clone()), - }]; - (k, Some(binding)) - }) - .collect() - } - - /// Return the command line arguments we want for the given container execution. - pub async fn command(&self, image_type: ImageType) -> Vec { - match image_type { - ImageType::BaseNode => self.base_node_cmd(), - ImageType::Wallet => self.wallet_cmd().await, - ImageType::XmRig => self.xmrig_cmd(), - ImageType::Sha3Miner => self.miner_cmd(), - ImageType::MmProxy => self.mm_proxy_cmd(), - ImageType::Tor => self.tor_cmd(), - ImageType::Monerod => self.monerod_cmd(), - ImageType::Loki => self.loki_cmd(), - ImageType::Promtail => self.promtail_cmd(), - ImageType::Grafana => self.grafana_cmd(), - } - } - - /// Returns the canonical path to the id files. The canonical path is defined as - /// `{root_path}/{image_data_folder}/config/{network}/{image_type}_id.json` - pub fn id_path(&self, root_path: &str, image_type: ImageType) -> Option { - match image_type { - ImageType::BaseNode | ImageType::Wallet => Some( - PathBuf::from(root_path) - .join(image_type.data_folder()) - .join("config") - .join(self.tari_network.lower_case()) - .join(format!("{}_id.json", image_type.image_name())), - ), - _ => None, - } - } - - pub fn seed_words_path(&self, root_path: &str, image_type: ImageType) -> Option { - match image_type { - ImageType::Wallet => Some(PathBuf::from(root_path).join("config").join("seed_words.txt")), - _ => None, - } - } - - fn base_node_cmd(&self) -> Vec { - let args = vec!["--log-config=/var/tari/config/log4rs.yml", "-n", "--watch=status"]; - args.into_iter().map(String::from).collect() - } - - async fn wallet_cmd(&self) -> Vec { - let base_node_id = node_identity().await.expect("Couldn't get the node identity"); - let pub_key = PublicKey::from_bytes(&base_node_id.public_key).expect("Couldn't convert the pubkey"); - let base_node_cmd = format!( - "-p wallet.custom_base_node={}::{}", - pub_key.to_hex(), - base_node_id.public_address - ); - - let args = vec![ - "--log-config=/var/tari/config/log4rs.yml", - "--seed-words-file=/var/tari/config/seed_words.txt", - "--enable-grpc", - "-n", - &base_node_cmd, - ]; - args.into_iter().map(String::from).collect() - } - - fn miner_cmd(&self) -> Vec { - let args = vec!["--log-config=/var/tari/config/log4rs.yml"]; - args.into_iter().map(String::from).collect() - } - - fn mm_proxy_cmd(&self) -> Vec { - let args = vec!["--log-config=/var/tari/config/log4rs.yml"]; - args.into_iter().map(String::from).collect() - } - - fn xmrig_cmd(&self) -> Vec { - let args = vec![ - "--url=mm_proxy:18081", - "--user=${TARI_MONERO_WALLET_ADDRESS}", - "--coin=monero", - "--daemon", - "--log-file=/var/tari/xmrig/xmrig.log", - "--verbose", - ]; - args.into_iter().map(String::from).collect() - } - - fn monerod_cmd(&self) -> Vec { - let network = match self.tari_network { - TariNetwork::Mainnet => "--mainnet", - _ => "--stagenet", - }; - let args = vec![ - "--non-interactive", - "--restricted-rpc", - "--rpc-bind-ip=0.0.0.0", - "--confirm-external-bind", - "--enable-dns-blocklist", - "--log-file=/home/monerod/monerod.log", - "--fast-block-sync=1", - "--prune-blockchain", - network, - ]; - args.into_iter().map(String::from).collect() - } - - fn tor_cmd(&self) -> Vec { - let hashed_password = EncryptedKey::hash_password(self.tor_control_password.as_str()).to_string(); - let args = vec![ - "--SocksPort", - "0.0.0.0:9050", - "--ControlPort", - "0.0.0.0:9051", - "--CookieAuthentication", - "0", - "--ClientOnly", - "1", - "--ClientUseIPv6", - "1", - "--HashedControlPassword", - hashed_password.as_str(), - "--allow-missing-torrc", - ]; - args.into_iter().map(String::from).collect() - } - - fn loki_cmd(&self) -> Vec { - let args = vec!["-config.file=/etc/loki/local-config.yaml"]; - args.into_iter().map(String::from).collect() - } - - fn promtail_cmd(&self) -> Vec { - let args = vec!["-config.file=/etc/promtail/config.yml"]; - args.into_iter().map(String::from).collect() - } - - fn grafana_cmd(&self) -> Vec { - vec![] - } - - /// Returns the bollard configuration map. You can specify any/all of the host-mounted data folder, of the - /// blockchain folder to map. - pub fn build_volumes(&self, general: bool, tari_blockchain: bool) -> HashMap> { - let mut volumes = HashMap::new(); - if general { - volumes.insert("/var/tari".to_string(), HashMap::<(), ()>::new()); - } - if tari_blockchain { - volumes.insert("/blockchain".to_string(), HashMap::new()); - } - volumes - } - - pub fn build_grafana_volumes(&self) -> HashMap> { - let mut volumes = self.build_volumes(true, false); - volumes.insert("/var/grafana".to_string(), HashMap::new()); - volumes - } - - fn common_envars(&self) -> Vec { - vec![ - format!("TARI_NETWORK={}", self.tari_network.lower_case()), - format!("DATA_FOLDER={}", self.data_directory.to_str().unwrap_or("")), // TODO deal with None - "TARI_LOG_CONFIGURATION=/var/tari/config/log4rs.yml".to_string(), - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin".to_string(), - ] - } - - fn base_node_tor_config(&self, env: &mut Vec) { - env.append(&mut vec![format!( - "TARI_BASE_NODE__P2P__TRANSPORT__TOR__CONTROL_AUTH=password={}", - self.tor_control_password - )]); - } - - /// Generate the vector of ENVAR strings for the docker environment - fn base_node_environment(&self) -> Vec { - let mut env = self.common_envars(); - self.base_node_tor_config(&mut env); - if let Some(base_node) = &self.base_node { - env.append(&mut vec![ - format!("WAIT_FOR_TOR={}", base_node.delay.as_secs()), - format!( - "TARI_BASE_NODE__DATA_DIR=/blockchain/{}", - self.tari_network.lower_case() - ), - "APP_NAME=base_node".to_string(), - ]); - } - env - } - - fn wallet_environment(&self) -> Vec { - let mut env = self.common_envars(); - if let Some(config) = &self.wallet { - env.append(&mut vec![ - "APP_NAME=wallet".to_string(), - "APP_EXEC=minotari_console_wallet".to_string(), - format!("WAIT_FOR_TOR={}", config.delay.as_secs() + 3), - "SHELL=/bin/bash".to_string(), - "TERM=linux".to_string(), - format!("TARI_WALLET_PASSWORD={}", config.password), - format!( - "TARI_WALLET__P2P__TRANSPORT__TOR__CONTROL_AUTH=password={}", - self.tor_control_password - ), - ]); - } - env - } - - fn xmrig_environment(&self) -> Vec { - let mut env = self.common_envars(); - let address = match &self.xmrig { - Some(config) if config.monero_mining_address.len() > 12 => config.monero_mining_address.as_str(), - _ => DEFAULT_MINING_ADDRESS, - }; - if let Some(config) = &self.xmrig { - env.append(&mut vec![ - format!("WAIT_FOR_TOR={}", config.delay.as_secs() + 9), - format!("TARI_MONERO_WALLET_ADDRESS={}", address), - ]); - } - env - } - - fn sha3_miner_environment(&self) -> Vec { - let mut env = self.common_envars(); - self.base_node_tor_config(&mut env); - if let Some(config) = &self.sha3_miner { - env.append(&mut vec![ - format!("WAIT_FOR_TOR={}", config.delay.as_secs() + 6), - "APP_NAME=sha3_miner".to_string(), - "APP_EXEC=minotari_miner".to_string(), - format!("TARI_MINER__NUM_MINING_THREADS={}", config.num_mining_threads), - "TARI_MINER__MINE_ON_TIP_ONLY=1".to_string(), - // This setting should be made obsolete soon: - format!( - "TARI_BASE_NODE__{}__BASE_NODE_GRPC_ADDRESS=/dns4/base_node/tcp/18142", - self.tari_network.upper_case() - ), - format!( - "TARI_BASE_NODE__{}__GRPC_BASE_NODE_ADDRESS=/dns4/base_node/tcp/18142", - self.tari_network.upper_case() - ), - "TARI_WALLET__GRPC_ADDRESS=/dns4/wallet/tcp/18143".to_string(), - ]); - } - env - } - - fn mm_proxy_environment(&self) -> Vec { - let mut env = self.common_envars(); - self.base_node_tor_config(&mut env); - if let Some(config) = &self.mm_proxy { - env.append(&mut vec![ - format!("WAIT_FOR_TOR={}", config.delay.as_secs() + 6), - "APP_NAME=mm_proxy".to_string(), - "APP_EXEC=tari_merge_mining_proxy".to_string(), - format!("TARI_MERGE_MINING_PROXY__MONEROD_URL={}", config.monerod_url), - format!("TARI_MERGE_MINING_PROXY__MONEROD_USERNAME={}", config.monero_username), - format!("TARI_MERGE_MINING_PROXY__MONEROD_PASSWORD={}", config.monero_password), - format!("TARI_MERGE_MINING_PROXY__MONEROD_USE_AUTH={}", config.monero_use_auth()), - ]); - } - env - } - - fn tor_environment(&self) -> Vec { - self.common_envars() - } - - fn grafana_environment(&self) -> Vec { - vec![ - format!("DATA_FOLDER={}", self.data_directory.to_str().unwrap_or("")), // TODO deal with None - "PATH=/usr/share/grafana/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin".to_string(), - ] - } - - fn monerod_environment(&self) -> Vec { - self.common_envars() - } -} - -#[derive(Debug, Error)] -pub enum LaunchpadConfigError {} - -fn create_port_map(ports: &[&'static str]) -> HashMap> { - let mut result = HashMap::new(); - for &port in ports { - result.insert(format!("{}/tcp", port), HashMap::new()); - } - result -} diff --git a/backend/src/docker/workspace.rs b/backend/src/docker/workspace.rs deleted file mode 100644 index 824a3f7a..00000000 --- a/backend/src/docker/workspace.rs +++ /dev/null @@ -1,549 +0,0 @@ -// Copyright 2021. The Tari Project -// -// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the -// following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following -// disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the -// following disclaimer in the documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote -// products derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE -// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// - -use std::{collections::HashMap, fs}; - -use bollard::{ - container::{LogsOptions, Stats, StatsOptions, StopContainerOptions}, - models::{ContainerCreateResponse, Network}, - network::{CreateNetworkOptions, InspectNetworkOptions}, - Docker, -}; -use futures::{Stream, StreamExt, TryStreamExt}; -use log::*; -use strum::IntoEnumIterator; -use tari_app_utilities::identity_management::setup_node_identity; -use tari_comms::{peer_manager::PeerFeatures, NodeIdentity}; - -use super::{add_container, container_state, CONTAINERS}; -use crate::docker::{ - change_container_status, - models::{ContainerId, ContainerState}, - try_create_container, - try_destroy_container, - ContainerStatus, - DockerWrapper, - DockerWrapperError, - ImageType, - LaunchpadConfig, - LogMessage, -}; - -static DEFAULT_REGISTRY: &str = "quay.io/tarilabs"; -static GRAFANA_REGISTRY: &str = "grafana"; - -/// `Workspaces` allows us to spin up multiple [TariWorkspace] recipes or configurations at once. Most users will only -/// ever need one at a time, and the default one at that, but developers and testers will likely find this useful. -/// -/// For example, you might want to run a node and wallet on two different networks concurrently. -/// Or, you might want to spin up two wallets on the same network to test some new feature. Here you would have one -/// recipe with just a base node and a wallet, and another recipe with just a wallet. -/// -/// Workspaces are referenced by a name, which is an arbitrary string, but by convention, you'll want to keep workspace -/// names short and do not use spaces in workspace names. -/// -/// Docker containers are named using a `{workspace_name}_{image_type}` convention. See [TariWorkspace] for more -/// details. -/// -/// Each workspace should also have a unique data folder to keep logs and configuration separate, but this is not a hard -/// requirement. -#[derive(Default)] -pub struct Workspaces { - workspaces: HashMap, -} - -impl Workspaces { - /// Returns a mutable reference to the `name`d workspace. For an immutable reference, see [workspace_mut]. - pub fn get_workspace_mut(&mut self, name: &str) -> Option<&mut TariWorkspace> { - self.workspaces.get_mut(name) - } - - /// Checks if a workspace with the given name exists. - pub fn workspace_exists(&self, name: &str) -> bool { - self.workspaces.contains_key(name) - } - - /// Create a new Tari workspace. It must not previously exist - pub fn create_workspace(&mut self, name: &str, config: LaunchpadConfig) -> Result<(), DockerWrapperError> { - if self.workspaces.contains_key(name) { - return Err(DockerWrapperError::WorkspaceAlreadyExists(name.to_string())); - } - let new_system = TariWorkspace::new(name, config); - self.workspaces.insert(name.to_string(), new_system); - Ok(()) - } - - /// Gracefully shut down the docker images and delete them - /// The volumes are kept, since if we restart, we don't want to re-sync the entire blockchain again - pub async fn shutdown(&mut self, docker: &DockerWrapper) -> Result<(), DockerWrapperError> { - for (name, workspace) in &mut self.workspaces { - info!("Shutting down {}", name); - workspace.shutdown(docker).await.ok(); - } - Ok(()) - } -} - -/// A TariWorkspace is a configuration of docker images (node, wallet, miner etc), configuration files and secrets, -/// and log files. -/// -/// ### Data locations -/// A workspace manages data in several places -/// * **Blockchain data** is stored in a [Docker volume](https://docs.docker.com/storage/volumes/) that is not directly -/// accessible to the host system. This is primarily done for performance reasons, but should not be a major issue -/// since you seldom need direct access to the LMDB database. If you do need the database for some reason, you can -/// mount the volume and run a bash command, for instance: `docker run --rm -v $(pwd):/backup -v -/// blockchain:/blockchain ubuntu tar czvf /backup/backup.tar.gz /blockchain`. As currently written, the blockchain -/// data is namespaced by workspace but it is also possible in principle for different workspaces to (TODO) share -/// blockchain data (for the same network), thereby preventing the need to keep multiple copies of the blockchain. In -/// this case, you need to be careful not to introduce contention from multiple nodes running against the same LMDB -/// database, leading to corrupt db files. -/// * **Configuration** and log files are stored of the workspace `root_folder`. A typical folder structure looks like -/// ```text -/// {root_folder} -/// ├── base_node -/// │ └── log -/// │ ├── core.log -/// │ ├── network.log -/// │ └── other.log -/// ├── config -/// │ ├── config.toml -/// │ ├── log4rs.yml -/// │ └── dibbler -/// │ ├── base_node_tor.json -/// │ ├── tari_base_node_id.json -/// │ └── tari_console_wallet_id.json -/// ├── mm_proxy -/// ├── monerod -/// ├── sha3_miner -/// │ └── log -/// │ ├── core.log -/// │ ├── network.log -/// │ └── other.log -/// ├── tor -/// ├── wallet -/// │ ├── log -/// │ │ ├── core.log -/// │ │ ├── network.log -/// │ │ └── other.log -/// │ └── wallet -/// │ ├── console-wallet.dat -/// │ ├── console-wallet.dat-shm -/// │ └── console-wallet.dat-wal -/// └── xmrig -/// ``` -/// the `{root_folder}` is mounted into the docker filesystem and is accessible to all containers in the workspace. -/// TODO - investigate security issues for this. In particular, we almost certainly want to isolate the wallet data -/// This means that changes to `config/log4rs.yml` take effect in all running containers immediately. -/// * **Docker containers** are ephemeral and are created and destroyed at will. -/// -/// ### Networking -/// Tor is used by several other containers. The control password for Tor is randomly generated when the workspace is -/// set up, and shared as an environment variable between containers. -/// -/// A dedicated, namespaced network is created for each workspace. This means that each container in the network can -/// talk to any other container in the same workspace, but not to containers in other workspaces. -/// -/// We also expose some ports to the host system for host-container communication. -/// -/// * Base node - ports 18142 and 18149. TODO - currently the same port is mapped to the host. For multiple Workspaces -/// we'd need to expose a different port to the host. e.g. 1n142 where n is the workspace number. -/// * Wallet - 18143 and 18188 -/// * Loki (18130), promtail (18980) and grafana (18300) and -pub struct TariWorkspace { - name: String, - config: LaunchpadConfig, -} - -impl TariWorkspace { - /// Create a new Tari system using the provided configuration - pub fn new(name: &str, config: LaunchpadConfig) -> Self { - Self { - name: name.to_string(), - config, - } - } - - /// Returns the name of this system, which is generally used as the workspace name when running multiple Tari - /// systems - pub fn name(&self) -> &str { - self.name.as_str() - } - - /// Returns the full image name for the given image type. for the default registry this is typically something like - /// `quay.io/tarilabs/tari_base_node:latest`. One should be able to use this string to do a successful - /// `docker pull {image_name}`. - /// - /// It also lets power users customise which version of docker images they want to run in the workspace. - pub fn fully_qualified_image(image: ImageType, registry: Option<&str>) -> String { - let reg = match image { - ImageType::Tor | - ImageType::BaseNode | - ImageType::Wallet | - ImageType::XmRig | - ImageType::Sha3Miner | - ImageType::MmProxy | - ImageType::Monerod => registry.unwrap_or(DEFAULT_REGISTRY), - ImageType::Loki | ImageType::Promtail | ImageType::Grafana => GRAFANA_REGISTRY, - }; - format!("{}/{}:{}", reg, image.image_name(), "latest") - } - - /// Starts the Tari workspace recipe. - /// - /// This is an MVP / PoC version that starts everything in one go, but TODO, should really take some sort of recipe - /// object to allow us to build up different recipes (wallet only, full miner, SHA3-mining only etc) - pub async fn start_recipe(&mut self, docker: &DockerWrapper) -> Result<(), DockerWrapperError> { - // Create or load identities - let _ids = self.create_or_load_identities()?; - // Set up the local network - if !self.network_exists(docker).await? { - self.create_network(docker).await?; - } - // Create or restart the volume - - for image in self.images_to_start() { - // Start each container - let name = self.start_service(image, docker).await?; - info!( - "Docker container {} ({}) successfully started", - image.image_name(), - name - ); - } - Ok(()) - } - - /// Bootstraps a node identity for the container, typically a base node or wallet instance. If an identity file - /// already exists at the canonical path location, it is loaded and returned instead. - /// - /// The canonical path is defined as `{root_path}/{image_type}/config/{network}/{image_type}_id.json` - pub fn create_or_load_identity( - &self, - root_path: &str, - image: ImageType, - ) -> Result, DockerWrapperError> { - if let Some(id_file_path) = self.config.id_path(root_path, image) { - debug!("Loading or creating identity file {}", id_file_path.to_string_lossy()); - let id = setup_node_identity(id_file_path, None, true, PeerFeatures::COMMUNICATION_NODE)? - .as_ref() - .clone(); - Ok(Some(id)) - } else { - Ok(None) - } - } - - /// A convenience method that calls [create_or_load_identity] for each image type. - pub fn create_or_load_identities(&self) -> Result, DockerWrapperError> { - let root_path = self.config.data_directory.to_string_lossy().to_string(); - let mut ids = HashMap::new(); - for image in ImageType::iter() { - if let Some(id) = self.create_or_load_identity(root_path.as_str(), image)? { - let _node_identity = ids.insert(image, id); - } - } - Ok(ids) - } - - /// Loads the seed words file - /// The canonical path is defined as `{root_path}/{network}/{config}/seed_words.txt` - pub fn get_seed_words(&self) -> Result>, DockerWrapperError> { - let root_path = self.config.data_directory.to_string_lossy().to_string(); - - if let Some(file_path) = self.config.seed_words_path(&root_path, ImageType::Wallet) { - debug!("Loading seed words {}", file_path.to_string_lossy()); - - let seed_words = fs::read_to_string(file_path) - .map_err(|_| DockerWrapperError::SeedFileReadError) - .expect("Could not read the seed file.") - .split_whitespace() - .map(String::from) - .collect(); - - Ok(Some(seed_words)) - } else { - Ok(None) - } - } - - pub fn delete_seed_words(&self) -> Result<(), DockerWrapperError> { - let root_path = self.config.data_directory.to_string_lossy().to_string(); - - if let Some(file_path) = self.config.seed_words_path(&root_path, ImageType::Wallet) { - return fs::remove_file(file_path).map_err(|_| DockerWrapperError::SeedFileRemovalError); - } - - Err(DockerWrapperError::SeedFileRemovalError) - } - - /// Create and return a [`Stream`] of [`LogMessage`] instances for the `name`d container in the workspace. - pub fn logs( - &self, - container_name: &str, - docker: &Docker, - ) -> Option>> { - let options = LogsOptions:: { - follow: true, - stdout: true, - stderr: true, - ..Default::default() - }; - CONTAINERS.read().unwrap().get(container_name).map(move |container| { - let id = container.id(); - docker - .logs(id.as_str(), Some(options)) - .map(|log| log.map(LogMessage::from).map_err(DockerWrapperError::from)) - }) - } - - /// Returns a [`Stream`] of resource stats for the container `name`, if it exists - pub fn resource_stats( - &self, - name: &str, - docker: &Docker, - ) -> Option>> { - if let Some(container) = CONTAINERS.read().unwrap().get(name) { - let options = StatsOptions { - stream: true, - one_shot: false, - }; - let id = container.id(); - let stream = docker - .stats(id.as_str(), Some(options)) - .map_err(DockerWrapperError::from); - Some(stream) - } else { - None - } - } - - /// Create and run a docker container. - /// - /// ## Arguments - /// * `image`: The type of image to start. See [`ImageType`]. - /// * `registry`: An optional docker registry path to use. The default is `quay.io/tarilabs` - /// * `tag`: The image tag to use. The default is `latest`. - /// * `docker`: a [`Docker`] instance. - /// - /// ## Return - /// - /// The method returns a future that resolves to a [`DockerWrapperError`] on an error, or the container name on - /// success. - /// - /// `start_service` creates a new docker container and runs it. As part of this process, - /// * it pulls configuration data from the [`LaunchConfig`] instance attached to this [`DockerWrapper`] to construct - /// the Environment, Volume configuration, and exposed Port configuration. - /// * creates a new container - /// * starts the container - /// * adds the container reference to the current list of containers being managed - /// * Returns the container name - pub async fn start_service( - &mut self, - image: ImageType, - docker: &DockerWrapper, - ) -> Result { - let fully_qualified_image_name = TariWorkspace::fully_qualified_image(image, self.config.registry.as_deref()); - info!("Creating {}", &fully_qualified_image_name); - let workspace_image_name = format!("{}_{}", self.name, image.image_name()); - let _unused = try_destroy_container(workspace_image_name.as_str(), docker).await; - let container = try_create_container( - image, - fully_qualified_image_name.clone(), - self.name().to_string(), - &self.config, - docker, - ) - .await?; - let name = image.container_name(); - let id = container.id.clone(); - self.add_container(name, container); - - info!("Starting {}.", fully_qualified_image_name); - docker.start_container::(id.as_str(), None).await?; - - self.mark_container_running(name)?; - info!("{} started with id {}", fully_qualified_image_name, id); - - Ok(name.to_string()) - } - - // helper function for start recipe. This will be overhauled to be more flexible in future - fn images_to_start(&self) -> Vec { - let mut images = Vec::with_capacity(6); - // Always use Tor for now - images.push(ImageType::Tor); - if self.config.base_node.is_some() { - images.push(ImageType::BaseNode); - } - if self.config.wallet.is_some() { - images.push(ImageType::Wallet); - } - if self.config.xmrig.is_some() { - images.push(ImageType::XmRig); - } - if self.config.sha3_miner.is_some() { - images.push(ImageType::Sha3Miner); - } - if self.config.mm_proxy.is_some() { - images.push(ImageType::MmProxy); - } - // TODO - add monerod support - images - } - - /// Add the container info to the list of containers the wrapper is managing - fn add_container(&mut self, name: &str, container: ContainerCreateResponse) { - let id = ContainerId::from(container.id.clone()); - let state = ContainerState::new(name.to_string(), id, container); - add_container(name, state); - } - - // Tag the container with id `id` as Running - fn mark_container_running(&mut self, name: &str) -> Result<(), DockerWrapperError> { - if let Some(container) = CONTAINERS.write().unwrap().get_mut(name) { - container.running(); - Ok(()) - } else { - Err(DockerWrapperError::ContainerNotFound(name.to_string())) - } - } - - /// Stop the container with the given `name` and optionally delete it - pub async fn stop_container(&mut self, name: &str, delete: bool, docker: &DockerWrapper) { - let container = match container_state(name) { - Some(c) => c, - None => { - info!( - "Cannot stop container {}. It was not found in the current workspace", - name - ); - return; - }, - }; - let options = StopContainerOptions { t: 0 }; - let id = container.id().clone(); - match docker.stop_container(id.as_str(), Some(options)).await { - Ok(_res) => { - info!("Container {} stopped", id.clone()); - match change_container_status(id.as_str(), ContainerStatus::Stopped) { - Ok(_) => (), - Err(err) => warn!( - "Could not update launchpad cache for {} due to: {}", - id, - err.to_string() - ), - } - }, - Err(err) => { - warn!("Could not stop container {} due to {}", id, err.to_string()); - }, - } - // Even if stopping failed (maybe it was already stopped), try and delete it - if delete { - match docker.remove_container(id.as_str(), None).await { - Ok(()) => { - info!("Container {} deleted", id); - match change_container_status(id.as_str(), ContainerStatus::Deleted) { - Ok(_) => (), - Err(err) => warn!( - "Could not update launchpad cache for {} due to: {}", - id, - err.to_string() - ), - } - }, - Err(err) => { - warn!("Could not delete container {} due to: {}", id, err.to_string()) - }, - } - } - } - - /// Stop all running containers and optionally delete them - pub async fn stop_containers(&mut self, delete: bool, docker: &DockerWrapper) { - let names = CONTAINERS.write().unwrap().keys().cloned().collect::>(); - for name in names { - // Stop the container immediately - self.stop_container(name.as_str(), delete, docker).await; - } - } - - /// Returns the network name - pub fn network_name(&self) -> String { - format!("{}_network", self.name) - } - - /// Checks if the network for this docker configuration exists - pub async fn network_exists(&self, docker: &DockerWrapper) -> Result { - let name = self.network_name(); - let options = InspectNetworkOptions { - verbose: false, - scope: "local", - }; - let network = docker.inspect_network(name.as_str(), Some(options)).await; - // hardcore pattern matching yo! - if let Ok(Network { - name: Some(name), - id: Some(id), - .. - }) = network - { - info!("Network {} (id:{}) exists", name, id); - Ok(true) - } else { - info!("Network {} does not exist", name); - Ok(false) - } - } - - /// Create a network in docker to allow the containers in this workspace to communicate with each other. - pub async fn create_network(&self, docker: &DockerWrapper) -> Result<(), DockerWrapperError> { - let name = self.network_name(); - let options = CreateNetworkOptions { - name: name.as_str(), - check_duplicate: true, - driver: "bridge", - internal: false, - attachable: false, - ingress: false, - ipam: Default::default(), - enable_ipv6: false, - options: Default::default(), - labels: Default::default(), - }; - let res = docker.create_network(options).await?; - if let Some(id) = &res.id { - info!("Network {} (id:{}) created", name, id); - } - if let Some(warn) = res.warning { - warn!("Creating {} network had warnings: {}", name, warn); - } - Ok(()) - } - - pub async fn shutdown(&mut self, docker: &DockerWrapper) -> Result<(), DockerWrapperError> { - self.stop_containers(true, docker).await; - Ok(()) - } -} diff --git a/backend/src/docker/wrapper.rs b/backend/src/docker/wrapper.rs deleted file mode 100644 index 9748ff88..00000000 --- a/backend/src/docker/wrapper.rs +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2021. The Tari Project -// -// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the -// following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following -// disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the -// following disclaimer in the documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote -// products derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE -// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// - -use std::collections::HashMap; - -use bollard::{ - image::CreateImageOptions, - models::{CreateImageInfo, EventMessage}, - system::EventsOptions, - Docker, -}; -use derive_more::{Deref, DerefMut}; -use futures::{Stream, TryStreamExt}; - -use crate::{docker::DockerWrapperError, rest::DockerImageError}; - -/// A wrapper around a [`bollard::Docker`] instance providing some opinionated convenience methods for Tari workspaces. -#[derive(Clone, Deref, DerefMut)] -pub struct DockerWrapper { - docker: Docker, -} - -impl DockerWrapper { - /// Create a new wrapper - pub fn connect() -> Result { - let docker = Docker::connect_with_local_defaults()?; - Ok(Self { docker }) - } - - /// Returns the version of the _docker client_. - pub fn version(&self) -> String { - self.docker.client_version().to_string() - } - - /// Returns a stream of relevant events. We're opinionated here, so we filter the stream to only return - /// container, image, network and volume events. - pub async fn events(&self) -> impl Stream> { - let mut type_filter = HashMap::new(); - type_filter.insert("type".to_string(), vec![ - "container".to_string(), - "image".to_string(), - "network".to_string(), - "volume".to_string(), - ]); - let options = EventsOptions { - since: None, - until: None, - filters: type_filter, - }; - self.docker.events(Some(options)).map_err(DockerWrapperError::from) - } - - pub async fn pull_latest_image( - &self, - full_image_name: String, - ) -> impl Stream> { - let opts = Some(CreateImageOptions { - from_image: full_image_name, - ..Default::default() - }); - self.docker - .create_image(opts, None, None) - .map_err(DockerImageError::from) - } -} diff --git a/backend/src/main.rs b/backend/src/main.rs index 7ac6f97d..42da5bab 100644 --- a/backend/src/main.rs +++ b/backend/src/main.rs @@ -10,13 +10,6 @@ use std::thread; use log::*; use thiserror::Error; -mod api; -mod commands; -mod docker; -mod error; -mod grpc; -mod rest; - use commands::AppState; use docker::{shutdown_all_containers, DockerWrapper, DockerWrapperError, Workspaces, DEFAULT_WORKSPACE_NAME}; use tauri::{ diff --git a/backend/src/rest/mod.rs b/backend/src/rest/mod.rs deleted file mode 100644 index c0fe8dbf..00000000 --- a/backend/src/rest/mod.rs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2021. The Tari Project -// -// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the -// following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following -// disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the -// following disclaimer in the documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote -// products derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE -// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// - -pub mod quay_io; -use std::collections::HashMap; - -use bollard::{image::ListImagesOptions, models::ImageSummary}; -use log::error; -use thiserror::Error; - -use crate::docker::DOCKER_INSTANCE; - -#[derive(Error, Debug)] -pub enum DockerImageError { - #[error("The image {0} is not found")] - ImageNotFound(String), - #[error("Something went wrong with the Docker API")] - DockerError(#[from] bollard::errors::Error), - #[error("Could not create an identity file")] - #[allow(dead_code)] - InvalidImageType, -} - -pub async fn list_image(fully_qualified_image_name: String) -> Result, DockerImageError> { - let docker = DOCKER_INSTANCE.clone(); - let mut fillter: HashMap> = HashMap::new(); - fillter.insert("reference".to_string(), vec![fully_qualified_image_name.clone()]); - let result = docker - .list_images(Some(ListImagesOptions:: { - all: true, - filters: fillter, - ..Default::default() - })) - .await - .map_err(|err| { - error!("Error searching for{}. Err: {}", fully_qualified_image_name, err); - DockerImageError::ImageNotFound(fully_qualified_image_name) - })?; - Ok(result) -} diff --git a/backend/src/rest/quay_io.rs b/backend/src/rest/quay_io.rs deleted file mode 100644 index f4e0b801..00000000 --- a/backend/src/rest/quay_io.rs +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright 2021. The Tari Project -// -// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the -// following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following -// disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the -// following disclaimer in the documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote -// products derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE -// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// - -use log::debug; -use serde::{Deserialize, Serialize}; - -use super::{list_image, DockerImageError}; -use crate::docker::{ImageType, TariWorkspace, DOCKER_INSTANCE}; - -pub const QUAY_IO_REPO_NAME: &str = "quay.io"; -pub const QUAY_IO_URL: &str = "https://quay.io/api/v1/repository"; -pub const TARILABS_REPO_NAME: &str = "tarilabs"; - -#[derive(Serialize, Debug, Clone, Deserialize)] -struct QuayImageTag { - name: String, - reversion: bool, - start_ts: u64, - end_ts: Option, - manifest_digest: String, - is_manifest_list: bool, - size: Option, - last_modified: String, - expiration: Option, -} - -#[derive(Serialize, Debug, Clone, Deserialize)] -struct QuayTags { - tags: Vec, - has_additional: bool, - page: i32, -} - -#[derive(Serialize, Debug, Clone, Deserialize)] -pub struct TagInfo { - pub latest: bool, - pub created_on: String, - pub digest: String, -} - -impl From for TagInfo { - fn from(source: QuayImageTag) -> Self { - TagInfo { - latest: true, - created_on: source.last_modified, - digest: source.manifest_digest, - } - } -} - -fn quay_url(image_name: String, page: Option) -> String { - match page { - Some(p) => format!("{}/{}/tag/?page={}", QUAY_IO_URL, image_name, p), - None => format!("{}/{}/tag/", QUAY_IO_URL, image_name), - } -} - -async fn get_image_tags(image: ImageType) -> Result { - if let ImageType::Loki | ImageType::Promtail | ImageType::Grafana = image { - return Err(format!("image {} is not hosted on quay.io", image)); - } - - let quay_io_url = quay_url(format!("{}/{}", TARILABS_REPO_NAME, image.image_name()), None); - let tag = reqwest::get(&quay_io_url) - .await - .map_err(|_| format!("Can't connect to: {}", &quay_io_url))? - .json::() - .await - .map_err(|_| format!("Can't read data from: {}", &quay_io_url))?; - Ok(tag) -} - -pub async fn get_tag_info(image: ImageType) -> Result { - let image_tag = get_image_tags(image).await?; - let tags = image_tag.tags; - let mut filtered: Vec = tags - .iter() - .filter(|t| t.name.contains("latest") && t.expiration.is_none()) - .cloned() - .collect(); - if filtered.is_empty() { - Err("No tags found for tag [latest]".to_string()) - } else { - if filtered.len() > 1 { - filtered.sort_by(|t1, t2| t1.start_ts.cmp(&t2.start_ts)); - } - Ok(TagInfo::from(filtered.pop().unwrap())) - } -} - -#[allow(dead_code)] -pub async fn is_up_to_date(image: ImageType, manifest_digest: String) -> Result { - let docker = DOCKER_INSTANCE.clone(); - let registry = format!("{}/{}", QUAY_IO_REPO_NAME, TARILABS_REPO_NAME); - let fully_qualified_image_name = TariWorkspace::fully_qualified_image(image, Some(®istry)); - let image_ids: Vec = list_image(fully_qualified_image_name.clone()) - .await? - .iter() - .map(|img| img.id.clone()) - .collect(); - - for image_id in image_ids { - let local_image = docker.inspect_image(&image_id).await?; - let signagure = match local_image.repo_digests { - Some(digests) => digests, - None => return Ok(false), - }; - debug!("signature: {:?}", signagure); - if signagure.iter().any(|s| s.contains(&manifest_digest)) { - return Ok(true); - } - } - Ok(false) -} diff --git a/libs/protocol/Cargo.toml b/libs/protocol/Cargo.toml index 67e10386..9548c49f 100644 --- a/libs/protocol/Cargo.toml +++ b/libs/protocol/Cargo.toml @@ -7,7 +7,6 @@ repository = "https://github.com/tari-project/tari-launchpad" edition = "2021" [dependencies] -tari_utilities = { git = "https://github.com/tari-project/tari_utilities.git", tag = "v0.4.10" } byte-unit = { version = "4.0.19", features = ["serde"] } derive_more = "0.99.17" diff --git a/libs/sdm-launchpad/Cargo.toml b/libs/sdm-launchpad/Cargo.toml index 861bad4d..b6100e96 100644 --- a/libs/sdm-launchpad/Cargo.toml +++ b/libs/sdm-launchpad/Cargo.toml @@ -7,7 +7,6 @@ repository = "https://github.com/tari-project/tari-launchpad" edition = "2021" [dependencies] -tari_base_node = { git = "https://github.com/tari-project/tari", tag = "v0.51.0-pre.4" } tari_app_grpc = { git = "https://github.com/tari-project/tari", tag = "v0.51.0-pre.4" } tari_base_node_grpc_client = { git = "https://github.com/tari-project/tari", tag = "v0.51.0-pre.4" } tari_common_types = { git = "https://github.com/tari-project/tari", tag = "v0.51.0-pre.4" } @@ -31,4 +30,3 @@ thiserror = "1.0.44" tor-hash-passwd = "1.0.1" tokio = "1.29.1" toml = "0.7.6" -tonic = "0.9.2" diff --git a/libs/sdm/Cargo.toml b/libs/sdm/Cargo.toml index c45a036c..4007dfc4 100644 --- a/libs/sdm/Cargo.toml +++ b/libs/sdm/Cargo.toml @@ -16,6 +16,7 @@ bollard = "0.14.0" derive_more = "0.99.17" futures = "0.3.28" log = "0.4.19" +rand = "0.8.4" thiserror = "1.0.44" tokio = { version = "1.29.1", features = ["macros"] } tokio-stream = { version = "0.1.14", features = ["sync"] } diff --git a/libs/sdm/src/utils.rs b/libs/sdm/src/utils.rs index 6aae5f66..d218d3e5 100644 --- a/libs/sdm/src/utils.rs +++ b/libs/sdm/src/utils.rs @@ -23,6 +23,7 @@ use std::sync::Arc; +use rand::distributions::{Alphanumeric, Distribution}; use tokio::task::JoinHandle; #[must_use] @@ -49,3 +50,9 @@ impl Drop for TaskGuardInner { self.handle.abort(); } } + +/// Create a cryptographically secure password on length `len` +pub fn create_password(len: usize) -> String { + let mut rng = rand::thread_rng(); + Alphanumeric.sample_iter(&mut rng).take(len).map(char::from).collect() +} diff --git a/libs/tact/Cargo.toml b/libs/tact/Cargo.toml index 0ff0cf19..1c8d191c 100644 --- a/libs/tact/Cargo.toml +++ b/libs/tact/Cargo.toml @@ -7,7 +7,6 @@ edition = "2021" [dependencies] anyhow = "1.0.71" async-trait = "0.1.68" -derive_more = "0.99.17" futures = "0.3.28" log = "0.4.17" thiserror = "1.0.40"