summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorNamilskyy <alive6863@gmail.com>2025-12-03 21:00:31 +0300
committerNamilskyy <alive6863@gmail.com>2025-12-03 21:00:31 +0300
commit2c8b804cd61a480501069cdf4d4377f3c2cf30bb (patch)
tree2eecc7396b2445d881c316848f158830aa6a8d7d /src/net
parent2c7b2b72edf32ec19ac9b72b47c075209717deb4 (diff)
Not much of the documentation has been implemented, as well as some minor changes
Diffstat (limited to 'src/net')
-rw-r--r--src/net/emissary_i2p.rs60
-rw-r--r--src/net/http_package.rs2
-rw-r--r--src/net/i2p_package.rs1
-rw-r--r--src/net/i2p_tools.rs0
-rw-r--r--src/net/mod.rs4
5 files changed, 2 insertions, 65 deletions
diff --git a/src/net/emissary_i2p.rs b/src/net/emissary_i2p.rs
deleted file mode 100644
index b9e5967..0000000
--- a/src/net/emissary_i2p.rs
+++ /dev/null
@@ -1,60 +0,0 @@
-use emissary_core::{
- I2cpConfig,
- Ntcp2Config
-};
-
-
-use crate::pkgtoolkit::pkgtools::Package;
-use crate::Config;
-
-use indicatif::{ProgressBar, ProgressStyle};
-use std::{collections::HashMap, path::Path};
-use tokio::io::{AsyncReadExt, AsyncWriteExt, BufReader};
-
-pub struct I2PPackage {
- pub config: Config,
- pub i2p_config: emissary_core::Config,
- pub index_packages: Option<HashMap<String, Package>>,
-}
-
-impl I2PPackage {
- pub fn new(cfg: Config, i2p_cfg: emissary_core::Config) -> Self {
- I2PPackage {
- config: cfg,
- i2p_config: i2p_cfg,
- index_packages: None,
- }
- }
-
- pub async fn fetch_index(&mut self) -> Result<(), Box<dyn std::error::Error>> {
- let cfg = Config::parse()?;
-
- let repo_url = &self.config.repo.repo_url;
- let cache_dir = &self.config.paths.cache_dir;
-
- let utl = url::Url::parse(repo_url).unwrap();
- let host = utl.host_str().ok_or("No host in URL")?;
-
- let request_path = utl.path();
- let request_path = if request_path.ends_with(".tar.gz") {
- request_path.to_string()
- } else {
- format!("{}/INDEX.tar.gz", request_path.trim_end_matches('/'))
- };
-
-
- let StorageBundle {
- ntcp2_iv,
- ntcp2_key,
- profiles,
- router_info,
- routers,
- signing_key,
- static_key,
- ssu2_intro_key,
- ssu2_static_key,
- } = storage.load().await;
-
- Ok(())
- }
-} \ No newline at end of file
diff --git a/src/net/http_package.rs b/src/net/http_package.rs
index 4b2aefa..8fb2e19 100644
--- a/src/net/http_package.rs
+++ b/src/net/http_package.rs
@@ -1,3 +1,5 @@
+// TODO: Add signatures checking and fix mixed sync/async use.
+
use crate::cfg::config::Config;
use crate::pkgtoolkit::pkgtools::Package;
use flate2::read::GzDecoder;
diff --git a/src/net/i2p_package.rs b/src/net/i2p_package.rs
index 2b847d6..f46ddc7 100644
--- a/src/net/i2p_package.rs
+++ b/src/net/i2p_package.rs
@@ -191,7 +191,6 @@ impl I2PPackage {
content_length: u64,
description: &str,
) -> Result<(), Box<dyn std::error::Error>> {
- // Прогресс-бар для загрузки
let pb = if content_length > 0 {
let pb = ProgressBar::new(content_length);
pb.set_style(ProgressStyle::default_bar()
diff --git a/src/net/i2p_tools.rs b/src/net/i2p_tools.rs
deleted file mode 100644
index e69de29..0000000
--- a/src/net/i2p_tools.rs
+++ /dev/null
diff --git a/src/net/mod.rs b/src/net/mod.rs
index 20a050e..1a04189 100644
--- a/src/net/mod.rs
+++ b/src/net/mod.rs
@@ -1,6 +1,2 @@
pub mod http_package;
pub mod i2p_package;
-// unimplemented
-// now i rewritting with emissary, SAMv3 not for download files btw
-// but yosemite one of docemented lib for i2p (SAMv3 only), it-s better i try to use it
-// pub mod emissary_i2p; \ No newline at end of file