From 2c26200867ea6a16edbb006dff71babb3fad4bf8 Mon Sep 17 00:00:00 2001 From: notplants Date: Sun, 8 Sep 2024 14:45:40 -0400 Subject: [PATCH 01/14] remove golgi dependency --- Cargo.lock | 452 +++++++++--- peach-lib/Cargo.toml | 5 +- peach-lib/src/config_manager.rs | 4 +- peach-lib/src/error.rs | 36 +- peach-lib/src/lib.rs | 1 + peach-lib/src/password_utils.rs | 27 +- peach-lib/src/sbot.rs | 75 +- peach-lib/src/ssb_messages.rs | 104 +++ peach-web/Cargo.toml | 2 +- peach-web/src/error.rs | 14 +- .../routes/settings/scuttlebutt/configure.rs | 2 +- peach-web/src/utils/sbot.rs | 690 +++++++++--------- 12 files changed, 890 insertions(+), 522 deletions(-) create mode 100644 peach-lib/src/ssb_messages.rs diff --git a/Cargo.lock b/Cargo.lock index 5fb2432..083ab10 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -35,6 +35,12 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "anyhow" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" + [[package]] name = "ascii" version = "1.0.0" @@ -47,7 +53,7 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3203e79f4dd9bdda415ed03cf14dae5a2bf775c683a00f94e9cd1faf0f596e5" dependencies = [ - "quote 1.0.20", + "quote 1.0.37", "syn 1.0.98", ] @@ -191,8 +197,8 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25f9db3b38af870bf7e5cc649167533b493928e50744e2c30ae350230b414670" dependencies = [ - "proc-macro2 1.0.40", - "quote 1.0.20", + "proc-macro2 1.0.86", + "quote 1.0.37", "syn 1.0.98", ] @@ -202,8 +208,8 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10f203db73a71dfa2fb6dd22763990fa26f3d2625a6da2da900d23b87d26be27" dependencies = [ - "proc-macro2 1.0.40", - "quote 1.0.20", + "proc-macro2 1.0.86", + "quote 1.0.37", "syn 1.0.98", ] @@ -213,6 +219,17 @@ version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a40729d2133846d9ed0ea60a8b9541bccddab49cd30f0715a1da672fe9a2524" +[[package]] +name = "async-trait" +version = "0.1.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.37", + "syn 2.0.77", +] + [[package]] name = "atomic-waker" version = "1.0.0" @@ -293,6 +310,12 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + [[package]] name = "bitflags" version = "0.3.3" @@ -614,7 +637,7 @@ version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f877be4f7c9f246b183111634f75baa039715e3f46ce860677d3b19a69fb229c" dependencies = [ - "quote 1.0.20", + "quote 1.0.37", "syn 1.0.98", ] @@ -635,8 +658,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ "convert_case", - "proc-macro2 1.0.40", - "quote 1.0.20", + "proc-macro2 1.0.86", + "quote 1.0.37", "rustc_version 0.4.0", "syn 1.0.98", ] @@ -722,6 +745,15 @@ dependencies = [ "void", ] +[[package]] +name = "encoding_rs" +version = "0.8.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +dependencies = [ + "cfg-if 1.0.0", +] + [[package]] name = "env_logger" version = "0.6.2" @@ -761,6 +793,12 @@ dependencies = [ "termcolor", ] +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + [[package]] name = "error-chain" version = "0.12.4" @@ -801,7 +839,7 @@ dependencies = [ "cfg-if 1.0.0", "libc", "redox_syscall 0.2.13", - "windows-sys", + "windows-sys 0.36.1", ] [[package]] @@ -938,8 +976,8 @@ version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" dependencies = [ - "proc-macro2 1.0.40", - "quote 1.0.20", + "proc-macro2 1.0.86", + "quote 1.0.37", "syn 1.0.98", ] @@ -1090,7 +1128,7 @@ dependencies = [ "kuska-sodiumoxide", "kuska-ssb", "log 0.4.17", - "serde 1.0.139", + "serde 1.0.209", "serde_json", "sha2", ] @@ -1106,19 +1144,44 @@ dependencies = [ "fnv", "futures 0.1.31", "http 0.1.21", - "indexmap", + "indexmap 1.9.1", "log 0.4.17", "slab 0.4.6", "string", "tokio-io", ] +[[package]] +name = "h2" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +dependencies = [ + "bytes 1.1.0", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http 0.2.8", + "indexmap 2.5.0", + "slab 0.4.6", + "tokio 1.26.0", + "tokio-util 0.7.8", + "tracing", +] + [[package]] name = "hashbrown" version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "607c8a29735385251a339424dd462993c0fed8fa09d378f259377df08c126022" +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + [[package]] name = "heck" version = "0.3.3" @@ -1251,7 +1314,7 @@ dependencies = [ "bytes 0.4.12", "futures 0.1.31", "futures-cpupool", - "h2", + "h2 0.1.26", "http 0.1.21", "http-body 0.1.0", "httparse", @@ -1282,6 +1345,7 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", + "h2 0.3.26", "http 0.2.8", "http-body 0.4.5", "httparse", @@ -1289,7 +1353,7 @@ dependencies = [ "itoa 1.0.2", "pin-project-lite", "socket2", - "tokio 1.19.2", + "tokio 1.26.0", "tower-service", "tracing", "want 0.3.0", @@ -1336,7 +1400,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" dependencies = [ "autocfg 1.1.0", - "hashbrown", + "hashbrown 0.12.2", +] + +[[package]] +name = "indexmap" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" +dependencies = [ + "equivalent", + "hashbrown 0.14.5", ] [[package]] @@ -1357,6 +1431,12 @@ dependencies = [ "libc", ] +[[package]] +name = "ipnet" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" + [[package]] name = "itoa" version = "0.4.8" @@ -1388,7 +1468,7 @@ dependencies = [ "futures 0.1.31", "jsonrpc-core 8.0.1", "log 0.4.17", - "serde 1.0.139", + "serde 1.0.209", "serde_json", ] @@ -1417,7 +1497,7 @@ dependencies = [ "jsonrpc-core 18.0.0", "jsonrpc-pubsub", "log 0.4.17", - "serde 1.0.139", + "serde 1.0.209", "serde_json", "url 1.7.2", ] @@ -1430,7 +1510,7 @@ checksum = "ddf83704f4e79979a424d1082dd2c1e52683058056c9280efa19ac5f6bc9033c" dependencies = [ "futures 0.1.31", "log 0.3.9", - "serde 1.0.139", + "serde 1.0.209", "serde_derive", "serde_json", ] @@ -1443,7 +1523,7 @@ checksum = "97b83fdc5e0218128d0d270f2f2e7a5ea716f3240c8518a58bc89e6716ba8581" dependencies = [ "futures 0.1.31", "log 0.4.17", - "serde 1.0.139", + "serde 1.0.209", "serde_derive", "serde_json", ] @@ -1458,7 +1538,7 @@ dependencies = [ "futures-executor", "futures-util", "log 0.4.17", - "serde 1.0.139", + "serde 1.0.209", "serde_derive", "serde_json", ] @@ -1515,7 +1595,7 @@ dependencies = [ "log 0.4.17", "parking_lot 0.11.2", "rand 0.7.3", - "serde 1.0.139", + "serde 1.0.209", ] [[package]] @@ -1547,9 +1627,9 @@ dependencies = [ "jsonrpc-core 18.0.0", "lazy_static", "log 0.4.17", - "tokio 1.19.2", + "tokio 1.26.0", "tokio-stream", - "tokio-util", + "tokio-util 0.6.10", "unicase", ] @@ -1563,10 +1643,34 @@ dependencies = [ "jsonrpc-core-client", "jsonrpc-pubsub", "log 0.4.17", - "serde 1.0.139", + "serde 1.0.209", "serde_json", ] +[[package]] +name = "jsonrpc_client" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c1ec33c537dc1d5a8b597313db6d213fee54320f81ea0d19b0c3869b282e1a" +dependencies = [ + "async-trait", + "jsonrpc_client_macro", + "reqwest", + "serde 1.0.209", + "serde_json", + "url 2.3.0", +] + +[[package]] +name = "jsonrpc_client_macro" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97c11e429f0eaa41fe659013680b459d2368d8f0a3e69dccfb7a35800b0dc27b" +dependencies = [ + "quote 1.0.37", + "syn 1.0.98", +] + [[package]] name = "keccak" version = "0.1.2" @@ -1604,7 +1708,7 @@ checksum = "ae0f8eafdd240b722243787b51fdaf8df6693fb8621d0f7061cdba574214cf88" dependencies = [ "libc", "libsodium-sys", - "serde 1.0.139", + "serde 1.0.209", ] [[package]] @@ -1624,7 +1728,7 @@ dependencies = [ "log 0.4.17", "once_cell", "regex", - "serde 1.0.139", + "serde 1.0.209", "serde_json", "thiserror", ] @@ -1763,8 +1867,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "423430ac467408136d7de93f2929debd8a7bc3e795c92476f45e259b158e3355" dependencies = [ "proc-macro-error", - "proc-macro2 1.0.40", - "quote 1.0.20", + "proc-macro2 1.0.86", + "quote 1.0.37", "syn 1.0.98", ] @@ -1811,8 +1915,8 @@ version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60bbf2d78a45808eba478a0660f050bbce70dafc011e275cf00f6f8500a8be88" dependencies = [ - "proc-macro2 1.0.40", - "quote 1.0.20", + "proc-macro2 1.0.86", + "quote 1.0.37", "syn 1.0.98", ] @@ -1870,7 +1974,7 @@ dependencies = [ "libc", "log 0.4.17", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys", + "windows-sys 0.36.1", ] [[package]] @@ -1963,7 +2067,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6cb122918e2e32ae9ee84b7b489dd20fec746cdad3e734095687fc2700da788a" dependencies = [ "atomicwrites", - "indexmap", + "indexmap 1.9.1", "lazy_static", "log 0.4.17", "mkdirp", @@ -2131,9 +2235,9 @@ checksum = "2069a3ae3dad97a4ae47754e8f47e5d2f1fd32ab7ad8a84bb31d051faa59cc3c" [[package]] name = "once_cell" -version = "1.13.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "opaque-debug" @@ -2211,7 +2315,7 @@ dependencies = [ "peach-lib", "regex", "rpassword", - "serde 1.0.139", + "serde 1.0.209", "serde_json", "snafu 0.6.10", "structopt", @@ -2243,22 +2347,25 @@ dependencies = [ name = "peach-lib" version = "1.3.4" dependencies = [ + "anyhow", "async-std", "chrono", "dirs 4.0.0", "fslock", - "golgi", "jsonrpc-client-core", "jsonrpc-client-http", "jsonrpc-core 8.0.1", + "jsonrpc_client", + "kuska-ssb", "lazy_static", "log 0.4.17", "nanorand", "regex", - "serde 1.0.139", + "serde 1.0.209", "serde_json", "serde_yaml", "sha3", + "solar_client", "toml", ] @@ -2274,7 +2381,7 @@ dependencies = [ "jsonrpc-http-server 11.0.0", "log 0.4.17", "peach-lib", - "serde 1.0.139", + "serde 1.0.209", "serde_json", "ws", ] @@ -2299,7 +2406,7 @@ dependencies = [ "miniserde", "probes 0.4.1", "regex", - "serde 1.0.139", + "serde 1.0.209", "wpactrl", ] @@ -2315,7 +2422,7 @@ dependencies = [ "linux-embedded-hal", "log 0.4.17", "nix 0.11.1", - "serde 1.0.139", + "serde 1.0.209", "ssd1306", "tinybmp", ] @@ -2327,7 +2434,7 @@ dependencies = [ "log 0.4.17", "miniserde", "probes 0.4.1", - "serde 1.0.139", + "serde 1.0.209", "systemstat", ] @@ -2341,7 +2448,6 @@ dependencies = [ "dirs 4.0.0", "env_logger 0.8.4", "futures 0.3.21", - "golgi", "lazy_static", "log 0.4.17", "maud", @@ -2349,6 +2455,7 @@ dependencies = [ "peach-network", "peach-stats", "rouille", + "solar_client", "temporary", "vnstat_parse", "xdg", @@ -2430,8 +2537,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", - "proc-macro2 1.0.40", - "quote 1.0.20", + "proc-macro2 1.0.86", + "quote 1.0.37", "syn 1.0.98", "version_check 0.9.4", ] @@ -2442,8 +2549,8 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "proc-macro2 1.0.40", - "quote 1.0.20", + "proc-macro2 1.0.86", + "quote 1.0.37", "version_check 0.9.4", ] @@ -2458,9 +2565,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.40" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] @@ -2482,11 +2589,11 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.20" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ - "proc-macro2 1.0.40", + "proc-macro2 1.0.86", ] [[package]] @@ -2765,6 +2872,40 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "reqwest" +version = "0.11.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" +dependencies = [ + "base64 0.21.7", + "bytes 1.1.0", + "encoding_rs", + "futures-core", + "futures-util", + "h2 0.3.26", + "http 0.2.8", + "http-body 0.4.5", + "hyper 0.14.20", + "ipnet", + "js-sys", + "log 0.4.17", + "mime", + "once_cell", + "percent-encoding 2.1.0", + "pin-project-lite", + "serde 1.0.209", + "serde_json", + "serde_urlencoded", + "tokio 1.26.0", + "tower-service", + "url 2.3.0", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg", +] + [[package]] name = "rouille" version = "3.5.0" @@ -2778,14 +2919,14 @@ dependencies = [ "num_cpus", "percent-encoding 2.1.0", "rand 0.8.5", - "serde 1.0.139", + "serde 1.0.209", "serde_derive", "serde_json", "sha1", "threadpool", "time 0.3.11", "tiny_http", - "url 2.2.2", + "url 2.3.0", ] [[package]] @@ -2899,9 +3040,9 @@ checksum = "9dad3f759919b92c3068c696c15c3d17238234498bbdcc80f2c469606f948ac8" [[package]] name = "serde" -version = "1.0.139" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0171ebb889e45aa68b44aee0859b3eede84c6f5f5c228e6f140c0b2a0a46cad6" +checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" dependencies = [ "serde_derive", ] @@ -2921,13 +3062,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.139" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc1d3230c1de7932af58ad8ffbe1d784bd55efd5a9d84ac24f69c72d83543dfb" +checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" dependencies = [ - "proc-macro2 1.0.40", - "quote 1.0.20", - "syn 1.0.98", + "proc-macro2 1.0.86", + "quote 1.0.37", + "syn 2.0.77", ] [[package]] @@ -2936,10 +3077,10 @@ version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "82c2c1fdcd807d1098552c5b9a36e425e42e9fbd7c6a37a8425f390f781f7fa7" dependencies = [ - "indexmap", + "indexmap 1.9.1", "itoa 1.0.2", "ryu", - "serde 1.0.139", + "serde 1.0.209", ] [[package]] @@ -2951,15 +3092,27 @@ dependencies = [ "serde 0.8.23", ] +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa 1.0.2", + "ryu", + "serde 1.0.209", +] + [[package]] name = "serde_yaml" version = "0.8.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ec0091e1f5aa338283ce049bd9dfefd55e1f168ac233e85c1ffe0038fb48cbe" dependencies = [ - "indexmap", + "indexmap 1.9.1", "ryu", - "serde 1.0.139", + "serde 1.0.209", "yaml-rust", ] @@ -3100,8 +3253,8 @@ version = "0.6.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1508efa03c362e23817f96cde18abed596a25219a8b2c66e8db33c03543d315b" dependencies = [ - "proc-macro2 1.0.40", - "quote 1.0.20", + "proc-macro2 1.0.86", + "quote 1.0.37", "syn 1.0.98", ] @@ -3115,6 +3268,16 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "solar_client" +version = "0.1.0" +dependencies = [ + "anyhow", + "jsonrpc_client", + "reqwest", + "serde_json", +] + [[package]] name = "spidev" version = "0.3.0" @@ -3170,8 +3333,8 @@ checksum = "dcb5ae327f9cc13b68763b5749770cb9e048a99bd9dfdfa58d0cf05d5f64afe0" dependencies = [ "heck", "proc-macro-error", - "proc-macro2 1.0.40", - "quote 1.0.20", + "proc-macro2 1.0.86", + "quote 1.0.37", "syn 1.0.98", ] @@ -3192,8 +3355,19 @@ version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd" dependencies = [ - "proc-macro2 1.0.40", - "quote 1.0.20", + "proc-macro2 1.0.86", + "quote 1.0.37", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.37", "unicode-ident", ] @@ -3292,8 +3466,8 @@ version = "1.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" dependencies = [ - "proc-macro2 1.0.40", - "quote 1.0.20", + "proc-macro2 1.0.86", + "quote 1.0.37", "syn 1.0.98", ] @@ -3337,7 +3511,7 @@ dependencies = [ "chrono", "chunked_transfer", "log 0.4.17", - "url 2.2.2", + "url 2.3.0", ] [[package]] @@ -3399,19 +3573,19 @@ dependencies = [ [[package]] name = "tokio" -version = "1.19.2" +version = "1.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c51a52ed6686dd62c320f9b89299e9dfb46f730c7a48e635c19f21d116cb1439" +checksum = "03201d01c3c27a29c8a5cee5b55a93ddae1ccf6f08f65365c2c918f8c1b76f64" dependencies = [ + "autocfg 1.1.0", "bytes 1.1.0", "libc", "memchr", "mio 0.8.4", "num_cpus", - "once_cell", "pin-project-lite", "socket2", - "winapi 0.3.9", + "windows-sys 0.45.0", ] [[package]] @@ -3551,7 +3725,7 @@ checksum = "df54d54117d6fdc4e4fea40fe1e4e566b3505700e148a6827e59b34b0d2600d9" dependencies = [ "futures-core", "pin-project-lite", - "tokio 1.19.2", + "tokio 1.26.0", ] [[package]] @@ -3651,7 +3825,21 @@ dependencies = [ "futures-sink", "log 0.4.17", "pin-project-lite", - "tokio 1.19.2", + "tokio 1.26.0", +] + +[[package]] +name = "tokio-util" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +dependencies = [ + "bytes 1.1.0", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio 1.26.0", + "tracing", ] [[package]] @@ -3660,8 +3848,8 @@ version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" dependencies = [ - "indexmap", - "serde 1.0.139", + "indexmap 1.9.1", + "serde 1.0.209", ] [[package]] @@ -3778,13 +3966,12 @@ dependencies = [ [[package]] name = "url" -version = "2.2.2" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" +checksum = "22fe195a4f217c25b25cb5058ced57059824a678474874038dc88d211bf508d3" dependencies = [ "form_urlencoded", "idna 0.2.3", - "matches", "percent-encoding 2.1.0", ] @@ -3914,8 +4101,8 @@ dependencies = [ "bumpalo", "lazy_static", "log 0.4.17", - "proc-macro2 1.0.40", - "quote 1.0.20", + "proc-macro2 1.0.86", + "quote 1.0.37", "syn 1.0.98", "wasm-bindgen-shared", ] @@ -3938,7 +4125,7 @@ version = "0.2.81" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c441e177922bc58f1e12c022624b6216378e5febc2f0533e41ba443d505b80aa" dependencies = [ - "quote 1.0.20", + "quote 1.0.37", "wasm-bindgen-macro-support", ] @@ -3948,8 +4135,8 @@ version = "0.2.81" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d94ac45fcf608c1f45ef53e748d35660f168490c10b23704c7779ab8f5c3048" dependencies = [ - "proc-macro2 1.0.40", - "quote 1.0.20", + "proc-macro2 1.0.86", + "quote 1.0.37", "syn 1.0.98", "wasm-bindgen-backend", "wasm-bindgen-shared", @@ -4029,43 +4216,118 @@ version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" dependencies = [ - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_msvc", + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", ] +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + [[package]] name = "windows_aarch64_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + [[package]] name = "windows_i686_gnu" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + [[package]] name = "windows_i686_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + [[package]] name = "windows_x86_64_gnu" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + [[package]] name = "windows_x86_64_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "winreg" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +dependencies = [ + "winapi 0.3.9", +] + [[package]] name = "wpactrl" version = "0.5.0" diff --git a/peach-lib/Cargo.toml b/peach-lib/Cargo.toml index 7c8ea4a..c45253f 100644 --- a/peach-lib/Cargo.toml +++ b/peach-lib/Cargo.toml @@ -9,10 +9,12 @@ async-std = "1.10" chrono = "0.4" dirs = "4.0" fslock="0.1" -golgi = { git = "https://git.coopcloud.tech/golgi-ssb/golgi.git" } +kuska-ssb = { git = "https://github.com/Kuska-ssb/ssb" } +solar_client = { path = "../../solarpub/solar_client" } jsonrpc-client-core = "0.5" jsonrpc-client-http = "0.5" jsonrpc-core = "8.0" +jsonrpc_client = "0.7" log = "0.4" nanorand = { version = "0.6", features = ["getrandom"] } regex = "1" @@ -22,3 +24,4 @@ serde_yaml = "0.8" toml = "0.5" sha3 = "0.10" lazy_static = "1.4" +anyhow = "1.0.86" diff --git a/peach-lib/src/config_manager.rs b/peach-lib/src/config_manager.rs index 49d6d38..94b97d5 100644 --- a/peach-lib/src/config_manager.rs +++ b/peach-lib/src/config_manager.rs @@ -59,8 +59,8 @@ pub fn get_peach_config_defaults() -> HashMap { ("SSB_ADMIN_IDS", ""), ("ADMIN_PASSWORD_HASH", "47"), ("TEMPORARY_PASSWORD_HASH", ""), - ("GO_SBOT_DATADIR", "/home/peach/.ssb-go"), - ("GO_SBOT_SERVICE", "go-sbot.service"), + ("SOLAR_SBOT_DATADIR", "/home/peach/.ssb-solar"), + ("SOLAR_SBOT_SERVICE", "solar-sbot.service"), ("PEACH_CONFIGDIR", "/var/lib/peachcloud"), ("PEACH_HOMEDIR", "/home/peach"), ("PEACH_WEBDIR", "/usr/share/peach-web"), diff --git a/peach-lib/src/error.rs b/peach-lib/src/error.rs index 9c55c1d..abf336b 100644 --- a/peach-lib/src/error.rs +++ b/peach-lib/src/error.rs @@ -1,9 +1,9 @@ #![warn(missing_docs)] //! Error handling for various aspects of the PeachCloud system, including the network, OLED, stats and dyndns JSON-RPC clients, as well as the configuration manager, sbot client and password utilities. - -use golgi::GolgiError; use std::{io, str, string}; +use jsonrpc_client::JsonRpcError; +use anyhow::Error; // Add the anyhow crate for errors /// This type represents all possible errors that can occur when interacting with the PeachCloud library. #[derive(Debug)] @@ -104,8 +104,15 @@ pub enum PeachError { path: String, }, - /// Represents a Golgi error - Golgi(GolgiError), + /// Represents a JsonRpcError with Solar + JsonRpcError(JsonRpcError), + + /// Represents an Anyhow error with Solar + SolarClientError(String), + + /// Represents an error with encoding or decoding an SsbMessage + SsbMessageError(String), + } impl std::error::Error for PeachError { @@ -134,7 +141,9 @@ impl std::error::Error for PeachError { PeachError::Utf8ToStr(_) => None, PeachError::Utf8ToString(_) => None, PeachError::Write { ref source, .. } => Some(source), - PeachError::Golgi(_) => None, + PeachError::JsonRpcError(_) => None, + PeachError::SolarClientError(_) => None, + PeachError::SsbMessageError(_) => None, } } } @@ -192,7 +201,9 @@ impl std::fmt::Display for PeachError { PeachError::Write { ref path, .. } => { write!(f, "Write error: {}", path) } - PeachError::Golgi(ref err) => err.fmt(f), + PeachError::JsonRpcError(ref err) => err.fmt(f), + PeachError::SolarClientError(ref err) => err.fmt(f), + PeachError::SsbMessageError(ref err) => err.fmt(f), } } } @@ -263,8 +274,15 @@ impl From for PeachError { } } -impl From for PeachError { - fn from(err: GolgiError) -> PeachError { - PeachError::Golgi(err) +impl From for PeachError { + fn from(err: JsonRpcError) -> PeachError { + PeachError::JsonRpcError(err) } } + +impl From for PeachError { + fn from(error: anyhow::Error) -> Self { + // TODO: include whole error somehow? + PeachError::SolarClientError(error.to_string()) + } +} \ No newline at end of file diff --git a/peach-lib/src/lib.rs b/peach-lib/src/lib.rs index cdbe8fa..1a3afd7 100644 --- a/peach-lib/src/lib.rs +++ b/peach-lib/src/lib.rs @@ -6,6 +6,7 @@ pub mod oled_client; pub mod password_utils; pub mod sbot; pub mod stats_client; +pub mod ssb_messages; // re-export error types pub use jsonrpc_client_core; diff --git a/peach-lib/src/password_utils.rs b/peach-lib/src/password_utils.rs index cbdd158..cde3ad9 100644 --- a/peach-lib/src/password_utils.rs +++ b/peach-lib/src/password_utils.rs @@ -1,9 +1,9 @@ use async_std::task; -use golgi::{sbot::Keystore, Sbot}; use log::debug; use nanorand::{Rng, WyRand}; use sha3::{Digest, Sha3_256}; +use crate::sbot::init_sbot; use crate::{config_manager, error::PeachError, sbot::SbotConfig}; /// Returns Ok(()) if the supplied password is correct, @@ -122,22 +122,15 @@ async fn publish_private_msg(msg: &str, recipient: &str) -> Result<(), String> { let recipient = vec![recipient.to_string()]; // initialise sbot connection with ip:port and shscap from config file - let mut sbot_client = match sbot_config { - // TODO: panics if we pass `Some(conf.shscap)` as second arg - Some(conf) => { - let ip_port = conf.lis.clone(); - Sbot::init(Keystore::GoSbot, Some(ip_port), None) - .await - .map_err(|e| e.to_string())? - } - None => Sbot::init(Keystore::GoSbot, None, None) - .await - .map_err(|e| e.to_string())?, - }; + let mut sbot_client = init_sbot(); debug!("Publishing a Scuttlebutt private message with temporary password"); - match sbot_client.publish_private(msg, recipient).await { - Ok(_) => Ok(()), - Err(e) => Err(format!("Failed to publish private message: {}", e)), - } + // TODO: implement publish private message in solar, and then implement this + Err(format!("Failed to publish private message: \ + private publishing is not yet implemented in solar_client: \ + the message meant to be sent was: {}", msg)) + // match sbot_client.publish_private(msg, recipient).await { + // Ok(_) => Ok(()), + // Err(e) => Err(format!("Failed to publish private message: {}", e)), + // } } diff --git a/peach-lib/src/sbot.rs b/peach-lib/src/sbot.rs index 730df22..a694ce4 100644 --- a/peach-lib/src/sbot.rs +++ b/peach-lib/src/sbot.rs @@ -1,8 +1,8 @@ -//! Data types and associated methods for monitoring and configuring go-sbot. +//! Data types and associated methods for monitoring and configuring solar-sbot. use std::{fs, fs::File, io, io::Write, path::PathBuf, process::Command, str}; - -use golgi::{sbot::Keystore, Sbot}; +use std::os::linux::raw::ino_t; +use solar_client::{Client, SolarClient}; use log::debug; use crate::config_manager; @@ -30,7 +30,7 @@ fn dir_size(path: impl Into) -> io::Result { /* SBOT-RELATED TYPES AND METHODS */ -/// go-sbot process status. +/// solar-sbot process status. #[derive(Debug, Serialize, Deserialize)] pub struct SbotStatus { /// Current process state. @@ -62,7 +62,7 @@ impl Default for SbotStatus { } impl SbotStatus { - /// Retrieve statistics for the go-sbot systemd process by querying `systemctl`. + /// Retrieve statistics for the solar-sbot systemd process by querying `systemctl`. pub fn read() -> Result { let mut status = SbotStatus::default(); @@ -70,7 +70,7 @@ impl SbotStatus { // because non-privileged users are able to run systemctl show let info_output = Command::new("systemctl") .arg("show") - .arg(config_manager::get_config_value("GO_SBOT_SERVICE")?) + .arg(config_manager::get_config_value("SOLAR_SBOT_SERVICE")?) .arg("--no-page") .output()?; @@ -92,7 +92,7 @@ impl SbotStatus { // because non-privileged users are able to run systemctl status let status_output = Command::new("systemctl") .arg("status") - .arg(config_manager::get_config_value("GO_SBOT_SERVICE")?) + .arg(config_manager::get_config_value("SOLAR_SBOT_SERVICE")?) .output()?; let service_status = str::from_utf8(&status_output.stdout)?; @@ -100,7 +100,7 @@ impl SbotStatus { for line in service_status.lines() { // example of the output line we're looking for: - // `Loaded: loaded (/home/glyph/.config/systemd/user/go-sbot.service; enabled; vendor + // `Loaded: loaded (/home/glyph/.config/systemd/user/solar-sbot.service; enabled; vendor // preset: enabled)` if line.contains("Loaded:") { let before_boot_state = line.find(';'); @@ -133,7 +133,7 @@ impl SbotStatus { // get path to blobstore let blobstore_path = format!( "{}/blobs/sha256", - config_manager::get_config_value("GO_SBOT_DATADIR")? + config_manager::get_config_value("SOLAR_SBOT_DATADIR")? ); // determine the size of the blobstore directory in bytes @@ -143,10 +143,10 @@ impl SbotStatus { } } -/// go-sbot configuration parameters. -#[derive(Debug, Serialize, Deserialize)] +/// solar-sbot configuration parameters. +#[derive(Debug, Serialize, Deserialize, Default)] #[serde(default)] -pub struct SbotConfig { +pub struct Config { // TODO: maybe define as a Path type? /// Directory path for the log and indexes. pub repo: String, @@ -180,7 +180,27 @@ pub struct SbotConfig { pub repair: bool, } -/// Default configuration values for go-sbot. +// TODO: make this real +#[derive(Debug, Deserialize, Serialize)] +#[serde(default)] +pub struct SbotConfig { + pub repo: String, + pub debugdir: String, + pub shscap: String, + pub hmac: String, + pub hops: i8, + pub lis: String, + pub wslis: String, + pub debuglis: String, + pub localadv: bool, + pub localdiscov: bool, + pub enable_ebt: bool, + pub promisc: bool, + pub nounixsock: bool, + pub repair: bool, +} + +/// Default configuration values for solar-sbot. impl Default for SbotConfig { fn default() -> Self { Self { @@ -203,12 +223,12 @@ impl Default for SbotConfig { } impl SbotConfig { - /// Read the go-sbot `config.toml` file from file and deserialize into `SbotConfig`. + /// Read the solar-sbot `config.toml` file from file and deserialize into `SbotConfig`. pub fn read() -> Result { - // determine path of user's go-sbot config.toml + // determine path of user's solar-sbot config.toml let config_path = format!( "{}/config.toml", - config_manager::get_config_value("GO_SBOT_DATADIR")? + config_manager::get_config_value("SOLAR_SBOT_DATADIR")? ); let config_contents = fs::read_to_string(config_path)?; @@ -218,17 +238,17 @@ impl SbotConfig { Ok(config) } - /// Write the given `SbotConfig` to the go-sbot `config.toml` file. + /// Write the given `SbotConfig` to the solar-sbot `config.toml` file. pub fn write(config: SbotConfig) -> Result<(), PeachError> { - let repo_comment = "# For details about go-sbot configuration, please visit the repo: https://github.com/cryptoscope/ssb\n".to_string(); + let repo_comment = "# For details about solar-sbot configuration, please visit the repo: https://github.com/cryptoscope/ssb\n".to_string(); // convert the provided `SbotConfig` instance to a string let config_string = toml::to_string(&config)?; - // determine path of user's go-sbot config.toml + // determine path of user's solar-sbot config.toml let config_path = format!( "{}/config.toml", - config_manager::get_config_value("GO_SBOT_DATADIR")? + config_manager::get_config_value("SOLAR_SBOT_DATADIR")? ); // open config file for writing @@ -245,7 +265,7 @@ impl SbotConfig { } /// Initialise an sbot client -pub async fn init_sbot() -> Result { +pub async fn init_sbot() -> Result { // read sbot config from config.toml let sbot_config = SbotConfig::read().ok(); @@ -253,15 +273,10 @@ pub async fn init_sbot() -> Result { // initialise sbot connection with ip:port and shscap from config file let key_path = format!( "{}/secret", - config_manager::get_config_value("GO_SBOT_DATADIR")? + config_manager::get_config_value("SOLAR_SBOT_DATADIR")? ); - let sbot_client = match sbot_config { - // TODO: panics if we pass `Some(conf.shscap)` as second arg - Some(conf) => { - let ip_port = conf.lis.clone(); - Sbot::init(Keystore::CustomGoSbot(key_path), Some(ip_port), None).await? - } - None => Sbot::init(Keystore::CustomGoSbot(key_path), None, None).await?, - }; + // TODO: read this from config + const SERVER_ADDR: &str = "http://127.0.0.1:3030"; + let sbot_client = Client::new(SERVER_ADDR.to_owned())?; Ok(sbot_client) } diff --git a/peach-lib/src/ssb_messages.rs b/peach-lib/src/ssb_messages.rs new file mode 100644 index 0000000..6684d2b --- /dev/null +++ b/peach-lib/src/ssb_messages.rs @@ -0,0 +1,104 @@ +//! Message types and conversion methods. + +use kuska_ssb::api::dto::content::TypedMessage; +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use std::fmt::Debug; +use crate::error::PeachError; +use crate::error::PeachError::SsbMessageError; + +/// `SsbMessageContent` is a type alias for `TypedMessage` from the `kuska_ssb` library. +/// It is aliased in golgi to fit the naming convention of the other message +/// types: `SsbMessageKVT` and `SsbMessageValue`. +/// +/// See the [kuska source code](https://github.com/Kuska-ssb/ssb/blob/master/src/api/dto/content.rs#L103) for the type definition of `TypedMessage`. +pub type SsbMessageContent = TypedMessage; + +/// The `value` of an SSB message (the `V` in `KVT`). +/// +/// More information concerning the data model can be found in the +/// [`Metadata` documentation](https://spec.scuttlebutt.nz/feed/messages.html#metadata). +#[derive(Serialize, Deserialize, Debug)] +#[serde(deny_unknown_fields)] +#[allow(missing_docs)] +pub struct SsbMessageValue { + pub previous: Option, + pub author: String, + pub sequence: u64, + pub timestamp: f64, + pub hash: String, + pub content: Value, + pub signature: String, +} + +/// Message content types. +#[derive(Debug, Eq, PartialEq)] +#[allow(missing_docs)] +pub enum SsbMessageContentType { + About, + Vote, + Post, + Contact, + Unrecognized, +} + +impl SsbMessageValue { + /// Get the type field of the message content as an enum, if found. + /// + /// If no `type` field is found or the `type` field is not a string, + /// it returns an `Err(GolgiError::ContentType)`. + /// + /// If a `type` field is found but with an unknown string, + /// it returns an `Ok(SsbMessageContentType::Unrecognized)`. + pub fn get_message_type(&self) -> Result { + let msg_type = self + .content + .get("type") + .ok_or_else(|| SsbMessageError("type field not found".to_string()))?; + let mtype_str: &str = msg_type.as_str().ok_or_else(|| { + SsbMessageError("type field value is not a string as expected".to_string()) + })?; + let enum_type = match mtype_str { + "about" => SsbMessageContentType::About, + "post" => SsbMessageContentType::Post, + "vote" => SsbMessageContentType::Vote, + "contact" => SsbMessageContentType::Contact, + _ => SsbMessageContentType::Unrecognized, + }; + Ok(enum_type) + } + + /// Helper function which returns `true` if this message is of the given type, + /// and `false` if the type does not match or is not found. + pub fn is_message_type(&self, message_type: SsbMessageContentType) -> bool { + let self_message_type = self.get_message_type(); + match self_message_type { + Ok(mtype) => mtype == message_type, + Err(_err) => false, + } + } + + /// Convert the content JSON value into an `SsbMessageContent` `enum`, + /// using the `type` field as a tag to select which variant of the `enum` + /// to deserialize into. + /// + /// See the [Serde docs on internally-tagged enum representations](https://serde.rs/enum-representations.html#internally-tagged) for further details. + pub fn into_ssb_message_content(self) -> Result { + let m: SsbMessageContent = serde_json::from_value(self.content)?; + Ok(m) + } +} + +/// An SSB message represented as a key-value-timestamp (`KVT`). +/// +/// More information concerning the data model can be found in the +/// [`Metadata` documentation](https://spec.scuttlebutt.nz/feed/messages.html#metadata). +#[derive(Serialize, Deserialize, Debug)] +#[serde(deny_unknown_fields)] +#[allow(missing_docs)] +pub struct SsbMessageKVT { + pub key: String, + pub value: SsbMessageValue, + pub timestamp: Option, + pub rts: Option, +} \ No newline at end of file diff --git a/peach-web/Cargo.toml b/peach-web/Cargo.toml index 1b13b00..4ab4f61 100644 --- a/peach-web/Cargo.toml +++ b/peach-web/Cargo.toml @@ -39,7 +39,7 @@ chrono = "0.4" dirs = "4.0" env_logger = "0.8" futures = "0.3" -golgi = { git = "https://git.coopcloud.tech/golgi-ssb/golgi.git" } +solar_client = { path = "../../solarpub/solar_client" } lazy_static = "1.4" log = "0.4" maud = "0.23" diff --git a/peach-web/src/error.rs b/peach-web/src/error.rs index 0d5453b..ebb3db5 100644 --- a/peach-web/src/error.rs +++ b/peach-web/src/error.rs @@ -2,7 +2,6 @@ use std::io::Error as IoError; -use golgi::GolgiError; use peach_lib::error::PeachError; use peach_lib::{serde_json, serde_yaml}; use serde_json::error::Error as JsonError; @@ -12,26 +11,26 @@ use serde_yaml::Error as YamlError; #[derive(Debug)] pub enum PeachWebError { FailedToRegisterDynDomain(String), - Golgi(GolgiError), HomeDir, Io(IoError), Json(JsonError), OsString, PeachLib { source: PeachError, msg: String }, Yaml(YamlError), + NotYetImplemented, } impl std::error::Error for PeachWebError { fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { match *self { PeachWebError::FailedToRegisterDynDomain(_) => None, - PeachWebError::Golgi(ref source) => Some(source), PeachWebError::HomeDir => None, PeachWebError::Io(ref source) => Some(source), PeachWebError::Json(ref source) => Some(source), PeachWebError::OsString => None, PeachWebError::PeachLib { ref source, .. } => Some(source), PeachWebError::Yaml(ref source) => Some(source), + PeachWebError::NotYetImplemented => None } } } @@ -42,7 +41,6 @@ impl std::fmt::Display for PeachWebError { PeachWebError::FailedToRegisterDynDomain(ref msg) => { write!(f, "DYN DNS error: {}", msg) } - PeachWebError::Golgi(ref source) => write!(f, "Golgi error: {}", source), PeachWebError::HomeDir => write!( f, "Filesystem error: failed to determine home directory path" @@ -55,16 +53,11 @@ impl std::fmt::Display for PeachWebError { ), PeachWebError::PeachLib { ref source, .. } => write!(f, "{}", source), PeachWebError::Yaml(ref source) => write!(f, "Serde YAML error: {}", source), + PeachWebError::NotYetImplemented => write!(f, "Not yet implemented"), } } } -impl From for PeachWebError { - fn from(err: GolgiError) -> PeachWebError { - PeachWebError::Golgi(err) - } -} - impl From for PeachWebError { fn from(err: IoError) -> PeachWebError { PeachWebError::Io(err) @@ -91,3 +84,4 @@ impl From for PeachWebError { PeachWebError::Yaml(err) } } + diff --git a/peach-web/src/routes/settings/scuttlebutt/configure.rs b/peach-web/src/routes/settings/scuttlebutt/configure.rs index d2a54cf..5eb249b 100644 --- a/peach-web/src/routes/settings/scuttlebutt/configure.rs +++ b/peach-web/src/routes/settings/scuttlebutt/configure.rs @@ -205,7 +205,7 @@ pub fn handle_form(request: &Request, restart: bool) -> Response { debugdir: String, shscap: String, hmac: String, - hops: u8, + hops: i8, lis_ip: String, lis_port: String, wslis: String, diff --git a/peach-web/src/utils/sbot.rs b/peach-web/src/utils/sbot.rs index 95f7a31..9e9b4f3 100644 --- a/peach-web/src/utils/sbot.rs +++ b/peach-web/src/utils/sbot.rs @@ -11,29 +11,25 @@ use std::{ use async_std::task; use dirs; use futures::stream::TryStreamExt; -use golgi::{ - api::{friends::RelationshipQuery, history_stream::CreateHistoryStream}, - blobs, - messages::SsbMessageKVT, - sbot::Keystore, - Sbot, -}; use log::debug; use peach_lib::config_manager; use peach_lib::sbot::SbotConfig; +use peach_lib::sbot::init_sbot; +use peach_lib::ssb_messages::SsbMessageKVT; +use solar_client::{Client, SolarClient}; use rouille::input::post::BufferedFile; use temporary::Directory; - +use peach_lib::serde_json::json; use crate::{error::PeachWebError, utils::sbot}; // SBOT HELPER FUNCTIONS -/// Executes a systemctl command for the go-sbot.service process. +/// Executes a systemctl command for the solar-sbot.service process. pub fn systemctl_sbot_cmd(cmd: &str) -> Result { let output = Command::new("sudo") .arg("systemctl") .arg(cmd) - .arg(config_manager::get_config_value("GO_SBOT_SERVICE")?) + .arg(config_manager::get_config_value("SOLAR_SBOT_SERVICE")?) .output()?; Ok(output) } @@ -41,7 +37,7 @@ pub fn systemctl_sbot_cmd(cmd: &str) -> Result { /// Executes a systemctl stop command followed by start command. /// Returns a redirect with a flash message stating the output of the restart attempt. pub fn restart_sbot_process() -> (String, String) { - debug!("Restarting go-sbot.service"); + debug!("Restarting solar-sbot.service"); match systemctl_sbot_cmd("stop") { // if stop was successful, try to start the process Ok(_) => match systemctl_sbot_cmd("start") { @@ -70,21 +66,14 @@ pub fn restart_sbot_process() -> (String, String) { /// Initialise an sbot client with the given configuration parameters. pub async fn init_sbot_with_config( sbot_config: &Option, -) -> Result { +) -> Result { debug!("Initialising an sbot client with configuration parameters"); // initialise sbot connection with ip:port and shscap from config file let key_path = format!( "{}/secret", config_manager::get_config_value("GO_SBOT_DATADIR")? ); - let sbot_client = match sbot_config { - // TODO: panics if we pass `Some(conf.shscap)` as second arg - Some(conf) => { - let ip_port = conf.lis.clone(); - Sbot::init(Keystore::CustomGoSbot(key_path), Some(ip_port), None).await? - } - None => Sbot::init(Keystore::CustomGoSbot(key_path), None, None).await?, - }; + let sbot_client = init_sbot().await?; Ok(sbot_client) } @@ -127,50 +116,53 @@ pub fn validate_public_key(public_key: &str) -> Result<(), String> { /// reverses the list and reads the sequence number of the most recently /// authored message. This gives us the size of the database in terms of /// the total number of locally-authored messages. -pub fn latest_sequence_number() -> Result> { - // retrieve latest go-sbot configuration parameters +pub fn latest_sequence_number() -> Result { + // retrieve latest solar-sbot configuration parameters let sbot_config = SbotConfig::read().ok(); task::block_on(async { let mut sbot_client = init_sbot_with_config(&sbot_config).await?; + Err(PeachWebError::NotYetImplemented) + // retrieve the local id - let id = sbot_client.whoami().await?; + // let id = sbot_client.whoami().await?; - let args = CreateHistoryStream::new(id).keys_values(true, true); - let history_stream = sbot_client.create_history_stream(args).await?; - let mut msgs: Vec = history_stream.try_collect().await?; + // let history_stream = sbot_client.feed(&id).await?; - // there will be zero messages when the sbot is run for the first time - if msgs.is_empty() { - Ok(0) - } else { - // reverse the list of messages so we can easily reference the latest one - msgs.reverse(); - - // return the sequence number of the latest msg - Ok(msgs[0].value.sequence) - } + // let mut msgs: Vec = history_stream.try_collect().await?; + // + // // there will be zero messages when the sbot is run for the first time + // if msgs.is_empty() { + // Ok(0) + // } else { + // // reverse the list of messages so we can easily reference the latest one + // msgs.reverse(); + // + // // return the sequence number of the latest msg + // Ok(msgs[0].value.sequence) + // } }) } -pub fn create_invite(uses: u16) -> Result> { - // retrieve latest go-sbot configuration parameters +pub fn create_invite(uses: u16) -> Result { + // retrieve latest solar-sbot configuration parameters let sbot_config = SbotConfig::read().ok(); task::block_on(async { let mut sbot_client = init_sbot_with_config(&sbot_config).await?; debug!("Generating Scuttlebutt invite code"); - let mut invite_code = sbot_client.invite_create(uses).await?; - - // insert domain into invite if one is configured - let domain = config_manager::get_config_value("EXTERNAL_DOMAIN")?; - if !domain.is_empty() { - invite_code = domain + &invite_code[4..]; - } - - Ok(invite_code) + Err(PeachWebError::NotYetImplemented) + // let mut invite_code = sbot_client.invite_create(uses).await?; + // + // // insert domain into invite if one is configured + // let domain = config_manager::get_config_value("EXTERNAL_DOMAIN")?; + // if !domain.is_empty() { + // invite_code = domain + &invite_code[4..]; + // } + // + // Ok(invite_code) }) } @@ -209,91 +201,71 @@ impl Profile { } /// Retrieve the profile info for the given public key. -pub fn get_profile_info(ssb_id: Option) -> Result> { - // retrieve latest go-sbot configuration parameters +pub fn get_profile_info(ssb_id: Option) -> Result { + // retrieve latest solar-sbot configuration parameters let sbot_config = SbotConfig::read().ok(); task::block_on(async { let mut sbot_client = init_sbot_with_config(&sbot_config).await?; - let local_id = sbot_client.whoami().await?; - - let mut profile = Profile::default(); - - // if an ssb_id has been provided, we assume that the profile info - // being retrieved is for a peer (ie. not for our local profile) - let id = if let Some(peer_id) = ssb_id { - // we are not dealing with the local profile - profile.is_local_profile = false; - - // determine relationship between peer and local id - let follow_query = RelationshipQuery { - source: local_id.clone(), - dest: peer_id.clone(), - }; - - // query follow state - profile.following = match sbot_client.friends_is_following(follow_query).await { - Ok(following) if following == "true" => Some(true), - Ok(following) if following == "false" => Some(false), - _ => None, - }; - - // TODO: i don't like that we have to instantiate the same query object - // twice. see if we can streamline this in golgi - let block_query = RelationshipQuery { - source: local_id.clone(), - dest: peer_id.clone(), - }; - - // query block state - profile.blocking = match sbot_client.friends_is_blocking(block_query).await { - Ok(blocking) if blocking == "true" => Some(true), - Ok(blocking) if blocking == "false" => Some(false), - _ => None, - }; - - peer_id - } else { - // if an ssb_id has not been provided, retrieve the local id using whoami - profile.is_local_profile = true; - - local_id - }; - - // retrieve the profile info for the given id - let info = sbot_client.get_profile_info(&id).await?; - // set each profile field accordingly - for (key, val) in info { - match key.as_str() { - "name" => profile.name = Some(val), - "description" => profile.description = Some(val), - "image" => profile.image = Some(val), - _ => (), - } - } - - // assign the ssb public key - // (could be for the local profile or a peer) - profile.id = Some(id); - - // determine the path to the blob defined by the value of `profile.image` - if let Some(ref blob_id) = profile.image { - profile.blob_path = match blobs::get_blob_path(blob_id) { - Ok(path) => { - // if we get the path, check if the blob is in the blobstore. - // this allows us to default to a placeholder image in the template - if let Ok(exists) = blob_is_stored_locally(&path).await { - profile.blob_exists = exists - }; - - Some(path) - } - Err(_) => None, - } - } - - Ok(profile) + Err(PeachWebError::NotYetImplemented) + // let local_id = sbot_client.whoami().await?; + // + // let mut profile = Profile::default(); + // + // // if an ssb_id has been provided, we assume that the profile info + // // being retrieved is for a peer (ie. not for our local profile) + // let id = if let Some(peer_id) = ssb_id { + // // we are not dealing with the local profile + // profile.is_local_profile = false; + // + // // query follow state + // profile.following = Some(sbot_client.is_following(&local_id, &peer_id).await?); + // + // // TODO: implement this check in solar_client so that this can be a real value + // profile.blocking = Some(false); + // + // peer_id + // } else { + // // if an ssb_id has not been provided, retrieve the local id using whoami + // profile.is_local_profile = true; + // + // local_id + // }; + // + // // retrieve the profile info for the given id + // let info = sbot_client.get_profile_info(&id).await?; + // // set each profile field accordingly + // for (key, val) in info { + // match key.as_str() { + // "name" => profile.name = Some(val), + // "description" => profile.description = Some(val), + // "image" => profile.image = Some(val), + // _ => (), + // } + // } + // + // // assign the ssb public key + // // (could be for the local profile or a peer) + // profile.id = Some(id); + // + // // determine the path to the blob defined by the value of `profile.image` + // if let Some(ref blob_id) = profile.image { + // profile.blob_path = match blobs::get_blob_path(blob_id) { + // Ok(path) => { + // // if we get the path, check if the blob is in the blobstore. + // // this allows us to default to a placeholder image in the template + // if let Ok(exists) = blob_is_stored_locally(&path).await { + // profile.blob_exists = exists + // }; + // + // Some(path) + // } + // Err(_) => None, + // } + // } + // + // Ok(profile) }) } @@ -306,78 +278,78 @@ pub fn update_profile_info( new_name: Option, new_description: Option, image: Option, -) -> Result { - // retrieve latest go-sbot configuration parameters +) -> Result { + // retrieve latest solar-sbot configuration parameters let sbot_config = SbotConfig::read().ok(); task::block_on(async { let mut sbot_client = init_sbot_with_config(&sbot_config) - .await - .map_err(|e| e.to_string())?; + .await?; - // track whether the name, description or image have been updated - let mut name_updated: bool = false; - let mut description_updated: bool = false; - let mut image_updated: bool = false; - - // check if a new_name value has been submitted in the form - if let Some(name) = new_name { - // only update the name if it has changed - if name != current_name { - debug!("Publishing a new Scuttlebutt profile name"); - if let Err(e) = sbot_client.publish_name(&name).await { - return Err(format!("Failed to update name: {}", e)); - } else { - name_updated = true - } - } - } - - if let Some(description) = new_description { - // only update the description if it has changed - if description != current_description { - debug!("Publishing a new Scuttlebutt profile description"); - if let Err(e) = sbot_client.publish_description(&description).await { - return Err(format!("Failed to update description: {}", e)); - } else { - description_updated = true - } - } - } - - // only update the image if a file was uploaded - if let Some(img) = image { - // only write the blob if it has a filename and data > 0 bytes - if img.filename.is_some() && !img.data.is_empty() { - match write_blob_to_store(img).await { - Ok(blob_id) => { - // if the file was successfully added to the blobstore, - // publish an about image message with the blob id - if let Err(e) = sbot_client.publish_image(&blob_id).await { - return Err(format!("Failed to update image: {}", e)); - } else { - image_updated = true - } - } - Err(e) => return Err(format!("Failed to add image to blobstore: {}", e)), - } - } else { - image_updated = false - } - } - - if name_updated || description_updated || image_updated { - Ok("Profile updated".to_string()) - } else { - // no updates were made but no errors were encountered either - Ok("Profile info unchanged".to_string()) - } + Err(PeachWebError::NotYetImplemented) + // // track whether the name, description or image have been updated + // let mut name_updated: bool = false; + // let mut description_updated: bool = false; + // let mut image_updated: bool = false; + // + // // check if a new_name value has been submitted in the form + // if let Some(name) = new_name { + // // only update the name if it has changed + // if name != current_name { + // debug!("Publishing a new Scuttlebutt profile name"); + // if let Err(e) = sbot_client.publish_name(&name).await { + // return Err(format!("Failed to update name: {}", e)); + // } else { + // name_updated = true + // } + // } + // } + // + // if let Some(description) = new_description { + // // only update the description if it has changed + // if description != current_description { + // debug!("Publishing a new Scuttlebutt profile description"); + // if let Err(e) = sbot_client.publish_description(&description).await { + // return Err(format!("Failed to update description: {}", e)); + // } else { + // description_updated = true + // } + // } + // } + // + // // only update the image if a file was uploaded + // if let Some(img) = image { + // // only write the blob if it has a filename and data > 0 bytes + // if img.filename.is_some() && !img.data.is_empty() { + // match write_blob_to_store(img).await { + // Ok(blob_id) => { + // // if the file was successfully added to the blobstore, + // // publish an about image message with the blob id + // if let Err(e) = sbot_client.publish_image(&blob_id).await { + // return Err(format!("Failed to update image: {}", e)); + // } else { + // image_updated = true + // } + // } + // Err(e) => return Err(format!("Failed to add image to blobstore: {}", e)), + // } + // } else { + // image_updated = false + // } + // } + // + // if name_updated || description_updated || image_updated { + // Ok("Profile updated".to_string()) + // } else { + // // no updates were made but no errors were encountered either + // Ok("Profile info unchanged".to_string()) + // } }) } /// Follow a peer. pub fn follow_peer(public_key: &str) -> Result { - // retrieve latest go-sbot configuration parameters + // retrieve latest solar-sbot configuration parameters let sbot_config = SbotConfig::read().ok(); task::block_on(async { @@ -386,7 +358,7 @@ pub fn follow_peer(public_key: &str) -> Result { .map_err(|e| e.to_string())?; debug!("Following a Scuttlebutt peer"); - match sbot_client.follow(public_key).await { + match sbot_client.follows(public_key).await { Ok(_) => Ok("Followed peer".to_string()), Err(e) => Err(format!("Failed to follow peer: {}", e)), } @@ -394,26 +366,26 @@ pub fn follow_peer(public_key: &str) -> Result { } /// Unfollow a peer. -pub fn unfollow_peer(public_key: &str) -> Result { - // retrieve latest go-sbot configuration parameters +pub fn unfollow_peer(public_key: &str) -> Result { + // retrieve latest solar-sbot configuration parameters let sbot_config = SbotConfig::read().ok(); task::block_on(async { let mut sbot_client = init_sbot_with_config(&sbot_config) - .await - .map_err(|e| e.to_string())?; + .await?; - debug!("Unfollowing a Scuttlebutt peer"); - match sbot_client.unfollow(public_key).await { - Ok(_) => Ok("Unfollowed peer".to_string()), - Err(e) => Err(format!("Failed to unfollow peer: {}", e)), - } + Err(PeachWebError::NotYetImplemented) + // debug!("Unfollowing a Scuttlebutt peer"); + // match sbot_client.unfollow(public_key).await { + // Ok(_) => Ok("Unfollowed peer".to_string()), + // Err(e) => Err(format!("Failed to unfollow peer: {}", e)), + // } }) } /// Block a peer. pub fn block_peer(public_key: &str) -> Result { - // retrieve latest go-sbot configuration parameters + // retrieve latest solar-sbot configuration parameters let sbot_config = SbotConfig::read().ok(); task::block_on(async { @@ -422,7 +394,7 @@ pub fn block_peer(public_key: &str) -> Result { .map_err(|e| e.to_string())?; debug!("Blocking a Scuttlebutt peer"); - match sbot_client.block(public_key).await { + match sbot_client.blocks(public_key).await { Ok(_) => Ok("Blocked peer".to_string()), Err(e) => Err(format!("Failed to block peer: {}", e)), } @@ -430,172 +402,171 @@ pub fn block_peer(public_key: &str) -> Result { } /// Unblock a peer. -pub fn unblock_peer(public_key: &str) -> Result { - // retrieve latest go-sbot configuration parameters +pub fn unblock_peer(public_key: &str) -> Result { + // retrieve latest solar-sbot configuration parameters let sbot_config = SbotConfig::read().ok(); task::block_on(async { let mut sbot_client = init_sbot_with_config(&sbot_config) - .await - .map_err(|e| e.to_string())?; + .await?; debug!("Unblocking a Scuttlebutt peer"); - match sbot_client.unblock(public_key).await { - Ok(_) => Ok("Unblocked peer".to_string()), - Err(e) => Err(format!("Failed to unblock peer: {}", e)), - } + Err(PeachWebError::NotYetImplemented) + // match sbot_client.unblock(public_key).await { + // Ok(_) => Ok("Unblocked peer".to_string()), + // Err(e) => Err(format!("Failed to unblock peer: {}", e)), + // } }) } /// Retrieve a list of peers blocked by the local public key. -pub fn get_blocks_list() -> Result>, Box> { - // retrieve latest go-sbot configuration parameters +pub fn get_blocks_list() -> Result>, PeachWebError> { + // retrieve latest solar-sbot configuration parameters let sbot_config = SbotConfig::read().ok(); task::block_on(async { let mut sbot_client = init_sbot_with_config(&sbot_config).await?; - let blocks = sbot_client.get_blocks().await?; - - // we'll use this to store the profile info for each peer whom we block - let mut peer_list = Vec::new(); - - if !blocks.is_empty() { - for peer in blocks.iter() { - // trim whitespace (including newline characters) and - // remove the inverted-commas around the id - let key = peer.trim().replace('"', ""); - // retrieve the profile info for the given peer - let mut peer_info = sbot_client.get_profile_info(&key).await?; - // insert the public key of the peer into the info hashmap - peer_info.insert("id".to_string(), key.to_string()); - // we do not even attempt to find the blob for a blocked peer, - // since it may be vulgar to cause distress to the local peer. - peer_info.insert("blob_exists".to_string(), "false".to_string()); - // push profile info to peer_list vec - peer_list.push(peer_info) - } - } - - // return the list of blocked peers - Ok(peer_list) + Err(PeachWebError::NotYetImplemented) + // let blocks = sbot_client.get_blocks().await?; + // + // // we'll use this to store the profile info for each peer whom we block + // let mut peer_list = Vec::new(); + // + // if !blocks.is_empty() { + // for peer in blocks.iter() { + // // trim whitespace (including newline characters) and + // // remove the inverted-commas around the id + // let key = peer.trim().replace('"', ""); + // // retrieve the profile info for the given peer + // let mut peer_info = sbot_client.get_profile_info(&key).await?; + // // insert the public key of the peer into the info hashmap + // peer_info.insert("id".to_string(), key.to_string()); + // // we do not even attempt to find the blob for a blocked peer, + // // since it may be vulgar to cause distress to the local peer. + // peer_info.insert("blob_exists".to_string(), "false".to_string()); + // // push profile info to peer_list vec + // peer_list.push(peer_info) + // } + // } + // + // // return the list of blocked peers + // Ok(peer_list) }) } /// Retrieve a list of peers followed by the local public key. -pub fn get_follows_list() -> Result>, Box> { - // retrieve latest go-sbot configuration parameters +pub fn get_follows_list() -> Result>, PeachWebError> { + // retrieve latest solar-sbot configuration parameters let sbot_config = SbotConfig::read().ok(); task::block_on(async { let mut sbot_client = init_sbot_with_config(&sbot_config).await?; - let follows = sbot_client.get_follows().await?; + Err(PeachWebError::NotYetImplemented) - // we'll use this to store the profile info for each peer who follows us - let mut peer_list = Vec::new(); - - if !follows.is_empty() { - for peer in follows.iter() { - // trim whitespace (including newline characters) and - // remove the inverted-commas around the id - let key = peer.trim().replace('"', ""); - // retrieve the profile info for the given peer - let mut peer_info = sbot_client.get_profile_info(&key).await?; - // insert the public key of the peer into the info hashmap - peer_info.insert("id".to_string(), key.to_string()); - // retrieve the profile image blob id for the given peer - if let Some(blob_id) = peer_info.get("image") { - // look-up the path for the image blob - if let Ok(blob_path) = blobs::get_blob_path(blob_id) { - // insert the image blob path of the peer into the info hashmap - peer_info.insert("blob_path".to_string(), blob_path.to_string()); - // check if the blob is in the blobstore - // set a flag in the info hashmap - match blob_is_stored_locally(&blob_path).await { - Ok(exists) if exists => { - peer_info.insert("blob_exists".to_string(), "true".to_string()) - } - _ => peer_info.insert("blob_exists".to_string(), "false".to_string()), - }; - } - } - // push profile info to peer_list vec - peer_list.push(peer_info) - } - } - - // return the list of peers - Ok(peer_list) + // let follows = sbot_client.get_follows().await?; + // + // // we'll use this to store the profile info for each peer who follows us + // let mut peer_list = Vec::new(); + // + // if !follows.is_empty() { + // for peer in follows.iter() { + // // trim whitespace (including newline characters) and + // // remove the inverted-commas around the id + // let key = peer.trim().replace('"', ""); + // // retrieve the profile info for the given peer + // let mut peer_info = sbot_client.get_profile_info(&key).await?; + // // insert the public key of the peer into the info hashmap + // peer_info.insert("id".to_string(), key.to_string()); + // // retrieve the profile image blob id for the given peer + // if let Some(blob_id) = peer_info.get("image") { + // // look-up the path for the image blob + // if let Ok(blob_path) = blobs::get_blob_path(blob_id) { + // // insert the image blob path of the peer into the info hashmap + // peer_info.insert("blob_path".to_string(), blob_path.to_string()); + // // check if the blob is in the blobstore + // // set a flag in the info hashmap + // match blob_is_stored_locally(&blob_path).await { + // Ok(exists) if exists => { + // peer_info.insert("blob_exists".to_string(), "true".to_string()) + // } + // _ => peer_info.insert("blob_exists".to_string(), "false".to_string()), + // }; + // } + // } + // // push profile info to peer_list vec + // peer_list.push(peer_info) + // } + // } + // + // // return the list of peers + // Ok(peer_list) }) } /// Retrieve a list of peers friended by the local public key. -pub fn get_friends_list() -> Result>, Box> { - // retrieve latest go-sbot configuration parameters +pub fn get_friends_list() -> Result>, PeachWebError> { + // retrieve latest solar-sbot configuration parameters let sbot_config = SbotConfig::read().ok(); task::block_on(async { let mut sbot_client = init_sbot_with_config(&sbot_config).await?; - let local_id = sbot_client.whoami().await?; + Err(PeachWebError::NotYetImplemented) - let follows = sbot_client.get_follows().await?; - - // we'll use this to store the profile info for each friend - let mut peer_list = Vec::new(); - - if !follows.is_empty() { - for peer in follows.iter() { - // trim whitespace (including newline characters) and - // remove the inverted-commas around the id - let peer_id = peer.trim().replace('"', ""); - // retrieve the profile info for the given peer - let mut peer_info = sbot_client.get_profile_info(&peer_id).await?; - // insert the public key of the peer into the info hashmap - peer_info.insert("id".to_string(), peer_id.to_string()); - // retrieve the profile image blob id for the given peer - if let Some(blob_id) = peer_info.get("image") { - // look-up the path for the image blob - if let Ok(blob_path) = blobs::get_blob_path(blob_id) { - // insert the image blob path of the peer into the info hashmap - peer_info.insert("blob_path".to_string(), blob_path.to_string()); - // check if the blob is in the blobstore - // set a flag in the info hashmap - match sbot::blob_is_stored_locally(&blob_path).await { - Ok(exists) if exists => { - peer_info.insert("blob_exists".to_string(), "true".to_string()) - } - _ => peer_info.insert("blob_exists".to_string(), "false".to_string()), - }; - } - } - - // check if the peer follows us (making us friends) - let follow_query = RelationshipQuery { - source: peer_id.to_string(), - dest: local_id.clone(), - }; - - // query follow state - match sbot_client.friends_is_following(follow_query).await { - Ok(following) if following == "true" => { - // only push profile info to peer_list vec if they follow us - peer_list.push(peer_info) - } - _ => (), - }; - } - } - - // return the list of peers - Ok(peer_list) + // let local_id = sbot_client.whoami().await?; + // + // let follows = sbot_client.get_follows().await?; + // + // // we'll use this to store the profile info for each friend + // let mut peer_list = Vec::new(); + // + // if !follows.is_empty() { + // for peer in follows.iter() { + // // trim whitespace (including newline characters) and + // // remove the inverted-commas around the id + // let peer_id = peer.trim().replace('"', ""); + // // retrieve the profile info for the given peer + // let mut peer_info = sbot_client.get_profile_info(&peer_id).await?; + // // insert the public key of the peer into the info hashmap + // peer_info.insert("id".to_string(), peer_id.to_string()); + // // retrieve the profile image blob id for the given peer + // if let Some(blob_id) = peer_info.get("image") { + // // look-up the path for the image blob + // if let Ok(blob_path) = blobs::get_blob_path(blob_id) { + // // insert the image blob path of the peer into the info hashmap + // peer_info.insert("blob_path".to_string(), blob_path.to_string()); + // // check if the blob is in the blobstore + // // set a flag in the info hashmap + // match sbot::blob_is_stored_locally(&blob_path).await { + // Ok(exists) if exists => { + // peer_info.insert("blob_exists".to_string(), "true".to_string()) + // } + // _ => peer_info.insert("blob_exists".to_string(), "false".to_string()), + // }; + // } + // } + // + // // query follow state + // match sbot_client.is_following(peer.id, local_id).await { + // Ok(true) => { + // // only push profile info to peer_list vec if they follow us + // peer_list.push(peer_info) + // } + // _ => (), + // }; + // } + // } + // + // // return the list of peers + // Ok(peer_list) }) } /// Retrieve the local public key (id). pub fn get_local_id() -> Result> { - // retrieve latest go-sbot configuration parameters + // retrieve latest solar-sbot configuration parameters let sbot_config = SbotConfig::read().ok(); task::block_on(async { @@ -609,7 +580,7 @@ pub fn get_local_id() -> Result> { /// Publish a public post. pub fn publish_public_post(text: String) -> Result { - // retrieve latest go-sbot configuration parameters + // retrieve latest solar-sbot configuration parameters let sbot_config = SbotConfig::read().ok(); task::block_on(async { @@ -618,7 +589,11 @@ pub fn publish_public_post(text: String) -> Result { .map_err(|e| e.to_string())?; debug!("Publishing a new Scuttlebutt public post"); - match sbot_client.publish_post(&text).await { + let post = json!({ + "type": "post", + "text": &text, + }); + match sbot_client.publish(post).await { Ok(_) => Ok("Published post".to_string()), Err(e) => Err(format!("Failed to publish post: {}", e)), } @@ -626,23 +601,23 @@ pub fn publish_public_post(text: String) -> Result { } /// Publish a private message. -pub fn publish_private_msg(text: String, recipients: Vec) -> Result { - // retrieve latest go-sbot configuration parameters +pub fn publish_private_msg(text: String, recipients: Vec) -> Result { + // retrieve latest solar-sbot configuration parameters let sbot_config = SbotConfig::read().ok(); task::block_on(async { let mut sbot_client = init_sbot_with_config(&sbot_config) - .await - .map_err(|e| e.to_string())?; + .await?; - debug!("Publishing a new Scuttlebutt private message"); - match sbot_client - .publish_private(text.to_string(), recipients) - .await - { - Ok(_) => Ok("Published private message".to_string()), - Err(e) => Err(format!("Failed to publish private message: {}", e)), - } + Err(PeachWebError::NotYetImplemented) + // debug!("Publishing a new Scuttlebutt private message"); + // match sbot_client + // .publish_private(text.to_string(), recipients) + // .await + // { + // Ok(_) => Ok("Published private message".to_string()), + // Err(e) => Err(format!("Failed to publish private message: {}", e)), + // } }) } @@ -696,20 +671,23 @@ pub async fn write_blob_to_store(image: BufferedFile) -> Result Date: Mon, 9 Sep 2024 15:34:22 -0400 Subject: [PATCH 02/14] a lot of things are working --- Cargo.lock | 433 +++++++++++++++++++++++++++----- peach-lib/src/config_manager.rs | 2 +- peach-web/Cargo.toml | 4 +- peach-web/src/error.rs | 1 - peach-web/src/utils/sbot.rs | 356 ++++++++++++-------------- 5 files changed, 537 insertions(+), 259 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 083ab10..26b4774 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -96,6 +96,7 @@ dependencies = [ "futures-lite", "num_cpus", "once_cell", + "tokio 1.40.0", ] [[package]] @@ -112,7 +113,7 @@ dependencies = [ "parking", "polling", "slab 0.4.6", - "socket2", + "socket2 0.4.10", "waker-fn", "winapi 0.3.9", ] @@ -253,7 +254,7 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", "winapi 0.3.9", ] @@ -334,6 +335,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" + [[package]] name = "block-buffer" version = "0.7.3" @@ -535,6 +542,22 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + [[package]] name = "cpufeatures" version = "0.2.2" @@ -848,6 +871,21 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + [[package]] name = "form_urlencoded" version = "1.0.1" @@ -1165,7 +1203,7 @@ dependencies = [ "http 0.2.8", "indexmap 2.5.0", "slab 0.4.6", - "tokio 1.26.0", + "tokio 1.40.0", "tokio-util 0.7.8", "tracing", ] @@ -1200,6 +1238,12 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + [[package]] name = "hex" version = "0.4.3" @@ -1253,9 +1297,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.7.1" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "496ce29bb5a52785b44e0f7ca2847ae0bb839c9bd28f69acac9b99d461c0c04c" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" [[package]] name = "httpdate" @@ -1337,9 +1381,9 @@ dependencies = [ [[package]] name = "hyper" -version = "0.14.20" +version = "0.14.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02c929dc5c39e335a03c405292728118860721b10190d98c2a0f0efd5baafbac" +checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" dependencies = [ "bytes 1.1.0", "futures-channel", @@ -1352,13 +1396,26 @@ dependencies = [ "httpdate", "itoa 1.0.2", "pin-project-lite", - "socket2", - "tokio 1.26.0", + "socket2 0.5.7", + "tokio 1.40.0", "tower-service", "tracing", "want 0.3.0", ] +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes 1.1.0", + "hyper 0.14.30", + "native-tls", + "tokio 1.40.0", + "tokio-native-tls", +] + [[package]] name = "i2cdev" version = "0.4.4" @@ -1574,7 +1631,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1dea6e07251d9ce6a552abfb5d7ad6bc290a4596c8dcc3d795fae2bbdc1f3ff" dependencies = [ "futures 0.3.21", - "hyper 0.14.20", + "hyper 0.14.30", "jsonrpc-core 18.0.0", "jsonrpc-server-utils 18.0.0", "log 0.4.17", @@ -1627,7 +1684,7 @@ dependencies = [ "jsonrpc-core 18.0.0", "lazy_static", "log 0.4.17", - "tokio 1.26.0", + "tokio 1.40.0", "tokio-stream", "tokio-util 0.6.10", "unicase", @@ -1762,9 +1819,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.126" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] name = "libsodium-sys" @@ -1967,14 +2024,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.4" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ + "hermit-abi 0.3.9", "libc", - "log 0.4.17", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.36.1", + "windows-sys 0.52.0", ] [[package]] @@ -2045,6 +2102,23 @@ dependencies = [ "getrandom 0.2.7", ] +[[package]] +name = "native-tls" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" +dependencies = [ + "libc", + "log 0.4.17", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + [[package]] name = "nb" version = "0.1.3" @@ -2205,7 +2279,7 @@ version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", ] @@ -2245,6 +2319,50 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" +[[package]] +name = "openssl" +version = "0.10.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" +dependencies = [ + "bitflags 2.6.0", + "cfg-if 1.0.0", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.37", + "syn 2.0.77", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + [[package]] name = "parking" version = "2.0.0" @@ -2448,12 +2566,14 @@ dependencies = [ "dirs 4.0.0", "env_logger 0.8.4", "futures 0.3.21", + "jsonrpc_client", "lazy_static", "log 0.4.17", "maud", "peach-lib", "peach-network", "peach-stats", + "reqwest", "rouille", "solar_client", "temporary", @@ -2475,9 +2595,9 @@ checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -2874,9 +2994,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.18" +version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ "base64 0.21.7", "bytes 1.1.0", @@ -2886,18 +3006,24 @@ dependencies = [ "h2 0.3.26", "http 0.2.8", "http-body 0.4.5", - "hyper 0.14.20", + "hyper 0.14.30", + "hyper-tls", "ipnet", "js-sys", "log 0.4.17", "mime", + "native-tls", "once_cell", "percent-encoding 2.1.0", "pin-project-lite", + "rustls-pemfile", "serde 1.0.209", "serde_json", "serde_urlencoded", - "tokio 1.26.0", + "sync_wrapper", + "system-configuration", + "tokio 1.40.0", + "tokio-native-tls", "tower-service", "url 2.3.0", "wasm-bindgen", @@ -2972,6 +3098,15 @@ dependencies = [ "semver 1.0.12", ] +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64 0.21.7", +] + [[package]] name = "ryu" version = "1.0.10" @@ -2993,6 +3128,15 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "schannel" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" +dependencies = [ + "windows-sys 0.59.0", +] + [[package]] name = "scoped-tls" version = "0.1.2" @@ -3005,6 +3149,29 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +[[package]] +name = "security-framework" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +dependencies = [ + "bitflags 2.6.0", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "semver" version = "0.1.20" @@ -3260,14 +3427,24 @@ dependencies = [ [[package]] name = "socket2" -version = "0.4.4" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ "libc", "winapi 0.3.9", ] +[[package]] +name = "socket2" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + [[package]] name = "solar_client" version = "0.1.0" @@ -3371,6 +3548,12 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + [[package]] name = "sysfs_gpio" version = "0.5.4" @@ -3380,6 +3563,27 @@ dependencies = [ "nix 0.14.1", ] +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "systemstat" version = "0.1.11" @@ -3573,19 +3777,17 @@ dependencies = [ [[package]] name = "tokio" -version = "1.26.0" +version = "1.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03201d01c3c27a29c8a5cee5b55a93ddae1ccf6f08f65365c2c918f8c1b76f64" +checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" dependencies = [ - "autocfg 1.1.0", + "backtrace", "bytes 1.1.0", "libc", - "memchr", - "mio 0.8.4", - "num_cpus", + "mio 1.0.2", "pin-project-lite", - "socket2", - "windows-sys 0.45.0", + "socket2 0.5.7", + "windows-sys 0.52.0", ] [[package]] @@ -3671,6 +3873,16 @@ dependencies = [ "log 0.4.17", ] +[[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 1.40.0", +] + [[package]] name = "tokio-proto" version = "0.1.1" @@ -3725,7 +3937,7 @@ checksum = "df54d54117d6fdc4e4fea40fe1e4e566b3505700e148a6827e59b34b0d2600d9" dependencies = [ "futures-core", "pin-project-lite", - "tokio 1.26.0", + "tokio 1.40.0", ] [[package]] @@ -3825,7 +4037,7 @@ dependencies = [ "futures-sink", "log 0.4.17", "pin-project-lite", - "tokio 1.26.0", + "tokio 1.40.0", ] [[package]] @@ -3838,7 +4050,7 @@ dependencies = [ "futures-core", "futures-sink", "pin-project-lite", - "tokio 1.26.0", + "tokio 1.40.0", "tracing", ] @@ -3985,6 +4197,12 @@ dependencies = [ "version_check 0.9.4", ] +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + [[package]] name = "vec_map" version = "0.8.2" @@ -4225,33 +4443,73 @@ dependencies = [ [[package]] name = "windows-sys" -version = "0.45.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets", + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] name = "windows-targets" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc 0.42.2", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -4261,9 +4519,15 @@ checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" [[package]] name = "windows_aarch64_msvc" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -4273,9 +4537,21 @@ checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" [[package]] name = "windows_i686_gnu" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -4285,9 +4561,15 @@ checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" [[package]] name = "windows_i686_msvc" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -4297,15 +4579,27 @@ checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" [[package]] name = "windows_x86_64_gnu" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -4315,17 +4609,24 @@ checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" [[package]] name = "windows_x86_64_msvc" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winreg" -version = "0.10.1" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "winapi 0.3.9", + "cfg-if 1.0.0", + "windows-sys 0.48.0", ] [[package]] diff --git a/peach-lib/src/config_manager.rs b/peach-lib/src/config_manager.rs index 94b97d5..385a098 100644 --- a/peach-lib/src/config_manager.rs +++ b/peach-lib/src/config_manager.rs @@ -59,7 +59,7 @@ pub fn get_peach_config_defaults() -> HashMap { ("SSB_ADMIN_IDS", ""), ("ADMIN_PASSWORD_HASH", "47"), ("TEMPORARY_PASSWORD_HASH", ""), - ("SOLAR_SBOT_DATADIR", "/home/peach/.ssb-solar"), + ("SOLAR_SBOT_DATADIR", "/home/peach/.local/share/local"), ("SOLAR_SBOT_SERVICE", "solar-sbot.service"), ("PEACH_CONFIGDIR", "/var/lib/peachcloud"), ("PEACH_HOMEDIR", "/home/peach"), diff --git a/peach-web/Cargo.toml b/peach-web/Cargo.toml index 4ab4f61..e6343cf 100644 --- a/peach-web/Cargo.toml +++ b/peach-web/Cargo.toml @@ -33,7 +33,7 @@ travis-ci = { repository = "peachcloud/peach-web", branch = "master" } maintenance = { status = "actively-developed" } [dependencies] -async-std = "1.10" +async-std = { version = "1", features=["attributes", "tokio1"] } base64 = "0.13" chrono = "0.4" dirs = "4.0" @@ -50,3 +50,5 @@ rouille = { version = "3.5", default-features = false } temporary = "0.6" vnstat_parse = "0.1.0" xdg = "2.2" +jsonrpc_client = { version = "0.7", features = ["macros", "reqwest"] } +reqwest = "0.11.24" diff --git a/peach-web/src/error.rs b/peach-web/src/error.rs index ebb3db5..2664364 100644 --- a/peach-web/src/error.rs +++ b/peach-web/src/error.rs @@ -84,4 +84,3 @@ impl From for PeachWebError { PeachWebError::Yaml(err) } } - diff --git a/peach-web/src/utils/sbot.rs b/peach-web/src/utils/sbot.rs index 9e9b4f3..f5bc26c 100644 --- a/peach-web/src/utils/sbot.rs +++ b/peach-web/src/utils/sbot.rs @@ -64,14 +64,12 @@ pub fn restart_sbot_process() -> (String, String) { } /// Initialise an sbot client with the given configuration parameters. -pub async fn init_sbot_with_config( - sbot_config: &Option, -) -> Result { +pub async fn init_sbot_client() -> Result { debug!("Initialising an sbot client with configuration parameters"); // initialise sbot connection with ip:port and shscap from config file let key_path = format!( - "{}/secret", - config_manager::get_config_value("GO_SBOT_DATADIR")? + "{}/secret.toml", + config_manager::get_config_value("SOLAR_SBOT_DATADIR")? ); let sbot_client = init_sbot().await?; Ok(sbot_client) @@ -121,7 +119,7 @@ pub fn latest_sequence_number() -> Result { let sbot_config = SbotConfig::read().ok(); task::block_on(async { - let mut sbot_client = init_sbot_with_config(&sbot_config).await?; + let mut sbot_client = init_sbot_client().await?; Err(PeachWebError::NotYetImplemented) @@ -150,7 +148,7 @@ pub fn create_invite(uses: u16) -> Result { let sbot_config = SbotConfig::read().ok(); task::block_on(async { - let mut sbot_client = init_sbot_with_config(&sbot_config).await?; + let mut sbot_client = init_sbot_client().await?; debug!("Generating Scuttlebutt invite code"); Err(PeachWebError::NotYetImplemented) @@ -201,54 +199,52 @@ impl Profile { } /// Retrieve the profile info for the given public key. -pub fn get_profile_info(ssb_id: Option) -> Result { - // retrieve latest solar-sbot configuration parameters - let sbot_config = SbotConfig::read().ok(); +pub fn get_profile_info(ssb_id: Option) -> Result> { task::block_on(async { - let mut sbot_client = init_sbot_with_config(&sbot_config).await?; + let sbot_client = init_sbot_client().await?; - Err(PeachWebError::NotYetImplemented) - // let local_id = sbot_client.whoami().await?; - // - // let mut profile = Profile::default(); - // - // // if an ssb_id has been provided, we assume that the profile info - // // being retrieved is for a peer (ie. not for our local profile) - // let id = if let Some(peer_id) = ssb_id { - // // we are not dealing with the local profile - // profile.is_local_profile = false; - // - // // query follow state - // profile.following = Some(sbot_client.is_following(&local_id, &peer_id).await?); - // - // // TODO: implement this check in solar_client so that this can be a real value - // profile.blocking = Some(false); - // - // peer_id - // } else { - // // if an ssb_id has not been provided, retrieve the local id using whoami - // profile.is_local_profile = true; - // - // local_id - // }; - // - // // retrieve the profile info for the given id - // let info = sbot_client.get_profile_info(&id).await?; - // // set each profile field accordingly - // for (key, val) in info { - // match key.as_str() { - // "name" => profile.name = Some(val), - // "description" => profile.description = Some(val), - // "image" => profile.image = Some(val), - // _ => (), - // } - // } - // - // // assign the ssb public key - // // (could be for the local profile or a peer) - // profile.id = Some(id); + let local_id = sbot_client.whoami().await?; + + let mut profile = Profile::default(); + + // if an ssb_id has been provided, we assume that the profile info + // being retrieved is for a peer (ie. not for our local profile) + let id = if let Some(peer_id) = ssb_id { + // we are not dealing with the local profile + profile.is_local_profile = false; + + // query follow state + profile.following = Some(sbot_client.is_following(&local_id, &peer_id).await?); + + // TODO: implement this check in solar_client so that this can be a real value + profile.blocking = Some(false); + + peer_id + } else { + // if an ssb_id has not been provided, retrieve the local id using whoami + profile.is_local_profile = true; + + local_id + }; + + // retrieve the profile info for the given id + let info = get_peer_info(&id).await?; + // set each profile field accordingly + for (key, val) in info { + match key.as_str() { + "name" => profile.name = Some(val), + "description" => profile.description = Some(val), + "image" => profile.image = Some(val), + _ => (), + } + } // + // assign the ssb public key + // (could be for the local profile or a peer) + profile.id = Some(id); + + // TODO: blobs support // // determine the path to the blob defined by the value of `profile.image` // if let Some(ref blob_id) = profile.image { // profile.blob_path = match blobs::get_blob_path(blob_id) { @@ -264,8 +260,8 @@ pub fn get_profile_info(ssb_id: Option) -> Result None, // } // } - // - // Ok(profile) + + Ok(profile) }) } @@ -283,7 +279,7 @@ pub fn update_profile_info( let sbot_config = SbotConfig::read().ok(); task::block_on(async { - let mut sbot_client = init_sbot_with_config(&sbot_config) + let mut sbot_client = init_sbot_client() .await?; Err(PeachWebError::NotYetImplemented) @@ -348,20 +344,16 @@ pub fn update_profile_info( } /// Follow a peer. -pub fn follow_peer(public_key: &str) -> Result { +pub fn follow_peer(public_key: &str) -> Result { // retrieve latest solar-sbot configuration parameters let sbot_config = SbotConfig::read().ok(); task::block_on(async { - let mut sbot_client = init_sbot_with_config(&sbot_config) - .await - .map_err(|e| e.to_string())?; + let mut sbot_client = init_sbot_client() + .await?; debug!("Following a Scuttlebutt peer"); - match sbot_client.follows(public_key).await { - Ok(_) => Ok("Followed peer".to_string()), - Err(e) => Err(format!("Failed to follow peer: {}", e)), - } + Err(PeachWebError::NotYetImplemented) }) } @@ -371,7 +363,7 @@ pub fn unfollow_peer(public_key: &str) -> Result { let sbot_config = SbotConfig::read().ok(); task::block_on(async { - let mut sbot_client = init_sbot_with_config(&sbot_config) + let mut sbot_client = init_sbot_client() .await?; Err(PeachWebError::NotYetImplemented) @@ -389,7 +381,7 @@ pub fn block_peer(public_key: &str) -> Result { let sbot_config = SbotConfig::read().ok(); task::block_on(async { - let mut sbot_client = init_sbot_with_config(&sbot_config) + let mut sbot_client = init_sbot_client() .await .map_err(|e| e.to_string())?; @@ -407,7 +399,7 @@ pub fn unblock_peer(public_key: &str) -> Result { let sbot_config = SbotConfig::read().ok(); task::block_on(async { - let mut sbot_client = init_sbot_with_config(&sbot_config) + let mut sbot_client = init_sbot_client() .await?; debug!("Unblocking a Scuttlebutt peer"); @@ -420,147 +412,131 @@ pub fn unblock_peer(public_key: &str) -> Result { } /// Retrieve a list of peers blocked by the local public key. -pub fn get_blocks_list() -> Result>, PeachWebError> { - // retrieve latest solar-sbot configuration parameters - let sbot_config = SbotConfig::read().ok(); +pub fn get_blocks_list() -> Result>, Box> { + // populate this vec to return + let mut to_return: Vec> = Vec::new(); task::block_on(async { - let mut sbot_client = init_sbot_with_config(&sbot_config).await?; + let mut sbot_client = init_sbot_client().await?; - Err(PeachWebError::NotYetImplemented) - // let blocks = sbot_client.get_blocks().await?; - // - // // we'll use this to store the profile info for each peer whom we block - // let mut peer_list = Vec::new(); - // - // if !blocks.is_empty() { - // for peer in blocks.iter() { - // // trim whitespace (including newline characters) and - // // remove the inverted-commas around the id - // let key = peer.trim().replace('"', ""); - // // retrieve the profile info for the given peer - // let mut peer_info = sbot_client.get_profile_info(&key).await?; - // // insert the public key of the peer into the info hashmap - // peer_info.insert("id".to_string(), key.to_string()); - // // we do not even attempt to find the blob for a blocked peer, - // // since it may be vulgar to cause distress to the local peer. - // peer_info.insert("blob_exists".to_string(), "false".to_string()); - // // push profile info to peer_list vec - // peer_list.push(peer_info) - // } - // } - // - // // return the list of blocked peers - // Ok(peer_list) + let self_id = sbot_client.whoami().await?; + + let blocks = sbot_client.blocks(&self_id).await?; + + if !blocks.is_empty() { + for peer in blocks.iter() { + // trim whitespace (including newline characters) and + // remove the inverted-commas around the id + // TODO: is this necessary? + let key = peer.trim().replace('"', ""); + let peer_info = get_peer_info(&key).await?; + + // push profile info to peer_list vec + to_return.push(peer_info) + } + } + + // return the list of peers + Ok(to_return) }) } + +pub async fn get_peer_info(key: &str) -> Result, Box> { + let mut sbot_client = init_sbot_client().await?; + // key,value dict of info about this peer + let mut peer_info = HashMap::new(); + // retrieve the profile info for the given peer + // TODO: get all profile info not just latest_name + // TODO: latest_name throws an error + // TODO: just show as "error" isntead of aborting, if some field doesn't fetch + // let latest_name = sbot_client.latest_name(&key).await?; + let latest_name = "latest name".to_string(); + if let Some(latest_description) = sbot_client.latest_description(&key).await.ok() { + peer_info.insert("description".to_string(), latest_description); + } + // insert the public key of the peer into the info hashmap + peer_info.insert("id".to_string(), key.to_string()); + peer_info.insert("name".to_string(), latest_name); + // retrieve the profile image blob id for the given peer + // TODO: blob support + // if let Some(blob_id) = peer_info.get("image") { + // // look-up the path for the image blob + // if let Ok(blob_path) = blobs::get_blob_path(blob_id) { + // // insert the image blob path of the peer into the info hashmap + // peer_info.insert("blob_path".to_string(), blob_path.to_string()); + // // check if the blob is in the blobstore + // // set a flag in the info hashmap + // match blob_is_stored_locally(&blob_path).await { + // Ok(exists) if exists => { + // peer_info.insert("blob_exists".to_string(), "true".to_string()) + // } + // _ => peer_info.insert("blob_exists".to_string(), "false".to_string()), + // }; + // } + // } + Ok(peer_info) +} + /// Retrieve a list of peers followed by the local public key. -pub fn get_follows_list() -> Result>, PeachWebError> { - // retrieve latest solar-sbot configuration parameters - let sbot_config = SbotConfig::read().ok(); +pub fn get_follows_list() -> Result>, Box> { + + // populate this vec to return + let mut to_return: Vec> = Vec::new(); task::block_on(async { - let mut sbot_client = init_sbot_with_config(&sbot_config).await?; + let mut sbot_client = init_sbot_client().await?; - Err(PeachWebError::NotYetImplemented) + let self_id = sbot_client.whoami().await?; - // let follows = sbot_client.get_follows().await?; - // - // // we'll use this to store the profile info for each peer who follows us - // let mut peer_list = Vec::new(); - // - // if !follows.is_empty() { - // for peer in follows.iter() { - // // trim whitespace (including newline characters) and - // // remove the inverted-commas around the id - // let key = peer.trim().replace('"', ""); - // // retrieve the profile info for the given peer - // let mut peer_info = sbot_client.get_profile_info(&key).await?; - // // insert the public key of the peer into the info hashmap - // peer_info.insert("id".to_string(), key.to_string()); - // // retrieve the profile image blob id for the given peer - // if let Some(blob_id) = peer_info.get("image") { - // // look-up the path for the image blob - // if let Ok(blob_path) = blobs::get_blob_path(blob_id) { - // // insert the image blob path of the peer into the info hashmap - // peer_info.insert("blob_path".to_string(), blob_path.to_string()); - // // check if the blob is in the blobstore - // // set a flag in the info hashmap - // match blob_is_stored_locally(&blob_path).await { - // Ok(exists) if exists => { - // peer_info.insert("blob_exists".to_string(), "true".to_string()) - // } - // _ => peer_info.insert("blob_exists".to_string(), "false".to_string()), - // }; - // } - // } - // // push profile info to peer_list vec - // peer_list.push(peer_info) - // } - // } - // - // // return the list of peers - // Ok(peer_list) + let follows = sbot_client.follows(&self_id).await?; + + if !follows.is_empty() { + for peer in follows.iter() { + // trim whitespace (including newline characters) and + // remove the inverted-commas around the id + // TODO: is this necessary? + let key = peer.trim().replace('"', ""); + let peer_info = get_peer_info(&key).await?; + + // push profile info to peer_list vec + to_return.push(peer_info) + } + } + + // return the list of peers + Ok(to_return) }) } /// Retrieve a list of peers friended by the local public key. -pub fn get_friends_list() -> Result>, PeachWebError> { - // retrieve latest solar-sbot configuration parameters - let sbot_config = SbotConfig::read().ok(); +pub fn get_friends_list() -> Result>, Box> { + + // populate this vec to return + let mut to_return: Vec> = Vec::new(); task::block_on(async { - let mut sbot_client = init_sbot_with_config(&sbot_config).await?; + let mut sbot_client = init_sbot_client().await?; - Err(PeachWebError::NotYetImplemented) + let self_id = sbot_client.whoami().await?; - // let local_id = sbot_client.whoami().await?; - // - // let follows = sbot_client.get_follows().await?; - // - // // we'll use this to store the profile info for each friend - // let mut peer_list = Vec::new(); - // - // if !follows.is_empty() { - // for peer in follows.iter() { - // // trim whitespace (including newline characters) and - // // remove the inverted-commas around the id - // let peer_id = peer.trim().replace('"', ""); - // // retrieve the profile info for the given peer - // let mut peer_info = sbot_client.get_profile_info(&peer_id).await?; - // // insert the public key of the peer into the info hashmap - // peer_info.insert("id".to_string(), peer_id.to_string()); - // // retrieve the profile image blob id for the given peer - // if let Some(blob_id) = peer_info.get("image") { - // // look-up the path for the image blob - // if let Ok(blob_path) = blobs::get_blob_path(blob_id) { - // // insert the image blob path of the peer into the info hashmap - // peer_info.insert("blob_path".to_string(), blob_path.to_string()); - // // check if the blob is in the blobstore - // // set a flag in the info hashmap - // match sbot::blob_is_stored_locally(&blob_path).await { - // Ok(exists) if exists => { - // peer_info.insert("blob_exists".to_string(), "true".to_string()) - // } - // _ => peer_info.insert("blob_exists".to_string(), "false".to_string()), - // }; - // } - // } - // - // // query follow state - // match sbot_client.is_following(peer.id, local_id).await { - // Ok(true) => { - // // only push profile info to peer_list vec if they follow us - // peer_list.push(peer_info) - // } - // _ => (), - // }; - // } - // } - // - // // return the list of peers - // Ok(peer_list) + let friends = sbot_client.friends(&self_id).await?; + + if !friends.is_empty() { + for peer in friends.iter() { + // trim whitespace (including newline characters) and + // remove the inverted-commas around the id + // TODO: is this necessary? + let key = peer.trim().replace('"', ""); + let peer_info = get_peer_info(&key).await?; + + // push profile info to peer_list vec + to_return.push(peer_info) + } + } + + // return the list of peers + Ok(to_return) }) } @@ -570,7 +546,7 @@ pub fn get_local_id() -> Result> { let sbot_config = SbotConfig::read().ok(); task::block_on(async { - let mut sbot_client = init_sbot_with_config(&sbot_config).await?; + let mut sbot_client = init_sbot_client().await?; let local_id = sbot_client.whoami().await?; @@ -584,7 +560,7 @@ pub fn publish_public_post(text: String) -> Result { let sbot_config = SbotConfig::read().ok(); task::block_on(async { - let mut sbot_client = init_sbot_with_config(&sbot_config) + let mut sbot_client = init_sbot_client() .await .map_err(|e| e.to_string())?; @@ -606,7 +582,7 @@ pub fn publish_private_msg(text: String, recipients: Vec) -> Result Date: Wed, 19 Feb 2025 13:39:10 -0500 Subject: [PATCH 03/14] working on tild integration --- Cargo.lock | 26 ++++++++--------- Cargo.toml | 3 +- peach-lib/Cargo.toml | 2 +- peach-lib/src/lib.rs | 1 + peach-lib/src/sbot.rs | 6 ++-- peach-web/Cargo.toml | 1 - peach-web/src/utils/sbot.rs | 12 ++++---- tilde-client/.gitignore | 2 ++ tilde-client/Cargo.toml | 12 ++++++++ tilde-client/README.md | 37 ++++++++++++++++++++++++ tilde-client/src/error.rs | 18 ++++++++++++ tilde-client/src/lib.rs | 56 +++++++++++++++++++++++++++++++++++++ 12 files changed, 151 insertions(+), 25 deletions(-) create mode 100644 tilde-client/.gitignore create mode 100644 tilde-client/Cargo.toml create mode 100644 tilde-client/README.md create mode 100644 tilde-client/src/error.rs create mode 100644 tilde-client/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index 26b4774..b5971f6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" @@ -2483,7 +2483,7 @@ dependencies = [ "serde_json", "serde_yaml", "sha3", - "solar_client", + "tilde-client", "toml", ] @@ -2575,7 +2575,6 @@ dependencies = [ "peach-stats", "reqwest", "rouille", - "solar_client", "temporary", "vnstat_parse", "xdg", @@ -3445,16 +3444,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "solar_client" -version = "0.1.0" -dependencies = [ - "anyhow", - "jsonrpc_client", - "reqwest", - "serde_json", -] - [[package]] name = "spidev" version = "0.3.0" @@ -3684,6 +3673,17 @@ dependencies = [ "num_cpus", ] +[[package]] +name = "tilde-client" +version = "0.0.1" +dependencies = [ + "anyhow", + "async-std", + "serde 1.0.209", + "serde_json", + "serde_yaml", +] + [[package]] name = "time" version = "0.1.44" diff --git a/Cargo.toml b/Cargo.toml index 0317b43..e7da647 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,6 +9,7 @@ members = [ "peach-monitor", "peach-stats", "peach-jsonrpc-server", - "peach-dyndns-updater" + "peach-dyndns-updater", + "tilde-client" ] diff --git a/peach-lib/Cargo.toml b/peach-lib/Cargo.toml index c45253f..3d08aa0 100644 --- a/peach-lib/Cargo.toml +++ b/peach-lib/Cargo.toml @@ -10,7 +10,7 @@ chrono = "0.4" dirs = "4.0" fslock="0.1" kuska-ssb = { git = "https://github.com/Kuska-ssb/ssb" } -solar_client = { path = "../../solarpub/solar_client" } +tilde-client = { path = "../tilde-client" } jsonrpc-client-core = "0.5" jsonrpc-client-http = "0.5" jsonrpc-core = "8.0" diff --git a/peach-lib/src/lib.rs b/peach-lib/src/lib.rs index 1a3afd7..ea5a84d 100644 --- a/peach-lib/src/lib.rs +++ b/peach-lib/src/lib.rs @@ -13,3 +13,4 @@ pub use jsonrpc_client_core; pub use jsonrpc_core; pub use serde_json; pub use serde_yaml; +pub use tilde_client; diff --git a/peach-lib/src/sbot.rs b/peach-lib/src/sbot.rs index a694ce4..a29085f 100644 --- a/peach-lib/src/sbot.rs +++ b/peach-lib/src/sbot.rs @@ -2,7 +2,7 @@ use std::{fs, fs::File, io, io::Write, path::PathBuf, process::Command, str}; use std::os::linux::raw::ino_t; -use solar_client::{Client, SolarClient}; +use tilde_client::{TildeClient, get_sbot_client}; use log::debug; use crate::config_manager; @@ -265,7 +265,7 @@ impl SbotConfig { } /// Initialise an sbot client -pub async fn init_sbot() -> Result { +pub async fn init_sbot() -> Result { // read sbot config from config.toml let sbot_config = SbotConfig::read().ok(); @@ -277,6 +277,6 @@ pub async fn init_sbot() -> Result { ); // TODO: read this from config const SERVER_ADDR: &str = "http://127.0.0.1:3030"; - let sbot_client = Client::new(SERVER_ADDR.to_owned())?; + let sbot_client = get_sbot_client(); Ok(sbot_client) } diff --git a/peach-web/Cargo.toml b/peach-web/Cargo.toml index e6343cf..6880306 100644 --- a/peach-web/Cargo.toml +++ b/peach-web/Cargo.toml @@ -39,7 +39,6 @@ chrono = "0.4" dirs = "4.0" env_logger = "0.8" futures = "0.3" -solar_client = { path = "../../solarpub/solar_client" } lazy_static = "1.4" log = "0.4" maud = "0.23" diff --git a/peach-web/src/utils/sbot.rs b/peach-web/src/utils/sbot.rs index f5bc26c..55a2fa8 100644 --- a/peach-web/src/utils/sbot.rs +++ b/peach-web/src/utils/sbot.rs @@ -16,10 +16,10 @@ use peach_lib::config_manager; use peach_lib::sbot::SbotConfig; use peach_lib::sbot::init_sbot; use peach_lib::ssb_messages::SsbMessageKVT; -use solar_client::{Client, SolarClient}; use rouille::input::post::BufferedFile; use temporary::Directory; use peach_lib::serde_json::json; +use peach_lib::tilde_client::TildeClient; use crate::{error::PeachWebError, utils::sbot}; // SBOT HELPER FUNCTIONS @@ -64,7 +64,7 @@ pub fn restart_sbot_process() -> (String, String) { } /// Initialise an sbot client with the given configuration parameters. -pub async fn init_sbot_client() -> Result { +pub async fn init_sbot_client() -> Result { debug!("Initialising an sbot client with configuration parameters"); // initialise sbot connection with ip:port and shscap from config file let key_path = format!( @@ -386,7 +386,7 @@ pub fn block_peer(public_key: &str) -> Result { .map_err(|e| e.to_string())?; debug!("Blocking a Scuttlebutt peer"); - match sbot_client.blocks(public_key).await { + match sbot_client.create_block(public_key).await { Ok(_) => Ok("Blocked peer".to_string()), Err(e) => Err(format!("Failed to block peer: {}", e)), } @@ -421,7 +421,7 @@ pub fn get_blocks_list() -> Result>, Box> let self_id = sbot_client.whoami().await?; - let blocks = sbot_client.blocks(&self_id).await?; + let blocks = sbot_client.get_blocks(&self_id).await?; if !blocks.is_empty() { for peer in blocks.iter() { @@ -489,7 +489,7 @@ pub fn get_follows_list() -> Result>, Box let self_id = sbot_client.whoami().await?; - let follows = sbot_client.follows(&self_id).await?; + let follows = sbot_client.get_follows(&self_id).await?; if !follows.is_empty() { for peer in follows.iter() { @@ -520,7 +520,7 @@ pub fn get_friends_list() -> Result>, Box let self_id = sbot_client.whoami().await?; - let friends = sbot_client.friends(&self_id).await?; + let friends = sbot_client.get_friends(&self_id).await?; if !friends.is_empty() { for peer in friends.iter() { diff --git a/tilde-client/.gitignore b/tilde-client/.gitignore new file mode 100644 index 0000000..96ef6c0 --- /dev/null +++ b/tilde-client/.gitignore @@ -0,0 +1,2 @@ +/target +Cargo.lock diff --git a/tilde-client/Cargo.toml b/tilde-client/Cargo.toml new file mode 100644 index 0000000..5c3023f --- /dev/null +++ b/tilde-client/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "tilde-client" +version = "0.0.1" +authors = ["Max Fowler "] +edition = "2018" + +[dependencies] +async-std = "1.10" +anyhow = "1.0.86" +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" +serde_yaml = "0.8" \ No newline at end of file diff --git a/tilde-client/README.md b/tilde-client/README.md new file mode 100644 index 0000000..7c05a99 --- /dev/null +++ b/tilde-client/README.md @@ -0,0 +1,37 @@ +# peach-lib + +![Generic badge](https://img.shields.io/badge/version-1.2.9-.svg) + +JSON-RPC client library for the PeachCloud ecosystem. + +`peach-lib` offers the ability to programmatically interact with the `peach-network`, `peach-oled` and `peach-stats` microservices. + +## Overview + +The `peach-lib` crate bundles JSON-RPC client code for making requests to the three PeachCloud microservices which expose JSON-RPC servers (`peach-network`, `peach-oled` and `peach-menu`). The full list of available RPC APIs can be found in the READMEs of the respective microservices ([peach-network](https://github.com/peachcloud/peach-network), [peach-oled](https://github.com/peachcloud/peach-oled), [peach-menu](https://github.com/peachcloud/peach-menu)), or in the [developer documentation for PeachCloud](http://docs.peachcloud.org/software/microservices/index.html). + +The library also includes a custom error type, `PeachError`, which bundles the underlying error types into three variants: `JsonRpcHttp`, `JsonRpcCore` and `Serde`. When used as the returned error type in a `Result` function response, this allows convenient use of the `?` operator (as illustrated in the example usage code below). + +## Usage + +Define the dependency in your `Cargo.toml` file: + +`peach-lib = { git = "https://github.com/peachcloud/peach-lib", branch = "main" }` + +Import the required client from the library: + +```rust +use peach_lib::network_client; +``` + +Call one of the exposed methods: + +```rust +network_client::ip("wlan0")?; +``` + +Further example usage can be found in the [`peach-menu`](https://github.com/peachcloud/peach-menu) code (see `src/states.rs`). + +## Licensing + +AGPL-3.0 diff --git a/tilde-client/src/error.rs b/tilde-client/src/error.rs new file mode 100644 index 0000000..14cadaf --- /dev/null +++ b/tilde-client/src/error.rs @@ -0,0 +1,18 @@ +#![warn(missing_docs)] + +use std::error::Error; +use std::fmt; + +/// all tilde client errors +#[derive(Debug)] +pub struct TildeError { + message: String, +} + +impl fmt::Display for TildeError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{}", self.message) + } +} + +impl Error for TildeError {} \ No newline at end of file diff --git a/tilde-client/src/lib.rs b/tilde-client/src/lib.rs new file mode 100644 index 0000000..38dee82 --- /dev/null +++ b/tilde-client/src/lib.rs @@ -0,0 +1,56 @@ +// methods for interacting with tilde sbot + +use crate::error::TildeError; + +use serde_json::Value; + +mod error; + +pub struct TildeClient { + name: String, + port: String +} +pub fn init_sbot() { + println!("++ init sbot!"); +} + +pub fn get_sbot_client() -> TildeClient { + TildeClient { + name: "name".to_string(), + port: "8009".to_string() + } +} + + +impl TildeClient { + pub async fn latest_description(&self, key: &str) -> Result { + todo!(); + } + + pub async fn whoami(&self) -> Result { + todo!(); + } + + pub async fn is_following(&self, from_id: &str, to_id: &str) -> Result { + todo!(); + } + + pub async fn create_block(&self, key: &str) -> Result { + todo!(); + } + pub async fn get_blocks(&self, key: &str) -> Result, TildeError> { + todo!(); + } + + pub async fn get_follows(&self, key: &str) -> Result, TildeError> { + todo!(); + } + + pub async fn get_friends(&self, key: &str) -> Result, TildeError> { + todo!(); + } + + pub async fn publish(&self, post: Value) -> Result, TildeError> { + todo!(); + } +} \ No newline at end of file -- 2.47.2 From 22e32a5715edfea54b3c84d1d42934cbcc65a089 Mon Sep 17 00:00:00 2001 From: notplants Date: Wed, 19 Feb 2025 14:43:31 -0500 Subject: [PATCH 04/14] working on tilde integration --- peach-lib/src/config_manager.rs | 4 ++-- peach-lib/src/sbot.rs | 14 ++++++++++---- peach-web/src/utils/sbot.rs | 4 ++-- tilde-client/src/error.rs | 2 +- tilde-client/src/lib.rs | 21 +++++++++++++++++++-- 5 files changed, 34 insertions(+), 11 deletions(-) diff --git a/peach-lib/src/config_manager.rs b/peach-lib/src/config_manager.rs index 385a098..52205f1 100644 --- a/peach-lib/src/config_manager.rs +++ b/peach-lib/src/config_manager.rs @@ -59,8 +59,8 @@ pub fn get_peach_config_defaults() -> HashMap { ("SSB_ADMIN_IDS", ""), ("ADMIN_PASSWORD_HASH", "47"), ("TEMPORARY_PASSWORD_HASH", ""), - ("SOLAR_SBOT_DATADIR", "/home/peach/.local/share/local"), - ("SOLAR_SBOT_SERVICE", "solar-sbot.service"), + ("TILDE_SBOT_DATADIR", "/home/notplants/.local/share/tildefriends/"), + ("TILDE_SBOT_SERVICE", "tilde-sbot.service"), ("PEACH_CONFIGDIR", "/var/lib/peachcloud"), ("PEACH_HOMEDIR", "/home/peach"), ("PEACH_WEBDIR", "/usr/share/peach-web"), diff --git a/peach-lib/src/sbot.rs b/peach-lib/src/sbot.rs index a29085f..07f41df 100644 --- a/peach-lib/src/sbot.rs +++ b/peach-lib/src/sbot.rs @@ -68,9 +68,10 @@ impl SbotStatus { // note this command does not need to be run as sudo // because non-privileged users are able to run systemctl show + let service_name = config_manager::get_config_value("TILDE_SBOT_SERVICE")?; let info_output = Command::new("systemctl") .arg("show") - .arg(config_manager::get_config_value("SOLAR_SBOT_SERVICE")?) + .arg(service_name) .arg("--no-page") .output()?; @@ -92,7 +93,7 @@ impl SbotStatus { // because non-privileged users are able to run systemctl status let status_output = Command::new("systemctl") .arg("status") - .arg(config_manager::get_config_value("SOLAR_SBOT_SERVICE")?) + .arg(config_manager::get_config_value("TILDE_SBOT_SERVICE")?) .output()?; let service_status = str::from_utf8(&status_output.stdout)?; @@ -130,10 +131,15 @@ impl SbotStatus { } } + // TOOD restore this // get path to blobstore + // let blobstore_path = format!( + // "{}/blobs/sha256", + // config_manager::get_config_value("TILDE_SBOT_DATADIR")? + // ); let blobstore_path = format!( - "{}/blobs/sha256", - config_manager::get_config_value("SOLAR_SBOT_DATADIR")? + "{}", + config_manager::get_config_value("TILDE_SBOT_DATADIR")? ); // determine the size of the blobstore directory in bytes diff --git a/peach-web/src/utils/sbot.rs b/peach-web/src/utils/sbot.rs index 55a2fa8..c167489 100644 --- a/peach-web/src/utils/sbot.rs +++ b/peach-web/src/utils/sbot.rs @@ -29,7 +29,7 @@ pub fn systemctl_sbot_cmd(cmd: &str) -> Result { let output = Command::new("sudo") .arg("systemctl") .arg(cmd) - .arg(config_manager::get_config_value("SOLAR_SBOT_SERVICE")?) + .arg(config_manager::get_config_value("TILDE_SBOT_SERVICE")?) .output()?; Ok(output) } @@ -69,7 +69,7 @@ pub async fn init_sbot_client() -> Result { // initialise sbot connection with ip:port and shscap from config file let key_path = format!( "{}/secret.toml", - config_manager::get_config_value("SOLAR_SBOT_DATADIR")? + config_manager::get_config_value("TILDE_SBOT_DATADIR")? ); let sbot_client = init_sbot().await?; Ok(sbot_client) diff --git a/tilde-client/src/error.rs b/tilde-client/src/error.rs index 14cadaf..10a5eee 100644 --- a/tilde-client/src/error.rs +++ b/tilde-client/src/error.rs @@ -6,7 +6,7 @@ use std::fmt; /// all tilde client errors #[derive(Debug)] pub struct TildeError { - message: String, + pub(crate) message: String, } impl fmt::Display for TildeError { diff --git a/tilde-client/src/lib.rs b/tilde-client/src/lib.rs index 38dee82..891ced0 100644 --- a/tilde-client/src/lib.rs +++ b/tilde-client/src/lib.rs @@ -3,6 +3,7 @@ use crate::error::TildeError; use serde_json::Value; +use std::process::{Command, exit}; mod error; @@ -23,12 +24,28 @@ pub fn get_sbot_client() -> TildeClient { impl TildeClient { + + pub fn run_tilde_command(&self, command: &str) -> Result { + let output = Command::new("out/release/tildefriends.standalone") + .arg(command) + .output().map_err(|e| TildeError { + message: format!("Command execution failed: {}", e), + })?; + + if !output.status.success() { + return Err(TildeError { message: format!("Command failed with status: {}", output.status) }) + } + + let result = String::from_utf8_lossy(&output.stdout).to_string(); + println!("Command output: {}", result); + Ok(result) + } pub async fn latest_description(&self, key: &str) -> Result { todo!(); } pub async fn whoami(&self) -> Result { - todo!(); + self.run_tilde_command("get_identity") } pub async fn is_following(&self, from_id: &str, to_id: &str) -> Result { @@ -53,4 +70,4 @@ impl TildeClient { pub async fn publish(&self, post: Value) -> Result, TildeError> { todo!(); } -} \ No newline at end of file +} -- 2.47.2 From fc2ea78876434418c1bc5d9fa6b051fd39839041 Mon Sep 17 00:00:00 2001 From: notplants Date: Sat, 8 Mar 2025 16:24:26 -0500 Subject: [PATCH 05/14] mostly working with tilde --- peach-lib/src/config_manager.rs | 1 + peach-lib/src/sbot.rs | 14 ++++++--- peach-web/src/error.rs | 10 ++++++ peach-web/src/utils/sbot.rs | 31 ++++++++++--------- tilde-client/src/lib.rs | 54 +++++++++++++++++++++------------ 5 files changed, 71 insertions(+), 39 deletions(-) diff --git a/peach-lib/src/config_manager.rs b/peach-lib/src/config_manager.rs index 52205f1..eb5baa2 100644 --- a/peach-lib/src/config_manager.rs +++ b/peach-lib/src/config_manager.rs @@ -61,6 +61,7 @@ pub fn get_peach_config_defaults() -> HashMap { ("TEMPORARY_PASSWORD_HASH", ""), ("TILDE_SBOT_DATADIR", "/home/notplants/.local/share/tildefriends/"), ("TILDE_SBOT_SERVICE", "tilde-sbot.service"), + ("TILDE_BINARY_PATH", "/home/notplants/computer/projects/peachpub/tilde/tildefriends/out/release/tildefriends.standalone"), ("PEACH_CONFIGDIR", "/var/lib/peachcloud"), ("PEACH_HOMEDIR", "/home/peach"), ("PEACH_WEBDIR", "/usr/share/peach-web"), diff --git a/peach-lib/src/sbot.rs b/peach-lib/src/sbot.rs index 07f41df..b4ca2e0 100644 --- a/peach-lib/src/sbot.rs +++ b/peach-lib/src/sbot.rs @@ -2,7 +2,7 @@ use std::{fs, fs::File, io, io::Write, path::PathBuf, process::Command, str}; use std::os::linux::raw::ino_t; -use tilde_client::{TildeClient, get_sbot_client}; +use tilde_client::{TildeClient}; use log::debug; use crate::config_manager; @@ -234,7 +234,7 @@ impl SbotConfig { // determine path of user's solar-sbot config.toml let config_path = format!( "{}/config.toml", - config_manager::get_config_value("SOLAR_SBOT_DATADIR")? + config_manager::get_config_value("TILDE_SBOT_DATADIR")? ); let config_contents = fs::read_to_string(config_path)?; @@ -254,7 +254,7 @@ impl SbotConfig { // determine path of user's solar-sbot config.toml let config_path = format!( "{}/config.toml", - config_manager::get_config_value("SOLAR_SBOT_DATADIR")? + config_manager::get_config_value("TILDE_SBOT_DATADIR")? ); // open config file for writing @@ -279,10 +279,14 @@ pub async fn init_sbot() -> Result { // initialise sbot connection with ip:port and shscap from config file let key_path = format!( "{}/secret", - config_manager::get_config_value("SOLAR_SBOT_DATADIR")? + config_manager::get_config_value("TILDE_SBOT_DATADIR")? ); // TODO: read this from config const SERVER_ADDR: &str = "http://127.0.0.1:3030"; - let sbot_client = get_sbot_client(); + let sbot_client = TildeClient { + name: "name".to_string(), + port: "8009".to_string(), + binary_path: config_manager::get_config_value("TILDE_BINARY_PATH")? + }; Ok(sbot_client) } diff --git a/peach-web/src/error.rs b/peach-web/src/error.rs index 2664364..dfe7ec6 100644 --- a/peach-web/src/error.rs +++ b/peach-web/src/error.rs @@ -6,6 +6,7 @@ use peach_lib::error::PeachError; use peach_lib::{serde_json, serde_yaml}; use serde_json::error::Error as JsonError; use serde_yaml::Error as YamlError; +use peach_lib::tilde_client::TildeError; /// Custom error type encapsulating all possible errors for the web application. #[derive(Debug)] @@ -17,6 +18,7 @@ pub enum PeachWebError { OsString, PeachLib { source: PeachError, msg: String }, Yaml(YamlError), + Tilde(TildeError), NotYetImplemented, } @@ -30,6 +32,7 @@ impl std::error::Error for PeachWebError { PeachWebError::OsString => None, PeachWebError::PeachLib { ref source, .. } => Some(source), PeachWebError::Yaml(ref source) => Some(source), + PeachWebError::Tilde(ref source) => Some(source), PeachWebError::NotYetImplemented => None } } @@ -53,6 +56,7 @@ impl std::fmt::Display for PeachWebError { ), PeachWebError::PeachLib { ref source, .. } => write!(f, "{}", source), PeachWebError::Yaml(ref source) => write!(f, "Serde YAML error: {}", source), + PeachWebError::Tilde(ref source) => write!(f, "Tilde error: {}", source), PeachWebError::NotYetImplemented => write!(f, "Not yet implemented"), } } @@ -84,3 +88,9 @@ impl From for PeachWebError { PeachWebError::Yaml(err) } } + +impl From for PeachWebError { + fn from(err: TildeError) -> PeachWebError { + PeachWebError::Tilde(err) + } +} \ No newline at end of file diff --git a/peach-web/src/utils/sbot.rs b/peach-web/src/utils/sbot.rs index c167489..e9dbdf6 100644 --- a/peach-web/src/utils/sbot.rs +++ b/peach-web/src/utils/sbot.rs @@ -151,16 +151,15 @@ pub fn create_invite(uses: u16) -> Result { let mut sbot_client = init_sbot_client().await?; debug!("Generating Scuttlebutt invite code"); - Err(PeachWebError::NotYetImplemented) - // let mut invite_code = sbot_client.invite_create(uses).await?; - // - // // insert domain into invite if one is configured + let mut invite_code = sbot_client.create_invite(uses as i32).await?; + + // // TODO: insert domain into invite if one is configured // let domain = config_manager::get_config_value("EXTERNAL_DOMAIN")?; // if !domain.is_empty() { // invite_code = domain + &invite_code[4..]; // } // - // Ok(invite_code) + Ok(invite_code) }) } @@ -445,19 +444,21 @@ pub fn get_blocks_list() -> Result>, Box> pub async fn get_peer_info(key: &str) -> Result, Box> { let mut sbot_client = init_sbot_client().await?; // key,value dict of info about this peer - let mut peer_info = HashMap::new(); - // retrieve the profile info for the given peer - // TODO: get all profile info not just latest_name - // TODO: latest_name throws an error - // TODO: just show as "error" isntead of aborting, if some field doesn't fetch - // let latest_name = sbot_client.latest_name(&key).await?; - let latest_name = "latest name".to_string(); - if let Some(latest_description) = sbot_client.latest_description(&key).await.ok() { - peer_info.insert("description".to_string(), latest_description); + let tilde_profile_info = sbot_client.get_profile_info(key).await.map_err(|err| { + println!("error getting profile info: {}", err); + err } + )?; + let mut peer_info = HashMap::new(); + tilde_profile_info.get("name").and_then(|val| val.as_str()).map(|val| { + peer_info.insert("name".to_string(), val.to_string()); + }); + tilde_profile_info.get("description").and_then(|val| val.as_str()).map(|val| { + peer_info.insert("description".to_string(), val.to_string()); + }); + // insert the public key of the peer into the info hashmap peer_info.insert("id".to_string(), key.to_string()); - peer_info.insert("name".to_string(), latest_name); // retrieve the profile image blob id for the given peer // TODO: blob support // if let Some(blob_id) = peer_info.get("image") { diff --git a/tilde-client/src/lib.rs b/tilde-client/src/lib.rs index 891ced0..b2205d9 100644 --- a/tilde-client/src/lib.rs +++ b/tilde-client/src/lib.rs @@ -1,6 +1,7 @@ // methods for interacting with tilde sbot -use crate::error::TildeError; +use std::collections::HashMap; +pub use crate::error::TildeError; use serde_json::Value; use std::process::{Command, exit}; @@ -8,44 +9,51 @@ use std::process::{Command, exit}; mod error; pub struct TildeClient { - name: String, - port: String + pub name: String, + pub port: String, + pub binary_path: String, } pub fn init_sbot() { println!("++ init sbot!"); } -pub fn get_sbot_client() -> TildeClient { - TildeClient { - name: "name".to_string(), - port: "8009".to_string() - } -} - - impl TildeClient { - pub fn run_tilde_command(&self, command: &str) -> Result { - let output = Command::new("out/release/tildefriends.standalone") - .arg(command) + pub fn run_tilde_command(&self, args: Vec<&str>) -> Result { + let mut command = Command::new(&self.binary_path); + command.args(args); + let output = command .output().map_err(|e| TildeError { message: format!("Command execution failed: {}", e), })?; if !output.status.success() { + println!("command: {:?}", command); + println!("stderr: {:?}", String::from_utf8_lossy(&output.stderr).to_string()); + println!("stdout: {:?}", String::from_utf8_lossy(&output.stdout).to_string()); return Err(TildeError { message: format!("Command failed with status: {}", output.status) }) } let result = String::from_utf8_lossy(&output.stdout).to_string(); println!("Command output: {}", result); + Ok(result) } - pub async fn latest_description(&self, key: &str) -> Result { - todo!(); + + pub async fn tilde_command_to_value(&self, args: Vec<&str>) -> Result { + let result = self.run_tilde_command(args)?; + let value = serde_json::from_str(&result).map_err(|e| TildeError { + message: format!("Failed to parse JSON: {}", e), + })?; + Ok(value) } pub async fn whoami(&self) -> Result { - self.run_tilde_command("get_identity") + self.run_tilde_command(vec!["get_identity"]).map(|val| val.trim_end().to_string()) + } + + pub async fn get_profile_info(&self, key: &str) -> Result { + self.tilde_command_to_value(vec!["get_profile", "-i", key]).await } pub async fn is_following(&self, from_id: &str, to_id: &str) -> Result { @@ -67,7 +75,15 @@ impl TildeClient { todo!(); } - pub async fn publish(&self, post: Value) -> Result, TildeError> { - todo!(); + pub async fn publish(&self, post: Value) -> Result { + let json_string = post.to_string(); + let key = self.whoami().await?; + self.run_tilde_command(vec!["publish", "-u", ":admin", "-i", &key, "-c", &json_string]) + } + + pub async fn create_invite(&self, num_uses: i32) -> Result { + // TODO: look up ip/domain from config + let key = self.whoami().await?; + self.run_tilde_command(vec!["create_invite", "-u", &num_uses.to_string(), "-i", &key, "-p", &self.port, "-a", "127.0.0.1", "-e", "-1"]) } } -- 2.47.2 From bf05149d934823d05f23a3bfd8a56a8e58350da0 Mon Sep 17 00:00:00 2001 From: notplants Date: Tue, 6 May 2025 14:03:06 -0400 Subject: [PATCH 06/14] peachpub mostly working --- peach-web/src/routes/guide.rs | 116 ++++++------- peach-web/src/routes/scuttlebutt/peers.rs | 8 +- peach-web/src/routes/settings/admin/menu.rs | 4 +- peach-web/src/utils/sbot.rs | 171 +++++++++----------- tilde-client/src/error.rs | 2 +- tilde-client/src/lib.rs | 51 +++++- 6 files changed, 191 insertions(+), 161 deletions(-) diff --git a/peach-web/src/routes/guide.rs b/peach-web/src/routes/guide.rs index d5fc4eb..dab61a1 100644 --- a/peach-web/src/routes/guide.rs +++ b/peach-web/src/routes/guide.rs @@ -29,67 +29,67 @@ pub fn build_template() -> PreEscaped { } } " to start the sbot. If the server starts successfully, you will see a green smiley face on the home page. If the face is orange and sleeping, that means the sbot is still inactive (ie. the process is not running). If the face is red and dead, that means the sbot failed to start - indicated an error. For now, the best way to gain insight into the problem is to check the systemd log. Open a terminal and enter: " - code { "systemctl status go-sbot.service" } + code { "systemctl status tilde-sbot.service" } ". The log output may give some clues about the source of the error." } } - (PreEscaped("")) - details { - summary class="card-text link" { "Submit a bug report" } - p class="card-text" style="margin-top: 1rem; margin-bottom: 1rem;" { - "Bug reports can be submitted by " - strong { - a href="https://git.coopcloud.tech/PeachCloud/peach-workspace/issues/new?template=BUG_TEMPLATE.md" class="link font-gray" { - "filing an issue" - } - } - " on the peach-workspace git repo. Before filing a report, first check to see if an issue already exists for the bug you've encountered. If not, you're invited to submit a new report; the template will guide you through several questions." - } - } - (PreEscaped("")) - details { - summary class="card-text link" { "Share feedback & request support" } - p class="card-text" style="margin-top: 1rem; margin-bottom: 1rem;" { - "You're invited to share your thoughts and experiences of PeachCloud in the #peachcloud channel on Scuttlebutt. The channel is also a good place to ask for help." - } - p class="card-text" style="margin-top: 1rem; margin-bottom: 1rem;" { - "Alternatively, we have a " - strong { - a href="https://matrix.to/#/#peachcloud:matrix.org" class="link font-gray" { - "Matrix channel" - } - } - " for discussion about PeachCloud and you can also reach out to @glyph " - strong { - a href="mailto:glyph@mycelial.technology" class="link font-gray" { - "via email" - } - } - "." - } - } - (PreEscaped("")) - details { - summary class="card-text link" { "Contribute to PeachCloud" } - p class="card-text" style="margin-top: 1rem; margin-bottom: 1rem;" { - "PeachCloud is free, open-source software and relies on donations and grants to fund develop. Donations can be made on our " - strong { - a href="https://opencollective.com/peachcloud" class="link font-gray" { - "Open Collective" - } - } - " page." - } - p class="card-text" style="margin-top: 1rem; margin-bottom: 1rem;" { - "Programmers, designers, artists and writers are also welcome to contribute to the project. Please visit the " - strong { - a href="https://git.coopcloud.tech/PeachCloud/peach-workspace" class="link font-gray" { - "main PeachCloud git repository" - } - } - " to find out more details or contact the team via Scuttlebutt, Matrix or email." - } - } + // (PreEscaped("")) + // details { + // summary class="card-text link" { "Submit a bug report" } + // p class="card-text" style="margin-top: 1rem; margin-bottom: 1rem;" { + // "Bug reports can be submitted by " + // strong { + // a href="https://git.coopcloud.tech/PeachCloud/peach-workspace/issues/new?template=BUG_TEMPLATE.md" class="link font-gray" { + // "filing an issue" + // } + // } + // " on the peach-workspace git repo. Before filing a report, first check to see if an issue already exists for the bug you've encountered. If not, you're invited to submit a new report; the template will guide you through several questions." + // } + // } + // (PreEscaped("")) + // details { + // summary class="card-text link" { "Share feedback & request support" } + // p class="card-text" style="margin-top: 1rem; margin-bottom: 1rem;" { + // "You're invited to share your thoughts and experiences of PeachCloud in the #peachcloud channel on Scuttlebutt. The channel is also a good place to ask for help." + // } + // p class="card-text" style="margin-top: 1rem; margin-bottom: 1rem;" { + // "Alternatively, we have a " + // strong { + // a href="https://matrix.to/#/#peachcloud:matrix.org" class="link font-gray" { + // "Matrix channel" + // } + // } + // " for discussion about PeachCloud and you can also reach out to @glyph " + // strong { + // a href="mailto:glyph@mycelial.technology" class="link font-gray" { + // "via email" + // } + // } + // "." + // } + // } + // (PreEscaped("")) + // details { + // summary class="card-text link" { "Contribute to PeachCloud" } + // p class="card-text" style="margin-top: 1rem; margin-bottom: 1rem;" { + // "PeachCloud is free, open-source software and relies on donations and grants to fund develop. Donations can be made on our " + // strong { + // a href="https://opencollective.com/peachcloud" class="link font-gray" { + // "Open Collective" + // } + // } + // " page." + // } + // p class="card-text" style="margin-top: 1rem; margin-bottom: 1rem;" { + // "Programmers, designers, artists and writers are also welcome to contribute to the project. Please visit the " + // strong { + // a href="https://git.coopcloud.tech/PeachCloud/peach-workspace" class="link font-gray" { + // "main PeachCloud git repository" + // } + // } + // " to find out more details or contact the team via Scuttlebutt, Matrix or email." + // } + // } } } }; diff --git a/peach-web/src/routes/scuttlebutt/peers.rs b/peach-web/src/routes/scuttlebutt/peers.rs index 39bb64a..2ccb23f 100644 --- a/peach-web/src/routes/scuttlebutt/peers.rs +++ b/peach-web/src/routes/scuttlebutt/peers.rs @@ -17,10 +17,10 @@ pub fn build_template() -> PreEscaped { div class="card-container" { (PreEscaped("")) div id="buttons" { - a id="search" class="button button-primary center" href="/scuttlebutt/search" title="Search for a peer" { "Search" } - a id="friends" class="button button-primary center" href="/scuttlebutt/friends" title="List friends" { "Friends" } - a id="follows" class="button button-primary center" href="/scuttlebutt/follows" title="List follows" { "Follows" } - a id="blocks" class="button button-primary center" href="/scuttlebutt/blocks" title="List blocks" { "Blocks" } + // a id="search" class="button button-primary center" href="/scuttlebutt/search" title="Search for a peer" { "Search" } + // a id="friends" class="button button-primary center" href="/scuttlebutt/friends" title="List friends" { "Friends" } + // a id="follows" class="button button-primary center" href="/scuttlebutt/follows" title="List follows" { "Follows" } + // a id="blocks" class="button button-primary center" href="/scuttlebutt/blocks" title="List blocks" { "Blocks" } a id="invites" class="button button-primary center" href="/scuttlebutt/invites" title="Create invites" { "Invites" } } } diff --git a/peach-web/src/routes/settings/admin/menu.rs b/peach-web/src/routes/settings/admin/menu.rs index 49470d5..7a1d7ae 100644 --- a/peach-web/src/routes/settings/admin/menu.rs +++ b/peach-web/src/routes/settings/admin/menu.rs @@ -9,9 +9,9 @@ pub fn build_template() -> PreEscaped { div class="card center" { (PreEscaped("")) div id="settingsButtons" { - a id="configure" class="button button-primary center" href="/settings/admin/configure" title="Configure Admin" { "Configure Admin" } + // a id="configure" class="button button-primary center" href="/settings/admin/configure" title="Configure Admin" { "Configure Admin" } a id="change" class="button button-primary center" href="/auth/change" title="Change Password" { "Change Password" } - a id="reset" class="button button-primary center" href="/auth/reset" title="Reset Password" { "Reset Password" } + // a id="reset" class="button button-primary center" href="/auth/reset" title="Reset Password" { "Reset Password" } } } diff --git a/peach-web/src/utils/sbot.rs b/peach-web/src/utils/sbot.rs index e9dbdf6..29700b4 100644 --- a/peach-web/src/utils/sbot.rs +++ b/peach-web/src/utils/sbot.rs @@ -19,7 +19,7 @@ use peach_lib::ssb_messages::SsbMessageKVT; use rouille::input::post::BufferedFile; use temporary::Directory; use peach_lib::serde_json::json; -use peach_lib::tilde_client::TildeClient; +use peach_lib::tilde_client::{TildeClient, TildeError}; use crate::{error::PeachWebError, utils::sbot}; // SBOT HELPER FUNCTIONS @@ -114,14 +114,15 @@ pub fn validate_public_key(public_key: &str) -> Result<(), String> { /// reverses the list and reads the sequence number of the most recently /// authored message. This gives us the size of the database in terms of /// the total number of locally-authored messages. -pub fn latest_sequence_number() -> Result { +pub fn latest_sequence_number() -> Result { // retrieve latest solar-sbot configuration parameters let sbot_config = SbotConfig::read().ok(); task::block_on(async { let mut sbot_client = init_sbot_client().await?; - Err(PeachWebError::NotYetImplemented) + let sequence_num = sbot_client.latest_sequence_number().await?; + Ok(sequence_num) // retrieve the local id // let id = sbot_client.whoami().await?; @@ -278,67 +279,67 @@ pub fn update_profile_info( let sbot_config = SbotConfig::read().ok(); task::block_on(async { - let mut sbot_client = init_sbot_client() - .await?; + let mut sbot_client = init_sbot_client().await?; - Err(PeachWebError::NotYetImplemented) // // track whether the name, description or image have been updated - // let mut name_updated: bool = false; - // let mut description_updated: bool = false; - // let mut image_updated: bool = false; - // - // // check if a new_name value has been submitted in the form - // if let Some(name) = new_name { - // // only update the name if it has changed - // if name != current_name { - // debug!("Publishing a new Scuttlebutt profile name"); - // if let Err(e) = sbot_client.publish_name(&name).await { - // return Err(format!("Failed to update name: {}", e)); - // } else { - // name_updated = true - // } - // } - // } - // - // if let Some(description) = new_description { - // // only update the description if it has changed - // if description != current_description { - // debug!("Publishing a new Scuttlebutt profile description"); - // if let Err(e) = sbot_client.publish_description(&description).await { - // return Err(format!("Failed to update description: {}", e)); - // } else { - // description_updated = true - // } - // } - // } - // - // // only update the image if a file was uploaded - // if let Some(img) = image { - // // only write the blob if it has a filename and data > 0 bytes - // if img.filename.is_some() && !img.data.is_empty() { - // match write_blob_to_store(img).await { - // Ok(blob_id) => { - // // if the file was successfully added to the blobstore, - // // publish an about image message with the blob id - // if let Err(e) = sbot_client.publish_image(&blob_id).await { - // return Err(format!("Failed to update image: {}", e)); - // } else { - // image_updated = true - // } - // } - // Err(e) => return Err(format!("Failed to add image to blobstore: {}", e)), - // } - // } else { - // image_updated = false - // } - // } - // - // if name_updated || description_updated || image_updated { - // Ok("Profile updated".to_string()) - // } else { - // // no updates were made but no errors were encountered either - // Ok("Profile info unchanged".to_string()) - // } + let mut name_updated: bool = false; + let mut description_updated: bool = false; + let mut image_updated: bool = false; + + // check if a new_name value has been submitted in the form + if let Some(name) = new_name { + // only update the name if it has changed + if name != current_name { + debug!("Publishing a new Scuttlebutt profile name"); + if let Err(e) = sbot_client.publish_name(&name).await { + return Err(PeachWebError::Tilde(TildeError {message: (format!("Failed to update name: {}", e))})); + } else { + name_updated = true; + } + } + } + + if let Some(description) = new_description { + // only update the description if it has changed + if description != current_description { + debug!("Publishing a new Scuttlebutt profile description"); + if let Err(e) = sbot_client.publish_description(&description).await { + return Err(PeachWebError::Tilde(TildeError {message: (format!("Failed to update description: {}", e))})); + } else { + description_updated = true + } + } + } + + // only update the image if a file was uploaded + if let Some(img) = image { + // only write the blob if it has a filename and data > 0 bytes + if img.filename.is_some() && !img.data.is_empty() { + match write_blob_to_store(img).await { + Ok(blob_id) => { + // if the file was successfully added to the blobstore, + // publish an about image message with the blob id + if let Err(e) = sbot_client.publish_image(&blob_id).await { + return Err(PeachWebError::Tilde(TildeError {message: (format!("Failed to update image: {}", e))})); + } else { + image_updated = true + } + } + Err(e) => { + return Err(PeachWebError::Tilde(TildeError {message: (format!("Failed to add image to blob store: {}", e))})); + } + } + } else { + image_updated = false + } + } + + if name_updated || description_updated || image_updated { + Ok("Profile updated".to_string()) + } else { + // no updates were made but no errors were encountered either + Ok("Profile info unchanged".to_string()) + } }) } @@ -459,8 +460,8 @@ pub async fn get_peer_info(key: &str) -> Result, Box) -> Result Ok("Published private message".to_string()), - // Err(e) => Err(format!("Failed to publish private message: {}", e)), - // } + for recipient in &recipients { + sbot_client.private_message(recipient, &text).await?; + } + Ok("Published private message".to_string()) }) } @@ -643,28 +639,13 @@ pub async fn write_blob_to_store(image: BufferedFile) -> Result Result { + let key = self.whoami().await?; + // let num = self.run_tilde_command(vec!["get_sequence", "-i", &key])?.parse::().map_err(|e| TildeError { + // message: format!("Failed to parse u64 from sequence number: {}", e), + // })?; + let num = self.run_tilde_command(vec!["get_sequence", "-i", &key])?; + println!("NUM: {}", num); + Ok(num) + } + pub async fn is_following(&self, from_id: &str, to_id: &str) -> Result { todo!(); } @@ -81,6 +91,45 @@ impl TildeClient { self.run_tilde_command(vec!["publish", "-u", ":admin", "-i", &key, "-c", &json_string]) } + pub async fn publish_name(&self, name: &str) -> Result { + let key = self.whoami().await?; + let about_post = json!({ + "type": "about", + "about": key, + "name": name + }); + self.publish(about_post).await + } + + pub async fn publish_description(&self, description: &str) -> Result { + let key = self.whoami().await?; + let about_post = json!({ + "type": "about", + "about": key, + "description": description + }); + self.publish(about_post).await + } + + pub async fn publish_image(&self, image_blob_id: &str) -> Result { + let key = self.whoami().await?; + let about_post = json!({ + "type": "about", + "about": key, + "image": image_blob_id + }); + self.publish(about_post).await + } + + pub async fn store_blob(&self, blob_file_path: &str) -> Result { + self.run_tilde_command(vec!["store_blob", "-f", blob_file_path]) + } + + pub async fn private_message(&self, recipient_key: &str, message: &str) -> Result { + let self_key = self.whoami().await?; + self.run_tilde_command(vec!["private", "-u", ":admin", "-i", &self_key, "-r", recipient_key, "-t", message]) + } + pub async fn create_invite(&self, num_uses: i32) -> Result { // TODO: look up ip/domain from config let key = self.whoami().await?; -- 2.47.2 From 0e655841f57df7fef74f917d40577d5bcd3d21f6 Mon Sep 17 00:00:00 2001 From: notplants Date: Thu, 8 May 2025 14:01:58 -0400 Subject: [PATCH 07/14] almost working with tilde --- peach-lib/src/sbot.rs | 66 ++++---- peach-web/src/public_router.rs | 2 +- .../routes/settings/scuttlebutt/configure.rs | 145 ++++++++---------- peach-web/src/routes/status/scuttlebutt.rs | 2 +- peach-web/src/utils/sbot.rs | 32 ++-- run-tilde-sbot.sh | 32 ++++ tilde-client/src/lib.rs | 2 - 7 files changed, 135 insertions(+), 146 deletions(-) create mode 100755 run-tilde-sbot.sh diff --git a/peach-lib/src/sbot.rs b/peach-lib/src/sbot.rs index b4ca2e0..c930e19 100644 --- a/peach-lib/src/sbot.rs +++ b/peach-lib/src/sbot.rs @@ -155,21 +155,17 @@ impl SbotStatus { pub struct Config { // TODO: maybe define as a Path type? /// Directory path for the log and indexes. - pub repo: String, - /// Directory path for writing debug output. - pub debugdir: String, + pub database_directory: String, /// Secret-handshake app-key (aka. network key). pub shscap: String, /// HMAC hash used to sign messages. pub hmac: String, /// Replication hops (1: friends, 2: friends of friends). - pub hops: u8, + pub replication_hops: u8, + /// Ip address of pub + pub ip: String, /// Address to listen on. - pub lis: String, - /// Address to listen on for WebSocket connections. - pub wslis: String, - /// Address to for metrics and pprof HTTP server. - pub debuglis: String, + pub ssb_port: String, /// Enable sending local UDP broadcasts. pub localadv: bool, /// Enable listening for UDP broadcasts and connecting. @@ -182,48 +178,41 @@ pub struct Config { pub promisc: bool, /// Disable the UNIX socket RPC interface. pub nounixsock: bool, - /// Attempt to repair the filesystem before starting. - pub repair: bool, } // TODO: make this real #[derive(Debug, Deserialize, Serialize)] #[serde(default)] pub struct SbotConfig { - pub repo: String, - pub debugdir: String, + pub database_directory: String, pub shscap: String, pub hmac: String, - pub hops: i8, - pub lis: String, - pub wslis: String, - pub debuglis: String, + pub replication_hops: i8, + pub ip: String, + pub ssb_port: String, + // TODO: below settings have not been configured with tilde pub localadv: bool, pub localdiscov: bool, pub enable_ebt: bool, pub promisc: bool, pub nounixsock: bool, - pub repair: bool, } /// Default configuration values for solar-sbot. impl Default for SbotConfig { fn default() -> Self { Self { - repo: ".ssb-go".to_string(), - debugdir: "".to_string(), + database_directory: "~/.local/share/tildefriends".to_string(), shscap: "1KHLiKZvAvjbY1ziZEHMXawbCEIM6qwjCDm3VYRan/s=".to_string(), hmac: "".to_string(), - hops: 1, - lis: ":8008".to_string(), - wslis: ":8989".to_string(), - debuglis: "localhost:6078".to_string(), + replication_hops: 1, + ip: "".to_string(), + ssb_port: "8008".to_string(), localadv: false, localdiscov: false, enable_ebt: false, promisc: false, nounixsock: false, - repair: false, } } } @@ -233,7 +222,7 @@ impl SbotConfig { pub fn read() -> Result { // determine path of user's solar-sbot config.toml let config_path = format!( - "{}/config.toml", + "{}/sbot-config.toml", config_manager::get_config_value("TILDE_SBOT_DATADIR")? ); @@ -244,16 +233,16 @@ impl SbotConfig { Ok(config) } - /// Write the given `SbotConfig` to the solar-sbot `config.toml` file. + /// Write the given `SbotConfig` to the tilde-sbot `sbot-config.toml` file. pub fn write(config: SbotConfig) -> Result<(), PeachError> { - let repo_comment = "# For details about solar-sbot configuration, please visit the repo: https://github.com/cryptoscope/ssb\n".to_string(); + let repo_comment = "# For details about tilde-sbot configuration, please visit tilde friends documentation\n".to_string(); // convert the provided `SbotConfig` instance to a string let config_string = toml::to_string(&config)?; // determine path of user's solar-sbot config.toml let config_path = format!( - "{}/config.toml", + "{}/sbot-config.toml", config_manager::get_config_value("TILDE_SBOT_DATADIR")? ); @@ -272,20 +261,17 @@ impl SbotConfig { /// Initialise an sbot client pub async fn init_sbot() -> Result { - // read sbot config from config.toml - let sbot_config = SbotConfig::read().ok(); + + // read sbot config + let sbot_config = match SbotConfig::read() { + Ok(config) => config, + // build default config if an error is returned from the read attempt + Err(_) => SbotConfig::default(), + }; debug!("Initialising an sbot client with configuration parameters"); - // initialise sbot connection with ip:port and shscap from config file - let key_path = format!( - "{}/secret", - config_manager::get_config_value("TILDE_SBOT_DATADIR")? - ); - // TODO: read this from config - const SERVER_ADDR: &str = "http://127.0.0.1:3030"; let sbot_client = TildeClient { - name: "name".to_string(), - port: "8009".to_string(), + port: sbot_config.ssb_port, binary_path: config_manager::get_config_value("TILDE_BINARY_PATH")? }; Ok(sbot_client) diff --git a/peach-web/src/public_router.rs b/peach-web/src/public_router.rs index fd433f3..b0a63fd 100644 --- a/peach-web/src/public_router.rs +++ b/peach-web/src/public_router.rs @@ -26,7 +26,7 @@ pub fn handle_route(request: &Request, session_data: &mut Option) - } // set the `.ssb-go` path in order to mount the blob fileserver - let ssb_path = sbot::get_go_ssb_path().expect("define ssb-go dir path"); + let ssb_path = sbot::get_tilde_ssb_path().expect("define ssb-go dir path"); let blobstore = format!("{}/blobs/sha256", ssb_path); // blobstore file server diff --git a/peach-web/src/routes/settings/scuttlebutt/configure.rs b/peach-web/src/routes/settings/scuttlebutt/configure.rs index 5eb249b..715a0d6 100644 --- a/peach-web/src/routes/settings/scuttlebutt/configure.rs +++ b/peach-web/src/routes/settings/scuttlebutt/configure.rs @@ -33,16 +33,8 @@ fn read_status_and_config() -> (String, SbotConfig, String, String) { Err(_) => SbotConfig::default(), }; - // split the listen address into ip and port - let (ip, port) = match sbot_config.lis.find(':') { - Some(index) => { - let (ip, port) = sbot_config.lis.split_at(index); - // remove the : from the port - (ip.to_string(), port.replace(':', "")) - } - // if no ':' separator is found, assume an ip has been configured (without port) - None => (sbot_config.lis.to_string(), String::new()), - }; + let ip = sbot_config.ip.clone(); + let port = sbot_config.ssb_port.clone(); (run_on_startup, sbot_config, ip, port) } @@ -52,7 +44,7 @@ pub fn build_template(request: &Request) -> PreEscaped { // check for flash cookies; will be (None, None) if no flash cookies are found let (flash_name, flash_msg) = request.retrieve_flash(); - let (run_on_startup, sbot_config, ip, port) = read_status_and_config(); + let (run_on_startup, sbot_config, ip, ssb_port) = read_status_and_config(); let menu_template = html! { (PreEscaped("")) @@ -62,42 +54,42 @@ pub fn build_template(request: &Request) -> PreEscaped { label for="hops" class="label-small font-gray" { "HOPS" } div id="hops" style="display: flex; justify-content: space-evenly;" { div { - @if sbot_config.hops == 0 { - input type="radio" id="hops_0" name="hops" value="0" checked; + @if sbot_config.replication_hops == 0 { + input type="radio" id="hops_0" name="replication_hops" value="0" checked; } @else { - input type="radio" id="hops_0" name="hops" value="0"; + input type="radio" id="hops_0" name="replication_hops" value="0"; } label class="font-normal" for="hops_0" { "0" } } div { - @if sbot_config.hops == 1 { - input type="radio" id="hops_1" name="hops" value="1" checked; + @if sbot_config.replication_hops == 1 { + input type="radio" id="hops_1" name="replication_hops" value="1" checked; } @else { - input type="radio" id="hops_1" name="hops" value="1"; + input type="radio" id="hops_1" name="replication_hops" value="1"; } label class="font-normal" for="hops_1" { "1" } } div { - @if sbot_config.hops == 2 { - input type="radio" id="hops_2" name="hops" value="2" checked; + @if sbot_config.replication_hops == 2 { + input type="radio" id="hops_2" name="replication_hops" value="2" checked; } @else { - input type="radio" id="hops_2" name="hops" value="2"; + input type="radio" id="hops_2" name="replication_hops" value="2"; } label class="font-normal" for="hops_2" { "2" } } div { - @if sbot_config.hops == 3 { - input type="radio" id="hops_3" name="hops" value="3" checked; + @if sbot_config.replication_hops == 3 { + input type="radio" id="hops_3" name="replication_hops" value="3" checked; } @else { - input type="radio" id="hops_3" name="hops" value="3"; + input type="radio" id="hops_3" name="replication_hops" value="3"; } label class="font-normal" for="hops_3" { "3" } } div { - @if sbot_config.hops == 4 { - input type="radio" id="hops_4" name="hops" value="4" checked; + @if sbot_config.replication_hops == 4 { + input type="radio" id="hops_4" name="replication_hops" value="4" checked; } @else { - input type="radio" id="hops_4" name="hops" value="4"; + input type="radio" id="hops_4" name="replication_hops" value="4"; } label class="font-normal" for="hops_4" { "4" } } @@ -106,11 +98,11 @@ pub fn build_template(request: &Request) -> PreEscaped { div class="center" style="display: flex; justify-content: space-between;" { div style="display: flex; flex-direction: column; width: 60%; margin-bottom: 2rem;" title="IP address on which the sbot runs" { label for="ip" class="label-small font-gray" { "IP ADDRESS" } - input type="text" id="ip" name="lis_ip" value=(ip); + input type="text" id="ip" name="ip" value=(ip); } div style="display: flex; flex-direction: column; width: 20%; margin-bottom: 2rem;" title="Port on which the sbot runs" { label for="port" class="label-small font-gray" { "PORT" } - input type="text" id="port" name="lis_port" value=(port); + input type="text" id="port" name="ssb_port" value=(ssb_port); } } div class="center" style="display: flex; flex-direction: column; margin-bottom: 2rem;" title="Network key (aka 'caps key') to define the Scuttleverse in which the sbot operates in" { @@ -119,34 +111,35 @@ pub fn build_template(request: &Request) -> PreEscaped { } div class="center" style="display: flex; flex-direction: column; margin-bottom: 2rem;" title="Directory in which the sbot database is saved" { label for="database_dir" class="label-small font-gray" { "DATABASE DIRECTORY" } - input type="text" id="database_dir" name="repo" value=(sbot_config.repo); + input type="text" id="database_dir" name="database_directory" value=(sbot_config.database_directory); } + // TODO: re-add these checkboxes, if tilde adds them div class="center" { - @if sbot_config.enable_ebt { - input type="checkbox" id="ebtReplication" style="margin-bottom: 1rem;" name="enable_ebt" checked; - } @else { - input type="checkbox" id="ebtReplication" style="margin-bottom: 1rem;" name="enable_ebt"; - } - label class="font-normal" for="ebtReplication" title="Enable Epidemic Broadcast Tree (EBT) replication instead of legacy replication" { - "Enable EBT Replication" - } - br; - @if sbot_config.localadv { - input type="checkbox" id="lanBroadcast" style="margin-bottom: 1rem;" name="localadv" checked; - } @else { - input type="checkbox" id="lanBroadcast" style="margin-bottom: 1rem;" name="localadv"; - } - label class="font-normal" for="lanBroadcast" title="Broadcast the IP and port of this sbot instance so that local peers can discovery it and attempt to connect" { - "Enable LAN Broadcasting" - } - br; - @if sbot_config.localdiscov { - input type="checkbox" id="lanDiscovery" style="margin-bottom: 1rem;" name="localdiscov" checked; - } @else { - input type="checkbox" id="lanDiscovery" style="margin-bottom: 1rem;" name="localdiscov"; - } - label class="font-normal" for="lanDiscovery" title="Listen for the presence of local peers and attempt to connect if found" { "Enable LAN Discovery" } - br; + // @if sbot_config.enable_ebt { + // input type="checkbox" id="ebtReplication" style="margin-bottom: 1rem;" name="enable_ebt" checked; + // } @else { + // input type="checkbox" id="ebtReplication" style="margin-bottom: 1rem;" name="enable_ebt"; + // } + // label class="font-normal" for="ebtReplication" title="Enable Epidemic Broadcast Tree (EBT) replication instead of legacy replication" { + // "Enable EBT Replication" + // } + // br; + // @if sbot_config.localadv { + // input type="checkbox" id="lanBroadcast" style="margin-bottom: 1rem;" name="localadv" checked; + // } @else { + // input type="checkbox" id="lanBroadcast" style="margin-bottom: 1rem;" name="localadv"; + // } + // label class="font-normal" for="lanBroadcast" title="Broadcast the IP and port of this sbot instance so that local peers can discovery it and attempt to connect" { + // "Enable LAN Broadcasting" + // } + // br; + // @if sbot_config.localdiscov { + // input type="checkbox" id="lanDiscovery" style="margin-bottom: 1rem;" name="localdiscov" checked; + // } @else { + // input type="checkbox" id="lanDiscovery" style="margin-bottom: 1rem;" name="localdiscov"; + // } + // label class="font-normal" for="lanDiscovery" title="Listen for the presence of local peers and attempt to connect if found" { "Enable LAN Discovery" } + // br; @if run_on_startup == "enabled" { input type="checkbox" id="startup" style="margin-bottom: 1rem;" name="startup" checked; } @else { @@ -154,18 +147,9 @@ pub fn build_template(request: &Request) -> PreEscaped { } label class="font-normal" for="startup" title="Run the pub automatically on system startup" { "Run pub when computer starts" } br; - @if sbot_config.repair { - input type="checkbox" id="repair" name="repair" checked; - } @else { - input type="checkbox" id="repair" name="repair"; - } - label class="font-normal" for="repair" title="Attempt to repair the filesystem when starting the pub" { "Attempt filesystem repair when pub starts" } } (PreEscaped("")) - input type="hidden" id="debugdir" name="debugdir" value=(sbot_config.debugdir); input type="hidden" id="hmac" name="hmac" value=(sbot_config.hmac); - input type="hidden" id="wslis" name="wslis" value=(sbot_config.wslis); - input type="hidden" id="debuglis" name="debuglis" value=(sbot_config.debuglis); input type="hidden" id="promisc" name="promisc" value=(sbot_config.promisc); input type="hidden" id="nounixsock" name="nounixsock" value=(sbot_config.nounixsock); (PreEscaped("")) @@ -196,61 +180,56 @@ pub fn build_template(request: &Request) -> PreEscaped { templates::base::build_template(body, theme) } +// use std::io::Read; /// Parse the sbot configuration values and write to file. pub fn handle_form(request: &Request, restart: bool) -> Response { + // query the request body for form data // return a 400 error if the admin_id field is missing let data = try_or_400!(post_input!(request, { - repo: String, - debugdir: String, + database_directory: String, shscap: String, hmac: String, - hops: i8, - lis_ip: String, - lis_port: String, - wslis: String, - debuglis: String, + replication_hops: i8, + ip: String, + ssb_port: String, localadv: bool, localdiscov: bool, enable_ebt: bool, promisc: bool, nounixsock: bool, startup: bool, - repair: bool, })); // concat the ip and port for listen address - let lis = format!("{}:{}", data.lis_ip, data.lis_port); + let lis = format!("{}:{}", data.ip, data.ssb_port); // instantiate `SbotConfig` from form data let config = SbotConfig { - lis, - hops: data.hops, - repo: data.repo, - debugdir: data.debugdir, + ip: data.ip, + ssb_port: data.ssb_port, + replication_hops: data.replication_hops, + database_directory: data.database_directory, shscap: data.shscap, localadv: data.localadv, localdiscov: data.localdiscov, hmac: data.hmac, - wslis: data.wslis, - debuglis: data.debuglis, enable_ebt: data.enable_ebt, promisc: data.promisc, nounixsock: data.nounixsock, - repair: data.repair, }; match data.startup { true => { - debug!("Enabling go-sbot.service"); + debug!("Enabling tilde-sbot.service"); if let Err(e) = sbot::systemctl_sbot_cmd("enable") { - warn!("Failed to enable go-sbot.service: {}", e) + warn!("Failed to enable tilde-sbot.service: {}", e) } } false => { - debug!("Disabling go-sbot.service"); + debug!("Disabling tilde-sbot.service"); if let Err(e) = sbot::systemctl_sbot_cmd("disable") { - warn!("Failed to disable go-sbot.service: {}", e) + warn!("Failed to disable tilde-sbot.service: {}", e) } } }; diff --git a/peach-web/src/routes/status/scuttlebutt.rs b/peach-web/src/routes/status/scuttlebutt.rs index fd8ca8d..087d982 100644 --- a/peach-web/src/routes/status/scuttlebutt.rs +++ b/peach-web/src/routes/status/scuttlebutt.rs @@ -102,7 +102,7 @@ fn memory_element(memory: Option) -> Markup { fn hops_element() -> Markup { // retrieve go-sbot systemd process status let hops = match SbotConfig::read() { - Ok(conf) => conf.hops, + Ok(conf) => conf.replication_hops, _ => 0, }; diff --git a/peach-web/src/utils/sbot.rs b/peach-web/src/utils/sbot.rs index 29700b4..810a98d 100644 --- a/peach-web/src/utils/sbot.rs +++ b/peach-web/src/utils/sbot.rs @@ -66,11 +66,6 @@ pub fn restart_sbot_process() -> (String, String) { /// Initialise an sbot client with the given configuration parameters. pub async fn init_sbot_client() -> Result { debug!("Initialising an sbot client with configuration parameters"); - // initialise sbot connection with ip:port and shscap from config file - let key_path = format!( - "{}/secret.toml", - config_manager::get_config_value("TILDE_SBOT_DATADIR")? - ); let sbot_client = init_sbot().await?; Ok(sbot_client) } @@ -154,12 +149,11 @@ pub fn create_invite(uses: u16) -> Result { debug!("Generating Scuttlebutt invite code"); let mut invite_code = sbot_client.create_invite(uses as i32).await?; - // // TODO: insert domain into invite if one is configured - // let domain = config_manager::get_config_value("EXTERNAL_DOMAIN")?; - // if !domain.is_empty() { - // invite_code = domain + &invite_code[4..]; - // } - // + let domain = config_manager::get_config_value("EXTERNAL_DOMAIN")?; + if !domain.is_empty() { + invite_code = domain + &invite_code[4..]; + } + Ok(invite_code) }) } @@ -596,16 +590,16 @@ pub fn publish_private_msg(text: String, recipients: Vec) -> Result Result { - let go_ssb_path = match SbotConfig::read() { - Ok(conf) => conf.repo, +/// Return the path of the tilde-sbot directory. +pub fn get_tilde_ssb_path() -> Result { + let tilde_ssb_path = match SbotConfig::read() { + Ok(conf) => conf.database_directory, // return the default path if unable to read `config.toml` Err(_) => { // determine the home directory let mut home_path = dirs::home_dir().ok_or(PeachWebError::HomeDir)?; - // add the go-ssb subdirectory - home_path.push(".ssb-go"); + // add the .ssb-tilde subdirectory + home_path.push(".ssb-tilde"); // convert the PathBuf to a String home_path .into_os_string() @@ -613,12 +607,12 @@ pub fn get_go_ssb_path() -> Result { .map_err(|_| PeachWebError::OsString)? } }; - Ok(go_ssb_path) + Ok(tilde_ssb_path) } /// Check whether a blob is in the blobstore. pub async fn blob_is_stored_locally(blob_path: &str) -> Result { - let go_ssb_path = get_go_ssb_path()?; + let go_ssb_path = get_tilde_ssb_path()?; let complete_path = format!("{}/blobs/sha256/{}", go_ssb_path, blob_path); let blob_exists_locally = Path::new(&complete_path).exists(); Ok(blob_exists_locally) diff --git a/run-tilde-sbot.sh b/run-tilde-sbot.sh new file mode 100755 index 0000000..ba06b57 --- /dev/null +++ b/run-tilde-sbot.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +CONFIG_FILE="/home/notplants/.local/share/tildefriends/sbot-config.toml" + +# Extract network_key (if it exists) +NETWORK_KEY=$(grep -v '^\s*#' "$CONFIG_FILE" | grep -E '^\s*network_key\s*=' | sed -E 's/.*=\s*"?(.*?)"?\s*/\1/') +DATABASE_DIRECTORY=$(grep -v '^\s*#' "$CONFIG_FILE" \ + | grep -E '^\s*database_directory\s*=' \ + | sed -E 's/.*=\s*"([^"]*)"\s*/\1/') + +# Extract all other key-value pairs except network_key +ARGS=$(grep -v '^\s*#' "$CONFIG_FILE" \ + | grep -E '^\s*[a-zA-Z0-9_.-]+\s*=' \ + | grep -v '^\s*network_key\s*=' \ + | sed -E 's/\s*=\s*/=/' \ + | tr -d '"' \ + | paste -sd, -) + +echo "ARGS: $ARGS" +[ -n "$NETWORK_KEY" ] && echo "NETWORK_KEY: $NETWORK_KEY" +[ -n "$DATABASE_DIRECTORY" ] && echo "DATABASE_DIRECTORY: $DATABASE_DIRECTORY" + +CMD="/home/notplants/computer/projects/peachpub/tilde/tildefriends/out/release/tildefriends.standalone run" +[ -n "$ARGS" ] && CMD="$CMD -a \"$ARGS\"" +[ -n "$NETWORK_KEY" ] && CMD="$CMD -k \"$NETWORK_KEY\"" +[ -n "$DATABASE_DIRECTORY" ] && CMD="$CMD -d \"$DATABASE_DIRECTORY/db.sql\"" + +echo "Running command:" +echo "$CMD" + +# Execute the command +eval $CMD diff --git a/tilde-client/src/lib.rs b/tilde-client/src/lib.rs index 81b319b..2950025 100644 --- a/tilde-client/src/lib.rs +++ b/tilde-client/src/lib.rs @@ -9,7 +9,6 @@ use std::process::{Command, exit}; mod error; pub struct TildeClient { - pub name: String, pub port: String, pub binary_path: String, } @@ -131,7 +130,6 @@ impl TildeClient { } pub async fn create_invite(&self, num_uses: i32) -> Result { - // TODO: look up ip/domain from config let key = self.whoami().await?; self.run_tilde_command(vec!["create_invite", "-u", &num_uses.to_string(), "-i", &key, "-p", &self.port, "-a", "127.0.0.1", "-e", "-1"]) } -- 2.47.2 From ac875097b3ea4778730c5cd328e7df9f48a81a26 Mon Sep 17 00:00:00 2001 From: notplants Date: Thu, 8 May 2025 14:51:07 -0400 Subject: [PATCH 08/14] working bash script --- run-tilde-sbot.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run-tilde-sbot.sh b/run-tilde-sbot.sh index ba06b57..3098a87 100755 --- a/run-tilde-sbot.sh +++ b/run-tilde-sbot.sh @@ -23,7 +23,7 @@ echo "ARGS: $ARGS" CMD="/home/notplants/computer/projects/peachpub/tilde/tildefriends/out/release/tildefriends.standalone run" [ -n "$ARGS" ] && CMD="$CMD -a \"$ARGS\"" [ -n "$NETWORK_KEY" ] && CMD="$CMD -k \"$NETWORK_KEY\"" -[ -n "$DATABASE_DIRECTORY" ] && CMD="$CMD -d \"$DATABASE_DIRECTORY/db.sql\"" +[ -n "$DATABASE_DIRECTORY" ] && CMD="$CMD -d \"$DATABASE_DIRECTORY/db.sqlite\"" echo "Running command:" echo "$CMD" -- 2.47.2 From ce861c69ba21669e30c11ccc0e6caefd1108207f Mon Sep 17 00:00:00 2001 From: notplants Date: Thu, 8 May 2025 15:36:39 -0400 Subject: [PATCH 09/14] README --- ORIGINAL-PEACHCLOUD-README.md | 74 +++++++++++++++++ README.md | 90 ++++++--------------- peach-lib/src/config_manager.rs | 12 ++- peach-lib/src/error.rs | 5 ++ peach-lib/src/password_utils.rs | 23 ++---- peach-web/src/routes/settings/admin/menu.rs | 4 +- 6 files changed, 122 insertions(+), 86 deletions(-) create mode 100644 ORIGINAL-PEACHCLOUD-README.md diff --git a/ORIGINAL-PEACHCLOUD-README.md b/ORIGINAL-PEACHCLOUD-README.md new file mode 100644 index 0000000..229433a --- /dev/null +++ b/ORIGINAL-PEACHCLOUD-README.md @@ -0,0 +1,74 @@ +# [PeachCloud](http://peachcloud.org) :peach: :cloud: + +_Better [Scuttlebutt](https://scuttlebutt.nz) cloud infrastructure as a hardware product._ + +[**_Support us on OpenCollective!_**](https://opencollective.com/peachcloud) + +[![Build Status](https://build.coopcloud.tech/api/badges/PeachCloud/peach-workspace/status.svg?ref=refs/heads/main)](https://build.coopcloud.tech/PeachCloud/peach-workspace) + +## Background + +- April 2018 project proposal: [`%HqwAsltORROCh4uyOq6iV+SsqU3OuNUevnq+5dwCqVI=.sha256`](https://viewer.scuttlebot.io/%25HqwAsltORROCh4uyOq6iV%2BSsqU3OuNUevnq%2B5dwCqVI%3D.sha256) +- November 2018 project pivot: [`%9NCyTf+oBxG0APlXRCKtrGZj3t+i+Kp3pKPN1gtFX2c=.sha256`](https://viewer.scuttlebot.io/%259NCyTf%2BoBxG0APlXRCKtrGZj3t%2Bi%2BKp3pKPN1gtFX2c%3D.sha256) + +## Active Repositories + +**Documentation** + + - [peach-devdocs](https://github.com/peachcloud/peach-devdocs) - Developer documentation for PeachCloud in the form of a Markdown book + +**Devops** + + - [peach-vps](https://github.com/peachcloud/peach-vps) - Setup scripts and configuration files for deploying a PeachCloud development server + +**Image building & device configuration** + + - [peach-config](https://github.com/peachcloud/peach-config) - Configuration instructions, files and scripts + - [peach-img-builder](https://github.com/peachcloud/peach-img-builder) - Vmdb2 script for building a Debian disc image for Raspberry Pi with PeachCloud pre-installed + +**Microservices** + + - [peach-buttons](https://github.com/peachcloud/peach-buttons) - Emit GPIO events using JSON-RPC pubsub over WS + - [peach-oled](https://github.com/peachcloud/peach-oled) - Write and draw to OLED display using JSON-RPC over HTTP + - [peach-menu](https://github.com/peachcloud/peach-menu) - A menu for monitoring and interacting with the PeachCloud device + - [peach-network](https://github.com/peachcloud/peach-network) - Query and configure network interfaces using JSON-RPC over HTTP + - [peach-stats](https://github.com/peachcloud/peach-stats) - Query system statistics using JSON-RPC over HTTP + - [peach-lib](https://github.com/peachcloud/peach-lib) - JSON-RPC client library for the PeachCloud ecosystem + - [peach-monitor](https://github.com/peachcloud/peach-monitor) - Monitor network data usage and set alert flags based on user-defined thresholds + +**Diagnostics** + + - [peach-probe](https://github.com/peachcloud/peach-probe) - Probe PeachCloud microservices to evaluate their state and ensure correct API responses + +**Web interface** + + - [peach-patterns](https://github.com/peachcloud/peach-patterns) - Pattern library for the PeachCloud UI design system + - [peach-web](https://github.com/peachcloud/peach-web) - A web interface for monitoring and interacting with the PeachCloud device + +## Continuous Integration + +[Drone CI](https://docs.drone.io/) is used to provide continuous integration for this workspace. The configuration file can be found in `.drone.yml` in the root of this repository. It is currently configured to run `cargo fmt`, `cargo clippy`, `cargo test` and `cargo build` on every `pull request` event. The pipeline runs on the AMD64 Debian Buster image from the official Rust Docker image repository. + +The status of the current and previous CI builds can be viewed via the [Drone CI Build UI](https://build.coopcloud.tech/PeachCloud/peach-workspace) (kindly hosted by Co-op Cloud). + +Adding `[CI SKIP]` to the end of a commit message results in the CI checks being skipped for the next event. For example: + +``` +git commit -m "update readme [CI SKIP]" +git push origin main +``` + +## Developer Diaries + +- [@ahdinosaur](https://github.com/ahdinosaur): `@6ilZq3kN0F+dXFHAPjAwMm87JEb/VdB+LC9eIMW3sa0=.ed25519` + - 1: [`%bSkZCJBmNYUmECNKYOiWkgEeRxrlo2UghNBzE6Cph94=.sha256`](https://viewer.scuttlebot.io/%25bSkZCJBmNYUmECNKYOiWkgEeRxrlo2UghNBzE6Cph94%3D.sha256) + - 2: [`%2L7gYAh2ih+7eFCrtObPWIUYHuGnJjwj4KCXrCIsWhM=.sha256`](https://viewer.scuttlebot.io/%252L7gYAh2ih%2B7eFCrtObPWIUYHuGnJjwj4KCXrCIsWhM%3D.sha256) + - [@mycognosist](https://github.com/mycognosist): `@HEqy940T6uB+T+d9Jaa58aNfRzLx9eRWqkZljBmnkmk=.ed25519` + - [`%mKUByRp4Gib6fqP1q2/dHg+ueSoR+Sj2Y0D7T0Np0D4=.sha256`](https://viewer.scuttlebot.io/%25mKUByRp4Gib6fqP1q2%2FdHg%2BueSoR%2BSj2Y0D7T0Np0D4%3D.sha256) + +## Accounts + +- [GitHub](https://github.com/peachcloud) +- [Twitter](https://twitter.com/peachcloudorg) +- [Email](mailto:peachcloudorg@gmail.com) +- [OpenCollective](https://opencollective.com/peachcloud) diff --git a/README.md b/README.md index 229433a..f820474 100644 --- a/README.md +++ b/README.md @@ -2,73 +2,35 @@ _Better [Scuttlebutt](https://scuttlebutt.nz) cloud infrastructure as a hardware product._ -[**_Support us on OpenCollective!_**](https://opencollective.com/peachcloud) +![image of peachcloud device](https://peach.commoninternet.net/assets/peachcloud.jpg) + +## About + +This project is a hack that combines PeachCloud with TildFriends. + +The original PeachCloud project was paused when most development in the Scuttlebutt ecosystem stopped (reference), +but even after most funding and development and left the ecosystem, a version of the Sbot in C called TildeFriends was finished, +and continues to be maintained. + +This fork of the PeachCloud project makes use of the TildeFriends sbot to make a minimal and functional PeachCloud Scuttlebutt pub, +that can be easily deployed and operated by a non-technical user. + +Due to the timing and conditions of the Scuttlebutt ecosystem, and the rise of new protocols, +for this particular hack, the focus was on getting the project working in a minimal form (aka more hacky), +with less of a focus on long-term sustainability of the project as an ecosystem. + +This project serves to provide a working simple-to-use pub for a P2P protocol which is in some ways frozen in amber, +as well as to share the PeachCloud interface and project, as a design-inspiration for other projects. + +## Setup + +TODO: how to install with yunohost +TODO: how to install without yunohost -[![Build Status](https://build.coopcloud.tech/api/badges/PeachCloud/peach-workspace/status.svg?ref=refs/heads/main)](https://build.coopcloud.tech/PeachCloud/peach-workspace) ## Background - April 2018 project proposal: [`%HqwAsltORROCh4uyOq6iV+SsqU3OuNUevnq+5dwCqVI=.sha256`](https://viewer.scuttlebot.io/%25HqwAsltORROCh4uyOq6iV%2BSsqU3OuNUevnq%2B5dwCqVI%3D.sha256) - November 2018 project pivot: [`%9NCyTf+oBxG0APlXRCKtrGZj3t+i+Kp3pKPN1gtFX2c=.sha256`](https://viewer.scuttlebot.io/%259NCyTf%2BoBxG0APlXRCKtrGZj3t%2Bi%2BKp3pKPN1gtFX2c%3D.sha256) - -## Active Repositories - -**Documentation** - - - [peach-devdocs](https://github.com/peachcloud/peach-devdocs) - Developer documentation for PeachCloud in the form of a Markdown book - -**Devops** - - - [peach-vps](https://github.com/peachcloud/peach-vps) - Setup scripts and configuration files for deploying a PeachCloud development server - -**Image building & device configuration** - - - [peach-config](https://github.com/peachcloud/peach-config) - Configuration instructions, files and scripts - - [peach-img-builder](https://github.com/peachcloud/peach-img-builder) - Vmdb2 script for building a Debian disc image for Raspberry Pi with PeachCloud pre-installed - -**Microservices** - - - [peach-buttons](https://github.com/peachcloud/peach-buttons) - Emit GPIO events using JSON-RPC pubsub over WS - - [peach-oled](https://github.com/peachcloud/peach-oled) - Write and draw to OLED display using JSON-RPC over HTTP - - [peach-menu](https://github.com/peachcloud/peach-menu) - A menu for monitoring and interacting with the PeachCloud device - - [peach-network](https://github.com/peachcloud/peach-network) - Query and configure network interfaces using JSON-RPC over HTTP - - [peach-stats](https://github.com/peachcloud/peach-stats) - Query system statistics using JSON-RPC over HTTP - - [peach-lib](https://github.com/peachcloud/peach-lib) - JSON-RPC client library for the PeachCloud ecosystem - - [peach-monitor](https://github.com/peachcloud/peach-monitor) - Monitor network data usage and set alert flags based on user-defined thresholds - -**Diagnostics** - - - [peach-probe](https://github.com/peachcloud/peach-probe) - Probe PeachCloud microservices to evaluate their state and ensure correct API responses - -**Web interface** - - - [peach-patterns](https://github.com/peachcloud/peach-patterns) - Pattern library for the PeachCloud UI design system - - [peach-web](https://github.com/peachcloud/peach-web) - A web interface for monitoring and interacting with the PeachCloud device - -## Continuous Integration - -[Drone CI](https://docs.drone.io/) is used to provide continuous integration for this workspace. The configuration file can be found in `.drone.yml` in the root of this repository. It is currently configured to run `cargo fmt`, `cargo clippy`, `cargo test` and `cargo build` on every `pull request` event. The pipeline runs on the AMD64 Debian Buster image from the official Rust Docker image repository. - -The status of the current and previous CI builds can be viewed via the [Drone CI Build UI](https://build.coopcloud.tech/PeachCloud/peach-workspace) (kindly hosted by Co-op Cloud). - -Adding `[CI SKIP]` to the end of a commit message results in the CI checks being skipped for the next event. For example: - -``` -git commit -m "update readme [CI SKIP]" -git push origin main -``` - -## Developer Diaries - -- [@ahdinosaur](https://github.com/ahdinosaur): `@6ilZq3kN0F+dXFHAPjAwMm87JEb/VdB+LC9eIMW3sa0=.ed25519` - - 1: [`%bSkZCJBmNYUmECNKYOiWkgEeRxrlo2UghNBzE6Cph94=.sha256`](https://viewer.scuttlebot.io/%25bSkZCJBmNYUmECNKYOiWkgEeRxrlo2UghNBzE6Cph94%3D.sha256) - - 2: [`%2L7gYAh2ih+7eFCrtObPWIUYHuGnJjwj4KCXrCIsWhM=.sha256`](https://viewer.scuttlebot.io/%252L7gYAh2ih%2B7eFCrtObPWIUYHuGnJjwj4KCXrCIsWhM%3D.sha256) - - [@mycognosist](https://github.com/mycognosist): `@HEqy940T6uB+T+d9Jaa58aNfRzLx9eRWqkZljBmnkmk=.ed25519` - - [`%mKUByRp4Gib6fqP1q2/dHg+ueSoR+Sj2Y0D7T0Np0D4=.sha256`](https://viewer.scuttlebot.io/%25mKUByRp4Gib6fqP1q2%2FdHg%2BueSoR%2BSj2Y0D7T0Np0D4%3D.sha256) - -## Accounts - -- [GitHub](https://github.com/peachcloud) -- [Twitter](https://twitter.com/peachcloudorg) -- [Email](mailto:peachcloudorg@gmail.com) -- [OpenCollective](https://opencollective.com/peachcloud) +- [Original PeachCloud ReadMe](/ORIGINAL-PEACHCLOUD-README.md) +- [Original PeachCloud Documentation](https://peach.commoninternet.net) diff --git a/peach-lib/src/config_manager.rs b/peach-lib/src/config_manager.rs index eb5baa2..586fbea 100644 --- a/peach-lib/src/config_manager.rs +++ b/peach-lib/src/config_manager.rs @@ -59,9 +59,9 @@ pub fn get_peach_config_defaults() -> HashMap { ("SSB_ADMIN_IDS", ""), ("ADMIN_PASSWORD_HASH", "47"), ("TEMPORARY_PASSWORD_HASH", ""), - ("TILDE_SBOT_DATADIR", "/home/notplants/.local/share/tildefriends/"), + ("TILDE_SBOT_DATADIR", "/home/peach/.local/share/tildefriends/"), ("TILDE_SBOT_SERVICE", "tilde-sbot.service"), - ("TILDE_BINARY_PATH", "/home/notplants/computer/projects/peachpub/tilde/tildefriends/out/release/tildefriends.standalone"), + ("TILDE_BINARY_PATH", "/home/peach/tildefriends.standalone"), ("PEACH_CONFIGDIR", "/var/lib/peachcloud"), ("PEACH_HOMEDIR", "/home/peach"), ("PEACH_WEBDIR", "/usr/share/peach-web"), @@ -286,8 +286,12 @@ pub fn delete_ssb_admin_id(ssb_id: &str) -> Result, PeachError> { // looks up the String value for SSB_ADMIN_IDS and converts it into a Vec pub fn get_ssb_admin_ids() -> Result, PeachError> { let ssb_admin_ids_str = get_config_value("SSB_ADMIN_IDS")?; - let ssb_admin_ids: Vec = serde_json::from_str(&ssb_admin_ids_str)?; - Ok(ssb_admin_ids) + if ssb_admin_ids_str.trim().is_empty() { + Ok(vec![]) + } else { + let ssb_admin_ids: Vec = serde_json::from_str(&ssb_admin_ids_str)?; + Ok(ssb_admin_ids) + } } // takes in a Vec and saves SSB_ADMIN_IDS as a json string representation of this vec diff --git a/peach-lib/src/error.rs b/peach-lib/src/error.rs index abf336b..9e86316 100644 --- a/peach-lib/src/error.rs +++ b/peach-lib/src/error.rs @@ -110,6 +110,9 @@ pub enum PeachError { /// Represents an Anyhow error with Solar SolarClientError(String), + /// Represents an Anyhow error with Solar + TildeClientError(String), + /// Represents an error with encoding or decoding an SsbMessage SsbMessageError(String), @@ -143,6 +146,7 @@ impl std::error::Error for PeachError { PeachError::Write { ref source, .. } => Some(source), PeachError::JsonRpcError(_) => None, PeachError::SolarClientError(_) => None, + PeachError::TildeClientError(_) => None, PeachError::SsbMessageError(_) => None, } } @@ -203,6 +207,7 @@ impl std::fmt::Display for PeachError { } PeachError::JsonRpcError(ref err) => err.fmt(f), PeachError::SolarClientError(ref err) => err.fmt(f), + PeachError::TildeClientError(ref err) => err.fmt(f), PeachError::SsbMessageError(ref err) => err.fmt(f), } } diff --git a/peach-lib/src/password_utils.rs b/peach-lib/src/password_utils.rs index cde3ad9..1c08e18 100644 --- a/peach-lib/src/password_utils.rs +++ b/peach-lib/src/password_utils.rs @@ -108,29 +108,20 @@ using this link: http://peach.local/auth/reset", // use golgi to send a private message on scuttlebutt match task::block_on(publish_private_msg(&msg, &ssb_admin_id)) { Ok(_) => (), - Err(e) => return Err(PeachError::Sbot(e)), + Err(e) => return Err(e), } } Ok(()) } -async fn publish_private_msg(msg: &str, recipient: &str) -> Result<(), String> { - // retrieve latest go-sbot configuration parameters - let sbot_config = SbotConfig::read().ok(); - - let msg = msg.to_string(); - let recipient = vec![recipient.to_string()]; +async fn publish_private_msg(msg: &str, recipient: &str) -> Result<(), PeachError> { // initialise sbot connection with ip:port and shscap from config file - let mut sbot_client = init_sbot(); + let mut sbot_client = init_sbot().await?; debug!("Publishing a Scuttlebutt private message with temporary password"); - // TODO: implement publish private message in solar, and then implement this - Err(format!("Failed to publish private message: \ - private publishing is not yet implemented in solar_client: \ - the message meant to be sent was: {}", msg)) - // match sbot_client.publish_private(msg, recipient).await { - // Ok(_) => Ok(()), - // Err(e) => Err(format!("Failed to publish private message: {}", e)), - // } + match sbot_client.private_message(recipient, msg).await { + Ok(_) => Ok(()), + Err(e) => Err(PeachError::TildeClientError(format!("Failed to publish private message: {}", e))), + } } diff --git a/peach-web/src/routes/settings/admin/menu.rs b/peach-web/src/routes/settings/admin/menu.rs index 7a1d7ae..49470d5 100644 --- a/peach-web/src/routes/settings/admin/menu.rs +++ b/peach-web/src/routes/settings/admin/menu.rs @@ -9,9 +9,9 @@ pub fn build_template() -> PreEscaped { div class="card center" { (PreEscaped("")) div id="settingsButtons" { - // a id="configure" class="button button-primary center" href="/settings/admin/configure" title="Configure Admin" { "Configure Admin" } + a id="configure" class="button button-primary center" href="/settings/admin/configure" title="Configure Admin" { "Configure Admin" } a id="change" class="button button-primary center" href="/auth/change" title="Change Password" { "Change Password" } - // a id="reset" class="button button-primary center" href="/auth/reset" title="Reset Password" { "Reset Password" } + a id="reset" class="button button-primary center" href="/auth/reset" title="Reset Password" { "Reset Password" } } } -- 2.47.2 From 1439bb942fb0377a653aeaef60c86e3f23b1a0b0 Mon Sep 17 00:00:00 2001 From: notplants Date: Wed, 21 May 2025 17:28:55 -0400 Subject: [PATCH 10/14] working version with binary wrapper --- peach-lib/src/config_manager.rs | 2 ++ peach-lib/src/sbot.rs | 4 +++- run-tilde-sbot.sh | 24 +++++++++++++++++++++--- tilde-client/src/lib.rs | 12 +++++++++--- 4 files changed, 35 insertions(+), 7 deletions(-) diff --git a/peach-lib/src/config_manager.rs b/peach-lib/src/config_manager.rs index 586fbea..99cd66b 100644 --- a/peach-lib/src/config_manager.rs +++ b/peach-lib/src/config_manager.rs @@ -62,6 +62,8 @@ pub fn get_peach_config_defaults() -> HashMap { ("TILDE_SBOT_DATADIR", "/home/peach/.local/share/tildefriends/"), ("TILDE_SBOT_SERVICE", "tilde-sbot.service"), ("TILDE_BINARY_PATH", "/home/peach/tildefriends.standalone"), + ("TILDE_WRAPPER_PATH", "/home/peach/run-tilde-sbot.sh"), + ("TILDE_CONFIG_PATH", "/home/peach/.local/share/tildefriends/tilde-sbot.toml"), ("PEACH_CONFIGDIR", "/var/lib/peachcloud"), ("PEACH_HOMEDIR", "/home/peach"), ("PEACH_WEBDIR", "/usr/share/peach-web"), diff --git a/peach-lib/src/sbot.rs b/peach-lib/src/sbot.rs index c930e19..070c8e7 100644 --- a/peach-lib/src/sbot.rs +++ b/peach-lib/src/sbot.rs @@ -272,7 +272,9 @@ pub async fn init_sbot() -> Result { debug!("Initialising an sbot client with configuration parameters"); let sbot_client = TildeClient { port: sbot_config.ssb_port, - binary_path: config_manager::get_config_value("TILDE_BINARY_PATH")? + tilde_binary_path: config_manager::get_config_value("TILDE_BINARY_PATH")?, + tilde_wrapper_path: config_manager::get_config_value("TILDE_WRAPPER_PATH")?, + tilde_config_path: config_manager::get_config_value("TILDE_CONFIG_PATH")?, }; Ok(sbot_client) } diff --git a/run-tilde-sbot.sh b/run-tilde-sbot.sh index 3098a87..c22aab3 100755 --- a/run-tilde-sbot.sh +++ b/run-tilde-sbot.sh @@ -1,6 +1,19 @@ #!/bin/bash -CONFIG_FILE="/home/notplants/.local/share/tildefriends/sbot-config.toml" +# Exit on error +set -e + +# Usage check +if [ "$#" -lt 2 ]; then + echo "Usage: $0 " + exit 1 +fi + +CONFIG_FILE="$1" +TILDEFRIENDS_PATH="$2" +shift 2 +EXTRA_ARGS=("$@") + # Extract network_key (if it exists) NETWORK_KEY=$(grep -v '^\s*#' "$CONFIG_FILE" | grep -E '^\s*network_key\s*=' | sed -E 's/.*=\s*"?(.*?)"?\s*/\1/') @@ -20,13 +33,18 @@ echo "ARGS: $ARGS" [ -n "$NETWORK_KEY" ] && echo "NETWORK_KEY: $NETWORK_KEY" [ -n "$DATABASE_DIRECTORY" ] && echo "DATABASE_DIRECTORY: $DATABASE_DIRECTORY" -CMD="/home/notplants/computer/projects/peachpub/tilde/tildefriends/out/release/tildefriends.standalone run" +CMD="\"$TILDEFRIENDS_PATH\"" [ -n "$ARGS" ] && CMD="$CMD -a \"$ARGS\"" [ -n "$NETWORK_KEY" ] && CMD="$CMD -k \"$NETWORK_KEY\"" [ -n "$DATABASE_DIRECTORY" ] && CMD="$CMD -d \"$DATABASE_DIRECTORY/db.sqlite\"" +# Append extra arguments +for ARG in "${EXTRA_ARGS[@]}"; do + CMD="$CMD \"$ARG\"" +done + echo "Running command:" echo "$CMD" # Execute the command -eval $CMD +eval $CMD \ No newline at end of file diff --git a/tilde-client/src/lib.rs b/tilde-client/src/lib.rs index 2950025..75a25f4 100644 --- a/tilde-client/src/lib.rs +++ b/tilde-client/src/lib.rs @@ -10,7 +10,9 @@ mod error; pub struct TildeClient { pub port: String, - pub binary_path: String, + pub tilde_binary_path: String, + pub tilde_wrapper_path: String, + pub tilde_config_path: String, } pub fn init_sbot() { println!("++ init sbot!"); @@ -19,8 +21,12 @@ pub fn init_sbot() { impl TildeClient { pub fn run_tilde_command(&self, args: Vec<&str>) -> Result { - let mut command = Command::new(&self.binary_path); - command.args(args); + let mut command = Command::new(&self.tilde_wrapper_path); + // wrapper config_file binary_path Date: Wed, 21 May 2025 18:07:38 -0400 Subject: [PATCH 11/14] working version with yunohost --- peach-lib/src/sbot.rs | 4 ++-- run-tilde-sbot.sh | 11 ++--------- tilde-client/src/lib.rs | 12 +++++------- 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/peach-lib/src/sbot.rs b/peach-lib/src/sbot.rs index 070c8e7..565d16e 100644 --- a/peach-lib/src/sbot.rs +++ b/peach-lib/src/sbot.rs @@ -270,11 +270,11 @@ pub async fn init_sbot() -> Result { }; debug!("Initialising an sbot client with configuration parameters"); + let database_path = format!("{}/db.sqlite", config_manager::get_config_value("TILDE_SBOT_DATADIR")?); let sbot_client = TildeClient { port: sbot_config.ssb_port, tilde_binary_path: config_manager::get_config_value("TILDE_BINARY_PATH")?, - tilde_wrapper_path: config_manager::get_config_value("TILDE_WRAPPER_PATH")?, - tilde_config_path: config_manager::get_config_value("TILDE_CONFIG_PATH")?, + tilde_database_path: database_path, }; Ok(sbot_client) } diff --git a/run-tilde-sbot.sh b/run-tilde-sbot.sh index c22aab3..7a17c10 100755 --- a/run-tilde-sbot.sh +++ b/run-tilde-sbot.sh @@ -5,14 +5,12 @@ set -e # Usage check if [ "$#" -lt 2 ]; then - echo "Usage: $0 " + echo "Usage: $0 " exit 1 fi CONFIG_FILE="$1" TILDEFRIENDS_PATH="$2" -shift 2 -EXTRA_ARGS=("$@") # Extract network_key (if it exists) @@ -33,16 +31,11 @@ echo "ARGS: $ARGS" [ -n "$NETWORK_KEY" ] && echo "NETWORK_KEY: $NETWORK_KEY" [ -n "$DATABASE_DIRECTORY" ] && echo "DATABASE_DIRECTORY: $DATABASE_DIRECTORY" -CMD="\"$TILDEFRIENDS_PATH\"" +CMD="\"$TILDEFRIENDS_PATH\" run" [ -n "$ARGS" ] && CMD="$CMD -a \"$ARGS\"" [ -n "$NETWORK_KEY" ] && CMD="$CMD -k \"$NETWORK_KEY\"" [ -n "$DATABASE_DIRECTORY" ] && CMD="$CMD -d \"$DATABASE_DIRECTORY/db.sqlite\"" -# Append extra arguments -for ARG in "${EXTRA_ARGS[@]}"; do - CMD="$CMD \"$ARG\"" -done - echo "Running command:" echo "$CMD" diff --git a/tilde-client/src/lib.rs b/tilde-client/src/lib.rs index 75a25f4..6b3b3d0 100644 --- a/tilde-client/src/lib.rs +++ b/tilde-client/src/lib.rs @@ -11,8 +11,7 @@ mod error; pub struct TildeClient { pub port: String, pub tilde_binary_path: String, - pub tilde_wrapper_path: String, - pub tilde_config_path: String, + pub tilde_database_path: String, } pub fn init_sbot() { println!("++ init sbot!"); @@ -21,11 +20,10 @@ pub fn init_sbot() { impl TildeClient { pub fn run_tilde_command(&self, args: Vec<&str>) -> Result { - let mut command = Command::new(&self.tilde_wrapper_path); - // wrapper config_file binary_path Date: Fri, 23 May 2025 14:01:38 -0400 Subject: [PATCH 12/14] working --- Cargo.lock | 7 +++++++ pdeploy.sh | 4 ++++ peach-lib/src/sbot.rs | 9 +++++---- peach-web/Cargo.toml | 1 + peach-web/src/routes/authentication/change.rs | 10 +++++----- peach-web/src/routes/authentication/forgot.rs | 2 +- peach-web/src/routes/authentication/login.rs | 6 +++--- peach-web/src/routes/authentication/logout.rs | 4 ++-- peach-web/src/routes/authentication/reset.rs | 10 +++++----- .../src/routes/authentication/temporary.rs | 4 ++-- peach-web/src/routes/scuttlebutt/block.rs | 10 +++++----- peach-web/src/routes/scuttlebutt/follow.rs | 10 +++++----- peach-web/src/routes/scuttlebutt/invites.rs | 20 +++++++++++-------- peach-web/src/routes/scuttlebutt/private.rs | 12 +++++------ peach-web/src/routes/scuttlebutt/profile.rs | 2 +- .../src/routes/scuttlebutt/profile_update.rs | 14 ++++++------- peach-web/src/routes/scuttlebutt/publish.rs | 10 +++++----- peach-web/src/routes/scuttlebutt/search.rs | 4 ++-- peach-web/src/routes/scuttlebutt/unblock.rs | 10 +++++----- peach-web/src/routes/scuttlebutt/unfollow.rs | 10 +++++----- peach-web/src/routes/settings/admin/add.rs | 8 ++++---- .../src/routes/settings/admin/configure.rs | 6 +++--- peach-web/src/routes/settings/admin/delete.rs | 8 ++++---- .../src/routes/settings/network/add_ap.rs | 4 ++-- .../src/routes/settings/network/ap_details.rs | 2 +- .../routes/settings/network/configure_dns.rs | 4 ++-- .../settings/network/data_usage_limits.rs | 2 +- peach-web/src/routes/settings/network/menu.rs | 2 +- .../src/routes/settings/network/modify_ap.rs | 4 ++-- peach-web/src/routes/settings/power/menu.rs | 2 +- peach-web/src/routes/settings/power/reboot.rs | 2 +- .../src/routes/settings/power/shutdown.rs | 2 +- .../routes/settings/scuttlebutt/configure.rs | 4 ++-- .../routes/settings/scuttlebutt/default.rs | 2 +- .../src/routes/settings/scuttlebutt/menu.rs | 2 +- .../routes/settings/scuttlebutt/restart.rs | 12 +++++------ .../src/routes/settings/scuttlebutt/start.rs | 8 ++++---- .../src/routes/settings/scuttlebutt/stop.rs | 10 +++++----- peach-web/src/utils/flash.rs | 17 +++++++++------- peach-web/src/utils/sbot.rs | 18 ++++++++--------- tdeploy.sh | 3 +++ tilde-client/src/lib.rs | 7 ++++--- 42 files changed, 155 insertions(+), 133 deletions(-) create mode 100755 pdeploy.sh create mode 100755 tdeploy.sh diff --git a/Cargo.lock b/Cargo.lock index b5971f6..ee6e509 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2576,6 +2576,7 @@ dependencies = [ "reqwest", "rouille", "temporary", + "urlencoding", "vnstat_parse", "xdg", ] @@ -4187,6 +4188,12 @@ dependencies = [ "percent-encoding 2.1.0", ] +[[package]] +name = "urlencoding" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" + [[package]] name = "value-bag" version = "1.0.0-alpha.9" diff --git a/pdeploy.sh b/pdeploy.sh new file mode 100755 index 0000000..ac4f968 --- /dev/null +++ b/pdeploy.sh @@ -0,0 +1,4 @@ +#! /bin/bash +cargo build --package peach-web --release +rsync -azvh /home/notplants/computer/projects/peachpub/peach-workspace/target/release/peach-web root@159.89.42.156:/var/www/peachpub_ynh/peach-web +ssh root@159.89.42.156 'systemctl restart peachpub_ynh-peach-web' diff --git a/peach-lib/src/sbot.rs b/peach-lib/src/sbot.rs index 565d16e..43e364e 100644 --- a/peach-lib/src/sbot.rs +++ b/peach-lib/src/sbot.rs @@ -222,9 +222,10 @@ impl SbotConfig { pub fn read() -> Result { // determine path of user's solar-sbot config.toml let config_path = format!( - "{}/sbot-config.toml", + "{}/tilde-sbot.toml", config_manager::get_config_value("TILDE_SBOT_DATADIR")? ); + println!("TILDE_SBOT_CONFIG_PATH: {}", config_path); let config_contents = fs::read_to_string(config_path)?; @@ -233,7 +234,7 @@ impl SbotConfig { Ok(config) } - /// Write the given `SbotConfig` to the tilde-sbot `sbot-config.toml` file. + /// Write the given `SbotConfig` to the tilde-sbot `tilde-sbot.toml` file. pub fn write(config: SbotConfig) -> Result<(), PeachError> { let repo_comment = "# For details about tilde-sbot configuration, please visit tilde friends documentation\n".to_string(); @@ -242,7 +243,7 @@ impl SbotConfig { // determine path of user's solar-sbot config.toml let config_path = format!( - "{}/sbot-config.toml", + "{}/tilde-sbot.toml", config_manager::get_config_value("TILDE_SBOT_DATADIR")? ); @@ -272,7 +273,7 @@ pub async fn init_sbot() -> Result { debug!("Initialising an sbot client with configuration parameters"); let database_path = format!("{}/db.sqlite", config_manager::get_config_value("TILDE_SBOT_DATADIR")?); let sbot_client = TildeClient { - port: sbot_config.ssb_port, + ssb_port: sbot_config.ssb_port, tilde_binary_path: config_manager::get_config_value("TILDE_BINARY_PATH")?, tilde_database_path: database_path, }; diff --git a/peach-web/Cargo.toml b/peach-web/Cargo.toml index 6880306..dc495c5 100644 --- a/peach-web/Cargo.toml +++ b/peach-web/Cargo.toml @@ -51,3 +51,4 @@ vnstat_parse = "0.1.0" xdg = "2.2" jsonrpc_client = { version = "0.7", features = ["macros", "reqwest"] } reqwest = "0.11.24" +urlencoding = "2.1.3" diff --git a/peach-web/src/routes/authentication/change.rs b/peach-web/src/routes/authentication/change.rs index 50e7b69..1aa40ef 100644 --- a/peach-web/src/routes/authentication/change.rs +++ b/peach-web/src/routes/authentication/change.rs @@ -41,7 +41,7 @@ pub fn build_template(request: &Request) -> PreEscaped { // render flash message if cookies were found in the request @if let (Some(name), Some(msg)) = (flash_name, flash_msg) { (PreEscaped("")) - (templates::flash::build_template(name, msg)) + (templates::flash::build_template(&name, &msg)) } } }; @@ -102,12 +102,12 @@ pub fn handle_form(request: &Request) -> Response { ) { Ok(_) => ( // = - "flash_name=success".to_string(), - "flash_msg=New password has been saved".to_string(), + "success".to_string(), + "New password has been saved".to_string(), ), Err(err) => ( - "flash_name=error".to_string(), - format!("flash_msg=Failed to save new password: {}", err), + "error".to_string(), + format!("Failed to save new password: {}", err), ), }; diff --git a/peach-web/src/routes/authentication/forgot.rs b/peach-web/src/routes/authentication/forgot.rs index 84ff7df..098a396 100644 --- a/peach-web/src/routes/authentication/forgot.rs +++ b/peach-web/src/routes/authentication/forgot.rs @@ -38,7 +38,7 @@ pub fn build_template(request: &Request) -> PreEscaped { // render flash message if cookies were found in the request @if let (Some(name), Some(msg)) = (flash_name, flash_msg) { (PreEscaped("")) - (templates::flash::build_template(name, msg)) + (templates::flash::build_template(&name, &msg)) } } }; diff --git a/peach-web/src/routes/authentication/login.rs b/peach-web/src/routes/authentication/login.rs index ae423b3..e9268f7 100644 --- a/peach-web/src/routes/authentication/login.rs +++ b/peach-web/src/routes/authentication/login.rs @@ -37,7 +37,7 @@ pub fn build_template(request: &Request) -> PreEscaped { // render flash message if cookies were found in the request @if let (Some(name), Some(msg)) = (flash_name, flash_msg) { (PreEscaped("")) - (templates::flash::build_template(name, msg)) + (templates::flash::build_template(&name, &msg)) } } }; @@ -76,8 +76,8 @@ pub fn handle_form(request: &Request, session_data: &mut Option) -> debug!("Unsuccessful login attempt"); let err_msg = format!("Invalid password: {}", err); let (flash_name, flash_msg) = ( - "flash_name=error".to_string(), - format!("flash_msg={}", err_msg), + "error".to_string(), + format!("{}", err_msg), ); // if unsuccessful login, render /login page again diff --git a/peach-web/src/routes/authentication/logout.rs b/peach-web/src/routes/authentication/logout.rs index 21cc514..0fb4fe7 100644 --- a/peach-web/src/routes/authentication/logout.rs +++ b/peach-web/src/routes/authentication/logout.rs @@ -14,8 +14,8 @@ pub fn deauthenticate(session_data: &mut Option) -> Response { *session_data = None; let (flash_name, flash_msg) = ( - "flash_name=success".to_string(), - "flash_msg=Logged out".to_string(), + "success".to_string(), + "Logged out".to_string(), ); // set the flash cookie headers and redirect to the login page diff --git a/peach-web/src/routes/authentication/reset.rs b/peach-web/src/routes/authentication/reset.rs index e352490..fecd95a 100644 --- a/peach-web/src/routes/authentication/reset.rs +++ b/peach-web/src/routes/authentication/reset.rs @@ -41,7 +41,7 @@ pub fn build_template(request: &Request) -> PreEscaped { // render flash message if cookies were found in the request @if let (Some(name), Some(msg)) = (flash_name, flash_msg) { (PreEscaped("")) - (templates::flash::build_template(name, msg)) + (templates::flash::build_template(&name, &msg)) } } }; @@ -100,12 +100,12 @@ pub fn handle_form(request: &Request) -> Response { &data.new_password2, ) { Ok(_) => ( - "flash_name=success".to_string(), - "flash_msg=New password has been saved. Return home to login".to_string(), + "success".to_string(), + "New password has been saved. Return home to login".to_string(), ), Err(err) => ( - "flash_name=error".to_string(), - format!("flash_msg=Failed to reset password: {}", err), + "error".to_string(), + format!("Failed to reset password: {}", err), ), }; diff --git a/peach-web/src/routes/authentication/temporary.rs b/peach-web/src/routes/authentication/temporary.rs index 9bf17fb..994bbc1 100644 --- a/peach-web/src/routes/authentication/temporary.rs +++ b/peach-web/src/routes/authentication/temporary.rs @@ -21,8 +21,8 @@ pub fn handle_form() -> Response { Ok(_) => { debug!("Sent temporary password to device admin(s)"); ( - "flash_name=success".to_string(), - "flash_msg=A temporary password has been sent to the admin(s) of this device" + "success".to_string(), + "A temporary password has been sent to the admin(s) of this device" .to_string(), ) } diff --git a/peach-web/src/routes/scuttlebutt/block.rs b/peach-web/src/routes/scuttlebutt/block.rs index 176133c..c079781 100644 --- a/peach-web/src/routes/scuttlebutt/block.rs +++ b/peach-web/src/routes/scuttlebutt/block.rs @@ -21,17 +21,17 @@ pub fn handle_form(request: &Request) -> Response { Ok(status) if status.state == Some("active".to_string()) => { match sbot::block_peer(&data.public_key) { Ok(success_msg) => ( - "flash_name=success".to_string(), - format!("flash_msg={}", success_msg), + "success".to_string(), + format!("{}", success_msg), ), Err(error_msg) => ( - "flash_name=error".to_string(), - format!("flash_msg={}", error_msg), + "error".to_string(), + format!("{}", error_msg), ), } } _ => ( - "flash_name=warning".to_string(), + "warning".to_string(), "Social interactions are unavailable.".to_string(), ), }; diff --git a/peach-web/src/routes/scuttlebutt/follow.rs b/peach-web/src/routes/scuttlebutt/follow.rs index a73d47b..d045345 100644 --- a/peach-web/src/routes/scuttlebutt/follow.rs +++ b/peach-web/src/routes/scuttlebutt/follow.rs @@ -21,17 +21,17 @@ pub fn handle_form(request: &Request) -> Response { Ok(status) if status.state == Some("active".to_string()) => { match sbot::follow_peer(&data.public_key) { Ok(success_msg) => ( - "flash_name=success".to_string(), - format!("flash_msg={}", success_msg), + "success".to_string(), + format!("{}", success_msg), ), Err(error_msg) => ( - "flash_name=error".to_string(), - format!("flash_msg={}", error_msg), + "error".to_string(), + format!("{}", error_msg), ), } } _ => ( - "flash_name=warning".to_string(), + "warning".to_string(), "Social interactions are unavailable.".to_string(), ), }; diff --git a/peach-web/src/routes/scuttlebutt/invites.rs b/peach-web/src/routes/scuttlebutt/invites.rs index f2cc5d1..e122774 100644 --- a/peach-web/src/routes/scuttlebutt/invites.rs +++ b/peach-web/src/routes/scuttlebutt/invites.rs @@ -1,5 +1,6 @@ use maud::{html, Markup, PreEscaped}; use peach_lib::sbot::SbotStatus; +use peach_lib::config_manager; use rouille::{post_input, try_or_400, Request, Response}; use crate::{ @@ -14,9 +15,9 @@ use crate::{ /// Render the invite form template. fn invite_form_template( - flash_name: Option<&str>, - flash_msg: Option<&str>, - invite_code: Option<&str>, + flash_name: Option, + flash_msg: Option, + invite_code: Option, ) -> Markup { html! { (PreEscaped("")) @@ -40,7 +41,7 @@ fn invite_form_template( // avoid displaying the invite code-containing flash msg @if name != "code" { (PreEscaped("")) - (templates::flash::build_template(name, msg)) + (templates::flash::build_template(&name, &msg)) } } } @@ -51,10 +52,11 @@ fn invite_form_template( pub fn build_template(request: &Request) -> PreEscaped { // check for flash cookies; will be (None, None) if no flash cookies are found let (flash_name, flash_msg) = request.retrieve_flash(); + println!("build template invites!"); // if flash_name is "code" then flash_msg will be an invite code - let invite_code = if flash_name == Some("code") { - flash_msg + let invite_code = if flash_name == Some("code".to_string()) { + flash_msg.clone() } else { None }; @@ -89,9 +91,11 @@ pub fn handle_form(request: &Request) -> Response { })); let (flash_name, flash_msg) = match sbot::create_invite(data.uses) { - Ok(code) => ("flash_name=code".to_string(), format!("flash_msg={}", code)), - Err(e) => ("flash_name=error".to_string(), format!("flash_msg={}", e)), + Ok(code) => ("code".to_string(), format!("{}", code)), + Err(e) => ("error".to_string(), format!("{}", e)), }; + println!("invite flash name: {}, {}", flash_name, flash_msg); + Response::redirect_303("/scuttlebutt/invites").add_flash(flash_name, flash_msg) } diff --git a/peach-web/src/routes/scuttlebutt/private.rs b/peach-web/src/routes/scuttlebutt/private.rs index 737bbe8..a88a030 100644 --- a/peach-web/src/routes/scuttlebutt/private.rs +++ b/peach-web/src/routes/scuttlebutt/private.rs @@ -74,7 +74,7 @@ pub fn build_template(request: &Request, ssb_id: Option) -> PreEscaped")) - (templates::flash::build_template(name, msg)) + (templates::flash::build_template(&name, &msg)) } } } @@ -112,17 +112,17 @@ pub fn handle_form(request: &Request) -> Response { Ok(status) if status.state == Some("active".to_string()) => { match sbot::publish_private_msg(data.text, recipients) { Ok(success_msg) => ( - "flash_name=success".to_string(), - format!("flash_msg={}", success_msg), + "success".to_string(), + format!("{}", success_msg), ), Err(error_msg) => ( - "flash_name=error".to_string(), - format!("flash_msg={}", error_msg), + "error".to_string(), + format!("{}", error_msg), ), } } _ => ( - "flash_name=warning".to_string(), + "warning".to_string(), "Private messaging is unavailable.".to_string(), ), }; diff --git a/peach-web/src/routes/scuttlebutt/profile.rs b/peach-web/src/routes/scuttlebutt/profile.rs index 007aeb8..5f56e1b 100644 --- a/peach-web/src/routes/scuttlebutt/profile.rs +++ b/peach-web/src/routes/scuttlebutt/profile.rs @@ -160,7 +160,7 @@ pub fn build_template(request: &Request, ssb_id: Option) -> PreEscaped")) - (templates::flash::build_template(name, msg)) + (templates::flash::build_template(&name, &msg)) } } } diff --git a/peach-web/src/routes/scuttlebutt/profile_update.rs b/peach-web/src/routes/scuttlebutt/profile_update.rs index 8d7459b..ffb8ca8 100644 --- a/peach-web/src/routes/scuttlebutt/profile_update.rs +++ b/peach-web/src/routes/scuttlebutt/profile_update.rs @@ -81,7 +81,7 @@ pub fn build_template(request: &Request) -> PreEscaped { // render flash message if cookies were found in the request @if let (Some(name), Some(msg)) = (flash_name, flash_msg) { (PreEscaped("")) - (templates::flash::build_template(name, msg)) + (templates::flash::build_template(&name, &msg)) } } } @@ -139,17 +139,17 @@ pub fn handle_form(request: &Request) -> Response { data.image, ) { Ok(success_msg) => ( - "flash_name=success".to_string(), - format!("flash_msg={}", success_msg), + "success".to_string(), + format!("{}", success_msg), ), Err(error_msg) => ( - "flash_name=error".to_string(), - format!("flash_msg={}", error_msg), + "error".to_string(), + format!("{}", error_msg), ), } } _ => ( - "flash_name=warning".to_string(), + "warning".to_string(), "Profile is unavailable.".to_string(), ), }; @@ -165,7 +165,7 @@ pub fn handle_form(request: &Request) -> Response { } Err(err) => { let (flash_name, flash_msg) = - ("flash_name=error".to_string(), format!("flash_msg={}", err)); + ("error".to_string(), format!("{}", err)); Response::redirect_303("/scuttlebutt/search").add_flash(flash_name, flash_msg) } } diff --git a/peach-web/src/routes/scuttlebutt/publish.rs b/peach-web/src/routes/scuttlebutt/publish.rs index 3d1b0a9..9d246e3 100644 --- a/peach-web/src/routes/scuttlebutt/publish.rs +++ b/peach-web/src/routes/scuttlebutt/publish.rs @@ -22,17 +22,17 @@ pub fn handle_form(request: &Request) -> Response { Ok(status) if status.state == Some("active".to_string()) => { match sbot::publish_public_post(data.text) { Ok(success_msg) => ( - "flash_name=success".to_string(), - format!("flash_msg={}", success_msg), + "success".to_string(), + format!("{}", success_msg), ), Err(error_msg) => ( - "flash_name=error".to_string(), - format!("flash_msg={}", error_msg), + "error".to_string(), + format!("{}", error_msg), ), } } _ => ( - "flash_name=warning".to_string(), + "warning".to_string(), "Public posting is unavailable.".to_string(), ), }; diff --git a/peach-web/src/routes/scuttlebutt/search.rs b/peach-web/src/routes/scuttlebutt/search.rs index 01bebf5..3220ce3 100644 --- a/peach-web/src/routes/scuttlebutt/search.rs +++ b/peach-web/src/routes/scuttlebutt/search.rs @@ -29,7 +29,7 @@ pub fn build_template(request: &Request) -> PreEscaped { // render flash message if cookies were found in the request @if let (Some(name), Some(msg)) = (flash_name, flash_msg) { (PreEscaped("")) - (templates::flash::build_template(name, msg)) + (templates::flash::build_template(&name, &msg)) } } } @@ -62,7 +62,7 @@ pub fn handle_form(request: &Request) -> Response { } Err(err) => { let (flash_name, flash_msg) = - ("flash_name=error".to_string(), format!("flash_msg={}", err)); + ("error".to_string(), format!("{}", err)); Response::redirect_303("/scuttlebutt/search").add_flash(flash_name, flash_msg) } } diff --git a/peach-web/src/routes/scuttlebutt/unblock.rs b/peach-web/src/routes/scuttlebutt/unblock.rs index 7ebf7f2..d4f5d0d 100644 --- a/peach-web/src/routes/scuttlebutt/unblock.rs +++ b/peach-web/src/routes/scuttlebutt/unblock.rs @@ -21,17 +21,17 @@ pub fn handle_form(request: &Request) -> Response { Ok(status) if status.state == Some("active".to_string()) => { match sbot::unblock_peer(&data.public_key) { Ok(success_msg) => ( - "flash_name=success".to_string(), - format!("flash_msg={}", success_msg), + "success".to_string(), + format!("{}", success_msg), ), Err(error_msg) => ( - "flash_name=error".to_string(), - format!("flash_msg={}", error_msg), + "error".to_string(), + format!("{}", error_msg), ), } } _ => ( - "flash_name=warning".to_string(), + "warning".to_string(), "Social interactions are unavailable.".to_string(), ), }; diff --git a/peach-web/src/routes/scuttlebutt/unfollow.rs b/peach-web/src/routes/scuttlebutt/unfollow.rs index a043f06..20267d9 100644 --- a/peach-web/src/routes/scuttlebutt/unfollow.rs +++ b/peach-web/src/routes/scuttlebutt/unfollow.rs @@ -21,17 +21,17 @@ pub fn handle_form(request: &Request) -> Response { Ok(status) if status.state == Some("active".to_string()) => { match sbot::unfollow_peer(&data.public_key) { Ok(success_msg) => ( - "flash_name=success".to_string(), - format!("flash_msg={}", success_msg), + "success".to_string(), + format!("{}", success_msg), ), Err(error_msg) => ( - "flash_name=error".to_string(), - format!("flash_msg={}", error_msg), + "error".to_string(), + format!("{}", error_msg), ), } } _ => ( - "flash_name=warning".to_string(), + "warning".to_string(), "Social interactions are unavailable.".to_string(), ), }; diff --git a/peach-web/src/routes/settings/admin/add.rs b/peach-web/src/routes/settings/admin/add.rs index 863d3c7..c969f25 100644 --- a/peach-web/src/routes/settings/admin/add.rs +++ b/peach-web/src/routes/settings/admin/add.rs @@ -21,12 +21,12 @@ pub fn handle_form(request: &Request) -> Response { // save submitted admin id to file let (flash_name, flash_msg) = match config_manager::add_ssb_admin_id(&data.ssb_id) { Ok(_) => ( - "flash_name=success".to_string(), - "flash_msg=Added SSB administrator".to_string(), + "success".to_string(), + "Added SSB administrator".to_string(), ), Err(err) => ( - "flash_name=error".to_string(), - format!("flash_msg=Failed to add new administrator: {}", err), + "error".to_string(), + format!("Failed to add new administrator: {}", err), ), }; diff --git a/peach-web/src/routes/settings/admin/configure.rs b/peach-web/src/routes/settings/admin/configure.rs index 4b823eb..69d4bb6 100644 --- a/peach-web/src/routes/settings/admin/configure.rs +++ b/peach-web/src/routes/settings/admin/configure.rs @@ -20,8 +20,8 @@ pub fn build_template(request: &Request) -> PreEscaped { // currently produces an error because we end up with Some(String) // instead of Some(str) Err(_err) => { - flash_name = Some("flash_name=error"); - flash_msg = Some("flash_msg=Failed to read PeachCloud configuration file"); + flash_name = Some("error".to_string()); + flash_msg = Some("Failed to read PeachCloud configuration file".to_string()); None } }; @@ -58,7 +58,7 @@ pub fn build_template(request: &Request) -> PreEscaped { // render flash message if cookies were found in the request @if let (Some(name), Some(msg)) = (flash_name, flash_msg) { (PreEscaped("")) - (templates::flash::build_template(name, msg)) + (templates::flash::build_template(&name, &msg)) } } }; diff --git a/peach-web/src/routes/settings/admin/delete.rs b/peach-web/src/routes/settings/admin/delete.rs index 06bfc1c..da08393 100644 --- a/peach-web/src/routes/settings/admin/delete.rs +++ b/peach-web/src/routes/settings/admin/delete.rs @@ -21,12 +21,12 @@ pub fn handle_form(request: &Request) -> Response { let (flash_name, flash_msg) = match config_manager::delete_ssb_admin_id(&data.ssb_id) { Ok(_) => ( // = - "flash_name=success".to_string(), - "flash_msg=Removed SSB administrator".to_string(), + "success".to_string(), + "Removed SSB administrator".to_string(), ), Err(err) => ( - "flash_name=error".to_string(), - format!("flash_msg=Failed to remove administrator: {}", err), + "error".to_string(), + format!("Failed to remove administrator: {}", err), ), }; diff --git a/peach-web/src/routes/settings/network/add_ap.rs b/peach-web/src/routes/settings/network/add_ap.rs index fed88ad..cd400ce 100644 --- a/peach-web/src/routes/settings/network/add_ap.rs +++ b/peach-web/src/routes/settings/network/add_ap.rs @@ -51,7 +51,7 @@ pub fn build_template(request: &Request, selected_ap: Option) -> PreEsca } @if let (Some(name), Some(msg)) = (flash_name, flash_msg) { (PreEscaped("")) - (templates::flash::build_template(name, msg)) + (templates::flash::build_template(&name, &msg)) } } }; @@ -91,7 +91,7 @@ pub fn handle_form(request: &Request) -> Response { ), }; - let (flash_name, flash_msg) = (format!("flash_name={}", name), format!("flash_msg={}", msg)); + let (flash_name, flash_msg) = (format!("{}", name), format!("{}", msg)); Response::redirect_303("/settings/network/wifi/add").add_flash(flash_name, flash_msg) } diff --git a/peach-web/src/routes/settings/network/ap_details.rs b/peach-web/src/routes/settings/network/ap_details.rs index 20985b4..b67fd56 100644 --- a/peach-web/src/routes/settings/network/ap_details.rs +++ b/peach-web/src/routes/settings/network/ap_details.rs @@ -180,7 +180,7 @@ pub fn build_template(request: &Request, selected_ap: String) -> PreEscaped")) - (templates::flash::build_template(name, msg)) + (templates::flash::build_template(&name, &msg)) } } }; diff --git a/peach-web/src/routes/settings/network/configure_dns.rs b/peach-web/src/routes/settings/network/configure_dns.rs index a619234..606ca22 100644 --- a/peach-web/src/routes/settings/network/configure_dns.rs +++ b/peach-web/src/routes/settings/network/configure_dns.rs @@ -111,7 +111,7 @@ pub fn build_template(request: &Request) -> PreEscaped { (render_save_button()) @if let (Some(name), Some(msg)) = (flash_name, flash_msg) { (PreEscaped("")) - (templates::flash::build_template(name, msg)) + (templates::flash::build_template(&name, &msg)) } } } @@ -195,7 +195,7 @@ pub fn handle_form(request: &Request) -> Response { ), }; - let (flash_name, flash_msg) = (format!("flash_name={}", name), format!("flash_msg={}", msg)); + let (flash_name, flash_msg) = (format!("{}", name), format!("{}", msg)); Response::redirect_303("/settings/network/dns").add_flash(flash_name, flash_msg) } diff --git a/peach-web/src/routes/settings/network/data_usage_limits.rs b/peach-web/src/routes/settings/network/data_usage_limits.rs index 3e0fcb8..42d9a58 100644 --- a/peach-web/src/routes/settings/network/data_usage_limits.rs +++ b/peach-web/src/routes/settings/network/data_usage_limits.rs @@ -158,7 +158,7 @@ pub fn build_template(request: &Request) -> PreEscaped { } @if let (Some(name), Some(msg)) = (flash_name, flash_msg) { (PreEscaped("")) - (templates::flash::build_template(name, msg)) + (templates::flash::build_template(&name, &msg)) } }; } diff --git a/peach-web/src/routes/settings/network/menu.rs b/peach-web/src/routes/settings/network/menu.rs index 2ccd451..b37b048 100644 --- a/peach-web/src/routes/settings/network/menu.rs +++ b/peach-web/src/routes/settings/network/menu.rs @@ -52,7 +52,7 @@ pub fn build_template(request: &Request) -> PreEscaped { // render flash message if cookies were found in the request @if let (Some(name), Some(msg)) = (flash_name, flash_msg) { (PreEscaped("")) - (templates::flash::build_template(name, msg)) + (templates::flash::build_template(&name, &msg)) } } }; diff --git a/peach-web/src/routes/settings/network/modify_ap.rs b/peach-web/src/routes/settings/network/modify_ap.rs index 86a92fb..3e4f5a8 100644 --- a/peach-web/src/routes/settings/network/modify_ap.rs +++ b/peach-web/src/routes/settings/network/modify_ap.rs @@ -52,7 +52,7 @@ pub fn build_template(request: &Request, selected_ap: Option) -> PreEsca // render flash message if cookies were found in the request @if let (Some(name), Some(msg)) = (flash_name, flash_msg) { (PreEscaped("")) - (templates::flash::build_template(name, msg)) + (templates::flash::build_template(&name, &msg)) } } }; @@ -99,7 +99,7 @@ pub fn handle_form(request: &Request) -> Response { ), }; - let (flash_name, flash_msg) = (format!("flash_name={}", name), format!("flash_msg={}", msg)); + let (flash_name, flash_msg) = (format!("{}", name), format!("{}", msg)); Response::redirect_303("/settings/network/wifi/modify").add_flash(flash_name, flash_msg) } diff --git a/peach-web/src/routes/settings/power/menu.rs b/peach-web/src/routes/settings/power/menu.rs index 42dc28b..e15f282 100644 --- a/peach-web/src/routes/settings/power/menu.rs +++ b/peach-web/src/routes/settings/power/menu.rs @@ -23,7 +23,7 @@ pub fn build_template(request: &Request) -> PreEscaped { } @if let (Some(name), Some(msg)) = (flash_name, flash_msg) { (PreEscaped("")) - (templates::flash::build_template(name, msg)) + (templates::flash::build_template(&name, &msg)) } } } diff --git a/peach-web/src/routes/settings/power/reboot.rs b/peach-web/src/routes/settings/power/reboot.rs index 5c1ba7b..a033b97 100644 --- a/peach-web/src/routes/settings/power/reboot.rs +++ b/peach-web/src/routes/settings/power/reboot.rs @@ -30,7 +30,7 @@ pub fn handle_reboot() -> Response { ), }; - let (flash_name, flash_msg) = (format!("flash_name={}", name), format!("flash_msg={}", msg)); + let (flash_name, flash_msg) = (format!("{}", name), format!("{}", msg)); Response::redirect_303("/power").add_flash(flash_name, flash_msg) } diff --git a/peach-web/src/routes/settings/power/shutdown.rs b/peach-web/src/routes/settings/power/shutdown.rs index ae1dfa3..cb1ba3d 100644 --- a/peach-web/src/routes/settings/power/shutdown.rs +++ b/peach-web/src/routes/settings/power/shutdown.rs @@ -29,7 +29,7 @@ pub fn handle_shutdown() -> Response { ), }; - let (flash_name, flash_msg) = (format!("flash_name={}", name), format!("flash_msg={}", msg)); + let (flash_name, flash_msg) = (format!("{}", name), format!("{}", msg)); Response::redirect_303("/power").add_flash(flash_name, flash_msg) } diff --git a/peach-web/src/routes/settings/scuttlebutt/configure.rs b/peach-web/src/routes/settings/scuttlebutt/configure.rs index 715a0d6..329a473 100644 --- a/peach-web/src/routes/settings/scuttlebutt/configure.rs +++ b/peach-web/src/routes/settings/scuttlebutt/configure.rs @@ -160,7 +160,7 @@ pub fn build_template(request: &Request) -> PreEscaped { // render flash message if cookies were found in the request @if let (Some(name), Some(msg)) = (flash_name, flash_msg) { (PreEscaped("")) - (templates::flash::build_template(name, msg)) + (templates::flash::build_template(&name, &msg)) } } }; @@ -251,7 +251,7 @@ pub fn handle_form(request: &Request, restart: bool) -> Response { ), }; - let (flash_name, flash_msg) = (format!("flash_name={}", name), format!("flash_msg={}", msg)); + let (flash_name, flash_msg) = (format!("{}", name), format!("{}", msg)); Response::redirect_303("/settings/scuttlebutt/configure").add_flash(flash_name, flash_msg) } diff --git a/peach-web/src/routes/settings/scuttlebutt/default.rs b/peach-web/src/routes/settings/scuttlebutt/default.rs index daf8d94..df8ba59 100644 --- a/peach-web/src/routes/settings/scuttlebutt/default.rs +++ b/peach-web/src/routes/settings/scuttlebutt/default.rs @@ -15,7 +15,7 @@ pub fn write_config() -> Response { ), }; - let (flash_name, flash_msg) = (format!("flash_name={}", name), format!("flash_msg={}", msg)); + let (flash_name, flash_msg) = (format!("{}", name), format!("{}", msg)); Response::redirect_303("/settings/scuttlebutt/configure").add_flash(flash_name, flash_msg) } diff --git a/peach-web/src/routes/settings/scuttlebutt/menu.rs b/peach-web/src/routes/settings/scuttlebutt/menu.rs index 4360898..ea42016 100644 --- a/peach-web/src/routes/settings/scuttlebutt/menu.rs +++ b/peach-web/src/routes/settings/scuttlebutt/menu.rs @@ -48,7 +48,7 @@ pub fn build_template(request: &Request) -> PreEscaped { // render flash message if cookies were found in the request @if let (Some(name), Some(msg)) = (flash_name, flash_msg) { (PreEscaped("")) - (templates::flash::build_template(name, msg)) + (templates::flash::build_template(&name, &msg)) } } }; diff --git a/peach-web/src/routes/settings/scuttlebutt/restart.rs b/peach-web/src/routes/settings/scuttlebutt/restart.rs index 3e25b73..1c7d417 100644 --- a/peach-web/src/routes/settings/scuttlebutt/restart.rs +++ b/peach-web/src/routes/settings/scuttlebutt/restart.rs @@ -14,17 +14,17 @@ pub fn restart_sbot() -> Response { // if stop was successful, try to start the process Ok(_) => match systemctl_sbot_cmd("start") { Ok(_) => ( - "flash_name=success".to_string(), - "flash_msg=Sbot process has been restarted".to_string(), + "success".to_string(), + "Sbot process has been restarted".to_string(), ), Err(e) => ( - "flash_name=error".to_string(), - format!("flash_msg=Failed to start the sbot process: {}", e), + "error".to_string(), + format!("Failed to start the sbot process: {}", e), ), }, Err(e) => ( - "flash_name=error".to_string(), - format!("flash_msg=Failed to stop the sbot process: {}", e), + "error".to_string(), + format!("Failed to stop the sbot process: {}", e), ), }; diff --git a/peach-web/src/routes/settings/scuttlebutt/start.rs b/peach-web/src/routes/settings/scuttlebutt/start.rs index 2ee7f4e..ddf9932 100644 --- a/peach-web/src/routes/settings/scuttlebutt/start.rs +++ b/peach-web/src/routes/settings/scuttlebutt/start.rs @@ -12,12 +12,12 @@ pub fn start_sbot() -> Response { info!("Starting go-sbot.service"); let (flash_name, flash_msg) = match systemctl_sbot_cmd("start") { Ok(_) => ( - "flash_name=success".to_string(), - "flash_msg=Sbot process has been started".to_string(), + "success".to_string(), + "Sbot process has been started".to_string(), ), Err(_) => ( - "flash_name=error".to_string(), - "flash_msg=Failed to start the sbot process".to_string(), + "error".to_string(), + "Failed to start the sbot process".to_string(), ), }; diff --git a/peach-web/src/routes/settings/scuttlebutt/stop.rs b/peach-web/src/routes/settings/scuttlebutt/stop.rs index d548698..68ad881 100644 --- a/peach-web/src/routes/settings/scuttlebutt/stop.rs +++ b/peach-web/src/routes/settings/scuttlebutt/stop.rs @@ -9,15 +9,15 @@ use crate::utils::{flash::FlashResponse, sbot::systemctl_sbot_cmd}; /// Redirect to the Scuttlebutt settings menu and communicate the outcome of /// the attempt via a flash message. pub fn stop_sbot() -> Response { - info!("Stopping go-sbot.service"); + info!("Stopping tilde-sbot.service"); let (flash_name, flash_msg) = match systemctl_sbot_cmd("stop") { Ok(_) => ( - "flash_name=success".to_string(), - "flash_msg=Sbot process has been stopped".to_string(), + "success".to_string(), + "Sbot process has been stopped".to_string(), ), Err(_) => ( - "flash_name=error".to_string(), - "flash_msg=Failed to stop the sbot process".to_string(), + "error".to_string(), + "Failed to stop the sbot process".to_string(), ), }; diff --git a/peach-web/src/utils/flash.rs b/peach-web/src/utils/flash.rs index 0134ca1..b2b4b1c 100644 --- a/peach-web/src/utils/flash.rs +++ b/peach-web/src/utils/flash.rs @@ -1,21 +1,21 @@ use rouille::{input, Request, Response}; +use urlencoding; /// Flash message trait for `Request`. pub trait FlashRequest { /// Retrieve the flash message cookie values from a `Request`. - fn retrieve_flash(&self) -> (Option<&str>, Option<&str>); + fn retrieve_flash(&self) -> (Option, Option); } impl FlashRequest for Request { - fn retrieve_flash(&self) -> (Option<&str>, Option<&str>) { - // check for flash cookies + fn retrieve_flash(&self) -> (Option, Option) { let flash_name = input::cookies(self) .find(|&(n, _)| n == "flash_name") // return the value of the cookie (key is already known) - .map(|key_val| key_val.1); + .and_then(|(_, val)| urlencoding::decode(&val).ok().map(|s| s.into_owned())); let flash_msg = input::cookies(self) .find(|&(n, _)| n == "flash_msg") - .map(|key_val| key_val.1); + .and_then(|(_, val)| urlencoding::decode(&val).ok().map(|s| s.into_owned())); (flash_name, flash_msg) } @@ -31,9 +31,12 @@ pub trait FlashResponse { impl FlashResponse for Response { fn add_flash(self, flash_name: String, flash_msg: String) -> Response { + + let flash_name = urlencoding::encode(&flash_name).into_owned(); + let flash_msg = urlencoding::encode(&flash_msg).into_owned(); // set the flash cookie headers - self.with_additional_header("Set-Cookie", format!("{}; Max-Age=1", flash_name)) - .with_additional_header("Set-Cookie", format!("{}; Max-Age=1", flash_msg)) + self.with_additional_header("Set-Cookie", format!("flash_name={}; Max-Age=1;", flash_name)) + .with_additional_header("Set-Cookie", format!("flash_msg={}; Max-Age=1;", flash_msg)) } fn reset_flash(self) -> Response { diff --git a/peach-web/src/utils/sbot.rs b/peach-web/src/utils/sbot.rs index 810a98d..19e260e 100644 --- a/peach-web/src/utils/sbot.rs +++ b/peach-web/src/utils/sbot.rs @@ -26,11 +26,14 @@ use crate::{error::PeachWebError, utils::sbot}; /// Executes a systemctl command for the solar-sbot.service process. pub fn systemctl_sbot_cmd(cmd: &str) -> Result { - let output = Command::new("sudo") + let mut command = Command::new("sudo"); + command .arg("systemctl") .arg(cmd) - .arg(config_manager::get_config_value("TILDE_SBOT_SERVICE")?) - .output()?; + .arg(config_manager::get_config_value("TILDE_SBOT_SERVICE")?); + println!("systemctl command: {:?}", command); + let output = command.output()?; + println!("systemctl output: {:?}", output); Ok(output) } @@ -146,13 +149,8 @@ pub fn create_invite(uses: u16) -> Result { task::block_on(async { let mut sbot_client = init_sbot_client().await?; - debug!("Generating Scuttlebutt invite code"); - let mut invite_code = sbot_client.create_invite(uses as i32).await?; - - let domain = config_manager::get_config_value("EXTERNAL_DOMAIN")?; - if !domain.is_empty() { - invite_code = domain + &invite_code[4..]; - } + let external_domain = config_manager::get_config_value("EXTERNAL_DOMAIN").ok(); + let mut invite_code = sbot_client.create_invite(uses as i32, external_domain.as_deref()).await?; Ok(invite_code) }) diff --git a/tdeploy.sh b/tdeploy.sh new file mode 100755 index 0000000..0526979 --- /dev/null +++ b/tdeploy.sh @@ -0,0 +1,3 @@ +#! /bin/bash +cargo build --package peach-web --release +rsync -azvh /home/notplants/computer/projects/peachpub/peach-workspace/target/release/peach-web root@10.243.137.235:/var/www/peachpub_ynh/peach-web diff --git a/tilde-client/src/lib.rs b/tilde-client/src/lib.rs index 6b3b3d0..1b2d86f 100644 --- a/tilde-client/src/lib.rs +++ b/tilde-client/src/lib.rs @@ -9,7 +9,7 @@ use std::process::{Command, exit}; mod error; pub struct TildeClient { - pub port: String, + pub ssb_port: String, pub tilde_binary_path: String, pub tilde_database_path: String, } @@ -133,8 +133,9 @@ impl TildeClient { self.run_tilde_command(vec!["private", "-u", ":admin", "-i", &self_key, "-r", recipient_key, "-t", message]) } - pub async fn create_invite(&self, num_uses: i32) -> Result { + pub async fn create_invite(&self, num_uses: i32, external_domain: Option<&str>) -> Result { let key = self.whoami().await?; - self.run_tilde_command(vec!["create_invite", "-u", &num_uses.to_string(), "-i", &key, "-p", &self.port, "-a", "127.0.0.1", "-e", "-1"]) + let address = external_domain.unwrap_or_else(|| "127.0.0.1"); + self.run_tilde_command(vec!["create_invite", "-u", &num_uses.to_string(), "-i", &key, "-p", &self.ssb_port, "-a", address, "-e", "-1"]) } } -- 2.47.2 From bc190051db93c4eab5348e69a148020f21bd28a8 Mon Sep 17 00:00:00 2001 From: notplants Date: Mon, 26 May 2025 17:56:04 -0400 Subject: [PATCH 13/14] bundle change-password cli with peach-web --- Cargo.lock | 1 + peach-web/Cargo.toml | 1 + peach-web/src/cli/change_password.rs | 34 ++++++++++++++++++++++++++++ peach-web/src/cli/mod.rs | 1 + peach-web/src/error.rs | 6 +++++ peach-web/src/main.rs | 29 ++++++++++++++++++------ tilde-client/src/lib.rs | 1 + 7 files changed, 66 insertions(+), 7 deletions(-) create mode 100644 peach-web/src/cli/change_password.rs create mode 100644 peach-web/src/cli/mod.rs diff --git a/Cargo.lock b/Cargo.lock index ee6e509..788c448 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2575,6 +2575,7 @@ dependencies = [ "peach-stats", "reqwest", "rouille", + "rpassword", "temporary", "urlencoding", "vnstat_parse", diff --git a/peach-web/Cargo.toml b/peach-web/Cargo.toml index dc495c5..9616bc6 100644 --- a/peach-web/Cargo.toml +++ b/peach-web/Cargo.toml @@ -52,3 +52,4 @@ xdg = "2.2" jsonrpc_client = { version = "0.7", features = ["macros", "reqwest"] } reqwest = "0.11.24" urlencoding = "2.1.3" +rpassword = "5.0" diff --git a/peach-web/src/cli/change_password.rs b/peach-web/src/cli/change_password.rs new file mode 100644 index 0000000..c776a0b --- /dev/null +++ b/peach-web/src/cli/change_password.rs @@ -0,0 +1,34 @@ +use peach_lib::password_utils::set_new_password; +use crate::error::PeachWebError; + +/// Utility function to set the admin password for peach-web from the command-line. +pub fn set_peach_web_password(password: Option) -> Result<(), PeachWebError> { + match password { + // read password from CLI arg + Some(password) => { + set_new_password(&password) + .map_err(|err| PeachWebError::PeachLib { source: err, msg: "Error setting password via cli".to_string() })?; + println!( + "Your new password has been set for peach-web. You can login through the \ + web interface with username admin." + ); + Ok(()) + } + // read password from tty + None => { + let pass1 = rpassword::read_password_from_tty(Some("New password: "))?; + let pass2 = rpassword::read_password_from_tty(Some("Confirm password: "))?; + if pass1 != pass2 { + Err(PeachWebError::InvalidPassword) + } else { + set_new_password(&pass1) + .map_err(|err| PeachWebError::PeachLib { source: err, msg: "Passwords did not match".to_string() })?; + println!( + "Your new password has been set for peach-web. You can login through the \ + web interface with username admin." + ); + Ok(()) + } + } + } +} \ No newline at end of file diff --git a/peach-web/src/cli/mod.rs b/peach-web/src/cli/mod.rs new file mode 100644 index 0000000..68d8a82 --- /dev/null +++ b/peach-web/src/cli/mod.rs @@ -0,0 +1 @@ +pub mod change_password; \ No newline at end of file diff --git a/peach-web/src/error.rs b/peach-web/src/error.rs index dfe7ec6..007eb54 100644 --- a/peach-web/src/error.rs +++ b/peach-web/src/error.rs @@ -19,6 +19,7 @@ pub enum PeachWebError { PeachLib { source: PeachError, msg: String }, Yaml(YamlError), Tilde(TildeError), + InvalidPassword, NotYetImplemented, } @@ -27,6 +28,7 @@ impl std::error::Error for PeachWebError { match *self { PeachWebError::FailedToRegisterDynDomain(_) => None, PeachWebError::HomeDir => None, + PeachWebError::InvalidPassword => None, PeachWebError::Io(ref source) => Some(source), PeachWebError::Json(ref source) => Some(source), PeachWebError::OsString => None, @@ -48,6 +50,10 @@ impl std::fmt::Display for PeachWebError { f, "Filesystem error: failed to determine home directory path" ), + PeachWebError::InvalidPassword => write!( + f, + "Failed to change password via CLI" + ), PeachWebError::Io(ref source) => write!(f, "IO error: {}", source), PeachWebError::Json(ref source) => write!(f, "Serde JSON error: {}", source), PeachWebError::OsString => write!( diff --git a/peach-web/src/main.rs b/peach-web/src/main.rs index 01ccc73..9c7fa78 100644 --- a/peach-web/src/main.rs +++ b/peach-web/src/main.rs @@ -19,11 +19,9 @@ mod public_router; mod routes; mod templates; pub mod utils; +mod cli; -use std::{ - collections::HashMap, - sync::{Mutex, RwLock}, -}; +use std::{collections::HashMap, env, sync::{Mutex, RwLock}}; use lazy_static::lazy_static; use log::info; @@ -52,9 +50,7 @@ pub struct SessionData { } /// Launch the peach-web server. -fn main() { - // initialize logger - env_logger::init(); +fn run_webserver() { // set ip address / hostname and port for the webserver // defaults to "127.0.0.1:8000" @@ -121,3 +117,22 @@ fn main() { }) }); } + +/// cli entry point +fn main() { + env_logger::init(); + + let mut args = env::args(); + let _program = args.next(); // skip program name + + match args.next().as_deref() { + Some("run") => run_webserver(), + Some("change-password") => { + cli::change_password::set_peach_web_password(args.next()); + } + _ => { + eprintln!("Usage: peach-web "); + std::process::exit(1); + } + } +} \ No newline at end of file diff --git a/tilde-client/src/lib.rs b/tilde-client/src/lib.rs index 1b2d86f..1c0829e 100644 --- a/tilde-client/src/lib.rs +++ b/tilde-client/src/lib.rs @@ -38,6 +38,7 @@ impl TildeClient { } let result = String::from_utf8_lossy(&output.stdout).to_string(); + println!("Command: {:?}", command); println!("Command output: {}", result); Ok(result) -- 2.47.2 From 9930d690ab57a86b89b528079df4d8639ec2b907 Mon Sep 17 00:00:00 2001 From: notplants Date: Tue, 27 May 2025 17:20:53 -0400 Subject: [PATCH 14/14] vendored openssl for arm64 build --- Cargo.lock | 2281 +++++++++++++++++++++++------------------- Cargo.toml | 2 +- peach-web/Cargo.toml | 1 + run-tilde-sbot.sh | 15 +- 4 files changed, 1283 insertions(+), 1016 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 788c448..5b6f158 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,28 +4,43 @@ version = 4 [[package]] name = "addr2line" -version = "0.17.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "aho-corasick" -version = "0.7.18" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + [[package]] name = "ansi_term" version = "0.12.1" @@ -37,15 +52,15 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.86" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" [[package]] name = "ascii" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbf56136a5198c7b01a49e3afcbef6cf84597273d298f54432926024107b0109" +checksum = "d92bec98840b8f03a5ff5413de5293bfcd8bf96467cf5452609f939ec6f5de16" [[package]] name = "async-attributes" @@ -53,122 +68,155 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3203e79f4dd9bdda415ed03cf14dae5a2bf775c683a00f94e9cd1faf0f596e5" dependencies = [ - "quote 1.0.37", - "syn 1.0.98", + "quote 1.0.40", + "syn 1.0.109", ] [[package]] name = "async-channel" -version = "1.6.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2114d64672151c0c5eaa5e131ec84a74f06e1e559830dabba01ca30605d66319" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" dependencies = [ "concurrent-queue", - "event-listener", + "event-listener 2.5.3", "futures-core", ] [[package]] -name = "async-executor" -version = "1.4.1" +name = "async-channel" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "871f9bb5e0a22eeb7e8cf16641feb87c9dc67032ccf8ff49e772eb9941d3a965" +checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" +dependencies = [ + "concurrent-queue", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-executor" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb812ffb58524bdd10860d7d974e2f01cc0950c2438a74ee5ec2e2280c6c4ffa" dependencies = [ "async-task", "concurrent-queue", "fastrand", "futures-lite", - "once_cell", - "slab 0.4.6", + "pin-project-lite", + "slab 0.4.9", ] [[package]] name = "async-global-executor" -version = "2.2.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5262ed948da60dd8956c6c5aca4d4163593dddb7b32d73267c93dab7b2e98940" +checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" dependencies = [ - "async-channel", + "async-channel 2.3.1", "async-executor", "async-io", "async-lock", "blocking", "futures-lite", - "num_cpus", "once_cell", - "tokio 1.40.0", + "tokio 1.45.1", ] [[package]] name = "async-io" -version = "1.7.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5e18f61464ae81cde0a23e713ae8fd299580c54d697a35820cfd0625b8b0e07" +checksum = "1237c0ae75a0f3765f58910ff9cdd0a12eeb39ab2f4c7de23262f337f0aacbb3" dependencies = [ + "async-lock", + "cfg-if 1.0.0", "concurrent-queue", + "futures-io", "futures-lite", - "libc", - "log 0.4.17", - "once_cell", "parking", "polling", - "slab 0.4.6", - "socket2 0.4.10", - "waker-fn", - "winapi 0.3.9", + "rustix", + "slab 0.4.9", + "tracing", + "windows-sys 0.59.0", ] [[package]] name = "async-lock" -version = "2.5.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97a171d191782fba31bb902b14ad94e24a68145032b7eedf871ab0bc0d077b6" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" dependencies = [ - "event-listener", + "event-listener 5.4.0", + "event-listener-strategy", + "pin-project-lite", ] [[package]] name = "async-process" -version = "1.4.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf2c06e30a24e8c78a3987d07f0930edf76ef35e027e7bdb063fccafdad1f60c" +checksum = "cde3f4e40e6021d7acffc90095cbd6dc54cb593903d1de5832f435eb274b85dc" dependencies = [ + "async-channel 2.3.1", "async-io", + "async-lock", + "async-signal", + "async-task", "blocking", "cfg-if 1.0.0", - "event-listener", + "event-listener 5.4.0", "futures-lite", - "libc", - "once_cell", - "signal-hook", - "winapi 0.3.9", + "rustix", + "tracing", +] + +[[package]] +name = "async-signal" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7605a4e50d4b06df3898d5a70bf5fde51ed9059b0434b73105193bc27acce0d" +dependencies = [ + "async-io", + "async-lock", + "atomic-waker", + "cfg-if 1.0.0", + "futures-core", + "futures-io", + "rustix", + "signal-hook-registry", + "slab 0.4.9", + "windows-sys 0.59.0", ] [[package]] name = "async-std" -version = "1.12.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" +checksum = "730294c1c08c2e0f85759590518f6333f0d5a0a766a27d519c1b244c3dfd8a24" dependencies = [ "async-attributes", - "async-channel", + "async-channel 1.9.0", "async-global-executor", "async-io", "async-lock", "async-process", - "crossbeam-utils 0.8.10", + "crossbeam-utils 0.8.21", "futures-channel", "futures-core", "futures-io", "futures-lite", "gloo-timers", "kv-log-macro", - "log 0.4.17", + "log 0.4.27", "memchr", "once_cell", "pin-project-lite", "pin-utils", - "slab 0.4.6", + "slab 0.4.9", "wasm-bindgen-futures", ] @@ -184,12 +232,13 @@ dependencies = [ [[package]] name = "async-stream" -version = "0.3.3" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dad5c83079eae9969be7fadefe640a1c566901f05ff91ab221de4b6f68d9507e" +checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" dependencies = [ - "async-stream-impl 0.3.3", + "async-stream-impl 0.3.6", "futures-core", + "pin-project-lite", ] [[package]] @@ -198,44 +247,44 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25f9db3b38af870bf7e5cc649167533b493928e50744e2c30ae350230b414670" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 1.0.98", + "proc-macro2 1.0.95", + "quote 1.0.40", + "syn 1.0.109", ] [[package]] name = "async-stream-impl" -version = "0.3.3" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f203db73a71dfa2fb6dd22763990fa26f3d2625a6da2da900d23b87d26be27" +checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 1.0.98", + "proc-macro2 1.0.95", + "quote 1.0.40", + "syn 2.0.101", ] [[package]] name = "async-task" -version = "4.3.0" +version = "4.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a40729d2133846d9ed0ea60a8b9541bccddab49cd30f0715a1da672fe9a2524" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" -version = "0.1.82" +version = "0.1.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" +checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.77", + "proc-macro2 1.0.95", + "quote 1.0.40", + "syn 2.0.101", ] [[package]] name = "atomic-waker" -version = "1.0.0" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "065374052e7df7ee4047b1160cca5e1467a12351a40b3da123c870ba0b8eda2a" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "atomicwrites" @@ -265,28 +314,28 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dde43e75fd43e8a1bf86103336bc699aa8d17ad1be60c76c0bdfd4828e19b78" dependencies = [ - "autocfg 1.1.0", + "autocfg 1.4.0", ] [[package]] name = "autocfg" -version = "1.1.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "backtrace" -version = "0.3.66" +version = "0.3.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" +checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" dependencies = [ "addr2line", - "cc", "cfg-if 1.0.0", "libc", "miniz_oxide", "object", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] @@ -307,9 +356,9 @@ checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" [[package]] name = "base64" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" @@ -317,18 +366,6 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" -[[package]] -name = "bitflags" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32866f4d103c4e438b1db1158aa1b1a80ee078e5d77a59a2f906fd62a577389c" - -[[package]] -name = "bitflags" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dead7461c1127cf637931a1e50934eb6eee8bff2f74433ac7909e9afcee04a3" - [[package]] name = "bitflags" version = "1.3.2" @@ -337,9 +374,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" [[package]] name = "block-buffer" @@ -355,11 +392,11 @@ dependencies = [ [[package]] name = "block-buffer" -version = "0.10.2" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ - "generic-array 0.14.5", + "generic-array 0.14.7", ] [[package]] @@ -373,25 +410,25 @@ dependencies = [ [[package]] name = "blocking" -version = "1.2.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6ccb65d468978a086b69884437ded69a90faab3bbe6e67f242173ea728acccc" +checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" dependencies = [ - "async-channel", + "async-channel 2.3.1", "async-task", - "atomic-waker", - "fastrand", + "futures-io", "futures-lite", - "once_cell", + "piper", ] [[package]] name = "bstr" -version = "0.2.17" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" +checksum = "234113d19d0d7d613b40e86fb654acf958910802bcceab913a4f9e7cda03b1a4" dependencies = [ "memchr", + "serde 1.0.219", ] [[package]] @@ -406,9 +443,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.10.0" +version = "3.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" [[package]] name = "byte-tools" @@ -418,9 +455,9 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[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" @@ -435,15 +472,15 @@ dependencies = [ [[package]] name = "bytes" -version = "1.1.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "bytesize" -version = "1.1.0" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c58ec36aac5066d5ca17df51b3e70279f5670a72102f5752cb7e7c856adfc70" +checksum = "2e93abca9e28e0a1b9877922aacb20576e05d4679ffa78c3d6dc22a26a216659" [[package]] name = "c_linked_list" @@ -451,26 +488,14 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4964518bd3b4a8190e832886cdc0da9794f12e8e6c1613a9e90ff331c4c8724b" -[[package]] -name = "cache-padded" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c" - -[[package]] -name = "cast" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c24dab4283a142afa2fdca129b80ad2c6284e073930f964c3a1293c225ee39a" -dependencies = [ - "rustc_version 0.4.0", -] - [[package]] name = "cc" -version = "1.0.73" +version = "1.2.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" +checksum = "16595d3be041c03b09d08d0858631facccee9221e579704070e6e9e4915d3bc7" +dependencies = [ + "shlex", +] [[package]] name = "cfg-if" @@ -485,23 +510,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] -name = "chrono" -version = "0.4.19" +name = "cfg_aliases" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "chrono" +version = "0.4.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" dependencies = [ - "libc", - "num-integer", - "num-traits 0.2.15", - "time 0.1.44", - "winapi 0.3.9", + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits 0.2.19", + "wasm-bindgen", + "windows-link", ] [[package]] name = "chunked_transfer" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fff857943da45f546682664a79488be82e69e43c1a7a2307679ab9afb3a66d2e" +checksum = "6e4de3bc4ea267985becf712dc6d9eed8b04c953b3fcfb339ebc87acd9804901" [[package]] name = "clap" @@ -529,11 +561,11 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "1.2.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ed07550be01594c6026cff2a1d7fe9c8f683caa798e12b68694ac9e88286a3" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" dependencies = [ - "cache-padded", + "crossbeam-utils 0.8.21", ] [[package]] @@ -560,9 +592,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.2" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" dependencies = [ "libc", ] @@ -593,7 +625,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" dependencies = [ - "autocfg 1.1.0", + "autocfg 1.4.0", "cfg-if 0.1.10", "crossbeam-utils 0.7.2", "lazy_static", @@ -629,62 +661,57 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" dependencies = [ - "autocfg 1.1.0", + "autocfg 1.4.0", "cfg-if 0.1.10", "lazy_static", ] [[package]] name = "crossbeam-utils" -version = "0.8.10" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d82ee10ce34d7bc12c2122495e7593a9c41347ecdd64185af4ecf72cb1a7f83" -dependencies = [ - "cfg-if 1.0.0", - "once_cell", -] +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crypto-common" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ccfd8c0ee4cce11e45b3fd6f9d5e69e0cc62912aa6a0cb1bf4617b0eba5a12f" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "generic-array 0.14.5", + "generic-array 0.14.7", "typenum", ] [[package]] -name = "ctor" -version = "0.1.22" +name = "ctrlc" +version = "3.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f877be4f7c9f246b183111634f75baa039715e3f46ce860677d3b19a69fb229c" +checksum = "46f93780a459b7d656ef7f071fe699c4d3d2cb201c4b24d085b6ddc505276e73" dependencies = [ - "quote 1.0.37", - "syn 1.0.98", + "nix 0.30.1", + "windows-sys 0.59.0", ] [[package]] -name = "ctrlc" -version = "3.2.2" +name = "deranged" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b37feaa84e6861e00a1f5e5aa8da3ee56d605c9992d33e082786754828e20865" +checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" dependencies = [ - "nix 0.24.1", - "winapi 0.3.9", + "powerfmt", ] [[package]] name = "derive_more" -version = "0.99.17" +version = "0.99.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +checksum = "6edb4b64a43d977b8e99788fe3a04d483834fba1215a7e02caa415b626497f7f" dependencies = [ "convert_case", - "proc-macro2 1.0.86", - "quote 1.0.37", - "rustc_version 0.4.0", - "syn 1.0.98", + "proc-macro2 1.0.95", + "quote 1.0.40", + "rustc_version 0.4.1", + "syn 2.0.101", ] [[package]] @@ -698,11 +725,11 @@ dependencies = [ [[package]] name = "digest" -version = "0.10.3" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer 0.10.2", + "block-buffer 0.10.4", "crypto-common", ] @@ -736,6 +763,17 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2 1.0.95", + "quote 1.0.40", + "syn 2.0.101", +] + [[package]] name = "doc-comment" version = "0.3.3" @@ -744,35 +782,15 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" [[package]] name = "either" -version = "1.7.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f107b87b6afc2a64fd13cac55fe06d6c8859f12d4b14cbcdd2c67d0976781be" - -[[package]] -name = "embedded-graphics" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2e7ee289ac88cbeea6f749cd72c6eb4cdeb801f4ea26795aace97b9776a2db2" -dependencies = [ - "tinybmp", - "tinytga", -] - -[[package]] -name = "embedded-hal" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35949884794ad573cf46071e41c9b60efb0cb311e3ca01f7af807af1debc66ff" -dependencies = [ - "nb 0.1.3", - "void", -] +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] name = "encoding_rs" -version = "0.8.34" +version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" dependencies = [ "cfg-if 1.0.0", ] @@ -785,7 +803,7 @@ checksum = "aafcde04e90a5226a6443b7aabdb016ba2f8307c847d524724bd9b346dd1a2d3" dependencies = [ "atty", "humantime 1.3.0", - "log 0.4.17", + "log 0.4.27", "regex", "termcolor", ] @@ -797,30 +815,40 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3" dependencies = [ "atty", - "humantime 2.1.0", - "log 0.4.17", + "humantime 2.2.0", + "log 0.4.27", "regex", "termcolor", ] [[package]] name = "env_logger" -version = "0.9.0" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" +checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" dependencies = [ "atty", - "humantime 2.1.0", - "log 0.4.17", + "humantime 2.2.0", + "log 0.4.27", "regex", "termcolor", ] [[package]] name = "equivalent" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cea14ef9355e3beab063703aa9dab15afd25f0667c341310c1e5274bb1d0da18" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] [[package]] name = "error-chain" @@ -829,14 +857,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d2f06b9cac1506ece98fe3231e3cc9c4410ec3d5b1f24ae1c8946f0742cdefc" dependencies = [ "backtrace", - "version_check 0.9.4", + "version_check", ] [[package]] name = "event-listener" -version = "2.5.2" +version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77f3309417938f28bf8228fcff79a4a37103981e3e186d2ccd19c74b38f4eb71" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "event-listener" +version = "5.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3492acde4c3fc54c845eaab3eed8bd00c7a7d881f78bfc801e43a93dec1331ae" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" +dependencies = [ + "event-listener 5.4.0", + "pin-project-lite", +] [[package]] name = "fake-simd" @@ -846,23 +895,20 @@ checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" [[package]] name = "fastrand" -version = "1.7.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" -dependencies = [ - "instant", -] +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "filetime" -version = "0.2.17" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94a7bbaa59354bc20dd75b67f23e2797b4490e9d6928203fb105c79e448c86c" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" dependencies = [ "cfg-if 1.0.0", "libc", - "redox_syscall 0.2.13", - "windows-sys 0.36.1", + "libredox", + "windows-sys 0.59.0", ] [[package]] @@ -888,12 +934,11 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.0.1" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ - "matches", - "percent-encoding 2.1.0", + "percent-encoding 2.3.1", ] [[package]] @@ -936,9 +981,9 @@ checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" [[package]] name = "futures" -version = "0.3.21" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f73fe65f54d1e12b726f517d3e2135ca3125a437b6d998caf1962961f7172d9e" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -951,9 +996,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.21" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -961,9 +1006,9 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.21" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-cpupool" @@ -977,9 +1022,9 @@ dependencies = [ [[package]] name = "futures-executor" -version = "0.3.21" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9420b90cfa29e327d0429f19be13e7ddb68fa1cccb09d65e5706b8c7a749b8a6" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -989,53 +1034,51 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.21" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-lite" -version = "1.12.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" +checksum = "f5edaec856126859abb19ed65f39e90fea3a9574b9707f13539acf4abf7eb532" dependencies = [ "fastrand", "futures-core", "futures-io", - "memchr", "parking", "pin-project-lite", - "waker-fn", ] [[package]] name = "futures-macro" -version = "0.3.21" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 1.0.98", + "proc-macro2 1.0.95", + "quote 1.0.40", + "syn 2.0.101", ] [[package]] name = "futures-sink" -version = "0.3.21" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.21" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.21" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures 0.1.31", "futures-channel", @@ -1047,7 +1090,7 @@ dependencies = [ "memchr", "pin-project-lite", "pin-utils", - "slab 0.4.6", + "slab 0.4.9", ] [[package]] @@ -1067,12 +1110,12 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.5" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", - "version_check 0.9.4", + "version_check", ] [[package]] @@ -1110,9 +1153,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.7" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -1122,29 +1165,41 @@ dependencies = [ ] [[package]] -name = "gimli" -version = "0.26.1" +name = "getrandom" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", +] + +[[package]] +name = "gimli" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "globset" -version = "0.4.9" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a1e17342619edbc21a964c2afbeb6c820c6a2560032872f397bb97ea127bd0a" +checksum = "54a1028dfc5f5df5da8a56a73e6c153c9a9708ec57232470703592a3f18e49f5" dependencies = [ "aho-corasick", "bstr", - "fnv", - "log 0.4.17", - "regex", + "log 0.4.27", + "regex-automata", + "regex-syntax", ] [[package]] name = "gloo-timers" -version = "0.2.4" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fb7d06c1c8cc2a29bee7ec961009a0b2caa0793ee4900c2ffb348734ba1c8f9" +checksum = "bbb143cf96099802033e0d4f4963b19fd2e0b728bcf076cd9cf7f6634f092994" dependencies = [ "futures-channel", "futures-core", @@ -1155,18 +1210,18 @@ dependencies = [ [[package]] name = "golgi" version = "0.2.4" -source = "git+https://git.coopcloud.tech/golgi-ssb/golgi.git#9981b64bb23e1dbb95e31cfa1c545d23bb4f40d2" +source = "git+https://git.coopcloud.tech/golgi-ssb/golgi.git#15c5e77da642460f60fbe75564abaf113201cc59" dependencies = [ "async-std", - "async-stream 0.3.3", - "base64 0.13.0", - "futures 0.3.21", + "async-stream 0.3.6", + "base64 0.13.1", + "futures 0.3.31", "hex", - "kuska-handshake", + "kuska-handshake 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "kuska-sodiumoxide", "kuska-ssb", - "log 0.4.17", - "serde 1.0.209", + "log 0.4.27", + "serde 1.0.219", "serde_json", "sha2", ] @@ -1182,9 +1237,9 @@ dependencies = [ "fnv", "futures 0.1.31", "http 0.1.21", - "indexmap 1.9.1", - "log 0.4.17", - "slab 0.4.6", + "indexmap 1.9.3", + "log 0.4.27", + "slab 0.4.9", "string", "tokio-io", ] @@ -1195,30 +1250,30 @@ version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" dependencies = [ - "bytes 1.1.0", + "bytes 1.10.1", "fnv", "futures-core", "futures-sink", "futures-util", - "http 0.2.8", - "indexmap 2.5.0", - "slab 0.4.6", - "tokio 1.40.0", - "tokio-util 0.7.8", + "http 0.2.12", + "indexmap 2.9.0", + "slab 0.4.9", + "tokio 1.45.1", + "tokio-util 0.7.15", "tracing", ] [[package]] name = "hashbrown" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "607c8a29735385251a339424dd462993c0fed8fa09d378f259377df08c126022" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.5" +version = "0.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "84b26c544d002229e640969970a2e74021aadf6e2f96372b9c58eff97de08eb3" [[package]] name = "heck" @@ -1244,6 +1299,12 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +[[package]] +name = "hermit-abi" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f154ce46856750ed433c8649605bf7ed2de3bc35fd9d2a9f30cddd873c80cb08" + [[package]] name = "hex" version = "0.4.3" @@ -1263,13 +1324,13 @@ dependencies = [ [[package]] name = "http" -version = "0.2.8" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ - "bytes 1.1.0", + "bytes 1.10.1", "fnv", - "itoa 1.0.2", + "itoa 1.0.15", ] [[package]] @@ -1286,26 +1347,26 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ - "bytes 1.1.0", - "http 0.2.8", + "bytes 1.10.1", + "http 0.2.12", "pin-project-lite", ] [[package]] name = "httparse" -version = "1.9.4" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" [[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" @@ -1318,9 +1379,9 @@ dependencies = [ [[package]] name = "humantime" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" +checksum = "9b112acc8b3adf4b107a8ec20977da0273a8c386765a3ec0229bd500a1443f9f" [[package]] name = "hyper" @@ -1335,12 +1396,12 @@ dependencies = [ "httparse", "iovec", "language-tags", - "log 0.4.17", + "log 0.4.27", "mime", "net2", "percent-encoding 1.0.1", "relay", - "time 0.1.44", + "time 0.1.45", "tokio-core", "tokio-io", "tokio-proto", @@ -1364,10 +1425,10 @@ dependencies = [ "httparse", "iovec", "itoa 0.4.8", - "log 0.4.17", + "log 0.4.27", "net2", "rustc_version 0.2.3", - "time 0.1.44", + "time 0.1.45", "tokio 0.1.22", "tokio-buf", "tokio-executor", @@ -1381,26 +1442,26 @@ dependencies = [ [[package]] name = "hyper" -version = "0.14.30" +version = "0.14.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" +checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7" dependencies = [ - "bytes 1.1.0", + "bytes 1.10.1", "futures-channel", "futures-core", "futures-util", "h2 0.3.26", - "http 0.2.8", - "http-body 0.4.5", + "http 0.2.12", + "http-body 0.4.6", "httparse", "httpdate", - "itoa 1.0.2", + "itoa 1.0.15", "pin-project-lite", - "socket2 0.5.7", - "tokio 1.40.0", + "socket2", + "tokio 1.45.1", "tower-service", "tracing", - "want 0.3.0", + "want 0.3.1", ] [[package]] @@ -1409,23 +1470,121 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ - "bytes 1.1.0", - "hyper 0.14.30", + "bytes 1.10.1", + "hyper 0.14.32", "native-tls", - "tokio 1.40.0", + "tokio 1.45.1", "tokio-native-tls", ] [[package]] -name = "i2cdev" -version = "0.4.4" +name = "iana-time-zone" +version = "0.1.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c0eb3d9b6b02dc2508ee23439170004e44344bab9d53a490eb1f64c885b5003" +checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" dependencies = [ - "bitflags 1.3.2", - "byteorder", - "libc", - "nix 0.14.1", + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log 0.4.27", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "icu_collections" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" +dependencies = [ + "displaydoc", + "potential_utf", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec 1.15.0", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" + +[[package]] +name = "icu_properties" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "potential_utf", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" + +[[package]] +name = "icu_provider" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" +dependencies = [ + "displaydoc", + "icu_locale_core", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", ] [[package]] @@ -1441,40 +1600,50 @@ dependencies = [ [[package]] name = "idna" -version = "0.2.3" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", + "idna_adapter", + "smallvec 1.15.0", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +dependencies = [ + "icu_normalizer", + "icu_properties", ] [[package]] name = "indexmap" -version = "1.9.1" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ - "autocfg 1.1.0", - "hashbrown 0.12.2", + "autocfg 1.4.0", + "hashbrown 0.12.3", ] [[package]] name = "indexmap" -version = "2.5.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" dependencies = [ "equivalent", - "hashbrown 0.14.5", + "hashbrown 0.15.3", ] [[package]] name = "instant" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ "cfg-if 1.0.0", ] @@ -1490,9 +1659,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.9.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" [[package]] name = "itoa" @@ -1502,16 +1671,17 @@ checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" [[package]] name = "itoa" -version = "1.0.2" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "js-sys" -version = "0.3.58" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3fac17f7123a73ca62df411b1bf727ccc805daa070338fda671c86dac1bdc27" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" dependencies = [ + "once_cell", "wasm-bindgen", ] @@ -1524,8 +1694,8 @@ dependencies = [ "error-chain", "futures 0.1.31", "jsonrpc-core 8.0.1", - "log 0.4.17", - "serde 1.0.209", + "log 0.4.27", + "serde 1.0.219", "serde_json", ] @@ -1539,7 +1709,7 @@ dependencies = [ "futures 0.1.31", "hyper 0.11.27", "jsonrpc-client-core", - "log 0.4.17", + "log 0.4.27", "tokio-core", ] @@ -1550,11 +1720,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2b99d4207e2a04fb4581746903c2bb7eb376f88de9c699d0f3e10feeac0cd3a" dependencies = [ "derive_more", - "futures 0.3.21", + "futures 0.3.31", "jsonrpc-core 18.0.0", "jsonrpc-pubsub", - "log 0.4.17", - "serde 1.0.209", + "log 0.4.27", + "serde 1.0.219", "serde_json", "url 1.7.2", ] @@ -1567,7 +1737,7 @@ checksum = "ddf83704f4e79979a424d1082dd2c1e52683058056c9280efa19ac5f6bc9033c" dependencies = [ "futures 0.1.31", "log 0.3.9", - "serde 1.0.209", + "serde 1.0.219", "serde_derive", "serde_json", ] @@ -1579,8 +1749,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97b83fdc5e0218128d0d270f2f2e7a5ea716f3240c8518a58bc89e6716ba8581" dependencies = [ "futures 0.1.31", - "log 0.4.17", - "serde 1.0.209", + "log 0.4.27", + "serde 1.0.219", "serde_derive", "serde_json", ] @@ -1591,11 +1761,11 @@ version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14f7f76aef2d054868398427f6c54943cf3d1caa9a7ec7d0c38d69df97a965eb" dependencies = [ - "futures 0.3.21", + "futures 0.3.31", "futures-executor", "futures-util", - "log 0.4.17", - "serde 1.0.209", + "log 0.4.27", + "serde 1.0.219", "serde_derive", "serde_json", ] @@ -1606,7 +1776,7 @@ version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b51da17abecbdab3e3d4f26b01c5ec075e88d3abe3ab3b05dc9aa69392764ec0" dependencies = [ - "futures 0.3.21", + "futures 0.3.31", "jsonrpc-client-transports", ] @@ -1619,7 +1789,7 @@ dependencies = [ "hyper 0.12.36", "jsonrpc-core 11.0.0", "jsonrpc-server-utils 11.0.0", - "log 0.4.17", + "log 0.4.27", "net2", "unicase", ] @@ -1630,11 +1800,11 @@ version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1dea6e07251d9ce6a552abfb5d7ad6bc290a4596c8dcc3d795fae2bbdc1f3ff" dependencies = [ - "futures 0.3.21", - "hyper 0.14.30", + "futures 0.3.31", + "hyper 0.14.32", "jsonrpc-core 18.0.0", "jsonrpc-server-utils 18.0.0", - "log 0.4.17", + "log 0.4.27", "net2", "parking_lot 0.11.2", "unicase", @@ -1646,13 +1816,13 @@ version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240f87695e6c6f62fb37f05c02c04953cf68d6408b8c1c89de85c7a0125b1011" dependencies = [ - "futures 0.3.21", + "futures 0.3.31", "jsonrpc-core 18.0.0", "lazy_static", - "log 0.4.17", + "log 0.4.27", "parking_lot 0.11.2", "rand 0.7.3", - "serde 1.0.209", + "serde 1.0.219", ] [[package]] @@ -1665,7 +1835,7 @@ dependencies = [ "globset", "jsonrpc-core 11.0.0", "lazy_static", - "log 0.4.17", + "log 0.4.27", "num_cpus", "tokio 0.1.22", "tokio-codec", @@ -1678,13 +1848,13 @@ version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa4fdea130485b572c39a460d50888beb00afb3e35de23ccd7fad8ff19f0e0d4" dependencies = [ - "bytes 1.1.0", - "futures 0.3.21", + "bytes 1.10.1", + "futures 0.3.31", "globset", "jsonrpc-core 18.0.0", "lazy_static", - "log 0.4.17", - "tokio 1.40.0", + "log 0.4.27", + "tokio 1.45.1", "tokio-stream", "tokio-util 0.6.10", "unicase", @@ -1699,8 +1869,8 @@ dependencies = [ "jsonrpc-core 18.0.0", "jsonrpc-core-client", "jsonrpc-pubsub", - "log 0.4.17", - "serde 1.0.209", + "log 0.4.27", + "serde 1.0.219", "serde_json", ] @@ -1713,9 +1883,9 @@ dependencies = [ "async-trait", "jsonrpc_client_macro", "reqwest", - "serde 1.0.209", + "serde 1.0.219", "serde_json", - "url 2.3.0", + "url 2.5.4", ] [[package]] @@ -1724,15 +1894,18 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97c11e429f0eaa41fe659013680b459d2368d8f0a3e69dccfb7a35800b0dc27b" dependencies = [ - "quote 1.0.37", - "syn 1.0.98", + "quote 1.0.40", + "syn 1.0.109", ] [[package]] name = "keccak" -version = "0.1.2" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9b7d56ba4a8344d6be9729995e6b06f928af29998cdf79fe390cbf6b1fee838" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] [[package]] name = "kernel32-sys" @@ -1750,10 +1923,22 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e33da4b69f23c2ece0b3e729d079cebdc2c0206e493e42f510f500ad81c631d5" dependencies = [ - "futures 0.3.21", + "futures 0.3.31", "hex", "kuska-sodiumoxide", - "log 0.4.17", + "log 0.4.27", + "thiserror", +] + +[[package]] +name = "kuska-handshake" +version = "0.2.0" +source = "git+https://github.com/Kuska-ssb/handshake.git#750d214b58a11fdc1a7c0c5d8073f0d99237082f" +dependencies = [ + "futures 0.3.31", + "hex", + "kuska-sodiumoxide", + "log 0.4.27", "thiserror", ] @@ -1765,27 +1950,27 @@ checksum = "ae0f8eafdd240b722243787b51fdaf8df6693fb8621d0f7061cdba574214cf88" dependencies = [ "libc", "libsodium-sys", - "serde 1.0.209", + "serde 1.0.219", ] [[package]] name = "kuska-ssb" -version = "0.4.1" -source = "git+https://github.com/Kuska-ssb/ssb#315c7e31aa6255d5657665ce9357034113d2b552" +version = "0.4.3" +source = "git+https://github.com/Kuska-ssb/ssb#512669e4ff5fb698c44fcf04b2cc4a81b3482eb4" dependencies = [ "async-std", "async-stream 0.2.1", "base64 0.11.0", "dirs 2.0.2", - "futures 0.3.21", + "futures 0.3.31", "get_if_addrs", "hex", - "kuska-handshake", + "kuska-handshake 0.2.0 (git+https://github.com/Kuska-ssb/handshake.git)", "kuska-sodiumoxide", - "log 0.4.17", + "log 0.4.27", "once_cell", "regex", - "serde 1.0.209", + "serde 1.0.219", "serde_json", "thiserror", ] @@ -1796,7 +1981,7 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" dependencies = [ - "log 0.4.17", + "log 0.4.27", ] [[package]] @@ -1807,9 +1992,9 @@ checksum = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "lazycell" @@ -1819,9 +2004,20 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.158" +version = "0.2.172" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.9.1", + "libc", + "redox_syscall 0.5.12", +] [[package]] name = "libsodium-sys" @@ -1852,17 +2048,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] -name = "linux-embedded-hal" -version = "0.2.2" +name = "linux-raw-sys" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "795096c0eecb0622afb591c3e1a97b1ba046688a7689957b70b8eee9cac8fb84" -dependencies = [ - "cast", - "embedded-hal", - "i2cdev", - "spidev", - "sysfs_gpio", -] +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" + +[[package]] +name = "litemap" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" [[package]] name = "lock_api" @@ -1875,11 +2070,11 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.7" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ - "autocfg 1.1.0", + "autocfg 1.4.0", "scopeguard", ] @@ -1889,24 +2084,23 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" dependencies = [ - "log 0.4.17", + "log 0.4.27", ] [[package]] name = "log" -version = "0.4.17" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" dependencies = [ - "cfg-if 1.0.0", "value-bag", ] [[package]] name = "matches" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" +checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" [[package]] name = "maud" @@ -1924,9 +2118,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "423430ac467408136d7de93f2929debd8a7bc3e795c92476f45e259b158e3355" dependencies = [ "proc-macro-error", - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 1.0.98", + "proc-macro2 1.0.95", + "quote 1.0.40", + "syn 1.0.109", ] [[package]] @@ -1937,9 +2131,9 @@ checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" [[package]] name = "memchr" -version = "2.5.0" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memoffset" @@ -1947,20 +2141,20 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" dependencies = [ - "autocfg 1.1.0", + "autocfg 1.4.0", ] [[package]] name = "mime" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "mime_guess" -version = "2.0.4" +version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" dependencies = [ "mime", "unicase", @@ -1968,13 +2162,13 @@ dependencies = [ [[package]] name = "mini-internal" -version = "0.1.24" +version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60bbf2d78a45808eba478a0660f050bbce70dafc011e275cf00f6f8500a8be88" +checksum = "d6c74ab4f1a0c0ab045260ee4727b23c00cc17e5eff5095262d08eef8c3c8d49" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 1.0.98", + "proc-macro2 1.0.95", + "quote 1.0.40", + "syn 2.0.101", ] [[package]] @@ -1985,22 +2179,22 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniserde" -version = "0.1.24" +version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a89fcaf0064d3361240ae91a1f773d874302a62b4e6fdbd37b2888cb7d5aba3e" +checksum = "08ec68bf2ad170a53a6efa92c3df7187968d6e475fe7a935725868154074ca0f" dependencies = [ - "itoa 1.0.2", + "itoa 1.0.15", "mini-internal", "ryu", ] [[package]] name = "miniz_oxide" -version = "0.5.3" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc" +checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a" dependencies = [ - "adler", + "adler2", ] [[package]] @@ -2015,23 +2209,22 @@ dependencies = [ "iovec", "kernel32-sys", "libc", - "log 0.4.17", + "log 0.4.27", "miow", "net2", - "slab 0.4.6", + "slab 0.4.9", "winapi 0.2.8", ] [[package]] name = "mio" -version = "1.0.2" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" dependencies = [ - "hermit-abi 0.3.9", "libc", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -2041,9 +2234,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" dependencies = [ "lazycell", - "log 0.4.17", + "log 0.4.27", "mio 0.6.23", - "slab 0.4.6", + "slab 0.4.9", ] [[package]] @@ -2083,7 +2276,7 @@ checksum = "00dec633863867f29cb39df64a397cdf4a6354708ddd7759f70c7fb51c5f9182" dependencies = [ "buf_redux", "httparse", - "log 0.4.17", + "log 0.4.27", "mime", "mime_guess", "quick-error", @@ -2099,17 +2292,17 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "729eb334247daa1803e0a094d0a5c55711b85571179f5ec6e53eccfdf7008958" dependencies = [ - "getrandom 0.2.7", + "getrandom 0.2.16", ] [[package]] name = "native-tls" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" +checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" dependencies = [ "libc", - "log 0.4.17", + "log 0.4.27", "openssl", "openssl-probe", "openssl-sys", @@ -2119,21 +2312,6 @@ dependencies = [ "tempfile", ] -[[package]] -name = "nb" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "801d31da0513b6ec5214e9bf433a77966320625a37860f910be265be6e18d06f" -dependencies = [ - "nb 1.0.0", -] - -[[package]] -name = "nb" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "546c37ac5d9e56f55e73b677106873d9d9f5190605e41a856503623648488cae" - [[package]] name = "nest" version = "1.0.0" @@ -2141,9 +2319,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6cb122918e2e32ae9ee84b7b489dd20fec746cdad3e734095687fc2700da788a" dependencies = [ "atomicwrites", - "indexmap 1.9.1", + "indexmap 1.9.3", "lazy_static", - "log 0.4.17", + "log 0.4.27", "mkdirp", "objekt", "serde-hjson", @@ -2155,42 +2333,15 @@ dependencies = [ [[package]] name = "net2" -version = "0.2.37" +version = "0.2.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "391630d12b68002ae1e25e8f974306474966550ad82dac6886fb8910c19568ae" +checksum = "b13b648036a2339d06de780866fbdfda0dde886de7b3af2ddeba8b14f4ee34ac" dependencies = [ "cfg-if 0.1.10", "libc", "winapi 0.3.9", ] -[[package]] -name = "nix" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a7bb1da2be7da3cbffda73fc681d509ffd9e665af478d2bee1907cee0bc64b2" -dependencies = [ - "bitflags 0.4.0", - "cfg-if 0.1.10", - "libc", - "rustc_version 0.1.7", - "semver 0.1.20", - "void", -] - -[[package]] -name = "nix" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "becb657d662f1cd2ef38c7ad480ec6b8cf9e96b27adb543e594f9cf0f2e6065c" -dependencies = [ - "bitflags 1.3.2", - "cc", - "cfg-if 0.1.10", - "libc", - "void", -] - [[package]] name = "nix" version = "0.14.1" @@ -2206,54 +2357,31 @@ dependencies = [ [[package]] name = "nix" -version = "0.24.1" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f17df307904acd05aa8e32e97bb20f2a0df1728bbc2d771ae8f9a90463441e9" +checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.9.1", "cfg-if 1.0.0", + "cfg_aliases", "libc", ] [[package]] name = "nom" -version = "4.2.3" +version = "7.1.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.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af" -dependencies = [ - "memchr", - "version_check 0.9.4", -] - -[[package]] -name = "nom" -version = "7.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" dependencies = [ "memchr", "minimal-lexical", ] [[package]] -name = "num-integer" -version = "0.1.45" +name = "num-conv" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg 1.1.0", - "num-traits 0.2.15", -] +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" [[package]] name = "num-traits" @@ -2261,42 +2389,42 @@ version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" dependencies = [ - "num-traits 0.2.15", + "num-traits 0.2.19", ] [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ - "autocfg 1.1.0", + "autocfg 1.4.0", ] [[package]] name = "num_cpus" -version = "1.13.1" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.1.19", + "hermit-abi 0.3.9", "libc", ] [[package]] name = "num_threads" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" +checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" dependencies = [ "libc", ] [[package]] name = "object" -version = "0.29.0" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ "memchr", ] @@ -2309,9 +2437,9 @@ checksum = "2069a3ae3dad97a4ae47754e8f47e5d2f1fd32ab7ad8a84bb31d051faa59cc3c" [[package]] name = "once_cell" -version = "1.19.0" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "opaque-debug" @@ -2321,11 +2449,11 @@ checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" [[package]] name = "openssl" -version = "0.10.66" +version = "0.10.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" +checksum = "fedfea7d58a1f73118430a55da6a286e7b044961736ce96a16a17068ea25e5da" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.1", "cfg-if 1.0.0", "foreign-types", "libc", @@ -2340,34 +2468,44 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.77", + "proc-macro2 1.0.95", + "quote 1.0.40", + "syn 2.0.101", ] [[package]] name = "openssl-probe" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" + +[[package]] +name = "openssl-src" +version = "300.5.0+3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8ce546f549326b0e6052b649198487d91320875da901e7bd11a06d1ee3f9c2f" +dependencies = [ + "cc", +] [[package]] name = "openssl-sys" -version = "0.9.103" +version = "0.9.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" +checksum = "e145e1651e858e820e4860f7b9c5e169bc1d8ce1c86043be79fa7b7634821847" dependencies = [ "cc", "libc", + "openssl-src", "pkg-config", "vcpkg", ] [[package]] name = "parking" -version = "2.0.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" [[package]] name = "parking_lot" @@ -2376,7 +2514,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" dependencies = [ "lock_api 0.3.4", - "parking_lot_core 0.6.2", + "parking_lot_core 0.6.3", "rustc_version 0.2.3", ] @@ -2387,15 +2525,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" dependencies = [ "instant", - "lock_api 0.4.7", - "parking_lot_core 0.8.5", + "lock_api 0.4.12", + "parking_lot_core 0.8.6", ] [[package]] name = "parking_lot_core" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" +checksum = "bda66b810a62be75176a80873726630147a5ca780cd33921e0b5709033e66b0a" dependencies = [ "cfg-if 0.1.10", "cloudabi", @@ -2408,15 +2546,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" +checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" dependencies = [ "cfg-if 1.0.0", "instant", "libc", - "redox_syscall 0.2.13", - "smallvec 1.9.0", + "redox_syscall 0.2.16", + "smallvec 1.15.0", "winapi 0.3.9", ] @@ -2429,11 +2567,11 @@ dependencies = [ "env_logger 0.6.2", "golgi", "lazy_static", - "log 0.4.17", + "log 0.4.27", "peach-lib", "regex", "rpassword", - "serde 1.0.209", + "serde 1.0.219", "serde_json", "snafu 0.6.10", "structopt", @@ -2444,7 +2582,7 @@ name = "peach-dyndns-updater" version = "0.1.8" dependencies = [ "env_logger 0.6.2", - "log 0.4.17", + "log 0.4.27", "peach-lib", ] @@ -2452,11 +2590,11 @@ dependencies = [ name = "peach-jsonrpc-server" version = "0.1.0" dependencies = [ - "env_logger 0.9.0", + "env_logger 0.9.3", "jsonrpc-core 18.0.0", "jsonrpc-http-server 18.0.0", "jsonrpc-test", - "log 0.4.17", + "log 0.4.27", "peach-stats", "serde_json", ] @@ -2476,10 +2614,10 @@ dependencies = [ "jsonrpc_client", "kuska-ssb", "lazy_static", - "log 0.4.17", + "log 0.4.27", "nanorand", "regex", - "serde 1.0.209", + "serde 1.0.219", "serde_json", "serde_yaml", "sha3", @@ -2497,9 +2635,9 @@ dependencies = [ "jsonrpc-client-core", "jsonrpc-client-http", "jsonrpc-http-server 11.0.0", - "log 0.4.17", + "log 0.4.27", "peach-lib", - "serde 1.0.209", + "serde 1.0.219", "serde_json", "ws", ] @@ -2522,37 +2660,20 @@ version = "0.5.0" dependencies = [ "get_if_addrs", "miniserde", - "probes 0.4.1", + "probes 0.4.3", "regex", - "serde 1.0.209", + "serde 1.0.219", "wpactrl", ] -[[package]] -name = "peach-oled" -version = "0.1.4" -dependencies = [ - "embedded-graphics", - "env_logger 0.9.0", - "jsonrpc-core 18.0.0", - "jsonrpc-http-server 18.0.0", - "jsonrpc-test", - "linux-embedded-hal", - "log 0.4.17", - "nix 0.11.1", - "serde 1.0.209", - "ssd1306", - "tinybmp", -] - [[package]] name = "peach-stats" version = "0.3.1" dependencies = [ - "log 0.4.17", + "log 0.4.27", "miniserde", - "probes 0.4.1", - "serde 1.0.209", + "probes 0.4.3", + "serde 1.0.219", "systemstat", ] @@ -2561,15 +2682,16 @@ name = "peach-web" version = "0.6.21" dependencies = [ "async-std", - "base64 0.13.0", + "base64 0.13.1", "chrono", "dirs 4.0.0", "env_logger 0.8.4", - "futures 0.3.21", + "futures 0.3.31", "jsonrpc_client", "lazy_static", - "log 0.4.17", + "log 0.4.27", "maud", + "openssl", "peach-lib", "peach-network", "peach-stats", @@ -2590,15 +2712,15 @@ checksum = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" [[package]] name = "percent-encoding" -version = "2.1.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pin-utils" @@ -2607,29 +2729,60 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] -name = "pkg-config" -version = "0.3.25" +name = "piper" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" - -[[package]] -name = "polling" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "685404d509889fade3e86fe3a5803bca2ec09b0c0778d5ada6ec8bf7a8de5259" +checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" dependencies = [ - "cfg-if 1.0.0", - "libc", - "log 0.4.17", - "wepoll-ffi", - "winapi 0.3.9", + "atomic-waker", + "fastrand", + "futures-io", ] [[package]] -name = "ppv-lite86" -version = "0.2.16" +name = "pkg-config" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + +[[package]] +name = "polling" +version = "3.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b53a684391ad002dd6a596ceb6c74fd004fdce75f4be2e3f615068abbea5fd50" +dependencies = [ + "cfg-if 1.0.0", + "concurrent-queue", + "hermit-abi 0.5.1", + "pin-project-lite", + "rustix", + "tracing", + "windows-sys 0.59.0", +] + +[[package]] +name = "potential_utf" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5a7c30837279ca13e7c867e9e40053bc68740f988cb07f7ca6df43cc734b585" +dependencies = [ + "zerovec", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] [[package]] name = "probes" @@ -2638,17 +2791,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f77e66f6d6d898cbbd4a09c48fd3507cfc210b7c83055de02a38b5f7a1e6d216" dependencies = [ "libc", - "time 0.3.11", + "time 0.3.41", ] [[package]] name = "probes" -version = "0.4.1" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bb02a28631f195f482c19529ec82bec8e4ffa2d96159e67eb1ae9f5c5c902d8" +checksum = "95f51f2fd9bc207118506f0af99542cec488b2a40e5eb3b1473c1e89a31690f5" dependencies = [ "libc", - "time 0.1.44", ] [[package]] @@ -2658,10 +2810,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 1.0.98", - "version_check 0.9.4", + "proc-macro2 1.0.95", + "quote 1.0.40", + "syn 1.0.109", + "version_check", ] [[package]] @@ -2670,9 +2822,9 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", - "version_check 0.9.4", + "proc-macro2 1.0.95", + "quote 1.0.40", + "version_check", ] [[package]] @@ -2686,9 +2838,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ "unicode-ident", ] @@ -2710,13 +2862,19 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.37" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ - "proc-macro2 1.0.86", + "proc-macro2 1.0.95", ] +[[package]] +name = "r-efi" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" + [[package]] name = "rand" version = "0.3.23" @@ -2780,7 +2938,7 @@ checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha 0.3.1", - "rand_core 0.6.3", + "rand_core 0.6.4", ] [[package]] @@ -2810,7 +2968,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.3", + "rand_core 0.6.4", ] [[package]] @@ -2839,11 +2997,11 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.7", + "getrandom 0.2.16", ] [[package]] @@ -2940,29 +3098,50 @@ checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" [[package]] name = "redox_syscall" -version = "0.2.13" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ "bitflags 1.3.2", ] [[package]] -name = "redox_users" -version = "0.4.3" +name = "redox_syscall" +version = "0.5.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +checksum = "928fca9cf2aa042393a8325b9ead81d2f0df4cb12e1e24cef072922ccd99c5af" dependencies = [ - "getrandom 0.2.7", - "redox_syscall 0.2.13", + "bitflags 2.9.1", +] + +[[package]] +name = "redox_users" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +dependencies = [ + "getrandom 0.2.16", + "libredox", "thiserror", ] [[package]] name = "regex" -version = "1.6.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -2971,9 +3150,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.27" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "relay" @@ -3000,33 +3179,33 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ "base64 0.21.7", - "bytes 1.1.0", + "bytes 1.10.1", "encoding_rs", "futures-core", "futures-util", "h2 0.3.26", - "http 0.2.8", - "http-body 0.4.5", - "hyper 0.14.30", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.32", "hyper-tls", "ipnet", "js-sys", - "log 0.4.17", + "log 0.4.27", "mime", "native-tls", "once_cell", - "percent-encoding 2.1.0", + "percent-encoding 2.3.1", "pin-project-lite", "rustls-pemfile", - "serde 1.0.209", + "serde 1.0.219", "serde_json", "serde_urlencoded", "sync_wrapper", "system-configuration", - "tokio 1.40.0", + "tokio 1.45.1", "tokio-native-tls", "tower-service", - "url 2.3.0", + "url 2.5.4", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -3035,25 +3214,24 @@ dependencies = [ [[package]] name = "rouille" -version = "3.5.0" +version = "3.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18b2380c42510ef4a28b5f228a174c801e0dec590103e215e60812e2e2f34d05" +checksum = "3716fbf57fc1084d7a706adf4e445298d123e4a44294c4e8213caf1b85fcc921" dependencies = [ - "base64 0.13.0", + "base64 0.13.1", "chrono", "filetime", "multipart", - "num_cpus", - "percent-encoding 2.1.0", + "percent-encoding 2.3.1", "rand 0.8.5", - "serde 1.0.209", + "serde 1.0.219", "serde_derive", "serde_json", - "sha1", + "sha1_smol", "threadpool", - "time 0.3.11", + "time 0.3.41", "tiny_http", - "url 2.3.0", + "url 2.5.4", ] [[package]] @@ -3068,18 +3246,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.21" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" - -[[package]] -name = "rustc_version" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f5376ea5e30ce23c03eb77cbe4962b988deead10910c372b226388b594c084" -dependencies = [ - "semver 0.1.20", -] +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc_version" @@ -3092,11 +3261,24 @@ dependencies = [ [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 1.0.12", + "semver 1.0.26", +] + +[[package]] +name = "rustix" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" +dependencies = [ + "bitflags 2.9.1", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", ] [[package]] @@ -3109,10 +3291,16 @@ dependencies = [ ] [[package]] -name = "ryu" -version = "1.0.10" +name = "rustversion" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" +checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "safemem" @@ -3131,9 +3319,9 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.24" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" dependencies = [ "windows-sys 0.59.0", ] @@ -3146,9 +3334,9 @@ checksum = "332ffa32bf586782a3efaeb58f127980944bbc8c4d6913a86107ac2a5ab24b28" [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "security-framework" @@ -3156,7 +3344,7 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.1", "core-foundation", "core-foundation-sys", "libc", @@ -3165,20 +3353,14 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.1" +version = "2.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" +checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" dependencies = [ "core-foundation-sys", "libc", ] -[[package]] -name = "semver" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4f410fedcf71af0345d7607d246e7ad15faaadd49d240ee3b24e5dc21a820ac" - [[package]] name = "semver" version = "0.9.0" @@ -3190,9 +3372,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.12" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2333e6df6d6598f2b1974829f853c2b4c5f4a6e503c10af918081aa6f8564e1" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" [[package]] name = "semver-parser" @@ -3208,9 +3390,9 @@ checksum = "9dad3f759919b92c3068c696c15c3d17238234498bbdcc80f2c469606f948ac8" [[package]] name = "serde" -version = "1.0.209" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ "serde_derive", ] @@ -3230,25 +3412,26 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.209" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.77", + "proc-macro2 1.0.95", + "quote 1.0.40", + "syn 2.0.101", ] [[package]] name = "serde_json" -version = "1.0.82" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82c2c1fdcd807d1098552c5b9a36e425e42e9fbd7c6a37a8425f390f781f7fa7" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ - "indexmap 1.9.1", - "itoa 1.0.2", + "indexmap 2.9.0", + "itoa 1.0.15", + "memchr", "ryu", - "serde 1.0.209", + "serde 1.0.219", ] [[package]] @@ -3267,20 +3450,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ "form_urlencoded", - "itoa 1.0.2", + "itoa 1.0.15", "ryu", - "serde 1.0.209", + "serde 1.0.219", ] [[package]] name = "serde_yaml" -version = "0.8.25" +version = "0.8.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ec0091e1f5aa338283ce049bd9dfefd55e1f168ac233e85c1ffe0038fb48cbe" +checksum = "578a7433b776b56a35785ed5ce9a7e777ac0598aac5a6dd1b4b18a307c7fc71b" dependencies = [ - "indexmap 1.9.1", + "indexmap 1.9.3", "ryu", - "serde 1.0.209", + "serde 1.0.219", "yaml-rust", ] @@ -3296,57 +3479,44 @@ dependencies = [ "opaque-debug", ] -[[package]] -name = "sha1" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1da05c97445caa12d05e848c4a4fcbbea29e748ac28f7e80e9b010392063770" -dependencies = [ - "sha1_smol", -] - [[package]] name = "sha1_smol" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" +checksum = "bbfa15b3dddfee50a0fff136974b3e1bde555604ba463834a7eb7deb6417705d" [[package]] name = "sha2" -version = "0.10.2" +version = "0.10.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55deaec60f81eefe3cce0dc50bda92d6d8e88f2a27df7c5033b42afeb1ed2676" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" dependencies = [ "cfg-if 1.0.0", "cpufeatures", - "digest 0.10.3", + "digest 0.10.7", ] [[package]] name = "sha3" -version = "0.10.1" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "881bf8156c87b6301fc5ca6b27f11eeb2761224c7081e69b409d5a1951a70c86" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" dependencies = [ - "digest 0.10.3", + "digest 0.10.7", "keccak", ] [[package]] -name = "signal-hook" -version = "0.3.14" +name = "shlex" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a253b5e89e2698464fc26b545c9edceb338e18a89effeeecfea192c3025be29d" -dependencies = [ - "libc", - "signal-hook-registry", -] +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" -version = "1.4.0" +version = "1.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +checksum = "9203b8055f63a2a00e2f593bb0510367fe707d7ff1e5c872de2f537b339e5410" dependencies = [ "libc", ] @@ -3359,9 +3529,12 @@ checksum = "17b4fcaed89ab08ef143da37bc52adbcc04d4a69014f4c1208d6b51f0c47bc23" [[package]] name = "slab" -version = "0.4.6" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg 1.4.0", +] [[package]] name = "smallvec" @@ -3380,9 +3553,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.9.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" +checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9" [[package]] name = "snafu" @@ -3421,51 +3594,26 @@ version = "0.6.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1508efa03c362e23817f96cde18abed596a25219a8b2c66e8db33c03543d315b" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 1.0.98", + "proc-macro2 1.0.95", + "quote 1.0.40", + "syn 1.0.109", ] [[package]] name = "socket2" -version = "0.4.10" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" -dependencies = [ - "libc", - "winapi 0.3.9", -] - -[[package]] -name = "socket2" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" dependencies = [ "libc", "windows-sys 0.52.0", ] [[package]] -name = "spidev" -version = "0.3.0" +name = "stable_deref_trait" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ba01d3ef92a37e898fecac76cd3e1b33c999395e2d70787608d9678c4293e04" -dependencies = [ - "bitflags 0.3.3", - "libc", - "nix 0.6.0", -] - -[[package]] -name = "ssd1306" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d818022001ebca8cec28b230700660a3f6a027123c8193c5e76e9764d087f3" -dependencies = [ - "embedded-graphics", - "embedded-hal", -] +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "string" @@ -3501,9 +3649,9 @@ checksum = "dcb5ae327f9cc13b68763b5749770cb9e048a99bd9dfdfa58d0cf05d5f64afe0" dependencies = [ "heck", "proc-macro-error", - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 1.0.98", + "proc-macro2 1.0.95", + "quote 1.0.40", + "syn 1.0.109", ] [[package]] @@ -3519,23 +3667,23 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.98" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2 1.0.95", + "quote 1.0.40", "unicode-ident", ] [[package]] name = "syn" -version = "2.0.77" +version = "2.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "proc-macro2 1.0.95", + "quote 1.0.40", "unicode-ident", ] @@ -3546,12 +3694,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" [[package]] -name = "sysfs_gpio" -version = "0.5.4" +name = "synstructure" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24961a55846623d8e4f6cec38718945116fed8d6970336a7110710a07aa9b5d1" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ - "nix 0.14.1", + "proc-macro2 1.0.95", + "quote 1.0.40", + "syn 2.0.101", ] [[package]] @@ -3577,15 +3727,15 @@ dependencies = [ [[package]] name = "systemstat" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f5dc96f7634f46ac7e485b8c051f5b89ec8ee5cc023236dd12fe4ae2fb52f80" +checksum = "91a3cae256f8af5246c2daad51ff29c32de4b4b0b0222063920af445fa3e12ab" dependencies = [ "bytesize", "chrono", "lazy_static", "libc", - "nom 7.1.1", + "nom", "winapi 0.3.9", ] @@ -3607,16 +3757,15 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.3.0" +version = "3.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" dependencies = [ - "cfg-if 1.0.0", "fastrand", - "libc", - "redox_syscall 0.2.13", - "remove_dir_all", - "winapi 0.3.9", + "getrandom 0.3.3", + "once_cell", + "rustix", + "windows-sys 0.59.0", ] [[package]] @@ -3630,9 +3779,9 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.1.3" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ "winapi-util", ] @@ -3648,22 +3797,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.31" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.31" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 1.0.98", + "proc-macro2 1.0.95", + "quote 1.0.40", + "syn 2.0.101", ] [[package]] @@ -3681,16 +3830,16 @@ version = "0.0.1" dependencies = [ "anyhow", "async-std", - "serde 1.0.209", + "serde 1.0.219", "serde_json", "serde_yaml", ] [[package]] name = "time" -version = "0.1.44" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" dependencies = [ "libc", "wasi 0.10.0+wasi-snapshot-preview1", @@ -3699,59 +3848,61 @@ dependencies = [ [[package]] name = "time" -version = "0.3.11" +version = "0.3.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72c91f41dcb2f096c05f0873d667dceec1087ce5bcf984ec8ffb19acddbb3217" +checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" dependencies = [ + "deranged", "libc", + "num-conv", "num_threads", + "powerfmt", + "serde 1.0.219", + "time-core", ] +[[package]] +name = "time-core" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" + [[package]] name = "tiny_http" -version = "0.8.2" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce51b50006056f590c9b7c3808c3bd70f0d1101666629713866c227d6e58d39" +checksum = "389915df6413a2e74fb181895f933386023c71110878cd0825588928e64cdc82" dependencies = [ "ascii", - "chrono", "chunked_transfer", - "log 0.4.17", - "url 2.3.0", + "httpdate", + "log 0.4.27", ] [[package]] -name = "tinybmp" -version = "0.1.1" +name = "tinystr" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d12b7f8b271567d6d072c49dee16b22271aabfc473e2066e3353e5af0f5230" +checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" dependencies = [ - "nom 5.1.2", -] - -[[package]] -name = "tinytga" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc9485052c1f4b541d888f1d564dd9957671e0c21da9bca0c9824c1123e03f07" -dependencies = [ - "nom 4.2.3", + "displaydoc", + "zerovec", ] [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71" dependencies = [ "tinyvec_macros", ] [[package]] name = "tinyvec_macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" @@ -3779,16 +3930,16 @@ dependencies = [ [[package]] name = "tokio" -version = "1.40.0" +version = "1.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" +checksum = "75ef51a33ef1da925cea3e4eb122833cb377c61439ca401b770f54902b806779" dependencies = [ "backtrace", - "bytes 1.1.0", + "bytes 1.10.1", "libc", - "mio 1.0.2", + "mio 1.0.4", "pin-project-lite", - "socket2 0.5.7", + "socket2", "windows-sys 0.52.0", ] @@ -3823,7 +3974,7 @@ dependencies = [ "bytes 0.4.12", "futures 0.1.31", "iovec", - "log 0.4.17", + "log 0.4.27", "mio 0.6.23", "scoped-tls", "tokio 0.1.22", @@ -3872,7 +4023,7 @@ checksum = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674" dependencies = [ "bytes 0.4.12", "futures 0.1.31", - "log 0.4.17", + "log 0.4.27", ] [[package]] @@ -3882,7 +4033,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" dependencies = [ "native-tls", - "tokio 1.40.0", + "tokio 1.45.1", ] [[package]] @@ -3912,11 +4063,11 @@ dependencies = [ "crossbeam-utils 0.7.2", "futures 0.1.31", "lazy_static", - "log 0.4.17", + "log 0.4.27", "mio 0.6.23", "num_cpus", "parking_lot 0.9.0", - "slab 0.4.6", + "slab 0.4.9", "tokio-executor", "tokio-io", "tokio-sync", @@ -3933,13 +4084,13 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.9" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df54d54117d6fdc4e4fea40fe1e4e566b3505700e148a6827e59b34b0d2600d9" +checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" dependencies = [ "futures-core", "pin-project-lite", - "tokio 1.40.0", + "tokio 1.45.1", ] [[package]] @@ -3977,9 +4128,9 @@ dependencies = [ "crossbeam-utils 0.7.2", "futures 0.1.31", "lazy_static", - "log 0.4.17", + "log 0.4.27", "num_cpus", - "slab 0.4.6", + "slab 0.4.9", "tokio-executor", ] @@ -3991,7 +4142,7 @@ checksum = "93044f2d313c95ff1cb7809ce9a7a05735b012288a888b62d4434fd58c94f296" dependencies = [ "crossbeam-utils 0.7.2", "futures 0.1.31", - "slab 0.4.6", + "slab 0.4.9", "tokio-executor", ] @@ -4003,7 +4154,7 @@ checksum = "e2a0b10e610b39c38b031a2fcab08e4b82f16ece36504988dcbd81dbba650d82" dependencies = [ "bytes 0.4.12", "futures 0.1.31", - "log 0.4.17", + "log 0.4.27", "mio 0.6.23", "tokio-codec", "tokio-io", @@ -4020,7 +4171,7 @@ dependencies = [ "futures 0.1.31", "iovec", "libc", - "log 0.4.17", + "log 0.4.27", "mio 0.6.23", "mio-uds", "tokio-codec", @@ -4034,60 +4185,58 @@ version = "0.6.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507" dependencies = [ - "bytes 1.1.0", + "bytes 1.10.1", "futures-core", "futures-sink", - "log 0.4.17", + "log 0.4.27", "pin-project-lite", - "tokio 1.40.0", + "tokio 1.45.1", ] [[package]] name = "tokio-util" -version = "0.7.8" +version = "0.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +checksum = "66a539a9ad6d5d281510d5bd368c973d636c02dbf8a67300bfb6b950696ad7df" dependencies = [ - "bytes 1.1.0", + "bytes 1.10.1", "futures-core", "futures-sink", "pin-project-lite", - "tokio 1.40.0", - "tracing", + "tokio 1.45.1", ] [[package]] name = "toml" -version = "0.5.9" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" dependencies = [ - "indexmap 1.9.1", - "serde 1.0.209", + "indexmap 1.9.3", + "serde 1.0.219", ] [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.35" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a400e31aa60b9d44a52a8ee0343b5b18566b03a8321e0d321f695cf56e940160" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ - "cfg-if 1.0.0", "pin-project-lite", "tracing-core", ] [[package]] name = "tracing-core" -version = "0.1.28" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b7358be39f2f274f322d2aaed611acc57f382e8eb1e5b48cb9ae30933495ce7" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" dependencies = [ "once_cell", ] @@ -4100,9 +4249,9 @@ checksum = "ee2aa4715743892880f70885373966c83d73ef1b0838a664ef0c76fffd35e7c2" [[package]] name = "try-lock" -version = "0.2.3" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "twoway" @@ -4115,51 +4264,48 @@ dependencies = [ [[package]] name = "typenum" -version = "1.15.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" [[package]] name = "unicase" -version = "2.6.0" +version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" -dependencies = [ - "version_check 0.9.4", -] +checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" [[package]] name = "unicode-bidi" -version = "0.3.8" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" +checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" [[package]] name = "unicode-ident" -version = "1.0.1" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bd2fe26506023ed7b5e1e315add59d6f584c621d037f9368fea9cfb988f368c" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "unicode-normalization" -version = "0.1.21" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854cbdc4f7bc6ae19c820d44abdc3277ac3e1b2b93db20a636825d9322fb60e6" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" dependencies = [ "tinyvec", ] [[package]] name = "unicode-segmentation" -version = "1.9.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" [[package]] name = "unicode-width" -version = "0.1.9" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "unicode-xid" @@ -4180,13 +4326,13 @@ dependencies = [ [[package]] name = "url" -version = "2.3.0" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22fe195a4f217c25b25cb5058ced57059824a678474874038dc88d211bf508d3" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", - "idna 0.2.3", - "percent-encoding 2.1.0", + "idna 1.0.3", + "percent-encoding 2.3.1", ] [[package]] @@ -4196,14 +4342,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" [[package]] -name = "value-bag" -version = "1.0.0-alpha.9" +name = "utf8_iter" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2209b78d1249f7e6f3293657c9779fe31ced465df091bbd433a1cf88e916ec55" -dependencies = [ - "ctor", - "version_check 0.9.4", -] +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "value-bag" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "943ce29a8a743eb10d6082545d861b24f9d1b160b7d741e0f2cdf726bec909c5" [[package]] name = "vcpkg" @@ -4219,15 +4367,9 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] name = "version_check" -version = "0.1.5" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "vnstat_parse" @@ -4241,20 +4383,13 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" -[[package]] -name = "waker-fn" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" - [[package]] name = "walkdir" -version = "2.3.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", - "winapi 0.3.9", "winapi-util", ] @@ -4265,7 +4400,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a05d9d966753fa4b5c8db73fcab5eed4549cfe0e1e4e66911e5564a0085c35d1" dependencies = [ "futures 0.1.31", - "log 0.4.17", + "log 0.4.27", "try-lock 0.1.0", ] @@ -4276,18 +4411,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6395efa4784b027708f7451087e647ec73cc74f5d9bc2e418404248d679a230" dependencies = [ "futures 0.1.31", - "log 0.4.17", - "try-lock 0.2.3", + "log 0.4.27", + "try-lock 0.2.5", ] [[package]] name = "want" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" dependencies = [ - "log 0.4.17", - "try-lock 0.2.3", + "try-lock 0.2.5", ] [[package]] @@ -4309,88 +4443,93 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] -name = "wasm-bindgen" -version = "0.2.81" +name = "wasi" +version = "0.14.2+wasi-0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c53b543413a17a202f4be280a7e5c62a1c69345f5de525ee64f8cfdbc954994" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +dependencies = [ + "wit-bindgen-rt", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" dependencies = [ "cfg-if 1.0.0", + "once_cell", + "rustversion", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.81" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5491a68ab4500fa6b4d726bd67408630c3dbe9c4fe7bda16d5c82a1fd8c7340a" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" dependencies = [ "bumpalo", - "lazy_static", - "log 0.4.17", - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 1.0.98", + "log 0.4.27", + "proc-macro2 1.0.95", + "quote 1.0.40", + "syn 2.0.101", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.31" +version = "0.4.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de9a9cec1733468a8c657e57fa2413d2ae2c0129b95e87c5b72b8ace4d13f31f" +checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" dependencies = [ "cfg-if 1.0.0", "js-sys", + "once_cell", "wasm-bindgen", "web-sys", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.81" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c441e177922bc58f1e12c022624b6216378e5febc2f0533e41ba443d505b80aa" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" dependencies = [ - "quote 1.0.37", + "quote 1.0.40", "wasm-bindgen-macro-support", ] [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.81" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d94ac45fcf608c1f45ef53e748d35660f168490c10b23704c7779ab8f5c3048" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 1.0.98", + "proc-macro2 1.0.95", + "quote 1.0.40", + "syn 2.0.101", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.81" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a89911bd99e5f3659ec4acf9c4d93b0a90fe4a2a11f15328472058edc5261be" - -[[package]] -name = "web-sys" -version = "0.3.58" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fed94beee57daf8dd7d51f2b15dc2bcde92d7a72304cdf662a4371008b71b90" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" dependencies = [ - "js-sys", - "wasm-bindgen", + "unicode-ident", ] [[package]] -name = "wepoll-ffi" -version = "0.1.2" +name = "web-sys" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d743fdedc5c64377b5fc2bc036b01c7fd642205a0d96356034ae3404d49eb7fb" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" dependencies = [ - "cc", + "js-sys", + "wasm-bindgen", ] [[package]] @@ -4423,11 +4562,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "winapi 0.3.9", + "windows-sys 0.59.0", ] [[package]] @@ -4437,16 +4576,62 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] -name = "windows-sys" -version = "0.36.1" +name = "windows-core" +version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" dependencies = [ - "windows_aarch64_msvc 0.36.1", - "windows_i686_gnu 0.36.1", - "windows_i686_msvc 0.36.1", - "windows_x86_64_gnu 0.36.1", - "windows_x86_64_msvc 0.36.1", + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-implement" +version = "0.60.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" +dependencies = [ + "proc-macro2 1.0.95", + "quote 1.0.40", + "syn 2.0.101", +] + +[[package]] +name = "windows-interface" +version = "0.59.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" +dependencies = [ + "proc-macro2 1.0.95", + "quote 1.0.40", + "syn 2.0.101", +] + +[[package]] +name = "windows-link" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" + +[[package]] +name = "windows-result" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" +dependencies = [ + "windows-link", ] [[package]] @@ -4519,12 +4704,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" -[[package]] -name = "windows_aarch64_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" - [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -4537,12 +4716,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" -[[package]] -name = "windows_i686_gnu" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" - [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -4561,12 +4734,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" -[[package]] -name = "windows_i686_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" - [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -4579,12 +4746,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" -[[package]] -name = "windows_x86_64_gnu" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" - [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -4609,12 +4770,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" -[[package]] -name = "windows_x86_64_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" - [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -4637,15 +4792,30 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "wit-bindgen-rt" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" +dependencies = [ + "bitflags 2.9.1", +] + [[package]] name = "wpactrl" -version = "0.5.0" -source = "git+https://github.com/sauyon/wpa-ctrl-rs.git?branch=master#ef19ca4cccabde0078ebd6bfdfc9f6bf7cd89176" +version = "0.5.1" +source = "git+https://github.com/sauyon/wpa-ctrl-rs.git?branch=master#ba1259ca4f83e16022733c48e9acf567f153e2fe" dependencies = [ "libc", - "log 0.4.17", + "log 0.4.27", ] +[[package]] +name = "writeable" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" + [[package]] name = "ws" version = "0.8.1" @@ -4655,12 +4825,12 @@ dependencies = [ "byteorder", "bytes 0.4.12", "httparse", - "log 0.4.17", + "log 0.4.27", "mio 0.6.23", "mio-extras", "rand 0.6.5", "sha-1", - "slab 0.4.6", + "slab 0.4.9", "url 1.7.2", ] @@ -4676,12 +4846,9 @@ dependencies = [ [[package]] name = "xdg" -version = "2.4.1" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4583db5cbd4c4c0303df2d15af80f0539db703fa1c68802d4cbbd2dd0f88f6" -dependencies = [ - "dirs 4.0.0", -] +checksum = "213b7324336b53d2414b2db8537e56544d981803139155afa84f76eeebb7a546" [[package]] name = "yaml-rust" @@ -4691,3 +4858,101 @@ checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" dependencies = [ "linked-hash-map 0.5.6", ] + +[[package]] +name = "yoke" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" +dependencies = [ + "serde 1.0.219", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" +dependencies = [ + "proc-macro2 1.0.95", + "quote 1.0.40", + "syn 2.0.101", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1702d9583232ddb9174e01bb7c15a2ab8fb1bc6f227aa1233858c351a3ba0cb" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28a6e20d751156648aa063f3800b706ee209a32c0b4d9f24be3d980b01be55ef" +dependencies = [ + "proc-macro2 1.0.95", + "quote 1.0.40", + "syn 2.0.101", +] + +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2 1.0.95", + "quote 1.0.40", + "syn 2.0.101", + "synstructure", +] + +[[package]] +name = "zerotrie" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a05eb080e015ba39cc9e23bbe5e7fb04d5fb040350f99f34e338d5fdd294428" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" +dependencies = [ + "proc-macro2 1.0.95", + "quote 1.0.40", + "syn 2.0.101", +] diff --git a/Cargo.toml b/Cargo.toml index e7da647..31eaec1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [workspace] members = [ - "peach-oled", +# "peach-oled", "peach-lib", "peach-config", "peach-network", diff --git a/peach-web/Cargo.toml b/peach-web/Cargo.toml index 9616bc6..22f7000 100644 --- a/peach-web/Cargo.toml +++ b/peach-web/Cargo.toml @@ -53,3 +53,4 @@ jsonrpc_client = { version = "0.7", features = ["macros", "reqwest"] } reqwest = "0.11.24" urlencoding = "2.1.3" rpassword = "5.0" +openssl = { version = '0.10', features = ["vendored"] } diff --git a/run-tilde-sbot.sh b/run-tilde-sbot.sh index 7a17c10..d2af9b8 100755 --- a/run-tilde-sbot.sh +++ b/run-tilde-sbot.sh @@ -31,13 +31,14 @@ echo "ARGS: $ARGS" [ -n "$NETWORK_KEY" ] && echo "NETWORK_KEY: $NETWORK_KEY" [ -n "$DATABASE_DIRECTORY" ] && echo "DATABASE_DIRECTORY: $DATABASE_DIRECTORY" -CMD="\"$TILDEFRIENDS_PATH\" run" -[ -n "$ARGS" ] && CMD="$CMD -a \"$ARGS\"" -[ -n "$NETWORK_KEY" ] && CMD="$CMD -k \"$NETWORK_KEY\"" -[ -n "$DATABASE_DIRECTORY" ] && CMD="$CMD -d \"$DATABASE_DIRECTORY/db.sqlite\"" +# build and exec the command +CMD=("$TILDEFRIENDS_PATH" run) +[ -n "$ARGS" ] && CMD+=(-a "$ARGS") +[ -n "$NETWORK_KEY" ] && CMD+=(-k "$NETWORK_KEY") +[ -n "$DATABASE_DIRECTORY" ] && CMD+=(-d "$DATABASE_DIRECTORY/db.sqlite") echo "Running command:" -echo "$CMD" +printf "%q " "${CMD[@]}" +echo -# Execute the command -eval $CMD \ No newline at end of file +exec "${CMD[@]}" -- 2.47.2