ysk-server-core 1.0.0 → 1.1.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 (594) hide show
  1. package/README.md +23 -6
  2. package/dist/db/database.d.ts +1 -1
  3. package/dist/db/database.js +1 -1
  4. package/dist/db/document-store.d.ts +6 -2
  5. package/dist/db/document-store.d.ts.map +1 -1
  6. package/dist/db/document-store.js +5 -5
  7. package/dist/db/document-store.js.map +1 -1
  8. package/dist/db/store.d.ts +31 -2
  9. package/dist/db/store.d.ts.map +1 -1
  10. package/dist/db/store.js +286 -40
  11. package/dist/db/store.js.map +1 -1
  12. package/dist/email/autodiscover.d.ts +3 -0
  13. package/dist/email/autodiscover.d.ts.map +1 -1
  14. package/dist/email/autodiscover.js +57 -17
  15. package/dist/email/autodiscover.js.map +1 -1
  16. package/dist/email/dns-records.d.ts.map +1 -1
  17. package/dist/email/dns-records.js +3 -1
  18. package/dist/email/dns-records.js.map +1 -1
  19. package/dist/email/live-checks.d.ts.map +1 -1
  20. package/dist/email/live-checks.js +13 -4
  21. package/dist/email/live-checks.js.map +1 -1
  22. package/dist/email/mail-queue.d.ts +13 -4
  23. package/dist/email/mail-queue.d.ts.map +1 -1
  24. package/dist/email/mail-queue.js +69 -14
  25. package/dist/email/mail-queue.js.map +1 -1
  26. package/dist/email/mail-tls-apply.d.ts.map +1 -1
  27. package/dist/email/mail-tls-apply.js +22 -0
  28. package/dist/email/mail-tls-apply.js.map +1 -1
  29. package/dist/files/index.d.ts +1 -0
  30. package/dist/files/index.d.ts.map +1 -1
  31. package/dist/files/index.js +1 -0
  32. package/dist/files/index.js.map +1 -1
  33. package/dist/files/manager.d.ts +25 -6
  34. package/dist/files/manager.d.ts.map +1 -1
  35. package/dist/files/manager.js +166 -33
  36. package/dist/files/manager.js.map +1 -1
  37. package/dist/files/name-conflict.d.ts +9 -0
  38. package/dist/files/name-conflict.d.ts.map +1 -0
  39. package/dist/files/name-conflict.js +36 -0
  40. package/dist/files/name-conflict.js.map +1 -0
  41. package/dist/files/shares.d.ts.map +1 -1
  42. package/dist/files/shares.js +17 -1
  43. package/dist/files/shares.js.map +1 -1
  44. package/dist/host/executor.d.ts +3 -0
  45. package/dist/host/executor.d.ts.map +1 -1
  46. package/dist/host/executor.js +169 -7
  47. package/dist/host/executor.js.map +1 -1
  48. package/dist/host-browse/browser-engine.d.ts.map +1 -1
  49. package/dist/host-browse/browser-engine.js +2 -1
  50. package/dist/host-browse/browser-engine.js.map +1 -1
  51. package/dist/host-browse/chrome-as-user.d.ts.map +1 -1
  52. package/dist/host-browse/chrome-as-user.js +2 -1
  53. package/dist/host-browse/chrome-as-user.js.map +1 -1
  54. package/dist/host-browse/chrome-path.d.ts +13 -0
  55. package/dist/host-browse/chrome-path.d.ts.map +1 -0
  56. package/dist/host-browse/chrome-path.js +76 -0
  57. package/dist/host-browse/chrome-path.js.map +1 -0
  58. package/dist/host-browse/chrome-probe.d.ts.map +1 -1
  59. package/dist/host-browse/chrome-probe.js +3 -2
  60. package/dist/host-browse/chrome-probe.js.map +1 -1
  61. package/dist/host-browse/index.d.ts +1 -0
  62. package/dist/host-browse/index.d.ts.map +1 -1
  63. package/dist/host-browse/index.js +1 -0
  64. package/dist/host-browse/index.js.map +1 -1
  65. package/dist/host-browse/ssrf.d.ts.map +1 -1
  66. package/dist/host-browse/ssrf.js +2 -2
  67. package/dist/host-browse/ssrf.js.map +1 -1
  68. package/dist/host-browse/types.d.ts.map +1 -1
  69. package/dist/host-browse/types.js +4 -3
  70. package/dist/host-browse/types.js.map +1 -1
  71. package/dist/hosting/apache/render-site.d.ts.map +1 -1
  72. package/dist/hosting/apache/render-site.js +2 -1
  73. package/dist/hosting/apache/render-site.js.map +1 -1
  74. package/dist/hosting/apache/sync.d.ts +2 -0
  75. package/dist/hosting/apache/sync.d.ts.map +1 -1
  76. package/dist/hosting/apache/sync.js +25 -0
  77. package/dist/hosting/apache/sync.js.map +1 -1
  78. package/dist/hosting/app-templates.js +1 -1
  79. package/dist/hosting/app-templates.js.map +1 -1
  80. package/dist/hosting/backup-cron.d.ts +19 -0
  81. package/dist/hosting/backup-cron.d.ts.map +1 -1
  82. package/dist/hosting/backup-cron.js +200 -35
  83. package/dist/hosting/backup-cron.js.map +1 -1
  84. package/dist/hosting/backup-remote.d.ts +17 -0
  85. package/dist/hosting/backup-remote.d.ts.map +1 -1
  86. package/dist/hosting/backup-remote.js +341 -55
  87. package/dist/hosting/backup-remote.js.map +1 -1
  88. package/dist/hosting/bt-tracker/index.d.ts +3 -0
  89. package/dist/hosting/bt-tracker/index.d.ts.map +1 -1
  90. package/dist/hosting/bt-tracker/index.js +3 -0
  91. package/dist/hosting/bt-tracker/index.js.map +1 -1
  92. package/dist/hosting/bt-tracker/library-ops.d.ts +86 -0
  93. package/dist/hosting/bt-tracker/library-ops.d.ts.map +1 -0
  94. package/dist/hosting/bt-tracker/library-ops.js +481 -0
  95. package/dist/hosting/bt-tracker/library-ops.js.map +1 -0
  96. package/dist/hosting/bt-tracker/library.d.ts +12 -0
  97. package/dist/hosting/bt-tracker/library.d.ts.map +1 -0
  98. package/dist/hosting/bt-tracker/library.js +109 -0
  99. package/dist/hosting/bt-tracker/library.js.map +1 -0
  100. package/dist/hosting/bt-tracker/restore-library.d.ts +16 -0
  101. package/dist/hosting/bt-tracker/restore-library.d.ts.map +1 -0
  102. package/dist/hosting/bt-tracker/restore-library.js +67 -0
  103. package/dist/hosting/bt-tracker/restore-library.js.map +1 -0
  104. package/dist/hosting/bt-tracker/restore-shares.d.ts.map +1 -1
  105. package/dist/hosting/bt-tracker/restore-shares.js +8 -0
  106. package/dist/hosting/bt-tracker/restore-shares.js.map +1 -1
  107. package/dist/hosting/bt-tracker/seeder.d.ts +55 -16
  108. package/dist/hosting/bt-tracker/seeder.d.ts.map +1 -1
  109. package/dist/hosting/bt-tracker/seeder.js +103 -3
  110. package/dist/hosting/bt-tracker/seeder.js.map +1 -1
  111. package/dist/hosting/bt-tracker/service.d.ts.map +1 -1
  112. package/dist/hosting/bt-tracker/service.js +28 -4
  113. package/dist/hosting/bt-tracker/service.js.map +1 -1
  114. package/dist/hosting/bt-tracker/settings.d.ts +14 -1
  115. package/dist/hosting/bt-tracker/settings.d.ts.map +1 -1
  116. package/dist/hosting/bt-tracker/settings.js +102 -3
  117. package/dist/hosting/bt-tracker/settings.js.map +1 -1
  118. package/dist/hosting/cdn/fan-out.d.ts.map +1 -1
  119. package/dist/hosting/cdn/fan-out.js +56 -31
  120. package/dist/hosting/cdn/fan-out.js.map +1 -1
  121. package/dist/hosting/cdn/from-project.d.ts +6 -0
  122. package/dist/hosting/cdn/from-project.d.ts.map +1 -1
  123. package/dist/hosting/cdn/from-project.js +55 -1
  124. package/dist/hosting/cdn/from-project.js.map +1 -1
  125. package/dist/hosting/cdn/http-probe-error.d.ts +7 -0
  126. package/dist/hosting/cdn/http-probe-error.d.ts.map +1 -0
  127. package/dist/hosting/cdn/http-probe-error.js +44 -0
  128. package/dist/hosting/cdn/http-probe-error.js.map +1 -0
  129. package/dist/hosting/cdn/nodes.d.ts +8 -0
  130. package/dist/hosting/cdn/nodes.d.ts.map +1 -1
  131. package/dist/hosting/cdn/nodes.js +69 -1
  132. package/dist/hosting/cdn/nodes.js.map +1 -1
  133. package/dist/hosting/cdn/ssl.d.ts.map +1 -1
  134. package/dist/hosting/cdn/ssl.js +3 -25
  135. package/dist/hosting/cdn/ssl.js.map +1 -1
  136. package/dist/hosting/db-cluster/apply-local.d.ts +1 -1
  137. package/dist/hosting/db-cluster/apply-local.js +7 -7
  138. package/dist/hosting/db-cluster/apply-local.js.map +1 -1
  139. package/dist/hosting/db-cluster/probe.js +1 -1
  140. package/dist/hosting/db-cluster/probe.js.map +1 -1
  141. package/dist/hosting/db-cluster/push-peer.d.ts +3 -0
  142. package/dist/hosting/db-cluster/push-peer.d.ts.map +1 -1
  143. package/dist/hosting/db-cluster/push-peer.js +41 -21
  144. package/dist/hosting/db-cluster/push-peer.js.map +1 -1
  145. package/dist/hosting/db-cluster/store.d.ts +1 -0
  146. package/dist/hosting/db-cluster/store.d.ts.map +1 -1
  147. package/dist/hosting/db-cluster/store.js +11 -0
  148. package/dist/hosting/db-cluster/store.js.map +1 -1
  149. package/dist/hosting/db-cluster/types.d.ts +1 -1
  150. package/dist/hosting/db-cluster/types.d.ts.map +1 -1
  151. package/dist/hosting/db-service-config.d.ts +1 -0
  152. package/dist/hosting/db-service-config.d.ts.map +1 -1
  153. package/dist/hosting/db-service-config.js +11 -1
  154. package/dist/hosting/db-service-config.js.map +1 -1
  155. package/dist/hosting/defense/automation.js +1 -1
  156. package/dist/hosting/defense/automation.js.map +1 -1
  157. package/dist/hosting/defense/defense-service.d.ts.map +1 -1
  158. package/dist/hosting/defense/defense-service.js +62 -39
  159. package/dist/hosting/defense/defense-service.js.map +1 -1
  160. package/dist/hosting/defense/geoip/index.d.ts.map +1 -1
  161. package/dist/hosting/defense/geoip/index.js +9 -7
  162. package/dist/hosting/defense/geoip/index.js.map +1 -1
  163. package/dist/hosting/defense/presets.js +2 -2
  164. package/dist/hosting/defense/presets.js.map +1 -1
  165. package/dist/hosting/defense/signals.d.ts +5 -0
  166. package/dist/hosting/defense/signals.d.ts.map +1 -1
  167. package/dist/hosting/defense/signals.js +26 -10
  168. package/dist/hosting/defense/signals.js.map +1 -1
  169. package/dist/hosting/defense/types.d.ts +2 -0
  170. package/dist/hosting/defense/types.d.ts.map +1 -1
  171. package/dist/hosting/dns-health.d.ts.map +1 -1
  172. package/dist/hosting/dns-health.js +26 -20
  173. package/dist/hosting/dns-health.js.map +1 -1
  174. package/dist/hosting/dns-zone.d.ts +18 -0
  175. package/dist/hosting/dns-zone.d.ts.map +1 -1
  176. package/dist/hosting/dns-zone.js +59 -0
  177. package/dist/hosting/dns-zone.js.map +1 -1
  178. package/dist/hosting/docker/argv.d.ts +10 -0
  179. package/dist/hosting/docker/argv.d.ts.map +1 -0
  180. package/dist/hosting/docker/argv.js +274 -0
  181. package/dist/hosting/docker/argv.js.map +1 -0
  182. package/dist/hosting/docker/daemon.d.ts +27 -0
  183. package/dist/hosting/docker/daemon.d.ts.map +1 -0
  184. package/dist/hosting/docker/daemon.js +125 -0
  185. package/dist/hosting/docker/daemon.js.map +1 -0
  186. package/dist/hosting/docker/honesty.d.ts +27 -0
  187. package/dist/hosting/docker/honesty.d.ts.map +1 -0
  188. package/dist/hosting/docker/honesty.js +50 -0
  189. package/dist/hosting/docker/honesty.js.map +1 -0
  190. package/dist/hosting/docker/index.d.ts +6 -0
  191. package/dist/hosting/docker/index.d.ts.map +1 -0
  192. package/dist/hosting/docker/index.js +6 -0
  193. package/dist/hosting/docker/index.js.map +1 -0
  194. package/dist/hosting/docker/manager.d.ts +131 -0
  195. package/dist/hosting/docker/manager.d.ts.map +1 -0
  196. package/dist/hosting/docker/manager.js +681 -0
  197. package/dist/hosting/docker/manager.js.map +1 -0
  198. package/dist/hosting/docker/parse.d.ts +21 -0
  199. package/dist/hosting/docker/parse.d.ts.map +1 -0
  200. package/dist/hosting/docker/parse.js +185 -0
  201. package/dist/hosting/docker/parse.js.map +1 -0
  202. package/dist/hosting/extras.d.ts.map +1 -1
  203. package/dist/hosting/extras.js +7 -1
  204. package/dist/hosting/extras.js.map +1 -1
  205. package/dist/hosting/fail2ban-ops.d.ts +2 -0
  206. package/dist/hosting/fail2ban-ops.d.ts.map +1 -1
  207. package/dist/hosting/fail2ban-ops.js +11 -9
  208. package/dist/hosting/fail2ban-ops.js.map +1 -1
  209. package/dist/hosting/firewall-ops.d.ts +4 -0
  210. package/dist/hosting/firewall-ops.d.ts.map +1 -1
  211. package/dist/hosting/firewall-ops.js +43 -2
  212. package/dist/hosting/firewall-ops.js.map +1 -1
  213. package/dist/hosting/ftps-service.d.ts +14 -0
  214. package/dist/hosting/ftps-service.d.ts.map +1 -1
  215. package/dist/hosting/ftps-service.js +78 -11
  216. package/dist/hosting/ftps-service.js.map +1 -1
  217. package/dist/hosting/git-auth.d.ts +77 -0
  218. package/dist/hosting/git-auth.d.ts.map +1 -0
  219. package/dist/hosting/git-auth.js +314 -0
  220. package/dist/hosting/git-auth.js.map +1 -0
  221. package/dist/hosting/git-control.d.ts +110 -0
  222. package/dist/hosting/git-control.d.ts.map +1 -0
  223. package/dist/hosting/git-control.js +333 -0
  224. package/dist/hosting/git-control.js.map +1 -0
  225. package/dist/hosting/git-deploy.d.ts +2 -0
  226. package/dist/hosting/git-deploy.d.ts.map +1 -1
  227. package/dist/hosting/git-deploy.js +50 -7
  228. package/dist/hosting/git-deploy.js.map +1 -1
  229. package/dist/hosting/git-errors.d.ts +7 -0
  230. package/dist/hosting/git-errors.d.ts.map +1 -0
  231. package/dist/hosting/git-errors.js +45 -0
  232. package/dist/hosting/git-errors.js.map +1 -0
  233. package/dist/hosting/git-hook.d.ts +33 -0
  234. package/dist/hosting/git-hook.d.ts.map +1 -0
  235. package/dist/hosting/git-hook.js +174 -0
  236. package/dist/hosting/git-hook.js.map +1 -0
  237. package/dist/hosting/global-search.d.ts.map +1 -1
  238. package/dist/hosting/global-search.js +22 -4
  239. package/dist/hosting/global-search.js.map +1 -1
  240. package/dist/hosting/host-migrate/bootstrap-target.d.ts +1 -1
  241. package/dist/hosting/host-migrate/bootstrap-target.js +6 -6
  242. package/dist/hosting/host-migrate/bootstrap-target.js.map +1 -1
  243. package/dist/hosting/host-migrate/index.d.ts +1 -0
  244. package/dist/hosting/host-migrate/index.d.ts.map +1 -1
  245. package/dist/hosting/host-migrate/index.js +1 -0
  246. package/dist/hosting/host-migrate/index.js.map +1 -1
  247. package/dist/hosting/host-migrate/inventory.d.ts.map +1 -1
  248. package/dist/hosting/host-migrate/inventory.js +13 -0
  249. package/dist/hosting/host-migrate/inventory.js.map +1 -1
  250. package/dist/hosting/host-migrate/orphan-homes.d.ts +19 -0
  251. package/dist/hosting/host-migrate/orphan-homes.d.ts.map +1 -0
  252. package/dist/hosting/host-migrate/orphan-homes.js +46 -0
  253. package/dist/hosting/host-migrate/orphan-homes.js.map +1 -0
  254. package/dist/hosting/host-migrate/temp-key.d.ts.map +1 -1
  255. package/dist/hosting/host-migrate/temp-key.js +7 -1
  256. package/dist/hosting/host-migrate/temp-key.js.map +1 -1
  257. package/dist/hosting/index.d.ts +9 -0
  258. package/dist/hosting/index.d.ts.map +1 -1
  259. package/dist/hosting/index.js +9 -0
  260. package/dist/hosting/index.js.map +1 -1
  261. package/dist/hosting/leftover-apply.d.ts +18 -0
  262. package/dist/hosting/leftover-apply.d.ts.map +1 -0
  263. package/dist/hosting/leftover-apply.js +90 -0
  264. package/dist/hosting/leftover-apply.js.map +1 -0
  265. package/dist/hosting/leftover-probe.d.ts +38 -0
  266. package/dist/hosting/leftover-probe.d.ts.map +1 -0
  267. package/dist/hosting/leftover-probe.js +162 -0
  268. package/dist/hosting/leftover-probe.js.map +1 -0
  269. package/dist/hosting/log-center/catalog.d.ts.map +1 -1
  270. package/dist/hosting/log-center/catalog.js +9 -0
  271. package/dist/hosting/log-center/catalog.js.map +1 -1
  272. package/dist/hosting/log-center/journal.d.ts.map +1 -1
  273. package/dist/hosting/log-center/journal.js +3 -0
  274. package/dist/hosting/log-center/journal.js.map +1 -1
  275. package/dist/hosting/managed-resources.d.ts.map +1 -1
  276. package/dist/hosting/managed-resources.js +18 -2
  277. package/dist/hosting/managed-resources.js.map +1 -1
  278. package/dist/hosting/nginx-sites-list.d.ts.map +1 -1
  279. package/dist/hosting/nginx-sites-list.js +39 -3
  280. package/dist/hosting/nginx-sites-list.js.map +1 -1
  281. package/dist/hosting/nginx-ssl.d.ts +4 -0
  282. package/dist/hosting/nginx-ssl.d.ts.map +1 -1
  283. package/dist/hosting/nginx-ssl.js +52 -7
  284. package/dist/hosting/nginx-ssl.js.map +1 -1
  285. package/dist/hosting/nginx-sync.d.ts +33 -0
  286. package/dist/hosting/nginx-sync.d.ts.map +1 -1
  287. package/dist/hosting/nginx-sync.js +258 -11
  288. package/dist/hosting/nginx-sync.js.map +1 -1
  289. package/dist/hosting/ops-log.d.ts +23 -0
  290. package/dist/hosting/ops-log.d.ts.map +1 -0
  291. package/dist/hosting/ops-log.js +15 -0
  292. package/dist/hosting/ops-log.js.map +1 -0
  293. package/dist/hosting/panel-tls.d.ts +9 -0
  294. package/dist/hosting/panel-tls.d.ts.map +1 -1
  295. package/dist/hosting/panel-tls.js +50 -2
  296. package/dist/hosting/panel-tls.js.map +1 -1
  297. package/dist/hosting/pm2-apply.d.ts.map +1 -1
  298. package/dist/hosting/pm2-apply.js +9 -2
  299. package/dist/hosting/pm2-apply.js.map +1 -1
  300. package/dist/hosting/postgres-provision.d.ts.map +1 -1
  301. package/dist/hosting/postgres-provision.js +43 -19
  302. package/dist/hosting/postgres-provision.js.map +1 -1
  303. package/dist/hosting/production-readiness.d.ts.map +1 -1
  304. package/dist/hosting/production-readiness.js +67 -10
  305. package/dist/hosting/production-readiness.js.map +1 -1
  306. package/dist/hosting/project-create-extras.d.ts +37 -0
  307. package/dist/hosting/project-create-extras.d.ts.map +1 -0
  308. package/dist/hosting/project-create-extras.js +47 -0
  309. package/dist/hosting/project-create-extras.js.map +1 -0
  310. package/dist/hosting/project-isolation-status.d.ts.map +1 -1
  311. package/dist/hosting/project-isolation-status.js +10 -2
  312. package/dist/hosting/project-isolation-status.js.map +1 -1
  313. package/dist/hosting/project-ops.d.ts +67 -0
  314. package/dist/hosting/project-ops.d.ts.map +1 -1
  315. package/dist/hosting/project-ops.js +377 -7
  316. package/dist/hosting/project-ops.js.map +1 -1
  317. package/dist/hosting/project-service.d.ts +3 -0
  318. package/dist/hosting/project-service.d.ts.map +1 -1
  319. package/dist/hosting/project-service.js +9 -0
  320. package/dist/hosting/project-service.js.map +1 -1
  321. package/dist/hosting/public-files.d.ts +4 -0
  322. package/dist/hosting/public-files.d.ts.map +1 -1
  323. package/dist/hosting/public-files.js +46 -7
  324. package/dist/hosting/public-files.js.map +1 -1
  325. package/dist/hosting/rebuild.d.ts.map +1 -1
  326. package/dist/hosting/rebuild.js +10 -2
  327. package/dist/hosting/rebuild.js.map +1 -1
  328. package/dist/hosting/runtime-probe.d.ts +7 -0
  329. package/dist/hosting/runtime-probe.d.ts.map +1 -1
  330. package/dist/hosting/runtime-probe.js +74 -7
  331. package/dist/hosting/runtime-probe.js.map +1 -1
  332. package/dist/hosting/runtime.d.ts.map +1 -1
  333. package/dist/hosting/runtime.js +5 -3
  334. package/dist/hosting/runtime.js.map +1 -1
  335. package/dist/hosting/service-catalog/redis.d.ts.map +1 -1
  336. package/dist/hosting/service-catalog/redis.js +2 -1
  337. package/dist/hosting/service-catalog/redis.js.map +1 -1
  338. package/dist/hosting/service-console.d.ts.map +1 -1
  339. package/dist/hosting/service-console.js +2 -1
  340. package/dist/hosting/service-console.js.map +1 -1
  341. package/dist/hosting/service-matrix.d.ts +1 -1
  342. package/dist/hosting/service-matrix.d.ts.map +1 -1
  343. package/dist/hosting/service-matrix.js +24 -1
  344. package/dist/hosting/service-matrix.js.map +1 -1
  345. package/dist/hosting/sftp-keys.d.ts.map +1 -1
  346. package/dist/hosting/sftp-keys.js +2 -1
  347. package/dist/hosting/sftp-keys.js.map +1 -1
  348. package/dist/hosting/software-catalog.d.ts +2 -2
  349. package/dist/hosting/software-catalog.d.ts.map +1 -1
  350. package/dist/hosting/software-catalog.js +12 -2
  351. package/dist/hosting/software-catalog.js.map +1 -1
  352. package/dist/hosting/software-probe/HostSoftwareProbe.d.ts.map +1 -1
  353. package/dist/hosting/software-probe/HostSoftwareProbe.js +4 -0
  354. package/dist/hosting/software-probe/HostSoftwareProbe.js.map +1 -1
  355. package/dist/hosting/software-probe/registry.d.ts.map +1 -1
  356. package/dist/hosting/software-probe/registry.js +13 -0
  357. package/dist/hosting/software-probe/registry.js.map +1 -1
  358. package/dist/hosting/software-uninstall.d.ts.map +1 -1
  359. package/dist/hosting/software-uninstall.js +22 -0
  360. package/dist/hosting/software-uninstall.js.map +1 -1
  361. package/dist/hosting/sql-engine-switch/migrate.d.ts.map +1 -1
  362. package/dist/hosting/sql-engine-switch/migrate.js +62 -5
  363. package/dist/hosting/sql-engine-switch/migrate.js.map +1 -1
  364. package/dist/hosting/sql-engine-switch/preview.d.ts +9 -0
  365. package/dist/hosting/sql-engine-switch/preview.d.ts.map +1 -1
  366. package/dist/hosting/sql-engine-switch/preview.js +48 -0
  367. package/dist/hosting/sql-engine-switch/preview.js.map +1 -1
  368. package/dist/hosting/ssl-certs.js +1 -1
  369. package/dist/hosting/ssl-certs.js.map +1 -1
  370. package/dist/hosting/stack/definitions.js +1 -1
  371. package/dist/hosting/stack/definitions.js.map +1 -1
  372. package/dist/hosting/system-apply.d.ts.map +1 -1
  373. package/dist/hosting/system-apply.js +16 -6
  374. package/dist/hosting/system-apply.js.map +1 -1
  375. package/dist/hosting/temp-db-user.d.ts +10 -0
  376. package/dist/hosting/temp-db-user.d.ts.map +1 -1
  377. package/dist/hosting/temp-db-user.js +31 -0
  378. package/dist/hosting/temp-db-user.js.map +1 -1
  379. package/dist/hosting/validators/adapters/ada.d.ts +16 -0
  380. package/dist/hosting/validators/adapters/ada.d.ts.map +1 -0
  381. package/dist/hosting/validators/adapters/ada.js +72 -0
  382. package/dist/hosting/validators/adapters/ada.js.map +1 -0
  383. package/dist/hosting/validators/adapters/avax.d.ts +17 -0
  384. package/dist/hosting/validators/adapters/avax.d.ts.map +1 -0
  385. package/dist/hosting/validators/adapters/avax.js +67 -0
  386. package/dist/hosting/validators/adapters/avax.js.map +1 -0
  387. package/dist/hosting/validators/adapters/base.d.ts +61 -0
  388. package/dist/hosting/validators/adapters/base.d.ts.map +1 -0
  389. package/dist/hosting/validators/adapters/base.js +4 -0
  390. package/dist/hosting/validators/adapters/base.js.map +1 -0
  391. package/dist/hosting/validators/adapters/eth-clients.d.ts +16 -0
  392. package/dist/hosting/validators/adapters/eth-clients.d.ts.map +1 -0
  393. package/dist/hosting/validators/adapters/eth-clients.js +247 -0
  394. package/dist/hosting/validators/adapters/eth-clients.js.map +1 -0
  395. package/dist/hosting/validators/adapters/eth.d.ts +18 -0
  396. package/dist/hosting/validators/adapters/eth.d.ts.map +1 -0
  397. package/dist/hosting/validators/adapters/eth.js +102 -0
  398. package/dist/hosting/validators/adapters/eth.js.map +1 -0
  399. package/dist/hosting/validators/adapters/index.d.ts +5 -0
  400. package/dist/hosting/validators/adapters/index.d.ts.map +1 -0
  401. package/dist/hosting/validators/adapters/index.js +39 -0
  402. package/dist/hosting/validators/adapters/index.js.map +1 -0
  403. package/dist/hosting/validators/adapters/near.d.ts +15 -0
  404. package/dist/hosting/validators/adapters/near.d.ts.map +1 -0
  405. package/dist/hosting/validators/adapters/near.js +72 -0
  406. package/dist/hosting/validators/adapters/near.js.map +1 -0
  407. package/dist/hosting/validators/adapters/phase2.d.ts +33 -0
  408. package/dist/hosting/validators/adapters/phase2.d.ts.map +1 -0
  409. package/dist/hosting/validators/adapters/phase2.js +294 -0
  410. package/dist/hosting/validators/adapters/phase2.js.map +1 -0
  411. package/dist/hosting/validators/compose-runner.d.ts +80 -0
  412. package/dist/hosting/validators/compose-runner.d.ts.map +1 -0
  413. package/dist/hosting/validators/compose-runner.js +158 -0
  414. package/dist/hosting/validators/compose-runner.js.map +1 -0
  415. package/dist/hosting/validators/disk.d.ts +20 -0
  416. package/dist/hosting/validators/disk.d.ts.map +1 -0
  417. package/dist/hosting/validators/disk.js +106 -0
  418. package/dist/hosting/validators/disk.js.map +1 -0
  419. package/dist/hosting/validators/extras.d.ts +77 -0
  420. package/dist/hosting/validators/extras.d.ts.map +1 -0
  421. package/dist/hosting/validators/extras.js +370 -0
  422. package/dist/hosting/validators/extras.js.map +1 -0
  423. package/dist/hosting/validators/health.d.ts +21 -0
  424. package/dist/hosting/validators/health.d.ts.map +1 -0
  425. package/dist/hosting/validators/health.js +65 -0
  426. package/dist/hosting/validators/health.js.map +1 -0
  427. package/dist/hosting/validators/honesty.d.ts +33 -0
  428. package/dist/hosting/validators/honesty.d.ts.map +1 -0
  429. package/dist/hosting/validators/honesty.js +54 -0
  430. package/dist/hosting/validators/honesty.js.map +1 -0
  431. package/dist/hosting/validators/index.d.ts +24 -0
  432. package/dist/hosting/validators/index.d.ts.map +1 -0
  433. package/dist/hosting/validators/index.js +24 -0
  434. package/dist/hosting/validators/index.js.map +1 -0
  435. package/dist/hosting/validators/manager.d.ts +77 -0
  436. package/dist/hosting/validators/manager.d.ts.map +1 -0
  437. package/dist/hosting/validators/manager.js +447 -0
  438. package/dist/hosting/validators/manager.js.map +1 -0
  439. package/dist/hosting/validators/mithril.d.ts +30 -0
  440. package/dist/hosting/validators/mithril.d.ts.map +1 -0
  441. package/dist/hosting/validators/mithril.js +146 -0
  442. package/dist/hosting/validators/mithril.js.map +1 -0
  443. package/dist/hosting/validators/native-prune.d.ts +12 -0
  444. package/dist/hosting/validators/native-prune.d.ts.map +1 -0
  445. package/dist/hosting/validators/native-prune.js +40 -0
  446. package/dist/hosting/validators/native-prune.js.map +1 -0
  447. package/dist/hosting/validators/ports.d.ts +7 -0
  448. package/dist/hosting/validators/ports.d.ts.map +1 -0
  449. package/dist/hosting/validators/ports.js +75 -0
  450. package/dist/hosting/validators/ports.js.map +1 -0
  451. package/dist/hosting/validators/registry.d.ts +22 -0
  452. package/dist/hosting/validators/registry.d.ts.map +1 -0
  453. package/dist/hosting/validators/registry.js +311 -0
  454. package/dist/hosting/validators/registry.js.map +1 -0
  455. package/dist/hosting/validators/releases.d.ts +30 -0
  456. package/dist/hosting/validators/releases.d.ts.map +1 -0
  457. package/dist/hosting/validators/releases.js +149 -0
  458. package/dist/hosting/validators/releases.js.map +1 -0
  459. package/dist/hosting/validators/settings.d.ts +4 -0
  460. package/dist/hosting/validators/settings.d.ts.map +1 -0
  461. package/dist/hosting/validators/settings.js +28 -0
  462. package/dist/hosting/validators/settings.js.map +1 -0
  463. package/dist/hosting/validators/snapshots.d.ts +40 -0
  464. package/dist/hosting/validators/snapshots.d.ts.map +1 -0
  465. package/dist/hosting/validators/snapshots.js +221 -0
  466. package/dist/hosting/validators/snapshots.js.map +1 -0
  467. package/dist/hosting/validators/store.d.ts +29 -0
  468. package/dist/hosting/validators/store.d.ts.map +1 -0
  469. package/dist/hosting/validators/store.js +186 -0
  470. package/dist/hosting/validators/store.js.map +1 -0
  471. package/dist/hosting/validators/upgrade.d.ts +35 -0
  472. package/dist/hosting/validators/upgrade.d.ts.map +1 -0
  473. package/dist/hosting/validators/upgrade.js +251 -0
  474. package/dist/hosting/validators/upgrade.js.map +1 -0
  475. package/dist/hosting/validators/versions.d.ts +9 -0
  476. package/dist/hosting/validators/versions.d.ts.map +1 -0
  477. package/dist/hosting/validators/versions.js +20 -0
  478. package/dist/hosting/validators/versions.js.map +1 -0
  479. package/dist/hosting/version-discovery.d.ts.map +1 -1
  480. package/dist/hosting/version-discovery.js +15 -6
  481. package/dist/hosting/version-discovery.js.map +1 -1
  482. package/dist/hosting/vnc/client-profiles.d.ts.map +1 -1
  483. package/dist/hosting/vnc/client-profiles.js +12 -6
  484. package/dist/hosting/vnc/client-profiles.js.map +1 -1
  485. package/dist/hosting/vnc/passwd.d.ts.map +1 -1
  486. package/dist/hosting/vnc/passwd.js +14 -3
  487. package/dist/hosting/vnc/passwd.js.map +1 -1
  488. package/dist/hosting/vnc/server-session.d.ts.map +1 -1
  489. package/dist/hosting/vnc/server-session.js +5 -0
  490. package/dist/hosting/vnc/server-session.js.map +1 -1
  491. package/dist/hosting/vnc/service.d.ts +1 -0
  492. package/dist/hosting/vnc/service.d.ts.map +1 -1
  493. package/dist/hosting/vnc/service.js +48 -9
  494. package/dist/hosting/vnc/service.js.map +1 -1
  495. package/dist/hosting/vnc/types.d.ts +5 -0
  496. package/dist/hosting/vnc/types.d.ts.map +1 -1
  497. package/dist/hosting/vnc/types.js +22 -0
  498. package/dist/hosting/vnc/types.js.map +1 -1
  499. package/dist/hosting/vpn/client-conf-protect.d.ts +5 -0
  500. package/dist/hosting/vpn/client-conf-protect.d.ts.map +1 -1
  501. package/dist/hosting/vpn/client-conf-protect.js +15 -0
  502. package/dist/hosting/vpn/client-conf-protect.js.map +1 -1
  503. package/dist/hosting/vpn/openvpn-ops.d.ts.map +1 -1
  504. package/dist/hosting/vpn/openvpn-ops.js +13 -3
  505. package/dist/hosting/vpn/openvpn-ops.js.map +1 -1
  506. package/dist/hosting/vpn/outline-ops.d.ts.map +1 -1
  507. package/dist/hosting/vpn/outline-ops.js +7 -3
  508. package/dist/hosting/vpn/outline-ops.js.map +1 -1
  509. package/dist/hosting/vpn/ports.d.ts +3 -0
  510. package/dist/hosting/vpn/ports.d.ts.map +1 -1
  511. package/dist/hosting/vpn/ports.js +8 -0
  512. package/dist/hosting/vpn/ports.js.map +1 -1
  513. package/dist/hosting/vpn/service.d.ts +11 -0
  514. package/dist/hosting/vpn/service.d.ts.map +1 -1
  515. package/dist/hosting/vpn/service.js +102 -27
  516. package/dist/hosting/vpn/service.js.map +1 -1
  517. package/dist/hosting/web-stats.d.ts.map +1 -1
  518. package/dist/hosting/web-stats.js +0 -1
  519. package/dist/hosting/web-stats.js.map +1 -1
  520. package/dist/hosting/wizard.d.ts.map +1 -1
  521. package/dist/hosting/wizard.js +53 -63
  522. package/dist/hosting/wizard.js.map +1 -1
  523. package/dist/llm/http-transport.d.ts.map +1 -1
  524. package/dist/llm/http-transport.js +11 -3
  525. package/dist/llm/http-transport.js.map +1 -1
  526. package/dist/monitoring/notifications.d.ts.map +1 -1
  527. package/dist/monitoring/notifications.js +86 -0
  528. package/dist/monitoring/notifications.js.map +1 -1
  529. package/dist/monitoring/process-snapshot.d.ts +2 -0
  530. package/dist/monitoring/process-snapshot.d.ts.map +1 -1
  531. package/dist/monitoring/process-snapshot.js +14 -2
  532. package/dist/monitoring/process-snapshot.js.map +1 -1
  533. package/dist/net/ssrf.d.ts +6 -0
  534. package/dist/net/ssrf.d.ts.map +1 -1
  535. package/dist/net/ssrf.js +80 -15
  536. package/dist/net/ssrf.js.map +1 -1
  537. package/dist/repositories/project-repo.d.ts +1 -1
  538. package/dist/repositories/project-repo.d.ts.map +1 -1
  539. package/dist/repositories/project-repo.js +12 -0
  540. package/dist/repositories/project-repo.js.map +1 -1
  541. package/dist/repositories/settings-repo.d.ts.map +1 -1
  542. package/dist/repositories/settings-repo.js +6 -1
  543. package/dist/repositories/settings-repo.js.map +1 -1
  544. package/dist/security/mfa/rate-limit.d.ts +11 -0
  545. package/dist/security/mfa/rate-limit.d.ts.map +1 -1
  546. package/dist/security/mfa/rate-limit.js +18 -0
  547. package/dist/security/mfa/rate-limit.js.map +1 -1
  548. package/dist/security/mfa/webauthn.d.ts +5 -0
  549. package/dist/security/mfa/webauthn.d.ts.map +1 -1
  550. package/dist/security/mfa/webauthn.js +13 -4
  551. package/dist/security/mfa/webauthn.js.map +1 -1
  552. package/dist/security/ssh-identity/install.d.ts.map +1 -1
  553. package/dist/security/ssh-identity/install.js +12 -0
  554. package/dist/security/ssh-identity/install.js.map +1 -1
  555. package/dist/security/ssh-identity/ops.d.ts +16 -0
  556. package/dist/security/ssh-identity/ops.d.ts.map +1 -1
  557. package/dist/security/ssh-identity/ops.js +73 -3
  558. package/dist/security/ssh-identity/ops.js.map +1 -1
  559. package/dist/services/auth.d.ts +9 -0
  560. package/dist/services/auth.d.ts.map +1 -1
  561. package/dist/services/auth.js +27 -9
  562. package/dist/services/auth.js.map +1 -1
  563. package/dist/services/protection-probe.d.ts.map +1 -1
  564. package/dist/services/protection-probe.js +7 -5
  565. package/dist/services/protection-probe.js.map +1 -1
  566. package/dist/services/scheduler.d.ts +5 -0
  567. package/dist/services/scheduler.d.ts.map +1 -1
  568. package/dist/services/scheduler.js +11 -0
  569. package/dist/services/scheduler.js.map +1 -1
  570. package/dist/services/users-admin.d.ts +1 -0
  571. package/dist/services/users-admin.d.ts.map +1 -1
  572. package/dist/services/users-admin.js +42 -4
  573. package/dist/services/users-admin.js.map +1 -1
  574. package/dist/update/index.d.ts +2 -0
  575. package/dist/update/index.d.ts.map +1 -1
  576. package/dist/update/index.js +2 -0
  577. package/dist/update/index.js.map +1 -1
  578. package/dist/update/inventory.d.ts +2 -0
  579. package/dist/update/inventory.d.ts.map +1 -1
  580. package/dist/update/inventory.js +13 -5
  581. package/dist/update/inventory.js.map +1 -1
  582. package/dist/update/self-update-apply.d.ts +51 -0
  583. package/dist/update/self-update-apply.d.ts.map +1 -1
  584. package/dist/update/self-update-apply.js +246 -63
  585. package/dist/update/self-update-apply.js.map +1 -1
  586. package/dist/update/self-update-overlay.d.ts +49 -0
  587. package/dist/update/self-update-overlay.d.ts.map +1 -0
  588. package/dist/update/self-update-overlay.js +343 -0
  589. package/dist/update/self-update-overlay.js.map +1 -0
  590. package/dist/update/update-hub.d.ts +45 -0
  591. package/dist/update/update-hub.d.ts.map +1 -0
  592. package/dist/update/update-hub.js +217 -0
  593. package/dist/update/update-hub.js.map +1 -0
  594. package/package.json +2 -4
