Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
290 changes: 141 additions & 149 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions cSpell.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"Hydranode",
"hyperthread",
"Icelake",
"iiiiiiiiiiiiiiiiiiiid",
"imdl",
"impls",
"incompletei",
Expand Down
6 changes: 3 additions & 3 deletions packages/clock/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
//! ```
//!
//! > **NOTICE**: internally the `Duration` is stores it's main unit as seconds in a `u64` and it will
//! overflow in 584.9 billion years.
//! > overflow in 584.9 billion years.
//!
//! > **NOTICE**: the timestamp does not depend on the time zone. That gives you
//! the ability to use the clock regardless of the underlying system time zone
//! configuration. See [Unix time Wikipedia entry](https://en.wikipedia.org/wiki/Unix_time).
//! > the ability to use the clock regardless of the underlying system time zone
//! > configuration. See [Unix time Wikipedia entry](https://en.wikipedia.org/wiki/Unix_time).

pub mod clock;
pub mod conv;
Expand Down
6 changes: 3 additions & 3 deletions packages/test-helpers/src/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ use crate::random;
/// > **NOTICE**: This configuration is not meant to be used in production.
///
/// > **NOTICE**: Port 0 is used for ephemeral ports, which means that the OS
/// will assign a random free port for the tracker to use.
/// > will assign a random free port for the tracker to use.
///
/// > **NOTICE**: You can change the log level to `debug` to see the logs of the
/// tracker while running the tests. That can be particularly useful when
/// debugging tests.
/// > tracker while running the tests. That can be particularly useful when
/// > debugging tests.
///
/// # Panics
///
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/jobs/http_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! The function [`http_tracker::start_job`](crate::bootstrap::jobs::http_tracker::start_job) starts a new HTTP tracker server.
//!
//! > **NOTICE**: the application can launch more than one HTTP tracker on different ports.
//! Refer to the [configuration documentation](https://docs.rs/torrust-tracker-configuration) for the configuration options.
//! > Refer to the [configuration documentation](https://docs.rs/torrust-tracker-configuration) for the configuration options.
//!
//! The [`http_tracker::start_job`](crate::bootstrap::jobs::http_tracker::start_job) function spawns a new asynchronous task,
//! that tasks is the "**launcher**". The "**launcher**" starts the actual server and sends a message back to the main application.
Expand Down
8 changes: 4 additions & 4 deletions src/bootstrap/jobs/tracker_apis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
//! function starts a the HTTP tracker REST API.
//!
//! > **NOTICE**: that even thought there is only one job the API has different
//! versions. API consumers can choose which version to use. The API version is
//! part of the URL, for example: `http://localhost:1212/api/v1/stats`.
//! > versions. API consumers can choose which version to use. The API version is
//! > part of the URL, for example: `http://localhost:1212/api/v1/stats`.
//!
//! The [`tracker_apis::start_job`](crate::bootstrap::jobs::tracker_apis::start_job)
//! function spawns a new asynchronous task, that tasks is the "**launcher**".
Expand Down Expand Up @@ -38,8 +38,8 @@ use crate::servers::registar::ServiceRegistrationForm;
/// application process to notify the API server was successfully started.
///
/// > **NOTICE**: it does not mean the API server is ready to receive requests.
/// It only means the new server started. It might take some time to the server
/// to be ready to accept request.
/// > It only means the new server started. It might take some time to the server
/// > to be ready to accept request.
#[derive(Debug)]
pub struct ApiServerJobStarted();

Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap/jobs/udp_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
//! function starts a new UDP tracker server.
//!
//! > **NOTICE**: that the application can launch more than one UDP tracker
//! on different ports. Refer to the [configuration documentation](https://docs.rs/torrust-tracker-configuration)
//! for the configuration options.
//! > on different ports. Refer to the [configuration documentation](https://docs.rs/torrust-tracker-configuration)
//! > for the configuration options.
use std::sync::Arc;

