Skip to content
This repository was archived by the owner on Apr 24, 2023. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: libp2p/js-libp2p-webrtc-star
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 590c5fc36a62631a0b0d102b56d60c091906c31c
Choose a base ref
...
head repository: libp2p/js-libp2p-webrtc-star
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 9dc6899250d85003de21a094c231ffea3a378dfe
Choose a head ref
  • 10 commits
  • 46 files changed
  • 3 contributors

Commits on Aug 23, 2021

  1. Copy the full SHA
    b4e4180 View commit details

Commits on Sep 28, 2021

  1. feat: make into monorepo (#376)

    Splits transport and server out into separate packages to reduce the
    amount of time it takes to install the transport when you don't need
    the server.
    
    BREAKING CHANGE: The transport module no longer includes the signalling server
    achingbrain authored Sep 28, 2021
    Copy the full SHA
    8c7f5de View commit details
  2. chore: upgrade to GitHub-native Dependabot (#339)

    Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
    Co-authored-by: Alex Potsides <alex@achingbrain.net>
    dependabot-preview[bot] and achingbrain authored Sep 28, 2021
    Copy the full SHA
    845b40d View commit details
  3. chore: create prerelease

    achingbrain committed Sep 28, 2021
    Copy the full SHA
    57ad848 View commit details
  4. chore: publish

     - libp2p-webrtc-star-signalling-server@0.1.0
     - libp2p-webrtc-star@0.24.0
    achingbrain committed Sep 28, 2021
    Copy the full SHA
    39ea3b2 View commit details
  5. Copy the full SHA
    0d5bad4 View commit details

Commits on Nov 30, 2021

  1. chore: update deps (#386)

    Pulls in updated prom-client which has less CPU usage
    achingbrain authored Nov 30, 2021
    Copy the full SHA
    e2683bd View commit details
  2. chore: publish

     - libp2p-webrtc-star-signalling-server@0.1.1
     - libp2p-webrtc-star@0.24.1
    achingbrain committed Nov 30, 2021
    Copy the full SHA
    22ffd5c View commit details

Commits on Dec 2, 2021

  1. chore: update to new peer-id and libp2p-crypto (#387)

    BREAKING CHANGE: requires node 15+
    achingbrain authored Dec 2, 2021
    Copy the full SHA
    28db4a0 View commit details
  2. chore: publish

     - libp2p-webrtc-star-signalling-server@0.1.2
     - libp2p-webrtc-star@0.25.0
    achingbrain committed Dec 2, 2021
    Copy the full SHA
    9dc6899 View commit details
Showing with 914 additions and 314 deletions.
  1. +8 −0 .github/dependabot.yml
  2. +176 −25 .github/workflows/main.yml
  3. +5 −5 Dockerfile
  4. +5 −0 LICENSE-APACHE
  5. +4 −6 LICENSE → LICENSE-MIT
  6. +14 −118 README.md
  7. +25 −0 lerna.json
  8. +26 −100 package.json
  9. +1 −1 { → packages/signalling-server}/.aegir.js
  10. +40 −0 packages/signalling-server/CHANGELOG.md
  11. 0 { → packages/signalling-server}/DEPLOYMENT.md
  12. +5 −0 packages/signalling-server/LICENSE-APACHE
  13. +19 −0 packages/signalling-server/LICENSE-MIT
  14. +62 −0 packages/signalling-server/README.md
  15. +86 −0 packages/signalling-server/package.json
  16. 0 {src/sig-server → packages/signalling-server/src}/bin.js
  17. 0 {src/sig-server → packages/signalling-server/src}/config.js
  18. 0 {src/sig-server → packages/signalling-server/src}/index.html
  19. 0 {src/sig-server → packages/signalling-server/src}/index.js
  20. 0 {src/sig-server → packages/signalling-server/src}/routes-ws/index.js
  21. +52 −0 packages/signalling-server/test/node.js
  22. +1 −1 { → packages/signalling-server}/test/sig-server.js
  23. +46 −0 packages/transport/.aegir.js
  24. +53 −3 { → packages/transport}/CHANGELOG.md
  25. +62 −0 packages/transport/DEPLOYMENT.md
  26. +5 −0 packages/transport/LICENSE-APACHE
  27. +19 −0 packages/transport/LICENSE-MIT
  28. +101 −0 packages/transport/README.md
  29. +93 −0 packages/transport/package.json
  30. 0 { → packages/transport}/src/constants.js
  31. 0 { → packages/transport}/src/index.js
  32. 0 { → packages/transport}/src/listener.js
  33. 0 { → packages/transport}/src/socket-to-conn.js
  34. 0 { → packages/transport}/src/utils.js
  35. 0 { → packages/transport}/test/browser.js
  36. +2 −2 { → packages/transport}/test/compliance.spec.js
  37. +0 −49 { → packages/transport}/test/node.js
  38. +3 −3 { → packages/transport}/test/transport/dial.js
  39. 0 { → packages/transport}/test/transport/discovery.js
  40. 0 { → packages/transport}/test/transport/filter.js
  41. 0 { → packages/transport}/test/transport/instance.spec.js
  42. 0 { → packages/transport}/test/transport/listen.js
  43. 0 { → packages/transport}/test/transport/multiple-signal-servers.js
  44. +1 −1 { → packages/transport}/test/transport/reconnect.node.js
  45. 0 { → packages/transport}/test/transport/track.js
  46. 0 { → packages/transport}/test/utils.spec.js
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
time: "11:00"
open-pull-requests-limit: 10
201 changes: 176 additions & 25 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,200 @@
name: ci
name: Test
on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:

build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
- uses: actions/cache@v2
id: cache
env:
CACHE_NAME: cache-node-modules
with:
path: |
~/.npm
./node_modules
./packages/*/node_modules
./packages/*/dist
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm install
npm run build --if-present
npm run link --if-present
check:
name: Check
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm install
- run: npx aegir lint
- run: npx aegir dep-check -- -i wrtc -i electron-webrtc
- run: npx aegir build --no-types
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: lts/*
- uses: actions/cache@v2
id: cache
env:
CACHE_NAME: cache-node-modules
with:
path: |
~/.npm
./node_modules
./packages/*/node_modules
./packages/*/dist
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm install
npm run build --if-present
npm run link --if-present
- run: |
npm run lint
npm run dep-check -- -- -- -p
npm run dep-check -- -- -- -- --unused
test-node:
needs: check
name: Unit tests ${{ matrix.project }} node ${{ matrix.node }} ${{ matrix.os }}
needs: build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
node: [14, 16]
fail-fast: true
node: [16]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- run: npm install @mapbox/node-pre-gyp -g
- run: npm install
- run: npm run test:node -- --cov --bail
- uses: codecov/codecov-action@v1
test-chrome:
needs: check
- uses: actions/cache@v2
id: cache
env:
CACHE_NAME: cache-node-modules
with:
path: |
~/.npm
./node_modules
./packages/*/node_modules
./packages/*/dist
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm install
npm run build --if-present
npm run link --if-present
- run: npm run test:node -- --since ${{ github.event.pull_request.base.sha }} --concurrency 1

test-browser:
name: Unit tests ${{ matrix.project }} ${{ matrix.browser }} ${{ matrix.type }}
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
browser:
- chromium
- firefox
type:
- browser
- webworker
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: lts/*
- uses: actions/cache@v2
id: cache
env:
CACHE_NAME: cache-node-modules
with:
path: |
~/.npm
./node_modules
./packages/*/node_modules
./packages/*/dist
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm install
npm run build --if-present
npm run link --if-present
- run: npm run test:browser -- --since ${{ github.event.pull_request.base.sha }} --concurrency 1 -- -- -- --browser ${{ matrix.browser }}

test-electron-main:
name: Unit tests electron-main
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm install
- run: npm run test:browser -- --bail
test-firefox:
needs: check
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: lts/*
- uses: actions/cache@v2
id: cache
env:
CACHE_NAME: cache-node-modules
with:
path: |
~/.npm
./node_modules
./packages/*/node_modules
./packages/*/dist
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm install
npm run build --if-present
npm run link --if-present
- uses: GabrielBB/xvfb-action@v1
with:
run: npm run test:electron-main -- --since ${{ github.event.pull_request.base.sha }} --concurrency 1 -- -- --bail

test-electron-renderer:
name: Unit tests electron-renderer
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm install
- run: npm run test:browser -- --browser firefox --bail
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: lts/*
- uses: actions/cache@v2
id: cache
env:
CACHE_NAME: cache-node-modules
with:
path: |
~/.npm
./node_modules
./packages/*/node_modules
./packages/*/dist
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm install
npm run build --if-present
npm run link --if-present
- uses: GabrielBB/xvfb-action@v1
with:
run: npm run test:electron-renderer -- --since ${{ github.event.pull_request.base.sha }} --concurrency 1 -- -- --bail
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -3,21 +3,21 @@ FROM node:lts-alpine as node
FROM node as builder

# Install deps
RUN apk add --update git build-base python3 libressl-dev ca-certificates
RUN apk add build-base python3 libressl-dev ca-certificates

# Setup directories for the `node` user
RUN mkdir -p /home/node/app/webrtc-star/node_modules && chown -R node:node /home/node/app/webrtc-star

WORKDIR /home/node/app/webrtc-star

# Install node modules
COPY package.json ./
COPY packages/signalling-server/package.json ./
# Switch to the node user for installation
RUN npm install --production

# Copy over source files under the node user
COPY ./src ./src
COPY ./README.md ./
COPY ./packages/signalling-server/src ./src
COPY ./packages/signalling-server/README.md ./

# Start from a clean node image
FROM node as server
@@ -36,4 +36,4 @@ EXPOSE 9090
# --port=9090 --host=0.0.0.0 --disableMetrics=false
# Server logging can be enabled via the DEBUG environment variable:
# DEBUG=signalling-server,signalling-server:error
CMD [ "node", "src/sig-server/bin.js"]
CMD [ "node", "src/bin.js"]
5 changes: 5 additions & 0 deletions LICENSE-APACHE
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
10 changes: 4 additions & 6 deletions LICENSE → LICENSE-MIT
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
The MIT License (MIT)

Copyright (c) 2016 David Dias

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Loading