diff --git a/Cargo.lock b/Cargo.lock index 90ce926..d91633a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -48,7 +48,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3203e79f4dd9bdda415ed03cf14dae5a2bf775c683a00f94e9cd1faf0f596e5" dependencies = [ "quote 1.0.18", - "syn 1.0.94", + "syn 1.0.96", ] [[package]] @@ -78,25 +78,24 @@ dependencies = [ [[package]] name = "async-global-executor" -version = "2.0.4" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c290043c9a95b05d45e952fb6383c67bcb61471f60cfa21e890dba6654234f43" +checksum = "fd8b508d585e01084059b60f06ade4cb7415cd2e4084b71dd1cb44e7d3fb9880" dependencies = [ "async-channel", "async-executor", "async-io", - "async-mutex", + "async-lock", "blocking", "futures-lite", - "num_cpus", "once_cell", ] [[package]] name = "async-io" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a811e6a479f2439f0c04038796b5cfb3d2ad56c230e0f2d3f7b04d68cfee607b" +checksum = "e5e18f61464ae81cde0a23e713ae8fd299580c54d697a35820cfd0625b8b0e07" dependencies = [ "concurrent-queue", "futures-lite", @@ -120,15 +119,6 @@ dependencies = [ "event-listener", ] -[[package]] -name = "async-mutex" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479db852db25d9dbf6204e6cb6253698f175c15726470f78af0d918e99d6156e" -dependencies = [ - "event-listener", -] - [[package]] name = "async-process" version = "1.4.0" @@ -201,9 +191,9 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25f9db3b38af870bf7e5cc649167533b493928e50744e2c30ae350230b414670" dependencies = [ - "proc-macro2 1.0.38", + "proc-macro2 1.0.39", "quote 1.0.18", - "syn 1.0.94", + "syn 1.0.96", ] [[package]] @@ -212,9 +202,9 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10f203db73a71dfa2fb6dd22763990fa26f3d2625a6da2da900d23b87d26be27" dependencies = [ - "proc-macro2 1.0.38", + "proc-macro2 1.0.39", "quote 1.0.18", - "syn 1.0.94", + "syn 1.0.96", ] [[package]] @@ -386,9 +376,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.9.1" +version = "3.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" +checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3" [[package]] name = "byte-tools" @@ -473,7 +463,7 @@ dependencies = [ "libc", "num-integer", "num-traits 0.2.15", - "time 0.1.43", + "time 0.1.44", "winapi 0.3.9", ] @@ -563,7 +553,7 @@ dependencies = [ "lazy_static", "maybe-uninit", "memoffset", - "scopeguard 1.1.0", + "scopeguard", ] [[package]] @@ -625,7 +615,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f877be4f7c9f246b183111634f75baa039715e3f46ce860677d3b19a69fb229c" dependencies = [ "quote 1.0.18", - "syn 1.0.94", + "syn 1.0.96", ] [[package]] @@ -645,10 +635,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ "convert_case", - "proc-macro2 1.0.38", + "proc-macro2 1.0.39", "quote 1.0.18", "rustc_version 0.4.0", - "syn 1.0.94", + "syn 1.0.96", ] [[package]] @@ -787,28 +777,6 @@ version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77f3309417938f28bf8228fcff79a4a37103981e3e186d2ccd19c74b38f4eb71" -[[package]] -name = "failure" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" -dependencies = [ - "backtrace", - "failure_derive", -] - -[[package]] -name = "failure_derive" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" -dependencies = [ - "proc-macro2 1.0.38", - "quote 1.0.18", - "syn 1.0.94", - "synstructure", -] - [[package]] name = "fake-simd" version = "0.1.2" @@ -970,9 +938,9 @@ version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" dependencies = [ - "proc-macro2 1.0.38", + "proc-macro2 1.0.39", "quote 1.0.18", - "syn 1.0.94", + "syn 1.0.96", ] [[package]] @@ -1066,14 +1034,14 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad" +checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" dependencies = [ "cfg-if 1.0.0", "js-sys", "libc", - "wasi 0.10.2+wasi-snapshot-preview1", + "wasi 0.11.0+wasi-snapshot-preview1", "wasm-bindgen", ] @@ -1085,9 +1053,9 @@ checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" [[package]] name = "globset" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10463d9ff00a2a068db14231982f5132edebad0d7660cd956a1c30292dbcbfbd" +checksum = "0a1e17342619edbc21a964c2afbeb6c820c6a2560032872f397bb97ea127bd0a" dependencies = [ "aho-corasick", "bstr", @@ -1110,8 +1078,8 @@ dependencies = [ [[package]] name = "golgi" -version = "0.1.1" -source = "git+https://git.coopcloud.tech/golgi-ssb/golgi.git#0aa616d92b005b38359aa34bf448f3f1f47e8e6a" +version = "0.1.4" +source = "git+https://git.coopcloud.tech/golgi-ssb/golgi.git#ca4c1114ddf328b818144c5a1af0187b1357e9be" dependencies = [ "async-std", "async-stream 0.3.3", @@ -1121,23 +1089,12 @@ dependencies = [ "kuska-handshake", "kuska-sodiumoxide", "kuska-ssb", + "log 0.4.17", "serde 1.0.137", "serde_json", "sha2", ] -[[package]] -name = "gpio-cdev" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04d50743080fbae298c55f0b28dd5ea4b513c53cddeddace6cbdd31db7dda981" -dependencies = [ - "bitflags 1.3.2", - "error-chain", - "libc", - "nix 0.11.1", -] - [[package]] name = "h2" version = "0.1.26" @@ -1199,13 +1156,13 @@ dependencies = [ [[package]] name = "http" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff8670570af52249509a86f5e3e18a08c60b177071826898fde8997cf5f6bfbb" +checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" dependencies = [ "bytes 1.1.0", "fnv", - "itoa 1.0.1", + "itoa 1.0.2", ] [[package]] @@ -1222,12 +1179,12 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ff4f84919677303da5f147645dbea6b1881f368d03ac84e1dc09031ebd7b2c6" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ "bytes 1.1.0", - "http 0.2.7", + "http 0.2.8", "pin-project-lite", ] @@ -1276,7 +1233,7 @@ dependencies = [ "net2", "percent-encoding 1.0.1", "relay", - "time 0.1.43", + "time 0.1.44", "tokio-core", "tokio-io", "tokio-proto", @@ -1303,7 +1260,7 @@ dependencies = [ "log 0.4.17", "net2", "rustc_version 0.2.3", - "time 0.1.43", + "time 0.1.44", "tokio 0.1.22", "tokio-buf", "tokio-executor", @@ -1317,22 +1274,22 @@ dependencies = [ [[package]] name = "hyper" -version = "0.14.18" +version = "0.14.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b26ae0a80afebe130861d90abf98e3814a4f28a4c6ffeb5ab8ebb2be311e0ef2" +checksum = "42dc3c131584288d375f2d07f822b0cb012d8c6fb899a5b9fdb3cb7eb9b6004f" dependencies = [ "bytes 1.1.0", "futures-channel", "futures-core", "futures-util", - "http 0.2.7", - "http-body 0.4.4", + "http 0.2.8", + "http-body 0.4.5", "httparse", "httpdate", - "itoa 1.0.1", + "itoa 1.0.2", "pin-project-lite", "socket2", - "tokio 1.18.2", + "tokio 1.19.2", "tower-service", "tracing", "want 0.3.0", @@ -1374,9 +1331,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.8.1" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f647032dfaa1f8b6dc29bd3edb7bbef4861b8b8007ebb118d6db284fd59f6ee" +checksum = "e6012d540c5baa3589337a98ce73408de9b5a25ec9fc2c6fd6be8f0d39e0ca5a" dependencies = [ "autocfg 1.1.0", "hashbrown", @@ -1408,15 +1365,15 @@ checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" [[package]] name = "itoa" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" +checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" [[package]] name = "js-sys" -version = "0.3.57" +version = "0.3.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "671a26f820db17c2a2750743f1dd03bafd15b98c9f30c7c2628c024c05d73397" +checksum = "c3fac17f7123a73ca62df411b1bf727ccc805daa070338fda671c86dac1bdc27" dependencies = [ "wasm-bindgen", ] @@ -1458,7 +1415,7 @@ dependencies = [ "derive_more", "futures 0.3.21", "jsonrpc-core 18.0.0", - "jsonrpc-pubsub 18.0.0", + "jsonrpc-pubsub", "log 0.4.17", "serde 1.0.137", "serde_json", @@ -1506,20 +1463,6 @@ dependencies = [ "serde_json", ] -[[package]] -name = "jsonrpc-core-client" -version = "11.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c889ca27072f038496a62f38356e8f827acf194d7276030120265362b2974eab" -dependencies = [ - "failure", - "futures 0.1.31", - "jsonrpc-core 11.0.0", - "log 0.4.17", - "serde 1.0.137", - "serde_json", -] - [[package]] name = "jsonrpc-core-client" version = "18.0.0" @@ -1551,7 +1494,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1dea6e07251d9ce6a552abfb5d7ad6bc290a4596c8dcc3d795fae2bbdc1f3ff" dependencies = [ "futures 0.3.21", - "hyper 0.14.18", + "hyper 0.14.19", "jsonrpc-core 18.0.0", "jsonrpc-server-utils 18.0.0", "log 0.4.17", @@ -1560,18 +1503,6 @@ dependencies = [ "unicase", ] -[[package]] -name = "jsonrpc-pubsub" -version = "11.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c233c4570183a45f7bde14cd7d23446d6c236de6df9442e53a60951adae9fd34" -dependencies = [ - "jsonrpc-core 11.0.0", - "log 0.4.17", - "parking_lot 0.7.1", - "serde 1.0.137", -] - [[package]] name = "jsonrpc-pubsub" version = "18.0.0" @@ -1616,26 +1547,12 @@ dependencies = [ "jsonrpc-core 18.0.0", "lazy_static", "log 0.4.17", - "tokio 1.18.2", + "tokio 1.19.2", "tokio-stream", "tokio-util", "unicase", ] -[[package]] -name = "jsonrpc-test" -version = "11.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0aedad254cd8faba2bf8d1fe00c52fe9d9944f1a8c3f789916b68a61a3414c87" -dependencies = [ - "jsonrpc-core 11.0.0", - "jsonrpc-core-client 11.0.0", - "jsonrpc-pubsub 11.0.0", - "log 0.4.17", - "serde 1.0.137", - "serde_json", -] - [[package]] name = "jsonrpc-test" version = "18.0.0" @@ -1643,32 +1560,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be4347ecf335735719f555eff3f119e198049ddb22eec4d60dd7b4d63a3b10a6" dependencies = [ "jsonrpc-core 18.0.0", - "jsonrpc-core-client 18.0.0", - "jsonrpc-pubsub 18.0.0", + "jsonrpc-core-client", + "jsonrpc-pubsub", "log 0.4.17", "serde 1.0.137", "serde_json", ] -[[package]] -name = "jsonrpc-ws-server" -version = "11.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e72d8f524c7afd11d9c71614d1f814ee1c46377869933ce42d559d6973922f79" -dependencies = [ - "jsonrpc-core 11.0.0", - "jsonrpc-server-utils 11.0.0", - "log 0.4.17", - "parking_lot 0.7.1", - "slab 0.4.6", - "ws", -] - [[package]] name = "keccak" -version = "0.1.0" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" +checksum = "f9b7d56ba4a8344d6be9729995e6b06f928af29998cdf79fe390cbf6b1fee838" [[package]] name = "kernel32-sys" @@ -1706,8 +1609,8 @@ dependencies = [ [[package]] name = "kuska-ssb" -version = "0.4.0" -source = "git+https://github.com/Kuska-ssb/ssb#fb7062de606e7c9cae8dd4df402a122db46c1b77" +version = "0.4.1" +source = "git+https://github.com/Kuska-ssb/ssb#6b0457a8ddd0e86a8f84cffac2b5cb835723822f" dependencies = [ "async-std", "async-stream 0.2.1", @@ -1755,9 +1658,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.125" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5916d2ae698f6de9bfb891ad7a8d65c09d232dc58cc4ac433c7da3b2fd84bc2b" +checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" [[package]] name = "libsodium-sys" @@ -1800,23 +1703,13 @@ dependencies = [ "sysfs_gpio", ] -[[package]] -name = "lock_api" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62ebf1391f6acad60e5c8b43706dde4582df75c06698ab44511d15016bc2442c" -dependencies = [ - "owning_ref", - "scopeguard 0.3.3", -] - [[package]] name = "lock_api" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" dependencies = [ - "scopeguard 1.1.0", + "scopeguard", ] [[package]] @@ -1826,7 +1719,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" dependencies = [ "autocfg 1.1.0", - "scopeguard 1.1.0", + "scopeguard", ] [[package]] @@ -1870,9 +1763,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "423430ac467408136d7de93f2929debd8a7bc3e795c92476f45e259b158e3355" dependencies = [ "proc-macro-error", - "proc-macro2 1.0.38", + "proc-macro2 1.0.39", "quote 1.0.18", - "syn 1.0.94", + "syn 1.0.96", ] [[package]] @@ -1918,9 +1811,9 @@ version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60bbf2d78a45808eba478a0660f050bbce70dafc011e275cf00f6f8500a8be88" dependencies = [ - "proc-macro2 1.0.38", + "proc-macro2 1.0.39", "quote 1.0.18", - "syn 1.0.94", + "syn 1.0.96", ] [[package]] @@ -1935,16 +1828,16 @@ version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a89fcaf0064d3361240ae91a1f773d874302a62b4e6fdbd37b2888cb7d5aba3e" dependencies = [ - "itoa 1.0.1", + "itoa 1.0.2", "mini-internal", "ryu", ] [[package]] name = "miniz_oxide" -version = "0.5.1" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2b29bd4bc3f33391105ebee3589c19197c4271e3e5a9ec9bfe8127eeff8f082" +checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc" dependencies = [ "adler", ] @@ -2045,7 +1938,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "729eb334247daa1803e0a094d0a5c55711b85571179f5ec6e53eccfdf7008958" dependencies = [ - "getrandom 0.2.6", + "getrandom 0.2.7", ] [[package]] @@ -2238,9 +2131,9 @@ checksum = "2069a3ae3dad97a4ae47754e8f47e5d2f1fd32ab7ad8a84bb31d051faa59cc3c" [[package]] name = "once_cell" -version = "1.10.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9" +checksum = "7709cef83f0c1f58f666e746a08b21e0085f7440fa6a29cc194d68aac97a4225" [[package]] name = "opaque-debug" @@ -2248,31 +2141,12 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" -[[package]] -name = "owning_ref" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff55baddef9e4ad00f88b6c743a2a8062d4c6ade126c2a528644b8e444d52ce" -dependencies = [ - "stable_deref_trait", -] - [[package]] name = "parking" version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" -[[package]] -name = "parking_lot" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab41b4aed082705d1056416ae4468b6ea99d52599ecf3169b00088d43113e337" -dependencies = [ - "lock_api 0.1.5", - "parking_lot_core 0.4.0", -] - [[package]] name = "parking_lot" version = "0.9.0" @@ -2295,19 +2169,6 @@ dependencies = [ "parking_lot_core 0.8.5", ] -[[package]] -name = "parking_lot_core" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94c8c7923936b28d546dfd14d4472eaf34c99b14e1c973a32b3e6d4eb04298c9" -dependencies = [ - "libc", - "rand 0.6.5", - "rustc_version 0.2.3", - "smallvec 0.6.14", - "winapi 0.3.9", -] - [[package]] name = "parking_lot_core" version = "0.6.2" @@ -2337,21 +2198,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "peach-buttons" -version = "0.1.3" -dependencies = [ - "crossbeam-channel", - "env_logger 0.6.2", - "gpio-cdev", - "jsonrpc-core 11.0.0", - "jsonrpc-pubsub 11.0.0", - "jsonrpc-test 11.0.0", - "jsonrpc-ws-server", - "log 0.4.17", - "snafu 0.4.4", -] - [[package]] name = "peach-config" version = "0.1.25" @@ -2385,7 +2231,7 @@ dependencies = [ "env_logger 0.9.0", "jsonrpc-core 18.0.0", "jsonrpc-http-server 18.0.0", - "jsonrpc-test 18.0.0", + "jsonrpc-test", "log 0.4.17", "peach-stats", "serde_json", @@ -2393,7 +2239,7 @@ dependencies = [ [[package]] name = "peach-lib" -version = "1.3.3" +version = "1.3.4" dependencies = [ "async-std", "chrono", @@ -2463,7 +2309,7 @@ dependencies = [ "env_logger 0.9.0", "jsonrpc-core 18.0.0", "jsonrpc-http-server 18.0.0", - "jsonrpc-test 18.0.0", + "jsonrpc-test", "linux-embedded-hal", "log 0.4.17", "nix 0.11.1", @@ -2485,7 +2331,7 @@ dependencies = [ [[package]] name = "peach-web" -version = "0.6.13" +version = "0.6.15" dependencies = [ "async-std", "base64 0.13.0", @@ -2559,7 +2405,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f77e66f6d6d898cbbd4a09c48fd3507cfc210b7c83055de02a38b5f7a1e6d216" dependencies = [ "libc", - "time 0.1.43", + "time 0.3.9", ] [[package]] @@ -2569,7 +2415,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4bb02a28631f195f482c19529ec82bec8e4ffa2d96159e67eb1ae9f5c5c902d8" dependencies = [ "libc", - "time 0.1.43", + "time 0.1.44", ] [[package]] @@ -2579,9 +2425,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", - "proc-macro2 1.0.38", + "proc-macro2 1.0.39", "quote 1.0.18", - "syn 1.0.94", + "syn 1.0.96", "version_check 0.9.4", ] @@ -2591,7 +2437,7 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "proc-macro2 1.0.38", + "proc-macro2 1.0.39", "quote 1.0.18", "version_check 0.9.4", ] @@ -2602,16 +2448,16 @@ version = "0.4.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" dependencies = [ - "unicode-xid 0.1.0", + "unicode-xid", ] [[package]] name = "proc-macro2" -version = "1.0.38" +version = "1.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9027b48e9d4c9175fa2218adf3557f91c1137021739951d4932f5f8268ac48aa" +checksum = "c54b25569025b7fc9651de43004ae593a75ad88543b17178aa5e1b9c4f15f56f" dependencies = [ - "unicode-xid 0.2.3", + "unicode-ident", ] [[package]] @@ -2635,7 +2481,7 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" dependencies = [ - "proc-macro2 1.0.38", + "proc-macro2 1.0.39", ] [[package]] @@ -2764,7 +2610,7 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" dependencies = [ - "getrandom 0.2.6", + "getrandom 0.2.7", ] [[package]] @@ -2874,16 +2720,16 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ - "getrandom 0.2.6", + "getrandom 0.2.7", "redox_syscall 0.2.13", "thiserror", ] [[package]] name = "regex" -version = "1.5.5" +version = "1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286" +checksum = "d83f127d94bdbcda4c8cc2e50f6f84f4b611f69c902699ca385a39c3a75f9ff1" dependencies = [ "aho-corasick", "memchr", @@ -2892,9 +2738,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.25" +version = "0.6.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" +checksum = "49b3de9ec5dc0a3417da371aab17d729997c15010e7fd24ff707773a33bddb64" [[package]] name = "relay" @@ -2977,14 +2823,14 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.9", + "semver 1.0.10", ] [[package]] name = "ryu" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" +checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" [[package]] name = "safemem" @@ -3007,12 +2853,6 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "332ffa32bf586782a3efaeb58f127980944bbc8c4d6913a86107ac2a5ab24b28" -[[package]] -name = "scopeguard" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27" - [[package]] name = "scopeguard" version = "1.1.0" @@ -3036,9 +2876,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cb243bdfdb5936c8dc3c45762a19d12ab4550cdc753bc247637d4ec35a040fd" +checksum = "a41d061efea015927ac527063765e73601444cdc344ba855bc7bd44578b25e1c" [[package]] name = "semver-parser" @@ -3080,9 +2920,9 @@ version = "1.0.137" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f26faba0c3959972377d3b2d306ee9f71faee9714294e41bb777f83f88578be" dependencies = [ - "proc-macro2 1.0.38", + "proc-macro2 1.0.39", "quote 1.0.18", - "syn 1.0.94", + "syn 1.0.96", ] [[package]] @@ -3092,7 +2932,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b7ce2b32a1aed03c558dc61a5cd328f15aff2dbc17daad8fb8af04d2100e15c" dependencies = [ "indexmap", - "itoa 1.0.1", + "itoa 1.0.2", "ryu", "serde 1.0.137", ] @@ -3168,9 +3008,9 @@ dependencies = [ [[package]] name = "signal-hook" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "647c97df271007dcea485bb74ffdb57f2e683f1306c854f468a0c244badabf2d" +checksum = "a253b5e89e2698464fc26b545c9edceb338e18a89effeeecfea192c3025be29d" dependencies = [ "libc", "signal-hook-registry", @@ -3228,17 +3068,6 @@ dependencies = [ "snafu-derive 0.2.3", ] -[[package]] -name = "snafu" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b028158eb06caa8345bee10cccfb25fa632beccf0ef5308832b4fd4b78a7db48" -dependencies = [ - "backtrace", - "doc-comment", - "snafu-derive 0.4.4", -] - [[package]] name = "snafu" version = "0.6.10" @@ -3260,26 +3089,15 @@ dependencies = [ "syn 0.15.44", ] -[[package]] -name = "snafu-derive" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf50aaef500c248a590e2696e8bf8c7620ca2235b9bb90a70363d82dd1abec6a" -dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "syn 0.15.44", -] - [[package]] name = "snafu-derive" version = "0.6.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1508efa03c362e23817f96cde18abed596a25219a8b2c66e8db33c03543d315b" dependencies = [ - "proc-macro2 1.0.38", + "proc-macro2 1.0.39", "quote 1.0.18", - "syn 1.0.94", + "syn 1.0.96", ] [[package]] @@ -3313,12 +3131,6 @@ dependencies = [ "embedded-hal", ] -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - [[package]] name = "string" version = "0.2.1" @@ -3353,9 +3165,9 @@ checksum = "dcb5ae327f9cc13b68763b5749770cb9e048a99bd9dfdfa58d0cf05d5f64afe0" dependencies = [ "heck", "proc-macro-error", - "proc-macro2 1.0.38", + "proc-macro2 1.0.39", "quote 1.0.18", - "syn 1.0.94", + "syn 1.0.96", ] [[package]] @@ -3366,30 +3178,18 @@ checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" dependencies = [ "proc-macro2 0.4.30", "quote 0.6.13", - "unicode-xid 0.1.0", + "unicode-xid", ] [[package]] name = "syn" -version = "1.0.94" +version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a07e33e919ebcd69113d5be0e4d70c5707004ff45188910106854f38b960df4a" +checksum = "0748dd251e24453cb8717f0354206b91557e4ec8703673a4b30208f2abaf1ebf" dependencies = [ - "proc-macro2 1.0.38", + "proc-macro2 1.0.39", "quote 1.0.18", - "unicode-xid 0.2.3", -] - -[[package]] -name = "synstructure" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" -dependencies = [ - "proc-macro2 1.0.38", - "quote 1.0.18", - "syn 1.0.94", - "unicode-xid 0.2.3", + "unicode-ident", ] [[package]] @@ -3403,9 +3203,9 @@ dependencies = [ [[package]] name = "systemstat" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8862adb0fd5f4c5707b0eeb6c2ec7610bd7a8bf5e069150bd6dde04a7f40ebf7" +checksum = "5f5dc96f7634f46ac7e485b8c051f5b89ec8ee5cc023236dd12fe4ae2fb52f80" dependencies = [ "bytesize", "chrono", @@ -3487,9 +3287,9 @@ version = "1.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" dependencies = [ - "proc-macro2 1.0.38", + "proc-macro2 1.0.39", "quote 1.0.18", - "syn 1.0.94", + "syn 1.0.96", ] [[package]] @@ -3503,11 +3303,12 @@ dependencies = [ [[package]] name = "time" -version = "0.1.43" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" +checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" dependencies = [ "libc", + "wasi 0.10.0+wasi-snapshot-preview1", "winapi 0.3.9", ] @@ -3593,9 +3394,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.18.2" +version = "1.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4903bf0427cf68dddd5aa6a93220756f8be0c34fcfa9f5e6191e103e15a31395" +checksum = "c51a52ed6686dd62c320f9b89299e9dfb46f730c7a48e635c19f21d116cb1439" dependencies = [ "bytes 1.1.0", "libc", @@ -3739,13 +3540,13 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50145484efff8818b5ccd256697f36863f587da82cf8b409c53adf1e840798e3" +checksum = "df54d54117d6fdc4e4fea40fe1e4e566b3505700e148a6827e59b34b0d2600d9" dependencies = [ "futures-core", "pin-project-lite", - "tokio 1.18.2", + "tokio 1.19.2", ] [[package]] @@ -3836,16 +3637,16 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.6.9" +version = "0.6.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e99e1983e5d376cd8eb4b66604d2e99e79f5bd988c3055891dcd8c9e2604cc0" +checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507" dependencies = [ "bytes 1.1.0", "futures-core", "futures-sink", "log 0.4.17", "pin-project-lite", - "tokio 1.18.2", + "tokio 1.19.2", ] [[package]] @@ -3866,9 +3667,9 @@ checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" [[package]] name = "tracing" -version = "0.1.34" +version = "0.1.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d0ecdcb44a79f0fe9844f0c4f33a342cbcbb5117de8001e6ba0dc2351327d09" +checksum = "a400e31aa60b9d44a52a8ee0343b5b18566b03a8321e0d321f695cf56e940160" dependencies = [ "cfg-if 1.0.0", "pin-project-lite", @@ -3877,11 +3678,11 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f54c8ca710e81886d498c2fd3331b56c93aa248d49de2222ad2742247c60072f" +checksum = "7709595b8878a4965ce5e87ebf880a7d39c9afc6837721b21a5a816a8117d921" dependencies = [ - "lazy_static", + "once_cell", ] [[package]] @@ -3926,6 +3727,12 @@ version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" +[[package]] +name = "unicode-ident" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bd2fe26506023ed7b5e1e315add59d6f584c621d037f9368fea9cfb988f368c" + [[package]] name = "unicode-normalization" version = "0.1.19" @@ -3953,12 +3760,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" -[[package]] -name = "unicode-xid" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "957e51f3646910546462e67d5f7599b9e4fb8acdd304b087a6494730f9eebf04" - [[package]] name = "url" version = "1.7.2" @@ -4073,9 +3874,9 @@ checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" +version = "0.10.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" [[package]] name = "wasi" @@ -4085,9 +3886,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.80" +version = "0.2.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27370197c907c55e3f1a9fbe26f44e937fe6451368324e009cba39e139dc08ad" +checksum = "7c53b543413a17a202f4be280a7e5c62a1c69345f5de525ee64f8cfdbc954994" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -4095,24 +3896,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.80" +version = "0.2.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53e04185bfa3a779273da532f5025e33398409573f348985af9a1cbf3774d3f4" +checksum = "5491a68ab4500fa6b4d726bd67408630c3dbe9c4fe7bda16d5c82a1fd8c7340a" dependencies = [ "bumpalo", "lazy_static", "log 0.4.17", - "proc-macro2 1.0.38", + "proc-macro2 1.0.39", "quote 1.0.18", - "syn 1.0.94", + "syn 1.0.96", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.30" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f741de44b75e14c35df886aff5f1eb73aa114fa5d4d00dcd37b5e01259bf3b2" +checksum = "de9a9cec1733468a8c657e57fa2413d2ae2c0129b95e87c5b72b8ace4d13f31f" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -4122,9 +3923,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.80" +version = "0.2.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17cae7ff784d7e83a2fe7611cfe766ecf034111b49deb850a3dc7699c08251f5" +checksum = "c441e177922bc58f1e12c022624b6216378e5febc2f0533e41ba443d505b80aa" dependencies = [ "quote 1.0.18", "wasm-bindgen-macro-support", @@ -4132,28 +3933,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.80" +version = "0.2.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99ec0dc7a4756fffc231aab1b9f2f578d23cd391390ab27f952ae0c9b3ece20b" +checksum = "7d94ac45fcf608c1f45ef53e748d35660f168490c10b23704c7779ab8f5c3048" dependencies = [ - "proc-macro2 1.0.38", + "proc-macro2 1.0.39", "quote 1.0.18", - "syn 1.0.94", + "syn 1.0.96", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.80" +version = "0.2.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d554b7f530dee5964d9a9468d95c1f8b8acae4f282807e7d27d4b03099a46744" +checksum = "6a89911bd99e5f3659ec4acf9c4d93b0a90fe4a2a11f15328472058edc5261be" [[package]] name = "web-sys" -version = "0.3.57" +version = "0.3.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b17e741662c70c8bd24ac5c5b18de314a2c26c32bf8346ee1e6f53de919c283" +checksum = "2fed94beee57daf8dd7d51f2b15dc2bcde92d7a72304cdf662a4371008b71b90" dependencies = [ "js-sys", "wasm-bindgen", diff --git a/Cargo.toml b/Cargo.toml index 25471e2..0317b43 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,5 @@ [workspace] - members = [ - "peach-buttons", "peach-oled", "peach-lib", "peach-config", @@ -13,3 +11,4 @@ members = [ "peach-jsonrpc-server", "peach-dyndns-updater" ] + diff --git a/peach-config/src/set_permissions.rs b/peach-config/src/set_permissions.rs index 355e24f..c50ffd0 100644 --- a/peach-config/src/set_permissions.rs +++ b/peach-config/src/set_permissions.rs @@ -1,17 +1,17 @@ use lazy_static::lazy_static; -use peach_lib::config_manager::get_config_value; +use peach_lib::config_manager; use crate::error::PeachConfigError; use crate::utils::cmd; lazy_static! { - pub static ref PEACH_CONFIGDIR: String = get_config_value("PEACH_CONFIGDIR") + pub static ref PEACH_CONFIGDIR: String = config_manager::get_config_value("PEACH_CONFIGDIR") .expect("Failed to load config value for PEACH_CONFIGDIR"); - pub static ref PEACH_WEBDIR: String = - get_config_value("PEACH_WEBDIR").expect("Failed to load config value for PEACH_WEBDIR"); - pub static ref PEACH_HOMEDIR: String = - get_config_value("PEACH_HOMEDIR").expect("Failed to load config value for PEACH_HOMEDIR"); + pub static ref PEACH_WEBDIR: String = config_manager::get_config_value("PEACH_WEBDIR") + .expect("Failed to load config value for PEACH_WEBDIR"); + pub static ref PEACH_HOMEDIR: String = config_manager::get_config_value("PEACH_HOMEDIR") + .expect("Failed to load config value for PEACH_HOMEDIR"); } /// Utility function to set correct file permissions on the PeachCloud device. diff --git a/peach-lib/Cargo.toml b/peach-lib/Cargo.toml index 028c61a..ee14e50 100644 --- a/peach-lib/Cargo.toml +++ b/peach-lib/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "peach-lib" -version = "1.3.3" +version = "1.3.4" authors = ["Andrew Reid "] edition = "2018" diff --git a/peach-lib/src/config_manager.rs b/peach-lib/src/config_manager.rs index 11ae424..49d6d38 100644 --- a/peach-lib/src/config_manager.rs +++ b/peach-lib/src/config_manager.rs @@ -60,6 +60,7 @@ pub fn get_peach_config_defaults() -> HashMap { ("ADMIN_PASSWORD_HASH", "47"), ("TEMPORARY_PASSWORD_HASH", ""), ("GO_SBOT_DATADIR", "/home/peach/.ssb-go"), + ("GO_SBOT_SERVICE", "go-sbot.service"), ("PEACH_CONFIGDIR", "/var/lib/peachcloud"), ("PEACH_HOMEDIR", "/home/peach"), ("PEACH_WEBDIR", "/usr/share/peach-web"), @@ -131,7 +132,10 @@ pub fn save_peach_config_to_disc( peach_config: HashMap, ) -> Result, PeachError> { // use a file lock to avoid race conditions while saving config - let mut lock = LockFile::open(&*LOCK_FILE_PATH)?; + let mut lock = LockFile::open(&*LOCK_FILE_PATH).map_err(|source| PeachError::Read { + source, + path: LOCK_FILE_PATH.to_string(), + })?; lock.lock()?; // first convert Hashmap to BTreeMap (so that keys are saved in deterministic alphabetical order) diff --git a/peach-lib/src/sbot.rs b/peach-lib/src/sbot.rs index 880479d..e2ddba7 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 crate::config_manager::get_config_value; +use crate::config_manager; use serde::{Deserialize, Serialize}; use crate::error::PeachError; @@ -67,7 +67,7 @@ impl SbotStatus { // because non-privileged users are able to run systemctl show let info_output = Command::new("systemctl") .arg("show") - .arg("go-sbot.service") + .arg(config_manager::get_config_value("GO_SBOT_SERVICE")?) .arg("--no-page") .output()?; @@ -89,7 +89,7 @@ impl SbotStatus { // because non-privileged users are able to run systemctl status let status_output = Command::new("systemctl") .arg("status") - .arg("go-sbot.service") + .arg(config_manager::get_config_value("GO_SBOT_SERVICE")?) .output()?; let service_status = str::from_utf8(&status_output.stdout)?; @@ -128,7 +128,10 @@ impl SbotStatus { } // get path to blobstore - let blobstore_path = format!("{}/blobs/sha256", get_config_value("GO_SBOT_DATADIR")?); + let blobstore_path = format!( + "{}/blobs/sha256", + config_manager::get_config_value("GO_SBOT_DATADIR")? + ); // determine the size of the blobstore directory in bytes status.blobstore = dir_size(blobstore_path).ok(); @@ -199,9 +202,11 @@ impl Default for SbotConfig { impl SbotConfig { /// Read the go-sbot `config.toml` file from file and deserialize into `SbotConfig`. pub fn read() -> Result { - // determine path of user's home directory - let mut config_path = dirs::home_dir().ok_or(PeachError::HomeDir)?; - config_path.push(".ssb-go/config.toml"); + // determine path of user's go-sbot config.toml + let config_path = format!( + "{}/config.toml", + config_manager::get_config_value("GO_SBOT_DATADIR")? + ); let config_contents = fs::read_to_string(config_path)?; @@ -217,8 +222,11 @@ impl SbotConfig { // convert the provided `SbotConfig` instance to a string let config_string = toml::to_string(&config)?; - // determine path of user's home directory - let config_path = format!("{}/config.toml", get_config_value("GO_SBOT_DATADIR")?); + // determine path of user's go-sbot config.toml + let config_path = format!( + "{}/config.toml", + config_manager::get_config_value("GO_SBOT_DATADIR")? + ); // open config file for writing let mut file = File::create(config_path)?; diff --git a/peach-web/src/routes/authentication/forgot.rs b/peach-web/src/routes/authentication/forgot.rs index d61f90d..84ff7df 100644 --- a/peach-web/src/routes/authentication/forgot.rs +++ b/peach-web/src/routes/authentication/forgot.rs @@ -30,7 +30,7 @@ pub fn build_template(request: &Request) -> PreEscaped { form id="sendPasswordReset" action="/auth/temporary" method="post" { div id="buttonDiv" { input class="button button-primary center" style="margin-top: 1rem;" type="submit" value="Send Temporary Password" title="Send temporary password to Scuttlebutt admin(s)"; - a href="/auth/reset_password" class="button button-primary center" title="Set a new password using the temporary password" { + a href="/auth/reset" class="button button-primary center" title="Set a new password using the temporary password" { "Set New Password" } } diff --git a/peach-web/src/utils/sbot.rs b/peach-web/src/utils/sbot.rs index 5c9bc79..98ab413 100644 --- a/peach-web/src/utils/sbot.rs +++ b/peach-web/src/utils/sbot.rs @@ -3,7 +3,6 @@ use std::{ error::Error, fs, fs::File, - io, io::prelude::*, path::Path, process::{Command, Output}, @@ -16,6 +15,7 @@ use golgi::{ api::friends::RelationshipQuery, blobs, messages::SsbMessageValue, sbot::Keystore, Sbot, }; use log::debug; +use peach_lib::config_manager; use peach_lib::sbot::SbotConfig; use rouille::input::post::BufferedFile; use temporary::Directory; @@ -25,12 +25,13 @@ use crate::{error::PeachWebError, utils::sbot}; // SBOT HELPER FUNCTIONS /// Executes a systemctl command for the go-sbot.service process. -pub fn systemctl_sbot_cmd(cmd: &str) -> io::Result { - Command::new("sudo") +pub fn systemctl_sbot_cmd(cmd: &str) -> Result { + let output = Command::new("sudo") .arg("systemctl") .arg(cmd) - .arg("go-sbot.service") - .output() + .arg(config_manager::get_config_value("GO_SBOT_SERVICE")?) + .output()?; + Ok(output) } /// Executes a systemctl stop command followed by start command. @@ -68,15 +69,18 @@ pub async fn init_sbot_with_config( ) -> 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::GoSbot, Some(ip_port), None).await? + Sbot::init(Keystore::CustomGoSbot(key_path), Some(ip_port), None).await? } - None => Sbot::init(Keystore::GoSbot, None, None).await?, + None => Sbot::init(Keystore::CustomGoSbot(key_path), None, None).await?, }; - Ok(sbot_client) }