home-hosted 0.13.0 → 0.20.0

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 (485) hide show
  1. package/README.md +117 -322
  2. package/bin/home-hosted.mjs +41 -0
  3. package/dist/chunks/account-DiLrSyww.js +359 -0
  4. package/dist/chunks/account-DiLrSyww.js.map +1 -0
  5. package/dist/chunks/add-DEIYVkNK.js +183 -0
  6. package/dist/chunks/add-DEIYVkNK.js.map +1 -0
  7. package/dist/chunks/{archive-DP-XQR8X.js → archive-DFi3qK1c.js} +25 -73
  8. package/dist/chunks/archive-DFi3qK1c.js.map +1 -0
  9. package/dist/chunks/{atomic-C1PfJpE7.js → atomic-SZUwDtGD.js} +3 -6
  10. package/dist/chunks/atomic-SZUwDtGD.js.map +1 -0
  11. package/dist/chunks/{backup-CZcVca2a.js → backup-DnyxIzw0.js} +110 -190
  12. package/dist/chunks/backup-DnyxIzw0.js.map +1 -0
  13. package/dist/chunks/backups-BrrN6cwW.js +2203 -0
  14. package/dist/chunks/backups-BrrN6cwW.js.map +1 -0
  15. package/dist/chunks/bind-DIxrnUst.js +43 -0
  16. package/dist/chunks/bind-DIxrnUst.js.map +1 -0
  17. package/dist/chunks/config-text-DxMOQQnk.js +34 -0
  18. package/dist/chunks/config-text-DxMOQQnk.js.map +1 -0
  19. package/dist/chunks/{contracts-CMBD1TF9.js → contracts-CxZ7u1L3.js} +1239 -1454
  20. package/dist/chunks/contracts-CxZ7u1L3.js.map +1 -0
  21. package/dist/chunks/daemon-BAAYUYQC.js +211 -0
  22. package/dist/chunks/daemon-BAAYUYQC.js.map +1 -0
  23. package/dist/chunks/daemon-log-Ccu-69vB.js +179 -0
  24. package/dist/chunks/daemon-log-Ccu-69vB.js.map +1 -0
  25. package/dist/chunks/deploy-CggSOEkq.js +144 -0
  26. package/dist/chunks/deploy-CggSOEkq.js.map +1 -0
  27. package/dist/chunks/{docker-Cy9Lyvda.js → docker--Un0uLfF.js} +32 -68
  28. package/dist/chunks/docker--Un0uLfF.js.map +1 -0
  29. package/dist/chunks/{down-pKbGCW9d.js → down-CpIN7LEQ.js} +34 -94
  30. package/dist/chunks/down-CpIN7LEQ.js.map +1 -0
  31. package/dist/chunks/exposure-CDJNvOCK.js +229 -0
  32. package/dist/chunks/exposure-CDJNvOCK.js.map +1 -0
  33. package/dist/chunks/import-Bd4VZH0f.js +205 -0
  34. package/dist/chunks/import-Bd4VZH0f.js.map +1 -0
  35. package/dist/chunks/import-plan--fDS_l5r.js +147 -0
  36. package/dist/chunks/import-plan--fDS_l5r.js.map +1 -0
  37. package/dist/chunks/import-write-BTfbeV26.js +42 -0
  38. package/dist/chunks/import-write-BTfbeV26.js.map +1 -0
  39. package/dist/chunks/{init-BZ7hK9Vf.js → init-Bv3oH65x.js} +14 -50
  40. package/dist/chunks/init-Bv3oH65x.js.map +1 -0
  41. package/dist/chunks/job-CYOdN6Ub.js +341 -0
  42. package/dist/chunks/job-CYOdN6Ub.js.map +1 -0
  43. package/dist/chunks/jobs-BX4ahcfh.js +489 -0
  44. package/dist/chunks/jobs-BX4ahcfh.js.map +1 -0
  45. package/dist/chunks/last-stop-DD3lHwo_.js +42 -0
  46. package/dist/chunks/last-stop-DD3lHwo_.js.map +1 -0
  47. package/dist/chunks/layout-D0ysDNav.js +18 -0
  48. package/dist/chunks/layout-D0ysDNav.js.map +1 -0
  49. package/dist/chunks/lazy-kfcBNeqj.js +48 -0
  50. package/dist/chunks/lazy-kfcBNeqj.js.map +1 -0
  51. package/dist/chunks/log-buffer-B7jmn7ts.js +110 -0
  52. package/dist/chunks/log-buffer-B7jmn7ts.js.map +1 -0
  53. package/dist/chunks/log-files-CZL2UhuE.js +488 -0
  54. package/dist/chunks/log-files-CZL2UhuE.js.map +1 -0
  55. package/dist/chunks/{logger-B5U4GD3j.js → logger-BnrKTBHQ.js} +2 -6
  56. package/dist/chunks/logger-BnrKTBHQ.js.map +1 -0
  57. package/dist/chunks/{logs---TI_bxM.js → logs-DxKI6OW2.js} +23 -73
  58. package/dist/chunks/logs-DxKI6OW2.js.map +1 -0
  59. package/dist/chunks/ls-BseUHy_m.js +128 -0
  60. package/dist/chunks/ls-BseUHy_m.js.map +1 -0
  61. package/dist/chunks/migrate-D4w_dXDm.js +268 -0
  62. package/dist/chunks/migrate-D4w_dXDm.js.map +1 -0
  63. package/dist/chunks/{nanny-B-Eu0sFW.js → nanny-BWh7nuvv.js} +21 -14
  64. package/dist/chunks/nanny-BWh7nuvv.js.map +1 -0
  65. package/dist/chunks/{nanny-ChMtq1Zl.js → nanny-BjF2-1pv.js} +3 -3
  66. package/dist/chunks/{nanny-ChMtq1Zl.js.map → nanny-BjF2-1pv.js.map} +1 -1
  67. package/dist/chunks/nanny-DGTXVq5d.js +806 -0
  68. package/dist/chunks/nanny-DGTXVq5d.js.map +1 -0
  69. package/dist/chunks/{nanny-sweep-DErnlPY1.js → nanny-sweep-hjmZ_p7S.js} +14 -24
  70. package/dist/chunks/nanny-sweep-hjmZ_p7S.js.map +1 -0
  71. package/dist/chunks/{nearest-6KgQEDUe.js → nearest-DOx4jySJ.js} +2 -10
  72. package/dist/chunks/nearest-DOx4jySJ.js.map +1 -0
  73. package/dist/chunks/{parse-DhmG26fI.js → parse-DVMPLUDe.js} +47 -72
  74. package/dist/chunks/parse-DVMPLUDe.js.map +1 -0
  75. package/dist/chunks/password-policy-Clq6PGE-.js +9 -0
  76. package/dist/chunks/password-policy-Clq6PGE-.js.map +1 -0
  77. package/dist/chunks/{paths-CGlGDrOU.js → paths-C34-TJLh.js} +32 -56
  78. package/dist/chunks/paths-C34-TJLh.js.map +1 -0
  79. package/dist/chunks/{port-B8WBTRMk.js → port-CnsrxKNR.js} +27 -71
  80. package/dist/chunks/port-CnsrxKNR.js.map +1 -0
  81. package/dist/chunks/process-CboOFPU_.js +192 -0
  82. package/dist/chunks/process-CboOFPU_.js.map +1 -0
  83. package/dist/chunks/{restart-Des4DrAN.js → restart-C0J8dZ2L.js} +11 -29
  84. package/dist/chunks/restart-C0J8dZ2L.js.map +1 -0
  85. package/dist/chunks/run-deploy-DoNDvwT4.js +91 -0
  86. package/dist/chunks/run-deploy-DoNDvwT4.js.map +1 -0
  87. package/dist/chunks/{schema-B240VXcV.js → schema-CZ6f-PHD.js} +7 -20
  88. package/dist/chunks/schema-CZ6f-PHD.js.map +1 -0
  89. package/dist/chunks/secret-MY397r90.js +219 -0
  90. package/dist/chunks/secret-MY397r90.js.map +1 -0
  91. package/dist/chunks/secrets-CG5N4lwY.js +1061 -0
  92. package/dist/chunks/secrets-CG5N4lwY.js.map +1 -0
  93. package/dist/chunks/server-Dm_dXfTW.js +255 -0
  94. package/dist/chunks/server-Dm_dXfTW.js.map +1 -0
  95. package/dist/chunks/server-attention-UQwYXqKe.js +10 -0
  96. package/dist/chunks/server-attention-UQwYXqKe.js.map +1 -0
  97. package/dist/chunks/server-create-D7nvhgBd.js +96 -0
  98. package/dist/chunks/server-create-D7nvhgBd.js.map +1 -0
  99. package/dist/chunks/server-ids-BEQD2rFz.js +23 -0
  100. package/dist/chunks/server-ids-BEQD2rFz.js.map +1 -0
  101. package/dist/chunks/server-vars-DMYmHutL.js +27 -0
  102. package/dist/chunks/server-vars-DMYmHutL.js.map +1 -0
  103. package/dist/chunks/service-C8l-ewNA.js +585 -0
  104. package/dist/chunks/service-C8l-ewNA.js.map +1 -0
  105. package/dist/chunks/{settings-xu-XTfWg.js → settings-CtYDs5PX.js} +62 -78
  106. package/dist/chunks/settings-CtYDs5PX.js.map +1 -0
  107. package/dist/chunks/{setup-temp-CAN4_bA-.js → setup-temp-TAtDmMMU.js} +43 -37
  108. package/dist/chunks/setup-temp-TAtDmMMU.js.map +1 -0
  109. package/dist/chunks/shape-CDGeYl_J.js +9 -0
  110. package/dist/chunks/shape-CDGeYl_J.js.map +1 -0
  111. package/dist/chunks/{src-BtWMFmzZ.js → src-BnzkVy_M.js} +12548 -10576
  112. package/dist/chunks/src-BnzkVy_M.js.map +1 -0
  113. package/dist/chunks/{status-DT1EsA-B.js → status-efbbfYZQ.js} +53 -26
  114. package/dist/chunks/status-efbbfYZQ.js.map +1 -0
  115. package/dist/chunks/store-Bs_Lljjm.js +2082 -0
  116. package/dist/chunks/store-Bs_Lljjm.js.map +1 -0
  117. package/dist/chunks/template-xan58bJh.js +28 -0
  118. package/dist/chunks/template-xan58bJh.js.map +1 -0
  119. package/dist/chunks/token-DDeWfZA4.js +142 -0
  120. package/dist/chunks/token-DDeWfZA4.js.map +1 -0
  121. package/dist/chunks/{ui-D562aqw5.js → ui-BcIAtyxE.js} +68 -79
  122. package/dist/chunks/ui-BcIAtyxE.js.map +1 -0
  123. package/dist/chunks/{ui-dir-CsU3uLNV.js → ui-dir-ClCzVRc3.js} +3 -7
  124. package/dist/chunks/ui-dir-ClCzVRc3.js.map +1 -0
  125. package/dist/chunks/ui-format-CDvvqOoi.js +53 -0
  126. package/dist/chunks/ui-format-CDvvqOoi.js.map +1 -0
  127. package/dist/chunks/{ui-release-DKzVvlLd.js → ui-release-XbJ85pYI.js} +36 -38
  128. package/dist/chunks/ui-release-XbJ85pYI.js.map +1 -0
  129. package/dist/chunks/{ui-revert-EkBBwRTt.js → ui-revert-Dgawq7ze.js} +4 -4
  130. package/dist/chunks/ui-revert-Dgawq7ze.js.map +1 -0
  131. package/dist/chunks/{ui-switch-BnZTdMDd.js → ui-switch-CfQMbZ0g.js} +31 -38
  132. package/dist/chunks/ui-switch-CfQMbZ0g.js.map +1 -0
  133. package/dist/chunks/{ui-update-_xryLYxw.js → ui-update-B3PPivUm.js} +30 -48
  134. package/dist/chunks/ui-update-B3PPivUm.js.map +1 -0
  135. package/dist/chunks/ui-update-CAiH2tFb.js +109 -0
  136. package/dist/chunks/ui-update-CAiH2tFb.js.map +1 -0
  137. package/dist/chunks/{up-Pdz-l6IH.js → up-BQSnYxYd.js} +47 -53
  138. package/dist/chunks/up-BQSnYxYd.js.map +1 -0
  139. package/dist/chunks/{usage-DFrCVXpT.js → usage-KG8TeOio.js} +7 -20
  140. package/dist/chunks/usage-KG8TeOio.js.map +1 -0
  141. package/dist/chunks/{workspaces-DYcfvKV_.js → workspaces-D9akpzU8.js} +80 -68
  142. package/dist/chunks/workspaces-D9akpzU8.js.map +1 -0
  143. package/dist/chunks/{wsl-temperature-BiCI4iK6.js → wsl-temperature-D-_d4Yk1.js} +47 -42
  144. package/dist/chunks/wsl-temperature-D-_d4Yk1.js.map +1 -0
  145. package/dist/cli.js +306 -238
  146. package/dist/cli.js.map +1 -1
  147. package/dist/client.js +76 -29
  148. package/dist/client.js.map +1 -1
  149. package/dist/types/api/acme.d.ts +3 -7
  150. package/dist/types/api/auth/$.routes.d.ts +107 -16
  151. package/dist/types/api/backups.d.ts +5 -5
  152. package/dist/types/api/control.d.ts +747 -38
  153. package/dist/types/api/ddns.d.ts +13 -18
  154. package/dist/types/api/events.d.ts +9 -3
  155. package/dist/types/api/health.d.ts +2 -4
  156. package/dist/types/api/jobs.d.ts +438 -0
  157. package/dist/types/api/logs.d.ts +20 -0
  158. package/dist/types/api/metrics.d.ts +2 -5
  159. package/dist/types/api/notifications.d.ts +3 -6
  160. package/dist/types/api/proxy.d.ts +63 -23
  161. package/dist/types/api/server-ops.d.ts +17 -0
  162. package/dist/types/api/servers/$.routes.d.ts +418 -186
  163. package/dist/types/api/session-required.d.ts +16 -0
  164. package/dist/types/api/settings.d.ts +7 -7
  165. package/dist/types/api/state.d.ts +100 -10
  166. package/dist/types/api/static.d.ts +2 -2
  167. package/dist/types/api/tls.d.ts +2 -5
  168. package/dist/types/api/workspaces/$.routes.d.ts +186 -12
  169. package/dist/types/api/wsl-temperature.d.ts +4 -10
  170. package/dist/types/app.d.ts +4511 -2778
  171. package/dist/types/cli/account.d.ts +23 -0
  172. package/dist/types/cli/add.d.ts +96 -0
  173. package/dist/types/cli/args.d.ts +24 -35
  174. package/dist/types/cli/backup-offline.d.ts +2 -8
  175. package/dist/types/cli/backup.d.ts +12 -21
  176. package/dist/types/cli/down.d.ts +15 -41
  177. package/dist/types/cli/import-plan.d.ts +55 -0
  178. package/dist/types/cli/import-write.d.ts +5 -0
  179. package/dist/types/cli/import.d.ts +86 -0
  180. package/dist/types/cli/io.d.ts +26 -35
  181. package/dist/types/cli/job.d.ts +99 -0
  182. package/dist/types/cli/logs.d.ts +1 -10
  183. package/dist/types/cli/ls.d.ts +57 -0
  184. package/dist/types/cli/migrate.d.ts +31 -8
  185. package/dist/types/cli/nearest.d.ts +1 -9
  186. package/dist/types/cli/run-deploy.d.ts +36 -0
  187. package/dist/types/cli/secret.d.ts +90 -0
  188. package/dist/types/cli/server.d.ts +6 -15
  189. package/dist/types/cli/service.d.ts +135 -0
  190. package/dist/types/cli/setup-temp.d.ts +17 -13
  191. package/dist/types/cli/status.d.ts +7 -1
  192. package/dist/types/cli/token.d.ts +6 -0
  193. package/dist/types/cli/ui-switch.d.ts +3 -14
  194. package/dist/types/cli/ui-update.d.ts +3 -16
  195. package/dist/types/cli/up.d.ts +9 -22
  196. package/dist/types/cli/usage.d.ts +2 -6
  197. package/dist/types/cli.d.ts +1 -10
  198. package/dist/types/client.d.ts +4099 -1142
  199. package/dist/types/config/accounts.d.ts +16 -0
  200. package/dist/types/config/jobs.d.ts +68 -0
  201. package/dist/types/config/layout.d.ts +2 -8
  202. package/dist/types/config/migrations.d.ts +9 -41
  203. package/dist/types/config/parse.d.ts +8 -13
  204. package/dist/types/config/patch.d.ts +1 -6
  205. package/dist/types/config/schema.d.ts +16 -18
  206. package/dist/types/config/secret-parts.d.ts +6 -27
  207. package/dist/types/config/secrets.d.ts +167 -88
  208. package/dist/types/config/seed.d.ts +1 -6
  209. package/dist/types/config/server-ids.d.ts +2 -11
  210. package/dist/types/config/settings.d.ts +13 -49
  211. package/dist/types/config/store.d.ts +17 -54
  212. package/dist/types/config/workspaces.d.ts +24 -56
  213. package/dist/types/helpers/action-result.d.ts +18 -32
  214. package/dist/types/helpers/atomic.d.ts +1 -4
  215. package/dist/types/helpers/backoff.d.ts +0 -1
  216. package/dist/types/helpers/bind.d.ts +3 -11
  217. package/dist/types/helpers/config-text.d.ts +4 -19
  218. package/dist/types/helpers/cookies.d.ts +2 -7
  219. package/dist/types/helpers/copy-tree.d.ts +4 -12
  220. package/dist/types/helpers/daemon-log.d.ts +8 -33
  221. package/dist/types/helpers/daemon.d.ts +20 -70
  222. package/dist/types/helpers/deferred.d.ts +2 -4
  223. package/dist/types/helpers/env-file.d.ts +2 -7
  224. package/dist/types/helpers/error.d.ts +3 -14
  225. package/dist/types/helpers/event-stream.d.ts +18 -10
  226. package/dist/types/helpers/factory.d.ts +2 -3
  227. package/dist/types/helpers/last-stop.d.ts +5 -12
  228. package/dist/types/helpers/logger.d.ts +1 -5
  229. package/dist/types/helpers/open.d.ts +0 -1
  230. package/dist/types/helpers/openapi.d.ts +19 -5
  231. package/dist/types/helpers/paths.d.ts +18 -53
  232. package/dist/types/helpers/restore-lock.d.ts +2 -17
  233. package/dist/types/helpers/runtime.d.ts +3 -13
  234. package/dist/types/helpers/secret-compare.d.ts +2 -10
  235. package/dist/types/helpers/server-create.d.ts +15 -0
  236. package/dist/types/helpers/shell.d.ts +2 -16
  237. package/dist/types/helpers/sse.d.ts +8 -6
  238. package/dist/types/helpers/ui-dir.d.ts +1 -5
  239. package/dist/types/helpers/utf8-chunks.d.ts +2 -8
  240. package/dist/types/helpers/validate.d.ts +2 -4
  241. package/dist/types/helpers/validator.d.ts +8 -4
  242. package/dist/types/helpers/version.d.ts +1 -6
  243. package/dist/types/helpers/workspace.d.ts +24 -16
  244. package/dist/types/index.d.ts +2 -3
  245. package/dist/types/middleware/auth.d.ts +8 -27
  246. package/dist/types/middleware/body-limit.d.ts +10 -0
  247. package/dist/types/middleware/host.d.ts +4 -23
  248. package/dist/types/middleware/loopback.d.ts +1 -8
  249. package/dist/types/middleware/token-scope.d.ts +34 -0
  250. package/dist/types/node-compat.d.ts +43 -0
  251. package/dist/types/openapi-reference.d.ts +4 -19
  252. package/dist/types/openapi.d.ts +5 -8
  253. package/dist/types/providers/archive.d.ts +8 -25
  254. package/dist/types/providers/backup-hook.d.ts +4 -19
  255. package/dist/types/providers/ddns/dyndns2.d.ts +0 -3
  256. package/dist/types/providers/ddns/index.d.ts +2 -3
  257. package/dist/types/providers/ddns/ip.d.ts +2 -12
  258. package/dist/types/providers/ddns/namecheap-api.d.ts +3 -2
  259. package/dist/types/providers/ddns/types.d.ts +6 -32
  260. package/dist/types/providers/ddns/zone.d.ts +1 -4
  261. package/dist/types/providers/docker.d.ts +18 -45
  262. package/dist/types/providers/entry-state.d.ts +4 -9
  263. package/dist/types/providers/health-check.d.ts +1 -5
  264. package/dist/types/providers/host.d.ts +33 -108
  265. package/dist/types/providers/identity.d.ts +9 -34
  266. package/dist/types/providers/log-tail.d.ts +14 -24
  267. package/dist/types/providers/nanny-sweep.d.ts +8 -25
  268. package/dist/types/providers/nanny.d.ts +16 -58
  269. package/dist/types/providers/port.d.ts +28 -83
  270. package/dist/types/providers/proc.d.ts +22 -80
  271. package/dist/types/providers/process.d.ts +12 -36
  272. package/dist/types/providers/proxy/admin.d.ts +11 -0
  273. package/dist/types/providers/proxy/types.d.ts +4 -16
  274. package/dist/types/providers/telegram.d.ts +1 -17
  275. package/dist/types/providers/ui-release.d.ts +15 -25
  276. package/dist/types/providers/webhook.d.ts +8 -29
  277. package/dist/types/providers/wsl-temperature.d.ts +13 -22
  278. package/dist/types/services/acme-challenge.d.ts +2 -16
  279. package/dist/types/services/auth.d.ts +65 -80
  280. package/dist/types/services/backups/archive-safety.d.ts +30 -0
  281. package/dist/types/services/backups/paths.d.ts +31 -0
  282. package/dist/types/services/backups.d.ts +61 -271
  283. package/dist/types/services/config-watch.d.ts +3 -15
  284. package/dist/types/services/control-server.d.ts +6 -10
  285. package/dist/types/services/ddns.d.ts +12 -13
  286. package/dist/types/services/dependencies.d.ts +3 -14
  287. package/dist/types/services/deploy.d.ts +34 -0
  288. package/dist/types/services/events.d.ts +15 -9
  289. package/dist/types/services/exposure.d.ts +13 -63
  290. package/dist/types/services/history.d.ts +5 -14
  291. package/dist/types/services/host-monitor.d.ts +6 -11
  292. package/dist/types/services/init.d.ts +5 -35
  293. package/dist/types/services/job-ledger.d.ts +27 -0
  294. package/dist/types/services/jobs.d.ts +113 -0
  295. package/dist/types/services/log-buffer.d.ts +7 -8
  296. package/dist/types/services/log-files.d.ts +12 -42
  297. package/dist/types/services/log-relay.d.ts +3 -13
  298. package/dist/types/services/nanny.d.ts +3 -10
  299. package/dist/types/services/notifications.d.ts +31 -61
  300. package/dist/types/services/panel.d.ts +32 -78
  301. package/dist/types/services/proxy-certificates/certificates.d.ts +31 -69
  302. package/dist/types/services/proxy-config.d.ts +15 -36
  303. package/dist/types/services/proxy-dns01.d.ts +14 -0
  304. package/dist/types/services/proxy.d.ts +73 -254
  305. package/dist/types/services/scheduler.d.ts +46 -0
  306. package/dist/types/services/state.d.ts +17 -8
  307. package/dist/types/services/supervisor/compose.d.ts +2 -6
  308. package/dist/types/services/supervisor/entry.d.ts +29 -32
  309. package/dist/types/services/supervisor/health.d.ts +8 -31
  310. package/dist/types/services/supervisor/job-run.d.ts +36 -0
  311. package/dist/types/services/supervisor/output.d.ts +13 -77
  312. package/dist/types/services/supervisor/persistent.d.ts +5 -11
  313. package/dist/types/services/supervisor/port-preflight.d.ts +4 -10
  314. package/dist/types/services/supervisor/records.d.ts +27 -60
  315. package/dist/types/services/supervisor/restart-required.d.ts +13 -0
  316. package/dist/types/services/supervisor/spawn.d.ts +3 -5
  317. package/dist/types/services/supervisor/view.d.ts +3 -1
  318. package/dist/types/services/supervisor.d.ts +31 -43
  319. package/dist/types/services/tls.d.ts +6 -17
  320. package/dist/types/services/ui-update.d.ts +19 -17
  321. package/dist/types/services/ui.d.ts +10 -19
  322. package/dist/types/shared/action-outcome.d.ts +2 -7
  323. package/dist/types/shared/api-client.d.ts +133 -177
  324. package/dist/types/shared/api-scopes.d.ts +17 -0
  325. package/dist/types/shared/backup-scope.d.ts +16 -90
  326. package/dist/types/shared/clone.d.ts +2 -11
  327. package/dist/types/shared/contracts/accounts.d.ts +99 -0
  328. package/dist/types/shared/contracts/backups.d.ts +219 -0
  329. package/dist/types/shared/contracts/ddns.d.ts +208 -0
  330. package/dist/types/shared/contracts/frames.d.ts +1395 -0
  331. package/dist/types/shared/contracts/index.d.ts +3 -0
  332. package/dist/types/shared/contracts/logs.d.ts +107 -0
  333. package/dist/types/shared/contracts/proxy.d.ts +303 -0
  334. package/dist/types/shared/contracts.d.ts +852 -1982
  335. package/dist/types/shared/cpu-scale.d.ts +3 -19
  336. package/dist/types/shared/crash-cause.d.ts +8 -0
  337. package/dist/types/shared/cron.d.ts +70 -0
  338. package/dist/types/shared/ddns-form.d.ts +9 -43
  339. package/dist/types/shared/endpoint.d.ts +1 -7
  340. package/dist/types/shared/error-codes.d.ts +438 -0
  341. package/dist/types/shared/error-message.d.ts +1 -7
  342. package/dist/types/shared/fields.d.ts +7 -17
  343. package/dist/types/shared/form-repair.d.ts +1 -5
  344. package/dist/types/shared/generated.d.ts +3 -19
  345. package/dist/types/shared/host-readings.d.ts +25 -128
  346. package/dist/types/shared/lazy.d.ts +1 -1
  347. package/dist/types/shared/live-frames.d.ts +2 -8
  348. package/dist/types/shared/live-series.d.ts +2 -8
  349. package/dist/types/shared/live-store.d.ts +4 -8
  350. package/dist/types/shared/log-download.d.ts +6 -0
  351. package/dist/types/shared/meta.d.ts +6 -0
  352. package/dist/types/shared/password-policy.d.ts +10 -0
  353. package/dist/types/shared/patch-diff.d.ts +13 -72
  354. package/dist/types/shared/port-reading.d.ts +18 -0
  355. package/dist/types/shared/probe-latency.d.ts +3 -21
  356. package/dist/types/shared/proxy-form.d.ts +33 -74
  357. package/dist/types/shared/proxy-validate.d.ts +11 -0
  358. package/dist/types/shared/query-params.d.ts +8 -0
  359. package/dist/types/shared/server-attention.d.ts +2 -27
  360. package/dist/types/shared/server-form.d.ts +15 -54
  361. package/dist/types/shared/server-key.d.ts +1 -12
  362. package/dist/types/shared/server-readings.d.ts +7 -32
  363. package/dist/types/shared/server-url.d.ts +9 -31
  364. package/dist/types/shared/shape.d.ts +1 -16
  365. package/dist/types/shared/stream-access.d.ts +2 -8
  366. package/dist/types/shared/ui-format.d.ts +25 -65
  367. package/docs/API.md +315 -107
  368. package/docs/BACKUPS.md +61 -56
  369. package/docs/CLI.md +255 -49
  370. package/docs/DDNS.md +35 -49
  371. package/docs/JOBS.md +129 -0
  372. package/docs/NOTIFICATIONS.md +58 -90
  373. package/docs/REVERSE_PROXY.md +116 -188
  374. package/docs/SECURITY.md +126 -44
  375. package/docs/SERVERS.md +282 -409
  376. package/docs/UI_CREATION.md +90 -47
  377. package/docs/demo/blank-host-restore.sh +31 -7
  378. package/package.json +15 -6
  379. package/scripts/prepare.mjs +47 -0
  380. package/uis/stock/dist/assets/CopyButton-8mliL0xi.js +1 -0
  381. package/uis/stock/dist/assets/GlobalSettingsView-BINXY77E.js +1 -0
  382. package/uis/stock/dist/assets/LogViewer-kiSnTwdY.js +1 -0
  383. package/uis/stock/dist/assets/LogsView-DDXf_ONs.js +1 -0
  384. package/uis/stock/dist/assets/Modal-lrUuViF2.js +39 -0
  385. package/uis/stock/dist/assets/ProxyView-uXMaJdSQ.js +1 -0
  386. package/uis/stock/dist/assets/ServerDetailView-CW0Vb_c0.js +4 -0
  387. package/uis/stock/dist/assets/SettingsShell-B135xWjJ.js +1 -0
  388. package/uis/stock/dist/assets/SettingsView-BLtWxVkl.js +2 -0
  389. package/uis/stock/dist/assets/de-BIoTrHBQ.js +1 -0
  390. package/uis/stock/dist/assets/es-x4-ih8lH.js +1 -0
  391. package/uis/stock/dist/assets/fr-DatqBBkO.js +1 -0
  392. package/uis/stock/dist/assets/index-CnojaKcA.css +2 -0
  393. package/uis/stock/dist/assets/index-D-CiZReu.js +16 -0
  394. package/uis/stock/dist/assets/ja-CW1703Gw.js +1 -0
  395. package/uis/stock/dist/assets/ko-wFbT4XtK.js +1 -0
  396. package/uis/stock/dist/assets/ru-C1p5C4VN.js +1 -0
  397. package/uis/stock/dist/assets/useUnsavedGuard-BcsXsfCC.js +9 -0
  398. package/uis/stock/dist/assets/vi-CDqr0uie.js +1 -0
  399. package/uis/stock/dist/assets/zh-CN-BJ7iit-X.js +1 -0
  400. package/uis/stock/dist/index.html +4 -3
  401. package/uis/stock/dist/ui.json +3 -3
  402. package/dist/chunks/archive-DP-XQR8X.js.map +0 -1
  403. package/dist/chunks/atomic-C1PfJpE7.js.map +0 -1
  404. package/dist/chunks/backup-CZcVca2a.js.map +0 -1
  405. package/dist/chunks/backups-CFRaWe_m.js +0 -4691
  406. package/dist/chunks/backups-CFRaWe_m.js.map +0 -1
  407. package/dist/chunks/config-text-DifCHhnz.js +0 -50
  408. package/dist/chunks/config-text-DifCHhnz.js.map +0 -1
  409. package/dist/chunks/contracts-CMBD1TF9.js.map +0 -1
  410. package/dist/chunks/daemon-log-BVj8cDEo.js +0 -241
  411. package/dist/chunks/daemon-log-BVj8cDEo.js.map +0 -1
  412. package/dist/chunks/daemon-qKVECISl.js +0 -247
  413. package/dist/chunks/daemon-qKVECISl.js.map +0 -1
  414. package/dist/chunks/docker-Cy9Lyvda.js.map +0 -1
  415. package/dist/chunks/down-pKbGCW9d.js.map +0 -1
  416. package/dist/chunks/init-BZ7hK9Vf.js.map +0 -1
  417. package/dist/chunks/last-stop-C-BXz_XI.js +0 -53
  418. package/dist/chunks/last-stop-C-BXz_XI.js.map +0 -1
  419. package/dist/chunks/layout-DwTtmund.js +0 -24
  420. package/dist/chunks/layout-DwTtmund.js.map +0 -1
  421. package/dist/chunks/lazy-Ce5zEAq1.js +0 -66
  422. package/dist/chunks/lazy-Ce5zEAq1.js.map +0 -1
  423. package/dist/chunks/log-buffer-Dy9HHDMD.js +0 -414
  424. package/dist/chunks/log-buffer-Dy9HHDMD.js.map +0 -1
  425. package/dist/chunks/logger-B5U4GD3j.js.map +0 -1
  426. package/dist/chunks/logs---TI_bxM.js.map +0 -1
  427. package/dist/chunks/migrate-Cfoq-Vgh.js +0 -155
  428. package/dist/chunks/migrate-Cfoq-Vgh.js.map +0 -1
  429. package/dist/chunks/nanny-B-Eu0sFW.js.map +0 -1
  430. package/dist/chunks/nanny-BtWfy0QH.js +0 -1167
  431. package/dist/chunks/nanny-BtWfy0QH.js.map +0 -1
  432. package/dist/chunks/nanny-sweep-DErnlPY1.js.map +0 -1
  433. package/dist/chunks/nearest-6KgQEDUe.js.map +0 -1
  434. package/dist/chunks/parse-DhmG26fI.js.map +0 -1
  435. package/dist/chunks/paths-CGlGDrOU.js.map +0 -1
  436. package/dist/chunks/port-B8WBTRMk.js.map +0 -1
  437. package/dist/chunks/restart-Des4DrAN.js.map +0 -1
  438. package/dist/chunks/schema-B240VXcV.js.map +0 -1
  439. package/dist/chunks/secrets-BieELnZh.js +0 -562
  440. package/dist/chunks/secrets-BieELnZh.js.map +0 -1
  441. package/dist/chunks/server-Bge2r2qQ.js +0 -169
  442. package/dist/chunks/server-Bge2r2qQ.js.map +0 -1
  443. package/dist/chunks/server-ids-DRuNLVCV.js +0 -32
  444. package/dist/chunks/server-ids-DRuNLVCV.js.map +0 -1
  445. package/dist/chunks/set-password-D5vZqqSX.js +0 -43
  446. package/dist/chunks/set-password-D5vZqqSX.js.map +0 -1
  447. package/dist/chunks/set-token-obPiEJYk.js +0 -78
  448. package/dist/chunks/set-token-obPiEJYk.js.map +0 -1
  449. package/dist/chunks/settings-xu-XTfWg.js.map +0 -1
  450. package/dist/chunks/setup-temp-CAN4_bA-.js.map +0 -1
  451. package/dist/chunks/shape-DnTKzjQ2.js +0 -24
  452. package/dist/chunks/shape-DnTKzjQ2.js.map +0 -1
  453. package/dist/chunks/src-BtWMFmzZ.js.map +0 -1
  454. package/dist/chunks/status-DT1EsA-B.js.map +0 -1
  455. package/dist/chunks/ui-D562aqw5.js.map +0 -1
  456. package/dist/chunks/ui-dir-CsU3uLNV.js.map +0 -1
  457. package/dist/chunks/ui-release-DKzVvlLd.js.map +0 -1
  458. package/dist/chunks/ui-revert-EkBBwRTt.js.map +0 -1
  459. package/dist/chunks/ui-switch-BnZTdMDd.js.map +0 -1
  460. package/dist/chunks/ui-update-_xryLYxw.js.map +0 -1
  461. package/dist/chunks/up-Pdz-l6IH.js.map +0 -1
  462. package/dist/chunks/usage-DFrCVXpT.js.map +0 -1
  463. package/dist/chunks/workspaces-DYcfvKV_.js.map +0 -1
  464. package/dist/chunks/wsl-temperature-BiCI4iK6.js.map +0 -1
  465. package/dist/types/cli/set-password.d.ts +0 -14
  466. package/dist/types/cli/set-token.d.ts +0 -21
  467. package/uis/stock/dist/assets/CopyButton-BUBKRJyY.js +0 -1
  468. package/uis/stock/dist/assets/GlobalSettingsView-yYMcRWvt.js +0 -1
  469. package/uis/stock/dist/assets/LogViewer-DIliXy62.js +0 -1
  470. package/uis/stock/dist/assets/LogsView-B7Z-7RNg.js +0 -1
  471. package/uis/stock/dist/assets/Modal-DmKa5Qpp.js +0 -39
  472. package/uis/stock/dist/assets/ProxyView-DvZiNkwb.js +0 -1
  473. package/uis/stock/dist/assets/ServerDetailView-6idGT_EX.js +0 -2
  474. package/uis/stock/dist/assets/SettingsShell-CeGtleYI.js +0 -1
  475. package/uis/stock/dist/assets/SettingsView-BrhJIrmk.js +0 -2
  476. package/uis/stock/dist/assets/de-BRITeb0H.js +0 -1
  477. package/uis/stock/dist/assets/es-B2zIEssV.js +0 -1
  478. package/uis/stock/dist/assets/fr-s0ZOBEqh.js +0 -1
  479. package/uis/stock/dist/assets/index-C1MehbKy.css +0 -2
  480. package/uis/stock/dist/assets/index-CnBN54wF.js +0 -15
  481. package/uis/stock/dist/assets/ja-CU7MR85V.js +0 -1
  482. package/uis/stock/dist/assets/ko-tL5Me6d-.js +0 -1
  483. package/uis/stock/dist/assets/ru-92yrvkNJ.js +0 -1
  484. package/uis/stock/dist/assets/vi-CzvY16k2.js +0 -1
  485. package/uis/stock/dist/assets/zh-CN-DDwFW_uW.js +0 -1
