update i2p-zero v1.21 installation manager link

This commit is contained in:
creating2morrow 2023-05-17 16:30:07 -04:00
parent d037e68fd4
commit da12468eae
2 changed files with 13 additions and 1 deletions

View file

@ -59,6 +59,9 @@ impl Default for Tunnels {
} }
} }
/// Looks for the `tunnels-config.json` at /home/$USER/.i2p-zero/config/
///
/// and attempts to extract the app and http proxy tunnel information.
async fn find_tunnels() { async fn find_tunnels() {
let app_port = utils::get_app_port(); let app_port = utils::get_app_port();
let file_path = format!( let file_path = format!(
@ -83,6 +86,9 @@ async fn find_tunnels() {
} }
} }
/// Called on application startup for i2p tunnel creation,
///
/// proxy tunnel, etc. Logs proxy status every minute.
pub async fn start() { pub async fn start() {
info!("starting i2p-zero"); info!("starting i2p-zero");
let args = args::Args::parse(); let args = args::Args::parse();
@ -107,6 +113,7 @@ pub async fn start() {
} }
} }
/// Create an i2p tunnel for the NEVMES application
fn create_tunnel() { fn create_tunnel() {
info!("creating tunnel"); info!("creating tunnel");
let args = args::Args::parse(); let args = args::Args::parse();
@ -143,6 +150,9 @@ fn create_http_proxy() {
debug!("{:?}", output.stdout); debug!("{:?}", output.stdout);
} }
/// This is the `dest` value of the app i2p tunnel
///
/// in `tunnels-config.json`.
pub fn get_destination() -> String { pub fn get_destination() -> String {
let file_path = format!( let file_path = format!(
"/home/{}/.i2p-zero/config/tunnels.json", "/home/{}/.i2p-zero/config/tunnels.json",
@ -168,6 +178,7 @@ pub fn get_destination() -> String {
utils::empty_string() utils::empty_string()
} }
/// Ping the i2p-zero http proxy `tunnel-control http.state <port>`
pub async fn check_connection() -> ProxyStatus { pub async fn check_connection() -> ProxyStatus {
let args = args::Args::parse(); let args = args::Args::parse();
let path = args.i2p_zero_dir; let path = args.i2p_zero_dir;
@ -177,6 +188,7 @@ pub async fn check_connection() -> ProxyStatus {
.output() .output()
.expect("check i2p connection failed"); .expect("check i2p connection failed");
let str_status = String::from_utf8(output.stdout).unwrap(); let str_status = String::from_utf8(output.stdout).unwrap();
debug!("http proxy is {}", &str_status);
if str_status == ProxyStatus::Open.value() { if str_status == ProxyStatus::Open.value() {
ProxyStatus::Open ProxyStatus::Open
} else { } else {

View file

@ -489,7 +489,7 @@ pub async fn install_software(installations: Installations) -> bool {
let i2p_version = crate::I2P_ZERO_RELEASE_VERSION; let i2p_version = crate::I2P_ZERO_RELEASE_VERSION;
let i2p_zero_zip = format!("i2p-zero-linux.{}.zip", i2p_version); let i2p_zero_zip = format!("i2p-zero-linux.{}.zip", i2p_version);
let link = format!( let link = format!(
"https://github.com/creating2morrow/i2p-zero/releases/download/{}/{}", "https://github.com/creating2morrow/i2p-zero/releases/download/{}-nevmes/{}",
i2p_version, i2p_zero_zip i2p_version, i2p_zero_zip
); );
let curl = std::process::Command::new("curl") let curl = std::process::Command::new("curl")