@geekmidas/cli 10.0.0-alpha.67 → 10.0.0-alpha.69

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 (175) hide show
  1. package/dist/{LegacyStateStore-C39UKwmf.mjs → LegacyStateStore-BE1Et8RS.mjs} +2 -2
  2. package/dist/{LegacyStateStore-C39UKwmf.mjs.map → LegacyStateStore-BE1Et8RS.mjs.map} +1 -1
  3. package/dist/{LegacyStateStore-BZiO9-Lw.cjs → LegacyStateStore-LS_uTO8D.cjs} +2 -2
  4. package/dist/{LegacyStateStore-BZiO9-Lw.cjs.map → LegacyStateStore-LS_uTO8D.cjs.map} +1 -1
  5. package/dist/{LocalStateStore-DHVsZLyF.cjs → LocalStateStore-CV6phNMZ.cjs} +2 -2
  6. package/dist/{LocalStateStore-DHVsZLyF.cjs.map → LocalStateStore-CV6phNMZ.cjs.map} +1 -1
  7. package/dist/{LocalStateStore-Dk3Wbvzk.mjs → LocalStateStore-DAnFc708.mjs} +2 -2
  8. package/dist/{LocalStateStore-Dk3Wbvzk.mjs.map → LocalStateStore-DAnFc708.mjs.map} +1 -1
  9. package/dist/{OpenApiTsGenerator-BmUAcR7d.mjs → OpenApiTsGenerator-CSaXs-dB.mjs} +2 -2
  10. package/dist/{OpenApiTsGenerator-BmUAcR7d.mjs.map → OpenApiTsGenerator-CSaXs-dB.mjs.map} +1 -1
  11. package/dist/{OpenApiTsGenerator-B2zrdyP4.cjs → OpenApiTsGenerator-CxB8mqXz.cjs} +2 -2
  12. package/dist/{OpenApiTsGenerator-B2zrdyP4.cjs.map → OpenApiTsGenerator-CxB8mqXz.cjs.map} +1 -1
  13. package/dist/{S3StateStore-B_ZF9eHt.mjs → S3StateStore-8kJEGnTh.mjs} +2 -2
  14. package/dist/{S3StateStore-B_ZF9eHt.mjs.map → S3StateStore-8kJEGnTh.mjs.map} +1 -1
  15. package/dist/{S3StateStore--4tYVMAL.cjs → S3StateStore-dA34LAYm.cjs} +2 -2
  16. package/dist/{S3StateStore--4tYVMAL.cjs.map → S3StateStore-dA34LAYm.cjs.map} +1 -1
  17. package/dist/{SSMStateStore-ACZ8hRvZ.cjs → SSMStateStore-DBzlfc-S.cjs} +2 -2
  18. package/dist/{SSMStateStore-ACZ8hRvZ.cjs.map → SSMStateStore-DBzlfc-S.cjs.map} +1 -1
  19. package/dist/{SSMStateStore-DjPuKqrm.mjs → SSMStateStore-Dkdw-fPL.mjs} +2 -2
  20. package/dist/{SSMStateStore-DjPuKqrm.mjs.map → SSMStateStore-Dkdw-fPL.mjs.map} +1 -1
  21. package/dist/add-CoIr2wgv.cjs +568 -0
  22. package/dist/add-CoIr2wgv.cjs.map +1 -0
  23. package/dist/add-Dzk23476.mjs +566 -0
  24. package/dist/add-Dzk23476.mjs.map +1 -0
  25. package/dist/{bundler-pyLj-gS0.cjs → bundler-CSR2nM4m.cjs} +5 -5
  26. package/dist/{bundler-pyLj-gS0.cjs.map → bundler-CSR2nM4m.cjs.map} +1 -1
  27. package/dist/{bundler-Bq3HaLOZ.mjs → bundler-Cn0JF5G0.mjs} +5 -5
  28. package/dist/{bundler-Bq3HaLOZ.mjs.map → bundler-Cn0JF5G0.mjs.map} +1 -1
  29. package/dist/{cli-DR7B2_fX.cjs → cli-IoM2-x48.cjs} +13 -4
  30. package/dist/cli-IoM2-x48.cjs.map +1 -0
  31. package/dist/{cli-C2Tjbn27.mjs → cli-ij8Lwlww.mjs} +13 -4
  32. package/dist/cli-ij8Lwlww.mjs.map +1 -0
  33. package/dist/{compose-BjToENzG.mjs → compose-CZtinmtw.mjs} +173 -58
  34. package/dist/compose-CZtinmtw.mjs.map +1 -0
  35. package/dist/{compose-5oNHAKNT.cjs → compose-DfIioFX0.cjs} +173 -58
  36. package/dist/compose-DfIioFX0.cjs.map +1 -0
  37. package/dist/{config-4XFxX1al.d.cts → config-BnA0kPTY.d.cts} +3 -3
  38. package/dist/{config-4XFxX1al.d.cts.map → config-BnA0kPTY.d.cts.map} +1 -1
  39. package/dist/{config-UtKzhpFb.d.mts → config-CxEp_g7j.d.mts} +3 -3
  40. package/dist/{config-UtKzhpFb.d.mts.map → config-CxEp_g7j.d.mts.map} +1 -1
  41. package/dist/config.cjs +3 -3
  42. package/dist/config.d.cts +3 -3
  43. package/dist/config.d.mts +3 -3
  44. package/dist/config.mjs +3 -3
  45. package/dist/credentialSchemas-BcNL1N5R.cjs +271 -0
  46. package/dist/credentialSchemas-BcNL1N5R.cjs.map +1 -0
  47. package/dist/credentialSchemas-BmYxnEz_.mjs +236 -0
  48. package/dist/credentialSchemas-BmYxnEz_.mjs.map +1 -0
  49. package/dist/deploy/public.cjs +11 -7
  50. package/dist/deploy/public.d.cts +15 -4
  51. package/dist/deploy/public.d.cts.map +1 -1
  52. package/dist/deploy/public.d.mts +15 -4
  53. package/dist/deploy/public.d.mts.map +1 -1
  54. package/dist/deploy/public.mjs +8 -8
  55. package/dist/{deploy-DRAwTG72.mjs → deploy-BzqbkJ3o.mjs} +11 -7
  56. package/dist/deploy-BzqbkJ3o.mjs.map +1 -0
  57. package/dist/{deploy-BucRfbvX.cjs → deploy-Dpz9raPM.cjs} +11 -7
  58. package/dist/deploy-Dpz9raPM.cjs.map +1 -0
  59. package/dist/{discover-OEfZ9OkA.cjs → discover-B4VjaFJk.cjs} +2 -2
  60. package/dist/{discover-OEfZ9OkA.cjs.map → discover-B4VjaFJk.cjs.map} +1 -1
  61. package/dist/{discover-BFoJWKGD.mjs → discover-Buwf1z4P.mjs} +2 -2
  62. package/dist/{discover-BFoJWKGD.mjs.map → discover-Buwf1z4P.mjs.map} +1 -1
  63. package/dist/{dokploy-m345Zx02.cjs → dokploy-B6O-J1fb.cjs} +2 -2
  64. package/dist/{dokploy-m345Zx02.cjs.map → dokploy-B6O-J1fb.cjs.map} +1 -1
  65. package/dist/{dokploy-DIt1IZl1.mjs → dokploy-DkwcORbv.mjs} +2 -2
  66. package/dist/{dokploy-DIt1IZl1.mjs.map → dokploy-DkwcORbv.mjs.map} +1 -1
  67. package/dist/{encryption-Ccbahik7.mjs → encryption-7m1mKcRy.mjs} +3 -3
  68. package/dist/{encryption-Ccbahik7.mjs.map → encryption-7m1mKcRy.mjs.map} +1 -1
  69. package/dist/{encryption-rZ3BghXy.cjs → encryption-C8Ic5t0C.cjs} +3 -3
  70. package/dist/{encryption-rZ3BghXy.cjs.map → encryption-C8Ic5t0C.cjs.map} +1 -1
  71. package/dist/{engine-Gs0abjuj.mjs → engine-62Kl70Pj.mjs} +146 -28
  72. package/dist/engine-62Kl70Pj.mjs.map +1 -0
  73. package/dist/{engine-Cx_dvx9q.cjs → engine-BR9qlS7A.cjs} +146 -28
  74. package/dist/engine-BR9qlS7A.cjs.map +1 -0
  75. package/dist/{github-CrcGFkfD.cjs → github-CmGIZjhu.cjs} +3 -3
  76. package/dist/{github-CrcGFkfD.cjs.map → github-CmGIZjhu.cjs.map} +1 -1
  77. package/dist/{github-CJANTYqi.mjs → github-DtymyOcH.mjs} +3 -3
  78. package/dist/{github-CJANTYqi.mjs.map → github-DtymyOcH.mjs.map} +1 -1
  79. package/dist/{index-DD1FfUHh.d.mts → index-CkX89m6S.d.mts} +2 -2
  80. package/dist/{index-CyApaHVe.d.cts.map → index-CkX89m6S.d.mts.map} +1 -1
  81. package/dist/{index-CyApaHVe.d.cts → index-EvZBkycu.d.cts} +2 -2
  82. package/dist/{index-DD1FfUHh.d.mts.map → index-EvZBkycu.d.cts.map} +1 -1
  83. package/dist/index.cjs +94 -52
  84. package/dist/index.cjs.map +1 -1
  85. package/dist/index.mjs +94 -52
  86. package/dist/index.mjs.map +1 -1
  87. package/dist/{migrate-DCVo5gLS.mjs → migrate-CEzq6DjL.mjs} +4 -4
  88. package/dist/{migrate-DCVo5gLS.mjs.map → migrate-CEzq6DjL.mjs.map} +1 -1
  89. package/dist/{migrate-CQdSpttI.cjs → migrate-CYC-hBOU.cjs} +4 -4
  90. package/dist/{migrate-CQdSpttI.cjs.map → migrate-CYC-hBOU.cjs.map} +1 -1
  91. package/dist/openapi.cjs +1 -1
  92. package/dist/openapi.d.cts +1 -1
  93. package/dist/openapi.d.mts +1 -1
  94. package/dist/openapi.mjs +1 -1
  95. package/dist/{ready-2s3-CndS.mjs → ready-DeYaSoNN.mjs} +3 -3
  96. package/dist/{ready-2s3-CndS.mjs.map → ready-DeYaSoNN.mjs.map} +1 -1
  97. package/dist/{ready-B6uHr4sm.cjs → ready-QGgjmcuN.cjs} +3 -3
  98. package/dist/{ready-B6uHr4sm.cjs.map → ready-QGgjmcuN.cjs.map} +1 -1
  99. package/dist/reconcile/public.cjs +1 -1
  100. package/dist/reconcile/public.d.cts +1 -1
  101. package/dist/reconcile/public.d.mts +1 -1
  102. package/dist/reconcile/public.mjs +1 -1
  103. package/dist/{resolve-BexmDcsN.cjs → resolve-BDsMffvz.cjs} +3 -3
  104. package/dist/{resolve-BexmDcsN.cjs.map → resolve-BDsMffvz.cjs.map} +1 -1
  105. package/dist/{resolve-DhZgtvZe.mjs → resolve-Dn5wGf1r.mjs} +3 -3
  106. package/dist/{resolve-DhZgtvZe.mjs.map → resolve-Dn5wGf1r.mjs.map} +1 -1
  107. package/dist/{rollback-BnY7KuG_.cjs → rollback-5XHaBDxW.cjs} +5 -5
  108. package/dist/{rollback-BnY7KuG_.cjs.map → rollback-5XHaBDxW.cjs.map} +1 -1
  109. package/dist/{rollback-m4Yeym5x.mjs → rollback-DDfaqv7P.mjs} +5 -5
  110. package/dist/{rollback-m4Yeym5x.mjs.map → rollback-DDfaqv7P.mjs.map} +1 -1
  111. package/dist/{runtime-CEk5n4VH.d.mts → runtime-B3jNgeP-.d.mts} +2 -2
  112. package/dist/{runtime-BRqFOvPM.d.cts.map → runtime-B3jNgeP-.d.mts.map} +1 -1
  113. package/dist/{runtime-BRqFOvPM.d.cts → runtime-DWThEP-r.d.cts} +2 -2
  114. package/dist/{runtime-CEk5n4VH.d.mts.map → runtime-DWThEP-r.d.cts.map} +1 -1
  115. package/dist/sandbox/credentials-worker.cjs +54 -0
  116. package/dist/sandbox/credentials-worker.cjs.map +1 -0
  117. package/dist/sandbox/credentials-worker.d.cts +1 -0
  118. package/dist/sandbox/credentials-worker.d.mts +1 -0
  119. package/dist/sandbox/credentials-worker.mjs +55 -0
  120. package/dist/sandbox/credentials-worker.mjs.map +1 -0
  121. package/dist/sandbox/discover-worker.cjs +1 -1
  122. package/dist/sandbox/discover-worker.mjs +1 -1
  123. package/dist/sandbox/migrate-worker.cjs +1 -1
  124. package/dist/sandbox/migrate-worker.mjs +1 -1
  125. package/dist/{schemas-RUlKHu27.cjs → schemas-BObwxB_t.cjs} +164 -3
  126. package/dist/schemas-BObwxB_t.cjs.map +1 -0
  127. package/dist/{schemas-Cfhtpdo0.mjs → schemas-D-xeKJDD.mjs} +153 -4
  128. package/dist/schemas-D-xeKJDD.mjs.map +1 -0
  129. package/dist/{sniffer-D66HIvi9.cjs → sniffer-Bc0nNBDF.cjs} +7 -7
  130. package/dist/sniffer-Bc0nNBDF.cjs.map +1 -0
  131. package/dist/{sniffer-BdFeLSmA.mjs → sniffer-DMqi2b1q.mjs} +7 -7
  132. package/dist/sniffer-DMqi2b1q.mjs.map +1 -0
  133. package/dist/{state-DgmM4EKq.cjs → state-8RgXeX5Y.cjs} +398 -8
  134. package/dist/state-8RgXeX5Y.cjs.map +1 -0
  135. package/dist/{state-DkUStoqJ.mjs → state-DClnPZt5.mjs} +291 -9
  136. package/dist/state-DClnPZt5.mjs.map +1 -0
  137. package/dist/target/public.cjs +1 -1
  138. package/dist/target/public.d.cts +2 -2
  139. package/dist/target/public.d.mts +2 -2
  140. package/dist/target/public.mjs +1 -1
  141. package/dist/{terminal-C3cv-OQu.mjs → terminal-C6TBo_SA.mjs} +2 -2
  142. package/dist/{terminal-C3cv-OQu.mjs.map → terminal-C6TBo_SA.mjs.map} +1 -1
  143. package/dist/{terminal-DjzgLu6m.cjs → terminal-CFO3xWoF.cjs} +2 -2
  144. package/dist/{terminal-DjzgLu6m.cjs.map → terminal-CFO3xWoF.cjs.map} +1 -1
  145. package/dist/{types-CSw2w69a.d.mts → types-CZdCxUCK.d.cts} +64 -2
  146. package/dist/types-CZdCxUCK.d.cts.map +1 -0
  147. package/dist/{types-D5WIxRDP.d.cts → types-Da0E3Qv7.d.mts} +63 -3
  148. package/dist/types-Da0E3Qv7.d.mts.map +1 -0
  149. package/dist/vitest.cjs +1 -1
  150. package/dist/vitest.mjs +1 -1
  151. package/dist/workspace/index.cjs +1 -1
  152. package/dist/workspace/index.d.cts +2 -2
  153. package/dist/workspace/index.d.mts +2 -2
  154. package/dist/workspace/index.mjs +1 -1
  155. package/dist/{workspace-ON-bqiJz.cjs → workspace-8NuAjaXJ.cjs} +2 -2
  156. package/dist/{workspace-ON-bqiJz.cjs.map → workspace-8NuAjaXJ.cjs.map} +1 -1
  157. package/dist/{workspace-Be6uBhlF.mjs → workspace-B2UK_rVP.mjs} +2 -2
  158. package/dist/{workspace-Be6uBhlF.mjs.map → workspace-B2UK_rVP.mjs.map} +1 -1
  159. package/package.json +16 -13
  160. package/dist/cli-C2Tjbn27.mjs.map +0 -1
  161. package/dist/cli-DR7B2_fX.cjs.map +0 -1
  162. package/dist/compose-5oNHAKNT.cjs.map +0 -1
  163. package/dist/compose-BjToENzG.mjs.map +0 -1
  164. package/dist/deploy-BucRfbvX.cjs.map +0 -1
  165. package/dist/deploy-DRAwTG72.mjs.map +0 -1
  166. package/dist/engine-Cx_dvx9q.cjs.map +0 -1
  167. package/dist/engine-Gs0abjuj.mjs.map +0 -1
  168. package/dist/schemas-Cfhtpdo0.mjs.map +0 -1
  169. package/dist/schemas-RUlKHu27.cjs.map +0 -1
  170. package/dist/sniffer-BdFeLSmA.mjs.map +0 -1
  171. package/dist/sniffer-D66HIvi9.cjs.map +0 -1
  172. package/dist/state-DgmM4EKq.cjs.map +0 -1
  173. package/dist/state-DkUStoqJ.mjs.map +0 -1
  174. package/dist/types-CSw2w69a.d.mts.map +0 -1
  175. package/dist/types-D5WIxRDP.d.cts.map +0 -1
