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

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 (185) hide show
  1. package/dist/{GoDaddyProvider-IVuFcWyc.mjs → GoDaddyProvider-BESq24p-.mjs} +2 -2
  2. package/dist/{GoDaddyProvider-IVuFcWyc.mjs.map → GoDaddyProvider-BESq24p-.mjs.map} +1 -1
  3. package/dist/{GoDaddyProvider-DAJIa64i.cjs → GoDaddyProvider-BK5N6-fx.cjs} +2 -2
  4. package/dist/{GoDaddyProvider-DAJIa64i.cjs.map → GoDaddyProvider-BK5N6-fx.cjs.map} +1 -1
  5. package/dist/{HostingerProvider-BtLb-jkn.mjs → HostingerProvider-BV30wTNI.mjs} +2 -2
  6. package/dist/{HostingerProvider-BtLb-jkn.mjs.map → HostingerProvider-BV30wTNI.mjs.map} +1 -1
  7. package/dist/{HostingerProvider-DdikWVRy.cjs → HostingerProvider-BbQod5OB.cjs} +2 -2
  8. package/dist/{HostingerProvider-DdikWVRy.cjs.map → HostingerProvider-BbQod5OB.cjs.map} +1 -1
  9. package/dist/{LegacyStateStore-CmgUY9kR.mjs → LegacyStateStore-Ck3HI28A.mjs} +2 -2
  10. package/dist/{LegacyStateStore-CmgUY9kR.mjs.map → LegacyStateStore-Ck3HI28A.mjs.map} +1 -1
  11. package/dist/{LegacyStateStore-CWwT7Mj5.cjs → LegacyStateStore-OEno6vIb.cjs} +2 -2
  12. package/dist/{LegacyStateStore-CWwT7Mj5.cjs.map → LegacyStateStore-OEno6vIb.cjs.map} +1 -1
  13. package/dist/{LocalStateStore-NOmS4QyA.mjs → LocalStateStore-Fa54CpLw.mjs} +2 -2
  14. package/dist/{LocalStateStore-NOmS4QyA.mjs.map → LocalStateStore-Fa54CpLw.mjs.map} +1 -1
  15. package/dist/{LocalStateStore-BkeQg1ga.cjs → LocalStateStore-ukDFg6GM.cjs} +2 -2
  16. package/dist/{LocalStateStore-BkeQg1ga.cjs.map → LocalStateStore-ukDFg6GM.cjs.map} +1 -1
  17. package/dist/{S3StateStore-Cw2nwI5C.cjs → S3StateStore-Cjuft2Lk.cjs} +4 -4
  18. package/dist/{S3StateStore-Cw2nwI5C.cjs.map → S3StateStore-Cjuft2Lk.cjs.map} +1 -1
  19. package/dist/{S3StateStore-SjIxuWHM.mjs → S3StateStore-D53985SR.mjs} +4 -4
  20. package/dist/{S3StateStore-SjIxuWHM.mjs.map → S3StateStore-D53985SR.mjs.map} +1 -1
  21. package/dist/{SSMStateStore-DGqzo4Ob.mjs → SSMStateStore-CRjV2h2G.mjs} +2 -2
  22. package/dist/{SSMStateStore-DGqzo4Ob.mjs.map → SSMStateStore-CRjV2h2G.mjs.map} +1 -1
  23. package/dist/{SSMStateStore-DC1N1Baw.cjs → SSMStateStore-CnJgw3_-.cjs} +2 -2
  24. package/dist/{SSMStateStore-DC1N1Baw.cjs.map → SSMStateStore-CnJgw3_-.cjs.map} +1 -1
  25. package/dist/{add-BwC_EH0e.cjs → add-CG_4mNir.cjs} +7 -7
  26. package/dist/{add-BwC_EH0e.cjs.map → add-CG_4mNir.cjs.map} +1 -1
  27. package/dist/{add-Bnd7vuUN.mjs → add-D0-1UyFj.mjs} +7 -7
  28. package/dist/{add-Bnd7vuUN.mjs.map → add-D0-1UyFj.mjs.map} +1 -1
  29. package/dist/{apps-D1svw9OG.cjs → apps-DHi6E_yH.cjs} +416 -51
  30. package/dist/apps-DHi6E_yH.cjs.map +1 -0
  31. package/dist/{apps-Xrlvir2-.mjs → apps-DWALM-8s.mjs} +389 -49
  32. package/dist/apps-DWALM-8s.mjs.map +1 -0
  33. package/dist/{bundler-CoRIF5bx.mjs → bundler-Cb5ynXXS.mjs} +6 -6
  34. package/dist/{bundler-CoRIF5bx.mjs.map → bundler-Cb5ynXXS.mjs.map} +1 -1
  35. package/dist/{bundler-CgWYsgqb.cjs → bundler-Co_7zpYC.cjs} +6 -6
  36. package/dist/{bundler-CgWYsgqb.cjs.map → bundler-Co_7zpYC.cjs.map} +1 -1
  37. package/dist/{cli-DsPHbC7p.cjs → cli-C5M_7Kux.cjs} +4 -4
  38. package/dist/{cli-DsPHbC7p.cjs.map → cli-C5M_7Kux.cjs.map} +1 -1
  39. package/dist/{cli-CKlTRVwo.mjs → cli-D_9WqN6C.mjs} +4 -4
  40. package/dist/{cli-CKlTRVwo.mjs.map → cli-D_9WqN6C.mjs.map} +1 -1
  41. package/dist/{compose-BMTnoIek.mjs → compose-7p0-3ogo.mjs} +5 -5
  42. package/dist/compose-7p0-3ogo.mjs.map +1 -0
  43. package/dist/{compose-ChUQHKG3.cjs → compose-BeQ01iYk.cjs} +27 -25
  44. package/dist/compose-BeQ01iYk.cjs.map +1 -0
  45. package/dist/{compose-CVAoA04l.cjs → compose-C10hkeHU.cjs} +5 -5
  46. package/dist/compose-C10hkeHU.cjs.map +1 -0
  47. package/dist/{compose-CkvPmijw.mjs → compose-DxmEMeTu.mjs} +27 -25
  48. package/dist/compose-DxmEMeTu.mjs.map +1 -0
  49. package/dist/{config-BKpzKP6W.mjs → config-B-wza0Xk.mjs} +2 -2
  50. package/dist/{config-BKpzKP6W.mjs.map → config-B-wza0Xk.mjs.map} +1 -1
  51. package/dist/{config-QAqAEgb0.cjs → config-CWExbDxA.cjs} +2 -2
  52. package/dist/{config-QAqAEgb0.cjs.map → config-CWExbDxA.cjs.map} +1 -1
  53. package/dist/config.cjs +2 -2
  54. package/dist/config.mjs +2 -2
  55. package/dist/{credentials-Jx1Vdisc.mjs → credentials-B5Oe4fLE.mjs} +7 -7
  56. package/dist/{credentials-Jx1Vdisc.mjs.map → credentials-B5Oe4fLE.mjs.map} +1 -1
  57. package/dist/{credentials-CCIXh-cq.cjs → credentials-Csnd7M8M.cjs} +7 -7
  58. package/dist/{credentials-CCIXh-cq.cjs.map → credentials-Csnd7M8M.cjs.map} +1 -1
  59. package/dist/deploy/public.cjs +12 -12
  60. package/dist/deploy/public.mjs +12 -12
  61. package/dist/{deploy-8wsaNpPW.mjs → deploy-6DDEG4Ai.mjs} +13 -13
  62. package/dist/{deploy-8wsaNpPW.mjs.map → deploy-6DDEG4Ai.mjs.map} +1 -1
  63. package/dist/{deploy-CEX0YRdq.cjs → deploy-BwNxJ3ZI.cjs} +13 -13
  64. package/dist/{deploy-CEX0YRdq.cjs.map → deploy-BwNxJ3ZI.cjs.map} +1 -1
  65. package/dist/{docker-M_-xKiFU.cjs → docker-BZnNUJCy.cjs} +5 -5
  66. package/dist/{docker-M_-xKiFU.cjs.map → docker-BZnNUJCy.cjs.map} +1 -1
  67. package/dist/{docker-M4kCqczV.mjs → docker-Ch5aPQ04.mjs} +5 -5
  68. package/dist/{docker-M4kCqczV.mjs.map → docker-Ch5aPQ04.mjs.map} +1 -1
  69. package/dist/{dokploy-BsAPW8K1.mjs → dokploy-CTWw3WSo.mjs} +2 -2
  70. package/dist/{dokploy-BsAPW8K1.mjs.map → dokploy-CTWw3WSo.mjs.map} +1 -1
  71. package/dist/{dokploy-Djm8QIQZ.cjs → dokploy-Cn7dQqmE.cjs} +2 -2
  72. package/dist/{dokploy-Djm8QIQZ.cjs.map → dokploy-Cn7dQqmE.cjs.map} +1 -1
  73. package/dist/{eas-zEpuiYYj.mjs → eas-D0B8H7hT.mjs} +3 -3
  74. package/dist/{eas-zEpuiYYj.mjs.map → eas-D0B8H7hT.mjs.map} +1 -1
  75. package/dist/{eas-B-Ac5NjL.cjs → eas-IPjz0PWK.cjs} +3 -3
  76. package/dist/{eas-B-Ac5NjL.cjs.map → eas-IPjz0PWK.cjs.map} +1 -1
  77. package/dist/{encryption-EOEhb95p.mjs → encryption-C9auXcSV.mjs} +4 -4
  78. package/dist/{encryption-EOEhb95p.mjs.map → encryption-C9auXcSV.mjs.map} +1 -1
  79. package/dist/{encryption-B4LCEdXH.cjs → encryption-vK64UP4M.cjs} +4 -4
  80. package/dist/{encryption-B4LCEdXH.cjs.map → encryption-vK64UP4M.cjs.map} +1 -1
  81. package/dist/{engine-Ci-uU3kt.mjs → engine-C3N2WhbC.mjs} +10 -10
  82. package/dist/{engine-Ci-uU3kt.mjs.map → engine-C3N2WhbC.mjs.map} +1 -1
  83. package/dist/{engine-6NLOikTQ.cjs → engine-Icqv5JI6.cjs} +10 -10
  84. package/dist/{engine-6NLOikTQ.cjs.map → engine-Icqv5JI6.cjs.map} +1 -1
  85. package/dist/{github-C0oLDg5G.mjs → github-D24wTOe2.mjs} +9 -9
  86. package/dist/{github-C0oLDg5G.mjs.map → github-D24wTOe2.mjs.map} +1 -1
  87. package/dist/{github-u9sfpl0l.cjs → github-DUuNInc0.cjs} +9 -9
  88. package/dist/{github-u9sfpl0l.cjs.map → github-DUuNInc0.cjs.map} +1 -1
  89. package/dist/{googlePlay-DfLH_sPa.cjs → googlePlay-BGDKlnPx.cjs} +5 -5
  90. package/dist/{googlePlay-DfLH_sPa.cjs.map → googlePlay-BGDKlnPx.cjs.map} +1 -1
  91. package/dist/{googlePlay-3nfA-wWh.mjs → googlePlay-Cy-MaYr2.mjs} +5 -5
  92. package/dist/{googlePlay-3nfA-wWh.mjs.map → googlePlay-Cy-MaYr2.mjs.map} +1 -1
  93. package/dist/index.cjs +71 -79
  94. package/dist/index.cjs.map +1 -1
  95. package/dist/index.mjs +71 -79
  96. package/dist/index.mjs.map +1 -1
  97. package/dist/{local-CtzKG55y.cjs → local-B4xobzh-.cjs} +2 -2
  98. package/dist/{local-CtzKG55y.cjs.map → local-B4xobzh-.cjs.map} +1 -1
  99. package/dist/{local-uvqZDwZ9.mjs → local-CdpBgn3d.mjs} +2 -2
  100. package/dist/{local-uvqZDwZ9.mjs.map → local-CdpBgn3d.mjs.map} +1 -1
  101. package/dist/{migrate-C6V9bEVY.cjs → migrate--hMBtpx-.cjs} +4 -4
  102. package/dist/{migrate-C6V9bEVY.cjs.map → migrate--hMBtpx-.cjs.map} +1 -1
  103. package/dist/{migrate-CA1GWA4t.mjs → migrate-DVrXTq58.mjs} +4 -4
  104. package/dist/{migrate-CA1GWA4t.mjs.map → migrate-DVrXTq58.mjs.map} +1 -1
  105. package/dist/{migrate-s9lVmF98.mjs → migrate-DhZfvCkJ.mjs} +6 -6
  106. package/dist/{migrate-s9lVmF98.mjs.map → migrate-DhZfvCkJ.mjs.map} +1 -1
  107. package/dist/{migrate-FKPFIzwd.cjs → migrate-DwQ-zaMy.cjs} +6 -6
  108. package/dist/{migrate-FKPFIzwd.cjs.map → migrate-DwQ-zaMy.cjs.map} +1 -1
  109. package/dist/{notes-BjxySbyH.cjs → notes-C2b5RzGl.cjs} +4 -4
  110. package/dist/{notes-BjxySbyH.cjs.map → notes-C2b5RzGl.cjs.map} +1 -1
  111. package/dist/{notes-Dz1M9_q9.mjs → notes-z5OOMqm4.mjs} +4 -4
  112. package/dist/{notes-Dz1M9_q9.mjs.map → notes-z5OOMqm4.mjs.map} +1 -1
  113. package/dist/openapi.cjs +2 -2
  114. package/dist/openapi.mjs +2 -2
  115. package/dist/{projectBucket-2XgQSnLw.mjs → projectBucket-DPD0_B8N.mjs} +2 -2
  116. package/dist/{projectBucket-2XgQSnLw.mjs.map → projectBucket-DPD0_B8N.mjs.map} +1 -1
  117. package/dist/{projectBucket-DsXNW1Yc.cjs → projectBucket-Dk_aZ1cD.cjs} +2 -2
  118. package/dist/{projectBucket-DsXNW1Yc.cjs.map → projectBucket-Dk_aZ1cD.cjs.map} +1 -1
  119. package/dist/{publish-Dmy_OhvF.mjs → publish-Bmc1Wfs3.mjs} +2 -2
  120. package/dist/{publish-Dmy_OhvF.mjs.map → publish-Bmc1Wfs3.mjs.map} +1 -1
  121. package/dist/{publish-7-dwP5TL.cjs → publish-CDvh-9OG.cjs} +2 -2
  122. package/dist/{publish-7-dwP5TL.cjs.map → publish-CDvh-9OG.cjs.map} +1 -1
  123. package/dist/{resolve-DhsUJwm8.cjs → resolve-CuxPZ3ga.cjs} +4 -4
  124. package/dist/{resolve-DhsUJwm8.cjs.map → resolve-CuxPZ3ga.cjs.map} +1 -1
  125. package/dist/{resolve-BK7mzDBb.mjs → resolve-DHARlMdl.mjs} +4 -4
  126. package/dist/{resolve-BK7mzDBb.mjs.map → resolve-DHARlMdl.mjs.map} +1 -1
  127. package/dist/{rollback-8qHgyadV.mjs → rollback-DZq_dIbl.mjs} +7 -7
  128. package/dist/{rollback-8qHgyadV.mjs.map → rollback-DZq_dIbl.mjs.map} +1 -1
  129. package/dist/{rollback-DP2iDjc9.cjs → rollback-DxHut8C-.cjs} +7 -7
  130. package/dist/{rollback-DP2iDjc9.cjs.map → rollback-DxHut8C-.cjs.map} +1 -1
  131. package/dist/{s3-DxCex5Fx.mjs → s3-Cd7UK2y8.mjs} +3 -3
  132. package/dist/{s3-DxCex5Fx.mjs.map → s3-Cd7UK2y8.mjs.map} +1 -1
  133. package/dist/{s3-DSPbU5gN.cjs → s3-Dhy58V_y.cjs} +3 -3
  134. package/dist/{s3-DSPbU5gN.cjs.map → s3-Dhy58V_y.cjs.map} +1 -1
  135. package/dist/{serverSetup-BSuHk2t2.cjs → serverSetup-DYiKHMVp.cjs} +7 -7
  136. package/dist/{serverSetup-BSuHk2t2.cjs.map → serverSetup-DYiKHMVp.cjs.map} +1 -1
  137. package/dist/{serverSetup-CeFpl5VJ.mjs → serverSetup-qe5bdBhO.mjs} +7 -7
  138. package/dist/{serverSetup-CeFpl5VJ.mjs.map → serverSetup-qe5bdBhO.mjs.map} +1 -1
  139. package/dist/{sniffer-BfNl8jn-.mjs → sniffer-BNcLP8MO.mjs} +7 -7
  140. package/dist/{sniffer-BfNl8jn-.mjs.map → sniffer-BNcLP8MO.mjs.map} +1 -1
  141. package/dist/{sniffer-Cb3n63dY.cjs → sniffer-DFix2ORf.cjs} +7 -7
  142. package/dist/{sniffer-Cb3n63dY.cjs.map → sniffer-DFix2ORf.cjs.map} +1 -1
  143. package/dist/{snsSubscriptions-DoZ0Q1n6.mjs → snsSubscriptions-BwX28_Kl.mjs} +3 -3
  144. package/dist/{snsSubscriptions-DoZ0Q1n6.mjs.map → snsSubscriptions-BwX28_Kl.mjs.map} +1 -1
  145. package/dist/{snsSubscriptions-Bd40ebt6.cjs → snsSubscriptions-Dr-gJWtR.cjs} +3 -3
  146. package/dist/{snsSubscriptions-Bd40ebt6.cjs.map → snsSubscriptions-Dr-gJWtR.cjs.map} +1 -1
  147. package/dist/{sst-B6RbJp8g.mjs → sst-Bvtx6uZ9.mjs} +5 -5
  148. package/dist/{sst-B6RbJp8g.mjs.map → sst-Bvtx6uZ9.mjs.map} +1 -1
  149. package/dist/{sst-DKNyfTpw.cjs → sst-CoKFPW7f.cjs} +5 -5
  150. package/dist/{sst-DKNyfTpw.cjs.map → sst-CoKFPW7f.cjs.map} +1 -1
  151. package/dist/{stack-DwQ62dKK.mjs → stack-BeSbt_7k.mjs} +100 -45
  152. package/dist/stack-BeSbt_7k.mjs.map +1 -0
  153. package/dist/{stack-UcV-V6Qk.cjs → stack-DbaKGKnI.cjs} +100 -45
  154. package/dist/stack-DbaKGKnI.cjs.map +1 -0
  155. package/dist/{stage-52sKecmS.mjs → stage-BblkSR2C.mjs} +7 -7
  156. package/dist/{stage-52sKecmS.mjs.map → stage-BblkSR2C.mjs.map} +1 -1
  157. package/dist/{stage-C2v5890I.cjs → stage-DI5mzoAi.cjs} +7 -7
  158. package/dist/{stage-C2v5890I.cjs.map → stage-DI5mzoAi.cjs.map} +1 -1
  159. package/dist/{stages-CFI0OiLj.cjs → stages-C-bVwvJZ.cjs} +3 -3
  160. package/dist/{stages-CFI0OiLj.cjs.map → stages-C-bVwvJZ.cjs.map} +1 -1
  161. package/dist/{stages-DoYa81kN.mjs → stages-DBsDvEbo.mjs} +3 -3
  162. package/dist/{stages-DoYa81kN.mjs.map → stages-DBsDvEbo.mjs.map} +1 -1
  163. package/dist/target/public.cjs +1 -1
  164. package/dist/target/public.mjs +1 -1
  165. package/dist/{terminal-DkXWdU0E.cjs → terminal-Bxy_A8iP.cjs} +2 -2
  166. package/dist/{terminal-DkXWdU0E.cjs.map → terminal-Bxy_A8iP.cjs.map} +1 -1
  167. package/dist/{terminal-BDEqpkbO.mjs → terminal-DDqusYW0.mjs} +2 -2
  168. package/dist/{terminal-BDEqpkbO.mjs.map → terminal-DDqusYW0.mjs.map} +1 -1
  169. package/dist/workspace/index.cjs +1 -1
  170. package/dist/workspace/index.mjs +1 -1
  171. package/dist/{workspace-Dkm3HL9e.cjs → workspace-BbbkJDUU.cjs} +5 -5
  172. package/dist/workspace-BbbkJDUU.cjs.map +1 -0
  173. package/dist/{workspace-BbfBFtjn.mjs → workspace-CZGJdcTs.mjs} +5 -5
  174. package/dist/workspace-CZGJdcTs.mjs.map +1 -0
  175. package/package.json +17 -15
  176. package/dist/apps-D1svw9OG.cjs.map +0 -1
  177. package/dist/apps-Xrlvir2-.mjs.map +0 -1
  178. package/dist/compose-BMTnoIek.mjs.map +0 -1
  179. package/dist/compose-CVAoA04l.cjs.map +0 -1
  180. package/dist/compose-ChUQHKG3.cjs.map +0 -1
  181. package/dist/compose-CkvPmijw.mjs.map +0 -1
  182. package/dist/stack-DwQ62dKK.mjs.map +0 -1
  183. package/dist/stack-UcV-V6Qk.cjs.map +0 -1
  184. package/dist/workspace-BbfBFtjn.mjs.map +0 -1
  185. package/dist/workspace-Dkm3HL9e.cjs.map +0 -1
