diff --git a/Cargo.lock b/Cargo.lock index e2eefc02..f04de808 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -179,17 +179,6 @@ version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" -[[package]] -name = "bencode" -version = "0.1.0" -dependencies = [ - "anyhow", - "buffers", - "clone_to_owned", - "serde", - "sha1w", -] - [[package]] name = "bincode" version = "1.3.3" @@ -232,14 +221,6 @@ dependencies = [ "generic-array 0.14.7", ] -[[package]] -name = "buffers" -version = "0.1.0" -dependencies = [ - "clone_to_owned", - "serde", -] - [[package]] name = "bumpalo" version = "3.13.0" @@ -311,10 +292,6 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" -[[package]] -name = "clone_to_owned" -version = "0.1.0" - [[package]] name = "colorchoice" version = "1.0.0" @@ -386,28 +363,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "dht" -version = "0.1.0" -dependencies = [ - "anyhow", - "bencode", - "clone_to_owned", - "directories", - "futures", - "hex 0.4.3", - "indexmap", - "librqbit_core", - "log", - "parking_lot", - "pretty_env_logger", - "rand", - "serde", - "serde_json", - "tokio", - "tokio-stream", -] - [[package]] name = "digest" version = "0.10.7" @@ -904,26 +859,27 @@ checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "librqbit" -version = "0.1.0" +version = "2.2.1" dependencies = [ "anyhow", "axum", - "bencode", "bincode", "bitvec", - "buffers", "byteorder", - "clone_to_owned", "crypto-hash", - "dht", "futures", "hex 0.4.3", "http", - "librqbit_core", + "librqbit-bencode", + "librqbit-buffers", + "librqbit-clone-to-owned", + "librqbit-core", + "librqbit-dht", + "librqbit-peer-protocol", + "librqbit-sha1-wrapper", "log", "openssl", "parking_lot", - "peer_binary_protocol", "pretty_env_logger", "rand", "regex", @@ -932,7 +888,6 @@ dependencies = [ "serde_json", "serde_urlencoded", "sha1", - "sha1w", "size_format", "tokio", "tokio-stream", @@ -942,15 +897,38 @@ dependencies = [ ] [[package]] -name = "librqbit_core" -version = "0.1.0" +name = "librqbit-bencode" +version = "2.2.1" +dependencies = [ + "anyhow", + "librqbit-buffers", + "librqbit-clone-to-owned", + "librqbit-sha1-wrapper", + "serde", +] + +[[package]] +name = "librqbit-buffers" +version = "2.2.1" +dependencies = [ + "librqbit-clone-to-owned", + "serde", +] + +[[package]] +name = "librqbit-clone-to-owned" +version = "2.2.1" + +[[package]] +name = "librqbit-core" +version = "2.2.1" dependencies = [ "anyhow", - "bencode", - "buffers", - "clone_to_owned", "hex 0.4.3", "itertools", + "librqbit-bencode", + "librqbit-buffers", + "librqbit-clone-to-owned", "log", "parking_lot", "serde", @@ -958,6 +936,52 @@ dependencies = [ "uuid", ] +[[package]] +name = "librqbit-dht" +version = "2.2.1" +dependencies = [ + "anyhow", + "directories", + "futures", + "hex 0.4.3", + "indexmap", + "librqbit-bencode", + "librqbit-clone-to-owned", + "librqbit-core", + "log", + "parking_lot", + "pretty_env_logger", + "rand", + "serde", + "serde_json", + "tokio", + "tokio-stream", +] + +[[package]] +name = "librqbit-peer-protocol" +version = "2.2.1" +dependencies = [ + "anyhow", + "bincode", + "bitvec", + "byteorder", + "librqbit-bencode", + "librqbit-buffers", + "librqbit-clone-to-owned", + "librqbit-core", + "serde", +] + +[[package]] +name = "librqbit-sha1-wrapper" +version = "2.2.1" +dependencies = [ + "crypto-hash", + "openssl", + "sha1", +] + [[package]] name = "linux-raw-sys" version = "0.3.8" @@ -1222,21 +1246,6 @@ dependencies = [ "regex", ] -[[package]] -name = "peer_binary_protocol" -version = "0.1.0" -dependencies = [ - "anyhow", - "bencode", - "bincode", - "bitvec", - "buffers", - "byteorder", - "clone_to_owned", - "librqbit_core", - "serde", -] - [[package]] name = "percent-encoding" version = "2.3.0" @@ -1478,9 +1487,9 @@ version = "2.0.0" dependencies = [ "anyhow", "clap", - "dht", "futures", "librqbit", + "librqbit-dht", "log", "parse_duration", "pretty_env_logger", @@ -1680,15 +1689,6 @@ dependencies = [ "digest", ] -[[package]] -name = "sha1w" -version = "0.1.0" -dependencies = [ - "crypto-hash", - "openssl", - "sha1", -] - [[package]] name = "size_format" version = "1.0.2" diff --git a/crates/README.md b/crates/README.md new file mode 100644 index 00000000..92c79353 --- /dev/null +++ b/crates/README.md @@ -0,0 +1,2 @@ +This package is a dependency of [rqbit](https://github.com/ikatson/rqbit) torrent client. +It can be used by itself too. See more [at the rqbit Github page](https://github.com/ikatson/rqbit). \ No newline at end of file diff --git a/crates/bencode/Cargo.toml b/crates/bencode/Cargo.toml index 67ce6063..dc3bd3f2 100644 --- a/crates/bencode/Cargo.toml +++ b/crates/bencode/Cargo.toml @@ -1,7 +1,12 @@ [package] -name = "bencode" -version = "0.1.0" +name = "librqbit-bencode" +version = "2.2.1" edition = "2018" +description = "Bencode serialization and deserialization using Serde" +license = "Apache-2.0" +documentation = "https://docs.rs/librqbit-bencode" +repository = "https://github.com/ikatson/rqbit" +readme = "README.md" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -13,7 +18,7 @@ sha1-rust = ["sha1w/sha1-rust"] [dependencies] serde = {version = "1", features=["derive"]} -buffers = {path = "../buffers"} -clone_to_owned = {path = "../clone_to_owned"} +buffers = {path = "../buffers", package="librqbit-buffers", version = "2.2.1"} +clone_to_owned = {path = "../clone_to_owned", package="librqbit-clone-to-owned", version = "2.2.1"} anyhow = "1" -sha1w = {path="../sha1w", default-features=false} \ No newline at end of file +sha1w = {path="../sha1w", default-features=false, package="librqbit-sha1-wrapper", version="2.2.1"} \ No newline at end of file diff --git a/crates/bencode/README.md b/crates/bencode/README.md new file mode 120000 index 00000000..32d46ee8 --- /dev/null +++ b/crates/bencode/README.md @@ -0,0 +1 @@ +../README.md \ No newline at end of file diff --git a/crates/buffers/Cargo.toml b/crates/buffers/Cargo.toml index d4f332b6..3f68b167 100644 --- a/crates/buffers/Cargo.toml +++ b/crates/buffers/Cargo.toml @@ -1,10 +1,14 @@ [package] -name = "buffers" -version = "0.1.0" +name = "librqbit-buffers" +version = "2.2.1" edition = "2018" +description = "Utils to work with &[u8] and Vec in librqbit source code." +license = "Apache-2.0" +documentation = "https://docs.rs/librqbit-buffers" +readme = "README.md" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] serde = {version = "1", features=["derive"]} -clone_to_owned = {path="../clone_to_owned"} \ No newline at end of file +clone_to_owned = {path="../clone_to_owned", package="librqbit-clone-to-owned", version = "2.2.1"} \ No newline at end of file diff --git a/crates/buffers/README.md b/crates/buffers/README.md new file mode 120000 index 00000000..32d46ee8 --- /dev/null +++ b/crates/buffers/README.md @@ -0,0 +1 @@ +../README.md \ No newline at end of file diff --git a/crates/clone_to_owned/Cargo.toml b/crates/clone_to_owned/Cargo.toml index 911fc8bb..ff44da2c 100644 --- a/crates/clone_to_owned/Cargo.toml +++ b/crates/clone_to_owned/Cargo.toml @@ -1,7 +1,9 @@ [package] -name = "clone_to_owned" -version = "0.1.0" +name = "librqbit-clone-to-owned" +version = "2.2.1" edition = "2018" +description = "Util traits to represent something that can be made owned and change type at the same time." +license = "Apache-2.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/crates/clone_to_owned/README.md b/crates/clone_to_owned/README.md new file mode 120000 index 00000000..32d46ee8 --- /dev/null +++ b/crates/clone_to_owned/README.md @@ -0,0 +1 @@ +../README.md \ No newline at end of file diff --git a/crates/dht/Cargo.toml b/crates/dht/Cargo.toml index a2802e4a..55643512 100644 --- a/crates/dht/Cargo.toml +++ b/crates/dht/Cargo.toml @@ -1,17 +1,28 @@ [package] -name = "dht" -version = "0.1.0" +name = "librqbit-dht" +version = "2.2.1" edition = "2018" +description = "DHT implementation, used in rqbit torrent client." +license = "Apache-2.0" +documentation = "https://docs.rs/librqbit-dht" +repository = "https://github.com/ikatson/rqbit" +readme = "README.md" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[features] +default = ["sha1-system"] +sha1-system = ["bencode/sha1-system", "librqbit-core/sha1-system"] +sha1-openssl = ["bencode/sha1-openssl", "librqbit-core/sha1-openssl"] +sha1-rust = ["bencode/sha1-rust", "librqbit-core/sha1-rust"] + [dependencies] tokio = {version = "1", features = ["macros", "rt-multi-thread", "net", "sync"]} tokio-stream = {version = "0.1", features = ["sync"]} serde = {version = "1", features = ["derive"]} serde_json = "1" hex = "0.4" -bencode = {path = "../bencode", default-features=false} +bencode = {path = "../bencode", default-features=false, package="librqbit-bencode", version="2.2.1"} anyhow = "1" parking_lot = "0.12" log = "0.4" @@ -21,7 +32,7 @@ rand = "0.8" indexmap = "1.7" directories = "4" -clone_to_owned = {path="../clone_to_owned"} -librqbit_core = {path="../librqbit_core"} +clone_to_owned = {path="../clone_to_owned", package="librqbit-clone-to-owned", version = "2.2.1"} +librqbit-core = {path="../librqbit_core", version = "2.2.1"} [dev-dependencies] diff --git a/crates/dht/README.md b/crates/dht/README.md new file mode 120000 index 00000000..32d46ee8 --- /dev/null +++ b/crates/dht/README.md @@ -0,0 +1 @@ +../README.md \ No newline at end of file diff --git a/crates/dht/src/main.rs b/crates/dht/src/main.rs index 762829a5..fc6f5246 100644 --- a/crates/dht/src/main.rs +++ b/crates/dht/src/main.rs @@ -1,7 +1,7 @@ use std::{str::FromStr, time::Duration}; use anyhow::Context; -use dht::{Dht, Id20}; +use librqbit_dht::{Dht, Id20}; use log::info; use tokio_stream::StreamExt; diff --git a/crates/librqbit/Cargo.toml b/crates/librqbit/Cargo.toml index ed0d9db4..e28e1443 100644 --- a/crates/librqbit/Cargo.toml +++ b/crates/librqbit/Cargo.toml @@ -1,8 +1,15 @@ [package] name = "librqbit" -version = "0.1.0" +version = "2.2.1" authors = ["Igor Katson "] edition = "2018" +description = "The main library used by rqbit torrent client. The binary is just a small wrapper on top of it." +license = "Apache-2.0" +documentation = "https://docs.rs/librqbit-dht" +repository = "https://github.com/ikatson/rqbit" +readme = "README.md" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [features] default = ["sha1-system", "default-tls"] @@ -12,23 +19,21 @@ sha1-rust = ["sha1w/sha1-rust"] default-tls = ["reqwest/default-tls"] rust-tls = ["reqwest/rustls-tls"] -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [dependencies] -bencode = {path = "../bencode", default-features=false} -buffers = {path = "../buffers"} -librqbit_core = {path = "../librqbit_core"} -clone_to_owned = {path = "../clone_to_owned"} -peer_binary_protocol = {path = "../peer_binary_protocol"} -sha1w = {path = "../sha1w", default-features=false} -dht = {path = "../dht"} +bencode = {path = "../bencode", default-features=false, package="librqbit-bencode", version="2.2.1"} +buffers = {path = "../buffers", package="librqbit-buffers", version = "2.2.1"} +librqbit-core = {path = "../librqbit_core", version = "2.2.1"} +clone_to_owned = {path = "../clone_to_owned", package="librqbit-clone-to-owned", version = "2.2.1"} +peer_binary_protocol = {path = "../peer_binary_protocol", package="librqbit-peer-protocol", version = "2.2.1"} +sha1w = {path = "../sha1w", default-features=false, package="librqbit-sha1-wrapper", version="2.2.1"} +dht = {path = "../dht", package="librqbit-dht", version="2.2.1"} tokio = {version = "1", features = ["macros", "rt-multi-thread"]} axum = {version = "0.6"} tokio-stream = "0.1" serde = {version = "1", features=["derive"]} serde_json = "1" -serde_urlencoded = "*" +serde_urlencoded = "0.7" anyhow = "1" http = "0.2" diff --git a/crates/librqbit/README.md b/crates/librqbit/README.md new file mode 120000 index 00000000..32d46ee8 --- /dev/null +++ b/crates/librqbit/README.md @@ -0,0 +1 @@ +../README.md \ No newline at end of file diff --git a/crates/librqbit_core/Cargo.toml b/crates/librqbit_core/Cargo.toml index 5ff5ee84..e987fae5 100644 --- a/crates/librqbit_core/Cargo.toml +++ b/crates/librqbit_core/Cargo.toml @@ -1,10 +1,21 @@ [package] -name = "librqbit_core" -version = "0.1.0" +name = "librqbit-core" +version = "2.2.1" edition = "2018" +description = "Important utilities used throughout librqbit useful for working with torrents." +license = "Apache-2.0" +documentation = "https://docs.rs/librqbit-core" +repository = "https://github.com/ikatson/rqbit" +readme = "README.md" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[features] +default = ["sha1-system"] +sha1-system = ["bencode/sha1-system"] +sha1-openssl = ["bencode/sha1-openssl"] +sha1-rust = ["bencode/sha1-rust"] + [dependencies] hex = "0.4" anyhow = "1" @@ -13,7 +24,7 @@ uuid = {version = "1", features = ["v4"]} log = "0.4" parking_lot = "0.12" serde = {version = "1", features=["derive"]} -buffers = {path="../buffers"} -bencode = {path = "../bencode", default-features=false} -clone_to_owned = {path="../clone_to_owned"} +buffers = {path="../buffers", package="librqbit-buffers", version = "2.2.1"} +bencode = {path = "../bencode", default-features=false, package="librqbit-bencode", version="2.2.1"} +clone_to_owned = {path="../clone_to_owned", package="librqbit-clone-to-owned", version = "2.2.1"} itertools = "0.11.0" diff --git a/crates/librqbit_core/README.md b/crates/librqbit_core/README.md new file mode 120000 index 00000000..32d46ee8 --- /dev/null +++ b/crates/librqbit_core/README.md @@ -0,0 +1 @@ +../README.md \ No newline at end of file diff --git a/crates/peer_binary_protocol/Cargo.toml b/crates/peer_binary_protocol/Cargo.toml index 472d59fa..b875c43e 100644 --- a/crates/peer_binary_protocol/Cargo.toml +++ b/crates/peer_binary_protocol/Cargo.toml @@ -1,17 +1,28 @@ [package] -name = "peer_binary_protocol" -version = "0.1.0" +name = "librqbit-peer-protocol" +version = "2.2.1" edition = "2018" +description = "Protocol for working with torrent peers. Used in rqbit torrent client." +license = "Apache-2.0" +documentation = "https://docs.rs/librqbit-peer-protocol" +repository = "https://github.com/ikatson/rqbit" +readme = "README.md" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[features] +default = ["sha1-system"] +sha1-system = ["bencode/sha1-system", "librqbit-core/sha1-system"] +sha1-openssl = ["bencode/sha1-openssl", "librqbit-core/sha1-openssl"] +sha1-rust = ["bencode/sha1-rust", "librqbit-core/sha1-rust"] + [dependencies] serde = {version = "1", features = ["derive"]} bincode = "1" byteorder = "1" -buffers = {path="../buffers"} -bencode = {path = "../bencode", default-features=false} -clone_to_owned = {path="../clone_to_owned"} -librqbit_core = {path="../librqbit_core"} +buffers = {path="../buffers", package="librqbit-buffers", version = "2.2.1"} +bencode = {path = "../bencode", default-features=false, package="librqbit-bencode", version="2.2.1"} +clone_to_owned = {path="../clone_to_owned", package="librqbit-clone-to-owned", version = "2.2.1"} +librqbit-core = {path="../librqbit_core", version = "2.2.1"} bitvec = "1" anyhow = "1" \ No newline at end of file diff --git a/crates/peer_binary_protocol/README.md b/crates/peer_binary_protocol/README.md new file mode 120000 index 00000000..32d46ee8 --- /dev/null +++ b/crates/peer_binary_protocol/README.md @@ -0,0 +1 @@ +../README.md \ No newline at end of file diff --git a/crates/rqbit/Cargo.toml b/crates/rqbit/Cargo.toml index 1e4ed3d3..1fbf8ebf 100644 --- a/crates/rqbit/Cargo.toml +++ b/crates/rqbit/Cargo.toml @@ -14,8 +14,8 @@ default-tls = ["librqbit/default-tls"] rust-tls = ["librqbit/rust-tls"] [dependencies] -librqbit = {path="../librqbit", default-features=false} -dht = {path="../dht"} +librqbit = {path="../librqbit", default-features=false, version = "2.2.1"} +dht = {path="../dht", package="librqbit-dht", version="2.2.1"} tokio = {version = "1", features = ["macros", "rt-multi-thread"]} anyhow = "1" clap = {version = "4", features = ["derive", "deprecated"]} diff --git a/crates/rqbit/LICENSE b/crates/rqbit/LICENSE new file mode 120000 index 00000000..30cff740 --- /dev/null +++ b/crates/rqbit/LICENSE @@ -0,0 +1 @@ +../../LICENSE \ No newline at end of file diff --git a/crates/rqbit/README.md b/crates/rqbit/README.md new file mode 120000 index 00000000..fe840054 --- /dev/null +++ b/crates/rqbit/README.md @@ -0,0 +1 @@ +../../README.md \ No newline at end of file diff --git a/crates/sha1w/Cargo.toml b/crates/sha1w/Cargo.toml index 5c01fdad..eeed7062 100644 --- a/crates/sha1w/Cargo.toml +++ b/crates/sha1w/Cargo.toml @@ -1,7 +1,12 @@ [package] -name = "sha1w" -version = "0.1.0" +name = "librqbit-sha1-wrapper" +version = "2.2.1" edition = "2018" +description = "Common interface around various sha1 implementations used in rqbit torrent client." +license = "Apache-2.0" +documentation = "https://docs.rs/librqbit-sha1-wrapper" +repository = "https://github.com/ikatson/rqbit" +readme = "README.md" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/crates/sha1w/README.md b/crates/sha1w/README.md new file mode 120000 index 00000000..32d46ee8 --- /dev/null +++ b/crates/sha1w/README.md @@ -0,0 +1 @@ +../README.md \ No newline at end of file