Skip to content

Commit

Permalink
Merge #650: Udpate tracker configuration
Browse files Browse the repository at this point in the history
940c246 fix: [#648] udpate tracker configuration (Jose Celano)

Pull request description:

  New breaking changes have been applied to the Tracker configuration.

  - Renamed `log_level` to  `threshold`.
  - Tracker mode split into `listed` and `private` flags.
  - Added configuration `version`.

  From:

  ```toml
  [logging]
  log_level = "info"

  [core]
  mode = "public"
  tracker_usage_statistics = true
  inactive_peer_cleanup_interval = 600

  ```

  To:

  ```toml
  version = "2"

  [logging]
  threshold = "info"

  [core]
  inactive_peer_cleanup_interval = 600
  listed = false
  private = false
  tracker_usage_statistics = true

  ```

Top commit has no ACKs.

Tree-SHA512: 1087d0abb8be8a9d36f66fc3e2b5d57136c49e589baae5018ead61041d6d6f7e15e76dfac2a911d54ff53ab72d25da1a75274f71a0842de97157e02f94b0899a
  • Loading branch information
josecelano committed Jul 2, 2024
2 parents b55742b + 940c246 commit 0a2db2f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
version = "2"

[core]
mode = "private"
private = true

[core.database]
driver = "Sqlite3"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
version = "2"

[core]
mode = "public"
private = true

[core.database]
driver = "Sqlite3"
Expand Down
7 changes: 1 addition & 6 deletions src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,7 @@ impl From<figment::Error> for Error {
}
}

// todo: use https://crates.io/crates/torrust-tracker-primitives for TrackerMode.

/// The mode the tracker will run in.
///
/// Refer to [Torrust Tracker Configuration](https://docs.rs/torrust-tracker-configuration)
/// to know how to configure the tracker to run in each mode.
/// The mode the tracker is running in.
#[derive(Serialize, Deserialize, Clone, PartialEq, Eq, Debug)]
pub enum TrackerMode {
/// Will track every new info hash and serve every peer.
Expand Down
4 changes: 1 addition & 3 deletions src/config/v1/tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ pub struct Tracker {
#[serde(default = "Tracker::default_api_url")]
pub api_url: Url,

/// The mode of the tracker. For example: `Public`.
/// See `TrackerMode` in [`torrust-tracker-primitives`](https://docs.rs/torrust-tracker-primitives)
/// crate for more information.
/// The mode the tracker is running in.
#[serde(default = "Tracker::default_mode")]
pub mode: TrackerMode,

Expand Down

0 comments on commit 0a2db2f

Please sign in to comment.