From 7b61be3df77ce0dcde2249ee9284c12707b70f82 Mon Sep 17 00:00:00 2001 From: Ben <43026681+bwp91@users.noreply.github.com> Date: Sat, 7 Oct 2023 01:32:53 +0100 Subject: [PATCH] revert checks (#1579) revert the ui version checks for a less harsh release --- package-lock.json | 332 +++++++++--------- package.json | 22 +- src/bin/hb-service.ts | 25 +- src/core/config/config.service.ts | 3 + src/index.ts | 10 +- .../child-bridges/child-bridges.service.ts | 16 +- src/modules/plugins/plugins.service.ts | 39 +- src/modules/status/status.service.ts | 7 +- test/e2e/plugins.gateway.e2e-spec.ts | 64 ++++ ui/package-lock.json | 173 ++++----- .../manage-plugins-modal.component.ts | 5 + ui/src/app/core/settings.service.ts | 1 + .../plugin-card/plugin-card.component.html | 46 +-- .../plugin-card/plugin-card.component.ts | 24 +- .../app/modules/plugins/plugins.component.ts | 3 +- .../modules/settings/settings.component.ts | 20 +- 16 files changed, 472 insertions(+), 318 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8c28d63da..ed3d53ec3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,17 +22,17 @@ "@fastify/helmet": "11.1.1", "@fastify/multipart": "8.0.0", "@fastify/static": "6.11.2", - "@fastify/swagger": "8.10.1", + "@fastify/swagger": "8.11.0", "@homebridge/node-pty-prebuilt-multiarch": "0.10.1-pre.6", "@nestjs/axios": "3.0.0", - "@nestjs/common": "10.2.6", - "@nestjs/core": "10.2.6", + "@nestjs/common": "10.2.7", + "@nestjs/core": "10.2.7", "@nestjs/jwt": "10.1.1", "@nestjs/passport": "10.0.2", - "@nestjs/platform-fastify": "10.2.6", - "@nestjs/platform-socket.io": "10.2.6", - "@nestjs/swagger": "7.1.12", - "@nestjs/websockets": "10.2.6", + "@nestjs/platform-fastify": "10.2.7", + "@nestjs/platform-socket.io": "10.2.7", + "@nestjs/swagger": "7.1.13", + "@nestjs/websockets": "10.2.7", "@oznu/hap-client": "1.9.0", "axios": "1.5.1", "class-transformer": "0.5.1", @@ -50,7 +50,7 @@ "reflect-metadata": "0.1.13", "rxjs": "7.8.1", "semver": "7.5.4", - "systeminformation": "5.21.9", + "systeminformation": "5.21.11", "tail": "2.2.6", "tar": "6.2.0", "tcp-port-used": "1.0.2", @@ -61,7 +61,7 @@ "homebridge-config-ui-x": "dist/bin/standalone.js" }, "devDependencies": { - "@nestjs/testing": "^10.2.6", + "@nestjs/testing": "^10.2.7", "@types/fs-extra": "^9.0.13", "@types/jest": "^29.5.5", "@types/node": "^18.18.1", @@ -69,8 +69,8 @@ "@types/semver": "7.5.3", "@types/tar": "^6.1.6", "@types/unzipper": "^0.10.7", - "@typescript-eslint/eslint-plugin": "^6.7.3", - "@typescript-eslint/parser": "^6.7.3", + "@typescript-eslint/eslint-plugin": "^6.7.4", + "@typescript-eslint/parser": "^6.7.4", "babel-jest": "^29.7.0", "bash-color": "^0.0.4", "buffer-shims": "^1.0.0", @@ -691,9 +691,9 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.9.0", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.9.0.tgz", - "integrity": "sha512-zJmuCWj2VLBt4c25CfBIbMZLGLyhkvs7LznyVX5HfpzeocThgIj5XQK4L+g3U36mMcx8bPMhGyPpwCATamC4jQ==", + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.9.1.tgz", + "integrity": "sha512-Y27x+MBLjXa+0JWDhykM3+JE+il3kHKAEqabfEWq3SDhZjLYb6/BHL/JKFnH3fe207JaXkyDo685Oc2Glt6ifA==", "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" @@ -723,9 +723,9 @@ } }, "node_modules/@eslint/eslintrc/node_modules/globals": { - "version": "13.22.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.22.0.tgz", - "integrity": "sha512-H1Ddc/PbZHTDVJSnj8kWptIRSD6AM3pK+mKytuIVF4uoBV7rshFlhhvA58ceJ5wp3Er58w6zj7bykMpYXt3ETw==", + "version": "13.23.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", + "integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -808,9 +808,9 @@ } }, "node_modules/@fastify/cors": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/@fastify/cors/-/cors-8.3.0.tgz", - "integrity": "sha512-oj9xkka2Tg0MrwuKhsSUumcAkfp2YCnKxmFEusi01pjk1YrdDsuSYTHXEelWNW+ilSy/ApZq0c2SvhKrLX0H1g==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@fastify/cors/-/cors-8.4.0.tgz", + "integrity": "sha512-MlVvMTenltToByTpLwlWtO+7dQ3l2J+1OpmGrx9JpSNWo1d+dhfNCOi23zHhxdFhtpDzfwGwCsKu9DTeG7k7nQ==", "dependencies": { "fastify-plugin": "^4.0.0", "mnemonist": "0.39.5" @@ -822,9 +822,9 @@ "integrity": "sha512-J8TOSBq3SoZbDhM9+R/u77hP93gz/rajSA+K2kGyijPpORPWUXHUpTaleoj+92As0S9uPRP7Oi8IqMf0u+ro6A==" }, "node_modules/@fastify/error": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/@fastify/error/-/error-3.3.0.tgz", - "integrity": "sha512-dj7vjIn1Ar8sVXj2yAXiMNCJDmS9MQ9XMlIecX2dIzzhjSHCyKo4DdXjXMs7wKW2kj6yvVRSpuQjOZ3YLrh56w==" + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@fastify/error/-/error-3.4.0.tgz", + "integrity": "sha512-e/mafFwbK3MNqxUcFBLgHhgxsF8UT1m8aj0dAlqEa2nJEgPsRtpHTZ3ObgrgkZ2M1eJHPTwgyUl/tXkvabsZdQ==" }, "node_modules/@fastify/fast-json-stringify-compiler": { "version": "4.3.0", @@ -909,9 +909,9 @@ } }, "node_modules/@fastify/swagger": { - "version": "8.10.1", - "resolved": "https://registry.npmjs.org/@fastify/swagger/-/swagger-8.10.1.tgz", - "integrity": "sha512-NZ4PyppZWEd4j8qPt4AKGhuMm7dALe2IntmI2NrdlnPno+rFRyQJHw3XHdziN7yirYGhCGM+vByItWEnPHLu4w==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@fastify/swagger/-/swagger-8.11.0.tgz", + "integrity": "sha512-K8hAWr3wTBUojjJfNUy0TAl766ga2O/L5mWVbBZ6MImOOB3GYUgqNXC4MKrOejt8Y4Ps4cdKjkgzWLcUtg8SFg==", "dependencies": { "fastify-plugin": "^4.0.0", "json-schema-resolver": "^2.0.0", @@ -921,9 +921,9 @@ } }, "node_modules/@fastify/swagger-ui": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/@fastify/swagger-ui/-/swagger-ui-1.9.3.tgz", - "integrity": "sha512-YYqce4CydjDIEry6Zo4JLjVPe5rjS8iGnk3fHiIQnth9sFSLeyG0U1DCH+IyYmLddNDg1uWJOuErlVqnu/jI3w==", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@fastify/swagger-ui/-/swagger-ui-1.10.0.tgz", + "integrity": "sha512-vps8KRDQ8JWQGG9Dh6fCOzAc81Y5a6RnCU/Sumyw3n7+HXJSYExnLLgv4aS9eRFSODtQ8kzZJ//IxAbf0nZ+sQ==", "dependencies": { "@fastify/static": "^6.0.0", "fastify-plugin": "^4.0.0", @@ -1516,9 +1516,9 @@ } }, "node_modules/@jest/reporters/node_modules/istanbul-lib-instrument": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.0.tgz", - "integrity": "sha512-x58orMzEVfzPUKqlbLd1hXCnySCxKdDKa6Rjg97CwuLLRI4g3FHTdnExu1OqffVFay6zeMW+T6/DowFLndWnIw==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.1.tgz", + "integrity": "sha512-EAMEJBsYuyyztxMxW3g7ugGPkrZsV57v0Hmv3mm1uQsmB+QnZuepg731CRaIgeUVSdmsTngOkSnauNF8p7FIhA==", "dev": true, "dependencies": { "@babel/core": "^7.12.3", @@ -1873,9 +1873,9 @@ } }, "node_modules/@nestjs/common": { - "version": "10.2.6", - "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-10.2.6.tgz", - "integrity": "sha512-ma8R7n+FXsWM4XF9QXjjrsRceyRzid/xKmNKVOa/sTJntkVG8lL71BHBEfjtFvO6EJUqjs/15LbDc0iaN5nCwA==", + "version": "10.2.7", + "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-10.2.7.tgz", + "integrity": "sha512-cUtCRXiUstDmh4bSBhVbq4cI439Gngp4LgLGLBmd5dqFQodfXKnSD441ldYfFiLz4rbUsnoMJz/8ZjuIEI+B7A==", "dependencies": { "iterare": "1.2.1", "tslib": "2.6.2", @@ -1901,9 +1901,9 @@ } }, "node_modules/@nestjs/core": { - "version": "10.2.6", - "resolved": "https://registry.npmjs.org/@nestjs/core/-/core-10.2.6.tgz", - "integrity": "sha512-oGQ2CoBeFRT7egG47MFqS89xlXBTIRZBkRpKRTPMftEfL1RMXhXIcIIaGfzp11wx6qxrBVxBXpVLM09oaqHpaQ==", + "version": "10.2.7", + "resolved": "https://registry.npmjs.org/@nestjs/core/-/core-10.2.7.tgz", + "integrity": "sha512-5GSu53QUUcwX17sNmlJPa1I0wIeAZOKbedyVuQx0ZAwWVa9g0wJBbsNP+R4EJ+j5Dkdzt/8xkiZvnKt8RFRR8g==", "hasInstallScript": true, "dependencies": { "@nuxtjs/opencollective": "0.3.2", @@ -1978,15 +1978,15 @@ } }, "node_modules/@nestjs/platform-fastify": { - "version": "10.2.6", - "resolved": "https://registry.npmjs.org/@nestjs/platform-fastify/-/platform-fastify-10.2.6.tgz", - "integrity": "sha512-TlKX0aN+BN91PtVx9IJMGU+BYaSFF/7FcRx2UonC59cCSMek/vEcErQGYxUXqvoMQKzBTHt5cDAhYTT3LzY0rw==", + "version": "10.2.7", + "resolved": "https://registry.npmjs.org/@nestjs/platform-fastify/-/platform-fastify-10.2.7.tgz", + "integrity": "sha512-m/OADHxB7yY6TyADLmXJ3BCadG110g/O0nLj2LQDNRiNLiYrgpV3D/cGOcMqlQOG30GZ7BKl8Cq8CsKVtMhzZA==", "dependencies": { - "@fastify/cors": "8.3.0", + "@fastify/cors": "8.4.0", "@fastify/formbody": "7.4.0", "@fastify/middie": "8.3.0", "fastify": "4.23.2", - "light-my-request": "5.10.0", + "light-my-request": "5.11.0", "path-to-regexp": "3.2.0", "tslib": "2.6.2" }, @@ -2010,9 +2010,9 @@ } }, "node_modules/@nestjs/platform-socket.io": { - "version": "10.2.6", - "resolved": "https://registry.npmjs.org/@nestjs/platform-socket.io/-/platform-socket.io-10.2.6.tgz", - "integrity": "sha512-c4GbHeyd12hyrLngnHDouBui0fwPjaK4TopkZdvkskRCd4sOfph9EUX2CHny+ZL8UeY8IbW/yBZxQ746ahSYsQ==", + "version": "10.2.7", + "resolved": "https://registry.npmjs.org/@nestjs/platform-socket.io/-/platform-socket.io-10.2.7.tgz", + "integrity": "sha512-P+xDyjz6FwST01elqZDFTxo250ALozGTnx01yvc5t30F6kJFIqeziuHzdrqTLfsEWpZLrjNIs4pi0UpAovawmw==", "dependencies": { "socket.io": "4.7.2", "tslib": "2.6.2" @@ -2028,15 +2028,15 @@ } }, "node_modules/@nestjs/swagger": { - "version": "7.1.12", - "resolved": "https://registry.npmjs.org/@nestjs/swagger/-/swagger-7.1.12.tgz", - "integrity": "sha512-Q1P/IE+cws0sJeNtbs+8uDalcVylpmAnaEUFenGOa3KSNnXF/8DOE84mET/uUhFXsiz9PLHK8Hy7o7B6fRpMhg==", + "version": "7.1.13", + "resolved": "https://registry.npmjs.org/@nestjs/swagger/-/swagger-7.1.13.tgz", + "integrity": "sha512-aHfW0rDZZKTuPVSkxutBCB16lBy5vrsHVoRF5RvPtH7U2cm4Vf+OnfhxKKuG2g2Xocn9sDL+JAyVlY2VN3ytTw==", "dependencies": { "@nestjs/mapped-types": "2.0.2", "js-yaml": "4.1.0", "lodash": "4.17.21", "path-to-regexp": "3.2.0", - "swagger-ui-dist": "5.7.2" + "swagger-ui-dist": "5.9.0" }, "peerDependencies": { "@fastify/static": "^6.0.0", @@ -2059,9 +2059,9 @@ } }, "node_modules/@nestjs/testing": { - "version": "10.2.6", - "resolved": "https://registry.npmjs.org/@nestjs/testing/-/testing-10.2.6.tgz", - "integrity": "sha512-uxlxHhpSvG4yDTPmuPneoQL1/UnBkOkzE+Zaz6bwURg7lc3uS4ZsXl75OL3pYaJH37rHYXYT9bGcYSpxVbwIrg==", + "version": "10.2.7", + "resolved": "https://registry.npmjs.org/@nestjs/testing/-/testing-10.2.7.tgz", + "integrity": "sha512-d2SIqiJIf/7NSILeNNWSdRvTTpHSouGgisGHwf5PVDC7z4/yXZw/wPO9eJhegnxFlqk6n2LW4QBTmMzbqjAfHA==", "dev": true, "dependencies": { "tslib": "2.6.2" @@ -2086,9 +2086,9 @@ } }, "node_modules/@nestjs/websockets": { - "version": "10.2.6", - "resolved": "https://registry.npmjs.org/@nestjs/websockets/-/websockets-10.2.6.tgz", - "integrity": "sha512-HwZADfixAMKMdMB/eBz0HJnPCs0r+W+5inpRwCazsQhwZniGUgXkfIhyRvNfHip/nb+DLS/M8BNBR2JGiJNTEg==", + "version": "10.2.7", + "resolved": "https://registry.npmjs.org/@nestjs/websockets/-/websockets-10.2.7.tgz", + "integrity": "sha512-NKJMubkwpUBsudbiyjuLZDT/W68K+fS/pe3vG5Ur8QoPn+fkI9SFCiQw27Cv4K0qVX2eGJ41yNmVfu61zGa4CQ==", "dependencies": { "iterare": "1.2.1", "object-hash": "3.0.0", @@ -2507,9 +2507,9 @@ } }, "node_modules/@types/node": { - "version": "18.18.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.1.tgz", - "integrity": "sha512-3G42sxmm0fF2+Vtb9TJQpnjmP+uKlWvFa8KoEGquh4gqRmoUG/N0ufuhikw6HEsdG2G2oIKhog1GCTfz9v5NdQ==" + "version": "18.18.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.3.tgz", + "integrity": "sha512-0OVfGupTl3NBFr8+iXpfZ8NR7jfFO+P1Q+IO/q0wbo02wYkP5gy36phojeYWpLQ6WAMjl+VfmqUk2YbUfp0irA==" }, "node_modules/@types/node-schedule": { "version": "2.1.1", @@ -2572,16 +2572,16 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.7.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.7.3.tgz", - "integrity": "sha512-vntq452UHNltxsaaN+L9WyuMch8bMd9CqJ3zhzTPXXidwbf5mqqKCVXEuvRZUqLJSTLeWE65lQwyXsRGnXkCTA==", + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.7.4.tgz", + "integrity": "sha512-DAbgDXwtX+pDkAHwiGhqP3zWUGpW49B7eqmgpPtg+BKJXwdct79ut9+ifqOFPJGClGKSHXn2PTBatCnldJRUoA==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.7.3", - "@typescript-eslint/type-utils": "6.7.3", - "@typescript-eslint/utils": "6.7.3", - "@typescript-eslint/visitor-keys": "6.7.3", + "@typescript-eslint/scope-manager": "6.7.4", + "@typescript-eslint/type-utils": "6.7.4", + "@typescript-eslint/utils": "6.7.4", + "@typescript-eslint/visitor-keys": "6.7.4", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", @@ -2607,15 +2607,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "6.7.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.7.3.tgz", - "integrity": "sha512-TlutE+iep2o7R8Lf+yoer3zU6/0EAUc8QIBB3GYBc1KGz4c4TRm83xwXUZVPlZ6YCLss4r77jbu6j3sendJoiQ==", + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.7.4.tgz", + "integrity": "sha512-I5zVZFY+cw4IMZUeNCU7Sh2PO5O57F7Lr0uyhgCJmhN/BuTlnc55KxPonR4+EM3GBdfiCyGZye6DgMjtubQkmA==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "6.7.3", - "@typescript-eslint/types": "6.7.3", - "@typescript-eslint/typescript-estree": "6.7.3", - "@typescript-eslint/visitor-keys": "6.7.3", + "@typescript-eslint/scope-manager": "6.7.4", + "@typescript-eslint/types": "6.7.4", + "@typescript-eslint/typescript-estree": "6.7.4", + "@typescript-eslint/visitor-keys": "6.7.4", "debug": "^4.3.4" }, "engines": { @@ -2635,13 +2635,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "6.7.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.7.3.tgz", - "integrity": "sha512-wOlo0QnEou9cHO2TdkJmzF7DFGvAKEnB82PuPNHpT8ZKKaZu6Bm63ugOTn9fXNJtvuDPanBc78lGUGGytJoVzQ==", + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.7.4.tgz", + "integrity": "sha512-SdGqSLUPTXAXi7c3Ob7peAGVnmMoGzZ361VswK2Mqf8UOYcODiYvs8rs5ILqEdfvX1lE7wEZbLyELCW+Yrql1A==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.7.3", - "@typescript-eslint/visitor-keys": "6.7.3" + "@typescript-eslint/types": "6.7.4", + "@typescript-eslint/visitor-keys": "6.7.4" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -2652,13 +2652,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "6.7.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.7.3.tgz", - "integrity": "sha512-Fc68K0aTDrKIBvLnKTZ5Pf3MXK495YErrbHb1R6aTpfK5OdSFj0rVN7ib6Tx6ePrZ2gsjLqr0s98NG7l96KSQw==", + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.7.4.tgz", + "integrity": "sha512-n+g3zi1QzpcAdHFP9KQF+rEFxMb2KxtnJGID3teA/nxKHOVi3ylKovaqEzGBbVY2pBttU6z85gp0D00ufLzViQ==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "6.7.3", - "@typescript-eslint/utils": "6.7.3", + "@typescript-eslint/typescript-estree": "6.7.4", + "@typescript-eslint/utils": "6.7.4", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" }, @@ -2679,9 +2679,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "6.7.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.7.3.tgz", - "integrity": "sha512-4g+de6roB2NFcfkZb439tigpAMnvEIg3rIjWQ+EM7IBaYt/CdJt6em9BJ4h4UpdgaBWdmx2iWsafHTrqmgIPNw==", + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.7.4.tgz", + "integrity": "sha512-o9XWK2FLW6eSS/0r/tgjAGsYasLAnOWg7hvZ/dGYSSNjCh+49k5ocPN8OmG5aZcSJ8pclSOyVKP2x03Sj+RrCA==", "dev": true, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -2692,13 +2692,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "6.7.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.3.tgz", - "integrity": "sha512-YLQ3tJoS4VxLFYHTw21oe1/vIZPRqAO91z6Uv0Ss2BKm/Ag7/RVQBcXTGcXhgJMdA4U+HrKuY5gWlJlvoaKZ5g==", + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.4.tgz", + "integrity": "sha512-ty8b5qHKatlNYd9vmpHooQz3Vki3gG+3PchmtsA4TgrZBKWHNjWfkQid7K7xQogBqqc7/BhGazxMD5vr6Ha+iQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.7.3", - "@typescript-eslint/visitor-keys": "6.7.3", + "@typescript-eslint/types": "6.7.4", + "@typescript-eslint/visitor-keys": "6.7.4", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -2719,17 +2719,17 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "6.7.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.7.3.tgz", - "integrity": "sha512-vzLkVder21GpWRrmSR9JxGZ5+ibIUSudXlW52qeKpzUEQhRSmyZiVDDj3crAth7+5tmN1ulvgKaCU2f/bPRCzg==", + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.7.4.tgz", + "integrity": "sha512-PRQAs+HUn85Qdk+khAxsVV+oULy3VkbH3hQ8hxLRJXWBEd7iI+GbQxH5SEUSH7kbEoTp6oT1bOwyga24ELALTA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.7.3", - "@typescript-eslint/types": "6.7.3", - "@typescript-eslint/typescript-estree": "6.7.3", + "@typescript-eslint/scope-manager": "6.7.4", + "@typescript-eslint/types": "6.7.4", + "@typescript-eslint/typescript-estree": "6.7.4", "semver": "^7.5.4" }, "engines": { @@ -2744,12 +2744,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "6.7.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.3.tgz", - "integrity": "sha512-HEVXkU9IB+nk9o63CeICMHxFWbHWr3E1mpilIQBe9+7L/lH97rleFLVtYsfnWB+JVMaiFnEaxvknvmIzX+CqVg==", + "version": "6.7.4", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.4.tgz", + "integrity": "sha512-pOW37DUhlTZbvph50x5zZCkFn3xzwkGtNoJHzIM3svpiSkJzwOYr/kVBaXmf+RAQiUDs1AHEZVNPg6UJCJpwRA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.7.3", + "@typescript-eslint/types": "6.7.4", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -3788,9 +3788,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001541", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001541.tgz", - "integrity": "sha512-bLOsqxDgTqUBkzxbNlSBt8annkDpQB9NdzdTbO2ooJ+eC/IQcvDspDc058g84ejCelF7vHUx57KIOjEecOHXaw==", + "version": "1.0.30001546", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001546.tgz", + "integrity": "sha512-zvtSJwuQFpewSyRrI3AsftF6rM0X80mZkChIt1spBGEvRglCrjTniXvinc8JKRoqTwXAgvqTImaN9igfSMtUBw==", "dev": true, "funding": [ { @@ -3898,9 +3898,9 @@ } }, "node_modules/ci-info": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", - "integrity": "sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==", + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", "dev": true, "funding": [ { @@ -4231,9 +4231,9 @@ } }, "node_modules/core-js-pure": { - "version": "3.32.2", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.32.2.tgz", - "integrity": "sha512-Y2rxThOuNywTjnX/PgA5vWM6CZ9QB9sz9oGeCixV8MqXZO70z/5SHzf9EeBrEBK0PN36DnEBBu9O/aGWzKuMZQ==", + "version": "3.33.0", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.33.0.tgz", + "integrity": "sha512-FKSIDtJnds/YFIEaZ4HszRX7hkxGpNKM7FC9aJ9WLJbSd3lD4vOltFuVIBLR8asSx9frkTSqL0dw90SKQxgKrg==", "hasInstallScript": true, "funding": { "type": "opencollective", @@ -4678,9 +4678,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.537", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.537.tgz", - "integrity": "sha512-W1+g9qs9hviII0HAwOdehGYkr+zt7KKdmCcJcjH0mYg6oL8+ioT3Skjmt7BLoAQqXhjf40AXd+HlR4oAWMlXjA==", + "version": "1.4.544", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.544.tgz", + "integrity": "sha512-54z7squS1FyFRSUqq/knOFSptjjogLZXbKcYk3B0qkE1KZzvqASwRZnY2KzZQJqIYLVD38XZeoiMRflYSwyO4w==", "dev": true }, "node_modules/emittery": { @@ -4710,9 +4710,9 @@ } }, "node_modules/engine.io": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.5.2.tgz", - "integrity": "sha512-IXsMcGpw/xRfjra46sVZVHiSWo/nJ/3g1337q9KNXtS6YRzbW5yIzTCb9DjhrBe7r3GZQR0I4+nq+4ODk5g/cA==", + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.5.3.tgz", + "integrity": "sha512-IML/R4eG/pUS5w7OfcDE0jKrljWS9nwnEfsxWCIJF5eO6AHo6+Hlv+lQbdlAYsiJPHzUthLm1RUjnBzWOs45cw==", "dependencies": { "@types/cookie": "^0.4.1", "@types/cors": "^2.8.12", @@ -5360,9 +5360,9 @@ } }, "node_modules/eslint/node_modules/globals": { - "version": "13.22.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.22.0.tgz", - "integrity": "sha512-H1Ddc/PbZHTDVJSnj8kWptIRSD6AM3pK+mKytuIVF4uoBV7rshFlhhvA58ceJ5wp3Er58w6zj7bykMpYXt3ETw==", + "version": "13.23.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", + "integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -5800,12 +5800,12 @@ } }, "node_modules/flat-cache": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.0.tgz", - "integrity": "sha512-OHx4Qwrrt0E4jEIcI5/Xb+f+QmJYNj2rrK8wiIdQOIrB9WrrJL8cjZvXdXuBTkkEwEqLycb5BeZDV1o2i9bTew==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.1.tgz", + "integrity": "sha512-/qM2b3LUIaIgviBQovTLvijfyOQXPtSRnRK26ksj2J7rzPIecePUIpJsZ4T02Qg+xiAEKIs5K8dsHEd+VaKa/Q==", "dev": true, "dependencies": { - "flatted": "^3.2.7", + "flatted": "^3.2.9", "keyv": "^4.5.3", "rimraf": "^3.0.2" }, @@ -6315,13 +6315,10 @@ "dev": true }, "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.4.tgz", + "integrity": "sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ==", "dev": true, - "dependencies": { - "function-bind": "^1.1.1" - }, "engines": { "node": ">= 0.4.0" } @@ -8835,14 +8832,14 @@ } }, "node_modules/libphonenumber-js": { - "version": "1.10.45", - "resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.10.45.tgz", - "integrity": "sha512-eeHcvGafEYCaKB4fo2uBINfG7j7PcGwBHUaTVfbwl/6KcjCgIKNlIOsSXVRp9BH10NQwmvvk+nQ1e/Yp4BGB7w==" + "version": "1.10.47", + "resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.10.47.tgz", + "integrity": "sha512-b4t7VQDV29xx/ni+58yl9KWPGjnDLDXCeCTLrD4V8vDpObXZRZBrg7uX/HWZ7YXiJKqdBDGgc+barUUTNB6Slw==" }, "node_modules/light-my-request": { - "version": "5.10.0", - "resolved": "https://registry.npmjs.org/light-my-request/-/light-my-request-5.10.0.tgz", - "integrity": "sha512-ZU2D9GmAcOUculTTdH9/zryej6n8TzT+fNGdNtm6SDp5MMMpHrJJkvAdE3c6d8d2chE9i+a//dS9CWZtisknqA==", + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/light-my-request/-/light-my-request-5.11.0.tgz", + "integrity": "sha512-qkFCeloXCOMpmEdZ/MV91P8AT4fjwFXWaAFz3lUeStM8RcoM1ks4J/F8r1b3r6y/H4u3ACEJ1T+Gv5bopj7oDA==", "dependencies": { "cookie": "^0.5.0", "process-warning": "^2.0.0", @@ -9500,9 +9497,12 @@ "integrity": "sha512-lgHwxlxV1qIg1Eap7LgIeoBWIMFibOjbrYPIPJZcI1mmGAI2m3lNYpK12Y+GBdPQ0U1hRwSord7GIaawz962qQ==" }, "node_modules/on-exit-leak-free": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/on-exit-leak-free/-/on-exit-leak-free-2.1.0.tgz", - "integrity": "sha512-VuCaZZAjReZ3vUwgOB8LxAosIurDiAW0s13rI1YwmaP++jvcxP77AWoQvenZebpCA2m8WC1/EosPYPMjnRAp/w==" + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/on-exit-leak-free/-/on-exit-leak-free-2.1.2.tgz", + "integrity": "sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==", + "engines": { + "node": ">=14.0.0" + } }, "node_modules/once": { "version": "1.4.0", @@ -9863,9 +9863,9 @@ } }, "node_modules/pino": { - "version": "8.15.2", - "resolved": "https://registry.npmjs.org/pino/-/pino-8.15.2.tgz", - "integrity": "sha512-TmIG2mfyuqOKtNxW2nCSGNk7Izt/Y60LRjCBfRXoAssuozffisXXvIUl7toajrwfNyN6VzZmPSupQOnqo/2DKQ==", + "version": "8.15.6", + "resolved": "https://registry.npmjs.org/pino/-/pino-8.15.6.tgz", + "integrity": "sha512-GuxHr61R0ZFD1npu58tB3a3FSVjuy21OwN/haw4OuKiZBL63Pg11Y51WWeD52RENS2mjwPZOwt+2OQOSkck6kQ==", "dependencies": { "atomic-sleep": "^1.0.0", "fast-redact": "^3.1.1", @@ -10773,9 +10773,9 @@ } }, "node_modules/sonic-boom": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-3.4.0.tgz", - "integrity": "sha512-zSe9QQW30nPzjkSJ0glFQO5T9lHsk39tz+2bAAwCj8CNgEG8ItZiX7Wb2ZgA8I04dwRGCcf1m3ABJa8AYm12Fw==", + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-3.6.1.tgz", + "integrity": "sha512-QV+p5nXPiUiSMxn/k5bOL+hzCpafdj1voL+hywPZhheRSYyYp7CF15rNdz1evOXCUn/tFb7R62PDX1yJmtoTgg==", "dependencies": { "atomic-sleep": "^1.0.0" } @@ -11060,14 +11060,14 @@ } }, "node_modules/swagger-ui-dist": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-5.7.2.tgz", - "integrity": "sha512-mVZc9QVQ6pTCV5crli3+Ng+DoMPwdtMHK8QLk2oX8Mtamp4D/hV+uYdC3lV0JZrDgpNEcjs0RrWTqMwwosuLPQ==" + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-5.9.0.tgz", + "integrity": "sha512-NUHSYoe5XRTk/Are8jPJ6phzBh3l9l33nEyXosM17QInoV95/jng8+PuSGtbD407QoPf93MH3Bkh773OgesJpA==" }, "node_modules/systeminformation": { - "version": "5.21.9", - "resolved": "https://registry.npmjs.org/systeminformation/-/systeminformation-5.21.9.tgz", - "integrity": "sha512-7pI4mu9P/2MGDV0T49B52E7IULBGj+kRVk6JSYUj5qfAk7N7C7aNX15fXziqrbgZntc6/jjYzWeb/x41jhg/eA==", + "version": "5.21.11", + "resolved": "https://registry.npmjs.org/systeminformation/-/systeminformation-5.21.11.tgz", + "integrity": "sha512-dIJEGoP5W7k4JJGje/b+inJrOL5hV9LPsUi5ndBvJydI80CVEcu2DZYgt6prdRErDi2SA4SqYd/WMR4b+u34mA==", "os": [ "darwin", "linux", @@ -11192,9 +11192,9 @@ } }, "node_modules/terser": { - "version": "5.20.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.20.0.tgz", - "integrity": "sha512-e56ETryaQDyebBwJIWYB2TT6f2EZ0fL0sW/JRXNMN26zZdKi2u/E/5my5lG6jNxym6qsrVXfFRmOdV42zlAgLQ==", + "version": "5.21.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.21.0.tgz", + "integrity": "sha512-WtnFKrxu9kaoXuiZFSGrcAvvBqAdmKx0SFNmVNYdJamMu9yyN3I/QF0FbH4QcqJQ+y1CJnzxGIKH0cSj+FGYRw==", "dev": true, "dependencies": { "@jridgewell/source-map": "^0.3.3", @@ -11342,9 +11342,9 @@ } }, "node_modules/thread-stream": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-2.4.0.tgz", - "integrity": "sha512-xZYtOtmnA63zj04Q+F9bdEay5r47bvpo1CaNqsKi7TpoJHcotUez8Fkfo2RJWpW91lnnaApdpRbVwCWsy+ifcw==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-2.4.1.tgz", + "integrity": "sha512-d/Ex2iWd1whipbT681JmTINKw0ZwOUBZm7+Gjs64DHuX34mmw8vJL2bFAaNacaW72zYiTJxSHi5abUuOi5nsfg==", "dependencies": { "real-require": "^0.2.0" } @@ -11382,9 +11382,9 @@ } }, "node_modules/toad-cache": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/toad-cache/-/toad-cache-3.2.0.tgz", - "integrity": "sha512-Hj5zSqBS6OHbZoQk9IU8VqIr+0JUpwzunnwSlFJhG8aJSInYUMEuzItl3kJsGteTPd1qtflafdRHlRtUazYeqg==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/toad-cache/-/toad-cache-3.3.0.tgz", + "integrity": "sha512-3oDzcogWGHZdkwrHyvJVpPjA7oNzY6ENOV3PsWJY9XYPZ6INo94Yd47s5may1U+nleBPwDhrRiTPMIvKaa3MQg==", "engines": { "node": ">=12" } @@ -11936,25 +11936,19 @@ "dev": true }, "node_modules/v8-to-istanbul": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz", - "integrity": "sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA==", + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.3.tgz", + "integrity": "sha512-9lDD+EVI2fjFsMWXc6dy5JJzBsVTcQ2fVkfBvncZ6xJWG9wtBhOldG+mHkSL0+V1K/xgZz0JDO5UT5hFwHUghg==", "dev": true, "dependencies": { "@jridgewell/trace-mapping": "^0.3.12", "@types/istanbul-lib-coverage": "^2.0.1", - "convert-source-map": "^1.6.0" + "convert-source-map": "^2.0.0" }, "engines": { "node": ">=10.12.0" } }, - "node_modules/v8-to-istanbul/node_modules/convert-source-map": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", - "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", - "dev": true - }, "node_modules/validator": { "version": "13.11.0", "resolved": "https://registry.npmjs.org/validator/-/validator-13.11.0.tgz", diff --git a/package.json b/package.json index 2f843ac45..5bccc7c82 100644 --- a/package.json +++ b/package.json @@ -55,17 +55,17 @@ "@fastify/helmet": "11.1.1", "@fastify/multipart": "8.0.0", "@fastify/static": "6.11.2", - "@fastify/swagger": "8.10.1", + "@fastify/swagger": "8.11.0", "@homebridge/node-pty-prebuilt-multiarch": "0.10.1-pre.6", "@nestjs/axios": "3.0.0", - "@nestjs/common": "10.2.6", - "@nestjs/core": "10.2.6", + "@nestjs/common": "10.2.7", + "@nestjs/core": "10.2.7", "@nestjs/jwt": "10.1.1", "@nestjs/passport": "10.0.2", - "@nestjs/platform-fastify": "10.2.6", - "@nestjs/platform-socket.io": "10.2.6", - "@nestjs/swagger": "7.1.12", - "@nestjs/websockets": "10.2.6", + "@nestjs/platform-fastify": "10.2.7", + "@nestjs/platform-socket.io": "10.2.7", + "@nestjs/swagger": "7.1.13", + "@nestjs/websockets": "10.2.7", "@oznu/hap-client": "1.9.0", "axios": "1.5.1", "class-transformer": "0.5.1", @@ -83,14 +83,14 @@ "reflect-metadata": "0.1.13", "rxjs": "7.8.1", "semver": "7.5.4", - "systeminformation": "5.21.9", + "systeminformation": "5.21.11", "tail": "2.2.6", "tar": "6.2.0", "tcp-port-used": "1.0.2", "unzipper": "0.10.14" }, "devDependencies": { - "@nestjs/testing": "^10.2.6", + "@nestjs/testing": "^10.2.7", "@types/fs-extra": "^9.0.13", "@types/jest": "^29.5.5", "@types/node": "^18.18.1", @@ -98,8 +98,8 @@ "@types/semver": "7.5.3", "@types/tar": "^6.1.6", "@types/unzipper": "^0.10.7", - "@typescript-eslint/eslint-plugin": "^6.7.3", - "@typescript-eslint/parser": "^6.7.3", + "@typescript-eslint/eslint-plugin": "^6.7.4", + "@typescript-eslint/parser": "^6.7.4", "babel-jest": "^29.7.0", "bash-color": "^0.0.4", "buffer-shims": "^1.0.0", diff --git a/src/bin/hb-service.ts b/src/bin/hb-service.ts index a7d5234af..869989c39 100644 --- a/src/bin/hb-service.ts +++ b/src/bin/hb-service.ts @@ -426,9 +426,20 @@ export class HomebridgeServiceHelper { return; } - // allow the --strict-plugin-resolution flag on Homebridge v1.4.1 or later only (check removed in UI 5.0) - if (!this.homebridgeOpts.includes('--strict-plugin-resolution')) { - this.homebridgeOpts.push('--strict-plugin-resolution'); + // allow the --strict-plugin-resolution flag on Homebridge v1.4.1 or later only + if ( + this.homebridgePackage && + process.env.UIX_STRICT_PLUGIN_RESOLUTION === '1' && + semver.gte(this.homebridgePackage.version, '1.4.1-beta.1') + ) { + if (!this.homebridgeOpts.includes('--strict-plugin-resolution')) { + this.homebridgeOpts.push('--strict-plugin-resolution'); + } + } else if (process.env.UIX_STRICT_PLUGIN_RESOLUTION === '1') { + const strictPluginIndex = this.homebridgeOpts.indexOf('--strict-plugin-resolution'); + if (strictPluginIndex > -1) { + this.homebridgeOpts.splice(strictPluginIndex, 1); + } } if (this.homebridgeOpts.length) { @@ -1081,9 +1092,11 @@ export class HomebridgeServiceHelper { this.homebridgeOpts.push('-D'); } - // check if keep orphans should be enabled, only for Homebridge v1.0.2 and later (check removed in UI 5.0) - if (homebridgeStartupOptions.keepOrphans && !this.homebridgeOpts.includes('-K')) { - this.homebridgeOpts.push('-K'); + // check if keep orphans should be enabled, only for Homebridge v1.0.2 and later + if (this.homebridgePackage && semver.gte(this.homebridgePackage.version, '1.0.2')) { + if (homebridgeStartupOptions.keepOrphans && !this.homebridgeOpts.includes('-K')) { + this.homebridgeOpts.push('-K'); + } } // insecure mode is enabled by default, allow it to be removed if set to false diff --git a/src/core/config/config.service.ts b/src/core/config/config.service.ts index 7e3e42737..4a03be91e 100644 --- a/src/core/config/config.service.ts +++ b/src/core/config/config.service.ts @@ -3,6 +3,7 @@ import * as os from 'os'; import * as path from 'path'; import * as fs from 'fs-extra'; import * as crypto from 'crypto'; +import * as semver from 'semver'; import * as _ from 'lodash'; export interface HomebridgeConfig { @@ -64,6 +65,7 @@ export class ConfigService { // docker settings public startupScript = path.resolve(this.storagePath, 'startup.sh'); + public dockerOfflineUpdate = this.runningInDocker && semver.satisfies(process.env.CONFIG_UI_VERSION, '>=4.6.2 <=4.44.1', { includePrerelease: true }); // package.json public package = fs.readJsonSync(path.resolve(process.env.UIX_BASE_PATH, 'package.json')); @@ -208,6 +210,7 @@ export class ConfigService { runningInFreeBSD: this.runningInFreeBSD, runningOnRaspberryPi: this.runningOnRaspberryPi, canShutdownRestartHost: this.canShutdownRestartHost, + dockerOfflineUpdate: this.dockerOfflineUpdate, serviceMode: this.serviceMode, temperatureUnits: this.ui.tempUnits || 'c', lang: this.ui.lang === 'auto' ? null : this.ui.lang, diff --git a/src/index.ts b/src/index.ts index 57c3b702f..17320e464 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,6 +5,7 @@ import * as path from 'path'; import * as child_process from 'child_process'; import * as commander from 'commander'; +import * as semver from 'semver'; let homebridge; @@ -34,10 +35,17 @@ class HomebridgeConfigUi { .option('-T, --no-timestamp', '', () => process.env.UIX_LOG_NO_TIMESTAMPS = '1') .parse(process.argv); + if (!semver.satisfies(process.version, '>=10.17.0')) { + const msg = `Node.js v10.17.0 higher is required. You may experience issues running this plugin running on ${process.version}.`; + log.error(msg); + log.warn(msg); + } + if (process.env.UIX_SERVICE_MODE === '1' && process.connected) { this.log('Running in Service Mode'); return; - } else if (config.standalone || process.env.UIX_SERVICE_MODE === '1') { + } else if (config.standalone || process.env.UIX_SERVICE_MODE === '1' || + (process.env.HOMEBRIDGE_CONFIG_UI === '1' && semver.satisfies(process.env.CONFIG_UI_VERSION, '>=3.5.5', { includePrerelease: true }))) { this.log.warn('*********** Homebridge Standalone Mode Is Depreciated **********'); this.log.warn('* Please swap to "service mode" using the hb-service command. *'); this.log.warn('* See https://homebridge.io/w/JUvQr for instructions on how to migrate. *'); diff --git a/src/modules/child-bridges/child-bridges.service.ts b/src/modules/child-bridges/child-bridges.service.ts index e98bf5bb7..f1d63e49b 100644 --- a/src/modules/child-bridges/child-bridges.service.ts +++ b/src/modules/child-bridges/child-bridges.service.ts @@ -1,4 +1,5 @@ import { BadRequestException, Injectable } from '@nestjs/common'; +import * as semver from 'semver'; import { Logger } from '../../core/logger/logger.service'; import { ConfigService } from '../../core/config/config.service'; @@ -30,10 +31,10 @@ export class ChildBridgesService { } /** - * Socket Handler - Per Client - * Start watching for child bridge status events - * @param client - */ + * Socket Handler - Per Client + * Start watching for child bridge status events + * @param client + */ public async watchChildBridgeStatus(client) { const listener = (data) => { client.emit('child-bridge-status-update', data); @@ -59,6 +60,13 @@ export class ChildBridgesService { * @returns */ public stopStartRestartChildBridge(event: 'startChildBridge' | 'stopChildBridge' | 'restartChildBridge', deviceId: string) { + if (['startChildBridge', 'stopChildBridge'].includes(event)) { + if (!semver.satisfies(this.configService.homebridgeVersion, '>=1.5.0-beta.2', { includePrerelease: true })) { + this.logger.error('The stop child bridge requires Homebridge v1.5.0 or later'); + throw new BadRequestException('This command is only available for Homebridge v1.5.0 or later'); + } + } + if (!this.configService.serviceMode) { this.logger.error('The restart child bridge command is only available in service mode'); throw new BadRequestException('This command is only available in service mode'); diff --git a/src/modules/plugins/plugins.service.ts b/src/modules/plugins/plugins.service.ts index f7267ec8c..ed61fc2c8 100755 --- a/src/modules/plugins/plugins.service.ts +++ b/src/modules/plugins/plugins.service.ts @@ -338,6 +338,12 @@ export class PluginsService { throw new Error(`Cannot uninstall ${pluginAction.name} from ${this.configService.name}.`); } + // legacy support for offline docker updates + if (pluginAction.name === this.configService.name && this.configService.dockerOfflineUpdate && pluginAction.version === 'latest') { + await this.updateSelfOffline(client); + return true; + } + // convert 'latest' into a real version if (action === 'install' && pluginAction.version === 'latest') { pluginAction.version = await this.getNpmModuleLatestVersion(pluginAction.name); @@ -472,6 +478,20 @@ export class PluginsService { const homebridgeVersion = semver.parse(homebridge.installedVersion); + // patch for homebridge 1.2.x to allow updates to newer versions of 1.2.x without 1.2.x being set to "latest" + if ( + homebridgeVersion.major === 1 && + homebridgeVersion.minor === 2 && + semver.gt(homebridge.installedVersion, homebridge.latestVersion) + ) { + const versions = await this.getAvailablePluginVersions('homebridge'); + if (versions.tags['release-1.2.x'] && semver.gt(versions.tags['release-1.2.x'], homebridge.installedVersion)) { + homebridge.updateAvailable = true; + homebridge.latestVersion = versions.tags['release-1.2.x']; + } + } + // end patch + // show beta updates if the user is currently running a beta release if ( homebridgeVersion.prerelease[0] === 'beta' && @@ -518,6 +538,22 @@ export class PluginsService { installOptions.push('-g'); } + // 1.2.x -> 1.3.0 upgrade set ciao as bridge advertiser + if (homebridge.installedVersion && homebridgeUpdateAction.version) { + const installedVersion = semver.parse(homebridge.installedVersion); + const targetVersion = semver.parse(homebridgeUpdateAction.version); + if (installedVersion.minor === 2 && targetVersion.minor > 2) { + try { + const config: HomebridgeConfig = await fs.readJson(this.configService.configPath); + config.bridge.advertiser = 'ciao'; + await fs.writeJsonSync(this.configService.configPath, config); + } catch (e) { + this.logger.warn('Could not update config.json', e.message); + } + } + } + // end 1.2.x -> 1.3.0 upgrade + await this.runNpmCommand( [...this.npm, 'install', ...installOptions, `${homebridge.name}@${homebridgeUpdateAction.version}`], installPath, @@ -548,7 +584,7 @@ export class PluginsService { const npm = await this.parsePackageJson(pjson, npmPkg.path) as HomebridgePlugin & { showUpdateWarning?: boolean }; // show the update warning if the installed version is below the minimum recommended - npm.showUpdateWarning = semver.lt(npm.installedVersion, '9.8.1'); + npm.showUpdateWarning = semver.lt(npm.installedVersion, '6.4.1'); this.npmPackage = npm; return npm; @@ -1380,5 +1416,4 @@ export class PluginsService { }, 60000); } } - } diff --git a/src/modules/status/status.service.ts b/src/modules/status/status.service.ts index e61a1bae8..08412fe8e 100644 --- a/src/modules/status/status.service.ts +++ b/src/modules/status/status.service.ts @@ -285,8 +285,8 @@ export class StatusService { client.emit('homebridge-status', await this.getHomebridgeStats()); - // ipc status events are only available in Homebridge 1.3.3 or later (check removed in UI 5.0) - and when running in service mode - if (this.configService.serviceMode) { + // ipc status events are only available in Homebridge 1.3.3 or later - and when running in service mode + if (this.configService.serviceMode && this.configService.homebridgeVersion && semver.gt(this.configService.homebridgeVersion, '1.3.3-beta.5')) { homebridgeStatusChangeSub = this.homebridgeStatusChange.subscribe(async (status) => { client.emit('homebridge-status', await this.getHomebridgeStats()); }); @@ -332,7 +332,7 @@ export class StatusService { * Check if homebridge is running on the local system */ public async checkHomebridgeStatus() { - if (this.configService.serviceMode) { + if (this.configService.serviceMode && this.configService.homebridgeVersion && semver.gt(this.configService.homebridgeVersion, '1.3.3-beta.5')) { return this.homebridgeStatus; } @@ -359,7 +359,6 @@ export class StatusService { } const defaultInterfaceName = await si.networkInterfaceDefault(); - // These ts-ignore should be able to be removed in the next major release of 'systeminformation' (v6) // See https://github.com/sebhildebrandt/systeminformation/issues/775#issuecomment-1741836906 // eslint-disable-next-line @typescript-eslint/ban-ts-comment diff --git a/test/e2e/plugins.gateway.e2e-spec.ts b/test/e2e/plugins.gateway.e2e-spec.ts index 5a6ead494..f2ce8d52b 100644 --- a/test/e2e/plugins.gateway.e2e-spec.ts +++ b/test/e2e/plugins.gateway.e2e-spec.ts @@ -353,6 +353,70 @@ describe('PluginsGateway (e2e)', () => { expect(client.emit).toHaveBeenCalledWith('stdout', expect.stringContaining('Operation succeeded!')); }); + it('ON /plugins/homebridge-update (1.2.x -> 1.3.x)', async () => { + // mock get homebridge package + pluginsService.getHomebridgePackage = async () => { + return { + name: 'homebridge', + private: false, + publicPackage: true, + installPath: pluginsPath, + latestVersion: '1.3.0', + installedVersion: '1.2.5' + }; + }; + + jest.spyOn(nodePtyService, 'spawn') + .mockImplementation(() => { + const term = new EventEmitter(); + setTimeout(() => { + term.emit('exit', 0); + }, 10); + return term; + }); + + const writeJsonMock = jest.spyOn(fs, 'writeJsonSync'); + + try { + await pluginsGateway.homebridgeUpdate(client, { version: 'latest' }); + } catch (e) { } + + // the save config method should have been called + expect(writeJsonMock).toHaveBeenCalled(); + }); + + it('ON /plugins/homebridge-update (1.1.x -> 1.3.x)', async () => { + // mock get homebridge package + pluginsService.getHomebridgePackage = async () => { + return { + name: 'homebridge', + private: false, + publicPackage: true, + installPath: pluginsPath, + latestVersion: '1.3.0', + installedVersion: '1.1.7' + }; + }; + + jest.spyOn(nodePtyService, 'spawn') + .mockImplementation(() => { + const term = new EventEmitter(); + setTimeout(() => { + term.emit('exit', 0); + }, 10); + return term; + }); + + const writeJsonMock = jest.spyOn(fs, 'writeJsonSync'); + + try { + await pluginsGateway.homebridgeUpdate(client, { version: 'latest' }); + } catch (e) { } + + // the save config method should not have been called + expect(writeJsonMock).not.toHaveBeenCalled(); + }); + afterAll(async () => { await app.close(); }); diff --git a/ui/package-lock.json b/ui/package-lock.json index 41cddf490..d93765cea 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -110,12 +110,12 @@ } }, "node_modules/@angular-devkit/architect": { - "version": "0.1402.12", - "resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.1402.12.tgz", - "integrity": "sha512-LuK26pyaqyClEbY0n4/WIh3irUuA8wwmMmEj8uW4boziuJWv7U42lJJRF3VwkchiyOIp8qiKg995K6IoeXkWgA==", + "version": "0.1402.13", + "resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.1402.13.tgz", + "integrity": "sha512-n0ISBuvkZHoOpAzuAZql1TU9VLHUE9e/a9g4VNOPHewjMzpN02VqeGKvJfOCKtzkCs6gVssIlILm2/SXxkIFxQ==", "dev": true, "dependencies": { - "@angular-devkit/core": "14.2.12", + "@angular-devkit/core": "14.2.13", "rxjs": "6.6.7" }, "engines": { @@ -125,15 +125,15 @@ } }, "node_modules/@angular-devkit/build-angular": { - "version": "14.2.12", - "resolved": "https://registry.npmjs.org/@angular-devkit/build-angular/-/build-angular-14.2.12.tgz", - "integrity": "sha512-ei8/FaL80Q6si/aF6FLZgtT4Kr2rudlyGMqQM4Rd2Zvt8mCh3TgM7QdLhoI11t9A0LWz6RIdROlDimMyyOEF6Q==", + "version": "14.2.13", + "resolved": "https://registry.npmjs.org/@angular-devkit/build-angular/-/build-angular-14.2.13.tgz", + "integrity": "sha512-FJZKQ3xYFvEJ807sxVy4bCVyGU2NMl3UUPNfLIdIdzwwDEP9tx/cc+c4VtVPEZZfU8jVenu8XOvL6L0vpjt3yg==", "dev": true, "dependencies": { "@ampproject/remapping": "2.2.0", - "@angular-devkit/architect": "0.1402.12", - "@angular-devkit/build-webpack": "0.1402.12", - "@angular-devkit/core": "14.2.12", + "@angular-devkit/architect": "0.1402.13", + "@angular-devkit/build-webpack": "0.1402.13", + "@angular-devkit/core": "14.2.13", "@babel/core": "7.18.10", "@babel/generator": "7.18.12", "@babel/helper-annotate-as-pure": "7.18.6", @@ -144,7 +144,7 @@ "@babel/runtime": "7.18.9", "@babel/template": "7.18.10", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "14.2.12", + "@ngtools/webpack": "14.2.13", "ansi-colors": "4.1.3", "babel-loader": "8.2.5", "babel-plugin-istanbul": "6.1.1", @@ -169,7 +169,7 @@ "ora": "5.4.1", "parse5-html-rewriting-stream": "6.0.1", "piscina": "3.2.0", - "postcss": "8.4.16", + "postcss": "8.4.31", "postcss-import": "15.0.0", "postcss-loader": "7.0.1", "postcss-preset-env": "7.8.0", @@ -272,12 +272,12 @@ "dev": true }, "node_modules/@angular-devkit/build-webpack": { - "version": "0.1402.12", - "resolved": "https://registry.npmjs.org/@angular-devkit/build-webpack/-/build-webpack-0.1402.12.tgz", - "integrity": "sha512-xBkbSwOhHgUsJk1tTtITqbHHiA0OdjwdrYZYceyfDASAglyRX6rT4Q9/Ppf7TSck6M1tUR76efYOn3D3ial29w==", + "version": "0.1402.13", + "resolved": "https://registry.npmjs.org/@angular-devkit/build-webpack/-/build-webpack-0.1402.13.tgz", + "integrity": "sha512-K27aJmuw86ZOdiu5PoGeGDJ2v7g2ZCK0bGwc8jzkjTLRfvd4FRKIIZumGv3hbQ3vQRLikiU6WMDRTFyCZky/EA==", "dev": true, "dependencies": { - "@angular-devkit/architect": "0.1402.12", + "@angular-devkit/architect": "0.1402.13", "rxjs": "6.6.7" }, "engines": { @@ -291,9 +291,9 @@ } }, "node_modules/@angular-devkit/core": { - "version": "14.2.12", - "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-14.2.12.tgz", - "integrity": "sha512-tg1+deEZdm3fgk2BQ6y7tujciL6qhtN5Ums266lX//kAZeZ4nNNXTBT+oY5xgfjvmLbW+xKg0XZrAS0oIRKY5g==", + "version": "14.2.13", + "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-14.2.13.tgz", + "integrity": "sha512-aIefeZcbjghQg/V6U9CTLtyB5fXDJ63KwYqVYkWP+i0XriS5A9puFgq2u/OVsWxAfYvqpDqp5AdQ0g0bi3CAsA==", "dev": true, "dependencies": { "ajv": "8.11.0", @@ -339,12 +339,12 @@ "dev": true }, "node_modules/@angular-devkit/schematics": { - "version": "14.2.12", - "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-14.2.12.tgz", - "integrity": "sha512-MN5yGR+SSSPPBBVMf4cifDJn9u0IYvxiHst+HWokH2AkBYy+vB1x8jYES2l1wkiISD7nvjTixfqX+Y95oMBoLg==", + "version": "14.2.13", + "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-14.2.13.tgz", + "integrity": "sha512-2zczyeNzeBcrT2HOysv52X9SH3tZoHfWJvVf6H0SIa74rfDKEl7hFpKNXnh3x8sIMLj5mZn05n5RCqGxCczcIg==", "dev": true, "dependencies": { - "@angular-devkit/core": "14.2.12", + "@angular-devkit/core": "14.2.13", "jsonc-parser": "3.1.0", "magic-string": "0.26.2", "ora": "5.4.1", @@ -463,15 +463,15 @@ } }, "node_modules/@angular/cli": { - "version": "14.2.12", - "resolved": "https://registry.npmjs.org/@angular/cli/-/cli-14.2.12.tgz", - "integrity": "sha512-G/785b6jIIX7J+zS8RHaCT1OYzqANw5hJlnLf8tLgmaadLMVNQvIrvHTYtmD86pbqCYyVDLoMxefxRIwMHJuqw==", + "version": "14.2.13", + "resolved": "https://registry.npmjs.org/@angular/cli/-/cli-14.2.13.tgz", + "integrity": "sha512-I5EepRem2CCyS3GDzQxZ2ZrqQwVqoGoLY+ZQhsK1QGWUnUyFOjbv3OlUGxRUYwcedu19V1EBAKjmQ96HzMIcVQ==", "dev": true, "dependencies": { - "@angular-devkit/architect": "0.1402.12", - "@angular-devkit/core": "14.2.12", - "@angular-devkit/schematics": "14.2.12", - "@schematics/angular": "14.2.12", + "@angular-devkit/architect": "0.1402.13", + "@angular-devkit/core": "14.2.13", + "@angular-devkit/schematics": "14.2.13", + "@schematics/angular": "14.2.13", "@yarnpkg/lockfile": "1.1.0", "ansi-colors": "4.1.3", "debug": "4.3.4", @@ -2938,9 +2938,9 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.9.0", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.9.0.tgz", - "integrity": "sha512-zJmuCWj2VLBt4c25CfBIbMZLGLyhkvs7LznyVX5HfpzeocThgIj5XQK4L+g3U36mMcx8bPMhGyPpwCATamC4jQ==", + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.9.1.tgz", + "integrity": "sha512-Y27x+MBLjXa+0JWDhykM3+JE+il3kHKAEqabfEWq3SDhZjLYb6/BHL/JKFnH3fe207JaXkyDo685Oc2Glt6ifA==", "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" @@ -2986,9 +2986,9 @@ } }, "node_modules/@eslint/eslintrc/node_modules/globals": { - "version": "13.22.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.22.0.tgz", - "integrity": "sha512-H1Ddc/PbZHTDVJSnj8kWptIRSD6AM3pK+mKytuIVF4uoBV7rshFlhhvA58ceJ5wp3Er58w6zj7bykMpYXt3ETw==", + "version": "13.23.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", + "integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -3329,9 +3329,9 @@ } }, "node_modules/@ngtools/webpack": { - "version": "14.2.12", - "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-14.2.12.tgz", - "integrity": "sha512-d/NRQAjS3BsMDUpLrhza+bvI7HKIV+lyRAvD3LYj5FE9kMoEGw4zRo9JG8ookCzvT2FjNiXQ7DWDZSAeMOy+WQ==", + "version": "14.2.13", + "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-14.2.13.tgz", + "integrity": "sha512-RQx/rGX7K/+R55x1R6Ax1JzyeHi8cW11dEXpzHWipyuSpusQLUN53F02eMB4VTakXsL3mFNWWy4bX3/LSq8/9w==", "dev": true, "engines": { "node": "^14.15.0 || >=16.10.0", @@ -3567,13 +3567,13 @@ } }, "node_modules/@schematics/angular": { - "version": "14.2.12", - "resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-14.2.12.tgz", - "integrity": "sha512-nCxoFzH/uh5vqhaAjAfQIBgGuCdV3RMjdSwD0VQ+GFiFvTe8rqFyDl+qpNCgETz4LwmGHb5HNjDH9+VyVLgfZQ==", + "version": "14.2.13", + "resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-14.2.13.tgz", + "integrity": "sha512-MLxTpTU3E8QACQ/5c0sENMR2gRiMXpGaKeD5IHY+3wyU2fUSJVB0QPU/l1WhoyZbX8N9ospBgf5UEG7taVF9rg==", "dev": true, "dependencies": { - "@angular-devkit/core": "14.2.12", - "@angular-devkit/schematics": "14.2.12", + "@angular-devkit/core": "14.2.13", + "@angular-devkit/schematics": "14.2.13", "jsonc-parser": "3.1.0" }, "engines": { @@ -3750,9 +3750,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "16.18.55", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.55.tgz", - "integrity": "sha512-Y1zz/LIuJek01+hlPNzzXQhmq/Z2BCP96j18MSXC0S0jSu/IG4FFxmBs7W4/lI2vPJ7foVfEB0hUVtnOjnCiTg==", + "version": "16.18.57", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.57.tgz", + "integrity": "sha512-piPoDozdPaX1hNWFJQzzgWqE40gh986VvVx/QO9RU4qYRE55ld7iepDVgZ3ccGUw0R4wge0Oy1dd+3xOQNkkUQ==", "dev": true }, "node_modules/@types/parse-json": { @@ -5406,9 +5406,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001541", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001541.tgz", - "integrity": "sha512-bLOsqxDgTqUBkzxbNlSBt8annkDpQB9NdzdTbO2ooJ+eC/IQcvDspDc058g84ejCelF7vHUx57KIOjEecOHXaw==", + "version": "1.0.30001546", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001546.tgz", + "integrity": "sha512-zvtSJwuQFpewSyRrI3AsftF6rM0X80mZkChIt1spBGEvRglCrjTniXvinc8JKRoqTwXAgvqTImaN9igfSMtUBw==", "funding": [ { "type": "opencollective", @@ -6008,12 +6008,12 @@ } }, "node_modules/core-js-compat": { - "version": "3.32.2", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.32.2.tgz", - "integrity": "sha512-+GjlguTDINOijtVRUxrQOv3kfu9rl+qPNdX2LTbJ/ZyVTuxK+ksVSAGX1nHstu4hrv1En/uPTtWgq2gI5wt4AQ==", + "version": "3.33.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.33.0.tgz", + "integrity": "sha512-0w4LcLXsVEuNkIqwjjf9rjCoPhK8uqA4tMRh4Ge26vfLtUutshn+aRJU21I9LCJlh2QQHfisNToLjw1XEJLTWw==", "dev": true, "dependencies": { - "browserslist": "^4.21.10" + "browserslist": "^4.22.1" }, "funding": { "type": "opencollective", @@ -6021,9 +6021,9 @@ } }, "node_modules/core-js-pure": { - "version": "3.32.2", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.32.2.tgz", - "integrity": "sha512-Y2rxThOuNywTjnX/PgA5vWM6CZ9QB9sz9oGeCixV8MqXZO70z/5SHzf9EeBrEBK0PN36DnEBBu9O/aGWzKuMZQ==", + "version": "3.33.0", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.33.0.tgz", + "integrity": "sha512-FKSIDtJnds/YFIEaZ4HszRX7hkxGpNKM7FC9aJ9WLJbSd3lD4vOltFuVIBLR8asSx9frkTSqL0dw90SKQxgKrg==", "hasInstallScript": true, "funding": { "type": "opencollective", @@ -6283,9 +6283,9 @@ } }, "node_modules/cssdb": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/cssdb/-/cssdb-7.7.2.tgz", - "integrity": "sha512-pQPYP7/kch4QlkTcLuUNiNL2v/E+O+VIdotT+ug62/+2B2/jkzs5fMM6RHCzGCZ9C82pODEMSIzRRUzJOrl78g==", + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/cssdb/-/cssdb-7.7.3.tgz", + "integrity": "sha512-QPbpOl+jR13quGTIvwCavognmtpr6T9ra6G9S++scJek7BY4xdkJpB3slU1JkjQmzKmpDHnPB+wkz+mxoT/h4w==", "dev": true, "funding": [ { @@ -6630,9 +6630,9 @@ "dev": true }, "node_modules/electron-to-chromium": { - "version": "1.4.537", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.537.tgz", - "integrity": "sha512-W1+g9qs9hviII0HAwOdehGYkr+zt7KKdmCcJcjH0mYg6oL8+ioT3Skjmt7BLoAQqXhjf40AXd+HlR4oAWMlXjA==" + "version": "1.4.544", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.544.tgz", + "integrity": "sha512-54z7squS1FyFRSUqq/knOFSptjjogLZXbKcYk3B0qkE1KZzvqASwRZnY2KzZQJqIYLVD38XZeoiMRflYSwyO4w==" }, "node_modules/emoji-regex": { "version": "8.0.0", @@ -7694,9 +7694,9 @@ } }, "node_modules/eslint/node_modules/globals": { - "version": "13.22.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.22.0.tgz", - "integrity": "sha512-H1Ddc/PbZHTDVJSnj8kWptIRSD6AM3pK+mKytuIVF4uoBV7rshFlhhvA58ceJ5wp3Er58w6zj7bykMpYXt3ETw==", + "version": "13.23.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", + "integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -8195,12 +8195,12 @@ } }, "node_modules/flat-cache": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.0.tgz", - "integrity": "sha512-OHx4Qwrrt0E4jEIcI5/Xb+f+QmJYNj2rrK8wiIdQOIrB9WrrJL8cjZvXdXuBTkkEwEqLycb5BeZDV1o2i9bTew==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.1.tgz", + "integrity": "sha512-/qM2b3LUIaIgviBQovTLvijfyOQXPtSRnRK26ksj2J7rzPIecePUIpJsZ4T02Qg+xiAEKIs5K8dsHEd+VaKa/Q==", "dev": true, "dependencies": { - "flatted": "^3.2.7", + "flatted": "^3.2.9", "keyv": "^4.5.3", "rimraf": "^3.0.2" }, @@ -8579,13 +8579,10 @@ "dev": true }, "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.4.tgz", + "integrity": "sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ==", "dev": true, - "dependencies": { - "function-bind": "^1.1.1" - }, "engines": { "node": ">= 0.4.0" } @@ -11914,9 +11911,9 @@ } }, "node_modules/postcss": { - "version": "8.4.16", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.16.tgz", - "integrity": "sha512-ipHE1XBvKzm5xI7hiHCZJCSugxvsdq2mPnsq5+UF+VHCjiBvtDrlxJfMBToWaP9D5XlgNmcFGqoHmUn0EYEaRQ==", + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", "dev": true, "funding": [ { @@ -11926,10 +11923,14 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ], "dependencies": { - "nanoid": "^3.3.4", + "nanoid": "^3.3.6", "picocolors": "^1.0.0", "source-map-js": "^1.0.2" }, @@ -13913,9 +13914,9 @@ } }, "node_modules/spdx-license-ids": { - "version": "3.0.15", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.15.tgz", - "integrity": "sha512-lpT8hSQp9jAKp9mhtBU4Xjon8LPGBvLIuBiSVhMEtmLecTh2mO0tlqrAMp47tBXzMr13NJMQ2lf7RpQGLJ3HsQ==", + "version": "3.0.16", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.16.tgz", + "integrity": "sha512-eWN+LnM3GR6gPu35WxNgbGl8rmY1AEmoMDvL/QD6zYmPWgywxWqJWNdLGT+ke8dKNWrcYgYjPpG5gbTfghP8rw==", "dev": true }, "node_modules/spdy": { @@ -14359,9 +14360,9 @@ } }, "node_modules/terser-webpack-plugin/node_modules/terser": { - "version": "5.20.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.20.0.tgz", - "integrity": "sha512-e56ETryaQDyebBwJIWYB2TT6f2EZ0fL0sW/JRXNMN26zZdKi2u/E/5my5lG6jNxym6qsrVXfFRmOdV42zlAgLQ==", + "version": "5.21.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.21.0.tgz", + "integrity": "sha512-WtnFKrxu9kaoXuiZFSGrcAvvBqAdmKx0SFNmVNYdJamMu9yyN3I/QF0FbH4QcqJQ+y1CJnzxGIKH0cSj+FGYRw==", "dev": true, "dependencies": { "@jridgewell/source-map": "^0.3.3", diff --git a/ui/src/app/core/manage-plugins/manage-plugins-modal/manage-plugins-modal.component.ts b/ui/src/app/core/manage-plugins/manage-plugins-modal/manage-plugins-modal.component.ts index 0aff27f66..602d95e69 100644 --- a/ui/src/app/core/manage-plugins/manage-plugins-modal/manage-plugins-modal.component.ts +++ b/ui/src/app/core/manage-plugins/manage-plugins-modal/manage-plugins-modal.component.ts @@ -159,6 +159,11 @@ export class ManagePluginsModalComponent implements OnInit, OnDestroy { (data) => { if (this.pluginName === 'homebridge-config-ui-x') { this.updateSelf = true; + if (this.$settings.env.dockerOfflineUpdate && this.targetVersion === 'latest') { + this.$router.navigate(['/platform-tools/docker/restart-container']); + this.activeModal.close(); + return; + } } this.$router.navigate(['/plugins']); this.$toastr.success(`${this.pastTenseVerb} ${this.pluginName}`, this.toastSuccess); diff --git a/ui/src/app/core/settings.service.ts b/ui/src/app/core/settings.service.ts index 8fd8f5016..b2d847745 100644 --- a/ui/src/app/core/settings.service.ts +++ b/ui/src/app/core/settings.service.ts @@ -24,6 +24,7 @@ interface EnvInterface { runningInPackageMode: boolean; runningOnRaspberryPi: boolean; canShutdownRestartHost: boolean; + dockerOfflineUpdate: boolean; serviceMode: boolean; lang: string | null; temperatureUnits: 'c' | 'f'; diff --git a/ui/src/app/modules/plugins/plugin-card/plugin-card.component.html b/ui/src/app/modules/plugins/plugin-card/plugin-card.component.html index 69de7ea8a..94056bfd5 100644 --- a/ui/src/app/modules/plugins/plugin-card/plugin-card.component.html +++ b/ui/src/app/modules/plugins/plugin-card/plugin-card.component.html @@ -3,7 +3,7 @@
+ [translate]="'plugins.status_installed'"> Installed
@@ -19,18 +19,18 @@
@{{ plugin.author }} + [href]="'https://www.npmjs.com/~' + plugin.author">@{{ plugin.author }}
+ (click)="openFundingModal(plugin)">
{{ 'plugins.donate.button_donate' | translate }}
+ href="https://github.com/homebridge/homebridge/wiki/verified-Plugins" ngbTooltip="@{{ plugin.author }}">
Verified
@@ -51,22 +51,22 @@
{{ 'plugins.button_settings' | translate | uppercase }}
+ placement="bottom" ngbTooltip="{{'plugins.tooltip_update_plugin_to' | translate:plugin }}" container="body"
+ openDelay="150" [translate]="'plugins.button_update'">
{{ 'plugins.button_update' | translate | uppercase }}
+ (click)="$plugin.installPlugin(plugin.name)">
{{ 'plugins.button_install' | translate | uppercase }}