Ocelot is a BitTorrent tracker written in C++, forked from WhatCD/Ocelot. It supports requests over TCP and can track IPv4/IPv6 peers.
- Support ipv6 protocol
- Discount on torrents, such as 100%, 50%, 30% free, which is supported by traditional tracker
- Statistics of users' uploaded/downloaded volume size, last seed time, etc.
- Fixed some issues
- GCC/G++ (4.7+ required; 4.8.1+ recommended)
- Boost (1.55.0+ required)
- libev (required)
- MySQL++ (3.2.0+ required)
- TCMalloc (optional, but strongly recommended)
The Gazelle installation guides include instructions for installing Ocelot as a part of the Gazelle project.
-
Create the following tables according to the Gazelle database schema, i.e.
gazelle.sql:torrentsusers_freeleechesusers_mainxbt_client_whitelistxbt_files_usersxbt_snatchedusers_freetorrentsusers_torrents
-
Edit
ocelot.conf(copied from templateocelot.conf.dist) to your liking. -
Build Ocelot:
apt-get update
apt-get install --no-install-recommends -y \
build-essential \
automake \
cmake \
default-libmysqlclient-dev \
libboost-iostreams-dev \
libboost-system-dev \
libev-dev \
libjemalloc-dev \
libmysql++-dev \
default-libmysqlclient-dev \
mariadb-client \
pkg-config \
git \
libgoogle-glog-dev
./configure --with-mysql-lib=/usr/lib/x86_64-linux-gnu/ \
--with-ev-lib=/usr/lib/x86_64-linux-gnu/ \
--with-boost-libdir=/usr/lib/x86_64-linux-gnu/
--with-glog-lib=/usr/lib/x86_64-linux-gnu/
make && make installOcelot can also be built from CMakeLists.txt by cmake with this command:
cmake . && cmake --build .- Run Ocelot:
./ocelotIf the service is to run in production, systemd is recommended to manage it.
-
Prepare Docker Image
Run these commands from the root directory of this repository.
docker build . --no-cache -t gpw-ocelot:latest -f DockerfileIf this is to deploy in production, remove CXXFLAGS=-D__DEBUG_BUILD__ which is for testing purpose,
such as allowing peer connections from local networks
-
Start the containers
- Deploy
Gazellefirstly by following instructionsGazelle Setup-Development-Environment - The container can be started using the previously built image
gpw-ocelot:latest. We usegazelleas parent here so that the containers under the same parentgazellecan communicate with each other under the same network.
- Deploy
docker-compose -p gazelle up -dNote: The following instructions are assumed that Gazelle(gpw-web) and Ocelot(gpw-ocelot) have already been running in container mode.
-
Register as a user from start webpage
http://localhost:9000 -
Upload a torrent (may need to restart the
gpw-ocelotcontainer to reload torrents from database ifgpw-webis started with tracker disabled) -
Send
announcerequest for testing, here is an example:
curl 'http://127.0.0.1:34000/<YOUR PASSKEY>/announce?info_hash=<TORRENT INFO HASH ENCODED>&peer_id=-DE203s-TQaEVc.-mzuO&port=32777&uploaded=0&downloaded=0&left=0&corrupt=0&key=449DBE8D&event=completed&numwant=200&compact=1&no_peer_id=1&supportcrypto=1&redundant=0' --output temp-c <path/to/ocelot.conf>- Path to config file. If unspecified, the current working directory is used.-v- Print queue status every time a flush is initiated.
SIGHUP- Reload configSIGUSR1- Reload torrent list, user list and client whitelist