@geekmidas/cli 10.0.0-alpha.84 → 10.0.0-alpha.85

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 (91) hide show
  1. package/dist/{LegacyStateStore-CTsUFLNQ.mjs → LegacyStateStore-CJ2o18nT.mjs} +2 -2
  2. package/dist/{LegacyStateStore-CTsUFLNQ.mjs.map → LegacyStateStore-CJ2o18nT.mjs.map} +1 -1
  3. package/dist/{LegacyStateStore-EDT2TUSe.cjs → LegacyStateStore-xGxPwP-m.cjs} +2 -2
  4. package/dist/{LegacyStateStore-EDT2TUSe.cjs.map → LegacyStateStore-xGxPwP-m.cjs.map} +1 -1
  5. package/dist/{LocalStateStore-D1VfxRuK.mjs → LocalStateStore-ByVjUIvS.mjs} +12 -10
  6. package/dist/LocalStateStore-ByVjUIvS.mjs.map +1 -0
  7. package/dist/{LocalStateStore-CdpzTvPn.cjs → LocalStateStore-CkjFD-4b.cjs} +11 -9
  8. package/dist/LocalStateStore-CkjFD-4b.cjs.map +1 -0
  9. package/dist/{S3StateStore-BPM74zwv.cjs → S3StateStore-iqMezbES.cjs} +2 -2
  10. package/dist/{S3StateStore-BPM74zwv.cjs.map → S3StateStore-iqMezbES.cjs.map} +1 -1
  11. package/dist/{S3StateStore-DVZ1YuGJ.mjs → S3StateStore-kpFlGVLE.mjs} +2 -2
  12. package/dist/{S3StateStore-DVZ1YuGJ.mjs.map → S3StateStore-kpFlGVLE.mjs.map} +1 -1
  13. package/dist/{SSMStateStore-DLvnGyyl.mjs → SSMStateStore-Bkz5ztfo.mjs} +2 -2
  14. package/dist/{SSMStateStore-DLvnGyyl.mjs.map → SSMStateStore-Bkz5ztfo.mjs.map} +1 -1
  15. package/dist/{SSMStateStore-qerm5c36.cjs → SSMStateStore-Z2OMVCtq.cjs} +2 -2
  16. package/dist/{SSMStateStore-qerm5c36.cjs.map → SSMStateStore-Z2OMVCtq.cjs.map} +1 -1
  17. package/dist/{add-BQ8v1ZII.cjs → add-CM7RLj89.cjs} +2 -2
  18. package/dist/{add-BQ8v1ZII.cjs.map → add-CM7RLj89.cjs.map} +1 -1
  19. package/dist/{add-DbnzC7Kl.mjs → add-jpX7M8RB.mjs} +2 -2
  20. package/dist/{add-DbnzC7Kl.mjs.map → add-jpX7M8RB.mjs.map} +1 -1
  21. package/dist/{bundler-D4030Afw.mjs → bundler-CaAKsbcN.mjs} +5 -5
  22. package/dist/{bundler-D4030Afw.mjs.map → bundler-CaAKsbcN.mjs.map} +1 -1
  23. package/dist/{bundler-DjrRffko.cjs → bundler-lEBH8ENP.cjs} +5 -5
  24. package/dist/{bundler-DjrRffko.cjs.map → bundler-lEBH8ENP.cjs.map} +1 -1
  25. package/dist/{cli-DwTa9d_8.mjs → cli-BV3jzbk0.mjs} +3 -3
  26. package/dist/{cli-DwTa9d_8.mjs.map → cli-BV3jzbk0.mjs.map} +1 -1
  27. package/dist/{cli-D8YQAYUX.cjs → cli-DQCBcNlN.cjs} +3 -3
  28. package/dist/{cli-D8YQAYUX.cjs.map → cli-DQCBcNlN.cjs.map} +1 -1
  29. package/dist/{compose-C5wz8mf9.mjs → compose-CQK6StuE.mjs} +24 -6
  30. package/dist/compose-CQK6StuE.mjs.map +1 -0
  31. package/dist/{compose-DqWh1TaO.cjs → compose-CSR0yEJm.cjs} +23 -5
  32. package/dist/compose-CSR0yEJm.cjs.map +1 -0
  33. package/dist/deploy/public.cjs +6 -6
  34. package/dist/deploy/public.mjs +6 -6
  35. package/dist/{deploy-BwIKGxWH.mjs → deploy-BuU117CA.mjs} +4 -4
  36. package/dist/{deploy-BwIKGxWH.mjs.map → deploy-BuU117CA.mjs.map} +1 -1
  37. package/dist/{deploy-C8sWg81_.cjs → deploy-Bw2Mm3x3.cjs} +4 -4
  38. package/dist/{deploy-C8sWg81_.cjs.map → deploy-Bw2Mm3x3.cjs.map} +1 -1
  39. package/dist/{dokploy-BkRxJbfi.cjs → dokploy-C81J1MVK.cjs} +2 -2
  40. package/dist/{dokploy-BkRxJbfi.cjs.map → dokploy-C81J1MVK.cjs.map} +1 -1
  41. package/dist/{dokploy-ijjms1-h.mjs → dokploy-DWALWk7u.mjs} +2 -2
  42. package/dist/{dokploy-ijjms1-h.mjs.map → dokploy-DWALWk7u.mjs.map} +1 -1
  43. package/dist/{encryption-g6PzwwfL.cjs → encryption-B8h8Tna0.cjs} +2 -2
  44. package/dist/{encryption-g6PzwwfL.cjs.map → encryption-B8h8Tna0.cjs.map} +1 -1
  45. package/dist/{encryption-BRcBAmjL.mjs → encryption-DpAum8W7.mjs} +2 -2
  46. package/dist/{encryption-BRcBAmjL.mjs.map → encryption-DpAum8W7.mjs.map} +1 -1
  47. package/dist/{engine-DLEJsZ3i.cjs → engine-B01fjhLt.cjs} +3 -3
  48. package/dist/{engine-DLEJsZ3i.cjs.map → engine-B01fjhLt.cjs.map} +1 -1
  49. package/dist/{engine-BP0CZ5fh.mjs → engine-BXCtEhSH.mjs} +3 -3
  50. package/dist/{engine-BP0CZ5fh.mjs.map → engine-BXCtEhSH.mjs.map} +1 -1
  51. package/dist/{github-Zs-dVJbR.mjs → github-8B68qrLs.mjs} +2 -2
  52. package/dist/{github-Zs-dVJbR.mjs.map → github-8B68qrLs.mjs.map} +1 -1
  53. package/dist/{github-B8YjwdLK.cjs → github-Cis9tYur.cjs} +2 -2
  54. package/dist/{github-B8YjwdLK.cjs.map → github-Cis9tYur.cjs.map} +1 -1
  55. package/dist/index.cjs +45 -45
  56. package/dist/index.cjs.map +1 -1
  57. package/dist/index.mjs +45 -45
  58. package/dist/index.mjs.map +1 -1
  59. package/dist/{migrate-BfZN1S32.cjs → migrate-BBCp5blp.cjs} +2 -2
  60. package/dist/{migrate-BfZN1S32.cjs.map → migrate-BBCp5blp.cjs.map} +1 -1
  61. package/dist/{migrate-CdXcX0XR.mjs → migrate-BeTWLSeC.mjs} +2 -2
  62. package/dist/{migrate-CdXcX0XR.mjs.map → migrate-BeTWLSeC.mjs.map} +1 -1
  63. package/dist/{migrate-FoL_mZIz.cjs → migrate-CPWn7A51.cjs} +2 -2
  64. package/dist/{migrate-FoL_mZIz.cjs.map → migrate-CPWn7A51.cjs.map} +1 -1
  65. package/dist/{migrate-DOMU4uKe.mjs → migrate-sDq7NApJ.mjs} +2 -2
  66. package/dist/{migrate-DOMU4uKe.mjs.map → migrate-sDq7NApJ.mjs.map} +1 -1
  67. package/dist/{resolve-r7PAs6ng.mjs → resolve-CXbwJ_iu.mjs} +3 -3
  68. package/dist/{resolve-r7PAs6ng.mjs.map → resolve-CXbwJ_iu.mjs.map} +1 -1
  69. package/dist/{resolve-T2I-5FcT.cjs → resolve-CztIqBOI.cjs} +3 -3
  70. package/dist/{resolve-T2I-5FcT.cjs.map → resolve-CztIqBOI.cjs.map} +1 -1
  71. package/dist/{rollback-BSdxnW3X.mjs → rollback-ByyFE5lV.mjs} +4 -4
  72. package/dist/{rollback-BSdxnW3X.mjs.map → rollback-ByyFE5lV.mjs.map} +1 -1
  73. package/dist/{rollback-CPSDjGse.cjs → rollback-CyIJ4xGJ.cjs} +4 -4
  74. package/dist/{rollback-CPSDjGse.cjs.map → rollback-CyIJ4xGJ.cjs.map} +1 -1
  75. package/dist/{seeds-BK8caVMm.mjs → seeds-9C5CkDon.mjs} +31 -3
  76. package/dist/seeds-9C5CkDon.mjs.map +1 -0
  77. package/dist/{seeds-DQ0FG57Z.cjs → seeds-B_Beuv0o.cjs} +30 -2
  78. package/dist/seeds-B_Beuv0o.cjs.map +1 -0
  79. package/dist/{sniffer-hSf5mRgV.cjs → sniffer-3fA0iExx.cjs} +5 -5
  80. package/dist/{sniffer-hSf5mRgV.cjs.map → sniffer-3fA0iExx.cjs.map} +1 -1
  81. package/dist/{sniffer-CqE_KTTp.mjs → sniffer-DgBkaLAu.mjs} +5 -5
  82. package/dist/{sniffer-CqE_KTTp.mjs.map → sniffer-DgBkaLAu.mjs.map} +1 -1
  83. package/dist/target/public.cjs +1 -1
  84. package/dist/target/public.mjs +1 -1
  85. package/package.json +15 -15
  86. package/dist/LocalStateStore-CdpzTvPn.cjs.map +0 -1
  87. package/dist/LocalStateStore-D1VfxRuK.mjs.map +0 -1
  88. package/dist/compose-C5wz8mf9.mjs.map +0 -1
  89. package/dist/compose-DqWh1TaO.cjs.map +0 -1
  90. package/dist/seeds-BK8caVMm.mjs.map +0 -1
  91. package/dist/seeds-DQ0FG57Z.cjs.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import { r as storedCredentials } from "./credentials-pAtB70k3.mjs";
