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
32 changes: 16 additions & 16 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ time = "build --timings --all-targets"

[build]
rustflags = [
"-D",
"warnings",
"-D",
"future-incompatible",
"-D",
"let-underscore",
"-D",
"nonstandard-style",
"-D",
"rust-2018-compatibility",
"-D",
"rust-2018-idioms",
"-D",
"rust-2021-compatibility",
"-D",
"unused",
"-D",
"warnings",
"-D",
"future-incompatible",
"-D",
"let-underscore",
"-D",
"nonstandard-style",
"-D",
"rust-2018-compatibility",
"-D",
"rust-2018-idioms",
"-D",
"rust-2021-compatibility",
"-D",
"unused",
]
10 changes: 8 additions & 2 deletions .github/workflows/container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,15 @@ jobs:
echo "continue=true" >> $GITHUB_OUTPUT
echo "On \`develop\` Branch, Type: \`development\`"

elif [[ $(echo "${{ github.ref }}" | grep -P '^(refs\/heads\/releases\/)(v)(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$') ]]; then
elif [[ "${{ github.ref }}" =~ ^refs/heads/releases/ ]]; then
semver_regex='^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-((0|[1-9][0-9]*|[0-9]*[A-Za-z-][0-9A-Za-z-]*)(\.(0|[1-9][0-9]*|[0-9]*[A-Za-z-][0-9A-Za-z-]*))*))?(\+([0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*))?$'
version=$(echo "${{ github.ref }}" | sed -n -E 's#^refs/heads/releases/##p')

if [[ ! "$version" =~ $semver_regex ]]; then
echo "Not a valid release branch semver. Will Not Continue"
exit 0
fi

version=$(echo "${{ github.ref }}" | sed -n -E 's/^(refs\/heads\/releases\/)//p')
echo "version=$version" >> $GITHUB_OUTPUT
echo "type=release" >> $GITHUB_OUTPUT
echo "continue=true" >> $GITHUB_OUTPUT
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- id: coverage
name: Generate Coverage Report
run: |
cargo clean
cargo clean
cargo llvm-cov --all-features --workspace --codecov --output-path ./codecov.json

- id: upload
Expand All @@ -54,4 +54,4 @@ jobs:
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{ github.workspace }}/codecov.json
fail_ci_if_error: true
fail_ci_if_error: true
2 changes: 1 addition & 1 deletion .github/workflows/generate_coverage_pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- id: coverage
name: Generate Coverage Report
run: |
cargo clean
cargo clean
cargo llvm-cov --all-features --workspace --codecov --output-path ./codecov.json

- name: Store PR number and commit SHA
Expand Down
39 changes: 13 additions & 26 deletions .github/workflows/testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ jobs:
run: cargo fmt --check

check:
name: Static Analysis
name: Linting
runs-on: ubuntu-latest
needs: format
timeout-minutes: 15

strategy:
matrix:
Expand All @@ -51,39 +52,25 @@ jobs:
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.toolchain }}
components: clippy
components: clippy, rustfmt

- id: node
name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: "20"

- id: cache
name: Enable Workflow Cache
uses: Swatinem/rust-cache@v2

- id: tools
name: Install Tools
uses: taiki-e/install-action@v2
with:
tool: cargo-machete

- id: check
name: Run Build Checks
run: cargo check --tests --benches --examples --workspace --all-targets --all-features
name: Install Internal Linter
run: cargo install --locked --git https://github.com/torrust/torrust-linting --bin linter

- id: lint
name: Run Lint Checks
run: cargo clippy --tests --benches --examples --workspace --all-targets --all-features

- id: docs
name: Lint Documentation
env:
RUSTDOCFLAGS: "-D warnings"
run: cargo doc --no-deps --bins --examples --workspace --all-features

- id: clean
name: Clean Build Directory
run: cargo clean

- id: deps
name: Check Unused Dependencies
run: cargo machete
name: Run All Linters
run: linter all

build:
name: Build on ${{ matrix.os }} (${{ matrix.toolchain }})
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upload_coverage_pr.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Upload Coverage Report (PR)

on:
# This workflow is triggered after every successfull execution
# This workflow is triggered after every successful execution
# of `Generate Coverage Report` workflow.
workflow_run:
workflows: ["Generate Coverage Report (PR)"]
Expand Down
18 changes: 18 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"default": true,
"MD013": false,
"MD031": true,
"MD032": true,
"MD040": true,
"MD022": true,
"MD009": true,
"MD007": {
"indent": 2
},
"MD026": false,
"MD041": false,
"MD034": false,
"MD024": false,
"MD033": false,
"MD060": false
}
27 changes: 27 additions & 0 deletions .taplo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Taplo configuration file for TOML formatting
# Used by the "Even Better TOML" VS Code extension

# Exclude generated and runtime folders from linting
exclude = [ ".coverage/**", "storage/**", "target/**" ]

