@geekmidas/cli 10.0.0-alpha.68 → 10.0.0-alpha.70

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 (174) hide show
  1. package/dist/{LegacyStateStore-BZiO9-Lw.cjs → LegacyStateStore-Dd5IwiyC.cjs} +2 -2
  2. package/dist/{LegacyStateStore-BZiO9-Lw.cjs.map → LegacyStateStore-Dd5IwiyC.cjs.map} +1 -1
  3. package/dist/{LegacyStateStore-C39UKwmf.mjs → LegacyStateStore-NSHEinQi.mjs} +2 -2
  4. package/dist/{LegacyStateStore-C39UKwmf.mjs.map → LegacyStateStore-NSHEinQi.mjs.map} +1 -1
  5. package/dist/{LocalStateStore-DHVsZLyF.cjs → LocalStateStore-DTylG4T4.cjs} +2 -2
  6. package/dist/{LocalStateStore-DHVsZLyF.cjs.map → LocalStateStore-DTylG4T4.cjs.map} +1 -1
  7. package/dist/{LocalStateStore-Dk3Wbvzk.mjs → LocalStateStore-DUoG2wA_.mjs} +2 -2
  8. package/dist/{LocalStateStore-Dk3Wbvzk.mjs.map → LocalStateStore-DUoG2wA_.mjs.map} +1 -1
  9. package/dist/{OpenApiTsGenerator-BmUAcR7d.mjs → OpenApiTsGenerator-BYD9EcJi.mjs} +44 -13
  10. package/dist/OpenApiTsGenerator-BYD9EcJi.mjs.map +1 -0
  11. package/dist/{OpenApiTsGenerator-B2zrdyP4.cjs → OpenApiTsGenerator-CpRWM0N6.cjs} +44 -13
  12. package/dist/OpenApiTsGenerator-CpRWM0N6.cjs.map +1 -0
  13. package/dist/{S3StateStore--4tYVMAL.cjs → S3StateStore-D7hrU-sy.cjs} +2 -2
  14. package/dist/{S3StateStore--4tYVMAL.cjs.map → S3StateStore-D7hrU-sy.cjs.map} +1 -1
  15. package/dist/{S3StateStore-B_ZF9eHt.mjs → S3StateStore-Dxob3PNA.mjs} +2 -2
  16. package/dist/{S3StateStore-B_ZF9eHt.mjs.map → S3StateStore-Dxob3PNA.mjs.map} +1 -1
  17. package/dist/{SSMStateStore-ACZ8hRvZ.cjs → SSMStateStore-DGIKJ4NN.cjs} +2 -2
  18. package/dist/{SSMStateStore-ACZ8hRvZ.cjs.map → SSMStateStore-DGIKJ4NN.cjs.map} +1 -1
  19. package/dist/{SSMStateStore-DjPuKqrm.mjs → SSMStateStore-Dvl4A8Up.mjs} +2 -2
  20. package/dist/{SSMStateStore-DjPuKqrm.mjs.map → SSMStateStore-Dvl4A8Up.mjs.map} +1 -1
  21. package/dist/add-BuviRszv.mjs +566 -0
  22. package/dist/add-BuviRszv.mjs.map +1 -0
  23. package/dist/add-DHIk61nK.cjs +568 -0
  24. package/dist/add-DHIk61nK.cjs.map +1 -0
  25. package/dist/{bundler-C1pnNrR0.cjs → bundler-D7dcJVgj.cjs} +5 -5
  26. package/dist/{bundler-C1pnNrR0.cjs.map → bundler-D7dcJVgj.cjs.map} +1 -1
  27. package/dist/{bundler-C-w7aGoZ.mjs → bundler-DJlsYzm7.mjs} +5 -5
  28. package/dist/{bundler-C-w7aGoZ.mjs.map → bundler-DJlsYzm7.mjs.map} +1 -1
  29. package/dist/{cli-BLyD4c0O.cjs → cli-7zCum6uN.cjs} +4 -4
  30. package/dist/{cli-BLyD4c0O.cjs.map → cli-7zCum6uN.cjs.map} +1 -1
  31. package/dist/{cli-Ce4pLL5O.mjs → cli-BjnqVnE6.mjs} +4 -4
  32. package/dist/{cli-Ce4pLL5O.mjs.map → cli-BjnqVnE6.mjs.map} +1 -1
  33. package/dist/{compose-DvsgumY2.cjs → compose-BJYHmuvx.cjs} +368 -25
  34. package/dist/compose-BJYHmuvx.cjs.map +1 -0
  35. package/dist/{compose-DFxuYhn6.mjs → compose-CByVaaeR.mjs} +363 -26
  36. package/dist/compose-CByVaaeR.mjs.map +1 -0
  37. package/dist/{config-CxEp_g7j.d.mts → config-BN6iXvyR.d.mts} +3 -3
  38. package/dist/{config-BnA0kPTY.d.cts.map → config-BN6iXvyR.d.mts.map} +1 -1
  39. package/dist/{config-BnA0kPTY.d.cts → config-j9zBKaEG.d.cts} +3 -3
  40. package/dist/{config-CxEp_g7j.d.mts.map → config-j9zBKaEG.d.cts.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 +7 -7
  50. package/dist/deploy/public.d.cts +3 -3
  51. package/dist/deploy/public.d.cts.map +1 -1
  52. package/dist/deploy/public.d.mts +3 -3
  53. package/dist/deploy/public.d.mts.map +1 -1
  54. package/dist/deploy/public.mjs +7 -7
  55. package/dist/{deploy-C08GONYW.cjs → deploy--ZU9gOOa.cjs} +6 -6
  56. package/dist/{deploy-C08GONYW.cjs.map → deploy--ZU9gOOa.cjs.map} +1 -1
  57. package/dist/{deploy-D-EVOWvu.mjs → deploy-CCSGr7be.mjs} +6 -6
  58. package/dist/{deploy-D-EVOWvu.mjs.map → deploy-CCSGr7be.mjs.map} +1 -1
  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-CZ6nfSV9.cjs → dokploy-BOupc9PK.cjs} +2 -2
  64. package/dist/{dokploy-CZ6nfSV9.cjs.map → dokploy-BOupc9PK.cjs.map} +1 -1
  65. package/dist/{dokploy-DU-XJsoT.mjs → dokploy-Bskfn1g5.mjs} +2 -2
  66. package/dist/{dokploy-DU-XJsoT.mjs.map → dokploy-Bskfn1g5.mjs.map} +1 -1
  67. package/dist/{encryption-CCcBSLZs.cjs → encryption-D-VkoJG4.cjs} +3 -3
  68. package/dist/{encryption-CCcBSLZs.cjs.map → encryption-D-VkoJG4.cjs.map} +1 -1
  69. package/dist/{encryption-DSiLau1-.mjs → encryption-DR-py9GX.mjs} +3 -3
  70. package/dist/{encryption-DSiLau1-.mjs.map → encryption-DR-py9GX.mjs.map} +1 -1
  71. package/dist/{engine-BM9Dy_DT.cjs → engine-Da8dBxt5.cjs} +16 -7
  72. package/dist/engine-Da8dBxt5.cjs.map +1 -0
  73. package/dist/{engine-llWnMZH5.mjs → engine-Xbv8NNdX.mjs} +16 -7
  74. package/dist/{engine-llWnMZH5.mjs.map → engine-Xbv8NNdX.mjs.map} +1 -1
  75. package/dist/{github-yy6WpHIl.mjs → github-D2pYzY7L.mjs} +3 -3
  76. package/dist/{github-yy6WpHIl.mjs.map → github-D2pYzY7L.mjs.map} +1 -1
  77. package/dist/{github-ZoMam0OH.cjs → github-DeXzs11c.cjs} +3 -3
  78. package/dist/{github-ZoMam0OH.cjs.map → github-DeXzs11c.cjs.map} +1 -1
  79. package/dist/{index-EvZBkycu.d.cts → index-Bk3NY6DN.d.cts} +2 -2
  80. package/dist/{index-CkX89m6S.d.mts.map → index-Bk3NY6DN.d.cts.map} +1 -1
  81. package/dist/{index-CkX89m6S.d.mts → index-DvoxuTqR.d.mts} +2 -2
  82. package/dist/{index-EvZBkycu.d.cts.map → index-DvoxuTqR.d.mts.map} +1 -1
  83. package/dist/index.cjs +89 -48
  84. package/dist/index.cjs.map +1 -1
  85. package/dist/index.mjs +89 -48
  86. package/dist/index.mjs.map +1 -1
  87. package/dist/{migrate-tOwxQBTI.cjs → migrate-BURDS8vy.cjs} +4 -4
  88. package/dist/{migrate-tOwxQBTI.cjs.map → migrate-BURDS8vy.cjs.map} +1 -1
  89. package/dist/{migrate-BWPuwiXk.mjs → migrate-DiJT84g9.mjs} +4 -4
  90. package/dist/{migrate-BWPuwiXk.mjs.map → migrate-DiJT84g9.mjs.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-B6uHr4sm.cjs → ready-C-qNcux-.cjs} +3 -3
  96. package/dist/{ready-B6uHr4sm.cjs.map → ready-C-qNcux-.cjs.map} +1 -1
  97. package/dist/{ready-2s3-CndS.mjs → ready-CfIiMts4.mjs} +3 -3
  98. package/dist/{ready-2s3-CndS.mjs.map → ready-CfIiMts4.mjs.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-BymzGtuT.cjs → resolve-B7jJQmTo.cjs} +3 -3
  104. package/dist/{resolve-BymzGtuT.cjs.map → resolve-B7jJQmTo.cjs.map} +1 -1
  105. package/dist/{resolve-pIvXlZ1h.mjs → resolve-Dj5TQKoD.mjs} +3 -3
  106. package/dist/{resolve-pIvXlZ1h.mjs.map → resolve-Dj5TQKoD.mjs.map} +1 -1
  107. package/dist/{rollback-ZlsbQOvj.mjs → rollback-Bw9kESjz.mjs} +5 -5
  108. package/dist/{rollback-ZlsbQOvj.mjs.map → rollback-Bw9kESjz.mjs.map} +1 -1
  109. package/dist/{rollback-zdfi6Reg.cjs → rollback-DNK1HEHY.cjs} +5 -5
  110. package/dist/{rollback-zdfi6Reg.cjs.map → rollback-DNK1HEHY.cjs.map} +1 -1
  111. package/dist/{runtime-DWThEP-r.d.cts → runtime-CYAO4iZG.d.cts} +2 -2
  112. package/dist/{runtime-B3jNgeP-.d.mts.map → runtime-CYAO4iZG.d.cts.map} +1 -1
  113. package/dist/{runtime-B3jNgeP-.d.mts → runtime-DHJhe4QI.d.mts} +2 -2
  114. package/dist/{runtime-DWThEP-r.d.cts.map → runtime-DHJhe4QI.d.mts.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-DpHpFZBD.cjs} +7 -7
  130. package/dist/sniffer-DpHpFZBD.cjs.map +1 -0
  131. package/dist/{sniffer-BdFeLSmA.mjs → sniffer-vAXsU_4G.mjs} +7 -7
  132. package/dist/sniffer-vAXsU_4G.mjs.map +1 -0
  133. package/dist/{state-Bn5JDMFT.mjs → state-527OmqvN.mjs} +156 -64
  134. package/dist/state-527OmqvN.mjs.map +1 -0
  135. package/dist/{state-CHZqCDRC.cjs → state-nS6I6s4u.cjs} +179 -63
  136. package/dist/state-nS6I6s4u.cjs.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-CZdCxUCK.d.cts → types-BD1jgA85.d.cts} +70 -2
  146. package/dist/types-BD1jgA85.d.cts.map +1 -0
  147. package/dist/{types-Da0E3Qv7.d.mts → types-DkG5WW8l.d.mts} +70 -2
  148. package/dist/types-DkG5WW8l.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 +3 -3
  153. package/dist/workspace/index.d.mts +3 -3
  154. package/dist/workspace/index.mjs +1 -1
  155. package/dist/{workspace-Be6uBhlF.mjs → workspace-C7NqCsQF.mjs} +105 -3
  156. package/dist/workspace-C7NqCsQF.mjs.map +1 -0
  157. package/dist/{workspace-ON-bqiJz.cjs → workspace-vdrcRI-m.cjs} +116 -2
  158. package/dist/workspace-vdrcRI-m.cjs.map +1 -0
  159. package/package.json +16 -13
  160. package/dist/OpenApiTsGenerator-B2zrdyP4.cjs.map +0 -1
  161. package/dist/OpenApiTsGenerator-BmUAcR7d.mjs.map +0 -1
  162. package/dist/compose-DFxuYhn6.mjs.map +0 -1
  163. package/dist/compose-DvsgumY2.cjs.map +0 -1
  164. package/dist/engine-BM9Dy_DT.cjs.map +0 -1
  165. package/dist/schemas-Cfhtpdo0.mjs.map +0 -1
  166. package/dist/schemas-RUlKHu27.cjs.map +0 -1
  167. package/dist/sniffer-BdFeLSmA.mjs.map +0 -1
  168. package/dist/sniffer-D66HIvi9.cjs.map +0 -1
  169. package/dist/state-Bn5JDMFT.mjs.map +0 -1
  170. package/dist/state-CHZqCDRC.cjs.map +0 -1
  171. package/dist/types-CZdCxUCK.d.cts.map +0 -1
  172. package/dist/types-Da0E3Qv7.d.mts.map +0 -1
  173. package/dist/workspace-Be6uBhlF.mjs.map +0 -1
  174. package/dist/workspace-ON-bqiJz.cjs.map +0 -1
