mrd0ll4r / chihaya-privtrak-middleware

A private tracker middleware for the chihaya BitTorrent tracker
MIT License
9 stars 1 forks source link
bittorrent-tracker chihaya middleware private-tracker tracker

chihaya-privtrak-middleware

Build Status Go Report Card GoDoc IRC Channel

A private tracker middleware for the chihaya BitTorrent tracker.

go get -t -u github.com/mrd0ll4r/chihaya-privtrak-middleware

Features

Non-Features

How to use this

the whole thing is in early stages, beware

Roughly, you need to do something like this:

  1. Implement a UserIdentifier to derive unique user IDs from requests. You could use HTTP/UDP optional parameters for this, or customized routes, or ... Just make sure the process is fast and reliable. Do not throw database queries in here, you WILL kill your tracker and/or DB. A sane way of doing this would be to issue 16-byte passkeys and just use them as user IDs.
  2. Implement a DeltaHandler to handle the deltas. You'd probably write these to a DB, or reprocess them first. They come in batches for a reason - don't insert them into a DB one by one. Before throwing them into a DB, you might want to
    • look up a user's numeric ID
    • look up the torrents numeric ID
    • (aggregate, possibly)
    • push them into an event processing system, for cool continuous queries
    • produce prometheus stats?
  3. Compile this middleware into your chihaya instance by adding a few lines in the cmd/chihay/config.go file.
  4. Adjust your config accordingly.

Expected issues

Future plans

License

MIT, see LICENSE