package/docs/BACKUPS.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Backups
2
2
 
3
- One `.zip` holds the panel and the workspaces you pick — settings, servers, secrets and the data
4
- each entry declares — and puts it back, on this machine or a blank one. Plain, or AES-256 with a
3
+ One `.zip` holds the panel and the workspaces you pick — settings, servers, **jobs**, secrets and the
4
+ data each entry declares — and puts it back, on this machine or a blank one. Plain, or AES-256 with a
5
5
  password. **Global settings → Backups**, or the CLI:
6
6
 
7
7
  ```bash
@@ -10,47 +10,51 @@ home-hosted backup create --all --confirm
10
10
  home-hosted backup create --all --exclude global:secrets --confirm
11
11
  home-hosted backup restore <name> --all --confirm
12
12
  home-hosted backup restore --from /media/usb/x.zip --all --confirm
13
+ home-hosted backup create --all --encrypt --confirm # asks for an archive password, without echo
13
14
  ```
14
15
 
15
- Both work with the panel **stopped**, which is when you usually need them. Without `--confirm` they
16
- plan first: at a terminal they ask, and without one (cron, CI) they print the plan and exit 1, so an
17
- unattended job never mistakes a plan for a backup. `--json` without `--confirm` is just the plan.
18
- The local channel the CLI uses plans by default too (`POST /_hh/backups` and `/_hh/backups/restore`
19
- answer a plan unless `confirm=true`); over `/api`, `POST /api/backups` creates at once, and a restore
20
- plans unless `?confirm=true`.
16
+ An encrypted archive's password comes from `HHOSTED_BACKUP_PASSWORD` (for a script), or a prompt:
17
+ `--encrypt` asks on `create`, and `restore` asks when the archive needs one. `--password <text>` still
18
+ works but warns — it lands in shell history and the process list.
19
+
20
+ The CLI works with the panel **stopped**, which is when you usually need it. Without `--confirm`,
21
+ `create` and `restore` plan first: at a terminal they ask, and without one (cron, CI) they print the
22
+ plan and exit 1, so an unattended job never mistakes a plan for a backup. `--json` without `--confirm`
23
+ prints just the plan. Over the HTTP API, `POST /api/backups` creates at once, and a restore plans
24
+ unless `?confirm=true`.
25
+
26
+ `backup list` shows each archive's time in this machine's zone (`2026-11-17 10:11 +07:00`); the file
27
+ **name** stays UTC, so the two differ by the host's offset.
21
28
 
