From: Michael Tremer Date: Thu, 12 Oct 2017 13:38:02 +0000 (+0100) Subject: Drop torrent tracker from webapp X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4856b93797f1c1f5538a8e20a3088f433a709bc9;p=ipfire.org.git Drop torrent tracker from webapp Signed-off-by: Michael Tremer --- diff --git a/templates/modules/tracker-peerlist.html b/templates/modules/tracker-peerlist.html deleted file mode 100644 index ea89c982..00000000 --- a/templates/modules/tracker-peerlist.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - {% for peer in peers %} - - - - - {% end %} - -
 Hostname
- {{ peer.country_code }} - {{ peer.ip }} - {{ peer.hostname or "---" }}
diff --git a/templates/tracker-torrent-detail.html b/templates/tracker-torrent-detail.html deleted file mode 100644 index 0bdff532..00000000 --- a/templates/tracker-torrent-detail.html +++ /dev/null @@ -1,26 +0,0 @@ -{% extends "base-1.html" %} - -{% block title %}{{ file.basename }} - {{ release.name }} - {{ _("Torrent download") }}{% end block %} - -{% block body %} - - -

- - {{ _("Magnet link") }} - - - {{ _("Torrent download") }} - -

- - {% if peers %} -

{{ _("Peers & Seeds") }}

- {% module TrackerPeerList(peers) %} - {% end %} -{% end block %} diff --git a/templates/tracker-torrents.html b/templates/tracker-torrents.html deleted file mode 100644 index 96c03d7d..00000000 --- a/templates/tracker-torrents.html +++ /dev/null @@ -1,70 +0,0 @@ -{% extends "base-1.html" %} - -{% block title %}{{ _("Torrent Downloads") }}{% end block %} - -{% block body %} - - - {% if lang == "de" %} -

- Dies ist der IPFire Torrent Tracker. -

-

- Er wird für das verteilen der IPFire-Downloads gebraucht - und tut das effizient mit Hilfe des Bittorrent-Protokols. -

- {% else %} -

- This is the home of the IPFire torrent tracker. -

-

- This tracker is used to distribute the IPFire - downloads in an efficient way with help of the Bittorrent - protocol. -

- {% end %} - - - - - - - - - - - - {% for release in releases %} - - - - - {% for torrent in release.torrents %} - - - - - - - {% end %} - {% end %} - -
{{ _("Release") }}{{ _("Seeders") }}{{ _("Peers") }} 
-

{{ release.name }}

-
- {{ torrent.basename }} - - {{ torrent.seeders }} - - {{ torrent.peers }} - - - - - - - -
-{% end block %} diff --git a/webapp/__init__.py b/webapp/__init__.py index 07d2f1a8..874af6f5 100644 --- a/webapp/__init__.py +++ b/webapp/__init__.py @@ -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", [ diff --git a/webapp/ui_modules.py b/webapp/ui_modules.py index 1cedb458..98f79ea0 100644 --- a/webapp/ui_modules.py +++ b/webapp/ui_modules.py @@ -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",