2
- import { F as parseDevServices } from "./seeds-BK8caVMm.mjs";
3
- import { t as deploy } from "./deploy-BwIKGxWH.mjs";
2
+ import { F as parseDevServices } from "./seeds-9C5CkDon.mjs";
3
+ import { t as deploy } from "./deploy-BuU117CA.mjs";
4
4
  import { i as formatError } from "./index.mjs";
5
5
  import { n as targetForProvider } from "./provider-q4lsYzYG.mjs";
6
6
  import { terminalCredentials } from "./terminal-BdvrmkaC.mjs";
@@ -73,4 +73,4 @@ async function deployCli(options, streams = { stdout: process.stdout }) {
73
73
  //#endregion
74
74
  export { deployCli };
75
75
 
76
- //# sourceMappingURL=cli-DwTa9d_8.mjs.map
76
+ //# sourceMappingURL=cli-BV3jzbk0.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"cli-DwTa9d_8.mjs","names":[],"sources":["../src/deploy/cli.ts"],"sourcesContent":["/**\n * `gkm deploy`: the terminal around `deploy()`. CLI layer only.\n *\n * Everything that belongs to a person at a terminal lives here and nowhere\n * below it: prompting for a missing login (and storing it), printing progress,\n * and turning the outcome into an exit code. The deploy itself is the same\n * `deploy()` a host calls.\n */\n\nimport { formatError } from '../debug';\nimport { targetForProvider } from '../target/provider';\nimport { storedCredentials } from './credentials';\nimport { deploy } from './deploy';\nimport { type DevService, parseDevServices } from './devServices';\nimport { terminalCredentials } from './terminal';\n\nexport interface DeployCliOptions {\n\t/** The project directory: `--cwd`, else where the command was run. */\n\tcwd: string;\n\t/** `--target`: where to deploy. Defaults to `deploy.default`. */\n\ttarget?: string;\n\t/** `--provider`, deprecated: `dokploy` means `--target dokploy`. */\n\tprovider?: string;\n\tstage: string;\n\ttag?: string;\n\t/**\n\t * Print each event as one JSON object per line on stdout, instead of the\n\t * progress lines. Nothing prompts: a missing credential fails the run.\n\t */\n\tjson?: boolean;\n\t/** Plan only: create, change, build and push nothing. */\n\tdryRun?: boolean;\n\t/** On a failed release, roll back every app, not only the failed ones. */\n\tatomic?: boolean;\n\t/** `--allow-dev-services minio,mailpit`, as typed. */\n\tallowDevServices?: string;\n}\n\n/** Where the command writes. The process's own streams, outside tests. */\nexport interface DeployCliStreams {\n\tstdout: Pick<NodeJS.WriteStream, 'write'>;\n}\n\n/**\n * Run `gkm deploy` and resolve with its exit code: 0 when the run finished,\n * 1 when anything stopped it.\n */\nexport async function deployCli(\n\toptions: DeployCliOptions,\n\tstreams: DeployCliStreams = { stdout: process.stdout },\n): Promise<number> {\n\tlet target = options.target;\n\tif (options.provider !== undefined && target === undefined) {\n\t\ttry {\n\t\t\t// On stderr, so a `--json` run's stdout still carries only events.\n\t\t\ttarget = targetForProvider(options.provider, (message) =>\n\t\t\t\tconsole.warn(message),\n\t\t\t);\n\t\t} catch (error) {\n\t\t\tconsole.error(formatError(error));\n\t\t\treturn 1;\n\t\t}\n\t}\n\n\tlet allowDevServices: DevService[];\n\ttry {\n\t\tallowDevServices = parseDevServices(options.allowDevServices);\n\t} catch (error) {\n\t\tconsole.error(formatError(error));\n\t\treturn 1;\n\t}\n\n\tconst input = {\n\t\tcwd: options.cwd,\n\t\tstage: options.stage,\n\t\t...(target ? { target } : {}),\n\t\t...(options.tag ? { tag: options.tag } : {}),\n\t\t...(options.dryRun ? { dryRun: true } : {}),\n\t\t...(options.atomic ? { atomic: true } : {}),\n\t\t...(allowDevServices.length > 0 ? { allowDevServices } : {}),\n\t};\n\n\tif (options.json) {\n\t\t// stdout carries the events and nothing else: docker's own output goes\n\t\t// to stderr, and nobody is asked anything — a prompt would be written\n\t\t// into the stream a program is parsing.\n\t\tconst run = deploy({\n\t\t\t...input,\n\t\t\tcredentials: storedCredentials(),\n\t\t\tchildOutput: 'stderr',\n\t\t});\n\t\tfor await (const event of run) {\n\t\t\tstreams.stdout.write(`${JSON.stringify(event)}\\n`);\n\t\t}\n\t\treturn run.result.then(\n\t\t\t() => 0,\n\t\t\t(error) => {\n\t\t\t\tconsole.error(formatError(error));\n\t\t\t\treturn 1;\n\t\t\t},\n\t\t);\n\t}\n\n\t// The lines arrive as they are written, rather than as events read back a\n\t// tick later, so they interleave with a prompt exactly as they always did.\n\tconst run = deploy({\n\t\t...input,\n\t\tcredentials: terminalCredentials(storedCredentials()),\n\t\tlogger: {\n\t\t\tinfo: (message) => console.log(message),\n\t\t\twarn: (message) => console.warn(message),\n\t\t\terror: (message) => console.error(message),\n\t\t},\n\t});\n\n\ttry {\n\t\tawait run.result;\n\t\treturn 0;\n\t} catch (error) {\n\t\tconsole.error(formatError(error));\n\t\treturn 1;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA+CA,eAAsB,UACrB,SACA,UAA4B,EAAE,QAAQ,QAAQ,OAAO,GACnC;CAClB,IAAI,SAAS,QAAQ;CACrB,IAAI,QAAQ,aAAa,KAAA,KAAa,WAAW,KAAA,GAChD,IAAI;EAEH,SAAS,kBAAkB,QAAQ,WAAW,YAC7C,QAAQ,KAAK,OAAO,CACrB;CACD,SAAS,OAAO;EACf,QAAQ,MAAM,YAAY,KAAK,CAAC;EAChC,OAAO;CACR;CAGD,IAAI;CACJ,IAAI;EACH,mBAAmB,iBAAiB,QAAQ,gBAAgB;CAC7D,SAAS,OAAO;EACf,QAAQ,MAAM,YAAY,KAAK,CAAC;EAChC,OAAO;CACR;CAEA,MAAM,QAAQ;EACb,KAAK,QAAQ;EACb,OAAO,QAAQ;EACf,GAAI,SAAS,EAAE,OAAO,IAAI,CAAC;EAC3B,GAAI,QAAQ,MAAM,EAAE,KAAK,QAAQ,IAAI,IAAI,CAAC;EAC1C,GAAI,QAAQ,SAAS,EAAE,QAAQ,KAAK,IAAI,CAAC;EACzC,GAAI,QAAQ,SAAS,EAAE,QAAQ,KAAK,IAAI,CAAC;EACzC,GAAI,iBAAiB,SAAS,IAAI,EAAE,iBAAiB,IAAI,CAAC;CAC3D;CAEA,IAAI,QAAQ,MAAM;EAIjB,MAAM,MAAM,OAAO;GAClB,GAAG;GACH,aAAa,kBAAkB;GAC/B,aAAa;EACd,CAAC;EACD,WAAW,MAAM,SAAS,KACzB,QAAQ,OAAO,MAAM,GAAG,KAAK,UAAU,KAAK,EAAE,GAAG;EAElD,OAAO,IAAI,OAAO,WACX,IACL,UAAU;GACV,QAAQ,MAAM,YAAY,KAAK,CAAC;GAChC,OAAO;EACR,CACD;CACD;CAIA,MAAM,MAAM,OAAO;EAClB,GAAG;EACH,aAAa,oBAAoB,kBAAkB,CAAC;EACpD,QAAQ;GACP,OAAO,YAAY,QAAQ,IAAI,OAAO;GACtC,OAAO,YAAY,QAAQ,KAAK,OAAO;GACvC,QAAQ,YAAY,QAAQ,MAAM,OAAO;EAC1C;CACD,CAAC;CAED,IAAI;EACH,MAAM,IAAI;EACV,OAAO;CACR,SAAS,OAAO;EACf,QAAQ,MAAM,YAAY,KAAK,CAAC;EAChC,OAAO;CACR;AACD"}
1
+ {"version":3,"file":"cli-BV3jzbk0.mjs","names":[],"sources":["../src/deploy/cli.ts"],"sourcesContent":["/**\n * `gkm deploy`: the terminal around `deploy()`. CLI layer only.\n *\n * Everything that belongs to a person at a terminal lives here and nowhere\n * below it: prompting for a missing login (and storing it), printing progress,\n * and turning the outcome into an exit code. The deploy itself is the same\n * `deploy()` a host calls.\n */\n\nimport { formatError } from '../debug';\nimport { targetForProvider } from '../target/provider';\nimport { storedCredentials } from './credentials';\nimport { deploy } from './deploy';\nimport { type DevService, parseDevServices } from './devServices';\nimport { terminalCredentials } from './terminal';\n\nexport interface DeployCliOptions {\n\t/** The project directory: `--cwd`, else where the command was run. */\n\tcwd: string;\n\t/** `--target`: where to deploy. Defaults to `deploy.default`. */\n\ttarget?: string;\n\t/** `--provider`, deprecated: `dokploy` means `--target dokploy`. */\n\tprovider?: string;\n\tstage: string;\n\ttag?: string;\n\t/**\n\t * Print each event as one JSON object per line on stdout, instead of the\n\t * progress lines. Nothing prompts: a missing credential fails the run.\n\t */\n\tjson?: boolean;\n\t/** Plan only: create, change, build and push nothing. */\n\tdryRun?: boolean;\n\t/** On a failed release, roll back every app, not only the failed ones. */\n\tatomic?: boolean;\n\t/** `--allow-dev-services minio,mailpit`, as typed. */\n\tallowDevServices?: string;\n}\n\n/** Where the command writes. The process's own streams, outside tests. */\nexport interface DeployCliStreams {\n\tstdout: Pick<NodeJS.WriteStream, 'write'>;\n}\n\n/**\n * Run `gkm deploy` and resolve with its exit code: 0 when the run finished,\n * 1 when anything stopped it.\n */\nexport async function deployCli(\n\toptions: DeployCliOptions,\n\tstreams: DeployCliStreams = { stdout: process.stdout },\n): Promise<number> {\n\tlet target = options.target;\n\tif (options.provider !== undefined && target === undefined) {\n\t\ttry {\n\t\t\t// On stderr, so a `--json` run's stdout still carries only events.\n\t\t\ttarget = targetForProvider(options.provider, (message) =>\n\t\t\t\tconsole.warn(message),\n\t\t\t);\n\t\t} catch (error) {\n\t\t\tconsole.error(formatError(error));\n\t\t\treturn 1;\n\t\t}\n\t}\n\n\tlet allowDevServices: DevService[];\n\ttry {\n\t\tallowDevServices = parseDevServices(options.allowDevServices);\n\t} catch (error) {\n\t\tconsole.error(formatError(error));\n\t\treturn 1;\n\t}\n\n\tconst input = {\n\t\tcwd: options.cwd,\n\t\tstage: options.stage,\n\t\t...(target ? { target } : {}),\n\t\t...(options.tag ? { tag: options.tag } : {}),\n\t\t...(options.dryRun ? { dryRun: true } : {}),\n\t\t...(options.atomic ? { atomic: true } : {}),\n\t\t...(allowDevServices.length > 0 ? { allowDevServices } : {}),\n\t};\n\n\tif (options.json) {\n\t\t// stdout carries the events and nothing else: docker's own output goes\n\t\t// to stderr, and nobody is asked anything — a prompt would be written\n\t\t// into the stream a program is parsing.\n\t\tconst run = deploy({\n\t\t\t...input,\n\t\t\tcredentials: storedCredentials(),\n\t\t\tchildOutput: 'stderr',\n\t\t});\n\t\tfor await (const event of run) {\n\t\t\tstreams.stdout.write(`${JSON.stringify(event)}\\n`);\n\t\t}\n\t\treturn run.result.then(\n\t\t\t() => 0,\n\t\t\t(error) => {\n\t\t\t\tconsole.error(formatError(error));\n\t\t\t\treturn 1;\n\t\t\t},\n\t\t);\n\t}\n\n\t// The lines arrive as they are written, rather than as events read back a\n\t// tick later, so they interleave with a prompt exactly as they always did.\n\tconst run = deploy({\n\t\t...input,\n\t\tcredentials: terminalCredentials(storedCredentials()),\n\t\tlogger: {\n\t\t\tinfo: (message) => console.log(message),\n\t\t\twarn: (message) => console.warn(message),\n\t\t\terror: (message) => console.error(message),\n\t\t},\n\t});\n\n\ttry {\n\t\tawait run.result;\n\t\treturn 0;\n\t} catch (error) {\n\t\tconsole.error(formatError(error));\n\t\treturn 1;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA+CA,eAAsB,UACrB,SACA,UAA4B,EAAE,QAAQ,QAAQ,OAAO,GACnC;CAClB,IAAI,SAAS,QAAQ;CACrB,IAAI,QAAQ,aAAa,KAAA,KAAa,WAAW,KAAA,GAChD,IAAI;EAEH,SAAS,kBAAkB,QAAQ,WAAW,YAC7C,QAAQ,KAAK,OAAO,CACrB;CACD,SAAS,OAAO;EACf,QAAQ,MAAM,YAAY,KAAK,CAAC;EAChC,OAAO;CACR;CAGD,IAAI;CACJ,IAAI;EACH,mBAAmB,iBAAiB,QAAQ,gBAAgB;CAC7D,SAAS,OAAO;EACf,QAAQ,MAAM,YAAY,KAAK,CAAC;EAChC,OAAO;CACR;CAEA,MAAM,QAAQ;EACb,KAAK,QAAQ;EACb,OAAO,QAAQ;EACf,GAAI,SAAS,EAAE,OAAO,IAAI,CAAC;EAC3B,GAAI,QAAQ,MAAM,EAAE,KAAK,QAAQ,IAAI,IAAI,CAAC;EAC1C,GAAI,QAAQ,SAAS,EAAE,QAAQ,KAAK,IAAI,CAAC;EACzC,GAAI,QAAQ,SAAS,EAAE,QAAQ,KAAK,IAAI,CAAC;EACzC,GAAI,iBAAiB,SAAS,IAAI,EAAE,iBAAiB,IAAI,CAAC;CAC3D;CAEA,IAAI,QAAQ,MAAM;EAIjB,MAAM,MAAM,OAAO;GAClB,GAAG;GACH,aAAa,kBAAkB;GAC/B,aAAa;EACd,CAAC;EACD,WAAW,MAAM,SAAS,KACzB,QAAQ,OAAO,MAAM,GAAG,KAAK,UAAU,KAAK,EAAE,GAAG;EAElD,OAAO,IAAI,OAAO,WACX,IACL,UAAU;GACV,QAAQ,MAAM,YAAY,KAAK,CAAC;GAChC,OAAO;EACR,CACD;CACD;CAIA,MAAM,MAAM,OAAO;EAClB,GAAG;EACH,aAAa,oBAAoB,kBAAkB,CAAC;EACpD,QAAQ;GACP,OAAO,YAAY,QAAQ,IAAI,OAAO;GACtC,OAAO,YAAY,QAAQ,KAAK,OAAO;GACvC,QAAQ,YAAY,QAAQ,MAAM,OAAO;EAC1C;CACD,CAAC;CAED,IAAI;EACH,MAAM,IAAI;EACV,OAAO;CACR,SAAS,OAAO;EACf,QAAQ,MAAM,YAAY,KAAK,CAAC;EAChC,OAAO;CACR;AACD"}
@@ -1,6 +1,6 @@
1
1
  const require_credentials = require("./credentials-BVs7mrtw.cjs");
2
- const require_seeds = require("./seeds-DQ0FG57Z.cjs");
3
- const require_deploy = require("./deploy-C8sWg81_.cjs");
2
+ const require_seeds = require("./seeds-B_Beuv0o.cjs");
3
+ const require_deploy = require("./deploy-Bw2Mm3x3.cjs");
4
4
  const require_index = require("./index.cjs");
5
5
  const require_provider = require("./provider-C9_-45d5.cjs");
6
6
  const require_terminal = require("./terminal-BL5E0xbR.cjs");
@@ -73,4 +73,4 @@ async function deployCli(options, streams = { stdout: process.stdout }) {
73
73
  //#endregion
74
74
  exports.deployCli = deployCli;
75
75
 
76
- //# sourceMappingURL=cli-D8YQAYUX.cjs.map
76
+ //# sourceMappingURL=cli-DQCBcNlN.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"cli-D8YQAYUX.cjs","names":["targetForProvider","formatError","parseDevServices","deploy","storedCredentials","terminalCredentials"],"sources":["../src/deploy/cli.ts"],"sourcesContent":["/**\n * `gkm deploy`: the terminal around `deploy()`. CLI layer only.\n *\n * Everything that belongs to a person at a terminal lives here and nowhere\n * below it: prompting for a missing login (and storing it), printing progress,\n * and turning the outcome into an exit code. The deploy itself is the same\n * `deploy()` a host calls.\n */\n\nimport { formatError } from '../debug';\nimport { targetForProvider } from '../target/provider';\nimport { storedCredentials } from './credentials';\nimport { deploy } from './deploy';\nimport { type DevService, parseDevServices } from './devServices';\nimport { terminalCredentials } from './terminal';\n\nexport interface DeployCliOptions {\n\t/** The project directory: `--cwd`, else where the command was run. */\n\tcwd: string;\n\t/** `--target`: where to deploy. Defaults to `deploy.default`. */\n\ttarget?: string;\n\t/** `--provider`, deprecated: `dokploy` means `--target dokploy`. */\n\tprovider?: string;\n\tstage: string;\n\ttag?: string;\n\t/**\n\t * Print each event as one JSON object per line on stdout, instead of the\n\t * progress lines. Nothing prompts: a missing credential fails the run.\n\t */\n\tjson?: boolean;\n\t/** Plan only: create, change, build and push nothing. */\n\tdryRun?: boolean;\n\t/** On a failed release, roll back every app, not only the failed ones. */\n\tatomic?: boolean;\n\t/** `--allow-dev-services minio,mailpit`, as typed. */\n\tallowDevServices?: string;\n}\n\n/** Where the command writes. The process's own streams, outside tests. */\nexport interface DeployCliStreams {\n\tstdout: Pick<NodeJS.WriteStream, 'write'>;\n}\n\n/**\n * Run `gkm deploy` and resolve with its exit code: 0 when the run finished,\n * 1 when anything stopped it.\n */\nexport async function deployCli(\n\toptions: DeployCliOptions,\n\tstreams: DeployCliStreams = { stdout: process.stdout },\n): Promise<number> {\n\tlet target = options.target;\n\tif (options.provider !== undefined && target === undefined) {\n\t\ttry {\n\t\t\t// On stderr, so a `--json` run's stdout still carries only events.\n\t\t\ttarget = targetForProvider(options.provider, (message) =>\n\t\t\t\tconsole.warn(message),\n\t\t\t);\n\t\t} catch (error) {\n\t\t\tconsole.error(formatError(error));\n\t\t\treturn 1;\n\t\t}\n\t}\n\n\tlet allowDevServices: DevService[];\n\ttry {\n\t\tallowDevServices = parseDevServices(options.allowDevServices);\n\t} catch (error) {\n\t\tconsole.error(formatError(error));\n\t\treturn 1;\n\t}\n\n\tconst input = {\n\t\tcwd: options.cwd,\n\t\tstage: options.stage,\n\t\t...(target ? { target } : {}),\n\t\t...(options.tag ? { tag: options.tag } : {}),\n\t\t...(options.dryRun ? { dryRun: true } : {}),\n\t\t...(options.atomic ? { atomic: true } : {}),\n\t\t...(allowDevServices.length > 0 ? { allowDevServices } : {}),\n\t};\n\n\tif (options.json) {\n\t\t// stdout carries the events and nothing else: docker's own output goes\n\t\t// to stderr, and nobody is asked anything — a prompt would be written\n\t\t// into the stream a program is parsing.\n\t\tconst run = deploy({\n\t\t\t...input,\n\t\t\tcredentials: storedCredentials(),\n\t\t\tchildOutput: 'stderr',\n\t\t});\n\t\tfor await (const event of run) {\n\t\t\tstreams.stdout.write(`${JSON.stringify(event)}\\n`);\n\t\t}\n\t\treturn run.result.then(\n\t\t\t() => 0,\n\t\t\t(error) => {\n\t\t\t\tconsole.error(formatError(error));\n\t\t\t\treturn 1;\n\t\t\t},\n\t\t);\n\t}\n\n\t// The lines arrive as they are written, rather than as events read back a\n\t// tick later, so they interleave with a prompt exactly as they always did.\n\tconst run = deploy({\n\t\t...input,\n\t\tcredentials: terminalCredentials(storedCredentials()),\n\t\tlogger: {\n\t\t\tinfo: (message) => console.log(message),\n\t\t\twarn: (message) => console.warn(message),\n\t\t\terror: (message) => console.error(message),\n\t\t},\n\t});\n\n\ttry {\n\t\tawait run.result;\n\t\treturn 0;\n\t} catch (error) {\n\t\tconsole.error(formatError(error));\n\t\treturn 1;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA+CA,eAAsB,UACrB,SACA,UAA4B,EAAE,QAAQ,QAAQ,OAAO,GACnC;CAClB,IAAI,SAAS,QAAQ;CACrB,IAAI,QAAQ,aAAa,KAAA,KAAa,WAAW,KAAA,GAChD,IAAI;EAEH,SAASA,iBAAAA,kBAAkB,QAAQ,WAAW,YAC7C,QAAQ,KAAK,OAAO,CACrB;CACD,SAAS,OAAO;EACf,QAAQ,MAAMC,cAAAA,YAAY,KAAK,CAAC;EAChC,OAAO;CACR;CAGD,IAAI;CACJ,IAAI;EACH,mBAAmBC,cAAAA,iBAAiB,QAAQ,gBAAgB;CAC7D,SAAS,OAAO;EACf,QAAQ,MAAMD,cAAAA,YAAY,KAAK,CAAC;EAChC,OAAO;CACR;CAEA,MAAM,QAAQ;EACb,KAAK,QAAQ;EACb,OAAO,QAAQ;EACf,GAAI,SAAS,EAAE,OAAO,IAAI,CAAC;EAC3B,GAAI,QAAQ,MAAM,EAAE,KAAK,QAAQ,IAAI,IAAI,CAAC;EAC1C,GAAI,QAAQ,SAAS,EAAE,QAAQ,KAAK,IAAI,CAAC;EACzC,GAAI,QAAQ,SAAS,EAAE,QAAQ,KAAK,IAAI,CAAC;EACzC,GAAI,iBAAiB,SAAS,IAAI,EAAE,iBAAiB,IAAI,CAAC;CAC3D;CAEA,IAAI,QAAQ,MAAM;EAIjB,MAAM,MAAME,eAAAA,OAAO;GAClB,GAAG;GACH,aAAaC,oBAAAA,kBAAkB;GAC/B,aAAa;EACd,CAAC;EACD,WAAW,MAAM,SAAS,KACzB,QAAQ,OAAO,MAAM,GAAG,KAAK,UAAU,KAAK,EAAE,GAAG;EAElD,OAAO,IAAI,OAAO,WACX,IACL,UAAU;GACV,QAAQ,MAAMH,cAAAA,YAAY,KAAK,CAAC;GAChC,OAAO;EACR,CACD;CACD;CAIA,MAAM,MAAME,eAAAA,OAAO;EAClB,GAAG;EACH,aAAaE,iBAAAA,oBAAoBD,oBAAAA,kBAAkB,CAAC;EACpD,QAAQ;GACP,OAAO,YAAY,QAAQ,IAAI,OAAO;GACtC,OAAO,YAAY,QAAQ,KAAK,OAAO;GACvC,QAAQ,YAAY,QAAQ,MAAM,OAAO;EAC1C;CACD,CAAC;CAED,IAAI;EACH,MAAM,IAAI;EACV,OAAO;CACR,SAAS,OAAO;EACf,QAAQ,MAAMH,cAAAA,YAAY,KAAK,CAAC;EAChC,OAAO;CACR;AACD"}
1
+ {"version":3,"file":"cli-DQCBcNlN.cjs","names":["targetForProvider","formatError","parseDevServices","deploy","storedCredentials","terminalCredentials"],"sources":["../src/deploy/cli.ts"],"sourcesContent":["/**\n * `gkm deploy`: the terminal around `deploy()`. CLI layer only.\n *\n * Everything that belongs to a person at a terminal lives here and nowhere\n * below it: prompting for a missing login (and storing it), printing progress,\n * and turning the outcome into an exit code. The deploy itself is the same\n * `deploy()` a host calls.\n */\n\nimport { formatError } from '../debug';\nimport { targetForProvider } from '../target/provider';\nimport { storedCredentials } from './credentials';\nimport { deploy } from './deploy';\nimport { type DevService, parseDevServices } from './devServices';\nimport { terminalCredentials } from './terminal';\n\nexport interface DeployCliOptions {\n\t/** The project directory: `--cwd`, else where the command was run. */\n\tcwd: string;\n\t/** `--target`: where to deploy. Defaults to `deploy.default`. */\n\ttarget?: string;\n\t/** `--provider`, deprecated: `dokploy` means `--target dokploy`. */\n\tprovider?: string;\n\tstage: string;\n\ttag?: string;\n\t/**\n\t * Print each event as one JSON object per line on stdout, instead of the\n\t * progress lines. Nothing prompts: a missing credential fails the run.\n\t */\n\tjson?: boolean;\n\t/** Plan only: create, change, build and push nothing. */\n\tdryRun?: boolean;\n\t/** On a failed release, roll back every app, not only the failed ones. */\n\tatomic?: boolean;\n\t/** `--allow-dev-services minio,mailpit`, as typed. */\n\tallowDevServices?: string;\n}\n\n/** Where the command writes. The process's own streams, outside tests. */\nexport interface DeployCliStreams {\n\tstdout: Pick<NodeJS.WriteStream, 'write'>;\n}\n\n/**\n * Run `gkm deploy` and resolve with its exit code: 0 when the run finished,\n * 1 when anything stopped it.\n */\nexport async function deployCli(\n\toptions: DeployCliOptions,\n\tstreams: DeployCliStreams = { stdout: process.stdout },\n): Promise<number> {\n\tlet target = options.target;\n\tif (options.provider !== undefined && target === undefined) {\n\t\ttry {\n\t\t\t// On stderr, so a `--json` run's stdout still carries only events.\n\t\t\ttarget = targetForProvider(options.provider, (message) =>\n\t\t\t\tconsole.warn(message),\n\t\t\t);\n\t\t} catch (error) {\n\t\t\tconsole.error(formatError(error));\n\t\t\treturn 1;\n\t\t}\n\t}\n\n\tlet allowDevServices: DevService[];\n\ttry {\n\t\tallowDevServices = parseDevServices(options.allowDevServices);\n\t} catch (error) {\n\t\tconsole.error(formatError(error));\n\t\treturn 1;\n\t}\n\n\tconst input = {\n\t\tcwd: options.cwd,\n\t\tstage: options.stage,\n\t\t...(target ? { target } : {}),\n\t\t...(options.tag ? { tag: options.tag } : {}),\n\t\t...(options.dryRun ? { dryRun: true } : {}),\n\t\t...(options.atomic ? { atomic: true } : {}),\n\t\t...(allowDevServices.length > 0 ? { allowDevServices } : {}),\n\t};\n\n\tif (options.json) {\n\t\t// stdout carries the events and nothing else: docker's own output goes\n\t\t// to stderr, and nobody is asked anything — a prompt would be written\n\t\t// into the stream a program is parsing.\n\t\tconst run = deploy({\n\t\t\t...input,\n\t\t\tcredentials: storedCredentials(),\n\t\t\tchildOutput: 'stderr',\n\t\t});\n\t\tfor await (const event of run) {\n\t\t\tstreams.stdout.write(`${JSON.stringify(event)}\\n`);\n\t\t}\n\t\treturn run.result.then(\n\t\t\t() => 0,\n\t\t\t(error) => {\n\t\t\t\tconsole.error(formatError(error));\n\t\t\t\treturn 1;\n\t\t\t},\n\t\t);\n\t}\n\n\t// The lines arrive as they are written, rather than as events read back a\n\t// tick later, so they interleave with a prompt exactly as they always did.\n\tconst run = deploy({\n\t\t...input,\n\t\tcredentials: terminalCredentials(storedCredentials()),\n\t\tlogger: {\n\t\t\tinfo: (message) => console.log(message),\n\t\t\twarn: (message) => console.warn(message),\n\t\t\terror: (message) => console.error(message),\n\t\t},\n\t});\n\n\ttry {\n\t\tawait run.result;\n\t\treturn 0;\n\t} catch (error) {\n\t\tconsole.error(formatError(error));\n\t\treturn 1;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA+CA,eAAsB,UACrB,SACA,UAA4B,EAAE,QAAQ,QAAQ,OAAO,GACnC;CAClB,IAAI,SAAS,QAAQ;CACrB,IAAI,QAAQ,aAAa,KAAA,KAAa,WAAW,KAAA,GAChD,IAAI;EAEH,SAASA,iBAAAA,kBAAkB,QAAQ,WAAW,YAC7C,QAAQ,KAAK,OAAO,CACrB;CACD,SAAS,OAAO;EACf,QAAQ,MAAMC,cAAAA,YAAY,KAAK,CAAC;EAChC,OAAO;CACR;CAGD,IAAI;CACJ,IAAI;EACH,mBAAmBC,cAAAA,iBAAiB,QAAQ,gBAAgB;CAC7D,SAAS,OAAO;EACf,QAAQ,MAAMD,cAAAA,YAAY,KAAK,CAAC;EAChC,OAAO;CACR;CAEA,MAAM,QAAQ;EACb,KAAK,QAAQ;EACb,OAAO,QAAQ;EACf,GAAI,SAAS,EAAE,OAAO,IAAI,CAAC;EAC3B,GAAI,QAAQ,MAAM,EAAE,KAAK,QAAQ,IAAI,IAAI,CAAC;EAC1C,GAAI,QAAQ,SAAS,EAAE,QAAQ,KAAK,IAAI,CAAC;EACzC,GAAI,QAAQ,SAAS,EAAE,QAAQ,KAAK,IAAI,CAAC;EACzC,GAAI,iBAAiB,SAAS,IAAI,EAAE,iBAAiB,IAAI,CAAC;CAC3D;CAEA,IAAI,QAAQ,MAAM;EAIjB,MAAM,MAAME,eAAAA,OAAO;GAClB,GAAG;GACH,aAAaC,oBAAAA,kBAAkB;GAC/B,aAAa;EACd,CAAC;EACD,WAAW,MAAM,SAAS,KACzB,QAAQ,OAAO,MAAM,GAAG,KAAK,UAAU,KAAK,EAAE,GAAG;EAElD,OAAO,IAAI,OAAO,WACX,IACL,UAAU;GACV,QAAQ,MAAMH,cAAAA,YAAY,KAAK,CAAC;GAChC,OAAO;EACR,CACD;CACD;CAIA,MAAM,MAAME,eAAAA,OAAO;EAClB,GAAG;EACH,aAAaE,iBAAAA,oBAAoBD,oBAAAA,kBAAkB,CAAC;EACpD,QAAQ;GACP,OAAO,YAAY,QAAQ,IAAI,OAAO;GACtC,OAAO,YAAY,QAAQ,KAAK,OAAO;GACvC,QAAQ,YAAY,QAAQ,MAAM,OAAO;EAC1C;CACD,CAAC;CAED,IAAI;EACH,MAAM,IAAI;EACV,OAAO;CACR,SAAS,OAAO;EACf,QAAQ,MAAMH,cAAAA,YAAY,KAAK,CAAC;EAChC,OAAO;CACR;AACD"}
@@ -4,7 +4,7 @@ import { r as discover } from "./discover-BPelzeGW.mjs";
4
4
  import { t as appKey } from "./derive-B4vDpzgP.mjs";
5
5
  import { B as certificateFor, F as resolveStageTelemetry, L as telemetryEnv, P as otlpTelemetryEnv, R as LOGS_PORT, V as proxyFor, z as ComposeTlsFileMissing } from "./workspace-Drz4jsvy.mjs";
6
6
  import { t as defineTarget } from "./define-DR8xGYfL.mjs";
7
- import { $ as postgresSuperuser, At as WORKER_PORT, Bn as NoDomainForStage, Bt as composeFor, C as workerDockerfile, Ct as networkEnv, Dt as composeBuildPaths, Et as localRolePassword, Fn as LOGS_SERVICE, Gt as hostFor, Hn as resolveHost, I as reportDevServices, In as logsAccess, Jt as scopeTelemetryEnv, Ln as logsService, M as devServicesUsed, Mt as findBuildRoot, Ot as imageLayout, Q as loadLocalCredentials, Qt as DEFAULT_IMAGES, R as suppliedOnly, Rn as stackLogs, S as ensureDockerignore, T as validateImageRef, Tt as envFor, Ut as planFor, Vn as isMainFrontendApp, Vt as EMULATOR_ACCESS_KEY_ID, Xt as telemetryOf, Z as LOCAL_RABBITMQ_USER, Zt as usesTelemetry, _ as DeployJournal, _t as LEGACY_LOCAL_LOGIN, a as createEmptyState, at as runsRedis, b as appDockerfile, bt as pgClient, dt as applyPolicies, ft as applyPostgres, ht as postgresStatements, i as assertNoStaleSecrets, it as redisService, j as assertExternalServices, kn as initStageSecrets, kt as TURBO_VERSION, l as recordRelease, n as reportDatabaseRuns, nt as REDIS_SERVICE, ot as stackRedis, pt as bucketPolicies, q as constructGlobs, qt as isTelemetryKey, r as reportPlannedSeeds, rn as primaryPortKey, rt as STACK_CACHE, st as withRedisPassword, t as DeploySeedsFailed, tn as portKeys, tt as withGeneratedSecrets, ut as applyBuckets, vt as ensurePostgresLogin, wn as imageRef, wt as workerEnvKeys, xt as appEnvKeys, yt as bucketClient, z as workerUnits, zn as withLogsPassword } from "./seeds-BK8caVMm.mjs";
7
+ import { $ as postgresSuperuser, At as WORKER_PORT, Bn as NoDomainForStage, Bt as composeFor, C as workerDockerfile, Ct as networkEnv, Dt as composeBuildPaths, Et as localRolePassword, Fn as LOGS_SERVICE, Gt as hostFor, Hn as resolveHost, I as reportDevServices, In as logsAccess, Jt as scopeTelemetryEnv, Ln as logsService, M as devServicesUsed, Mt as findBuildRoot, Ot as imageLayout, Q as loadLocalCredentials, Qt as DEFAULT_IMAGES, R as suppliedOnly, Rn as stackLogs, S as ensureDockerignore, T as validateImageRef, Tt as envFor, Ut as planFor, Vn as isMainFrontendApp, Vt as EMULATOR_ACCESS_KEY_ID, Xt as telemetryOf, Z as LOCAL_RABBITMQ_USER, Zt as usesTelemetry, _ as DeployJournal, _t as LEGACY_LOCAL_LOGIN, a as createEmptyState, at as runsRedis, b as appDockerfile, bt as pgClient, dt as applyPolicies, ft as applyPostgres, ht as postgresStatements, i as assertNoStaleSecrets, it as redisService, j as assertExternalServices, kn as initStageSecrets, kt as TURBO_VERSION, l as recordRelease, n as reportDatabaseRuns, nt as REDIS_SERVICE, ot as stackRedis, pt as bucketPolicies, q as constructGlobs, qt as isTelemetryKey, r as reportPlannedSeeds, rn as primaryPortKey, rt as STACK_CACHE, st as withRedisPassword, t as DeploySeedsFailed, tn as portKeys, tt as withGeneratedSecrets, ut as applyBuckets, vt as ensurePostgresLogin, wn as imageRef, wt as workerEnvKeys, xt as appEnvKeys, yt as bucketClient, z as workerUnits, zn as withLogsPassword } from "./seeds-9C5CkDon.mjs";
8
8
  import { i as DEFAULT_EVENTS } from "./SubscriberGenerator-BPqQf8fB.mjs";
9
9
  import { i as installedFrom } from "./drivers-DTZzxeIl.mjs";
10
10
  import { f as plannedSeeds, o as SeedFailed, p as seedDatabases, u as migrateDatabases } from "./databases-CzszQV0N.mjs";
@@ -13,7 +13,7 @@ import { dirname, join } from "node:path";
13
13
  import { existsSync } from "node:fs";
14
14
  import { chmod, copyFile, mkdir, readFile, readdir, rename, rm, writeFile } from "node:fs/promises";
15
15
  import { hostname, userInfo } from "node:os";
16
- import { provideKey, provisionOrder, publicEnvFor } from "@geekmidas/manifest";
16
+ import { CLIENT_IP_HEADER, provideKey, provisionOrder, publicEnvFor } from "@geekmidas/manifest";
17
17
  import { spawn } from "node:child_process";
18
18
  import { createHash } from "node:crypto";
19
19
  import { stringify } from "yaml";
@@ -434,8 +434,10 @@ function traefikDynamic(routes, options) {
434
434
  const routers = {};
435
435
  const services = {};
436
436
  const middlewares = {};
437
+ const strip = `${project}-strip-gkm-headers`;
438
+ if (routes.length > 0) middlewares[strip] = { headers: { customRequestHeaders: { [CLIENT_IP_HEADER]: "" } } };
437
439
  for (const route of routes) {
438
- const chain = [];
440
+ const chain = [strip];
439
441
  if (route.allow) {
440
442
  middlewares[name(route, "allow")] = { ipAllowList: { sourceRange: [...route.allow] } };
441
443
  chain.push(name(route, "allow"));
@@ -448,7 +450,7 @@ function traefikDynamic(routes, options) {
448
450
  rule: `Host(\`${route.host}\`)`,
449
451
  entryPoints: ["websecure"],
450
452
  service: name(route),
451
- ...chain.length > 0 ? { middlewares: chain } : {},
453
+ middlewares: chain,
452
454
  tls: tls.kind === "acme" ? { certResolver: ACME_RESOLVER } : {}
453
455
  };
454
456
  services[name(route)] = { loadBalancer: {
@@ -793,6 +795,18 @@ function pinImages(file, digests, images) {
793
795
  }
794
796
  //#endregion
795
797
  //#region src/compose/caddyfile.ts
798
+ /**
799
+ * The stack's own edge, rendered for Caddy: one site block per route.
800
+ *
801
+ * Deployed, each host is the stage's real domain and Caddy gets it a
802
+ * certificate from Let's Encrypt on first request — the same automatic HTTPS
803
+ * it does anywhere, with nothing to configure but the name — or serves the
804
+ * stage's own certificate (`deploy.compose.tls`). Locally the hosts are
805
+ * `*.localhost` and the certificates come from Caddy's own CA, as the `gkm
806
+ * dev` edge does, so a local stack is `https://` like a deployed one.
807
+ *
808
+ * Pure: the routes are data (`routes.ts`), and rendering them is one string.
809
+ */
796
810
  /** Where Caddy reads a stage's own certificate, inside its container. */
797
811
  const CADDY_TLS_DIR = "/etc/caddy/tls";
798
812
  /** An upstream on the stack's own network: its service name. */
@@ -815,7 +829,11 @@ function edgeCaddyfile(routes, options) {
815
829
  ` : tls.kind === "files" ? `
816
830
  tls ${tls.certFile} ${tls.keyFile}
817
831
  ` : "";
818
- const blocks = routes.map(({ host, upstreams, prefix, allow, streaming }) => `https://${host} {${certificate}${allow ? `
832
+ const blocks = routes.map(({ host, upstreams, prefix, allow, streaming }) => `https://${host} {${certificate}
833
+ # gkm's own header, which only a service of this stack may send: the auth
834
+ # server rate-limits by the client address it carries.
835
+ request_header -${CLIENT_IP_HEADER}
836
+ ${allow ? `
819
837
  # Only these addresses — the peer Caddy sees, never a header a client
820
838
  # could set. Everything else is refused before it reaches the upstream.
821
839
  @denied not remote_ip ${allow.join(" ")}
@@ -2628,4 +2646,4 @@ function composeTarget(options = {}) {
2628
2646
  //#endregion
2629
2647
  export { stackOverrideFile as a, parseDigests as c, removeEdgeRoutes as d, EDGE_PROJECT as f, ComposePushNeedsBuild as i, pinnedRef as l, compose_exports as n, composeProject as o, dockerCompose as p, ComposePinNeedsPull as r, stackDir as s, composeTarget as t, edgeDir as u };
2630
2648
 
2631
- //# sourceMappingURL=compose-C5wz8mf9.mjs.map
2649
+ //# sourceMappingURL=compose-CQK6StuE.mjs.map