

What.cd's Gazelle on GitHub - hswolff
https://github.com/WhatCD/Gazelle

======
Spittie
They wrote a small announcement in their forum. For anyone that can't read it:

    
    
      This is an important change for Gazelle coders. You may have noticed that gazelle/ is now redirecting to http://whatcd.github.io/Gazelle/. 
      This is due to the fact that we are now hosting our public Gazelle repository on GitHub. 
      The old gazelle site had become severely outdated and a nuisance to maintain. 
      Luckily for us, GitHub is the perfect solution. 
      You can view our Gazelle repository here—it is accompanied by a GitHub page providing a brief overview of the project as well as a wiki with important information such as installation instructions, coding standards, and API documentation.

------
kurrepalt
Cool, it's like watching how people did PHP 4-5 years ago when there weren't
many frameworks available, and people used GLOBAL variables for accessing the
DB/cache.

~~~
wdewind
[https://github.com/WhatCD/Gazelle/blob/master/classes/wiki.c...](https://github.com/WhatCD/Gazelle/blob/master/classes/wiki.class.php)

Yeah, not to be negative, but it literally has SQL and HTML in one file. Ooof.

~~~
kurrepalt
Yes, the thing I also noted first was that it doesn't have any
bootstrap/router (only 'bootstrap' is the one that's included at the top of
each .php-file, wordpress-style). Development must have been pure pain. :(

I really understand why people hate PHP so much when all they get to see is
purely non-optimized shit. It generally has a really bad reputation which it
doesn't deserve. Especially in HN-circles.

~~~
wdewind
Yes I agree wholeheartedly. There are two very fair knocks against PHP: it's
not the fastest, and the API uses somewhat inconsistent standards and
conventions (isset vs. is_array for instance...so frustrating). But for the
slowness aspect, it's not so slow that you are really hindered by this unless
you are doing something that requires very intense performance, in which case
why are you using a higher level language anyway. Pretty much the rest of its
bad reputation is undeserved, and the downsides are on the level of give and
take you get with any other language.

------
calpaterson
If you want to start a bittorrent tracker but don't want to bother with all of
the trouble of things like Gazelle, you might like thehighseas, a
straightforward bittorrent tracker I wrote:

[https://github.com/calpaterson/thehighseas](https://github.com/calpaterson/thehighseas)

~~~
dewey
That's a different league though. Gazelle provides a lot more than just
listing torrents.

~~~
calpaterson
Absolutely, I just thought I'd mention it in case people want to get into
bittorrent but want an easier way to get started

------
daturkel
This might get passed off as something for people looking do to
evil/illegal/etc projects, but Gazelle is easily the best tracker front-end
out there and it's super customizable (google "Gazelle tracker" and you'll
likely find a bunch of screenshots of different sites implementing it
differently—from skinning it to adding new features). Bittorrent is underused
as a medium for legal downloads and I encourage anyone interested in a torrent
site of any kind to check this out before they try to write their own.

~~~
FZeroX
This is my go-to example of a cool legal* website running Gazelle:
[http://panda.cd/](http://panda.cd/)

If you know of any others please let me know!

* Not that the well-known ones are illegal either, really, but the point is slightly academic as they will still throw people in jail over it...

------
jzelinskie
There's pressure being put on Gazelle right now because Waffles and AnimeBytes
are writing a replacement called Batter[1] using Django. I've also been
working on a tracker in Go called Chihaya[2] that will replace Ocelot. I'm
glad they finally opening things up more, but it might be a bit too late. If
you're interested in working on a more modern rewrite of Gazelle's software
stack that has actual software development practices (continuous integration,
tests, style guidelines), check out the projects. Both projects are BSD 2
Clause, btw.

[1] [https://github.com/wafflesfm/batter](https://github.com/wafflesfm/batter)

[2] [https://github.com/pushrax/chihaya](https://github.com/pushrax/chihaya)

~~~
wcauchois
thanks for the links. i gotta say though, your indentation style on chihaya is
crackodactyl.

~~~
jzelinskie
It's only gofmt with lines <80 chars; there is a function call or two broken
into multiple lines to meet that. I'm scrapping that limit and just going to
make it as readable as possible. The real crazy thing is GitHub using 8 spaces
for tabs!

------
quchen
Could someone explain what this is?

~~~
aroch
'Gazelle' is the bittorrent tracker frontend developed by What.CD (For those
not in the know, one of the largest music trackers out there).

~~~
andrewflnr
So, what is a bittorrent tracker?

~~~
FZeroX
The tracker tells you who else has the files you want, in a nutshell.

Basic bittorrent outline:

You download a .torrent file which contains (amongst other things) a list of
files, their hashes, and a list of trackers to connect to.

Your BitTorrent client connects to the tracker and says "Hi, who else has or
is looking for these files"?

It returns a list of these people (aka "peers") and your BitTorrent client
then connects directly to peers to download the files (and upload them to
other people).

~~~
andrewflnr
And all this time I thought a torrent file had the actual peers in it. So you
don't even really need the .torrent if you have the addresses of some trackers
that know where the files are that you want?

~~~
nadaviv
You would also need the torrent's hash (which enable you to specify to the
tracker which files you want exactly). That's how magnet link [1] works - they
contain the torrent's hash and optionally a list of trackers (most clients
today support DHT [2], a decentralized tracker-less way to find peers).

[1]
[https://en.wikipedia.org/wiki/Magnet_URI_scheme](https://en.wikipedia.org/wiki/Magnet_URI_scheme)

[2]
[https://en.wikipedia.org/wiki/Distributed_hash_table](https://en.wikipedia.org/wiki/Distributed_hash_table)

------
dustywusty
This code's pretty riddled with SQL injection vulnerabilities. Can't imagine
anyone recommending use of this for new projects.

For a single instance,
[https://github.com/WhatCD/Gazelle/blob/master/sections/user/...](https://github.com/WhatCD/Gazelle/blob/master/sections/user/user.php)

The $UserId variable, which is used throughout the queries within this file,
is set by an unfiltered GET variable.

~~~
deeebug
Actually they check the $_GET['id'] variable, which is used to set the $UserId
variable. Check the top of the source:

if (empty($_GET['id']) || !is_numeric($_GET['id']) ||
(!empty($_GET['preview']) && !is_numeric($_GET['preview']))) {

------
FZeroX
I was an architect and coder on this project back at the very beginning and
for a few years after launch, if you have any questions about the code then
ask away :)

------
kbar13
not really sure why we're posting private trackers' projects, but here is
waffles.fm's:

[https://github.com/wafflesfm/batter](https://github.com/wafflesfm/batter)

~~~
antocv
Is waffels still going, are they accepting new members?

~~~
dewey
Yes and yes, but this is not the place to ask for invites.

~~~
foobarbazqux
Why not?

~~~
dewey
Because it's against their rules and the rules of pretty much all the other
private trackers too.

------
adamdavis
I remember working with gazelle for a torrent site for live Phish recordings.
Truly a terrifying code base.

------
dfrey
You must maintain a 0.4 ratio of pushes to pulls on github to use this
repository.

------
adPothier
Ocelot, their custom-made C++ tracker is a nice piece of code. They were
forced to drop out php-based and XBTT-based trackers some years ago when the
server load from their became huge peer swarm became unmanageable.

TorrentFreak made a great story about this[1].

[1] [http://torrentfreak.com/what-cd-debuts-lightweight-
tracker-f...](http://torrentfreak.com/what-cd-debuts-lightweight-tracker-for-
its-5-million-peers-101014/)

~~~
brass9
Is the ocelot code opensource? I'd be interested in it.

~~~
dewey
Yes, it's in the repository
([https://github.com/WhatCD/Gazelle/blob/master/ocelot-0.6.tar...](https://github.com/WhatCD/Gazelle/blob/master/ocelot-0.6.tar.bz2))

------
mjgoins
Not free (or "open source") from what I can tell.

    
    
      COPYRIGHTED AND PATENTED PENDING BY WHAT.CD INCORPORATED, 
      DBA/AKA PROJECT GAZELLE
    

Which is a bit confusing, but then later:

    
    
      FOR NONCOMMERCIAL PURPOSES ONLY

~~~
slacka
It was first released under the GPLv3 [http://torrentfreak.com/gazelle-
rejuvenates-the-bittorrent-t...](http://torrentfreak.com/gazelle-rejuvenates-
the-bittorrent-tracker-community-080828/)

You can view a mirror of the original release here:
[https://code.google.com/p/gazellewhatcd/](https://code.google.com/p/gazellewhatcd/)

~~~
sciurus
Looking at your link, I see
[https://code.google.com/p/gazellewhatcd/source/browse/trunk/...](https://code.google.com/p/gazellewhatcd/source/browse/trunk/COPYING.txt).

That isn't the GPLv3. That isn't even a free software license
([https://www.gnu.org/philosophy/free-
sw.html](https://www.gnu.org/philosophy/free-sw.html)), since they only grant
a license "FOR NONCOMMERCIAL PURPOSES".

------
brass9
I don't understand. Why is this on HN now? IIRC project Gazelle had been open-
sourced several years ago.

~~~
dewey
Because they just started to mirror their own git to GitHub and the
documentation is more accessible there than the internal wiki on a private
tracker.

