diff --git a/Cargo.toml b/Cargo.toml index 30a7a09..99c452d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,2 +1,3 @@ [workspace] -members = ["iota-storage", "iota-terms", "iota-state", "iota-cli", "iota-core", "omikron-connector", "web-server", "web-ui", "iota-logger", "iota-util"] +members = ["iota-storage", "iota-updater", "iota-terms", "iota-state", "iota-cli", "iota-core", "omikron-connector", "web-server", "web-ui", "iota-logger", "iota-util"] +resolver = "3" diff --git a/iota-updater/Cargo.toml b/iota-updater/Cargo.toml index e69de29..7c4ec88 100644 --- a/iota-updater/Cargo.toml +++ b/iota-updater/Cargo.toml @@ -0,0 +1,33 @@ +[package] +name = "iota-updater" +version = "0.1.0" +edition = "2024" + +[dependencies] +iota-logger = { path = "../iota-logger" } + +ttp-core = { git = "https://git.methanium.net/Tensamin/TTP.git", package = "ttp-core" } +ttp-native = { git = "https://git.methanium.net/Tensamin/TTP.git", package = "ttp-native" } + +json = "*" +pnet = "0.35.0" +ratatui = "0.30.0" +reqwest = "0.13.2" +tokio = { version = "1.50.0", features = ["full"] } +sysinfo = "0.38.3" +uuid = { version = "*", features = ["v4"] } +walkdir = "2.5.0" +zip = "6.0.0" +aes-gcm = "0.10.3" +base64 = "0.22.1" +rand_core = { version = "0.6", features = ["getrandom", "std"] } +sha2 = "0.10.9" +x448 = { version = "*" } +hkdf = "0.12.4" +once_cell = "1.21.3" +hex = "*" +serde = "1.0.228" +tempfile = "3.27.0" +anyhow = "1.0.102" +semver = "1.0.28" +self-replace = "1.5.0" diff --git a/iota-updater/src/lib.rs b/iota-updater/src/lib.rs index 627b3eb..4d8ddbb 100644 --- a/iota-updater/src/lib.rs +++ b/iota-updater/src/lib.rs @@ -4,9 +4,10 @@ * It is made by Yolokit and pasted in by AlexEmmet */ use anyhow::{Context, Result, anyhow}; +use iota_logger::log; +use self_replace::self_replace; use semver::Version; use std::fs::File; -use std::io::copy; use tempfile::NamedTempFile; const CURRENT_VERSION: &str = env!("CARGO_PKG_VERSION"); @@ -98,7 +99,7 @@ async fn asset_name_for_current_platform() -> String { } async fn download_asset(url: &str) -> Result { - let mut response = reqwest::get(url) + let response = reqwest::get(url) .await .context("failed to download asset")?; @@ -148,8 +149,7 @@ async fn perform_update() -> Result { let downloaded = download_asset(&asset.browser_download_url).await?; - self_replace::self_replace(downloaded.path()) - .context("failed to replace current executable")?; + self_replace(downloaded.path()).context("failed to replace current executable")?; Ok(true) } diff --git a/iota-util/Cargo.toml b/iota-util/Cargo.toml index 41502e1..51d9d49 100644 --- a/iota-util/Cargo.toml +++ b/iota-util/Cargo.toml @@ -4,13 +4,9 @@ version = "0.1.0" edition = "2024" [dependencies] - ttp-core = { git = "https://git.methanium.net/Tensamin/TTP.git", package = "ttp-core" } ttp-native = { git = "https://git.methanium.net/Tensamin/TTP.git", package = "ttp-native" } -json = "*" -pnet = "0.35.0" -ratatui = "0.30.0" reqwest = "0.13.2" tokio = { version = "1.50.0", features = ["full"] } sysinfo = "0.38.3" @@ -23,10 +19,4 @@ rand_core = { version = "0.6", features = ["getrandom", "std"] } sha2 = "0.10.9" x448 = { version = "*" } hkdf = "0.12.4" -once_cell = "1.21.3" hex = "*" -serde = "1.0.228" -tempfile = "3.27.0" -anyhow = "1.0.102" -semver = "1.0.28" -serde_macros = "0.8.9" diff --git a/iota-util/src/lib.rs b/iota-util/src/lib.rs index ebef516..2277b2b 100644 --- a/iota-util/src/lib.rs +++ b/iota-util/src/lib.rs @@ -1,5 +1,3 @@ pub mod crypto_helper; pub mod crypto_util; pub mod file_util; -pub mod langu; -pub mod update_util; diff --git a/web-ui/Cargo.toml b/web-ui/Cargo.toml index 16a8974..e0debbd 100644 --- a/web-ui/Cargo.toml +++ b/web-ui/Cargo.toml @@ -24,15 +24,7 @@ futures = "*" futures-util = "*" hex = "*" hkdf = "0.12.4" -hyper = { version = "1.8.1", features = [ - "capi", - "client", - "full", - "http1", - "http2", - "nightly", - "server", -] } +hyper = { version = "1.8.1", features = ["capi", "client", "full", "http1", "http2", "nightly", "server"] } hyper-util = { version = "*" } json = "*" lazy_static = "1.5.0"