├── .gitignore ├── .github └── workflows │ ├── tests.yml │ └── release.yml ├── Cargo.toml ├── LICENSE-MIT ├── README.md ├── src ├── main.rs ├── wol.rs └── servers.rs ├── LICENSE-APACHE └── Cargo.lock /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | sample.yml 3 | *.profraw 4 | -------------------------------------------------------------------------------- /.github/workflows/tests.yml: -------------------------------------------------------------------------------- 1 | name: "Tests" 2 | on: 3 | push: 4 | pull_request: 5 | 6 | jobs: 7 | test: 8 | name: cargo test 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v4 12 | - uses: actions-rust-lang/setup-rust-toolchain@v1 13 | - run: cargo test --all-features 14 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rallyup" 3 | version = "0.1.1" 4 | edition = "2021" 5 | authors = ["Darwin Darakananda "] 6 | license = "MIT OR Apache-2.0" 7 | keywords = ["cli", "tool", "network", "wol", "automation"] 8 | categories = ["command-line-utilities"] 9 | repository = "https://github.com/darwindarak/rallyup" 10 | description = """ 11 | rallyup is a lightweight Wake-On-LAN (WOL) scheduler and dependency manager that ensures infrastructure services, such as firewalls, storage, and hypervisors, are brought online in the correct sequence and at the right time. 12 | """ 13 | 14 | [dependencies] 15 | pnet = "0.35" 16 | serde = { version = "1.0", features = ["derive"] } 17 | serde_yaml_ng = "0.10" 18 | serde_regex = "1.1.0" 19 | regex = "1.11.0" 20 | anyhow = "1.0.91" 21 | thiserror = "1.0.65" 22 | humantime = "2.1.0" 23 | humantime-serde = "1.1.1" 24 | reqwest = "0.12.8" 25 | tokio = { version = "1", features = ["full"] } 26 | crossterm = "0.28.1" 27 | colored = "2.1.0" 28 | 29 | [dev-dependencies] 30 | mockito = "1.5.0" 31 | -------------------------------------------------------------------------------- /LICENSE-MIT: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Computer Union Co., Ltd. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release Binary 2 | permissions: 3 | contents: write 4 | 5 | on: 6 | release: 7 | types: [created] 8 | 9 | jobs: 10 | create-release: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v4 14 | - uses: taiki-e/create-gh-release-action@v1 15 | with: 16 | # (required) GitHub token for creating GitHub Releases. 17 | token: ${{ secrets.GITHUB_TOKEN }} 18 | 19 | upload-assets: 20 | needs: create-release 21 | strategy: 22 | matrix: 23 | include: 24 | - target: x86_64-unknown-linux-gnu 25 | os: ubuntu-latest 26 | - target: x86_64-apple-darwin 27 | os: macos-latest 28 | - target: aarch64-apple-darwin 29 | os: macos-latest 30 | runs-on: ${{ matrix.os }} 31 | steps: 32 | - uses: actions/checkout@v4 33 | 34 | - uses: taiki-e/upload-rust-binary-action@v1 35 | with: 36 | include: LICENSE-MIT,LICENSE-APACHE,README.md 37 | # (required) Comma-separated list of binary names (non-extension portion of filename) to build and upload. 38 | # Note that glob pattern is not supported yet. 39 | bin: rallyup 40 | # (optional) Target triple, default is host triple. 41 | target: ${{ matrix.target }} 42 | # (required) GitHub token for uploading assets to GitHub Releases. 43 | token: ${{ secrets.GITHUB_TOKEN }} 44 | 45 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # `rallyup` 2 | 3 | `rallyup` is a lightweight Wake-On-LAN (WOL) scheduler and dependency manager designed for small businesses and homelabs. It ensures that infrastructure services like firewalls, storage, and hypervisors are brought online in the correct order, particularly after events like power outages. 4 | 5 | A typical setup involves configuring most of the infrastructure for WOL but not for Wake-On-Power, and setting `rallyup` to run on startup on a low-power device like a Raspberry Pi. When you need to bring the entire environment online, simply power on the device running `rallyup`, and the rest of the infrastructure will automatically follow in the correct order. 6 | 7 | ![Tests](https://github.com/darwindarak/rallyup/actions/workflows/tests.yml/badge.svg) 8 | [![Crates.io](https://img.shields.io/crates/v/rallyup.svg)](https://crates.io/crates/rallyup) 9 | 10 | ## Features 11 | 12 | - [x] *VLAN Support*: Send WOL packets to devices across different VLANs. 13 | - [x] *YAML Configuration*: Easily define server boot sequences, dependencies, and status checks. 14 | - [ ] *Service Status Checks*: Verify that a service is up using built-in status checks (HTTP health checks, NFS, SMB, custom shell commands). 15 | - [x] HTTP 16 | - [x] Open port 17 | - [x] Shell 18 | - [ ] NFS (might just use open port check) 19 | - [ ] SMB (might just use open port check) 20 | - [ ] *Plugin-Friendly*: Users can write their own custom status check plugins. 21 | 22 | ## Usage 23 | 24 | ```sh 25 | rallyup servers.yaml 26 | ``` 27 | 28 | ## Configuration 29 | 30 | The dependencies between servers, along with the methods for validating that they are online, are defined in a YAML configuration file. 31 | 32 | ## Servers Configuration 33 | 34 | **Fields**: 35 | - **name**: The name of the server, used for identification when defining dependencies between servers 36 | - **mac**: The MAC address of the server we want to wake up 37 | - **interface**: The network interface to use when sending the WOL packet 38 | - **vlan**: The VLAN ID (optional) that the server is on 39 | - **depends**: A list of other server names that this server depends on 40 | - **check**: A list of health checks that must pass before this server is considered fully online 41 | 42 | **Example**: 43 | ```yaml 44 | - name: "firewall" 45 | mac: "00:11:22:33:44:55" 46 | interface: "eth0" 47 | vlan: 100 48 | depends: 49 | - "storage" 50 | check: [... see below] 51 | ``` 52 | - 53 | ## Health Check Configurations 54 | 55 | Each server can have multiple health checks to ensure the server is fully online before the next device starts up. 56 | 57 | ### Common Fields 58 | 59 | - **retry**: The interval, defined in human readable string (e.g. 1s, 1 minute, etc.) to wait between retrying this health check 60 | - **timeout**: The timeout interval after which the check, and subsequently the entire boot sequence, will fail 61 | 62 | ### Built-in Health Checks 63 | 64 | #### HTTP Health Checks 65 | 66 | The HTTP health check verifies whether a specified endpoint responds as expected. 67 | 68 | **Fields** 69 | - **type**: should be `http` for an HTTP health check. 70 | - **url**: The URL to perform the HTTP health check against 71 | - **status**: Expected HTTP status code 72 | - **regex**: Regex to match in the response body 73 | 74 | > Note: You must provide either `status` or `regex`, or both. 75 | 76 | **Example** 77 | ```yaml 78 | - type: http 79 | url: "http://192.168.1.1/health" 80 | status: 200 81 | retry: 5s 82 | timeout: 30s 83 | ``` 84 | 85 | #### Port Health Check 86 | 87 | The port health check verifies whether a specified TCP port on a server is open and accessible. 88 | This is really a stand-in for verifying NFS and SMB ports until I can figure out how to check if those services are online. 89 | 90 | **Fields** 91 | - **type**: should be `port` for a port health check 92 | - **ip**: the IP address to check 93 | - **port**: the port number to check 94 | 95 | **Example** 96 | ```yaml 97 | - type: port 98 | ip: "192.168.1.1" 99 | port: 22 100 | retry: "10s" 101 | timeout: "1m" 102 | ``` 103 | 104 | #### Shell Health Checks 105 | 106 | The shell health check executes a shell command checks the result. 107 | This is to provide the option of user-defined health checks. 108 | 109 | **Fields** 110 | - **type**: should be `shell` for a shell health check. 111 | - **command**: he shell command to execute 112 | - **status**: Expected exit code 113 | - **regex**: Regex to match in the standard output 114 | 115 | > Note: You must provide either `status` or `regex`, or both. 116 | 117 | **Example** 118 | ```yaml 119 | - type: shell 120 | command: ping -c 1 192.168.1.1 121 | status: 0 122 | retry: 5s 123 | timeout: 20s 124 | ``` 125 | 126 | ### Full Example 127 | 128 | > TODO: 129 | > - [ ] Need to test in the lab and post the actual sample 130 | 131 | ```yaml 132 | - name: "Firewall" 133 | mac: "00:1A:2B:3C:4D:5E" 134 | interface: eth0 135 | vlan: 10 136 | depends: [] 137 | check: 138 | - type: http 139 | url: "http://192.168.1.1/health" 140 | status: 200 141 | regex: 'ok' 142 | 143 | - name: "Storage Server 1" 144 | mac: "00:1A:2B:3C:4D:5F" 145 | interface: eth0 146 | vlan: 100 147 | depends: 148 | - "Firewall" 149 | check: 150 | - type: port 151 | ip: 192.168.100.101 152 | port: 2049 153 | timeout: 5 minutes 154 | 155 | - name: "Storage Server 2" 156 | mac: "00:1A:2B:3C:4D:5G" 157 | vlan: 100 158 | depends: 159 | - "Firewall" 160 | check: 161 | - type: port 162 | ip: 192.168.100.102 163 | port: 445 164 | retry: 5s 165 | 166 | - name: "VM Host" 167 | mac: "00:1A:2B:3C:4D:60" 168 | vlan: 200 169 | depends: 170 | - "Storage Server 1" 171 | - "Storage Server 2" 172 | check: 173 | - type: command 174 | command: "ping -c 192.168.200.10" 175 | status: 0 176 | ``` 177 | 178 | ## License 179 | 180 | This project is licensed under either of the following licenses, at your option: 181 | 182 | - [MIT License](./LICENSE-MIT) 183 | - [Apache License 2.0](./LICENSE-APACHE) 184 | 185 | You may choose to use this project under the terms of either license. 186 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | mod servers; 2 | mod wol; 3 | 4 | use colored::*; 5 | use crossterm::{ 6 | execute, 7 | style::Print, 8 | terminal::{Clear, ClearType}, 9 | }; 10 | use std::io::{stdout, Write}; 11 | use std::{env, sync::Arc}; 12 | use tokio::{sync::RwLock, time::sleep}; 13 | 14 | const SPINNER: &[&str] = &["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"]; 15 | 16 | fn render_servers(servers: &Vec, spinner_index: usize, backtrack: u16) -> u16 { 17 | let mut stdout = stdout(); 18 | 19 | // Clear what was previously rendered 20 | if backtrack > 0 { 21 | execute!( 22 | stdout, 23 | crossterm::cursor::MoveToPreviousLine(backtrack), 24 | Clear(ClearType::FromCursorDown) 25 | ) 26 | .unwrap(); 27 | } 28 | 29 | let mut line_count = 0; 30 | 31 | for server in servers { 32 | // Display the server name and status 33 | let (icon, server_status) = match server.status { 34 | servers::ServerStatus::Waiting => ("◉".normal(), "waiting".normal()), 35 | servers::ServerStatus::WOLSent => ("◉".yellow(), "WOL sent".yellow()), 36 | servers::ServerStatus::Ok => ("◉".green(), "ok".green()), 37 | servers::ServerStatus::TimedOut => ("◉".red(), "timed-out".red()), 38 | }; 39 | execute!( 40 | stdout, 41 | Print(format!( 42 | "{} {}: {}\n", 43 | icon, 44 | server.name.bold(), 45 | server_status 46 | )) 47 | ) 48 | .unwrap(); 49 | line_count += 1; 50 | 51 | for (i, check) in server.check.iter().enumerate() { 52 | let mut extension = "│"; 53 | if i == server.check.len() - 1 { 54 | execute!(stdout, Print("└──")).unwrap(); 55 | extension = " "; 56 | } else { 57 | execute!(stdout, Print("├──")).unwrap(); 58 | } 59 | match check.status { 60 | servers::CheckStatus::Waiting => { 61 | execute!( 62 | stdout, 63 | Print(format!( 64 | " {}\n{} └── Status: {}\n", 65 | check, 66 | extension, 67 | "waiting".yellow() 68 | )) 69 | ) 70 | .unwrap(); 71 | } 72 | servers::CheckStatus::TimedOut => { 73 | execute!( 74 | stdout, 75 | Print(format!( 76 | " {}\n{} └── Status: {}\n", 77 | check, 78 | extension, 79 | "timed-out".red() 80 | )) 81 | ) 82 | .unwrap(); 83 | } 84 | 85 | servers::CheckStatus::Running => { 86 | let spinner = SPINNER[spinner_index % SPINNER.len()]; 87 | execute!( 88 | stdout, 89 | Print(format!( 90 | " {}\n{} └── Status: {}\n", 91 | check, extension, spinner 92 | )) 93 | ) 94 | .unwrap(); 95 | } 96 | servers::CheckStatus::Ok => { 97 | execute!( 98 | stdout, 99 | Print(format!( 100 | "{}\n{} └── Status: {}\n", 101 | check, 102 | extension, 103 | "ok".green() 104 | )) 105 | ) 106 | .unwrap(); 107 | } 108 | } 109 | line_count += 2; 110 | } 111 | execute!(stdout, Print("\n")).unwrap(); 112 | line_count += 1; 113 | } 114 | stdout.flush().unwrap(); 115 | line_count 116 | } 117 | 118 | async fn update_server_status(servers: Arc>>) { 119 | let mut spinner_index = 0; 120 | let mut last_line_count = 0; 121 | 122 | loop { 123 | { 124 | let servers = servers.read().await; 125 | last_line_count = render_servers(&servers, spinner_index, last_line_count); 126 | } 127 | 128 | spinner_index = (spinner_index + 1) % SPINNER.len(); 129 | 130 | sleep(std::time::Duration::from_millis(200)).await; 131 | } 132 | } 133 | 134 | fn print_help() { 135 | println!("Usage: rallyup "); 136 | println!("rallyup: A tool to send Wake-on-LAN packets to servers in dependency order"); 137 | } 138 | 139 | #[tokio::main] 140 | async fn main() -> Result<(), anyhow::Error> { 141 | let args: Vec = env::args().collect(); 142 | 143 | if args.len() != 2 { 144 | print_help(); 145 | return Ok(()); 146 | } 147 | 148 | let filename = &args[1]; 149 | 150 | let wake_order = servers::parse_server_dependencies(filename)?; 151 | 152 | let mut line_count = 0; 153 | for server in wake_order.iter() { 154 | // server status line 155 | line_count += 1; 156 | // 2 lines per health check 157 | line_count += server.check.len() as u16 * 2; 158 | // newline between servers 159 | line_count += 1; 160 | } 161 | 162 | // Need to keep it in a Arc since the status render loop will be reading 163 | // the server status while the health checks may be updating it concurrently 164 | let servers = Arc::new(RwLock::new(wake_order.clone())); 165 | 166 | tokio::spawn(update_server_status(servers.clone())); 167 | 168 | for (server_index, server) in wake_order.into_iter().enumerate() { 169 | wol::send_wol_packet(&server.mac, &server.interface, server.vlan)?; 170 | { 171 | let mut servers = servers.write().await; 172 | servers[server_index].status = servers::ServerStatus::WOLSent; 173 | } 174 | 175 | let server_status = servers::perform_health_checks(servers.clone(), server_index).await; 176 | 177 | if let servers::ServerStatus::TimedOut = server_status { 178 | let servers = servers.read().await; 179 | render_servers(&servers, 0, line_count); 180 | return Err(anyhow::anyhow!( 181 | "health check for {} timed out", 182 | server.name 183 | )); 184 | } 185 | } 186 | 187 | { 188 | let servers = servers.read().await; 189 | render_servers(&servers, 0, line_count); 190 | } 191 | return Ok(()); 192 | } 193 | -------------------------------------------------------------------------------- /src/wol.rs: -------------------------------------------------------------------------------- 1 | use pnet::datalink::NetworkInterface; 2 | use pnet::datalink::{self, Channel::Ethernet}; 3 | use pnet::packet::ethernet::{EtherTypes, EthernetPacket, MutableEthernetPacket}; 4 | use pnet::packet::{MutablePacket, Packet}; 5 | use pnet::util::MacAddr; 6 | 7 | use thiserror::Error; 8 | 9 | const SIZE_DST_MAC: usize = 6; 10 | const SIZE_SRC_MAC: usize = 6; 11 | const SIZE_ETHERTYPE: usize = 2; 12 | const SIZE_VLAN_ETHERTYPE: usize = 2; 13 | const SIZE_VLAN_TAG: usize = 2; 14 | const SIZE_WOL_PAYLOAD: usize = 102; 15 | 16 | const WOL_ETHERTYPE: [u8; 2] = [0x08, 0x42]; 17 | 18 | #[derive(Debug, Error)] 19 | pub enum WOLError { 20 | #[error("Invalid MAC address: {0}")] 21 | InvalidMAC(String), 22 | 23 | #[error("Failed to find network interface: {0}")] 24 | InterfaceNotFound(String), 25 | 26 | #[error("Network error: {0}")] 27 | NetworkError(#[from] std::io::Error), 28 | 29 | #[error("Failed to send WOL packet for server: {0}")] 30 | WOLPacketError(String), 31 | } 32 | 33 | type Result = std::result::Result; 34 | 35 | // Ethernet Frame Layout: 36 | // ----------------------------------------------------------------------------- 37 | // | Destination MAC | Source MAC | VLAN EtherType | VLAN Tag | WOL EtherType | WOL Magic Packet | 38 | // | (Broadcast MAC) | (Interface MAC) | (0x8100) | (VLAN ID)| (0x0842) | (FF:FF:FF + 16 * Target MAC) | 39 | // ----------------------------------------------------------------------------- 40 | // | 6 bytes | 6 bytes | 2 bytes | 2 bytes | 2 bytes | 102 bytes | 41 | // ----------------------------------------------------------------------------- 42 | // Detailed Breakdown of Each Component: 43 | // - Destination MAC (6 bytes): The destination MAC address, usually the broadcast MAC (FF:FF:FF:FF:FF:FF) for WOL packets. 44 | // - Source MAC (6 bytes): The source MAC address, which is the MAC address of the sending interface. 45 | // - VLAN EtherType (2 bytes): The EtherType field for VLAN tagging, which is always 0x8100 to indicate the presence of a VLAN tag. 46 | // - VLAN Tag (2 bytes): The VLAN tag, which contains 12 bits for the VLAN ID and 4 bits for priority and CFI (Canonical Format Indicator). 47 | // - WOL EtherType (2 bytes): The EtherType field indicating a Wake-on-LAN packet, which is 0x0842. 48 | // - WOL Magic Packet (102 bytes): The WOL magic packet, consisting of 6 bytes of FF followed by the target MAC address repeated 16 times. 49 | 50 | fn create_wol_payload(mac: MacAddr) -> Vec { 51 | // 6 bytes of FF followed by target MAC address repeated 16 times 52 | let mut packet = vec![0xFF; 6]; 53 | for _ in 0..16 { 54 | packet.extend_from_slice(&mac.octets()); 55 | } 56 | packet 57 | } 58 | 59 | fn vlan_to_bytes(vlan: u16) -> Vec { 60 | // Do not need priority bits, using only the remaining 14 bits of the tag 61 | let vlan_tag = (vlan & 0x0FFF).to_be_bytes(); 62 | vlan_tag.to_vec() 63 | } 64 | 65 | pub fn build_wol_packet( 66 | maybe_mac: &str, 67 | interface_name: &str, 68 | vlan_id: Option, 69 | ) -> Result<(Vec, NetworkInterface)> { 70 | let mac = maybe_mac 71 | .parse::() 72 | .map_err(|_| WOLError::InvalidMAC(maybe_mac.to_string()))?; 73 | 74 | let wol_packet = create_wol_payload(mac); 75 | 76 | let interface = datalink::interfaces() 77 | .into_iter() 78 | .find(|iface| iface.name == interface_name) 79 | .ok_or_else(|| WOLError::InterfaceNotFound(interface_name.to_string()))?; 80 | 81 | let payload_size = if vlan_id.is_some() { 82 | SIZE_VLAN_TAG + SIZE_VLAN_ETHERTYPE 83 | } else { 84 | 0 85 | } + SIZE_WOL_PAYLOAD; 86 | 87 | let packet_size = SIZE_DST_MAC + SIZE_SRC_MAC + SIZE_ETHERTYPE + payload_size; 88 | let mut buffer = vec![0u8; packet_size]; 89 | 90 | let mut packet = MutableEthernetPacket::new(&mut buffer[..]) 91 | .ok_or_else(|| WOLError::WOLPacketError("failed to create ethernet packet".into()))?; 92 | 93 | packet.set_destination(MacAddr::broadcast()); 94 | 95 | if let Some(mac) = interface.mac { 96 | packet.set_source(mac); 97 | } else { 98 | return Err(WOLError::NetworkError(std::io::Error::new( 99 | std::io::ErrorKind::Other, 100 | "failed to get source MAC address of the interface", 101 | ))); 102 | } 103 | 104 | let payload_offset = if let Some(vlan) = vlan_id { 105 | packet.set_ethertype(EtherTypes::Vlan); 106 | 107 | let vlan_tag = vlan_to_bytes(vlan); 108 | packet.payload_mut()[..SIZE_VLAN_TAG].copy_from_slice(&vlan_tag); 109 | 110 | // Set WOL Ethertype manually 111 | packet.payload_mut()[SIZE_VLAN_TAG..(SIZE_VLAN_TAG + SIZE_ETHERTYPE)] 112 | .copy_from_slice(&WOL_ETHERTYPE); 113 | 114 | SIZE_VLAN_TAG + SIZE_ETHERTYPE 115 | } else { 116 | packet.set_ethertype(EtherTypes::WakeOnLan); 117 | 0 118 | }; 119 | 120 | packet.payload_mut()[payload_offset..].copy_from_slice(&wol_packet); 121 | 122 | Ok((buffer, interface)) 123 | } 124 | 125 | pub fn send_wol_packet(maybe_mac: &str, interface_name: &str, vlan_id: Option) -> Result<()> { 126 | let (packet_buffer, interface) = build_wol_packet(maybe_mac, interface_name, vlan_id)?; 127 | 128 | let packet = EthernetPacket::new(&packet_buffer) 129 | .expect("`packet_buffer` was created by a `MutableEthernetPacket`, should not error here"); 130 | 131 | let mut tx = match datalink::channel(&interface, Default::default()) { 132 | Ok(Ethernet(tx, _)) => tx, 133 | Ok(_) => { 134 | return Err(WOLError::NetworkError(std::io::Error::new( 135 | std::io::ErrorKind::Other, 136 | "unhandled channel type for this interface", 137 | ))) 138 | } 139 | Err(e) => return Err(WOLError::NetworkError(e)), 140 | }; 141 | 142 | tx.send_to(packet.packet(), None).ok_or_else(|| { 143 | std::io::Error::new(std::io::ErrorKind::Other, "failed to send WOL packet") 144 | })??; 145 | 146 | Ok(()) 147 | } 148 | 149 | #[cfg(test)] 150 | mod tests { 151 | use super::*; 152 | 153 | #[test] 154 | fn test_invalid_mac_address() { 155 | let invalid_mac = "random MAC"; 156 | let interface_name = "eth0"; 157 | 158 | let result = send_wol_packet(invalid_mac, interface_name, None); 159 | assert!( 160 | matches!(result, Err(WOLError::InvalidMAC(_))), 161 | "Expected InvalidMAC error." 162 | ); 163 | } 164 | 165 | #[test] 166 | fn test_missing_network_interface() { 167 | let mac = "00:11:22:33:44:55"; 168 | let non_existent_interface = "nonexistent_iface"; 169 | 170 | let result = send_wol_packet(mac, non_existent_interface, None); 171 | assert!( 172 | matches!(result, Err(WOLError::InterfaceNotFound(_))), 173 | "Expected InterfaceNotFound error." 174 | ); 175 | } 176 | 177 | #[test] 178 | fn test_ethernet_packet() { 179 | let maybe_mac = "01:23:45:67:89:AB"; 180 | let mac = maybe_mac.parse::().unwrap(); 181 | let dest_mac = MacAddr::broadcast(); 182 | //let vlan_id = Some(100); 183 | 184 | let interface = datalink::interfaces() 185 | .into_iter() 186 | .find(|iface| iface.mac.is_some()) 187 | .expect("cannot find an interface with a MAC address for testing"); 188 | 189 | let payload_size = SIZE_WOL_PAYLOAD; 190 | let packet_size = SIZE_DST_MAC + SIZE_SRC_MAC + SIZE_ETHERTYPE + payload_size; 191 | 192 | let (buffer, _interface) = build_wol_packet(maybe_mac, &interface.name, None) 193 | .expect("failed to build test packet"); 194 | 195 | assert_eq!(packet_size, buffer.len()); 196 | 197 | // L2 broadcast address 198 | assert_eq!(dest_mac.octets(), buffer[..6]); 199 | // Source MAC 200 | assert_eq!(interface.mac.unwrap().octets(), buffer[6..12]); 201 | // WOL Ethertype 202 | assert_eq!(vec![0x08, 0x42], buffer[12..14]); 203 | // WOL packet prefix 204 | assert_eq!(vec![0xFF; 6], buffer[14..20]); 205 | // WOL target MAC x 16 206 | assert_eq!(mac.octets().repeat(16), buffer[20..]); 207 | } 208 | 209 | #[test] 210 | fn test_ethernet_packet_with_vlan() { 211 | let maybe_mac = "01:23:45:67:89:AB"; 212 | let mac = maybe_mac.parse::().unwrap(); 213 | let dest_mac = MacAddr::broadcast(); 214 | let vlan_id = Some(0x0101); 215 | 216 | let interface = datalink::interfaces() 217 | .into_iter() 218 | .find(|iface| iface.mac.is_some()) 219 | .expect("cannot find an interface with a MAC address for testing"); 220 | 221 | let payload_size = SIZE_VLAN_TAG + SIZE_VLAN_ETHERTYPE + SIZE_WOL_PAYLOAD; 222 | let packet_size = SIZE_DST_MAC + SIZE_SRC_MAC + SIZE_ETHERTYPE + payload_size; 223 | 224 | let (buffer, _interface) = build_wol_packet(maybe_mac, &interface.name, vlan_id) 225 | .expect("failed to build test packet"); 226 | 227 | assert_eq!(packet_size, buffer.len()); 228 | 229 | // L2 broadcast address 230 | assert_eq!(dest_mac.octets(), buffer[..6]); 231 | // Source MAC 232 | assert_eq!(interface.mac.unwrap().octets(), buffer[6..12]); 233 | // VLAN Ethertype 234 | assert_eq!(vec![0x81, 0x00], buffer[12..14]); 235 | // VLAN Tag 236 | assert_eq!(vec![0x01, 0x01], buffer[14..16]); 237 | // WOL Ethertype 238 | assert_eq!(vec![0x08, 0x42], buffer[16..18]); 239 | // WOL packet prefix 240 | assert_eq!(vec![0xFF; 6], buffer[18..24]); 241 | // WOL target MAC x 16 242 | assert_eq!(mac.octets().repeat(16), buffer[24..]); 243 | } 244 | } 245 | -------------------------------------------------------------------------------- /LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2024 Computer Union Co., Ltd. 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /src/servers.rs: -------------------------------------------------------------------------------- 1 | use colored::Colorize; 2 | use regex::Regex; 3 | use serde::Deserialize; 4 | use std::{ 5 | collections::{HashMap, HashSet}, 6 | fmt, fs, 7 | net::IpAddr, 8 | process::Stdio, 9 | sync::Arc, 10 | time::Instant, 11 | }; 12 | use tokio::{net::TcpStream, process::Command, sync::RwLock}; 13 | 14 | use thiserror::Error; 15 | 16 | #[derive(Debug, Error)] 17 | pub enum ServerConfigError { 18 | #[error("Failed to parse config file: {0}")] 19 | ParseError(String), 20 | 21 | #[error("Found undefined dependency: {0}")] 22 | UndefinedDependency(String), 23 | 24 | #[error("Found circular dependency: {0}")] 25 | CircularDependency(String), 26 | 27 | #[error("Misconfigured healthcheck: {0}")] 28 | BadHealthCheckDefinition(String), 29 | } 30 | 31 | fn default_retry_duration() -> std::time::Duration { 32 | std::time::Duration::from_secs(10) 33 | } 34 | 35 | fn default_timeout_duration() -> std::time::Duration { 36 | // 5 minutes timeout 37 | // some servers might take longer, but that can be overridden in the config 38 | std::time::Duration::from_secs(300) 39 | } 40 | 41 | #[derive(Debug, Clone, Copy, Default)] 42 | pub enum CheckStatus { 43 | #[default] 44 | Waiting, 45 | Running, 46 | TimedOut, 47 | Ok, 48 | } 49 | 50 | #[derive(Debug, Deserialize, Clone)] 51 | pub struct HealthCheck { 52 | #[serde(default = "default_retry_duration", with = "humantime_serde")] 53 | pub retry: std::time::Duration, 54 | 55 | #[serde(default = "default_timeout_duration", with = "humantime_serde")] 56 | pub timeout: std::time::Duration, 57 | 58 | #[serde(flatten)] 59 | pub method: HealthCheckMethod, 60 | 61 | #[serde(skip)] 62 | pub status: CheckStatus, 63 | } 64 | 65 | impl fmt::Display for HealthCheck { 66 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 67 | write!(f, "{}", self.method) 68 | } 69 | } 70 | 71 | #[derive(Debug, Deserialize, Clone)] 72 | #[serde(tag = "type", rename_all = "snake_case")] 73 | pub enum HealthCheckMethod { 74 | Http { 75 | url: String, 76 | status: Option, 77 | #[serde(default, with = "serde_regex")] 78 | regex: Option, 79 | }, 80 | Port { 81 | ip: String, 82 | port: u16, 83 | }, 84 | Shell { 85 | command: String, 86 | status: Option, 87 | #[serde(default, with = "serde_regex")] 88 | regex: Option, 89 | }, 90 | } 91 | 92 | fn truncate_command(command: &str, max_length: usize) -> String { 93 | if command.len() > max_length { 94 | // Truncate to 27 characters and add "..." to make it 30 characters in total 95 | format!("{}{}", &command[..max_length - 3], "...".yellow()) 96 | } else { 97 | command.to_string() 98 | } 99 | } 100 | 101 | impl fmt::Display for HealthCheckMethod { 102 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 103 | match self { 104 | HealthCheckMethod::Http { 105 | url, 106 | status: _, 107 | regex: _, 108 | } => write!(f, "{} [{}]", "http".bold(), url), 109 | HealthCheckMethod::Port { ip, port } => { 110 | write!(f, "{} [{}:{}]", "port".bold(), ip, port) 111 | } 112 | HealthCheckMethod::Shell { 113 | command, 114 | status: _, 115 | regex: _, 116 | } => write!(f, "{} [{}]", "shell".bold(), truncate_command(command, 30)), 117 | } 118 | } 119 | } 120 | 121 | #[derive(Debug, Clone, Copy, Default, PartialEq, Eq)] 122 | pub enum ServerStatus { 123 | #[default] 124 | Waiting, 125 | WOLSent, 126 | Ok, 127 | TimedOut, 128 | } 129 | 130 | #[derive(Debug, Deserialize, Clone)] 131 | pub struct Server { 132 | pub name: String, 133 | pub mac: String, 134 | pub interface: String, 135 | #[serde(default)] 136 | pub vlan: Option, 137 | 138 | #[serde(default)] 139 | pub depends: Vec, 140 | #[serde(default)] 141 | pub check: Vec, 142 | 143 | #[serde(skip)] 144 | pub status: ServerStatus, 145 | } 146 | 147 | fn map_server_names(servers: &[Server]) -> HashMap { 148 | servers.iter().map(|s| (s.name.clone(), s)).collect() 149 | } 150 | 151 | fn determine_wakeup_order(servers: &[Server]) -> Result, ServerConfigError> { 152 | let server_from_name = map_server_names(servers); 153 | 154 | let mut visited = HashSet::new(); 155 | let mut visiting = HashSet::new(); 156 | let mut sorted = Vec::new(); 157 | 158 | for server in servers { 159 | if !visited.contains(&server.name) { 160 | depth_first_search( 161 | server, 162 | &server_from_name, 163 | &mut visited, 164 | &mut visiting, 165 | &mut sorted, 166 | )?; 167 | } 168 | } 169 | 170 | let servers_in_order: Vec = sorted 171 | .iter() 172 | .map(|name| *server_from_name.get(name).unwrap()) 173 | .cloned() 174 | .collect(); 175 | Ok(servers_in_order) 176 | } 177 | 178 | fn depth_first_search( 179 | server: &Server, 180 | server_from_name: &HashMap, 181 | visited: &mut HashSet, 182 | visiting: &mut HashSet, 183 | sorted: &mut Vec, 184 | ) -> Result<(), ServerConfigError> { 185 | if visiting.contains(&server.name) { 186 | return Err(ServerConfigError::CircularDependency(server.name.clone())); 187 | } 188 | 189 | if visited.contains(&server.name) { 190 | return Ok(()); 191 | } 192 | 193 | visiting.insert(server.name.clone()); 194 | 195 | for dep in &server.depends { 196 | let dep_server = server_from_name 197 | .get(dep) 198 | .ok_or_else(|| ServerConfigError::UndefinedDependency(dep.clone()))?; 199 | depth_first_search(dep_server, server_from_name, visited, visiting, sorted)?; 200 | } 201 | 202 | visiting.remove(&server.name); 203 | visited.insert(server.name.clone()); 204 | 205 | sorted.push(server.name.clone()); 206 | 207 | Ok(()) 208 | } 209 | 210 | fn validate_health_check(healthcheck: &HealthCheckMethod) -> Result<(), ServerConfigError> { 211 | match healthcheck { 212 | HealthCheckMethod::Http { 213 | url: _, 214 | status, 215 | regex, 216 | } => { 217 | if status.is_none() && regex.is_none() { 218 | return Err(ServerConfigError::BadHealthCheckDefinition("HTTP health check requires an HTTP status code to match and/or a Regex to match in the response".into())); 219 | } 220 | } 221 | HealthCheckMethod::Port { ip, port: _ } => { 222 | if ip.parse::().is_err() { 223 | return Err(ServerConfigError::BadHealthCheckDefinition( 224 | "Port check requires a valid IP address".into(), 225 | )); 226 | } 227 | } 228 | HealthCheckMethod::Shell { 229 | command: _, 230 | status, 231 | regex, 232 | } => { 233 | if status.is_none() && regex.is_none() { 234 | return Err(ServerConfigError::BadHealthCheckDefinition("Health check via shell command requires an return code to match and/or a Regex to match in the standard output".into())); 235 | } 236 | } 237 | } 238 | 239 | Ok(()) 240 | } 241 | 242 | pub fn parse_server_dependencies(file_path: &str) -> Result, ServerConfigError> { 243 | let yaml_content = 244 | fs::read_to_string(file_path).map_err(|e| ServerConfigError::ParseError(e.to_string()))?; 245 | 246 | let servers: Vec = serde_yaml_ng::from_str(&yaml_content) 247 | .map_err(|e| ServerConfigError::ParseError(e.to_string()))?; 248 | 249 | for server in &servers { 250 | for healthcheck in &server.check { 251 | validate_health_check(&healthcheck.method)?; 252 | } 253 | } 254 | 255 | // Apply topological sort to determine order to wake the servers 256 | // check for circular and undefined servers along the way 257 | let sorted = determine_wakeup_order(&servers)?; 258 | 259 | Ok(sorted) 260 | } 261 | 262 | async fn http_health_check( 263 | url: &str, 264 | expected_status: Option, 265 | payload_regex: Option, 266 | ) -> bool { 267 | if let Ok(response) = reqwest::get(url).await { 268 | if let Some(status) = expected_status { 269 | if response.status().as_u16() != status { 270 | return false; 271 | } 272 | } 273 | if let Some(regex) = payload_regex { 274 | if let Ok(body) = response.text().await { 275 | if regex.is_match(&body) { 276 | return true; 277 | } 278 | }; 279 | return false; 280 | } 281 | return true; 282 | }; 283 | false 284 | } 285 | 286 | async fn port_health_check(ip: &str, port: u16) -> bool { 287 | let address = format!("{}:{}", ip, port); 288 | TcpStream::connect(address).await.is_ok() 289 | } 290 | 291 | async fn shell_health_check( 292 | command: &str, 293 | expected_status: Option, 294 | payload_regex: Option, 295 | ) -> bool { 296 | let result = Command::new("sh") 297 | .arg("-c") 298 | .arg(command) 299 | .stdout(Stdio::piped()) 300 | .stderr(Stdio::piped()) 301 | .output() 302 | .await; 303 | 304 | if let Ok(output) = result { 305 | if let Some(status) = expected_status { 306 | if output.status.code() != Some(status) { 307 | return false; 308 | } 309 | } 310 | 311 | let stdout = String::from_utf8_lossy(&output.stdout); 312 | if let Some(regex) = payload_regex { 313 | if !regex.is_match(&stdout) { 314 | return false; 315 | } 316 | } 317 | return true; 318 | }; 319 | false 320 | } 321 | 322 | pub async fn check_health(check: HealthCheckMethod) -> bool { 323 | match check { 324 | HealthCheckMethod::Http { url, status, regex } => { 325 | http_health_check(&url, status, regex).await 326 | } 327 | HealthCheckMethod::Port { ip, port } => port_health_check(&ip, port).await, 328 | HealthCheckMethod::Shell { 329 | command, 330 | status, 331 | regex, 332 | } => shell_health_check(&command, status, regex).await, 333 | } 334 | } 335 | 336 | pub async fn perform_health_checks( 337 | servers: Arc>>, 338 | index: usize, 339 | ) -> ServerStatus { 340 | let mut tasks = Vec::new(); 341 | 342 | let checks = { 343 | let servers_read = servers.read().await; 344 | servers_read[index].check.clone() 345 | }; 346 | 347 | for (check_index, check) in checks.into_iter().enumerate() { 348 | { 349 | let mut servers_write = servers.write().await; 350 | servers_write[index].check[check_index].status = CheckStatus::Running; 351 | } 352 | 353 | let servers_clone = servers.clone(); 354 | tasks.push(tokio::spawn(async move { 355 | let start_time = Instant::now(); 356 | loop { 357 | if start_time.elapsed() >= check.timeout { 358 | { 359 | let mut servers_write = servers_clone.write().await; 360 | servers_write[index].check[check_index].status = CheckStatus::TimedOut; 361 | } 362 | return CheckStatus::TimedOut; 363 | } 364 | if check_health(check.method.clone()).await { 365 | break; 366 | } else { 367 | tokio::time::sleep(check.retry).await; 368 | } 369 | } 370 | { 371 | let mut servers_write = servers_clone.write().await; 372 | servers_write[index].check[check_index].status = CheckStatus::Ok; 373 | } 374 | CheckStatus::Ok 375 | })) 376 | } 377 | 378 | let mut timeout = false; 379 | for task in tasks { 380 | if let CheckStatus::TimedOut = task.await.unwrap() { 381 | timeout = true; 382 | } 383 | } 384 | { 385 | let mut servers_write = servers.write().await; 386 | servers_write[index].status = if timeout { 387 | ServerStatus::TimedOut 388 | } else { 389 | ServerStatus::Ok 390 | }; 391 | } 392 | 393 | if timeout { 394 | ServerStatus::TimedOut 395 | } else { 396 | ServerStatus::Ok 397 | } 398 | } 399 | 400 | #[cfg(test)] 401 | mod tests { 402 | use super::*; 403 | 404 | #[test] 405 | fn test_circular_dependencies() { 406 | let yaml_data = r#" 407 | - name: "server1" 408 | mac: "00:11:22:33:44:55" 409 | interface: "eth0" 410 | vlan: 100 411 | depends: 412 | - "server2" 413 | check: [] 414 | 415 | - name: "server2" 416 | mac: "66:77:88:99:AA:BB" 417 | interface: "eth0" 418 | vlan: 100 419 | depends: 420 | - "server3" 421 | check: [] 422 | 423 | - name: "server3" 424 | mac: "AA:BB:CC:DD:EE:FF" 425 | interface: "eth1" 426 | vlan: 200 427 | depends: 428 | - "server4" 429 | check: [] 430 | 431 | - name: "server4" 432 | mac: "FF:EE:DD:CC:BB:AA" 433 | interface: "eth1" 434 | vlan: 200 435 | depends: 436 | - "server1" 437 | check: [] 438 | "#; 439 | 440 | let servers: Vec = 441 | serde_yaml_ng::from_str(yaml_data).expect("Failed to parse YAML"); 442 | 443 | let result = determine_wakeup_order(&servers); 444 | match result { 445 | Err(ServerConfigError::CircularDependency(circular_server)) => { 446 | assert_eq!(circular_server, "server1".to_string()); 447 | } 448 | _ => panic!("Expected a circular dependency error"), 449 | } 450 | } 451 | 452 | #[test] 453 | fn test_no_circular_dependencies_with() { 454 | let yaml_data = r#" 455 | - name: "server1" 456 | mac: "00:11:22:33:44:55" 457 | interface: "eth0" 458 | vlan: 100 459 | depends: 460 | - "server2" 461 | check: [] 462 | 463 | - name: "server2" 464 | mac: "66:77:88:99:AA:BB" 465 | interface: "eth0" 466 | vlan: 100 467 | depends: 468 | - "server3" 469 | check: [] 470 | 471 | - name: "server3" 472 | mac: "AA:BB:CC:DD:EE:FF" 473 | interface: "eth1" 474 | vlan: 200 475 | depends: [] 476 | check: [] 477 | "#; 478 | 479 | // Deserialize the YAML string into a ServerDependencyConfig 480 | let servers: Vec = 481 | serde_yaml_ng::from_str(yaml_data).expect("Failed to parse YAML"); 482 | 483 | // Call the validate_dependencies function and check if it passes without errors. 484 | let result = determine_wakeup_order(&servers); 485 | 486 | // We expect no errors, meaning no circular dependencies exist. 487 | assert!(result.is_ok(), "Expected no circular dependencies"); 488 | } 489 | 490 | #[test] 491 | fn test_invalid_http_check() { 492 | let yaml_data = r#" 493 | name: "server1" 494 | mac: "00:11:22:33:44:55" 495 | interface: "eth0" 496 | vlan: 100 497 | depends: [] 498 | check: 499 | - type: http 500 | url: "http://example.com" 501 | "#; 502 | 503 | let server: Server = serde_yaml_ng::from_str(yaml_data).expect("Failed to parse YAML"); 504 | let result = validate_health_check(&server.check[0].method); 505 | assert!(matches!( 506 | result, 507 | Err(ServerConfigError::BadHealthCheckDefinition(_)) 508 | )); 509 | } 510 | 511 | #[test] 512 | fn test_invalid_shell_check() { 513 | let yaml_data = r#" 514 | name: "server1" 515 | mac: "00:11:22:33:44:55" 516 | interface: "eth0" 517 | vlan: 100 518 | depends: [] 519 | check: 520 | - type: shell 521 | command: curl something 522 | retry: 2 minutes 523 | "#; 524 | 525 | let server: Server = serde_yaml_ng::from_str(yaml_data).expect("Failed to parse YAML"); 526 | let result = validate_health_check(&server.check[0].method); 527 | assert!(matches!( 528 | result, 529 | Err(ServerConfigError::BadHealthCheckDefinition(_)) 530 | )); 531 | } 532 | 533 | #[test] 534 | fn test_invalid_port_check() { 535 | let yaml_data = r#" 536 | name: "server1" 537 | mac: "00:11:22:33:44:55" 538 | interface: "eth0" 539 | vlan: 100 540 | depends: [] 541 | check: 542 | - type: port 543 | ip: "invalid_ip" # Invalid IP address 544 | port: 80 545 | "#; 546 | 547 | let server: Server = serde_yaml_ng::from_str(yaml_data).expect("Failed to parse YAML"); 548 | let result = validate_health_check(&server.check[0].method); 549 | 550 | assert!(matches!( 551 | result, 552 | Err(ServerConfigError::BadHealthCheckDefinition(_)) 553 | )); 554 | } 555 | 556 | #[test] 557 | fn test_valid_health_checks() { 558 | let yaml_data = r#" 559 | name: "server1" 560 | mac: "00:11:22:33:44:55" 561 | interface: "eth0" 562 | vlan: 100 563 | depends: [] 564 | check: 565 | - type: http 566 | url: "http://example.com" 567 | status: 200 # Valid: status is provided 568 | regex: ~ 569 | - type: port 570 | ip: "192.168.1.1" # Valid IP 571 | port: 80 572 | - type: shell 573 | command: "echo Hello" 574 | status: ~ # Valid: regex is provided 575 | regex: "Hello" 576 | "#; 577 | 578 | let server: Server = serde_yaml_ng::from_str(yaml_data).expect("Failed to parse YAML"); 579 | for healthcheck in &server.check { 580 | let result = validate_health_check(&healthcheck.method); 581 | assert!(result.is_ok()) 582 | } 583 | } 584 | 585 | #[test] 586 | fn test_determine_wakeup_order() { 587 | // Define the YAML string for servers with dependencies 588 | let yaml_data = r#" 589 | - name: "server_a" 590 | mac: "00:11:22:33:44:55" 591 | interface: "eth0" 592 | depends: 593 | - "server_b" 594 | - "server_c" 595 | 596 | - name: "server_b" 597 | mac: "11:22:33:44:55:66" 598 | interface: "eth0" 599 | depends: 600 | - "server_c" 601 | 602 | - name: "server_c" 603 | mac: "22:33:44:55:66:77" 604 | interface: "eth0" 605 | "#; 606 | 607 | // Parse the YAML string into the expected structure 608 | let servers: Vec = 609 | serde_yaml_ng::from_str(yaml_data).expect("Failed to parse YAML"); 610 | 611 | // Expected topologically sorted order (server_c first, then server_b, then server_a) 612 | let expected_order = vec!["server_c", "server_b", "server_a"]; 613 | 614 | // Call the function to get the wakeup order 615 | let result = determine_wakeup_order(&servers).expect("Failed to determine wakeup order"); 616 | 617 | // Check that the result matches the expected order 618 | assert_eq!( 619 | result.into_iter().map(|s| s.name).collect::>(), 620 | expected_order 621 | ); 622 | } 623 | 624 | #[tokio::test] 625 | async fn test_http_health_check_success() { 626 | let mut server = mockito::Server::new_async().await; 627 | server 628 | .mock("GET", "/health") 629 | .with_status(200) 630 | .with_body("healthy") 631 | .create_async() 632 | .await; 633 | 634 | let url = format!("{}/health", server.url()); 635 | 636 | // Status and regex match 637 | let status = Some(200); 638 | let regex = Some(Regex::new("health").unwrap()); 639 | 640 | let result = http_health_check(&url, status, regex).await; 641 | assert!(result); 642 | 643 | // Just status 644 | let status = Some(200); 645 | let regex = None; 646 | 647 | let result = http_health_check(&url, status, regex).await; 648 | assert!(result); 649 | 650 | // Just regex 651 | let status = None; 652 | let regex = Some(Regex::new("health").unwrap()); 653 | 654 | let result = http_health_check(&url, status, regex).await; 655 | assert!(result); 656 | } 657 | 658 | #[tokio::test] 659 | async fn test_http_health_check_fail() { 660 | // Mock a failed response 661 | let mut server = mockito::Server::new_async().await; 662 | server 663 | .mock("GET", "/health") 664 | .with_status(503) 665 | .with_body("Service Unavailable") 666 | .create_async() 667 | .await; 668 | 669 | let url = format!("{}/health", server.url()); 670 | 671 | // Status and regex match 672 | let status = Some(200); 673 | let regex = Some(Regex::new("health").unwrap()); 674 | 675 | let result = http_health_check(&url, status, regex).await; 676 | assert!(!result); 677 | 678 | // Just status 679 | let status = Some(200); 680 | let regex = None; 681 | 682 | let result = http_health_check(&url, status, regex).await; 683 | assert!(!result); 684 | 685 | // Just regex 686 | let status = None; 687 | let regex = Some(Regex::new("health").unwrap()); 688 | 689 | let result = http_health_check(&url, status, regex).await; 690 | assert!(!result); 691 | } 692 | 693 | #[tokio::test] 694 | async fn test_port_health_check_success() { 695 | // Set up a mock TCP listener on an available port 696 | let listener = tokio::net::TcpListener::bind(("127.0.0.1", 0)) 697 | .await 698 | .unwrap(); 699 | 700 | let port = listener.local_addr().unwrap().port(); 701 | let ip = "127.0.0.1"; 702 | 703 | // Simulate the health check 704 | let result = port_health_check(&ip, port).await; 705 | assert!(result); 706 | 707 | drop(listener); // Close the listener 708 | } 709 | 710 | #[tokio::test] 711 | async fn test_port_health_check_fail() { 712 | // Set up a mock TCP listener on an available port 713 | // Could probably just pick a random port, but I want to make sure 714 | // we don't accidentally pick a port that's in use by other process 715 | let listener = tokio::net::TcpListener::bind(("127.0.0.1", 0)) 716 | .await 717 | .unwrap(); 718 | let port = listener.local_addr().unwrap().port(); 719 | drop(listener); 720 | 721 | let ip = "127.0.0.1"; 722 | 723 | let result = port_health_check(&ip, port).await; 724 | assert!(!result); 725 | } 726 | 727 | #[tokio::test] 728 | async fn test_shell_health_check_success() { 729 | let command = "echo 'hello'"; 730 | 731 | // Status and regex 732 | let status = Some(0); 733 | let regex = Some(Regex::new("hello").unwrap()); 734 | let result = shell_health_check(&command, status, regex).await; 735 | 736 | assert!(result); 737 | 738 | // Just status 739 | let status = Some(0); 740 | let regex = None; 741 | let result = shell_health_check(&command, status, regex).await; 742 | 743 | assert!(result); 744 | 745 | // Just regex 746 | let status = None; 747 | let regex = Some(Regex::new("hello").unwrap()); 748 | let result = shell_health_check(&command, status, regex).await; 749 | 750 | assert!(result); 751 | } 752 | 753 | #[tokio::test] 754 | async fn test_shell_health_check_fail() { 755 | let command = "echo 'hello'"; 756 | 757 | // Regex does not match 758 | let status = None; 759 | let regex = Some(Regex::new("world").unwrap()); 760 | let result = shell_health_check(&command, status, regex).await; 761 | assert!(!result); 762 | 763 | // Status does not match 764 | let status = Some(1); 765 | let regex = None; 766 | let result = shell_health_check(&command, status, regex).await; 767 | assert!(!result); 768 | 769 | // Regex and status does not match 770 | let status = Some(1); 771 | let regex = Some(Regex::new("world").unwrap()); 772 | let result = shell_health_check(&command, status, regex).await; 773 | assert!(!result); 774 | } 775 | 776 | #[tokio::test] 777 | async fn test_health_check_timeout() { 778 | let mut server = mockito::Server::new_async().await; 779 | let mock = server 780 | .mock("GET", "/") 781 | .with_status(500) 782 | .expect(3) 783 | .create_async() 784 | .await; 785 | 786 | let yaml_data = r#" 787 | - name: "timeout_test_server" 788 | mac: "00:11:22:33:44:55" 789 | interface: "eth0" 790 | vlan: 100 791 | depends: [] 792 | check: 793 | - type: http 794 | url: 795 | status: 200 796 | retry: 800 ms 797 | timeout: 2s 798 | "#; 799 | 800 | let yaml_data = yaml_data.replace("", &server.url()); 801 | 802 | let servers: Vec = 803 | serde_yaml_ng::from_str(&yaml_data).expect("Failed to parse YAML"); 804 | 805 | let server_state = Arc::new(RwLock::new(servers)); 806 | 807 | let start_time = Instant::now(); 808 | let result = perform_health_checks(server_state.clone(), 0).await; 809 | 810 | assert!(start_time.elapsed() >= std::time::Duration::from_secs(2)); 811 | assert_eq!(result, ServerStatus::TimedOut); 812 | // Also check that the number of retries is correct 813 | mock.assert(); 814 | } 815 | } 816 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "addr2line" 7 | version = "0.24.2" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" 10 | dependencies = [ 11 | "gimli", 12 | ] 13 | 14 | [[package]] 15 | name = "adler2" 16 | version = "2.0.0" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" 19 | 20 | [[package]] 21 | name = "aho-corasick" 22 | version = "1.1.3" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" 25 | dependencies = [ 26 | "memchr", 27 | ] 28 | 29 | [[package]] 30 | name = "anyhow" 31 | version = "1.0.91" 32 | source = "registry+https://github.com/rust-lang/crates.io-index" 33 | checksum = "c042108f3ed77fd83760a5fd79b53be043192bb3b9dba91d8c574c0ada7850c8" 34 | 35 | [[package]] 36 | name = "assert-json-diff" 37 | version = "2.0.2" 38 | source = "registry+https://github.com/rust-lang/crates.io-index" 39 | checksum = "47e4f2b81832e72834d7518d8487a0396a28cc408186a2e8854c0f98011faf12" 40 | dependencies = [ 41 | "serde", 42 | "serde_json", 43 | ] 44 | 45 | [[package]] 46 | name = "atomic-waker" 47 | version = "1.1.2" 48 | source = "registry+https://github.com/rust-lang/crates.io-index" 49 | checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" 50 | 51 | [[package]] 52 | name = "autocfg" 53 | version = "1.4.0" 54 | source = "registry+https://github.com/rust-lang/crates.io-index" 55 | checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" 56 | 57 | [[package]] 58 | name = "backtrace" 59 | version = "0.3.74" 60 | source = "registry+https://github.com/rust-lang/crates.io-index" 61 | checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" 62 | dependencies = [ 63 | "addr2line", 64 | "cfg-if", 65 | "libc", 66 | "miniz_oxide", 67 | "object", 68 | "rustc-demangle", 69 | "windows-targets 0.52.6", 70 | ] 71 | 72 | [[package]] 73 | name = "base64" 74 | version = "0.22.1" 75 | source = "registry+https://github.com/rust-lang/crates.io-index" 76 | checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" 77 | 78 | [[package]] 79 | name = "bitflags" 80 | version = "2.6.0" 81 | source = "registry+https://github.com/rust-lang/crates.io-index" 82 | checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" 83 | 84 | [[package]] 85 | name = "bumpalo" 86 | version = "3.16.0" 87 | source = "registry+https://github.com/rust-lang/crates.io-index" 88 | checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" 89 | 90 | [[package]] 91 | name = "byteorder" 92 | version = "1.5.0" 93 | source = "registry+https://github.com/rust-lang/crates.io-index" 94 | checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" 95 | 96 | [[package]] 97 | name = "bytes" 98 | version = "1.8.0" 99 | source = "registry+https://github.com/rust-lang/crates.io-index" 100 | checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" 101 | 102 | [[package]] 103 | name = "cc" 104 | version = "1.1.31" 105 | source = "registry+https://github.com/rust-lang/crates.io-index" 106 | checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f" 107 | dependencies = [ 108 | "shlex", 109 | ] 110 | 111 | [[package]] 112 | name = "cfg-if" 113 | version = "1.0.0" 114 | source = "registry+https://github.com/rust-lang/crates.io-index" 115 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 116 | 117 | [[package]] 118 | name = "colored" 119 | version = "2.1.0" 120 | source = "registry+https://github.com/rust-lang/crates.io-index" 121 | checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" 122 | dependencies = [ 123 | "lazy_static", 124 | "windows-sys 0.48.0", 125 | ] 126 | 127 | [[package]] 128 | name = "core-foundation" 129 | version = "0.9.4" 130 | source = "registry+https://github.com/rust-lang/crates.io-index" 131 | checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" 132 | dependencies = [ 133 | "core-foundation-sys", 134 | "libc", 135 | ] 136 | 137 | [[package]] 138 | name = "core-foundation-sys" 139 | version = "0.8.7" 140 | source = "registry+https://github.com/rust-lang/crates.io-index" 141 | checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" 142 | 143 | [[package]] 144 | name = "crossterm" 145 | version = "0.28.1" 146 | source = "registry+https://github.com/rust-lang/crates.io-index" 147 | checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6" 148 | dependencies = [ 149 | "bitflags", 150 | "crossterm_winapi", 151 | "mio", 152 | "parking_lot", 153 | "rustix", 154 | "signal-hook", 155 | "signal-hook-mio", 156 | "winapi", 157 | ] 158 | 159 | [[package]] 160 | name = "crossterm_winapi" 161 | version = "0.9.1" 162 | source = "registry+https://github.com/rust-lang/crates.io-index" 163 | checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b" 164 | dependencies = [ 165 | "winapi", 166 | ] 167 | 168 | [[package]] 169 | name = "encoding_rs" 170 | version = "0.8.35" 171 | source = "registry+https://github.com/rust-lang/crates.io-index" 172 | checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" 173 | dependencies = [ 174 | "cfg-if", 175 | ] 176 | 177 | [[package]] 178 | name = "equivalent" 179 | version = "1.0.1" 180 | source = "registry+https://github.com/rust-lang/crates.io-index" 181 | checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" 182 | 183 | [[package]] 184 | name = "errno" 185 | version = "0.3.9" 186 | source = "registry+https://github.com/rust-lang/crates.io-index" 187 | checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" 188 | dependencies = [ 189 | "libc", 190 | "windows-sys 0.52.0", 191 | ] 192 | 193 | [[package]] 194 | name = "fastrand" 195 | version = "2.1.1" 196 | source = "registry+https://github.com/rust-lang/crates.io-index" 197 | checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" 198 | 199 | [[package]] 200 | name = "fnv" 201 | version = "1.0.7" 202 | source = "registry+https://github.com/rust-lang/crates.io-index" 203 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 204 | 205 | [[package]] 206 | name = "foreign-types" 207 | version = "0.3.2" 208 | source = "registry+https://github.com/rust-lang/crates.io-index" 209 | checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 210 | dependencies = [ 211 | "foreign-types-shared", 212 | ] 213 | 214 | [[package]] 215 | name = "foreign-types-shared" 216 | version = "0.1.1" 217 | source = "registry+https://github.com/rust-lang/crates.io-index" 218 | checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 219 | 220 | [[package]] 221 | name = "form_urlencoded" 222 | version = "1.2.1" 223 | source = "registry+https://github.com/rust-lang/crates.io-index" 224 | checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" 225 | dependencies = [ 226 | "percent-encoding", 227 | ] 228 | 229 | [[package]] 230 | name = "futures-channel" 231 | version = "0.3.31" 232 | source = "registry+https://github.com/rust-lang/crates.io-index" 233 | checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" 234 | dependencies = [ 235 | "futures-core", 236 | ] 237 | 238 | [[package]] 239 | name = "futures-core" 240 | version = "0.3.31" 241 | source = "registry+https://github.com/rust-lang/crates.io-index" 242 | checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" 243 | 244 | [[package]] 245 | name = "futures-sink" 246 | version = "0.3.31" 247 | source = "registry+https://github.com/rust-lang/crates.io-index" 248 | checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" 249 | 250 | [[package]] 251 | name = "futures-task" 252 | version = "0.3.31" 253 | source = "registry+https://github.com/rust-lang/crates.io-index" 254 | checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" 255 | 256 | [[package]] 257 | name = "futures-util" 258 | version = "0.3.31" 259 | source = "registry+https://github.com/rust-lang/crates.io-index" 260 | checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" 261 | dependencies = [ 262 | "futures-core", 263 | "futures-task", 264 | "pin-project-lite", 265 | "pin-utils", 266 | ] 267 | 268 | [[package]] 269 | name = "getrandom" 270 | version = "0.2.15" 271 | source = "registry+https://github.com/rust-lang/crates.io-index" 272 | checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" 273 | dependencies = [ 274 | "cfg-if", 275 | "libc", 276 | "wasi", 277 | ] 278 | 279 | [[package]] 280 | name = "gimli" 281 | version = "0.31.1" 282 | source = "registry+https://github.com/rust-lang/crates.io-index" 283 | checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" 284 | 285 | [[package]] 286 | name = "glob" 287 | version = "0.3.1" 288 | source = "registry+https://github.com/rust-lang/crates.io-index" 289 | checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" 290 | 291 | [[package]] 292 | name = "h2" 293 | version = "0.4.6" 294 | source = "registry+https://github.com/rust-lang/crates.io-index" 295 | checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" 296 | dependencies = [ 297 | "atomic-waker", 298 | "bytes", 299 | "fnv", 300 | "futures-core", 301 | "futures-sink", 302 | "http", 303 | "indexmap", 304 | "slab", 305 | "tokio", 306 | "tokio-util", 307 | "tracing", 308 | ] 309 | 310 | [[package]] 311 | name = "hashbrown" 312 | version = "0.15.0" 313 | source = "registry+https://github.com/rust-lang/crates.io-index" 314 | checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" 315 | 316 | [[package]] 317 | name = "hermit-abi" 318 | version = "0.3.9" 319 | source = "registry+https://github.com/rust-lang/crates.io-index" 320 | checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" 321 | 322 | [[package]] 323 | name = "http" 324 | version = "1.1.0" 325 | source = "registry+https://github.com/rust-lang/crates.io-index" 326 | checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" 327 | dependencies = [ 328 | "bytes", 329 | "fnv", 330 | "itoa", 331 | ] 332 | 333 | [[package]] 334 | name = "http-body" 335 | version = "1.0.1" 336 | source = "registry+https://github.com/rust-lang/crates.io-index" 337 | checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" 338 | dependencies = [ 339 | "bytes", 340 | "http", 341 | ] 342 | 343 | [[package]] 344 | name = "http-body-util" 345 | version = "0.1.2" 346 | source = "registry+https://github.com/rust-lang/crates.io-index" 347 | checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" 348 | dependencies = [ 349 | "bytes", 350 | "futures-util", 351 | "http", 352 | "http-body", 353 | "pin-project-lite", 354 | ] 355 | 356 | [[package]] 357 | name = "httparse" 358 | version = "1.9.5" 359 | source = "registry+https://github.com/rust-lang/crates.io-index" 360 | checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" 361 | 362 | [[package]] 363 | name = "httpdate" 364 | version = "1.0.3" 365 | source = "registry+https://github.com/rust-lang/crates.io-index" 366 | checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" 367 | 368 | [[package]] 369 | name = "humantime" 370 | version = "2.1.0" 371 | source = "registry+https://github.com/rust-lang/crates.io-index" 372 | checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" 373 | 374 | [[package]] 375 | name = "humantime-serde" 376 | version = "1.1.1" 377 | source = "registry+https://github.com/rust-lang/crates.io-index" 378 | checksum = "57a3db5ea5923d99402c94e9feb261dc5ee9b4efa158b0315f788cf549cc200c" 379 | dependencies = [ 380 | "humantime", 381 | "serde", 382 | ] 383 | 384 | [[package]] 385 | name = "hyper" 386 | version = "1.5.0" 387 | source = "registry+https://github.com/rust-lang/crates.io-index" 388 | checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a" 389 | dependencies = [ 390 | "bytes", 391 | "futures-channel", 392 | "futures-util", 393 | "h2", 394 | "http", 395 | "http-body", 396 | "httparse", 397 | "httpdate", 398 | "itoa", 399 | "pin-project-lite", 400 | "smallvec", 401 | "tokio", 402 | "want", 403 | ] 404 | 405 | [[package]] 406 | name = "hyper-rustls" 407 | version = "0.27.3" 408 | source = "registry+https://github.com/rust-lang/crates.io-index" 409 | checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" 410 | dependencies = [ 411 | "futures-util", 412 | "http", 413 | "hyper", 414 | "hyper-util", 415 | "rustls", 416 | "rustls-pki-types", 417 | "tokio", 418 | "tokio-rustls", 419 | "tower-service", 420 | ] 421 | 422 | [[package]] 423 | name = "hyper-tls" 424 | version = "0.6.0" 425 | source = "registry+https://github.com/rust-lang/crates.io-index" 426 | checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" 427 | dependencies = [ 428 | "bytes", 429 | "http-body-util", 430 | "hyper", 431 | "hyper-util", 432 | "native-tls", 433 | "tokio", 434 | "tokio-native-tls", 435 | "tower-service", 436 | ] 437 | 438 | [[package]] 439 | name = "hyper-util" 440 | version = "0.1.9" 441 | source = "registry+https://github.com/rust-lang/crates.io-index" 442 | checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" 443 | dependencies = [ 444 | "bytes", 445 | "futures-channel", 446 | "futures-util", 447 | "http", 448 | "http-body", 449 | "hyper", 450 | "pin-project-lite", 451 | "socket2", 452 | "tokio", 453 | "tower-service", 454 | "tracing", 455 | ] 456 | 457 | [[package]] 458 | name = "idna" 459 | version = "0.5.0" 460 | source = "registry+https://github.com/rust-lang/crates.io-index" 461 | checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" 462 | dependencies = [ 463 | "unicode-bidi", 464 | "unicode-normalization", 465 | ] 466 | 467 | [[package]] 468 | name = "indexmap" 469 | version = "2.6.0" 470 | source = "registry+https://github.com/rust-lang/crates.io-index" 471 | checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" 472 | dependencies = [ 473 | "equivalent", 474 | "hashbrown", 475 | ] 476 | 477 | [[package]] 478 | name = "ipnet" 479 | version = "2.10.1" 480 | source = "registry+https://github.com/rust-lang/crates.io-index" 481 | checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" 482 | 483 | [[package]] 484 | name = "ipnetwork" 485 | version = "0.20.0" 486 | source = "registry+https://github.com/rust-lang/crates.io-index" 487 | checksum = "bf466541e9d546596ee94f9f69590f89473455f88372423e0008fc1a7daf100e" 488 | dependencies = [ 489 | "serde", 490 | ] 491 | 492 | [[package]] 493 | name = "itoa" 494 | version = "1.0.11" 495 | source = "registry+https://github.com/rust-lang/crates.io-index" 496 | checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" 497 | 498 | [[package]] 499 | name = "js-sys" 500 | version = "0.3.72" 501 | source = "registry+https://github.com/rust-lang/crates.io-index" 502 | checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" 503 | dependencies = [ 504 | "wasm-bindgen", 505 | ] 506 | 507 | [[package]] 508 | name = "lazy_static" 509 | version = "1.5.0" 510 | source = "registry+https://github.com/rust-lang/crates.io-index" 511 | checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" 512 | 513 | [[package]] 514 | name = "libc" 515 | version = "0.2.161" 516 | source = "registry+https://github.com/rust-lang/crates.io-index" 517 | checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" 518 | 519 | [[package]] 520 | name = "linux-raw-sys" 521 | version = "0.4.14" 522 | source = "registry+https://github.com/rust-lang/crates.io-index" 523 | checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" 524 | 525 | [[package]] 526 | name = "lock_api" 527 | version = "0.4.12" 528 | source = "registry+https://github.com/rust-lang/crates.io-index" 529 | checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" 530 | dependencies = [ 531 | "autocfg", 532 | "scopeguard", 533 | ] 534 | 535 | [[package]] 536 | name = "log" 537 | version = "0.4.22" 538 | source = "registry+https://github.com/rust-lang/crates.io-index" 539 | checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" 540 | 541 | [[package]] 542 | name = "memchr" 543 | version = "2.7.4" 544 | source = "registry+https://github.com/rust-lang/crates.io-index" 545 | checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" 546 | 547 | [[package]] 548 | name = "mime" 549 | version = "0.3.17" 550 | source = "registry+https://github.com/rust-lang/crates.io-index" 551 | checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" 552 | 553 | [[package]] 554 | name = "miniz_oxide" 555 | version = "0.8.0" 556 | source = "registry+https://github.com/rust-lang/crates.io-index" 557 | checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" 558 | dependencies = [ 559 | "adler2", 560 | ] 561 | 562 | [[package]] 563 | name = "mio" 564 | version = "1.0.2" 565 | source = "registry+https://github.com/rust-lang/crates.io-index" 566 | checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" 567 | dependencies = [ 568 | "hermit-abi", 569 | "libc", 570 | "log", 571 | "wasi", 572 | "windows-sys 0.52.0", 573 | ] 574 | 575 | [[package]] 576 | name = "mockito" 577 | version = "1.5.0" 578 | source = "registry+https://github.com/rust-lang/crates.io-index" 579 | checksum = "09b34bd91b9e5c5b06338d392463e1318d683cf82ec3d3af4014609be6e2108d" 580 | dependencies = [ 581 | "assert-json-diff", 582 | "bytes", 583 | "colored", 584 | "futures-util", 585 | "http", 586 | "http-body", 587 | "http-body-util", 588 | "hyper", 589 | "hyper-util", 590 | "log", 591 | "rand", 592 | "regex", 593 | "serde_json", 594 | "serde_urlencoded", 595 | "similar", 596 | "tokio", 597 | ] 598 | 599 | [[package]] 600 | name = "native-tls" 601 | version = "0.2.12" 602 | source = "registry+https://github.com/rust-lang/crates.io-index" 603 | checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" 604 | dependencies = [ 605 | "libc", 606 | "log", 607 | "openssl", 608 | "openssl-probe", 609 | "openssl-sys", 610 | "schannel", 611 | "security-framework", 612 | "security-framework-sys", 613 | "tempfile", 614 | ] 615 | 616 | [[package]] 617 | name = "no-std-net" 618 | version = "0.6.0" 619 | source = "registry+https://github.com/rust-lang/crates.io-index" 620 | checksum = "43794a0ace135be66a25d3ae77d41b91615fb68ae937f904090203e81f755b65" 621 | 622 | [[package]] 623 | name = "object" 624 | version = "0.36.5" 625 | source = "registry+https://github.com/rust-lang/crates.io-index" 626 | checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" 627 | dependencies = [ 628 | "memchr", 629 | ] 630 | 631 | [[package]] 632 | name = "once_cell" 633 | version = "1.20.2" 634 | source = "registry+https://github.com/rust-lang/crates.io-index" 635 | checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" 636 | 637 | [[package]] 638 | name = "openssl" 639 | version = "0.10.68" 640 | source = "registry+https://github.com/rust-lang/crates.io-index" 641 | checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" 642 | dependencies = [ 643 | "bitflags", 644 | "cfg-if", 645 | "foreign-types", 646 | "libc", 647 | "once_cell", 648 | "openssl-macros", 649 | "openssl-sys", 650 | ] 651 | 652 | [[package]] 653 | name = "openssl-macros" 654 | version = "0.1.1" 655 | source = "registry+https://github.com/rust-lang/crates.io-index" 656 | checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" 657 | dependencies = [ 658 | "proc-macro2", 659 | "quote", 660 | "syn", 661 | ] 662 | 663 | [[package]] 664 | name = "openssl-probe" 665 | version = "0.1.5" 666 | source = "registry+https://github.com/rust-lang/crates.io-index" 667 | checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" 668 | 669 | [[package]] 670 | name = "openssl-sys" 671 | version = "0.9.104" 672 | source = "registry+https://github.com/rust-lang/crates.io-index" 673 | checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" 674 | dependencies = [ 675 | "cc", 676 | "libc", 677 | "pkg-config", 678 | "vcpkg", 679 | ] 680 | 681 | [[package]] 682 | name = "parking_lot" 683 | version = "0.12.3" 684 | source = "registry+https://github.com/rust-lang/crates.io-index" 685 | checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" 686 | dependencies = [ 687 | "lock_api", 688 | "parking_lot_core", 689 | ] 690 | 691 | [[package]] 692 | name = "parking_lot_core" 693 | version = "0.9.10" 694 | source = "registry+https://github.com/rust-lang/crates.io-index" 695 | checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" 696 | dependencies = [ 697 | "cfg-if", 698 | "libc", 699 | "redox_syscall", 700 | "smallvec", 701 | "windows-targets 0.52.6", 702 | ] 703 | 704 | [[package]] 705 | name = "percent-encoding" 706 | version = "2.3.1" 707 | source = "registry+https://github.com/rust-lang/crates.io-index" 708 | checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" 709 | 710 | [[package]] 711 | name = "pin-project-lite" 712 | version = "0.2.15" 713 | source = "registry+https://github.com/rust-lang/crates.io-index" 714 | checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" 715 | 716 | [[package]] 717 | name = "pin-utils" 718 | version = "0.1.0" 719 | source = "registry+https://github.com/rust-lang/crates.io-index" 720 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 721 | 722 | [[package]] 723 | name = "pkg-config" 724 | version = "0.3.31" 725 | source = "registry+https://github.com/rust-lang/crates.io-index" 726 | checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" 727 | 728 | [[package]] 729 | name = "pnet" 730 | version = "0.35.0" 731 | source = "registry+https://github.com/rust-lang/crates.io-index" 732 | checksum = "682396b533413cc2e009fbb48aadf93619a149d3e57defba19ff50ce0201bd0d" 733 | dependencies = [ 734 | "ipnetwork", 735 | "pnet_base", 736 | "pnet_datalink", 737 | "pnet_packet", 738 | "pnet_sys", 739 | "pnet_transport", 740 | ] 741 | 742 | [[package]] 743 | name = "pnet_base" 744 | version = "0.35.0" 745 | source = "registry+https://github.com/rust-lang/crates.io-index" 746 | checksum = "ffc190d4067df16af3aba49b3b74c469e611cad6314676eaf1157f31aa0fb2f7" 747 | dependencies = [ 748 | "no-std-net", 749 | ] 750 | 751 | [[package]] 752 | name = "pnet_datalink" 753 | version = "0.35.0" 754 | source = "registry+https://github.com/rust-lang/crates.io-index" 755 | checksum = "e79e70ec0be163102a332e1d2d5586d362ad76b01cec86f830241f2b6452a7b7" 756 | dependencies = [ 757 | "ipnetwork", 758 | "libc", 759 | "pnet_base", 760 | "pnet_sys", 761 | "winapi", 762 | ] 763 | 764 | [[package]] 765 | name = "pnet_macros" 766 | version = "0.35.0" 767 | source = "registry+https://github.com/rust-lang/crates.io-index" 768 | checksum = "13325ac86ee1a80a480b0bc8e3d30c25d133616112bb16e86f712dcf8a71c863" 769 | dependencies = [ 770 | "proc-macro2", 771 | "quote", 772 | "regex", 773 | "syn", 774 | ] 775 | 776 | [[package]] 777 | name = "pnet_macros_support" 778 | version = "0.35.0" 779 | source = "registry+https://github.com/rust-lang/crates.io-index" 780 | checksum = "eed67a952585d509dd0003049b1fc56b982ac665c8299b124b90ea2bdb3134ab" 781 | dependencies = [ 782 | "pnet_base", 783 | ] 784 | 785 | [[package]] 786 | name = "pnet_packet" 787 | version = "0.35.0" 788 | source = "registry+https://github.com/rust-lang/crates.io-index" 789 | checksum = "4c96ebadfab635fcc23036ba30a7d33a80c39e8461b8bd7dc7bb186acb96560f" 790 | dependencies = [ 791 | "glob", 792 | "pnet_base", 793 | "pnet_macros", 794 | "pnet_macros_support", 795 | ] 796 | 797 | [[package]] 798 | name = "pnet_sys" 799 | version = "0.35.0" 800 | source = "registry+https://github.com/rust-lang/crates.io-index" 801 | checksum = "7d4643d3d4db6b08741050c2f3afa9a892c4244c085a72fcda93c9c2c9a00f4b" 802 | dependencies = [ 803 | "libc", 804 | "winapi", 805 | ] 806 | 807 | [[package]] 808 | name = "pnet_transport" 809 | version = "0.35.0" 810 | source = "registry+https://github.com/rust-lang/crates.io-index" 811 | checksum = "5f604d98bc2a6591cf719b58d3203fd882bdd6bf1db696c4ac97978e9f4776bf" 812 | dependencies = [ 813 | "libc", 814 | "pnet_base", 815 | "pnet_packet", 816 | "pnet_sys", 817 | ] 818 | 819 | [[package]] 820 | name = "ppv-lite86" 821 | version = "0.2.20" 822 | source = "registry+https://github.com/rust-lang/crates.io-index" 823 | checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" 824 | dependencies = [ 825 | "zerocopy", 826 | ] 827 | 828 | [[package]] 829 | name = "proc-macro2" 830 | version = "1.0.89" 831 | source = "registry+https://github.com/rust-lang/crates.io-index" 832 | checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" 833 | dependencies = [ 834 | "unicode-ident", 835 | ] 836 | 837 | [[package]] 838 | name = "quote" 839 | version = "1.0.37" 840 | source = "registry+https://github.com/rust-lang/crates.io-index" 841 | checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" 842 | dependencies = [ 843 | "proc-macro2", 844 | ] 845 | 846 | [[package]] 847 | name = "rallyup" 848 | version = "0.1.1" 849 | dependencies = [ 850 | "anyhow", 851 | "colored", 852 | "crossterm", 853 | "humantime", 854 | "humantime-serde", 855 | "mockito", 856 | "pnet", 857 | "regex", 858 | "reqwest", 859 | "serde", 860 | "serde_regex", 861 | "serde_yaml_ng", 862 | "thiserror", 863 | "tokio", 864 | ] 865 | 866 | [[package]] 867 | name = "rand" 868 | version = "0.8.5" 869 | source = "registry+https://github.com/rust-lang/crates.io-index" 870 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 871 | dependencies = [ 872 | "libc", 873 | "rand_chacha", 874 | "rand_core", 875 | ] 876 | 877 | [[package]] 878 | name = "rand_chacha" 879 | version = "0.3.1" 880 | source = "registry+https://github.com/rust-lang/crates.io-index" 881 | checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 882 | dependencies = [ 883 | "ppv-lite86", 884 | "rand_core", 885 | ] 886 | 887 | [[package]] 888 | name = "rand_core" 889 | version = "0.6.4" 890 | source = "registry+https://github.com/rust-lang/crates.io-index" 891 | checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 892 | dependencies = [ 893 | "getrandom", 894 | ] 895 | 896 | [[package]] 897 | name = "redox_syscall" 898 | version = "0.5.7" 899 | source = "registry+https://github.com/rust-lang/crates.io-index" 900 | checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" 901 | dependencies = [ 902 | "bitflags", 903 | ] 904 | 905 | [[package]] 906 | name = "regex" 907 | version = "1.11.1" 908 | source = "registry+https://github.com/rust-lang/crates.io-index" 909 | checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" 910 | dependencies = [ 911 | "aho-corasick", 912 | "memchr", 913 | "regex-automata", 914 | "regex-syntax", 915 | ] 916 | 917 | [[package]] 918 | name = "regex-automata" 919 | version = "0.4.8" 920 | source = "registry+https://github.com/rust-lang/crates.io-index" 921 | checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" 922 | dependencies = [ 923 | "aho-corasick", 924 | "memchr", 925 | "regex-syntax", 926 | ] 927 | 928 | [[package]] 929 | name = "regex-syntax" 930 | version = "0.8.5" 931 | source = "registry+https://github.com/rust-lang/crates.io-index" 932 | checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" 933 | 934 | [[package]] 935 | name = "reqwest" 936 | version = "0.12.8" 937 | source = "registry+https://github.com/rust-lang/crates.io-index" 938 | checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" 939 | dependencies = [ 940 | "base64", 941 | "bytes", 942 | "encoding_rs", 943 | "futures-core", 944 | "futures-util", 945 | "h2", 946 | "http", 947 | "http-body", 948 | "http-body-util", 949 | "hyper", 950 | "hyper-rustls", 951 | "hyper-tls", 952 | "hyper-util", 953 | "ipnet", 954 | "js-sys", 955 | "log", 956 | "mime", 957 | "native-tls", 958 | "once_cell", 959 | "percent-encoding", 960 | "pin-project-lite", 961 | "rustls-pemfile", 962 | "serde", 963 | "serde_json", 964 | "serde_urlencoded", 965 | "sync_wrapper", 966 | "system-configuration", 967 | "tokio", 968 | "tokio-native-tls", 969 | "tower-service", 970 | "url", 971 | "wasm-bindgen", 972 | "wasm-bindgen-futures", 973 | "web-sys", 974 | "windows-registry", 975 | ] 976 | 977 | [[package]] 978 | name = "ring" 979 | version = "0.17.8" 980 | source = "registry+https://github.com/rust-lang/crates.io-index" 981 | checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" 982 | dependencies = [ 983 | "cc", 984 | "cfg-if", 985 | "getrandom", 986 | "libc", 987 | "spin", 988 | "untrusted", 989 | "windows-sys 0.52.0", 990 | ] 991 | 992 | [[package]] 993 | name = "rustc-demangle" 994 | version = "0.1.24" 995 | source = "registry+https://github.com/rust-lang/crates.io-index" 996 | checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" 997 | 998 | [[package]] 999 | name = "rustix" 1000 | version = "0.38.37" 1001 | source = "registry+https://github.com/rust-lang/crates.io-index" 1002 | checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" 1003 | dependencies = [ 1004 | "bitflags", 1005 | "errno", 1006 | "libc", 1007 | "linux-raw-sys", 1008 | "windows-sys 0.52.0", 1009 | ] 1010 | 1011 | [[package]] 1012 | name = "rustls" 1013 | version = "0.23.15" 1014 | source = "registry+https://github.com/rust-lang/crates.io-index" 1015 | checksum = "5fbb44d7acc4e873d613422379f69f237a1b141928c02f6bc6ccfddddc2d7993" 1016 | dependencies = [ 1017 | "once_cell", 1018 | "rustls-pki-types", 1019 | "rustls-webpki", 1020 | "subtle", 1021 | "zeroize", 1022 | ] 1023 | 1024 | [[package]] 1025 | name = "rustls-pemfile" 1026 | version = "2.2.0" 1027 | source = "registry+https://github.com/rust-lang/crates.io-index" 1028 | checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" 1029 | dependencies = [ 1030 | "rustls-pki-types", 1031 | ] 1032 | 1033 | [[package]] 1034 | name = "rustls-pki-types" 1035 | version = "1.10.0" 1036 | source = "registry+https://github.com/rust-lang/crates.io-index" 1037 | checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" 1038 | 1039 | [[package]] 1040 | name = "rustls-webpki" 1041 | version = "0.102.8" 1042 | source = "registry+https://github.com/rust-lang/crates.io-index" 1043 | checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" 1044 | dependencies = [ 1045 | "ring", 1046 | "rustls-pki-types", 1047 | "untrusted", 1048 | ] 1049 | 1050 | [[package]] 1051 | name = "ryu" 1052 | version = "1.0.18" 1053 | source = "registry+https://github.com/rust-lang/crates.io-index" 1054 | checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" 1055 | 1056 | [[package]] 1057 | name = "schannel" 1058 | version = "0.1.26" 1059 | source = "registry+https://github.com/rust-lang/crates.io-index" 1060 | checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" 1061 | dependencies = [ 1062 | "windows-sys 0.59.0", 1063 | ] 1064 | 1065 | [[package]] 1066 | name = "scopeguard" 1067 | version = "1.2.0" 1068 | source = "registry+https://github.com/rust-lang/crates.io-index" 1069 | checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" 1070 | 1071 | [[package]] 1072 | name = "security-framework" 1073 | version = "2.11.1" 1074 | source = "registry+https://github.com/rust-lang/crates.io-index" 1075 | checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" 1076 | dependencies = [ 1077 | "bitflags", 1078 | "core-foundation", 1079 | "core-foundation-sys", 1080 | "libc", 1081 | "security-framework-sys", 1082 | ] 1083 | 1084 | [[package]] 1085 | name = "security-framework-sys" 1086 | version = "2.12.0" 1087 | source = "registry+https://github.com/rust-lang/crates.io-index" 1088 | checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" 1089 | dependencies = [ 1090 | "core-foundation-sys", 1091 | "libc", 1092 | ] 1093 | 1094 | [[package]] 1095 | name = "serde" 1096 | version = "1.0.213" 1097 | source = "registry+https://github.com/rust-lang/crates.io-index" 1098 | checksum = "3ea7893ff5e2466df8d720bb615088341b295f849602c6956047f8f80f0e9bc1" 1099 | dependencies = [ 1100 | "serde_derive", 1101 | ] 1102 | 1103 | [[package]] 1104 | name = "serde_derive" 1105 | version = "1.0.213" 1106 | source = "registry+https://github.com/rust-lang/crates.io-index" 1107 | checksum = "7e85ad2009c50b58e87caa8cd6dac16bdf511bbfb7af6c33df902396aa480fa5" 1108 | dependencies = [ 1109 | "proc-macro2", 1110 | "quote", 1111 | "syn", 1112 | ] 1113 | 1114 | [[package]] 1115 | name = "serde_json" 1116 | version = "1.0.132" 1117 | source = "registry+https://github.com/rust-lang/crates.io-index" 1118 | checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" 1119 | dependencies = [ 1120 | "itoa", 1121 | "memchr", 1122 | "ryu", 1123 | "serde", 1124 | ] 1125 | 1126 | [[package]] 1127 | name = "serde_regex" 1128 | version = "1.1.0" 1129 | source = "registry+https://github.com/rust-lang/crates.io-index" 1130 | checksum = "a8136f1a4ea815d7eac4101cfd0b16dc0cb5e1fe1b8609dfd728058656b7badf" 1131 | dependencies = [ 1132 | "regex", 1133 | "serde", 1134 | ] 1135 | 1136 | [[package]] 1137 | name = "serde_urlencoded" 1138 | version = "0.7.1" 1139 | source = "registry+https://github.com/rust-lang/crates.io-index" 1140 | checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" 1141 | dependencies = [ 1142 | "form_urlencoded", 1143 | "itoa", 1144 | "ryu", 1145 | "serde", 1146 | ] 1147 | 1148 | [[package]] 1149 | name = "serde_yaml_ng" 1150 | version = "0.10.0" 1151 | source = "registry+https://github.com/rust-lang/crates.io-index" 1152 | checksum = "7b4db627b98b36d4203a7b458cf3573730f2bb591b28871d916dfa9efabfd41f" 1153 | dependencies = [ 1154 | "indexmap", 1155 | "itoa", 1156 | "ryu", 1157 | "serde", 1158 | "unsafe-libyaml", 1159 | ] 1160 | 1161 | [[package]] 1162 | name = "shlex" 1163 | version = "1.3.0" 1164 | source = "registry+https://github.com/rust-lang/crates.io-index" 1165 | checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" 1166 | 1167 | [[package]] 1168 | name = "signal-hook" 1169 | version = "0.3.17" 1170 | source = "registry+https://github.com/rust-lang/crates.io-index" 1171 | checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" 1172 | dependencies = [ 1173 | "libc", 1174 | "signal-hook-registry", 1175 | ] 1176 | 1177 | [[package]] 1178 | name = "signal-hook-mio" 1179 | version = "0.2.4" 1180 | source = "registry+https://github.com/rust-lang/crates.io-index" 1181 | checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd" 1182 | dependencies = [ 1183 | "libc", 1184 | "mio", 1185 | "signal-hook", 1186 | ] 1187 | 1188 | [[package]] 1189 | name = "signal-hook-registry" 1190 | version = "1.4.2" 1191 | source = "registry+https://github.com/rust-lang/crates.io-index" 1192 | checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" 1193 | dependencies = [ 1194 | "libc", 1195 | ] 1196 | 1197 | [[package]] 1198 | name = "similar" 1199 | version = "2.6.0" 1200 | source = "registry+https://github.com/rust-lang/crates.io-index" 1201 | checksum = "1de1d4f81173b03af4c0cbed3c898f6bff5b870e4a7f5d6f4057d62a7a4b686e" 1202 | 1203 | [[package]] 1204 | name = "slab" 1205 | version = "0.4.9" 1206 | source = "registry+https://github.com/rust-lang/crates.io-index" 1207 | checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" 1208 | dependencies = [ 1209 | "autocfg", 1210 | ] 1211 | 1212 | [[package]] 1213 | name = "smallvec" 1214 | version = "1.13.2" 1215 | source = "registry+https://github.com/rust-lang/crates.io-index" 1216 | checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" 1217 | 1218 | [[package]] 1219 | name = "socket2" 1220 | version = "0.5.7" 1221 | source = "registry+https://github.com/rust-lang/crates.io-index" 1222 | checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" 1223 | dependencies = [ 1224 | "libc", 1225 | "windows-sys 0.52.0", 1226 | ] 1227 | 1228 | [[package]] 1229 | name = "spin" 1230 | version = "0.9.8" 1231 | source = "registry+https://github.com/rust-lang/crates.io-index" 1232 | checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" 1233 | 1234 | [[package]] 1235 | name = "subtle" 1236 | version = "2.6.1" 1237 | source = "registry+https://github.com/rust-lang/crates.io-index" 1238 | checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" 1239 | 1240 | [[package]] 1241 | name = "syn" 1242 | version = "2.0.85" 1243 | source = "registry+https://github.com/rust-lang/crates.io-index" 1244 | checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56" 1245 | dependencies = [ 1246 | "proc-macro2", 1247 | "quote", 1248 | "unicode-ident", 1249 | ] 1250 | 1251 | [[package]] 1252 | name = "sync_wrapper" 1253 | version = "1.0.1" 1254 | source = "registry+https://github.com/rust-lang/crates.io-index" 1255 | checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" 1256 | dependencies = [ 1257 | "futures-core", 1258 | ] 1259 | 1260 | [[package]] 1261 | name = "system-configuration" 1262 | version = "0.6.1" 1263 | source = "registry+https://github.com/rust-lang/crates.io-index" 1264 | checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" 1265 | dependencies = [ 1266 | "bitflags", 1267 | "core-foundation", 1268 | "system-configuration-sys", 1269 | ] 1270 | 1271 | [[package]] 1272 | name = "system-configuration-sys" 1273 | version = "0.6.0" 1274 | source = "registry+https://github.com/rust-lang/crates.io-index" 1275 | checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" 1276 | dependencies = [ 1277 | "core-foundation-sys", 1278 | "libc", 1279 | ] 1280 | 1281 | [[package]] 1282 | name = "tempfile" 1283 | version = "3.13.0" 1284 | source = "registry+https://github.com/rust-lang/crates.io-index" 1285 | checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" 1286 | dependencies = [ 1287 | "cfg-if", 1288 | "fastrand", 1289 | "once_cell", 1290 | "rustix", 1291 | "windows-sys 0.59.0", 1292 | ] 1293 | 1294 | [[package]] 1295 | name = "thiserror" 1296 | version = "1.0.65" 1297 | source = "registry+https://github.com/rust-lang/crates.io-index" 1298 | checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" 1299 | dependencies = [ 1300 | "thiserror-impl", 1301 | ] 1302 | 1303 | [[package]] 1304 | name = "thiserror-impl" 1305 | version = "1.0.65" 1306 | source = "registry+https://github.com/rust-lang/crates.io-index" 1307 | checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" 1308 | dependencies = [ 1309 | "proc-macro2", 1310 | "quote", 1311 | "syn", 1312 | ] 1313 | 1314 | [[package]] 1315 | name = "tinyvec" 1316 | version = "1.8.0" 1317 | source = "registry+https://github.com/rust-lang/crates.io-index" 1318 | checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" 1319 | dependencies = [ 1320 | "tinyvec_macros", 1321 | ] 1322 | 1323 | [[package]] 1324 | name = "tinyvec_macros" 1325 | version = "0.1.1" 1326 | source = "registry+https://github.com/rust-lang/crates.io-index" 1327 | checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" 1328 | 1329 | [[package]] 1330 | name = "tokio" 1331 | version = "1.41.0" 1332 | source = "registry+https://github.com/rust-lang/crates.io-index" 1333 | checksum = "145f3413504347a2be84393cc8a7d2fb4d863b375909ea59f2158261aa258bbb" 1334 | dependencies = [ 1335 | "backtrace", 1336 | "bytes", 1337 | "libc", 1338 | "mio", 1339 | "parking_lot", 1340 | "pin-project-lite", 1341 | "signal-hook-registry", 1342 | "socket2", 1343 | "tokio-macros", 1344 | "windows-sys 0.52.0", 1345 | ] 1346 | 1347 | [[package]] 1348 | name = "tokio-macros" 1349 | version = "2.4.0" 1350 | source = "registry+https://github.com/rust-lang/crates.io-index" 1351 | checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" 1352 | dependencies = [ 1353 | "proc-macro2", 1354 | "quote", 1355 | "syn", 1356 | ] 1357 | 1358 | [[package]] 1359 | name = "tokio-native-tls" 1360 | version = "0.3.1" 1361 | source = "registry+https://github.com/rust-lang/crates.io-index" 1362 | checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" 1363 | dependencies = [ 1364 | "native-tls", 1365 | "tokio", 1366 | ] 1367 | 1368 | [[package]] 1369 | name = "tokio-rustls" 1370 | version = "0.26.0" 1371 | source = "registry+https://github.com/rust-lang/crates.io-index" 1372 | checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" 1373 | dependencies = [ 1374 | "rustls", 1375 | "rustls-pki-types", 1376 | "tokio", 1377 | ] 1378 | 1379 | [[package]] 1380 | name = "tokio-util" 1381 | version = "0.7.12" 1382 | source = "registry+https://github.com/rust-lang/crates.io-index" 1383 | checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" 1384 | dependencies = [ 1385 | "bytes", 1386 | "futures-core", 1387 | "futures-sink", 1388 | "pin-project-lite", 1389 | "tokio", 1390 | ] 1391 | 1392 | [[package]] 1393 | name = "tower-service" 1394 | version = "0.3.3" 1395 | source = "registry+https://github.com/rust-lang/crates.io-index" 1396 | checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" 1397 | 1398 | [[package]] 1399 | name = "tracing" 1400 | version = "0.1.40" 1401 | source = "registry+https://github.com/rust-lang/crates.io-index" 1402 | checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" 1403 | dependencies = [ 1404 | "pin-project-lite", 1405 | "tracing-core", 1406 | ] 1407 | 1408 | [[package]] 1409 | name = "tracing-core" 1410 | version = "0.1.32" 1411 | source = "registry+https://github.com/rust-lang/crates.io-index" 1412 | checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" 1413 | dependencies = [ 1414 | "once_cell", 1415 | ] 1416 | 1417 | [[package]] 1418 | name = "try-lock" 1419 | version = "0.2.5" 1420 | source = "registry+https://github.com/rust-lang/crates.io-index" 1421 | checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" 1422 | 1423 | [[package]] 1424 | name = "unicode-bidi" 1425 | version = "0.3.17" 1426 | source = "registry+https://github.com/rust-lang/crates.io-index" 1427 | checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" 1428 | 1429 | [[package]] 1430 | name = "unicode-ident" 1431 | version = "1.0.13" 1432 | source = "registry+https://github.com/rust-lang/crates.io-index" 1433 | checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" 1434 | 1435 | [[package]] 1436 | name = "unicode-normalization" 1437 | version = "0.1.24" 1438 | source = "registry+https://github.com/rust-lang/crates.io-index" 1439 | checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" 1440 | dependencies = [ 1441 | "tinyvec", 1442 | ] 1443 | 1444 | [[package]] 1445 | name = "unsafe-libyaml" 1446 | version = "0.2.11" 1447 | source = "registry+https://github.com/rust-lang/crates.io-index" 1448 | checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" 1449 | 1450 | [[package]] 1451 | name = "untrusted" 1452 | version = "0.9.0" 1453 | source = "registry+https://github.com/rust-lang/crates.io-index" 1454 | checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" 1455 | 1456 | [[package]] 1457 | name = "url" 1458 | version = "2.5.2" 1459 | source = "registry+https://github.com/rust-lang/crates.io-index" 1460 | checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" 1461 | dependencies = [ 1462 | "form_urlencoded", 1463 | "idna", 1464 | "percent-encoding", 1465 | ] 1466 | 1467 | [[package]] 1468 | name = "vcpkg" 1469 | version = "0.2.15" 1470 | source = "registry+https://github.com/rust-lang/crates.io-index" 1471 | checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" 1472 | 1473 | [[package]] 1474 | name = "want" 1475 | version = "0.3.1" 1476 | source = "registry+https://github.com/rust-lang/crates.io-index" 1477 | checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" 1478 | dependencies = [ 1479 | "try-lock", 1480 | ] 1481 | 1482 | [[package]] 1483 | name = "wasi" 1484 | version = "0.11.0+wasi-snapshot-preview1" 1485 | source = "registry+https://github.com/rust-lang/crates.io-index" 1486 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 1487 | 1488 | [[package]] 1489 | name = "wasm-bindgen" 1490 | version = "0.2.95" 1491 | source = "registry+https://github.com/rust-lang/crates.io-index" 1492 | checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" 1493 | dependencies = [ 1494 | "cfg-if", 1495 | "once_cell", 1496 | "wasm-bindgen-macro", 1497 | ] 1498 | 1499 | [[package]] 1500 | name = "wasm-bindgen-backend" 1501 | version = "0.2.95" 1502 | source = "registry+https://github.com/rust-lang/crates.io-index" 1503 | checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" 1504 | dependencies = [ 1505 | "bumpalo", 1506 | "log", 1507 | "once_cell", 1508 | "proc-macro2", 1509 | "quote", 1510 | "syn", 1511 | "wasm-bindgen-shared", 1512 | ] 1513 | 1514 | [[package]] 1515 | name = "wasm-bindgen-futures" 1516 | version = "0.4.45" 1517 | source = "registry+https://github.com/rust-lang/crates.io-index" 1518 | checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" 1519 | dependencies = [ 1520 | "cfg-if", 1521 | "js-sys", 1522 | "wasm-bindgen", 1523 | "web-sys", 1524 | ] 1525 | 1526 | [[package]] 1527 | name = "wasm-bindgen-macro" 1528 | version = "0.2.95" 1529 | source = "registry+https://github.com/rust-lang/crates.io-index" 1530 | checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" 1531 | dependencies = [ 1532 | "quote", 1533 | "wasm-bindgen-macro-support", 1534 | ] 1535 | 1536 | [[package]] 1537 | name = "wasm-bindgen-macro-support" 1538 | version = "0.2.95" 1539 | source = "registry+https://github.com/rust-lang/crates.io-index" 1540 | checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" 1541 | dependencies = [ 1542 | "proc-macro2", 1543 | "quote", 1544 | "syn", 1545 | "wasm-bindgen-backend", 1546 | "wasm-bindgen-shared", 1547 | ] 1548 | 1549 | [[package]] 1550 | name = "wasm-bindgen-shared" 1551 | version = "0.2.95" 1552 | source = "registry+https://github.com/rust-lang/crates.io-index" 1553 | checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" 1554 | 1555 | [[package]] 1556 | name = "web-sys" 1557 | version = "0.3.72" 1558 | source = "registry+https://github.com/rust-lang/crates.io-index" 1559 | checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" 1560 | dependencies = [ 1561 | "js-sys", 1562 | "wasm-bindgen", 1563 | ] 1564 | 1565 | [[package]] 1566 | name = "winapi" 1567 | version = "0.3.9" 1568 | source = "registry+https://github.com/rust-lang/crates.io-index" 1569 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1570 | dependencies = [ 1571 | "winapi-i686-pc-windows-gnu", 1572 | "winapi-x86_64-pc-windows-gnu", 1573 | ] 1574 | 1575 | [[package]] 1576 | name = "winapi-i686-pc-windows-gnu" 1577 | version = "0.4.0" 1578 | source = "registry+https://github.com/rust-lang/crates.io-index" 1579 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1580 | 1581 | [[package]] 1582 | name = "winapi-x86_64-pc-windows-gnu" 1583 | version = "0.4.0" 1584 | source = "registry+https://github.com/rust-lang/crates.io-index" 1585 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1586 | 1587 | [[package]] 1588 | name = "windows-registry" 1589 | version = "0.2.0" 1590 | source = "registry+https://github.com/rust-lang/crates.io-index" 1591 | checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" 1592 | dependencies = [ 1593 | "windows-result", 1594 | "windows-strings", 1595 | "windows-targets 0.52.6", 1596 | ] 1597 | 1598 | [[package]] 1599 | name = "windows-result" 1600 | version = "0.2.0" 1601 | source = "registry+https://github.com/rust-lang/crates.io-index" 1602 | checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" 1603 | dependencies = [ 1604 | "windows-targets 0.52.6", 1605 | ] 1606 | 1607 | [[package]] 1608 | name = "windows-strings" 1609 | version = "0.1.0" 1610 | source = "registry+https://github.com/rust-lang/crates.io-index" 1611 | checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" 1612 | dependencies = [ 1613 | "windows-result", 1614 | "windows-targets 0.52.6", 1615 | ] 1616 | 1617 | [[package]] 1618 | name = "windows-sys" 1619 | version = "0.48.0" 1620 | source = "registry+https://github.com/rust-lang/crates.io-index" 1621 | checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" 1622 | dependencies = [ 1623 | "windows-targets 0.48.5", 1624 | ] 1625 | 1626 | [[package]] 1627 | name = "windows-sys" 1628 | version = "0.52.0" 1629 | source = "registry+https://github.com/rust-lang/crates.io-index" 1630 | checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" 1631 | dependencies = [ 1632 | "windows-targets 0.52.6", 1633 | ] 1634 | 1635 | [[package]] 1636 | name = "windows-sys" 1637 | version = "0.59.0" 1638 | source = "registry+https://github.com/rust-lang/crates.io-index" 1639 | checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" 1640 | dependencies = [ 1641 | "windows-targets 0.52.6", 1642 | ] 1643 | 1644 | [[package]] 1645 | name = "windows-targets" 1646 | version = "0.48.5" 1647 | source = "registry+https://github.com/rust-lang/crates.io-index" 1648 | checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" 1649 | dependencies = [ 1650 | "windows_aarch64_gnullvm 0.48.5", 1651 | "windows_aarch64_msvc 0.48.5", 1652 | "windows_i686_gnu 0.48.5", 1653 | "windows_i686_msvc 0.48.5", 1654 | "windows_x86_64_gnu 0.48.5", 1655 | "windows_x86_64_gnullvm 0.48.5", 1656 | "windows_x86_64_msvc 0.48.5", 1657 | ] 1658 | 1659 | [[package]] 1660 | name = "windows-targets" 1661 | version = "0.52.6" 1662 | source = "registry+https://github.com/rust-lang/crates.io-index" 1663 | checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" 1664 | dependencies = [ 1665 | "windows_aarch64_gnullvm 0.52.6", 1666 | "windows_aarch64_msvc 0.52.6", 1667 | "windows_i686_gnu 0.52.6", 1668 | "windows_i686_gnullvm", 1669 | "windows_i686_msvc 0.52.6", 1670 | "windows_x86_64_gnu 0.52.6", 1671 | "windows_x86_64_gnullvm 0.52.6", 1672 | "windows_x86_64_msvc 0.52.6", 1673 | ] 1674 | 1675 | [[package]] 1676 | name = "windows_aarch64_gnullvm" 1677 | version = "0.48.5" 1678 | source = "registry+https://github.com/rust-lang/crates.io-index" 1679 | checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" 1680 | 1681 | [[package]] 1682 | name = "windows_aarch64_gnullvm" 1683 | version = "0.52.6" 1684 | source = "registry+https://github.com/rust-lang/crates.io-index" 1685 | checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" 1686 | 1687 | [[package]] 1688 | name = "windows_aarch64_msvc" 1689 | version = "0.48.5" 1690 | source = "registry+https://github.com/rust-lang/crates.io-index" 1691 | checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" 1692 | 1693 | [[package]] 1694 | name = "windows_aarch64_msvc" 1695 | version = "0.52.6" 1696 | source = "registry+https://github.com/rust-lang/crates.io-index" 1697 | checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" 1698 | 1699 | [[package]] 1700 | name = "windows_i686_gnu" 1701 | version = "0.48.5" 1702 | source = "registry+https://github.com/rust-lang/crates.io-index" 1703 | checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" 1704 | 1705 | [[package]] 1706 | name = "windows_i686_gnu" 1707 | version = "0.52.6" 1708 | source = "registry+https://github.com/rust-lang/crates.io-index" 1709 | checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" 1710 | 1711 | [[package]] 1712 | name = "windows_i686_gnullvm" 1713 | version = "0.52.6" 1714 | source = "registry+https://github.com/rust-lang/crates.io-index" 1715 | checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" 1716 | 1717 | [[package]] 1718 | name = "windows_i686_msvc" 1719 | version = "0.48.5" 1720 | source = "registry+https://github.com/rust-lang/crates.io-index" 1721 | checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" 1722 | 1723 | [[package]] 1724 | name = "windows_i686_msvc" 1725 | version = "0.52.6" 1726 | source = "registry+https://github.com/rust-lang/crates.io-index" 1727 | checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" 1728 | 1729 | [[package]] 1730 | name = "windows_x86_64_gnu" 1731 | version = "0.48.5" 1732 | source = "registry+https://github.com/rust-lang/crates.io-index" 1733 | checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" 1734 | 1735 | [[package]] 1736 | name = "windows_x86_64_gnu" 1737 | version = "0.52.6" 1738 | source = "registry+https://github.com/rust-lang/crates.io-index" 1739 | checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" 1740 | 1741 | [[package]] 1742 | name = "windows_x86_64_gnullvm" 1743 | version = "0.48.5" 1744 | source = "registry+https://github.com/rust-lang/crates.io-index" 1745 | checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" 1746 | 1747 | [[package]] 1748 | name = "windows_x86_64_gnullvm" 1749 | version = "0.52.6" 1750 | source = "registry+https://github.com/rust-lang/crates.io-index" 1751 | checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" 1752 | 1753 | [[package]] 1754 | name = "windows_x86_64_msvc" 1755 | version = "0.48.5" 1756 | source = "registry+https://github.com/rust-lang/crates.io-index" 1757 | checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" 1758 | 1759 | [[package]] 1760 | name = "windows_x86_64_msvc" 1761 | version = "0.52.6" 1762 | source = "registry+https://github.com/rust-lang/crates.io-index" 1763 | checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" 1764 | 1765 | [[package]] 1766 | name = "zerocopy" 1767 | version = "0.7.35" 1768 | source = "registry+https://github.com/rust-lang/crates.io-index" 1769 | checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" 1770 | dependencies = [ 1771 | "byteorder", 1772 | "zerocopy-derive", 1773 | ] 1774 | 1775 | [[package]] 1776 | name = "zerocopy-derive" 1777 | version = "0.7.35" 1778 | source = "registry+https://github.com/rust-lang/crates.io-index" 1779 | checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" 1780 | dependencies = [ 1781 | "proc-macro2", 1782 | "quote", 1783 | "syn", 1784 | ] 1785 | 1786 | [[package]] 1787 | name = "zeroize" 1788 | version = "1.8.1" 1789 | source = "registry+https://github.com/rust-lang/crates.io-index" 1790 | checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" 1791 | --------------------------------------------------------------------------------