@@ -1,10 +1,10 @@
1
1
  const require_rolldown_runtime = require("./rolldown-runtime-C0BPl7ul.cjs");
2
2
  const require_errors = require("./errors-DMC4Umsb.cjs");
3
- const require_credentials = require("./credentials-CCIXh-cq.cjs");
4
- const require_workspace = require("./workspace-Dkm3HL9e.cjs");
5
- const require_compose = require("./compose-CVAoA04l.cjs");
3
+ const require_credentials = require("./credentials-Csnd7M8M.cjs");
4
+ const require_workspace = require("./workspace-BbbkJDUU.cjs");
5
+ const require_compose = require("./compose-C10hkeHU.cjs");
6
6
  const require_SubscriberGenerator = require("./SubscriberGenerator-BNJyPmXJ.cjs");
7
- const require_config = require("./config-QAqAEgb0.cjs");
7
+ const require_config = require("./config-CWExbDxA.cjs");
8
8
  const require_types = require("./types-Bl_CwZC9.cjs");
9
9
  const require_EndpointGenerator = require("./EndpointGenerator-DyLMYClE.cjs");
10
10
  const require_discover = require("./discover-CRywE7yc.cjs");
@@ -24,6 +24,8 @@ let _geekmidas_events_sqs_url = require("@geekmidas/events/sqs/url");
24
24
  _geekmidas_events_sqs_url = require_rolldown_runtime.__toESM(_geekmidas_events_sqs_url, 1);
