@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.
- package/dist/{LegacyStateStore-C39UKwmf.mjs → LegacyStateStore-BE1Et8RS.mjs} +2 -2
- package/dist/{LegacyStateStore-C39UKwmf.mjs.map → LegacyStateStore-BE1Et8RS.mjs.map} +1 -1
- package/dist/{LegacyStateStore-BZiO9-Lw.cjs → LegacyStateStore-LS_uTO8D.cjs} +2 -2
- package/dist/{LegacyStateStore-BZiO9-Lw.cjs.map → LegacyStateStore-LS_uTO8D.cjs.map} +1 -1
- package/dist/{LocalStateStore-DHVsZLyF.cjs → LocalStateStore-CV6phNMZ.cjs} +2 -2
- package/dist/{LocalStateStore-DHVsZLyF.cjs.map → LocalStateStore-CV6phNMZ.cjs.map} +1 -1
- package/dist/{LocalStateStore-Dk3Wbvzk.mjs → LocalStateStore-DAnFc708.mjs} +2 -2
- package/dist/{LocalStateStore-Dk3Wbvzk.mjs.map → LocalStateStore-DAnFc708.mjs.map} +1 -1
- package/dist/{OpenApiTsGenerator-BmUAcR7d.mjs → OpenApiTsGenerator-CSaXs-dB.mjs} +2 -2
- package/dist/{OpenApiTsGenerator-BmUAcR7d.mjs.map → OpenApiTsGenerator-CSaXs-dB.mjs.map} +1 -1
- package/dist/{OpenApiTsGenerator-B2zrdyP4.cjs → OpenApiTsGenerator-CxB8mqXz.cjs} +2 -2
- package/dist/{OpenApiTsGenerator-B2zrdyP4.cjs.map → OpenApiTsGenerator-CxB8mqXz.cjs.map} +1 -1
- package/dist/{S3StateStore-B_ZF9eHt.mjs → S3StateStore-8kJEGnTh.mjs} +2 -2
- package/dist/{S3StateStore-B_ZF9eHt.mjs.map → S3StateStore-8kJEGnTh.mjs.map} +1 -1
- package/dist/{S3StateStore--4tYVMAL.cjs → S3StateStore-dA34LAYm.cjs} +2 -2
- package/dist/{S3StateStore--4tYVMAL.cjs.map → S3StateStore-dA34LAYm.cjs.map} +1 -1
- package/dist/{SSMStateStore-ACZ8hRvZ.cjs → SSMStateStore-DBzlfc-S.cjs} +2 -2
- package/dist/{SSMStateStore-ACZ8hRvZ.cjs.map → SSMStateStore-DBzlfc-S.cjs.map} +1 -1
- package/dist/{SSMStateStore-DjPuKqrm.mjs → SSMStateStore-Dkdw-fPL.mjs} +2 -2
- package/dist/{SSMStateStore-DjPuKqrm.mjs.map → SSMStateStore-Dkdw-fPL.mjs.map} +1 -1
- package/dist/add-CoIr2wgv.cjs +568 -0
- package/dist/add-CoIr2wgv.cjs.map +1 -0
- package/dist/add-Dzk23476.mjs +566 -0
- package/dist/add-Dzk23476.mjs.map +1 -0
- package/dist/{bundler-pyLj-gS0.cjs → bundler-CSR2nM4m.cjs} +5 -5
- package/dist/{bundler-pyLj-gS0.cjs.map → bundler-CSR2nM4m.cjs.map} +1 -1
- package/dist/{bundler-Bq3HaLOZ.mjs → bundler-Cn0JF5G0.mjs} +5 -5
- package/dist/{bundler-Bq3HaLOZ.mjs.map → bundler-Cn0JF5G0.mjs.map} +1 -1
- package/dist/{cli-DR7B2_fX.cjs → cli-IoM2-x48.cjs} +13 -4
- package/dist/cli-IoM2-x48.cjs.map +1 -0
- package/dist/{cli-C2Tjbn27.mjs → cli-ij8Lwlww.mjs} +13 -4
- package/dist/cli-ij8Lwlww.mjs.map +1 -0
- package/dist/{compose-BjToENzG.mjs → compose-CZtinmtw.mjs} +173 -58
- package/dist/compose-CZtinmtw.mjs.map +1 -0
- package/dist/{compose-5oNHAKNT.cjs → compose-DfIioFX0.cjs} +173 -58
- package/dist/compose-DfIioFX0.cjs.map +1 -0
- package/dist/{config-4XFxX1al.d.cts → config-BnA0kPTY.d.cts} +3 -3
- package/dist/{config-4XFxX1al.d.cts.map → config-BnA0kPTY.d.cts.map} +1 -1
- package/dist/{config-UtKzhpFb.d.mts → config-CxEp_g7j.d.mts} +3 -3
- package/dist/{config-UtKzhpFb.d.mts.map → config-CxEp_g7j.d.mts.map} +1 -1
- package/dist/config.cjs +3 -3
- package/dist/config.d.cts +3 -3
- package/dist/config.d.mts +3 -3
- package/dist/config.mjs +3 -3
- package/dist/credentialSchemas-BcNL1N5R.cjs +271 -0
- package/dist/credentialSchemas-BcNL1N5R.cjs.map +1 -0
- package/dist/credentialSchemas-BmYxnEz_.mjs +236 -0
- package/dist/credentialSchemas-BmYxnEz_.mjs.map +1 -0
- package/dist/deploy/public.cjs +11 -7
- package/dist/deploy/public.d.cts +15 -4
- package/dist/deploy/public.d.cts.map +1 -1
- package/dist/deploy/public.d.mts +15 -4
- package/dist/deploy/public.d.mts.map +1 -1
- package/dist/deploy/public.mjs +8 -8
- package/dist/{deploy-DRAwTG72.mjs → deploy-BzqbkJ3o.mjs} +11 -7
- package/dist/deploy-BzqbkJ3o.mjs.map +1 -0
- package/dist/{deploy-BucRfbvX.cjs → deploy-Dpz9raPM.cjs} +11 -7
- package/dist/deploy-Dpz9raPM.cjs.map +1 -0
- package/dist/{discover-OEfZ9OkA.cjs → discover-B4VjaFJk.cjs} +2 -2
- package/dist/{discover-OEfZ9OkA.cjs.map → discover-B4VjaFJk.cjs.map} +1 -1
- package/dist/{discover-BFoJWKGD.mjs → discover-Buwf1z4P.mjs} +2 -2
- package/dist/{discover-BFoJWKGD.mjs.map → discover-Buwf1z4P.mjs.map} +1 -1
- package/dist/{dokploy-m345Zx02.cjs → dokploy-B6O-J1fb.cjs} +2 -2
- package/dist/{dokploy-m345Zx02.cjs.map → dokploy-B6O-J1fb.cjs.map} +1 -1
- package/dist/{dokploy-DIt1IZl1.mjs → dokploy-DkwcORbv.mjs} +2 -2
- package/dist/{dokploy-DIt1IZl1.mjs.map → dokploy-DkwcORbv.mjs.map} +1 -1
- package/dist/{encryption-Ccbahik7.mjs → encryption-7m1mKcRy.mjs} +3 -3
- package/dist/{encryption-Ccbahik7.mjs.map → encryption-7m1mKcRy.mjs.map} +1 -1
- package/dist/{encryption-rZ3BghXy.cjs → encryption-C8Ic5t0C.cjs} +3 -3
- package/dist/{encryption-rZ3BghXy.cjs.map → encryption-C8Ic5t0C.cjs.map} +1 -1
- package/dist/{engine-Gs0abjuj.mjs → engine-62Kl70Pj.mjs} +146 -28
- package/dist/engine-62Kl70Pj.mjs.map +1 -0
- package/dist/{engine-Cx_dvx9q.cjs → engine-BR9qlS7A.cjs} +146 -28
- package/dist/engine-BR9qlS7A.cjs.map +1 -0
- package/dist/{github-CrcGFkfD.cjs → github-CmGIZjhu.cjs} +3 -3
- package/dist/{github-CrcGFkfD.cjs.map → github-CmGIZjhu.cjs.map} +1 -1
- package/dist/{github-CJANTYqi.mjs → github-DtymyOcH.mjs} +3 -3
- package/dist/{github-CJANTYqi.mjs.map → github-DtymyOcH.mjs.map} +1 -1
- package/dist/{index-DD1FfUHh.d.mts → index-CkX89m6S.d.mts} +2 -2
- package/dist/{index-CyApaHVe.d.cts.map → index-CkX89m6S.d.mts.map} +1 -1
- package/dist/{index-CyApaHVe.d.cts → index-EvZBkycu.d.cts} +2 -2
- package/dist/{index-DD1FfUHh.d.mts.map → index-EvZBkycu.d.cts.map} +1 -1
- package/dist/index.cjs +94 -52
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +94 -52
- package/dist/index.mjs.map +1 -1
- package/dist/{migrate-DCVo5gLS.mjs → migrate-CEzq6DjL.mjs} +4 -4
- package/dist/{migrate-DCVo5gLS.mjs.map → migrate-CEzq6DjL.mjs.map} +1 -1
- package/dist/{migrate-CQdSpttI.cjs → migrate-CYC-hBOU.cjs} +4 -4
- package/dist/{migrate-CQdSpttI.cjs.map → migrate-CYC-hBOU.cjs.map} +1 -1
- package/dist/openapi.cjs +1 -1
- package/dist/openapi.d.cts +1 -1
- package/dist/openapi.d.mts +1 -1
- package/dist/openapi.mjs +1 -1
- package/dist/{ready-2s3-CndS.mjs → ready-DeYaSoNN.mjs} +3 -3
- package/dist/{ready-2s3-CndS.mjs.map → ready-DeYaSoNN.mjs.map} +1 -1
- package/dist/{ready-B6uHr4sm.cjs → ready-QGgjmcuN.cjs} +3 -3
- package/dist/{ready-B6uHr4sm.cjs.map → ready-QGgjmcuN.cjs.map} +1 -1
- package/dist/reconcile/public.cjs +1 -1
- package/dist/reconcile/public.d.cts +1 -1
- package/dist/reconcile/public.d.mts +1 -1
- package/dist/reconcile/public.mjs +1 -1
- package/dist/{resolve-BexmDcsN.cjs → resolve-BDsMffvz.cjs} +3 -3
- package/dist/{resolve-BexmDcsN.cjs.map → resolve-BDsMffvz.cjs.map} +1 -1
- package/dist/{resolve-DhZgtvZe.mjs → resolve-Dn5wGf1r.mjs} +3 -3
- package/dist/{resolve-DhZgtvZe.mjs.map → resolve-Dn5wGf1r.mjs.map} +1 -1
- package/dist/{rollback-BnY7KuG_.cjs → rollback-5XHaBDxW.cjs} +5 -5
- package/dist/{rollback-BnY7KuG_.cjs.map → rollback-5XHaBDxW.cjs.map} +1 -1
- package/dist/{rollback-m4Yeym5x.mjs → rollback-DDfaqv7P.mjs} +5 -5
- package/dist/{rollback-m4Yeym5x.mjs.map → rollback-DDfaqv7P.mjs.map} +1 -1
- package/dist/{runtime-CEk5n4VH.d.mts → runtime-B3jNgeP-.d.mts} +2 -2
- package/dist/{runtime-BRqFOvPM.d.cts.map → runtime-B3jNgeP-.d.mts.map} +1 -1
- package/dist/{runtime-BRqFOvPM.d.cts → runtime-DWThEP-r.d.cts} +2 -2
- package/dist/{runtime-CEk5n4VH.d.mts.map → runtime-DWThEP-r.d.cts.map} +1 -1
- package/dist/sandbox/credentials-worker.cjs +54 -0
- package/dist/sandbox/credentials-worker.cjs.map +1 -0
- package/dist/sandbox/credentials-worker.d.cts +1 -0
- package/dist/sandbox/credentials-worker.d.mts +1 -0
- package/dist/sandbox/credentials-worker.mjs +55 -0
- package/dist/sandbox/credentials-worker.mjs.map +1 -0
- package/dist/sandbox/discover-worker.cjs +1 -1
- package/dist/sandbox/discover-worker.mjs +1 -1
- package/dist/sandbox/migrate-worker.cjs +1 -1
- package/dist/sandbox/migrate-worker.mjs +1 -1
- package/dist/{schemas-RUlKHu27.cjs → schemas-BObwxB_t.cjs} +164 -3
- package/dist/schemas-BObwxB_t.cjs.map +1 -0
- package/dist/{schemas-Cfhtpdo0.mjs → schemas-D-xeKJDD.mjs} +153 -4
- package/dist/schemas-D-xeKJDD.mjs.map +1 -0
- package/dist/{sniffer-D66HIvi9.cjs → sniffer-Bc0nNBDF.cjs} +7 -7
- package/dist/sniffer-Bc0nNBDF.cjs.map +1 -0
- package/dist/{sniffer-BdFeLSmA.mjs → sniffer-DMqi2b1q.mjs} +7 -7
- package/dist/sniffer-DMqi2b1q.mjs.map +1 -0
- package/dist/{state-DgmM4EKq.cjs → state-8RgXeX5Y.cjs} +398 -8
- package/dist/state-8RgXeX5Y.cjs.map +1 -0
- package/dist/{state-DkUStoqJ.mjs → state-DClnPZt5.mjs} +291 -9
- package/dist/state-DClnPZt5.mjs.map +1 -0
- package/dist/target/public.cjs +1 -1
- package/dist/target/public.d.cts +2 -2
- package/dist/target/public.d.mts +2 -2
- package/dist/target/public.mjs +1 -1
- package/dist/{terminal-C3cv-OQu.mjs → terminal-C6TBo_SA.mjs} +2 -2
- package/dist/{terminal-C3cv-OQu.mjs.map → terminal-C6TBo_SA.mjs.map} +1 -1
- package/dist/{terminal-DjzgLu6m.cjs → terminal-CFO3xWoF.cjs} +2 -2
- package/dist/{terminal-DjzgLu6m.cjs.map → terminal-CFO3xWoF.cjs.map} +1 -1
- package/dist/{types-CSw2w69a.d.mts → types-CZdCxUCK.d.cts} +64 -2
- package/dist/types-CZdCxUCK.d.cts.map +1 -0
- package/dist/{types-D5WIxRDP.d.cts → types-Da0E3Qv7.d.mts} +63 -3
- package/dist/types-Da0E3Qv7.d.mts.map +1 -0
- package/dist/vitest.cjs +1 -1
- package/dist/vitest.mjs +1 -1
- package/dist/workspace/index.cjs +1 -1
- package/dist/workspace/index.d.cts +2 -2
- package/dist/workspace/index.d.mts +2 -2
- package/dist/workspace/index.mjs +1 -1
- package/dist/{workspace-ON-bqiJz.cjs → workspace-8NuAjaXJ.cjs} +2 -2
- package/dist/{workspace-ON-bqiJz.cjs.map → workspace-8NuAjaXJ.cjs.map} +1 -1
- package/dist/{workspace-Be6uBhlF.mjs → workspace-B2UK_rVP.mjs} +2 -2
- package/dist/{workspace-Be6uBhlF.mjs.map → workspace-B2UK_rVP.mjs.map} +1 -1
- package/package.json +16 -13
- package/dist/cli-C2Tjbn27.mjs.map +0 -1
- package/dist/cli-DR7B2_fX.cjs.map +0 -1
- package/dist/compose-5oNHAKNT.cjs.map +0 -1
- package/dist/compose-BjToENzG.mjs.map +0 -1
- package/dist/deploy-BucRfbvX.cjs.map +0 -1
- package/dist/deploy-DRAwTG72.mjs.map +0 -1
- package/dist/engine-Cx_dvx9q.cjs.map +0 -1
- package/dist/engine-Gs0abjuj.mjs.map +0 -1
- package/dist/schemas-Cfhtpdo0.mjs.map +0 -1
- package/dist/schemas-RUlKHu27.cjs.map +0 -1
- package/dist/sniffer-BdFeLSmA.mjs.map +0 -1
- package/dist/sniffer-D66HIvi9.cjs.map +0 -1
- package/dist/state-DgmM4EKq.cjs.map +0 -1
- package/dist/state-DkUStoqJ.mjs.map +0 -1
- package/dist/types-CSw2w69a.d.mts.map +0 -1
- package/dist/types-D5WIxRDP.d.cts.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BhDjJH2R.mjs";
|
|
2
2
|
import { a as runOutput, i as run$1, s as gkmHome } from "./run-BJLIerMM.mjs";
|
|
3
|
-
import { d as output, r as discover } from "./discover-
|
|
3
|
+
import { d as output, r as discover } from "./discover-Buwf1z4P.mjs";
|
|
4
4
|
import { t as appKey } from "./derive-B4vDpzgP.mjs";
|
|
5
|
-
import { O as TEST_STAGE, h as getPublicEnvPrefix, n as allConstructGlobs } from "./workspace-
|
|
5
|
+
import { O as TEST_STAGE, h as getPublicEnvPrefix, n as allConstructGlobs } from "./workspace-B2UK_rVP.mjs";
|
|
6
6
|
import { ConfigNotFound, NotInAnApp, loadWorkspaceAppInfo, loadWorkspaceConfig } from "./config.mjs";
|
|
7
|
-
import { c as runtimeOf } from "./resolve-
|
|
7
|
+
import { c as runtimeOf } from "./resolve-Dn5wGf1r.mjs";
|
|
8
8
|
import { i as DEFAULT_STORAGE, n as DEFAULT_CACHE, r as DEFAULT_EVENTS$1, t as readFakes } from "./fakes-C9RiT6XG.mjs";
|
|
9
9
|
import { basename, dirname, isAbsolute, join, parse, relative, resolve, sep } from "node:path";
|
|
10
10
|
import { constants, existsSync, readFileSync } from "node:fs";
|
|
@@ -3107,15 +3107,18 @@ function pgClient(port, password = LOCAL_USER$1) {
|
|
|
3107
3107
|
}
|
|
3108
3108
|
} };
|
|
3109
3109
|
}
|
|
3110
|
-
/** A bucket client pointed at
|
|
3111
|
-
function bucketClient(port
|
|
3110
|
+
/** A bucket client pointed at a MinIO on this machine. */
|
|
3111
|
+
function bucketClient(port, credentials = {
|
|
3112
|
+
user: LOCAL_USER$1,
|
|
3113
|
+
password: LOCAL_USER$1
|
|
3114
|
+
}) {
|
|
3112
3115
|
const s3 = new S3Client({
|
|
3113
3116
|
region: "us-east-1",
|
|
3114
3117
|
endpoint: `http://localhost:${port}`,
|
|
3115
3118
|
forcePathStyle: true,
|
|
3116
3119
|
credentials: {
|
|
3117
|
-
accessKeyId:
|
|
3118
|
-
secretAccessKey:
|
|
3120
|
+
accessKeyId: credentials.user,
|
|
3121
|
+
secretAccessKey: credentials.password
|
|
3119
3122
|
}
|
|
3120
3123
|
});
|
|
3121
3124
|
return {
|
|
@@ -4576,6 +4579,285 @@ function keyFingerprint(masterKey) {
|
|
|
4576
4579
|
return createHash("sha256").update(masterKey).digest("hex").slice(0, 8);
|
|
4577
4580
|
}
|
|
4578
4581
|
//#endregion
|
|
4582
|
+
//#region src/deploy/devServices.ts
|
|
4583
|
+
/**
|
|
4584
|
+
* Mail and object storage on a deployed stage: real ones, or — only when
|
|
4585
|
+
* someone asked — the dev services the local stage runs.
|
|
4586
|
+
*
|
|
4587
|
+
* Locally a declared `Email` is Mailpit and a declared bucket is MinIO, and
|
|
4588
|
+
* nobody has to configure either. Deployed, the same two containers would be
|
|
4589
|
+
* a stage that silently delivers no mail and keeps its files on one
|
|
4590
|
+
* container's disk. So a deployed stage on a server target takes both from
|
|
4591
|
+
* its secrets — the mail server's URL and sending address, and each bucket's
|
|
4592
|
+
* URL — and a stage missing any of them fails before anything is built,
|
|
4593
|
+
* provisioned or written, naming every key at once.
|
|
4594
|
+
*
|
|
4595
|
+
* A bucket's credentials are not checked: they are optional, and come from
|
|
4596
|
+
* either of two places. The bucket's URL may carry a key of its own
|
|
4597
|
+
* (`s3://KEY:SECRET@uploads`), which wins; otherwise the S3 client's default
|
|
4598
|
+
* chain applies — the stage's shared `AWS_ACCESS_KEY_ID`/
|
|
4599
|
+
* `AWS_SECRET_ACCESS_KEY` when it set them, or a role.
|
|
4600
|
+
*
|
|
4601
|
+
* `--allow-dev-services minio,mailpit` is the way out for a stage that is
|
|
4602
|
+
* not production — a preview, a demo: the target runs the dev service and
|
|
4603
|
+
* derives the keys from it. Keys the stage did set still win. Every run that
|
|
4604
|
+
* uses one says so, loudly.
|
|
4605
|
+
*
|
|
4606
|
+
* Pure: what each target runs is decided here from declarations and the
|
|
4607
|
+
* stage's values, and the targets do the running.
|
|
4608
|
+
*/
|
|
4609
|
+
/** The dev services a deployed stage may be allowed to run. */
|
|
4610
|
+
const DEV_SERVICES = ["minio", "mailpit"];
|
|
4611
|
+
/**
|
|
4612
|
+
* The S3 client's shared key pair. Optional: a bucket whose URL carries its own
|
|
4613
|
+
* key (`s3://KEY:SECRET@bucket`) signs with that, and one without signs with
|
|
4614
|
+
* this pair when the stage set it, or with whatever else the SDK's default
|
|
4615
|
+
* chain finds — a role.
|
|
4616
|
+
*/
|
|
4617
|
+
const STORAGE_KEY_PAIR = ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY"];
|
|
4618
|
+
/** A `--allow-dev-services` value that is not a dev service. */
|
|
4619
|
+
var UnknownDevService = class extends Error {
|
|
4620
|
+
value;
|
|
4621
|
+
constructor(value) {
|
|
4622
|
+
super(`'${value}' is not a dev service. --allow-dev-services takes a comma-separated list of ${DEV_SERVICES.join(", ")}: --allow-dev-services ${DEV_SERVICES.join(",")}`);
|
|
4623
|
+
this.value = value;
|
|
4624
|
+
this.name = "UnknownDevService";
|
|
4625
|
+
}
|
|
4626
|
+
};
|
|
4627
|
+
/** Dev services asked of a target that runs no containers. */
|
|
4628
|
+
var DevServicesNeedServerTarget = class extends Error {
|
|
4629
|
+
target;
|
|
4630
|
+
services;
|
|
4631
|
+
constructor(target, services) {
|
|
4632
|
+
super(`--allow-dev-services applies to server targets only, and '${target}' deploys to AWS, where a bucket is S3 and mail is the stage's own. Drop --allow-dev-services ${services.join(",")}.`);
|
|
4633
|
+
this.target = target;
|
|
4634
|
+
this.services = services;
|
|
4635
|
+
this.name = "DevServicesNeedServerTarget";
|
|
4636
|
+
}
|
|
4637
|
+
};
|
|
4638
|
+
/**
|
|
4639
|
+
* A deployed stage with mail or object storage that its secrets do not
|
|
4640
|
+
* configure — every missing key, across every app, at once.
|
|
4641
|
+
*/
|
|
4642
|
+
var ExternalServicesNotConfigured = class extends Error {
|
|
4643
|
+
stage;
|
|
4644
|
+
missing;
|
|
4645
|
+
constructor(stage, missing) {
|
|
4646
|
+
const services = [...new Set(missing.map((m) => m.service))].sort();
|
|
4647
|
+
const lines = missing.map((m) => {
|
|
4648
|
+
const by = m.apps?.length ? `, read by ${m.apps.join(", ")}` : "";
|
|
4649
|
+
return ` gkm secrets:set ${m.key} '${m.example}' --stage ${stage}\n ${m.what}${by}` + (m.note ? `\n ${m.note}` : "");
|
|
4650
|
+
});
|
|
4651
|
+
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}`);
|
|
4652
|
+
this.stage = stage;
|
|
4653
|
+
this.missing = missing;
|
|
4654
|
+
this.name = "ExternalServicesNotConfigured";
|
|
4655
|
+
}
|
|
4656
|
+
};
|
|
4657
|
+
/**
|
|
4658
|
+
* The dev services a value names: `'minio,mailpit'`, or a list of them.
|
|
4659
|
+
*
|
|
4660
|
+
* @throws {UnknownDevService} for anything that is not one
|
|
4661
|
+
*/
|
|
4662
|
+
function parseDevServices(value) {
|
|
4663
|
+
if (value === void 0) return [];
|
|
4664
|
+
const items = (typeof value === "string" ? [value] : value).flatMap((item) => item.split(",")).map((item) => item.trim()).filter(Boolean);
|
|
4665
|
+
const services = /* @__PURE__ */ new Set();
|
|
4666
|
+
for (const item of items) {
|
|
4667
|
+
if (!DEV_SERVICES.includes(item)) throw new UnknownDevService(item);
|
|
4668
|
+
services.add(item);
|
|
4669
|
+
}
|
|
4670
|
+
return [...services].sort();
|
|
4671
|
+
}
|
|
4672
|
+
/**
|
|
4673
|
+
* Every mail and storage construct a manifest declares, with the apps that
|
|
4674
|
+
* depend on each — what a target that provisions the whole manifest checks.
|
|
4675
|
+
*/
|
|
4676
|
+
function manifestServiceDeclarations(manifest) {
|
|
4677
|
+
return Object.entries(manifest).flatMap(([id, declaration]) => {
|
|
4678
|
+
const { kind } = declaration;
|
|
4679
|
+
if (kind !== "email" && kind !== "objects" && kind !== "file-server") return [];
|
|
4680
|
+
const apps = dependentsOf(manifest, id).filter((caller) => {
|
|
4681
|
+
const callerKind = manifest[caller]?.kind;
|
|
4682
|
+
return callerKind === "rest-api" || callerKind === "site";
|
|
4683
|
+
}).map(appKey);
|
|
4684
|
+
return [{
|
|
4685
|
+
id,
|
|
4686
|
+
kind,
|
|
4687
|
+
...declaration.kind === "file-server" ? { of: declaration.of } : {},
|
|
4688
|
+
...apps.length ? { apps } : {}
|
|
4689
|
+
}];
|
|
4690
|
+
});
|
|
4691
|
+
}
|
|
4692
|
+
/**
|
|
4693
|
+
* Every key a stage must be given rather than derive — the one list both a
|
|
4694
|
+
* deploy's checks and `gkm secrets:add` read, so what a deploy refuses and
|
|
4695
|
+
* what the builder offers cannot drift.
|
|
4696
|
+
*
|
|
4697
|
+
* - Deployed, mail is its URL and its sending address, a bucket its URL, and
|
|
4698
|
+
* a file server its public URL. Locally all of it is Mailpit and MinIO.
|
|
4699
|
+
* - On every stage, a third party's credentials: nobody but the third party
|
|
4700
|
+
* can issue them.
|
|
4701
|
+
*
|
|
4702
|
+
* Never a derived value: a database URL, a generated secret, the seed.
|
|
4703
|
+
*/
|
|
4704
|
+
function requiredStageKeys(input) {
|
|
4705
|
+
const domain = input.domain ?? "example.com";
|
|
4706
|
+
const keys = [];
|
|
4707
|
+
const add = (entry) => {
|
|
4708
|
+
if (!keys.some((k) => k.key === entry.key)) keys.push(entry);
|
|
4709
|
+
};
|
|
4710
|
+
const byId = (list) => [...list ?? []].sort((a, b) => a.id.localeCompare(b.id));
|
|
4711
|
+
const apps = (d) => d.apps?.length ? { apps: [...d.apps].sort() } : {};
|
|
4712
|
+
if (!input.local) {
|
|
4713
|
+
const services = byId(input.services);
|
|
4714
|
+
for (const d of services.filter((d) => d.kind === "email")) {
|
|
4715
|
+
add({
|
|
4716
|
+
key: provideKey(d.id, "url"),
|
|
4717
|
+
id: d.id,
|
|
4718
|
+
kind: "email",
|
|
4719
|
+
what: `where '${d.id}' sends mail — any SMTP server`,
|
|
4720
|
+
example: `smtp://user:password@smtp.${domain}:587`,
|
|
4721
|
+
service: "mailpit",
|
|
4722
|
+
...apps(d)
|
|
4723
|
+
});
|
|
4724
|
+
add({
|
|
4725
|
+
key: provideKey(d.id, "from"),
|
|
4726
|
+
id: d.id,
|
|
4727
|
+
kind: "email",
|
|
4728
|
+
what: `the address '${d.id}' sends from, on a domain the mail server has verified`,
|
|
4729
|
+
example: `noreply@${domain}`,
|
|
4730
|
+
service: "mailpit",
|
|
4731
|
+
...apps(d)
|
|
4732
|
+
});
|
|
4733
|
+
}
|
|
4734
|
+
for (const d of services.filter((d) => d.kind === "objects")) add({
|
|
4735
|
+
key: provideKey(d.id, "url"),
|
|
4736
|
+
id: d.id,
|
|
4737
|
+
kind: "bucket",
|
|
4738
|
+
what: `the bucket '${d.id}' — S3, R2, or any S3-compatible store (add &endpoint=… for one that is not S3)`,
|
|
4739
|
+
note: `credentials are optional: a key for this bucket alone in the URL (s3://KEY:SECRET@${appKey(d.id)}?…) wins; without one, the shared AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY or a role signs`,
|
|
4740
|
+
example: `s3://${appKey(d.id)}?region=eu-west-1`,
|
|
4741
|
+
service: "minio",
|
|
4742
|
+
...apps(d)
|
|
4743
|
+
});
|
|
4744
|
+
for (const d of services.filter((d) => d.kind === "file-server")) add({
|
|
4745
|
+
key: provideKey(d.id, "url"),
|
|
4746
|
+
id: d.id,
|
|
4747
|
+
kind: "file-server",
|
|
4748
|
+
what: `the public address '${d.id}' serves its bucket on — a CDN or the bucket's own domain`,
|
|
4749
|
+
example: `https://${appKey(d.id)}.${domain}`,
|
|
4750
|
+
service: "minio",
|
|
4751
|
+
...d.of ? { of: d.of } : {},
|
|
4752
|
+
...apps(d)
|
|
4753
|
+
});
|
|
4754
|
+
}
|
|
4755
|
+
for (const d of byId(input.credentials)) add({
|
|
4756
|
+
key: provideKey(d.id, "credentials"),
|
|
4757
|
+
id: d.id,
|
|
4758
|
+
kind: d.kind,
|
|
4759
|
+
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`,
|
|
4760
|
+
example: "{\"apiKey\":\"…\"}",
|
|
4761
|
+
...apps(d)
|
|
4762
|
+
});
|
|
4763
|
+
return keys;
|
|
4764
|
+
}
|
|
4765
|
+
/**
|
|
4766
|
+
* Whether only the stage's secrets can supply `key` to a construct of `kind`
|
|
4767
|
+
* — what nothing on the stage derives.
|
|
4768
|
+
*
|
|
4769
|
+
* A third party's credentials, always. Deployed, also each generated secret
|
|
4770
|
+
* and keyring: the stage generated each one once, and every run reads the
|
|
4771
|
+
* same value back.
|
|
4772
|
+
*/
|
|
4773
|
+
function suppliedOnly(kind, id, key, local) {
|
|
4774
|
+
if (kind === "credential") return true;
|
|
4775
|
+
if (kind === "external-api") return key === provideKey(id, "credentials");
|
|
4776
|
+
if (local) return false;
|
|
4777
|
+
return kind === "secret" || kind === "encryption";
|
|
4778
|
+
}
|
|
4779
|
+
/**
|
|
4780
|
+
* Where a deployed stage's mail and storage come from, and what it lacks.
|
|
4781
|
+
*
|
|
4782
|
+
* - Mail is external once its URL is set, and then needs its sending
|
|
4783
|
+
* address too. Unset, it is Mailpit where allowed — the address derived
|
|
4784
|
+
* unless set — and missing otherwise.
|
|
4785
|
+
* - A bucket is external once its URL is set; its credentials, in the URL or
|
|
4786
|
+
* the shared pair, are optional. Unset, it is MinIO where allowed, and
|
|
4787
|
+
* missing otherwise.
|
|
4788
|
+
* - A file server's URL is derived where its bucket is MinIO, unless set;
|
|
4789
|
+
* over an external bucket the stage must set it.
|
|
4790
|
+
*
|
|
4791
|
+
* The keys themselves are {@link requiredStageKeys}'s.
|
|
4792
|
+
*/
|
|
4793
|
+
function externalServices(input) {
|
|
4794
|
+
const { supplied, allow } = input;
|
|
4795
|
+
const has = (key) => supplied[key] !== void 0;
|
|
4796
|
+
const required = requiredStageKeys({
|
|
4797
|
+
local: false,
|
|
4798
|
+
services: input.declarations,
|
|
4799
|
+
...input.domain ? { domain: input.domain } : {}
|
|
4800
|
+
});
|
|
4801
|
+
const mailpit = required.filter((k) => k.kind === "email" && k.key === provideKey(k.id, "url")).filter((k) => !has(k.key) && allow.includes("mailpit")).map((k) => k.id);
|
|
4802
|
+
const minio = required.filter((k) => k.kind === "bucket").filter((k) => !has(k.key) && allow.includes("minio")).map((k) => k.id);
|
|
4803
|
+
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);
|
|
4804
|
+
return {
|
|
4805
|
+
missing: required.filter((k) => !has(k.key) && !covered(k)).map(({ key, id, what, note, example, service, apps }) => ({
|
|
4806
|
+
key,
|
|
4807
|
+
id,
|
|
4808
|
+
what,
|
|
4809
|
+
...note ? { note } : {},
|
|
4810
|
+
example,
|
|
4811
|
+
service,
|
|
4812
|
+
...apps ? { apps } : {}
|
|
4813
|
+
})),
|
|
4814
|
+
minio,
|
|
4815
|
+
mailpit
|
|
4816
|
+
};
|
|
4817
|
+
}
|
|
4818
|
+
/**
|
|
4819
|
+
* `externalServices`, refusing a stage that lacks anything.
|
|
4820
|
+
*
|
|
4821
|
+
* @throws {ExternalServicesNotConfigured} naming every missing key
|
|
4822
|
+
*/
|
|
4823
|
+
function assertExternalServices(input) {
|
|
4824
|
+
const services = externalServices(input);
|
|
4825
|
+
if (services.missing.length > 0) throw new ExternalServicesNotConfigured(input.stage, services.missing);
|
|
4826
|
+
return services;
|
|
4827
|
+
}
|
|
4828
|
+
/** The dev services a run uses, one entry per service it runs. */
|
|
4829
|
+
function devServicesUsed(services) {
|
|
4830
|
+
const used = [];
|
|
4831
|
+
if (services.mailpit.length > 0) used.push({
|
|
4832
|
+
service: "mailpit",
|
|
4833
|
+
ids: services.mailpit
|
|
4834
|
+
});
|
|
4835
|
+
if (services.minio.length > 0) used.push({
|
|
4836
|
+
service: "minio",
|
|
4837
|
+
ids: services.minio
|
|
4838
|
+
});
|
|
4839
|
+
return used;
|
|
4840
|
+
}
|
|
4841
|
+
/** The line a run prints for each dev service a deployed stage uses. */
|
|
4842
|
+
function devServiceWarning(stage, use) {
|
|
4843
|
+
return `⚠️ DEV SERVICE ON A DEPLOYED STAGE (${stage}): ${use.service === "mailpit" ? `Mailpit is catching mail for ${use.ids.join(", ")}. It delivers NO mail: nobody receives a sign-in link, a receipt or a reset` : `MinIO is storing ${use.ids.join(", ")}. Every object is on one container's disk, with no replication and no backup`}. It is not production-grade — set the stage's own keys in its secrets for that.`;
|
|
4844
|
+
}
|
|
4845
|
+
/**
|
|
4846
|
+
* Report each dev service a run uses: a loud line, and a `dev-service.used`
|
|
4847
|
+
* event a host can act on.
|
|
4848
|
+
*/
|
|
4849
|
+
function reportDevServices(ctx, uses) {
|
|
4850
|
+
for (const use of uses) {
|
|
4851
|
+
ctx.logger.warn(`\n${devServiceWarning(ctx.stage, use)}`);
|
|
4852
|
+
ctx.emit({
|
|
4853
|
+
type: "dev-service.used",
|
|
4854
|
+
service: use.service,
|
|
4855
|
+
stage: ctx.stage,
|
|
4856
|
+
constructs: use.ids
|
|
4857
|
+
});
|
|
4858
|
+
}
|
|
4859
|
+
}
|
|
4860
|
+
//#endregion
|
|
4579
4861
|
//#region src/target/dokploy/domain.ts
|
|
4580
4862
|
/** A stage was deployed that `deploy.domains` gives no domain. */
|
|
4581
4863
|
var NoDomainForStage = class extends Error {
|
|
@@ -5388,6 +5670,6 @@ function setPostgresBackupId(state, backupId) {
|
|
|
5388
5670
|
if (state.backups) state.backups.postgresBackupId = backupId;
|
|
5389
5671
|
}
|
|
5390
5672
|
//#endregion
|
|
5391
|
-
export {
|
|
5673
|
+
export { postgresDatabaseNames as $, withCustomSecret as $t, assertExternalServices as A, loadEnvFiles as At, keyFingerprint as B, readKey as Bt, isMainFrontendApp as C, fakeKey as Ct, ExternalServicesNotConfigured as D, createEntryWrapper as Dt, DevServicesNeedServerTarget as E, createCredentialsPreload as Et, reportDevServices as F, store_exports as Ft, reconcileWorkspace as G, isOwnedBy as Gt, backendsOf as H, deployIdentity as Ht, requiredStageKeys as I, FileSecretsStore as It, forgetState as J, projectName as Jt, workspace_exports as K, markerOf as Kt, suppliedOnly as L, getKeyPath as Lt, externalServices as M, prepareEntryCredentials as Mt, manifestServiceDeclarations as N, isRemoteStore as Nt, STORAGE_KEY_PAIR as O, findAvailablePort as Ot, parseDevServices as P, secretsStoreFor as Pt, bucketPolicies as Q, toEmbeddableSecrets as Qt, encryptSecrets as R, keystoreProject as Rt, NoDomainForStage as S, describeServices as St, DEV_SERVICES as T, primaryPortKey as Tt, constructGlobs as U, imageName as Ut, FAKE_ENV as V, applicationName as Vt, derivedContainers as W, imageRef as Wt, applyPolicies as X, maskPassword as Xt, applyBuckets as Y, initStageSecrets as Yt, applyPostgres as Z, storage_exports as Zt, deployDocker as _, cacheBackendFor as _t, recordRelease as a, appEnvKeys as at, ensureDockerignore as b, storageBackendFor as bt, setBackupState as c, localRolePassword as ct, setGeneratedSecret as d, hostFor as dt, postgresStatements as et, setPostgresBackupId as f, composeBuildPaths as ft, credentialsFileContent as g, findBuildRoot as gt, credentialsBuildArg as h, detectPackageManager as ht, isDnsVerified as i, pgClient as it, devServicesUsed as j, loadSecretsForApp as jt, UnknownDevService as k, isPortAvailable as kt, setDnsRecord as l, planFor as lt, withGeneratedSecrets as m, TURBO_VERSION as mt, getBackupState as n, composeFor as nt, recordRollback as o, networkEnv as ot, DeployJournal as p, imageLayout as pt, LOCAL_CA_PATH as q, ownershipMarker as qt, getGeneratedSecret as r, bucketClient as rt, setApplicationId as s, envFor as st, createEmptyState as t, quoteIdentifier as tt, setDnsVerification as u, resourceName as ut, appDockerfile as v, eventsBackendFor as vt, resolveHost as w, portKeys as wt, validateImageRef as x, DEFAULT_IMAGES as xt, dockerCommand as y, providerOf as yt, encryption_exports as z, projectKey as zt };
|
|
5392
5674
|
|
|
5393
|
-
//# sourceMappingURL=state-
|
|
5675
|
+
//# sourceMappingURL=state-DClnPZt5.mjs.map
|