home-hosted 0.10.3 → 0.12.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 (317) hide show
  1. package/README.md +273 -628
  2. package/dist/chunks/archive-DpCwA8Nf.js +339 -0
  3. package/dist/chunks/archive-DpCwA8Nf.js.map +1 -0
  4. package/dist/chunks/atomic-CEfCUfkQ.js +25 -0
  5. package/dist/chunks/atomic-CEfCUfkQ.js.map +1 -0
  6. package/dist/chunks/backup-CPrJVPJI.js +797 -0
  7. package/dist/chunks/backup-CPrJVPJI.js.map +1 -0
  8. package/dist/chunks/backups-Bd2SF2qd.js +4346 -0
  9. package/dist/chunks/backups-Bd2SF2qd.js.map +1 -0
  10. package/dist/chunks/config-text-DifCHhnz.js +50 -0
  11. package/dist/chunks/config-text-DifCHhnz.js.map +1 -0
  12. package/dist/chunks/contracts-ku5ypHXJ.js +2256 -0
  13. package/dist/chunks/contracts-ku5ypHXJ.js.map +1 -0
  14. package/dist/chunks/daemon-TwXk5vb8.js +215 -0
  15. package/dist/chunks/daemon-TwXk5vb8.js.map +1 -0
  16. package/dist/chunks/daemon-log-BVj8cDEo.js +241 -0
  17. package/dist/chunks/daemon-log-BVj8cDEo.js.map +1 -0
  18. package/dist/chunks/docker-CGv4Uv7w.js +436 -0
  19. package/dist/chunks/docker-CGv4Uv7w.js.map +1 -0
  20. package/dist/chunks/down-BlX5X3bm.js +378 -0
  21. package/dist/chunks/down-BlX5X3bm.js.map +1 -0
  22. package/dist/chunks/init-DdmqHVra.js +263 -0
  23. package/dist/chunks/init-DdmqHVra.js.map +1 -0
  24. package/dist/chunks/last-stop-BZ08Z89-.js +52 -0
  25. package/dist/chunks/last-stop-BZ08Z89-.js.map +1 -0
  26. package/dist/chunks/layout-D74TGUnr.js +24 -0
  27. package/dist/chunks/layout-D74TGUnr.js.map +1 -0
  28. package/dist/chunks/log-buffer-HnP0jKhZ.js +350 -0
  29. package/dist/chunks/log-buffer-HnP0jKhZ.js.map +1 -0
  30. package/dist/chunks/logger-B5U4GD3j.js +13 -0
  31. package/dist/chunks/logger-B5U4GD3j.js.map +1 -0
  32. package/dist/chunks/logs-gI_69Q1P.js +265 -0
  33. package/dist/chunks/logs-gI_69Q1P.js.map +1 -0
  34. package/dist/chunks/migrate-BTlsibvF.js +155 -0
  35. package/dist/chunks/migrate-BTlsibvF.js.map +1 -0
  36. package/dist/chunks/nanny-20aBXL1o.js +1069 -0
  37. package/dist/chunks/nanny-20aBXL1o.js.map +1 -0
  38. package/dist/chunks/nanny-CjnnrIpm.js +132 -0
  39. package/dist/chunks/nanny-CjnnrIpm.js.map +1 -0
  40. package/dist/chunks/nanny-DUaAfCV-.js +39 -0
  41. package/dist/chunks/nanny-DUaAfCV-.js.map +1 -0
  42. package/dist/chunks/nanny-sweep-Ca9kPAVi.js +104 -0
  43. package/dist/chunks/nanny-sweep-Ca9kPAVi.js.map +1 -0
  44. package/dist/chunks/nearest-6KgQEDUe.js +41 -0
  45. package/dist/chunks/nearest-6KgQEDUe.js.map +1 -0
  46. package/dist/chunks/parse-B9owE47G.js +383 -0
  47. package/dist/chunks/parse-B9owE47G.js.map +1 -0
  48. package/dist/chunks/paths-BT94q6-w.js +172 -0
  49. package/dist/chunks/paths-BT94q6-w.js.map +1 -0
  50. package/dist/chunks/port-B8WBTRMk.js +333 -0
  51. package/dist/chunks/port-B8WBTRMk.js.map +1 -0
  52. package/dist/chunks/restart-UZgeDukG.js +126 -0
  53. package/dist/chunks/restart-UZgeDukG.js.map +1 -0
  54. package/dist/chunks/rolldown-runtime-D7D4PA-g.js +13 -0
  55. package/dist/chunks/schema-o7Lgk0V1.js +102 -0
  56. package/dist/chunks/schema-o7Lgk0V1.js.map +1 -0
  57. package/dist/chunks/secrets-D7PdYh71.js +544 -0
  58. package/dist/chunks/secrets-D7PdYh71.js.map +1 -0
  59. package/dist/chunks/server-BuIeSsRu.js +169 -0
  60. package/dist/chunks/server-BuIeSsRu.js.map +1 -0
  61. package/dist/chunks/server-ids-DRuNLVCV.js +32 -0
  62. package/dist/chunks/server-ids-DRuNLVCV.js.map +1 -0
  63. package/dist/chunks/set-password-DegMumPh.js +43 -0
  64. package/dist/chunks/set-password-DegMumPh.js.map +1 -0
  65. package/dist/chunks/set-token-21d1FTDC.js +78 -0
  66. package/dist/chunks/set-token-21d1FTDC.js.map +1 -0
  67. package/dist/chunks/settings-BVSBnIwJ.js +332 -0
  68. package/dist/chunks/settings-BVSBnIwJ.js.map +1 -0
  69. package/dist/chunks/setup-temp-XiuAtiW2.js +150 -0
  70. package/dist/chunks/setup-temp-XiuAtiW2.js.map +1 -0
  71. package/dist/chunks/shape-DnTKzjQ2.js +24 -0
  72. package/dist/chunks/shape-DnTKzjQ2.js.map +1 -0
  73. package/dist/chunks/src-BL97vLVb.js +11153 -0
  74. package/dist/chunks/src-BL97vLVb.js.map +1 -0
  75. package/dist/chunks/status-EuWdRq8Q.js +119 -0
  76. package/dist/chunks/status-EuWdRq8Q.js.map +1 -0
  77. package/dist/chunks/ui-DbPuwddJ.js +323 -0
  78. package/dist/chunks/ui-DbPuwddJ.js.map +1 -0
  79. package/dist/chunks/ui-dir-CsU3uLNV.js +39 -0
  80. package/dist/chunks/ui-dir-CsU3uLNV.js.map +1 -0
  81. package/dist/chunks/ui-release-DKzVvlLd.js +312 -0
  82. package/dist/chunks/ui-release-DKzVvlLd.js.map +1 -0
  83. package/dist/chunks/ui-revert-BhqOAhmM.js +27 -0
  84. package/dist/chunks/ui-revert-BhqOAhmM.js.map +1 -0
  85. package/dist/chunks/ui-switch-CMoslPO2.js +150 -0
  86. package/dist/chunks/ui-switch-CMoslPO2.js.map +1 -0
  87. package/dist/chunks/ui-update-TTBBoDik.js +272 -0
  88. package/dist/chunks/ui-update-TTBBoDik.js.map +1 -0
  89. package/dist/chunks/up-C4H13hBw.js +196 -0
  90. package/dist/chunks/up-C4H13hBw.js.map +1 -0
  91. package/dist/chunks/usage-CSBgLRN5.js +85 -0
  92. package/dist/chunks/usage-CSBgLRN5.js.map +1 -0
  93. package/dist/chunks/workspaces-CAln2sQ7.js +221 -0
  94. package/dist/chunks/workspaces-CAln2sQ7.js.map +1 -0
  95. package/dist/chunks/wsl-temperature-BiCI4iK6.js +322 -0
  96. package/dist/chunks/wsl-temperature-BiCI4iK6.js.map +1 -0
  97. package/dist/cli.js +229 -24861
  98. package/dist/cli.js.map +1 -1
  99. package/dist/client.js +120 -0
  100. package/dist/client.js.map +1 -0
  101. package/dist/types/api/acme.d.ts +24 -0
  102. package/dist/types/api/auth/$.routes.d.ts +103 -0
  103. package/dist/types/api/backups.d.ts +179 -0
  104. package/dist/types/api/control.d.ts +469 -0
  105. package/dist/types/api/ddns.d.ts +432 -0
  106. package/dist/types/api/events.d.ts +21 -0
  107. package/dist/types/api/health.d.ts +27 -0
  108. package/dist/types/api/logs.d.ts +95 -0
  109. package/dist/types/api/metrics.d.ts +19 -0
  110. package/dist/types/api/notifications.d.ts +141 -0
  111. package/dist/types/api/proxy.d.ts +1128 -0
  112. package/dist/types/api/servers/$.routes.d.ts +1318 -0
  113. package/dist/types/api/settings.d.ts +642 -0
  114. package/dist/types/api/state.d.ts +492 -0
  115. package/dist/types/api/static.d.ts +11 -0
  116. package/dist/types/api/tls.d.ts +112 -0
  117. package/dist/types/api/workspaces/$.routes.d.ts +797 -0
  118. package/dist/types/api/wsl-temperature.d.ts +113 -0
  119. package/dist/types/app.d.ts +6080 -0
  120. package/dist/types/cli/args.d.ts +75 -0
  121. package/dist/types/cli/backup-offline.d.ts +23 -0
  122. package/dist/types/cli/backup.d.ts +79 -0
  123. package/dist/types/cli/down.d.ts +75 -0
  124. package/dist/types/cli/init.d.ts +60 -0
  125. package/dist/types/cli/io.d.ts +65 -0
  126. package/dist/types/cli/logs.d.ts +64 -0
  127. package/dist/types/cli/migrate.d.ts +33 -0
  128. package/dist/types/cli/nanny.d.ts +19 -0
  129. package/dist/types/cli/nearest.d.ts +10 -0
  130. package/dist/types/cli/restart.d.ts +42 -0
  131. package/dist/types/cli/server.d.ts +68 -0
  132. package/dist/types/cli/set-password.d.ts +14 -0
  133. package/dist/types/cli/set-token.d.ts +21 -0
  134. package/dist/types/cli/setup-temp.d.ts +65 -0
  135. package/dist/types/cli/status.d.ts +14 -0
  136. package/dist/types/cli/ui-revert.d.ts +3 -0
  137. package/dist/types/cli/ui-switch.d.ts +27 -0
  138. package/dist/types/cli/ui-update.d.ts +72 -0
  139. package/dist/types/cli/up.d.ts +90 -0
  140. package/dist/types/cli/usage.d.ts +23 -0
  141. package/dist/types/cli.d.ts +12 -0
  142. package/dist/types/client.d.ts +6284 -0
  143. package/dist/types/config/layout.d.ts +11 -0
  144. package/dist/types/config/migrations.d.ts +69 -0
  145. package/dist/types/config/parse.d.ts +54 -0
  146. package/dist/types/config/patch.d.ts +20 -0
  147. package/dist/types/config/schema.d.ts +318 -0
  148. package/dist/types/config/secret-parts.d.ts +48 -0
  149. package/dist/types/config/secrets.d.ts +206 -0
  150. package/dist/types/config/seed.d.ts +30 -0
  151. package/dist/types/config/server-ids.d.ts +14 -0
  152. package/dist/types/config/settings.d.ts +74 -0
  153. package/dist/types/config/store.d.ts +132 -0
  154. package/dist/types/config/workspaces.d.ts +96 -0
  155. package/dist/types/helpers/action-result.d.ts +46 -0
  156. package/dist/types/helpers/atomic.d.ts +9 -0
  157. package/dist/types/helpers/backoff.d.ts +7 -0
  158. package/dist/types/helpers/bind.d.ts +16 -0
  159. package/dist/types/helpers/config-text.d.ts +23 -0
  160. package/dist/types/helpers/cookies.d.ts +19 -0
  161. package/dist/types/helpers/copy-tree.d.ts +15 -0
  162. package/dist/types/helpers/daemon-log.d.ts +45 -0
  163. package/dist/types/helpers/daemon.d.ts +122 -0
  164. package/dist/types/helpers/deferred.d.ts +7 -0
  165. package/dist/types/helpers/env-file.d.ts +20 -0
  166. package/dist/types/helpers/error.d.ts +18 -0
  167. package/dist/types/helpers/factory.d.ts +6 -0
  168. package/dist/types/helpers/last-stop.d.ts +20 -0
  169. package/dist/types/helpers/logger.d.ts +7 -0
  170. package/dist/types/helpers/open.d.ts +2 -0
  171. package/dist/types/helpers/openapi.d.ts +46 -0
  172. package/dist/types/helpers/paths.d.ts +94 -0
  173. package/dist/types/helpers/restore-lock.d.ts +32 -0
  174. package/dist/types/helpers/runtime.d.ts +18 -0
  175. package/dist/types/helpers/secret-compare.d.ts +13 -0
  176. package/dist/types/helpers/shell.d.ts +19 -0
  177. package/dist/types/helpers/sse.d.ts +23 -0
  178. package/dist/types/helpers/template.d.ts +8 -0
  179. package/dist/types/helpers/ui-dir.d.ts +11 -0
  180. package/dist/types/helpers/validate.d.ts +7 -0
  181. package/dist/types/helpers/validator.d.ts +12 -0
  182. package/dist/types/helpers/version.d.ts +10 -0
  183. package/dist/types/helpers/workspace.d.ts +25 -0
  184. package/dist/types/index.d.ts +17 -0
  185. package/dist/types/middleware/auth.d.ts +37 -0
  186. package/dist/types/middleware/host.d.ts +29 -0
  187. package/dist/types/middleware/loopback.d.ts +18 -0
  188. package/dist/types/openapi-reference.d.ts +22 -0
  189. package/dist/types/openapi.d.ts +34 -0
  190. package/dist/types/providers/archive.d.ts +54 -0
  191. package/dist/types/providers/backup-hook.d.ts +34 -0
  192. package/dist/types/providers/ddns/cloudflare.d.ts +2 -0
  193. package/dist/types/providers/ddns/desec.d.ts +2 -0
  194. package/dist/types/providers/ddns/digitalocean.d.ts +2 -0
  195. package/dist/types/providers/ddns/duckdns.d.ts +2 -0
  196. package/dist/types/providers/ddns/dyndns2.d.ts +15 -0
  197. package/dist/types/providers/ddns/dynu.d.ts +2 -0
  198. package/dist/types/providers/ddns/freedns.d.ts +2 -0
  199. package/dist/types/providers/ddns/gandi.d.ts +2 -0
  200. package/dist/types/providers/ddns/godaddy.d.ts +2 -0
  201. package/dist/types/providers/ddns/henet.d.ts +3 -0
  202. package/dist/types/providers/ddns/index.d.ts +12 -0
  203. package/dist/types/providers/ddns/ip.d.ts +27 -0
  204. package/dist/types/providers/ddns/namecheap-api.d.ts +13 -0
  205. package/dist/types/providers/ddns/namecheap.d.ts +6 -0
  206. package/dist/types/providers/ddns/noip.d.ts +2 -0
  207. package/dist/types/providers/ddns/porkbun.d.ts +2 -0
  208. package/dist/types/providers/ddns/spaceship.d.ts +7 -0
  209. package/dist/types/providers/ddns/types.d.ts +98 -0
  210. package/dist/types/providers/ddns/zone.d.ts +11 -0
  211. package/dist/types/providers/docker.d.ts +117 -0
  212. package/dist/types/providers/entry-state.d.ts +15 -0
  213. package/dist/types/providers/health-check.d.ts +27 -0
  214. package/dist/types/providers/host.d.ts +147 -0
  215. package/dist/types/providers/identity.d.ts +54 -0
  216. package/dist/types/providers/log-tail.d.ts +29 -0
  217. package/dist/types/providers/nanny-sweep.d.ts +51 -0
  218. package/dist/types/providers/nanny.d.ts +94 -0
  219. package/dist/types/providers/port.d.ts +142 -0
  220. package/dist/types/providers/proc.d.ts +116 -0
  221. package/dist/types/providers/process.d.ts +61 -0
  222. package/dist/types/providers/proxy/caddy.d.ts +2 -0
  223. package/dist/types/providers/proxy/index.d.ts +7 -0
  224. package/dist/types/providers/proxy/types.d.ts +54 -0
  225. package/dist/types/providers/server-vars.d.ts +4 -0
  226. package/dist/types/providers/telegram.d.ts +32 -0
  227. package/dist/types/providers/ui-release.d.ts +113 -0
  228. package/dist/types/providers/webhook.d.ts +64 -0
  229. package/dist/types/providers/wsl-temperature.d.ts +69 -0
  230. package/dist/types/services/acme-challenge.d.ts +44 -0
  231. package/dist/types/services/auth.d.ts +145 -0
  232. package/dist/types/services/backups.d.ts +352 -0
  233. package/dist/types/services/config-watch.d.ts +40 -0
  234. package/dist/types/services/control-server.d.ts +58 -0
  235. package/dist/types/services/ddns.d.ts +67 -0
  236. package/dist/types/services/dependencies.d.ts +21 -0
  237. package/dist/types/services/events.d.ts +17 -0
  238. package/dist/types/services/exposure.d.ts +33 -0
  239. package/dist/types/services/history.d.ts +36 -0
  240. package/dist/types/services/host-monitor.d.ts +32 -0
  241. package/dist/types/services/init.d.ts +71 -0
  242. package/dist/types/services/log-buffer.d.ts +28 -0
  243. package/dist/types/services/log-files.d.ts +87 -0
  244. package/dist/types/services/log-relay.d.ts +36 -0
  245. package/dist/types/services/nanny.d.ts +14 -0
  246. package/dist/types/services/notifications.d.ts +124 -0
  247. package/dist/types/services/panel.d.ts +194 -0
  248. package/dist/types/services/proxy-config.d.ts +83 -0
  249. package/dist/types/services/proxy.d.ts +454 -0
  250. package/dist/types/services/state.d.ts +41 -0
  251. package/dist/types/services/supervisor/compose.d.ts +17 -0
  252. package/dist/types/services/supervisor/entry.d.ts +139 -0
  253. package/dist/types/services/supervisor/health.d.ts +55 -0
  254. package/dist/types/services/supervisor/pending-load.d.ts +6 -0
  255. package/dist/types/services/supervisor/persistent.d.ts +55 -0
  256. package/dist/types/services/supervisor/port-preflight.d.ts +45 -0
  257. package/dist/types/services/supervisor/records.d.ts +38 -0
  258. package/dist/types/services/supervisor/spawn.d.ts +15 -0
  259. package/dist/types/services/supervisor/view.d.ts +4 -0
  260. package/dist/types/services/supervisor.d.ts +113 -0
  261. package/dist/types/services/tls.d.ts +48 -0
  262. package/dist/types/services/ui-update.d.ts +44 -0
  263. package/dist/types/services/ui.d.ts +50 -0
  264. package/dist/types/shared/api-client.d.ts +137 -0
  265. package/dist/types/shared/backup-scope.d.ts +109 -0
  266. package/dist/types/shared/clone.d.ts +14 -0
  267. package/dist/types/shared/contracts.d.ts +4233 -0
  268. package/dist/types/shared/cpu-scale.d.ts +25 -0
  269. package/dist/types/shared/ddns-form.d.ts +62 -0
  270. package/dist/types/shared/endpoint.d.ts +8 -0
  271. package/dist/types/shared/error-message.d.ts +8 -0
  272. package/dist/types/shared/fields.d.ts +21 -0
  273. package/dist/types/shared/generated.d.ts +26 -0
  274. package/dist/types/shared/host-readings.d.ts +185 -0
  275. package/dist/types/shared/patch-diff.d.ts +94 -0
  276. package/dist/types/shared/probe-latency.d.ts +25 -0
  277. package/dist/types/shared/proxy-form.d.ts +182 -0
  278. package/dist/types/shared/server-attention.d.ts +37 -0
  279. package/dist/types/shared/server-key.d.ts +13 -0
  280. package/dist/types/shared/server-readings.d.ts +55 -0
  281. package/dist/types/shared/server-url.d.ts +43 -0
  282. package/dist/types/shared/shape.d.ts +17 -0
  283. package/dist/types/shared/ui-format.d.ts +89 -0
  284. package/docs/API.md +180 -0
  285. package/docs/BACKUPS.md +97 -0
  286. package/docs/CLI.md +122 -0
  287. package/docs/DDNS.md +12 -3
  288. package/docs/NOTIFICATIONS.md +3 -1
  289. package/docs/RESTORE_DEMO.md +6 -4
  290. package/docs/REVERSE_PROXY.md +2 -2
  291. package/docs/SECURITY.md +82 -0
  292. package/docs/SERVERS.md +47 -15
  293. package/docs/UI_CREATION.md +82 -286
  294. package/package.json +18 -9
  295. package/uis/stock/dist/assets/de-DyGrM1KK.js +1 -0
  296. package/uis/stock/dist/assets/es-BebHdc0E.js +1 -0
  297. package/uis/stock/dist/assets/fr-DsDTrxhI.js +1 -0
  298. package/uis/stock/dist/assets/index-6LANO2Ua.css +2 -0
  299. package/uis/stock/dist/assets/index-D06cUZbM.js +56 -0
  300. package/uis/stock/dist/assets/ja-D3RARJjW.js +1 -0
  301. package/uis/stock/dist/assets/ko-CKI3dFoD.js +1 -0
  302. package/uis/stock/dist/assets/ru-DEU5ujXt.js +1 -0
  303. package/uis/stock/dist/assets/vi-ULKPnasj.js +1 -0
  304. package/uis/stock/dist/assets/zh-CN-tCvnOxWy.js +1 -0
  305. package/uis/stock/dist/index.html +2 -2
  306. package/uis/stock/dist/ui.json +3 -3
  307. package/AGENTS.md +0 -403
  308. package/uis/stock/dist/assets/de-CiSKBON6.js +0 -1
  309. package/uis/stock/dist/assets/es-BgNQbboq.js +0 -1
  310. package/uis/stock/dist/assets/fr-WzBF8AXI.js +0 -1
  311. package/uis/stock/dist/assets/index-CXDl25BP.js +0 -53
  312. package/uis/stock/dist/assets/index-Cok5msAO.css +0 -2
  313. package/uis/stock/dist/assets/ja-DMQqF4ip.js +0 -1
  314. package/uis/stock/dist/assets/ko-DgfSg9v_.js +0 -1
  315. package/uis/stock/dist/assets/ru-DjIByX61.js +0 -1
  316. package/uis/stock/dist/assets/vi-DOB8nYFC.js +0 -1
  317. package/uis/stock/dist/assets/zh-CN-DZ3WlUgy.js +0 -1
