homebridge-config-ui-x 5.9.1-beta.1 → 5.9.1-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -3
- package/TODO-MATTER.md +15 -0
- package/dist/app.controller.d.ts +1 -1
- package/dist/app.controller.js +14 -12
- package/dist/app.controller.js.map +1 -1
- package/dist/app.gateway.js +7 -10
- package/dist/app.gateway.js.map +1 -1
- package/dist/app.module.js +42 -43
- package/dist/app.module.js.map +1 -1
- package/dist/app.service.js +4 -7
- package/dist/app.service.js.map +1 -1
- package/dist/bin/base-platform.d.ts +1 -1
- package/dist/bin/base-platform.js +11 -17
- package/dist/bin/base-platform.js.map +1 -1
- package/dist/bin/fork.js +7 -45
- package/dist/bin/fork.js.map +1 -1
- package/dist/bin/hb-service.js +224 -243
- package/dist/bin/hb-service.js.map +1 -1
- package/dist/bin/platforms/darwin.d.ts +1 -1
- package/dist/bin/platforms/darwin.js +61 -65
- package/dist/bin/platforms/darwin.js.map +1 -1
- package/dist/bin/platforms/freebsd.d.ts +1 -1
- package/dist/bin/platforms/freebsd.js +42 -47
- package/dist/bin/platforms/freebsd.js.map +1 -1
- package/dist/bin/platforms/linux.d.ts +1 -1
- package/dist/bin/platforms/linux.js +127 -132
- package/dist/bin/platforms/linux.js.map +1 -1
- package/dist/bin/platforms/win32.d.ts +1 -1
- package/dist/bin/platforms/win32.js +30 -36
- package/dist/bin/platforms/win32.js.map +1 -1
- package/dist/bin/standalone.js +15 -53
- package/dist/bin/standalone.js.map +1 -1
- package/dist/core/auth/auth.controller.d.ts +5 -4
- package/dist/core/auth/auth.controller.js +40 -39
- package/dist/core/auth/auth.controller.js.map +1 -1
- package/dist/core/auth/auth.dto.js +17 -18
- package/dist/core/auth/auth.dto.js.map +1 -1
- package/dist/core/auth/auth.module.js +28 -31
- package/dist/core/auth/auth.module.js.map +1 -1
- package/dist/core/auth/auth.service.d.ts +3 -3
- package/dist/core/auth/auth.service.js +65 -62
- package/dist/core/auth/auth.service.js.map +1 -1
- package/dist/core/auth/guards/admin.guard.js +4 -7
- package/dist/core/auth/guards/admin.guard.js.map +1 -1
- package/dist/core/auth/guards/custom.guard.js +6 -9
- package/dist/core/auth/guards/custom.guard.js.map +1 -1
- package/dist/core/auth/guards/ws-admin-guard.d.ts +2 -2
- package/dist/core/auth/guards/ws-admin-guard.js +13 -11
- package/dist/core/auth/guards/ws-admin-guard.js.map +1 -1
- package/dist/core/auth/guards/ws.guard.d.ts +2 -2
- package/dist/core/auth/guards/ws.guard.js +13 -11
- package/dist/core/auth/guards/ws.guard.js.map +1 -1
- package/dist/core/auth/jwt.strategy.d.ts +3 -2
- package/dist/core/auth/jwt.strategy.js +21 -16
- package/dist/core/auth/jwt.strategy.js.map +1 -1
- package/dist/core/config/config.interfaces.d.ts +8 -1
- package/dist/core/config/config.interfaces.js +1 -2
- package/dist/core/config/config.module.js +8 -10
- package/dist/core/config/config.module.js.map +1 -1
- package/dist/core/config/config.service.d.ts +4 -3
- package/dist/core/config/config.service.js +90 -83
- package/dist/core/config/config.service.js.map +1 -1
- package/dist/core/config/config.startup.d.ts +1 -1
- package/dist/core/config/config.startup.js +23 -28
- package/dist/core/config/config.startup.js.map +1 -1
- package/dist/core/feature-flags/feature-flags.registry.js +2 -5
- package/dist/core/feature-flags/feature-flags.registry.js.map +1 -1
- package/dist/core/homebridge-ipc/homebridge-ipc.module.js +11 -14
- package/dist/core/homebridge-ipc/homebridge-ipc.module.js.map +1 -1
- package/dist/core/homebridge-ipc/homebridge-ipc.service.d.ts +4 -4
- package/dist/core/homebridge-ipc/homebridge-ipc.service.js +25 -19
- package/dist/core/homebridge-ipc/homebridge-ipc.service.js.map +1 -1
- package/dist/core/logger/logger.module.js +8 -10
- package/dist/core/logger/logger.module.js.map +1 -1
- package/dist/core/logger/logger.service.js +13 -23
- package/dist/core/logger/logger.service.js.map +1 -1
- package/dist/core/node-pty/node-pty.module.js +7 -10
- package/dist/core/node-pty/node-pty.module.js.map +1 -1
- package/dist/core/node-pty/node-pty.service.js +6 -11
- package/dist/core/node-pty/node-pty.service.js.map +1 -1
- package/dist/core/node-version.constants.js +4 -11
- package/dist/core/node-version.constants.js.map +1 -1
- package/dist/core/scheduler/scheduler.module.js +15 -10
- package/dist/core/scheduler/scheduler.module.js.map +1 -1
- package/dist/core/scheduler/scheduler.service.d.ts +12 -1
- package/dist/core/scheduler/scheduler.service.js +101 -13
- package/dist/core/scheduler/scheduler.service.js.map +1 -1
- package/dist/core/spa/spa-html.service.js +9 -15
- package/dist/core/spa/spa-html.service.js.map +1 -1
- package/dist/core/spa/spa.filter.d.ts +1 -1
- package/dist/core/spa/spa.filter.js +11 -16
- package/dist/core/spa/spa.filter.js.map +1 -1
- package/dist/core/ssl/ssl-cert-generator.service.js +34 -36
- package/dist/core/ssl/ssl-cert-generator.service.js.map +1 -1
- package/dist/env-setup.d.ts +1 -0
- package/dist/env-setup.js +7 -0
- package/dist/env-setup.js.map +1 -0
- package/dist/globalDefaults.d.ts +1 -0
- package/dist/globalDefaults.js +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +16 -19
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts +5 -3
- package/dist/main.js +44 -51
- package/dist/main.js.map +1 -1
- package/dist/modules/accessories/accessories.controller.d.ts +3 -3
- package/dist/modules/accessories/accessories.controller.js +28 -29
- package/dist/modules/accessories/accessories.controller.js.map +1 -1
- package/dist/modules/accessories/accessories.dto.js +11 -13
- package/dist/modules/accessories/accessories.dto.js.map +1 -1
- package/dist/modules/accessories/accessories.gateway.d.ts +2 -2
- package/dist/modules/accessories/accessories.gateway.js +18 -16
- package/dist/modules/accessories/accessories.gateway.js.map +1 -1
- package/dist/modules/accessories/accessories.interfaces.d.ts +94 -0
- package/dist/modules/accessories/accessories.interfaces.js +2 -0
- package/dist/modules/accessories/accessories.interfaces.js.map +1 -0
- package/dist/modules/accessories/accessories.module.js +19 -20
- package/dist/modules/accessories/accessories.module.js.map +1 -1
- package/dist/modules/accessories/accessories.service.d.ts +23 -5
- package/dist/modules/accessories/accessories.service.js +316 -51
- package/dist/modules/accessories/accessories.service.js.map +1 -1
- package/dist/modules/backup/backup.controller.d.ts +4 -4
- package/dist/modules/backup/backup.controller.js +68 -67
- package/dist/modules/backup/backup.controller.js.map +1 -1
- package/dist/modules/backup/backup.gateway.d.ts +4 -4
- package/dist/modules/backup/backup.gateway.js +25 -21
- package/dist/modules/backup/backup.gateway.js.map +1 -1
- package/dist/modules/backup/backup.module.js +22 -25
- package/dist/modules/backup/backup.module.js.map +1 -1
- package/dist/modules/backup/backup.service.d.ts +5 -5
- package/dist/modules/backup/backup.service.js +143 -133
- package/dist/modules/backup/backup.service.js.map +1 -1
- package/dist/modules/child-bridges/child-bridges.gateway.d.ts +3 -3
- package/dist/modules/child-bridges/child-bridges.gateway.js +23 -21
- package/dist/modules/child-bridges/child-bridges.gateway.js.map +1 -1
- package/dist/modules/child-bridges/child-bridges.interfaces.js +1 -2
- package/dist/modules/child-bridges/child-bridges.module.js +19 -22
- package/dist/modules/child-bridges/child-bridges.module.js.map +1 -1
- package/dist/modules/child-bridges/child-bridges.service.d.ts +3 -3
- package/dist/modules/child-bridges/child-bridges.service.js +15 -11
- package/dist/modules/child-bridges/child-bridges.service.js.map +1 -1
- package/dist/modules/config-editor/config-editor.controller.d.ts +13 -11
- package/dist/modules/config-editor/config-editor.controller.js +168 -103
- package/dist/modules/config-editor/config-editor.controller.js.map +1 -1
- package/dist/modules/config-editor/config-editor.dto.d.ts +6 -0
- package/dist/modules/config-editor/config-editor.dto.js +40 -0
- package/dist/modules/config-editor/config-editor.dto.js.map +1 -0
- package/dist/modules/config-editor/config-editor.module.js +21 -24
- package/dist/modules/config-editor/config-editor.module.js.map +1 -1
- package/dist/modules/config-editor/config-editor.service.d.ts +11 -8
- package/dist/modules/config-editor/config-editor.service.js +123 -66
- package/dist/modules/config-editor/config-editor.service.js.map +1 -1
- package/dist/modules/custom-plugins/custom-plugins.module.js +10 -13
- package/dist/modules/custom-plugins/custom-plugins.module.js.map +1 -1
- package/dist/modules/custom-plugins/homebridge-deconz/homebridge-deconz.controller.d.ts +2 -2
- package/dist/modules/custom-plugins/homebridge-deconz/homebridge-deconz.controller.js +21 -19
- package/dist/modules/custom-plugins/homebridge-deconz/homebridge-deconz.controller.js.map +1 -1
- package/dist/modules/custom-plugins/homebridge-deconz/homebridge-deconz.module.js +14 -17
- package/dist/modules/custom-plugins/homebridge-deconz/homebridge-deconz.module.js.map +1 -1
- package/dist/modules/custom-plugins/homebridge-deconz/homebridge-deconz.service.d.ts +2 -2
- package/dist/modules/custom-plugins/homebridge-deconz/homebridge-deconz.service.js +18 -15
- package/dist/modules/custom-plugins/homebridge-deconz/homebridge-deconz.service.js.map +1 -1
- package/dist/modules/custom-plugins/homebridge-hue/homebridge-hue.controller.d.ts +2 -2
- package/dist/modules/custom-plugins/homebridge-hue/homebridge-hue.controller.js +21 -19
- package/dist/modules/custom-plugins/homebridge-hue/homebridge-hue.controller.js.map +1 -1
- package/dist/modules/custom-plugins/homebridge-hue/homebridge-hue.module.js +14 -17
- package/dist/modules/custom-plugins/homebridge-hue/homebridge-hue.module.js.map +1 -1
- package/dist/modules/custom-plugins/homebridge-hue/homebridge-hue.service.d.ts +2 -2
- package/dist/modules/custom-plugins/homebridge-hue/homebridge-hue.service.js +18 -15
- package/dist/modules/custom-plugins/homebridge-hue/homebridge-hue.service.js.map +1 -1
- package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.controller.d.ts +2 -2
- package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.controller.js +18 -19
- package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.controller.js.map +1 -1
- package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.gateway.d.ts +2 -2
- package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.gateway.js +15 -13
- package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.gateway.js.map +1 -1
- package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.module.js +18 -21
- package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.module.js.map +1 -1
- package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.service.d.ts +8 -8
- package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.service.js +47 -41
- package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.service.js.map +1 -1
- package/dist/modules/log/log.gateway.d.ts +3 -3
- package/dist/modules/log/log.gateway.js +15 -13
- package/dist/modules/log/log.gateway.js.map +1 -1
- package/dist/modules/log/log.interfaces.js +1 -2
- package/dist/modules/log/log.module.js +14 -17
- package/dist/modules/log/log.module.js.map +1 -1
- package/dist/modules/log/log.service.d.ts +5 -5
- package/dist/modules/log/log.service.js +47 -43
- package/dist/modules/log/log.service.js.map +1 -1
- package/dist/modules/platform-tools/docker/docker.controller.d.ts +1 -1
- package/dist/modules/platform-tools/docker/docker.controller.js +24 -25
- package/dist/modules/platform-tools/docker/docker.controller.js.map +1 -1
- package/dist/modules/platform-tools/docker/docker.module.js +14 -17
- package/dist/modules/platform-tools/docker/docker.module.js.map +1 -1
- package/dist/modules/platform-tools/docker/docker.service.d.ts +2 -2
- package/dist/modules/platform-tools/docker/docker.service.js +20 -16
- package/dist/modules/platform-tools/docker/docker.service.js.map +1 -1
- package/dist/modules/platform-tools/hb-service/hb-service.controller.d.ts +2 -2
- package/dist/modules/platform-tools/hb-service/hb-service.controller.js +35 -36
- package/dist/modules/platform-tools/hb-service/hb-service.controller.js.map +1 -1
- package/dist/modules/platform-tools/hb-service/hb-service.dto.js +20 -19
- package/dist/modules/platform-tools/hb-service/hb-service.dto.js.map +1 -1
- package/dist/modules/platform-tools/hb-service/hb-service.module.js +14 -17
- package/dist/modules/platform-tools/hb-service/hb-service.module.js.map +1 -1
- package/dist/modules/platform-tools/hb-service/hb-service.service.d.ts +3 -3
- package/dist/modules/platform-tools/hb-service/hb-service.service.js +37 -30
- package/dist/modules/platform-tools/hb-service/hb-service.service.js.map +1 -1
- package/dist/modules/platform-tools/linux/linux.controller.d.ts +1 -1
- package/dist/modules/platform-tools/linux/linux.controller.js +23 -21
- package/dist/modules/platform-tools/linux/linux.controller.js.map +1 -1
- package/dist/modules/platform-tools/linux/linux.module.js +14 -17
- package/dist/modules/platform-tools/linux/linux.module.js.map +1 -1
- package/dist/modules/platform-tools/linux/linux.service.d.ts +2 -2
- package/dist/modules/platform-tools/linux/linux.service.js +18 -14
- package/dist/modules/platform-tools/linux/linux.service.js.map +1 -1
- package/dist/modules/platform-tools/platform-tools.module.js +12 -15
- package/dist/modules/platform-tools/platform-tools.module.js.map +1 -1
- package/dist/modules/platform-tools/terminal/terminal.controller.d.ts +1 -1
- package/dist/modules/platform-tools/terminal/terminal.controller.js +15 -13
- package/dist/modules/platform-tools/terminal/terminal.controller.js.map +1 -1
- package/dist/modules/platform-tools/terminal/terminal.gateway.d.ts +2 -2
- package/dist/modules/platform-tools/terminal/terminal.gateway.js +17 -15
- package/dist/modules/platform-tools/terminal/terminal.gateway.js.map +1 -1
- package/dist/modules/platform-tools/terminal/terminal.interfaces.js +1 -2
- package/dist/modules/platform-tools/terminal/terminal.module.js +18 -21
- package/dist/modules/platform-tools/terminal/terminal.module.js.map +1 -1
- package/dist/modules/platform-tools/terminal/terminal.service.d.ts +7 -7
- package/dist/modules/platform-tools/terminal/terminal.service.js +33 -28
- package/dist/modules/platform-tools/terminal/terminal.service.js.map +1 -1
- package/dist/modules/plugins/plugins.controller.d.ts +12 -7
- package/dist/modules/plugins/plugins.controller.js +100 -52
- package/dist/modules/plugins/plugins.controller.js.map +1 -1
- package/dist/modules/plugins/plugins.dto.js +26 -24
- package/dist/modules/plugins/plugins.dto.js.map +1 -1
- package/dist/modules/plugins/plugins.gateway.d.ts +5 -5
- package/dist/modules/plugins/plugins.gateway.js +38 -34
- package/dist/modules/plugins/plugins.gateway.js.map +1 -1
- package/dist/modules/plugins/plugins.interfaces.js +1 -2
- package/dist/modules/plugins/plugins.module.js +27 -26
- package/dist/modules/plugins/plugins.module.js.map +1 -1
- package/dist/modules/plugins/plugins.service.d.ts +26 -13
- package/dist/modules/plugins/plugins.service.js +365 -203
- package/dist/modules/plugins/plugins.service.js.map +1 -1
- package/dist/modules/server/server.controller.d.ts +7 -7
- package/dist/modules/server/server.controller.js +208 -205
- package/dist/modules/server/server.controller.js.map +1 -1
- package/dist/modules/server/server.dto.js +13 -16
- package/dist/modules/server/server.dto.js.map +1 -1
- package/dist/modules/server/server.module.js +23 -26
- package/dist/modules/server/server.module.js.map +1 -1
- package/dist/modules/server/server.service.d.ts +6 -6
- package/dist/modules/server/server.service.js +202 -224
- package/dist/modules/server/server.service.js.map +1 -1
- package/dist/modules/setup-wizard/setup-wizard.controller.d.ts +3 -3
- package/dist/modules/setup-wizard/setup-wizard.controller.js +19 -20
- package/dist/modules/setup-wizard/setup-wizard.controller.js.map +1 -1
- package/dist/modules/setup-wizard/setup-wizard.gateway.d.ts +4 -4
- package/dist/modules/setup-wizard/setup-wizard.gateway.js +25 -21
- package/dist/modules/setup-wizard/setup-wizard.gateway.js.map +1 -1
- package/dist/modules/setup-wizard/setup-wizard.guard.d.ts +2 -2
- package/dist/modules/setup-wizard/setup-wizard.guard.js +11 -9
- package/dist/modules/setup-wizard/setup-wizard.guard.js.map +1 -1
- package/dist/modules/setup-wizard/setup-wizard.module.js +12 -15
- package/dist/modules/setup-wizard/setup-wizard.module.js.map +1 -1
- package/dist/modules/status/status.controller.d.ts +5 -5
- package/dist/modules/status/status.controller.js +40 -36
- package/dist/modules/status/status.controller.js.map +1 -1
- package/dist/modules/status/status.gateway.d.ts +11 -11
- package/dist/modules/status/status.gateway.js +51 -47
- package/dist/modules/status/status.gateway.js.map +1 -1
- package/dist/modules/status/status.interfaces.js +2 -5
- package/dist/modules/status/status.interfaces.js.map +1 -1
- package/dist/modules/status/status.module.js +26 -29
- package/dist/modules/status/status.module.js.map +1 -1
- package/dist/modules/status/status.service.d.ts +13 -13
- package/dist/modules/status/status.service.js +100 -88
- package/dist/modules/status/status.service.js.map +1 -1
- package/dist/modules/users/users.controller.d.ts +3 -3
- package/dist/modules/users/users.controller.js +59 -60
- package/dist/modules/users/users.controller.js.map +1 -1
- package/dist/modules/users/users.dto.js +51 -45
- package/dist/modules/users/users.dto.js.map +1 -1
- package/dist/modules/users/users.module.js +14 -17
- package/dist/modules/users/users.module.js.map +1 -1
- package/dist/self-check.js +25 -25
- package/dist/self-check.js.map +1 -1
- package/package.json +14 -12
- package/public/3rdpartylicenses.txt +26 -26
- package/public/{chunk-6KT3BYU6.js → chunk-2UCXG3TD.js} +1 -1
- package/public/{chunk-5T4JHJYL.js → chunk-2VYE34OE.js} +1 -1
- package/public/{chunk-TOYVIOBH.js → chunk-4AG5CIDJ.js} +1 -1
- package/public/{chunk-RMZRXORR.js → chunk-4H57TZAE.js} +1 -1
- package/public/{chunk-73TX7DHV.js → chunk-5CCE4FIL.js} +1 -1
- package/public/{chunk-2CNQY2E7.js → chunk-5RBSMCFS.js} +1 -1
- package/public/{chunk-LZOHFRHN.js → chunk-6O32KEYY.js} +1 -1
- package/public/{chunk-EAGKQ5OJ.js → chunk-7K67C3PU.js} +1 -1
- package/public/{chunk-732XLY23.js → chunk-7PEOCUE2.js} +3 -3
- package/public/{chunk-W3SNJ7TC.js → chunk-7RXQUWCY.js} +1 -1
- package/public/{chunk-EVND2DL5.js → chunk-7SZF43OV.js} +1 -1
- package/public/chunk-AEYQANK4.js +68 -0
- package/public/{chunk-2KEG7SYT.js → chunk-AU2Q4PYM.js} +1 -1
- package/public/chunk-AZIULTML.js +1 -0
- package/public/chunk-B63E4PTS.js +19 -0
- package/public/{chunk-X5AKILHJ.js → chunk-CT6TS63V.js} +1 -1
- package/public/{chunk-LWAL5JUG.js → chunk-DGS32J2V.js} +1 -1
- package/public/{chunk-D5RKKI2A.js → chunk-DWAKEAKY.js} +1 -1
- package/public/chunk-DZVJNQPQ.js +1 -0
- package/public/chunk-E26RJWMZ.js +4 -0
- package/public/{chunk-7UDDRMZZ.js → chunk-H22EEHWT.js} +1 -1
- package/public/{chunk-2FNQEOXF.js → chunk-HZFYCQBZ.js} +1 -1
- package/public/{chunk-OS2SEJZU.js → chunk-I24Z7SXB.js} +1 -1
- package/public/{chunk-7IYTG6GP.js → chunk-IA43FDJ7.js} +1 -1
- package/public/{chunk-WLGXJQPD.js → chunk-IHMVNP7Y.js} +1 -1
- package/public/{chunk-TSFGO3MA.js → chunk-IJNJ3FHH.js} +1 -1
- package/public/{chunk-ZJJ3EOBP.js → chunk-IM4LXJ36.js} +1 -1
- package/public/chunk-J4AYRIB4.js +1 -0
- package/public/{chunk-NKNWXFAK.js → chunk-JXJXX7ID.js} +1 -1
- package/public/chunk-K73OEMZP.js +1 -0
- package/public/chunk-KAZYWBPX.js +1 -0
- package/public/chunk-KGXF4YD5.js +1 -0
- package/public/chunk-KN2SQNGB.js +1 -0
- package/public/chunk-LN3BMCV4.js +1 -0
- package/public/{chunk-5ETJWAIW.js → chunk-LOQEG2RD.js} +1 -1
- package/public/chunk-M3HVG4RQ.js +1 -0
- package/public/{chunk-CYBDQV2B.js → chunk-MNT5ZGV3.js} +1 -1
- package/public/{chunk-UF2IM5BE.js → chunk-NTFDKV64.js} +1 -1
- package/public/chunk-PF7M52WR.js +1 -0
- package/public/chunk-PFWD43QS.js +2 -0
- package/public/{chunk-4QXLJX7D.js → chunk-PHND6FV5.js} +1 -1
- package/public/chunk-PSYU6RB3.js +1 -0
- package/public/{chunk-3E2NZ5JW.js → chunk-Q7T3F2Y7.js} +1 -1
- package/public/chunk-QKKTMQUU.js +1 -0
- package/public/chunk-QT6XPFQS.js +1 -0
- package/public/{chunk-3IZSIVEA.js → chunk-R2WI5YTX.js} +1 -1
- package/public/chunk-R44T3ZI7.js +50 -0
- package/public/{chunk-YNONXMOG.js → chunk-R6KWC4OQ.js} +1 -1
- package/public/{chunk-SY4VNLXW.js → chunk-RDOYYGV5.js} +1 -1
- package/public/chunk-RERUZJD4.js +5 -0
- package/public/chunk-S5IG2PNV.js +1 -0
- package/public/{chunk-AI6E5JVH.js → chunk-SVVZYE76.js} +1 -1
- package/public/{chunk-325LPX6W.js → chunk-T3SFHTRG.js} +1 -1
- package/public/{chunk-ADW6BF5G.js → chunk-TJ6P7UCH.js} +1 -1
- package/public/{chunk-ASKB5DLO.js → chunk-U3NNN7U4.js} +1 -1
- package/public/{chunk-BLT2YCDN.js → chunk-UBLR5WZR.js} +1 -1
- package/public/{chunk-YH6MRXGX.js → chunk-UZHUIPNT.js} +1 -1
- package/public/{chunk-BTBGWLKK.js → chunk-VNXIDOPC.js} +1 -1
- package/public/{chunk-WWSLIQVD.js → chunk-W6VJMRO6.js} +1 -1
- package/public/{chunk-3IJXQMYZ.js → chunk-WFVVY4KI.js} +1 -1
- package/public/{chunk-QK4V5DVW.js → chunk-WHSTHY5K.js} +1 -1
- package/public/chunk-XMBCOKOA.js +1 -0
- package/public/{chunk-OAHDGV32.js → chunk-XQACD65E.js} +1 -1
- package/public/{chunk-ZEI3HZ6P.js → chunk-XQCLQKCG.js} +2 -2
- package/public/{chunk-2UOYBCTN.js → chunk-XS55KH6X.js} +1 -1
- package/public/{chunk-VYC5JLE6.js → chunk-YFMEPI62.js} +1 -1
- package/public/chunk-Z4E6BJST.js +1 -0
- package/public/{chunk-OK5EJ7US.js → chunk-ZSWIXPXA.js} +1 -1
- package/public/index.html +2 -2
- package/public/{main-27RPBS22.js → main-WFXBCXTF.js} +1 -1
- package/public/{styles-CSF457UW.css → styles-WNHDEKE4.css} +1 -1
- package/scripts/extract-plugin-alias.js +8 -4
- package/public/chunk-2LXNPXT5.js +0 -1
- package/public/chunk-3XDYZNNE.js +0 -1
- package/public/chunk-57DUDNZJ.js +0 -1
- package/public/chunk-FM6ZYPKR.js +0 -4
- package/public/chunk-JJ7TVAIH.js +0 -5
- package/public/chunk-L43N56JA.js +0 -1
- package/public/chunk-L5I3DZ23.js +0 -1
- package/public/chunk-LH2LMHIZ.js +0 -1
- package/public/chunk-N2TWGDNX.js +0 -1
- package/public/chunk-O4SS7KVP.js +0 -40
- package/public/chunk-ONTEIYY3.js +0 -19
- package/public/chunk-P7TZIGJS.js +0 -50
- package/public/chunk-Q2IS3QQY.js +0 -1
- package/public/chunk-QQ5VZZQG.js +0 -1
- package/public/chunk-RYTGW6B7.js +0 -1
- package/public/chunk-SOT54YHI.js +0 -1
- package/public/chunk-TGZNYEGN.js +0 -1
- package/public/chunk-U5JF2ZOK.js +0 -1
- package/public/chunk-UNGEHXRN.js +0 -1
- package/public/chunk-VEGMNMLG.js +0 -1
- package/public/chunk-Y5FP6C55.js +0 -2
- package/public/chunk-YYJG2ENF.js +0 -1
|
@@ -1,30 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const systeminformation_1 = require("systeminformation");
|
|
14
|
-
const node_version_constants_1 = require("../../core/node-version.constants");
|
|
15
|
-
const base_platform_1 = require("../base-platform");
|
|
16
|
-
class LinuxInstaller extends base_platform_1.BasePlatform {
|
|
1
|
+
import { execSync } from 'node:child_process';
|
|
2
|
+
import { existsSync, readFileSync, unlinkSync } from 'node:fs';
|
|
3
|
+
import { chmod, readdir, rm, writeFile } from 'node:fs/promises';
|
|
4
|
+
import { userInfo } from 'node:os';
|
|
5
|
+
import { dirname, join, resolve } from 'node:path';
|
|
6
|
+
import process from 'node:process';
|
|
7
|
+
import { mkdirp, pathExists, readJson, remove } from 'fs-extra/esm';
|
|
8
|
+
import { gte, parse } from 'semver';
|
|
9
|
+
import { osInfo } from 'systeminformation';
|
|
10
|
+
import { isNodeV24SupportedArchitecture } from '../../core/node-version.constants.js';
|
|
11
|
+
import { BasePlatform } from '../base-platform.js';
|
|
12
|
+
export class LinuxInstaller extends BasePlatform {
|
|
17
13
|
get systemdServiceName() {
|
|
18
14
|
return this.hbService.serviceName.toLowerCase();
|
|
19
15
|
}
|
|
20
16
|
get systemdServicePath() {
|
|
21
|
-
return
|
|
17
|
+
return resolve('/etc/systemd/system', `${this.systemdServiceName}.service`);
|
|
22
18
|
}
|
|
23
19
|
get systemdEnvPath() {
|
|
24
|
-
return
|
|
20
|
+
return resolve('/etc/default', this.systemdServiceName);
|
|
25
21
|
}
|
|
26
22
|
get runPartsPath() {
|
|
27
|
-
return
|
|
23
|
+
return resolve('/etc/hb-service', this.hbService.serviceName.toLowerCase(), 'prestart.d');
|
|
28
24
|
}
|
|
29
25
|
async install() {
|
|
30
26
|
this.checkForRoot();
|
|
@@ -53,11 +49,11 @@ class LinuxInstaller extends base_platform_1.BasePlatform {
|
|
|
53
49
|
await this.stop();
|
|
54
50
|
await this.disableService();
|
|
55
51
|
try {
|
|
56
|
-
if (
|
|
57
|
-
|
|
52
|
+
if (existsSync(this.systemdServicePath)) {
|
|
53
|
+
unlinkSync(this.systemdServicePath);
|
|
58
54
|
}
|
|
59
|
-
if (
|
|
60
|
-
|
|
55
|
+
if (existsSync(this.systemdEnvPath)) {
|
|
56
|
+
unlinkSync(this.systemdEnvPath);
|
|
61
57
|
}
|
|
62
58
|
await this.reloadSystemd();
|
|
63
59
|
this.hbService.logger(`Removed ${this.hbService.serviceName} Service`, 'succeed');
|
|
@@ -69,7 +65,7 @@ class LinuxInstaller extends base_platform_1.BasePlatform {
|
|
|
69
65
|
}
|
|
70
66
|
async viewLogs() {
|
|
71
67
|
try {
|
|
72
|
-
const ret =
|
|
68
|
+
const ret = execSync(`journalctl -n 50 -u ${this.systemdServiceName} --no-pager`).toString();
|
|
73
69
|
console.log(ret);
|
|
74
70
|
}
|
|
75
71
|
catch (e) {
|
|
@@ -81,19 +77,19 @@ class LinuxInstaller extends base_platform_1.BasePlatform {
|
|
|
81
77
|
this.fixPermissions();
|
|
82
78
|
try {
|
|
83
79
|
this.hbService.logger(`Starting ${this.hbService.serviceName} Service...`);
|
|
84
|
-
|
|
85
|
-
|
|
80
|
+
execSync(`systemctl start ${this.systemdServiceName}`);
|
|
81
|
+
execSync(`systemctl status ${this.systemdServiceName} --no-pager`);
|
|
86
82
|
}
|
|
87
83
|
catch (e) {
|
|
88
84
|
this.hbService.logger(`Failed to start ${this.hbService.serviceName} - ${e}`, 'fail');
|
|
89
|
-
|
|
85
|
+
process.exit(1);
|
|
90
86
|
}
|
|
91
87
|
}
|
|
92
88
|
async stop() {
|
|
93
89
|
this.checkForRoot();
|
|
94
90
|
try {
|
|
95
91
|
this.hbService.logger(`Stopping ${this.hbService.serviceName} Service...`);
|
|
96
|
-
|
|
92
|
+
execSync(`systemctl stop ${this.systemdServiceName}`);
|
|
97
93
|
this.hbService.logger(`${this.hbService.serviceName} Stopped`, 'succeed');
|
|
98
94
|
}
|
|
99
95
|
catch (e) {
|
|
@@ -105,8 +101,8 @@ class LinuxInstaller extends base_platform_1.BasePlatform {
|
|
|
105
101
|
this.fixPermissions();
|
|
106
102
|
try {
|
|
107
103
|
this.hbService.logger(`Restarting ${this.hbService.serviceName} Service...`);
|
|
108
|
-
|
|
109
|
-
|
|
104
|
+
execSync(`systemctl restart ${this.systemdServiceName}`);
|
|
105
|
+
execSync(`systemctl status ${this.systemdServiceName} --no-pager`);
|
|
110
106
|
this.hbService.logger(`${this.hbService.serviceName} Restarted`, 'succeed');
|
|
111
107
|
}
|
|
112
108
|
catch (e) {
|
|
@@ -117,26 +113,26 @@ class LinuxInstaller extends base_platform_1.BasePlatform {
|
|
|
117
113
|
if ([
|
|
118
114
|
'/usr/local/lib/node_modules',
|
|
119
115
|
'/usr/lib/node_modules',
|
|
120
|
-
].includes(
|
|
116
|
+
].includes(dirname(process.env.UIX_BASE_PATH))) {
|
|
121
117
|
setTimeout(() => {
|
|
122
|
-
|
|
118
|
+
process.exit(0);
|
|
123
119
|
}, 60000);
|
|
124
|
-
const modulesPath =
|
|
125
|
-
const temporaryDirectoriesToClean = (await
|
|
120
|
+
const modulesPath = dirname(process.env.UIX_BASE_PATH);
|
|
121
|
+
const temporaryDirectoriesToClean = (await readdir(modulesPath)).filter((x) => {
|
|
126
122
|
return x.startsWith('.homebridge-');
|
|
127
123
|
});
|
|
128
124
|
for (const directory of temporaryDirectoriesToClean) {
|
|
129
|
-
const pathToRemove =
|
|
125
|
+
const pathToRemove = join(modulesPath, directory);
|
|
130
126
|
try {
|
|
131
127
|
console.log('Removing stale temporary directory:', pathToRemove);
|
|
132
|
-
await
|
|
128
|
+
await rm(pathToRemove, { recursive: true, force: true });
|
|
133
129
|
}
|
|
134
130
|
catch (e) {
|
|
135
131
|
console.error('Failed to remove:', pathToRemove, e);
|
|
136
132
|
}
|
|
137
133
|
}
|
|
138
134
|
}
|
|
139
|
-
|
|
135
|
+
process.exit(0);
|
|
140
136
|
}
|
|
141
137
|
async rebuild(all = false) {
|
|
142
138
|
try {
|
|
@@ -146,21 +142,21 @@ class LinuxInstaller extends base_platform_1.BasePlatform {
|
|
|
146
142
|
else {
|
|
147
143
|
this.checkForRoot();
|
|
148
144
|
}
|
|
149
|
-
const targetNodeVersion =
|
|
150
|
-
const npmGlobalPath =
|
|
145
|
+
const targetNodeVersion = execSync('node -v').toString('utf8').trim();
|
|
146
|
+
const npmGlobalPath = execSync('/bin/echo -n "$(npm -g prefix)/lib/node_modules"', {
|
|
151
147
|
env: Object.assign({
|
|
152
148
|
npm_config_loglevel: 'silent',
|
|
153
149
|
npm_update_notifier: 'false',
|
|
154
|
-
},
|
|
150
|
+
}, process.env),
|
|
155
151
|
}).toString('utf8');
|
|
156
|
-
|
|
157
|
-
cwd:
|
|
152
|
+
execSync('npm rebuild --unsafe-perm', {
|
|
153
|
+
cwd: process.env.UIX_BASE_PATH,
|
|
158
154
|
stdio: 'inherit',
|
|
159
155
|
});
|
|
160
156
|
this.hbService.logger(`Rebuilt homebridge-config-ui-x for Node.js ${targetNodeVersion}.`, 'succeed');
|
|
161
157
|
if (all === true) {
|
|
162
158
|
try {
|
|
163
|
-
|
|
159
|
+
execSync('npm rebuild --unsafe-perm', {
|
|
164
160
|
cwd: npmGlobalPath,
|
|
165
161
|
stdio: 'inherit',
|
|
166
162
|
});
|
|
@@ -177,9 +173,9 @@ class LinuxInstaller extends base_platform_1.BasePlatform {
|
|
|
177
173
|
}
|
|
178
174
|
}
|
|
179
175
|
async getId() {
|
|
180
|
-
if (
|
|
181
|
-
const uid =
|
|
182
|
-
const gid =
|
|
176
|
+
if (process.getuid() === 0 && this.hbService.asUser) {
|
|
177
|
+
const uid = execSync(`id -u ${this.hbService.asUser}`).toString('utf8');
|
|
178
|
+
const gid = execSync(`id -g ${this.hbService.asUser}`).toString('utf8');
|
|
183
179
|
return {
|
|
184
180
|
uid: Number.parseInt(uid, 10),
|
|
185
181
|
gid: Number.parseInt(gid, 10),
|
|
@@ -187,18 +183,18 @@ class LinuxInstaller extends base_platform_1.BasePlatform {
|
|
|
187
183
|
}
|
|
188
184
|
else {
|
|
189
185
|
return {
|
|
190
|
-
uid:
|
|
191
|
-
gid:
|
|
186
|
+
uid: userInfo().uid,
|
|
187
|
+
gid: userInfo().gid,
|
|
192
188
|
};
|
|
193
189
|
}
|
|
194
190
|
}
|
|
195
191
|
getPidOfPort(port) {
|
|
196
192
|
try {
|
|
197
193
|
if (this.hbService.docker) {
|
|
198
|
-
return
|
|
194
|
+
return execSync('pidof homebridge').toString('utf8').trim();
|
|
199
195
|
}
|
|
200
196
|
else {
|
|
201
|
-
return
|
|
197
|
+
return execSync(`fuser ${port}/tcp 2>/dev/null`).toString('utf8').trim();
|
|
202
198
|
}
|
|
203
199
|
}
|
|
204
200
|
catch (e) {
|
|
@@ -212,19 +208,19 @@ class LinuxInstaller extends base_platform_1.BasePlatform {
|
|
|
212
208
|
else {
|
|
213
209
|
this.checkForRoot();
|
|
214
210
|
}
|
|
215
|
-
if (
|
|
216
|
-
if (!
|
|
217
|
-
this.hbService.logger(`Node.js ${job.target} is not supported on ${
|
|
211
|
+
if (gte(job.target, '24.0.0')) {
|
|
212
|
+
if (!isNodeV24SupportedArchitecture()) {
|
|
213
|
+
this.hbService.logger(`Node.js ${job.target} is not supported on ${process.arch} architecture.`, 'fail');
|
|
218
214
|
this.hbService.logger('Node.js v24 requires a 64-bit architecture. Please use Node.js v22 instead.', 'fail');
|
|
219
|
-
|
|
215
|
+
process.exit(1);
|
|
220
216
|
}
|
|
221
217
|
}
|
|
222
|
-
const targetPath =
|
|
218
|
+
const targetPath = dirname(dirname(process.execPath));
|
|
223
219
|
if (targetPath !== '/usr' && targetPath !== '/usr/local' && targetPath !== '/opt/homebridge' && !targetPath.endsWith('/@appstore/homebridge/app')) {
|
|
224
220
|
this.hbService.logger(`Cannot update Node.js on your system. Non-standard installation path detected: ${targetPath}`, 'fail');
|
|
225
|
-
|
|
221
|
+
process.exit(1);
|
|
226
222
|
}
|
|
227
|
-
if (targetPath === '/usr' && await
|
|
223
|
+
if (targetPath === '/usr' && await pathExists('/etc/apt/sources.list.d/nodesource.list')) {
|
|
228
224
|
await this.updateNodeFromNodesource(job);
|
|
229
225
|
}
|
|
230
226
|
else {
|
|
@@ -234,7 +230,7 @@ class LinuxInstaller extends base_platform_1.BasePlatform {
|
|
|
234
230
|
this.hbService.logger(`Rebuilding for Node.js ${job.target}...`);
|
|
235
231
|
await this.rebuild(true);
|
|
236
232
|
}
|
|
237
|
-
if (await
|
|
233
|
+
if (await pathExists(this.systemdServicePath)) {
|
|
238
234
|
await this.restart();
|
|
239
235
|
}
|
|
240
236
|
else {
|
|
@@ -242,29 +238,29 @@ class LinuxInstaller extends base_platform_1.BasePlatform {
|
|
|
242
238
|
}
|
|
243
239
|
}
|
|
244
240
|
async glibcVersionCheck(target) {
|
|
245
|
-
const glibcVersion = Number.parseFloat(
|
|
241
|
+
const glibcVersion = Number.parseFloat(execSync('getconf GNU_LIBC_VERSION 2>/dev/null').toString().split('glibc')[1].trim());
|
|
246
242
|
if (glibcVersion < 2.23) {
|
|
247
243
|
this.hbService.logger('Your version of Linux does not meet the GLIBC version requirements to use this tool to upgrade Node.js. '
|
|
248
244
|
+ `Wanted: >=2.23. Installed: ${glibcVersion} - see https://homebridge.io/w/JJSun`, 'fail');
|
|
249
|
-
|
|
245
|
+
process.exit(1);
|
|
250
246
|
}
|
|
251
|
-
if (
|
|
247
|
+
if (gte(target, '18.0.0') && glibcVersion < 2.28) {
|
|
252
248
|
this.hbService.logger('Your version of Linux does not meet the GLIBC version requirements to use this tool to upgrade Node.js. '
|
|
253
249
|
+ `Wanted: >=2.28. Installed: ${glibcVersion} - see https://homebridge.io/w/JJSun`, 'fail');
|
|
254
|
-
|
|
250
|
+
process.exit(1);
|
|
255
251
|
}
|
|
256
|
-
if (
|
|
252
|
+
if (gte(target, '20.0.0') && glibcVersion < 2.31) {
|
|
257
253
|
this.hbService.logger('Your version of Linux does not meet the GLIBC version requirements to use this tool to upgrade Node.js. '
|
|
258
254
|
+ `Wanted: >=2.31. Installed: ${glibcVersion} - see https://homebridge.io/w/JJSun`, 'fail');
|
|
259
|
-
|
|
255
|
+
process.exit(1);
|
|
260
256
|
}
|
|
261
257
|
}
|
|
262
258
|
async updateNodeFromTarball(job, targetPath) {
|
|
263
259
|
try {
|
|
264
|
-
if (
|
|
265
|
-
if (
|
|
260
|
+
if (process.env.HOMEBRIDGE_SYNOLOGY_PACKAGE === '1') {
|
|
261
|
+
if (gte(job.target, '18.0.0')) {
|
|
266
262
|
this.hbService.logger('Cannot update Node.js on your system. Synology DSM 7 does not currently support Node.js 18 or later.', 'fail');
|
|
267
|
-
|
|
263
|
+
process.exit(1);
|
|
268
264
|
}
|
|
269
265
|
}
|
|
270
266
|
else {
|
|
@@ -272,7 +268,7 @@ class LinuxInstaller extends base_platform_1.BasePlatform {
|
|
|
272
268
|
}
|
|
273
269
|
}
|
|
274
270
|
catch (e) {
|
|
275
|
-
const os = await
|
|
271
|
+
const os = await osInfo();
|
|
276
272
|
if (os.distro === 'Alpine Linux') {
|
|
277
273
|
this.hbService.logger('Updating Node.js on Alpine Linux / Docker is not supported by this command.', 'fail');
|
|
278
274
|
this.hbService.logger('To update Node.js you should pull down the latest version of the homebridge/homebridge Docker image.', 'fail');
|
|
@@ -280,16 +276,16 @@ class LinuxInstaller extends base_platform_1.BasePlatform {
|
|
|
280
276
|
else {
|
|
281
277
|
this.hbService.logger('Updating Node.js using this tool is not supported on your version of Linux.');
|
|
282
278
|
}
|
|
283
|
-
|
|
279
|
+
process.exit(1);
|
|
284
280
|
}
|
|
285
|
-
const uname =
|
|
281
|
+
const uname = execSync('uname -m').toString().trim();
|
|
286
282
|
let downloadUrl;
|
|
287
283
|
switch (uname) {
|
|
288
284
|
case 'x86_64':
|
|
289
285
|
downloadUrl = `https://nodejs.org/dist/${job.target}/node-${job.target}-linux-x64.tar.gz`;
|
|
290
286
|
break;
|
|
291
287
|
case 'aarch64':
|
|
292
|
-
if (
|
|
288
|
+
if (execSync('getconf LONG_BIT')?.toString()?.trim() === '32') {
|
|
293
289
|
downloadUrl = `https://nodejs.org/dist/${job.target}/node-${job.target}-linux-armv7l.tar.gz`;
|
|
294
290
|
}
|
|
295
291
|
else {
|
|
@@ -303,8 +299,8 @@ class LinuxInstaller extends base_platform_1.BasePlatform {
|
|
|
303
299
|
downloadUrl = `https://unofficial-builds.nodejs.org/download/release/${job.target}/node-${job.target}-linux-armv6l.tar.gz`;
|
|
304
300
|
break;
|
|
305
301
|
default:
|
|
306
|
-
this.hbService.logger(`Architecture not supported: ${
|
|
307
|
-
|
|
302
|
+
this.hbService.logger(`Architecture not supported: ${process.arch}.`, 'fail');
|
|
303
|
+
process.exit(1);
|
|
308
304
|
}
|
|
309
305
|
this.hbService.logger(`Target: ${targetPath}`);
|
|
310
306
|
try {
|
|
@@ -316,54 +312,54 @@ class LinuxInstaller extends base_platform_1.BasePlatform {
|
|
|
316
312
|
preserveOwner: false,
|
|
317
313
|
unlink: true,
|
|
318
314
|
};
|
|
319
|
-
await this.hbService.removeNpmPackage(
|
|
315
|
+
await this.hbService.removeNpmPackage(resolve(targetPath, 'lib', 'node_modules', 'npm'));
|
|
320
316
|
await this.hbService.extractNodejs(job.target, extractConfig);
|
|
321
|
-
await
|
|
317
|
+
await remove(archivePath);
|
|
322
318
|
}
|
|
323
319
|
catch (e) {
|
|
324
320
|
this.hbService.logger(`Failed to update Node.js: ${e.message}`, 'fail');
|
|
325
|
-
|
|
321
|
+
process.exit(1);
|
|
326
322
|
}
|
|
327
323
|
}
|
|
328
324
|
async updateNodeFromNodesource(job) {
|
|
329
325
|
this.hbService.logger('Updating from NodeSource...');
|
|
330
326
|
try {
|
|
331
327
|
await this.glibcVersionCheck(job.target);
|
|
332
|
-
const majorVersion =
|
|
333
|
-
|
|
328
|
+
const majorVersion = parse(job.target).major;
|
|
329
|
+
execSync('apt-get update --allow-releaseinfo-change && sudo apt-get install -y ca-certificates curl gnupg', {
|
|
334
330
|
stdio: 'inherit',
|
|
335
331
|
});
|
|
336
|
-
|
|
332
|
+
execSync('mkdir -p /etc/apt/keyrings', {
|
|
337
333
|
stdio: 'inherit',
|
|
338
334
|
});
|
|
339
|
-
|
|
335
|
+
execSync('curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor --yes -o /etc/apt/keyrings/nodes', {
|
|
340
336
|
stdio: 'inherit',
|
|
341
337
|
});
|
|
342
|
-
if (await
|
|
343
|
-
|
|
338
|
+
if (await pathExists('/usr/share/keyrings/nodesource.gpg')) {
|
|
339
|
+
execSync('rm -f /usr/share/keyrings/nodesource.gpg', {
|
|
344
340
|
stdio: 'inherit',
|
|
345
341
|
});
|
|
346
342
|
}
|
|
347
|
-
|
|
343
|
+
execSync(`echo "deb [signed-by=/etc/apt/keyrings/nodes] https://deb.nodesource.com/node_${majorVersion}.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list`, {
|
|
348
344
|
stdio: 'inherit',
|
|
349
345
|
});
|
|
350
|
-
if (majorVersion <
|
|
351
|
-
|
|
346
|
+
if (majorVersion < parse(process.version).major) {
|
|
347
|
+
execSync('apt-get remove -y nodejs', {
|
|
352
348
|
stdio: 'inherit',
|
|
353
349
|
});
|
|
354
350
|
}
|
|
355
|
-
|
|
351
|
+
execSync('apt-get update && apt-get install -y nodejs', {
|
|
356
352
|
stdio: 'inherit',
|
|
357
353
|
});
|
|
358
354
|
}
|
|
359
355
|
catch (e) {
|
|
360
356
|
this.hbService.logger(`Failed to update Node.js: ${e.message}`, 'fail');
|
|
361
|
-
|
|
357
|
+
process.exit(1);
|
|
362
358
|
}
|
|
363
359
|
}
|
|
364
360
|
async reloadSystemd() {
|
|
365
361
|
try {
|
|
366
|
-
|
|
362
|
+
execSync('systemctl daemon-reload');
|
|
367
363
|
}
|
|
368
364
|
catch (e) {
|
|
369
365
|
this.hbService.logger('WARNING: failed to run "systemctl daemon-reload"', 'warn');
|
|
@@ -371,7 +367,7 @@ class LinuxInstaller extends base_platform_1.BasePlatform {
|
|
|
371
367
|
}
|
|
372
368
|
async enableService() {
|
|
373
369
|
try {
|
|
374
|
-
|
|
370
|
+
execSync(`systemctl enable ${this.systemdServiceName} 2> /dev/null`);
|
|
375
371
|
}
|
|
376
372
|
catch (e) {
|
|
377
373
|
this.hbService.logger(`WARNING: failed to run "systemctl enable ${this.systemdServiceName}"`, 'warn');
|
|
@@ -379,7 +375,7 @@ class LinuxInstaller extends base_platform_1.BasePlatform {
|
|
|
379
375
|
}
|
|
380
376
|
async disableService() {
|
|
381
377
|
try {
|
|
382
|
-
|
|
378
|
+
execSync(`systemctl disable ${this.systemdServiceName} 2> /dev/null`);
|
|
383
379
|
}
|
|
384
380
|
catch (e) {
|
|
385
381
|
this.hbService.logger(`WARNING: failed to run "systemctl disable ${this.systemdServiceName}"`, 'warn');
|
|
@@ -388,43 +384,43 @@ class LinuxInstaller extends base_platform_1.BasePlatform {
|
|
|
388
384
|
checkForRoot() {
|
|
389
385
|
if (this.isPackage()) {
|
|
390
386
|
this.hbService.logger('ERROR: This command is not available.', 'fail');
|
|
391
|
-
|
|
387
|
+
process.exit(1);
|
|
392
388
|
}
|
|
393
|
-
if (
|
|
389
|
+
if (process.getuid() !== 0) {
|
|
394
390
|
this.hbService.logger('ERROR: This command must be executed using sudo on Linux', 'fail');
|
|
395
391
|
this.hbService.logger(`EXAMPLE: sudo hb-service ${this.hbService.action}`, 'fail');
|
|
396
|
-
|
|
392
|
+
process.exit(1);
|
|
397
393
|
}
|
|
398
394
|
if (this.hbService.action === 'install' && !this.hbService.asUser) {
|
|
399
395
|
this.hbService.logger('ERROR: User parameter missing. Pass in the user you want to run Homebridge as using the --user flag eg.', 'fail');
|
|
400
396
|
this.hbService.logger(`EXAMPLE: sudo hb-service ${this.hbService.action} --user your-user`, 'fail');
|
|
401
|
-
|
|
397
|
+
process.exit(1);
|
|
402
398
|
}
|
|
403
399
|
}
|
|
404
400
|
checkIsNotRoot() {
|
|
405
|
-
if (
|
|
401
|
+
if (process.getuid() === 0 && !this.hbService.allowRunRoot && process.env.HOMEBRIDGE_CONFIG_UI !== '1') {
|
|
406
402
|
this.hbService.logger('ERROR: This command must not be executed as root or with sudo', 'fail');
|
|
407
403
|
this.hbService.logger('ERROR: If you know what you are doing; you can override this by adding --allow-root', 'fail');
|
|
408
|
-
|
|
404
|
+
process.exit(1);
|
|
409
405
|
}
|
|
410
406
|
}
|
|
411
407
|
async checkUser() {
|
|
412
408
|
try {
|
|
413
|
-
|
|
409
|
+
execSync(`id ${this.hbService.asUser} 2> /dev/null`);
|
|
414
410
|
}
|
|
415
411
|
catch (e) {
|
|
416
|
-
|
|
412
|
+
execSync(`useradd -m --system ${this.hbService.asUser}`);
|
|
417
413
|
this.hbService.logger(`Created service user: ${this.hbService.asUser}`, 'info');
|
|
418
414
|
if (this.hbService.addGroup) {
|
|
419
|
-
|
|
415
|
+
execSync(`usermod -a -G ${this.hbService.addGroup} ${this.hbService.asUser}`, { timeout: 10000 });
|
|
420
416
|
this.hbService.logger(`Added ${this.hbService.asUser} to group ${this.hbService.addGroup}`, 'info');
|
|
421
417
|
}
|
|
422
418
|
}
|
|
423
419
|
try {
|
|
424
|
-
const os = await
|
|
420
|
+
const os = await osInfo();
|
|
425
421
|
if (os.distro === 'Raspbian GNU/Linux') {
|
|
426
|
-
|
|
427
|
-
|
|
422
|
+
execSync(`usermod -a -G audio,bluetooth,dialout,gpio,video ${this.hbService.asUser} 2> /dev/null`);
|
|
423
|
+
execSync(`usermod -a -G input,i2c,spi ${this.hbService.asUser} 2> /dev/null`);
|
|
428
424
|
}
|
|
429
425
|
}
|
|
430
426
|
catch (e) {
|
|
@@ -432,36 +428,36 @@ class LinuxInstaller extends base_platform_1.BasePlatform {
|
|
|
432
428
|
}
|
|
433
429
|
setupSudo() {
|
|
434
430
|
try {
|
|
435
|
-
const npmPath =
|
|
436
|
-
const shutdownPath =
|
|
431
|
+
const npmPath = execSync('which npm').toString('utf8').trim();
|
|
432
|
+
const shutdownPath = execSync('which shutdown').toString('utf8').trim();
|
|
437
433
|
const sudoersEntry = `${this.hbService.asUser} ALL=(ALL) NOPASSWD:SETENV: ${shutdownPath}, ${npmPath}, /usr/bin/npm, /usr/local/bin/npm`;
|
|
438
|
-
const sudoers =
|
|
434
|
+
const sudoers = readFileSync('/etc/sudoers', 'utf-8');
|
|
439
435
|
if (sudoers.includes(sudoersEntry)) {
|
|
440
436
|
return;
|
|
441
437
|
}
|
|
442
|
-
|
|
438
|
+
execSync(`echo '${sudoersEntry}' | sudo EDITOR='tee -a' visudo`);
|
|
443
439
|
}
|
|
444
440
|
catch (e) {
|
|
445
441
|
this.hbService.logger('WARNING: Failed to setup /etc/sudoers, you may not be able to shutdown/restart your server from the Homebridge UI.', 'warn');
|
|
446
442
|
}
|
|
447
443
|
}
|
|
448
444
|
isPackage() {
|
|
449
|
-
return (Boolean(
|
|
450
|
-
|| Boolean(
|
|
445
|
+
return (Boolean(process.env.HOMEBRIDGE_SYNOLOGY_PACKAGE === '1')
|
|
446
|
+
|| Boolean(process.env.HOMEBRIDGE_APT_PACKAGE === '1'));
|
|
451
447
|
}
|
|
452
448
|
fixPermissions() {
|
|
453
|
-
if (
|
|
449
|
+
if (existsSync(this.systemdServicePath) && existsSync(this.systemdEnvPath)) {
|
|
454
450
|
try {
|
|
455
|
-
const serviceUser =
|
|
451
|
+
const serviceUser = execSync(`cat "${this.systemdServicePath}" | grep "User=" | awk -F'=' '{print $2}'`)
|
|
456
452
|
.toString('utf8')
|
|
457
453
|
.trim();
|
|
458
|
-
const storagePath =
|
|
454
|
+
const storagePath = execSync(`cat "${this.systemdEnvPath}" | grep "UIX_STORAGE_PATH" | awk -F'=' '{print $2}' | sed -e 's/^"//' -e 's/"$//'`)
|
|
459
455
|
.toString('utf8')
|
|
460
456
|
.trim();
|
|
461
|
-
if (storagePath.length > 5 &&
|
|
462
|
-
|
|
457
|
+
if (storagePath.length > 5 && existsSync(storagePath)) {
|
|
458
|
+
execSync(`chown -R ${serviceUser}: "${storagePath}"`);
|
|
463
459
|
}
|
|
464
|
-
|
|
460
|
+
execSync(`chmod a+x ${this.hbService.selfPath}`);
|
|
465
461
|
}
|
|
466
462
|
catch (e) {
|
|
467
463
|
this.hbService.logger('WARNING: Failed to set permissions', 'warn');
|
|
@@ -469,25 +465,25 @@ class LinuxInstaller extends base_platform_1.BasePlatform {
|
|
|
469
465
|
}
|
|
470
466
|
}
|
|
471
467
|
async createFirewallRules() {
|
|
472
|
-
if (await
|
|
468
|
+
if (await pathExists('/usr/sbin/ufw')) {
|
|
473
469
|
return await this.createUfwRules();
|
|
474
470
|
}
|
|
475
|
-
if (await
|
|
471
|
+
if (await pathExists('/usr/bin/firewall-cmd')) {
|
|
476
472
|
return await this.createFirewallCmdRules();
|
|
477
473
|
}
|
|
478
474
|
}
|
|
479
475
|
async createUfwRules() {
|
|
480
476
|
try {
|
|
481
|
-
const status =
|
|
477
|
+
const status = execSync('/bin/echo -n "$(ufw status)" 2> /dev/null').toString('utf8');
|
|
482
478
|
if (!status.includes('Status: active')) {
|
|
483
479
|
return;
|
|
484
480
|
}
|
|
485
|
-
const currentConfig = await
|
|
481
|
+
const currentConfig = await readJson(process.env.UIX_CONFIG_PATH);
|
|
486
482
|
const bridgePort = currentConfig.bridge?.port;
|
|
487
|
-
|
|
483
|
+
execSync(`ufw allow ${this.hbService.uiPort}/tcp 2> /dev/null`);
|
|
488
484
|
this.hbService.logger(`Added firewall rule to allow inbound traffic on port ${this.hbService.uiPort}/tcp`, 'info');
|
|
489
485
|
if (bridgePort) {
|
|
490
|
-
|
|
486
|
+
execSync(`ufw allow ${bridgePort}/tcp 2> /dev/null`);
|
|
491
487
|
this.hbService.logger(`Added firewall rule to allow inbound traffic on port ${bridgePort}/tcp`, 'info');
|
|
492
488
|
}
|
|
493
489
|
}
|
|
@@ -497,19 +493,19 @@ class LinuxInstaller extends base_platform_1.BasePlatform {
|
|
|
497
493
|
}
|
|
498
494
|
async createFirewallCmdRules() {
|
|
499
495
|
try {
|
|
500
|
-
const status =
|
|
496
|
+
const status = execSync('/bin/echo -n "$(firewall-cmd --state)" 2> /dev/null').toString('utf8');
|
|
501
497
|
if (status !== 'running') {
|
|
502
498
|
return;
|
|
503
499
|
}
|
|
504
|
-
const currentConfig = await
|
|
500
|
+
const currentConfig = await readJson(process.env.UIX_CONFIG_PATH);
|
|
505
501
|
const bridgePort = currentConfig.bridge?.port;
|
|
506
|
-
|
|
502
|
+
execSync(`firewall-cmd --permanent --add-port=${this.hbService.uiPort}/tcp 2> /dev/null`);
|
|
507
503
|
this.hbService.logger(`Added firewall rule to allow inbound traffic on port ${this.hbService.uiPort}/tcp`, 'info');
|
|
508
504
|
if (bridgePort) {
|
|
509
|
-
|
|
505
|
+
execSync(`firewall-cmd --permanent --add-port=${bridgePort}/tcp 2> /dev/null`);
|
|
510
506
|
this.hbService.logger(`Added firewall rule to allow inbound traffic on port ${bridgePort}/tcp`, 'info');
|
|
511
507
|
}
|
|
512
|
-
|
|
508
|
+
execSync('firewall-cmd --reload 2> /dev/null');
|
|
513
509
|
this.hbService.logger('Firewall reloaded', 'info');
|
|
514
510
|
}
|
|
515
511
|
catch (e) {
|
|
@@ -517,8 +513,8 @@ class LinuxInstaller extends base_platform_1.BasePlatform {
|
|
|
517
513
|
}
|
|
518
514
|
}
|
|
519
515
|
async createRunPartsPath() {
|
|
520
|
-
await
|
|
521
|
-
const permissionScriptPath =
|
|
516
|
+
await mkdirp(this.runPartsPath);
|
|
517
|
+
const permissionScriptPath = resolve(this.runPartsPath, '10-fix-permissions');
|
|
522
518
|
const permissionScript = [
|
|
523
519
|
'#!/bin/sh',
|
|
524
520
|
'',
|
|
@@ -529,8 +525,8 @@ class LinuxInstaller extends base_platform_1.BasePlatform {
|
|
|
529
525
|
' chown -R $USER: $UIX_STORAGE_PATH',
|
|
530
526
|
'fi',
|
|
531
527
|
].filter(x => x !== null).join('\n');
|
|
532
|
-
await
|
|
533
|
-
await
|
|
528
|
+
await writeFile(permissionScriptPath, permissionScript);
|
|
529
|
+
await chmod(permissionScriptPath, '755');
|
|
534
530
|
}
|
|
535
531
|
async createSystemdEnvFile() {
|
|
536
532
|
const envFile = [
|
|
@@ -542,7 +538,7 @@ class LinuxInstaller extends base_platform_1.BasePlatform {
|
|
|
542
538
|
'',
|
|
543
539
|
'DISABLE_OPENCOLLECTIVE=true',
|
|
544
540
|
].filter(x => x !== null).join('\n');
|
|
545
|
-
await
|
|
541
|
+
await writeFile(this.systemdEnvPath, envFile);
|
|
546
542
|
}
|
|
547
543
|
async createSystemdService() {
|
|
548
544
|
const serviceFile = [
|
|
@@ -569,8 +565,7 @@ class LinuxInstaller extends base_platform_1.BasePlatform {
|
|
|
569
565
|
'[Install]',
|
|
570
566
|
'WantedBy=multi-user.target',
|
|
571
567
|
].filter(x => x !== null).join('\n');
|
|
572
|
-
await
|
|
568
|
+
await writeFile(this.systemdServicePath, serviceFile);
|
|
573
569
|
}
|
|
574
570
|
}
|
|
575
|
-
exports.LinuxInstaller = LinuxInstaller;
|
|
576
571
|
//# sourceMappingURL=linux.js.map
|