@@ -1,10 +1,10 @@
1
1
  const require_rolldown_runtime = require("./rolldown-runtime-C0BPl7ul.cjs");
2
2
  const require_run = require("./run-fVZ-rLnc.cjs");
3
- const require_discover = require("./discover-OEfZ9OkA.cjs");
3
+ const require_discover = require("./discover-B4VjaFJk.cjs");
4
4
  const require_derive = require("./derive-DAbo49sm.cjs");
5
- const require_workspace = require("./workspace-ON-bqiJz.cjs");
5
+ const require_workspace = require("./workspace-vdrcRI-m.cjs");
6
6
  const require_config = require("./config.cjs");
7
- const require_resolve = require("./resolve-BymzGtuT.cjs");
7
+ const require_resolve = require("./resolve-B7jJQmTo.cjs");
8
8
  const require_fakes = require("./fakes-zW-jNAbQ.cjs");
9
9
  let node_path = require("node:path");
10
10
  let node_fs = require("node:fs");
@@ -12,8 +12,8 @@ let node_fs_promises = require("node:fs/promises");
12
12
  let node_os = require("node:os");
13
13
  let node_util = require("node:util");
14
14
  let _geekmidas_manifest = require("@geekmidas/manifest");
15
- let node_child_process = require("node:child_process");
16
15
  let node_net = require("node:net");
