@geekmidas/cli 10.0.0-alpha.168 → 10.0.0-alpha.169

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 (193) hide show
  1. package/dist/{GoDaddyProvider-CJIYlkUN.mjs → GoDaddyProvider-Cvmy2SPq.mjs} +2 -2
  2. package/dist/{GoDaddyProvider-CJIYlkUN.mjs.map → GoDaddyProvider-Cvmy2SPq.mjs.map} +1 -1
  3. package/dist/{GoDaddyProvider-CYAlIeML.cjs → GoDaddyProvider-KmdZlFSL.cjs} +2 -2
  4. package/dist/{GoDaddyProvider-CYAlIeML.cjs.map → GoDaddyProvider-KmdZlFSL.cjs.map} +1 -1
  5. package/dist/{HostingerProvider-Ceqc_nlG.cjs → HostingerProvider--IyQKlIC.cjs} +2 -2
  6. package/dist/{HostingerProvider-Ceqc_nlG.cjs.map → HostingerProvider--IyQKlIC.cjs.map} +1 -1
  7. package/dist/{HostingerProvider-Tb0bnTpM.mjs → HostingerProvider-DYf1XT_W.mjs} +2 -2
  8. package/dist/{HostingerProvider-Tb0bnTpM.mjs.map → HostingerProvider-DYf1XT_W.mjs.map} +1 -1
  9. package/dist/{LegacyStateStore-Ci-CRqt2.cjs → LegacyStateStore-8GVMHI12.cjs} +2 -2
  10. package/dist/{LegacyStateStore-Ci-CRqt2.cjs.map → LegacyStateStore-8GVMHI12.cjs.map} +1 -1
  11. package/dist/{LegacyStateStore-DJWY64Jj.mjs → LegacyStateStore-BOZj8nj1.mjs} +2 -2
  12. package/dist/{LegacyStateStore-DJWY64Jj.mjs.map → LegacyStateStore-BOZj8nj1.mjs.map} +1 -1
  13. package/dist/{LocalStateStore-Enw_wV7d.cjs → LocalStateStore-CfBABk6G.cjs} +2 -2
  14. package/dist/{LocalStateStore-Enw_wV7d.cjs.map → LocalStateStore-CfBABk6G.cjs.map} +1 -1
  15. package/dist/{LocalStateStore-BFgjv29N.mjs → LocalStateStore-D3wY7Qkb.mjs} +2 -2
  16. package/dist/{LocalStateStore-BFgjv29N.mjs.map → LocalStateStore-D3wY7Qkb.mjs.map} +1 -1
  17. package/dist/{S3StateStore-B48M3z7L.cjs → S3StateStore-C-Fs7CWD.cjs} +4 -4
  18. package/dist/{S3StateStore-B48M3z7L.cjs.map → S3StateStore-C-Fs7CWD.cjs.map} +1 -1
  19. package/dist/{S3StateStore-Cwfd-ZnJ.mjs → S3StateStore-CO92LBQI.mjs} +4 -4
  20. package/dist/{S3StateStore-Cwfd-ZnJ.mjs.map → S3StateStore-CO92LBQI.mjs.map} +1 -1
  21. package/dist/{SSMStateStore-DYgE98Sm.mjs → SSMStateStore-Ns7FpnmB.mjs} +2 -2
  22. package/dist/{SSMStateStore-DYgE98Sm.mjs.map → SSMStateStore-Ns7FpnmB.mjs.map} +1 -1
  23. package/dist/{SSMStateStore-CuBe-NK5.cjs → SSMStateStore-t6mkXQew.cjs} +2 -2
  24. package/dist/{SSMStateStore-CuBe-NK5.cjs.map → SSMStateStore-t6mkXQew.cjs.map} +1 -1
  25. package/dist/{add-C85tazt0.mjs → add-Byp8-rRf.mjs} +5 -5
  26. package/dist/{add-C85tazt0.mjs.map → add-Byp8-rRf.mjs.map} +1 -1
  27. package/dist/{add-4AT0LlDK.cjs → add-C3oUiBAc.cjs} +5 -5
  28. package/dist/{add-4AT0LlDK.cjs.map → add-C3oUiBAc.cjs.map} +1 -1
  29. package/dist/{apps-CWGmV2nQ.mjs → apps-C21-TXqR.mjs} +72 -16
  30. package/dist/apps-C21-TXqR.mjs.map +1 -0
  31. package/dist/{apps-By6pnfzA.cjs → apps-D_-DXV0H.cjs} +76 -14
  32. package/dist/apps-D_-DXV0H.cjs.map +1 -0
  33. package/dist/{bundler-DPBLrtjT.cjs → bundler-D43S2YTJ.cjs} +6 -6
  34. package/dist/{bundler-DPBLrtjT.cjs.map → bundler-D43S2YTJ.cjs.map} +1 -1
  35. package/dist/{bundler-B9rkNGpK.mjs → bundler-DjfpJ0mX.mjs} +6 -6
  36. package/dist/{bundler-B9rkNGpK.mjs.map → bundler-DjfpJ0mX.mjs.map} +1 -1
  37. package/dist/{cli-DgL0QED8.mjs → cli-00fMnBFk.mjs} +4 -4
  38. package/dist/{cli-DgL0QED8.mjs.map → cli-00fMnBFk.mjs.map} +1 -1
  39. package/dist/{cli-BnWRqhwx.cjs → cli-CYBb8rgx.cjs} +4 -4
  40. package/dist/{cli-BnWRqhwx.cjs.map → cli-CYBb8rgx.cjs.map} +1 -1
  41. package/dist/{compose-CLM-sqgE.cjs → compose-D9ksPt5H.cjs} +8 -8
  42. package/dist/{compose-CLM-sqgE.cjs.map → compose-D9ksPt5H.cjs.map} +1 -1
  43. package/dist/{compose-DwjaxFFK.cjs → compose-Dgd-yfJT.cjs} +5 -5
  44. package/dist/{compose-DwjaxFFK.cjs.map → compose-Dgd-yfJT.cjs.map} +1 -1
  45. package/dist/{compose-CcK-QoYU.mjs → compose-MwgjPj_A.mjs} +8 -8
  46. package/dist/{compose-CcK-QoYU.mjs.map → compose-MwgjPj_A.mjs.map} +1 -1
  47. package/dist/{compose-DuRBnjxx.mjs → compose-rn_DWcup.mjs} +5 -5
  48. package/dist/{compose-DuRBnjxx.mjs.map → compose-rn_DWcup.mjs.map} +1 -1
  49. package/dist/config.cjs +1 -1
  50. package/dist/config.mjs +1 -1
  51. package/dist/{credentials-CCCAy3NL.cjs → credentials-C6n_kdu4.cjs} +6 -6
  52. package/dist/{credentials-CCCAy3NL.cjs.map → credentials-C6n_kdu4.cjs.map} +1 -1
  53. package/dist/{credentials-CeCOEKP3.mjs → credentials-kK0X754I.mjs} +6 -6
  54. package/dist/{credentials-CeCOEKP3.mjs.map → credentials-kK0X754I.mjs.map} +1 -1
  55. package/dist/deploy/public.cjs +11 -11
  56. package/dist/deploy/public.d.cts.map +1 -1
  57. package/dist/deploy/public.d.mts.map +1 -1
  58. package/dist/deploy/public.mjs +11 -11
  59. package/dist/{deploy-Dy5jyciI.cjs → deploy-C1gf4bT-.cjs} +25 -23
  60. package/dist/deploy-C1gf4bT-.cjs.map +1 -0
  61. package/dist/{deploy-F6GA-u59.mjs → deploy-CFuDCbTq.mjs} +26 -24
  62. package/dist/deploy-CFuDCbTq.mjs.map +1 -0
  63. package/dist/{destroy-B7-8EgCJ.cjs → destroy-CMz0BPEe.cjs} +9 -9
  64. package/dist/{destroy-B7-8EgCJ.cjs.map → destroy-CMz0BPEe.cjs.map} +1 -1
  65. package/dist/{destroy-Gyxrl5yO.mjs → destroy-UTWZmaGn.mjs} +9 -9
  66. package/dist/{destroy-Gyxrl5yO.mjs.map → destroy-UTWZmaGn.mjs.map} +1 -1
  67. package/dist/{docker-COHyyOkv.mjs → docker-BIuidyEB.mjs} +5 -5
  68. package/dist/{docker-COHyyOkv.mjs.map → docker-BIuidyEB.mjs.map} +1 -1
  69. package/dist/{docker-CP4bspkW.cjs → docker-BrdCdNwm.cjs} +5 -5
  70. package/dist/{docker-CP4bspkW.cjs.map → docker-BrdCdNwm.cjs.map} +1 -1
  71. package/dist/{dokploy-DBmB9vWu.mjs → dokploy--ndQ72iu.mjs} +2 -2
  72. package/dist/{dokploy-DBmB9vWu.mjs.map → dokploy--ndQ72iu.mjs.map} +1 -1
  73. package/dist/{dokploy-C7ampvzk.cjs → dokploy-D7ZChrtZ.cjs} +2 -2
  74. package/dist/{dokploy-C7ampvzk.cjs.map → dokploy-D7ZChrtZ.cjs.map} +1 -1
  75. package/dist/{eas-EXRkhGSM.mjs → eas-BCcpBC4k.mjs} +3 -3
  76. package/dist/{eas-EXRkhGSM.mjs.map → eas-BCcpBC4k.mjs.map} +1 -1
  77. package/dist/{eas-CbnTdz8d.cjs → eas-DCvA907G.cjs} +3 -3
  78. package/dist/{eas-CbnTdz8d.cjs.map → eas-DCvA907G.cjs.map} +1 -1
  79. package/dist/{encryption-CdDDSAu_.cjs → encryption-8TklMCh2.cjs} +3 -3
  80. package/dist/{encryption-CdDDSAu_.cjs.map → encryption-8TklMCh2.cjs.map} +1 -1
  81. package/dist/{encryption-lLZV2eMs.mjs → encryption-C2LzfQp8.mjs} +3 -3
  82. package/dist/{encryption-lLZV2eMs.mjs.map → encryption-C2LzfQp8.mjs.map} +1 -1
  83. package/dist/{engine-Cg92m1Xf.cjs → engine-BMoNLayn.cjs} +9 -9
  84. package/dist/{engine-Cg92m1Xf.cjs.map → engine-BMoNLayn.cjs.map} +1 -1
  85. package/dist/{engine-ZzUy2czq.mjs → engine-D-_nkxQL.mjs} +9 -9
  86. package/dist/{engine-ZzUy2czq.mjs.map → engine-D-_nkxQL.mjs.map} +1 -1
  87. package/dist/{github-CPpJmNgV.mjs → github-B_zfStMR.mjs} +7 -7
  88. package/dist/{github-CPpJmNgV.mjs.map → github-B_zfStMR.mjs.map} +1 -1
  89. package/dist/{github-BHqRcUgU.cjs → github-CZjNDPAp.cjs} +7 -7
  90. package/dist/{github-BHqRcUgU.cjs.map → github-CZjNDPAp.cjs.map} +1 -1
  91. package/dist/{googlePlay-Dg-0ASWN.mjs → googlePlay-BcVRYMh4.mjs} +4 -4
  92. package/dist/{googlePlay-Dg-0ASWN.mjs.map → googlePlay-BcVRYMh4.mjs.map} +1 -1
  93. package/dist/{googlePlay-DRz0ya3q.cjs → googlePlay-Btn0lut5.cjs} +4 -4
  94. package/dist/{googlePlay-DRz0ya3q.cjs.map → googlePlay-Btn0lut5.cjs.map} +1 -1
  95. package/dist/{iam-b4IvC1fm.cjs → iam-BoYPPNdM.cjs} +2 -2
  96. package/dist/{iam-b4IvC1fm.cjs.map → iam-BoYPPNdM.cjs.map} +1 -1
  97. package/dist/{iam-CLIne3Ny.mjs → iam-ra1_Y405.mjs} +2 -2
  98. package/dist/{iam-CLIne3Ny.mjs.map → iam-ra1_Y405.mjs.map} +1 -1
  99. package/dist/index.cjs +63 -63
  100. package/dist/index.cjs.map +1 -1
  101. package/dist/index.mjs +63 -63
  102. package/dist/index.mjs.map +1 -1
  103. package/dist/{local-Cin6exc0.mjs → local-B9Vniy-F.mjs} +2 -2
  104. package/dist/{local-Cin6exc0.mjs.map → local-B9Vniy-F.mjs.map} +1 -1
  105. package/dist/{local-BIrl0ENw.cjs → local-DxfqOu7A.cjs} +2 -2
  106. package/dist/{local-BIrl0ENw.cjs.map → local-DxfqOu7A.cjs.map} +1 -1
  107. package/dist/{migrate-BtkwylxW.cjs → migrate-C1u7Tl7D.cjs} +5 -5
  108. package/dist/{migrate-BtkwylxW.cjs.map → migrate-C1u7Tl7D.cjs.map} +1 -1
  109. package/dist/{migrate-CxI07Ey0.cjs → migrate-CcYfCpMe.cjs} +3 -3
  110. package/dist/{migrate-CxI07Ey0.cjs.map → migrate-CcYfCpMe.cjs.map} +1 -1
  111. package/dist/{migrate-DEU8I8sQ.mjs → migrate-b5rcr4sw.mjs} +5 -5
  112. package/dist/{migrate-DEU8I8sQ.mjs.map → migrate-b5rcr4sw.mjs.map} +1 -1
  113. package/dist/{migrate-DpLMJLCw.mjs → migrate-blnmh2Tm.mjs} +3 -3
  114. package/dist/{migrate-DpLMJLCw.mjs.map → migrate-blnmh2Tm.mjs.map} +1 -1
  115. package/dist/{notes-or_kXTal.mjs → notes-CT1jNLDC.mjs} +6 -5
  116. package/dist/notes-CT1jNLDC.mjs.map +1 -0
  117. package/dist/{notes-rTfi6rfN.cjs → notes-Cw3JQ0Y_.cjs} +5 -4
  118. package/dist/notes-Cw3JQ0Y_.cjs.map +1 -0
  119. package/dist/openapi.cjs +1 -1
  120. package/dist/openapi.mjs +1 -1
  121. package/dist/{projectBucket-CRa1b1Td.cjs → projectBucket-8hJmCusk.cjs} +2 -2
  122. package/dist/{projectBucket-CRa1b1Td.cjs.map → projectBucket-8hJmCusk.cjs.map} +1 -1
  123. package/dist/{projectBucket-Coh5K3-g.mjs → projectBucket-DJNi2yJL.mjs} +2 -2
  124. package/dist/{projectBucket-Coh5K3-g.mjs.map → projectBucket-DJNi2yJL.mjs.map} +1 -1
  125. package/dist/{publish-Bwhywmpz.mjs → publish-CMaPsMsT.mjs} +2 -2
  126. package/dist/{publish-Bwhywmpz.mjs.map → publish-CMaPsMsT.mjs.map} +1 -1
  127. package/dist/{publish-D9Yl4AzW.cjs → publish-Dlb-rrc5.cjs} +2 -2
  128. package/dist/{publish-D9Yl4AzW.cjs.map → publish-Dlb-rrc5.cjs.map} +1 -1
  129. package/dist/{resolve-BrJUFIUu.cjs → resolve-BKn4TTn3.cjs} +4 -4
  130. package/dist/{resolve-BrJUFIUu.cjs.map → resolve-BKn4TTn3.cjs.map} +1 -1
  131. package/dist/{resolve-B9tboVm2.mjs → resolve-DrFS2Ivb.mjs} +4 -4
  132. package/dist/{resolve-B9tboVm2.mjs.map → resolve-DrFS2Ivb.mjs.map} +1 -1
  133. package/dist/{rollback-D48bPMpD.cjs → rollback-6ZeoByXd.cjs} +6 -6
  134. package/dist/{rollback-D48bPMpD.cjs.map → rollback-6ZeoByXd.cjs.map} +1 -1
  135. package/dist/{rollback-M6b0z1tp.mjs → rollback-B3lHgwkj.mjs} +6 -6
  136. package/dist/{rollback-M6b0z1tp.mjs.map → rollback-B3lHgwkj.mjs.map} +1 -1
  137. package/dist/{s3-3iS3jlKU.cjs → s3-Cq1_F2J8.cjs} +3 -3
  138. package/dist/{s3-3iS3jlKU.cjs.map → s3-Cq1_F2J8.cjs.map} +1 -1
  139. package/dist/{s3-CNOSRjqH.mjs → s3-DfAM0soB.mjs} +3 -3
  140. package/dist/{s3-CNOSRjqH.mjs.map → s3-DfAM0soB.mjs.map} +1 -1
  141. package/dist/{serverSetup-DnOdoucM.cjs → serverSetup-DMNKsLKq.cjs} +6 -6
  142. package/dist/{serverSetup-DnOdoucM.cjs.map → serverSetup-DMNKsLKq.cjs.map} +1 -1
  143. package/dist/{serverSetup-CzLJ_RV0.mjs → serverSetup-lZ7tYUZJ.mjs} +6 -6
  144. package/dist/{serverSetup-CzLJ_RV0.mjs.map → serverSetup-lZ7tYUZJ.mjs.map} +1 -1
  145. package/dist/{sniffer-C5F7uYQB.cjs → sniffer-CUImZsQL.cjs} +7 -7
  146. package/dist/{sniffer-C5F7uYQB.cjs.map → sniffer-CUImZsQL.cjs.map} +1 -1
  147. package/dist/{sniffer-yeftYpWK.mjs → sniffer-DcT9RrAj.mjs} +7 -7
  148. package/dist/{sniffer-yeftYpWK.mjs.map → sniffer-DcT9RrAj.mjs.map} +1 -1
  149. package/dist/{snsSubscriptions-CXwELBil.cjs → snsSubscriptions-1lX1ze3u.cjs} +10 -5
  150. package/dist/snsSubscriptions-1lX1ze3u.cjs.map +1 -0
  151. package/dist/{snsSubscriptions-CXRa_bwG.mjs → snsSubscriptions-DFWhEgiA.mjs} +10 -5
  152. package/dist/snsSubscriptions-DFWhEgiA.mjs.map +1 -0
  153. package/dist/{sst-BAQrBaGa.mjs → sst-CB6rX5Zs.mjs} +5 -5
  154. package/dist/{sst-BAQrBaGa.mjs.map → sst-CB6rX5Zs.mjs.map} +1 -1
  155. package/dist/{sst-B_srWo15.cjs → sst-ct0Vhta9.cjs} +5 -5
  156. package/dist/{sst-B_srWo15.cjs.map → sst-ct0Vhta9.cjs.map} +1 -1
  157. package/dist/{stack-DaJ9D2Uc.cjs → stack-CkdkfmpN.cjs} +111 -34
  158. package/dist/stack-CkdkfmpN.cjs.map +1 -0
  159. package/dist/{stack-t2tN1jYo.mjs → stack-Dsl0l3fi.mjs} +106 -35
  160. package/dist/stack-Dsl0l3fi.mjs.map +1 -0
  161. package/dist/{stage-Clk6oQO_.cjs → stage-Cmn0dCV2.cjs} +6 -6
  162. package/dist/{stage-Clk6oQO_.cjs.map → stage-Cmn0dCV2.cjs.map} +1 -1
  163. package/dist/{stage-B4gqRg7l.mjs → stage-DfdUf2sj.mjs} +6 -6
  164. package/dist/{stage-B4gqRg7l.mjs.map → stage-DfdUf2sj.mjs.map} +1 -1
  165. package/dist/{stages-afi9P-Cd.cjs → stages-BWg3NU3J.cjs} +2 -2
  166. package/dist/{stages-afi9P-Cd.cjs.map → stages-BWg3NU3J.cjs.map} +1 -1
  167. package/dist/{stages-D1rnfO18.mjs → stages-COiipV8N.mjs} +2 -2
  168. package/dist/{stages-D1rnfO18.mjs.map → stages-COiipV8N.mjs.map} +1 -1
  169. package/dist/target/public.cjs +1 -1
  170. package/dist/target/public.mjs +1 -1
  171. package/dist/{terminal-D4kY5oz7.mjs → terminal-BDKhPIBA.mjs} +2 -2
  172. package/dist/{terminal-D4kY5oz7.mjs.map → terminal-BDKhPIBA.mjs.map} +1 -1
  173. package/dist/{terminal-JAudEZRC.cjs → terminal-CFeiyJxJ.cjs} +2 -2
  174. package/dist/{terminal-JAudEZRC.cjs.map → terminal-CFeiyJxJ.cjs.map} +1 -1
  175. package/dist/workspace/index.cjs +1 -1
  176. package/dist/workspace/index.mjs +1 -1
  177. package/dist/{workspace-p7gmCQVS.cjs → workspace-CEpojAus.cjs} +41 -14
  178. package/dist/workspace-CEpojAus.cjs.map +1 -0
  179. package/dist/{workspace-Gubg8xLJ.mjs → workspace-_aoe8v6u.mjs} +42 -15
  180. package/dist/workspace-_aoe8v6u.mjs.map +1 -0
  181. package/package.json +15 -15
  182. package/dist/apps-By6pnfzA.cjs.map +0 -1
  183. package/dist/apps-CWGmV2nQ.mjs.map +0 -1
  184. package/dist/deploy-Dy5jyciI.cjs.map +0 -1
  185. package/dist/deploy-F6GA-u59.mjs.map +0 -1
  186. package/dist/notes-or_kXTal.mjs.map +0 -1
  187. package/dist/notes-rTfi6rfN.cjs.map +0 -1
  188. package/dist/snsSubscriptions-CXRa_bwG.mjs.map +0 -1
  189. package/dist/snsSubscriptions-CXwELBil.cjs.map +0 -1
  190. package/dist/stack-DaJ9D2Uc.cjs.map +0 -1
  191. package/dist/stack-t2tN1jYo.mjs.map +0 -1
  192. package/dist/workspace-Gubg8xLJ.mjs.map +0 -1
  193. package/dist/workspace-p7gmCQVS.cjs.map +0 -1
