Giter Club home page Giter Club logo

mika's Introduction

Mika

A torrent tracker written in the Go programming language and using redis as a backend database.

This tracker is notably different from others like chihaya in that it caters specifically to private tracker needs.

Features

  • Complete JSON/REST Api for interacting with the tracker on a separate authenticated port differing from the standard tracker port. This port is configured for TLS1.2+ only.
  • Redis backed storage engine with no support for RDBMS systems (mysql/postgres)
  • Designed for private tracker needs, chihaya is a more suitable choice for public trackers.
  • (Partial) IPv4 and IPv6 support with the ability to enable or disable the stacks.
  • Smart peer selection based on geographic location.
  • No database reads on incoming announces/scrapes.
  • User bonus point system built into the tracker which is updated on each request instead of large batches.
  • (Partial) Support for metrics and instrumentation backends (graphite/influxdb)
  • Python based API Client maintained at totv-python.
  • (Soon) PHP based API Client
  • Client whitelists for only allowing specific torrent clients
  • Tested on Linux, should run anywhere the golang platform does.
  • User authentication via passkey

Usage

Create and configure a new config.json file from the config.json.dist example.

Currently we are storing torrent data in MySQL. Because of this we need to load the existing data into redis. This includes the following entities:

  • torrent.info_hash We track torrents using torrent_id internally
  • user.passkey To validate users and track their relationship to specific peer_id's
  • whitelist.peer_id whitelist.vstring Load the current client white list

To do this we use the manage.py script with the warmup command as follows and run the tracker.

hacker@nsa:$ ./manage.py warmup
> Warming up redis data...
> Loading whitelist...   12
> Loading passkeys...    146
> Loading torrents...    3819
hacker@nsa:$ ./mika

We also need to generate SSL keys for the API listener as follows:

hacker@nsa:$ ./manage.py genkey
> Generating new keys...
Generating a 1024 bit RSA private key
...

Current Issues & Considerations

The tracker does not currently gracefully reconnect everything when it looses connection to its redis backend. If you ever restart redis, make sure to restart mika as well until this issue is resolved.

Compiling

If building a binary from source you will need a Go 1.4+ SDK installed.

To build, set your $GOPATH env var to $git_project_clone, install deps and go build.

hacker@nsa:$ export GOPATH=$dir_path
hacker@nsa:$ mkdir -p $GOPATH/src/github.com/leighmacdonald
hacker@nsa:$ cd $GOPATH/src/github.com/leighmacdonald
hacker@nsa:$ git clone [email protected]:leighmacdonald/mika
hacker@nsa:$ cd mika 
hacker@nsa:$ cp .hooks/pre-commit .git/hooks/
hacker@nsa:$ ./ci_build.sh
hacker@nsa:$ ./mika

Run-time options:

  • -config <config.json> - Path to config file. Default is ./config.json
  • -procs - Number of processor cores to use. The default is $numcores-1, but you may want to lower this if there is other contentious services running too.

Signals

  • SIGUSR2 - Reload config

Auto start

There are many ways to start the application as a service. Currently I am using supervisord and have included an example configuration under the docs folder.

mika's People

Contributors

leighmacdonald avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.