@geekmidas/cli 10.0.0-alpha.145 → 10.0.0-alpha.147

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 (217) hide show
  1. package/dist/{GoDaddyProvider-DAJIa64i.cjs → GoDaddyProvider-CpO8dFYC.cjs} +2 -2
  2. package/dist/{GoDaddyProvider-DAJIa64i.cjs.map → GoDaddyProvider-CpO8dFYC.cjs.map} +1 -1
  3. package/dist/{GoDaddyProvider-IVuFcWyc.mjs → GoDaddyProvider-DXuPFufW.mjs} +2 -2
  4. package/dist/{GoDaddyProvider-IVuFcWyc.mjs.map → GoDaddyProvider-DXuPFufW.mjs.map} +1 -1
  5. package/dist/{HostingerProvider-DdikWVRy.cjs → HostingerProvider-Beu0Ciky.cjs} +2 -2
  6. package/dist/{HostingerProvider-DdikWVRy.cjs.map → HostingerProvider-Beu0Ciky.cjs.map} +1 -1
  7. package/dist/{HostingerProvider-BtLb-jkn.mjs → HostingerProvider-Dum492dc.mjs} +2 -2
  8. package/dist/{HostingerProvider-BtLb-jkn.mjs.map → HostingerProvider-Dum492dc.mjs.map} +1 -1
  9. package/dist/{LegacyStateStore-CmgUY9kR.mjs → LegacyStateStore-DZjph7ES.mjs} +2 -2
  10. package/dist/{LegacyStateStore-CmgUY9kR.mjs.map → LegacyStateStore-DZjph7ES.mjs.map} +1 -1
  11. package/dist/{LegacyStateStore-CWwT7Mj5.cjs → LegacyStateStore-V4R0llou.cjs} +2 -2
  12. package/dist/{LegacyStateStore-CWwT7Mj5.cjs.map → LegacyStateStore-V4R0llou.cjs.map} +1 -1
  13. package/dist/{LocalStateStore-NOmS4QyA.mjs → LocalStateStore-Bth8pBp-.mjs} +2 -2
  14. package/dist/{LocalStateStore-NOmS4QyA.mjs.map → LocalStateStore-Bth8pBp-.mjs.map} +1 -1
  15. package/dist/{LocalStateStore-BkeQg1ga.cjs → LocalStateStore-DuSotrd3.cjs} +2 -2
  16. package/dist/{LocalStateStore-BkeQg1ga.cjs.map → LocalStateStore-DuSotrd3.cjs.map} +1 -1
  17. package/dist/{S3StateStore-SjIxuWHM.mjs → S3StateStore-DGlh3s2p.mjs} +4 -4
  18. package/dist/{S3StateStore-SjIxuWHM.mjs.map → S3StateStore-DGlh3s2p.mjs.map} +1 -1
  19. package/dist/{S3StateStore-Cw2nwI5C.cjs → S3StateStore-DTPxQS3z.cjs} +4 -4
  20. package/dist/{S3StateStore-Cw2nwI5C.cjs.map → S3StateStore-DTPxQS3z.cjs.map} +1 -1
  21. package/dist/{SSMStateStore-DC1N1Baw.cjs → SSMStateStore-B9R317q0.cjs} +2 -2
  22. package/dist/{SSMStateStore-DC1N1Baw.cjs.map → SSMStateStore-B9R317q0.cjs.map} +1 -1
  23. package/dist/{SSMStateStore-DGqzo4Ob.mjs → SSMStateStore-DCa85jhG.mjs} +2 -2
  24. package/dist/{SSMStateStore-DGqzo4Ob.mjs.map → SSMStateStore-DCa85jhG.mjs.map} +1 -1
  25. package/dist/{add-Bnd7vuUN.mjs → add-Bl33BvDW.mjs} +7 -7
  26. package/dist/{add-Bnd7vuUN.mjs.map → add-Bl33BvDW.mjs.map} +1 -1
  27. package/dist/{add-BwC_EH0e.cjs → add-Cr-9Ku0W.cjs} +7 -7
  28. package/dist/{add-BwC_EH0e.cjs.map → add-Cr-9Ku0W.cjs.map} +1 -1
  29. package/dist/{apps-D1svw9OG.cjs → apps-BIsxWYUo.cjs} +513 -52
  30. package/dist/apps-BIsxWYUo.cjs.map +1 -0
  31. package/dist/{apps-Xrlvir2-.mjs → apps-DFzUuJ22.mjs} +470 -52
  32. package/dist/apps-DFzUuJ22.mjs.map +1 -0
  33. package/dist/{bundler-CoRIF5bx.mjs → bundler-BagXzefF.mjs} +6 -6
  34. package/dist/{bundler-CoRIF5bx.mjs.map → bundler-BagXzefF.mjs.map} +1 -1
  35. package/dist/{bundler-CgWYsgqb.cjs → bundler-Cael9EDc.cjs} +6 -6
  36. package/dist/{bundler-CgWYsgqb.cjs.map → bundler-Cael9EDc.cjs.map} +1 -1
  37. package/dist/{cli-DsPHbC7p.cjs → cli-B1A-cLy-.cjs} +4 -4
  38. package/dist/{cli-DsPHbC7p.cjs.map → cli-B1A-cLy-.cjs.map} +1 -1
  39. package/dist/{cli-CKlTRVwo.mjs → cli-BJRPsFq7.mjs} +4 -4
  40. package/dist/{cli-CKlTRVwo.mjs.map → cli-BJRPsFq7.mjs.map} +1 -1
  41. package/dist/{compose-BMTnoIek.mjs → compose-C7izI7Eo.mjs} +5 -5
  42. package/dist/compose-C7izI7Eo.mjs.map +1 -0
  43. package/dist/{compose-CkvPmijw.mjs → compose-CZU60dwb.mjs} +303 -46
  44. package/dist/compose-CZU60dwb.mjs.map +1 -0
  45. package/dist/{compose-CVAoA04l.cjs → compose-Cius-YHS.cjs} +5 -5
  46. package/dist/compose-Cius-YHS.cjs.map +1 -0
  47. package/dist/{compose-ChUQHKG3.cjs → compose-CnNmDNph.cjs} +302 -45
  48. package/dist/compose-CnNmDNph.cjs.map +1 -0
  49. package/dist/{config-BKpzKP6W.mjs → config-BLrAd7Of.mjs} +2 -2
  50. package/dist/{config-BKpzKP6W.mjs.map → config-BLrAd7Of.mjs.map} +1 -1
  51. package/dist/{config-BcL1Fojs.d.cts → config-CRk2vdSp.d.mts} +3 -3
  52. package/dist/{config-BbivVpq0.d.mts.map → config-CRk2vdSp.d.mts.map} +1 -1
  53. package/dist/{config-QAqAEgb0.cjs → config-juUyBlb1.cjs} +2 -2
  54. package/dist/{config-QAqAEgb0.cjs.map → config-juUyBlb1.cjs.map} +1 -1
  55. package/dist/{config-BbivVpq0.d.mts → config-oBgsbLip.d.cts} +3 -3
  56. package/dist/{config-BcL1Fojs.d.cts.map → config-oBgsbLip.d.cts.map} +1 -1
  57. package/dist/config.cjs +2 -2
  58. package/dist/config.d.cts +3 -3
  59. package/dist/config.d.mts +3 -3
  60. package/dist/config.mjs +2 -2
  61. package/dist/{credentials-Jx1Vdisc.mjs → credentials-CJ_z0Nni.mjs} +7 -7
  62. package/dist/{credentials-Jx1Vdisc.mjs.map → credentials-CJ_z0Nni.mjs.map} +1 -1
  63. package/dist/{credentials-CCIXh-cq.cjs → credentials-D11xozSF.cjs} +7 -7
  64. package/dist/{credentials-CCIXh-cq.cjs.map → credentials-D11xozSF.cjs.map} +1 -1
  65. package/dist/deploy/public.cjs +12 -12
  66. package/dist/deploy/public.d.cts +3 -3
  67. package/dist/deploy/public.d.cts.map +1 -1
  68. package/dist/deploy/public.d.mts +3 -3
  69. package/dist/deploy/public.d.mts.map +1 -1
  70. package/dist/deploy/public.mjs +12 -12
  71. package/dist/{deploy-CEX0YRdq.cjs → deploy-Ch1wCsU1.cjs} +13 -13
  72. package/dist/{deploy-CEX0YRdq.cjs.map → deploy-Ch1wCsU1.cjs.map} +1 -1
  73. package/dist/{deploy-8wsaNpPW.mjs → deploy-Dfn21QYG.mjs} +13 -13
  74. package/dist/{deploy-8wsaNpPW.mjs.map → deploy-Dfn21QYG.mjs.map} +1 -1
  75. package/dist/{docker-M_-xKiFU.cjs → docker-BT6G7aJE.cjs} +5 -5
  76. package/dist/{docker-M_-xKiFU.cjs.map → docker-BT6G7aJE.cjs.map} +1 -1
  77. package/dist/{docker-M4kCqczV.mjs → docker-_W_CauBY.mjs} +5 -5
  78. package/dist/{docker-M4kCqczV.mjs.map → docker-_W_CauBY.mjs.map} +1 -1
  79. package/dist/{dokploy-BsAPW8K1.mjs → dokploy-CBgGuei3.mjs} +2 -2
  80. package/dist/{dokploy-BsAPW8K1.mjs.map → dokploy-CBgGuei3.mjs.map} +1 -1
  81. package/dist/{dokploy-Djm8QIQZ.cjs → dokploy-DaQbR_NH.cjs} +2 -2
  82. package/dist/{dokploy-Djm8QIQZ.cjs.map → dokploy-DaQbR_NH.cjs.map} +1 -1
  83. package/dist/{eas-zEpuiYYj.mjs → eas-3L1_yKhk.mjs} +3 -3
  84. package/dist/{eas-zEpuiYYj.mjs.map → eas-3L1_yKhk.mjs.map} +1 -1
  85. package/dist/{eas-B-Ac5NjL.cjs → eas-YxDTJ3ql.cjs} +3 -3
  86. package/dist/{eas-B-Ac5NjL.cjs.map → eas-YxDTJ3ql.cjs.map} +1 -1
  87. package/dist/{encryption-EOEhb95p.mjs → encryption-CRyFk5nu.mjs} +4 -4
  88. package/dist/{encryption-EOEhb95p.mjs.map → encryption-CRyFk5nu.mjs.map} +1 -1
  89. package/dist/{encryption-B4LCEdXH.cjs → encryption-CVIu104e.cjs} +4 -4
  90. package/dist/{encryption-B4LCEdXH.cjs.map → encryption-CVIu104e.cjs.map} +1 -1
  91. package/dist/{engine-Ci-uU3kt.mjs → engine-DZnZy1R5.mjs} +17 -12
  92. package/dist/engine-DZnZy1R5.mjs.map +1 -0
  93. package/dist/{engine-6NLOikTQ.cjs → engine-XecwdLdj.cjs} +17 -12
  94. package/dist/engine-XecwdLdj.cjs.map +1 -0
  95. package/dist/{github-C0oLDg5G.mjs → github-CDJXpBCT.mjs} +9 -9
  96. package/dist/{github-C0oLDg5G.mjs.map → github-CDJXpBCT.mjs.map} +1 -1
  97. package/dist/{github-u9sfpl0l.cjs → github-dnxU_tMp.cjs} +9 -9
  98. package/dist/{github-u9sfpl0l.cjs.map → github-dnxU_tMp.cjs.map} +1 -1
  99. package/dist/{googlePlay-3nfA-wWh.mjs → googlePlay-BYeXKpNE.mjs} +5 -5
  100. package/dist/{googlePlay-3nfA-wWh.mjs.map → googlePlay-BYeXKpNE.mjs.map} +1 -1
  101. package/dist/{googlePlay-DfLH_sPa.cjs → googlePlay-CnIU3qIV.cjs} +5 -5
  102. package/dist/{googlePlay-DfLH_sPa.cjs.map → googlePlay-CnIU3qIV.cjs.map} +1 -1
  103. package/dist/{index-C1jffZ5_.d.cts → index-B35vTdAW.d.cts} +2 -2
  104. package/dist/{index-BZZeEWug.d.mts.map → index-B35vTdAW.d.cts.map} +1 -1
  105. package/dist/{index-BZZeEWug.d.mts → index-Dv1Zj86i.d.mts} +2 -2
  106. package/dist/{index-C1jffZ5_.d.cts.map → index-Dv1Zj86i.d.mts.map} +1 -1
  107. package/dist/index.cjs +73 -80
  108. package/dist/index.cjs.map +1 -1
  109. package/dist/index.mjs +73 -80
  110. package/dist/index.mjs.map +1 -1
  111. package/dist/{local-uvqZDwZ9.mjs → local-BIOpCtLE.mjs} +2 -2
  112. package/dist/{local-uvqZDwZ9.mjs.map → local-BIOpCtLE.mjs.map} +1 -1
  113. package/dist/{local-CtzKG55y.cjs → local-qdNfjzxQ.cjs} +2 -2
  114. package/dist/{local-CtzKG55y.cjs.map → local-qdNfjzxQ.cjs.map} +1 -1
  115. package/dist/{migrate-s9lVmF98.mjs → migrate--VNdTWT7.mjs} +6 -6
  116. package/dist/{migrate-s9lVmF98.mjs.map → migrate--VNdTWT7.mjs.map} +1 -1
  117. package/dist/{migrate-FKPFIzwd.cjs → migrate-CDEHWq-e.cjs} +6 -6
  118. package/dist/{migrate-FKPFIzwd.cjs.map → migrate-CDEHWq-e.cjs.map} +1 -1
  119. package/dist/{migrate-C6V9bEVY.cjs → migrate-CkHtNdre.cjs} +4 -4
  120. package/dist/{migrate-C6V9bEVY.cjs.map → migrate-CkHtNdre.cjs.map} +1 -1
  121. package/dist/{migrate-CA1GWA4t.mjs → migrate-svXhccrs.mjs} +4 -4
  122. package/dist/{migrate-CA1GWA4t.mjs.map → migrate-svXhccrs.mjs.map} +1 -1
  123. package/dist/{notes-Dz1M9_q9.mjs → notes-D9ofENLJ.mjs} +4 -4
  124. package/dist/{notes-Dz1M9_q9.mjs.map → notes-D9ofENLJ.mjs.map} +1 -1
  125. package/dist/{notes-BjxySbyH.cjs → notes-DBNPml4N.cjs} +4 -4
  126. package/dist/{notes-BjxySbyH.cjs.map → notes-DBNPml4N.cjs.map} +1 -1
  127. package/dist/openapi.cjs +2 -2
  128. package/dist/openapi.d.cts +1 -1
  129. package/dist/openapi.d.mts +1 -1
  130. package/dist/openapi.mjs +2 -2
  131. package/dist/{projectBucket-DsXNW1Yc.cjs → projectBucket-BtiC0Cn8.cjs} +2 -2
  132. package/dist/{projectBucket-DsXNW1Yc.cjs.map → projectBucket-BtiC0Cn8.cjs.map} +1 -1
  133. package/dist/{projectBucket-2XgQSnLw.mjs → projectBucket-De0MQeNj.mjs} +2 -2
  134. package/dist/{projectBucket-2XgQSnLw.mjs.map → projectBucket-De0MQeNj.mjs.map} +1 -1
  135. package/dist/{publish-7-dwP5TL.cjs → publish-CohTrVKe.cjs} +2 -2
  136. package/dist/{publish-7-dwP5TL.cjs.map → publish-CohTrVKe.cjs.map} +1 -1
  137. package/dist/{publish-Dmy_OhvF.mjs → publish-k38S418e.mjs} +2 -2
  138. package/dist/{publish-Dmy_OhvF.mjs.map → publish-k38S418e.mjs.map} +1 -1
  139. package/dist/reconcile/public.d.cts +1 -1
  140. package/dist/reconcile/public.d.mts +1 -1
  141. package/dist/{resolve-DhsUJwm8.cjs → resolve-Cr3Qj8ch.cjs} +4 -4
  142. package/dist/{resolve-DhsUJwm8.cjs.map → resolve-Cr3Qj8ch.cjs.map} +1 -1
  143. package/dist/{resolve-BK7mzDBb.mjs → resolve-YMxlYJtO.mjs} +4 -4
  144. package/dist/{resolve-BK7mzDBb.mjs.map → resolve-YMxlYJtO.mjs.map} +1 -1
  145. package/dist/{rollback-8qHgyadV.mjs → rollback-DIoyVrQI.mjs} +7 -7
  146. package/dist/{rollback-8qHgyadV.mjs.map → rollback-DIoyVrQI.mjs.map} +1 -1
  147. package/dist/{rollback-DP2iDjc9.cjs → rollback-eyqvtzW_.cjs} +7 -7
  148. package/dist/{rollback-DP2iDjc9.cjs.map → rollback-eyqvtzW_.cjs.map} +1 -1
  149. package/dist/{runtime-CeAt1IJd.d.mts → runtime-CFvcLEJW.d.cts} +2 -2
  150. package/dist/{runtime-Bvgyxm88.d.cts.map → runtime-CFvcLEJW.d.cts.map} +1 -1
  151. package/dist/{runtime-Bvgyxm88.d.cts → runtime-dwsH6ddo.d.mts} +2 -2
  152. package/dist/{runtime-CeAt1IJd.d.mts.map → runtime-dwsH6ddo.d.mts.map} +1 -1
  153. package/dist/{s3-DSPbU5gN.cjs → s3-CegRM8Sa.cjs} +3 -3
  154. package/dist/{s3-DSPbU5gN.cjs.map → s3-CegRM8Sa.cjs.map} +1 -1
  155. package/dist/{s3-DxCex5Fx.mjs → s3-Cl3tRemt.mjs} +3 -3
  156. package/dist/{s3-DxCex5Fx.mjs.map → s3-Cl3tRemt.mjs.map} +1 -1
  157. package/dist/{serverSetup-BSuHk2t2.cjs → serverSetup-BwfMgz3W.cjs} +7 -7
  158. package/dist/{serverSetup-BSuHk2t2.cjs.map → serverSetup-BwfMgz3W.cjs.map} +1 -1
  159. package/dist/{serverSetup-CeFpl5VJ.mjs → serverSetup-fQwkJ_EI.mjs} +7 -7
  160. package/dist/{serverSetup-CeFpl5VJ.mjs.map → serverSetup-fQwkJ_EI.mjs.map} +1 -1
  161. package/dist/{sniffer-Cb3n63dY.cjs → sniffer-BgdVvvzU.cjs} +7 -7
  162. package/dist/{sniffer-Cb3n63dY.cjs.map → sniffer-BgdVvvzU.cjs.map} +1 -1
  163. package/dist/{sniffer-BfNl8jn-.mjs → sniffer-FF7mfuR8.mjs} +7 -7
  164. package/dist/{sniffer-BfNl8jn-.mjs.map → sniffer-FF7mfuR8.mjs.map} +1 -1
  165. package/dist/{snsSubscriptions-DoZ0Q1n6.mjs → snsSubscriptions-B_WH4o1S.mjs} +3 -3
  166. package/dist/{snsSubscriptions-DoZ0Q1n6.mjs.map → snsSubscriptions-B_WH4o1S.mjs.map} +1 -1
  167. package/dist/{snsSubscriptions-Bd40ebt6.cjs → snsSubscriptions-DUY-Tu6J.cjs} +3 -3
  168. package/dist/{snsSubscriptions-Bd40ebt6.cjs.map → snsSubscriptions-DUY-Tu6J.cjs.map} +1 -1
  169. package/dist/{sst-DKNyfTpw.cjs → sst-BEXeTgDQ.cjs} +5 -5
  170. package/dist/{sst-DKNyfTpw.cjs.map → sst-BEXeTgDQ.cjs.map} +1 -1
  171. package/dist/{sst-B6RbJp8g.mjs → sst-BkTtncop.mjs} +5 -5
  172. package/dist/{sst-B6RbJp8g.mjs.map → sst-BkTtncop.mjs.map} +1 -1
  173. package/dist/{stack-UcV-V6Qk.cjs → stack-CcFgY4sJ.cjs} +106 -49
  174. package/dist/stack-CcFgY4sJ.cjs.map +1 -0
  175. package/dist/{stack-DwQ62dKK.mjs → stack-CqfBL5LA.mjs} +106 -49
  176. package/dist/stack-CqfBL5LA.mjs.map +1 -0
  177. package/dist/{stage-52sKecmS.mjs → stage-4ZtteXz8.mjs} +7 -7
  178. package/dist/{stage-52sKecmS.mjs.map → stage-4ZtteXz8.mjs.map} +1 -1
  179. package/dist/{stage-C2v5890I.cjs → stage-C19XRx7W.cjs} +7 -7
  180. package/dist/{stage-C2v5890I.cjs.map → stage-C19XRx7W.cjs.map} +1 -1
  181. package/dist/{stages-CFI0OiLj.cjs → stages-Bs1THSy7.cjs} +3 -3
  182. package/dist/{stages-CFI0OiLj.cjs.map → stages-Bs1THSy7.cjs.map} +1 -1
  183. package/dist/{stages-DoYa81kN.mjs → stages-_xCG4Ymu.mjs} +3 -3
  184. package/dist/{stages-DoYa81kN.mjs.map → stages-_xCG4Ymu.mjs.map} +1 -1
  185. package/dist/target/public.cjs +1 -1
  186. package/dist/target/public.d.cts +2 -2
  187. package/dist/target/public.d.mts +2 -2
  188. package/dist/target/public.mjs +1 -1
  189. package/dist/{terminal-DkXWdU0E.cjs → terminal-BkyVVOb-.cjs} +2 -2
  190. package/dist/{terminal-DkXWdU0E.cjs.map → terminal-BkyVVOb-.cjs.map} +1 -1
  191. package/dist/{terminal-BDEqpkbO.mjs → terminal-KVX_MmCR.mjs} +2 -2
  192. package/dist/{terminal-BDEqpkbO.mjs.map → terminal-KVX_MmCR.mjs.map} +1 -1
  193. package/dist/{types-Dy1eV7yc.d.cts → types-Dk--xVOT.d.cts} +31 -11
  194. package/dist/{types-Dy1eV7yc.d.cts.map → types-Dk--xVOT.d.cts.map} +1 -1
  195. package/dist/{types-C6hDCkV2.d.mts → types-DwQYpd_0.d.mts} +31 -11
  196. package/dist/{types-C6hDCkV2.d.mts.map → types-DwQYpd_0.d.mts.map} +1 -1
  197. package/dist/workspace/index.cjs +1 -1
  198. package/dist/workspace/index.d.cts +2 -2
  199. package/dist/workspace/index.d.mts +2 -2
  200. package/dist/workspace/index.mjs +1 -1
  201. package/dist/{workspace-Dkm3HL9e.cjs → workspace-1szcahj9.cjs} +19 -27
  202. package/dist/workspace-1szcahj9.cjs.map +1 -0
  203. package/dist/{workspace-BbfBFtjn.mjs → workspace-DFGsrjGD.mjs} +19 -27
  204. package/dist/workspace-DFGsrjGD.mjs.map +1 -0
  205. package/package.json +17 -15
  206. package/dist/apps-D1svw9OG.cjs.map +0 -1
  207. package/dist/apps-Xrlvir2-.mjs.map +0 -1
  208. package/dist/compose-BMTnoIek.mjs.map +0 -1
  209. package/dist/compose-CVAoA04l.cjs.map +0 -1
  210. package/dist/compose-ChUQHKG3.cjs.map +0 -1
  211. package/dist/compose-CkvPmijw.mjs.map +0 -1
  212. package/dist/engine-6NLOikTQ.cjs.map +0 -1
  213. package/dist/engine-Ci-uU3kt.mjs.map +0 -1
  214. package/dist/stack-DwQ62dKK.mjs.map +0 -1
  215. package/dist/stack-UcV-V6Qk.cjs.map +0 -1
  216. package/dist/workspace-BbfBFtjn.mjs.map +0 -1
  217. package/dist/workspace-Dkm3HL9e.cjs.map +0 -1