@@ -1,8 +1,8 @@
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-CCCAy3NL.cjs");
4
- const require_workspace = require("./workspace-p7gmCQVS.cjs");
5
- const require_compose = require("./compose-DwjaxFFK.cjs");
3
+ const require_credentials = require("./credentials-C6n_kdu4.cjs");
4
+ const require_workspace = require("./workspace-CEpojAus.cjs");
5
+ const require_compose = require("./compose-Dgd-yfJT.cjs");
6
6
  const require_SubscriberGenerator = require("./SubscriberGenerator-DMi4siph.cjs");
7
7
  const require_types = require("./types-Bl_CwZC9.cjs");
8
8
  const require_EndpointGenerator = require("./EndpointGenerator-C1h_wExz.cjs");
@@ -271,9 +271,12 @@ function sitesFor(plan, project, addresses = {}, processorAddresses = {}) {
271
271
  });
272
272
  continue;
273
273
  }
274
+ const { aliases, redirects } = hostsFor(resource, project);
274
275
  sites.push({
275
276
  host,
276
- upstream
277
+ upstream,
278
+ ...aliases.length ? { aliases } : {},
279
+ ...redirects.length ? { redirects } : {}
277
280
  });
278
281
  }
279
282
  return sites;
@@ -337,6 +340,24 @@ function hostFor$1(resource, project) {
337
340
  ].filter(Boolean).join(".");
