homebridge-config-ui-x 5.9.1-beta.1 → 5.9.1-beta.11

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.
Files changed (383) hide show
  1. package/CHANGELOG.md +23 -3
  2. package/TODO-MATTER.md +15 -0
  3. package/dist/app.controller.d.ts +1 -1
  4. package/dist/app.controller.js +14 -12
  5. package/dist/app.controller.js.map +1 -1
  6. package/dist/app.gateway.js +7 -10
  7. package/dist/app.gateway.js.map +1 -1
  8. package/dist/app.module.js +42 -43
  9. package/dist/app.module.js.map +1 -1
  10. package/dist/app.service.js +4 -7
  11. package/dist/app.service.js.map +1 -1
  12. package/dist/bin/base-platform.d.ts +1 -1
  13. package/dist/bin/base-platform.js +11 -17
  14. package/dist/bin/base-platform.js.map +1 -1
  15. package/dist/bin/fork.js +7 -45
  16. package/dist/bin/fork.js.map +1 -1
  17. package/dist/bin/hb-service.js +224 -243
  18. package/dist/bin/hb-service.js.map +1 -1
  19. package/dist/bin/platforms/darwin.d.ts +1 -1
  20. package/dist/bin/platforms/darwin.js +61 -65
  21. package/dist/bin/platforms/darwin.js.map +1 -1
  22. package/dist/bin/platforms/freebsd.d.ts +1 -1
  23. package/dist/bin/platforms/freebsd.js +42 -47
  24. package/dist/bin/platforms/freebsd.js.map +1 -1
  25. package/dist/bin/platforms/linux.d.ts +1 -1
  26. package/dist/bin/platforms/linux.js +127 -132
  27. package/dist/bin/platforms/linux.js.map +1 -1
  28. package/dist/bin/platforms/win32.d.ts +1 -1
  29. package/dist/bin/platforms/win32.js +30 -36
  30. package/dist/bin/platforms/win32.js.map +1 -1
  31. package/dist/bin/standalone.js +15 -53
  32. package/dist/bin/standalone.js.map +1 -1
  33. package/dist/core/auth/auth.controller.d.ts +5 -4
  34. package/dist/core/auth/auth.controller.js +40 -39
  35. package/dist/core/auth/auth.controller.js.map +1 -1
  36. package/dist/core/auth/auth.dto.js +17 -18
  37. package/dist/core/auth/auth.dto.js.map +1 -1
  38. package/dist/core/auth/auth.module.js +28 -31
  39. package/dist/core/auth/auth.module.js.map +1 -1
  40. package/dist/core/auth/auth.service.d.ts +3 -3
  41. package/dist/core/auth/auth.service.js +65 -62
  42. package/dist/core/auth/auth.service.js.map +1 -1
  43. package/dist/core/auth/guards/admin.guard.js +4 -7
  44. package/dist/core/auth/guards/admin.guard.js.map +1 -1
  45. package/dist/core/auth/guards/custom.guard.js +6 -9
  46. package/dist/core/auth/guards/custom.guard.js.map +1 -1
  47. package/dist/core/auth/guards/ws-admin-guard.d.ts +2 -2
  48. package/dist/core/auth/guards/ws-admin-guard.js +13 -11
  49. package/dist/core/auth/guards/ws-admin-guard.js.map +1 -1
  50. package/dist/core/auth/guards/ws.guard.d.ts +2 -2
  51. package/dist/core/auth/guards/ws.guard.js +13 -11
  52. package/dist/core/auth/guards/ws.guard.js.map +1 -1
  53. package/dist/core/auth/jwt.strategy.d.ts +3 -2
  54. package/dist/core/auth/jwt.strategy.js +21 -16
  55. package/dist/core/auth/jwt.strategy.js.map +1 -1
  56. package/dist/core/config/config.interfaces.d.ts +8 -1
  57. package/dist/core/config/config.interfaces.js +1 -2
  58. package/dist/core/config/config.module.js +8 -10
  59. package/dist/core/config/config.module.js.map +1 -1
  60. package/dist/core/config/config.service.d.ts +4 -3
  61. package/dist/core/config/config.service.js +90 -83
  62. package/dist/core/config/config.service.js.map +1 -1
  63. package/dist/core/config/config.startup.d.ts +1 -1
  64. package/dist/core/config/config.startup.js +23 -28
  65. package/dist/core/config/config.startup.js.map +1 -1
  66. package/dist/core/feature-flags/feature-flags.registry.js +2 -5
  67. package/dist/core/feature-flags/feature-flags.registry.js.map +1 -1
  68. package/dist/core/homebridge-ipc/homebridge-ipc.module.js +11 -14
  69. package/dist/core/homebridge-ipc/homebridge-ipc.module.js.map +1 -1
  70. package/dist/core/homebridge-ipc/homebridge-ipc.service.d.ts +4 -4
  71. package/dist/core/homebridge-ipc/homebridge-ipc.service.js +25 -19
  72. package/dist/core/homebridge-ipc/homebridge-ipc.service.js.map +1 -1
  73. package/dist/core/logger/logger.module.js +8 -10
  74. package/dist/core/logger/logger.module.js.map +1 -1
  75. package/dist/core/logger/logger.service.js +13 -23
  76. package/dist/core/logger/logger.service.js.map +1 -1
  77. package/dist/core/node-pty/node-pty.module.js +7 -10
  78. package/dist/core/node-pty/node-pty.module.js.map +1 -1
  79. package/dist/core/node-pty/node-pty.service.js +6 -11
  80. package/dist/core/node-pty/node-pty.service.js.map +1 -1
  81. package/dist/core/node-version.constants.js +4 -11
  82. package/dist/core/node-version.constants.js.map +1 -1
  83. package/dist/core/scheduler/scheduler.module.js +15 -10
  84. package/dist/core/scheduler/scheduler.module.js.map +1 -1
  85. package/dist/core/scheduler/scheduler.service.d.ts +12 -1
  86. package/dist/core/scheduler/scheduler.service.js +101 -13
  87. package/dist/core/scheduler/scheduler.service.js.map +1 -1
  88. package/dist/core/spa/spa-html.service.js +9 -15
  89. package/dist/core/spa/spa-html.service.js.map +1 -1
  90. package/dist/core/spa/spa.filter.d.ts +1 -1
  91. package/dist/core/spa/spa.filter.js +11 -16
  92. package/dist/core/spa/spa.filter.js.map +1 -1
  93. package/dist/core/ssl/ssl-cert-generator.service.js +34 -36
  94. package/dist/core/ssl/ssl-cert-generator.service.js.map +1 -1
  95. package/dist/env-setup.d.ts +1 -0
  96. package/dist/env-setup.js +7 -0
  97. package/dist/env-setup.js.map +1 -0
  98. package/dist/globalDefaults.d.ts +1 -0
  99. package/dist/globalDefaults.js +1 -0
  100. package/dist/index.d.ts +1 -1
  101. package/dist/index.js +16 -19
  102. package/dist/index.js.map +1 -1
  103. package/dist/main.d.ts +5 -3
  104. package/dist/main.js +44 -51
  105. package/dist/main.js.map +1 -1
  106. package/dist/modules/accessories/accessories.controller.d.ts +3 -3
  107. package/dist/modules/accessories/accessories.controller.js +28 -29
  108. package/dist/modules/accessories/accessories.controller.js.map +1 -1
  109. package/dist/modules/accessories/accessories.dto.js +11 -13
  110. package/dist/modules/accessories/accessories.dto.js.map +1 -1
  111. package/dist/modules/accessories/accessories.gateway.d.ts +2 -2
  112. package/dist/modules/accessories/accessories.gateway.js +18 -16
  113. package/dist/modules/accessories/accessories.gateway.js.map +1 -1
  114. package/dist/modules/accessories/accessories.interfaces.d.ts +94 -0
  115. package/dist/modules/accessories/accessories.interfaces.js +2 -0
  116. package/dist/modules/accessories/accessories.interfaces.js.map +1 -0
  117. package/dist/modules/accessories/accessories.module.js +19 -20
  118. package/dist/modules/accessories/accessories.module.js.map +1 -1
  119. package/dist/modules/accessories/accessories.service.d.ts +23 -5
  120. package/dist/modules/accessories/accessories.service.js +316 -51
  121. package/dist/modules/accessories/accessories.service.js.map +1 -1
  122. package/dist/modules/backup/backup.controller.d.ts +4 -4
  123. package/dist/modules/backup/backup.controller.js +68 -67
  124. package/dist/modules/backup/backup.controller.js.map +1 -1
  125. package/dist/modules/backup/backup.gateway.d.ts +4 -4
  126. package/dist/modules/backup/backup.gateway.js +25 -21
  127. package/dist/modules/backup/backup.gateway.js.map +1 -1
  128. package/dist/modules/backup/backup.module.js +22 -25
  129. package/dist/modules/backup/backup.module.js.map +1 -1
  130. package/dist/modules/backup/backup.service.d.ts +5 -5
  131. package/dist/modules/backup/backup.service.js +143 -133
  132. package/dist/modules/backup/backup.service.js.map +1 -1
  133. package/dist/modules/child-bridges/child-bridges.gateway.d.ts +3 -3
  134. package/dist/modules/child-bridges/child-bridges.gateway.js +23 -21
  135. package/dist/modules/child-bridges/child-bridges.gateway.js.map +1 -1
  136. package/dist/modules/child-bridges/child-bridges.interfaces.js +1 -2
  137. package/dist/modules/child-bridges/child-bridges.module.js +19 -22
  138. package/dist/modules/child-bridges/child-bridges.module.js.map +1 -1
  139. package/dist/modules/child-bridges/child-bridges.service.d.ts +3 -3
  140. package/dist/modules/child-bridges/child-bridges.service.js +15 -11
  141. package/dist/modules/child-bridges/child-bridges.service.js.map +1 -1
  142. package/dist/modules/config-editor/config-editor.controller.d.ts +13 -11
  143. package/dist/modules/config-editor/config-editor.controller.js +168 -103
  144. package/dist/modules/config-editor/config-editor.controller.js.map +1 -1
  145. package/dist/modules/config-editor/config-editor.dto.d.ts +6 -0
  146. package/dist/modules/config-editor/config-editor.dto.js +40 -0
  147. package/dist/modules/config-editor/config-editor.dto.js.map +1 -0
  148. package/dist/modules/config-editor/config-editor.module.js +21 -24
  149. package/dist/modules/config-editor/config-editor.module.js.map +1 -1
  150. package/dist/modules/config-editor/config-editor.service.d.ts +11 -8
  151. package/dist/modules/config-editor/config-editor.service.js +123 -66
  152. package/dist/modules/config-editor/config-editor.service.js.map +1 -1
  153. package/dist/modules/custom-plugins/custom-plugins.module.js +10 -13
  154. package/dist/modules/custom-plugins/custom-plugins.module.js.map +1 -1
  155. package/dist/modules/custom-plugins/homebridge-deconz/homebridge-deconz.controller.d.ts +2 -2
  156. package/dist/modules/custom-plugins/homebridge-deconz/homebridge-deconz.controller.js +21 -19
  157. package/dist/modules/custom-plugins/homebridge-deconz/homebridge-deconz.controller.js.map +1 -1
  158. package/dist/modules/custom-plugins/homebridge-deconz/homebridge-deconz.module.js +14 -17
  159. package/dist/modules/custom-plugins/homebridge-deconz/homebridge-deconz.module.js.map +1 -1
  160. package/dist/modules/custom-plugins/homebridge-deconz/homebridge-deconz.service.d.ts +2 -2
  161. package/dist/modules/custom-plugins/homebridge-deconz/homebridge-deconz.service.js +18 -15
  162. package/dist/modules/custom-plugins/homebridge-deconz/homebridge-deconz.service.js.map +1 -1
  163. package/dist/modules/custom-plugins/homebridge-hue/homebridge-hue.controller.d.ts +2 -2
  164. package/dist/modules/custom-plugins/homebridge-hue/homebridge-hue.controller.js +21 -19
  165. package/dist/modules/custom-plugins/homebridge-hue/homebridge-hue.controller.js.map +1 -1
  166. package/dist/modules/custom-plugins/homebridge-hue/homebridge-hue.module.js +14 -17
  167. package/dist/modules/custom-plugins/homebridge-hue/homebridge-hue.module.js.map +1 -1
  168. package/dist/modules/custom-plugins/homebridge-hue/homebridge-hue.service.d.ts +2 -2
  169. package/dist/modules/custom-plugins/homebridge-hue/homebridge-hue.service.js +18 -15
  170. package/dist/modules/custom-plugins/homebridge-hue/homebridge-hue.service.js.map +1 -1
  171. package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.controller.d.ts +2 -2
  172. package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.controller.js +18 -19
  173. package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.controller.js.map +1 -1
  174. package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.gateway.d.ts +2 -2
  175. package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.gateway.js +15 -13
  176. package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.gateway.js.map +1 -1
  177. package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.module.js +18 -21
  178. package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.module.js.map +1 -1
  179. package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.service.d.ts +8 -8
  180. package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.service.js +47 -41
  181. package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.service.js.map +1 -1
  182. package/dist/modules/log/log.gateway.d.ts +3 -3
  183. package/dist/modules/log/log.gateway.js +15 -13
  184. package/dist/modules/log/log.gateway.js.map +1 -1
  185. package/dist/modules/log/log.interfaces.js +1 -2
  186. package/dist/modules/log/log.module.js +14 -17
  187. package/dist/modules/log/log.module.js.map +1 -1
  188. package/dist/modules/log/log.service.d.ts +5 -5
  189. package/dist/modules/log/log.service.js +47 -43
  190. package/dist/modules/log/log.service.js.map +1 -1
  191. package/dist/modules/platform-tools/docker/docker.controller.d.ts +1 -1
  192. package/dist/modules/platform-tools/docker/docker.controller.js +24 -25
  193. package/dist/modules/platform-tools/docker/docker.controller.js.map +1 -1
  194. package/dist/modules/platform-tools/docker/docker.module.js +14 -17
  195. package/dist/modules/platform-tools/docker/docker.module.js.map +1 -1
  196. package/dist/modules/platform-tools/docker/docker.service.d.ts +2 -2
  197. package/dist/modules/platform-tools/docker/docker.service.js +20 -16
  198. package/dist/modules/platform-tools/docker/docker.service.js.map +1 -1
  199. package/dist/modules/platform-tools/hb-service/hb-service.controller.d.ts +2 -2
  200. package/dist/modules/platform-tools/hb-service/hb-service.controller.js +35 -36
  201. package/dist/modules/platform-tools/hb-service/hb-service.controller.js.map +1 -1
  202. package/dist/modules/platform-tools/hb-service/hb-service.dto.js +20 -19
  203. package/dist/modules/platform-tools/hb-service/hb-service.dto.js.map +1 -1
  204. package/dist/modules/platform-tools/hb-service/hb-service.module.js +14 -17
  205. package/dist/modules/platform-tools/hb-service/hb-service.module.js.map +1 -1
  206. package/dist/modules/platform-tools/hb-service/hb-service.service.d.ts +3 -3
  207. package/dist/modules/platform-tools/hb-service/hb-service.service.js +37 -30
  208. package/dist/modules/platform-tools/hb-service/hb-service.service.js.map +1 -1
  209. package/dist/modules/platform-tools/linux/linux.controller.d.ts +1 -1
  210. package/dist/modules/platform-tools/linux/linux.controller.js +23 -21
  211. package/dist/modules/platform-tools/linux/linux.controller.js.map +1 -1
  212. package/dist/modules/platform-tools/linux/linux.module.js +14 -17
  213. package/dist/modules/platform-tools/linux/linux.module.js.map +1 -1
  214. package/dist/modules/platform-tools/linux/linux.service.d.ts +2 -2
  215. package/dist/modules/platform-tools/linux/linux.service.js +18 -14
  216. package/dist/modules/platform-tools/linux/linux.service.js.map +1 -1
  217. package/dist/modules/platform-tools/platform-tools.module.js +12 -15
  218. package/dist/modules/platform-tools/platform-tools.module.js.map +1 -1
  219. package/dist/modules/platform-tools/terminal/terminal.controller.d.ts +1 -1
  220. package/dist/modules/platform-tools/terminal/terminal.controller.js +15 -13
  221. package/dist/modules/platform-tools/terminal/terminal.controller.js.map +1 -1
  222. package/dist/modules/platform-tools/terminal/terminal.gateway.d.ts +2 -2
  223. package/dist/modules/platform-tools/terminal/terminal.gateway.js +17 -15
  224. package/dist/modules/platform-tools/terminal/terminal.gateway.js.map +1 -1
  225. package/dist/modules/platform-tools/terminal/terminal.interfaces.js +1 -2
  226. package/dist/modules/platform-tools/terminal/terminal.module.js +18 -21
  227. package/dist/modules/platform-tools/terminal/terminal.module.js.map +1 -1
  228. package/dist/modules/platform-tools/terminal/terminal.service.d.ts +7 -7
  229. package/dist/modules/platform-tools/terminal/terminal.service.js +33 -28
  230. package/dist/modules/platform-tools/terminal/terminal.service.js.map +1 -1
  231. package/dist/modules/plugins/plugins.controller.d.ts +12 -7
  232. package/dist/modules/plugins/plugins.controller.js +100 -52
  233. package/dist/modules/plugins/plugins.controller.js.map +1 -1
  234. package/dist/modules/plugins/plugins.dto.js +26 -24
  235. package/dist/modules/plugins/plugins.dto.js.map +1 -1
  236. package/dist/modules/plugins/plugins.gateway.d.ts +5 -5
  237. package/dist/modules/plugins/plugins.gateway.js +38 -34
  238. package/dist/modules/plugins/plugins.gateway.js.map +1 -1
  239. package/dist/modules/plugins/plugins.interfaces.js +1 -2
  240. package/dist/modules/plugins/plugins.module.js +27 -26
  241. package/dist/modules/plugins/plugins.module.js.map +1 -1
  242. package/dist/modules/plugins/plugins.service.d.ts +26 -13
  243. package/dist/modules/plugins/plugins.service.js +365 -203
  244. package/dist/modules/plugins/plugins.service.js.map +1 -1
  245. package/dist/modules/server/server.controller.d.ts +7 -7
  246. package/dist/modules/server/server.controller.js +208 -205
  247. package/dist/modules/server/server.controller.js.map +1 -1
  248. package/dist/modules/server/server.dto.js +13 -16
  249. package/dist/modules/server/server.dto.js.map +1 -1
  250. package/dist/modules/server/server.module.js +23 -26
  251. package/dist/modules/server/server.module.js.map +1 -1
  252. package/dist/modules/server/server.service.d.ts +6 -6
  253. package/dist/modules/server/server.service.js +202 -224
  254. package/dist/modules/server/server.service.js.map +1 -1
  255. package/dist/modules/setup-wizard/setup-wizard.controller.d.ts +3 -3
  256. package/dist/modules/setup-wizard/setup-wizard.controller.js +19 -20
  257. package/dist/modules/setup-wizard/setup-wizard.controller.js.map +1 -1
  258. package/dist/modules/setup-wizard/setup-wizard.gateway.d.ts +4 -4
  259. package/dist/modules/setup-wizard/setup-wizard.gateway.js +25 -21
  260. package/dist/modules/setup-wizard/setup-wizard.gateway.js.map +1 -1
  261. package/dist/modules/setup-wizard/setup-wizard.guard.d.ts +2 -2
  262. package/dist/modules/setup-wizard/setup-wizard.guard.js +11 -9
  263. package/dist/modules/setup-wizard/setup-wizard.guard.js.map +1 -1
  264. package/dist/modules/setup-wizard/setup-wizard.module.js +12 -15
  265. package/dist/modules/setup-wizard/setup-wizard.module.js.map +1 -1
  266. package/dist/modules/status/status.controller.d.ts +5 -5
  267. package/dist/modules/status/status.controller.js +40 -36
  268. package/dist/modules/status/status.controller.js.map +1 -1
  269. package/dist/modules/status/status.gateway.d.ts +11 -11
  270. package/dist/modules/status/status.gateway.js +51 -47
  271. package/dist/modules/status/status.gateway.js.map +1 -1
  272. package/dist/modules/status/status.interfaces.js +2 -5
  273. package/dist/modules/status/status.interfaces.js.map +1 -1
  274. package/dist/modules/status/status.module.js +26 -29
  275. package/dist/modules/status/status.module.js.map +1 -1
  276. package/dist/modules/status/status.service.d.ts +13 -13
  277. package/dist/modules/status/status.service.js +100 -88
  278. package/dist/modules/status/status.service.js.map +1 -1
  279. package/dist/modules/users/users.controller.d.ts +3 -3
  280. package/dist/modules/users/users.controller.js +59 -60
  281. package/dist/modules/users/users.controller.js.map +1 -1
  282. package/dist/modules/users/users.dto.js +51 -45
  283. package/dist/modules/users/users.dto.js.map +1 -1
  284. package/dist/modules/users/users.module.js +14 -17
  285. package/dist/modules/users/users.module.js.map +1 -1
  286. package/dist/self-check.js +25 -25
  287. package/dist/self-check.js.map +1 -1
  288. package/package.json +14 -12
  289. package/public/3rdpartylicenses.txt +26 -26
  290. package/public/{chunk-AI6E5JVH.js → chunk-24KMNOUL.js} +1 -1
  291. package/public/{chunk-RMZRXORR.js → chunk-2JKVDOVH.js} +1 -1
  292. package/public/chunk-2NCYMI5G.js +1 -0
  293. package/public/{chunk-TOYVIOBH.js → chunk-53XRPANC.js} +1 -1
  294. package/public/{chunk-5ETJWAIW.js → chunk-57Y3L52Q.js} +1 -1
  295. package/public/{chunk-3E2NZ5JW.js → chunk-5WXUZ3UB.js} +1 -1
  296. package/public/chunk-6JOKZWRV.js +1 -0
  297. package/public/{chunk-W3SNJ7TC.js → chunk-6KOTOEN7.js} +1 -1
  298. package/public/{chunk-WLGXJQPD.js → chunk-6RX377TT.js} +1 -1
  299. package/public/chunk-6WKO2T4Z.js +1 -0
  300. package/public/chunk-757LRGXE.js +68 -0
  301. package/public/{chunk-EAGKQ5OJ.js → chunk-7K67C3PU.js} +1 -1
  302. package/public/chunk-A2XCOYWA.js +1 -0
  303. package/public/{chunk-2KEG7SYT.js → chunk-A6QZW5FF.js} +1 -1
  304. package/public/chunk-ACO7OQZJ.js +1 -0
  305. package/public/{chunk-LWAL5JUG.js → chunk-AFJZVBKJ.js} +1 -1
  306. package/public/{chunk-325LPX6W.js → chunk-AFRZCXEB.js} +1 -1
  307. package/public/{chunk-6KT3BYU6.js → chunk-B65DT3FC.js} +1 -1
  308. package/public/{chunk-ADW6BF5G.js → chunk-BELFJ2SD.js} +1 -1
  309. package/public/chunk-DG6RGETW.js +1 -0
  310. package/public/{chunk-D5RKKI2A.js → chunk-DWAKEAKY.js} +1 -1
  311. package/public/chunk-EACHMWEA.js +50 -0
  312. package/public/{chunk-X5AKILHJ.js → chunk-ESOTGGKX.js} +1 -1
  313. package/public/chunk-F7DXQT5T.js +1 -0
  314. package/public/chunk-FS5QC22S.js +1 -0
  315. package/public/{chunk-4QXLJX7D.js → chunk-FSSORWXC.js} +1 -1
  316. package/public/chunk-GCSYCY2Y.js +1 -0
  317. package/public/{chunk-7UDDRMZZ.js → chunk-H22EEHWT.js} +1 -1
  318. package/public/{chunk-UF2IM5BE.js → chunk-HHHD7NH4.js} +1 -1
  319. package/public/{chunk-2FNQEOXF.js → chunk-HZFYCQBZ.js} +1 -1
  320. package/public/{chunk-OS2SEJZU.js → chunk-I24Z7SXB.js} +1 -1
  321. package/public/{chunk-TSFGO3MA.js → chunk-IJNJ3FHH.js} +1 -1
  322. package/public/{chunk-NKNWXFAK.js → chunk-JXJXX7ID.js} +1 -1
  323. package/public/chunk-KGXF4YD5.js +1 -0
  324. package/public/{chunk-YH6MRXGX.js → chunk-KLZ3D7WG.js} +1 -1
  325. package/public/{chunk-732XLY23.js → chunk-KVEQ2HM3.js} +3 -3
  326. package/public/{chunk-73TX7DHV.js → chunk-LGJ37P4E.js} +1 -1
  327. package/public/chunk-LMQCEFY5.js +19 -0
  328. package/public/{chunk-2CNQY2E7.js → chunk-LYPHF4BI.js} +1 -1
  329. package/public/{chunk-CYBDQV2B.js → chunk-MNT5ZGV3.js} +1 -1
  330. package/public/{chunk-SY4VNLXW.js → chunk-NPZDFVKF.js} +1 -1
  331. package/public/{chunk-EVND2DL5.js → chunk-NQ3EUNKR.js} +1 -1
  332. package/public/chunk-O63KCVSC.js +1 -0
  333. package/public/{chunk-2UOYBCTN.js → chunk-P7VMCG7G.js} +1 -1
  334. package/public/{chunk-OAHDGV32.js → chunk-PE5T5OTD.js} +1 -1
  335. package/public/{chunk-LZOHFRHN.js → chunk-QIB6F6O5.js} +1 -1
  336. package/public/{chunk-OK5EJ7US.js → chunk-QWSS6CWX.js} +1 -1
  337. package/public/{chunk-YNONXMOG.js → chunk-R6KWC4OQ.js} +1 -1
  338. package/public/chunk-RERUZJD4.js +5 -0
  339. package/public/{chunk-7IYTG6GP.js → chunk-S6M53YYQ.js} +1 -1
  340. package/public/{chunk-3IZSIVEA.js → chunk-TAYBEUKS.js} +1 -1
  341. package/public/{chunk-ASKB5DLO.js → chunk-UOYGACIL.js} +1 -1
  342. package/public/chunk-UUBGHMJO.js +1 -0
  343. package/public/chunk-VN4YJ4DW.js +1 -0
  344. package/public/chunk-VTCNWWXF.js +1 -0
  345. package/public/chunk-VWYLCYWH.js +1 -0
  346. package/public/chunk-VYNFC5TY.js +1 -0
  347. package/public/{chunk-WWSLIQVD.js → chunk-W6VJMRO6.js} +1 -1
  348. package/public/{chunk-3IJXQMYZ.js → chunk-WFVVY4KI.js} +1 -1
  349. package/public/chunk-WJVSACF7.js +4 -0
  350. package/public/{chunk-BLT2YCDN.js → chunk-WUEH3CVV.js} +1 -1
  351. package/public/chunk-WXDPCDNZ.js +2 -0
  352. package/public/{chunk-BTBGWLKK.js → chunk-XJ7EHBZC.js} +1 -1
  353. package/public/{chunk-ZEI3HZ6P.js → chunk-XQCLQKCG.js} +2 -2
  354. package/public/{chunk-ZJJ3EOBP.js → chunk-XUHWQHKX.js} +1 -1
  355. package/public/{chunk-VYC5JLE6.js → chunk-YFMEPI62.js} +1 -1
  356. package/public/{chunk-5T4JHJYL.js → chunk-YHIIRNVF.js} +1 -1
  357. package/public/{chunk-QK4V5DVW.js → chunk-YT7L7BBI.js} +1 -1
  358. package/public/index.html +2 -2
  359. package/public/{main-27RPBS22.js → main-WBUEOYPF.js} +1 -1
  360. package/public/{styles-CSF457UW.css → styles-WNHDEKE4.css} +1 -1
  361. package/scripts/extract-plugin-alias.js +8 -4
  362. package/public/chunk-2LXNPXT5.js +0 -1
  363. package/public/chunk-3XDYZNNE.js +0 -1
  364. package/public/chunk-57DUDNZJ.js +0 -1
  365. package/public/chunk-FM6ZYPKR.js +0 -4
  366. package/public/chunk-JJ7TVAIH.js +0 -5
  367. package/public/chunk-L43N56JA.js +0 -1
  368. package/public/chunk-L5I3DZ23.js +0 -1
  369. package/public/chunk-LH2LMHIZ.js +0 -1
  370. package/public/chunk-N2TWGDNX.js +0 -1
  371. package/public/chunk-O4SS7KVP.js +0 -40
  372. package/public/chunk-ONTEIYY3.js +0 -19
  373. package/public/chunk-P7TZIGJS.js +0 -50
  374. package/public/chunk-Q2IS3QQY.js +0 -1
  375. package/public/chunk-QQ5VZZQG.js +0 -1
  376. package/public/chunk-RYTGW6B7.js +0 -1
  377. package/public/chunk-SOT54YHI.js +0 -1
  378. package/public/chunk-TGZNYEGN.js +0 -1
  379. package/public/chunk-U5JF2ZOK.js +0 -1
  380. package/public/chunk-UNGEHXRN.js +0 -1
  381. package/public/chunk-VEGMNMLG.js +0 -1
  382. package/public/chunk-Y5FP6C55.js +0 -2
  383. package/public/chunk-YYJG2ENF.js +0 -1
