@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,12 +1,13 @@
|
|
|
1
1
|
import { i as LocalSandbox, t as MissingCredential } from "./credentials-pAtB70k3.mjs";
|
|
2
|
-
import { a as discriminatedUnion,
|
|
3
|
-
import { c as runWorker, d as output, r as discover } from "./discover-
|
|
2
|
+
import { a as discriminatedUnion, c as looseObject, f as string, n as array, s as literal, u as object } from "./schemas-D-xeKJDD.mjs";
|
|
3
|
+
import { c as runWorker, d as output, r as discover } from "./discover-Buwf1z4P.mjs";
|
|
4
4
|
import { i as activeSandbox } from "./sandbox-Dm247NGx.mjs";
|
|
5
5
|
import { t as appKey } from "./derive-B4vDpzgP.mjs";
|
|
6
|
-
import { g as stripPublicPrefix, h as getPublicEnvPrefix, s as getAppBuildOrder } from "./workspace-
|
|
7
|
-
import {
|
|
8
|
-
import { f as StateStoreBusy, m as StateVersionConflict, o as DokployApi, s as DokployApiError, t as sniffAllApps, v as eventError } from "./sniffer-
|
|
6
|
+
import { g as stripPublicPrefix, h as getPublicEnvPrefix, s as getAppBuildOrder } from "./workspace-B2UK_rVP.mjs";
|
|
7
|
+
import { A as assertExternalServices, C as isMainFrontendApp, D as ExternalServicesNotConfigured, F as reportDevServices, Gt as isOwnedBy, Jt as projectName, Kt as markerOf, M as externalServices, N as manifestServiceDeclarations, O as STORAGE_KEY_PAIR, Qt as toEmbeddableSecrets, R as encryptSecrets, U as constructGlobs, Ut as imageName, Vt as applicationName, Wt as imageRef, Yt as initStageSecrets, Z as applyPostgres, _ as deployDocker, _t as cacheBackendFor, a as recordRelease, bt as storageBackendFor, c as setBackupState, d as setGeneratedSecret, f as setPostgresBackupId, i as isDnsVerified, j as devServicesUsed, l as setDnsRecord, m as withGeneratedSecrets, n as getBackupState, o as recordRollback, p as DeployJournal, qt as ownershipMarker, r as getGeneratedSecret, s as setApplicationId, t as createEmptyState, u as setDnsVerification, ut as resourceName, vt as eventsBackendFor, w as resolveHost, yt as providerOf } from "./state-DClnPZt5.mjs";
|
|
8
|
+
import { f as StateStoreBusy, m as StateVersionConflict, o as DokployApi, s as DokployApiError, t as sniffAllApps, v as eventError } from "./sniffer-DMqi2b1q.mjs";
|
|
9
9
|
import { o as migrationFiles } from "./provider-D7rQzzzf.mjs";
|
|
10
|
+
import { n as assertStageCredentials } from "./credentialSchemas-BmYxnEz_.mjs";
|
|
10
11
|
import { join } from "node:path";
|
|
11
12
|
import { cacheTable, cloudName, cookieDomain, dependentsOf, externalApiUrl, migrationTargets, mobileOrigins, provideKey, provisionOrder, schemeBase } from "@geekmidas/manifest";
|
|
12
13
|
import { createHash, randomBytes } from "node:crypto";
|
|
@@ -507,34 +508,47 @@ const PROVISIONERS = {
|
|
|
507
508
|
return { provides: { [provideKey(declaration.id, "url")]: url.toString() } };
|
|
508
509
|
},
|
|
509
510
|
/**
|
|
510
|
-
* A bucket,
|
|
511
|
+
* A bucket: the stage's own, or — allowed — a MinIO stack on the box.
|
|
512
|
+
*
|
|
513
|
+
* A deployed stage's bucket is an external one — S3, R2, any S3-compatible
|
|
514
|
+
* store — whose URL and key pair the stage's secrets hold. Only with
|
|
515
|
+
* `--allow-dev-services minio` does this target run MinIO for one, and
|
|
516
|
+
* then only for a bucket whose URL the stage did not set.
|
|
511
517
|
*
|
|
512
518
|
* Dokploy has first-class primitives for Postgres and Redis and none for
|
|
513
|
-
* object storage, so
|
|
514
|
-
* *writes* rather than configures — a compose file with one
|
|
519
|
+
* object storage, so MinIO is the one kind whose infrastructure this
|
|
520
|
+
* target *writes* rather than configures — a compose file with one
|
|
521
|
+
* service in it.
|
|
515
522
|
*
|
|
516
523
|
* The service is named `cloudName(...)` like everything else, which is not
|
|
517
524
|
* cosmetic here: containers on `dokploy-network` resolve each other by
|
|
518
525
|
* service name, so the name is the address. Calling it `minio` would work
|
|
519
526
|
* for exactly one project on the box and then collide.
|
|
520
527
|
*
|
|
521
|
-
*
|
|
522
|
-
*
|
|
523
|
-
*
|
|
524
|
-
*
|
|
525
|
-
*
|
|
528
|
+
* A stage's own bucket URL may carry a key scoped to that bucket
|
|
529
|
+
* (`s3://KEY:SECRET@bucket`), which the client signs with; the shared
|
|
530
|
+
* `AWS_ACCESS_KEY_ID` pair is passed beside it when the stage set one, for
|
|
531
|
+
* a bucket whose URL has none. The MinIO this provisions uses that pair —
|
|
532
|
+
* the stage's, or one derived for it.
|
|
526
533
|
*/
|
|
527
534
|
objects: async (declaration, context) => {
|
|
528
535
|
if (declaration.kind !== "objects") throw new WrongKind(declaration.kind);
|
|
536
|
+
const key = provideKey(declaration.id, "url");
|
|
537
|
+
const given = context.supplied?.[key];
|
|
538
|
+
if (given !== void 0) return { provides: {
|
|
539
|
+
[key]: given,
|
|
540
|
+
...storageKeys(context.supplied)
|
|
541
|
+
} };
|
|
529
542
|
const backend = context.storage ?? "minio";
|
|
530
543
|
if (backend !== "minio") throw new UnprovisionableBucket(declaration.id, backend);
|
|
544
|
+
if (!context.devServices?.includes("minio")) throw notConfigured(declaration.id, "objects", context);
|
|
531
545
|
const service = serviceName({
|
|
532
546
|
stage: context.stage,
|
|
533
547
|
app: context.scope ?? context.project
|
|
534
548
|
}, declaration.id);
|
|
535
549
|
const bucket = resourceName(declaration.id, declaration.kind, context.stage);
|
|
536
|
-
const user = `${bucket}-root`;
|
|
537
|
-
const password = derivedPassword(context, `objects:${declaration.id}`);
|
|
550
|
+
const user = context.supplied?.AWS_ACCESS_KEY_ID ?? `${bucket}-root`;
|
|
551
|
+
const password = context.supplied?.AWS_SECRET_ACCESS_KEY ?? derivedPassword(context, `objects:${declaration.id}`);
|
|
538
552
|
const { compose } = await context.api.findOrCreateCompose(service, context.projectId, context.environmentId, minioCompose({
|
|
539
553
|
service,
|
|
540
554
|
bucket,
|
|
@@ -543,33 +557,67 @@ const PROVISIONERS = {
|
|
|
543
557
|
}));
|
|
544
558
|
await context.api.deployCompose(compose.composeId);
|
|
545
559
|
return { provides: {
|
|
546
|
-
[
|
|
560
|
+
[key]: s3Url(service, bucket),
|
|
547
561
|
AWS_ACCESS_KEY_ID: user,
|
|
548
562
|
AWS_SECRET_ACCESS_KEY: password,
|
|
549
|
-
AWS_REGION: MINIO_REGION
|
|
563
|
+
AWS_REGION: context.supplied?.AWS_REGION ?? MINIO_REGION
|
|
550
564
|
} };
|
|
551
565
|
},
|
|
552
566
|
/**
|
|
553
567
|
* The address a bucket's objects are served on.
|
|
554
568
|
*
|
|
555
|
-
*
|
|
556
|
-
*
|
|
557
|
-
* target's Caddy has no equivalent here. What this resolves is the address,
|
|
558
|
-
* and the `open` prefixes are applied to the bucket rather than to an edge,
|
|
559
|
-
* so a policy is what makes them public wherever the bucket lives.
|
|
569
|
+
* The stage's own — a CDN, the bucket's domain — when its secrets hold
|
|
570
|
+
* one, which a bucket that is not MinIO's needs.
|
|
560
571
|
*
|
|
561
|
-
*
|
|
562
|
-
*
|
|
563
|
-
*
|
|
572
|
+
* Over MinIO nothing is provisioned: Dokploy runs Traefik, so a second
|
|
573
|
+
* reverse proxy behind the first would terminate TLS twice — which is why
|
|
574
|
+
* the local target's Caddy has no equivalent here. What this resolves is
|
|
575
|
+
* the address, and the `open` prefixes are applied to the bucket rather
|
|
576
|
+
* than to an edge, so a policy is what makes them public wherever the
|
|
577
|
+
* bucket lives. Until a Traefik rule exists it answers on MinIO directly,
|
|
578
|
+
* path-style, which is honest about the shape it has today: the bucket is
|
|
579
|
+
* in the path rather than fronted by a host of its own.
|
|
564
580
|
*/
|
|
565
581
|
"file-server": async (declaration, context) => {
|
|
566
582
|
if (declaration.kind !== "file-server") throw new WrongKind(declaration.kind);
|
|
583
|
+
const key = provideKey(declaration.id, "url");
|
|
584
|
+
const given = context.supplied?.[key];
|
|
585
|
+
if (given !== void 0) return { provides: { [key]: given } };
|
|
567
586
|
const parentUrl = context.provisioned[declaration.of]?.provides[provideKey(declaration.of, "url")];
|
|
568
587
|
if (!parentUrl) throw new UnresolvedParent(declaration.id, declaration.of);
|
|
569
588
|
const endpoint = new URL(parentUrl).searchParams.get("endpoint");
|
|
570
589
|
const bucket = new URL(parentUrl).hostname;
|
|
571
590
|
if (!endpoint) throw new UnresolvedParent(declaration.id, declaration.of);
|
|
572
|
-
return { provides: { [
|
|
591
|
+
return { provides: { [key]: `${endpoint}/${bucket}` } };
|
|
592
|
+
},
|
|
593
|
+
/**
|
|
594
|
+
* Mail: the stage's own SMTP server, or — allowed — Mailpit on the box.
|
|
595
|
+
*
|
|
596
|
+
* Every provider speaks SMTP, so the provider is whatever the stage's
|
|
597
|
+
* `<ID>_URL` names, with the address it sends from beside it. Only with
|
|
598
|
+
* `--allow-dev-services mailpit`, and only where the stage set no URL,
|
|
599
|
+
* does this run Mailpit — which catches every message and delivers none.
|
|
600
|
+
*/
|
|
601
|
+
email: async (declaration, context) => {
|
|
602
|
+
if (declaration.kind !== "email") throw new WrongKind(declaration.kind);
|
|
603
|
+
const key = provideKey(declaration.id, "url");
|
|
604
|
+
const from = provideKey(declaration.id, "from");
|
|
605
|
+
const given = context.supplied?.[key];
|
|
606
|
+
if (given !== void 0) return { provides: {
|
|
607
|
+
[key]: given,
|
|
608
|
+
[from]: supplied(declaration.id, from, context)
|
|
609
|
+
} };
|
|
610
|
+
if (!context.devServices?.includes("mailpit")) throw notConfigured(declaration.id, "email", context);
|
|
611
|
+
const service = serviceName({
|
|
612
|
+
stage: context.stage,
|
|
613
|
+
app: context.scope ?? context.project
|
|
614
|
+
}, declaration.id);
|
|
615
|
+
const { compose } = await context.api.findOrCreateCompose(service, context.projectId, context.environmentId, mailpitCompose(service));
|
|
616
|
+
await context.api.deployCompose(compose.composeId);
|
|
617
|
+
return { provides: {
|
|
618
|
+
[key]: `smtp://${service}:1025`,
|
|
619
|
+
[from]: context.supplied?.[from] ?? `noreply@${context.domain ?? "localhost"}`
|
|
620
|
+
} };
|
|
573
621
|
},
|
|
574
622
|
/**
|
|
575
623
|
* A topic, and below it a queue — the same broker either way.
|
|
@@ -807,6 +855,56 @@ function minioCompose(options) {
|
|
|
807
855
|
""
|
|
808
856
|
].join("\n");
|
|
809
857
|
}
|
|
858
|
+
/**
|
|
859
|
+
* A one-service compose file for Mailpit, on `dokploy-network` so the apps
|
|
860
|
+
* reach it by its service name. It accepts mail from anything on the network
|
|
861
|
+
* and delivers none of it.
|
|
862
|
+
*/
|
|
863
|
+
function mailpitCompose(service) {
|
|
864
|
+
return [
|
|
865
|
+
"services:",
|
|
866
|
+
` ${service}:`,
|
|
867
|
+
" image: axllent/mailpit:latest",
|
|
868
|
+
" environment:",
|
|
869
|
+
" MP_SMTP_AUTH_ACCEPT_ANY: '1'",
|
|
870
|
+
" MP_SMTP_AUTH_ALLOW_INSECURE: '1'",
|
|
871
|
+
" networks:",
|
|
872
|
+
" - dokploy-network",
|
|
873
|
+
"networks:",
|
|
874
|
+
" dokploy-network:",
|
|
875
|
+
" external: true",
|
|
876
|
+
""
|
|
877
|
+
].join("\n");
|
|
878
|
+
}
|
|
879
|
+
/**
|
|
880
|
+
* The S3 client's shared keys the stage set, for a bucket that is its own —
|
|
881
|
+
* none when it set none, since a bucket's URL may carry its own key.
|
|
882
|
+
*/
|
|
883
|
+
function storageKeys(values) {
|
|
884
|
+
const keys = {};
|
|
885
|
+
for (const key of [...STORAGE_KEY_PAIR, "AWS_REGION"]) {
|
|
886
|
+
const value = values?.[key];
|
|
887
|
+
if (value !== void 0) keys[key] = value;
|
|
888
|
+
}
|
|
889
|
+
return keys;
|
|
890
|
+
}
|
|
891
|
+
/**
|
|
892
|
+
* The error for a bucket or mail the stage configured nothing for — what
|
|
893
|
+
* `validate` already refused, should a provisioner be reached without it.
|
|
894
|
+
*/
|
|
895
|
+
function notConfigured(id, kind, context) {
|
|
896
|
+
const { missing } = externalServices({
|
|
897
|
+
stage: context.stage,
|
|
898
|
+
declarations: [{
|
|
899
|
+
id,
|
|
900
|
+
kind
|
|
901
|
+
}],
|
|
902
|
+
supplied: context.supplied ?? {},
|
|
903
|
+
allow: [],
|
|
904
|
+
...context.domain ? { domain: context.domain } : {}
|
|
905
|
+
});
|
|
906
|
+
return new ExternalServicesNotConfigured(context.stage, missing);
|
|
907
|
+
}
|
|
810
908
|
/** Whether anything reads through a reader on this construct. */
|
|
811
909
|
function readsFrom(manifest, id) {
|
|
812
910
|
return Object.values(manifest).some((declaration) => declaration.kind === "database-reader" && declaration.of === id);
|
|
@@ -995,6 +1093,8 @@ async function provisionDeclared(options) {
|
|
|
995
1093
|
cache: cacheBackendFor(providerOf(workspace)),
|
|
996
1094
|
events: eventsBackendFor(providerOf(workspace)),
|
|
997
1095
|
storage: storageBackendFor(providerOf(workspace)),
|
|
1096
|
+
...options.devServices ? { devServices: options.devServices } : {},
|
|
1097
|
+
...workspace.deploy?.domains?.[options.stage] ? { domain: workspace.deploy.domains[options.stage] } : {},
|
|
998
1098
|
addresses: surfaceAddresses(manifest, options.appUrls),
|
|
999
1099
|
seed: options.seed,
|
|
1000
1100
|
...options.supplied ? { supplied: options.supplied } : {},
|
|
@@ -1986,8 +2086,25 @@ async function validateDokploy(phase) {
|
|
|
1986
2086
|
secrets: phase.secrets,
|
|
1987
2087
|
ctx
|
|
1988
2088
|
};
|
|
2089
|
+
const stored = await phase.secrets.read();
|
|
2090
|
+
const services = assertExternalServices({
|
|
2091
|
+
stage,
|
|
2092
|
+
declarations: manifestServiceDeclarations(phase.manifest),
|
|
2093
|
+
supplied: stored?.custom ?? {},
|
|
2094
|
+
allow: phase.allowDevServices,
|
|
2095
|
+
...workspace.deploy?.domains?.[stage] ? { domain: workspace.deploy.domains[stage] } : {}
|
|
2096
|
+
});
|
|
2097
|
+
reportDevServices(phase, devServicesUsed(services));
|
|
2098
|
+
await assertStageCredentials({
|
|
2099
|
+
root: workspace.root,
|
|
2100
|
+
patterns: constructGlobs(workspace),
|
|
2101
|
+
manifest: phase.manifest,
|
|
2102
|
+
stage,
|
|
2103
|
+
supplied: stored?.custom ?? {}
|
|
2104
|
+
});
|
|
1989
2105
|
return {
|
|
1990
2106
|
...run,
|
|
2107
|
+
allowDevServices: phase.allowDevServices,
|
|
1991
2108
|
preflight: await preflight(run),
|
|
1992
2109
|
verify: verifySettings(workspace.deploy.dokploy?.verify),
|
|
1993
2110
|
atomic: phase.atomic,
|
|
@@ -2167,7 +2284,8 @@ async function provision(run) {
|
|
|
2167
2284
|
appUrls,
|
|
2168
2285
|
supplied: stageSecrets.custom,
|
|
2169
2286
|
seed: stageSecrets.seed,
|
|
2170
|
-
manifest
|
|
2287
|
+
manifest,
|
|
2288
|
+
devServices: run.allowDevServices
|
|
2171
2289
|
});
|
|
2172
2290
|
declaredEnv = declared.env;
|
|
2173
2291
|
declaredClusters = declared.clusters;
|
|
@@ -2985,4 +3103,4 @@ const MOBILE_SKIP_REASON = "deploys via its framework toolchain";
|
|
|
2985
3103
|
//#endregion
|
|
2986
3104
|
export { RegistryNotConfigured as _, dokployResult as a, releaseDokploy as c, validateDokploy as d, verifyDokploy as f, RegistryAmbiguous as g, HealthCheckTimedOut as h, dokployApi as i, restoreImage as l, DeployMigrationsFailed as m, FrontendDeployFailed as n, planDokploy as o, verifySettings as p, MissingEnvVars as r, provisionDokploy as s, BackendDeployFailed as t, rollbackDokploy as u, RegistryNotFound as v, ProjectNotOwned as y };
|
|
2987
3105
|
|
|
2988
|
-
//# sourceMappingURL=engine-
|
|
3106
|
+
//# sourceMappingURL=engine-62Kl70Pj.mjs.map
|