22
29
  ## What an archive holds
23
30
 
24
- Selection is two-level: whole workspaces, or single pieces of one.
31
+ Pick whole workspaces, or single pieces of one:
25
32
 
26
33
  | id | what |
27
34
  | --- | --- |
28
- | `global:settings`, `global:secrets`, `global:tls` | panel-wide settings, the password/token hashes, the TLS pair |
29
- | `workspace:<id>:settings` · `:servers` · `:secrets` | a workspace's settings, its `servers.config.json`, its notification/DDNS credentials |
30
- | `workspace:<id>:secrets:<name>` | one secret, restored on its own |
35
+ | `global:settings`, `global:secrets`, `global:tls` | panel-wide settings; account and API-token hashes, plus server and job secret environment values; the TLS pair |
36
+ | `workspace:<id>:settings` · `:servers` · `:jobs` · `:secrets` | a workspace's settings, its `servers.config.json`, its `jobs.config.json`, its secrets (notification and DDNS credentials, secret environment) |
37
+ | `workspace:<id>:secrets:<name>` | one secret on its own; `:serverEnv` is every server's [secret environment](./SERVERS.md#secret-environment) |
31
38
  | `workspace:<id>:data:<path>` | one declared data directory |
32
39
 
33
- A data directory is anything an entry declares in `dataEnvs` or `backupPaths`. Generated
34
- directories inside them (`node_modules`, `dist`, `.next`, caches) are skipped unless the entry sets
35
- `backupIgnoreGenerated: false`. A symlink that leads **outside** a declared path is not followed —
36
- declare its target instead — and file permission bits travel (`0600` stays `0600`). A declared path
37
- that is *itself* a symlink (`data -> /mnt/disk/data`) is the data: its target is captured, and a
38
- restore writes back into that target. A declared path that ends up holding no files (a mount that
39
- was not up) is still archived, with a warning in the create result and on the CLI's stderr. Each
40
- declared path gets its own place in the archive, however alike two names read (`/srv/app-data`,
41
- `/srv/app/data`); archives written before that still restore.
40
+ A workspace with no `jobs.config.json` has no jobs entry, and a restore never writes an empty one.
42
41
 
