add i2p-zero to gui installation manager

This commit is contained in:
creating2morrow 2023-05-07 03:35:56 -04:00
parent 6f97ce12b2
commit 1e7f786994
5 changed files with 30 additions and 7 deletions

2
.gitignore vendored
View file

@ -9,4 +9,6 @@ monero-wallet-rpc.log
notes.txt
.vscode/settings.json
*.bz2
*.zip
*/monero-x86_64-linux-gnu-v0.18.2.2/**
*/i2p-zero-linux.v1.20/**

View file

@ -15,7 +15,9 @@ pub mod user; // user rep/service layer
pub const NEVMES_JWP_SECRET_KEY: &str = "NEVMES_JWP_SECRET_KEY";
pub const NEVMES_JWT_SECRET_KEY: &str = "NEVMES_JWT_SECRET_KEY";
// set the latest monero release download here
/// The latest monero release download
pub const MONERO_RELEASE_VERSION: &str = "monero-linux-x64-v0.18.2.2.tar.bz2";
/// The latest i2p-zero release version
pub const I2P_ZERO_RELEASE_VERSION: &str = "v1.20";
// DO NOT EDIT BELOW THIS LINE

View file

@ -241,9 +241,9 @@ async fn validate_proof(txp: &TxProof) -> TxProof {
/// Validate that the subaddress in the proof was
///
/// created by us. TODO(c2m): Store the index for quicker
/// created by us. TODO(?): Use xmr rpc call `get_address_index`
///
/// lookups.
/// for faster lookups (check minor > 0)
async fn validate_subaddress(subaddress: &String) -> bool {
let m_address = monero::get_address().await;
let all_address = m_address.result.addresses;

View file

@ -422,6 +422,25 @@ pub async fn install_software(installations: Installations) {
}
if installations.i2p_zero {
info!("installing i2p-zero");
let i2p_version = crate::I2P_ZERO_RELEASE_VERSION;
let i2p_zero_zip = format!("i2p-zero-linux.{}.zip", i2p_version);
let link = format!("https://github.com/i2p-zero/i2p-zero/releases/download/{}/{}",
i2p_version, i2p_zero_zip);
let curl = std::process::Command::new("curl")
.args(["-LO#", &link])
.status();
match curl {
Ok(curl_output) => {
debug!("{:?}", curl_output);
tokio::time::sleep(std::time::Duration::from_secs(1)).await;
let unzip_output = std::process::Command::new("unzip")
.arg(i2p_zero_zip)
.spawn()
.expect("i2p unzip failed");
debug!("{:?}", unzip_output.stdout);
},
_=> error!("i2p-zero download failed")
}
}
if installations.xmr {
info!("installing monero");

View file

@ -218,14 +218,14 @@ impl eframe::App for HomeApp {
.vscroll(true)
.show(&ctx, |ui| {
// let mut wants_i2p = self.installations.i2p;
// let mut wants_i2p_zero = self.installations.i2p_zero;
let mut wants_i2p_zero = self.installations.i2p_zero;
let mut wants_xmr = self.installations.xmr;
// if ui.checkbox(&mut wants_i2p, "i2p").changed() {
// self.installations.i2p = !self.installations.i2p;
// }
// if ui.checkbox(&mut wants_i2p_zero, "i2p-zero").changed() {
// self.installations.i2p_zero = !self.installations.i2p_zero;
// }
if ui.checkbox(&mut wants_i2p_zero, "i2p-zero").changed() {
self.installations.i2p_zero = !self.installations.i2p_zero;
}
if ui.checkbox(&mut wants_xmr, "xmr").changed() {
self.installations.xmr = !self.installations.xmr;
}