Skip to content

Commit 5ce46ed

Browse files
committed
Merge #1070: Extract new package bittorrent-tracker-client
e01995c fix: tracker checker execution in CI (Jose Celano) a5822cd fix: cargo machete errors (Jose Celano) 31ac6cf refactor: use extracted bittorrent-tracker-client (Jose Celano) 093e8c9 feat: extract new package bittorrent-tracker-client (Jose Celano) Pull request description: This will allow other projects to reuse the tracker lib and console clients. ### Subtasks - [x] Extract the new package. - [x] Use the new package in the main app. ACKs for top commit: josecelano: ACK e01995c Tree-SHA512: eca269f9192d154a5f84c87b281017bf2312ccfcafcab12dbf7c3657d734faf946029ae2b997035bfb56f74c3086bd84d40251831585321fab2a3fc2a9a84a97
2 parents 25d9487 + e01995c commit 5ce46ed

File tree

49 files changed

+368
-96
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+368
-96
lines changed

Cargo.lock

Lines changed: 31 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ axum-client-ip = "0"
3737
axum-extra = { version = "0", features = ["query"] }
3838
axum-server = { version = "0", features = ["tls-rustls"] }
3939
bittorrent-primitives = "0.1.0"
40+
bittorrent-tracker-client = { version = "3.0.0-develop", path = "packages/tracker-client" }
4041
camino = { version = "1", features = ["serde", "serde1"] }
4142
chrono = { version = "0", default-features = false, features = ["clock"] }
4243
clap = { version = "4", features = ["derive", "env"] }
@@ -46,7 +47,6 @@ derive_more = { version = "1", features = ["as_ref", "constructor", "from"] }
4647
figment = "0"
4748
futures = "0"
4849
futures-util = "0"
49-
hex-literal = "0"
5050
http-body = "1"
5151
hyper = "1"
5252
hyper-util = { version = "0", features = ["http1", "http2", "tokio"] }
@@ -100,6 +100,7 @@ members = [
100100
"packages/primitives",
101101
"packages/test-helpers",
102102
"packages/torrent-repository",
103+
"packages/tracker-client",
103104
]
104105

105106
[profile.dev]

packages/tracker-client/Cargo.toml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
[package]
2+
description = "A library with the primitive types shared by the Torrust tracker packages."
3+
keywords = ["bittorrent", "client", "tracker"]
4+
license = "LGPL-3.0"
5+
name = "bittorrent-tracker-client"
6+
readme = "README.md"
7+
8+
authors.workspace = true
9+
documentation.workspace = true
10+
edition.workspace = true
11+
homepage.workspace = true
12+
publish.workspace = true
13+
repository.workspace = true
14+
rust-version.workspace = true
15+
version.workspace = true
16+
17+
[dependencies]
18+
anyhow = "1"
19+
aquatic_udp_protocol = "0"
20+
bittorrent-primitives = "0.1.0"
21+
clap = { version = "4", features = ["derive", "env"] }
22+
derive_more = { version = "1", features = ["as_ref", "constructor", "from"] }
23+
futures = "0"
24+
hex-literal = "0"
25+
hyper = "1"
26+
percent-encoding = "2"
27+
reqwest = { version = "0", features = ["json"] }
28+
serde = { version = "1", features = ["derive"] }
29+
serde_bencode = "0"
30+
serde_bytes = "0"
31+
serde_json = { version = "1", features = ["preserve_order"] }
32+
serde_repr = "0"
33+
thiserror = "1"
34+
tokio = { version = "1", features = ["macros", "net", "rt-multi-thread", "signal", "sync"] }
35+
torrust-tracker-configuration = { version = "3.0.0-develop", path = "../configuration" }
36+
torrust-tracker-located-error = { version = "3.0.0-develop", path = "../located-error" }
37+
torrust-tracker-primitives = { version = "3.0.0-develop", path = "../primitives" }
38+
tracing = "0"
39+
tracing-subscriber = { version = "0", features = ["json"] }
40+
url = { version = "2", features = ["serde"] }
41+
zerocopy = "0.7"
42+
43+
[package.metadata.cargo-machete]
44+
ignored = ["serde_bytes"]

packages/tracker-client/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# BitTorrent Tracker Client
2+
3+
A library an console applications to interact with a BitTorrent tracker.
4+
5+
> **Disclaimer**: This project is actively under development. We’re currently extracting and refining common types from the ][Torrust Tracker](https://github.com/torrust/torrust-tracker) to make them available to the BitTorrent community in Rust. While these types are functional, they are not yet ready for use in production or third-party projects.
6+
7+
## License
8+
9+
**Copyright (c) 2024 The Torrust Developers.**
10+
11+
This program is free software: you can redistribute it and/or modify it under the terms of the [GNU Lesser General Public License][LGPL_3_0] as published by the [Free Software Foundation][FSF], version 3.
12+
13+
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the [GNU Lesser General Public License][LGPL_3_0] for more details.
14+
15+
You should have received a copy of the *GNU Lesser General Public License* along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
17+
Some files include explicit copyright notices and/or license notices.
18+
19+
### Legacy Exception
20+
21+
For prosperity, versions of Torrust BitTorrent Tracker Client that are older than five years are automatically granted the [MIT-0][MIT_0] license in addition to the existing [LGPL-3.0-only][LGPL_3_0] license.
22+
23+
[LGPL_3_0]: ./LICENSE
24+
[MIT_0]: ./docs/licenses/LICENSE-MIT_0
25+
[FSF]: https://www.fsf.org/
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
MIT No Attribution
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this
4+
software and associated documentation files (the "Software"), to deal in the Software
5+
without restriction, including without limitation the rights to use, copy, modify,
6+
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
7+
permit persons to whom the Software is furnished to do so.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
10+
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
11+
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
12+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
13+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
14+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

src/bin/http_tracker_client.rs renamed to packages/tracker-client/src/bin/http_tracker_client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//! Program to make request to HTTP trackers.
2-
use torrust_tracker::console::clients::http::app;
2+
use bittorrent_tracker_client::console::clients::http::app;
33

44
#[tokio::main]
55
async fn main() -> anyhow::Result<()> {

src/bin/tracker_checker.rs renamed to packages/tracker-client/src/bin/tracker_checker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//! Program to check running trackers.
2-
use torrust_tracker::console::clients::checker::app;
2+
use bittorrent_tracker_client::console::clients::checker::app;
33

44
#[tokio::main]
55
async fn main() {

src/bin/udp_tracker_client.rs renamed to packages/tracker-client/src/bin/udp_tracker_client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//! Program to make request to UDP trackers.
2-
use torrust_tracker::console::clients::udp::app;
2+
use bittorrent_tracker_client::console::clients::udp::app;
33

44
#[tokio::main]
55
async fn main() -> anyhow::Result<()> {

src/console/clients/checker/app.rs renamed to packages/tracker-client/src/console/clients/checker/app.rs

File renamed without changes.

src/console/clients/checker/checks/health.rs renamed to packages/tracker-client/src/console/clients/checker/checks/health.rs

File renamed without changes.

0 commit comments

Comments
 (0)