@@ -1,30 +1,26 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.LinuxInstaller = void 0;
7
- const node_child_process_1 = require("node:child_process");
8
- const node_os_1 = require("node:os");
9
- const node_path_1 = require("node:path");
10
- const node_process_1 = __importDefault(require("node:process"));
11
- const fs_extra_1 = require("fs-extra");
12
- const semver_1 = require("semver");
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 (0, node_path_1.resolve)('/etc/systemd/system', `${this.systemdServiceName}.service`);
17
+ return resolve('/etc/systemd/system', `${this.systemdServiceName}.service`);
22
18
  }
23
19
  get systemdEnvPath() {
24
- return (0, node_path_1.resolve)('/etc/default', this.systemdServiceName);
20
+ return resolve('/etc/default', this.systemdServiceName);
25
21
  }
26
22
  get runPartsPath() {
27
- return (0, node_path_1.resolve)('/etc/hb-service', this.hbService.serviceName.toLowerCase(), 'prestart.d');
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 ((0, fs_extra_1.existsSync)(this.systemdServicePath)) {
57
- (0, fs_extra_1.unlinkSync)(this.systemdServicePath);
52
+ if (existsSync(this.systemdServicePath)) {
53
+ unlinkSync(this.systemdServicePath);
58
54
  }
59
- if ((0, fs_extra_1.existsSync)(this.systemdEnvPath)) {
60
- (0, fs_extra_1.unlinkSync)(this.systemdEnvPath);
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 = (0, node_child_process_1.execSync)(`journalctl -n 50 -u ${this.systemdServiceName} --no-pager`).toString();
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
- (0, node_child_process_1.execSync)(`systemctl start ${this.systemdServiceName}`);
85
- (0, node_child_process_1.execSync)(`systemctl status ${this.systemdServiceName} --no-pager`);
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
- node_process_1.default.exit(1);
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
- (0, node_child_process_1.execSync)(`systemctl stop ${this.systemdServiceName}`);
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
- (0, node_child_process_1.execSync)(`systemctl restart ${this.systemdServiceName}`);
109
- (0, node_child_process_1.execSync)(`systemctl status ${this.systemdServiceName} --no-pager`);
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((0, node_path_1.dirname)(node_process_1.default.env.UIX_BASE_PATH))) {
116
+ ].includes(dirname(process.env.UIX_BASE_PATH))) {
121
117
  setTimeout(() => {
122
- node_process_1.default.exit(0);
118
+ process.exit(0);
123
119
  }, 60000);
124
- const modulesPath = (0, node_path_1.dirname)(node_process_1.default.env.UIX_BASE_PATH);
125
- const temporaryDirectoriesToClean = (await (0, fs_extra_1.readdir)(modulesPath)).filter((x) => {
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 = (0, node_path_1.join)(modulesPath, directory);
125
+ const pathToRemove = join(modulesPath, directory);
130
126
  try {
131
127
  console.log('Removing stale temporary directory:', pathToRemove);
132
- await (0, fs_extra_1.rm)(pathToRemove, { recursive: true, force: true });
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
- node_process_1.default.exit(0);
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 = (0, node_child_process_1.execSync)('node -v').toString('utf8').trim();
150
- const npmGlobalPath = (0, node_child_process_1.execSync)('/bin/echo -n "$(npm -g prefix)/lib/node_modules"', {
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
- }, node_process_1.default.env),
150
+ }, process.env),
155
151
  }).toString('utf8');
156
- (0, node_child_process_1.execSync)('npm rebuild --unsafe-perm', {
157
- cwd: node_process_1.default.env.UIX_BASE_PATH,
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
- (0, node_child_process_1.execSync)('npm rebuild --unsafe-perm', {
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 (node_process_1.default.getuid() === 0 && this.hbService.asUser) {
181
- const uid = (0, node_child_process_1.execSync)(`id -u ${this.hbService.asUser}`).toString('utf8');
182
- const gid = (0, node_child_process_1.execSync)(`id -g ${this.hbService.asUser}`).toString('utf8');
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: (0, node_os_1.userInfo)().uid,
191
- gid: (0, node_os_1.userInfo)().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 (0, node_child_process_1.execSync)('pidof homebridge').toString('utf8').trim();
194
+ return execSync('pidof homebridge').toString('utf8').trim();
199
195
  }
200
196
  else {
201
- return (0, node_child_process_1.execSync)(`fuser ${port}/tcp 2>/dev/null`).toString('utf8').trim();
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 ((0, semver_1.gte)(job.target, '24.0.0')) {
216
- if (!(0, node_version_constants_1.isNodeV24SupportedArchitecture)()) {
217
- this.hbService.logger(`Node.js ${job.target} is not supported on ${node_process_1.default.arch} architecture.`, 'fail');
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
- node_process_1.default.exit(1);
215
+ process.exit(1);
220
216
  }
221
217
  }
222
- const targetPath = (0, node_path_1.dirname)((0, node_path_1.dirname)(node_process_1.default.execPath));
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
- node_process_1.default.exit(1);
221
+ process.exit(1);
226
222
  }
227
- if (targetPath === '/usr' && await (0, fs_extra_1.pathExists)('/etc/apt/sources.list.d/nodesource.list')) {
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 (0, fs_extra_1.pathExists)(this.systemdServicePath)) {
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((0, node_child_process_1.execSync)('getconf GNU_LIBC_VERSION 2>/dev/null').toString().split('glibc')[1].trim());
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
- node_process_1.default.exit(1);
245
+ process.exit(1);
250
246
  }
251
- if ((0, semver_1.gte)(target, '18.0.0') && glibcVersion < 2.28) {
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
- node_process_1.default.exit(1);
250
+ process.exit(1);
255
251
  }
256
- if ((0, semver_1.gte)(target, '20.0.0') && glibcVersion < 2.31) {
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
- node_process_1.default.exit(1);
255
+ process.exit(1);
260
256
  }
261
257
  }
262
258
  async updateNodeFromTarball(job, targetPath) {
263
259
  try {
264
- if (node_process_1.default.env.HOMEBRIDGE_SYNOLOGY_PACKAGE === '1') {
265
- if ((0, semver_1.gte)(job.target, '18.0.0')) {
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
- node_process_1.default.exit(1);
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 (0, systeminformation_1.osInfo)();
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
- node_process_1.default.exit(1);
279
+ process.exit(1);
284
280
  }
285
- const uname = (0, node_child_process_1.execSync)('uname -m').toString().trim();
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 ((0, node_child_process_1.execSync)('getconf LONG_BIT')?.toString()?.trim() === '32') {
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: ${node_process_1.default.arch}.`, 'fail');
307
- node_process_1.default.exit(1);
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((0, node_path_1.resolve)(targetPath, 'lib', 'node_modules', 'npm'));
315
+ await this.hbService.removeNpmPackage(resolve(targetPath, 'lib', 'node_modules', 'npm'));
320
316
  await this.hbService.extractNodejs(job.target, extractConfig);
321
- await (0, fs_extra_1.remove)(archivePath);
317
+ await remove(archivePath);
322
318
  }
323
319
  catch (e) {
324
320
  this.hbService.logger(`Failed to update Node.js: ${e.message}`, 'fail');
325
- node_process_1.default.exit(1);
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 = (0, semver_1.parse)(job.target).major;
333
- (0, node_child_process_1.execSync)('apt-get update --allow-releaseinfo-change && sudo apt-get install -y ca-certificates curl gnupg', {
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
- (0, node_child_process_1.execSync)('mkdir -p /etc/apt/keyrings', {
332
+ execSync('mkdir -p /etc/apt/keyrings', {
337
333
  stdio: 'inherit',
338
334
  });
339
- (0, node_child_process_1.execSync)('curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor --yes -o /etc/apt/keyrings/nodes', {
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 (0, fs_extra_1.pathExists)('/usr/share/keyrings/nodesource.gpg')) {
343
- (0, node_child_process_1.execSync)('rm -f /usr/share/keyrings/nodesource.gpg', {
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
- (0, node_child_process_1.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`, {
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 < (0, semver_1.parse)(node_process_1.default.version).major) {
351
- (0, node_child_process_1.execSync)('apt-get remove -y nodejs', {
346
+ if (majorVersion < parse(process.version).major) {
347
+ execSync('apt-get remove -y nodejs', {
352
348
  stdio: 'inherit',
353
349
  });
354
350
  }
355
- (0, node_child_process_1.execSync)('apt-get update && apt-get install -y nodejs', {
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
- node_process_1.default.exit(1);
357
+ process.exit(1);
362
358
  }
363
359
  }
364
360
  async reloadSystemd() {
365
361
  try {
366
- (0, node_child_process_1.execSync)('systemctl daemon-reload');
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
- (0, node_child_process_1.execSync)(`systemctl enable ${this.systemdServiceName} 2> /dev/null`);
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
- (0, node_child_process_1.execSync)(`systemctl disable ${this.systemdServiceName} 2> /dev/null`);
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
- node_process_1.default.exit(1);
387
+ process.exit(1);
392
388
  }
393
- if (node_process_1.default.getuid() !== 0) {
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
- node_process_1.default.exit(1);
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
- node_process_1.default.exit(1);
397
+ process.exit(1);
402
398
  }
403
399
  }
404
400
  checkIsNotRoot() {
405
- if (node_process_1.default.getuid() === 0 && !this.hbService.allowRunRoot && node_process_1.default.env.HOMEBRIDGE_CONFIG_UI !== '1') {
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
- node_process_1.default.exit(1);
404
+ process.exit(1);
409
405
  }
410
406
  }
411
407
  async checkUser() {
412
408
  try {
413
- (0, node_child_process_1.execSync)(`id ${this.hbService.asUser} 2> /dev/null`);
409
+ execSync(`id ${this.hbService.asUser} 2> /dev/null`);
414
410
  }
415
411
  catch (e) {
416
- (0, node_child_process_1.execSync)(`useradd -m --system ${this.hbService.asUser}`);
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
- (0, node_child_process_1.execSync)(`usermod -a -G ${this.hbService.addGroup} ${this.hbService.asUser}`, { timeout: 10000 });
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 (0, systeminformation_1.osInfo)();
420
+ const os = await osInfo();
425
421
  if (os.distro === 'Raspbian GNU/Linux') {
426
- (0, node_child_process_1.execSync)(`usermod -a -G audio,bluetooth,dialout,gpio,video ${this.hbService.asUser} 2> /dev/null`);
427
- (0, node_child_process_1.execSync)(`usermod -a -G input,i2c,spi ${this.hbService.asUser} 2> /dev/null`);
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 = (0, node_child_process_1.execSync)('which npm').toString('utf8').trim();
436
- const shutdownPath = (0, node_child_process_1.execSync)('which shutdown').toString('utf8').trim();
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 = (0, fs_extra_1.readFileSync)('/etc/sudoers', 'utf-8');
434
+ const sudoers = readFileSync('/etc/sudoers', 'utf-8');
439
435
  if (sudoers.includes(sudoersEntry)) {
440
436
  return;
441
437
  }
442
- (0, node_child_process_1.execSync)(`echo '${sudoersEntry}' | sudo EDITOR='tee -a' visudo`);
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(node_process_1.default.env.HOMEBRIDGE_SYNOLOGY_PACKAGE === '1')
450
- || Boolean(node_process_1.default.env.HOMEBRIDGE_APT_PACKAGE === '1'));
445
+ return (Boolean(process.env.HOMEBRIDGE_SYNOLOGY_PACKAGE === '1')
446
+ || Boolean(process.env.HOMEBRIDGE_APT_PACKAGE === '1'));
451
447
  }
452
448
  fixPermissions() {
453
- if ((0, fs_extra_1.existsSync)(this.systemdServicePath) && (0, fs_extra_1.existsSync)(this.systemdEnvPath)) {
449
+ if (existsSync(this.systemdServicePath) && existsSync(this.systemdEnvPath)) {
454
450
  try {
455
- const serviceUser = (0, node_child_process_1.execSync)(`cat "${this.systemdServicePath}" | grep "User=" | awk -F'=' '{print $2}'`)
451
+ const serviceUser = execSync(`cat "${this.systemdServicePath}" | grep "User=" | awk -F'=' '{print $2}'`)
456
452
  .toString('utf8')
457
453
  .trim();
458
- const storagePath = (0, node_child_process_1.execSync)(`cat "${this.systemdEnvPath}" | grep "UIX_STORAGE_PATH" | awk -F'=' '{print $2}' | sed -e 's/^"//' -e 's/"$//'`)
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 && (0, fs_extra_1.existsSync)(storagePath)) {
462
- (0, node_child_process_1.execSync)(`chown -R ${serviceUser}: "${storagePath}"`);
457
+ if (storagePath.length > 5 && existsSync(storagePath)) {
458
+ execSync(`chown -R ${serviceUser}: "${storagePath}"`);
463
459
  }
464
- (0, node_child_process_1.execSync)(`chmod a+x ${this.hbService.selfPath}`);
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 (0, fs_extra_1.pathExists)('/usr/sbin/ufw')) {
468
+ if (await pathExists('/usr/sbin/ufw')) {
473
469
  return await this.createUfwRules();
474
470
  }
475
- if (await (0, fs_extra_1.pathExists)('/usr/bin/firewall-cmd')) {
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 = (0, node_child_process_1.execSync)('/bin/echo -n "$(ufw status)" 2> /dev/null').toString('utf8');
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 (0, fs_extra_1.readJson)(node_process_1.default.env.UIX_CONFIG_PATH);
481
+ const currentConfig = await readJson(process.env.UIX_CONFIG_PATH);
486
482
  const bridgePort = currentConfig.bridge?.port;
487
- (0, node_child_process_1.execSync)(`ufw allow ${this.hbService.uiPort}/tcp 2> /dev/null`);
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
- (0, node_child_process_1.execSync)(`ufw allow ${bridgePort}/tcp 2> /dev/null`);
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 = (0, node_child_process_1.execSync)('/bin/echo -n "$(firewall-cmd --state)" 2> /dev/null').toString('utf8');
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 (0, fs_extra_1.readJson)(node_process_1.default.env.UIX_CONFIG_PATH);
500
+ const currentConfig = await readJson(process.env.UIX_CONFIG_PATH);
505
501
  const bridgePort = currentConfig.bridge?.port;
506
- (0, node_child_process_1.execSync)(`firewall-cmd --permanent --add-port=${this.hbService.uiPort}/tcp 2> /dev/null`);
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
- (0, node_child_process_1.execSync)(`firewall-cmd --permanent --add-port=${bridgePort}/tcp 2> /dev/null`);
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
- (0, node_child_process_1.execSync)('firewall-cmd --reload 2> /dev/null');
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 (0, fs_extra_1.mkdirp)(this.runPartsPath);
521
- const permissionScriptPath = (0, node_path_1.resolve)(this.runPartsPath, '10-fix-permissions');
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 (0, fs_extra_1.writeFile)(permissionScriptPath, permissionScript);
533
- await (0, fs_extra_1.chmod)(permissionScriptPath, '755');
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 (0, fs_extra_1.writeFile)(this.systemdEnvPath, envFile);
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 (0, fs_extra_1.writeFile)(this.systemdServicePath, serviceFile);
568
+ await writeFile(this.systemdServicePath, serviceFile);
573
569
  }
574
570
  }
575
- exports.LinuxInstaller = LinuxInstaller;
576
571
  //# sourceMappingURL=linux.js.map