16
+ let node_child_process = require("node:child_process");
17
17
  let dotenv = require("dotenv");
18
18
  let node_crypto = require("node:crypto");
19
19
  let _geekmidas_constructs_encryption = require("@geekmidas/constructs/encryption");
@@ -4650,7 +4650,7 @@ var ExternalServicesNotConfigured = class extends Error {
4650
4650
  const by = m.apps?.length ? `, read by ${m.apps.join(", ")}` : "";
4651
4651
  return ` gkm secrets:set ${m.key} '${m.example}' --stage ${stage}\n ${m.what}${by}` + (m.note ? `\n ${m.note}` : "");
4652
4652
  });
4653
- super(`The stage '${stage}' is deployed, and a deployed stage's mail and object storage are real services: gkm runs no Mailpit or MinIO for it. Set ${missing.length === 1 ? "this key" : `these ${missing.length} keys`} in the stage's secrets:\n\n${lines.join("\n")}\n\nFor a stage that is not production — a preview, a demo — the dev services can run instead, with --allow-dev-services ${services.join(",")}. Mailpit delivers no mail, and MinIO keeps every object on one container's disk.`);
4653
+ super(`The stage '${stage}' is deployed, and a deployed stage's mail and object storage are real services: gkm runs no Mailpit or MinIO for it. Set ${missing.length === 1 ? "this key" : `these ${missing.length} keys`} in the stage's secrets:\n\n${lines.join("\n")}\n\nFor a stage that is not production — a preview, a demo — the dev services can run instead, with --allow-dev-services ${services.join(",")}. Mailpit delivers no mail, and MinIO keeps every object on one container's disk.\n\nOr run: gkm secrets:add --stage ${stage}`);
4654
4654
  this.stage = stage;