@@ -1,12 +1,13 @@
1
1
  import { i as LocalSandbox, t as MissingCredential } from "./credentials-pAtB70k3.mjs";
2
- import { a as discriminatedUnion, d as string, l as object, n as array, o as literal, s as looseObject } from "./schemas-Cfhtpdo0.mjs";
3
- import { c as runWorker, d as output, r as discover } from "./discover-BFoJWKGD.mjs";
2
+ import { a as discriminatedUnion, c as looseObject, f as string, n as array, s as literal, u as object } from "./schemas-D-xeKJDD.mjs";
3
+ import { c as runWorker, d as output, r as discover } from "./discover-Buwf1z4P.mjs";
4
4
  import { i as activeSandbox } from "./sandbox-Dm247NGx.mjs";
5
5
  import { t as appKey } from "./derive-B4vDpzgP.mjs";
6
- import { g as stripPublicPrefix, h as getPublicEnvPrefix, s as getAppBuildOrder } from "./workspace-Be6uBhlF.mjs";
7
- import { $ as cacheBackendFor, At as projectName, C as resolveHost, Ct as applicationName, Dt as isOwnedBy, Et as imageRef, F as applyPostgres, K as resourceName, Ot as markerOf, Pt as toEmbeddableSecrets, S as isMainFrontendApp, Tt as imageName, _ as deployDocker, a as recordRelease, c as setBackupState, d as setGeneratedSecret, et as eventsBackendFor, f as setPostgresBackupId, i as isDnsVerified, jt as initStageSecrets, k as constructGlobs, kt as ownershipMarker, l as setDnsRecord, m as withGeneratedSecrets, n as getBackupState, nt as storageBackendFor, o as recordRollback, p as DeployJournal, r as getGeneratedSecret, s as setApplicationId, t as createEmptyState, tt as providerOf, u as setDnsVerification, w as encryptSecrets } from "./state-DkUStoqJ.mjs";
8
- import { f as StateStoreBusy, m as StateVersionConflict, o as DokployApi, s as DokployApiError, t as sniffAllApps, v as eventError } from "./sniffer-BdFeLSmA.mjs";
6
+ import { g as stripPublicPrefix, h as getPublicEnvPrefix, s as getAppBuildOrder } from "./workspace-B2UK_rVP.mjs";
7
+ import { A as assertExternalServices, C as isMainFrontendApp, D as ExternalServicesNotConfigured, F as reportDevServices, Gt as isOwnedBy, Jt as projectName, Kt as markerOf, M as externalServices, N as manifestServiceDeclarations, O as STORAGE_KEY_PAIR, Qt as toEmbeddableSecrets, R as encryptSecrets, U as constructGlobs, Ut as imageName, Vt as applicationName, Wt as imageRef, Yt as initStageSecrets, Z as applyPostgres, _ as deployDocker, _t as cacheBackendFor, a as recordRelease, bt as storageBackendFor, c as setBackupState, d as setGeneratedSecret, f as setPostgresBackupId, i as isDnsVerified, j as devServicesUsed, l as setDnsRecord, m as withGeneratedSecrets, n as getBackupState, o as recordRollback, p as DeployJournal, qt as ownershipMarker, r as getGeneratedSecret, s as setApplicationId, t as createEmptyState, u as setDnsVerification, ut as resourceName, vt as eventsBackendFor, w as resolveHost, yt as providerOf } from "./state-DClnPZt5.mjs";
8
+ import { f as StateStoreBusy, m as StateVersionConflict, o as DokployApi, s as DokployApiError, t as sniffAllApps, v as eventError } from "./sniffer-DMqi2b1q.mjs";
9
9
  import { o as migrationFiles } from "./provider-D7rQzzzf.mjs";