@@ -0,0 +1,194 @@
1
+ import type { GlobalSettingsStore } from '../config/settings.js';
2
+ import type { WorkspaceRegistry } from '../config/workspaces.js';
3
+ import type { AuthService } from './auth.js';
4
+ import type { BackupService, BackupSources } from './backups.js';
5
+ import type { ControlEndpoint } from './control-server.js';
6
+ import type { EventHub } from './events.js';
7
+ import type { HostMonitor } from './host-monitor.js';
8
+ import type { ProxyService } from './proxy.js';
9
+ import type { TlsStore } from './tls.js';
10
+ import type { UiService } from './ui.js';
11
+ import type { AppState, DdnsAccount, ProxyDnsAccountView, ServerConfig, ServerView, Workspace, WorkspaceView } from '../shared/contracts.js';
12
+ import { SecretsStore } from '../config/secrets.js';
13
+ import { WorkspaceStore } from '../config/store.js';
14
+ import { ConfigWatch } from './config-watch.js';
15
+ import { DdnsService } from './ddns.js';
16
+ import { HistoryStore } from './history.js';
17
+ import { LogFiles } from './log-files.js';
18
+ import { NotificationService } from './notifications.js';
19
+ import { Supervisor } from './supervisor.js';
20
+ /** Everything one workspace owns at runtime, plus the objects that watch it. */
21
+ export interface WorkspaceRuntime {
22
+ id: string;
23
+ label: string;
24
+ store: WorkspaceStore;
25
+ secrets: SecretsStore;
26
+ logFiles: LogFiles;
27
+ history: HistoryStore;
28
+ notifications: NotificationService;
29
+ ddns: DdnsService;
30
+ supervisor: Supervisor;
31
+ watches: ConfigWatch[];
32
+ logsDir: string;
33
+ /** The config error last written to the log, so a standing typo is reported once. */
34
+ reportedConfigError: string | null;
35
+ /** The state frame's view of this runtime, rebuilt on every read. */
36
+ view: () => WorkspaceView;
37
+ }
38
+ export interface PanelServiceOptions {
39
+ registry: WorkspaceRegistry;
40
+ /** The panel-wide settings: listener, auth, TLS policy, host vitals, backups. */
41
+ settings: GlobalSettingsStore;
42
+ /** The panel-wide secrets: password hash and API token. */
43
+ secrets: SecretsStore;
44
+ auth: AuthService;
45
+ tls: TlsStore;
46
+ backups: BackupService;
47
+ ui: UiService;
48
+ hostMonitor: HostMonitor;
49
+ hub: EventHub;
50
+ /** The live listener; read lazily because it is created after this service. */
51
+ control: () => ControlEndpoint;
52
+ /** The panel-wide reverse proxy; read lazily for the same reason. */
53
+ proxy: () => ProxyService | null;
54
+ /** `--no-autostart` still means "start nothing on your own", reloads included. */
55
+ autostart: boolean;
56
+ }
57
+ /**
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.
65
+ */
66
+ export declare class PanelService {
67
+ private readonly options;
68
+ private readonly runtimes;
69
+ private readonly timer;
70
+ private disposed;
71
+ private lastStateSignature;
72
+ private stateScheduled;
73
+ constructor(options: PanelServiceOptions);
74
+ get settings(): GlobalSettingsStore;
75
+ get registry(): WorkspaceRegistry;
76
+ get hub(): EventHub;
77
+ workspaces(): WorkspaceRuntime[];
78
+ workspace(id: string): WorkspaceRuntime | undefined;
79
+ /** The id a workspace-scoped request without one resolves to. */
80
+ defaultId(): string;
81
+ requireWorkspace(id?: string): WorkspaceRuntime;
82
+ /** Resolves a `(workspace, server)` pair, the only unique key now that ids repeat. */
83
+ findServer(workspaceId: string, serverId: string): {
84
+ workspace: WorkspaceRuntime;
85
+ config: ServerConfig;
86
+ } | null;
87
+ /**
88
+ * One workspace's DDNS account, credentials included, for the panel-wide proxy.
89
+ *
90
+ * The account stays where it lives — a workspace owns its secrets and its
91
+ * notification routing — so the proxy references it instead of holding a copy.
92
+ */
93
+ findDnsAccount(workspaceId: string, accountId: string): {
94
+ workspace: WorkspaceRuntime;
95
+ account: DdnsAccount;
96
+ credentials: Record<string, string> | null;
97
+ } | null;
98
+ /**
99
+ * Every DNS account a proxy route may name, across every workspace.
100
+ *
101
+ * A route references `<workspace>/<account>`, so the picker needs all of them; the
102
+ * account itself never leaves the workspace that owns it.
103
+ */
104
+ listDnsAccounts(): ProxyDnsAccountView[];
105
+ serverViews(workspaceId?: string): ServerView[];
106
+ /**
107
+ * The running servers of every workspace *except* `except`, so one supervisor can recognize a
108
+ * sibling workspace's process as one the panel owns rather than a stranger to signal — and can
109
+ * name it when it refuses.
110
+ *
111
+ * Read from the live views rather than from nanny state: an adopted entry has no child record,
112
+ * and a persistent one's pid is the nanny's, whose tree the supervisor walks itself.
113
+ */
114
+ siblingServers(except: string): Array<{
115
+ pid: number;
116
+ workspaceId: string;
117
+ serverId: string;
118
+ }>;
119
+ getState(): AppState;
120
+ /** The sources a backup archive is built from and restored into. */
121
+ backupSources(): BackupSources;
122
+ create(input: {
123
+ id?: string;
124
+ label?: string;
125
+ }): WorkspaceView;
126
+ /**
127
+ * Registers a workspace an archive brought but this host did not have, then builds
128
+ * its runtime so the files a restore is about to write have an owner.
129
+ *
130
+ * Idempotent, and it never touches an existing workspace: a restore must fill one
131
+ * that is already here, not replace its label or its runtime.
132
+ */
133
+ ensureWorkspace(input: {
134
+ id: string;
135
+ label: string;
136
+ }): void;
137
+ rename(id: string, label: string): WorkspaceView;
138
+ /**
139
+ * Stops every entry the workspace supervises — persistent ones included, because
140
+ * deleting a workspace removes the state file its nanny would be found through —
141
+ * and then removes its directory.
142
+ */
143
+ remove(id: string): Promise<Workspace>;
144
+ /**
145
+ * Re-reads every workspace and the global settings, e.g. after a restore.
146
+ *
147
+ * `store.load()` resets the byte baseline the config watcher compares against, so the
148
+ * poll that follows sees "no change" and never reaches its autostart pass. The entries
149
+ * an archive brought therefore waited for a panel restart — which is why the start of
150
+ * newly appeared autostart entries belongs here, the one place that knows what was new.
151
+ */
152
+ /**
153
+ * Record a dump a restore staged, so this entry's next start loads it.
154
+ *
155
+ * Written to the entry's own state file rather than memory: the restore usually happens before the
156
+ * entry has ever started, and a panel restart between the two must not lose the load.
157
+ */
158
+ stagePendingLoad(workspaceId: string, serverId: string, dumpDir: string): void;
159
+ reloadAll(): void;
160
+ /**
161
+ * Applies a lowered `logs.keep` to the files already on disk, after any reload.
162
+ *
163
+ * `keep` bounds the directory, not the next rotation — and a quiet entry may not fill a file for
164
+ * days, so "I lowered it" must not mean "eventually". The HTTP settings route always did this;
165
+ * the hand-edit paths (`handleConfigChange`, `reloadAll`) reloaded the store and stopped there, so
166
+ * a `settings.json` edit left `.3`…`.5` sitting under a `keep: 2` that the same docs invite a
167
+ * person to write. One derivation, called from every path that can lower it, because pruning is
168
+ * idempotent and cheap: it is one `readdir` per workspace.
169
+ */
170
+ private pruneLogs;
171
+ /** Starts the autostart entries a reload just revealed, exactly as a hand edit would. */
172
+ private startRestored;
173
+ /** Starts whatever the config marks autostart, across every workspace. */
174
+ startAll(workspaces?: string[]): Promise<void>;
175
+ /** `withPersistent` reaches every workspace's supervisor: a `down` is host-wide. */
176
+ dispose(options?: {
177
+ withPersistent?: boolean;
178
+ }): Promise<void>;
179
+ private createRuntime;
180
+ private disposeRuntime;
181
+ private reportWorkspaceErrors;
182
+ /**
183
+ * A workspace file edited by hand is picked up without a restart. A revision
184
+ * this release cannot read is reported in the state frame, and the workspace
185
+ * keeps running what it had — a typo never stops a server.
186
+ */
187
+ private handleConfigChange;
188
+ private tick;
189
+ /** A panel-wide service changed something the state frame carries. */
190
+ notifyStateChange(): void;
191
+ /** Coalesces every signal in a turn into at most one frame. */
192
+ private scheduleState;
193
+ private publishState;
194
+ }
@@ -0,0 +1,83 @@
1
+ import type { ProxyAdminTransport } from '../providers/proxy/index.js';
2
+ import type { ProxyConfig, ProxyTlsMode } from '../shared/contracts.js';
3
+ /** One route, resolved to something the engine can actually dial. */
4
+ export interface ProxyUpstreamRoute {
5
+ host: string;
6
+ path: string;
7
+ /** `host:port` the engine forwards to. */
8
+ dial: string;
9
+ /** The upstream speaks TLS (the panel itself may), so verification is skipped. */
10
+ upstreamTls: boolean;
11
+ tls: ProxyTlsMode;
12
+ /** The handshake for this name can complete: a certificate is there or will be. */
13
+ certificateReady: boolean;
14
+ }
15
+ export interface ProxyConfigInput {
16
+ config: ProxyConfig;
17
+ admin: ProxyAdminTransport;
18
+ /** Where certificates and other engine state live; never a home directory. */
19
+ engineDir: string;
20
+ routes: ProxyUpstreamRoute[];
21
+ /** The PEM pairs `tls: "manual"` may serve, as paths on disk; the engine picks by SNI. */
22
+ manual: Array<{
23
+ certificate: string;
24
+ key: string;
25
+ }>;
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
+ */
31
+ acme: {
32
+ email: string;
33
+ staging: boolean;
34
+ subjects: string[];
35
+ };
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
+ */
45
+ dns01?: {
46
+ /** The panel's ACMEProxy endpoint, e.g. `http://127.0.0.1:3999/_acme`. */
47
+ endpoint: string;
48
+ username: string;
49
+ password: string;
50
+ /** Nameservers the engine checks the record against; empty leaves it to Caddy. */
51
+ resolvers: string[];
52
+ policies: Array<{
53
+ /** `<workspace>/<account>`, for the panel's own record of who answers. */
54
+ account: string;
55
+ /** The DNS provider, for the engine log when a challenge fails. */
56
+ provider: string;
57
+ subjects: string[];
58
+ }>;
59
+ };
60
+ }
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
+ */
66
+ export declare const FALLBACK_NAME = "hh-fallback.invalid";
67
+ /**
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.
73
+ */
74
+ export declare function boundPorts(rendered: Record<string, unknown>): number[];
75
+ /**
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.
82
+ */
83
+ export declare function renderCaddyConfig(input: ProxyConfigInput): Record<string, unknown>;