use log::debug;
Expand Down
2 changes: 1 addition & 1 deletion src/console/clients/udp/checker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ impl Client {
///
/// - It can't connect to the remote UDP socket.
/// - It can't make a connection request successfully to the remote UDP
/// server (after successfully connecting to the remote UDP socket).
/// server (after successfully connecting to the remote UDP socket).
///
/// # Panics
///
Expand Down
8 changes: 4 additions & 4 deletions src/console/profiling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
//! ```
//!
//! > NOTICE: valgrind executes the program you wan to profile and waits until
//! it ends. Since the tracker is a service and does not end the profiling
//! binary accepts an arguments with the duration you want to run the tracker,
//! so that it terminates automatically after that period of time.
//! > it ends. Since the tracker is a service and does not end the profiling
//! > binary accepts an arguments with the duration you want to run the tracker,
//! > so that it terminates automatically after that period of time.
//!
//! # Run profiling
//!
Expand Down Expand Up @@ -81,7 +81,7 @@
//! ```
//!
//! > NOTICE: We are using an specific tracker configuration for profiling that
//! removes all features except the UDP tracker and sets the logging level to `error`.
//! > removes all features except the UDP tracker and sets the logging level to `error`.
//!
//! Build the aquatic UDP load test command:
//!
Expand Down
4 changes: 2 additions & 2 deletions src/core/databases/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//! - [`Sqlite`](crate::core::databases::sqlite::Sqlite)
//!
//! > **NOTICE**: There are no database migrations. If there are any changes,
//! we will implemented them or provide a script to migrate to the new schema.
//! > we will implemented them or provide a script to migrate to the new schema.
//!
//! The persistent objects are:
//!
Expand All @@ -25,7 +25,7 @@
//! `completed` | 20 | The number of peers that have ever completed downloading the torrent associated to this entry. See [`Entry`](torrust_tracker_torrent_repository::entry::Entry) for more information.
//!
//! > **NOTICE**: The peer list for a torrent is not persisted. Since peer have to re-announce themselves on intervals, the data is be
//! regenerated again after some minutes.
//! > regenerated again after some minutes.
//!
//! # Torrent whitelist
//!
Expand Down
8 changes: 4 additions & 4 deletions src/core/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@
//! The torrent entry has two attributes:
//!
//! - `completed`: which is hte number of peers that have completed downloading the torrent file/s. As they have completed downloading,
//! they have a full version of the torrent data, and they can provide the full data to other peers. That's why they are also known as "seeders".
//! they have a full version of the torrent data, and they can provide the full data to other peers. That's why they are also known as "seeders".
//! - `peers`: an indexed and orderer list of peer for the torrent. Each peer contains the data received from the peer in the `announce` request.
//!
//! The [`torrent`] module not only contains the original data obtained from peer via `announce` requests, it also contains
Expand Down Expand Up @@ -401,7 +401,7 @@
//! - `scrapes_handled`: number of `scrape` handled requests by the tracker
//!
//! > **NOTICE**: as the HTTP tracker does not have an specific `connection` request like the UDP tracker, `connections_handled` are
//! increased on every `announce` and `scrape` requests.
//! > increased on every `announce` and `scrape` requests.
//!
//! The tracker exposes an event sender API that allows the tracker users to send events. When a higher application service handles a
//! `connection` , `announce` or `scrape` requests, it notifies the `Tracker` by sending statistics events.
Expand Down Expand Up @@ -467,8 +467,8 @@ use crate::CurrentClock;
/// authentication and other services.
///
/// > **NOTICE**: the `Tracker` is not responsible for handling the network layer.
/// Typically, the `Tracker` is used by a higher application service that handles
/// the network layer.
/// > Typically, the `Tracker` is used by a higher application service that handles
/// > the network layer.
pub struct Tracker {
announce_policy: AnnouncePolicy,
/// A database driver implementation: [`Sqlite3`](crate::core::databases::sqlite)
Expand Down
6 changes: 3 additions & 3 deletions src/core/torrent/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
//!
//! - The number of peers that have completed downloading the torrent since the tracker started collecting metrics.
//! - The number of peers that have completed downloading the torrent and are still active, that means they are actively participating in the network,
//! by announcing themselves periodically to the tracker. Since they have completed downloading they have a full copy of the torrent data. Peers with a
//! full copy of the data are called "seeders".
//! by announcing themselves periodically to the tracker. Since they have completed downloading they have a full copy of the torrent data. Peers with a
//! full copy of the data are called "seeders".
//! - The number of peers that have NOT completed downloading the torrent and are still active, that means they are actively participating in the network.
//! Peer that don not have a full copy of the torrent data are called "leechers".
//! Peer that don not have a full copy of the torrent data are called "leechers".
//!
use torrust_tracker_torrent_repository::TorrentsSkipMapMutexStd;

Expand Down
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@
//! ```
//!
//! > **NOTICE**: those are the commands for `Ubuntu`. If you are using a
//! different OS, you will need to install the equivalent packages. Please
//! refer to the documentation of your OS.
//! > different OS, you will need to install the equivalent packages. Please
//! > refer to the documentation of your OS.
//!
//! With the default configuration you will need to create the `storage` directory:
//!
Expand Down Expand Up @@ -231,7 +231,7 @@
//! will use `./share/default/config/tracker.development.sqlite3.toml`.
//!
//! > IMPORTANT: Every time you change the configuration you need to restart the
//! service.
//! > service.
//!
//! # Usage
//!
Expand Down
22 changes: 11 additions & 11 deletions src/servers/apis/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! The tracker REST API with all its versions.
//!
//! > **NOTICE**: This API should not be exposed directly to the internet, it is
//! intended for internal use only.
//! > intended for internal use only.
//!
//! Endpoints for the latest API: [v1].
//!
Expand Down Expand Up @@ -124,16 +124,16 @@
//! ```
//!
//! > **NOTICE**: If you are using a reverse proxy like NGINX, you can skip this
//! step and use NGINX for the SSL instead. See
//! [other alternatives to Nginx/certbot](https://github.com/torrust/torrust-tracker/discussions/131)
//! > step and use NGINX for the SSL instead. See
//! > [other alternatives to Nginx/certbot](https://github.com/torrust/torrust-tracker/discussions/131)
//!
//! > **NOTICE**: You can generate a self-signed certificate for localhost using
//! OpenSSL. See [Let's Encrypt](https://letsencrypt.org/docs/certificates-for-localhost/).
//! That's particularly useful for testing purposes. Once you have the certificate
//! you need to set the [`ssl_cert_path`](torrust_tracker_configuration::HttpApi::tsl_config.ssl_cert_path)
//! and [`ssl_key_path`](torrust_tracker_configuration::HttpApi::tsl_config.ssl_key_path)
//! options in the configuration file with the paths to the certificate
//! (`localhost.crt`) and key (`localhost.key`) files.
//! > OpenSSL. See [Let's Encrypt](https://letsencrypt.org/docs/certificates-for-localhost/).
//! > That's particularly useful for testing purposes. Once you have the certificate
//! > you need to set the [`ssl_cert_path`](torrust_tracker_configuration::HttpApi::tsl_config.ssl_cert_path)
//! > and [`ssl_key_path`](torrust_tracker_configuration::HttpApi::tsl_config.ssl_key_path)
//! > options in the configuration file with the paths to the certificate
//! > (`localhost.crt`) and key (`localhost.key`) files.
//!
//! # Versioning
//!
Expand All @@ -153,8 +153,8 @@
//! If you want to contribute to this documentation you can [open a new pull request](https://github.com/torrust/torrust-tracker/pulls).
//!
//! > **NOTICE**: we are using [curl](https://curl.se/) in the API examples.
//! And you have to use quotes around the URL in order to avoid unexpected
//! errors. For example: `curl "http://127.0.0.1:1212/api/v1/stats?token=MyAccessToken"`.
//! > And you have to use quotes around the URL in order to avoid unexpected
//! > errors. For example: `curl "http://127.0.0.1:1212/api/v1/stats?token=MyAccessToken"`.
pub mod routes;
pub mod server;
pub mod v1;
Expand Down
2 changes: 1 addition & 1 deletion src/servers/apis/v1/context/auth_key/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pub async fn generate_auth_key_handler(State(tracker): State<Arc<Tracker>>, Path
///
/// - `POST /api/v1/key/120`. It will generate a new key valid for two minutes.
/// - `DELETE /api/v1/key/xqD6NWH9TcKrOCwDmqcdH5hF5RrbL0A6`. It will delete the
/// key `xqD6NWH9TcKrOCwDmqcdH5hF5RrbL0A6`.
/// key `xqD6NWH9TcKrOCwDmqcdH5hF5RrbL0A6`.
///
/// > **NOTICE**: this may change in the future, in the [API v2](https://github.com/torrust/torrust-tracker/issues/144).
#[derive(Deserialize)]
Expand Down
10 changes: 5 additions & 5 deletions src/servers/apis/v1/context/auth_key/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
//! ```
//!
//! > **NOTICE**: `valid_until` and `expiry_time` represent the same time.
//! `valid_until` is the number of seconds since the Unix epoch
//! ([timestamp](https://en.wikipedia.org/wiki/Timestamp)), while `expiry_time`
//! is the human-readable time ([ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)).
//! > `valid_until` is the number of seconds since the Unix epoch
//! > ([timestamp](https://en.wikipedia.org/wiki/Timestamp)), while `expiry_time`
//! > is the human-readable time ([ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)).
//!
//! **Resource**
//!
Expand Down Expand Up @@ -96,8 +96,8 @@
//! ```
//!
//! > **NOTICE**: a `500` status code will be returned and the body is not a
//! valid JSON. It's a text body containing the serialized-to-display error
//! message.
//! > valid JSON. It's a text body containing the serialized-to-display error
//! > message.
//!
//! # Reload authentication keys
//!
Expand Down
4 changes: 2 additions & 2 deletions src/servers/apis/v1/context/torrent/resources/torrent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
//!
//! - `Torrent` is the full torrent resource.
//! - `ListItem` is a list item resource on a torrent list. `ListItem` does
//! include a `peers` field but it is always `None` in the struct and `null` in
//! the JSON response.
//! include a `peers` field but it is always `None` in the struct and `null` in
//! the JSON response.
use serde::{Deserialize, Serialize};

use crate::core::services::torrent::{BasicInfo, Info};
Expand Down
4 changes: 2 additions & 2 deletions src/servers/apis/v1/context/whitelist/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub async fn add_torrent_to_whitelist_handler(
///
/// - `200` response with a [`ActionStatus::Ok`](crate::servers::apis::v1::responses::ActionStatus::Ok) in json.
/// - `500` with serialized error in debug format if the torrent couldn't be
/// removed from the whitelisted.
/// removed from the whitelisted.
///
/// Refer to the [API endpoint documentation](crate::servers::apis::v1::context::whitelist#remove-a-torrent-from-the-whitelist)
/// for more information about this endpoint.
Expand All @@ -65,7 +65,7 @@ pub async fn remove_torrent_from_whitelist_handler(
///
/// - `200` response with a [`ActionStatus::Ok`](crate::servers::apis::v1::responses::ActionStatus::Ok) in json.
/// - `500` with serialized error in debug format if the torrent whitelist
/// couldn't be reloaded from the database.
/// couldn't be reloaded from the database.
///
/// Refer to the [API endpoint documentation](crate::servers::apis::v1::context::whitelist#reload-the-whitelist)
/// for more information about this endpoint.
Expand Down
8 changes: 4 additions & 4 deletions src/servers/apis/v1/context/whitelist/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
//! torrents in the whitelist. The whitelist can be updated using the API.
//!
//! > **NOTICE**: the whitelist is only used when the tracker is configured to
//! in `listed` or `private_listed` modes. Refer to the
//! [configuration crate documentation](https://docs.rs/torrust-tracker-configuration)
//! to know how to enable the those modes.
//! > in `listed` or `private_listed` modes. Refer to the
//! > [configuration crate documentation](https://docs.rs/torrust-tracker-configuration)
//! > to know how to enable the those modes.
//!
//! > **NOTICE**: if the tracker is not running in `listed` or `private_listed`
//! modes the requests to the whitelist API will be ignored.
//! > modes the requests to the whitelist API will be ignored.
//!
//! # Endpoints
//!
Expand Down
2 changes: 1 addition & 1 deletion src/servers/apis/v1/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//! > **NOTICE**:
//! - The authentication keys are only used by the HTTP tracker.
//! - The whitelist is only used when the tracker is running in `listed` or
//! `private_listed` mode.
//! `private_listed` mode.
//!
//! Refer to the [authentication middleware](crate::servers::apis::v1::middlewares::auth)
//! for more information about the authentication process.
Expand Down
Loading