10
+ import { n as assertStageCredentials } from "./credentialSchemas-BmYxnEz_.mjs";
10
11
  import { join } from "node:path";
11
12
  import { cacheTable, cloudName, cookieDomain, dependentsOf, externalApiUrl, migrationTargets, mobileOrigins, provideKey, provisionOrder, schemeBase } from "@geekmidas/manifest";
12
13
  import { createHash, randomBytes } from "node:crypto";
@@ -507,34 +508,47 @@ const PROVISIONERS = {
507
508
  return { provides: { [provideKey(declaration.id, "url")]: url.toString() } };
508
509
  },
509
510
  /**
510
- * A bucket, as a MinIO stack on the box.
511
+ * A bucket: the stage's own, or — allowed — a MinIO stack on the box.
512
+ *
513
+ * A deployed stage's bucket is an external one — S3, R2, any S3-compatible
514
+ * store — whose URL and key pair the stage's secrets hold. Only with
515
+ * `--allow-dev-services minio` does this target run MinIO for one, and
516
+ * then only for a bucket whose URL the stage did not set.
511
517
  *
512
518
  * Dokploy has first-class primitives for Postgres and Redis and none for
513
- * object storage, so this is the one kind whose infrastructure this target
514
- * *writes* rather than configures — a compose file with one service in it.
519
+ * object storage, so MinIO is the one kind whose infrastructure this
520
+ * target *writes* rather than configures — a compose file with one
521
+ * service in it.
515
522
  *
516
523
  * The service is named `cloudName(...)` like everything else, which is not
517
524
  * cosmetic here: containers on `dokploy-network` resolve each other by
518
525
  * service name, so the name is the address. Calling it `minio` would work
519
526
  * for exactly one project on the box and then collide.
520
527
  *
521
- * `s3://` carries no credentials, deliberately — deployed on AWS the SDK
522
- * reads them from an execution role, so a URL that embedded a key would be
523
- * one more thing to rotate and leak. There is no role here, so the same
524
- * chain reads `AWS_ACCESS_KEY_ID` beside the URL, exactly as it does
525
- * locally.
528
+ * A stage's own bucket URL may carry a key scoped to that bucket
529
+ * (`s3://KEY:SECRET@bucket`), which the client signs with; the shared
530
+ * `AWS_ACCESS_KEY_ID` pair is passed beside it when the stage set one, for
531
+ * a bucket whose URL has none. The MinIO this provisions uses that pair —
532
+ * the stage's, or one derived for it.
526
533
  */