4655
4655
  this.missing = missing;
4656
4656
  this.name = "ExternalServicesNotConfigured";
@@ -4692,85 +4692,127 @@ function manifestServiceDeclarations(manifest) {
4692
4692
  });
4693
4693
  }
4694
4694
  /**
4695
- * Where a deployed stage's mail and storage come from, and what it lacks.
4695
+ * Every key a stage must be given rather than derive — the one list both a
4696
+ * deploy's checks and `gkm secrets:add` read, so what a deploy refuses and
4697
+ * what the builder offers cannot drift.
4696
4698
  *
4697
- * - Mail is external once its URL is set, and then needs its sending
4698
- * address too. Unset, it is Mailpit where allowed — the address derived
4699
- * unless set — and missing otherwise.
4700
- * - A bucket is external once its URL is set; its credentials, in the URL or
4701
- * the shared pair, are optional. Unset, it is MinIO where allowed, and
4702
- * missing otherwise.
4703
- * - A file server's URL is derived where its bucket is MinIO, unless set;
4704
- * over an external bucket the stage must set it.
4699
+ * - Deployed, mail is its URL and its sending address, a bucket its URL, and
4700
+ * a file server its public URL. Locally all of it is Mailpit and MinIO.
4701
+ * - On every stage, a third party's credentials: nobody but the third party
4702
+ * can issue them.
4703
+ *
4704
+ * Never a derived value: a database URL, a generated secret, the seed.
4705
4705
  */
