From 0aa13e2da1fa253e3843479841d3d39c5ffd69eb Mon Sep 17 00:00:00 2001 From: DimaDemchenko Date: Thu, 15 Feb 2024 11:46:28 +0200 Subject: [PATCH 1/5] readme --- README.md | 43 ++++++++++++++++++++++--------------------- travis.yml | 1 + 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 7dfd49e..74fae18 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,30 @@ -[![Build Status](https://travis-ci.org/Novage/wt-tracker.svg?branch=master)](https://travis-ci.org/Novage/wt-tracker) [![Coverage Status](https://coveralls.io/repos/github/Novage/wt-tracker/badge.svg?branch=master)](https://coveralls.io/github/Novage/wt-tracker?branch=master) + # wt-tracker + High-performance WebTorrent tracker. WebTorrent tracker is a required component of [WebTorrent](https://github.com/webtorrent/webtorrent) and [P2P Media Loader](https://github.com/Novage/p2p-media-loader) (peer-to-peer networks for web browsers) to do [WebRTC](https://en.wikipedia.org/wiki/WebRTC) signaling - exchanging connection data (i.e. [SDP](https://en.wikipedia.org/wiki/Session_Description_Protocol)) between peers - joining them into swarms. ## Features -* handles more than 40k WebSocket Secure (HTTPS) peers on a VPS with only 2 GiB memory and 1 virtual CPU thanks to [uWebSockets.js](https://github.com/uNetworking/uWebSockets.js) I/O backend and perfomance optimizations in the code -* handles ws:// (HTTP) and wss:// (HTTPS) connections simultaneously -* IPv4 and IPv6 support -* robust and well-tested: CI, unit tests, static code analyzis, 100% TypeScript -* supports tracker "scrape" extension -* statistics under /stats.json URL +- handles more than 40k WebSocket Secure (HTTPS) peers on a VPS with only 2 GiB memory and 1 virtual CPU thanks to [uWebSockets.js](https://github.com/uNetworking/uWebSockets.js) I/O backend and perfomance optimizations in the code +- handles ws:// (HTTP) and wss:// (HTTPS) connections simultaneously +- IPv4 and IPv6 support +- robust and well-tested: CI, unit tests, static code analyzis, 100% TypeScript +- supports tracker "scrape" extension +- statistics under /stats.json URL ## Related projects -* [P2P Media Loader](https://github.com/Novage/p2p-media-loader) - an open-source engine for P2P streaming of live and on demand video directly in a web browser HTML page -* [Novage, LLC](https://novage.com.ua/) - P2P development, support & consulting -* [WebTorrent](https://github.com/webtorrent/webtorrent) - streaming torrent client for the web https://webtorrent.io -* [uWebSockets.js](https://github.com/uNetworking/uWebSockets.js) - the Node.js bindings to µWebSockets, one of the most efficient web servers available +- [P2P Media Loader](https://github.com/Novage/p2p-media-loader) - an open-source engine for P2P streaming of live and on demand video directly in a web browser HTML page +- [Novage, LLC](https://novage.com.ua/) - P2P development, support & consulting +- [WebTorrent](https://github.com/webtorrent/webtorrent) - streaming torrent client for the web https://webtorrent.io +- [uWebSockets.js](https://github.com/uNetworking/uWebSockets.js) - the Node.js bindings to µWebSockets, one of the most efficient web servers available ## Build instructions -Node.js 10+ is required. +Node.js 16, 18 or 20 is required. ```sh npm install @@ -52,15 +53,15 @@ npm start [config.json] See [config.json](sample/config.json) -|Name|Type|Description| -|----|----|-----------| -|servers.websockets.path|string|URL pattern for the WebSockets endpoint| -|servers.websockets.maxPayloadLength|number|The maximum length of received message| -|servers.websockets.midleTimeout|number|The maximum amount of seconds that may pass without sending or getting a message. Being idle for more than this, and the connection is severed.| -|servers.websockets.compression|0,1,2|0 = no compression, 1 = shared compressor, 2 = dedicated compressor (see [details](https://github.com/uNetworking/uWebSockets/blob/master/misc/READMORE.md#settings))| -|servers.websockets.maxConnections|number|The maximum number of WebSocket connections. 0 = no limit.| -|tracker.maxOffers|number|The maximum number of client's WebRTC SDP offers that are processed| -|tracker.announceInterval|number|Desired announce interval in seconds required from the clients| +| Name | Type | Description | +| ----------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| servers.websockets.path | string | URL pattern for the WebSockets endpoint | +| servers.websockets.maxPayloadLength | number | The maximum length of received message | +| servers.websockets.midleTimeout | number | The maximum amount of seconds that may pass without sending or getting a message. Being idle for more than this, and the connection is severed. | +| servers.websockets.compression | 0,1,2 | 0 = no compression, 1 = shared compressor, 2 = dedicated compressor (see [details](https://github.com/uNetworking/uWebSockets/blob/master/misc/READMORE.md#settings)) | +| servers.websockets.maxConnections | number | The maximum number of WebSocket connections. 0 = no limit. | +| tracker.maxOffers | number | The maximum number of client's WebRTC SDP offers that are processed | +| tracker.announceInterval | number | Desired announce interval in seconds required from the clients | ## Index HTML page diff --git a/travis.yml b/travis.yml index 8d972a6..ca55c85 100644 --- a/travis.yml +++ b/travis.yml @@ -2,6 +2,7 @@ language: node_js node_js: - 20 - 18 + - 16 install: - npm install script: From 9eccf9bd8f727802a7b5cf27cfcc904133e62641 Mon Sep 17 00:00:00 2001 From: Andriy Lysnevych Date: Thu, 15 Feb 2024 15:47:52 +0200 Subject: [PATCH 2/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 74fae18..5ec36f4 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ WebTorrent tracker is a required component of [WebTorrent](https://github.com/we ## Build instructions -Node.js 16, 18 or 20 is required. +Node.js 16+ is required. ```sh npm install From a3ee18e74d902d535ee5fe7d061ad8b886cf9649 Mon Sep 17 00:00:00 2001 From: Andriy Lysnevych Date: Thu, 15 Feb 2024 15:49:49 +0200 Subject: [PATCH 3/5] Update travis.yml --- travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/travis.yml b/travis.yml index ca55c85..f27f5ff 100644 --- a/travis.yml +++ b/travis.yml @@ -1,5 +1,6 @@ language: node_js node_js: + - 21 - 20 - 18 - 16 From 1e8916c175866d196bda90160882ca0cb9eee77f Mon Sep 17 00:00:00 2001 From: Andriy Lysnevych Date: Thu, 15 Feb 2024 16:08:23 +0200 Subject: [PATCH 4/5] Update package.json lock --- package-lock.json | 16 ++++++++-------- package.json | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index a228f9b..88d13c7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "@types/chai": "^4.3.11", "@types/debug": "^4.1.12", "@types/mocha": "^10.0.6", - "@types/node": "^20.11.17", + "@types/node": "^20.11.18", "@types/ws": "^8.5.10", "@typescript-eslint/eslint-plugin": "^7.0.1", "@typescript-eslint/parser": "^7.0.1", @@ -33,7 +33,7 @@ "ws": "^8.16.0" }, "engines": { - "node": ">=10.0.0" + "node": ">=16.0.0" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -988,9 +988,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.11.17", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.17.tgz", - "integrity": "sha512-QmgQZGWu1Yw9TDyAP9ZzpFJKynYNeOvwMJmaxABfieQoVoiVOS6MN1WSpqpRcbeA5+RW82kraAVxCCJg+780Qw==", + "version": "20.11.18", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.18.tgz", + "integrity": "sha512-ABT5VWnnYneSBcNWYSCuR05M826RoMyMSGiFivXGx6ZUIsXb9vn4643IEwkg2zbEOSgAiSogtapN2fgc4mAPlw==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -3527,9 +3527,9 @@ } }, "node_modules/vite": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.1.2.tgz", - "integrity": "sha512-uwiFebQbTWRIGbCaTEBVAfKqgqKNKMJ2uPXsXeLIZxM8MVMjoS3j0cG8NrPxdDIadaWnPSjrkLWffLSC+uiP3Q==", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.1.3.tgz", + "integrity": "sha512-UfmUD36DKkqhi/F75RrxvPpry+9+tTkrXfMNZD+SboZqBCMsxKtO52XeGzzuh7ioz+Eo/SYDBbdb0Z7vgcDJew==", "dev": true, "dependencies": { "esbuild": "^0.19.3", diff --git a/package.json b/package.json index d7c3cb3..9c4458b 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "types": "dist/index.d.ts", "type": "module", "engines": { - "node": ">=10.0.0" + "node": ">=16.0.0" }, "bin": { "wt-tracker": "./bin/wt-tracker" @@ -49,7 +49,7 @@ "@types/chai": "^4.3.11", "@types/debug": "^4.1.12", "@types/mocha": "^10.0.6", - "@types/node": "^20.11.17", + "@types/node": "^20.11.18", "@types/ws": "^8.5.10", "@typescript-eslint/eslint-plugin": "^7.0.1", "@typescript-eslint/parser": "^7.0.1", From 7cf412dd89daa67af5b878a886512d5b32f5eccc Mon Sep 17 00:00:00 2001 From: Andriy Lysnevych Date: Thu, 15 Feb 2024 16:18:51 +0200 Subject: [PATCH 5/5] Add PR workflow --- .github/workflows/{coveralls.yml => main.yml} | 4 ++-- .github/workflows/pr.yml | 23 +++++++++++++++++++ travis.yml | 13 ----------- 3 files changed, 25 insertions(+), 15 deletions(-) rename .github/workflows/{coveralls.yml => main.yml} (90%) create mode 100644 .github/workflows/pr.yml delete mode 100644 travis.yml diff --git a/.github/workflows/coveralls.yml b/.github/workflows/main.yml similarity index 90% rename from .github/workflows/coveralls.yml rename to .github/workflows/main.yml index b52a4e7..0d7cc50 100644 --- a/.github/workflows/coveralls.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: Tests +name: Build & Test main on: push: @@ -15,7 +15,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v3 with: - node-version: "18" + node-version: "20" - name: Install dependencies run: npm install diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..8941e11 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,23 @@ +name: Build & Test PR + +on: + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: "20" + + - name: Install dependencies + run: npm install + + - name: Run tests + run: npm run test:coverage diff --git a/travis.yml b/travis.yml deleted file mode 100644 index f27f5ff..0000000 --- a/travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -language: node_js -node_js: - - 21 - - 20 - - 18 - - 16 -install: - - npm install -script: - - npm run build - - npm test -after_success: - - npm run test:coveralls