527
534
  objects: async (declaration, context) => {
528
535
  if (declaration.kind !== "objects") throw new WrongKind(declaration.kind);
536
+ const key = provideKey(declaration.id, "url");
537
+ const given = context.supplied?.[key];
538
+ if (given !== void 0) return { provides: {
539
+ [key]: given,
540
+ ...storageKeys(context.supplied)
541
+ } };
529
542
  const backend = context.storage ?? "minio";
530
543
  if (backend !== "minio") throw new UnprovisionableBucket(declaration.id, backend);
544
+ if (!context.devServices?.includes("minio")) throw notConfigured(declaration.id, "objects", context);
531
545
  const service = serviceName({
532
546
  stage: context.stage,
533
547
  app: context.scope ?? context.project
534
548
  }, declaration.id);
535
549
  const bucket = resourceName(declaration.id, declaration.kind, context.stage);
536
- const user = `${bucket}-root`;
537
- const password = derivedPassword(context, `objects:${declaration.id}`);
550
+ const user = context.supplied?.AWS_ACCESS_KEY_ID ?? `${bucket}-root`;
551
+ const password = context.supplied?.AWS_SECRET_ACCESS_KEY ?? derivedPassword(context, `objects:${declaration.id}`);
538
552
  const { compose } = await context.api.findOrCreateCompose(service, context.projectId, context.environmentId, minioCompose({
539
553
  service,
540
554
  bucket,
@@ -543,33 +557,67 @@ const PROVISIONERS = {
543
557
  }));
544
558
  await context.api.deployCompose(compose.composeId);
545
559
  return { provides: {
546
- [provideKey(declaration.id, "url")]: s3Url(service, bucket),
560
+ [key]: s3Url(service, bucket),
547
561
  AWS_ACCESS_KEY_ID: user,
548
562
  AWS_SECRET_ACCESS_KEY: password,
549
- AWS_REGION: MINIO_REGION
563
+ AWS_REGION: context.supplied?.AWS_REGION ?? MINIO_REGION
550
564
  } };
551
565
  },
552
566
  /**
553
567
  * The address a bucket's objects are served on.
554
568
  *
555
- * Nothing is provisioned: Dokploy runs Traefik, so a second reverse proxy
556
- * behind the first would terminate TLS twice — which is why the local
557
- * target's Caddy has no equivalent here. What this resolves is the address,
558
- * and the `open` prefixes are applied to the bucket rather than to an edge,
559
- * so a policy is what makes them public wherever the bucket lives.
569
+ * The stage's own — a CDN, the bucket's domain — when its secrets hold
570
+ * one, which a bucket that is not MinIO's needs.
560
571
  *
561
- * Until a Traefik rule exists it answers on MinIO directly, path-style,
562
- * which is honest about the shape it has today: the bucket is in the path
563
- * rather than fronted by a host of its own.
572
+ * Over MinIO nothing is provisioned: Dokploy runs Traefik, so a second
573
+ * reverse proxy behind the first would terminate TLS twice — which is why
574
+ * the local target's Caddy has no equivalent here. What this resolves is
575
+ * the address, and the `open` prefixes are applied to the bucket rather
576
+ * than to an edge, so a policy is what makes them public wherever the
577
+ * bucket lives. Until a Traefik rule exists it answers on MinIO directly,
578
+ * path-style, which is honest about the shape it has today: the bucket is
579
+ * in the path rather than fronted by a host of its own.
564
580
  */
565
581
  "file-server": async (declaration, context) => {
566
582
  if (declaration.kind !== "file-server") throw new WrongKind(declaration.kind);
583
+ const key = provideKey(declaration.id, "url");
584
+ const given = context.supplied?.[key];
585
+ if (given !== void 0) return { provides: { [key]: given } };
567
586
  const parentUrl = context.provisioned[declaration.of]?.provides[provideKey(declaration.of, "url")];
568
587
  if (!parentUrl) throw new UnresolvedParent(declaration.id, declaration.of);
569
588
  const endpoint = new URL(parentUrl).searchParams.get("endpoint");
570
589
  const bucket = new URL(parentUrl).hostname;
571
590
  if (!endpoint) throw new UnresolvedParent(declaration.id, declaration.of);
572
- return { provides: { [provideKey(declaration.id, "url")]: `${endpoint}/${bucket}` } };
591
+ return { provides: { [key]: `${endpoint}/${bucket}` } };
592
+ },
593
+ /**
594
+ * Mail: the stage's own SMTP server, or — allowed — Mailpit on the box.
595
+ *
596
+ * Every provider speaks SMTP, so the provider is whatever the stage's
597
+ * `<ID>_URL` names, with the address it sends from beside it. Only with
598
+ * `--allow-dev-services mailpit`, and only where the stage set no URL,
599
+ * does this run Mailpit — which catches every message and delivers none.
600
+ */
601
+ email: async (declaration, context) => {
602
+ if (declaration.kind !== "email") throw new WrongKind(declaration.kind);
603
+ const key = provideKey(declaration.id, "url");
604
+ const from = provideKey(declaration.id, "from");
605
+ const given = context.supplied?.[key];
606
+ if (given !== void 0) return { provides: {
607
+ [key]: given,
608
+ [from]: supplied(declaration.id, from, context)
609
+ } };
610
+ if (!context.devServices?.includes("mailpit")) throw notConfigured(declaration.id, "email", context);
611
+ const service = serviceName({
612
+ stage: context.stage,
613
+ app: context.scope ?? context.project
614
+ }, declaration.id);
615
+ const { compose } = await context.api.findOrCreateCompose(service, context.projectId, context.environmentId, mailpitCompose(service));
616
+ await context.api.deployCompose(compose.composeId);
617
+ return { provides: {
618
+ [key]: `smtp://${service}:1025`,
619
+ [from]: context.supplied?.[from] ?? `noreply@${context.domain ?? "localhost"}`
620
+ } };
573
621
  },
574
622
  /**
575
623
  * A topic, and below it a queue — the same broker either way.
@@ -807,6 +855,56 @@ function minioCompose(options) {
807
855
  ""
808
856
  ].join("\n");
809
857
  }
858
+ /**
859
+ * A one-service compose file for Mailpit, on `dokploy-network` so the apps
860
+ * reach it by its service name. It accepts mail from anything on the network
861
+ * and delivers none of it.
862
+ */
863
+ function mailpitCompose(service) {
864
+ return [
865
+ "services:",
866
+ ` ${service}:`,
867
+ " image: axllent/mailpit:latest",
868
+ " environment:",
869
+ " MP_SMTP_AUTH_ACCEPT_ANY: '1'",
870
+ " MP_SMTP_AUTH_ALLOW_INSECURE: '1'",
871
+ " networks:",
872
+ " - dokploy-network",
873
+ "networks:",
874
+ " dokploy-network:",
875
+ " external: true",
876
+ ""
877
+ ].join("\n");
878
+ }
879
+ /**
880
+ * The S3 client's shared keys the stage set, for a bucket that is its own —
881
+ * none when it set none, since a bucket's URL may carry its own key.
882
+ */
883
+ function storageKeys(values) {
884
+ const keys = {};
885
+ for (const key of [...STORAGE_KEY_PAIR, "AWS_REGION"]) {
886
+ const value = values?.[key];
887
+ if (value !== void 0) keys[key] = value;
888
+ }
889
+ return keys;
890
+ }
891
+ /**
892
+ * The error for a bucket or mail the stage configured nothing for — what
893
+ * `validate` already refused, should a provisioner be reached without it.
894
+ */
895
+ function notConfigured(id, kind, context) {
896
+ const { missing } = externalServices({
897
+ stage: context.stage,
898
+ declarations: [{
899
+ id,
900
+ kind
901
+ }],
902
+ supplied: context.supplied ?? {},
903
+ allow: [],
904
+ ...context.domain ? { domain: context.domain } : {}
905
+ });
906
+ return new ExternalServicesNotConfigured(context.stage, missing);
907
+ }
810
908
  /** Whether anything reads through a reader on this construct. */
811
909
  function readsFrom(manifest, id) {
812
910
  return Object.values(manifest).some((declaration) => declaration.kind === "database-reader" && declaration.of === id);
@@ -995,6 +1093,8 @@ async function provisionDeclared(options) {
995
1093
  cache: cacheBackendFor(providerOf(workspace)),
996
1094
  events: eventsBackendFor(providerOf(workspace)),
997
1095
  storage: storageBackendFor(providerOf(workspace)),
1096
+ ...options.devServices ? { devServices: options.devServices } : {},
1097
+ ...workspace.deploy?.domains?.[options.stage] ? { domain: workspace.deploy.domains[options.stage] } : {},
998
1098
  addresses: surfaceAddresses(manifest, options.appUrls),
999
1099
  seed: options.seed,
1000
1100
  ...options.supplied ? { supplied: options.supplied } : {},
@@ -1986,8 +2086,25 @@ async function validateDokploy(phase) {
1986
2086
  secrets: phase.secrets,
1987
2087
  ctx
1988
2088
  };
2089
+ const stored = await phase.secrets.read();
2090
+ const services = assertExternalServices({
2091
+ stage,
2092
+ declarations: manifestServiceDeclarations(phase.manifest),
2093
+ supplied: stored?.custom ?? {},
2094
+ allow: phase.allowDevServices,
2095
+ ...workspace.deploy?.domains?.[stage] ? { domain: workspace.deploy.domains[stage] } : {}
2096
+ });
2097
+ reportDevServices(phase, devServicesUsed(services));
2098
+ await assertStageCredentials({
2099
+ root: workspace.root,
2100
+ patterns: constructGlobs(workspace),
2101
+ manifest: phase.manifest,
2102
+ stage,
2103
+ supplied: stored?.custom ?? {}
2104
+ });
1989
2105
  return {
1990
2106
  ...run,
2107
+ allowDevServices: phase.allowDevServices,
1991
2108
  preflight: await preflight(run),
1992
2109
  verify: verifySettings(workspace.deploy.dokploy?.verify),
1993
2110
  atomic: phase.atomic,
@@ -2167,7 +2284,8 @@ async function provision(run) {
2167
2284
  appUrls,
2168
2285
  supplied: stageSecrets.custom,
2169
2286
  seed: stageSecrets.seed,
2170
- manifest
2287
+ manifest,
2288
+ devServices: run.allowDevServices
2171
2289
  });
2172
2290
  declaredEnv = declared.env;
2173
2291
  declaredClusters = declared.clusters;
@@ -2985,4 +3103,4 @@ const MOBILE_SKIP_REASON = "deploys via its framework toolchain";
2985
3103
  //#endregion
2986
3104
  export { RegistryNotConfigured as _, dokployResult as a, releaseDokploy as c, validateDokploy as d, verifyDokploy as f, RegistryAmbiguous as g, HealthCheckTimedOut as h, dokployApi as i, restoreImage as l, DeployMigrationsFailed as m, FrontendDeployFailed as n, planDokploy as o, verifySettings as p, MissingEnvVars as r, provisionDokploy as s, BackendDeployFailed as t, rollbackDokploy as u, RegistryNotFound as v, ProjectNotOwned as y };
2987
3105
 
2988
- //# sourceMappingURL=engine-Gs0abjuj.mjs.map
3106
+ //# sourceMappingURL=engine-62Kl70Pj.mjs.map