4706
- function externalServices(input) {
4707
- const { supplied, allow } = input;
4708
- const has = (key) => supplied[key] !== void 0;
4706
+ function requiredStageKeys(input) {
4709
4707
  const domain = input.domain ?? "example.com";
4710
- const missing = [];
4711
- const minio = [];
4712
- const mailpit = [];
4708
+ const keys = [];
4713
4709
  const add = (entry) => {
4714
- if (!missing.some((m) => m.key === entry.key)) missing.push(entry);
4710
+ if (!keys.some((k) => k.key === entry.key)) keys.push(entry);
4715
4711
  };
4716
- const declarations = [...input.declarations].sort((a, b) => a.id.localeCompare(b.id));
4712
+ const byId = (list) => [...list ?? []].sort((a, b) => a.id.localeCompare(b.id));
4717
4713
  const apps = (d) => d.apps?.length ? { apps: [...d.apps].sort() } : {};
4718
- for (const d of declarations.filter((d) => d.kind === "email")) {
4719
- const url = (0, _geekmidas_manifest.provideKey)(d.id, "url");
4720
- const from = (0, _geekmidas_manifest.provideKey)(d.id, "from");
4721
- if (!has(url) && allow.includes("mailpit")) {
4722
- mailpit.push(d.id);
4723
- continue;
4724
- }
4725
- if (!has(url)) add({
4726
- key: url,
4727
- id: d.id,
4728
- what: `where '${d.id}' sends mail — any SMTP server`,
4729
- example: `smtp://user:password@smtp.${domain}:587`,
4730
- service: "mailpit",
4731
- ...apps(d)
4732
- });
4733
- if (!has(from)) add({
4734
- key: from,
4735
- id: d.id,
4736
- what: `the address '${d.id}' sends from, on a domain the mail server has verified`,
4737
- example: `noreply@${domain}`,
4738
- service: "mailpit",
4739
- ...apps(d)
4740
- });
4741
- }
4742
- for (const d of declarations.filter((d) => d.kind === "objects")) {
4743
- const url = (0, _geekmidas_manifest.provideKey)(d.id, "url");
4744
- if (has(url)) continue;
4745
- if (allow.includes("minio")) {
4746
- minio.push(d.id);
4747
- continue;
4714
+ if (!input.local) {
4715
+ const services = byId(input.services);
4716
+ for (const d of services.filter((d) => d.kind === "email")) {
4717
+ add({
4718
+ key: (0, _geekmidas_manifest.provideKey)(d.id, "url"),
4719
+ id: d.id,
4720
+ kind: "email",
4721
+ what: `where '${d.id}' sends mail — any SMTP server`,
4722
+ example: `smtp://user:password@smtp.${domain}:587`,
4723
+ service: "mailpit",
4724
+ ...apps(d)
4725
+ });
4726
+ add({
4727
+ key: (0, _geekmidas_manifest.provideKey)(d.id, "from"),
4728
+ id: d.id,
4729
+ kind: "email",
4730
+ what: `the address '${d.id}' sends from, on a domain the mail server has verified`,
4731
+ example: `noreply@${domain}`,
4732
+ service: "mailpit",
4733
+ ...apps(d)
4734
+ });
4748
4735
  }
4749
- add({
4750
- key: url,
4736
+ for (const d of services.filter((d) => d.kind === "objects")) add({
4737
+ key: (0, _geekmidas_manifest.provideKey)(d.id, "url"),
4751
4738
  id: d.id,
4739
+ kind: "bucket",
4752
4740
  what: `the bucket '${d.id}' — S3, R2, or any S3-compatible store (add &endpoint=… for one that is not S3)`,
4753
4741
  note: `credentials are optional: a key for this bucket alone in the URL (s3://KEY:SECRET@${require_derive.appKey(d.id)}?…) wins; without one, the shared AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY or a role signs`,
4754
4742
  example: `s3://${require_derive.appKey(d.id)}?region=eu-west-1`,
4755
4743
  service: "minio",
4756
4744
  ...apps(d)
4757
4745
  });
4758
- }
4759
- for (const d of declarations.filter((d) => d.kind === "file-server")) {
4760
- const url = (0, _geekmidas_manifest.provideKey)(d.id, "url");
4761
- if (has(url)) continue;
4762
- if (d.of && minio.includes(d.of)) continue;
4763
- add({
4764
- key: url,
4746
+ for (const d of services.filter((d) => d.kind === "file-server")) add({
4747
+ key: (0, _geekmidas_manifest.provideKey)(d.id, "url"),
4765
4748
  id: d.id,
4749
+ kind: "file-server",
4766
4750
  what: `the public address '${d.id}' serves its bucket on — a CDN or the bucket's own domain`,
4767
4751
  example: `https://${require_derive.appKey(d.id)}.${domain}`,
4768
4752
  service: "minio",
4753
+ ...d.of ? { of: d.of } : {},
4769
4754
  ...apps(d)
4770
4755
  });
4771
4756
  }
4757
+ for (const d of byId(input.credentials)) add({
4758
+ key: (0, _geekmidas_manifest.provideKey)(d.id, "credentials"),
4759
+ id: d.id,
4760
+ kind: d.kind,
4761
+ what: d.kind === "external-api" ? `the credentials '${d.id}' was issued for this stage, as its schema describes them` : `the credential '${d.id}', as its schema describes it`,
4762
+ example: "{\"apiKey\":\"…\"}",
4763
+ ...apps(d)
4764
+ });
4765
+ return keys;
4766
+ }
4767
+ /**
4768
+ * Whether only the stage's secrets can supply `key` to a construct of `kind`
4769
+ * — what nothing on the stage derives.
4770
+ *
4771
+ * A third party's credentials, always. Deployed, also each generated secret
4772
+ * and keyring: the stage generated each one once, and every run reads the
4773
+ * same value back.
4774
+ */
4775
+ function suppliedOnly(kind, id, key, local) {
4776
+ if (kind === "credential") return true;
4777
+ if (kind === "external-api") return key === (0, _geekmidas_manifest.provideKey)(id, "credentials");
4778
+ if (local) return false;
4779
+ return kind === "secret" || kind === "encryption";
4780
+ }
4781
+ /**
4782
+ * Where a deployed stage's mail and storage come from, and what it lacks.
4783
+ *
4784
+ * - Mail is external once its URL is set, and then needs its sending
4785
+ * address too. Unset, it is Mailpit where allowed — the address derived
4786
+ * unless set — and missing otherwise.
4787
+ * - A bucket is external once its URL is set; its credentials, in the URL or
4788
+ * the shared pair, are optional. Unset, it is MinIO where allowed, and
4789
+ * missing otherwise.
4790
+ * - A file server's URL is derived where its bucket is MinIO, unless set;
4791
+ * over an external bucket the stage must set it.
4792
+ *
4793
+ * The keys themselves are {@link requiredStageKeys}'s.
4794
+ */
4795
+ function externalServices(input) {
4796
+ const { supplied, allow } = input;
4797
+ const has = (key) => supplied[key] !== void 0;
4798
+ const required = requiredStageKeys({
4799
+ local: false,
4800
+ services: input.declarations,
4801
+ ...input.domain ? { domain: input.domain } : {}
4802
+ });
4803
+ const mailpit = required.filter((k) => k.kind === "email" && k.key === (0, _geekmidas_manifest.provideKey)(k.id, "url")).filter((k) => !has(k.key) && allow.includes("mailpit")).map((k) => k.id);
4804
+ const minio = required.filter((k) => k.kind === "bucket").filter((k) => !has(k.key) && allow.includes("minio")).map((k) => k.id);
4805
+ const covered = (k) => k.kind === "email" && mailpit.includes(k.id) || k.kind === "bucket" && minio.includes(k.id) || k.kind === "file-server" && k.of !== void 0 && minio.includes(k.of);
4772
4806
  return {
4773
- missing,
4807
+ missing: required.filter((k) => !has(k.key) && !covered(k)).map(({ key, id, what, note, example, service, apps }) => ({
4808
+ key,
4809
+ id,
4810
+ what,
4811
+ ...note ? { note } : {},
4812
+ example,
4813
+ service,
4814
+ ...apps ? { apps } : {}
4815
+ })),
4774
4816
  minio,
4775
4817
  mailpit
4776
4818
  };
@@ -4818,6 +4860,56 @@ function reportDevServices(ctx, uses) {
4818
4860
  }
4819
4861
  }
4820
4862
  //#endregion
4863
+ //#region src/deploy/otel.ts
4864
+ /**
4865
+ * The OpenTelemetry variables a stage's secrets pass to every backend.
4866
+ *
4867
+ * A production server starts OpenTelemetry when `OTEL_EXPORTER_OTLP_ENDPOINT`
4868
+ * is set (`generators/telemetry.ts`), and the SDK reads the rest of its
4869
+ * configuration from the standard `OTEL_*` variables. No construct declares
4870
+ * them — they say where the telemetry goes, not what the app is — so a target
4871
+ * that writes each backend only the keys it reads would never hand them over.
4872
+ * Every target that runs backends asks this module instead.
4873
+ *
4874
+ * Which keys pass is a pattern over the `OTEL_` prefix rather than the prefix
4875
+ * alone or a list:
4876
+ *
4877
+ * - The bare prefix would forward anything a stage happened to name `OTEL_*`
4878
+ * — `OTEL_LOG_LEVEL=debug`, `OTEL_SDK_DISABLED` — to every backend, without
4879
+ * anyone choosing to.
4880
+ * - A list would have to spell out the exporter's five settings once for all
4881
+ * signals and once per signal — twenty keys — and would miss the next one.
4882
+ *
4883
+ * The pattern names the families the server uses: the OTLP exporter's
4884
+ * endpoint, headers, protocol, timeout and compression, for every signal or
4885
+ * for one (`OTEL_EXPORTER_OTLP_LOGS_ENDPOINT`); sampling; and the resource's
4886
+ * identity.
4887
+ *
4888
+ * Sites get none of it: a site's environment is inlined into a bundle that
4889
+ * every browser downloads, and an exporter's headers are a credential.
4890
+ */
4891
+ /** The `OTEL_*` variables a backend is handed from the stage's secrets. */
4892
+ const OTEL_PASSTHROUGH = /^OTEL_(?:EXPORTER_OTLP_(?:(?:TRACES|LOGS|METRICS)_)?(?:ENDPOINT|HEADERS|PROTOCOL|TIMEOUT|COMPRESSION)|TRACES_SAMPLER(?:_ARG)?|RESOURCE_ATTRIBUTES|SERVICE_NAME)$/;
4893
+ /** Whether a stage secret is one of the passed-through `OTEL_*` variables. */
4894
+ function isOtelVariable(key) {
4895
+ return OTEL_PASSTHROUGH.test(key);
4896
+ }
4897
+ /** Whether a variable says where an OTLP exporter sends, or how it signs. */
4898
+ function isOtlpDestination(key) {
4899
+ return /^OTEL_EXPORTER_OTLP_(?:(?:TRACES|LOGS|METRICS)_)?(?:ENDPOINT|HEADERS)$/.test(key);
4900
+ }
4901
+ /**
4902
+ * The `OTEL_*` variables one backend runs with: every one the stage's secrets
4903
+ * hold, and `OTEL_SERVICE_NAME` — the app's name — where the stage set
4904
+ * telemetry up without naming the service. Empty when the stage set none.
4905
+ */
4906
+ function otelEnv(custom, app) {
4907
+ const env = {};
4908
+ for (const [key, value] of Object.entries(custom)) if (isOtelVariable(key) && value !== "") env[key] = value;
4909
+ if (Object.keys(env).length > 0 && !env.OTEL_SERVICE_NAME) env.OTEL_SERVICE_NAME = app;
4910
+ return env;
4911
+ }
4912
+ //#endregion
4821
4913
  //#region src/target/dokploy/domain.ts
4822
4914
  /** A stage was deployed that `deploy.domains` gives no domain. */
4823
4915
  var NoDomainForStage = class extends Error {
@@ -5984,6 +6076,12 @@ Object.defineProperty(exports, "isMainFrontendApp", {
5984
6076
  return isMainFrontendApp;
5985
6077
  }
5986
6078
  });
6079
+ Object.defineProperty(exports, "isOtlpDestination", {
6080
+ enumerable: true,
6081
+ get: function() {
6082
+ return isOtlpDestination;
6083
+ }
6084
+ });
5987
6085
  Object.defineProperty(exports, "isOwnedBy", {
5988
6086
  enumerable: true,
5989
6087
  get: function() {
@@ -6056,6 +6154,12 @@ Object.defineProperty(exports, "networkEnv", {
6056
6154
  return networkEnv;
6057
6155
  }
6058
6156
  });
6157
+ Object.defineProperty(exports, "otelEnv", {
6158
+ enumerable: true,
6159
+ get: function() {
6160
+ return otelEnv;
6161
+ }
6162
+ });
6059
6163
  Object.defineProperty(exports, "ownershipMarker", {
6060
6164
  enumerable: true,
6061
6165
  get: function() {
@@ -6164,6 +6268,12 @@ Object.defineProperty(exports, "reportDevServices", {
6164
6268
  return reportDevServices;
6165
6269
  }
6166
6270
  });
6271
+ Object.defineProperty(exports, "requiredStageKeys", {
6272
+ enumerable: true,
6273
+ get: function() {
6274
+ return requiredStageKeys;
6275
+ }
6276
+ });
6167
6277
  Object.defineProperty(exports, "resolveHost", {
6168
6278
  enumerable: true,
6169
6279
  get: function() {
@@ -6236,6 +6346,12 @@ Object.defineProperty(exports, "store_exports", {
6236
6346
  return store_exports;
6237
6347
  }
6238
6348
  });
6349
+ Object.defineProperty(exports, "suppliedOnly", {
6350
+ enumerable: true,
6351
+ get: function() {
6352
+ return suppliedOnly;
6353
+ }
6354
+ });
6239
6355
  Object.defineProperty(exports, "toEmbeddableSecrets", {
6240
6356
  enumerable: true,
6241
6357
  get: function() {
@@ -6267,4 +6383,4 @@ Object.defineProperty(exports, "workspace_exports", {
6267
6383
  }
6268
6384
  });
6269
6385
 
6270
- //# sourceMappingURL=state-CHZqCDRC.cjs.map
6386
+ //# sourceMappingURL=state-nS6I6s4u.cjs.map