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
@@ -1,79 +1,62 @@
1
1
  import type { SecretsStore } from '../config/secrets.js';
2
2
  import type { DestinationStatusView, NotificationDefaults, NotificationsConfig, NotificationTarget, WebhookTarget } from '../shared/contracts.js';
3
- export type NotificationReason = 'crash' | 'unhealthy' | 'forced-restart' | 'recovered' | 'restart-ok' | 'rss' | 'host' | 'host-recovered' | 'ddns' | 'ddns-error';
3
+ export type NotificationReason = 'crash' | 'unhealthy' | 'forced-restart' | 'recovered' | 'restart-ok' | 'rss' | 'host' | 'host-recovered' | 'ddns' | 'ddns-error' | 'deploy' | 'job-failed';
4
4
  export interface NotificationEvent {
5
5
  serverId: string;
6
6
  label: string;
7
7
  reason: NotificationReason;
8
8
  detail: string;
9
+ /** The workspace the server or job belongs to: a server id is unique only inside it. */
10
+ workspaceId?: string;
9
11
  }
10
- /** The event toggles and the throttle: what a destination may inherit, and what it may override. */
11
12
  type NotificationPolicy = NotificationDefaults;
12
13
  /**
13
- * Fans supervision events out to the configured destinations.
14
+ * Fans supervision events out to the configured destinations (Telegram chats and webhooks).
14
15
  *
15
- * **One list, two kinds.** A destination is a Telegram chat or a webhook; both carry an `enabled`
16
- * switch, an optional policy of their own, and one row on the page. A workspace may point at
17
- * several Telegram chats, which is why the bot token is a per-destination secret rather than the
18
- * singleton it used to be.
19
- *
20
- * **Inheritance is the default.** A destination with `useOwnSettings: false` follows
21
- * `notifications.defaults`, so the common case is configured once instead of per destination. A
22
- * destination that sets its own opts out entirely — no field is merged, because a half-inherited
23
- * policy is one nobody can reason about.
24
- *
25
- * The throttle is per destination *and* server *and* reason: a flapping server must not flood one
26
- * destination, and one destination going quiet must not silence another.
16
+ * The throttle is per destination, server and reason. A paired state change the throttle swallowed
17
+ * is sent when its window ends, if the receiver would otherwise be left reading the opposite state.
27
18
  */