43
- ## Automatic backups
42
+ A data directory is anything an entry declares in `dataEnvs` or `backupPaths`:
44
43
 
45
- A schedule writes one archive every N hours, named `auto-…`, with its own retention. `Keep` bounds
46
- the archives you take by hand; a scheduled pass never prunes those. Only archives the panel wrote
47
- are ever pruned — another tool's zips in the same directory are left alone. A scheduled pass is
48
- skipped while a restore is running. Age is read from the archive's name, not its file date, so
49
- copying archives between disks does not change which are newest or which get pruned. The panel
50
- remembers when the last scheduled archive was written; an `auto-…` file dropped into the directory
51
- by hand is noticed after the next restart.
44
+ - Generated directories inside it (`node_modules`, `dist`, `.next`, caches) are skipped unless the entry
45
+ sets `backupIgnoreGenerated: false`.
46
+ - A symlink leading **outside** a declared path is not followed — declare its target instead. A
47
+ declared path that is *itself* a symlink (`data -> /mnt/disk/data`) captures, and restores into, its
48
+ target.
49
+ - Permission bits travel (`0600` stays `0600`).
50
+ - A declared path holding no files (a mount that was not up) is still archived, with a warning.
52
51
 
53
- What a schedule captures:
52
+ ## Automatic backups
53
+
54
+ A schedule writes one archive every N hours, named `auto-…`, with its own retention; `Keep` bounds the
55
+ archives you take by hand, which a scheduled pass never prunes. Only archives the panel wrote are ever
56
+ pruned, and age is read from the name, not the file date. A scheduled pass is skipped while a restore
57
+ runs.
54
58
 