[formatting]
# Preserve blank lines that exist
allowed_blank_lines = 1
# Don't reorder keys to maintain structure
reorder_keys = false
# Array formatting
array_auto_collapse = false
array_auto_expand = false
array_trailing_comma = true
# Inline table formatting
compact_arrays = false
compact_inline_tables = false
inline_table_expand = false
# Alignment
align_comments = true
align_entries = false
# Indentation
indent_entries = false
indent_tables = false
# Other
trailing_newline = true
16 changes: 16 additions & 0 deletions .yamllint-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
extends: default

rules:
line-length:
max: 200 # More reasonable for infrastructure code
comments:
min-spaces-from-content: 1 # Allow single space before comments
document-start: disable # Most project YAML files don't require ---
truthy:
allowed-values: ["true", "false", "yes", "no", "on", "off"] # Allow common GitHub Actions values

# Ignore generated/runtime directories
ignore: |
target/**
storage/**
.coverage/**
24 changes: 12 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ version.workspace = true
name = "torrust_tracker_lib"

[workspace.package]
authors = ["Nautilus Cyberneering <info@nautilus-cyberneering.de>, Mick van Dijke <mick@dutchbits.nl>"]
categories = ["network-programming", "web-programming"]
authors = [ "Nautilus Cyberneering <info@nautilus-cyberneering.de>, Mick van Dijke <mick@dutchbits.nl>" ]
categories = [ "network-programming", "web-programming" ]
description = "A feature rich BitTorrent tracker."
documentation = "https://docs.rs/crate/torrust-tracker/"
edition = "2021"
homepage = "https://torrust.com/"
keywords = ["bittorrent", "file-sharing", "peer-to-peer", "torrent", "tracker"]
keywords = [ "bittorrent", "file-sharing", "peer-to-peer", "torrent", "tracker" ]
license = "AGPL-3.0-only"
publish = true
repository = "https://github.com/torrust/torrust-tracker"
Expand All @@ -34,19 +34,19 @@ version = "3.0.0-develop"

[dependencies]
anyhow = "1"
axum-server = { version = "0", features = ["tls-rustls-no-provider"] }
axum-server = { version = "0", features = [ "tls-rustls-no-provider" ] }
bittorrent-http-tracker-core = { version = "3.0.0-develop", path = "packages/http-tracker-core" }
bittorrent-tracker-core = { version = "3.0.0-develop", path = "packages/tracker-core" }
bittorrent-udp-tracker-core = { version = "3.0.0-develop", path = "packages/udp-tracker-core" }
chrono = { version = "0", default-features = false, features = ["clock"] }
clap = { version = "4", features = ["derive", "env"] }
chrono = { version = "0", default-features = false, features = [ "clock" ] }
clap = { version = "4", features = [ "derive", "env" ] }
rand = "0"
regex = "1"
reqwest = { version = "0", features = ["json"] }
serde = { version = "1", features = ["derive"] }
serde_json = { version = "1", features = ["preserve_order"] }
reqwest = { version = "0", features = [ "json" ] }
serde = { version = "1", features = [ "derive" ] }
serde_json = { version = "1", features = [ "preserve_order" ] }
thiserror = "2.0.12"
tokio = { version = "1", features = ["macros", "net", "rt-multi-thread", "signal", "sync"] }
tokio = { version = "1", features = [ "macros", "net", "rt-multi-thread", "signal", "sync" ] }
tokio-util = "0.7.15"
torrust-axum-health-check-api-server = { version = "3.0.0-develop", path = "packages/axum-health-check-api-server" }
torrust-axum-http-tracker-server = { version = "3.0.0-develop", path = "packages/axum-http-tracker-server" }
Expand All @@ -59,7 +59,7 @@ torrust-tracker-configuration = { version = "3.0.0-develop", path = "packages/co
torrust-tracker-swarm-coordination-registry = { version = "3.0.0-develop", path = "packages/swarm-coordination-registry" }
torrust-udp-tracker-server = { version = "3.0.0-develop", path = "packages/udp-tracker-server" }
tracing = "0"
tracing-subscriber = { version = "0", features = ["json"] }
tracing-subscriber = { version = "0", features = [ "json" ] }

[dev-dependencies]
bittorrent-primitives = "0.1.0"
Expand All @@ -70,7 +70,7 @@ torrust-rest-tracker-api-client = { version = "3.0.0-develop", path = "packages/
torrust-tracker-test-helpers = { version = "3.0.0-develop", path = "packages/test-helpers" }

[workspace]
members = ["console/tracker-client", "packages/torrent-repository-benchmarking"]
members = [ "console/tracker-client", "packages/torrent-repository-benchmarking" ]

[profile.dev]
debug = 1
Expand Down
18 changes: 4 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Others:
<https://github.com/orgs/torrust/projects/10/views/6>

## Implemented BitTorrent Enhancement Proposals (BEPs)
>

> _[Learn more about BitTorrent Enhancement Proposals][BEP 00]_

- [BEP 03]: The BitTorrent Protocol.
Expand Down Expand Up @@ -113,8 +113,8 @@ podman run -it docker.io/torrust/tracker:develop

### Development Version

- Please ensure you have the _**[latest stable (or nightly) version of rust][rust]___.
- Please ensure that your computer has enough RAM. _**Recommended 16GB.___
- Please ensure you have the \_\*\*[latest stable (or nightly) version of rust][rust]\_\_\_.
- Please ensure that your computer has enough RAM. \_\*\*Recommended 16GB.\_\_\_

#### Checkout, Test and Run

Expand Down Expand Up @@ -217,7 +217,7 @@ This program is free software: you can redistribute it and/or modify it under th

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 Affero General Public License][AGPL_3_0] for more details.

You should have received a copy of the *GNU Affero General Public License* along with this program. If not, see <https://www.gnu.org/licenses/>.
You should have received a copy of the _GNU Affero General Public License_ along with this program. If not, see <https://www.gnu.org/licenses/>.

Some files include explicit copyright notices and/or license notices.

Expand Down Expand Up @@ -250,43 +250,33 @@ This project was a joint effort by [Nautilus Cyberneering GmbH][nautilus] and [D
[deployment_wf_b]: ../../actions/workflows/deployment.yaml/badge.svg
[testing_wf]: ../../actions/workflows/testing.yaml
[testing_wf_b]: ../../actions/workflows/testing.yaml/badge.svg

[bittorrent]: http://bittorrent.org/
[rust]: https://www.rust-lang.org/
[axum]: https://github.com/tokio-rs/axum
[newtrackon]: https://newtrackon.com/
[coverage]: https://app.codecov.io/gh/torrust/torrust-tracker
[torrust]: https://torrust.com/

[dockerhub]: https://hub.docker.com/r/torrust/tracker/tags

[torrent_source_felid]: https://github.com/qbittorrent/qBittorrent/discussions/19406

[BEP 00]: https://www.bittorrent.org/beps/bep_0000.html
[BEP 03]: https://www.bittorrent.org/beps/bep_0003.html
[BEP 07]: https://www.bittorrent.org/beps/bep_0007.html
[BEP 15]: https://www.bittorrent.org/beps/bep_0015.html
[BEP 23]: https://www.bittorrent.org/beps/bep_0023.html
[BEP 27]: https://www.bittorrent.org/beps/bep_0027.html
[BEP 48]: https://www.bittorrent.org/beps/bep_0048.html

[containers.md]: ./docs/containers.md

[docs]: https://docs.rs/torrust-tracker/latest/
[api]: https://docs.rs/torrust-tracker/latest/torrust_tracker/servers/apis/v1
[http]: https://docs.rs/torrust-tracker/latest/torrust_tracker/servers/http
[udp]: https://docs.rs/torrust-tracker/latest/torrust_tracker/servers/udp

[good first issues]: https://github.com/torrust/torrust-tracker/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22
[discussions]: https://github.com/torrust/torrust-tracker/discussions

[guide.md]: https://github.com/torrust/.github/blob/main/info/contributing.md
[agreement.md]: https://github.com/torrust/.github/blob/main/info/licensing/contributor_agreement_v01.md

[AGPL_3_0]: ./docs/licenses/LICENSE-AGPL_3_0
[MIT_0]: ./docs/licenses/LICENSE-MIT_0
[FSF]: https://www.fsf.org/

[nautilus]: https://github.com/orgs/Nautilus-Cyberneering/
[Dutch Bits]: https://dutchbits.nl
[Naim A.]: https://github.com/naim94a/udpt
Expand Down
18 changes: 9 additions & 9 deletions console/tracker-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
description = "A collection of console clients to make requests to BitTorrent trackers."
keywords = ["bittorrent", "client", "tracker"]
keywords = [ "bittorrent", "client", "tracker" ]
license = "LGPL-3.0"
name = "torrust-tracker-client"
readme = "README.md"
Expand All @@ -19,21 +19,21 @@ anyhow = "1"
aquatic_udp_protocol = "0"
bittorrent-primitives = "0.1.0"
bittorrent-tracker-client = { version = "3.0.0-develop", path = "../../packages/tracker-client" }
clap = { version = "4", features = ["derive", "env"] }
clap = { version = "4", features = [ "derive", "env" ] }
futures = "0"
hex-literal = "1"
hyper = "1"
reqwest = { version = "0", features = ["json"] }
serde = { version = "1", features = ["derive"] }
reqwest = { version = "0", features = [ "json" ] }
serde = { version = "1", features = [ "derive" ] }
serde_bencode = "0"
serde_bytes = "0"
serde_json = { version = "1", features = ["preserve_order"] }
serde_json = { version = "1", features = [ "preserve_order" ] }
thiserror = "2"
tokio = { version = "1", features = ["macros", "net", "rt-multi-thread", "signal", "sync"] }
tokio = { version = "1", features = [ "macros", "net", "rt-multi-thread", "signal", "sync" ] }
torrust-tracker-configuration = { version = "3.0.0-develop", path = "../../packages/configuration" }
tracing = "0"
tracing-subscriber = { version = "0", features = ["json"] }
url = { version = "2", features = ["serde"] }
tracing-subscriber = { version = "0", features = [ "json" ] }
url = { version = "2", features = [ "serde" ] }

[package.metadata.cargo-machete]
ignored = ["serde_bytes"]
ignored = [ "serde_bytes" ]
Loading