28
19
  export declare class NotificationService {
29
20
  private readonly secrets;
30
21
  private readonly getConfig;
22
+ /** Whether the text names the workspace: only when the panel has more than one. */
23
+ private readonly showWorkspace;
31
24
  private readonly cooldowns;
32
25
  private readonly results;
33
- constructor(secrets: SecretsStore, getConfig: () => NotificationsConfig);
34
- /** The general block, as the page edits it. */
26
+ /** The paired reason each destination last received, per server: the state it believes. */
27
+ private readonly delivered;
28
+ /** The newest paired event a cooldown swallowed, waiting for that window to end. */
29
+ private readonly trailing;
30
+ constructor(secrets: SecretsStore, getConfig: () => NotificationsConfig,
31
+ /** Whether the text names the workspace: only when the panel has more than one. */
32
+ showWorkspace?: () => boolean);
33
+ /** Cancels the held trailing sends, so a removed workspace sends nothing later. */
34
+ dispose(): void;
35
35
  defaults(): NotificationDefaults;
36
- /**
37
- * Every destination as a row: its own fields, the policy it will actually use, and its last result.
38
- *
39
- * The page shows this rather than the raw config, so an inheriting destination displays the
40
- * inherited toggles — the values a send will use, not the stale ones on disk.
41
- */
36
+ /** Every destination with the policy it will actually use (inherited toggles, not the stale ones on disk). */
42
37
  destinations(): DestinationStatusView[];
43
- /** The policy a destination actually uses: its own, or the general block's. */
44
38
  effectivePolicy(target: NotificationTarget): NotificationPolicy;
45
- /**
46
- * The destinations that would deliver this event right now.
47
- *
48
- * Per destination rather than one boolean for the service: a single answer would either send a
49
- * host warning somewhere switched off for it, or silence a crash because another destination's
50
- * cooldown was still running.
51
- */
39
+ /** The destinations that would deliver this event right now. */
52
40
  targetsFor(event: NotificationEvent, now?: number): NotificationTarget[];
53
- /** Whether *any* destination would deliver this event. */
41
+ private wanting;
42
+ private throttled;
54
43
  shouldNotify(event: NotificationEvent, now?: number): boolean;
55
- /** Starts the cooldown window for every destination about to be asked to send. */
56
44
  markSent(event: NotificationEvent, now?: number): void;
57
- /** One destination's window, returning the deadline it set so a failed send can undo it. */
45
+ /** Returns the deadline it set, so a failed send can undo it. */
58
46
  private armCooldown;
59
47
  /**
60
- * Gives back the window a **failed** send took.
61
- *
62
- * The window exists to collapse a flapping server into one message, so it is armed before the
63
- * send rather than after: two events already in flight must not both go out. But a send that
64
- * never arrived has told nobody anything — measured on the built panel, a crash alert sent while
65
- * the receiver was down recorded `fetch failed`, and the next two crashes inside the 5-minute
66
- * window were silenced by it, so the one alert that would have reached a working receiver was
67
- * the one the outage took. Undo only the deadline this send set: a concurrent dispatch may have
68
- * armed a later one, and clearing that would reopen the flood the window is for.
48
+ * Gives back the window a **failed** send took (armed before sending, so two in-flight events cannot
49
+ * both go out). Only this send's deadline: a concurrent dispatch may have armed a later one.
69
50
  */
70
51
  private releaseCooldown;
71
52
  /** Fire-and-forget by design: supervision must never wait on a chat or webhook API. */
72
53
  notify(event: NotificationEvent): void;
73
54
  dispatch(event: NotificationEvent): Promise<boolean>;
74
- /** One destination, one event. A throw is recorded against it and nothing else. */
55
+ /** Keeps the newest swallowed state change, to send when the window ends: only the final state matters. */
56
+ private holdLatest;
57
+ private dropTrailing;
58
+ private sendTo;
75
59
  private deliver;
76
- /** A probe for one destination. */
77
60
  sendTest(id: string, overrides?: {
78
61
  chatId?: string;
79
62
  botToken?: string;
@@ -81,25 +64,13 @@ export declare class NotificationService {
81
64
  ok: boolean;
82
65
  error?: string;
83
66
  }>;
84
- /**
85
- * A Telegram destination's own token, with the chat id and the token both overridable.
86
- *
87
- * The override is what lets a token be tried before it is saved — the route advertises it and
88
- * `detect-chats` honours it, so ignoring it here made "send a test" fail on a token the page was
89
- * still holding.
90
- */
67
+ /** The overrides let a token and chat be tried before they are saved. */
91
68
  private testTelegram;
92
- /**
93
- * A webhook probe, for a saved destination or for a draft the page has not saved.
94
- *
95
- * A draft is passed whole, so a URL and its headers can be tried before they are stored — and so
96
- * a destination's own "test" tests *that* destination, not whichever one comes first.
97
- */
69
+ /** A webhook probe, for a saved destination or an unsaved draft. */
98
70
  testWebhook(target: Pick<WebhookTarget, 'url' | 'method' | 'format' | 'headers'>, id?: string): Promise<{
99
71
  ok: boolean;
100
72
  error?: string;
101
73
  }>;
102
- /** Lists the chats a destination's bot can see, so its chat id can be picked. */
103
74
  detectChats(id: string, overrides?: {
104
75
  botToken?: string;
105
76
  }): Promise<{
@@ -110,15 +81,14 @@ export declare class NotificationService {
110
81
  }>;
111
82
  error?: string;
112
83
  }>;
113
- /** Verifies a token without storing or sending anything. */
114
84
  verifyToken(token: string): Promise<{
115
85
  ok: boolean;
116
86
  username?: string;
117
87
  error?: string;
118
88
  }>;
119
89
  private cooldownKey;
90
+ private stateKey;
120
91
  private sendTelegram;
121
- /** Records one destination's outcome, keyed by its id. */
122
92
  private remember;
123
93
  }
124
94
  export {};
@@ -14,6 +14,7 @@ import { WorkspaceStore } from '../config/store.js';
14
14
  import { ConfigWatch } from './config-watch.js';
15
15
  import { DdnsService } from './ddns.js';
16
16
  import { HistoryStore } from './history.js';
17
+ import { JobsService } from './jobs.js';
17
18
  import { LogFiles } from './log-files.js';
18
19
  import { NotificationService } from './notifications.js';
19
20
  import { Supervisor } from './supervisor.js';
@@ -28,18 +29,16 @@ export interface WorkspaceRuntime {
28
29
  notifications: NotificationService;
29
30
  ddns: DdnsService;
30
31
  supervisor: Supervisor;
32
+ jobs: JobsService;
31
33
  watches: ConfigWatch[];
32
34
  logsDir: string;
33
35
  /** The config error last written to the log, so a standing typo is reported once. */
34
36
  reportedConfigError: string | null;
35
- /** The state frame's view of this runtime, rebuilt on every read. */
36
37
  view: () => WorkspaceView;
37
38
  }
38
39
  export interface PanelServiceOptions {
39
40
  registry: WorkspaceRegistry;
40
- /** The panel-wide settings: listener, auth, TLS policy, host vitals, backups. */
41
41
  settings: GlobalSettingsStore;
42
- /** The panel-wide secrets: password hash and API token. */
43
42
  secrets: SecretsStore;
44
43
  auth: AuthService;
45
44
  tls: TlsStore;
@@ -47,21 +46,15 @@ export interface PanelServiceOptions {
47
46
  ui: UiService;
48
47
  hostMonitor: HostMonitor;
49
48
  hub: EventHub;
50
- /** The live listener; read lazily because it is created after this service. */
49
+ /** Read lazily: the listener is created after this service. */
51
50
  control: () => ControlEndpoint;
52
- /** The panel-wide reverse proxy; read lazily for the same reason. */
53
51
  proxy: () => ProxyService | null;
54
52
  /** `--no-autostart` still means "start nothing on your own", reloads included. */
55
53
  autostart: boolean;
56
54
  }
57
55
  /**
58
- * The panel process at the workspace level: one runtime per workspace, one
59
- * aggregate state frame, and the CRUD a workspace selector needs.
60
- *
61
- * Every workspace gets its own store, secrets, log files, history, DDNS service
62
- * and supervisor, so nothing an entry does can leak across the unit a person
63
- * chose to separate it into. Only what is genuinely panel-wide — the listener,
64
- * auth, TLS, host vitals, backups, UI — stays here.
56
+ * One runtime per workspace (store, secrets, logs, history, DDNS, supervisor, jobs) so nothing leaks
57
+ * across workspaces, plus the aggregate state frame. Only panel-wide concerns stay here.
65
58
  */
66
59
  export declare class PanelService {
67
60
  private readonly options;
@@ -70,11 +63,10 @@ export declare class PanelService {
70
63
  private readonly removing;
71
64
  private readonly timer;
72
65
  private disposed;
66
+ private ticking;
73
67
  private lastStateSignature;
74
68
  private stateScheduled;
75
- /** The panel-wide `settings.json`, watched like every workspace file. */
76
69
  private readonly settingsWatch;
77
- /** The global config error last written to the log, so a standing typo is reported once. */
78
70
  private reportedSettingsError;
79
71
  constructor(options: PanelServiceOptions);
80
72
  get settings(): GlobalSettingsStore;
@@ -82,40 +74,24 @@ export declare class PanelService {
82
74
  get hub(): EventHub;
83
75
  workspaces(): WorkspaceRuntime[];
84
76
  workspace(id: string): WorkspaceRuntime | undefined;
85
- /** The id a workspace-scoped request without one resolves to. */
86
77
  defaultId(): string;
87
78
  requireWorkspace(id?: string): WorkspaceRuntime;
88
- /** Resolves a `(workspace, server)` pair, the only unique key now that ids repeat. */
89
79
  findServer(workspaceId: string, serverId: string): {
90
80
  workspace: WorkspaceRuntime;
91
81
  config: ServerConfig;
92
82
  } | null;
93
- /**
94
- * One workspace's DDNS account, credentials included, for the panel-wide proxy.
95
- *
96
- * The account stays where it lives — a workspace owns its secrets and its
97
- * notification routing — so the proxy references it instead of holding a copy.
98
- */
83
+ /** One workspace's DDNS account with credentials; the proxy references it rather than copying it. */
99
84
  findDnsAccount(workspaceId: string, accountId: string): {
100
85
  workspace: WorkspaceRuntime;
101
86
  account: DdnsAccount;
102
87
  credentials: Record<string, string> | null;
103
88
  } | null;
104
- /**
105
- * Every DNS account a proxy route may name, across every workspace.
106
- *
107
- * A route references `<workspace>/<account>`, so the picker needs all of them; the
108
- * account itself never leaves the workspace that owns it.
109
- */
89
+ /** Every DNS account a proxy route may name (`<workspace>/<account>`), across every workspace. */
110
90
  listDnsAccounts(): ProxyDnsAccountView[];
111
91
  serverViews(workspaceId?: string): ServerView[];
112
92
  /**
113
- * The running servers of every workspace *except* `except`, so one supervisor can recognize a
114
- * sibling workspace's process as one the panel owns rather than a stranger to signal — and can
115
- * name it when it refuses.
116
- *
117
- * Read from the live views rather than from nanny state: an adopted entry has no child record,
118
- * and a persistent one's pid is the nanny's, whose tree the supervisor walks itself.
93
+ * The running servers of every other workspace, so a supervisor treats a sibling's process as
94
+ * panel-owned rather than a stranger to signal. Read from live views: an adopted entry has no child record.
119
95
  */
120
96
  siblingServers(except: string): Array<{
121
97
  pid: number;
@@ -123,18 +99,14 @@ export declare class PanelService {
123
99
  serverId: string;
124
100
  }>;
125
101
  getState(): AppState;
126
- /** The sources a backup archive is built from and restored into. */
127
102
  backupSources(): BackupSources;
128
103
  create(input: {
129
104
  id?: string;
130
105
  label?: string;
131
106
  }): WorkspaceView;
132
107
  /**
133
- * Registers a workspace an archive brought but this host did not have, then builds
134
- * its runtime so the files a restore is about to write have an owner.
135
- *
136
- * Idempotent, and it never touches an existing workspace: a restore must fill one
137
- * that is already here, not replace its label or its runtime.
108
+ * Registers and builds a workspace an archive brought, so a restore's files have an owner.
109
+ * Idempotent; never touches an existing workspace.
138
110
  */
139
111
  ensureWorkspace(input: {
140
112
  id: string;
@@ -142,70 +114,52 @@ export declare class PanelService {
142
114
  }): void;
143
115
  rename(id: string, label: string): WorkspaceView;
144
116
  /**
145
- * Stops every entry the workspace supervises — persistent ones included, because
146
- * deleting a workspace removes the state file its nanny would be found through —
147
- * and then removes its directory.
117
+ * Stops every entry, persistent ones included (their nanny state is deleted with the directory),
118
+ * then removes the workspace directory.
148
119
  */
149
120
  remove(id: string): Promise<Workspace>;
150
121
  /**
151
- * Re-reads every workspace and the global settings, e.g. after a restore.
152
- *
153
- * `store.load()` resets the byte baseline the config watcher compares against, so the
154
- * poll that follows sees "no change" and never reaches its autostart pass. The entries
155
- * an archive brought therefore waited for a panel restart — which is why the start of
156
- * newly appeared autostart entries belongs here, the one place that knows what was new.
157
- */
158
- /**
159
- * Record a dump a restore staged, so this entry's next start loads it.
160
- *
161
- * Written to the entry's own state file rather than memory: the restore usually happens before the
162
- * entry has ever started, and a panel restart between the two must not lose the load.
122
+ * Record a dump a restore staged, so this entry's next start loads it. Persisted to the entry's
123
+ * state file, which is the authority: the entry (or its runtime) may not exist yet, and a restart
124
+ * in between must not lose the load.
163
125
  */
164
126
  stagePendingLoad(workspaceId: string, serverId: string, dumpDir: string): void;
165
- reloadAll(): void;
166
127
  /**
167
- * Applies a lowered `logs.keep` to the files already on disk, after any reload.
168
- *
169
- * `keep` bounds the directory, not the next rotation — and a quiet entry may not fill a file for
170
- * days, so "I lowered it" must not mean "eventually". The HTTP settings route always did this;
171
- * the hand-edit paths (`handleConfigChange`, `reloadAll`) reloaded the store and stopped there, so
172
- * a `settings.json` edit left `.3`…`.5` sitting under a `keep: 2` that the same docs invite a
173
- * person to write. One derivation, called from every path that can lower it, because pruning is
174
- * idempotent and cheap: it is one `readdir` per workspace.
128
+ * Re-reads every workspace and the global settings, e.g. after a restore. Starts newly appeared
129
+ * autostart entries itself: `store.load()` resets the watcher's baseline, so its poll never would.
175
130
  */
131
+ reloadAll(): void;
132
+ /** Applies a lowered `logs.keep` to the files already on disk, from every path that can lower it. */
176
133
  private pruneLogs;
177
134
  /** Starts the autostart entries a reload just revealed, exactly as a hand edit would. */
178
135
  private startRestored;
179
- /** Starts whatever the config marks autostart, across every workspace. */
136
+ /** Starts whatever the config marks autostart, across every workspace. Boot's own pass. */
180
137
  startAll(workspaces?: string[]): Promise<void>;
181
138
  /** `withPersistent` reaches every workspace's supervisor: a `down` is host-wide. */
182
139
  dispose(options?: {
183
140
  withPersistent?: boolean;
184
141
  }): Promise<void>;
142
+ /**
143
+ * Registers a workspace only once its directory and runtime exist, so a failure cannot leave a
144
+ * `workspaces.json` entry every later `up` dies on. A failure rolls back what this call made.
145
+ */
146
+ private addWorkspace;
185
147
  private createRuntime;
186
148
  private disposeRuntime;
187
149
  private reportWorkspaceErrors;
188
- /**
189
- * A workspace file edited by hand is picked up without a restart. A revision
190
- * this release cannot read is reported in the state frame, and the workspace
191
- * keeps running what it had — a typo never stops a server.
192
- */
150
+ /** A hand edit is picked up live; an unreadable one is reported and the running config kept. */
193
151
  private handleConfigChange;
194
152
  /**
195
- * `settings.json` edited by hand (or by `setup-temp`) is picked up without a restart, and the next
196
- * save builds on it instead of overwriting it. Every consumer reads the settings through a getter,
197
- * so the reload alone is enough — except a running proxy engine, which holds the config it was
198
- * last handed and is re-applied here.
153
+ * A hand-edited `settings.json` is picked up live. Consumers read through getters, except a running
154
+ * proxy engine, which holds its last config and is re-applied here.
199
155
  */
200
156
  private handleSettingsChange;
201
157
  /**
202
- * The exposure rule a settings write obeys, for an edit that arrives through the file instead: a
203
- * hand edit that would newly expose the live listener or a proxied panel route without a password
204
- * is refused. Only a *new* exposure — one already in force is the startup guard's to report.
158
+ * The settings-write exposure rule, for a hand edit: refuses only a *new* exposure; one already in
159
+ * force is the startup guard's to report.
205
160
  */
206
161
  private settingsRefusal;
207
162
  private tick;
208
- /** A panel-wide service changed something the state frame carries. */
209
163
  notifyStateChange(): void;
210
164
  /** Coalesces every signal in a turn into at most one frame. */
211
165
  private scheduleState;
@@ -1,15 +1,24 @@
1
1
  import type { GlobalSettingsStore } from '../../config/settings.js';
2
2
  import type { ProxyCertificateState, ProxyCertificateView, ProxyConfig, ProxyRoute } from '../../shared/contracts.js';
3
3
  import { TlsStore } from '../tls.js';
4
- /**
5
- * Does a route's certificate cover this host?
6
- *
7
- * A `*.example.com` entry covers exactly one label (`www.example.com`, not `a.b.example.com` and not
8
- * `example.com`), which is what a wildcard certificate means; anything else is an exact match, case
9
- * insensitive.
10
- */
4
+ interface CertSnapshot {
5
+ at: number;
6
+ key: string;
7
+ days: number | null;
8
+ issued: Map<string, {
9
+ notAfter: number;
10
+ issuer: string;
11
+ }>;
12
+ local: Map<string, {
13
+ notAfter: number;
14
+ lifetimeMs: number;
15
+ }>;
16
+ views: ProxyCertificateView[];
17
+ /** The last thing the engine logged about obtaining a certificate, per name. */
18
+ failures: Map<string, string>;
19
+ }
20
+ /** A `*.example.com` entry covers exactly one non-empty label; anything else is an exact, case-insensitive match. */
11
21
  export declare function coversHost(hosts: readonly string[], host: string): boolean;
12
- /** What the desk needs from the service that owns it. */
13
22
  export interface CertificateDeskDeps {
14
23
  tlsDir: string;
15
24
  stateDir: string;
@@ -23,94 +32,47 @@ export interface CertificateDeskDeps {
23
32
  }
24
33
  export declare class CertificateDesk {
25
34
  private readonly deps;
26
- /** Cached certificate verdicts, invalidated by `invalidate`. */
27
35
  private certCache;
28
- /** The parsed failure map, keyed on the log's identity — see `obtainFailures`. */
36
+ /** The parsed failure map, keyed on the log's identity. */
29
37
  private failureCache;
30
38
  constructor(deps: CertificateDeskDeps);
31
- /** The config lives on the service; read through the thunk rather than holding a stale copy. */
32
39
  private get config();
33
- /** Drops the cached verdicts, so the next read sees a pair that just changed. */
34
40
  invalidate(): void;
35
41
  pairStore(id: string): TlsStore;
36
- /**
37
- * Stores a pair under `id` and records it in the config, so a route can be
38
- * checked against what it actually covers.
39
- */
40
42
  saveCertificate(id: string, label: string, certificate: string, privateKey: string): {
41
43
  ok: boolean;
42
44
  error?: string;
43
45
  };
44
- /**
45
- * Removes a pair — refused while a route still serves it, because deleting the
46
- * files first would leave the engine on a certificate the panel has dropped.
47
- */
46
+ /** Refused while a route still serves the pair, or the engine would keep a certificate the panel dropped. */
48
47
  clearCertificate(id: string): void;
49
- /** Every uploaded pair, described: what it is for, and what it covers. */
50
48
  certificateViews(): ProxyCertificateView[];
51
49
  /**
52
- * What the certificate snapshot depends on: the config it resolves against, and the
53
- * uploaded pair files themselves. Keying on both means a route edit, an upload, or a
54
- * pair that expired (or was replaced) on disk is reflected on the next read, while a
55
- * steady state still costs one read per 15 seconds.
50
+ * Keyed on the config alone, so an edit shows on the next read without touching the disk; a pair
51
+ * replaced by hand shows when the snapshot expires (one stat per pair per frame was the cost).
56
52
  */
57
53
  private certKey;
58
- /** The certificate store read once, so a per-second tick costs nothing. */
59
- certSnapshot(): {
60
- at: number;
61
- key: string;
62
- days: number | null;
63
- issued: Map<string, {
64
- notAfter: number;
65
- issuer: string;
66
- }>;
67
- local: Map<string, {
68
- notAfter: number;
69
- lifetimeMs: number;
70
- }>;
71
- views: ProxyCertificateView[];
72
- };
73
- /**
74
- * The pair that would actually serve this hostname: an exact SAN beats a wildcard,
75
- * and an expired or unreadable pair is not a candidate at all.
76
- */
54
+ /** The certificate store and the engine log's failures, read once per `CERT_SNAPSHOT_MS`: the frame asks per route. */
55
+ certSnapshot(): CertSnapshot;
56
+ /** The pair that would serve this hostname: an exact SAN beats a wildcard; an unusable pair is no candidate. */
77
57
  bestCover(host: string): ProxyCertificateView | null;
78
58
  private readCertificateViews;
79
- /**
80
- * What a route's certificate situation is: read from the engine's own store for a
81
- * managed name, and from the last thing the engine said about it in its log.
82
- */
83
59
  certificateFor(route: ProxyRoute): {
84
60
  state: ProxyCertificateState;
85
61
  message: string | null;
86
62
  retryInMinutes?: number;
87
63
  };
88
- /** Managed certificates the engine holds, by hostname. */
89
64
  private issuedCertificates;
90
- /** Certificates the engine's own CA issued, by hostname. */
91
65
  private localCertificates;
92
- /**
93
- * The engine's own certificates, which `readIssuedCertificates` skips on purpose.
94
- *
95
- * A public name in here means the CA would not issue and the engine fell back to
96
- * its own CA — a state worth its own name, because the name is served but not by a
97
- * trusted issuer, and it clears itself when the engine next tries the CA.
98
- */
66
+ /** The engine's own CA certificates; a public name here means the CA refused and the engine fell back. */
99
67
  private readLocalCertificates;
100
68
  private readIssuedCertificates;
69
+ private obtainFailures;
101
70
  /**
102
- * The last thing the engine said about obtaining a certificate, per name. Caddy
103
- * has no admin endpoint that lists failures, so its own log is the source.
104
- *
105
- * Memoised on the file's identity and mtime, because this is called **per route** from
106
- * `routeViews()` — which `view()` runs for every state frame and `sync()` runs every tick.
107
- * Each call read the whole log (bounded at 2 MB by rotation), split every line and kept the
108
- * last 400: ~1.3 ms each, so ~13 ms of blocking synchronous I/O per second at ten routes,
109
- * for a file that only changes when the engine tries to obtain a certificate.
110
- *
111
- * The key is `ino` + `mtimeMs` + size, not mtime alone: rotation replaces the file, and a
112
- * replacement can land in the same millisecond as the previous read.
71
+ * The last thing the engine logged about obtaining a certificate, per name (Caddy has no admin endpoint
72
+ * for failures), from the log's last `LOG_TAIL_BYTES`. Memoised on `ino` + mtime + size: rotation can
73
+ * replace the file within the same millisecond.
113
74
  */
114
- private obtainFailures;
75
+ private readObtainFailures;
115
76
  private parseFailures;
116
77
  }
78
+ export {};
@@ -1,13 +1,14 @@
1
1
  import type { ProxyAdminTransport } from '../providers/proxy/index.js';
2
2
  import type { ProxyConfig, ProxyTlsMode } from '../shared/contracts.js';
3
- /** One route, resolved to something the engine can actually dial. */
4
3
  export interface ProxyUpstreamRoute {
5
4
  host: string;
6
5
  path: string;
7
6
  /** `host:port` the engine forwards to. */
8
7
  dial: string;
9
- /** The upstream speaks TLS (the panel itself may), so verification is skipped. */
8
+ /** The upstream speaks TLS (the panel itself may). */
10
9
  upstreamTls: boolean;
10
+ /** Its certificate is not verified: the panel's own self-signed listener, or a route's opt-in. */
11
+ upstreamSkipVerify?: boolean;
11
12
  tls: ProxyTlsMode;
12
13
  /** The handshake for this name can complete: a certificate is there or will be. */
13
14
  certificateReady: boolean;
@@ -18,30 +19,19 @@ export interface ProxyConfigInput {
18
19
  /** Where certificates and other engine state live; never a home directory. */
19
20
  engineDir: string;
20
21
  routes: ProxyUpstreamRoute[];
21
- /** The PEM pairs `tls: "manual"` may serve, as paths on disk; the engine picks by SNI. */
22
+ /** PEM pairs `tls: "manual"` may serve; `tags` carry a content fingerprint, so a pair replaced in place changes the config. */
22
23
  manual: Array<{
23
24
  certificate: string;
24
25
  key: string;
26
+ tags?: string[];
25
27
  }>;
26
- /**
27
- * The ACME account, and the names it may issue for. Without this the engine still
28
- * gets certificates, but registers an account with no contact address and has no
29
- * way to be pointed at the staging endpoint.
30
- */
28
+ /** Without it the engine registers an account with no contact address and cannot use staging. */
31
29
  acme: {
32
30
  email: string;
33
31
  staging: boolean;
34
32
  subjects: string[];
35
33
  };
36
- /**
37
- * How the panel answers a DNS-01 challenge. Absent means the engine keeps using
38
- * HTTP-01/TLS-ALPN-01 for every name.
39
- *
40
- * One entry per DNS account, because an engine policy carries one challenge
41
- * provider: a name whose zone lives at Cloudflare and one at deSEC need one policy
42
- * each. The caller groups them, so the renderer never guesses which account owns a
43
- * hostname.
44
- */
34
+ /** Absent: HTTP-01/TLS-ALPN-01 for every name. One policy per DNS account, grouped by the caller. */
45
35
  dns01?: {
46
36
  /** The panel's ACMEProxy endpoint, e.g. `http://127.0.0.1:3999/_acme`. */
47
37
  endpoint: string;
@@ -50,34 +40,23 @@ export interface ProxyConfigInput {
50
40
  /** Nameservers the engine checks the record against; empty leaves it to Caddy. */
51
41
  resolvers: string[];
52
42
  policies: Array<{
53
- /** `<workspace>/<account>`, for the panel's own record of who answers. */
54
43
  account: string;
55
- /** The DNS provider, for the engine log when a challenge fails. */
56
44
  provider: string;
57
45
  subjects: string[];
58
46
  }>;
59
47
  };
60
48
  }
61
- /**
62
- * The name the engine answers with when a visitor reaches the port without an SNI
63
- * (a bare IP) — or with one it has no certificate for. Caddy issues it from its own
64
- * CA, which is why nothing here has to generate a certificate.
65
- */
49
+ /** The name served to a visitor with no SNI (a bare IP) or an unknown one; Caddy's own CA issues it. */
66
50
  export declare const FALLBACK_NAME = "hh-fallback.invalid";
51
+ /** The ports a rendered configuration actually listens on; the applied record and the port preflight both read this. */
52
+ export declare function boundPorts(rendered: Record<string, unknown>): number[];
67
53
  /**
68
- * The ports a rendered configuration listens on.
69
- *
70
- * The one derivation: `httpPort`/`httpsPort` are what was *asked for*, not what is bound — a
71
- * `tls: 'off'`-only table binds no HTTPS listener, and a table with no servable route binds nothing.
72
- * Both the applied record and the port preflight read this, so they cannot disagree.
54
+ * The engine's admin block for one transport. Its own function because a stored revision is
55
+ * re-rendered with the *current* one on revert: on Windows the admin port is chosen per start.
73
56
  */
74
- export declare function boundPorts(rendered: Record<string, unknown>): number[];
57
+ export declare function adminBlock(admin: ProxyAdminTransport): Record<string, unknown>;
75
58
  /**
76
- * The whole engine configuration, generated from the panel's route table.
77
- *
78
- * Two servers on purpose: one terminates TLS for the names that ask for it, the
79
- * other keeps the cleartext port for ACME HTTP-01 challenges, plaintext routes and
80
- * an explicit redirect. Caddy's own redirect insertion is off so the redirect
81
- * carries our `httpsPort`, which is not necessarily 443.
59
+ * The whole engine configuration. Two servers: TLS for the names that ask for it, and cleartext for
60
+ * HTTP-01, plaintext routes and our own redirect (which carries `httpsPort`, not necessarily 443).
82
61
  */
83
62
  export declare function renderCaddyConfig(input: ProxyConfigInput): Record<string, unknown>;
@@ -0,0 +1,14 @@
1
+ import type { ProxyUpstreamRoute } from './proxy-config.js';
2
+ /**
3
+ * The engine policies DNS-01 needs: one per account, since a policy carries one challenge provider.
4
+ * Names no account answers are left out and keep the port challenges.
5
+ */
6
+ export declare function groupDns01Policies(routes: readonly ProxyUpstreamRoute[], accountFor: (host: string) => {
7
+ workspaceId: string;
8
+ accountId: string;
9
+ provider: string;
10
+ } | null): Array<{
11
+ account: string;
12
+ provider: string;
13
+ subjects: string[];
14
+ }>;