]> git.ipfire.org Git - ipfire.org.git/commitdiff
Drop torrent tracker from webapp
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 12 Oct 2017 13:38:02 +0000 (14:38 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 12 Oct 2017 13:38:02 +0000 (14:38 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
templates/modules/tracker-peerlist.html [deleted file]
templates/tracker-torrent-detail.html [deleted file]
templates/tracker-torrents.html [deleted file]
webapp/__init__.py
webapp/ui_modules.py

diff --git a/templates/modules/tracker-peerlist.html b/templates/modules/tracker-peerlist.html
deleted file mode 100644 (file)
index ea89c98..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<table class="table table-striped">
-       <thead>
-               <tr>
-                       <th>&nbsp;</th>
-                       <th>Hostname</th>
-               </tr>
-       </thead>
-       <tbody>
-               {% for peer in peers %}
-                       <tr>
-                               <td>
-                                       <img src="{{ static_url("images/flags/" + peer.country_code + ".png") }}"
-                                               alt="{{ peer.country_code }}" />
-                                       {{ peer.ip }}
-                               </td>
-                               <td>{{ peer.hostname or "---" }}</td>
-                       </tr>
-               {% end %}
-       </tbody>
-</table>
diff --git a/templates/tracker-torrent-detail.html b/templates/tracker-torrent-detail.html
deleted file mode 100644 (file)
index 0bdff53..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-{% extends "base-1.html" %}
-
-{% block title %}{{ file.basename }} - {{ release.name }} - {{ _("Torrent download") }}{% end block %}
-
-{% block body %}
-       <div class="page-header">
-               <h1>
-                       {{ file.basename }}
-                       <small>{{ release.name }}</small>
-               </h1>
-       </div>
-
-       <p class="pull-right">
-               <a class="btn btn-default" href="{{ file.magnet_link }}">
-                       <i class="glyphicon glyphicon-magnet"></i> {{ _("Magnet link") }}
-               </a>
-               <a class="btn btn-default" href="http://tracker.ipfire.org/{{ file.torrent_hash }}/download">
-                       <i class="glyphicon glyphicon-download-alt"></i> {{ _("Torrent download") }}
-               </a>
-       </p>
-
-       {% if peers %}
-               <h3>{{ _("Peers & Seeds") }}</h3>
-               {% module TrackerPeerList(peers) %}
-       {% end %}
-{% end block %}
diff --git a/templates/tracker-torrents.html b/templates/tracker-torrents.html
deleted file mode 100644 (file)
index 96c03d7..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-{% extends "base-1.html" %}
-
-{% block title %}{{ _("Torrent Downloads") }}{% end block %}
-
-{% block body %}
-       <div class="page-header">
-               <h1>{{ _("IPFire Torrent Tracker") }}</h1>
-       </div>
-
-       {% if lang == "de" %}
-               <p>
-                       Dies ist der IPFire Torrent Tracker.
-               </p>
-               <p>
-                       Er wird für das verteilen der IPFire-Downloads gebraucht
-                       und tut das effizient mit Hilfe des Bittorrent-Protokols.
-               </p>
-       {% else %}
-               <p>
-                       This is the home of the IPFire torrent tracker.
-               </p>
-               <p>
-                       This tracker is used to distribute the IPFire
-                       downloads in an efficient way with help of the Bittorrent
-                       protocol.
-               </p>
-       {% end %}
-
-       <table class="table table-striped">
-               <thead>
-                       <tr>
-                               <th>{{ _("Release") }}</th>
-                               <th>{{ _("Seeders") }}</th>
-                               <th>{{ _("Peers") }}</th>
-                               <th>&nbsp;</th>
-                       </tr>
-               </thead>
-               <tbody>
-                       {% for release in releases %}
-                               <tr>
-                                       <td colspan="4">
-                                               <h3>{{ release.name }}</h3>
-                                       </td>
-                               </tr>
-
-                               {% for torrent in release.torrents %}
-                                       <tr>
-                                               <td>
-                                                       <a href="/{{ torrent.torrent_hash }}">{{ torrent.basename }}</a>
-                                               </td>
-                                               <td>
-                                                       {{ torrent.seeders }}
-                                               </td>
-                                               <td>
-                                                       {{ torrent.peers }}
-                                               </td>
-                                               <td>
-                                                       <a href="{{ torrent.magnet_link }}">
-                                                               <i class="glyphicon glyphicon-magnet"></i>
-                                                       </a>
-                                                       <a href="http://tracker.ipfire.org/{{ torrent.torrent_hash }}/download">
-                                                               <i class="glyphicon glyphicon-download-alt"></i>
-                                                       </a>
-                                               </td>
-                                       </tr>
-                               {% end %}
-                       {% end %}
-               </tbody>
-       </table>
-{% end block %}
index 07d2f1a862095612360bdb8cbd84a206f7aa14a9..874af6f53e5b0940388af0fefdfa65494c8a7c8e 100644 (file)
@@ -65,7 +65,6 @@ class Application(tornado.web.Application):
                                "TalkCallLog"          : TalkCallLogModule,
                                "TalkLines"            : TalkLinesModule,
                                "TalkOngoingCalls"     : TalkOngoingCallsModule,
-                               "TrackerPeerList"      : TrackerPeerListModule,
                                "Wish"                 : WishModule,
                                "Wishlist"             : WishlistModule,
                                "WishlistItems"        : WishlistItemsModule,
@@ -203,16 +202,6 @@ class Application(tornado.web.Application):
                        (r"/profile/([a-f0-9]{40})/([0-9]+).png", IUseImage),
                ])
 
-               # tracker.ipfire.org
-               self.add_handlers(r"(torrent|tracker)(\.dev)?\.ipfire\.org", [
-                       (r"/", TrackerIndexHandler),
-                       (r"/announce.*", TrackerAnnounceHandler),
-                       (r"/scrape", TrackerScrapeHandler),
-                       (r"/torrent/([0-9a-f]+)", TrackerDetailHandler),
-                       (r"/([0-9a-f]{40})", TrackerDetailHandler),
-                       (r"/([0-9a-f]{40})/download", TrackerDownloadHandler),
-               ] + static_handlers)
-
                # boot.ipfire.org
                BOOT_STATIC_PATH = os.path.join(self.settings["static_path"], "netboot")
                self.add_handlers(r"boot(\.dev)?\.ipfire\.org", [
index 1cedb4583e9d810f25e0fa6e5fab28d44330f99f..98f79ea08b9a23236f48ffa9d9c73723bb53114b 100644 (file)
@@ -375,25 +375,6 @@ class TalkOngoingCallsModule(UIModule):
                        account=account, channels=channels, debug=debug)
 
 
-class TrackerPeerListModule(UIModule):
-       def render(self, peers):
-               # Guess country code and hostname of the host
-               for peer in peers:
-                       country_code = self.geoip.get_country(peer["ip"])
-                       if country_code:
-                               peer["country_code"] = country_code.lower()
-                       else:
-                               peer["country_code"] = "unknown"
-
-                       try:
-                               peer["hostname"] = socket.gethostbyaddr(peer["ip"])[0]
-                       except:
-                               peer["hostname"] = ""
-
-               return self.render_string("modules/tracker-peerlist.html",
-                       peers=[backend.database.Row(p) for p in peers])
-
-
 class WishlistModule(UIModule):
        def render(self, wishes, short=False):
                return self.render_string("wishlist/modules/wishlist.html",