@@ -0,0 +1,681 @@
1
+ /**
2
+ * Docker engine manager — inventory + honesty-gated mutations via HostExecutor.
3
+ */
4
+ import { existsSync, readdirSync } from 'node:fs';
5
+ import { join } from 'node:path';
6
+ import { isSafeDockerImageRef, isSafeDockerName, isSafeVolumeDest, isDockerPruneScope, isDockerRestartPolicy, tl, validatorIdFromComposeProject, } from 'ysk-server-shared';
7
+ import { runOpts } from '../ops-log.js';
8
+ import { classifyDockerArgv } from './argv.js';
9
+ import { applyDaemonPatch, readDaemonSettings, writeDaemonSettings, } from './daemon.js';
10
+ import { appliedDockerOp, blockedDockerOp, failedDockerOp, writtenDockerOp, } from './honesty.js';
11
+ import { parseComposeLs, parseContainers, parseDockerInfo, parseImages, parseNetworks, parseSystemDf, parseVolumes, } from './parse.js';
12
+ import { composeFilePath, composeProjectName } from '../validators/compose-runner.js';
13
+ import { listValidatorInstances } from '../validators/store.js';
14
+ async function docker(host, argv, opts) {
15
+ const cls = classifyDockerArgv(['docker', ...argv]);
16
+ if (cls === 'blocked') {
17
+ return { exitCode: 2, stdout: '', stderr: 'blocked docker argv', argv: ['docker', ...argv] };
18
+ }
19
+ try {
20
+ const r = await host.runCommand(['docker', ...argv], {
21
+ ...runOpts({
22
+ execute: opts?.dryRun === true ? false : true,
23
+ timeoutMs: opts?.timeoutMs ?? 30_000,
24
+ onLog: opts?.onLog,
25
+ signal: opts?.signal,
26
+ }),
27
+ dryRun: opts?.dryRun,
28
+ });
29
+ return { exitCode: r.exitCode, stdout: r.stdout, stderr: r.stderr, argv: ['docker', ...argv] };
30
+ }
31
+ catch (e) {
32
+ return {
33
+ exitCode: 1,
34
+ stdout: '',
35
+ stderr: e instanceof Error ? e.message : 'docker command failed',
36
+ argv: ['docker', ...argv],
37
+ };
38
+ }
39
+ }
40
+ export async function probeDockerEngine(host) {
41
+ const notes = [];
42
+ let version = null;
43
+ let composeVersion = null;
44
+ let installed = false;
45
+ let daemonActive = false;
46
+ let composeAvailable = false;
47
+ try {
48
+ const ver = await docker(host, ['version', '--format', '{{.Client.Version}}'], { timeoutMs: 4_000 });
49
+ if (ver.exitCode === 0 && ver.stdout.trim()) {
50
+ installed = true;
51
+ version = ver.stdout.trim().split('\n')[0] ?? null;
52
+ }
53
+ else {
54
+ notes.push(ver.stderr.trim() || tl('docker.errors.notInstalled'));
55
+ }
56
+ }
57
+ catch (e) {
58
+ notes.push(e instanceof Error ? e.message : tl('docker.errors.notInstalled'));
59
+ }
60
+ if (installed) {
61
+ try {
62
+ const info = await docker(host, ['info', '--format', '{{.ServerVersion}}'], { timeoutMs: 8_000 });
63
+ daemonActive = info.exitCode === 0 && Boolean(info.stdout.trim());
64
+ if (!daemonActive)
65
+ notes.push(tl('docker.errors.daemonDown'));
66
+ }
67
+ catch {
68
+ notes.push(tl('docker.errors.daemonDown'));
69
+ }
70
+ try {
71
+ const cv = await docker(host, ['compose', 'version'], { timeoutMs: 8_000 });
72
+ composeAvailable = cv.exitCode === 0;
73
+ composeVersion = composeAvailable ? cv.stdout.trim().split('\n')[0] ?? null : null;
74
+ if (!composeAvailable)
75
+ notes.push(tl('docker.errors.needCompose'));
76
+ }
77
+ catch {
78
+ notes.push(tl('docker.errors.needCompose'));
79
+ }
80
+ }
81
+ return { installed, daemonActive, composeAvailable, version, composeVersion, notes };
82
+ }
83
+ function scanValidatorCompose(dataDir) {
84
+ const root = join(dataDir, 'validators');
85
+ if (!existsSync(root))
86
+ return [];
87
+ const out = [];
88
+ for (const inst of listValidatorInstances(dataDir)) {
89
+ const file = composeFilePath(join(root, inst.id));
90
+ out.push({
91
+ name: composeProjectName(inst.id),
92
+ status: existsSync(file) ? 'configured' : 'missing',
93
+ configFiles: existsSync(file) ? file : '',
94
+ yskManaged: true,
95
+ validatorId: inst.id,
96
+ });
97
+ }
98
+ try {
99
+ for (const name of readdirSync(root)) {
100
+ const file = composeFilePath(join(root, name));
101
+ if (!existsSync(file))
102
+ continue;
103
+ if (out.some((p) => p.validatorId === name))
104
+ continue;
105
+ out.push({
106
+ name: composeProjectName(name),
107
+ status: 'configured',
108
+ configFiles: file,
109
+ yskManaged: true,
110
+ validatorId: name,
111
+ });
112
+ }
113
+ }
114
+ catch {
115
+ /* ignore */
116
+ }
117
+ return out;
118
+ }
119
+ export async function dockerEngineStatus(input) {
120
+ const probe = await probeDockerEngine(input.host);
121
+ const validatorProjects = listValidatorInstances(input.dataDir).length;
122
+ const empty = {
123
+ ...probe,
124
+ dataRoot: null,
125
+ rootless: false,
126
+ cgroupDriver: null,
127
+ counts: { containers: 0, running: 0, images: 0, volumes: 0, networks: 0 },
128
+ disk: { dataRoot: null, usedBytes: null, availBytes: null, usePct: null },
129
+ validatorProjects,
130
+ };
131
+ if (!probe.installed || !probe.daemonActive)
132
+ return empty;
133
+ try {
134
+ const infoRaw = await docker(input.host, ['info', '--format', '{{json .}}'], { timeoutMs: 12_000 });
135
+ const info = parseDockerInfo(infoRaw.stdout);
136
+ const vols = await listDockerVolumes({ host: input.host });
137
+ const nets = await listDockerNetworks({ host: input.host });
138
+ let disk = { dataRoot: info.dataRoot, usedBytes: null, availBytes: null, usePct: null };
139
+ if (info.dataRoot) {
140
+ try {
141
+ const { parseDfBytes, pickMountForPath } = await import('../validators/disk.js');
142
+ const df = await input.host.runCommand(['df', '-B1', '-T', info.dataRoot], { timeoutMs: 8_000 });
143
+ const mount = pickMountForPath(parseDfBytes(df.stdout), info.dataRoot);
144
+ if (mount) {
145
+ disk = {
146
+ dataRoot: info.dataRoot,
147
+ usedBytes: mount.usedBytes,
148
+ availBytes: mount.availBytes,
149
+ usePct: mount.usePct,
150
+ };
151
+ }
152
+ }
153
+ catch {
154
+ /* leave nulls */
155
+ }
156
+ }
157
+ return {
158
+ ...probe,
159
+ version: info.version ?? probe.version,
160
+ dataRoot: info.dataRoot,
161
+ rootless: info.rootless,
162
+ cgroupDriver: info.cgroupDriver,
163
+ counts: {
164
+ containers: info.containers,
165
+ running: info.running,
166
+ images: info.images,
167
+ volumes: vols.length,
168
+ networks: nets.length,
169
+ },
170
+ disk,
171
+ validatorProjects,
172
+ };
173
+ }
174
+ catch (e) {
175
+ return {
176
+ ...empty,
177
+ notes: [...probe.notes, e instanceof Error ? e.message : 'docker info failed'],
178
+ };
179
+ }
180
+ }
181
+ export async function listDockerContainers(input) {
182
+ const argv = ['ps', '--format', '{{json .}}'];
183
+ if (input.all !== false)
184
+ argv.splice(1, 0, '-a');
185
+ const r = await docker(input.host, argv);
186
+ if (r.exitCode !== 0)
187
+ return [];
188
+ return parseContainers(r.stdout);
189
+ }
190
+ export async function listDockerImages(host) {
191
+ const r = await docker(host, ['images', '--format', '{{json .}}']);
192
+ return r.exitCode === 0 ? parseImages(r.stdout) : [];
193
+ }
194
+ export async function listDockerVolumes(input) {
195
+ const r = await docker(input.host, ['volume', 'ls', '--format', '{{json .}}']);
196
+ return r.exitCode === 0 ? parseVolumes(r.stdout) : [];
197
+ }
198
+ export async function listDockerNetworks(input) {
199
+ const r = await docker(input.host, ['network', 'ls', '--format', '{{json .}}']);
200
+ return r.exitCode === 0 ? parseNetworks(r.stdout) : [];
201
+ }
202
+ export async function listDockerComposeProjects(input) {
203
+ const fromDisk = scanValidatorCompose(input.dataDir);
204
+ const r = await docker(input.host, ['compose', 'ls', '--format', 'json']);
205
+ const live = r.exitCode === 0 ? parseComposeLs(r.stdout) : [];
206
+ const byName = new Map();
207
+ for (const p of fromDisk)
208
+ byName.set(p.name, p);
209
+ for (const p of live) {
210
+ const prev = byName.get(p.name);
211
+ byName.set(p.name, {
212
+ ...p,
213
+ yskManaged: p.yskManaged || Boolean(prev?.yskManaged),
214
+ validatorId: p.validatorId ?? prev?.validatorId ?? validatorIdFromComposeProject(p.name),
215
+ configFiles: p.configFiles || prev?.configFiles || '',
216
+ });
217
+ }
218
+ return [...byName.values()].sort((a, b) => a.name.localeCompare(b.name));
219
+ }
220
+ export async function dockerContainerLogs(input) {
221
+ const id = String(input.id ?? '').trim();
222
+ if (!isSafeDockerName(id) && !/^[a-f0-9]{6,64}$/i.test(id)) {
223
+ return { lines: [], notes: [tl('docker.errors.badName')] };
224
+ }
225
+ const tail = Math.min(500, Math.max(20, input.tail ?? 200));
226
+ const r = await docker(input.host, ['logs', '--tail', String(tail), id], { timeoutMs: 20_000 });
227
+ const text = `${r.stdout}\n${r.stderr}`.trim();
228
+ return {
229
+ lines: text ? text.split('\n') : [],
230
+ notes: r.exitCode === 0 ? [] : [r.stderr.trim() || tl('docker.errors.logsFailed')],
231
+ };
232
+ }
233
+ export function inferExecBin(image) {
234
+ const s = String(image ?? '').toLowerCase();
235
+ if (s.includes('client-go') || /\/geth(?::|$)/.test(s) || s.includes('ethereum/client-go'))
236
+ return 'geth';
237
+ if (s.includes('reth'))
238
+ return 'reth';
239
+ if (s.includes('nethermind'))
240
+ return 'nethermind';
241
+ if (s.includes('lighthouse'))
242
+ return 'lighthouse';
243
+ if (s.includes('prysm'))
244
+ return 'beacon-chain';
245
+ if (s.includes('teku'))
246
+ return 'teku';
247
+ if (s.includes('nimbus'))
248
+ return 'nimbus_beacon_node';
249
+ if (s.includes('avalanche'))
250
+ return 'avalanchego';
251
+ if (s.includes('near'))
252
+ return 'neard';
253
+ if (s.includes('cardano'))
254
+ return 'cardano-node';
255
+ if (s.includes('bitcoin'))
256
+ return 'bitcoin-cli';
257
+ if (s.includes('gaia') || s.includes('cosmos'))
258
+ return 'gaiad';
259
+ if (s.includes('sui'))
260
+ return 'sui';
261
+ if (s.includes('aptos'))
262
+ return 'aptos';
263
+ if (s.includes('agave') || s.includes('solana'))
264
+ return 'solana';
265
+ if (s.includes('polkadot'))
266
+ return 'polkadot';
267
+ if (s.includes('alpine') || s.includes('busybox'))
268
+ return 'busybox';
269
+ return null;
270
+ }
271
+ export function buildDockerExecArgv(input) {
272
+ const id = String(input.id ?? '').trim();
273
+ if (!isSafeDockerName(id) && !/^[a-f0-9]{6,64}$/i.test(id)) {
274
+ return { ok: false, notes: [tl('docker.errors.badName')] };
275
+ }
276
+ const bin = (input.bin?.trim() || inferExecBin(input.image ?? '') || '').trim();
277
+ if (!bin)
278
+ return { ok: false, notes: [tl('docker.errors.badExec')] };
279
+ const tail = input.preset === 'hostname'
280
+ ? bin === 'busybox'
281
+ ? ['busybox', 'hostname']
282
+ : ['hostname']
283
+ : input.preset === 'help'
284
+ ? [bin, '--help']
285
+ : bin === 'geth'
286
+ ? ['geth', 'version']
287
+ : [bin, '--version'];
288
+ const argv = ['exec', id, ...tail];
289
+ if (classifyDockerArgv(['docker', ...argv]) === 'blocked') {
290
+ return { ok: false, notes: [tl('docker.errors.badExec')] };
291
+ }
292
+ return { ok: true, argv };
293
+ }
294
+ export async function dockerExec(input) {
295
+ const probe = await probeDockerEngine(input.host);
296
+ const missing = needDocker(probe);
297
+ if (missing)
298
+ return missing;
299
+ let image = '';
300
+ const ins = await inspectDocker({ host: input.host, id: input.id });
301
+ if (ins.ok && ins.raw && typeof ins.raw === 'object') {
302
+ const arr = Array.isArray(ins.raw) ? ins.raw : [ins.raw];
303
+ const cfg = arr[0];
304
+ image = String(cfg?.Config?.Image ?? cfg?.Image ?? '');
305
+ }
306
+ const built = buildDockerExecArgv({
307
+ id: input.id,
308
+ preset: input.preset ?? 'version',
309
+ bin: input.bin,
310
+ image,
311
+ });
312
+ if (!built.ok)
313
+ return blockedDockerOp({ reason: 'validation', notes: built.notes });
314
+ if (!input.execute || !input.host.executeEnabled()) {
315
+ return writtenDockerOp({ notes: [tl('docker.notes.dryMutate'), built.argv.join(' ')] });
316
+ }
317
+ const r = await docker(input.host, built.argv, {
318
+ timeoutMs: 30_000,
319
+ onLog: input.onLog,
320
+ signal: input.signal,
321
+ });
322
+ if (r.exitCode !== 0) {
323
+ return failedDockerOp({ notes: [r.stderr.trim() || tl('docker.errors.mutateFailed'), r.stdout.trim()] });
324
+ }
325
+ return appliedDockerOp({
326
+ notes: [tl('docker.notes.exec'), r.stdout.trim() || r.stderr.trim()].filter(Boolean),
327
+ });
328
+ }
329
+ export async function inspectDocker(input) {
330
+ const id = String(input.id ?? '').trim();
331
+ if (!id)
332
+ return { ok: false, raw: null, notes: [tl('docker.errors.badName')] };
333
+ const r = await docker(input.host, ['inspect', id]);
334
+ if (r.exitCode !== 0)
335
+ return { ok: false, raw: null, notes: [r.stderr.trim() || 'inspect failed'] };
336
+ try {
337
+ return { ok: true, raw: JSON.parse(r.stdout), notes: [] };
338
+ }
339
+ catch {
340
+ return { ok: true, raw: r.stdout, notes: [] };
341
+ }
342
+ }
343
+ export async function dockerSystemDf(host) {
344
+ const r = await docker(host, ['system', 'df']);
345
+ return parseSystemDf(r.stdout);
346
+ }
347
+ function needDocker(probe) {
348
+ if (!probe.installed) {
349
+ return blockedDockerOp({ reason: 'missing_binary', notes: [tl('docker.errors.notInstalled'), ...probe.notes] });
350
+ }
351
+ if (!probe.daemonActive) {
352
+ return blockedDockerOp({ reason: 'other', notes: [tl('docker.errors.daemonDown'), ...probe.notes] });
353
+ }
354
+ return null;
355
+ }
356
+ export async function dockerContainerAction(input) {
357
+ const id = String(input.id ?? '').trim();
358
+ if (!id)
359
+ return blockedDockerOp({ reason: 'validation', notes: [tl('docker.errors.badName')] });
360
+ const probe = await probeDockerEngine(input.host);
361
+ const missing = needDocker(probe);
362
+ if (missing)
363
+ return missing;
364
+ const argv = input.action === 'remove' ? ['rm', '-f', id] : [input.action, id];
365
+ if (!input.execute || !input.host.executeEnabled()) {
366
+ return writtenDockerOp({ notes: [tl('docker.notes.dryMutate'), argv.join(' ')] });
367
+ }
368
+ const r = await docker(input.host, argv, { timeoutMs: 60_000 });
369
+ if (r.exitCode !== 0) {
370
+ return failedDockerOp({ notes: [r.stderr.trim() || tl('docker.errors.mutateFailed')] });
371
+ }
372
+ return appliedDockerOp({ notes: [tl(`docker.notes.${input.action}`)] });
373
+ }
374
+ export function buildDockerRunArgv(req) {
375
+ if (!isSafeDockerImageRef(req.image)) {
376
+ return { ok: false, notes: [tl('docker.errors.badImage')] };
377
+ }
378
+ if (req.name && !isSafeDockerName(req.name)) {
379
+ return { ok: false, notes: [tl('docker.errors.badName')] };
380
+ }
381
+ const restart = req.restart ?? 'unless-stopped';
382
+ if (!isDockerRestartPolicy(restart)) {
383
+ return { ok: false, notes: [tl('docker.errors.badRestart')] };
384
+ }
385
+ const network = (req.network ?? 'bridge').trim() || 'bridge';
386
+ if (network === 'host' || !/^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,64}$/.test(network)) {
387
+ return { ok: false, notes: [tl('docker.errors.badNetwork')] };
388
+ }
389
+ const argv = ['run', '-d', '--restart', restart, '--network', network];
390
+ if (req.name)
391
+ argv.push('--name', req.name);
392
+ argv.push('--label', 'com.ysk-server.managed=true', '--label', 'com.ysk-server.feature=docker-run');
393
+ for (const p of req.ports ?? []) {
394
+ const host = Number(p.host);
395
+ const cont = Number(p.container);
396
+ if (!Number.isInteger(host) || host < 1 || host > 65535) {
397
+ return { ok: false, notes: [tl('docker.errors.badPort')] };
398
+ }
399
+ if (!Number.isInteger(cont) || cont < 1 || cont > 65535) {
400
+ return { ok: false, notes: [tl('docker.errors.badPort')] };
401
+ }
402
+ const bind = (p.bind ?? '127.0.0.1').trim() || '127.0.0.1';
403
+ if (bind !== '127.0.0.1' && bind !== '0.0.0.0') {
404
+ return { ok: false, notes: [tl('docker.errors.badPort')] };
405
+ }
406
+ const proto = p.proto === 'udp' ? '/udp' : '';
407
+ argv.push('-p', `${bind}:${host}:${cont}${proto}`);
408
+ }
409
+ for (const [k, v] of Object.entries(req.env ?? {})) {
410
+ if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(k)) {
411
+ return { ok: false, notes: [tl('docker.errors.badEnv')] };
412
+ }
413
+ if (String(v).includes('\n')) {
414
+ return { ok: false, notes: [tl('docker.errors.badEnv')] };
415
+ }
416
+ argv.push('-e', `${k}=${v}`);
417
+ }
418
+ for (const vol of req.volumes ?? []) {
419
+ if (!isSafeDockerName(vol.name) || !isSafeVolumeDest(vol.dest)) {
420
+ return { ok: false, notes: [tl('docker.errors.badVolume')] };
421
+ }
422
+ argv.push('-v', `${vol.name}:${vol.dest}`);
423
+ }
424
+ argv.push(req.image);
425
+ return { ok: true, argv };
426
+ }
427
+ export async function dockerRun(input) {
428
+ const built = buildDockerRunArgv(input.req);
429
+ if (!built.ok)
430
+ return blockedDockerOp({ reason: 'validation', notes: built.notes });
431
+ const probe = await probeDockerEngine(input.host);
432
+ const missing = needDocker(probe);
433
+ if (missing)
434
+ return missing;
435
+ if (!input.execute || !input.host.executeEnabled()) {
436
+ return writtenDockerOp({ notes: [tl('docker.notes.dryMutate'), built.argv.join(' ')] });
437
+ }
438
+ const r = await docker(input.host, built.argv, { timeoutMs: 180_000 });
439
+ if (r.exitCode !== 0)
440
+ return failedDockerOp({ notes: [r.stderr.trim() || tl('docker.errors.mutateFailed')] });
441
+ return appliedDockerOp({ notes: [tl('docker.notes.ran'), r.stdout.trim()].filter(Boolean) });
442
+ }
443
+ export async function dockerPull(input) {
444
+ if (!isSafeDockerImageRef(input.image)) {
445
+ return blockedDockerOp({ reason: 'validation', notes: [tl('docker.errors.badImage')] });
446
+ }
447
+ const probe = await probeDockerEngine(input.host);
448
+ const missing = needDocker(probe);
449
+ if (missing)
450
+ return missing;
451
+ if (!input.execute || !input.host.executeEnabled()) {
452
+ return writtenDockerOp({ notes: [tl('docker.notes.dryMutate'), `docker pull ${input.image}`] });
453
+ }
454
+ const r = await docker(input.host, ['pull', input.image], {
455
+ timeoutMs: 600_000,
456
+ onLog: input.onLog,
457
+ signal: input.signal,
458
+ });
459
+ if (r.exitCode !== 0)
460
+ return failedDockerOp({ notes: [r.stderr.trim() || tl('docker.errors.mutateFailed')] });
461
+ return appliedDockerOp({ notes: [tl('docker.notes.pulled')] });
462
+ }
463
+ export async function dockerRemoveImage(input) {
464
+ const id = String(input.id ?? '').trim();
465
+ if (!id)
466
+ return blockedDockerOp({ reason: 'validation', notes: [tl('docker.errors.badImage')] });
467
+ const probe = await probeDockerEngine(input.host);
468
+ const missing = needDocker(probe);
469
+ if (missing)
470
+ return missing;
471
+ if (!input.execute || !input.host.executeEnabled()) {
472
+ return writtenDockerOp({ notes: [tl('docker.notes.dryMutate'), `docker rmi ${id}`] });
473
+ }
474
+ const r = await docker(input.host, ['rmi', id], { timeoutMs: 120_000 });
475
+ if (r.exitCode !== 0)
476
+ return failedDockerOp({ notes: [r.stderr.trim() || tl('docker.errors.mutateFailed')] });
477
+ return appliedDockerOp({ notes: [tl('docker.notes.imageRemoved')] });
478
+ }
479
+ export async function dockerCreateVolume(input) {
480
+ if (!isSafeDockerName(input.name)) {
481
+ return blockedDockerOp({ reason: 'validation', notes: [tl('docker.errors.badName')] });
482
+ }
483
+ const probe = await probeDockerEngine(input.host);
484
+ const missing = needDocker(probe);
485
+ if (missing)
486
+ return missing;
487
+ if (!input.execute || !input.host.executeEnabled()) {
488
+ return writtenDockerOp({ notes: [tl('docker.notes.dryMutate'), `docker volume create ${input.name}`] });
489
+ }
490
+ const r = await docker(input.host, ['volume', 'create', input.name]);
491
+ if (r.exitCode !== 0)
492
+ return failedDockerOp({ notes: [r.stderr.trim() || tl('docker.errors.mutateFailed')] });
493
+ return appliedDockerOp({ notes: [tl('docker.notes.volumeCreated')] });
494
+ }
495
+ export async function dockerRemoveVolume(input) {
496
+ if (!isSafeDockerName(input.name)) {
497
+ return blockedDockerOp({ reason: 'validation', notes: [tl('docker.errors.badName')] });
498
+ }
499
+ const probe = await probeDockerEngine(input.host);
500
+ const missing = needDocker(probe);
501
+ if (missing)
502
+ return missing;
503
+ if (!input.execute || !input.host.executeEnabled()) {
504
+ return writtenDockerOp({ notes: [tl('docker.notes.dryMutate'), `docker volume rm ${input.name}`] });
505
+ }
506
+ const r = await docker(input.host, ['volume', 'rm', input.name]);
507
+ if (r.exitCode !== 0)
508
+ return failedDockerOp({ notes: [r.stderr.trim() || tl('docker.errors.mutateFailed')] });
509
+ return appliedDockerOp({ notes: [tl('docker.notes.volumeRemoved')] });
510
+ }
511
+ export async function dockerCreateNetwork(input) {
512
+ if (!isSafeDockerName(input.name) || input.name === 'bridge' || input.name === 'host' || input.name === 'none') {
513
+ return blockedDockerOp({ reason: 'validation', notes: [tl('docker.errors.badNetwork')] });
514
+ }
515
+ const probe = await probeDockerEngine(input.host);
516
+ const missing = needDocker(probe);
517
+ if (missing)
518
+ return missing;
519
+ if (!input.execute || !input.host.executeEnabled()) {
520
+ return writtenDockerOp({ notes: [tl('docker.notes.dryMutate'), `docker network create ${input.name}`] });
521
+ }
522
+ const r = await docker(input.host, ['network', 'create', input.name]);
523
+ if (r.exitCode !== 0)
524
+ return failedDockerOp({ notes: [r.stderr.trim() || tl('docker.errors.mutateFailed')] });
525
+ return appliedDockerOp({ notes: [tl('docker.notes.networkCreated')] });
526
+ }
527
+ export async function dockerRemoveNetwork(input) {
528
+ const id = String(input.id ?? '').trim();
529
+ if (!id || id === 'bridge' || id === 'host' || id === 'none' || id === 'docker0') {
530
+ return blockedDockerOp({ reason: 'validation', notes: [tl('docker.errors.protectedNetwork')] });
531
+ }
532
+ const probe = await probeDockerEngine(input.host);
533
+ const missing = needDocker(probe);
534
+ if (missing)
535
+ return missing;
536
+ if (!input.execute || !input.host.executeEnabled()) {
537
+ return writtenDockerOp({ notes: [tl('docker.notes.dryMutate'), `docker network rm ${id}`] });
538
+ }
539
+ const r = await docker(input.host, ['network', 'rm', id]);
540
+ if (r.exitCode !== 0)
541
+ return failedDockerOp({ notes: [r.stderr.trim() || tl('docker.errors.mutateFailed')] });
542
+ return appliedDockerOp({ notes: [tl('docker.notes.networkRemoved')] });
543
+ }
544
+ function composeFileFor(dataDir, project) {
545
+ const fromName = validatorIdFromComposeProject(project);
546
+ if (fromName) {
547
+ const p = composeFilePath(join(dataDir, 'validators', fromName));
548
+ if (existsSync(p))
549
+ return p;
550
+ }
551
+ const direct = composeFilePath(join(dataDir, 'validators', project));
552
+ return existsSync(direct) ? direct : null;
553
+ }
554
+ export async function dockerComposeAction(input) {
555
+ const project = String(input.project ?? '').trim();
556
+ if (!isSafeDockerName(project)) {
557
+ return blockedDockerOp({ reason: 'validation', notes: [tl('docker.errors.badName')] });
558
+ }
559
+ const file = composeFileFor(input.dataDir, project);
560
+ if (!file) {
561
+ return blockedDockerOp({ reason: 'validation', notes: [tl('docker.errors.composeMissing')] });
562
+ }
563
+ const probe = await probeDockerEngine(input.host);
564
+ const missing = needDocker(probe);
565
+ if (missing)
566
+ return missing;
567
+ if (!probe.composeAvailable) {
568
+ return blockedDockerOp({ reason: 'missing_binary', notes: [tl('docker.errors.needCompose')] });
569
+ }
570
+ const argv = input.action === 'up'
571
+ ? ['compose', '-f', file, '-p', project, 'up', '-d']
572
+ : input.action === 'down'
573
+ ? ['compose', '-f', file, '-p', project, 'down']
574
+ : input.action === 'rm'
575
+ ? ['compose', '-f', file, '-p', project, 'down', '--volumes', '--remove-orphans']
576
+ : ['compose', '-f', file, '-p', project, 'restart'];
577
+ if (!input.execute || !input.host.executeEnabled()) {
578
+ return writtenDockerOp({ notes: [tl('docker.notes.dryMutate'), argv.join(' ')] });
579
+ }
580
+ const r = await docker(input.host, argv, {
581
+ timeoutMs: 600_000,
582
+ onLog: input.onLog,
583
+ signal: input.signal,
584
+ });
585
+ if (r.exitCode !== 0)
586
+ return failedDockerOp({ notes: [r.stderr.trim() || tl('docker.errors.mutateFailed')] });
587
+ return appliedDockerOp({ notes: [tl(`docker.notes.compose.${input.action}`)] });
588
+ }
589
+ export async function dockerComposeLogs(input) {
590
+ const file = composeFileFor(input.dataDir, input.project);
591
+ if (!file)
592
+ return { lines: [], notes: [tl('docker.errors.composeMissing')] };
593
+ const tail = Math.min(500, Math.max(20, input.tail ?? 200));
594
+ const r = await docker(input.host, [
595
+ 'compose',
596
+ '-f',
597
+ file,
598
+ '-p',
599
+ input.project,
600
+ 'logs',
601
+ '--no-color',
602
+ '--tail',
603
+ String(tail),
604
+ ]);
605
+ const text = `${r.stdout}\n${r.stderr}`.trim();
606
+ return { lines: text ? text.split('\n') : [], notes: r.exitCode === 0 ? [] : [r.stderr] };
607
+ }
608
+ export async function dockerPrune(input) {
609
+ if (!isDockerPruneScope(input.scope)) {
610
+ return blockedDockerOp({ reason: 'validation', notes: [tl('docker.errors.badPrune')] });
611
+ }
612
+ const scope = input.scope;
613
+ if ((scope === 'volumes' || scope === 'system') && input.confirm !== 'PRUNE') {
614
+ return blockedDockerOp({ reason: 'validation', notes: [tl('docker.errors.needPruneConfirm')] });
615
+ }
616
+ const probe = await probeDockerEngine(input.host);
617
+ const missing = needDocker(probe);
618
+ if (missing)
619
+ return missing;
620
+ const argv = scope === 'containers'
621
+ ? ['container', 'prune', '-f']
622
+ : scope === 'images'
623
+ ? ['image', 'prune', '-f']
624
+ : scope === 'volumes'
625
+ ? ['volume', 'prune', '-f']
626
+ : scope === 'builder'
627
+ ? ['builder', 'prune', '-f']
628
+ : ['system', 'prune', '-f'];
629
+ // builder prune is classified blocked at argv — map to image prune --filter dangling
630
+ const safeArgv = scope === 'builder' ? ['image', 'prune', '-f'] : argv;
631
+ if (!input.execute || !input.host.executeEnabled()) {
632
+ const df = await dockerSystemDf(input.host);
633
+ return writtenDockerOp({
634
+ notes: [
635
+ tl('docker.notes.dryPrune'),
636
+ safeArgv.join(' '),
637
+ ...df.map((r) => `${r.type} ${r.size} reclaimable ${r.reclaimable}`),
638
+ ],
639
+ });
640
+ }
641
+ const r = await docker(input.host, safeArgv, {
642
+ timeoutMs: 300_000,
643
+ onLog: input.onLog,
644
+ signal: input.signal,
645
+ });
646
+ if (r.exitCode !== 0)
647
+ return failedDockerOp({ notes: [r.stderr.trim() || tl('docker.errors.mutateFailed')] });
648
+ return appliedDockerOp({ notes: [tl('docker.notes.pruned'), r.stdout.trim()].filter(Boolean) });
649
+ }
650
+ export async function dockerEngineControl(input) {
651
+ if (!input.execute || !input.host.executeEnabled()) {
652
+ return writtenDockerOp({ notes: [tl('docker.notes.dryEngine'), `systemctl ${input.action} docker`] });
653
+ }
654
+ const r = await input.host.runCommand(['systemctl', input.action, 'docker'], { timeoutMs: 60_000 });
655
+ if (r.exitCode !== 0) {
656
+ return failedDockerOp({ notes: [r.stderr.trim() || tl('docker.errors.engineFailed')] });
657
+ }
658
+ return appliedDockerOp({ notes: [tl(`docker.notes.engine.${input.action}`)] });
659
+ }
660
+ export function getDockerDaemonSettings() {
661
+ return readDaemonSettings();
662
+ }
663
+ export async function patchDockerDaemon(input) {
664
+ const cur = readDaemonSettings();
665
+ const applied = applyDaemonPatch(cur.raw, input.patch);
666
+ if (!applied.ok)
667
+ return blockedDockerOp({ reason: 'validation', notes: applied.notes });
668
+ if (!input.execute || !input.host.executeEnabled()) {
669
+ return writtenDockerOp({ notes: [tl('docker.notes.dryDaemon')] });
670
+ }
671
+ const w = writeDaemonSettings({ next: applied.next, execute: true });
672
+ const restart = await input.host.runCommand(['systemctl', 'restart', 'docker'], { timeoutMs: 90_000 });
673
+ if (restart.exitCode !== 0) {
674
+ return failedDockerOp({
675
+ notes: [tl('docker.errors.engineFailed'), restart.stderr.trim()],
676
+ written: w.written,
677
+ });
678
+ }
679
+ return appliedDockerOp({ notes: [...w.notes, tl('docker.notes.engine.restart')], written: w.written });
680
+ }
681
+ //# sourceMappingURL=manager.js.map