55
59
  | Mode | Carries | CLI spelling |
56
60
  | --- | --- | --- |
@@ -63,17 +67,20 @@ What a schedule captures:
63
67
  Start a **blank** home-hosted anywhere, upload the archive, restore. Workspaces the target has never
64
68
  seen are created, data lands where *this* machine's config says, and `autostart` entries come up.
65
69
 
66
- - **Paths match by declaration**, not by the source machine's absolute path: `{projectDir}`,
67
- `{dataRoot}` and `{home}` follow the restoring panel; a literal absolute path stays that path.
70
+ - **Paths match by declaration**: `{projectDir}`, `{dataRoot}` and `{home}` follow the restoring panel;
71
+ a literal absolute path stays that path.
68
72
  - **A restore never writes where no config declares**, and never across workspaces.
69
- - **Older archives are lifted** through the same migrations `home-hosted migrate` runs; an archive
73
+ - **Older archives are upgraded** through the same migrations `home-hosted migrate` runs; an archive
70
74
  from a *newer* release is refused.
71
- - **One secret merges by field** — restoring the Telegram token leaves DDNS credentials alone, and
72
- excluding one secret keeps the local copy of it.
73
- - **The password and token hashes are secrets too.** Restoring them reinstates the old machine's
74
- credentials. Leave `global:secrets` unticked, or rotate afterwards (`set-token --generate`).
75
- - **The plaintext first-run password is never archived** — only its hash, which is all a restore
76
- needs.
75
+ - **A replaced `jobs.config.json` is kept as `.bak`** beside the new one. Servers and settings are
76
+ replaced in place.
77
+ - **Secrets merge by field** — restoring the Telegram token leaves DDNS credentials alone, and an
78
+ excluded secret keeps its local copy.
79
+ - **Account and API-token hashes are secrets too**: restoring them reinstates the old machine's
80
+ credentials. Leave `global:secrets` unticked, or rotate afterwards (`home-hosted account secret <id>`).
81
+ - **The plaintext first-run secret is never archived**, only its hash. It still signs in, but `up`
82
+ and `status` say "the first-run secret is in use but no longer recorded" until you run
83
+ `home-hosted account reset`.
77
84
  - **DDNS credentials are sealed under `HHOSTED_DDNS_SECRET`**, which is not in the archive. Use the