25
25
  let _geekmidas_cache_postgres = require("@geekmidas/cache/postgres");
26
26
  let node_util = require("node:util");
27
+ let node_forge = require("node-forge");
28
+ node_forge = require_rolldown_runtime.__toESM(node_forge, 1);
27
29
  let _aws_sdk_client_s3 = require("@aws-sdk/client-s3");
28
30
  let _aws_sdk_client_sns = require("@aws-sdk/client-sns");
29
31
  let _aws_sdk_client_sqs = require("@aws-sdk/client-sqs");
@@ -59,8 +61,10 @@ function processorsDevRoute(fileServerId) {
59
61
  * caching, because caching is not what is missing locally, and a caching proxy
60
62
  * would add an invalidation story a local stack has no use for.
61
63
  *
62
- * What it buys beyond the shape is a certificate. Caddy issues one per host
63
- * from its own CA, so a local address is `https://` like the deployed one, and
64
+ * What it buys beyond the shape is a certificate: gkm's local authority
65
+ * (`trust/authority.ts`) issues one for the stage's hosts, which the edge
66
+ * serves the way a deployed edge serves the stage's own, so a local address is
67
+ * `https://` like the deployed one, and
64
68
  * everything downstream of that — `Secure` cookies, `SameSite`, a cookie domain
65
69
  * with more than one host under it — starts behaving the way it will in
66
70
  * production rather than the way `http://localhost` allows.
@@ -94,12 +98,14 @@ const EDGE_KINDS = {
94
98
  * maps it to the host gateway.
95
99
  */
96
100
  const HOST_GATEWAY = "host.docker.internal";
101
+ /** Where the edge's container reads `.gkm/caddy-sites/` — routes and certificates. */
102
+ const CADDY_SITES_IN_CONTAINER = "/etc/caddy/sites";
97
103
  /**
98
104
  * The suffix every local host shares.
99
105
  *
100
106
  * `.localhost` rather than a made-up TLD because it resolves to loopback
101
107
  * without touching `/etc/hosts` — macOS and systemd-resolved both answer for
102
- * subdomains of it, and Caddy issues internal certificates for it by default.
108
+ * subdomains of it.
103
109
  */
104
110
  const LOCAL_TLD = "localhost";
105
111
  /**
@@ -238,14 +244,14 @@ function stageOf(resource) {
238
244
  function caddyfileRoot() {
239
245
  return `${GENERATED}
240
246
  {
241
- # No ACME, no public DNS: the CA is local and so are the names.
242
- local_certs
247
+ # No ACME, no public DNS: each stage's certificate is gkm's, beside its
248
+ # routes, and the names are local.
243
249
  auto_https disable_redirects
244
250
  }
245
251
 
246
252
  # One file per stage, so two stages share this edge the way they already share
247
253
  # one Postgres and one MinIO.
248
- import /etc/caddy/sites/*.caddy
254
+ import ${CADDY_SITES_IN_CONTAINER}/*.caddy
249
255
  `;
250
256
  }
251
257
  /**
@@ -258,7 +264,7 @@ import /etc/caddy/sites/*.caddy
258
264
  * and signs on the Host header, so forwarding the requested hostname would make
259
265
  * it look for a bucket named after the domain.
260
266
  */
261
- function toCaddyfile(sites) {
267
+ function toCaddyfile(sites, options) {
262
268
  if (sites.length === 0) return `${GENERATED}
263
269
  # No file server is declared in this stage, so it routes nothing.
264
270
  `;
@@ -276,7 +282,7 @@ function toCaddyfile(sites) {
276
282
  }`;
277
283
  return `
278
284
  https://${host} {
279
- tls internal
285
+ tls ${options.certificate} ${options.certificate}
280
286
 
281
287
  # gkm's own header, which only a service of this stack may send: the auth
282
288
  # server rate-limits by the client address it carries.
@@ -327,9 +333,9 @@ const GENERATED = `# Generated by gkm from the construct manifest — do not edi
327
333
  # bucket — which MinIO alone cannot produce: its virtual-host mode reads the
328
334
  # leading label as the bucket name.
329
335
  #
330
- # Certificates come from Caddy's own CA. "gkm dev" and "gkm test" export its
331
- # root and point Node at it, so nothing has to be installed to use these URLs
332
- # from code; a browser needs the root trusted once.
336
+ # Certificates come from gkm's local CA. "gkm dev" and "gkm test" point Node at
337
+ # its root, so nothing has to be installed to use these URLs from code; a
338
+ # browser needs the root trusted once ("gkm trust").
333
339
  `;
334
340
  //#endregion
335
341
  //#region src/telemetry/edges.ts
@@ -2970,6 +2976,352 @@ function toPosix(path) {
2970
2976
  return path.split(node_path.sep).join("/");
2971
2977
  }
2972
2978
  //#endregion
2979
+ //#region src/trust/authority.ts
2980
+ /**
2981
+ * gkm's local certificate authority: one per machine, and every local edge's
2982
+ * certificate is issued from it.
2983
+ *
2984
+ * `gkm dev`'s Caddy, a local `gkm compose` stack's Caddy — and anything else
2985
+ * that serves the local stage's `*.localhost` names — serves a certificate
2986
+ * this module issued, the way a deployed stage's edge serves the files
2987
+ * `deploy.compose.tls` names. So there is one root to trust (`gkm trust`), it
2988
+ * exists before any container starts, and a container that calls the stage's
2989
+ * public hosts can be handed it (`NODE_EXTRA_CA_CERTS`) without first copying
2990
+ * it out of a proxy.
2991
+ *
2992
+ * The root lives in the CLI's home (`GKM_HOME`, else `~/.gkm`), outside every
2993
+ * project. Its key never leaves that directory: only certificates it signed —
2994
+ * and their own keys — are written to a workspace or handed to a container.
2995
+ */
2996
+ /** How long the root is good for: ten years, so it is trusted once. */
2997
+ const AUTHORITY_DAYS = 3650;
2998
+ /** An issued certificate this close to its end is issued again. */
2999
+ const RENEW_WITHIN_DAYS = 30;
3000
+ const DAY = 864e5;
3001
+ /** The authority's files, under the CLI's home. */
3002
+ function localAuthorityPaths(home = require_credentials.gkmHome()) {
3003
+ const dir = (0, node_path.join)(home, "ca");
3004
+ return {
3005
+ dir,
3006
+ certFile: (0, node_path.join)(dir, "root.pem"),
3007
+ keyFile: (0, node_path.join)(dir, "root-key.pem")
3008
+ };
3009
+ }
3010
+ /** The authority's directory is there, and its root or key is not readable. */
3011
+ var LocalAuthorityDamaged = class extends require_errors.GkmError {
3012
+ dir;
3013
+ reason;
3014
+ constructor(dir, reason) {
3015
+ super(`gkm's local certificate authority in ${dir} cannot be used: ${reason}. Delete the directory and run "gkm trust" to make a new one — a browser that trusted the old root has to trust the new one.`);
3016
+ this.dir = dir;
3017
+ this.reason = reason;
3018
+ this.name = "LocalAuthorityDamaged";
3019
+ }
3020
+ };
3021
+ /** A certificate asked for with no names to put on it. */
3022
+ var LocalCertificateWithoutNames = class extends require_errors.GkmError {
3023
+ constructor() {
3024
+ super("A local certificate needs at least one host name. Pass the hosts the edge serves — localCertificateNames(project, hosts) lists them.");
3025
+ this.name = "LocalCertificateWithoutNames";
3026
+ }
3027
+ };
3028
+ /**
3029
+ * Load the authority, creating it the first time.
3030
+ *
3031
+ * Created whole or not at all: generated into a directory of its own and
3032
+ * renamed into place, so two commands starting at once — `gkm dev` for two
3033
+ * apps — end with one root between them, never one's certificate and the
3034
+ * other's key.
3035
+ *
3036
+ * @throws {LocalAuthorityDamaged} when its directory holds no usable root.
3037
+ */
3038
+ async function ensureLocalAuthority(paths = localAuthorityPaths()) {
3039
+ if (!(0, node_fs.existsSync)(paths.dir)) await createAuthority(paths);
3040
+ return readLocalAuthority(paths);
3041
+ }
3042
+ /**
3043
+ * Load an authority that exists.
3044
+ *
3045
+ * @throws {LocalAuthorityDamaged} when its root or key is missing or unreadable.
3046
+ */
3047
+ async function readLocalAuthority(paths = localAuthorityPaths()) {
3048
+ let cert;
3049
+ let key;
3050
+ try {
3051
+ [cert, key] = await Promise.all([(0, node_fs_promises.readFile)(paths.certFile, "utf-8"), (0, node_fs_promises.readFile)(paths.keyFile, "utf-8")]);
3052
+ } catch {
3053
+ throw new LocalAuthorityDamaged(paths.dir, "its root certificate or key is missing");
3054
+ }
3055
+ try {
3056
+ const root = node_forge.default.pki.certificateFromPem(cert);
3057
+ const signer = node_forge.default.pki.privateKeyFromPem(key);
3058
+ if (!root.publicKey.n.equals(signer.n)) throw new LocalAuthorityDamaged(paths.dir, "its key is not the root certificate’s");
3059
+ } catch (error) {
3060
+ if (error instanceof LocalAuthorityDamaged) throw error;
3061
+ throw new LocalAuthorityDamaged(paths.dir, "its files are not PEM");
3062
+ }
3063
+ return {
3064
+ certFile: paths.certFile,
3065
+ cert,
3066
+ key
3067
+ };
3068
+ }
3069
+ async function createAuthority(paths) {
3070
+ const { cert, key } = selfSigned();
3071
+ const staging = `${paths.dir}.${process.pid}.${(0, node_crypto.randomBytes)(4).toString("hex")}`;
3072
+ await (0, node_fs_promises.mkdir)(staging, {
3073
+ recursive: true,
3074
+ mode: 448
3075
+ });
3076
+ try {
3077
+ await (0, node_fs_promises.writeFile)((0, node_path.join)(staging, "root.pem"), cert, { mode: 420 });
3078
+ await (0, node_fs_promises.writeFile)((0, node_path.join)(staging, "root-key.pem"), key, { mode: 384 });
3079
+ await (0, node_fs_promises.mkdir)((0, node_path.dirname)(paths.dir), { recursive: true });
3080
+ await (0, node_fs_promises.rename)(staging, paths.dir).catch((error) => {
3081
+ if (error.code !== "EEXIST" && error.code !== "ENOTEMPTY") throw error;
3082
+ });
3083
+ } finally {
3084
+ await (0, node_fs_promises.rm)(staging, {
3085
+ recursive: true,
3086
+ force: true
3087
+ });
3088
+ }
3089
+ }
3090
+ /** A new root: who made it, on which machine, so a keychain says whose it is. */
3091
+ function selfSigned() {
3092
+ const { privateKey, publicKey } = keyPair();
3093
+ const cert = node_forge.default.pki.createCertificate();
3094
+ cert.publicKey = publicKey;
3095
+ cert.serialNumber = serialNumber();
3096
+ const now = Date.now();
3097
+ cert.validity.notBefore = /* @__PURE__ */ new Date(now - DAY);
3098
+ cert.validity.notAfter = new Date(now + AUTHORITY_DAYS * DAY);
3099
+ const subject = utf8([
3100
+ {
3101
+ name: "organizationName",
3102
+ value: "gkm local CA"
3103
+ },
3104
+ {
3105
+ name: "organizationalUnitName",
3106
+ value: owner()
3107
+ },
3108
+ {
3109
+ name: "commonName",
3110
+ value: `gkm local CA ${owner()}`
3111
+ }
3112
+ ]);
3113
+ cert.setSubject(subject);
3114
+ cert.setIssuer(subject);
3115
+ cert.setExtensions([
3116
+ {
3117
+ name: "basicConstraints",
3118
+ cA: true,
3119
+ pathLenConstraint: 0,
3120
+ critical: true
3121
+ },
3122
+ {
3123
+ name: "keyUsage",
3124
+ keyCertSign: true,
3125
+ cRLSign: true,
3126
+ critical: true
3127
+ },
3128
+ { name: "subjectKeyIdentifier" }
3129
+ ]);
3130
+ cert.sign(privateKey, node_forge.default.md.sha256.create());
3131
+ return {
3132
+ cert: node_forge.default.pki.certificateToPem(cert),
3133
+ key: node_forge.default.pki.privateKeyToPem(privateKey)
3134
+ };
3135
+ }
3136
+ /**
3137
+ * The names a project's local certificate carries: its bare host and every
3138
+ * label under it — `shop.localhost`, `*.shop.localhost` — and any host the
3139
+ * edge serves that those do not cover, a stage's own wildcard among them.
3140
+ * Without a project, the hosts alone: `*.localhost` is nobody's to claim.
3141
+ */
3142
+ function localCertificateNames(project, hosts) {
3143
+ const names = [...project ? [`${project}.localhost`, `*.${project}.localhost`] : []];
3144
+ for (const host of hosts) {
3145
+ const name = host.toLowerCase();
3146
+ if (!names.some((covering) => covers(covering, name))) names.push(name);
3147
+ }
3148
+ return names;
3149
+ }
3150
+ /** Whether a certificate name answers for a host, by the one-label wildcard rule. */
3151
+ function covers(name, host) {
3152
+ if (name === host) return true;
3153
+ if (!name.startsWith("*.") || host.startsWith("*.")) return false;
3154
+ const suffix = name.slice(1);
3155
+ return host.endsWith(suffix) && !host.slice(0, -suffix.length).includes(".");
3156
+ }
3157
+ /**
3158
+ * A certificate for `names`, signed by the authority. Each call makes a new
3159
+ * key; {@link ensureLocalCertificate} is what keeps one across runs.
3160
+ *
3161
+ * @throws {LocalCertificateWithoutNames} for an empty list.
3162
+ */
3163
+ function issueLocalCertificate(authority, names, options = {}) {
3164
+ if (names.length === 0) throw new LocalCertificateWithoutNames();
3165
+ const root = node_forge.default.pki.certificateFromPem(authority.cert);
3166
+ const signer = node_forge.default.pki.privateKeyFromPem(authority.key);
3167
+ const { privateKey, publicKey } = keyPair();
3168
+ const now = (options.now ?? /* @__PURE__ */ new Date()).getTime();
3169
+ const cert = node_forge.default.pki.createCertificate();
3170
+ cert.publicKey = publicKey;
3171
+ cert.serialNumber = serialNumber();
3172
+ cert.validity.notBefore = /* @__PURE__ */ new Date(now - 36e5);
3173
+ cert.validity.notAfter = new Date(now + (options.days ?? 365) * DAY);
3174
+ cert.setSubject(utf8([{
3175
+ name: "organizationName",
3176
+ value: "gkm local certificate"
3177
+ }, {
3178
+ name: "commonName",
3179
+ value: names[0]
3180
+ }]));
3181
+ cert.setIssuer(root.subject.attributes);
3182
+ cert.setExtensions([
3183
+ {
3184
+ name: "basicConstraints",
3185
+ cA: false,
3186
+ critical: true
3187
+ },
3188
+ {
3189
+ name: "keyUsage",
3190
+ digitalSignature: true,
3191
+ keyEncipherment: true,
3192
+ critical: true
3193
+ },
3194
+ {
3195
+ name: "extKeyUsage",
3196
+ serverAuth: true
3197
+ },
3198
+ {
3199
+ name: "subjectAltName",
3200
+ altNames: names.map((value) => ({
3201
+ type: 2,
3202
+ value
3203
+ }))
3204
+ },
3205
+ { name: "subjectKeyIdentifier" },
3206
+ {
3207
+ name: "authorityKeyIdentifier",
3208
+ keyIdentifier: root.generateSubjectKeyIdentifier().getBytes()
3209
+ }
3210
+ ]);
3211
+ cert.sign(signer, node_forge.default.md.sha256.create());
3212
+ return {
3213
+ cert: node_forge.default.pki.certificateToPem(cert),
3214
+ key: node_forge.default.pki.privateKeyToPem(privateKey)
3215
+ };
3216
+ }
3217
+ /**
3218
+ * The certificate for `names` kept in `file` — certificate then key, one PEM
3219
+ * file, which is what a proxy given the same path for both reads — issued
3220
+ * again only when the one there is not the authority's, does not cover every
3221
+ * name, or is near its end.
3222
+ *
3223
+ * One file written by rename, so two commands issuing at once leave a pair
3224
+ * that matches, never one's certificate beside the other's key.
3225
+ *
3226
+ * @throws {LocalCertificateWithoutNames} for an empty list.
3227
+ */
3228
+ async function ensureLocalCertificate(authority, names, file, options = {}) {
3229
+ const now = options.now ?? /* @__PURE__ */ new Date();
3230
+ const existing = await (0, node_fs_promises.readFile)(file, "utf-8").catch(() => void 0);
3231
+ const kept = existing ? splitPem(existing) : void 0;
3232
+ if (kept && stillGood(authority, kept, names, now)) return {
3233
+ ...kept,
3234
+ issued: false
3235
+ };
3236
+ const issued = issueLocalCertificate(authority, names, { now });
3237
+ await (0, node_fs_promises.mkdir)((0, node_path.dirname)(file), {
3238
+ recursive: true,
3239
+ mode: 448
3240
+ });
3241
+ const staging = `${file}.${process.pid}.${(0, node_crypto.randomBytes)(4).toString("hex")}`;
3242
+ await (0, node_fs_promises.writeFile)(staging, `${issued.cert}${issued.key}`, { mode: 384 });
3243
+ await (0, node_fs_promises.rename)(staging, file);
3244
+ return {
3245
+ ...issued,
3246
+ issued: true
3247
+ };
3248
+ }
3249
+ /** A combined PEM file's certificate and key. */
3250
+ function splitPem(pem) {
3251
+ const cert = pem.match(/-----BEGIN CERTIFICATE-----[\s\S]+?-----END CERTIFICATE-----\r?\n?/)?.[0];
3252
+ const key = pem.match(/-----BEGIN (?:RSA )?PRIVATE KEY-----[\s\S]+?-----END (?:RSA )?PRIVATE KEY-----\r?\n?/)?.[0];
3253
+ return cert && key ? {
3254
+ cert,
3255
+ key
3256
+ } : void 0;
3257
+ }
3258
+ /** Whether a kept certificate still serves: the authority's, every name, in date. */
3259
+ function stillGood(authority, kept, names, now) {
3260
+ try {
3261
+ const root = node_forge.default.pki.certificateFromPem(authority.cert);
3262
+ const cert = node_forge.default.pki.certificateFromPem(kept.cert);
3263
+ if (!root.verify(cert)) return false;
3264
+ if (cert.validity.notAfter.getTime() - now.getTime() < RENEW_WITHIN_DAYS * DAY) return false;
3265
+ const certKey = (0, node_crypto.createPublicKey)(kept.cert).export({
3266
+ type: "spki",
3267
+ format: "der"
3268
+ });
3269
+ const ownKey = (0, node_crypto.createPublicKey)((0, node_crypto.createPrivateKey)(kept.key)).export({
3270
+ type: "spki",
3271
+ format: "der"
3272
+ });
3273
+ if (!certKey.equals(ownKey)) return false;
3274
+ const san = cert.getExtension("subjectAltName");
3275
+ const dns = new Set((san?.altNames ?? []).filter((n) => n.type === 2).map((n) => n.value));
3276
+ return names.every((name) => dns.has(name));
3277
+ } catch {
3278
+ return false;
3279
+ }
3280
+ }
3281
+ /** An RSA key pair, made natively — forge's own generation is slow. */
3282
+ function keyPair() {
3283
+ const { privateKey: pem } = (0, node_crypto.generateKeyPairSync)("rsa", {
3284
+ modulusLength: 2048,
3285
+ publicKeyEncoding: {
3286
+ type: "spki",
3287
+ format: "pem"
3288
+ },
3289
+ privateKeyEncoding: {
3290
+ type: "pkcs8",
3291
+ format: "pem"
3292
+ }
3293
+ });
3294
+ const privateKey = node_forge.default.pki.privateKeyFromPem(pem);
3295
+ return {
3296
+ privateKey,
3297
+ publicKey: node_forge.default.pki.setRsaPublicKey(privateKey.n, privateKey.e)
3298
+ };
3299
+ }
3300
+ /**
3301
+ * Attributes as UTF8String. forge writes PrintableString otherwise, which
3302
+ * has no `@` or `*` — and a TLS stack rejects the certificate outright.
3303
+ */
3304
+ function utf8(attributes) {
3305
+ return attributes.map((attribute) => ({
3306
+ ...attribute,
3307
+ valueTagClass: node_forge.default.asn1.Type.UTF8
3308
+ }));
3309
+ }
3310
+ /** A random, positive serial: sixteen bytes, its high bit clear. */
3311
+ function serialNumber() {
3312
+ const bytes = (0, node_crypto.randomBytes)(16);
3313
+ bytes[0] = bytes[0] & 127;
3314
+ return bytes.toString("hex");
3315
+ }
3316
+ /** `user@host`, as far as the machine will say. */
3317
+ function owner() {
3318
+ let user = "gkm";
3319
+ try {
3320
+ user = (0, node_os.userInfo)().username;
3321
+ } catch {}
3322
+ return `${user}@${(0, node_os.hostname)()}`;
3323
+ }
3324
+ //#endregion
2973
3325
  //#region src/reconcile/clients.ts
2974
3326
  /**
2975
3327
  * The real Postgres and MinIO clients the applier runs against.
@@ -3202,16 +3554,6 @@ const dockerCli = {
3202
3554
  if (options.show) return shown(args, services);
3203
3555
  await run("docker", args);
3204
3556
  },
3205
- async copyOut(composePath, service, from, to) {
3206
- await (0, node_fs_promises.mkdir)((0, node_path.dirname)(to), { recursive: true });
3207
- await run("docker", [
3208
- "compose",
3209
- ...composeFiles(composePath),
3210
- "cp",
3211
- `${service}:${from}`,
3212
- to
3213
- ]);
3214
- },
3215
3557
  async reload(composePath, service) {
3216
3558
  await run("docker", [
3217
3559
  "compose",
@@ -3222,7 +3564,8 @@ const dockerCli = {
3222
3564
  "caddy",
3223
3565
  "reload",
3224
3566
  "--config",
3225
- "/etc/caddy/Caddyfile"
3567
+ "/etc/caddy/Caddyfile",
3568
+ "--force"
3226
3569
  ]);
3227
3570
  },
3228
3571
  async exec(composePath, service, argv) {
@@ -3856,17 +4199,12 @@ const CHECKOUT_MOUNTS = ["caddy"];
3856
4199
  */
3857
4200
  const caddySitesPath = (stage) => `.gkm/caddy-sites/${stage}.caddy`;
3858
4201
  /**
3859
- * Where the local edge's root certificate is copied to.
3860
- *
3861
- * Exported so a process can be pointed at it without installing anything:
3862
- * `NODE_EXTRA_CA_CERTS` is the whole of the trust story for Node, and it needs
3863
- * no sudo. A browser is the case that still wants the root in the system store,
3864
- * which is a one-time `caddy trust` rather than something a reconcile should do
3865
- * on a developer's behalf.
4202
+ * Where one stage's certificate is kept: certificate and key in one PEM,
4203
+ * issued from gkm's local authority (`trust/authority.ts`), beside the
4204
+ * stage's routes — so the edge reads it through the mount it already has, and
4205
+ * a stage removed takes its certificate with it.
3866
4206
  */
3867
- const LOCAL_CA_PATH = ".gkm/caddy-root.crt";
3868
- /** Where Caddy keeps the root of the CA it generated. */
3869
- const CADDY_ROOT_IN_CONTAINER = "/data/caddy/pki/authorities/local/root.crt";
4207
+ const caddyCertificatePath = (stage) => `.gkm/caddy-sites/${stage}.pem`;
3870
4208
  /**
3871
4209
  * Converge the local target on what the manifest declares.
3872
4210
  *
@@ -3909,7 +4247,10 @@ async function reconcile(options) {
3909
4247
  ...options.objectWebhooks?.length ? { objectWebhooks: options.objectWebhooks } : {},
3910
4248
  ...options.inboxRelay ? { inboxRelay: options.inboxRelay } : {}
3911
4249
  });
3912
- const caddyfile = toCaddyfile(sitesFor(plan, project, options.addresses, options.processorAddresses));
4250
+ const sites = sitesFor(plan, project, options.addresses, options.processorAddresses);
4251
+ const edged = plan.containers.includes("caddy");
4252
+ const authorityPaths = options.authority ?? localAuthorityPaths();
4253
+ const caddyfile = toCaddyfile(sites, { certificate: `${CADDY_SITES_IN_CONTAINER}/${stage}.pem` });
3913
4254
  const hash = planHash(plan, compose, {
3914
4255
  caddyfile,
3915
4256
  postgres: postgresStatements(plan, project, seed).map((statement) => statement.create).join(";\n")
@@ -3932,7 +4273,7 @@ async function reconcile(options) {
3932
4273
  uses: false,
3933
4274
  serviceName: project
3934
4275
  });
3935
- if (plan.containers.includes("caddy")) env.NODE_EXTRA_CA_CERTS = (0, node_path.join)(root, LOCAL_CA_PATH);
4276
+ if (edged) env.NODE_EXTRA_CA_CERTS = authorityPaths.certFile;
3936
4277
  return env;
3937
4278
  };
3938
4279
  const result = {
@@ -3950,11 +4291,12 @@ async function reconcile(options) {
3950
4291
  hash,
3951
4292
  changed: false
3952
4293
  };
4294
+ const certificate = edged ? await ensureLocalCertificate(await ensureLocalAuthority(authorityPaths), localCertificateNames(project, sites.map((site) => site.host)), (0, node_path.join)(root, caddyCertificatePath(stage))) : void 0;
3953
4295
  const recorded = await loadState(root, stage);
3954
4296
  const postgresPort = ports[require_compose.primaryPortKey("postgres")];
3955
- if (recorded?.hash === hash && (0, node_fs.existsSync)(composePath) && (!start || await docker.healthy(composePath, running, { mounted: CHECKOUT_MOUNTS })) && (!start || !provision || postgresPort === void 0 || await databasesExist(sql(postgresPort, options.credentials.postgres), postgresDatabaseNames(plan)))) return result;
4297
+ if (!certificate?.issued && recorded?.hash === hash && (0, node_fs.existsSync)(composePath) && (!start || await docker.healthy(composePath, running, { mounted: CHECKOUT_MOUNTS })) && (!start || !provision || postgresPort === void 0 || await databasesExist(sql(postgresPort, options.credentials.postgres), postgresDatabaseNames(plan)))) return result;
3956
4298
  await write(composePath, require_compose.toYaml(compose), 384);
3957
- if (plan.containers.includes("caddy")) {
4299
+ if (edged) {
3958
4300
  await write((0, node_path.join)(root, CADDYFILE_PATH), caddyfileRoot());
3959
4301
  await write((0, node_path.join)(root, caddySitesPath(stage)), caddyfile);
3960
4302
  await pruneCaddySites(root, [
@@ -3967,8 +4309,7 @@ async function reconcile(options) {
3967
4309
  options.progress?.(`🐳 Starting ${running.join(", ")} — the first start pulls each image, which can take a few minutes`);
3968
4310
  await docker.up(composePath, running, options.progress ? { show: true } : {});
3969
4311
  }
3970
- if (start && plan.containers.includes("caddy")) await docker.reload(composePath, "caddy").catch(() => {});
3971
- if (start && plan.containers.includes("caddy")) await docker.copyOut(composePath, "caddy", CADDY_ROOT_IN_CONTAINER, (0, node_path.join)(root, LOCAL_CA_PATH)).catch(() => {});
4312
+ if (start && edged) await docker.reload(composePath, "caddy").catch(() => {});
3972
4313
  const checked = start && plan.containers.length > 0 ? await logins({
3973
4314
  credentials: options.credentials,
3974
4315
  containers: plan.containers,
@@ -4053,8 +4394,8 @@ async function observedPorts(docker, composePath, containers, fakes) {
4053
4394
  */
4054
4395
  async function pruneCaddySites(root, stages) {
4055
4396
  const dir = (0, node_path.dirname)((0, node_path.join)(root, caddySitesPath(require_workspace.TEST_STAGE)));
4056
- const keep = new Set(stages.map((stage) => stage && `${stage}.caddy`));
4057
- for (const file of await (0, node_fs_promises.readdir)(dir)) if (file.endsWith(".caddy") && !keep.has(file)) await (0, node_fs_promises.rm)((0, node_path.join)(dir, file));
4397
+ const keep = new Set(stages.flatMap((stage) => stage ? [`${stage}.caddy`, `${stage}.pem`] : []));
4398
+ for (const file of await (0, node_fs_promises.readdir)(dir)) if (/\.(caddy|pem)$/.test(file) && !keep.has(file)) await (0, node_fs_promises.rm)((0, node_path.join)(dir, file));
4058
4399
  }
4059
4400
  async function write(path, content, mode) {
4060
4401
  try {
@@ -4608,12 +4949,6 @@ Object.defineProperty(exports, "LEGACY_LOCAL_LOGIN", {
4608
4949
  return LEGACY_LOCAL_LOGIN;
4609
4950
  }
4610
4951
  });
4611
- Object.defineProperty(exports, "LOCAL_CA_PATH", {
4612
- enumerable: true,
4613
- get: function() {
4614
- return LOCAL_CA_PATH;
4615
- }
4616
- });
4617
4952
  Object.defineProperty(exports, "LOCAL_TLD", {
4618
4953
  enumerable: true,
4619
4954
  get: function() {
@@ -4752,6 +5087,18 @@ Object.defineProperty(exports, "dockerfileOf", {
4752
5087
  return dockerfileOf;
4753
5088
  }
4754
5089
  });
5090
+ Object.defineProperty(exports, "ensureLocalAuthority", {
5091
+ enumerable: true,
5092
+ get: function() {
5093
+ return ensureLocalAuthority;
5094
+ }
5095
+ });
5096
+ Object.defineProperty(exports, "ensureLocalCertificate", {
5097
+ enumerable: true,
5098
+ get: function() {
5099
+ return ensureLocalCertificate;
5100
+ }
5101
+ });
4755
5102
  Object.defineProperty(exports, "ensurePostgresLogin", {
4756
5103
  enumerable: true,
4757
5104
  get: function() {
@@ -4860,6 +5207,18 @@ Object.defineProperty(exports, "isUnder", {
4860
5207
  return isUnder;
4861
5208
  }
4862
5209
  });
5210
+ Object.defineProperty(exports, "localAuthorityPaths", {
5211
+ enumerable: true,
5212
+ get: function() {
5213
+ return localAuthorityPaths;
5214
+ }
5215
+ });
5216
+ Object.defineProperty(exports, "localCertificateNames", {
5217
+ enumerable: true,
5218
+ get: function() {
5219
+ return localCertificateNames;
5220
+ }
5221
+ });
4863
5222
  Object.defineProperty(exports, "localRolePassword", {
4864
5223
  enumerable: true,
4865
5224
  get: function() {
@@ -4932,6 +5291,12 @@ Object.defineProperty(exports, "quoteIdentifier", {
4932
5291
  return quoteIdentifier;
4933
5292
  }
4934
5293
  });
5294
+ Object.defineProperty(exports, "readLocalAuthority", {
5295
+ enumerable: true,
5296
+ get: function() {
5297
+ return readLocalAuthority;
5298
+ }
5299
+ });
4935
5300
  Object.defineProperty(exports, "reconcileWorkspace", {
4936
5301
  enumerable: true,
4937
5302
  get: function() {
@@ -5005,4 +5370,4 @@ Object.defineProperty(exports, "workspace_exports", {
5005
5370
  }
5006
5371
  });
5007
5372
 
5008
- //# sourceMappingURL=apps-D1svw9OG.cjs.map
5373
+ //# sourceMappingURL=apps-DHi6E_yH.cjs.map