From 5717f33f68df38fbd3472f0667b8121393909ad8 Mon Sep 17 00:00:00 2001 From: Igor Katson Date: Tue, 27 Aug 2024 18:32:09 +0100 Subject: [PATCH] v7.0.0 prep further --- Cargo.lock | 60 +++++++++---------- crates/librqbit/Cargo.toml | 2 +- crates/rqbit/Cargo.toml | 2 +- crates/upnp-serve/Cargo.toml | 13 ++-- crates/upnp-serve/README.md | 1 + .../upnp-serve/examples/upnp-stub-server.rs | 6 +- 6 files changed, 45 insertions(+), 39 deletions(-) create mode 120000 crates/upnp-serve/README.md diff --git a/Cargo.lock b/Cargo.lock index 02f9ba9..79bdc82 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1522,6 +1522,7 @@ dependencies = [ "librqbit-sha1-wrapper", "librqbit-tracker-comms", "librqbit-upnp", + "librqbit-upnp-serve", "lru", "memmap2", "mime_guess", @@ -1545,7 +1546,6 @@ dependencies = [ "tower-http", "tracing", "tracing-subscriber", - "upnp-serve", "url", "urlencoding", "uuid", @@ -1691,6 +1691,34 @@ dependencies = [ "url", ] +[[package]] +name = "librqbit-upnp-serve" +version = "0.1.0" +dependencies = [ + "anyhow", + "axum 0.7.5", + "bstr", + "gethostname", + "http 1.1.0", + "httparse", + "librqbit-core", + "librqbit-sha1-wrapper", + "librqbit-upnp", + "mime_guess", + "parking_lot", + "quick-xml", + "reqwest", + "serde", + "socket2", + "tokio", + "tokio-util", + "tower-http", + "tracing", + "tracing-subscriber", + "url", + "uuid", +] + [[package]] name = "libsqlite3-sys" version = "0.28.0" @@ -2515,6 +2543,7 @@ dependencies = [ "futures", "libc", "librqbit", + "librqbit-upnp-serve", "openssl", "parking_lot", "parse_duration", @@ -2527,7 +2556,6 @@ dependencies = [ "tokio-util", "tracing", "tracing-subscriber", - "upnp-serve", ] [[package]] @@ -3583,34 +3611,6 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" -[[package]] -name = "upnp-serve" -version = "0.1.0" -dependencies = [ - "anyhow", - "axum 0.7.5", - "bstr", - "gethostname", - "http 1.1.0", - "httparse", - "librqbit-core", - "librqbit-sha1-wrapper", - "librqbit-upnp", - "mime_guess", - "parking_lot", - "quick-xml", - "reqwest", - "serde", - "socket2", - "tokio", - "tokio-util", - "tower-http", - "tracing", - "tracing-subscriber", - "url", - "uuid", -] - [[package]] name = "url" version = "2.5.2" diff --git a/crates/librqbit/Cargo.toml b/crates/librqbit/Cargo.toml index f4d7a44..bbc3b49 100644 --- a/crates/librqbit/Cargo.toml +++ b/crates/librqbit/Cargo.toml @@ -40,7 +40,7 @@ peer_binary_protocol = { path = "../peer_binary_protocol", default-features = fa sha1w = { path = "../sha1w", default-features = false, package = "librqbit-sha1-wrapper", version = "4" } dht = { path = "../dht", package = "librqbit-dht", version = "5.1.0" } librqbit-upnp = { path = "../upnp", version = "0.1.1" } -upnp-serve = { path = "../upnp-serve", default-features = false, version = "0.1.0", optional = true } +upnp-serve = { path = "../upnp-serve", package = "librqbit-upnp-serve", default-features = false, version = "0.1.0", optional = true } tokio = { version = "1", features = [ "macros", diff --git a/crates/rqbit/Cargo.toml b/crates/rqbit/Cargo.toml index bc0b094..a9b61cd 100644 --- a/crates/rqbit/Cargo.toml +++ b/crates/rqbit/Cargo.toml @@ -44,7 +44,7 @@ serde_json = "1" size_format = "1" bytes = "1.5.0" openssl = { version = "0.10", features = ["vendored"], optional = true } -upnp-serve = { path = "../upnp-serve" } +upnp-serve = { path = "../upnp-serve", version = "0.1.0", package = "librqbit-upnp-serve" } libc = "0.2.158" signal-hook = "0.3.17" tokio-util = "0.7.11" diff --git a/crates/upnp-serve/Cargo.toml b/crates/upnp-serve/Cargo.toml index 77ab1aa..5a2ec7e 100644 --- a/crates/upnp-serve/Cargo.toml +++ b/crates/upnp-serve/Cargo.toml @@ -1,7 +1,12 @@ [package] -name = "upnp-serve" +name = "librqbit-upnp-serve" version = "0.1.0" edition = "2021" +description = "Simple UPnP MediaServer implementation" +license = "Apache-2.0" +documentation = "https://docs.rs/librqbit-upnp-serve" +repository = "https://github.com/ikatson/rqbit" +readme = "README.md" [features] default = ["sha1-crypto-hash"] @@ -18,10 +23,10 @@ serde = { version = "1", features = ["derive"] } http = "1.1.0" httparse = "1.9.4" uuid = { version = "1.10.0", features = ["v4"] } -librqbit-upnp = { path = "../upnp", default-features = false } +librqbit-upnp = { version = "0.1", path = "../upnp", default-features = false } gethostname = "0.5.0" -librqbit-sha1-wrapper = { path = "../sha1w", default-features = false } -librqbit-core = { path = "../librqbit_core", default-features = false } +librqbit-sha1-wrapper = { path = "../sha1w", version = "4", default-features = false } +librqbit-core = { version = "4", path = "../librqbit_core", default-features = false } mime_guess = "2.0.5" url = "2.5.2" parking_lot = "0.12.3" diff --git a/crates/upnp-serve/README.md b/crates/upnp-serve/README.md new file mode 120000 index 0000000..32d46ee --- /dev/null +++ b/crates/upnp-serve/README.md @@ -0,0 +1 @@ +../README.md \ No newline at end of file diff --git a/crates/upnp-serve/examples/upnp-stub-server.rs b/crates/upnp-serve/examples/upnp-stub-server.rs index 0663d68..52ccd68 100644 --- a/crates/upnp-serve/examples/upnp-stub-server.rs +++ b/crates/upnp-serve/examples/upnp-stub-server.rs @@ -5,12 +5,12 @@ use std::{ use anyhow::Context; use axum::routing::get; -use mime_guess::Mime; -use tracing::{error, info}; -use upnp_serve::{ +use librqbit_upnp_serve::{ upnp_types::content_directory::response::{Item, ItemOrContainer}, UpnpServer, UpnpServerOptions, }; +use mime_guess::Mime; +use tracing::{error, info}; #[tokio::main] async fn main() -> anyhow::Result<()> {