338
341
  }
339
342
  /**
343
+ * Where a resource answers, every host of it: {@link hostFor}'s, and each
344
+ * alias and redirect label under the project, carrying the stage as its own
345
+ * label does — `www-test.shop.localhost` for `gkm test`.
346
+ */
347
+ function hostsFor(resource, project) {
348
+ const stage = stageOf(resource);
349
+ const under = (label) => [
350
+ stage ? `${label}-${stage}` : label,
351
+ project,
352
+ LOCAL_TLD
353
+ ].filter(Boolean).join(".");
354
+ return {
355
+ host: hostFor$1(resource, project),
356
+ aliases: (resource.aliases ?? []).map(under),
357
+ redirects: (resource.redirects ?? []).map(under)
358
+ };
359
+ }
360
+ /**
340
361
  * A resource's own label: its `subdomain` where it declared one, and a file
341
362
  * server's own name — the label a deploy uses too — with the stage it carries
342
363
  * kept, so `gkm test` and `gkm dev` still answer on different hosts.
@@ -388,7 +409,8 @@ function toCaddyfile(sites, options) {
388
409
  if (sites.length === 0) return `${GENERATED}
389
410
  # No file server is declared in this stage, so it routes nothing.
390
411
  `;
391
- const blocks = sites.map(({ host, upstream, rewrite, processors, tenants }) => {
412
+ const port = options.port && options.port !== 443 ? `:${options.port}` : "";
413
+ const blocks = sites.map(({ host, upstream, rewrite, processors, tenants, aliases, redirects }) => {
392
414
  const proxy = `reverse_proxy ${upstream} {${rewrite ? `
393
415
  rewrite ${rewrite}
394
416
  # MinIO routes and signs on the Host header, so forwarding the requested
@@ -400,8 +422,14 @@ function toCaddyfile(sites, options) {
400
422
  header_up Host {host}
401
423
  header_up X-Forwarded-Proto {scheme}`}
402
424
  }`;
425
+ const redirectBlocks = (redirects ?? []).map((from) => `
426
+ https://${from} {
427
+ tls ${options.certificate} ${options.certificate}
428
+
429
+ redir https://${host}${port}{uri} permanent
430
+ }`).join("");
403
431
  return `
404
- https://${host} {
432
+ ${[host, ...aliases ?? []].map((name) => `https://${name}`).join(", ")} {
405
433
  tls ${options.certificate} ${options.certificate}
406
434
 
407
435
  ${clientIpRule(options.edgeToken)}
@@ -416,7 +444,7 @@ ${processors ? `
416
444
  }
417
445
  }
418
446
  ` : ""}${tenants ? tenantBlock(tenants, proxy) : ` ${proxy}`}
419
- }`;
447
+ }${redirectBlocks}`;
420
448
  });
421
449
  return `${GENERATED}${blocks.join("\n")}\n`;
422
450
  }
@@ -793,6 +821,7 @@ function planFor(manifest, stage, order, options = {}) {
793
821
  } : {},
794
822
  ...declaration.kind === "file-server" && declaration.open?.length ? { open: declaration.open } : {},
795
823
  ...declaration.kind === "file-server" && declaration.processors?.length ? { processors: [...new Set(declaration.processors.map((p) => p.prefix))].sort() } : {},
824
+ ...declaration.kind === "email" && declaration.from ? { from: declaration.from } : {},
796
825
  ...declaration.kind === "inbox" ? { inbox: {
797
826
  addresses: declaration.addresses,
798
827
  subdomains: declaration.subdomains === true,
@@ -800,6 +829,8 @@ function planFor(manifest, stage, order, options = {}) {
800
829
  } } : {},
801
830
  ...declaration.kind === "objects" && (0, _geekmidas_manifest.bucketExpiry)(manifest, id) ? { expire: (0, _geekmidas_manifest.bucketExpiry)(manifest, id) } : {},
802
831
  ...(declaration.kind === "rest-api" || declaration.kind === "websocket-api" || declaration.kind === "site") && declaration.subdomain ? { subdomain: declaration.subdomain } : {},
832
+ ...(0, _geekmidas_manifest.isHostedDeclaration)(declaration) && (0, _geekmidas_manifest.hostLabels)(declaration).aliases.length ? { aliases: [...(0, _geekmidas_manifest.hostLabels)(declaration).aliases] } : {},
833
+ ...(0, _geekmidas_manifest.isHostedDeclaration)(declaration) && (0, _geekmidas_manifest.hostLabels)(declaration).redirects.length ? { redirects: [...(0, _geekmidas_manifest.hostLabels)(declaration).redirects] } : {},
803
834
  ...(0, _geekmidas_manifest.isWildcardSite)(declaration) ? {
804
835
  protectedSubdomains: require_workspace.protectedSubdomains(manifest, options.protectedSubdomains),
805
836
  ...declaration.hosts ? { hosts: declaration.hosts } : {}
@@ -1022,16 +1053,18 @@ function envFor(plan, options) {
1022
1053
  const url = urlFor(resource, plan, options.ports, options.project ?? "", options.addresses, credential, devices.has(resource.id) ? options.lanAddress : void 0);
1023
1054
  if (url) resolved[resource.id] = url;
1024
1055
  }
1056
+ const aliased = aliasAddressesFor(plan, options);
1025
1057
  for (const resource of plan.resources) {
1026
1058
  const url = resolved[resource.id];
1027
1059
  if (resource.kind === "rest-api") Object.assign(env, surfaceEnv(resource, url, resolved, {
1028
1060
  plan,
1061
+ aliased,
1029
1062
  ...options.addresses ? { addresses: options.addresses } : {},
1030
1063
  ...options.lanAddress ? { lanAddress: options.lanAddress } : {},
1031
1064
  ...options.metroPorts ? { metroPorts: options.metroPorts } : {}
1032
1065
  }));
1033
1066
  if (resource.kind === "websocket-api") {
1034
- const origins = surfaceEnv(resource, url, resolved)[(0, _geekmidas_manifest.providedKeyFor)(resource.id, resource.kind, "trustedOrigins")];
1067
+ const origins = surfaceEnv(resource, url, resolved, { aliased })[(0, _geekmidas_manifest.providedKeyFor)(resource.id, resource.kind, "trustedOrigins")];
1035
1068
  if (origins !== void 0) env[(0, _geekmidas_manifest.providedKeyFor)(resource.id, resource.kind, "trustedOrigins")] = origins;
1036
1069
  const publisher = webSocketPublisher(resource, options.ports, options.project ?? "", credential);
1037
1070
  if (publisher) env[(0, _geekmidas_manifest.providedKeyFor)(resource.id, resource.kind, "publisherConnectionString")] = publisher;
@@ -1069,7 +1102,7 @@ function envFor(plan, options) {
1069
1102
  if (smtp !== void 0) env[(0, _geekmidas_manifest.providedKeyFor)(resource.id, resource.kind, "smtpUrl")] = `smtp://${LOCAL_HOST}:${smtp}`;
1070
1103
  }
1071
1104
  if (resource.kind === "email" && url) {
1072
- env[(0, _geekmidas_manifest.providedKeyFor)(resource.id, resource.kind, "from")] = options.mailFrom ?? `noreply@${LOCAL_HOST}`;
1105
+ env[(0, _geekmidas_manifest.providedKeyFor)(resource.id, resource.kind, "from")] = (0, _geekmidas_manifest.senderAddress)(resource, options.mailDomain ?? LOCAL_HOST);
1073
1106
  const inbox = options.ports[MAILPIT_INBOX_PORT];
1074
1107
  if (inbox !== void 0) env[(0, _geekmidas_manifest.providedKeyFor)(resource.id, resource.kind, "inboxUrl")] = `http://${LOCAL_HOST}:${inbox}`;
1075
1108
  }
@@ -1135,7 +1168,7 @@ function publicEnv(plan, resolved, addresses = {}) {
1135
1168
  */
