From 695960dfc9d6f86c7a832c849766950ee75e0c91 Mon Sep 17 00:00:00 2001 From: amokfa <124960413+amokfa@users.noreply.github.com> Date: Fri, 4 Aug 2023 18:21:27 +0530 Subject: [PATCH 1/3] fix: logcat handle encoding errors, duplicate field (#250) * remove duplicate timestamp fields * ignore encoding errors when reading logcat input * address code review --- uplink/src/collector/logcat.rs | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/uplink/src/collector/logcat.rs b/uplink/src/collector/logcat.rs index 3d1e1fe6c..19ed4bdda 100644 --- a/uplink/src/collector/logcat.rs +++ b/uplink/src/collector/logcat.rs @@ -4,6 +4,7 @@ use std::io::{BufRead, BufReader}; use std::process::{Command, Stdio}; use std::sync::{Arc, Mutex}; use std::time::Duration; +use std::process::ChildStdout; use crate::{base::clock, ActionResponse, ActionRoute, BridgeTx, Payload}; @@ -133,14 +134,18 @@ impl LogEntry { } pub fn to_payload(&self, sequence: u32) -> anyhow::Result { - let payload = serde_json::to_value(self)?; - Ok(Payload { stream: "logs".to_string(), device_id: None, sequence, - timestamp: self.timestamp, - payload, + timestamp: self.log_timestamp, + payload: serde_json::json!({ + "level": self.level, + "log_timestamp": self.log_timestamp, + "tag": self.tag, + "message": self.message, + "line": self.line + }), }) } } @@ -238,19 +243,13 @@ impl Logcat { logger.kill().unwrap(); break; } - let mut next_line = String::new(); - match buf_stdout.read_line(&mut next_line) { - Ok(0) => { - log::info!("logger output has ended"); - break; - } + let next_line = match read_line_lossy(&mut buf_stdout) { + Ok(l) => l, Err(e) => { - log::error!("error while reading logger output: {}", e); + log::error!("Logcat error: {e}"); break; } - _ => (), }; - let next_line = next_line.trim(); let entry = match LogEntry::from_string(next_line) { Ok(entry) => entry, @@ -273,3 +272,12 @@ impl Logcat { }); } } + +fn read_line_lossy(reader: &mut BufReader) -> Result { + let mut buf = Vec::with_capacity(256); + match reader.read_until(b'\n', &mut buf) { + Err(e) => Err(format!("Error when reading from logcat: {e}")), + Ok(0) => Err("logcat output has ended".to_string()), + Ok(_) => Ok(String::from_utf8_lossy(buf.as_slice()).to_string()), + } +} \ No newline at end of file From f2f6f46435e3ec54ae24dd1698bb29e6926c3bda Mon Sep 17 00:00:00 2001 From: Devdutt Shenoi Date: Sat, 5 Aug 2023 16:54:10 +0530 Subject: [PATCH 2/3] test: verify tunshell action pass-through (#263) --- uplink/src/base/bridge/mod.rs | 161 +++++++++++++++++++++++++++++++++- 1 file changed, 160 insertions(+), 1 deletion(-) diff --git a/uplink/src/base/bridge/mod.rs b/uplink/src/base/bridge/mod.rs index f1244df7f..46fdfbddf 100644 --- a/uplink/src/base/bridge/mod.rs +++ b/uplink/src/base/bridge/mod.rs @@ -538,7 +538,7 @@ mod tests { Action, ActionResponse, Config, }; - use super::{stream::Stream, Bridge, BridgeTx, Package}; + use super::*; fn default_config() -> Config { Config { @@ -790,4 +790,163 @@ mod tests { let status = recv_response(&package_rx); assert!(status.is_completed()); } + + #[tokio::test] + async fn accept_regular_actions_during_tunshell() { + let config = default_config(); + let (bridge_tx, actions_tx, package_rx) = start_bridge(Arc::new(config)); + let bridge_tx_clone = bridge_tx.clone(); + + std::thread::spawn(move || loop { + let rt = Runtime::new().unwrap(); + let test_route = ActionRoute { name: TUNSHELL_ACTION.to_string(), timeout: 30 }; + let action_rx = rt.block_on(bridge_tx.register_action_route(test_route)); + let action = action_rx.recv().unwrap(); + assert_eq!(action.action_id, "1"); + let response = ActionResponse::progress(&action.action_id, "Launched", 0); + rt.block_on(bridge_tx.send_action_response(response)); + std::thread::sleep(Duration::from_secs(3)); + let response = ActionResponse::success(&action.action_id); + rt.block_on(bridge_tx.send_action_response(response)); + }); + + std::thread::spawn(move || loop { + let rt = Runtime::new().unwrap(); + let test_route = ActionRoute { name: "test".to_string(), timeout: 30 }; + let action_rx = rt.block_on(bridge_tx_clone.register_action_route(test_route)); + let action = action_rx.recv().unwrap(); + assert_eq!(action.action_id, "2"); + let response = ActionResponse::progress(&action.action_id, "Running", 0); + rt.block_on(bridge_tx_clone.send_action_response(response)); + std::thread::sleep(Duration::from_secs(1)); + let response = ActionResponse::success(&action.action_id); + rt.block_on(bridge_tx_clone.send_action_response(response)); + }); + + std::thread::sleep(Duration::from_secs(1)); + + let action = Action { + device_id: None, + action_id: "1".to_string(), + kind: "tunshell".to_string(), + name: "launch_shell".to_string(), + payload: "test".to_string(), + }; + actions_tx.send(action).unwrap(); + + std::thread::sleep(Duration::from_secs(1)); + + let action = Action { + device_id: None, + action_id: "2".to_string(), + kind: "test".to_string(), + name: "test".to_string(), + payload: "test".to_string(), + }; + actions_tx.send(action).unwrap(); + + let ActionResponse { action_id, state, .. } = recv_response(&package_rx); + assert_eq!(action_id, "1"); + assert_eq!(state, "Received"); + + let ActionResponse { action_id, state, .. } = recv_response(&package_rx); + assert_eq!(action_id, "1"); + assert_eq!(state, "Launched"); + + let ActionResponse { action_id, state, .. } = recv_response(&package_rx); + assert_eq!(action_id, "2"); + assert_eq!(state, "Received"); + + let ActionResponse { action_id, state, .. } = recv_response(&package_rx); + assert_eq!(action_id, "2"); + assert_eq!(state, "Running"); + + let status = recv_response(&package_rx); + assert_eq!(status.action_id, "2"); + assert!(status.is_completed()); + + let status = recv_response(&package_rx); + assert_eq!(status.action_id, "1"); + assert!(status.is_completed()); + } + + #[tokio::test] + async fn accept_tunshell_during_regular_action() { + let config = default_config(); + let (bridge_tx, actions_tx, package_rx) = start_bridge(Arc::new(config)); + let bridge_tx_clone = bridge_tx.clone(); + + std::thread::spawn(move || loop { + let rt = Runtime::new().unwrap(); + let test_route = ActionRoute { name: "test".to_string(), timeout: 30 }; + let action_rx = rt.block_on(bridge_tx_clone.register_action_route(test_route)); + let action = action_rx.recv().unwrap(); + assert_eq!(action.action_id, "1"); + let response = ActionResponse::progress(&action.action_id, "Running", 0); + rt.block_on(bridge_tx_clone.send_action_response(response)); + std::thread::sleep(Duration::from_secs(3)); + let response = ActionResponse::success(&action.action_id); + rt.block_on(bridge_tx_clone.send_action_response(response)); + }); + + std::thread::spawn(move || loop { + let rt = Runtime::new().unwrap(); + let test_route = ActionRoute { name: TUNSHELL_ACTION.to_string(), timeout: 30 }; + let action_rx = rt.block_on(bridge_tx.register_action_route(test_route)); + let action = action_rx.recv().unwrap(); + assert_eq!(action.action_id, "2"); + let response = ActionResponse::progress(&action.action_id, "Launched", 0); + rt.block_on(bridge_tx.send_action_response(response)); + std::thread::sleep(Duration::from_secs(1)); + let response = ActionResponse::success(&action.action_id); + rt.block_on(bridge_tx.send_action_response(response)); + }); + + std::thread::sleep(Duration::from_secs(1)); + + let action = Action { + device_id: None, + action_id: "1".to_string(), + kind: "test".to_string(), + name: "test".to_string(), + payload: "test".to_string(), + }; + actions_tx.send(action).unwrap(); + + std::thread::sleep(Duration::from_secs(1)); + + let action = Action { + device_id: None, + action_id: "2".to_string(), + kind: "tunshell".to_string(), + name: "launch_shell".to_string(), + payload: "test".to_string(), + }; + actions_tx.send(action).unwrap(); + + let ActionResponse { action_id, state, .. } = recv_response(&package_rx); + assert_eq!(action_id, "1"); + assert_eq!(state, "Received"); + + let ActionResponse { action_id, state, .. } = recv_response(&package_rx); + assert_eq!(action_id, "1"); + assert_eq!(state, "Running"); + + let ActionResponse { action_id, state, .. } = recv_response(&package_rx); + assert_eq!(action_id, "2"); + assert_eq!(state, "Received"); + + let ActionResponse { action_id, state, .. } = recv_response(&package_rx); + assert_eq!(action_id, "2"); + assert_eq!(state, "Launched"); + + let status = recv_response(&package_rx); + assert_eq!(status.action_id, "2"); + assert!(status.is_completed()); + + let status = recv_response(&package_rx); + assert_eq!(status.action_id, "1"); + assert!(status.is_completed()); + } + } From c9cd8303eb9fb51fdc164a9e1e0ab8ee4657170f Mon Sep 17 00:00:00 2001 From: Devdutt Shenoi Date: Sat, 5 Aug 2023 19:36:34 +0530 Subject: [PATCH 3/3] feat: default main on port 5050 if tcpapps unconfigured (#264) * feat: automatically assign main port * feat: default app on port 5555 * fix: default to port `5050` * doc: move to using port 5050 --- README.md | 2 +- configs/config.toml | 4 +- configs/simulator.toml | 2 +- configs/stress.toml | 2 +- docs/apps.md | 10 +- examples/demo.go | 2 +- examples/demo.py | 2 +- examples/demo.rs | 2 +- examples/rpi/updates/app_update/app_update.sh | 2 +- .../app_update_rollback.sh | 2 +- examples/rpi/updates/deb_update/deb_update.sh | 2 +- .../updates/rootfs_update/rootfs_update.sh | 2 +- scripts/bridge.py | 2 +- scripts/config.toml | 4 +- scripts/startup.sh | 2 +- scripts/uplink.toml | 4 +- tools/simulator/Cargo.lock | 895 +++++++++--------- tools/utils/src/push_data.rs | 2 +- tools/utils/src/wait_and_send.rs | 2 +- uplink/src/base/mod.rs | 10 +- 20 files changed, 485 insertions(+), 470 deletions(-) diff --git a/README.md b/README.md index 51db03076..c5cf3b9f6 100644 --- a/README.md +++ b/README.md @@ -195,7 +195,7 @@ With the help of tunshell, uplink allows you to remotely connect to a device she You can test sending JSON data to Bytebeam over uplink with the following command while uplink is active ```sh -nc localhost 5555 +nc localhost 5050 { "stream": "can", "sequence": 1, "timestamp": 12345, "data": 100 } { "stream": "can", "sequence": 1, "timestamp": 12345, "data": 100 } { "stream": "can", "sequence": 1, "timestamp": 12345, "data": 100 } diff --git a/configs/config.toml b/configs/config.toml index 4eb63235d..f3c81e9fd 100644 --- a/configs/config.toml +++ b/configs/config.toml @@ -36,11 +36,11 @@ network_timeout = 30 # - actions: A list of actions that uplink can forward to the app, # with configurable timeouts [tcpapps.1] -port = 5555 +port = 5050 actions = [{ name = "install_update" }, { name = "load_file" }] [tcpapps.2] -port = 5556 +port = 6060 actions = [] # Metrics configurations are available for serializer and streams. By default diff --git a/configs/simulator.toml b/configs/simulator.toml index fe9aab23a..75bb5cd57 100644 --- a/configs/simulator.toml +++ b/configs/simulator.toml @@ -5,4 +5,4 @@ action_redirections = { "update_firmware" = "install_update", "send_file" = "loa persistence_path = "/tmp/uplink" [tcpapps.1] -port = 5555 +port = 5050 diff --git a/configs/stress.toml b/configs/stress.toml index 1a3d10a9f..5a53d859b 100644 --- a/configs/stress.toml +++ b/configs/stress.toml @@ -4,7 +4,7 @@ processes = [{ name = "echo" }] action_redirections = { "update_firmware" = "install_update", "send_file" = "load_file" } [tcpapps.1] -port = 5555 +port = 5050 actions = [{ name = "install_update" }, { name = "load_file" }] [persistence] diff --git a/docs/apps.md b/docs/apps.md index 1b83c202a..779f84d70 100644 --- a/docs/apps.md +++ b/docs/apps.md @@ -2,13 +2,13 @@ uplink is a service that runs in the background and connects user applications to the bytebeam platform. ## Configuring uplink -Applications can connect to the uplink service over TCP to send and receive JSON data, and for this uplink has to expose a TCP port per application. The following example configuration describes to uplink that two applications require it to expose the ports 5555 and 6666, where one of them also expects to receive `install_firmware` actions: +Applications can connect to the uplink service over TCP to send and receive JSON data, and for this uplink has to expose a TCP port per application. The following example configuration describes to uplink that two applications require it to expose the ports 5050 and 6060, where one of them also expects to receive `install_firmware` actions: ``` [tcpapps.main_app] -port = 5555 +port = 5050 [tcpapps.ota_installer] -port = 5555 +port = 6060 actions = [{ name = "install_firmware" }] ``` NOTE: Only one client can connect to a TCP port at a time. If a second client attempts to connect to a port which is already occupied, the first client will be disconnected from uplink. @@ -77,7 +77,7 @@ An example success response to an action with the id `"123"`, would look like: > **NOTE:** There is a timeout mechanism which on being triggered will send a ***Failed*** response to platform and stop forwarding any *Progress* responses from the connected applications. In order to not trigger this timeout, an application must send a ***Failed*** or ***Completed*** response before the action timeout. Once an action has timedout, a failure response is sent and all it's future responses are dropped. Action timeouts can be configured per action when setting up uplink, as follows: > ``` > [tcpapps.main_app] -> port = 5555 +> port = 5050 > actions = [{ name = "abc", timeout = 300 }] # Allow the connected app to send responses for action abc upto 5 minutes from receive, send a failure response and drop all responses afterwards if not yet completed. > ``` @@ -86,7 +86,7 @@ We have provided examples written in python and golang to demonstrate how you ca 1. Ensure uplink is running on the device, connected to relevant broker and using the following config: ```toml [tcpapps.main_app] -port = 5555 +port = 5050 actions = [{ name = "update_firmware" }, { name = "reboot" }, { name = "update_config" }] ``` 2. Run the python/golang examples diff --git a/examples/demo.go b/examples/demo.go index 7f0653d0e..c07a951b4 100644 --- a/examples/demo.go +++ b/examples/demo.go @@ -26,7 +26,7 @@ type Action struct { func main() { // Connect to uplink via bridge port - c, err := net.Dial("tcp", "localhost:5555") + c, err := net.Dial("tcp", "localhost:5050") if err != nil { fmt.Println(err) return diff --git a/examples/demo.py b/examples/demo.py index 6a9934907..431016337 100644 --- a/examples/demo.py +++ b/examples/demo.py @@ -7,7 +7,7 @@ import threading s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) -s.connect(("localhost", 5555)) +s.connect(("localhost", 5050)) # Converts JSON data received over TCP into a python dictionary def recv_action(s): diff --git a/examples/demo.rs b/examples/demo.rs index 5bdf02a89..4762a8bcc 100644 --- a/examples/demo.rs +++ b/examples/demo.rs @@ -4,7 +4,7 @@ use std::thread; use std::time::{Duration, SystemTime, UNIX_EPOCH}; fn main() -> Result<()> { - let mut stream = TcpStream::connect("localhost:5555").expect("couldn't connect to server"); + let mut stream = TcpStream::connect("localhost:5050").expect("couldn't connect to server"); let stream_clone = stream.try_clone().expect("clone failed..."); println!("Connected to the server!"); diff --git a/examples/rpi/updates/app_update/app_update.sh b/examples/rpi/updates/app_update/app_update.sh index 6ac86a637..0600596c9 100755 --- a/examples/rpi/updates/app_update/app_update.sh +++ b/examples/rpi/updates/app_update/app_update.sh @@ -10,7 +10,7 @@ # COPROC[1] is the stdin for netcat # COPROC[0] is the stdout of netcat -# By echoing to the stdin of nc, we write to the port 5555 +# By echoing to the stdin of nc, we write to the port 5050 PORT=$2 APP=$3 diff --git a/examples/rpi/updates/app_update_rollback/app_update_rollback.sh b/examples/rpi/updates/app_update_rollback/app_update_rollback.sh index 100f8c3ca..9c2c96190 100755 --- a/examples/rpi/updates/app_update_rollback/app_update_rollback.sh +++ b/examples/rpi/updates/app_update_rollback/app_update_rollback.sh @@ -11,7 +11,7 @@ # COPROC[1] is the stdin for netcat # COPROC[0] is the stdout of netcat -# By echoing to the stdin of nc, we write to the port 5555 +# By echoing to the stdin of nc, we write to the port 5050 PORT=$2 APP=$3 diff --git a/examples/rpi/updates/deb_update/deb_update.sh b/examples/rpi/updates/deb_update/deb_update.sh index d569b4879..fa72ef23c 100755 --- a/examples/rpi/updates/deb_update/deb_update.sh +++ b/examples/rpi/updates/deb_update/deb_update.sh @@ -3,7 +3,7 @@ ## This script is used for deb package updates # COPROC[1] is the stdin for netcat # COPROC[0] is the stdout of netcat -# By echoing to the stdin of nc, we write to the port 5555 +# By echoing to the stdin of nc, we write to the port 5050 dpkg -i $3/*.deb $4 # To extract to the custom location diff --git a/examples/rpi/updates/rootfs_update/rootfs_update.sh b/examples/rpi/updates/rootfs_update/rootfs_update.sh index 8c04a5bd5..9f11a8cfd 100755 --- a/examples/rpi/updates/rootfs_update/rootfs_update.sh +++ b/examples/rpi/updates/rootfs_update/rootfs_update.sh @@ -9,7 +9,7 @@ # COPROC[1] is the stdin for netcat # COPROC[0] is the stdout of netcat -# By echoing to the stdin of nc, we write to the port 5555 +# By echoing to the stdin of nc, we write to the port 5050 PORT=$2 coproc nc localhost $PORT diff --git a/scripts/bridge.py b/scripts/bridge.py index a9c9289ee..2f41ae280 100644 --- a/scripts/bridge.py +++ b/scripts/bridge.py @@ -9,7 +9,7 @@ import subprocess s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) -s.connect(("localhost", 5555)) +s.connect(("localhost", 5050)) # Converts JSON data received over TCP into a python dictionary def recv_action(s): diff --git a/scripts/config.toml b/scripts/config.toml index 1174b7acc..a4f2de7eb 100644 --- a/scripts/config.toml +++ b/scripts/config.toml @@ -1,7 +1,7 @@ persistence_path = "/tmp/uplink" action_redirections={update_firmware="install_firmware"} [tcpapps.1] -port=5555 +port=5050 actions=[{name="reboot"}] [downloader] @@ -15,7 +15,7 @@ port=3333 [ota_installer] path="/tmp/uplink/installer" actions=[{name="install_firmware", timeout=610}] -uplink_port=5555 +uplink_port=5050 [logging] tags=["sshd", "systemd"] diff --git a/scripts/startup.sh b/scripts/startup.sh index 705decc50..f8316b796 100755 --- a/scripts/startup.sh +++ b/scripts/startup.sh @@ -1,7 +1,7 @@ #!/bin/bash root_part=`awk -F"root=" '{ print $NF; }' /proc/cmdline | cut -d" " -f1` -coproc nc localhost 5555 +coproc nc localhost 5050 if [ -f "/mnt/download/action_id" ] then diff --git a/scripts/uplink.toml b/scripts/uplink.toml index 303b13102..831b84d1f 100644 --- a/scripts/uplink.toml +++ b/scripts/uplink.toml @@ -1,7 +1,7 @@ action_redirections={update_firmware="install_firmware"} [tcpapps.1] -port=5555 +port=5050 [downloader] path="/tmp/uplink/download" @@ -10,4 +10,4 @@ actions=[{name="update_firmware", timeout=310}, {name="send_file"}] [ota_installer] path="/tmp/uplink/installer" actions=[{name="install_firmware", timeout=310}] -uplink_port=5555 +uplink_port=5050 diff --git a/tools/simulator/Cargo.lock b/tools/simulator/Cargo.lock index e50267642..0038e5aa3 100644 --- a/tools/simulator/Cargo.lock +++ b/tools/simulator/Cargo.lock @@ -3,10 +3,19 @@ version = 3 [[package]] -name = "adler32" -version = "1.2.0" +name = "addr2line" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "afl" @@ -30,30 +39,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "alloc-no-stdlib" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" - -[[package]] -name = "alloc-stdlib" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" -dependencies = [ - "alloc-no-stdlib", -] - -[[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" @@ -69,21 +54,15 @@ version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "224afbd727c3d6e4b90103ece64b8d1b67fbb1973b1046c2281eed3f3803f800" -[[package]] -name = "ascii" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d92bec98840b8f03a5ff5413de5293bfcd8bf96467cf5452609f939ec6f5de16" - [[package]] name = "async-trait" -version = "0.1.64" +version = "0.1.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd7fce9ba8c3c042128ce72d8b2ddbf3a05747efb67ea0313c635e10bda47a2" +checksum = "cc6dde6e4ed435a4c1ee4e73592f5ba9da2151af10076cc04858746af9352d09" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.28", ] [[package]] @@ -117,6 +96,70 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "axum" +version = "0.6.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" +dependencies = [ + "async-trait", + "axum-core", + "bitflags", + "bytes 1.4.0", + "futures-util", + "http", + "http-body", + "hyper", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite 0.2.9", + "rustversion", + "serde", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", + "sync_wrapper", + "tokio 1.29.1", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-core" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" +dependencies = [ + "async-trait", + "bytes 1.4.0", + "futures-util", + "http", + "http-body", + "mime", + "rustversion", + "tower-layer", + "tower-service", +] + +[[package]] +name = "backtrace" +version = "0.3.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +dependencies = [ + "addr2line", + "cc", + "cfg-if 1.0.0", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + [[package]] name = "base64" version = "0.11.0" @@ -129,12 +172,6 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - [[package]] name = "base64" version = "0.21.0" @@ -175,46 +212,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "block-buffer" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" -dependencies = [ - "generic-array", -] - -[[package]] -name = "brotli" -version = "3.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1a0b1dbcc8ae29329621f8d4f0d835787c1c38bb1401979b49d13b0b305ff68" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", - "brotli-decompressor", -] - -[[package]] -name = "brotli-decompressor" -version = "2.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b6561fd3f895a11e8f72af2cb7d22e08366bebc2b6b57f7744c4bda27034744" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", -] - -[[package]] -name = "buf_redux" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b953a6887648bb07a535631f2bc00fbdb2a2216f135552cb3f534ed136b9c07f" -dependencies = [ - "memchr", - "safemem", -] - [[package]] name = "bumpalo" version = "3.12.0" @@ -260,24 +257,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "chrono" -version = "0.4.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" -dependencies = [ - "iana-time-zone", - "num-integer", - "num-traits", - "winapi 0.3.9", -] - -[[package]] -name = "chunked_transfer" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cca491388666e04d7248af3f60f0c40cfb0991c72205595d7c396e3510207d1a" - [[package]] name = "clap" version = "2.34.0" @@ -293,16 +272,6 @@ dependencies = [ "vec_map", ] -[[package]] -name = "codespan-reporting" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" -dependencies = [ - "termcolor", - "unicode-width", -] - [[package]] name = "config" version = "0.13.3" @@ -440,60 +409,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "cxx" -version = "1.0.91" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86d3488e7665a7a483b57e25bdd90d0aeb2bc7608c8d0346acf2ad3f1caf1d62" -dependencies = [ - "cc", - "cxxbridge-flags", - "cxxbridge-macro", - "link-cplusplus", -] - -[[package]] -name = "cxx-build" -version = "1.0.91" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48fcaf066a053a41a81dfb14d57d99738b767febb8b735c3016e469fac5da690" -dependencies = [ - "cc", - "codespan-reporting", - "once_cell", - "proc-macro2", - "quote", - "scratch", - "syn", -] - -[[package]] -name = "cxxbridge-flags" -version = "1.0.91" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2ef98b8b717a829ca5603af80e1f9e2e48013ab227b68ef37872ef84ee479bf" - -[[package]] -name = "cxxbridge-macro" -version = "1.0.91" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "086c685979a698443656e5cf7856c95c642295a38599f12fb1ff76fb28d19892" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "darling" version = "0.13.4" @@ -515,7 +430,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.10.0", - "syn", + "syn 1.0.109", ] [[package]] @@ -526,17 +441,7 @@ checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" dependencies = [ "darling_core", "quote", - "syn", -] - -[[package]] -name = "deflate" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c86f7e25f518f4b81808a2cf1c50996a61f5c2eb394b2393bd87f2a4780a432f" -dependencies = [ - "adler32", - "gzip-header", + "syn 1.0.109", ] [[package]] @@ -548,16 +453,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "digest" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" -dependencies = [ - "block-buffer 0.10.3", - "crypto-common", -] - [[package]] name = "dirs" version = "4.0.0" @@ -578,16 +473,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "disk" -version = "0.1.0" -dependencies = [ - "bytes 1.4.0", - "log", - "seahash", - "thiserror", -] - [[package]] name = "dummy" version = "0.4.1" @@ -596,7 +481,7 @@ checksum = "5bf5ff6f74150b0bbb6e6057718a903b3d8f3fc7096c9190fc162ca99d3b2273" dependencies = [ "darling", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -631,7 +516,7 @@ checksum = "828de45d0ca18782232dfb8f3ea9cc428e8ced380eb26a520baaacfc70de39ce" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -710,6 +595,16 @@ dependencies = [ "windows-sys 0.45.0", ] +[[package]] +name = "flate2" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + [[package]] name = "flume" version = "0.10.14" @@ -831,7 +726,7 @@ checksum = "95a73af87da33b5acf53acfebdc339fe592ecf5357ac7c0a7734ab9d8c876a70" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -933,9 +828,15 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] +[[package]] +name = "gimli" +version = "0.27.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" + [[package]] name = "git2" version = "0.16.1" @@ -955,15 +856,6 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" -[[package]] -name = "gzip-header" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95cc527b92e6029a62960ad99aa8a6660faa4555fe5f731aab13aa6a921795a2" -dependencies = [ - "crc32fast", -] - [[package]] name = "h2" version = "0.3.15" @@ -978,7 +870,7 @@ dependencies = [ "http", "indexmap", "slab", - "tokio 1.25.0", + "tokio 1.29.1", "tokio-util 0.7.7", "tracing", ] @@ -1016,6 +908,12 @@ dependencies = [ "libc", ] +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + [[package]] name = "http" version = "0.2.9" @@ -1076,8 +974,8 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite 0.2.9", - "socket2", - "tokio 1.25.0", + "socket2 0.4.9", + "tokio 1.29.1", "tower-service", "tracing", "want", @@ -1092,34 +990,10 @@ dependencies = [ "http", "hyper", "rustls 0.20.8", - "tokio 1.25.0", + "tokio 1.29.1", "tokio-rustls 0.23.4", ] -[[package]] -name = "iana-time-zone" -version = "0.1.53" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "winapi 0.3.9", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" -dependencies = [ - "cxx", - "cxx-build", -] - [[package]] name = "ident_case" version = "1.0.1" @@ -1240,9 +1114,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.139" +version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "libgit2-sys" @@ -1268,15 +1142,6 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "link-cplusplus" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" -dependencies = [ - "cc", -] - [[package]] name = "linux-raw-sys" version = "0.1.4" @@ -1302,6 +1167,15 @@ dependencies = [ "cfg-if 1.0.0", ] +[[package]] +name = "lz4_flex" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b8c72594ac26bfd34f2d99dfced2edfaddfe8a476e3ff2ca0eb293d925c4f83" +dependencies = [ + "twox-hash", +] + [[package]] name = "matchers" version = "0.1.0" @@ -1311,6 +1185,12 @@ dependencies = [ "regex-automata", ] +[[package]] +name = "matchit" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed1202b2a6f884ae56f04cff409ab315c5ce26b5e58d7412e484f01fd52f52ef" + [[package]] name = "memchr" version = "2.5.0" @@ -1338,22 +1218,21 @@ version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" -[[package]] -name = "mime_guess" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" -dependencies = [ - "mime", - "unicase", -] - [[package]] name = "minimal-lexical" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + [[package]] name = "mio" version = "0.6.23" @@ -1429,24 +1308,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "multipart" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00dec633863867f29cb39df64a397cdf4a6354708ddd7759f70c7fb51c5f9182" -dependencies = [ - "buf_redux", - "httparse", - "log", - "mime", - "mime_guess", - "quick-error", - "rand 0.8.5", - "safemem", - "tempfile", - "twoway", -] - [[package]] name = "nanorand" version = "0.7.0" @@ -1485,6 +1346,12 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "no-std-net" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43794a0ace135be66a25d3ae77d41b91615fb68ae937f904090203e81f755b65" + [[package]] name = "nom" version = "7.1.3" @@ -1504,25 +1371,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", -] - [[package]] name = "num_cpus" version = "1.15.0" @@ -1542,6 +1390,15 @@ dependencies = [ "libc", ] +[[package]] +name = "object" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +dependencies = [ + "memchr", +] + [[package]] name = "once_cell" version = "1.17.1" @@ -1577,7 +1434,7 @@ checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1670,7 +1527,7 @@ checksum = "851c8d0ce9bebe43790dedfc86614c23494ac9f423dd618d3a61fc693eafe61e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1681,7 +1538,7 @@ checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1708,6 +1565,48 @@ version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" +[[package]] +name = "pnet_base" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "872e46346144ebf35219ccaa64b1dffacd9c6f188cd7d012bd6977a2a838f42e" +dependencies = [ + "no-std-net", +] + +[[package]] +name = "pnet_macros" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a780e80005c2e463ec25a6e9f928630049a10b43945fea83207207d4a7606f4" +dependencies = [ + "proc-macro2", + "quote", + "regex", + "syn 1.0.109", +] + +[[package]] +name = "pnet_macros_support" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d932134f32efd7834eb8b16d42418dac87086347d1bc7d142370ef078582bc" +dependencies = [ + "pnet_base", +] + +[[package]] +name = "pnet_packet" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bde678bbd85cb1c2d99dc9fc596e57f03aa725f84f3168b0eaf33eeccb41706" +dependencies = [ + "glob", + "pnet_base", + "pnet_macros", + "pnet_macros_support", +] + [[package]] name = "pollster" version = "0.2.5" @@ -1758,7 +1657,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "version_check", ] @@ -1775,9 +1674,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.51" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] @@ -1790,9 +1689,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.23" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" dependencies = [ "proc-macro2", ] @@ -2033,7 +1932,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", - "tokio 1.25.0", + "tokio 1.29.1", "tokio-rustls 0.23.4", "tokio-util 0.7.7", "tower-service", @@ -2061,31 +1960,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "rouille" -version = "3.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f86e4c51a773f953f02bbab5fd049f004bfd384341d62da2a079aff812ab176" -dependencies = [ - "base64 0.13.1", - "brotli", - "chrono", - "deflate", - "filetime", - "multipart", - "num_cpus", - "percent-encoding", - "rand 0.8.5", - "serde", - "serde_derive", - "serde_json", - "sha1", - "threadpool", - "time", - "tiny_http", - "url", -] - [[package]] name = "rumqttc" version = "0.20.0" @@ -2099,10 +1973,16 @@ dependencies = [ "rustls-native-certs", "rustls-pemfile", "thiserror", - "tokio 1.25.0", + "tokio 1.29.1", "tokio-rustls 0.23.4", ] +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + [[package]] name = "rustc_version" version = "0.2.3" @@ -2193,12 +2073,6 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" -[[package]] -name = "safemem" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" - [[package]] name = "schannel" version = "0.1.21" @@ -2214,12 +2088,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" -[[package]] -name = "scratch" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddccb15bcce173023b3fedd9436f882a0739b8dfb45e4f6b6002bee5929f61b2" - [[package]] name = "sct" version = "0.6.1" @@ -2292,22 +2160,22 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.152" +version = "1.0.181" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" +checksum = "6d3e73c93c3240c0bda063c239298e633114c69a888c3e37ca8bb33f343e9890" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.152" +version = "1.0.181" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" +checksum = "be02f6cb0cd3a5ec20bbcfbcbd749f57daddb1a0882dc2e46a6c236c90b977ed" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.28", ] [[package]] @@ -2321,6 +2189,16 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_path_to_error" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4beec8bce849d58d06238cb50db2e1c417cfeafa4c63f692b15c82b7c80f8335" +dependencies = [ + "itoa", + "serde", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -2381,24 +2259,13 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" dependencies = [ - "block-buffer 0.9.0", + "block-buffer", "cfg-if 1.0.0", "cpufeatures", - "digest 0.9.0", + "digest", "opaque-debug", ] -[[package]] -name = "sha1" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" -dependencies = [ - "cfg-if 1.0.0", - "cpufeatures", - "digest 0.10.6", -] - [[package]] name = "sharded-slab" version = "0.1.4" @@ -2454,6 +2321,18 @@ dependencies = [ "libc", ] +[[package]] +name = "signal-hook-tokio" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213241f76fb1e37e27de3b6aa1b068a2c333233b59cca6634f634b80a27ecf1e" +dependencies = [ + "futures-core", + "libc", + "signal-hook", + "tokio 1.29.1", +] + [[package]] name = "simplelog" version = "0.12.0" @@ -2478,7 +2357,7 @@ dependencies = [ "simplelog", "structopt", "thiserror", - "tokio 1.25.0", + "tokio 1.29.1", "tokio-stream", "tokio-util 0.7.7", "uplink", @@ -2501,14 +2380,24 @@ checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" [[package]] name = "socket2" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" dependencies = [ "libc", "winapi 0.3.9", ] +[[package]] +name = "socket2" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "spin" version = "0.5.2" @@ -2530,6 +2419,16 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "storage" +version = "0.1.0" +dependencies = [ + "bytes 1.4.0", + "log", + "seahash", + "thiserror", +] + [[package]] name = "strsim" version = "0.8.0" @@ -2563,7 +2462,23 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.109", +] + +[[package]] +name = "surge-ping" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af341b2be485d647b5dc4cfb2da99efac35b5c95748a08fb7233480fedc5ead3" +dependencies = [ + "hex", + "parking_lot", + "pnet_packet", + "rand 0.8.5", + "socket2 0.5.3", + "thiserror", + "tokio 1.29.1", + "tracing", ] [[package]] @@ -2577,6 +2492,23 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04361975b3f5e348b2189d8dc55bc942f278b2d482a6a0365de5bdd62d351567" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + [[package]] name = "sysinfo" version = "0.26.9" @@ -2606,6 +2538,17 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "tar" +version = "0.4.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec96d2ffad078296368d46ff1cb309be1c23c513b4ab0e22a45de0185275ac96" +dependencies = [ + "filetime", + "libc", + "xattr", +] + [[package]] name = "tempdir" version = "0.3.7" @@ -2658,22 +2601,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.38" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" +checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.38" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" +checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.28", ] [[package]] @@ -2686,15 +2629,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "threadpool" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" -dependencies = [ - "num_cpus", -] - [[package]] name = "time" version = "0.3.20" @@ -2724,18 +2658,6 @@ dependencies = [ "time-core", ] -[[package]] -name = "tiny_http" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389915df6413a2e74fb181895f933386023c71110878cd0825588928e64cdc82" -dependencies = [ - "ascii", - "chunked_transfer", - "httpdate", - "log", -] - [[package]] name = "tinyvec" version = "1.6.0" @@ -2776,22 +2698,22 @@ dependencies = [ [[package]] name = "tokio" -version = "1.25.0" +version = "1.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e00990ebabbe4c14c08aca901caed183ecd5c09562a12c824bb53d3c3fd3af" +checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" dependencies = [ "autocfg", + "backtrace", "bytes 1.4.0", "libc", - "memchr", "mio 0.8.6", "num_cpus", "parking_lot", "pin-project-lite 0.2.9", "signal-hook-registry", - "socket2", - "tokio-macros 1.8.2", - "windows-sys 0.42.0", + "socket2 0.4.9", + "tokio-macros 2.1.0", + "windows-sys 0.48.0", ] [[package]] @@ -2804,7 +2726,7 @@ dependencies = [ "once_cell", "pin-project-lite 0.2.9", "tokio 0.2.25", - "tokio 1.25.0", + "tokio 1.29.1", "tokio-stream", ] @@ -2816,18 +2738,18 @@ checksum = "e44da00bfc73a25f814cd8d7e57a68a5c31b74b3152a0a1d1f590c97ed06265a" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "tokio-macros" -version = "1.8.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.28", ] [[package]] @@ -2859,7 +2781,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" dependencies = [ "rustls 0.20.8", - "tokio 1.25.0", + "tokio 1.29.1", "webpki 0.22.0", ] @@ -2871,7 +2793,7 @@ checksum = "8fb52b74f05dbf495a8fba459fdc331812b96aa086d9eb78101fa0d4569c3313" dependencies = [ "futures-core", "pin-project-lite 0.2.9", - "tokio 1.25.0", + "tokio 1.29.1", ] [[package]] @@ -2900,7 +2822,7 @@ dependencies = [ "futures-sink", "pin-project-lite 0.2.9", "slab", - "tokio 1.25.0", + "tokio 1.29.1", "tracing", ] @@ -2913,6 +2835,28 @@ dependencies = [ "serde", ] +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "pin-project 1.0.12", + "pin-project-lite 0.2.9", + "tokio 1.29.1", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-layer" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" + [[package]] name = "tower-service" version = "0.3.2" @@ -2940,7 +2884,7 @@ checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -3064,15 +3008,6 @@ dependencies = [ "serde_json", ] -[[package]] -name = "twoway" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59b11b2b5241ba34be09c3cc85a36e56e48f9888862e19cedf23336d35316ed1" -dependencies = [ - "memchr", -] - [[package]] name = "twox-hash" version = "1.6.3" @@ -3100,15 +3035,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "unicase" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" -dependencies = [ - "version_check", -] - [[package]] name = "unicode-bidi" version = "0.3.10" @@ -3150,31 +3076,37 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "uplink" -version = "2.0.0" +version = "2.5.0" dependencies = [ "anyhow", "async-trait", + "axum", "bytes 1.4.0", "config", - "disk", + "flate2", "flume", "futures-util", "glob", "lazy_static", "log", + "lz4_flex", "pretty-bytes", "rand 0.8.5", "regex", "reqwest", - "rouille", "rumqttc", "serde", "serde_json", + "signal-hook", + "signal-hook-tokio", + "storage", "structopt", + "surge-ping", "sysinfo 0.26.9", + "tar", "thiserror", "time", - "tokio 1.25.0", + "tokio 1.29.1", "tokio-compat-02", "tokio-stream", "tokio-util 0.7.7", @@ -3292,7 +3224,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "wasm-bindgen-shared", ] @@ -3326,7 +3258,7 @@ checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3459,13 +3391,13 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.42.1", + "windows_aarch64_msvc 0.42.1", + "windows_i686_gnu 0.42.1", + "windows_i686_msvc 0.42.1", + "windows_x86_64_gnu 0.42.1", + "windows_x86_64_gnullvm 0.42.1", + "windows_x86_64_msvc 0.42.1", ] [[package]] @@ -3474,7 +3406,16 @@ version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" dependencies = [ - "windows-targets", + "windows-targets 0.42.1", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.1", ] [[package]] @@ -3483,13 +3424,28 @@ version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.42.1", + "windows_aarch64_msvc 0.42.1", + "windows_i686_gnu 0.42.1", + "windows_i686_msvc 0.42.1", + "windows_x86_64_gnu 0.42.1", + "windows_x86_64_gnullvm 0.42.1", + "windows_x86_64_msvc 0.42.1", +] + +[[package]] +name = "windows-targets" +version = "0.48.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +dependencies = [ + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", ] [[package]] @@ -3498,42 +3454,84 @@ version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + [[package]] name = "windows_aarch64_msvc" version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" + [[package]] name = "windows_i686_gnu" version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + [[package]] name = "windows_i686_msvc" version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" +[[package]] +name = "windows_i686_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" + [[package]] name = "windows_x86_64_gnu" version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" + [[package]] name = "windows_x86_64_msvc" version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + [[package]] name = "winreg" version = "0.10.1" @@ -3553,6 +3551,15 @@ dependencies = [ "winapi-build", ] +[[package]] +name = "xattr" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d1526bbe5aaeb5eb06885f4d987bcdfa5e23187055de9b83fe00156a821fabc" +dependencies = [ + "libc", +] + [[package]] name = "xdg" version = "2.4.1" diff --git a/tools/utils/src/push_data.rs b/tools/utils/src/push_data.rs index ed64c05d2..70fe527d9 100644 --- a/tools/utils/src/push_data.rs +++ b/tools/utils/src/push_data.rs @@ -18,7 +18,7 @@ struct ShadowPayload { #[tokio::main] async fn main() { - let port = std::env::args().nth(2).unwrap_or_else(|| "127.0.0.1:5555".to_string()); + let port = std::env::args().nth(2).unwrap_or_else(|| "127.0.0.1:5050".to_string()); let mut framed = Framed::new(TcpStream::connect(port).await.unwrap(), LinesCodec::new()); let mut idx = 0; loop { diff --git a/tools/utils/src/wait_and_send.rs b/tools/utils/src/wait_and_send.rs index e9d734d68..6d6d14d6a 100644 --- a/tools/utils/src/wait_and_send.rs +++ b/tools/utils/src/wait_and_send.rs @@ -24,7 +24,7 @@ async fn main() { println!("Using default value \"Completed\""); "Completed".to_string() }); - let port = std::env::args().nth(2).unwrap_or_else(|| "127.0.0.1:5555".to_string()); + let port = std::env::args().nth(2).unwrap_or_else(|| "127.0.0.1:5050".to_string()); let stream = TcpStream::connect(port).await.unwrap(); let mut framed = Framed::new(stream, LinesCodec::new()); async fn respond<'a>( diff --git a/uplink/src/base/mod.rs b/uplink/src/base/mod.rs index b65e45a31..3a6b8cb01 100644 --- a/uplink/src/base/mod.rs +++ b/uplink/src/base/mod.rs @@ -40,6 +40,14 @@ fn default_persistence_path() -> PathBuf { path } +// Automatically assigns port 5050 for default main app, if left unconfigured +fn default_tcpapps() -> HashMap { + let mut apps = HashMap::new(); + apps.insert("main".to_string(), AppConfig { port: 5050, actions: vec![] }); + + apps +} + pub fn clock() -> u128 { SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_millis() } @@ -209,7 +217,7 @@ pub struct Config { #[serde(default)] pub console: ConsoleConfig, pub authentication: Option, - #[serde(default)] + #[serde(default = "default_tcpapps")] pub tcpapps: HashMap, pub mqtt: MqttConfig, #[serde(default)]