Skip to content

kubaryi/yabtt

Repository files navigation

Yet another BitTorrent Tracker

Build Version Powered-by

This is a security-first1 and high-performance2 BitTorrent Tracker.

The tracker is an HTTP/HTTPS service which responds to HTTP GET requests. The requests include metrics from clients that help the tracker keep overall statistics about the torrent. The response includes a peer list that helps the client participate in the torrent.

Read our documents to learn more.

Features

  1. Native support for HTTPS and HSTS.
  2. Full supports for the HTTP Tracker Protocol in the BitTorrent protocol specification, but we don't support or plan to support the UDP Tracker Protocol. -> why?
  3. Full supports for both IPv4 and IPv6 (including the Compact mode for IPv6).
  4. Supports the Tracker "Scrape" Extension.
  5. Supports Compact mode and provide no-peer-id mode for compatibility.
  6. Tracker statistics via web interface at /info or /stats. -> Screenshots

Usage

Our philosophy is to make everything as simple as possible. So we chose SQLite3 as the database, which means that you don't need to deploy the database separately.

Moreover, we provide Docker Container, which is also our most recommended deployment method:

Note You should replace /path/for/certs/ with the location of your certificates.

docker run -d --name yabtt -v /path/for/certs/:/etc/yabtt/ssl/ -p 8080:8080 ghcr.io/kubaryi/yabtt:latest

Or run with Docker Compose:

---
version: 2.1

services:
  yabtt:
    image: ghcr.io/kubaryi/yabtt:latest
    volumes:
      - /path/for/certs/:/etc/yabtt/ssl/
    container_name: yabtt
    ports:
      - 8080:8080

For HTTPS, We have prepared a more detailed guide.

Configuration

You can configure the server by the YABTT_* environment variables (the -e option for Docker or the environment configuration in docker-compose.yml).

Here are the environment variables we support:

Environment Default Describe
YABTT_INTERVAL 3600 Interval in seconds that the client should wait between sending regular requests to the tracker.
YABTT_PORT 8080 The port of server monitoring.
YABTT_QUERY_LIMIT 50 Limit the number of peers that the query can return.
YABTT_COMPACT_ONLY false Force compact mode to save bandwidth. 3
YABTT_DISABLE_HTTPS false Set it to true to disable HTTPS, but you should NEVER do this.
YABTT_AUTH_USERNAME admin Set the 'Basic' HTTP Authentication for tracker statistics.
YABTT_AUTH_PASSWORD admin Set the 'Basic' HTTP Authentication for tracker statistics.
YABTT_LOG_LEVEL info The log level printed on TTY.

Examples

See Examples and Screenshots.

Benchmark

For reference, we have designed a simple benchmark to test the main version of the application. However, it should be noted that the results can only be used as a reference and cannot represent the actual performance of the application in production.

You can check our report here.

Why UDP Tracker Protocol is not a good idea?

UDP Tracker Protocol allows clients to use UDP, which is lighter than TCP, to reducing the complexity of tracker code and increasing it's performance.

However, there is a fatal defect for UDP. UDP is more difficult to encrypt than HTTP! Although there is an idea like DoT (DNS Over TLS), it is difficult to be popular, not to mention that DoT also has the disadvantage that the traffic characteristics are too obvious. Its successor, DoH (DNS Over HTTPS), sends HTTP traffic! As a BitTorrent Tracker Server with "security"1 as the selling point, we can't stand such a "dangerous" transmission protocol such as UDP!

On the other hand, UDP is not a silver bullet to solve performance problems! I don't even think it's the right idea to use a transport layer protocol to solve an application layer problem. In order to solve performance problems, we should focus more on solutions such as HTTP/2 or HTTP/3 than on "evil ways" like UDP.

Build

See Compilation Guide

Reference

This project refers to the following documents or specifications.

License

The code in this project is released under the GPL-3.0 License.

Footnotes

  1. By default, we force HTTPS and run it with "strict mode". 2

  2. You can check our benchmark report here.

  3. In the situation that YABTT_COMPACT_ONLY be setting by true, we will refuse the request if the request contains compact=0.