@@ -1,14 +1,14 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BhDjJH2R.mjs";
2
2
  import { t as GkmError } from "./errors-D8Gwp5kU.mjs";
3
- import { B as toEmbeddableSecrets, L as initStageSecrets, a as findRootDomain, dt as run, ft as runOutput, m as createComposeState, o as normalizeDnsConfig, rt as imageRef, v as recordRelease } from "./credentials-Jx1Vdisc.mjs";
4
- import { L as resolveStageTelemetry, ct as ComposeTlsFileMissing, gt as SERVER_IPV4_KEY, yt as isReservedStageKey } from "./workspace-BbfBFtjn.mjs";
5
- import { D as pinImages, M as backupsRoleStatements, S as traefikStaticFile, T as assertImagesExist, _ as EDGE_NETWORK, a as composeProject, d as stackDir, g as EDGE_DYNAMIC_DIR, h as EDGE_CERTS_DIR, i as LOOPBACK_SERVICES, k as BACKUPS_SERVICE, l as envFile, m as EDGE_AWS_CREDENTIALS, n as LOGS_PORT_ENV, o as composeStack, p as withCaddyConfigs, r as LOG_ROTATION, t as EDGE_PORT_ENV, u as replicaNames, v as EDGE_PROJECT, w as RegistryRequired, x as edgeComposeFile, y as EDGE_SERVICE } from "./stack-DwQ62dKK.mjs";
3
+ import { B as toEmbeddableSecrets, L as initStageSecrets, a as findRootDomain, dt as run, ft as runOutput, m as createComposeState, o as normalizeDnsConfig, rt as imageRef, v as recordRelease } from "./credentials-CJ_z0Nni.mjs";
4
+ import { L as resolveStageTelemetry, ct as ComposeTlsFileMissing, gt as SERVER_IPV4_KEY, yt as isReservedStageKey } from "./workspace-DFGsrjGD.mjs";
5
+ import { D as pinImages, M as backupsRoleStatements, S as traefikStaticFile, T as assertImagesExist, _ as EDGE_NETWORK, a as composeProject, d as stackDir, g as EDGE_DYNAMIC_DIR, h as EDGE_CERTS_DIR, i as LOOPBACK_SERVICES, k as BACKUPS_SERVICE, l as envFile, m as EDGE_AWS_CREDENTIALS, n as LOGS_PORT_ENV, o as composeStack, p as withCaddyConfigs, r as LOG_ROTATION, t as EDGE_PORT_ENV, u as replicaNames, v as EDGE_PROJECT, w as RegistryRequired, x as edgeComposeFile, y as EDGE_SERVICE } from "./stack-CqfBL5LA.mjs";
6
6
  import { t as defineTarget } from "./define-6poNqm5O.mjs";
