From ae5e99f0af64cd2dbc47de6e29b3346ad65751d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20Unneb=C3=A4ck?= Date: Sat, 25 Apr 2020 10:34:40 +0100 Subject: [PATCH 1/6] Use object shorthand for properties --- test/client-large-torrent.js | 2 +- test/client-magnet.js | 2 +- test/client-ws-socket-pool.js | 8 ++++---- test/client.js | 22 +++++++++++----------- test/destroy.js | 4 ++-- test/evict.js | 16 ++++++++-------- test/filter.js | 12 ++++++------ test/request-handler.js | 4 ++-- test/scrape.js | 4 ++-- test/server.js | 16 ++++++++-------- test/stats.js | 2 +- 11 files changed, 46 insertions(+), 46 deletions(-) diff --git a/test/client-large-torrent.js b/test/client-large-torrent.js index 00a62c21..7820216a 100644 --- a/test/client-large-torrent.js +++ b/test/client-large-torrent.js @@ -11,7 +11,7 @@ function testLargeTorrent (t, serverType) { common.createServer(t, serverType, function (server, announceUrl) { var client = new Client({ infoHash: fixtures.sintel.parsedTorrent.infoHash, - peerId: peerId, + peerId, port: 6881, announce: announceUrl, wrtc: {} diff --git a/test/client-magnet.js b/test/client-magnet.js index bb768eab..994473ee 100644 --- a/test/client-magnet.js +++ b/test/client-magnet.js @@ -15,7 +15,7 @@ function testMagnet (t, serverType) { var client = new Client({ infoHash: parsedTorrent.infoHash, announce: announceUrl, - peerId: peerId, + peerId, port: 6881, wrtc: {} }) diff --git a/test/client-ws-socket-pool.js b/test/client-ws-socket-pool.js index a87619f9..04ed642c 100644 --- a/test/client-ws-socket-pool.js +++ b/test/client-ws-socket-pool.js @@ -13,8 +13,8 @@ test('ensure client.destroy() callback is called with re-used websockets in sock var client1 = new Client({ infoHash: fixtures.leaves.parsedTorrent.infoHash, announce: announceUrl, - peerId: peerId, - port: port, + peerId, + port, wrtc: {} }) @@ -30,8 +30,8 @@ test('ensure client.destroy() callback is called with re-used websockets in sock var client2 = new Client({ infoHash: fixtures.alice.parsedTorrent.infoHash, // different info hash announce: announceUrl, - peerId: peerId, - port: port, + peerId, + port, wrtc: {} }) diff --git a/test/client.js b/test/client.js index e622c1ab..f1c8cef3 100644 --- a/test/client.js +++ b/test/client.js @@ -16,7 +16,7 @@ function testClientStart (t, serverType) { infoHash: fixtures.leaves.parsedTorrent.infoHash, announce: announceUrl, peerId: peerId1, - port: port, + port, wrtc: {} }) @@ -62,7 +62,7 @@ function testClientStop (t, serverType) { infoHash: fixtures.leaves.parsedTorrent.infoHash, announce: announceUrl, peerId: peerId1, - port: port, + port, wrtc: {} }) @@ -110,7 +110,7 @@ function testClientStopDestroy (t, serverType) { infoHash: fixtures.leaves.parsedTorrent.infoHash, announce: announceUrl, peerId: peerId1, - port: port, + port, wrtc: {} }) @@ -164,7 +164,7 @@ function testClientUpdate (t, serverType) { infoHash: fixtures.leaves.parsedTorrent.infoHash, announce: announceUrl, peerId: peerId1, - port: port, + port, wrtc: {} }) @@ -217,7 +217,7 @@ function testClientScrape (t, serverType) { infoHash: fixtures.leaves.parsedTorrent.infoHash, announce: announceUrl, peerId: peerId1, - port: port, + port, wrtc: {} }) @@ -259,7 +259,7 @@ function testClientAnnounceWithParams (t, serverType) { infoHash: fixtures.leaves.parsedTorrent.infoHash, announce: announceUrl, peerId: peerId1, - port: port, + port, wrtc: {} }) @@ -307,7 +307,7 @@ function testClientGetAnnounceOpts (t, serverType) { infoHash: fixtures.leaves.parsedTorrent.infoHash, announce: announceUrl, peerId: peerId1, - port: port, + port, getAnnounceOpts: function () { return { testParam: 'this is a test' @@ -358,7 +358,7 @@ function testClientAnnounceWithNumWant (t, serverType) { infoHash: fixtures.leaves.parsedTorrent.infoHash, announce: [announceUrl], peerId: peerId1, - port: port, + port, wrtc: {} }) @@ -449,7 +449,7 @@ test('http: userAgent', function (t) { infoHash: fixtures.leaves.parsedTorrent.infoHash, announce: announceUrl, peerId: peerId1, - port: port, + port, userAgent: 'WebTorrent/0.98.0 (https://webtorrent.io)', wrtc: {} }) @@ -476,7 +476,7 @@ function testSupportedTracker (t, serverType) { infoHash: fixtures.leaves.parsedTorrent.infoHash, announce: announceUrl, peerId: peerId1, - port: port, + port, wrtc: {} }) @@ -514,7 +514,7 @@ function testUnsupportedTracker (t, announceUrl) { infoHash: fixtures.leaves.parsedTorrent.infoHash, announce: announceUrl, peerId: peerId1, - port: port, + port, wrtc: {} }) diff --git a/test/destroy.js b/test/destroy.js index 5437b8ac..57aa0b9b 100644 --- a/test/destroy.js +++ b/test/destroy.js @@ -13,8 +13,8 @@ function testNoEventsAfterDestroy (t, serverType) { var client = new Client({ infoHash: fixtures.leaves.parsedTorrent.infoHash, announce: announceUrl, - peerId: peerId, - port: port, + peerId, + port, wrtc: {} }) diff --git a/test/evict.js b/test/evict.js index 3cab3a76..196a8f28 100644 --- a/test/evict.js +++ b/test/evict.js @@ -16,7 +16,7 @@ function serverTest (t, serverType, serverFamily) { : '127.0.0.1' var opts = { - serverType: serverType, + serverType, peersCacheLength: 2 // LRU cache can only contain a max of 2 peers } @@ -27,11 +27,11 @@ function serverTest (t, serverType, serverFamily) { var announceUrl = serverType + '://' + hostname + ':' + port + '/announce' var client1 = new Client({ - infoHash: infoHash, + infoHash, announce: [announceUrl], - peerId: peerId, + peerId, port: 6881, - wrtc: wrtc + wrtc }) if (serverType === 'ws') common.mockWebsocketTracker(client1) @@ -39,11 +39,11 @@ function serverTest (t, serverType, serverFamily) { client1.once('update', function (data) { var client2 = new Client({ - infoHash: infoHash, + infoHash, announce: [announceUrl], peerId: peerId2, port: 6882, - wrtc: wrtc + wrtc }) if (serverType === 'ws') common.mockWebsocketTracker(client2) @@ -64,11 +64,11 @@ function serverTest (t, serverType, serverFamily) { }) var client3 = new Client({ - infoHash: infoHash, + infoHash, announce: [announceUrl], peerId: peerId3, port: 6880, - wrtc: wrtc + wrtc }) if (serverType === 'ws') common.mockWebsocketTracker(client3) diff --git a/test/filter.js b/test/filter.js index 395e2336..386f17a7 100644 --- a/test/filter.js +++ b/test/filter.js @@ -8,7 +8,7 @@ var peerId = Buffer.from('01234567890123456789') function testFilterOption (t, serverType) { t.plan(8) - var opts = { serverType: serverType } // this is test-suite-only option + var opts = { serverType } // this is test-suite-only option opts.filter = function (infoHash, params, cb) { process.nextTick(function () { if (infoHash === fixtures.alice.parsedTorrent.infoHash) { @@ -23,7 +23,7 @@ function testFilterOption (t, serverType) { var client1 = new Client({ infoHash: fixtures.alice.parsedTorrent.infoHash, announce: announceUrl, - peerId: peerId, + peerId, port: 6881, wrtc: {} }) @@ -40,7 +40,7 @@ function testFilterOption (t, serverType) { var client2 = new Client({ infoHash: fixtures.leaves.parsedTorrent.infoHash, announce: announceUrl, - peerId: peerId, + peerId, port: 6881, wrtc: {} }) @@ -88,7 +88,7 @@ test('ws: filter option blocks tracker from tracking torrent', function (t) { function testFilterCustomError (t, serverType) { t.plan(8) - var opts = { serverType: serverType } // this is test-suite-only option + var opts = { serverType } // this is test-suite-only option opts.filter = function (infoHash, params, cb) { process.nextTick(function () { if (infoHash === fixtures.alice.parsedTorrent.infoHash) { @@ -103,7 +103,7 @@ function testFilterCustomError (t, serverType) { var client1 = new Client({ infoHash: fixtures.alice.parsedTorrent.infoHash, announce: announceUrl, - peerId: peerId, + peerId, port: 6881, wrtc: {} }) @@ -119,7 +119,7 @@ function testFilterCustomError (t, serverType) { var client2 = new Client({ infoHash: fixtures.leaves.parsedTorrent.infoHash, announce: announceUrl, - peerId: peerId, + peerId, port: 6881, wrtc: {} }) diff --git a/test/request-handler.js b/test/request-handler.js index d825a31e..a9e1fa37 100644 --- a/test/request-handler.js +++ b/test/request-handler.js @@ -9,7 +9,7 @@ var peerId = Buffer.from('01234567890123456789') function testRequestHandler (t, serverType) { t.plan(5) - var opts = { serverType: serverType } // this is test-suite-only option + var opts = { serverType } // this is test-suite-only option class Swarm extends Server.Swarm { announce (params, cb) { @@ -33,7 +33,7 @@ function testRequestHandler (t, serverType) { var client1 = new Client({ infoHash: fixtures.alice.parsedTorrent.infoHash, announce: announceUrl, - peerId: peerId, + peerId, port: 6881, wrtc: {} }) diff --git a/test/scrape.js b/test/scrape.js index b372ec2d..08bf9b79 100644 --- a/test/scrape.js +++ b/test/scrape.js @@ -14,7 +14,7 @@ function testSingle (t, serverType) { var client = new Client({ infoHash: fixtures.leaves.parsedTorrent.infoHash, announce: announceUrl, - peerId: peerId, + peerId, port: 6881, wrtc: {} }) @@ -199,7 +199,7 @@ test('server: all info_hash scrape (manual http request)', function (t) { var client = new Client({ infoHash: fixtures.leaves.parsedTorrent.infoHash, announce: announceUrl, - peerId: peerId, + peerId, port: 6881 }) client.on('error', function (err) { t.error(err) }) diff --git a/test/server.js b/test/server.js index ae3d956a..98576a0c 100644 --- a/test/server.js +++ b/test/server.js @@ -19,7 +19,7 @@ function serverTest (t, serverType, serverFamily) { : '127.0.0.1' var opts = { - serverType: serverType + serverType } common.createServer(t, opts, function (server) { @@ -29,11 +29,11 @@ function serverTest (t, serverType, serverFamily) { var announceUrl = serverType + '://' + hostname + ':' + port + '/announce' var client1 = new Client({ - infoHash: infoHash, + infoHash, announce: [announceUrl], - peerId: peerId, + peerId, port: 6881, - wrtc: wrtc + wrtc }) if (serverType === 'ws') common.mockWebsocketTracker(client1) @@ -89,11 +89,11 @@ function serverTest (t, serverType, serverFamily) { t.equal(typeof data.downloaded, 'number') var client2 = new Client({ - infoHash: infoHash, + infoHash, announce: [announceUrl], peerId: peerId2, port: 6882, - wrtc: wrtc + wrtc }) if (serverType === 'ws') common.mockWebsocketTracker(client2) @@ -109,11 +109,11 @@ function serverTest (t, serverType, serverFamily) { t.equal(data.incomplete, 1) var client3 = new Client({ - infoHash: infoHash, + infoHash, announce: [announceUrl], peerId: peerId3, port: 6880, - wrtc: wrtc + wrtc }) if (serverType === 'ws') common.mockWebsocketTracker(client3) diff --git a/test/stats.js b/test/stats.js index 5b14f81b..0cedc485 100644 --- a/test/stats.js +++ b/test/stats.js @@ -120,7 +120,7 @@ test('server: get leecher stats.json', function (t) { var client = new Client({ infoHash: fixtures.leaves.parsedTorrent.infoHash, announce: announceUrl, - peerId: peerId, + peerId, port: 6881 }) client.on('error', function (err) { t.error(err) }) From 3f6350024aae31cc44436323d055ab834eb671c3 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" <23040076+greenkeeper[bot]@users.noreply.github.com> Date: Fri, 15 May 2020 18:22:22 +0000 Subject: [PATCH 2/6] fix(package): update simple-get to version 4.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2d1be7ba..af918cd2 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "randombytes": "^2.1.0", "run-parallel": "^1.1.9", "run-series": "^1.1.8", - "simple-get": "^3.1.0", + "simple-get": "^4.0.0", "simple-peer": "^9.7.1", "simple-websocket": "^8.1.1", "string2compact": "^1.3.0", From 3c810b4ace9e643565d44a3abfc5b96a7ead692e Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sun, 17 May 2020 12:38:45 -0700 Subject: [PATCH 3/6] 9.15.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index af918cd2..fdfc1c7d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "bittorrent-tracker", "description": "Simple, robust, BitTorrent tracker (client & server) implementation", - "version": "9.14.5", + "version": "9.15.0", "author": { "name": "WebTorrent, LLC", "email": "feross@webtorrent.io", From 01204765a501eb8f88bdb6fd44b327ae9735d771 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sun, 17 May 2020 12:38:45 -0700 Subject: [PATCH 4/6] update authors --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index 904c5d34..acf8e9f7 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -49,5 +49,6 @@ - Eric Guan (guanzo91@gmail.com) - Koushik Dutta (koush@koushikdutta.com) - KayleePop (34007889+KayleePop@users.noreply.github.com) +- Diego Rodriguez Baquero (diego.baquero@pager.com) #### Generated by tools/update-authors.sh. From 695a399568d5f3d3dc08ae6fc2c31079b278522d Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sun, 17 May 2020 12:38:46 -0700 Subject: [PATCH 5/6] package metadata --- index.js | 1 + package.json | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 1e7f2a45..de5d73c7 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,4 @@ +/*! bittorrent-tracker. MIT License. WebTorrent LLC */ const Client = require('./client') const Server = require('./server') diff --git a/package.json b/package.json index fdfc1c7d..7f3e09d0 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "Simple, robust, BitTorrent tracker (client & server) implementation", "version": "9.15.0", "author": { - "name": "WebTorrent, LLC", + "name": "WebTorrent LLC", "email": "feross@webtorrent.io", "url": "https://webtorrent.io" }, @@ -78,5 +78,19 @@ "scripts": { "test": "standard && tape test/*.js", "update-authors": "./tools/update-authors.sh" - } + }, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] } From 8c30e9d8d4ac8ded05a7b90fd583529de2f3181e Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" <23040076+greenkeeper[bot]@users.noreply.github.com> Date: Sun, 17 May 2020 19:40:53 +0000 Subject: [PATCH 6/6] fix(package): update simple-websocket to version 9.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7f3e09d0..fe7d8a3b 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "run-series": "^1.1.8", "simple-get": "^4.0.0", "simple-peer": "^9.7.1", - "simple-websocket": "^8.1.1", + "simple-websocket": "^9.0.0", "string2compact": "^1.3.0", "unordered-array-remove": "^1.0.2", "ws": "^7.3.0"