Torrust-Actix Tracker is a lightweight but incredibly powerful and feature-rich BitTorrent Tracker made using Rust.
Currently, it's being actively used at https://www.gbitt.info/ which as of current writing has 200+ million torrent hashes loaded and hitting 5+ million peers.
This project originated from Torrust-Tracker code originally developed by Mick van Dijke, further developed by Power2All as alternative for OpenTracker and other tracker code available on GitHub.
You can get the latest binaries from releases or follow the install from scratch instructions below.
Clone the repository:
git clone https://github.com/Power2All/torrust-actix.git
cd torrust-actix
Build the source code using Rust (make sure you have installed rustup with stable branch)
chmod +x build.sh && ./build.sh
/webgui/index.htm
needs to be modified)cargo build --release
Running the code will create a config.toml
file when it doesn't exist yet. The configuration will be filled with default values, and will use SQLite3 in memory as default persistence. Persistence is turned OFF by default, so you need to activate that manually:
./target/release/torrust-actix
Modify the newly created config.toml
file according to your liking. (ToDo: Create extended documentation)
log_level = "info"
log_console_interval = 60
statistics_enabled = true
db_driver = "SQLite3"
db_path = "sqlite://:memory:"
persistence = false
persistence_interval = 60
api_key = "MyAccessToken"
whitelist = false
blacklist = false
keys = false
keys_cleanup_interval = 10
users = false
maintenance_mode_enabled = false
interval = 1800
interval_minimum = 1800
interval_cleanup = 900
peer_timeout = 2700
peers_returned = 200
[[udp_server]] enabled = true bind_address = "127.0.0.1:6969"
[[http_server]] enabled = true bind_address = "127.0.0.1:6969" ssl = false ssl_key = "" ssl_cert = ""
[[api_server]] enabled = true bind_address = "127.0.0.1:8080" ssl = false ssl_key = "" ssl_cert = ""
[db_structure] db_torrents = "torrents" table_torrents_info_hash = "info_hash" table_torrents_completed = "completed" db_whitelist = "whitelist" table_whitelist_info_hash = "info_hash" db_blacklist = "blacklist" table_blacklist_info_hash = "info_hash" db_keys = "keys" table_keys_hash = "hash" table_keys_timeout = "timeout" db_users = "users" table_users_uuid = "uuid" table_users_key = "key" table_users_uploaded = "uploaded" table_users_downloaded = "downloaded" table_users_completed = "completed" table_users_updated = "updated" table_users_active = "active"
* Run the torrust-actix again after finishing the configuration:
```bash
./target/release/torrust-actix
Your tracker announce URL will be the following, depending on what blocks you have enabled:
udp://127.0.0.1:6969/announce
http://127.0.0.1:6969/announce
https://127.0.0.1:6969/announce
udp://127.0.0.1:6969/announce/1234567890123456789012345678901234567890
http://127.0.0.1:6969/announce/1234567890123456789012345678901234567890
https://127.0.0.1:6969/announce/1234567890123456789012345678901234567890
The following URLs are available if you have enabled the API block.
Also, the following URL is enabled for the Web Interface: http(s)://127.0.0.1:8080/webgui/
Replace [TOKENID]
with the token set in the configuration file.
Replace [TORRENT_HASH]
with a hex 40 character info_hash.
Also depends on if you have HTTP and/or HTTPS enabled.
If an error occurred for whatever reason, the status key will not contain "ok", but the reason:
{
"status":"FAILURE REASON"
}
http(s)://127.0.0.1:8080/api/stats?token=[TOKENID]
This will show statistics of the tracker in JSON format.
{
"started":1234567890,
"timestamp_run_save":1234567890,
"timestamp_run_timeout":1234567890,
"timestamp_run_console":1234567890,
"torrents":0,
"torrents_updates":0,
"torrents_shadow":0,
"maintenance_mode":false,
"seeds":0,
"peers":0,
"completed":0,
"whitelist_enabled":true,
"whitelist":0,
"blacklist_enabled":true,
"blacklist":0,
"keys_enabled":true,
"keys":0,
"tcp4_connections_handled":0,
"tcp4_api_handled":0,
"tcp4_announces_handled":0,
"tcp4_scrapes_handled":0,
"tcp6_connections_handled":0,
"tcp6_api_handled":0,
"tcp6_announces_handled":0,
"tcp6_scrapes_handled":0,
"udp4_connections_handled":0,
"udp4_announces_handled":0,
"udp4_scrapes_handled":0,
"udp6_connections_handled":0,
"udp6_announces_handled":0,
"udp6_scrapes_handled":0
}
http(s)://127.0.0.1:8080/api/torrent/[TORRENT_HASH]?token=[TOKENID]
This will show the content of the torrent, including peers.
{
"info_hash":"1234567890123456789012345678901234567890",
"completed":0,
"seeders":1,
"leechers":0,
"peers": [
[
{
"client":"",
"id":"1234567890123456789012345678901234567890"
},
{
"downloaded":0,
"event":"Started",
"ip":"127.0.0.1:1234",
"left":0,
"updated":0,
"uploaded":0
}
]
]
}
http(s)://127.0.0.1:8080/api/torrent/[TORRENT_HASH]?token=[TOKENID]
This will remove the torrent and it's peers from the memory.
{
"status":"ok"
}
http(s)://127.0.0.1:8080/api/whitelist?token=[TOKENID]
This will get the whole whitelist in list format.
[
"1234567890123456789012345678901234567890",
"0987654321098765432109876543210987654321"
]
http(s)://127.0.0.1:8080/api/whitelist/[TORRENT_HASH]?token=[TOKENID]
This will check if an info_hash exists in the whitelist, and returns if true.
{
"status":"ok"
}
http(s)://127.0.0.1:8080/api/whitelist/[TORRENT_HASH]?token=[TOKENID]
This will insert an info_hash in the whitelist, and returns status if successful.
{
"status":"ok"
}
http(s)://127.0.0.1:8080/api/whitelist/[TORRENT_HASH]?token=[TOKENID]
This will remove an info_hash from the whitelist, and returns status if successful or failure reason.
{
"status":"ok"
}
http(s)://127.0.0.1:8080/api/blacklist?token=[TOKENID]
This will get the whole blacklist in list format.
[
"1234567890123456789012345678901234567890",
"0987654321098765432109876543210987654321"
]
http(s)://127.0.0.1:8080/api/blacklist/[TORRENT_HASH]?token=[TOKENID]
This will check if an info_hash exists in the blacklist, and returns if true.
{
"status":"ok"
}
http(s)://127.0.0.1:8080/api/blacklist/[TORRENT_HASH]?token=[TOKENID]
This will insert an info_hash in the blacklist, and returns status if successful.
{
"status":"ok"
}
http(s)://127.0.0.1:8080/api/blacklist/[TORRENT_HASH]?token=[TOKENID]
This will remove an info_hash from the blacklist, and returns status if successful or failure reason.
{
"status":"ok"
}
http(s)://127.0.0.1:8080/api/keys?token=[TOKENID]
This will get the whole keys in list format. 1st value is the key itself, 2nd value is the timestamp in UNIX format (seconds).
[
[
"1234567890123456789012345678901234567890",
"1234567890"
]
]
http(s)://127.0.0.1:8080/api/keys/[KEY]?token=[TOKENID]
This will check if a key exists in the keys list, and returns if true.
{
"status":"ok"
}
http(s)://127.0.0.1:8080/api/keys/[KEY]/[TIMEOUT]?token=[TOKENID]
This will insert or update a key in the keys list, and returns status if successful. The [TIMEOUT]
is a number in seconds. Make this 0 to keep the key permanent.
{
"status":"ok"
}
http(s)://127.0.0.1:8080/api/keys/[KEY]?token=[TOKENID]
This will remove a key from the keys list, and returns status if successful or failure reason.
{
"status":"ok"
}
http(s)://127.0.0.1:8080/api/users?token=[TOKENID]
This will return all the users in an array, including which torrents are being used actively by the user.
[
{
"uuid": "cbeca840-e9f7-44d5-a1e4-51e9aef864a7",
"key": "1234567890123456789012345678901234567890",
"uploaded": 0,
"downloaded": 0,
"completed": 0,
"updated": 1686302997,
"active": 1,
"torrents_active": [
[
"1234567890123456789012345678901234567890",
1686302997
]
]
}
]
http(s)://127.0.0.1:8080/api/user/[USER_HASH]?token=[TOKENID]
This will return the user containing hashed key (not the uuid) in an array, including which torrents are being used actively by the user.
{
"uuid":"cbeca840-e9f7-44d5-a1e4-51e9aef864a7",
"key":"1234567890123456789012345678901234567890",
"uploaded":0,
"downloaded":0,
"completed":0,
"updated":1686302997,
"active":1,
"torrents_active":[
[
"1234567890123456789012345678901234567890",
1686302997
]
]
}
http(s)://127.0.0.1:8080/api/user?token=[TOKENID]
This will insert a user in the user memory database, and returns status if successful. Body data must be in valid JSON as shown below, otherwise it will return a error.
Send:
{
"uuid":"cbeca840-e9f7-44d5-a1e4-51e9aef864a7",
"key":"1234567890123456789012345678901234567890",
"uploaded":0,
"downloaded":0,
"completed":0,
"updated":1686302997,
"active":1
}
Response:
{
"status":"ok"
}
http(s)://127.0.0.1:8080/api/user/[USER_HASH]?token=[TOKENID]
This will remove the user from the memory.
{
"status":"ok"
}
http(s)://127.0.0.1:8080/api/maintenance/enable?token=[TOKENID]
This will enable the maintenance mode.
{
"status":"ok"
}
http(s)://127.0.0.1:8080/api/maintenance/disable?token=[TOKENID]
This will disable the maintenance mode.
{
"status":"ok"
}
Initial version of Torrust-Axum.
This Torrust-Tracker was a joint effort by Nautilus Cyberneering GmbH, Dutch Bits and Power2All. Also thanks to Naim A. and greatest-ape for some parts in the Torrust-Tracker code. This project (Torrust-Actix) is built from scratch by Power2All.