1136
1169
  function surfaceEnv(resource, url, resolved = {}, local = {}) {
1137
1170
  if (!url) return {};
1138
- const origins = [...new Set((resource.callers ?? []).map((caller) => resolved[caller]).filter((address) => Boolean(address)).map(originOf).filter((origin) => Boolean(origin)))].sort();
1171
+ const origins = [...new Set((resource.callers ?? []).flatMap((caller) => resolved[caller] ? [resolved[caller], ...local.aliased?.[caller] ?? []] : []).map(originOf).filter((origin) => Boolean(origin)))].sort();
1139
1172
  const domain = (0, _geekmidas_manifest.cookieDomain)([url, ...origins]);
1140
1173
  const mobile = (resource.callers ?? []).map((caller) => local.plan?.resources.find((r) => r.id === caller && r.kind === "mobile-app")).filter((caller) => Boolean(caller));
1141
1174
  const hosts = [...local.lanAddress ? [local.lanAddress] : [], LOCAL_HOST];
@@ -1156,6 +1189,23 @@ function surfaceEnv(resource, url, resolved = {}, local = {}) {
1156
1189
  };
1157
1190
  }
1158
1191
  /**
1192
+ * Every construct's alias addresses: where a target placed them, and
1193
+ * otherwise — behind the local edge — each alias under the project, on the
1194
+ * edge's port, as {@link hostsFor} names it. Never a redirect's.
1195
+ */
1196
+ function aliasAddressesFor(plan, options) {
1197
+ if (options.aliasAddresses) return { ...options.aliasAddresses };
1198
+ const edge = plan.containers.includes("caddy") ? options.ports[require_compose.primaryPortKey("caddy")] : void 0;
1199
+ if (edge === void 0) return {};
1200
+ const aliased = {};
1201
+ for (const resource of plan.resources) {
1202
+ if (!resource.aliases?.length) continue;
1203
+ if (!options.addresses?.[resource.id]) continue;
1204
+ aliased[resource.id] = hostsFor(resource, options.project ?? "").aliases.map((host) => `https://${host}:${edge}`);
1205
+ }
1206
+ return aliased;
1207
+ }
1208
+ /**
1159
1209
  * The buckets whose links a phone opens: those a surface a mobile app calls
1160
1210
  * depends on.
1161
1211
  *
@@ -4830,9 +4880,11 @@ async function reconcile(options) {
4830
4880
  const sites = sitesFor(plan, project, options.addresses, options.processorAddresses);
4831
4881
  const edged = plan.containers.includes("caddy");
4832
4882
  const authorityPaths = options.authority ?? localAuthorityPaths();
4883
+ const edgePort = ports[require_compose.primaryPortKey("caddy")];
4833
4884
  const caddyfile = toCaddyfile(sites, {
4834
4885
  certificate: `${CADDY_SITES_IN_CONTAINER}/${stage}.pem`,
4835
- edgeToken: edgeToken(project, seed)
4886
+ edgeToken: edgeToken(project, seed),
4887
+ ...edgePort !== void 0 ? { port: edgePort } : {}
4836
4888
  });
4837
4889
  const hash = planHash(plan, compose, {
4838
4890
  caddyfile,
@@ -4846,7 +4898,7 @@ async function reconcile(options) {
4846
4898
  project,
4847
4899
  credentials,
4848
4900
  seed,
4849
- ...options.mailFrom ? { mailFrom: options.mailFrom } : {},
4901
+ ...options.mailDomain ? { mailDomain: options.mailDomain } : {},
4850
4902
  ...options.addresses ? { addresses: options.addresses } : {},
4851
4903
  ...lan ? { lanAddress: lan } : {},
4852
4904
  ...options.metroPorts ? { metroPorts: options.metroPorts } : {},
@@ -4874,7 +4926,11 @@ async function reconcile(options) {
4874
4926
  hash,
4875
4927
  changed: false
4876
4928
  };
4877
- const certificate = edged ? await ensureLocalCertificate(await ensureLocalAuthority(authorityPaths), localCertificateNames(project, sites.map((site) => site.host)), (0, node_path.join)(root, caddyCertificatePath(stage))) : void 0;
4929
+ const certificate = edged ? await ensureLocalCertificate(await ensureLocalAuthority(authorityPaths), localCertificateNames(project, sites.flatMap((site) => [
4930
+ site.host,
4931
+ ...site.aliases ?? [],
4932
+ ...site.redirects ?? []
4933
+ ])), (0, node_path.join)(root, caddyCertificatePath(stage))) : void 0;
4878
4934
  const recorded = await loadState(root, stage);
4879
4935
  const postgresPort = ports[require_compose.primaryPortKey("postgres")];
4880
4936
  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;
@@ -6037,6 +6093,12 @@ Object.defineProperty(exports, "hostFor", {
6037
6093
  return hostFor$1;
6038
6094
  }
6039
6095
  });
6096
+ Object.defineProperty(exports, "hostsFor", {
6097
+ enumerable: true,
6098
+ get: function() {
6099
+ return hostsFor;
6100
+ }
6101
+ });
6040
6102
  Object.defineProperty(exports, "imageBuildCredentials", {
6041
6103
  enumerable: true,
6042
6104
  get: function() {
@@ -6302,4 +6364,4 @@ Object.defineProperty(exports, "workspace_exports", {
6302
6364
  }
6303
6365
  });
6304
6366
 
6305
- //# sourceMappingURL=apps-By6pnfzA.cjs.map
6367
+ //# sourceMappingURL=apps-D_-DXV0H.cjs.map