7
- import { C as runsRedis, J as logsAccess, Q as withLogsPassword, T as withRedisPassword, U as primaryPortKey, b as REDIS_SERVICE, m as loadLocalCredentials, q as LOGS_SERVICE, y as withGeneratedSecrets } from "./compose-BMTnoIek.mjs";
8
- import { E as findBuildRoot, G as applyNotifications, K as applyPolicies, U as applyBuckets, W as applyLifecycles, Z as postgresStatements, _ as bucketClient, a as workerEnvKeys, c as constructGlobs, et as envFor, ft as usesTelemetry, g as ensurePostgresLogin, h as LEGACY_LOCAL_LOGIN, nt as stageEnv, q as applyPostgres, s as backendsOf, t as appEnvKeys, v as pgClient, x as imageLayout } from "./apps-Xrlvir2-.mjs";
7
+ import { C as runsRedis, J as logsAccess, Q as withLogsPassword, T as withRedisPassword, U as primaryPortKey, b as REDIS_SERVICE, m as loadLocalCredentials, q as LOGS_SERVICE, y as withGeneratedSecrets } from "./compose-C7izI7Eo.mjs";
8
+ import { $ as applyPolicies, A as findBuildRoot, Q as applyNotifications, S as readLocalAuthority, T as imageLayout, X as applyBuckets, Z as applyLifecycles, _ as pgClient, a as workerEnvKeys, c as constructGlobs, et as applyPostgres, g as bucketClient, h as ensurePostgresLogin, it as postgresStatements, lt as stageEnv, m as LEGACY_LOCAL_LOGIN, s as backendsOf, st as envFor, t as appEnvKeys, v as ensureLocalAuthority, x as localCertificateNames, y as ensureLocalCertificate, yt as usesTelemetry } from "./apps-DFzUuJ22.mjs";
9
9
  import { i as discover } from "./discover-DbDrCQ8h.mjs";
