From 995145989a01cfcb0a2a3b99a996cde530514d59 Mon Sep 17 00:00:00 2001 From: Tadeusz Wyrzykowski Date: Thu, 19 Sep 2024 21:28:58 +0200 Subject: [PATCH] Release 1.7.0 (#557) ### Fixed - Removed vulnerable module 'ip' [#545](https://github.com/NRCHKB/node-red-contrib-homekit-bridged/issues/545) - msg.context now handled properly ### Added - Adaptive Lighting support [#335](https://github.com/NRCHKB/node-red-contrib-homekit-bridged/issues/335) - By default, registered Eve.app Characteristics for power management - for existing setup, requires old custom characteristics file to be removed ### Changed - Updated hap-nodejs [0.11.1 to 0.12.3-beta.18](https://github.com/homebridge/HAP-NodeJS/blob/latest/CHANGELOG.md) (features and bug fixes) - Dependencies upgrade - Node `10`, `12` and `16` no longer supported, use Node 20! Or at least 18 - Updated GitHub Actions - Some trivial PinCodes are no longer allowed - MDNS Configuration is now deprecated, use Bind instead --- .github/workflows/codeql-analysis.yml | 20 +- .github/workflows/publish-dev.yml | 16 +- .github/workflows/publish.yml | 24 +- .github/workflows/tests.yml | 10 +- CHANGELOG.md | 24 +- LICENSE | 2 +- SECURITY.md | 15 +- build/nodes/bridge.html | 105 +- build/nodes/nrchkb.html | 265 +- build/nodes/service.html | 42 +- build/nodes/service2.html | 42 +- build/nodes/standalone.html | 117 +- package-lock.json | 3414 ++++++++++------- package.json | 51 +- src/lib/HAPHostNode.ts | 20 +- src/lib/HAPServiceNode.ts | 7 +- src/lib/HAPServiceNode2.ts | 7 +- src/lib/api.ts | 45 +- src/lib/cameraSource/index.js | 21 +- src/lib/hap/HAPCharacteristic.ts | 17 + src/lib/hap/HAPService.ts | 9 + src/lib/hap/eve-app/EveCharacteristics.ts | 101 + src/lib/hap/eve-app/EveServices.ts | 23 + src/lib/types/HAPHostConfigType.ts | 28 +- src/lib/types/HAPHostNodeType.ts | 4 +- src/lib/types/HAPService2ConfigType.ts | 28 +- src/lib/types/HAPService2NodeType.ts | 59 +- src/lib/types/HAPServiceConfigType.ts | 5 + src/lib/types/HAPServiceNodeType.ts | 2 + .../hap-nodejs/BonjourMulticastOptions.ts | 11 + .../HapAdaptiveLightingControllerMode.ts | 13 + .../types/{ => hap-nodejs}/HapCategories.ts | 0 src/lib/utils/MdnsUtils.ts | 2 +- src/lib/utils/ServiceUtils.ts | 122 +- src/lib/utils/ServiceUtils2.ts | 20 +- 35 files changed, 2906 insertions(+), 1785 deletions(-) create mode 100644 src/lib/hap/HAPCharacteristic.ts create mode 100644 src/lib/hap/HAPService.ts create mode 100644 src/lib/hap/eve-app/EveCharacteristics.ts create mode 100644 src/lib/hap/eve-app/EveServices.ts create mode 100644 src/lib/types/hap-nodejs/BonjourMulticastOptions.ts create mode 100644 src/lib/types/hap-nodejs/HapAdaptiveLightingControllerMode.ts rename src/lib/types/{ => hap-nodejs}/HapCategories.ts (100%) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index aec1eae9..ed13afb1 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -31,16 +31,16 @@ jobs: language: [ 'javascript' ] steps: - - name: Checkout repository - uses: actions/checkout@v2 + - name: Checkout repository + uses: actions/checkout@v4 - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: ${{ matrix.language }} + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} - - name: Autobuild - uses: github/codeql-action/autobuild@v1 + - name: Autobuild + uses: github/codeql-action/autobuild@v1 - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/publish-dev.yml b/.github/workflows/publish-dev.yml index 8388e9f0..d721b4f5 100644 --- a/.github/workflows/publish-dev.yml +++ b/.github/workflows/publish-dev.yml @@ -9,10 +9,10 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 - run: | npm ci npm run build @@ -22,10 +22,10 @@ jobs: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 registry-url: https://registry.npmjs.org/ always-auth: true - name: Extract PACKAGE_VERSION @@ -34,8 +34,8 @@ jobs: - name: Prepare Discord notification messages id: discord-prepare run: | - echo ::set-output name=DISCORD_MSG_DEV_ANN::'{"title":"New dev version `${{ steps.package-version.outputs.current-version }}` has been released.","description":"Changelog is available [here](https://github.com/NRCHKB/node-red-contrib-homekit-bridged/commits/dev/CHANGELOG.md)","url":"https://github.com/NRCHKB/node-red-contrib-homekit-bridged/tree/dev","color":9371648,"fields":[{"name":"How to install","value":"1. Stop node-red\n2. Backup `~/.node-red` folder\n3. `cd ~/.node-red`\n4. `npm i node-red-contrib-homekit-bridged@${{ steps.package-version.outputs.current-version }}`\n5. Start node-red"}]}' - echo ::set-output name=DISCORD_MSG_ERROR::'{"title":"Dev version `${{ steps.package-version.outputs.current-version }}` failed to be released.","description":"Changelog is available [here](https://github.com/NRCHKB/node-red-contrib-homekit-bridged/commits/dev/CHANGELOG.md)","url":"https://github.com/NRCHKB/node-red-contrib-homekit-bridged/tree/dev","color":9371648,"fields":[{"name":"How to install","value":"1. Stop node-red\n2. Backup `~/.node-red` folder\n3. `cd ~/.node-red`\n4. `npm i node-red-contrib-homekit-bridged@${{ steps.package-version.outputs.current-version }}`\n5. Start node-red"}]}' + echo ::set-output name=DISCORD_MSG_DEV_ANN::'{"title":"New dev version `${{ steps.package-version.outputs.current-version }}` has been released.","description":"Changelog is available [here](https://github.com/NRCHKB/node-red-contrib-homekit-bridged/commits/dev/CHANGELOG.md)","url":"https://github.com/NRCHKB/node-red-contrib-homekit-bridged/tree/dev","color":9371648,"fields":[{"name":"How to install","value":"1. Stop node-red\n2. Backup `~/.node-red` folder\n3. `cd ~/.node-red`\n4. `npm i node-red-contrib-homekit-bridged@${{ steps.package-version.outputs.current-version }}`\n5. Start node-red"}]}' + echo ::set-output name=DISCORD_MSG_ERROR::'{"title":"Dev version `${{ steps.package-version.outputs.current-version }}` failed to be released.","description":"Changelog is available [here](https://github.com/NRCHKB/node-red-contrib-homekit-bridged/commits/dev/CHANGELOG.md)","url":"https://github.com/NRCHKB/node-red-contrib-homekit-bridged/tree/dev","color":9371648,"fields":[{"name":"How to install","value":"1. Stop node-red\n2. Backup `~/.node-red` folder\n3. `cd ~/.node-red`\n4. `npm i node-red-contrib-homekit-bridged@${{ steps.package-version.outputs.current-version }}`\n5. Start node-red"}]}' - name: Publish if: contains(steps.package-version.outputs.current-version, 'dev') == true run: | diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f3f3a82a..a9cb6519 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -9,10 +9,10 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 - run: | npm ci npm run build @@ -22,10 +22,10 @@ jobs: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 registry-url: https://registry.npmjs.org/ always-auth: true - name: Extract PACKAGE_VERSION @@ -47,10 +47,10 @@ jobs: contents: read packages: write steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 registry-url: https://npm.pkg.github.com/ scope: '@nrchkb' - name: Extract PACKAGE_VERSION @@ -64,3 +64,9 @@ jobs: npm publish env: NODE_AUTH_TOKEN: ${{secrets.GHUB_TKN}} + - name: Update Node-Red flow-library + if: contains(steps.package-version.outputs.current-version, 'dev') != true + uses: Zehir/update-package-node-red-flow-library-action@v1.0.5 + continue-on-error: true + with: + package-name: 'node-red-contrib-homekit-bridged' diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a339a369..3360dfb1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,17 +1,17 @@ name: Tests -on: [pull_request] +on: [ pull_request ] jobs: build: runs-on: ${{ matrix.os }} strategy: matrix: - node_version: [12, 14, 16, 18] - os: [ubuntu-latest, windows-latest, macOS-latest] + node_version: [ 18, 20, 22 ] + os: [ ubuntu-latest, windows-latest, macOS-latest ] steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - name: build and test diff --git a/CHANGELOG.md b/CHANGELOG.md index 4cfd5525..9a76be22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,6 @@ ##### Before upgrading make sure that you are using the latest version of [Node-RED](https://nodered.org/docs/getting-started/local) and latest LTS version of [Node.js](https://nodejs.org/en/download/) -###### Upgrading from versions 0.X to 1.X is a breaking change, all devices will be reset in the Home app. Please review the [release notes](https://github.com/NRCHKB/node-red-contrib-homekit-bridged/releases/tag/v1.0.1) thoroughly before updating! - # Changelog All notable changes to this project will be documented in this file. @@ -11,6 +9,28 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.7.0] - 2024-09-19 + +### Fixed + +- Removed vulnerable module 'ip' [#545](https://github.com/NRCHKB/node-red-contrib-homekit-bridged/issues/545) +- msg.context now handled properly + +### Added + +- Adaptive Lighting support [#335](https://github.com/NRCHKB/node-red-contrib-homekit-bridged/issues/335) +- By default, registered Eve.app Characteristics for power management - for existing setup, requires old custom characteristics file to be removed + +### Changed + +- Updated hap-nodejs [0.11.1 to 0.12.3-beta.18](https://github.com/homebridge/HAP-NodeJS/blob/latest/CHANGELOG.md) (features + and bug fixes) +- Dependencies upgrade +- Node `10`, `12` and `16` no longer supported, use Node 20! Or at least 18 +- Updated GitHub Actions +- Some trivial PinCodes are no longer allowed +- MDNS Configuration is now deprecated, use Bind instead + ## [1.6.1] - 2024-02-19 ### Fixed diff --git a/LICENSE b/LICENSE index b33e23fd..6e8ba2c4 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019 Node-RED Contribution - HomeKit Bridged +Copyright (c) 2024 Node-RED Contribution - HomeKit Bridged Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/SECURITY.md b/SECURITY.md index ba24654b..d619e670 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -11,10 +11,10 @@ If vulnerability is a serious risk then please consider contacting us directly a ## Supported Versions -| Version | Supported | -| ------- | ------------------ | -| > = 1.2.0 | :white_check_mark: | -| < 1.2.0 | :x: limited | +| Version | Supported | +|----------|--------------------| +| >= 1.x.y | :white_check_mark: | +| < 1.x.y | :x: limited | ## Reporting a Vulnerability @@ -35,8 +35,10 @@ To use node-red safely you should secure it properly with encryption and passwor ### Invalid Setup Codes -The following Setup Codes must not be used due to their trivial, insecure nature. In future release (possibly 1.X.Y) -they will be forbidden programmatically. +Since 1.3 random Setup Code will be generated for new Host (Bridge or Standalone Accessory) nodes (instead of default 1111-1111) + +The following Setup Codes must not be used due to their trivial, insecure nature. +Since 1.7.0 they are forbidden programmatically. - 0000-0000 - 1111-1111 @@ -51,4 +53,3 @@ they will be forbidden programmatically. - 1234-5678 - 8765-4321 -Since 1.3 random Setup Code will be generated for new Bridge nodes (instead of default 1111-1111) diff --git a/build/nodes/bridge.html b/build/nodes/bridge.html index 3bf82d4b..fe79ac5a 100644 --- a/build/nodes/bridge.html +++ b/build/nodes/bridge.html @@ -55,9 +55,14 @@
+
+ + + +
- +