78
85
  same value on the new host, or re-enter them.
79
86
 
@@ -82,22 +89,22 @@ seen are created, data lands where *this* machine's config says, and `autostart`
82
89
  | | Restored | Still yours to do |
83
90
  | --- | --- | --- |
84
91
  | Panel settings, workspaces, servers, defaults | ✅ | restart the panel if the listener or TLS changed (the plan says so) |
85
- | Declared data directories | ✅ | see the database note below |
92
+ | Jobs — schedules, commands, `secretEnv` names | ✅ | secret **values** come back with the workspace's secrets; schedules fire from the next matching time |
93
+ | Declared data directories | ✅ | see [Databases](#databases) |
86
94
  | Notification and DDNS config | ✅ | DDNS credentials need the same `HHOSTED_DDNS_SECRET` |
87
- | Password and API token | per secret | leave unticked, or rotate |
95
+ | Accounts and API tokens | per secret | leave unticked, or rotate |
88
96
  | Reverse-proxy routes | ✅ | certificates are reissued; re-upload a `manual` pair |
89
97
  | Reverse-proxy engine | ❌ | reinstall it from Global settings → Reverse proxy |
90
98
  | Logs, crash history, nanny state | ❌ | they describe the old box |
91
- | An entry's `envFile` | ❌ | machine-local by design — copy it, or declare its directory in `backupPaths` |
99
+ | An entry's `envFile` | ❌ | copy it, declare its directory in `backupPaths`, or move it to `secretEnv` |
92
100
  | The panel's own environment (`HHOSTED_*`, `${ENV}` values) | ❌ | set them on the new host |
93
101
 
94
102
  ## Worked example
95
103
 
96
- [`demo/blank-host-restore.sh`](./demo/blank-host-restore.sh) runs the whole move against real
97
- panels in throwaway directories (it needs Docker): host A gets one MongoDB-backed entry with data,
98
- an archive is taken with `backup create --all --exclude global:secrets --confirm`, host B starts
99
- blank, and `backup restore --from <archive> --all --confirm` brings the workspace, the entry and its
100
- data back — the script then reads the database on host B to prove it.
104
+ [`demo/blank-host-restore.sh`](./demo/blank-host-restore.sh) runs the whole move against real panels in
105
+ throwaway directories (it needs Docker): a MongoDB-backed entry on host A is archived with
106
+ `backup create --all --exclude global:secrets --confirm`, restored onto a blank host B with
107
+ `backup restore --from <archive> --all --confirm`, and the data is read back.
101
108
 
102
109
  ```bash
103
110
  docs/demo/blank-host-restore.sh # cleans up after itself; touches nothing of yours
@@ -105,13 +112,11 @@ docs/demo/blank-host-restore.sh # cleans up after itself; touches nothing of y
105
112
 
106
113
  ## Databases
107
114
 
108
- Data directories are copied file by file while servers keep running. That is fine for files and
109
- most app data, but **not a consistent snapshot of a live database** — SQLite mid-transaction or a
110
- Postgres data directory can be captured torn and fail to open later.
111
-
112
- For a real database, either stop that entry around the backup, or declare `dump`/`load` hooks so
113
- the engine itself writes the backup ([SERVERS.md](./SERVERS.md#dumping-a-database-for-backups)).
115
+ Data directories are copied file by file while servers keep running. That is fine for most app data,
116
+ but **not a consistent snapshot of a live database** — SQLite mid-transaction or a Postgres data
117
+ directory can be captured torn. Stop that entry around the backup, or declare `dump`/`load` hooks so
118
+ the engine writes the backup itself ([SERVERS.md](./SERVERS.md#dumping-a-database-for-backups)).
114
119
 
115
- Restoring has the mirror-image hazard: data copied under a **running** server is replaced beneath a
116
- live process. The plan names those entries (`Data was replaced under a running server`); stop them
117
- before applying, or restart them after.
120
+ A restore has the mirror-image hazard: data replaced under a **running** server. The plan names those
121
+ entries (`Data was replaced under a running server` in the panel, `! worker is running — …; restart
122
+ it` from the CLI); stop them before applying, or restart them after.
package/docs/CLI.md CHANGED
@@ -1,43 +1,158 @@
1
1
  # The CLI
2
2
 
3
- `home-hosted <command>`, or `hh <command>` once installed. `home-hosted <command> --help` (or
4
- `home-hosted help <command>`) prints what a command takes, and a misspelled command or flag suggests
5
- the one you meant. Every command and flag on one screen: the README's
6
- [CLI section](../README.md#-cli). This page is the depth behind it.
3
+ `home-hosted <command>`, or `hh <command>` once installed. `home-hosted --help` lists every command and
4
+ flag; `home-hosted <command> --help` (or `home-hosted help <command>`) prints one command's. A
5
+ misspelled command or flag suggests the one you meant. This page is what each command does; the rules
6
+ a script can rely on are at the end, under [For scripts](#for-scripts).
7
7
 
8
- ## Rules every command follows
8
+ ## The panel and one server
9
9
 
10
- - A numeric flag must be a whole number (`--port 8000x` is refused, not read as 8000; `--lines` takes
11
- 1 or more, or `all`), and a flag a command cannot honour is refused rather than ignored.
12
- - Server commands act in the panel's default workspace; `-w/--workspace <id>` picks another.
13
- - Hints name the command as you ran it, `--home` included, so they can be pasted.
14
- - Commands that only look — `status`, `logs`, `usage`, `backup list`, a backup plan — never create
15
- state files. Whatever creates `.hh` first creates it `0700`.
16
- - `up --port`/`--host` are saved to `settings.json`, so the next plain `up` binds the same way.
17
- `restart` checks every `up` flag before it stops anything, and stops if `down` fails.
10
+ - **`up`** starts the panel detached. `--port`/`--host` are saved to `settings.json`, so the next plain
11
+ `up` binds the same way. With a panel already running it says where and exits 0 — unless
12
+ `--port`/`--host` ask for something else, which is refused (exit 1) and points at `restart`.
13
+ `--print-config` prints the effective config and starts nothing; `--foreground` stays in this
14
+ process (systemd, docker).
15
+ - **`down`** stops the panel and every server it started. Persistent entries keep running unless
16
+ `--with-persistent`.
17
+ - **`restart`** with no id is `down` then `up`, taking `up`'s flags; it checks them before stopping
18
+ anything. To move the port or bind without stopping servers, use **Global settings → Listener**.
19
+ **`restart <id>`** restarts one server and leaves the panel up; panel flags are refused there.
20
+ - **`start <id>`** starts one server, bringing up what it `dependsOn` first, and waits for it to be
21
+ ready. `--free-port` frees its port before starting. An entry already running says `already running`
22
+ and exits 0; an unknown id suggests the nearest one (`ls` lists them).
23
+ - **`stop <id>`** stops only that server (`already stopped` if it was). With the panel down it still stops a **persistent** entry
24
+ through its own supervisor.
25
+ - **`free-port <id>`** asks whatever holds that server's port to stop, from a fresh lookup. A process
26
+ the panel supervises is refused.
18
27
 
19
- ## Scripting
28
+ ## Accounts and tokens
20
29
 
21
- - `--json` prints **one JSON document on stdout, or nothing**; every refusal goes to stderr. Branch
22
- on the exit code first, then the document. The one exception is a stream, which has no single
23
- document: `logs --follow --json` prints **one object per line** (NDJSON), each `{ path, line }`, so
24
- a consumer needs no out-of-band knowledge of which file it is reading.
25
- - Piping into `head` or `grep -q` exits 0, not with a broken-pipe error, so `set -o pipefail` is safe.
26
- - `start` and `restart <id>` wait to confirm the process stayed up, so `start web && curl …` works.
27
- - `backup create`/`restore` never write without consent: at a terminal they ask, and without one they
28
- print the plan and **exit 1** unless `--confirm` is given — a cron job without it fails loudly
29
- instead of silently taking no backup. `--json` without `--confirm` is the plan request and exits 0.
30
+ ```bash
31
+ home-hosted account create admin # a new account; the secret is printed once
32
+ home-hosted account create monitor --scope read # a monitor that cannot start or change anything
33
+ home-hosted account ls # ids, labels, scopes — never a secret
34
+ home-hosted account edit monitor --disable # refuse it without deleting it (--enable undoes it)
35
+ home-hosted account secret admin # prompts, or HHOSTED_SECRET=… for a script
36
+ home-hosted account revoke monitor # immediately; its sessions end too
37
+ home-hosted account reset admin # the recovery path when you are locked out
38
+ home-hosted account disable-auth # the guard off; the accounts are kept
39
+ home-hosted account enable-auth # and back on
40
+ ```
41
+
42
+ An **account** is one credential: its id and secret both sign in to the panel and authenticate the API
43
+ as `Authorization: Bearer <id>:<secret>`. Only a hash is stored, so the secret is shown once
44
+ (`HHOSTED_SECRET` sets your own on `create`). `--label` names it for people; `--json` prints the id and
45
+ secret as one document.
46
+
47
+ `--scope` takes a comma-separated subset of `read`, `lifecycle`, `config`, `proxy`, `admin` (default:
48
+ all five), and `-w/--workspace` limits the account to some workspaces — what each scope allows:
49
+ [SECURITY.md](./SECURITY.md#an-account-is-scoped-and-the-scopes-mean-something).
50
+
51
+ `revoke` refuses the last account that can sign in. `reset` is what to run when you cannot sign in at
52
+ all: on the machine that runs the panel, it writes a fresh generated secret and prints it
53
+ (`HHOSTED_SECRET` sets your own, held to the same length rule as `account secret`). With no id it picks
54
+ an `admin` account, never a read-only one, and an account it resets is enabled again. Each subcommand
55
+ takes only its own flags; `--json` on `create`, `ls`, `edit`, `revoke` and `reset` prints one document.
56
+
57
+ A **token** is the API half only: it never signs in to the UI, and it can be minted with no panel
58
+ running. Reach for `account` when a *person* signs in, `token` when a *script* calls the API.
59
+
60
+ ```bash
61
+ home-hosted token create --name "Deploy Hook" --scope lifecycle # prints the value once; id: deploy-hook
62
+ home-hosted token ls # ids, names, scopes, last use
63
+ home-hosted token revoke deploy-hook
64
+ ```
65
+
66
+ `--name` and `--scope` are required; a name with a space needs quotes (an unquoted second word is
67
+ refused). **The id is a slug of the name**, and `revoke` takes the id — `ls` shows both. Either credential is managed only from a signed-in session or this CLI, never with a bearer
68
+ credential, so a leaked one cannot mint another; revoke one that may have leaked.
69
+
70
+ ## Declaring servers
71
+
72
+ ```bash
73
+ home-hosted add web --port 4000 -- node server.js # everything after -- is the command
74
+ home-hosted add api --cwd ./api --autostart -- pnpm start # --cwd relative to --project
75
+ home-hosted add db -w media --persistent -- ./start-db.sh
76
+ home-hosted add app --secret-env DATABASE_URL,API_KEY -- node app.js # declares the names only
77
+ home-hosted ls # ID STATUS PORT COMMAND
78
+ home-hosted ls -w media --json
79
+ ```
80
+
81
+ With the panel up, `add` and `ls` go through it, with the same validation as **➕ Add server**. With it
82
+ down they read and write the workspace's `servers.config.json` directly; `ls` then shows no status. An
83
+ added entry is **not started**, `autostart` or not — run `start <id>`. An id the workspace already has
84
+ is refused, and `add` never creates a workspace. An id is lowercase letters, digits, `-` and `_`,
85
+ starting with a letter or digit. The command is a program, not a shell line: `-- node server.js`, not
86
+ `-- "node server.js"` (`add` warns about a space in it). `--secret-env NAME` (repeatable, or
87
+ comma-separated) declares a secret's name, so `secret set` works straight after.
88
+
89
+ ## Secret environment
90
+
91
+ Only a secret's **name** goes in an entry, in `secretEnv`; the value lives in the workspace's secrets
92
+ file. Declare the name first (`add … --secret-env NAME`, the panel's form, or the config), then:
93
+
94
+ ```bash
95
+ home-hosted secret set app DATABASE_URL # prompts without echo
96
+ printf '%s\n' "$DATABASE_URL" | home-hosted secret set app DATABASE_URL --stdin
97
+ home-hosted secret ls app # the names, and which have a value
98
+ home-hosted secret unset app DATABASE_URL
99
+ ```
100
+
101
+ - The id can be a server or a **job** ([JOBS.md](./JOBS.md#a-jobs-secret-environment)). It resolves to
102
+ a server first; a server and a job sharing an id keep separate values, and `ls --json` names which
103
+ one answered.
104
+ - `set` refuses an undeclared name **before** it asks for a value, and refuses a blank value (use
105
+ `unset`).
106
+ - **No command prints a value** — not `ls`, not `--json`, not an error.
107
+ - With the panel down the file is written directly, and the next start reads it.
108
+
109
+ ## Deploying
110
+
111
+ `deploy` runs an entry's `deploy` steps ([SERVERS.md](./SERVERS.md#deploying)), **waits**, and exits 1
112
+ if a step fails.
113
+
114
+ ```bash
115
+ home-hosted deploy web # every step, then a restart
116
+ home-hosted deploy web --json # { server, ok, failedStep?, error?, durationMs }
117
+ ```
118
+
119
+ With the panel down it runs the same steps and says nothing was restarted.
120
+
121
+ ## Jobs
122
+
123
+ What a job is and how its schedule behaves: [JOBS.md](./JOBS.md).
124
+
125
+ ```bash
126
+ home-hosted job ls # id, expression, NEXT run, LAST outcome and duration, state
127
+ home-hosted job ls --json # { jobs: [...] } — the same rows as GET /api/jobs
128
+ home-hosted job run nightly-backup # waits; exits 0 only when the run's outcome is ok
129
+ home-hosted job run nightly-backup --json # { job, ok, runId, outcome, exitCode, signal, startedAt, endedAt, … }
130
+ home-hosted job run nightly-backup --detach # starts it and prints the run id
131
+ home-hosted job stop nightly-backup # ends the run in flight
132
+ home-hosted job enable|disable nightly-backup # switches its schedule on or off
133
+ home-hosted job runs nightly-backup # the last runs, newest first
134
+ home-hosted job log nightly-backup # what its runs wrote, newest last
135
+ home-hosted job log nightly-backup --run <id> # one run's lines; --follow keeps printing new ones
136
+ ```
137
+
138
+ `job run` prints the outcome rather than streaming output (that goes to the job's log). It is refused
139
+ while a run is already in flight (`JOB_RUNNING`), and every `job` command needs a running panel. `NEXT`
140
+ reads `never` for an expression that cannot come due, and `—` for a disabled or broken job. `log
141
+ --follow --json` prints one `{ job, line }` object per line. `ls` lists services only.
30
142
 
31
143
  ## What `status` tells you
32
144
 
33
145
  ```text
34
146
  home-hosted <version>
35
147
  status running
36
- servers 3 of 3 up
148
+ servers 2 of 3 up
149
+ worker crashed ← needs attention
150
+ web running
151
+ api running
37
152
  pid 4242 · up 2h 14m
38
153
  url http://127.0.0.1:3999 (http)
39
- … project, state, log and per-server log paths
40
- password k7mq-x2pd-9fh (only while the first-run password is in use)
154
+ … project, state (--home), panel log and per-server log paths, ui
155
+ login default / k7mq-x2pd-9fh (only while the first-run secret is in use)
41
156
  ```
42
157
 
43
158
  `status --json` always carries `running` and `liveness`:
@@ -49,47 +164,138 @@ home-hosted <version>
49
164
  | `gone` | nothing is running |
50
165
  | `recycled` | the OS gave the recorded pid to another process; nothing is signalled |
51
166
 
52
- - `running: true` with `"answering": false` means the process exists but does not respond — anything
53
- that waits for the panel to *serve* should read `answering`.
54
- - `exitedCleanly: true` (with `lastStopAt`) means someone ran `down`; `false` means it died.
55
- - If `run.json` is missing but **this home's** panel answers on the configured port (its `/healthz`
56
- says which home it serves), `status` reports `answeringWithoutRecord` and `down` refuses rather
57
- than guess which process to stop. Anything else on that port — another home's panel, another
58
- program — is `portTakenByOther`: `down` has nothing of this home to stop and exits 0, and `up` will
59
- need another `--port`.
167
+ - `running: true` with `"answering": false` means the process exists but does not respond.
168
+ - With the panel not running, `exitedCleanly: true` (with `lastStopAt`) means someone ran `down`;
169
+ `false` means it died. A running panel sends no `exitedCleanly`.
170
+ - `answeringWithoutRecord`: `run.json` is missing but this home's panel answers on the configured port;
171
+ `down` refuses rather than guess what to stop. `portTakenByOther`: something else holds the port;
172
+ `down` has nothing to stop, and `up` needs another `--port`.
173
+ - With the panel stopped, persistent entries still running are listed (`persistentRunning`).
174
+
175
+ ## Coming from pm2 or compose
176
+
177
+ `import` **prints a plan and writes nothing** until you pass `--confirm` (`--dry-run` never writes).
178
+
179
+ ```bash
180
+ home-hosted import pm2 ecosystem.config.json # the plan
181
+ home-hosted import pm2 ecosystem.config.json --confirm # and write it
182
+ home-hosted import compose docker-compose.yml --id stack --confirm
183
+ ```
184
+
185
+ **pm2** — each `apps[]` element becomes one entry; `--env <name>` lays each app's `env_<name>` block
186
+ over its `env`, as pm2 does (a name no app declares is refused):
187
+
188
+ | pm2 | becomes |
189
+ | --- | --- |
190
+ | `name` | `id` (slugified; two names that land on one id are refused) |
191
+ | `script`, `interpreter` | `command` (the interpreter, default `node`) and `args[0]` (the script) |
192
+ | `args` | the rest of `args`, split on whitespace — a quoted argument is reported, not guessed |
193
+ | `cwd`, `env` | `cwd`, `env` |
194
+ | `env` whose name reads as a secret (`API_KEY`, `*_TOKEN`, …) | `secretEnv`; the value goes to the workspace's secrets file |
195
+ | `autorestart`, `max_restarts` | `restart.enabled`, `restart.maxRetries` |
196
+ | `max_memory_restart` | `resources.maxRssBytes` (`200M`, `1G`, or bytes) |
197
+ | `watch`, `cron_restart`, cluster `instances` | **not carried** — each is reported by name |
198
+
199
+ A `.js`/`.mjs`/`.cjs` ecosystem is code, so reading it means running it: pass `--allow-js` or export
200
+ JSON.
201
+
202
+ **compose** — one entry per stack, running `docker compose -f <file> up`; `--id` names it (default:
203
+ the file's directory name). A flag that belongs to the other kind (`--env`/`--allow-js` on compose,
204
+ `--id` on pm2) is refused.
205
+
206
+ Nothing is started: `home-hosted start <id>` when you are ready.
60
207
 
61
208
  ## Logs and usage
62
209
 
63
210
  ```bash
64
- home-hosted logs # the panel's console: what it did, and anything it could not finish
211
+ home-hosted logs # the panel's console
65
212
  home-hosted logs --follow # like tail -f
66
- home-hosted logs web # one server's log
213
+ home-hosted logs web --lines all # one server's whole log (default: the last 50 lines)
67
214
  home-hosted logs api -w staging # a server in another workspace
68
- home-hosted usage # what is eating the machine
215
+ home-hosted usage # CPU and memory per server, loudest first
69
216
  ```
70
217
 
71
218
  `logs` reads files directly, so it works when the panel is wedged. An id the workspace does not
72
- declare is refused with a suggestion rather than answered with an empty log. In `usage`, a stopped
73
- server shows a dash, never `0`. `STARTS` and `CRASH` cover the history window: `STARTS` counts start
74
- events, so a long-lived server shows the start it got (usually `1`) rather than `0`, and a flapping
75
- one climbs — which is what makes it visible while its live CPU and memory still look idle. It is
76
- **not** the retry budget the panel shows on a server's card: that is `server.restarts`, the crashes
77
- spent out of `restart.maxRetries` on the current sequence, which a deliberate start resets. `--json`
78
- names the count `starts` for the same reason (a panel predating the rename sends `restarts`, and this
79
- command reads either).
219
+ declare is refused with a suggestion. In `usage`, a stopped server shows a dash, never `0`, and
220
+ `STARTS` counts start events over the history window — a flapping server climbs even while its CPU
221
+ looks idle.
222
+
223
+ ## Backups, UIs and temperature
224
+
225
+ - **`backup`** — `list`, `create`, `restore`, all with the panel stopped too:
226
+ [BACKUPS.md](./BACKUPS.md).
227
+ - **`ui-switch`** installs a UI from a release asset (`--repo`, `--tag`, `--asset`, `--list`) or a zip
228
+ (`--file <path|url>`; a plain `http://` URL needs `--insecure`). **`ui-update`** follows the
229
+ installed UI's releases (`--check` only reports); **`ui-revert`** goes back to the stock UI. Both
230
+ read `--token`, `GITHUB_TOKEN` or `GH_TOKEN` for GitHub. Building one:
231
+ [UI_CREATION.md](./UI_CREATION.md).
232
+ - **`setup-temp`** sets up CPU temperature where the OS exposes none (`--wsl` on WSL2, `--clear` to
233
+ stop): [SERVERS.md](./SERVERS.md#cpu-temperature-where-the-os-exposes-none).
234
+ - **`init`** scaffolds a project that keeps its state in the repo (`--dir`, `--name`, `--pm`,
235
+ `--no-install`, `-y`).
236
+
237
+ ## Starting at boot
238
+
239
+ ```bash
240
+ home-hosted service install # this account: systemd --user, a LaunchAgent, a logon task
241
+ home-hosted service install --startup # Windows only: a Startup-folder .cmd — needs no administrator
242
+ home-hosted service install --system # the machine, at boot (sudo / an administrator)
243
+ home-hosted service install --print # the unit on stdout, nothing written or run
244
+ home-hosted service status # whether it is installed, and what the manager says
245
+ home-hosted service uninstall # stop it, unregister it, remove the file
246
+ ```
247
+
248
+ The unit runs `up --foreground` with absolute paths, this home and project, and the installing shell's
249
+ `PATH`. It is named `home-hosted` for the default home and `home-hosted-<8 hex>` for any other.
250
+
251
+ - **Only the panel is signalled on stop**, so persistent entries keep running, as on `down`.
252
+ - **It restarts only after a failure.** After `down` the panel stays down until the next boot or
253
+ `systemctl start`.
254
+ - **A Linux user service** waits for a login after a reboot; `loginctl enable-linger <you>` removes
255
+ the wait.
256
+ - **On Windows, registering any scheduled task needs an administrator.** Without one, use `--startup`:
257
+ it starts at logon and has **no restart policy**.
258
+ - An install over an existing unit is refused. `status` and `uninstall` act only on a file this
259
+ command wrote; anything else is reported and left alone.
260
+ - **Inside a container, `install` refuses** — a boot entry there is never seen by the host. Use the
261
+ container's restart policy (`--restart unless-stopped`) instead.
80
262
 
81
263
  ## Upgrading
82
264
 
83
265
  ```bash
84
266
  home-hosted migrate --dry-run # what would change, writes nothing
85
- home-hosted migrate # asks before each schema step, keeps a .bak beside each file
267
+ home-hosted migrate # asks once before any schema step, keeps a .bak beside each file
86
268
  ```
87
269
 
88
- Each config records the release and schema that wrote it. A newer release always reads an older
270
+ `-y/--yes` (or `HHOSTED_MIGRATE=allow`) applies without asking. A newer release always reads an older
89
271
  config, and keys it does not know are kept and reported, never reset. A config it cannot read — a
90
272
  wrong value, a duplicate id, a newer schema — stops `up` with the exact problem instead of starting
91
- with defaults. Per-release notes live in the
92
- [release notes](https://github.com/NamesMT/home-hosted/releases).
273
+ with defaults. A hand-written `servers.config.json` with no `meta` loads as it is. Per-release notes:
274
+ the [release notes](https://github.com/NamesMT/home-hosted/releases).
93
275
 
94
276
  **Coming from 0.6.x:** install the latest 0.7.x and run it once — it moves the state into `.hh/` —
95
277
  then upgrade.
278
+
279
+ ## For scripts
280
+
281
+ - A numeric flag must be a whole number (`--port 8000x` is refused, not read as 8000), and a flag a
282
+ command cannot honour is refused rather than ignored.
283
+ - Server commands act in the panel's default workspace; `-w/--workspace <id>` picks another.
284
+ - `--home <dir>` and `--project <dir>` (or `HHOSTED_HOME`/`HHOSTED_PROJECT`) work on every command;
285
+ hints name the command as you ran it, `--home` included, so they can be pasted.
286
+ - Commands that only look — `status`, `logs`, `usage`, `backup list`, a backup plan — never create
287
+ state files.
288
+
289
+ - `--json` prints **one JSON document on stdout, or nothing**; every refusal goes to stderr. Branch
290
+ on the exit code first, then the document. The one exception is a stream: `logs --follow --json`
291
+ prints one `{ path, line }` object per line.
292
+ - Piping into `head` or `grep -q` exits 0, not with a broken-pipe error, so `set -o pipefail` is safe.
293
+ - `start` and `restart <id>` wait until a server with a `port` is **running** (its readiness probe
294
+ passed, bounded by its `health.startTimeoutMs`), so `start web && curl …` works; one without a port
295
+ is watched for a second. A crash on boot, or a probe that never passes, exits 1.
296
+ - Anything that writes on your behalf without a terminal to ask at — `backup create`/`restore`,
297
+ `import` — prints the plan and **exits 1** unless given `--confirm`, so a cron job without it fails
298
+ loudly. `backup … --json` without `--confirm` is a plan request and exits 0.
299
+ - `import` exits **0** when it wrote the plan (`--confirm`) or showed it at a terminal, and **1** when
300
+ any entry is refused or fails to write, or when it ran without a terminal and without `--confirm`.
301
+ With `--json` a plan request exits 0; a refused or failed entry still exits 1.