10
- import { a as ensureDockerignore } from "./docker-M4kCqczV.mjs";
11
- import { a as subscriptionKey, c as HostNotPointingAtServer, f as requiredServerAddress, g as stageDns, h as stackHosts, i as recordedPushSubscriptions, n as SUBSCRIPTION_TYPE, o as subscriptionResource, p as serverAddressHint, r as confirmPendingSubscriptions, s as topicConnection, t as PushSubscriptionsUnconfirmed, u as isLocalHost, v as systemLookup } from "./snsSubscriptions-DoZ0Q1n6.mjs";
10
+ import { a as ensureDockerignore } from "./docker-_W_CauBY.mjs";
11
+ import { a as subscriptionKey, c as HostNotPointingAtServer, f as requiredServerAddress, g as stageDns, h as stackHosts, i as recordedPushSubscriptions, n as SUBSCRIPTION_TYPE, o as subscriptionResource, p as serverAddressHint, r as confirmPendingSubscriptions, s as topicConnection, t as PushSubscriptionsUnconfirmed, u as isLocalHost, v as systemLookup } from "./snsSubscriptions-B_WH4o1S.mjs";
12
12
  import { i as installedFrom } from "./drivers-uxLBq3e3.mjs";
13
13
  import { a as dnsResources, c as currentActor, d as DeployJournal, n as reportDatabaseRuns, o as forgetDnsResource, r as reportPlannedSeeds, s as recordDnsChanges, t as DeploySeedsFailed } from "./seeds-BCC8vAXR.mjs";
