From 2e73eb7b8fc5b93784c859b5b2a222e65782ee17 Mon Sep 17 00:00:00 2001 From: kruserr <46799551+kruserr@users.noreply.github.com> Date: Tue, 8 Oct 2024 20:18:34 +0000 Subject: [PATCH 1/9] chore: init i6-pack migration --- i6-pack/Cargo.toml | 14 +++++++ i6-pack/src/compression.rs | 53 ++++++++++++++++++++++++ i6-pack/src/encryption.rs | 83 ++++++++++++++++++++++++++++++++++++++ i6-pack/src/lib.rs | 3 ++ i6-pack/src/main.rs | 78 +++++++++++++++++++++++++++++++++++ i6-pack/src/utils.rs | 28 +++++++++++++ 6 files changed, 259 insertions(+) create mode 100644 i6-pack/Cargo.toml create mode 100644 i6-pack/src/compression.rs create mode 100644 i6-pack/src/encryption.rs create mode 100644 i6-pack/src/lib.rs create mode 100644 i6-pack/src/main.rs create mode 100644 i6-pack/src/utils.rs diff --git a/i6-pack/Cargo.toml b/i6-pack/Cargo.toml new file mode 100644 index 0000000..0978186 --- /dev/null +++ b/i6-pack/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "i6-pack" +version = "0.0.1" +edition = "2021" + +[dependencies] +clap = "4" +tar = "0.4" +zstd = "0.13" +aes-gcm = "0.10" +rand = "0.8" +hmac = "0.12" +uuid = {version = "1", features = ["v4"]} +argon2 = "0.5" diff --git a/i6-pack/src/compression.rs b/i6-pack/src/compression.rs new file mode 100644 index 0000000..e789806 --- /dev/null +++ b/i6-pack/src/compression.rs @@ -0,0 +1,53 @@ +use std::fs::File; +use std::io::{self, Write}; +use std::path::Path; +use tar::Builder; +use zstd::stream::{decode_all, encode_all}; + +pub fn create_tar_archive>( + folder: P, + tar_file: &str, +) -> io::Result<()> { + let tar_gz = File::create(tar_file)?; + let mut archive = Builder::new(tar_gz); + archive.append_dir_all(".", folder)?; + Ok(()) +} + +pub fn extract_tar_archive(tar_file: &str, output_dir: &str) -> io::Result<()> { + let tar_gz = File::open(tar_file)?; + let mut archive = tar::Archive::new(tar_gz); + + let mut final_output_dir = output_dir.to_string(); + if Path::new(output_dir).exists() { + final_output_dir = format!("{}-{}", output_dir, uuid::Uuid::new_v4()); + } + + std::fs::create_dir_all(&final_output_dir)?; + archive.unpack(&final_output_dir)?; + Ok(()) +} + +pub fn compress_tar_file( + tar_file: &str, + compressed_file: &str, +) -> io::Result<()> { + let tar = File::open(tar_file)?; + let compressed = File::create(compressed_file)?; + let mut tar_reader = tar; + let mut compressed_writer = compressed; + let compressed_data = encode_all(&mut tar_reader, 0)?; + compressed_writer.write_all(&compressed_data)?; + Ok(()) +} + +pub fn decompress_file( + compressed_file: &str, + output_file: &str, +) -> io::Result<()> { + let compressed = File::open(compressed_file)?; + let decompressed_data = decode_all(compressed)?; + let mut decompressed = File::create(output_file)?; + decompressed.write_all(&decompressed_data)?; + Ok(()) +} diff --git a/i6-pack/src/encryption.rs b/i6-pack/src/encryption.rs new file mode 100644 index 0000000..fdc9a2c --- /dev/null +++ b/i6-pack/src/encryption.rs @@ -0,0 +1,83 @@ +use aes_gcm::{ + aead::{Aead, KeyInit}, + Aes256Gcm, Key, Nonce, +}; +use hmac::digest::{generic_array::GenericArray, typenum}; +use rand::RngCore; +use std::fs::File; +use std::io::{self, Write}; + +const SALT_LEN: usize = 16; +const NONCE_LEN: usize = 12; + +fn generate_salt() -> [u8; SALT_LEN] { + let mut salt = [0u8; SALT_LEN]; + rand::thread_rng().fill_bytes(&mut salt); + salt +} + +fn generate_nonce() -> Nonce { + let mut nonce = [0u8; NONCE_LEN]; + rand::thread_rng().fill_bytes(&mut nonce); + *Nonce::from_slice(&nonce) +} + +fn derive_key_from_password_argon2(password: &str, salt: &[u8]) -> [u8; 32] { + use argon2::{self, password_hash::SaltString, Argon2, PasswordHasher}; + + let argon2 = Argon2::default(); + let salt = SaltString::encode_b64(salt).unwrap(); + let password_hash = argon2.hash_password(password.as_bytes(), &salt).unwrap(); + let key = password_hash.hash.unwrap(); + let mut key_bytes = [0u8; 32]; + key_bytes.copy_from_slice(key.as_bytes()); + key_bytes +} + +pub fn encrypt_file( + input_file: &str, + output_file: &str, + password: &str, +) -> io::Result<()> { + let salt = generate_salt(); + let key = derive_key_from_password_argon2(password, &salt); + let cipher = Aes256Gcm::new(Key::::from_slice(&key)); + let nonce = generate_nonce(); + + let file_content = std::fs::read(input_file)?; + let ciphertext = cipher + .encrypt(&nonce, file_content.as_ref()) + .map_err(|_| io::Error::new(io::ErrorKind::Other, "Encryption failure"))?; + + let mut output = File::create(output_file)?; + output.write_all(&salt)?; // Prepend salt + output.write_all(nonce.as_slice())?; // Prepend nonce + output.write_all(&ciphertext)?; + Ok(()) +} + +pub fn decrypt_file( + input_file: &str, + output_file: &str, + password: &str, +) -> io::Result<()> { + let file_content = std::fs::read(input_file)?; + let (salt_and_nonce, ciphertext) = + file_content.split_at(SALT_LEN + NONCE_LEN); // Extract salt and nonce + let (salt, nonce) = salt_and_nonce.split_at(SALT_LEN); // Extract salt + + let key = derive_key_from_password_argon2(password, salt); + let cipher = Aes256Gcm::new(Key::::from_slice(&key)); + + let nonce = GenericArray::from_slice(nonce); + let plaintext = match cipher.decrypt(nonce, ciphertext) { + Ok(pt) => pt, + Err(_) => { + return Err(io::Error::new(io::ErrorKind::Other, "Decryption failure")) + } + }; + + let mut output = File::create(output_file)?; + output.write_all(&plaintext)?; + Ok(()) +} diff --git a/i6-pack/src/lib.rs b/i6-pack/src/lib.rs new file mode 100644 index 0000000..4e69181 --- /dev/null +++ b/i6-pack/src/lib.rs @@ -0,0 +1,3 @@ +pub mod compression; +pub mod encryption; +pub mod utils; diff --git a/i6-pack/src/main.rs b/i6-pack/src/main.rs new file mode 100644 index 0000000..6a28a2d --- /dev/null +++ b/i6-pack/src/main.rs @@ -0,0 +1,78 @@ +mod compression; +mod encryption; +mod utils; + +use clap::{Arg, Command as ClapCommand}; +use std::io; + +fn main() -> io::Result<()> { + let matches = ClapCommand::new("encryptor") + .version("1.0") + .author("kruserr") + .about( + "Compress and encrypt a folder, or decrypt and decompress an archive", + ) + .arg( + Arg::new("action") + .help("Action to perform: pack or unpack") + .required(true) + .index(1), + ) + .arg( + Arg::new("target") + .help("Folder to compress and encrypt, or to extract to") + .required(true) + .index(2), + ) + .arg( + Arg::new("password") + .help("Password for encryption/decryption") + .required(true) + .index(3), + ) + .get_matches(); + + let action = matches.get_one::("action").unwrap(); + let target = matches.get_one::("target").unwrap(); + let password = matches.get_one::("password").unwrap(); + + // Validate and sanitize the target path + let target_path = utils::validate_path(target) + .or_else(|_| utils::sanitize_output_path(target)) + .expect("Invalid target path"); + + let tar_file = + &format!(".{}_{}.tar", target_path.display(), uuid::Uuid::new_v4()); + let compressed_file = + &format!(".{}_{}.tar.zst", target_path.display(), uuid::Uuid::new_v4()); + let encrypted_file = &format!("{}.i6p", target_path.display()); + + match action.as_str() { + "pack" => { + compression::create_tar_archive(target_path.to_str().unwrap(), tar_file)?; + compression::compress_tar_file(tar_file, compressed_file)?; + encryption::encrypt_file(compressed_file, encrypted_file, password)?; + } + "unpack" => { + encryption::decrypt_file( + target_path.to_str().unwrap(), + compressed_file, + password, + )?; + compression::decompress_file(compressed_file, tar_file)?; + compression::extract_tar_archive( + tar_file, + &utils::remove_extension(target_path.to_str().unwrap(), ".i6p"), + )?; + } + _ => { + eprintln!("Invalid action. Use 'pack' or 'unpack'."); + std::process::exit(1); + } + } + + // Clean up temporary files + std::fs::remove_file(tar_file)?; + std::fs::remove_file(compressed_file)?; + Ok(()) +} diff --git a/i6-pack/src/utils.rs b/i6-pack/src/utils.rs new file mode 100644 index 0000000..850f1f8 --- /dev/null +++ b/i6-pack/src/utils.rs @@ -0,0 +1,28 @@ +use std::io; +use std::path::{Path, PathBuf}; + +pub fn remove_extension(filename: &str, extension: &str) -> String { + filename.strip_suffix(extension).unwrap_or(filename).to_owned() +} + +pub fn validate_path(path: &str) -> io::Result { + let path = Path::new(path); + if path.exists() { + Ok(path.to_path_buf()) + } else { + Err(io::Error::new(io::ErrorKind::NotFound, "Path does not exist")) + } +} + +pub fn sanitize_output_path(output_path: &str) -> io::Result { + let path = Path::new(output_path); + if path.is_absolute() + && !path + .components() + .any(|comp| matches!(comp, std::path::Component::ParentDir)) + { + Ok(path.to_path_buf()) + } else { + Err(io::Error::new(io::ErrorKind::InvalidInput, "Invalid output path")) + } +} From 39e5dd1cd84b7a9130df30941184ca7d03493257 Mon Sep 17 00:00:00 2001 From: kruserr <46799551+kruserr@users.noreply.github.com> Date: Tue, 8 Oct 2024 20:20:00 +0000 Subject: [PATCH 2/9] chore: init i6-pack migration --- ci.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ci.sh b/ci.sh index 43930be..4fcbf3a 100755 --- a/ci.sh +++ b/ci.sh @@ -5,6 +5,11 @@ ci () { cargo +nightly fmt --all cargo clippy --all-targets --all-features -- -Dwarnings cargo test + + # cargo audit + # cargo upgrade --verbose + # cargo update --verbose + # cargo +nightly udeps --all-targets } ci From f577276ffb82f93f8a7b807f0747b1bedf3890fa Mon Sep 17 00:00:00 2001 From: kruserr <46799551+kruserr@users.noreply.github.com> Date: Tue, 8 Oct 2024 20:22:23 +0000 Subject: [PATCH 3/9] chore: set up workspace --- Cargo.lock | 507 ++++++++++++++++++++++++++++---- Cargo.toml | 38 +-- i6/Cargo.toml | 31 ++ {src => i6/src}/http/mod.rs | 0 {src => i6/src}/lib.rs | 0 {src => i6/src}/main.rs | 0 {src => i6/src}/timer/create.rs | 0 {src => i6/src}/timer/list.rs | 0 {src => i6/src}/timer/mod.rs | 0 {src => i6/src}/timer/print.rs | 0 {src => i6/src}/timer/stop.rs | 0 11 files changed, 487 insertions(+), 89 deletions(-) create mode 100644 i6/Cargo.toml rename {src => i6/src}/http/mod.rs (100%) rename {src => i6/src}/lib.rs (100%) rename {src => i6/src}/main.rs (100%) rename {src => i6/src}/timer/create.rs (100%) rename {src => i6/src}/timer/list.rs (100%) rename {src => i6/src}/timer/mod.rs (100%) rename {src => i6/src}/timer/print.rs (100%) rename {src => i6/src}/timer/stop.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index a70dd91..556e3a2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.24.1" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] @@ -17,11 +17,107 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" +[[package]] +name = "aead" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" +dependencies = [ + "crypto-common", + "generic-array", +] + +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "aes-gcm" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" +dependencies = [ + "aead", + "aes", + "cipher", + "ctr", + "ghash", + "subtle", +] + +[[package]] +name = "anstream" +version = "0.6.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" + +[[package]] +name = "anstyle-parse" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + +[[package]] +name = "argon2" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c3610892ee6e0cbce8ae2700349fcf8f98adb0dbfbee85aec3c9179d29cc072" +dependencies = [ + "base64ct", + "blake2", + "cpufeatures", + "password-hash", +] + [[package]] name = "async-trait" -version = "0.1.82" +version = "0.1.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", @@ -41,9 +137,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "backtrace" @@ -67,10 +163,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] -name = "base64" -version = "0.22.1" +name = "base64ct" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "bitflags" @@ -84,6 +180,15 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest", +] + [[package]] name = "block-buffer" version = "0.10.4" @@ -107,10 +212,12 @@ checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" [[package]] name = "cc" -version = "1.1.21" +version = "1.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0" +checksum = "2e80e3b6a3ab07840e1cae9b0666a63970dc28e8ed5ffbcdacbfc760c281bfc1" dependencies = [ + "jobserver", + "libc", "shlex", ] @@ -120,6 +227,16 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + [[package]] name = "clap" version = "3.2.25" @@ -128,13 +245,34 @@ checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" dependencies = [ "atty", "bitflags 1.3.2", - "clap_lex", + "clap_lex 0.2.4", "indexmap 1.9.3", - "strsim", + "strsim 0.10.0", "termcolor", "textwrap", ] +[[package]] +name = "clap" +version = "4.5.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" +dependencies = [ + "clap_builder", +] + +[[package]] +name = "clap_builder" +version = "4.5.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" +dependencies = [ + "anstream", + "anstyle", + "clap_lex 0.7.2", + "strsim 0.11.1", +] + [[package]] name = "clap_lex" version = "0.2.4" @@ -144,6 +282,18 @@ dependencies = [ "os_str_bytes", ] +[[package]] +name = "clap_lex" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" + +[[package]] +name = "colorchoice" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" + [[package]] name = "cpufeatures" version = "0.2.14" @@ -160,9 +310,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array", + "rand_core", "typenum", ] +[[package]] +name = "ctr" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" +dependencies = [ + "cipher", +] + [[package]] name = "data-encoding" version = "2.6.0" @@ -177,6 +337,7 @@ checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", "crypto-common", + "subtle", ] [[package]] @@ -194,6 +355,28 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "errno" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "filetime" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" +dependencies = [ + "cfg-if", + "libc", + "libredox", + "windows-sys 0.59.0", +] + [[package]] name = "fnv" version = "1.0.7" @@ -226,9 +409,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -236,27 +419,27 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-core", "futures-sink", @@ -287,11 +470,21 @@ dependencies = [ "wasi", ] +[[package]] +name = "ghash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0d8a4362ccb29cb0b265253fb0a2728f592895ee6854fd9bc13f2ffda266ff1" +dependencies = [ + "opaque-debug", + "polyval", +] + [[package]] name = "gimli" -version = "0.31.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "h2" @@ -305,7 +498,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.5.0", + "indexmap 2.6.0", "slab", "tokio", "tokio-util", @@ -320,9 +513,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.5" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" [[package]] name = "headers" @@ -330,7 +523,7 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06683b93020a07e3dbcf5f8c0f6d40080d725bea7936fc01ad345c01b97dc270" dependencies = [ - "base64 0.21.7", + "base64", "bytes", "headers-core", "http 0.2.12", @@ -363,6 +556,15 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + [[package]] name = "http" version = "0.2.12" @@ -398,9 +600,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.4" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "httpdate" @@ -436,7 +638,7 @@ dependencies = [ name = "i6" version = "0.1.9" dependencies = [ - "clap", + "clap 3.2.25", "openssl", "rapiddb-web", "tokio", @@ -444,6 +646,20 @@ dependencies = [ "warp", ] +[[package]] +name = "i6-pack" +version = "0.0.1" +dependencies = [ + "aes-gcm", + "argon2", + "clap 4.5.20", + "hmac", + "rand", + "tar", + "uuid", + "zstd", +] + [[package]] name = "idna" version = "0.5.0" @@ -466,20 +682,44 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.14.5", + "hashbrown 0.15.0", ] +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "generic-array", +] + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + [[package]] name = "itoa" version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +[[package]] +name = "jobserver" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +dependencies = [ + "libc", +] + [[package]] name = "lazy_static" version = "1.5.0" @@ -488,9 +728,26 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.158" +version = "0.2.159" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" + +[[package]] +name = "libredox" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.6.0", + "libc", + "redox_syscall", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lock_api" @@ -590,18 +847,24 @@ dependencies = [ [[package]] name = "object" -version = "0.36.4" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" + +[[package]] +name = "opaque-debug" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "openssl" @@ -676,6 +939,17 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "password-hash" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" +dependencies = [ + "base64ct", + "rand_core", + "subtle", +] + [[package]] name = "percent-encoding" version = "2.3.1" @@ -684,18 +958,18 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project" -version = "1.1.5" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +checksum = "baf123a161dde1e524adf36f90bc5d8d3462824a9c43553ad07a8183161189ec" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.5" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +checksum = "a4502d8515ca9f32f1fb543d987f63d95a14934883db45bdb48060b6b69257f8" dependencies = [ "proc-macro2", "quote", @@ -716,9 +990,21 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" + +[[package]] +name = "polyval" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25" +dependencies = [ + "cfg-if", + "cpufeatures", + "opaque-debug", + "universal-hash", +] [[package]] name = "ppv-lite86" @@ -731,9 +1017,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "b3e4daa0dcf6feba26f985457cdf104d4b4256fc5a09547140f3631bb076b19a" dependencies = [ "unicode-ident", ] @@ -805,9 +1091,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.4" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0884ad60e090bf1345b93da0a5de8923c93884cd03f40dfcfddd3b4bee661853" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ "bitflags 2.6.0", ] @@ -833,6 +1119,19 @@ version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +[[package]] +name = "rustix" +version = "0.38.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" +dependencies = [ + "bitflags 2.6.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + [[package]] name = "rustls" version = "0.22.4" @@ -849,19 +1148,18 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "2.1.3" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" dependencies = [ - "base64 0.22.1", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" +checksum = "0e696e35370c65c9c541198af4543ccd580cf17fc25d8e05c5a242b202488c55" [[package]] name = "rustls-webpki" @@ -1008,6 +1306,12 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + [[package]] name = "subtle" version = "2.6.1" @@ -1016,15 +1320,26 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" -version = "2.0.77" +version = "2.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "tar" +version = "0.4.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ff6c40d3aedb5e06b57c6f669ad17ab063dd1e63d977c6a88e7f4dfa4f04020" +dependencies = [ + "filetime", + "libc", + "xattr", +] + [[package]] name = "termcolor" version = "1.4.1" @@ -1042,18 +1357,18 @@ checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" [[package]] name = "thiserror" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", @@ -1244,9 +1559,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" [[package]] name = "unicode-ident" @@ -1263,6 +1578,16 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "universal-hash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" +dependencies = [ + "crypto-common", + "subtle", +] + [[package]] name = "untrusted" version = "0.9.0" @@ -1286,6 +1611,21 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "uuid" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +dependencies = [ + "getrandom", +] + [[package]] name = "valuable" version = "0.1.0" @@ -1463,6 +1803,17 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "xattr" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" +dependencies = [ + "libc", + "linux-raw-sys", + "rustix", +] + [[package]] name = "zerocopy" version = "0.7.35" @@ -1489,3 +1840,31 @@ name = "zeroize" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" + +[[package]] +name = "zstd" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcf2b778a664581e31e389454a7072dab1647606d44f7feea22cd5abb9c9f3f9" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "7.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54a3ab4db68cea366acc5c897c7b4d4d1b8994a9cd6e6f841f8964566a419059" +dependencies = [ + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.13+zstd.1.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" +dependencies = [ + "cc", + "pkg-config", +] diff --git a/Cargo.toml b/Cargo.toml index 5b7f00f..4e8ad5c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,31 +1,19 @@ -[package] -name = "i6" -version = "0.1.9" # prepare_release.sh -edition = "2021" -license = "AGPL-3.0" -authors = ["kruserr"] -readme = "README.md" -repository = "https://github.com/kruserr/i6" -description = "A collection of tools" -keywords = ["cli", "terminal", "utility", "tool", "command"] -categories = ["command-line-interface", "command-line-utilities", "development-tools"] +[workspace] +resolver = "2" -[dependencies] -clap = "3" +members = [ + "i6-pack", + "i6", -# for http and https commands -tokio = { version = "1", features = ["full"] } -# warp = "0.3" -tracing-subscriber = "0.3" -# for https command -warp = { version = "0.3", features = ["default", "tls"] } -openssl = "0.10" + # Internal + # "examples", +] -# for db command -rapiddb-web = "0.1" - -[lints.rust] +[workspace.lints.rust] unused_parens = "allow" +unused_imports = "allow" -[lints.clippy] +[workspace.lints.clippy] needless_return = "allow" +implicit_saturating_sub = "allow" +single_component_path_imports = "allow" diff --git a/i6/Cargo.toml b/i6/Cargo.toml new file mode 100644 index 0000000..5b7f00f --- /dev/null +++ b/i6/Cargo.toml @@ -0,0 +1,31 @@ +[package] +name = "i6" +version = "0.1.9" # prepare_release.sh +edition = "2021" +license = "AGPL-3.0" +authors = ["kruserr"] +readme = "README.md" +repository = "https://github.com/kruserr/i6" +description = "A collection of tools" +keywords = ["cli", "terminal", "utility", "tool", "command"] +categories = ["command-line-interface", "command-line-utilities", "development-tools"] + +[dependencies] +clap = "3" + +# for http and https commands +tokio = { version = "1", features = ["full"] } +# warp = "0.3" +tracing-subscriber = "0.3" +# for https command +warp = { version = "0.3", features = ["default", "tls"] } +openssl = "0.10" + +# for db command +rapiddb-web = "0.1" + +[lints.rust] +unused_parens = "allow" + +[lints.clippy] +needless_return = "allow" diff --git a/src/http/mod.rs b/i6/src/http/mod.rs similarity index 100% rename from src/http/mod.rs rename to i6/src/http/mod.rs diff --git a/src/lib.rs b/i6/src/lib.rs similarity index 100% rename from src/lib.rs rename to i6/src/lib.rs diff --git a/src/main.rs b/i6/src/main.rs similarity index 100% rename from src/main.rs rename to i6/src/main.rs diff --git a/src/timer/create.rs b/i6/src/timer/create.rs similarity index 100% rename from src/timer/create.rs rename to i6/src/timer/create.rs diff --git a/src/timer/list.rs b/i6/src/timer/list.rs similarity index 100% rename from src/timer/list.rs rename to i6/src/timer/list.rs diff --git a/src/timer/mod.rs b/i6/src/timer/mod.rs similarity index 100% rename from src/timer/mod.rs rename to i6/src/timer/mod.rs diff --git a/src/timer/print.rs b/i6/src/timer/print.rs similarity index 100% rename from src/timer/print.rs rename to i6/src/timer/print.rs diff --git a/src/timer/stop.rs b/i6/src/timer/stop.rs similarity index 100% rename from src/timer/stop.rs rename to i6/src/timer/stop.rs From 0ca64bf84ab7d41887714b3688a4b375948eaace Mon Sep 17 00:00:00 2001 From: kruserr <46799551+kruserr@users.noreply.github.com> Date: Tue, 8 Oct 2024 20:27:10 +0000 Subject: [PATCH 4/9] chore: set up workspace --- i6-pack/Cargo.toml | 4 ++++ i6/Cargo.toml | 10 ++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/i6-pack/Cargo.toml b/i6-pack/Cargo.toml index 0978186..3660c8f 100644 --- a/i6-pack/Cargo.toml +++ b/i6-pack/Cargo.toml @@ -2,6 +2,10 @@ name = "i6-pack" version = "0.0.1" edition = "2021" +publish = false + +[lints] +workspace = true [dependencies] clap = "4" diff --git a/i6/Cargo.toml b/i6/Cargo.toml index 5b7f00f..4c87442 100644 --- a/i6/Cargo.toml +++ b/i6/Cargo.toml @@ -2,6 +2,7 @@ name = "i6" version = "0.1.9" # prepare_release.sh edition = "2021" +default-run = "i6" license = "AGPL-3.0" authors = ["kruserr"] readme = "README.md" @@ -10,6 +11,9 @@ description = "A collection of tools" keywords = ["cli", "terminal", "utility", "tool", "command"] categories = ["command-line-interface", "command-line-utilities", "development-tools"] +[lints] +workspace = true + [dependencies] clap = "3" @@ -23,9 +27,3 @@ openssl = "0.10" # for db command rapiddb-web = "0.1" - -[lints.rust] -unused_parens = "allow" - -[lints.clippy] -needless_return = "allow" From 4f116bec79e8660a8242ec5e5ee4f10d953cca7b Mon Sep 17 00:00:00 2001 From: kruserr <46799551+kruserr@users.noreply.github.com> Date: Tue, 8 Oct 2024 20:28:39 +0000 Subject: [PATCH 5/9] fix: update name --- i6-pack/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/i6-pack/src/main.rs b/i6-pack/src/main.rs index 6a28a2d..1d0e309 100644 --- a/i6-pack/src/main.rs +++ b/i6-pack/src/main.rs @@ -6,8 +6,8 @@ use clap::{Arg, Command as ClapCommand}; use std::io; fn main() -> io::Result<()> { - let matches = ClapCommand::new("encryptor") - .version("1.0") + let matches = ClapCommand::new("i6-pack") + .version("0.0.1") .author("kruserr") .about( "Compress and encrypt a folder, or decrypt and decompress an archive", From 16c8dc96a6bbb0aa77abfdc5d21d8026746dd340 Mon Sep 17 00:00:00 2001 From: kruserr <46799551+kruserr@users.noreply.github.com> Date: Tue, 8 Oct 2024 20:49:07 +0000 Subject: [PATCH 6/9] feat: add pack command --- Cargo.lock | 3 +- i6-pack/Cargo.toml | 2 +- i6-pack/src/cli.rs | 46 ++++++++ i6-pack/src/lib.rs | 1 + i6-pack/src/main.rs | 44 +------- i6/Cargo.toml | 2 + i6/src/main.rs | 263 +++++++++++++++++++++++++------------------- 7 files changed, 201 insertions(+), 160 deletions(-) create mode 100644 i6-pack/src/cli.rs diff --git a/Cargo.lock b/Cargo.lock index 556e3a2..0784b1c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -639,6 +639,7 @@ name = "i6" version = "0.1.9" dependencies = [ "clap 3.2.25", + "i6-pack", "openssl", "rapiddb-web", "tokio", @@ -648,7 +649,7 @@ dependencies = [ [[package]] name = "i6-pack" -version = "0.0.1" +version = "0.1.9" dependencies = [ "aes-gcm", "argon2", diff --git a/i6-pack/Cargo.toml b/i6-pack/Cargo.toml index 3660c8f..a366575 100644 --- a/i6-pack/Cargo.toml +++ b/i6-pack/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "i6-pack" -version = "0.0.1" +version = "0.1.9" edition = "2021" publish = false diff --git a/i6-pack/src/cli.rs b/i6-pack/src/cli.rs new file mode 100644 index 0000000..66303cd --- /dev/null +++ b/i6-pack/src/cli.rs @@ -0,0 +1,46 @@ +use crate::utils; +use crate::compression; +use crate::encryption; + +pub fn run(action: &str, target: &str, password: &str) -> std::io::Result<()> { + // Validate and sanitize the target path + let target_path = utils::validate_path(target) + .or_else(|_| utils::sanitize_output_path(target)) + .expect("Invalid target path"); + + let tar_file = + &format!(".{}_{}.tar", target_path.display(), uuid::Uuid::new_v4()); + let compressed_file = + &format!(".{}_{}.tar.zst", target_path.display(), uuid::Uuid::new_v4()); + let encrypted_file = &format!("{}.i6p", target_path.display()); + + match action { + "pack" => { + compression::create_tar_archive(target_path.to_str().unwrap(), tar_file)?; + compression::compress_tar_file(tar_file, compressed_file)?; + encryption::encrypt_file(compressed_file, encrypted_file, password)?; + } + "unpack" => { + encryption::decrypt_file( + target_path.to_str().unwrap(), + compressed_file, + password, + )?; + compression::decompress_file(compressed_file, tar_file)?; + compression::extract_tar_archive( + tar_file, + &utils::remove_extension(target_path.to_str().unwrap(), ".i6p"), + )?; + } + _ => { + eprintln!("Invalid action. Use 'pack' or 'unpack'."); + std::process::exit(1); + } + } + + // Clean up temporary files + std::fs::remove_file(tar_file)?; + std::fs::remove_file(compressed_file)?; + + Ok(()) +} diff --git a/i6-pack/src/lib.rs b/i6-pack/src/lib.rs index 4e69181..d68ce23 100644 --- a/i6-pack/src/lib.rs +++ b/i6-pack/src/lib.rs @@ -1,3 +1,4 @@ pub mod compression; pub mod encryption; pub mod utils; +pub mod cli; diff --git a/i6-pack/src/main.rs b/i6-pack/src/main.rs index 1d0e309..636f4ce 100644 --- a/i6-pack/src/main.rs +++ b/i6-pack/src/main.rs @@ -1,6 +1,4 @@ -mod compression; -mod encryption; -mod utils; +use i6_pack::cli; use clap::{Arg, Command as ClapCommand}; use std::io; @@ -36,43 +34,5 @@ fn main() -> io::Result<()> { let target = matches.get_one::("target").unwrap(); let password = matches.get_one::("password").unwrap(); - // Validate and sanitize the target path - let target_path = utils::validate_path(target) - .or_else(|_| utils::sanitize_output_path(target)) - .expect("Invalid target path"); - - let tar_file = - &format!(".{}_{}.tar", target_path.display(), uuid::Uuid::new_v4()); - let compressed_file = - &format!(".{}_{}.tar.zst", target_path.display(), uuid::Uuid::new_v4()); - let encrypted_file = &format!("{}.i6p", target_path.display()); - - match action.as_str() { - "pack" => { - compression::create_tar_archive(target_path.to_str().unwrap(), tar_file)?; - compression::compress_tar_file(tar_file, compressed_file)?; - encryption::encrypt_file(compressed_file, encrypted_file, password)?; - } - "unpack" => { - encryption::decrypt_file( - target_path.to_str().unwrap(), - compressed_file, - password, - )?; - compression::decompress_file(compressed_file, tar_file)?; - compression::extract_tar_archive( - tar_file, - &utils::remove_extension(target_path.to_str().unwrap(), ".i6p"), - )?; - } - _ => { - eprintln!("Invalid action. Use 'pack' or 'unpack'."); - std::process::exit(1); - } - } - - // Clean up temporary files - std::fs::remove_file(tar_file)?; - std::fs::remove_file(compressed_file)?; - Ok(()) + cli::run(action, target, password) } diff --git a/i6/Cargo.toml b/i6/Cargo.toml index 4c87442..d13e203 100644 --- a/i6/Cargo.toml +++ b/i6/Cargo.toml @@ -25,5 +25,7 @@ tracing-subscriber = "0.3" warp = { version = "0.3", features = ["default", "tls"] } openssl = "0.10" +i6-pack = { version = "0.1", path = "../i6-pack" } + # for db command rapiddb-web = "0.1" diff --git a/i6/src/main.rs b/i6/src/main.rs index ae55388..a811607 100644 --- a/i6/src/main.rs +++ b/i6/src/main.rs @@ -1,136 +1,167 @@ use std::error::Error; - use clap::{value_parser, App, Arg, SubCommand}; #[tokio::main] async fn main() -> Result<(), Box> { - let http_id = "http"; - let https_id = "https"; + let http_id = "http"; + let https_id = "https"; + let pack_id = "pack"; - let matches = App::new("i6") - .version(env!("CARGO_PKG_VERSION")) - .author(env!("CARGO_PKG_AUTHORS")) - .about(env!("CARGO_PKG_DESCRIPTION")) - .subcommand( - SubCommand::with_name(http_id).about("Start a static http server").arg( - Arg::with_name("port") - .index(1) - .default_value("3030") - .value_parser(value_parser!(u16)), - ), - ) - .subcommand( - SubCommand::with_name(https_id).about("Start a static https server").arg( - Arg::with_name("port") - .index(1) - .default_value("3030") - .value_parser(value_parser!(u16)), - ), - ) - .subcommand( - SubCommand::with_name("timer") - .about("Manages timers") - .arg(Arg::with_name("minutes").index(1).takes_value(true)) - .arg(Arg::with_name("name").index(2).takes_value(true)) + let matches = App::new("i6") + .version(env!("CARGO_PKG_VERSION")) + .author(env!("CARGO_PKG_AUTHORS")) + .about(env!("CARGO_PKG_DESCRIPTION")) .subcommand( - SubCommand::with_name("create") - .about("Creates a new timer") - .arg( - Arg::with_name("minutes") - .short('m') - .long("minutes") - .takes_value(true) - .help("Sets the duration of the timer in minutes"), - ) - .arg( - Arg::with_name("name") - .short('n') - .long("name") - .takes_value(true) - .help("Sets the name of the timer"), - ), + SubCommand::with_name(http_id) + .about("Start a static http server") + .arg( + Arg::with_name("port") + .index(1) + .default_value("3030") + .value_parser(value_parser!(u16)), + ), ) .subcommand( - SubCommand::with_name("list").about("Lists all timers").alias("ls"), + SubCommand::with_name(https_id) + .about("Start a static https server") + .arg( + Arg::with_name("port") + .index(1) + .default_value("3030") + .value_parser(value_parser!(u16)), + ), ) .subcommand( - SubCommand::with_name("stop") - .about("Stops a timer") - .arg( - Arg::with_name("name") - .short('n') - .long("name") - .takes_value(true) - .help("Stops the timer with the given name"), - ) - .arg( - Arg::with_name("all") - .short('a') - .long("all") - .takes_value(false) - .help("Stops all timers"), - ), + SubCommand::with_name("timer") + .about("Manages timers") + .arg(Arg::with_name("minutes").index(1).takes_value(true)) + .arg(Arg::with_name("name").index(2).takes_value(true)) + .subcommand( + SubCommand::with_name("create") + .about("Creates a new timer") + .arg( + Arg::with_name("minutes") + .short('m') + .long("minutes") + .takes_value(true) + .help("Sets the duration of the timer in minutes"), + ) + .arg( + Arg::with_name("name") + .short('n') + .long("name") + .takes_value(true) + .help("Sets the name of the timer"), + ), + ) + .subcommand( + SubCommand::with_name("list").about("Lists all timers").alias("ls"), + ) + .subcommand( + SubCommand::with_name("stop") + .about("Stops a timer") + .arg( + Arg::with_name("name") + .short('n') + .long("name") + .takes_value(true) + .help("Stops the timer with the given name"), + ) + .arg( + Arg::with_name("all") + .short('a') + .long("all") + .takes_value(false) + .help("Stops all timers"), + ), + ) + .subcommand( + SubCommand::with_name("history") + .about("Shows the history of all timers") + .alias("log") + .arg( + Arg::with_name("json") + .short('j') + .long("json") + .takes_value(false) + .help("Prints the history in JSON format"), + ), + ), ) .subcommand( - SubCommand::with_name("history") - .about("Shows the history of all timers") - .alias("log") - .arg( - Arg::with_name("json") - .short('j') - .long("json") - .takes_value(false) - .help("Prints the history in JSON format"), - ), - ), - ) - .get_matches(); - - if let Some(matches) = matches.subcommand_matches(http_id) { - println!("http, {:?}", matches); - - let port = *matches.get_one::("port").unwrap_or(&3030); + SubCommand::with_name(pack_id) + .about("Compress and encrypt a folder, or decrypt and decompress an archive") + .arg( + Arg::with_name("action") + .help("Action to perform: pack or unpack") + .required(true) + .index(1), + ) + .arg( + Arg::with_name("target") + .help("Folder to compress and encrypt, or to extract to") + .required(true) + .index(2), + ) + .arg( + Arg::with_name("password") + .help("Password for encryption/decryption") + .required(true) + .index(3), + ), + ) + .get_matches(); - i6::http::create_server_http(port).await?; - } + if let Some(matches) = matches.subcommand_matches(http_id) { + println!("http, {:?}", matches); + let port = *matches.get_one::("port").unwrap_or(&3030); + i6::http::create_server_http(port).await?; + } - if let Some(matches) = matches.subcommand_matches(https_id) { - println!("https, {:?}", matches); + if let Some(matches) = matches.subcommand_matches(https_id) { + println!("https, {:?}", matches); + let port = *matches.get_one::("port").unwrap_or(&3030); + i6::http::create_server_https(port).await?; + } - let port = *matches.get_one::("port").unwrap_or(&3030); + if let Some(matches) = matches.subcommand_matches("timer") { + if let Some(matches) = matches.subcommand_matches("create") { + let minutes = matches.value_of("minutes").unwrap_or_default(); + let name = matches.value_of("name").unwrap_or_default(); + i6::timer::create::create_timer(minutes, name); + } else if matches.subcommand_matches("list").is_some() { + i6::timer::list::list_timers(); + } else if let Some(matches) = matches.subcommand_matches("stop") { + if matches.is_present("all") { + i6::timer::stop::stop_all_timers(); + } else { + i6::timer::stop::stop_timer( + matches.value_of("name").unwrap_or_default(), + ); + } + } else if let Some(matches) = matches.subcommand_matches("history") { + if matches.is_present("json") { + i6::timer::print::print_history_json(); + } else { + i6::timer::print::print_history(); + } + } else if let (Some(minutes), Some(name)) = + (matches.value_of("minutes"), matches.value_of("name")) + { + i6::timer::create::create_timer(minutes, name); + } else if let Some(minutes) = matches.value_of("minutes") { + i6::timer::create::create_timer(minutes, ""); + } + } - i6::http::create_server_https(port).await?; - } + if let Some(matches) = matches.subcommand_matches(pack_id) { + let action = matches.value_of("action").unwrap(); + let target = matches.value_of("target").unwrap(); + let password = matches.value_of("password").unwrap(); - if let Some(matches) = matches.subcommand_matches("timer") { - if let Some(matches) = matches.subcommand_matches("create") { - let minutes = matches.value_of("minutes").unwrap_or_default(); - let name = matches.value_of("name").unwrap_or_default(); - i6::timer::create::create_timer(minutes, name); - } else if matches.subcommand_matches("list").is_some() { - i6::timer::list::list_timers(); - } else if let Some(matches) = matches.subcommand_matches("stop") { - if matches.is_present("all") { - i6::timer::stop::stop_all_timers(); - } else { - i6::timer::stop::stop_timer( - matches.value_of("name").unwrap_or_default(), - ); - } - } else if let Some(matches) = matches.subcommand_matches("history") { - if matches.is_present("json") { - i6::timer::print::print_history_json(); - } else { - i6::timer::print::print_history(); - } - } else if let (Some(minutes), Some(name)) = - (matches.value_of("minutes"), matches.value_of("name")) - { - i6::timer::create::create_timer(minutes, name); - } else if let Some(minutes) = matches.value_of("minutes") { - i6::timer::create::create_timer(minutes, ""); + i6_pack::cli::run(action, target, password)?; } - } - return Ok(()); -} + + Ok(()) +} \ No newline at end of file From 94259c8ab5faf6a6664bf21b07d65ce4d8b792c0 Mon Sep 17 00:00:00 2001 From: kruserr <46799551+kruserr@users.noreply.github.com> Date: Tue, 8 Oct 2024 20:50:51 +0000 Subject: [PATCH 7/9] style: fmt --- i6-pack/src/cli.rs | 2 +- i6-pack/src/lib.rs | 2 +- i6/src/main.rs | 291 ++++++++++++++++++++++----------------------- 3 files changed, 146 insertions(+), 149 deletions(-) diff --git a/i6-pack/src/cli.rs b/i6-pack/src/cli.rs index 66303cd..4829067 100644 --- a/i6-pack/src/cli.rs +++ b/i6-pack/src/cli.rs @@ -1,6 +1,6 @@ -use crate::utils; use crate::compression; use crate::encryption; +use crate::utils; pub fn run(action: &str, target: &str, password: &str) -> std::io::Result<()> { // Validate and sanitize the target path diff --git a/i6-pack/src/lib.rs b/i6-pack/src/lib.rs index d68ce23..8320afd 100644 --- a/i6-pack/src/lib.rs +++ b/i6-pack/src/lib.rs @@ -1,4 +1,4 @@ +pub mod cli; pub mod compression; pub mod encryption; pub mod utils; -pub mod cli; diff --git a/i6/src/main.rs b/i6/src/main.rs index a811607..56bf78b 100644 --- a/i6/src/main.rs +++ b/i6/src/main.rs @@ -1,167 +1,164 @@ -use std::error::Error; use clap::{value_parser, App, Arg, SubCommand}; +use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { - let http_id = "http"; - let https_id = "https"; - let pack_id = "pack"; + let http_id = "http"; + let https_id = "https"; + let pack_id = "pack"; - let matches = App::new("i6") - .version(env!("CARGO_PKG_VERSION")) - .author(env!("CARGO_PKG_AUTHORS")) - .about(env!("CARGO_PKG_DESCRIPTION")) + let matches = App::new("i6") + .version(env!("CARGO_PKG_VERSION")) + .author(env!("CARGO_PKG_AUTHORS")) + .about(env!("CARGO_PKG_DESCRIPTION")) + .subcommand( + SubCommand::with_name(http_id).about("Start a static http server").arg( + Arg::with_name("port") + .index(1) + .default_value("3030") + .value_parser(value_parser!(u16)), + ), + ) + .subcommand( + SubCommand::with_name(https_id).about("Start a static https server").arg( + Arg::with_name("port") + .index(1) + .default_value("3030") + .value_parser(value_parser!(u16)), + ), + ) + .subcommand( + SubCommand::with_name("timer") + .about("Manages timers") + .arg(Arg::with_name("minutes").index(1).takes_value(true)) + .arg(Arg::with_name("name").index(2).takes_value(true)) .subcommand( - SubCommand::with_name(http_id) - .about("Start a static http server") - .arg( - Arg::with_name("port") - .index(1) - .default_value("3030") - .value_parser(value_parser!(u16)), - ), + SubCommand::with_name("create") + .about("Creates a new timer") + .arg( + Arg::with_name("minutes") + .short('m') + .long("minutes") + .takes_value(true) + .help("Sets the duration of the timer in minutes"), + ) + .arg( + Arg::with_name("name") + .short('n') + .long("name") + .takes_value(true) + .help("Sets the name of the timer"), + ), ) .subcommand( - SubCommand::with_name(https_id) - .about("Start a static https server") - .arg( - Arg::with_name("port") - .index(1) - .default_value("3030") - .value_parser(value_parser!(u16)), - ), + SubCommand::with_name("list").about("Lists all timers").alias("ls"), ) .subcommand( - SubCommand::with_name("timer") - .about("Manages timers") - .arg(Arg::with_name("minutes").index(1).takes_value(true)) - .arg(Arg::with_name("name").index(2).takes_value(true)) - .subcommand( - SubCommand::with_name("create") - .about("Creates a new timer") - .arg( - Arg::with_name("minutes") - .short('m') - .long("minutes") - .takes_value(true) - .help("Sets the duration of the timer in minutes"), - ) - .arg( - Arg::with_name("name") - .short('n') - .long("name") - .takes_value(true) - .help("Sets the name of the timer"), - ), - ) - .subcommand( - SubCommand::with_name("list").about("Lists all timers").alias("ls"), - ) - .subcommand( - SubCommand::with_name("stop") - .about("Stops a timer") - .arg( - Arg::with_name("name") - .short('n') - .long("name") - .takes_value(true) - .help("Stops the timer with the given name"), - ) - .arg( - Arg::with_name("all") - .short('a') - .long("all") - .takes_value(false) - .help("Stops all timers"), - ), - ) - .subcommand( - SubCommand::with_name("history") - .about("Shows the history of all timers") - .alias("log") - .arg( - Arg::with_name("json") - .short('j') - .long("json") - .takes_value(false) - .help("Prints the history in JSON format"), - ), - ), + SubCommand::with_name("stop") + .about("Stops a timer") + .arg( + Arg::with_name("name") + .short('n') + .long("name") + .takes_value(true) + .help("Stops the timer with the given name"), + ) + .arg( + Arg::with_name("all") + .short('a') + .long("all") + .takes_value(false) + .help("Stops all timers"), + ), ) .subcommand( - SubCommand::with_name(pack_id) - .about("Compress and encrypt a folder, or decrypt and decompress an archive") - .arg( - Arg::with_name("action") - .help("Action to perform: pack or unpack") - .required(true) - .index(1), - ) - .arg( - Arg::with_name("target") - .help("Folder to compress and encrypt, or to extract to") - .required(true) - .index(2), - ) - .arg( - Arg::with_name("password") - .help("Password for encryption/decryption") - .required(true) - .index(3), - ), + SubCommand::with_name("history") + .about("Shows the history of all timers") + .alias("log") + .arg( + Arg::with_name("json") + .short('j') + .long("json") + .takes_value(false) + .help("Prints the history in JSON format"), + ), + ), + ) + .subcommand( + SubCommand::with_name(pack_id) + .about( + "Compress and encrypt a folder, or decrypt and decompress an archive", + ) + .arg( + Arg::with_name("action") + .help("Action to perform: pack or unpack") + .required(true) + .index(1), + ) + .arg( + Arg::with_name("target") + .help("Folder to compress and encrypt, or to extract to") + .required(true) + .index(2), ) - .get_matches(); + .arg( + Arg::with_name("password") + .help("Password for encryption/decryption") + .required(true) + .index(3), + ), + ) + .get_matches(); - if let Some(matches) = matches.subcommand_matches(http_id) { - println!("http, {:?}", matches); - let port = *matches.get_one::("port").unwrap_or(&3030); - i6::http::create_server_http(port).await?; - } + if let Some(matches) = matches.subcommand_matches(http_id) { + println!("http, {:?}", matches); + let port = *matches.get_one::("port").unwrap_or(&3030); + i6::http::create_server_http(port).await?; + } - if let Some(matches) = matches.subcommand_matches(https_id) { - println!("https, {:?}", matches); - let port = *matches.get_one::("port").unwrap_or(&3030); - i6::http::create_server_https(port).await?; - } + if let Some(matches) = matches.subcommand_matches(https_id) { + println!("https, {:?}", matches); + let port = *matches.get_one::("port").unwrap_or(&3030); + i6::http::create_server_https(port).await?; + } - if let Some(matches) = matches.subcommand_matches("timer") { - if let Some(matches) = matches.subcommand_matches("create") { - let minutes = matches.value_of("minutes").unwrap_or_default(); - let name = matches.value_of("name").unwrap_or_default(); - i6::timer::create::create_timer(minutes, name); - } else if matches.subcommand_matches("list").is_some() { - i6::timer::list::list_timers(); - } else if let Some(matches) = matches.subcommand_matches("stop") { - if matches.is_present("all") { - i6::timer::stop::stop_all_timers(); - } else { - i6::timer::stop::stop_timer( - matches.value_of("name").unwrap_or_default(), - ); - } - } else if let Some(matches) = matches.subcommand_matches("history") { - if matches.is_present("json") { - i6::timer::print::print_history_json(); - } else { - i6::timer::print::print_history(); - } - } else if let (Some(minutes), Some(name)) = - (matches.value_of("minutes"), matches.value_of("name")) - { - i6::timer::create::create_timer(minutes, name); - } else if let Some(minutes) = matches.value_of("minutes") { - i6::timer::create::create_timer(minutes, ""); - } + if let Some(matches) = matches.subcommand_matches("timer") { + if let Some(matches) = matches.subcommand_matches("create") { + let minutes = matches.value_of("minutes").unwrap_or_default(); + let name = matches.value_of("name").unwrap_or_default(); + i6::timer::create::create_timer(minutes, name); + } else if matches.subcommand_matches("list").is_some() { + i6::timer::list::list_timers(); + } else if let Some(matches) = matches.subcommand_matches("stop") { + if matches.is_present("all") { + i6::timer::stop::stop_all_timers(); + } else { + i6::timer::stop::stop_timer( + matches.value_of("name").unwrap_or_default(), + ); + } + } else if let Some(matches) = matches.subcommand_matches("history") { + if matches.is_present("json") { + i6::timer::print::print_history_json(); + } else { + i6::timer::print::print_history(); + } + } else if let (Some(minutes), Some(name)) = + (matches.value_of("minutes"), matches.value_of("name")) + { + i6::timer::create::create_timer(minutes, name); + } else if let Some(minutes) = matches.value_of("minutes") { + i6::timer::create::create_timer(minutes, ""); } + } - if let Some(matches) = matches.subcommand_matches(pack_id) { - let action = matches.value_of("action").unwrap(); - let target = matches.value_of("target").unwrap(); - let password = matches.value_of("password").unwrap(); - - i6_pack::cli::run(action, target, password)?; - } + if let Some(matches) = matches.subcommand_matches(pack_id) { + let action = matches.value_of("action").unwrap(); + let target = matches.value_of("target").unwrap(); + let password = matches.value_of("password").unwrap(); + i6_pack::cli::run(action, target, password)?; + } - Ok(()) -} \ No newline at end of file + Ok(()) +} From 20ce3d802c0647d15f510af2c47ebfd4bb6199ce Mon Sep 17 00:00:00 2001 From: kruserr <46799551+kruserr@users.noreply.github.com> Date: Tue, 8 Oct 2024 20:52:25 +0000 Subject: [PATCH 8/9] chore: bump version to 0.1.10 --- Cargo.lock | 4 ++-- i6-pack/Cargo.toml | 2 +- i6/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0784b1c..a23659a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -636,7 +636,7 @@ dependencies = [ [[package]] name = "i6" -version = "0.1.9" +version = "0.1.10" dependencies = [ "clap 3.2.25", "i6-pack", @@ -649,7 +649,7 @@ dependencies = [ [[package]] name = "i6-pack" -version = "0.1.9" +version = "0.1.10" dependencies = [ "aes-gcm", "argon2", diff --git a/i6-pack/Cargo.toml b/i6-pack/Cargo.toml index a366575..45f540e 100644 --- a/i6-pack/Cargo.toml +++ b/i6-pack/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "i6-pack" -version = "0.1.9" +version = "0.1.10" edition = "2021" publish = false diff --git a/i6/Cargo.toml b/i6/Cargo.toml index d13e203..17b9ecc 100644 --- a/i6/Cargo.toml +++ b/i6/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "i6" -version = "0.1.9" # prepare_release.sh +version = "0.1.10" # prepare_release.sh edition = "2021" default-run = "i6" license = "AGPL-3.0" From 18353cd9687a556c9b385c4482fe164c2bfa73aa Mon Sep 17 00:00:00 2001 From: kruserr <46799551+kruserr@users.noreply.github.com> Date: Tue, 8 Oct 2024 20:56:01 +0000 Subject: [PATCH 9/9] chore: update deps --- Cargo.lock | 919 +++++++++++++++++++++++++++++++++++++++++++++++++- i6/Cargo.toml | 3 + 2 files changed, 916 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a23659a..0078204 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,6 +17,15 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" +[[package]] +name = "adobe-cmap-parser" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae8abfa9a4688de8fc9f42b3f013b6fffec18ed8a554f5f113577e0b9b3212a3" +dependencies = [ + "pom", +] + [[package]] name = "aead" version = "0.5.2" @@ -52,6 +61,30 @@ dependencies = [ "subtle", ] +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + [[package]] name = "anstream" version = "0.6.15" @@ -101,6 +134,15 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "arbitrary" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +dependencies = [ + "derive_arbitrary", +] + [[package]] name = "argon2" version = "0.5.3" @@ -198,6 +240,12 @@ dependencies = [ "generic-array", ] +[[package]] +name = "bumpalo" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + [[package]] name = "byteorder" version = "1.5.0" @@ -227,6 +275,18 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "chrono" +version = "0.4.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "num-traits", + "windows-targets", +] + [[package]] name = "cipher" version = "0.4.4" @@ -288,12 +348,63 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" +[[package]] +name = "cli-epub-to-text" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "616c0806c96dd34a4d342c5cb19b135330b1959a3482c65ede9ad9ddc8233cdf" +dependencies = [ + "epub", + "html2text", +] + +[[package]] +name = "cli-justify" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc39d3272084201e4bc2ba63a4cda8736e182119a7ebc5d7751686230e13331" +dependencies = [ + "getopts", +] + +[[package]] +name = "cli-pdf-to-text" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eeb6b6d867620c21d49d125074e52fe535f39e9eacfdace1ddcab27bfdf8a01b" +dependencies = [ + "getopts", + "libc", + "lopdf", + "pdf-extract", + "redirect-stderr", + "winapi", +] + +[[package]] +name = "cli-text-reader" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06b13dc113efc05df807509e5fce0a7fbd0e79de16c221d17e34756ece39101b" +dependencies = [ + "atty", + "cli-justify", + "crossterm", + "getopts", +] + [[package]] name = "colorchoice" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + [[package]] name = "cpufeatures" version = "0.2.14" @@ -303,6 +414,65 @@ dependencies = [ "libc", ] +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" + +[[package]] +name = "crossterm" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c85525306c4291d1b73ce93c8acf9c339f9b213aef6c1d85c3830cbf1c16325c" +dependencies = [ + "bitflags 1.3.2", + "crossterm_winapi", + "libc", + "mio 0.7.14", + "parking_lot 0.11.2", + "signal-hook", + "signal-hook-mio", + "winapi", +] + +[[package]] +name = "crossterm_winapi" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b" +dependencies = [ + "winapi", +] + [[package]] name = "crypto-common" version = "0.1.6" @@ -329,6 +499,26 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "derive_arbitrary" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "digest" version = "0.10.7" @@ -340,6 +530,23 @@ dependencies = [ "subtle", ] +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "either" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" + [[package]] name = "encoding_rs" version = "0.8.34" @@ -349,6 +556,19 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "epub" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7425903972972788e21d4a8cbec3589c232cca4fab21d320187a8e452f6465e" +dependencies = [ + "percent-encoding", + "regex", + "thiserror", + "xml-rs", + "zip", +] + [[package]] name = "equivalent" version = "1.0.1" @@ -365,6 +585,15 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "euclid" +version = "0.20.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bb7ef65b3777a325d1eeefefab5b6d4959da54747e33bd6258e789640f307ad" +dependencies = [ + "num-traits", +] + [[package]] name = "filetime" version = "0.2.25" @@ -377,6 +606,16 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "flate2" +version = "1.0.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + [[package]] name = "fnv" version = "1.0.7" @@ -407,6 +646,16 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "futf" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df420e2e84819663797d1ec6544b13c5be84629e7bb00dc960d6917db2987843" +dependencies = [ + "mac", + "new_debug_unreachable", +] + [[package]] name = "futures-channel" version = "0.3.31" @@ -459,6 +708,15 @@ dependencies = [ "version_check", ] +[[package]] +name = "getopts" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14dbbfd5c71d70241ecf9e6f13737f7b5ce823821063188d7e46c41d371eebd5" +dependencies = [ + "unicode-width", +] + [[package]] name = "getrandom" version = "0.2.15" @@ -565,6 +823,33 @@ dependencies = [ "digest", ] +[[package]] +name = "html2text" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "042a9677c258ac2952dd026bb0cd21972f00f644a5a38f5a215cb22cdaf6834e" +dependencies = [ + "html5ever", + "markup5ever", + "tendril", + "thiserror", + "unicode-width", +] + +[[package]] +name = "html5ever" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c13771afe0e6e846f1e67d038d4cb29998a6779f93c809212e4e9c32efd244d4" +dependencies = [ + "log", + "mac", + "markup5ever", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "http" version = "0.2.12" @@ -642,6 +927,7 @@ dependencies = [ "i6-pack", "openssl", "rapiddb-web", + "rustic-reader", "tokio", "tracing-subscriber", "warp", @@ -661,6 +947,29 @@ dependencies = [ "zstd", ] +[[package]] +name = "iana-time-zone" +version = "0.1.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + [[package]] name = "idna" version = "0.5.0" @@ -700,6 +1009,15 @@ dependencies = [ "generic-array", ] +[[package]] +name = "instant" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" +dependencies = [ + "cfg-if", +] + [[package]] name = "is_terminal_polyfill" version = "1.70.1" @@ -721,6 +1039,15 @@ dependencies = [ "libc", ] +[[package]] +name = "js-sys" +version = "0.3.70" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +dependencies = [ + "wasm-bindgen", +] + [[package]] name = "lazy_static" version = "1.5.0" @@ -741,9 +1068,15 @@ checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ "bitflags 2.6.0", "libc", - "redox_syscall", + "redox_syscall 0.5.7", ] +[[package]] +name = "linked-hash-map" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" + [[package]] name = "linux-raw-sys" version = "0.4.14" @@ -766,6 +1099,51 @@ version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +[[package]] +name = "lopdf" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e775e4ee264e8a87d50a9efef7b67b4aa988cf94e75630859875fc347e6c872b" +dependencies = [ + "chrono", + "encoding_rs", + "flate2", + "itoa", + "linked-hash-map", + "log", + "md5", + "nom", + "rayon", + "time", + "weezl", +] + +[[package]] +name = "mac" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" + +[[package]] +name = "markup5ever" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16ce3abbeba692c8b8441d036ef91aea6df8da2c6b6e21c7e14d3c18e526be45" +dependencies = [ + "log", + "phf", + "phf_codegen", + "string_cache", + "string_cache_codegen", + "tendril", +] + +[[package]] +name = "md5" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" + [[package]] name = "memchr" version = "2.7.4" @@ -797,6 +1175,12 @@ dependencies = [ "unicase", ] +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniz_oxide" version = "0.8.0" @@ -806,6 +1190,19 @@ dependencies = [ "adler2", ] +[[package]] +name = "mio" +version = "0.7.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" +dependencies = [ + "libc", + "log", + "miow", + "ntapi", + "winapi", +] + [[package]] name = "mio" version = "1.0.2" @@ -818,6 +1215,15 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "miow" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" +dependencies = [ + "winapi", +] + [[package]] name = "multer" version = "2.1.0" @@ -836,6 +1242,31 @@ dependencies = [ "version_check", ] +[[package]] +name = "new_debug_unreachable" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "ntapi" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f" +dependencies = [ + "winapi", +] + [[package]] name = "nu-ansi-term" version = "0.46.0" @@ -846,6 +1277,42 @@ dependencies = [ "winapi", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_enum" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "object" version = "0.36.5" @@ -915,7 +1382,18 @@ checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" name = "overload" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "parking_lot" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api", + "parking_lot_core 0.8.6", +] [[package]] name = "parking_lot" @@ -924,7 +1402,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", - "parking_lot_core", + "parking_lot_core 0.9.10", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" +dependencies = [ + "cfg-if", + "instant", + "libc", + "redox_syscall 0.2.16", + "smallvec", + "winapi", ] [[package]] @@ -935,7 +1427,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.5.7", "smallvec", "windows-targets", ] @@ -951,12 +1443,84 @@ dependencies = [ "subtle", ] +[[package]] +name = "pdf-extract" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d50e5a753c6d21d93f2d7baafcff4c1dec3ac84a7bac466800004eaefdd1d6e" +dependencies = [ + "adobe-cmap-parser", + "encoding_rs", + "euclid", + "lopdf", + "postscript", + "type1-encoding-parser", + "unicode-normalization", +] + [[package]] name = "percent-encoding" version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +[[package]] +name = "phf" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +dependencies = [ + "phf_shared 0.11.2", +] + +[[package]] +name = "phf_codegen" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8d39688d359e6b34654d328e262234662d16cc0f60ec8dcbe5e718709342a5a" +dependencies = [ + "phf_generator 0.11.2", + "phf_shared 0.11.2", +] + +[[package]] +name = "phf_generator" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" +dependencies = [ + "phf_shared 0.10.0", + "rand", +] + +[[package]] +name = "phf_generator" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +dependencies = [ + "phf_shared 0.11.2", + "rand", +] + +[[package]] +name = "phf_shared" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" +dependencies = [ + "siphasher", +] + +[[package]] +name = "phf_shared" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +dependencies = [ + "siphasher", +] + [[package]] name = "pin-project" version = "1.1.6" @@ -1007,6 +1571,24 @@ dependencies = [ "universal-hash", ] +[[package]] +name = "pom" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60f6ce597ecdcc9a098e7fddacb1065093a3d66446fa16c675e7e71d1b5c28e6" + +[[package]] +name = "postscript" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78451badbdaebaf17f053fd9152b3ffb33b516104eacb45e7864aaa9c712f306" + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "ppv-lite86" version = "0.2.20" @@ -1016,6 +1598,21 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" + +[[package]] +name = "proc-macro-crate" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" +dependencies = [ + "toml_edit", +] + [[package]] name = "proc-macro2" version = "1.0.87" @@ -1090,6 +1687,45 @@ dependencies = [ "warp", ] +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "redirect-stderr" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f40b822483d70949bc7ca9b0bf140bfaea960ab88e61941b73c3cb34ccaf499" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "redox_syscall" version = "0.5.7" @@ -1099,6 +1735,35 @@ dependencies = [ "bitflags 2.6.0", ] +[[package]] +name = "regex" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + [[package]] name = "ring" version = "0.17.8" @@ -1120,6 +1785,20 @@ version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +[[package]] +name = "rustic-reader" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d368047641bab3a8653e3b1ee261446fbe95d9b4658ebab700faebfe30efd735" +dependencies = [ + "cli-epub-to-text", + "cli-justify", + "cli-pdf-to-text", + "cli-text-reader", + "getopts", + "redirect-stderr", +] + [[package]] name = "rustix" version = "0.38.37" @@ -1261,6 +1940,27 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +[[package]] +name = "signal-hook" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" +dependencies = [ + "libc", + "signal-hook-registry", +] + +[[package]] +name = "signal-hook-mio" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd" +dependencies = [ + "libc", + "mio 0.7.14", + "signal-hook", +] + [[package]] name = "signal-hook-registry" version = "1.4.2" @@ -1270,6 +1970,12 @@ dependencies = [ "libc", ] +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + [[package]] name = "slab" version = "0.4.9" @@ -1301,6 +2007,32 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +[[package]] +name = "string_cache" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" +dependencies = [ + "new_debug_unreachable", + "once_cell", + "parking_lot 0.12.3", + "phf_shared 0.10.0", + "precomputed-hash", + "serde", +] + +[[package]] +name = "string_cache_codegen" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bb30289b722be4ff74a408c3cc27edeaad656e06cb1fe8fa9231fa59c728988" +dependencies = [ + "phf_generator 0.10.0", + "phf_shared 0.10.0", + "proc-macro2", + "quote", +] + [[package]] name = "strsim" version = "0.10.0" @@ -1341,6 +2073,17 @@ dependencies = [ "xattr", ] +[[package]] +name = "tendril" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d24a120c5fc464a3458240ee02c299ebcb9d67b5249c8848b09d639dca8d7bb0" +dependencies = [ + "futf", + "mac", + "utf-8", +] + [[package]] name = "termcolor" version = "1.4.1" @@ -1386,6 +2129,37 @@ dependencies = [ "once_cell", ] +[[package]] +name = "time" +version = "0.3.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +dependencies = [ + "num-conv", + "time-core", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1410,8 +2184,8 @@ dependencies = [ "backtrace", "bytes", "libc", - "mio", - "parking_lot", + "mio 1.0.2", + "parking_lot 0.12.3", "pin-project-lite", "signal-hook-registry", "socket2", @@ -1466,6 +2240,23 @@ dependencies = [ "tokio", ] +[[package]] +name = "toml_datetime" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" + +[[package]] +name = "toml_edit" +version = "0.22.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" +dependencies = [ + "indexmap 2.6.0", + "toml_datetime", + "winnow", +] + [[package]] name = "tower-service" version = "0.3.3" @@ -1543,6 +2334,15 @@ dependencies = [ "utf-8", ] +[[package]] +name = "type1-encoding-parser" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3d6cc09e1a99c7e01f2afe4953789311a1c50baebbdac5b477ecf78e2e92a5b" +dependencies = [ + "pom", +] + [[package]] name = "typenum" version = "1.17.0" @@ -1579,6 +2379,12 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-width" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" + [[package]] name = "universal-hash" version = "0.5.1" @@ -1691,6 +2497,67 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasm-bindgen" +version = "0.2.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +dependencies = [ + "cfg-if", + "once_cell", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" + +[[package]] +name = "weezl" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" + [[package]] name = "winapi" version = "0.3.9" @@ -1722,6 +2589,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets", +] + [[package]] name = "windows-sys" version = "0.52.0" @@ -1804,6 +2680,15 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "winnow" +version = "0.6.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" +dependencies = [ + "memchr", +] + [[package]] name = "xattr" version = "1.3.1" @@ -1815,6 +2700,12 @@ dependencies = [ "rustix", ] +[[package]] +name = "xml-rs" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af4e2e2f7cba5a093896c1e150fbfe177d1883e7448200efb81d40b9d339ef26" + [[package]] name = "zerocopy" version = "0.7.35" @@ -1842,6 +2733,22 @@ version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +[[package]] +name = "zip" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cc23c04387f4da0374be4533ad1208cbb091d5c11d070dfef13676ad6497164" +dependencies = [ + "arbitrary", + "crc32fast", + "crossbeam-utils", + "displaydoc", + "flate2", + "indexmap 2.6.0", + "num_enum", + "thiserror", +] + [[package]] name = "zstd" version = "0.13.2" diff --git a/i6/Cargo.toml b/i6/Cargo.toml index 17b9ecc..5b02f62 100644 --- a/i6/Cargo.toml +++ b/i6/Cargo.toml @@ -29,3 +29,6 @@ i6-pack = { version = "0.1", path = "../i6-pack" } # for db command rapiddb-web = "0.1" + +# for reader command +rustic-reader = "0.1"