@geekmidas/cli 10.0.0-alpha.146 → 10.0.0-alpha.148

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 (219) hide show
  1. package/dist/{GoDaddyProvider-BESq24p-.mjs → GoDaddyProvider-CGgS-I6m.mjs} +2 -2
  2. package/dist/{GoDaddyProvider-BESq24p-.mjs.map → GoDaddyProvider-CGgS-I6m.mjs.map} +1 -1
  3. package/dist/{GoDaddyProvider-BK5N6-fx.cjs → GoDaddyProvider-D_dZQJIX.cjs} +2 -2
  4. package/dist/{GoDaddyProvider-BK5N6-fx.cjs.map → GoDaddyProvider-D_dZQJIX.cjs.map} +1 -1
  5. package/dist/{HostingerProvider-BV30wTNI.mjs → HostingerProvider-CWRE6auw.mjs} +2 -2
  6. package/dist/{HostingerProvider-BV30wTNI.mjs.map → HostingerProvider-CWRE6auw.mjs.map} +1 -1
  7. package/dist/{HostingerProvider-BbQod5OB.cjs → HostingerProvider-eGuDBjfN.cjs} +2 -2
  8. package/dist/{HostingerProvider-BbQod5OB.cjs.map → HostingerProvider-eGuDBjfN.cjs.map} +1 -1
  9. package/dist/{LegacyStateStore-Ck3HI28A.mjs → LegacyStateStore-CLyFmPIj.mjs} +2 -2
  10. package/dist/{LegacyStateStore-Ck3HI28A.mjs.map → LegacyStateStore-CLyFmPIj.mjs.map} +1 -1
  11. package/dist/{LegacyStateStore-OEno6vIb.cjs → LegacyStateStore-DyX9-7R_.cjs} +2 -2
  12. package/dist/{LegacyStateStore-OEno6vIb.cjs.map → LegacyStateStore-DyX9-7R_.cjs.map} +1 -1
  13. package/dist/{LocalStateStore-ukDFg6GM.cjs → LocalStateStore-C-v8K8zO.cjs} +2 -2
  14. package/dist/{LocalStateStore-ukDFg6GM.cjs.map → LocalStateStore-C-v8K8zO.cjs.map} +1 -1
  15. package/dist/{LocalStateStore-Fa54CpLw.mjs → LocalStateStore-DQVwsyTh.mjs} +2 -2
  16. package/dist/{LocalStateStore-Fa54CpLw.mjs.map → LocalStateStore-DQVwsyTh.mjs.map} +1 -1
  17. package/dist/{S3StateStore-Cjuft2Lk.cjs → S3StateStore-GA-DOTmj.cjs} +4 -4
  18. package/dist/{S3StateStore-Cjuft2Lk.cjs.map → S3StateStore-GA-DOTmj.cjs.map} +1 -1
  19. package/dist/{S3StateStore-D53985SR.mjs → S3StateStore-gR_6fNF6.mjs} +4 -4
  20. package/dist/{S3StateStore-D53985SR.mjs.map → S3StateStore-gR_6fNF6.mjs.map} +1 -1
  21. package/dist/{SSMStateStore-CRjV2h2G.mjs → SSMStateStore-CT68N-Ti.mjs} +2 -2
  22. package/dist/{SSMStateStore-CRjV2h2G.mjs.map → SSMStateStore-CT68N-Ti.mjs.map} +1 -1
  23. package/dist/{SSMStateStore-CnJgw3_-.cjs → SSMStateStore-kdb9rf7x.cjs} +2 -2
  24. package/dist/{SSMStateStore-CnJgw3_-.cjs.map → SSMStateStore-kdb9rf7x.cjs.map} +1 -1
  25. package/dist/{add-CG_4mNir.cjs → add-C7_WJEv2.cjs} +7 -8
  26. package/dist/{add-CG_4mNir.cjs.map → add-C7_WJEv2.cjs.map} +1 -1
  27. package/dist/{add-D0-1UyFj.mjs → add-CvmRPEfW.mjs} +6 -7
  28. package/dist/{add-D0-1UyFj.mjs.map → add-CvmRPEfW.mjs.map} +1 -1
  29. package/dist/{apps-DHi6E_yH.cjs → apps-ClZkLcMz.cjs} +771 -17
  30. package/dist/apps-ClZkLcMz.cjs.map +1 -0
  31. package/dist/{apps-DWALM-8s.mjs → apps-CmKxFPTj.mjs} +611 -19
  32. package/dist/apps-CmKxFPTj.mjs.map +1 -0
  33. package/dist/{bundler-Cb5ynXXS.mjs → bundler-D6IEJvq4.mjs} +6 -6
  34. package/dist/{bundler-Cb5ynXXS.mjs.map → bundler-D6IEJvq4.mjs.map} +1 -1
  35. package/dist/{bundler-Co_7zpYC.cjs → bundler-Ronn7-mL.cjs} +6 -6
  36. package/dist/{bundler-Co_7zpYC.cjs.map → bundler-Ronn7-mL.cjs.map} +1 -1
  37. package/dist/{cli-D_9WqN6C.mjs → cli-AZVyGSRn.mjs} +4 -4
  38. package/dist/{cli-D_9WqN6C.mjs.map → cli-AZVyGSRn.mjs.map} +1 -1
  39. package/dist/{cli-C5M_7Kux.cjs → cli-B1g2OvS0.cjs} +4 -4
  40. package/dist/{cli-C5M_7Kux.cjs.map → cli-B1g2OvS0.cjs.map} +1 -1
  41. package/dist/{compose-BeQ01iYk.cjs → compose-B5AsRVqr.cjs} +291 -36
  42. package/dist/compose-B5AsRVqr.cjs.map +1 -0
  43. package/dist/{compose-DxmEMeTu.mjs → compose-BRNMF29g.mjs} +286 -31
  44. package/dist/compose-BRNMF29g.mjs.map +1 -0
  45. package/dist/{compose-7p0-3ogo.mjs → compose-DNuENvIt.mjs} +15 -9
  46. package/dist/{compose-7p0-3ogo.mjs.map → compose-DNuENvIt.mjs.map} +1 -1
  47. package/dist/{compose-C10hkeHU.cjs → compose-DVPWitEu.cjs} +32 -8
  48. package/dist/{compose-C10hkeHU.cjs.map → compose-DVPWitEu.cjs.map} +1 -1
  49. package/dist/{config-B-wza0Xk.mjs → config-BLrAd7Of.mjs} +2 -2
  50. package/dist/{config-B-wza0Xk.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-CWExbDxA.cjs → config-juUyBlb1.cjs} +2 -2
  54. package/dist/{config-CWExbDxA.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-Csnd7M8M.cjs → credentials-CrQglKgo.cjs} +6 -70
  62. package/dist/credentials-CrQglKgo.cjs.map +1 -0
  63. package/dist/{credentials-B5Oe4fLE.mjs → credentials-FRF4PZYo.mjs} +8 -42
  64. package/dist/credentials-FRF4PZYo.mjs.map +1 -0
  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-6DDEG4Ai.mjs → deploy-DI_tg5Mi.mjs} +13 -13
  72. package/dist/{deploy-6DDEG4Ai.mjs.map → deploy-DI_tg5Mi.mjs.map} +1 -1
  73. package/dist/{deploy-BwNxJ3ZI.cjs → deploy-DTBod420.cjs} +31 -31
  74. package/dist/{deploy-BwNxJ3ZI.cjs.map → deploy-DTBod420.cjs.map} +1 -1
  75. package/dist/{docker-BZnNUJCy.cjs → docker-CnWX5QNR.cjs} +8 -8
  76. package/dist/{docker-BZnNUJCy.cjs.map → docker-CnWX5QNR.cjs.map} +1 -1
  77. package/dist/{docker-Ch5aPQ04.mjs → docker-DsJNWnaX.mjs} +5 -5
  78. package/dist/{docker-Ch5aPQ04.mjs.map → docker-DsJNWnaX.mjs.map} +1 -1
  79. package/dist/{dokploy-Cn7dQqmE.cjs → dokploy-CxttPnYP.cjs} +2 -2
  80. package/dist/{dokploy-Cn7dQqmE.cjs.map → dokploy-CxttPnYP.cjs.map} +1 -1
  81. package/dist/{dokploy-CTWw3WSo.mjs → dokploy-Dd2mXHgX.mjs} +2 -2
  82. package/dist/{dokploy-CTWw3WSo.mjs.map → dokploy-Dd2mXHgX.mjs.map} +1 -1
  83. package/dist/{eas-IPjz0PWK.cjs → eas-B-JskJLP.cjs} +3 -3
  84. package/dist/{eas-IPjz0PWK.cjs.map → eas-B-JskJLP.cjs.map} +1 -1
  85. package/dist/{eas-D0B8H7hT.mjs → eas-B_yjP_Sl.mjs} +3 -3
  86. package/dist/{eas-D0B8H7hT.mjs.map → eas-B_yjP_Sl.mjs.map} +1 -1
  87. package/dist/{encryption-C9auXcSV.mjs → encryption-dUnvnbu8.mjs} +4 -4
  88. package/dist/{encryption-C9auXcSV.mjs.map → encryption-dUnvnbu8.mjs.map} +1 -1
  89. package/dist/{encryption-vK64UP4M.cjs → encryption-yW6cWTsN.cjs} +4 -4
  90. package/dist/{encryption-vK64UP4M.cjs.map → encryption-yW6cWTsN.cjs.map} +1 -1
  91. package/dist/{engine-C3N2WhbC.mjs → engine-W1gbyy7T.mjs} +17 -12
  92. package/dist/engine-W1gbyy7T.mjs.map +1 -0
  93. package/dist/{engine-Icqv5JI6.cjs → engine-oBwumCI2.cjs} +21 -16
  94. package/dist/engine-oBwumCI2.cjs.map +1 -0
  95. package/dist/{github-D24wTOe2.mjs → github-D2-FIlNY.mjs} +8 -9
  96. package/dist/{github-D24wTOe2.mjs.map → github-D2-FIlNY.mjs.map} +1 -1
  97. package/dist/{github-DUuNInc0.cjs → github-DLucfS9E.cjs} +9 -10
  98. package/dist/{github-DUuNInc0.cjs.map → github-DLucfS9E.cjs.map} +1 -1
  99. package/dist/{googlePlay-BGDKlnPx.cjs → googlePlay-C91kIbBZ.cjs} +5 -5
  100. package/dist/{googlePlay-BGDKlnPx.cjs.map → googlePlay-C91kIbBZ.cjs.map} +1 -1
  101. package/dist/{googlePlay-Cy-MaYr2.mjs → googlePlay-CapfGnZ8.mjs} +5 -5
  102. package/dist/{googlePlay-Cy-MaYr2.mjs.map → googlePlay-CapfGnZ8.mjs.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 +99 -81
  108. package/dist/index.cjs.map +1 -1
  109. package/dist/index.mjs +87 -69
  110. package/dist/index.mjs.map +1 -1
  111. package/dist/{local-CdpBgn3d.mjs → local-2SR2d_BC.mjs} +2 -2
  112. package/dist/{local-CdpBgn3d.mjs.map → local-2SR2d_BC.mjs.map} +1 -1
  113. package/dist/{local-B4xobzh-.cjs → local-l5_-A-zI.cjs} +2 -2
  114. package/dist/{local-B4xobzh-.cjs.map → local-l5_-A-zI.cjs.map} +1 -1
  115. package/dist/{migrate--hMBtpx-.cjs → migrate-B05YVukh.cjs} +4 -4
  116. package/dist/{migrate--hMBtpx-.cjs.map → migrate-B05YVukh.cjs.map} +1 -1
  117. package/dist/{migrate-DVrXTq58.mjs → migrate-C0ecSkL2.mjs} +4 -4
  118. package/dist/{migrate-DVrXTq58.mjs.map → migrate-C0ecSkL2.mjs.map} +1 -1
  119. package/dist/{migrate-DwQ-zaMy.cjs → migrate-DNLNhKNT.cjs} +6 -6
  120. package/dist/{migrate-DwQ-zaMy.cjs.map → migrate-DNLNhKNT.cjs.map} +1 -1
  121. package/dist/{migrate-DhZfvCkJ.mjs → migrate-KdqlzELQ.mjs} +6 -6
  122. package/dist/{migrate-DhZfvCkJ.mjs.map → migrate-KdqlzELQ.mjs.map} +1 -1
  123. package/dist/{notes-z5OOMqm4.mjs → notes-Cj8jL1kS.mjs} +4 -4
  124. package/dist/{notes-z5OOMqm4.mjs.map → notes-Cj8jL1kS.mjs.map} +1 -1
  125. package/dist/{notes-C2b5RzGl.cjs → notes-DTTUGZyi.cjs} +4 -4
  126. package/dist/{notes-C2b5RzGl.cjs.map → notes-DTTUGZyi.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-DPD0_B8N.mjs → projectBucket-6BKUPlDp.mjs} +2 -2
  132. package/dist/{projectBucket-DPD0_B8N.mjs.map → projectBucket-6BKUPlDp.mjs.map} +1 -1
  133. package/dist/{projectBucket-Dk_aZ1cD.cjs → projectBucket-CjJB-nom.cjs} +2 -2
  134. package/dist/{projectBucket-Dk_aZ1cD.cjs.map → projectBucket-CjJB-nom.cjs.map} +1 -1
  135. package/dist/{publish-CDvh-9OG.cjs → publish-Cj36G3de.cjs} +2 -2
  136. package/dist/{publish-CDvh-9OG.cjs.map → publish-Cj36G3de.cjs.map} +1 -1
  137. package/dist/{publish-Bmc1Wfs3.mjs → publish-DRsFN1td.mjs} +2 -2
  138. package/dist/{publish-Bmc1Wfs3.mjs.map → publish-DRsFN1td.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-CuxPZ3ga.cjs → resolve-C1NkdIcy.cjs} +4 -4
  142. package/dist/{resolve-CuxPZ3ga.cjs.map → resolve-C1NkdIcy.cjs.map} +1 -1
  143. package/dist/{resolve-DHARlMdl.mjs → resolve-DjbMNLt-.mjs} +4 -4
  144. package/dist/{resolve-DHARlMdl.mjs.map → resolve-DjbMNLt-.mjs.map} +1 -1
  145. package/dist/{rollback-DxHut8C-.cjs → rollback-531Va3dw.cjs} +7 -7
  146. package/dist/{rollback-DxHut8C-.cjs.map → rollback-531Va3dw.cjs.map} +1 -1
  147. package/dist/{rollback-DZq_dIbl.mjs → rollback-D0ZpwlFq.mjs} +7 -7
  148. package/dist/{rollback-DZq_dIbl.mjs.map → rollback-D0ZpwlFq.mjs.map} +1 -1
  149. package/dist/{runtime-Bvgyxm88.d.cts → 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-CeAt1IJd.d.mts → 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-Dhy58V_y.cjs → s3-BSfFgbms.cjs} +3 -3
  154. package/dist/{s3-Dhy58V_y.cjs.map → s3-BSfFgbms.cjs.map} +1 -1
  155. package/dist/{s3-Cd7UK2y8.mjs → s3-Ho00alt7.mjs} +3 -3
  156. package/dist/{s3-Cd7UK2y8.mjs.map → s3-Ho00alt7.mjs.map} +1 -1
  157. package/dist/{serverSetup-qe5bdBhO.mjs → serverSetup-BW1RgJXo.mjs} +7 -7
  158. package/dist/{serverSetup-qe5bdBhO.mjs.map → serverSetup-BW1RgJXo.mjs.map} +1 -1
  159. package/dist/{serverSetup-DYiKHMVp.cjs → serverSetup-C59lCe80.cjs} +7 -7
  160. package/dist/{serverSetup-DYiKHMVp.cjs.map → serverSetup-C59lCe80.cjs.map} +1 -1
  161. package/dist/{sniffer-DFix2ORf.cjs → sniffer-BL7X_kzC.cjs} +7 -7
  162. package/dist/{sniffer-DFix2ORf.cjs.map → sniffer-BL7X_kzC.cjs.map} +1 -1
  163. package/dist/{sniffer-BNcLP8MO.mjs → sniffer-DrmSlwg9.mjs} +7 -7
  164. package/dist/{sniffer-BNcLP8MO.mjs.map → sniffer-DrmSlwg9.mjs.map} +1 -1
  165. package/dist/{snsSubscriptions-Dr-gJWtR.cjs → snsSubscriptions-B8nZBBEE.cjs} +3 -3
  166. package/dist/{snsSubscriptions-Dr-gJWtR.cjs.map → snsSubscriptions-B8nZBBEE.cjs.map} +1 -1
  167. package/dist/{snsSubscriptions-BwX28_Kl.mjs → snsSubscriptions-DF7YGauz.mjs} +3 -3
  168. package/dist/{snsSubscriptions-BwX28_Kl.mjs.map → snsSubscriptions-DF7YGauz.mjs.map} +1 -1
  169. package/dist/{sst-Bvtx6uZ9.mjs → sst-C-RSpWC2.mjs} +5 -5
  170. package/dist/{sst-Bvtx6uZ9.mjs.map → sst-C-RSpWC2.mjs.map} +1 -1
  171. package/dist/{sst-CoKFPW7f.cjs → sst-Dvko43Y3.cjs} +5 -5
  172. package/dist/{sst-CoKFPW7f.cjs.map → sst-Dvko43Y3.cjs.map} +1 -1
  173. package/dist/{stack-BeSbt_7k.mjs → stack-CVzOFHed.mjs} +70 -387
  174. package/dist/stack-CVzOFHed.mjs.map +1 -0
  175. package/dist/{stack-DbaKGKnI.cjs → stack-l_eQ63Gl.cjs} +73 -462
  176. package/dist/stack-l_eQ63Gl.cjs.map +1 -0
  177. package/dist/{stage-BblkSR2C.mjs → stage-JMlDwobz.mjs} +18 -15
  178. package/dist/stage-JMlDwobz.mjs.map +1 -0
  179. package/dist/{stage-DI5mzoAi.cjs → stage-_vzQ82Gz.cjs} +19 -16
  180. package/dist/stage-_vzQ82Gz.cjs.map +1 -0
  181. package/dist/{stages-C-bVwvJZ.cjs → stages-Bs1THSy7.cjs} +3 -3
  182. package/dist/{stages-C-bVwvJZ.cjs.map → stages-Bs1THSy7.cjs.map} +1 -1
  183. package/dist/{stages-DBsDvEbo.mjs → stages-_xCG4Ymu.mjs} +3 -3
  184. package/dist/{stages-DBsDvEbo.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-DDqusYW0.mjs → terminal-BnKPi06T.mjs} +2 -2
  190. package/dist/{terminal-DDqusYW0.mjs.map → terminal-BnKPi06T.mjs.map} +1 -1
  191. package/dist/{terminal-Bxy_A8iP.cjs → terminal-CdPFlCS_.cjs} +2 -2
  192. package/dist/{terminal-Bxy_A8iP.cjs.map → terminal-CdPFlCS_.cjs.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-BbbkJDUU.cjs → workspace-1szcahj9.cjs} +19 -27
  202. package/dist/workspace-1szcahj9.cjs.map +1 -0
  203. package/dist/{workspace-CZGJdcTs.mjs → workspace-DFGsrjGD.mjs} +19 -27
  204. package/dist/workspace-DFGsrjGD.mjs.map +1 -0
  205. package/package.json +15 -15
  206. package/dist/apps-DHi6E_yH.cjs.map +0 -1
  207. package/dist/apps-DWALM-8s.mjs.map +0 -1
  208. package/dist/compose-BeQ01iYk.cjs.map +0 -1
  209. package/dist/compose-DxmEMeTu.mjs.map +0 -1
  210. package/dist/credentials-B5Oe4fLE.mjs.map +0 -1
  211. package/dist/credentials-Csnd7M8M.cjs.map +0 -1
  212. package/dist/engine-C3N2WhbC.mjs.map +0 -1
  213. package/dist/engine-Icqv5JI6.cjs.map +0 -1
  214. package/dist/stack-BeSbt_7k.mjs.map +0 -1
  215. package/dist/stack-DbaKGKnI.cjs.map +0 -1
  216. package/dist/stage-BblkSR2C.mjs.map +0 -1
  217. package/dist/stage-DI5mzoAi.cjs.map +0 -1
  218. package/dist/workspace-BbbkJDUU.cjs.map +0 -1
  219. package/dist/workspace-CZGJdcTs.mjs.map +0 -1
@@ -1,331 +1,18 @@
1
1
  import { t as GkmError } from "./errors-D8Gwp5kU.mjs";
2
- import { D as originSecretKey, O as processorOriginHost, a as findRootDomain, o as normalizeDnsConfig, rt as imageRef, w as ORIGIN_VERIFY_HEADER } from "./credentials-B5Oe4fLE.mjs";
3
- import { B as LOGS_PORT, I as otlpTelemetryEnv, L as resolveStageTelemetry, ht as checkStageBackups, lt as certificateFor, ut as proxyFor, yt as isReservedStageKey, z as telemetryEnv } from "./workspace-CZGJdcTs.mjs";
4
- import { $ as NoDomainForStage, B as portKeys, H as postgresImage, L as DEFAULT_IMAGES, M as EMULATOR_ACCESS_KEY_ID, S as redisService, Y as logsService, Z as stackLogs, b as REDIS_SERVICE, g as postgresSuperuser, h as postgresRoleSlug, j as watchedBuckets, k as minioWebhookEnv, n as composeFor, nt as resolveHost, p as LOCAL_RABBITMQ_USER, q as LOGS_SERVICE, tt as isMainFrontendApp, w as stackRedis, x as STACK_CACHE } from "./compose-7p0-3ogo.mjs";
5
- import { $ as bucketPolicies, D as TURBO_VERSION, E as PROCESSOR_PORT, G as processorUnits, H as publicBuildValues, K as workerUnits, O as WORKER_PORT, Q as bucketLifecycles, _t as LOCAL_TLD, a as workerEnvKeys, at as localRolePassword, b as localAuthorityPaths, ct as planFor, dt as isTelemetryKey, ft as scopeTelemetryEnv, gt as usesTelemetry, ht as telemetryOf, i as processorEnvKeys, nt as quoteIdentifier, r as networkEnv, t as appEnvKeys, vt as hostFor, w as composeBuildPaths } from "./apps-DWALM-8s.mjs";
2
+ import { Q as imageRef, a as findRootDomain, o as normalizeDnsConfig } from "./credentials-FRF4PZYo.mjs";
3
+ import { B as LOGS_PORT, I as otlpTelemetryEnv, L as resolveStageTelemetry, lt as certificateFor, ut as proxyFor, yt as isReservedStageKey, z as telemetryEnv } from "./workspace-DFGsrjGD.mjs";
4
+ import { $ as publicBuildValues, A as originSecretKey, At as isTelemetryKey, D as ORIGIN_VERIFY_HEADER, Dt as planFor, F as PROCESSOR_PORT, Ft as usesTelemetry, Gt as stageBackups, I as TURBO_VERSION, It as LOCAL_TLD, L as WORKER_PORT, Lt as clientIpRule, N as composeBuildPaths, Pt as telemetryOf, Q as offlineBuildHosts, Rt as hostFor, Z as OFFLINE_BUILD_ADDRESS, _t as bucketLifecycles, a as networkEnv, at as workerUnits, dt as stackBackups, et as runsServer, it as processorUnits, j as processorOriginHost, jt as scopeTelemetryEnv, ot as BACKUPS_SERVICE, s as processEnvKeys, ut as backupsService, vt as bucketPolicies, w as localAuthorityPaths, wt as localRolePassword } from "./apps-CmKxFPTj.mjs";
5
+ import { A as minioWebhookEnv, C as redisService, M as watchedBuckets, N as EMULATOR_ACCESS_KEY_ID, Q as logsService, R as DEFAULT_IMAGES, S as STACK_CACHE, T as stackRedis, V as portKeys, X as LOGS_SERVICE, at as resolveHost, et as stackLogs, g as postgresSuperuser, it as isMainFrontendApp, n as composeFor, nt as NoDomainForStage, p as LOCAL_RABBITMQ_USER, x as REDIS_SERVICE } from "./compose-DNuENvIt.mjs";
6
6
  import { a as SNS_SUBSCRIPTIONS_KEY, c as INBOX_RELAY_TOKEN_KEY, d as inboxWebhookUrl, o as objectsRoute, s as subscriberRoute, u as inboxRelayWorker } from "./SubscriberGenerator-CzPrixYu.mjs";
7
- import { g as appKey } from "./config-B-wza0Xk.mjs";
7
+ import { g as appKey } from "./config-BLrAd7Of.mjs";
8
8
  import { n as DEFAULT_EVENTS } from "./types-Y1NfWlyG.mjs";
9
- import { _ as suppliedOnly, f as devServicesUsed, g as stageServiceDeclarations, i as stageProviderNotes, p as externalServices } from "./notes-z5OOMqm4.mjs";
10
- import { o as processorDockerfile, r as appDockerfile, s as workerDockerfile, v as validateImageRef } from "./docker-Ch5aPQ04.mjs";
11
- import { createRequire } from "node:module";
12
- import { dirname, join } from "node:path";
13
- import { existsSync, readFileSync } from "node:fs";
9
+ import { _ as suppliedOnly, f as devServicesUsed, g as stageServiceDeclarations, i as stageProviderNotes, p as externalServices } from "./notes-Cj8jL1kS.mjs";
10
+ import { o as processorDockerfile, r as appDockerfile, s as workerDockerfile, v as validateImageRef } from "./docker-DsJNWnaX.mjs";
11
+ import { join } from "node:path";
14
12
  import { createHash } from "node:crypto";
15
- import { CLIENT_IP_HEADER, DEFAULT_POSTGRES_VERSION, WILDCARD_SUBDOMAIN, isWildcardSite, kebabCase, provideKey, provisionOrder } from "@geekmidas/manifest";
16
- import { fileURLToPath } from "node:url";
13
+ import { CLIENT_IP_HEADER, EDGE_TOKEN_HEADER, EDGE_TOKEN_KEY, WILDCARD_SUBDOMAIN, isWildcardSite, provideKey, provisionOrder } from "@geekmidas/manifest";
17
14
  import { stringify } from "yaml";
18
15
  import bcrypt from "bcryptjs";
19
- //#region src/providers/dns.ts
20
- /** Whether the workspace deploys through the compose target. */
21
- function deploysWithCompose(workspace) {
22
- return workspace.deploy?.default === "compose" || Object.values(workspace.apps).some((app) => app.resolvedDeployTarget === "compose");
23
- }
24
- //#endregion
25
- //#region src/backups/config.ts
26
- /**
27
- * Which stages take backups, and where they are kept.
28
- *
29
- * A deployed compose stage whose stack runs Postgres is backed up by
30
- * default — every day at 02:00 UTC, kept 30 days — unless
31
- * `deploy.backups.<stage>` says otherwise. The local stage never is.
32
- *
33
- * Every backup is kept in the project bucket (`providers/projectBucket.ts`),
34
- * beside the stage's deploy state, one folder per run and one file per
35
- * database:
36
- *
37
- * ```
38
- * gkm/<project>/<stage>/backups/2026-10-10/02-00-00Z/database.sql.gz
39
- * gkm/<project>/<stage>/backups/2026-10-10/02-00-00Z/auth-database.sql.gz
40
- * ```
41
- *
42
- * The file is named after the database's construct, the way its migrations
43
- * folder is: `AuthDatabase` is `db/auth-database`, and `auth-database.sql.gz`.
44
- */
45
- /** Whether the stack runs Postgres: some construct is a database. */
46
- function runsPostgres(manifest) {
47
- return Object.values(manifest).some((d) => d.kind === "database");
48
- }
49
- /**
50
- * What `stage`'s backups are: on — by its entry or the default — off by
51
- * `false`, or none, for the local stage, a stage compose does not deploy,
52
- * and a stack with no database.
53
- */
54
- function stageBackups(workspace, manifest, stage) {
55
- if (stage === workspace.stages?.local) return {
56
- mode: "none",
57
- reason: "local"
58
- };
59
- if (!deploysWithCompose(workspace)) return {
60
- mode: "none",
61
- reason: "not-compose"
62
- };
63
- if (!runsPostgres(manifest)) return {
64
- mode: "none",
65
- reason: "no-postgres"
66
- };
67
- const value = (workspace.deploy?.backups)?.[stage];
68
- const checked = checkStageBackups(stage, value ?? {});
69
- if (checked === false) return { mode: "disabled" };
70
- return {
71
- mode: "on",
72
- backups: checked,
73
- source: value === void 0 ? "default" : "config"
74
- };
75
- }
76
- /**
77
- * Where a stage's backups are, in the project bucket — under the same
78
- * `<prefix>/<project>/<stage>` its deploy state is: `gkm/shop/production/backups`.
79
- */
80
- function backupsPrefix(workspace, stage) {
81
- const state = workspace.state;
82
- const prefix = state?.provider === "s3" && state.prefix !== void 0 ? state.prefix.replace(/\/+$/, "") : "gkm";
83
- return `${prefix ? `${prefix}/` : ""}${workspace.name}/${stage}/backups`;
84
- }
85
- /** A run folder's time back, or `undefined` for a key that is not one. */
86
- function runTime(folder) {
87
- const match = /^(\d{4}-\d{2}-\d{2})\/(\d{2})-(\d{2})-(\d{2})Z$/.exec(folder);
88
- if (!match) return void 0;
89
- const at = /* @__PURE__ */ new Date(`${match[1]}T${match[2]}:${match[3]}:${match[4]}Z`);
90
- return Number.isNaN(at.getTime()) ? void 0 : at;
91
- }
92
- /** A database's file in a run's folder: `auth-database.sql.gz`. */
93
- function backupFile(database) {
94
- return `${database.file}.sql.gz`;
95
- }
96
- /** Each database the stack runs, by its construct and its name in Postgres. */
97
- function backupDatabases(resources) {
98
- return resources.filter((r) => r.kind === "database").map((r) => ({
99
- id: r.id,
100
- file: kebabCase(r.id),
101
- name: r.name
102
- })).sort((a, b) => a.file.localeCompare(b.file));
103
- }
104
- /**
105
- * The expiry of every stage's backups, by each stage's own entry — what the
106
- * project bucket's lifecycle carries beside its own rule.
107
- *
108
- * A put replaces a bucket's whole lifecycle, so this is built from every
109
- * deployed stage each time, never from the stage being deployed alone: one
110
- * stage's deploy keeps every other's rule. A stage set to `false` has none,
111
- * and its backups are kept until someone deletes them.
112
- */
113
- function backupExpiries(workspace, manifest) {
114
- const expiries = [];
115
- for (const stage of [...workspace.stages?.deployed ?? []].sort()) {
116
- const choice = stageBackups(workspace, manifest, stage);
117
- if (choice.mode !== "on") continue;
118
- expiries.push({
119
- id: `gkm-backups-${stage}`,
120
- prefix: `${backupsPrefix(workspace, stage)}/`,
121
- days: choice.backups.keepDays,
122
- abortIncompleteDays: 1
123
- });
124
- }
125
- return expiries;
126
- }
127
- //#endregion
128
- //#region src/backups/service.ts
129
- /**
130
- * The stack's `backups` service: what a deployed compose stage with Postgres
131
- * runs beside its apps, unless `deploy.backups.<stage>` is `false`.
132
- *
133
- * - **The image** is built from the stack's own Postgres image —
134
- * `postgres:<major>-alpine`, already on the server for the stack, and with
135
- * the `pg_dump` that matches the server — with Node added and gkm's runner
136
- * (`runner.ts`) copied in. Nothing is pulled that the stack does not have,
137
- * and nothing is mounted from the host: the build context is two files.
138
- * - **Its key** is `BACKUPS_URL`, from the stage's secrets, like any app's:
139
- * allowed to put objects under the stage's backups prefix and nothing else.
140
- * The server holds no AWS credentials of its own.
141
- * - **Its login** is a role of its own, `<project>_backups`, granted
142
- * `pg_read_all_data` — it can read every database and write none. Postgres
143
- * before 14 has no such role, and there it signs in as the stack's
144
- * superuser.
145
- * - **Its health** is the last good run: unhealthy once that is more than
146
- * twice the schedule's longest gap old, after a startup grace.
147
- */
148
- /** The service's name in the stack. */
149
- const BACKUPS_SERVICE = "backups";
150
- /** The secret its key is written to. */
151
- const BACKUPS_URL_KEY = "BACKUPS_URL";
152
- /** Where the runner is, in the image. */
153
- const RUNNER_PATH = "/gkm/backup.mjs";
154
- /** The first Postgres with `pg_read_all_data`. */
155
- const READ_ALL_DATA_SINCE = 14;
156
- /** A stage that backs up, and no key to back up with. */
157
- var BackupsUrlMissing = class extends GkmError {
158
- stage;
159
- constructor(stage) {
160
- super(`'${stage}' runs Postgres, so its stack backs it up, and its secrets hold no ${BACKUPS_URL_KEY} to back up with. The deploy writes it — the IAM user and key it creates in the stage's AWS account — so run the deploy with the account's credentials. To take no backups on this stage, set deploy.backups.${stage}: false.`);
161
- this.stage = stage;
162
- this.name = "BackupsUrlMissing";
163
- }
164
- };
165
- /** The backups role: `<project>_backups`, as the superuser is `<project>_admin`. */
166
- function backupsRole(project) {
167
- return `${postgresRoleSlug(project)}_backups`;
168
- }
169
- /**
170
- * The runner's source, as JavaScript: the built `backups/runner.mjs` beside
171
- * the CLI's bundle, or — run from source — `runner.ts`, with its types
172
- * stripped by esbuild.
173
- */
174
- function runnerSource() {
175
- const here = dirname(fileURLToPath(import.meta.url));
176
- for (const path of [
177
- join(here, "backups", "runner.mjs"),
178
- join(here, "runner.mjs"),
179
- join(here, "..", "backups", "runner.mjs")
180
- ]) if (existsSync(path)) return readFileSync(path, "utf-8");
181
- const { transformSync } = createRequire(import.meta.url)("esbuild");
182
- return transformSync(readFileSync(join(here, "runner.ts"), "utf-8"), {
183
- loader: "ts",
184
- format: "esm",
185
- target: "node22"
186
- }).code;
187
- }
188
- /** The image's Dockerfile: the stack's Postgres, Node, and the runner. */
189
- function backupsDockerfile(from) {
190
- return `# Generated by gkm — the stage's backups: pg_dump from ${from}, and gkm's uploader.
191
- FROM ${from}
192
- RUN apk add --no-cache nodejs
193
- COPY backup.mjs ${RUNNER_PATH}
194
- USER postgres
195
- ENTRYPOINT []
196
- CMD ["node", "${RUNNER_PATH}", "serve"]
197
- `;
198
- }
199
- /**
200
- * The stack's backups service, for a stage whose backups are on.
201
- *
202
- * @throws {BackupsUrlMissing} when the stage's secrets hold no key
203
- */
204
- function stackBackups(input) {
205
- const { plan, stage } = input;
206
- const version = plan.resources.find((r) => r.version)?.version ?? DEFAULT_POSTGRES_VERSION;
207
- const from = postgresImage(version);
208
- const script = runnerSource();
209
- const dockerfile = backupsDockerfile(from);
210
- const hash = createHash("sha256").update(dockerfile).update(script).digest("hex").slice(0, 12);
211
- const readOnly = version >= READ_ALL_DATA_SINCE;
212
- const role = backupsRole(input.workspace.name);
213
- const login = readOnly ? {
214
- user: role,
215
- password: localRolePassword(input.workspace.name, plan, role, input.seed)
216
- } : input.superuser;
217
- const databases = backupDatabases(plan.resources);
218
- const prefix = backupsPrefix(input.workspace, stage);
219
- const { kind, ...schedule } = input.backups.schedule;
220
- let env = {};
221
- if (!input.buildOnly) {
222
- const url = input.custom[BACKUPS_URL_KEY];
223
- if (!url) throw new BackupsUrlMissing(stage);
224
- env = {
225
- BACKUPS_URL: url,
226
- BACKUPS_PREFIX: prefix,
227
- BACKUPS_DATABASES: JSON.stringify(databases.map(({ file, name }) => ({
228
- file,
229
- name
230
- }))),
231
- BACKUPS_SCHEDULE: JSON.stringify(kind === "cron" ? {
232
- kind,
233
- minutes: input.backups.schedule.minutes,
234
- hours: input.backups.schedule.hours,
235
- days: input.backups.schedule.days,
236
- months: input.backups.schedule.months,
237
- weekdays: input.backups.schedule.weekdays
238
- } : {
239
- kind,
240
- ...schedule
241
- }),
242
- BACKUPS_MAX_GAP_SECONDS: String(input.backups.maxGapSeconds),
243
- PGHOST: "postgres",
244
- PGPORT: "5432",
245
- PGUSER: login.user,
246
- PGPASSWORD: login.password,
247
- ...input.telemetry?.OTEL_EXPORTER_OTLP_ENDPOINT ? {
248
- OTEL_EXPORTER_OTLP_ENDPOINT: input.telemetry.OTEL_EXPORTER_OTLP_ENDPOINT,
249
- ...input.telemetry.OTEL_EXPORTER_OTLP_HEADERS ? { OTEL_EXPORTER_OTLP_HEADERS: input.telemetry.OTEL_EXPORTER_OTLP_HEADERS } : {},
250
- OTEL_SERVICE_NAME: BACKUPS_SERVICE
251
- } : {}
252
- };
253
- }
254
- return {
255
- backups: input.backups,
256
- databases,
257
- prefix,
258
- from,
259
- image: `${input.project}-backups:pg${version}-${hash}`,
260
- files: {
261
- Dockerfile: dockerfile,
262
- "backup.mjs": script
263
- },
264
- login,
265
- readOnly,
266
- env
267
- };
268
- }
269
- /** The service in the stack's compose file. */
270
- function backupsService(backups, envFiles) {
271
- return {
272
- image: backups.image,
273
- build: {
274
- context: `./${BACKUPS_SERVICE}`,
275
- dockerfile: "Dockerfile"
276
- },
277
- pull_policy: "build",
278
- restart: "unless-stopped",
279
- ...envFiles ? { env_file: [{
280
- path: `./${BACKUPS_SERVICE}.env`,
281
- format: "raw"
282
- }] } : {},
283
- depends_on: { postgres: { condition: "service_healthy" } },
284
- healthcheck: {
285
- test: [
286
- "CMD",
287
- "node",
288
- RUNNER_PATH,
289
- "health"
290
- ],
291
- interval: "1m",
292
- timeout: "10s",
293
- retries: 3,
294
- start_period: "30s"
295
- }
296
- };
297
- }
298
- /**
299
- * The backups role, created and kept: able to sign in and read every
300
- * database, and nothing else. None when it signs in as the superuser.
301
- */
302
- function backupsRoleStatements(backups) {
303
- if (!backups.readOnly) return [];
304
- const role = quoteIdentifier(backups.login.user);
305
- const password = `'${backups.login.password.replace(/'/g, "''")}'`;
306
- return [
307
- {
308
- id: BACKUPS_SERVICE,
309
- describe: `role ${backups.login.user}`,
310
- exists: {
311
- sql: "SELECT 1 FROM pg_roles WHERE rolname = $1",
312
- values: [backups.login.user]
313
- },
314
- create: `CREATE ROLE ${role} LOGIN PASSWORD ${password}`
315
- },
316
- {
317
- id: BACKUPS_SERVICE,
318
- describe: `role ${backups.login.user}: its password`,
319
- create: `ALTER ROLE ${role} WITH LOGIN PASSWORD ${password}`
320
- },
321
- {
322
- id: BACKUPS_SERVICE,
323
- describe: `role ${backups.login.user}: read every database`,
324
- create: `GRANT pg_read_all_data TO ${role}`
325
- }
326
- ];
327
- }
328
- //#endregion
329
16
  //#region src/compose/routes.ts
330
17
  /** A route with handlers and a check that would have to hold for each of them. */
331
18
  var EdgeRouteConflict = class extends Error {
@@ -389,7 +76,7 @@ function edgeCaddyfile(routes, options) {
389
76
  const certificate = tls.kind === "files" ? `
390
77
  tls ${tls.certFile} ${tls.keyFile}
391
78
  ` : "";
392
- const blocks = [...routes.filter((route) => !route.wildcard), ...routes.filter((route) => route.wildcard)].map((route) => siteBlock(route, route.wildcard?.tls.kind === "on-demand" ? `
79
+ const blocks = [...routes.filter((route) => !route.wildcard), ...routes.filter((route) => route.wildcard)].map((route) => siteBlock(route, options.edgeToken, route.wildcard?.tls.kind === "on-demand" ? `
393
80
  tls {
394
81
  on_demand
395
82
  }
@@ -397,7 +84,7 @@ function edgeCaddyfile(routes, options) {
397
84
  return `${HEADER}${global ? `${global}\n\n` : ""}${blocks.join("\n\n")}\n`;
398
85
  }
399
86
  /** One route's site block. */
400
- function siteBlock(route, certificate) {
87
+ function siteBlock(route, edgeToken, certificate) {
401
88
  assertRouteRenderable(route);
402
89
  const { host, allow, auth, paths, prefixes, requireHeader, handlers } = route;
403
90
  const allowed = [...paths ?? [], ...(prefixes ?? []).map((prefix) => `${prefix}*`)];
@@ -437,10 +124,7 @@ function siteBlock(route, certificate) {
437
124
  `).join("")}
438
125
  handle {${proxy.replace(/\n/g, "\n ")}
439
126
  }` : proxy;
440
- return `https://${host} {${certificate}
441
- # gkm's own header, which only a service of this stack may send: the auth
442
- # server rate-limits by the client address it carries.
443
- request_header -${CLIENT_IP_HEADER}
127
+ return `https://${host} {${certificate}${clientIpRule(edgeToken)}
444
128
  ${checks}${body}
445
129
  }`;
446
130
  }
@@ -923,7 +607,7 @@ function edgeCompose(options) {
923
607
  }
924
608
  /** A stack's dynamic configuration, as an object. */
925
609
  function traefikDynamic(routes, options) {
926
- const { project, tls } = options;
610
+ const { project, tls, edgeToken } = options;
927
611
  const name = (route, suffix) => `${project}-${route.name}${suffix ? `-${suffix}` : ""}`;
928
612
  const url = ({ service, port }) => `http://${edgeAlias(project, service)}:${port}`;
929
613
  const routers = {};
@@ -965,14 +649,23 @@ function traefikDynamic(routes, options) {
965
649
  };
966
650
  services[handlerName] = { loadBalancer: { servers: handler.upstreams.map((upstream) => ({ url: url(upstream) })) } };
967
651
  }
652
+ const rule = `${hostRule(route)}${paths}${header}`;
968
653
  routers[name(route)] = {
969
- rule: `${hostRule(route)}${paths}${header}`,
654
+ rule,
970
655
  ...route.wildcard ? { priority: 1 } : {},
971
656
  entryPoints: ["websecure"],
972
657
  service: name(route),
973
658
  middlewares: chain,
974
659
  tls: certificate()
975
660
  };
661
+ if (edgeToken && !route.prefix) routers[name(route, "stack")] = {
662
+ rule: `${rule} && Header(\`${EDGE_TOKEN_HEADER}\`, \`${edgeToken}\`)`,
663
+ ...route.wildcard ? { priority: 2 } : {},
664
+ entryPoints: ["websecure"],
665
+ service: name(route),
666
+ ...chain.length > 1 ? { middlewares: chain.slice(1) } : {},
667
+ tls: certificate()
668
+ };
976
669
  services[name(route)] = { loadBalancer: {
977
670
  servers: route.upstreams.map((upstream) => ({ url: url(upstream) })),
978
671
  ...route.prefix ? { passHostHeader: false } : {},
@@ -1041,16 +734,17 @@ function yaml(value) {
1041
734
  * The stack a workspace runs as for one stage — pure.
1042
735
  *
1043
736
  * Everything `gkm compose` writes is decided here, as data: the compose file,
1044
- * the Caddyfile, one env file per backend, and the image each app runs. The
737
+ * the Caddyfile, one env file per process that reads one — each backend,
738
+ * worker and site that runs a server — and the image each app runs. The
1045
739
  * command around it reads the workspace, asks the registry, writes the files
1046
740
  * and starts Docker; none of those decide anything, so all of it can be
1047
741
  * asserted without a daemon.
1048
742
  *
1049
743
  * The values come from the same derivations every other target uses. The
1050
- * plan is reconcile's `planFor`, the keys an app reads are `appEnvKeys`, and
1051
- * every URL is `envFor`'s — asked twice, once with each app at its public
1052
- * address and once on the compose network, because a browser and a sibling
1053
- * service reach the same API by different names.
744
+ * plan is reconcile's `planFor`, the keys a process reads are
745
+ * `processEnvKeys` — the rule `gkm dev` and `gkm exec` apply — and every URL
746
+ * is `envFor`'s, with each app at its public address: a browser and a sibling
747
+ * service reach an API by the same name, through the edge.
1054
748
  */
1055
749
  /** Where a stack's files are written, relative to the workspace root. */
1056
750
  function stackDir(stage) {
@@ -1380,7 +1074,7 @@ function composeStack(input) {
1380
1074
  const https = input.ports?.https ?? 443;
1381
1075
  const http = input.ports?.http ?? 80;
1382
1076
  const proxy = proxyFor(workspace.deploy?.compose, stage, local);
1383
- const certificate = local ? void 0 : certificateFor(workspace.deploy?.compose, stage, workspace.root);
1077
+ const certificate = certificateFor(workspace.deploy?.compose, stage, workspace.root);
1384
1078
  const plan = stackPlan(workspace, manifest, stage);
1385
1079
  const byId = new Map(plan.resources.map((r) => [r.id, r]));
1386
1080
  if (local && !input.localCredentials) throw new LocalCredentialsMissing(stage);
@@ -1554,12 +1248,6 @@ function composeStack(input) {
1554
1248
  ...derivation,
1555
1249
  addresses: publicAddresses
1556
1250
  }, hostOf);
1557
- const inside = networkEnv(plan, {
1558
- ...derivation,
1559
- addresses: Object.fromEntries(apps.map((app) => [app.id, `${app.kind === "websocket-api" ? "ws" : "http"}://${hostOf(app.name)}:${app.port}`]))
1560
- }, hostOf);
1561
- const surfaceUrls = new Map(plan.resources.filter((r) => r.kind === "rest-api" || r.kind === "websocket-api" || r.kind === "site").map((r) => [r.envKey, r.id]));
1562
- const appById = new Map(apps.map((app) => [app.id, app]));
1563
1251
  /**
1564
1252
  * What a key resolves to for one app, from the stage's secrets where only
1565
1253
  * they can hold it, and the derivations otherwise.
@@ -1594,8 +1282,6 @@ function composeStack(input) {
1594
1282
  if (custom[key] !== void 0) return custom[key];
1595
1283
  if (owner?.kind === "cache") return redis?.urls[key];
1596
1284
  if (owner?.kind === "websocket-api" && key === provideKey(owner.id, "publisherConnectionString")) return redis?.urls[key];
1597
- const surface = surfaceUrls.get(key);
1598
- if ((app.kind === "rest-api" || app.kind === "websocket-api") && surface && surface !== app.id) return inside[key];
1599
1285
  return outside[key];
1600
1286
  };
1601
1287
  const telemetryValues = logs ? telemetryEnv({
@@ -1618,26 +1304,21 @@ function composeStack(input) {
1618
1304
  }
1619
1305
  return values;
1620
1306
  };
1307
+ const stageKeys = Object.keys(custom);
1621
1308
  for (const app of apps) {
1622
- if (app.kind === "site") {
1623
- const site = manifest[app.id];
1624
- if (site?.kind !== "site") continue;
1309
+ const site = manifest[app.id];
1310
+ if (site?.kind === "site") {
1625
1311
  const args = publicBuildValues(site, manifest, (key) => valueFor(app, key, owners.get(key)), custom);
1626
1312
  if (app.build && Object.keys(args).length > 0) app.build.args = args;
1627
- continue;
1313
+ const offline = offlineBuildHosts(site, manifest, (key) => valueFor(app, key, owners.get(key)));
1314
+ if (app.build && offline.length > 0) app.build.offlineHosts = offline;
1315
+ if (!app.runtime) continue;
1628
1316
  }
1629
1317
  if (input.buildOnly) continue;
1630
- const keys = appEnvKeys(manifest, app.name) ?? /* @__PURE__ */ new Set();
1631
- const values = valuesFor(app, keys);
1632
- const trusted = provideKey(app.id, "trustedOrigins");
1633
- if (keys.has(trusted)) {
1634
- const internal = (byId.get(app.id)?.callers ?? []).map((caller) => appById.get(caller)).filter((caller) => caller?.kind === "rest-api" || caller?.kind === "websocket-api").map((caller) => `http://${hostOf(caller.name)}:${caller.port}`);
1635
- const origins = [...(values[trusted] ?? "").split(",").filter(Boolean), ...internal];
1636
- values[trusted] = [...new Set(origins)].join(",");
1637
- }
1318
+ const values = valuesFor(app, processEnvKeys(manifest, { app: app.name }, stageKeys) ?? /* @__PURE__ */ new Set());
1638
1319
  app.env = {
1639
1320
  ...scopeTelemetryEnv(values, {
1640
- uses: telemetryOf(manifest, app.id) !== void 0,
1321
+ uses: app.kind !== "site" && telemetryOf(manifest, app.id) !== void 0,
1641
1322
  serviceName: app.name,
1642
1323
  ...telemetryValues ? { telemetry: telemetryValues } : {}
1643
1324
  }),
@@ -1662,7 +1343,7 @@ function composeStack(input) {
1662
1343
  });
1663
1344
  }
1664
1345
  for (const worker of input.buildOnly ? [] : workers) {
1665
- const keys = workerEnvKeys(manifest, worker.id) ?? /* @__PURE__ */ new Set();
1346
+ const keys = processEnvKeys(manifest, { workers: [worker.id] }, stageKeys) ?? /* @__PURE__ */ new Set();
1666
1347
  const resolved = valuesFor({
1667
1348
  name: worker.name,
1668
1349
  id: worker.id,
@@ -1714,7 +1395,7 @@ function composeStack(input) {
1714
1395
  }
1715
1396
  if (proxy === "traefik" && (served || unit.origin)) edgeServices.add(unit.name);
1716
1397
  if (input.buildOnly) continue;
1717
- const keys = processorEnvKeys(manifest, unit.id) ?? /* @__PURE__ */ new Set();
1398
+ const keys = processEnvKeys(manifest, { processors: [unit.id] }, stageKeys) ?? /* @__PURE__ */ new Set();
1718
1399
  unit.env = {
1719
1400
  ...scopeTelemetryEnv(valuesFor({
1720
1401
  name: unit.name,
@@ -1753,19 +1434,15 @@ function composeStack(input) {
1753
1434
  const token = relay?.env?.[INBOX_RELAY_TOKEN_KEY];
1754
1435
  if (relay && token) inboxRelay = inboxWebhookUrl(`http://${hostOf(relay.name)}:${relay.port}`, token);
1755
1436
  }
1756
- const deployedTls = certificate ? {
1437
+ const tls = certificate || local ? {
1757
1438
  kind: "files",
1758
1439
  ...proxy === "caddy" ? {
1759
1440
  certFile: `${CADDY_TLS_DIR}/cert.pem`,
1760
1441
  keyFile: `${CADDY_TLS_DIR}/key.pem`
1761
1442
  } : edgeCertificatePaths(project)
1762
1443
  } : { kind: "acme" };
1763
- const tls = local ? {
1764
- kind: "files",
1765
- certFile: `${CADDY_TLS_DIR}/cert.pem`,
1766
- keyFile: `${CADDY_TLS_DIR}/key.pem`
1767
- } : deployedTls;
1768
- const authority = local ? input.localAuthority ?? localAuthorityPaths() : void 0;
1444
+ const authority = local && !certificate ? input.localAuthority ?? localAuthorityPaths() : void 0;
1445
+ const root = authority?.certFile ?? certificate?.caFile;
1769
1446
  const backupsChoice = input.buildOnly ? void 0 : stageBackups(workspace, manifest, stage);
1770
1447
  const backups = backupsChoice?.mode === "on" && infra.includes("postgres") ? stackBackups({
1771
1448
  workspace,
@@ -1883,9 +1560,9 @@ function composeStack(input) {
1883
1560
  envFiles: !input.buildOnly,
1884
1561
  proxy,
1885
1562
  edge: new Map([...edgeServices].map((service) => [service, hostOf(service)])),
1886
- ...authority ? { localEdge: {
1563
+ ...local ? { localEdge: {
1887
1564
  hosts: stackPublicHosts(routes),
1888
- authority: authority.certFile
1565
+ ...root ? { authority: root } : {}
1889
1566
  } } : {}
1890
1567
  });
1891
1568
  const dockerfiles = {};
@@ -1946,10 +1623,12 @@ function composeStack(input) {
1946
1623
  } } : {},
1947
1624
  ...proxy === "caddy" ? { caddyfile: edgeCaddyfile(routes, {
1948
1625
  tls,
1626
+ edgeToken: outside[EDGE_TOKEN_KEY],
1949
1627
  ...local ? { redirects: false } : {}
1950
1628
  }) } : { traefik: traefikDynamicFile(routes, {
1951
1629
  project,
1952
- tls: deployedTls
1630
+ tls,
1631
+ edgeToken: outside[EDGE_TOKEN_KEY]
1953
1632
  }) },
1954
1633
  ...certificate ? { tls: certificate } : {},
1955
1634
  dockerfiles,
@@ -1994,14 +1673,17 @@ function stackApps(workspace, manifest, plan, options) {
1994
1673
  const resource = resources.get(id);
1995
1674
  if (!app || !resource || !app.port) continue;
1996
1675
  const host = hostOf(name, app, workspace, resource, options);
1997
- const tag = declaration.kind === "site" ? siteTag(options.images.tag, options.stage) : options.images.tag;
1676
+ const site = declaration.kind === "site";
1677
+ const tag = site ? siteTag(options.images.tag, options.stage) : options.images.tag;
1998
1678
  const ref = validateImageRef(imageRef(options.identity, name, options.images.registry, tag));
1999
1679
  apps.push({
2000
1680
  app: name,
2001
1681
  name,
2002
1682
  id,
2003
1683
  kind: declaration.kind,
1684
+ ...declaration.kind === "site" ? { variant: declaration.variant } : {},
2004
1685
  replicas: declaration.kind === "websocket-api" ? declaration.replicas ?? 1 : 1,
1686
+ runtime: !site || runsServer(declaration),
2005
1687
  path: app.path,
2006
1688
  port: app.port,
2007
1689
  host,
@@ -2234,17 +1916,19 @@ function stackPublicHosts(routes) {
2234
1916
  * handed because a browser is.
2235
1917
  *
2236
1918
  * Inside a container `*.localhost` is its own loopback, so each host is
2237
- * resolved to the host's gateway, where the edge publishes its ports. Not a
2238
- * network alias on the edge: the address may carry the edge's published port
1919
+ * resolved to the host's gateway, where the edge — the stack's Caddy, or the
1920
+ * shared Traefik edge — publishes its ports. Not a network alias on the edge:
1921
+ * the address may carry the edge's published port
2239
1922
  * (`https://api.shop.localhost:8443`), which only the host answers on. And the
2240
- * certificate there is gkm's, so the container trusts gkm's root — its public
2241
- * certificate, never its key, mounted read-only.
1923
+ * container trusts the root the edge's certificate chains to — gkm's, or the
1924
+ * one the stage's own certificate names — its public certificate, never a
1925
+ * key, mounted read-only.
2242
1926
  */
2243
1927
  function localEdgeAccess(edge) {
2244
1928
  return {
2245
1929
  extra_hosts: edge.hosts.map((host) => `${host}:host-gateway`),
2246
- volumes: [`${edge.authority}:${LOCAL_CA_IN_CONTAINER}:ro`],
2247
- environment: { NODE_EXTRA_CA_CERTS: LOCAL_CA_IN_CONTAINER }
1930
+ volumes: edge.authority ? [`${edge.authority}:${LOCAL_CA_IN_CONTAINER}:ro`] : [],
1931
+ environment: edge.authority ? { NODE_EXTRA_CA_CERTS: LOCAL_CA_IN_CONTAINER } : {}
2248
1932
  };
2249
1933
  }
2250
1934
  /** The compose document: the infrastructure, the apps, and the edge. */
@@ -2305,16 +1989,15 @@ function stackFile(options) {
2305
1989
  workspaceRoot: options.workspaceRoot,
2306
1990
  dockerfile: app.build.dockerfile
2307
1991
  }),
2308
- ...app.build.args ? { args: app.build.args } : {}
1992
+ ...app.build.args ? { args: app.build.args } : {},
1993
+ ...app.build.offlineHosts ? { extra_hosts: app.build.offlineHosts.map((host) => `${host}:${OFFLINE_BUILD_ADDRESS}`) } : {}
2309
1994
  } } : {},
2310
1995
  restart: "unless-stopped",
2311
- ...app.kind !== "site" ? {
2312
- env_file: [{
2313
- path: `./${app.name}.env`,
2314
- format: "raw"
2315
- }],
2316
- ...infra.length ? { depends_on: Object.fromEntries(infra.map((name) => [name, HEALTHY])) } : {}
2317
- } : {},
1996
+ ...app.runtime ? { env_file: [{
1997
+ path: `./${app.name}.env`,
1998
+ format: "raw"
1999
+ }] } : {},
2000
+ ...app.kind !== "site" && infra.length ? { depends_on: Object.fromEntries(infra.map((name) => [name, HEALTHY])) } : {},
2318
2001
  healthcheck: probe(app.port, app.kind === "site" ? "/" : "/health"),
2319
2002
  ...app.kind === "websocket-api" ? { ulimits: { nofile: NOFILE } } : {}
2320
2003
  };
@@ -2351,7 +2034,7 @@ function stackFile(options) {
2351
2034
  ...service.environment,
2352
2035
  ...access.environment
2353
2036
  },
2354
- volumes: [...service.volumes ?? [], ...access.volumes],
2037
+ ...access.volumes.length ? { volumes: [...service.volumes ?? [], ...access.volumes] } : {},
2355
2038
  ...access.extra_hosts.length ? { extra_hosts: [...service.extra_hosts ?? [], ...access.extra_hosts] } : {}
2356
2039
  };
2357
2040
  }
@@ -2424,6 +2107,6 @@ function envFile(env) {
2424
2107
  return `${Object.entries(env).sort(([a], [b]) => a.localeCompare(b)).map(([key, value]) => `${key}=${value}`).join("\n")}\n`;
2425
2108
  }
2426
2109
  //#endregion
2427
- export { BACKUPS_URL_KEY as A, assertSitePasswords as C, pinImages as D, parseDigests as E, backupFile as F, backupsPrefix as I, runTime as L, backupsRoleStatements as M, backupDatabases as N, pinnedRef as O, backupExpiries as P, stageBackups as R, traefikStaticFile as S, assertImagesExist as T, EDGE_NETWORK as _, composeProject as a, edgeAlias as b, derivedCredentials as c, stackDir as d, stackPlan as f, EDGE_DYNAMIC_DIR as g, EDGE_CERTS_DIR as h, LOOPBACK_SERVICES as i, RUNNER_PATH as j, BACKUPS_SERVICE as k, envFile as l, EDGE_AWS_CREDENTIALS as m, LOGS_PORT_ENV as n, composeStack as o, withCaddyConfigs as p, LOG_ROTATION as r, deployedInboxEnv as s, EDGE_PORT_ENV as t, replicaNames as u, EDGE_PROJECT as v, RegistryRequired as w, edgeComposeFile as x, EDGE_SERVICE as y, deploysWithCompose as z };
2110
+ export { RegistryRequired as C, pinnedRef as D, pinImages as E, assertSitePasswords as S, parseDigests as T, EDGE_NETWORK as _, composeProject as a, edgeComposeFile as b, derivedCredentials as c, stackDir as d, stackPlan as f, EDGE_DYNAMIC_DIR as g, EDGE_CERTS_DIR as h, LOOPBACK_SERVICES as i, envFile as l, EDGE_AWS_CREDENTIALS as m, LOGS_PORT_ENV as n, composeStack as o, withCaddyConfigs as p, LOG_ROTATION as r, deployedInboxEnv as s, EDGE_PORT_ENV as t, replicaNames as u, EDGE_PROJECT as v, assertImagesExist as w, traefikStaticFile as x, EDGE_SERVICE as y };
2428
2111
 
2429
- //# sourceMappingURL=stack-BeSbt_7k.mjs.map
2112
+ //# sourceMappingURL=stack-CVzOFHed.mjs.map