14
14
  import { f as plannedSeeds, o as SeedFailed, p as seedDatabases, u as migrateDatabases } from "./databases-mzSUFBTw.mjs";
@@ -21,7 +21,8 @@ import { createConnection, createServer } from "node:net";
21
21
  import { createHash } from "node:crypto";
22
22
  import { provideKey } from "@geekmidas/manifest";
23
23
  import { stringify } from "yaml";
24
- import { request } from "node:https";
24
+ import { request } from "node:http";
25
+ import { request as request$1 } from "node:https";
25
26
  //#region src/compose/docker.ts
26
27
  /**
27
28
  * The Docker operations `gkm compose` needs, behind an interface.
@@ -283,14 +284,6 @@ const dockerCompose = {
283
284
  if (code !== 0) return void 0;
284
285
  return stdout.trim().split("\n")[0] || void 0;
285
286
  },
286
- async copyOut(stack, service, from, to) {
287
- await mkdir(dirname(to), { recursive: true });
288
- await run("docker", compose(stack, [
289
- "cp",
290
- `${service}:${from}`,
291
- to
292
- ]), runOptions(stack));
293
- },
294
287
  async push(stack, ref) {
295
288
  const output = await runOutput("docker", ["push", ref], {
296
289
  cwd: stack.cwd,
@@ -798,15 +791,16 @@ function certificatePaths(project) {
798
791
  /**
799
792
  * Register a stack with the edge: its certificate first, where it has one,
800
793
  * so the routes that need it never load without it — then its routes, in one
801
- * rename the edge picks up whole. The certificate is read here and written
802
- * through the engine. The paths written, inside the edge.
794
+ * rename the edge picks up whole. The certificate — the stage's own, or the
795
+ * one gkm's local CA issued the local stage — is PEM read on this machine and
796
+ * written through the engine. The paths written, inside the edge.
803
797
  */
804
798
  async function writeEdgeRoutes(docker, edge, project, routes, certificate) {
805
799
  const written = [];
806
800
  const [crt, key] = certificatePaths(project);
807
801
  if (certificate) {
808
- await put(docker, edge, crt, await readFile(certificate.certFile, "utf-8"));
809
- await put(docker, edge, key, await readFile(certificate.keyFile, "utf-8"), "600");
802
+ await put(docker, edge, crt, certificate.cert);
803
+ await put(docker, edge, key, certificate.key, "600");
810
804
  written.push(crt, key);
811
805
  } else await remove(docker, edge, [crt, key]);
812
806
  await put(docker, edge, routesPath(project), routes);
@@ -1052,26 +1046,67 @@ var HealthRequestTimedOut = class extends GkmError {
1052
1046
  this.name = "HealthRequestTimedOut";
1053
1047
  }
1054
1048
  };
