Looking for Standalone BT Tracker

Discussion in 'Application Software' started by YukinoAi, Oct 20, 2015.

  1. YukinoAi

    YukinoAi MDL Novice

    Sep 5, 2015
    So I'm nearing my wit's end. I can keep working on this but I don't think this is happening anytime this year solo hence the post.

    I'm looking for a standalone bittorrent tracker that can run on windows x86 and x64 systems.
    Ideally the interface should work something like:
    start "" tracker.exe port=9000
    Command line only is ideal.
    :stop reading now:

    :Long part:
    Stuff I care about:
    -no external environmental dependencies in the final .exe (no external usage of c++ redist or .net packages or mysql)
    -strongly prefer not having external dependencies in terms of separate files in the same directory but this is not a deal-breaker
    -works reliably
    -reproducible build environment (if applicable)
    -compilation for execution in native win_x86 and win_x64 environments (if applicable)
    -final .exe+ dependency files (if any) should be no greater than ~100mb

    Stuff I don't care about:
    -efficiency (how fast it runs or how many maximum clients it supports)
    -any files created dynamically at runtime, such as mysqllite.db/trackerConfig.ini/peerList.db.txt

    Tools available:
    -Any application/build environment on OS in any architecture and in any configuration (via T2 hypervisor)

    -should get it's settings from either a command line or some (optional) .ini file
    -no gui involved (command line only)
    -and run in WindowsPE (3,4,5,10)

    Random Comments:
    -The only reason I haven't used vmware thinapp to capture the embeded trackers in uTorrent/qTorrent with a hex-editor to disable the popup is because there isn't an x64 build available for either uTorrent/qTorrent and thinapp itself also only supports capturing 32-bit applications.
    -Anything involving Python would be wonderful since "pyinstaller --onefile myPythonScript.py" can generate a single .exe reliably for both x86 and x64 windows for both python 2.x and 3.x and pyinstaller is easy to install using pip
    -The only thing I really don't get is why this 'boost' or 'jam' or 'binding' stuff is involved when I'm was just trying to use libtorrent in python. I'd prefer that it wasn't. Other than that tho, I don't really need any help understanding any concepts, it's the implementation details that are messing me up at this point.

    Stuff I've already tried:
    A) Web-based php trackers like opentracker_php They seem to require...well php and half of them require mySQL too. I don't mind embedding a webserver but I can't seem to figure out how to embedd a web-server + php + mysql in a <100mb .exe file. Even portable WAMP/LAMP servers are like 300-600 mb extracted.
    -There's this one announce.php tracker that doesn't use mysql and that would be perfect except for the part where it still needs php.
    -Haven't found a portable webserver + php that's <100 mb and can work programmatically
    B) opentracker_mem will-not-compile-at-all, for use on windows systems (using the tdm-gcc implementation of mgwin) or ubuntu's apt-get mgwin packages
    -can't get past the opentracker's dependency of libowfat (posix only)
    C) pytt (python based tracker using the tornado web server, this would be ideal but only half written)
    D) libtorrent
    -can't even start trying to use libtorrent since I can't get past the endless list of dependency after dependency after dependency after dependency
    -libtorrent - needto compile-get a compiler-install compiler-need boost - boost requires jam - install jam.msi -does nothing -install jam.python.msi -does nothing -try using bootstrap.bat to create jam -doesn't detect gcc-specify mgwin manually -builds -bjam does nothing when run
    -install precompiled boost -libtorrent still needs jam too apparently, -no jam included in precomplied boost
    -and even after that I no idea what where to specify $boostpath that libtorrent needs (is that the lib files or the jam path and shouldn't jam do something at some point?)
    E) the python-bittorrent-master library (it's python 2.x only and 5+ years old) just crashes every time it receives a client request since (I think?) it doesn't parse the peer_id from the request properly, and I have no idea how to fix that.

    Maybe I could...:
    1) So...Should I just learn python, php and C++ and then write a tracker from scratch with opentracker_mem/opentracker_php/libtorrent/Pytt/btspecification as sources on a Tornado web server? x.x I actually know C++, but not in a useful way. The only useful anythings I've ever written so far have been in .bat or .aux format since scripting is capable of being genuinely useful, unlike lower-level programing (reading/writing text and binary files directly instead of having to use external APIs to do even the simplest possible thing).

    2) I'm currently using qTorrent's embedded tracker, but that's 32-bit only and not suited for a PE style enviornment. Maybe I should just recompile qTorrent into x64... but the qTorrent people are linux people are thus inherently hostile towards anything involving windows or anything not in their *only and only one* legitimate use case...

    3) or can't I just embedded PHP into python somehow so I can package an existing announce.php script using python+Tornado with pyinstaller? x.x
  2. spunky120158

    spunky120158 MDL Novice

    Oct 5, 2015
    So let me get this straight you want to run a tracker from your house?
    You want to run it on your windows computer?
    Wouldnt you be better off using an open tracker to share your files? But if you really want to house one, I would suggest using a separate machine running a linux flavored server OS. I've been installing, writing, modifying trackers for over 10 years and one thing I have found is that most if not all the source codes I've worked with dont like Windows.
    You need
    A webserver, Apache is a great one.
    A recent version of PHP.
    and MySQL or similar for the database.
    these things seem to run better on Linux.
    Now if you're doing this on a small scale, just for a closed group of colleges I would suggest that for $50 a year.... rent some shared hosting.
    But if you really want it done from home, then get a linux machine.
    If you really really want to run it on windows... you must have XAMPP installed.
    Good luck
  3. YukinoAi

    YukinoAi MDL Novice

    Sep 5, 2015
    So I was looking for a lightweight windows tracker since it's for small scale deployments on LANs, needed for transferring very large files at the application layer (multicasting is so icky) using the bittorrent protocol. Ideally i'd small enough and with low-enough requirements to fit onto WinPE for deployment from-a-stick scenarios. OpenTracker on linux isn't a realistic option since then I'd need 2-3 computers/VMs for deployment instead of just 1-2.

    And yeah o.o Since I couldn't find one, I might have just finished writing one, for windows, that doesn't use php or mysql (database is an ephemeral multidimensional array) in python using the Tornado web server.

    I'll post the source code on github and compile it into .exe's later once I've finished adding a compact responses option, some other missing features and cleaned up the code a bit.
  4. YukinoAi

    YukinoAi MDL Novice

    Sep 5, 2015
    #4 YukinoAi, Oct 28, 2015
    Last edited by a moderator: Oct 28, 2015
  5. spunky120158

    spunky120158 MDL Novice

    Oct 5, 2015
    Thanks will check these out, dont know when I'll find time...but it should be soon.
  6. Bezalel

    Bezalel MDL Member

    Apr 30, 2012
    Why not use trackerless torrents? It sounds like your tracker isn't going to have a permanent address.
  7. YukinoAi

    YukinoAi MDL Novice

    Sep 5, 2015
    Remember that trackerless torrents still have to find peers. That is done either via 1) trackers, 2) DHT, 3) LPD or 4) PeerExchange.

    PeerExchange simply facilitates the distribution of peers. It is not able to perform the initial peer discovery (the important part).

    DHT is not appropriate for controlled LAN environments since clients tend to attempt form DHT connections to the internet. Torrents in those circumstances can hold proprietary information and so it is vital no information regarding the file transfer ever be made public (including the meta file).

    LPD works great! except that (besides being slow and finicky) it cannot cross broadcast domain boundaries. It would not be unreasonable to configure a dedicated seedbox on a separate vLAN and expect peers that can normally route to that vLAN to access that seeding peer. LPD would be insufficient to discover such a peer.

    Really what I needed was a tracker that could function inside of a controlled environment, transparently, that would work inside of WinPE. py3bt_tracker can do this. No other tracker software that I have come across can do this. Most other tracker software insists on having long-lived databases, blacklisting features, interaction with websites, doesn't have binaries available, requires external http servers, requires php etc.

    In terms of permanent address, routable addresses are assigned to hosts, not the software that runs on top of them. py3bt_tracker can run on a system with a static address or a dynamic one.

    I really meant this to be an ephemeral tracker, one brought up for a file transfer session, taken down afterwards, and never exposed publicly. In this usage scenario, the tracker's address would be known just long enough to create the torrent metafile, send the metafile to the clients and seed the chosen file(s).