diff options
| author | Namilskyy <alive6863@gmail.com> | 2025-11-25 19:30:30 +0300 |
|---|---|---|
| committer | Namilskyy <alive6863@gmail.com> | 2025-11-25 19:30:30 +0300 |
| commit | 2f3c93066163b32eb62aa15797ec4fff90c7cce8 (patch) | |
| tree | 24d0fa6dcd6043885002e0efd707554b15fa0d83 /src | |
| parent | 778f713b2c4b8f8311daf2b878de91e449f69988 (diff) | |
Switched unworking i2p_client to emissary-core library as i2p implementation.
Diffstat (limited to 'src')
| -rw-r--r-- | src/cfg/config.rs | 6 | ||||
| -rw-r--r-- | src/i2impl/i2tools.rs | 0 | ||||
| -rw-r--r-- | src/i2impl/mi2p.rs | 33 | ||||
| -rw-r--r-- | src/main.rs | 34 | ||||
| -rw-r--r-- | src/pkgtoolkit/pkgtools.rs | 4 |
5 files changed, 75 insertions, 2 deletions
diff --git a/src/cfg/config.rs b/src/cfg/config.rs index 8672433..7c81e21 100644 --- a/src/cfg/config.rs +++ b/src/cfg/config.rs @@ -37,6 +37,10 @@ pub struct Repo { pub repo_url: String, #[serde(rename = "auto_update")] pub auto_update: bool, + #[serde(rename = "destination")] + pub destination: (String, String), +// #[serde(rename = "arch")] +// pub arch = arch; } #[derive(Deserialize, Debug, Serialize)] @@ -68,6 +72,8 @@ impl Config { repo_url: format!("https://mesk.anthrill.i2p/repo/{}/", std::env::consts::ARCH), auto_update: true, + destination: (String::from("mesk"), String::from("mesk")), + // Its a hurt place, you need to generate destinations by i2pd and paste here (to mesk.toml) }, log: Log { log_file: String::from("/var/log/mesk.log"), diff --git a/src/i2impl/i2tools.rs b/src/i2impl/i2tools.rs new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/i2impl/i2tools.rs diff --git a/src/i2impl/mi2p.rs b/src/i2impl/mi2p.rs index e69de29..223c17f 100644 --- a/src/i2impl/mi2p.rs +++ b/src/i2impl/mi2p.rs @@ -0,0 +1,33 @@ + +use crate::cfg::config::Config; + +use emissary_core::I2cpConfig; + +/* +use i2p_client::ClientType; +use i2p_client::I2PClient; +use i2p_client::SessionStyle::Stream; +use i2p_client::Session; + +struct I2PStatus { + Connected: bool, + ConnectionType: ClientType, +} + +impl I2PStatus { + pub fn connect(&self) -> Result<bool, std::io::Error> { + + let config: Config = Config::parse().unwrap(); + let client= I2PClient::new(true, "MeskPKG-manager".to_string(), "2.0", "2.58.0", 10); + // let destination = Session::r#gen(&mut self, SigType::EdDsaSha512Ed25519) + let session = Session::create(config.repo.repo_url, + &config.repo.destination.0, + "MeskPKG-manager", + Stream, + "2.0", + "2.58"); + + Ok(true) + } +} +*/
\ No newline at end of file diff --git a/src/main.rs b/src/main.rs index a2d4aa0..00d0116 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,6 +6,40 @@ use crate::cfg::config::Config; use crate::pkgtoolkit::pkgtools::Package; use crate::i2impl::mi2p; +use clap::{Parser, Subcommand, Args}; + +#[derive(Parser)] +struct Cli { + #[command(subcommand)] + command: Commands, +} + +#[derive(Subcommand)] +enum Commands { + Validate { + pkgname: String, + }, + Build{ + pkgname: String, + }, + Install{ + pkgname: String, + }, + Uninstall{ + pkgname: String, + }, + +} + +#[derive(Args, Clone)] +struct RemoteInstallArgs { + Verbose: bool, + Debug: bool, + Bin: bool, + Source: bool, + I2P: bool, +} + fn main() { todo!() }
\ No newline at end of file diff --git a/src/pkgtoolkit/pkgtools.rs b/src/pkgtoolkit/pkgtools.rs index 7197d9e..9487c03 100644 --- a/src/pkgtoolkit/pkgtools.rs +++ b/src/pkgtoolkit/pkgtools.rs @@ -5,7 +5,7 @@ use std::path::Path; use flate2::read::GzDecoder; use tar::Archive; -pub enum arch { +pub enum archs { x86_64, aarch64, x86, @@ -14,7 +14,7 @@ pub enum arch { pub struct Package { name: String, version: String, - arch: arch, + arch: archs, descr: String, } |