1055
- /** The real probe: one HTTPS GET, the certificate verified. */
1056
- const httpsProbe = ({ url, ca, connectTo, connectPort, authorization, timeoutMs, signal }) => {
1049
+ /** The most of a body read — a sitemap may be 50 MB, and none needs to be. */
1050
+ const EDGE_BODY_LIMIT = 10485760;
1051
+ /** A body larger than {@link EDGE_BODY_LIMIT}. */
1052
+ var EdgeResponseTooLarge = class extends GkmError {
1053
+ url;
1054
+ limit;
1055
+ constructor(url, limit) {
1056
+ super(`${url} answered with more than ${limit} bytes, which is more than gkm reads. Split it — a sitemap index can list several sitemaps.`);
1057
+ this.url = url;
1058
+ this.limit = limit;
1059
+ this.name = "EdgeResponseTooLarge";
1060
+ }
1061
+ };
1062
+ /**
1063
+ * The real request: one GET to the edge — over HTTPS, the certificate
1064
+ * verified, for an `https:` URL, and plain HTTP for an `http:` one — with
1065
+ * the URL's host as SNI and `Host` wherever it connects.
1066
+ */
1067
+ const edgeFetch = ({ url, ca, connectTo, connectPort, authorization, timeoutMs, signal, read }) => {
1057
1068
  const target = new URL(url);
1069
+ const secure = target.protocol === "https:";
1070
+ const request$2 = secure ? request$1 : request;
1058
1071
  return new Promise((resolve, reject) => {
1059
- const req = request({
1072
+ const req = request$2({
1060
1073
  host: connectTo ?? target.hostname,
1061
- port: connectPort ?? (target.port || 443),
1062
- servername: target.hostname,
1074
+ port: connectPort ?? (target.port || (secure ? 443 : 80)),
1075
+ ...secure ? { servername: target.hostname } : {},
1063
1076
  path: `${target.pathname}${target.search}`,
1064
1077
  method: "GET",
1065
1078
  headers: {
1066
1079
  host: target.host,
1067
1080
  ...authorization ? { authorization } : {}
1068
1081
  },
1069
- ...ca ? { ca } : {},
1082
+ ...secure && ca ? { ca } : {},
1070
1083
  ...signal ? { signal } : {},
1071
1084
  timeout: timeoutMs
1072
1085
  }, (res) => {
1073
- res.resume();
1074
- res.on("end", () => resolve(res.statusCode ?? 0));
1086
+ const status = res.statusCode ?? 0;
1087
+ if (!read) {
1088
+ res.resume();
1089
+ res.on("end", () => resolve({
1090
+ status,
1091
+ body: ""
1092
+ }));
1093
+ res.on("error", reject);
1094
+ return;
1095
+ }
1096
+ const chunks = [];
1097
+ let size = 0;
1098
+ res.on("data", (chunk) => {
1099
+ size += chunk.length;
1100
+ if (size > 10485760) {
1101
+ req.destroy(new EdgeResponseTooLarge(url, EDGE_BODY_LIMIT));
1102
+ return;
1103
+ }
1104
+ chunks.push(chunk);
1105
+ });
1106
+ res.on("end", () => resolve({
1107
+ status,
1108
+ body: Buffer.concat(chunks).toString("utf-8")
1109
+ }));
1075
1110
  res.on("error", reject);
1076
1111
  });
1077
1112
  req.on("timeout", () => req.destroy(new HealthRequestTimedOut(url, timeoutMs)));
@@ -1079,6 +1114,8 @@ const httpsProbe = ({ url, ca, connectTo, connectPort, authorization, timeoutMs,
1079
1114
  req.end();
1080
1115
  });
1081
1116
  };
1117
+ /** The real probe: one GET through the edge, answered by its status. */
1118
+ const httpsProbe = (request) => edgeFetch(request).then(({ status }) => status);
1082
1119
  /** Whether a status means the app answered as it should. */
1083
1120
  function isHealthy(status) {
1084
1121
  return status >= 200 && status < 400;
@@ -1220,6 +1257,138 @@ async function ensureTopicSubscriptions(input) {
1220
1257
  }
1221
1258
  return arns;
1222
1259
  }
1260
+ /**
1261
+ * How long one page has to answer: a first render fetches from the site's
1262
+ * APIs, so it is given longer than a health check is.
1263
+ */
1264
+ const WARMUP_TIMEOUT_MS = 3e4;
1265
+ /**
1266
+ * Asks the site for `/`, then for every page its `/sitemap.xml` lists — a
1267
+ * sitemap index's sitemaps followed one level — up to `maxUrls` pages in
1268
+ * all, `concurrency` at a time. Only pages on the site's own origin are
1269
+ * asked: a sitemap may list another's, which this deploy did not start.
1270
+ */
1271
+ async function warmSite(options) {
1272
+ const { fetch, edge = {}, maxUrls = 500, concurrency = 4, timeoutMs = WARMUP_TIMEOUT_MS } = options;
1273
+ const origin = new URL(options.url).origin;
1274
+ const result = {
1275
+ warmed: [],
1276
+ warnings: [],
1277
+ leftOut: 0
1278
+ };
1279
+ /** One GET; a failure is a warning, and `undefined`. */
1280
+ const get = async (url, read) => {
1281
+ try {
1282
+ return await fetch({
1283
+ url,
1284
+ ...edge,
1285
+ timeoutMs,
1286
+ read
1287
+ });
1288
+ } catch (error) {
1289
+ if (edge.signal?.aborted) throw error;
1290
+ result.warnings.push({
1291
+ url,
1292
+ reason: error instanceof HealthRequestTimedOut ? `no answer within ${error.timeoutMs}ms` : error instanceof Error ? error.message : String(error)
1293
+ });
1294
+ return;
1295
+ }
1296
+ };
1297
+ const warm = async (url) => {
1298
+ const response = await get(url, false);
1299
+ if (!response) return;
1300
+ if (isHealthy(response.status)) result.warmed.push(url);
1301
+ else result.warnings.push({
1302
+ url,
1303
+ reason: `HTTP ${response.status}`
1304
+ });
1305
+ };
1306
+ /** A sitemap's `<loc>`s, or none where it has none — or did not answer. */
1307
+ const sitemap = async (url) => {
1308
+ const response = await get(url, true);
1309
+ if (!response) return void 0;
1310
+ if (response.status >= 400 && response.status < 500) return void 0;
1311
+ if (!isHealthy(response.status)) {
1312
+ result.warnings.push({
1313
+ url,
1314
+ reason: `HTTP ${response.status}`
1315
+ });
1316
+ return;
1317
+ }
1318
+ return readSitemap(response.body);
1319
+ };
1320
+ const root = `${origin}/`;
1321
+ await warm(root);
1322
+ const pages = /* @__PURE__ */ new Set([root]);
1323
+ const sameOrigin = (loc) => {
1324
+ if (!URL.canParse(loc, root)) return void 0;
1325
+ const url = new URL(loc, root);
1326
+ url.hash = "";
1327
+ return url.origin === origin ? url.href : void 0;
1328
+ };
1329
+ const list = (locs) => {
1330
+ for (const loc of locs) {
1331
+ const url = sameOrigin(loc);
1332
+ if (url) pages.add(url);
1333
+ }
1334
+ };
1335
+ const top = await sitemap(`${origin}/sitemap.xml`);
1336
+ if (top?.kind === "index") {
1337
+ const read = await pool([...new Set(top.locs.map(sameOrigin).filter((u) => u !== void 0))], concurrency, sitemap);
1338
+ for (const child of read) if (child?.kind === "urlset") list(child.locs);
1339
+ } else if (top) list(top.locs);
1340
+ const listed = [...pages].slice(1);
1341
+ const room = Math.max(0, maxUrls - 1);
1342
+ result.leftOut = Math.max(0, listed.length - room);
1343
+ await pool(listed.slice(0, room), concurrency, warm);
1344
+ return result;
1345
+ }
1346
+ /**
1347
+ * Reads a sitemap (sitemaps.org): each entry's `<loc>`, entity-decoded or
1348
+ * from CDATA. Only an unprefixed `<loc>` is an entry's — an `<image:loc>` is
1349
+ * an image on a page, not a page.
1350
+ */
1351
+ function readSitemap(xml) {
1352
+ const kind = /<(?:[\w-]+:)?sitemapindex[\s>]/.test(xml) ? "index" : "urlset";
1353
+ const locs = [];
1354
+ for (const match of xml.matchAll(/<loc>\s*(?:<!\[CDATA\[([\s\S]*?)\]\]>|([\s\S]*?))\s*<\/loc>/g)) {
1355
+ const loc = match[1] ?? decodeEntities(match[2] ?? "");
1356
+ if (loc.trim()) locs.push(loc.trim());
1357
+ }
1358
+ return {
1359
+ kind,
1360
+ locs
1361
+ };
1362
+ }
1363
+ const ENTITIES = {
1364
+ amp: "&",
1365
+ lt: "<",
1366
+ gt: ">",
1367
+ quot: "\"",
1368
+ apos: "'"
1369
+ };
1370
+ function decodeEntities(text) {
1371
+ return text.replace(/&(#x[\da-f]+|#\d+|amp|lt|gt|quot|apos);/gi, (whole, entity) => {
1372
+ if (entity[0] === "#") {
1373
+ const code = entity[1] === "x" || entity[1] === "X" ? Number.parseInt(entity.slice(2), 16) : Number.parseInt(entity.slice(1), 10);
1374
+ return Number.isFinite(code) ? String.fromCodePoint(code) : whole;
1375
+ }
1376
+ return ENTITIES[entity.toLowerCase()] ?? whole;
1377
+ });
1378
+ }
1379
+ /** Each item through `run`, at most `size` at once, results in order. */
1380
+ async function pool(items, size, run) {
1381
+ const results = new Array(items.length);
1382
+ let next = 0;
1383
+ const worker = async () => {
1384
+ while (next < items.length) {
1385
+ const index = next++;
1386
+ results[index] = await run(items[index]);
1387
+ }
1388
+ };
1389
+ await Promise.all(Array.from({ length: Math.min(size, items.length) }, worker));
1390
+ return results;
1391
+ }
1223
1392
  //#endregion
1224
1393
  //#region src/target/compose/phases.ts
1225
1394
  /**
@@ -1243,7 +1412,8 @@ async function ensureTopicSubscriptions(input) {
1243
1412
  * was released under and the digest it resolved to are written to the
1244
1413
  * stage's state, so "what is this stage running" has an exact answer.
1245
1414
  * - What was started answers (`verify`): each app is asked through Caddy,
1246
- * over HTTPS, with the certificate verified.
1415
+ * over HTTPS, with the certificate verified. Then each server-rendered site
1416
+ * is warmed (`warmup.ts`): a page that fails to warm is said, never failed.
1247
1417
  *
1248
1418
  * Every image is built inside Docker from a pruned slice of the build root —
1249
1419
  * the same Dockerfiles `gkm docker` writes — so nothing is built on this
@@ -1340,6 +1510,7 @@ const defaultDeps = {
1340
1510
  migrate: migrateDatabases,
1341
1511
  seed: seedDatabases,
1342
1512
  probe: httpsProbe,
1513
+ fetch: edgeFetch,
1343
1514
  healthAttempts: 90,
1344
1515
  healthIntervalMs: 2e3,
1345
1516
  env: process.env,
@@ -1483,7 +1654,12 @@ async function validateCompose(ctx, deps, options = {}) {
1483
1654
  async function readyCompose(ctx, run, deps) {
1484
1655
  const { stack } = run;
1485
1656
  if (stack.tls) {
1486
- for (const file of [stack.tls.certFile, stack.tls.keyFile]) if (!existsSync(file)) throw new ComposeTlsFileMissing(ctx.stage, file);
1657
+ const { certFile, keyFile, caFile } = stack.tls;
1658
+ for (const file of [
1659
+ certFile,
1660
+ keyFile,
1661
+ ...caFile ? [caFile] : []
1662
+ ]) if (!existsSync(file)) throw new ComposeTlsFileMissing(ctx.stage, file);
1487
1663
  }
1488
1664
  if (stack.local) return;
1489
1665
  if (run.server && !ctx.dryRun && !run.push) await deps.server.check(run.server);
@@ -2030,13 +2206,12 @@ async function releaseCompose(ctx, run, deps) {
2030
2206
  ...ref.output ? { output: ref.output } : {}
2031
2207
  });
2032
2208
  if (stack.proxy === "traefik" && stack.traefik) {
2033
- const written = await writeEdgeRoutes(deps.docker, edge, stack.project, stack.traefik, stack.tls);
2209
+ const written = await writeEdgeRoutes(deps.docker, edge, stack.project, stack.traefik, await edgeCertificate(run.dir, stack));
2034
2210
  ctx.logger.info(`🌐 Registered ${stack.routes.length} route(s) with ${EDGE_PROJECT}: ${written.at(-1)}`);
2035
- } else if (!stack.local) await removeEdgeRoutes(deps.docker, edge, stack.project);
2211
+ } else if (!stack.local || existsSync(edgeFile(run))) await removeEdgeRoutes(deps.docker, edge, stack.project);
2036
2212
  ctx.logger.info("\n🚀 Starting the stack…");
2037
2213
  const down = await deps.docker.up(ref).then(() => [], (error) => unhealthyAfterUp(ctx, run, deps, error));
2038
2214
  const isDown = new Set(down.map(({ app }) => app));
2039
- if (stack.local) await deps.docker.copyOut(ref, "caddy", "/data/caddy/pki/authorities/local/root.crt", caFile(run)).catch(() => {});
2040
2215
  await recordImages(ctx, run);
2041
2216
  for (const app of stack.apps) {
2042
2217
  if (isDown.has(app.name)) continue;
@@ -2080,7 +2255,8 @@ async function releaseCompose(ctx, run, deps) {
2080
2255
  if (isDown.has(unit.name)) continue;
2081
2256
  ctx.logger.info(` ${unit.name.padEnd(12)} processors of ${unit.id}`);
2082
2257
  }
2083
- if (stack.local) ctx.logger.info(`\n🔐 Certificates are from Caddy's local CA: NODE_EXTRA_CA_CERTS=${join(stackDir(ctx.stage), "caddy-root.crt")}`);
2258
+ if (stack.authority) ctx.logger.info(`\n🔐 Certificates are from gkm's local CA ("gkm trust" trusts it here): NODE_EXTRA_CA_CERTS=${stack.authority.certFile}`);
2259
+ else if (stack.local && stack.tls) ctx.logger.info(stack.tls.caFile ? `\n🔐 Certificates are the stage's own (deploy.compose.tls), from the CA in ${stack.tls.caFile}: NODE_EXTRA_CA_CERTS=${stack.tls.caFile}` : `\n🔐 Certificates are the stage's own (deploy.compose.tls): ${stack.tls.certFile}. Set its caFile to the root it chains to, so gkm and the stack's containers trust it.`);
2084
2260
  if (down.length > 0) throw new ComposeAppsUnhealthy(stack.project, down, stack.proxy, "docker");
2085
2261
  }
2086
2262
  /**
@@ -2143,13 +2319,13 @@ async function recordImages(ctx, run) {
2143
2319
  /**
2144
2320
  * Each app asked through Caddy, over HTTPS, the certificate verified: an API
2145
2321
  * at `/health`, a site at `/`. On the local stage the edge is this machine and
2146
- * its certificates are Caddy's internal CA's, so the CA `release` copied out
2147
- * is the one trusted and the request goes to 127.0.0.1.
2322
+ * its certificate is from gkm's local CA, so that root is the one trusted and
2323
+ * the request goes to 127.0.0.1.
2148
2324
  */
2149
2325
  async function verifyCompose(ctx, run, deps) {
2150
2326
  const { stack } = run;
2151
2327
  if (run.push) return;
2152
- const ca = stack.local ? await readFile(caFile(run), "utf-8").catch(() => void 0) : void 0;
2328
+ const ca = await verifyAuthority(stack);
2153
2329
  ctx.logger.info(`\n🩺 Checking each app through ${stack.proxy === "caddy" ? "Caddy" : "the shared edge"}…`);
2154
2330
  const edge = stack.local ? { connectTo: "127.0.0.1" } : run.server ? {
2155
2331
  connectTo: run.server.host,
@@ -2169,9 +2345,57 @@ async function verifyCompose(ctx, run, deps) {
2169
2345
  if (down.length > 0) throw new ComposeAppsUnhealthy(stack.project, down, stack.proxy);
2170
2346
  await pruneStageDns(ctx, run);
2171
2347
  await confirmSubscriptions(ctx, run, deps);
2348
+ await warmSites(ctx, run, deps, {
2349
+ ca,
2350
+ edge
2351
+ });
2172
2352
  if (stack.logs) reportLogs(ctx, stack.logs, stack.local, run.server);
2173
2353
  }
2174
2354
  /**
2355
+ * Each server-rendered site (`next`, `tanstack`) asked for its `/` and every
2356
+ * page its sitemap lists, through the edge as `checkApp` asks it — see
2357
+ * `warmup.ts`. Its image was built with no API reachable, so each page
2358
+ * renders on its first request: this is that request, made before any
2359
+ * visitor's.
2360
+ *
2361
+ * Only ever said, never failed on: every app is already healthy, and a page
2362
+ * that did not warm renders on the next request for it.
2363
+ */
2364
+ async function warmSites(ctx, run, deps, options) {
2365
+ const { stack } = run;
2366
+ const sites = stack.apps.filter((app) => app.kind === "site" && (app.variant === "next" || app.variant === "tanstack"));
2367
+ if (sites.length === 0) return;
2368
+ ctx.logger.info("\n🔥 Warming each server-rendered site…");
2369
+ for (const app of sites) {
2370
+ if (app.id === stack.wildcard?.site) {
2371
+ ctx.logger.info(` – ${app.name.padEnd(12)} serves every subdomain: there is no one host to warm, so it is skipped`);
2372
+ continue;
2373
+ }
2374
+ try {
2375
+ const { warmed, warnings, leftOut } = await warmSite({
2376
+ url: app.url,
2377
+ fetch: deps.fetch ?? edgeFetch,
2378
+ edge: {
2379
+ ...options.ca ? { ca: options.ca } : {},
2380
+ ...app.auth ? { authorization: basicAuthorization(app.auth) } : {},
2381
+ ...options.edge,
2382
+ signal: ctx.signal
2383
+ }
2384
+ });
2385
+ const said = `warmed ${warmed.length} page(s)${warnings.length > 0 ? `, ${warnings.length} warning(s)` : ""}`;
2386
+ if (warnings.length === 0) ctx.logger.info(` ✓ ${app.name.padEnd(12)} ${said}`);
2387
+ else {
2388
+ ctx.logger.warn(` ⚠ ${app.name.padEnd(12)} ${said}:`);
2389
+ for (const { url, reason } of warnings) ctx.logger.warn(` ${url}: ${reason}`);
2390
+ }
2391
+ if (leftOut > 0) ctx.logger.info(` ${leftOut} more page(s) in its sitemap were not asked: at most 500 are warmed per site`);
2392
+ } catch (error) {
2393
+ if (ctx.signal.aborted) throw error;
2394
+ ctx.logger.warn(` ⚠ ${app.name.padEnd(12)} not warmed: ${error instanceof Error ? error.message : String(error)}`);
2395
+ }
2396
+ }
2397
+ }
2398
+ /**
2175
2399
  * The SNS subscriptions the stage's providers made before the workers were
2176
2400
  * up: each still pending is subscribed again, so SNS resends its
2177
2401
  * confirmation to a worker now there to answer it, and waited on. One still
@@ -2350,9 +2574,6 @@ function composeResult(ctx, run) {
2350
2574
  changes: run.changes
2351
2575
  };
2352
2576
  }
2353
- function caFile(run) {
2354
- return join(run.dir, "caddy-root.crt");
2355
- }
2356
2577
  /** The shared edge's compose file, as this machine hands it to compose. */
2357
2578
  function edgeFile(run) {
2358
2579
  return join(run.dir, `${EDGE_PROJECT}.yml`);
@@ -2366,6 +2587,42 @@ function applied(ctx, run, change) {
2366
2587
  via
2367
2588
  });
2368
2589
  }
2590
+ /**
2591
+ * The root the check after a start trusts, PEM: gkm's on the local stage that
2592
+ * set no certificate of its own, and otherwise the one the stage's own names
2593
+ * (`deploy.compose.tls.<stage>.caFile`). Undefined — Node's own roots, and
2594
+ * `NODE_EXTRA_CA_CERTS` — for a certificate that names none: a public CA's.
2595
+ */
2596
+ async function verifyAuthority(stack) {
2597
+ if (stack.authority) return (await readLocalAuthority(stack.authority)).cert;
2598
+ if (stack.tls?.caFile) return readFile(stack.tls.caFile, "utf-8");
2599
+ }
2600
+ /**
2601
+ * The certificate the stack's proxy serves, PEM: the stage's own where it set
2602
+ * one, the one gkm's local CA issued the local stage otherwise, and none — a
2603
+ * deployed stage's comes from Let's Encrypt — when neither.
2604
+ */
2605
+ async function edgeCertificate(dir, stack) {
2606
+ if (stack.tls) return {
2607
+ cert: await readFile(stack.tls.certFile, "utf-8"),
2608
+ key: await readFile(stack.tls.keyFile, "utf-8")
2609
+ };
2610
+ if (stack.authority) return localEdgeCertificate(dir, stack, stack.authority);
2611
+ }
2612
+ /** Where the local stage's edge certificate is kept, between runs. */
2613
+ const LOCAL_EDGE_CERTIFICATE = "local-edge.pem";
2614
+ /**
2615
+ * The local stage's edge certificate, from gkm's local CA: the one kept in
2616
+ * the stack's directory while it still covers every host, so an unchanged
2617
+ * stack does not recreate its Caddy for a new certificate each run.
2618
+ */
2619
+ async function localEdgeCertificate(dir, stack, authority) {
2620
+ const { cert, key } = await ensureLocalCertificate(await ensureLocalAuthority(authority), localCertificateNames(stack.resolution.project ?? "", stackHosts(stack)), join(dir, LOCAL_EDGE_CERTIFICATE));
2621
+ return {
2622
+ cert,
2623
+ key
2624
+ };
2625
+ }
2369
2626
  /** Write the stack's files: owner-only, since the env files hold secrets. */
2370
2627
  async function writeStack(root, dir, stack) {
2371
2628
  await mkdir(dir, {
@@ -2380,10 +2637,8 @@ async function writeStack(root, dir, stack) {
2380
2637
  await chmod(path, mode);
2381
2638
  files.push(path);
2382
2639
  };
2383
- const tls = stack.proxy === "caddy" && stack.tls ? {
2384
- cert: await readFile(stack.tls.certFile, "utf-8"),
2385
- key: await readFile(stack.tls.keyFile, "utf-8")
2386
- } : void 0;
2640
+ const issued = await edgeCertificate(dir, stack);
2641
+ const tls = stack.proxy === "caddy" ? issued : void 0;
2387
2642
  const compose = stack.caddyfile !== void 0 ? withCaddyConfigs(stack.compose, {
2388
2643
  caddyfile: stack.caddyfile,
2389
2644
  ...tls ? { tls } : {}
@@ -2471,7 +2726,9 @@ function printPlan(ctx, run) {
2471
2726
  * --remove-orphans`, and each app's image, tag and digest in the stage's
2472
2727
  * state — an app that never turns healthy fails it only once the rest is
2473
2728
  * released and routed
2474
- * - `verify`: each app asked through Caddy over HTTPS
2729
+ * - `verify`: each app asked through Caddy over HTTPS, then each
2730
+ * server-rendered site warmed — its `/` and its sitemap's pages asked, a
2731
+ * failure only warned of
2475
2732
  *
2476
2733
  * With `push` (`gkm compose --build --push`), run with `buildOnly`, it builds
2477
2734
  * every image and pushes it to `deploy.registry`, and does nothing else: no
@@ -2521,4 +2778,4 @@ function composeTarget(options = {}) {
2521
2778
  //#endregion
2522
2779
  export { edgePorts as a, edgeRef as c, dockerHost as d, sshAccess as f, projectNetwork as h, ComposePushNeedsBuild as i, removeEdgeRoutes as l, dockerCompose as m, compose_exports as n, stackOverrideFile as o, sshTarget as p, ComposePinNeedsPull as r, deployedStackSecrets as s, composeTarget as t, composeServer as u };
2523
2780
 
2524
- //# sourceMappingURL=compose-CkvPmijw.mjs.map
2781
+ //# sourceMappingURL=compose-CZU60dwb.mjs.map