@geekmidas/cli 10.0.0-alpha.75 → 10.0.0-alpha.77
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-BFnXUFlx.cjs → LegacyStateStore-DwngfJxr.cjs} +2 -2
- package/dist/{LegacyStateStore-BFnXUFlx.cjs.map → LegacyStateStore-DwngfJxr.cjs.map} +1 -1
- package/dist/{LegacyStateStore-cpt3K1vx.mjs → LegacyStateStore-dyq07_Ir.mjs} +2 -2
- package/dist/{LegacyStateStore-cpt3K1vx.mjs.map → LegacyStateStore-dyq07_Ir.mjs.map} +1 -1
- package/dist/{LocalStateStore-zQGZ9b4J.cjs → LocalStateStore-B0NCde8Z.cjs} +2 -2
- package/dist/{LocalStateStore-zQGZ9b4J.cjs.map → LocalStateStore-B0NCde8Z.cjs.map} +1 -1
- package/dist/{LocalStateStore-RH9F2ZEy.mjs → LocalStateStore-DLxCCatI.mjs} +2 -2
- package/dist/{LocalStateStore-RH9F2ZEy.mjs.map → LocalStateStore-DLxCCatI.mjs.map} +1 -1
- package/dist/{S3StateStore-CT-ZMlQY.cjs → S3StateStore-BOenb-3o.cjs} +2 -2
- package/dist/{S3StateStore-CT-ZMlQY.cjs.map → S3StateStore-BOenb-3o.cjs.map} +1 -1
- package/dist/{S3StateStore-DBeBc0c0.mjs → S3StateStore-CGK_4hlo.mjs} +2 -2
- package/dist/{S3StateStore-DBeBc0c0.mjs.map → S3StateStore-CGK_4hlo.mjs.map} +1 -1
- package/dist/{SSMStateStore-rnzNfOaV.mjs → SSMStateStore-B_5_RqY-.mjs} +2 -2
- package/dist/{SSMStateStore-rnzNfOaV.mjs.map → SSMStateStore-B_5_RqY-.mjs.map} +1 -1
- package/dist/{SSMStateStore-HmsH3c4v.cjs → SSMStateStore-DYeD__7p.cjs} +2 -2
- package/dist/{SSMStateStore-HmsH3c4v.cjs.map → SSMStateStore-DYeD__7p.cjs.map} +1 -1
- package/dist/{add-CHBin8TF.cjs → add-DCsgtvDk.cjs} +8 -8
- package/dist/{add-CHBin8TF.cjs.map → add-DCsgtvDk.cjs.map} +1 -1
- package/dist/{add-Cvzdw8cf.mjs → add-EPQO-_dt.mjs} +3 -3
- package/dist/{add-Cvzdw8cf.mjs.map → add-EPQO-_dt.mjs.map} +1 -1
- package/dist/{aws-DojzQnLd.mjs → aws-Bja4zGSs.mjs} +13 -9
- package/dist/aws-Bja4zGSs.mjs.map +1 -0
- package/dist/{aws-DkHdTV-p.cjs → aws-CQAuluiu.cjs} +13 -9
- package/dist/aws-CQAuluiu.cjs.map +1 -0
- package/dist/awsStore-7VmS_cZR.cjs +54 -0
- package/dist/awsStore-7VmS_cZR.cjs.map +1 -0
- package/dist/awsStore-B529csle.mjs +43 -0
- package/dist/awsStore-B529csle.mjs.map +1 -0
- package/dist/{bundler-_8AEZhrs.cjs → bundler-5spPyduN.cjs} +5 -5
- package/dist/bundler-5spPyduN.cjs.map +1 -0
- package/dist/{bundler-xjp5RwRS.mjs → bundler-DgO_EMVs.mjs} +5 -5
- package/dist/bundler-DgO_EMVs.mjs.map +1 -0
- package/dist/{cli-BTGfA0B7.mjs → cli-B74Ru-V1.mjs} +3 -3
- package/dist/{cli-BTGfA0B7.mjs.map → cli-B74Ru-V1.mjs.map} +1 -1
- package/dist/{cli-B4ktxAsM.cjs → cli-ZpFTMbGw.cjs} +4 -4
- package/dist/{cli-B4ktxAsM.cjs.map → cli-ZpFTMbGw.cjs.map} +1 -1
- package/dist/{compose-UKyv_1yU.cjs → compose-CePlrbUw.cjs} +68 -60
- package/dist/compose-CePlrbUw.cjs.map +1 -0
- package/dist/{compose-DdH2JQJD.mjs → compose-IUuxRW0J.mjs} +18 -10
- package/dist/compose-IUuxRW0J.mjs.map +1 -0
- package/dist/{config-DA0kRTQe.d.mts → config-Ckmoj56i.d.mts} +3 -3
- package/dist/{config-B38YWicj.d.cts.map → config-Ckmoj56i.d.mts.map} +1 -1
- package/dist/{config-B38YWicj.d.cts → config-aAeLXH86.d.cts} +3 -3
- package/dist/{config-DA0kRTQe.d.mts.map → config-aAeLXH86.d.cts.map} +1 -1
- package/dist/config.cjs +1 -1
- package/dist/config.d.cts +3 -3
- package/dist/config.d.mts +3 -3
- package/dist/config.mjs +1 -1
- package/dist/deploy/public.cjs +12 -12
- package/dist/deploy/public.d.cts +3 -3
- package/dist/deploy/public.d.cts.map +1 -1
- package/dist/deploy/public.d.mts +3 -3
- package/dist/deploy/public.d.mts.map +1 -1
- package/dist/deploy/public.mjs +6 -6
- package/dist/{deploy-CuSsiFIc.mjs → deploy-Q6X6RXRG.mjs} +5 -5
- package/dist/{deploy-CuSsiFIc.mjs.map → deploy-Q6X6RXRG.mjs.map} +1 -1
- package/dist/{deploy-XUZoA1us.cjs → deploy-XHXi-_tL.cjs} +11 -11
- package/dist/{deploy-XUZoA1us.cjs.map → deploy-XHXi-_tL.cjs.map} +1 -1
- package/dist/{dokploy-DZXTQX10.mjs → dokploy-BtP5XSrS.mjs} +2 -2
- package/dist/{dokploy-DZXTQX10.mjs.map → dokploy-BtP5XSrS.mjs.map} +1 -1
- package/dist/{dokploy-Cvgg_pID.cjs → dokploy-MSsPBO-t.cjs} +2 -2
- package/dist/{dokploy-Cvgg_pID.cjs.map → dokploy-MSsPBO-t.cjs.map} +1 -1
- package/dist/{encryption-JkeMPugf.mjs → encryption-D4Ykywfr.mjs} +3 -3
- package/dist/{encryption-JkeMPugf.mjs.map → encryption-D4Ykywfr.mjs.map} +1 -1
- package/dist/{encryption-w-Ehh9DW.cjs → encryption-DY0na43R.cjs} +6 -6
- package/dist/{encryption-w-Ehh9DW.cjs.map → encryption-DY0na43R.cjs.map} +1 -1
- package/dist/{engine-CmozkHxq.mjs → engine-BI2xjCKt.mjs} +9 -4
- package/dist/{engine-CmozkHxq.mjs.map → engine-BI2xjCKt.mjs.map} +1 -1
- package/dist/{engine-zpWBMsQq.cjs → engine-y53kE_3H.cjs} +73 -68
- package/dist/{engine-zpWBMsQq.cjs.map → engine-y53kE_3H.cjs.map} +1 -1
- package/dist/{github-BNngHoId.mjs → github-BBIqk1Jv.mjs} +6 -6
- package/dist/github-BBIqk1Jv.mjs.map +1 -0
- package/dist/{github-BGdJ-Lnm.cjs → github-Bmb45xUQ.cjs} +10 -10
- package/dist/github-Bmb45xUQ.cjs.map +1 -0
- package/dist/{index-vMidfqhU.d.cts → index-C7Tma2m1.d.cts} +2 -2
- package/dist/{index-B-1lLGzy.d.mts.map → index-C7Tma2m1.d.cts.map} +1 -1
- package/dist/{index-B-1lLGzy.d.mts → index-CNdSRwar.d.mts} +2 -2
- package/dist/{index-vMidfqhU.d.cts.map → index-CNdSRwar.d.mts.map} +1 -1
- package/dist/index.cjs +210 -221
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +141 -152
- package/dist/index.mjs.map +1 -1
- package/dist/migrate-31JXUOaG.cjs +93 -0
- package/dist/migrate-31JXUOaG.cjs.map +1 -0
- package/dist/{migrate-BLL1RTAj.mjs → migrate-BUBsUiM3.mjs} +3 -3
- package/dist/{migrate-BLL1RTAj.mjs.map → migrate-BUBsUiM3.mjs.map} +1 -1
- package/dist/migrate-DWVl5PQK.mjs +93 -0
- package/dist/migrate-DWVl5PQK.mjs.map +1 -0
- package/dist/{migrate-CgjlYeun.cjs → migrate-sny0NjKe.cjs} +8 -8
- package/dist/{migrate-CgjlYeun.cjs.map → migrate-sny0NjKe.cjs.map} +1 -1
- package/dist/openapi.cjs +16 -6
- package/dist/openapi.cjs.map +1 -1
- package/dist/openapi.d.cts +1 -1
- package/dist/openapi.d.cts.map +1 -1
- package/dist/openapi.d.mts +1 -1
- package/dist/openapi.d.mts.map +1 -1
- package/dist/openapi.mjs +16 -6
- package/dist/openapi.mjs.map +1 -1
- package/dist/reconcile/public.d.cts +1 -1
- package/dist/reconcile/public.d.mts +1 -1
- package/dist/{resolve-DZNx7rLy.mjs → resolve-BF1ICosS.mjs} +3 -3
- package/dist/{resolve-DZNx7rLy.mjs.map → resolve-BF1ICosS.mjs.map} +1 -1
- package/dist/{resolve-fevXn-wZ.cjs → resolve-DokLtTUb.cjs} +3 -3
- package/dist/{resolve-fevXn-wZ.cjs.map → resolve-DokLtTUb.cjs.map} +1 -1
- package/dist/{rollback-Dw-FW3X2.cjs → rollback-CpOWRR9H.cjs} +7 -7
- package/dist/{rollback-Dw-FW3X2.cjs.map → rollback-CpOWRR9H.cjs.map} +1 -1
- package/dist/{rollback-CLi5Pln_.mjs → rollback-sg0ZhKGG.mjs} +5 -5
- package/dist/{rollback-CLi5Pln_.mjs.map → rollback-sg0ZhKGG.mjs.map} +1 -1
- package/dist/{runtime-BzZD5HHi.d.cts → runtime-B5bYom9w.d.mts} +2 -2
- package/dist/{runtime-BzZD5HHi.d.cts.map → runtime-B5bYom9w.d.mts.map} +1 -1
- package/dist/{runtime-Cm6J6L7n.d.mts → runtime-BozOkPtG.d.cts} +2 -2
- package/dist/{runtime-Cm6J6L7n.d.mts.map → runtime-BozOkPtG.d.cts.map} +1 -1
- package/dist/secretsManager-DUXW3fQt.cjs +70 -0
- package/dist/secretsManager-DUXW3fQt.cjs.map +1 -0
- package/dist/secretsManager-Ti0oZwsS.mjs +70 -0
- package/dist/secretsManager-Ti0oZwsS.mjs.map +1 -0
- package/dist/{sniffer-BmCvVyhq.mjs → sniffer-DR8AlRCk.mjs} +17 -17
- package/dist/sniffer-DR8AlRCk.mjs.map +1 -0
- package/dist/{sniffer-bMzrX4cO.cjs → sniffer-Y6GQOCXB.cjs} +17 -17
- package/dist/sniffer-Y6GQOCXB.cjs.map +1 -0
- package/dist/{state-BrWIOce_.mjs → stale-DGzpiN5S.mjs} +270 -45
- package/dist/stale-DGzpiN5S.mjs.map +1 -0
- package/dist/{state-kA4Fkufx.cjs → stale-yu2FkH3G.cjs} +293 -44
- package/dist/stale-yu2FkH3G.cjs.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/{types-TzCChNrA.d.cts → types-B9yWJAis.d.mts} +59 -9
- package/dist/types-B9yWJAis.d.mts.map +1 -0
- package/dist/{types-Dp9lgx_S.d.mts → types-ct7pdQRf.d.cts} +60 -8
- package/dist/types-ct7pdQRf.d.cts.map +1 -0
- 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-vdrcRI-m.cjs → workspace-DOm81oUo.cjs} +54 -1
- package/dist/workspace-DOm81oUo.cjs.map +1 -0
- package/dist/{workspace-C7NqCsQF.mjs → workspace-QUTqYmVy.mjs} +43 -2
- package/dist/workspace-QUTqYmVy.mjs.map +1 -0
- package/package.json +16 -15
- package/dist/aws-DkHdTV-p.cjs.map +0 -1
- package/dist/aws-DojzQnLd.mjs.map +0 -1
- package/dist/bundler-_8AEZhrs.cjs.map +0 -1
- package/dist/bundler-xjp5RwRS.mjs.map +0 -1
- package/dist/compose-DdH2JQJD.mjs.map +0 -1
- package/dist/compose-UKyv_1yU.cjs.map +0 -1
- package/dist/github-BGdJ-Lnm.cjs.map +0 -1
- package/dist/github-BNngHoId.mjs.map +0 -1
- package/dist/sniffer-BmCvVyhq.mjs.map +0 -1
- package/dist/sniffer-bMzrX4cO.cjs.map +0 -1
- package/dist/state-BrWIOce_.mjs.map +0 -1
- package/dist/state-kA4Fkufx.cjs.map +0 -1
- package/dist/types-Dp9lgx_S.d.mts.map +0 -1
- package/dist/types-TzCChNrA.d.cts.map +0 -1
- package/dist/workspace-C7NqCsQF.mjs.map +0 -1
- package/dist/workspace-vdrcRI-m.cjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -4,20 +4,20 @@ import { r as DEFAULT_TIMEOUT_MS, t as CommandFailed } from "./run-BJLIerMM.mjs"
|
|
|
4
4
|
import { c as getDokployCredentials, f as removeDokployCredentials, i as LocalSandbox, l as getDokployRegistryId, m as storeHostingerToken, p as storeDokployCredentials, s as getCredentialsPath, u as getDokployToken } from "./credentials-pAtB70k3.mjs";
|
|
5
5
|
import { l as withOwningTsconfigJsx, r as discover, u as ConstructGenerator } from "./discover-BPelzeGW.mjs";
|
|
6
6
|
import { t as appKey } from "./derive-B4vDpzgP.mjs";
|
|
7
|
-
import { A as deployedProblems, D as InvalidStages, O as TEST_STAGE, c as getAppGkmConfig, j as stageProblems, n as allConstructGlobs, s as getAppBuildOrder } from "./workspace-
|
|
7
|
+
import { A as deployedProblems, D as InvalidStages, O as TEST_STAGE, c as getAppGkmConfig, j as stageProblems, n as allConstructGlobs, s as getAppBuildOrder } from "./workspace-QUTqYmVy.mjs";
|
|
8
8
|
import { ConfigNotFound, NotABackendApp, NotInAnApp, loadAppConfig, loadConfig, loadWorkspaceConfig, loadWorkspaceSettings, parseModuleConfig } from "./config.mjs";
|
|
9
|
-
import {
|
|
9
|
+
import { At as eventsBackendFor, Bt as findAvailablePort, Dt as imageBuildCredentials, Ft as fakeKey, G as workerEntryDir, H as workerUnits, Ht as loadEnvFiles, J as FAKE_ENV, K as QueueGenerator, Kt as secretsStoreFor, Lt as primaryPortKey, Ot as isImageBuild, Pt as describeServices, Q as reconcileWorkspace, Qt as projectKey, R as parseDevServices, Rt as createCredentialsPreload, U as WorkerGenerator, Ut as loadSecretsForApp, Vt as isPortAvailable, W as workerBundleName, Wt as prepareEntryCredentials, X as constructGlobs, Xt as getKeyPath, Y as backendsOf$1, Yt as FileSecretsStore, Z as derivedContainers, ct as quoteIdentifier, dn as toEmbeddableSecrets, dt as pgClient, et as LOCAL_CA_PATH, fn as withCustomSecret, jt as providerOf, kt as cacheBackendFor, ln as maskPassword, ot as postgresDatabaseNames, q as CronGenerator, tn as deployIdentity, tt as forgetState, y as dockerCommand, zt as createEntryWrapper } from "./stale-DGzpiN5S.mjs";
|
|
10
10
|
import { i as telemetryFor, n as runtimeFor, t as EndpointGenerator } from "./EndpointGenerator-DftalLYg.mjs";
|
|
11
|
-
import { g as createStateStore, n as sniffAppEnvironment, o as DokployApi, x as keyFingerprint } from "./sniffer-BmCvVyhq.mjs";
|
|
12
11
|
import { generateOpenApi, openapiCommand, resolveOpenApiConfig } from "./openapi.mjs";
|
|
13
12
|
import { s as isCacheBackend, t as SubscriberGenerator } from "./SubscriberGenerator-5looQ3gB.mjs";
|
|
14
13
|
import { a as describeHolder, i as assignAppPorts, o as holderOf, r as appTag, s as withAppPorts, t as APP_TAG_ENV } from "./appPorts-C9z9Pzn9.mjs";
|
|
15
14
|
import { n as driversFor, r as eventsBackendsIn, t as cacheBackendsIn } from "./drivers-Ch1rJitn.mjs";
|
|
16
15
|
import { n as withCompute, r as withRoutes, t as manifestModule } from "./emit-C1e8qD08.mjs";
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
16
|
+
import { g as createStateStore, n as sniffAppEnvironment, o as DokployApi, x as keyFingerprint } from "./sniffer-DR8AlRCk.mjs";
|
|
17
|
+
import { t as deploy$1 } from "./deploy-Q6X6RXRG.mjs";
|
|
18
|
+
import { a as stackOverrideFile, c as parseDigests, i as ComposePushNeedsBuild, l as pinnedRef, o as composeProject, r as ComposePinNeedsPull, s as stackDir, t as composeTarget, u as dockerCompose } from "./compose-IUuxRW0J.mjs";
|
|
19
19
|
import { o as loadCredentialSchemas, t as CredentialsInvalid } from "./credentialSchemas-BJqRJNK4.mjs";
|
|
20
|
-
import { t as LocalStateStore } from "./LocalStateStore-
|
|
20
|
+
import { t as LocalStateStore } from "./LocalStateStore-DLxCCatI.mjs";
|
|
21
21
|
import { a as getExecCommand, c as validateProjectName, i as findWorkspaceRoot, n as detectPackageManager$1, o as getInstallCommand, r as findWorkspacePackages, s as getRunCommand, t as checkDirectoryExists } from "./utils-D_fxUqvU.mjs";
|
|
22
22
|
import { a as writeTestHarness, i as TEST_MANIFEST_ENV, n as TEST_READY_FILE, t as TEST_READY_ENV } from "./ready-ZZoNskrr.mjs";
|
|
23
23
|
import { createRequire } from "node:module";
|
|
@@ -47,7 +47,7 @@ import crypto from "crypto";
|
|
|
47
47
|
import { Function } from "@geekmidas/constructs/functions";
|
|
48
48
|
import { Topic } from "@geekmidas/constructs/topic";
|
|
49
49
|
//#region package.json
|
|
50
|
-
var version = "10.0.0-alpha.
|
|
50
|
+
var version = "10.0.0-alpha.77";
|
|
51
51
|
//#endregion
|
|
52
52
|
//#region src/prompt.ts
|
|
53
53
|
/**
|
|
@@ -130,7 +130,7 @@ const logger$8 = console;
|
|
|
130
130
|
* Validate Dokploy token by making a test API call
|
|
131
131
|
*/
|
|
132
132
|
async function validateDokployToken(endpoint, token) {
|
|
133
|
-
const { DokployApi } = await import("./sniffer-
|
|
133
|
+
const { DokployApi } = await import("./sniffer-DR8AlRCk.mjs").then((n) => n.c);
|
|
134
134
|
return new DokployApi({
|
|
135
135
|
baseUrl: endpoint,
|
|
136
136
|
token
|
|
@@ -1527,10 +1527,10 @@ async function execCommand(commandArgs, options = {}) {
|
|
|
1527
1527
|
if (!commandArgs[0]) throw new NoCommandSpecified();
|
|
1528
1528
|
const defaultEnv = loadEnvFiles(".env");
|
|
1529
1529
|
if (defaultEnv.loaded.length > 0) logger$6.log(`📦 Loaded env: ${defaultEnv.loaded.join(", ")}`);
|
|
1530
|
-
const { credentials, secretsJsonPath, appName } = await prepareEntryCredentials({ cwd });
|
|
1530
|
+
const { credentials, secretsJsonPath, appName } = isImageBuild() ? await imageBuildEntry(cwd) : await prepareEntryCredentials({ cwd });
|
|
1531
1531
|
if (appName) logger$6.log(`📦 App: ${appName}`);
|
|
1532
1532
|
const secretCount = Object.keys(credentials).filter((k) => k !== "PORT").length;
|
|
1533
|
-
if (secretCount > 0) logger$6.log(`🔐 Loaded ${secretCount} secret(s)`);
|
|
1533
|
+
if (secretCount > 0 && !isImageBuild()) logger$6.log(`🔐 Loaded ${secretCount} secret(s)`);
|
|
1534
1534
|
const preloadDir = join(cwd, ".gkm");
|
|
1535
1535
|
await mkdir(preloadDir, { recursive: true });
|
|
1536
1536
|
const preloadPath = join(preloadDir, "credentials-preload.mjs");
|
|
@@ -1556,6 +1556,23 @@ async function execCommand(commandArgs, options = {}) {
|
|
|
1556
1556
|
});
|
|
1557
1557
|
if (exitCode !== 0) process.exit(exitCode);
|
|
1558
1558
|
}
|
|
1559
|
+
/**
|
|
1560
|
+
* `gkm exec` inside an image build: the public values the Dockerfile's build
|
|
1561
|
+
* args set, written where the preload reads them. No workspace is loaded, no
|
|
1562
|
+
* secret read and no address resolved.
|
|
1563
|
+
*/
|
|
1564
|
+
async function imageBuildEntry(cwd) {
|
|
1565
|
+
const credentials = imageBuildCredentials();
|
|
1566
|
+
logger$6.log(`🐳 Image build: ${Object.keys(credentials).length} public value(s) from the build args`);
|
|
1567
|
+
const dir = join(cwd, ".gkm");
|
|
1568
|
+
await mkdir(dir, { recursive: true });
|
|
1569
|
+
const secretsJsonPath = join(dir, "image-build-env.json");
|
|
1570
|
+
await writeFile(secretsJsonPath, JSON.stringify(credentials, null, 2));
|
|
1571
|
+
return {
|
|
1572
|
+
credentials,
|
|
1573
|
+
secretsJsonPath
|
|
1574
|
+
};
|
|
1575
|
+
}
|
|
1559
1576
|
//#endregion
|
|
1560
1577
|
//#region src/dev/index.ts
|
|
1561
1578
|
const logger$5 = console;
|
|
@@ -1688,7 +1705,7 @@ async function devCommand(options) {
|
|
|
1688
1705
|
let secretsJsonPath;
|
|
1689
1706
|
let publicUrl;
|
|
1690
1707
|
let manifest;
|
|
1691
|
-
const appSecrets = await loadSecretsForApp(workspace ? await secretsStoreFor(workspace, config.stages.local) : new FileSecretsStore(secretsRoot), config.stages.local
|
|
1708
|
+
const appSecrets = await loadSecretsForApp(workspace ? await secretsStoreFor(workspace, config.stages.local) : new FileSecretsStore(secretsRoot), config.stages.local);
|
|
1692
1709
|
if (workspace) {
|
|
1693
1710
|
const reconciled = await reconcileWorkspace(workspace, {
|
|
1694
1711
|
stage: workspace.stages.local,
|
|
@@ -2036,9 +2053,9 @@ async function workspaceDevCommand(configured, options) {
|
|
|
2036
2053
|
for (const { id, port } of fakes) logger$5.log(`🎭 ${id} fake: http://localhost:${port}`);
|
|
2037
2054
|
logger$5.log(options.migrate || options.seed ? "🗄️ Migrating the databases" : "🗄️ Checking for pending migrations");
|
|
2038
2055
|
if (options.migrate || options.seed) {
|
|
2039
|
-
const { prepareDevDatabases } = await import("./migrate-
|
|
2056
|
+
const { prepareDevDatabases } = await import("./migrate-BUBsUiM3.mjs");
|
|
2040
2057
|
await prepareDevDatabases(workspace, reconciled.env, { seed: !!options.seed });
|
|
2041
|
-
} else await import("./migrate-
|
|
2058
|
+
} else await import("./migrate-BUBsUiM3.mjs").then(({ reportPendingMigrations }) => reportPendingMigrations(workspace, reconciled.env)).catch((error) => {
|
|
2042
2059
|
logger$5.log(`⚠️ Could not check for pending migrations: ${error instanceof Error ? error.message : String(error)}`);
|
|
2043
2060
|
});
|
|
2044
2061
|
const appUrls = {};
|
|
@@ -3046,7 +3063,7 @@ async function buildApp(input) {
|
|
|
3046
3063
|
if (production?.bundle && !input.skipBundle) {
|
|
3047
3064
|
const outputDir = join(appRoot, ".gkm", "server");
|
|
3048
3065
|
const entryPoint = await writeSurfaceServer(outputDir, production);
|
|
3049
|
-
const { bundleServer } = await import("./bundler-
|
|
3066
|
+
const { bundleServer } = await import("./bundler-DgO_EMVs.mjs");
|
|
3050
3067
|
await bundleServer({
|
|
3051
3068
|
entryPoint,
|
|
3052
3069
|
outputDir: join(outputDir, "dist"),
|
|
@@ -3170,7 +3187,7 @@ async function buildWorkers(input) {
|
|
|
3170
3187
|
});
|
|
3171
3188
|
logger$4.log(`Generated worker ${worker.id}: ${crons.length} crons, ${queues.length} queues, ${subscribers.length} subscribers`);
|
|
3172
3189
|
if (!input.bundle) continue;
|
|
3173
|
-
const { bundleServer } = await import("./bundler-
|
|
3190
|
+
const { bundleServer } = await import("./bundler-DgO_EMVs.mjs");
|
|
3174
3191
|
const outfile = workerBundleName(worker.id);
|
|
3175
3192
|
await bundleServer({
|
|
3176
3193
|
entryPoint,
|
|
@@ -3240,7 +3257,7 @@ async function buildForTarget(target, context, appRoot, workspaceRoot, endpointG
|
|
|
3240
3257
|
let masterKey;
|
|
3241
3258
|
if (context.production?.bundle && !skipBundle) {
|
|
3242
3259
|
logger$4.log(`\n📦 Bundling production server...`);
|
|
3243
|
-
const { bundleServer } = await import("./bundler-
|
|
3260
|
+
const { bundleServer } = await import("./bundler-DgO_EMVs.mjs");
|
|
3244
3261
|
const allConstructs = [
|
|
3245
3262
|
...endpoints.map((e) => e.construct),
|
|
3246
3263
|
...functions.map((f) => f.construct),
|
|
@@ -4010,13 +4027,6 @@ const SERVICE_DEFAULTS = {
|
|
|
4010
4027
|
region: "us-east-1"
|
|
4011
4028
|
}
|
|
4012
4029
|
};
|
|
4013
|
-
/** Default credentials for pgboss (not a Docker service, reuses postgres) */
|
|
4014
|
-
const PGBOSS_DEFAULTS = {
|
|
4015
|
-
host: "localhost",
|
|
4016
|
-
port: 5432,
|
|
4017
|
-
username: "pgboss",
|
|
4018
|
-
database: "app"
|
|
4019
|
-
};
|
|
4020
4030
|
/**
|
|
4021
4031
|
* Generate credentials for a specific service.
|
|
4022
4032
|
*/
|
|
@@ -4056,14 +4066,6 @@ function generateMinioEndpoint(creds) {
|
|
|
4056
4066
|
return `http://${host}:${port}`;
|
|
4057
4067
|
}
|
|
4058
4068
|
/**
|
|
4059
|
-
* Generate connection URL for pg-boss (uses PostgreSQL protocol).
|
|
4060
|
-
* Format: pgboss://user:pass@host:port/db?schema=pgboss
|
|
4061
|
-
*/
|
|
4062
|
-
function generatePgBossUrl(creds) {
|
|
4063
|
-
const { username, password, host, port, database } = creds;
|
|
4064
|
-
return `pgboss://${username}:${encodeURIComponent(password)}@${host}:${port}/${database}?schema=pgboss`;
|
|
4065
|
-
}
|
|
4066
|
-
/**
|
|
4067
4069
|
* Generate connection URLs from service credentials.
|
|
4068
4070
|
*/
|
|
4069
4071
|
function generateConnectionUrls(services) {
|
|
@@ -4071,7 +4073,6 @@ function generateConnectionUrls(services) {
|
|
|
4071
4073
|
if (services.postgres) urls.DATABASE_URL = generatePostgresUrl(services.postgres);
|
|
4072
4074
|
if (services.redis) urls.REDIS_URL = generateRedisUrl(services.redis);
|
|
4073
4075
|
if (services.minio) urls.STORAGE_ENDPOINT = generateMinioEndpoint(services.minio);
|
|
4074
|
-
if (services.pgboss) urls.EVENT_PUBLISHER_CONNECTION_STRING = generatePgBossUrl(services.pgboss);
|
|
4075
4076
|
if (services.mailpit) {
|
|
4076
4077
|
urls.SMTP_HOST = services.mailpit.host;
|
|
4077
4078
|
urls.SMTP_PORT = String(services.mailpit.port);
|
|
@@ -4095,13 +4096,6 @@ function createStageSecrets(stage, services, options) {
|
|
|
4095
4096
|
serviceCredentials.minio.username = options.projectName;
|
|
4096
4097
|
}
|
|
4097
4098
|
}
|
|
4098
|
-
if (serviceCredentials.postgres && !serviceCredentials.pgboss) serviceCredentials.pgboss = {
|
|
4099
|
-
...PGBOSS_DEFAULTS,
|
|
4100
|
-
password: generateSecurePassword(),
|
|
4101
|
-
host: serviceCredentials.postgres.host,
|
|
4102
|
-
port: serviceCredentials.postgres.port,
|
|
4103
|
-
database: serviceCredentials.postgres.database
|
|
4104
|
-
};
|
|
4105
4099
|
return {
|
|
4106
4100
|
stage,
|
|
4107
4101
|
createdAt: now,
|
|
@@ -4964,25 +4958,25 @@ function loadPackageJson() {
|
|
|
4964
4958
|
* Run: pnpm --filter @geekmidas/cli sync-versions
|
|
4965
4959
|
*/
|
|
4966
4960
|
const GEEKMIDAS_VERSIONS = {
|
|
4967
|
-
"@geekmidas/audit": "~10.0.0-alpha.
|
|
4968
|
-
"@geekmidas/auth": "~10.0.0-alpha.
|
|
4969
|
-
"@geekmidas/cache": "~10.0.0-alpha.
|
|
4970
|
-
"@geekmidas/client": "~10.0.0-alpha.
|
|
4971
|
-
"@geekmidas/cloud": "~10.0.0-alpha.
|
|
4972
|
-
"@geekmidas/constructs": "~10.0.0-alpha.
|
|
4973
|
-
"@geekmidas/db": "~10.0.0-alpha.
|
|
4974
|
-
"@geekmidas/emailkit": "~10.0.0-alpha.
|
|
4975
|
-
"@geekmidas/envkit": "~10.0.0-alpha.
|
|
4976
|
-
"@geekmidas/errors": "~10.0.0-alpha.
|
|
4977
|
-
"@geekmidas/events": "~10.0.0-alpha.
|
|
4978
|
-
"@geekmidas/logger": "~10.0.0-alpha.
|
|
4979
|
-
"@geekmidas/manifest": "~10.0.0-alpha.
|
|
4980
|
-
"@geekmidas/rate-limit": "~10.0.0-alpha.
|
|
4981
|
-
"@geekmidas/schema": "~10.0.0-alpha.
|
|
4982
|
-
"@geekmidas/services": "~10.0.0-alpha.
|
|
4983
|
-
"@geekmidas/storage": "~10.0.0-alpha.
|
|
4984
|
-
"@geekmidas/telescope": "~10.0.0-alpha.
|
|
4985
|
-
"@geekmidas/testkit": "~10.0.0-alpha.
|
|
4961
|
+
"@geekmidas/audit": "~10.0.0-alpha.77",
|
|
4962
|
+
"@geekmidas/auth": "~10.0.0-alpha.77",
|
|
4963
|
+
"@geekmidas/cache": "~10.0.0-alpha.77",
|
|
4964
|
+
"@geekmidas/client": "~10.0.0-alpha.77",
|
|
4965
|
+
"@geekmidas/cloud": "~10.0.0-alpha.77",
|
|
4966
|
+
"@geekmidas/constructs": "~10.0.0-alpha.77",
|
|
4967
|
+
"@geekmidas/db": "~10.0.0-alpha.77",
|
|
4968
|
+
"@geekmidas/emailkit": "~10.0.0-alpha.77",
|
|
4969
|
+
"@geekmidas/envkit": "~10.0.0-alpha.77",
|
|
4970
|
+
"@geekmidas/errors": "~10.0.0-alpha.77",
|
|
4971
|
+
"@geekmidas/events": "~10.0.0-alpha.77",
|
|
4972
|
+
"@geekmidas/logger": "~10.0.0-alpha.77",
|
|
4973
|
+
"@geekmidas/manifest": "~10.0.0-alpha.77",
|
|
4974
|
+
"@geekmidas/rate-limit": "~10.0.0-alpha.77",
|
|
4975
|
+
"@geekmidas/schema": "~10.0.0-alpha.77",
|
|
4976
|
+
"@geekmidas/services": "~10.0.0-alpha.77",
|
|
4977
|
+
"@geekmidas/storage": "~10.0.0-alpha.77",
|
|
4978
|
+
"@geekmidas/telescope": "~10.0.0-alpha.77",
|
|
4979
|
+
"@geekmidas/testkit": "~10.0.0-alpha.77",
|
|
4986
4980
|
"@geekmidas/cli": `~${loadPackageJson().version}`
|
|
4987
4981
|
};
|
|
4988
4982
|
//#endregion
|
|
@@ -6827,7 +6821,6 @@ docker-compose.constructs.yml
|
|
|
6827
6821
|
.env
|
|
6828
6822
|
.env.local
|
|
6829
6823
|
.env.*.local
|
|
6830
|
-
docker/.env
|
|
6831
6824
|
|
|
6832
6825
|
# IDE
|
|
6833
6826
|
.idea/
|
|
@@ -7040,6 +7033,7 @@ function secretsStore(options) {
|
|
|
7040
7033
|
return `
|
|
7041
7034
|
// Deployed stages keep their secrets in SSM, in the account each stage
|
|
7042
7035
|
// deploys to: \`gkm secrets:set <KEY> '…' --stage <stage>\` writes there.
|
|
7036
|
+
// Past 8 KB a stage needs { provider: 'secrets-manager', region } instead.
|
|
7043
7037
|
store: { provider: 'ssm', region: '${options.region}' },`;
|
|
7044
7038
|
}
|
|
7045
7039
|
/**
|
|
@@ -9895,7 +9889,6 @@ async function initCommand(projectName, options = {}) {
|
|
|
9895
9889
|
};
|
|
9896
9890
|
if (isFullstack) {
|
|
9897
9891
|
customSecrets.AUTH_PORT = "3002";
|
|
9898
|
-
customSecrets.AUTH_URL = "http://localhost:3002";
|
|
9899
9892
|
customSecrets.BETTER_AUTH_SECRET = `better-auth-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
9900
9893
|
customSecrets.BETTER_AUTH_URL = "http://localhost:3002";
|
|
9901
9894
|
customSecrets.BETTER_AUTH_TRUSTED_ORIGINS = "http://localhost:3000,http://localhost:3001";
|
|
@@ -10059,27 +10052,18 @@ var NotAnAwsRegion = class extends Error {
|
|
|
10059
10052
|
//#endregion
|
|
10060
10053
|
//#region src/setup/fullstack-secrets.ts
|
|
10061
10054
|
/**
|
|
10062
|
-
* Generate a secure random password for database users.
|
|
10063
|
-
* Uses a combination of timestamp and random bytes for uniqueness.
|
|
10064
|
-
*/
|
|
10065
|
-
function generateDbPassword() {
|
|
10066
|
-
return `${Date.now().toString(36)}${Math.random().toString(36).slice(2)}${Math.random().toString(36).slice(2)}`;
|
|
10067
|
-
}
|
|
10068
|
-
/**
|
|
10069
|
-
* Generate database URL for an app.
|
|
10070
|
-
* All apps connect to the same database, but use different users/schemas.
|
|
10071
|
-
*/
|
|
10072
|
-
function generateDbUrl(appName, password, projectName, host = "localhost", port = 5432) {
|
|
10073
|
-
return `postgresql://${appName.replace(/-/g, "_")}:${password}@${host}:${port}/${`${projectName.replace(/-/g, "_")}_dev`}`;
|
|
10074
|
-
}
|
|
10075
|
-
/**
|
|
10076
10055
|
* Generate fullstack-aware custom secrets for a workspace.
|
|
10077
10056
|
*
|
|
10078
10057
|
* Generates:
|
|
10079
10058
|
* - Common secrets: PORT, LOG_LEVEL, JWT_SECRET (no `NODE_ENV` — the command
|
|
10080
10059
|
* decides that; see `gkm init`)
|
|
10081
|
-
* - Per-app database passwords and URLs for backend apps with db service
|
|
10082
10060
|
* - Better-auth secrets for apps using the better-auth framework
|
|
10061
|
+
*
|
|
10062
|
+
* No address of anything a construct declares — a database's or a tenant's
|
|
10063
|
+
* URL, a surface's or a site's. Those are derived from the construct, with
|
|
10064
|
+
* passwords from the stage, and one stored here would be a value set by hand,
|
|
10065
|
+
* which wins over the derived one: a `localhost` URL handed to a container,
|
|
10066
|
+
* with a password no role has.
|
|
10083
10067
|
*/
|
|
10084
10068
|
function generateFullstackCustomSecrets(workspace, containers = []) {
|
|
10085
10069
|
const hasDb = containers.includes("postgres");
|
|
@@ -10089,22 +10073,10 @@ function generateFullstackCustomSecrets(workspace, containers = []) {
|
|
|
10089
10073
|
JWT_SECRET: `dev-${Date.now()}-${Math.random().toString(36).slice(2)}`
|
|
10090
10074
|
};
|
|
10091
10075
|
if (!hasDb) return customs;
|
|
10092
|
-
const
|
|
10093
|
-
|
|
10094
|
-
if (appConfig.type === "web") {
|
|
10095
|
-
frontendPorts.push(appConfig.port);
|
|
10096
|
-
const upperName = appName.toUpperCase();
|
|
10097
|
-
customs[`${upperName}_URL`] = `http://localhost:${appConfig.port}`;
|
|
10098
|
-
continue;
|
|
10099
|
-
}
|
|
10100
|
-
if (appConfig.type === "mobile") continue;
|
|
10101
|
-
const password = generateDbPassword();
|
|
10102
|
-
const upperName = appName.toUpperCase();
|
|
10103
|
-
customs[`${upperName}_DATABASE_URL`] = generateDbUrl(appName, password, workspace.name);
|
|
10104
|
-
customs[`${upperName}_DB_PASSWORD`] = password;
|
|
10076
|
+
for (const appConfig of Object.values(workspace.apps)) {
|
|
10077
|
+
if (appConfig.type === "web" || appConfig.type === "mobile") continue;
|
|
10105
10078
|
if (appConfig.framework === "better-auth") {
|
|
10106
10079
|
customs.AUTH_PORT = String(appConfig.port);
|
|
10107
|
-
customs.AUTH_URL = `http://localhost:${appConfig.port}`;
|
|
10108
10080
|
customs.BETTER_AUTH_SECRET = `better-auth-${Date.now()}-${generateSecurePassword(16)}`;
|
|
10109
10081
|
customs.BETTER_AUTH_URL = `http://localhost:${appConfig.port}`;
|
|
10110
10082
|
}
|
|
@@ -10112,31 +10084,12 @@ function generateFullstackCustomSecrets(workspace, containers = []) {
|
|
|
10112
10084
|
if (customs.BETTER_AUTH_SECRET) customs.BETTER_AUTH_TRUSTED_ORIGINS = Object.values(workspace.apps).map((a) => a.port).map((p) => `http://localhost:${p}`).join(",");
|
|
10113
10085
|
return customs;
|
|
10114
10086
|
}
|
|
10115
|
-
/**
|
|
10116
|
-
* Extract *_DB_PASSWORD keys from secrets and write docker/.env.
|
|
10117
|
-
*
|
|
10118
|
-
* The docker/.env file contains database passwords that the PostgreSQL
|
|
10119
|
-
* init script reads to create per-app database users.
|
|
10120
|
-
*/
|
|
10121
|
-
async function writeDockerEnvFromSecrets(secrets, workspaceRoot) {
|
|
10122
|
-
const dbPasswordEntries = Object.entries(secrets.custom).filter(([key]) => key.endsWith("_DB_PASSWORD"));
|
|
10123
|
-
if (secrets.services.pgboss && !dbPasswordEntries.some(([key]) => key === "PGBOSS_DB_PASSWORD")) dbPasswordEntries.push(["PGBOSS_DB_PASSWORD", secrets.services.pgboss.password]);
|
|
10124
|
-
if (dbPasswordEntries.length === 0) return;
|
|
10125
|
-
const envContent = `# Auto-generated docker environment file
|
|
10126
|
-
# Contains database passwords for docker-compose postgres init
|
|
10127
|
-
# This file is gitignored - do not commit to version control
|
|
10128
|
-
${dbPasswordEntries.map(([key, value]) => `${key}=${value}`).join("\n")}
|
|
10129
|
-
`;
|
|
10130
|
-
const envPath = join(workspaceRoot, "docker", ".env");
|
|
10131
|
-
await mkdir(dirname(envPath), { recursive: true });
|
|
10132
|
-
await writeFile(envPath, envContent);
|
|
10133
|
-
}
|
|
10134
10087
|
//#endregion
|
|
10135
10088
|
//#region src/secrets/index.ts
|
|
10136
10089
|
const logger$2 = console;
|
|
10137
10090
|
/**
|
|
10138
|
-
* The store the stage named on the command line keeps its secrets in — SSM
|
|
10139
|
-
* its account, for a deployed stage kept there. Outside any workspace nothing
|
|
10091
|
+
* The store the stage named on the command line keeps its secrets in — SSM or
|
|
10092
|
+
* Secrets Manager in its account, for a deployed stage kept there. Outside any workspace nothing
|
|
10140
10093
|
* names a store, so it is the file.
|
|
10141
10094
|
*/
|
|
10142
10095
|
async function storeFor(stage) {
|
|
@@ -10217,6 +10170,47 @@ async function secretsSetCommand(key, value, options) {
|
|
|
10217
10170
|
await store.write(stage, withCustomSecret(secrets, key, secretValue));
|
|
10218
10171
|
logger$2.log(`\n✓ Secret "${key}" set for stage "${stage}" (${store.name})`);
|
|
10219
10172
|
}
|
|
10173
|
+
/** `gkm secrets:unset` for a key the stage does not hold. */
|
|
10174
|
+
var SecretNotSet = class extends Error {
|
|
10175
|
+
key;
|
|
10176
|
+
stage;
|
|
10177
|
+
constructor(key, stage) {
|
|
10178
|
+
super(`The stage '${stage}' holds no secret '${key}'. List what it holds with gkm secrets:show --stage ${stage}.`);
|
|
10179
|
+
this.key = key;
|
|
10180
|
+
this.stage = stage;
|
|
10181
|
+
this.name = "SecretNotSet";
|
|
10182
|
+
}
|
|
10183
|
+
};
|
|
10184
|
+
/** `gkm secrets:unset` on a stage that has no secrets at all. */
|
|
10185
|
+
var StageSecretsNotFound = class extends Error {
|
|
10186
|
+
stage;
|
|
10187
|
+
constructor(stage) {
|
|
10188
|
+
super(`The stage '${stage}' has no secrets, so there is nothing to remove.`);
|
|
10189
|
+
this.stage = stage;
|
|
10190
|
+
this.name = "StageSecretsNotFound";
|
|
10191
|
+
}
|
|
10192
|
+
};
|
|
10193
|
+
/**
|
|
10194
|
+
* Remove a custom secret from a stage, in the stage's own store — the file,
|
|
10195
|
+
* SSM or Secrets Manager. The rest of the stage is written back as it was.
|
|
10196
|
+
*
|
|
10197
|
+
* @throws {StageSecretsNotFound} when the stage holds no secrets
|
|
10198
|
+
* @throws {SecretNotSet} when it holds none by that key
|
|
10199
|
+
*/
|
|
10200
|
+
async function secretsUnsetCommand(key, options) {
|
|
10201
|
+
const { stage } = options;
|
|
10202
|
+
const store = await storeFor(stage);
|
|
10203
|
+
const secrets = await store.read(stage);
|
|
10204
|
+
if (!secrets) throw new StageSecretsNotFound(stage);
|
|
10205
|
+
if (!(key in secrets.custom)) throw new SecretNotSet(key, stage);
|
|
10206
|
+
const { [key]: _removed, ...custom } = secrets.custom;
|
|
10207
|
+
await store.write(stage, {
|
|
10208
|
+
...secrets,
|
|
10209
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
10210
|
+
custom
|
|
10211
|
+
});
|
|
10212
|
+
logger$2.log(`\n✓ Secret "${key}" removed from stage "${stage}" (${store.name})`);
|
|
10213
|
+
}
|
|
10220
10214
|
/**
|
|
10221
10215
|
* A third party's credentials, checked against the schema of the construct
|
|
10222
10216
|
* that reads them before they are stored — what the app would otherwise
|
|
@@ -10372,9 +10366,8 @@ const logger$1 = console;
|
|
|
10372
10366
|
*
|
|
10373
10367
|
* Orchestrates:
|
|
10374
10368
|
* 1. Load workspace config
|
|
10375
|
-
* 2. Resolve secrets (local →
|
|
10376
|
-
* 3.
|
|
10377
|
-
* 4. Start Docker services
|
|
10369
|
+
* 2. Resolve secrets (local → the stage's store → generate fresh)
|
|
10370
|
+
* 3. Start Docker services
|
|
10378
10371
|
*/
|
|
10379
10372
|
async function setupCommand(options = {}) {
|
|
10380
10373
|
logger$1.log("\n🔧 Setting up the local environment...\n");
|
|
@@ -10387,20 +10380,13 @@ async function setupCommand(options = {}) {
|
|
|
10387
10380
|
}
|
|
10388
10381
|
const stage = options.stage ?? loadedConfig.workspace.stages.local;
|
|
10389
10382
|
const { workspace } = loadedConfig;
|
|
10390
|
-
const isMultiApp = Object.keys(workspace.apps).length > 1;
|
|
10391
10383
|
logger$1.log(`📦 Workspace: ${workspace.name}`);
|
|
10392
10384
|
logger$1.log(`📱 Apps: ${Object.keys(workspace.apps).join(", ")}`);
|
|
10393
10385
|
logger$1.log(`🔑 Stage: ${stage}\n`);
|
|
10394
|
-
|
|
10395
|
-
if (!secrets) {
|
|
10386
|
+
if (!await resolveSecrets(stage, workspace, options)) {
|
|
10396
10387
|
logger$1.error("❌ Failed to resolve secrets. Exiting.");
|
|
10397
10388
|
process.exit(1);
|
|
10398
10389
|
}
|
|
10399
|
-
const containers = await derivedContainers(workspace, stage);
|
|
10400
|
-
if (isMultiApp && containers.includes("postgres")) {
|
|
10401
|
-
await writeDockerEnvFromSecrets(secrets, workspace.root);
|
|
10402
|
-
logger$1.log("📄 Generated docker/.env with database passwords");
|
|
10403
|
-
}
|
|
10404
10390
|
if (!options.skipDocker) {
|
|
10405
10391
|
logger$1.log("");
|
|
10406
10392
|
await reconcileLocal(workspace, stage, options);
|
|
@@ -10497,24 +10483,6 @@ function reconcileSecrets(secrets, workspace, containers = []) {
|
|
|
10497
10483
|
logger$1.log(` 🔄 Adding missing service credentials: ${name}`);
|
|
10498
10484
|
changed = true;
|
|
10499
10485
|
}
|
|
10500
|
-
if (result.services.postgres && !result.services.pgboss) {
|
|
10501
|
-
result = {
|
|
10502
|
-
...result,
|
|
10503
|
-
services: {
|
|
10504
|
-
...result.services,
|
|
10505
|
-
pgboss: {
|
|
10506
|
-
host: result.services.postgres.host,
|
|
10507
|
-
port: result.services.postgres.port,
|
|
10508
|
-
username: "pgboss",
|
|
10509
|
-
password: generateSecurePassword(),
|
|
10510
|
-
database: result.services.postgres.database ?? "app"
|
|
10511
|
-
}
|
|
10512
|
-
}
|
|
10513
|
-
};
|
|
10514
|
-
result.urls = generateConnectionUrls(result.services);
|
|
10515
|
-
logger$1.log(" 🔄 Adding missing service credentials: pgboss");
|
|
10516
|
-
changed = true;
|
|
10517
|
-
}
|
|
10518
10486
|
if (Object.keys(workspace.apps).length > 1) {
|
|
10519
10487
|
const expected = generateFullstackCustomSecrets(workspace, containers);
|
|
10520
10488
|
const missing = {};
|
|
@@ -10540,7 +10508,7 @@ function reconcileSecrets(secrets, workspace, containers = []) {
|
|
|
10540
10508
|
/**
|
|
10541
10509
|
* Build a fresh StageSecrets object for a workspace: service credentials,
|
|
10542
10510
|
* connection URLs, and custom secrets. Pure — does not write to disk or touch
|
|
10543
|
-
*
|
|
10511
|
+
* any store. Service passwords are freshly randomized, so the result must be the same
|
|
10544
10512
|
* one used to start the matching Docker containers.
|
|
10545
10513
|
* @internal Exported for reuse by `gkm test` auto-setup.
|
|
10546
10514
|
*/
|
|
@@ -10773,7 +10741,7 @@ function testDatabases(reconciled) {
|
|
|
10773
10741
|
* starts without the reference data the app needs.
|
|
10774
10742
|
*/
|
|
10775
10743
|
async function migrateTestStage(workspace, env) {
|
|
10776
|
-
const { migrateAndSeed } = await import("./migrate-
|
|
10744
|
+
const { migrateAndSeed } = await import("./migrate-BUBsUiM3.mjs");
|
|
10777
10745
|
const { discover } = await import("./discover-BPelzeGW.mjs").then((n) => n.i);
|
|
10778
10746
|
const sources = {};
|
|
10779
10747
|
const manifest = await discover({
|
|
@@ -11206,7 +11174,7 @@ program.command("migrate").description("Apply each database construct's migratio
|
|
|
11206
11174
|
try {
|
|
11207
11175
|
const globalOptions = program.opts();
|
|
11208
11176
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11209
|
-
const { migrateCommand } = await import("./migrate-
|
|
11177
|
+
const { migrateCommand } = await import("./migrate-BUBsUiM3.mjs");
|
|
11210
11178
|
await migrateCommand({
|
|
11211
11179
|
...options,
|
|
11212
11180
|
...construct ? { construct } : {}
|
|
@@ -11220,7 +11188,7 @@ program.command("seed").description("Migrate, then run each database construct's
|
|
|
11220
11188
|
try {
|
|
11221
11189
|
const globalOptions = program.opts();
|
|
11222
11190
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11223
|
-
const { seedCommand } = await import("./migrate-
|
|
11191
|
+
const { seedCommand } = await import("./migrate-BUBsUiM3.mjs");
|
|
11224
11192
|
await seedCommand({
|
|
11225
11193
|
...options,
|
|
11226
11194
|
...construct ? { construct } : {}
|
|
@@ -11234,7 +11202,7 @@ program.command("migration").description("Write a construct's next migration: an
|
|
|
11234
11202
|
try {
|
|
11235
11203
|
const globalOptions = program.opts();
|
|
11236
11204
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11237
|
-
const { migrationCommand } = await import("./migrate-
|
|
11205
|
+
const { migrationCommand } = await import("./migrate-BUBsUiM3.mjs");
|
|
11238
11206
|
await migrationCommand({
|
|
11239
11207
|
construct,
|
|
11240
11208
|
...name ? { name } : {}
|
|
@@ -11324,11 +11292,21 @@ program.command("secrets:set").description("Set a custom secret for a stage").ar
|
|
|
11324
11292
|
process.exit(1);
|
|
11325
11293
|
}
|
|
11326
11294
|
});
|
|
11295
|
+
program.command("secrets:unset").description("Remove a custom secret from a stage").argument("<key>", "Secret key (e.g., API_KEY)").requiredOption("--stage <stage>", "Stage name").action(async (key, options) => {
|
|
11296
|
+
try {
|
|
11297
|
+
const globalOptions = program.opts();
|
|
11298
|
+
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11299
|
+
await secretsUnsetCommand(key, options);
|
|
11300
|
+
} catch (error) {
|
|
11301
|
+
console.error(formatError(error));
|
|
11302
|
+
process.exit(1);
|
|
11303
|
+
}
|
|
11304
|
+
});
|
|
11327
11305
|
program.command("secrets:add").description("Build the keys a stage must be given — buckets, mail, file servers, third parties' credentials — across every app").requiredOption("--stage <stage>", "Stage name").option("--missing", "Only the keys the stage has not set").option("--json", "Print the keys as JSON and ask nothing").action(async (options) => {
|
|
11328
11306
|
try {
|
|
11329
11307
|
const globalOptions = program.opts();
|
|
11330
11308
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11331
|
-
const { secretsAddCommand } = await import("./add-
|
|
11309
|
+
const { secretsAddCommand } = await import("./add-EPQO-_dt.mjs");
|
|
11332
11310
|
await secretsAddCommand(options);
|
|
11333
11311
|
} catch (error) {
|
|
11334
11312
|
console.error(formatError(error));
|
|
@@ -11339,7 +11317,7 @@ program.command("encryption:rotate").description("Add a new current key to an En
|
|
|
11339
11317
|
try {
|
|
11340
11318
|
const globalOptions = program.opts();
|
|
11341
11319
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11342
|
-
const { encryptionRotateCommand } = await import("./encryption-
|
|
11320
|
+
const { encryptionRotateCommand } = await import("./encryption-D4Ykywfr.mjs");
|
|
11343
11321
|
await encryptionRotateCommand(construct, options);
|
|
11344
11322
|
} catch (error) {
|
|
11345
11323
|
console.error(formatError(error));
|
|
@@ -11350,7 +11328,7 @@ program.command("encryption:retire").description("Remove an old key from an Encr
|
|
|
11350
11328
|
try {
|
|
11351
11329
|
const globalOptions = program.opts();
|
|
11352
11330
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11353
|
-
const { encryptionRetireCommand } = await import("./encryption-
|
|
11331
|
+
const { encryptionRetireCommand } = await import("./encryption-D4Ykywfr.mjs");
|
|
11354
11332
|
await encryptionRetireCommand(construct, key, options);
|
|
11355
11333
|
} catch (error) {
|
|
11356
11334
|
console.error(formatError(error));
|
|
@@ -11393,7 +11371,7 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
|
|
|
11393
11371
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11394
11372
|
const { loadWorkspaceConfig } = await import("./config.mjs");
|
|
11395
11373
|
const { reconcileMissingSecrets } = await import("./reconcile--I7V4Klj.mjs");
|
|
11396
|
-
const { secretsStoreFor } = await import("./
|
|
11374
|
+
const { secretsStoreFor } = await import("./stale-DGzpiN5S.mjs").then((n) => n.Jt);
|
|
11397
11375
|
const { workspace } = await loadWorkspaceConfig();
|
|
11398
11376
|
const stage = options.stage ?? workspace.stages.local;
|
|
11399
11377
|
const store = await secretsStoreFor(workspace, stage);
|
|
@@ -11402,7 +11380,7 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
|
|
|
11402
11380
|
console.error(`No secrets found for stage "${stage}". Run "gkm secrets:init --stage ${stage}" first.`);
|
|
11403
11381
|
process.exit(1);
|
|
11404
11382
|
}
|
|
11405
|
-
const { derivedContainers } = await import("./
|
|
11383
|
+
const { derivedContainers } = await import("./stale-DGzpiN5S.mjs").then((n) => n.$);
|
|
11406
11384
|
const result = reconcileMissingSecrets(secrets, workspace, await derivedContainers(workspace, stage));
|
|
11407
11385
|
if (!result) {
|
|
11408
11386
|
console.log(`\n✓ Secrets for stage "${stage}" are up-to-date`);
|
|
@@ -11416,8 +11394,19 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
|
|
|
11416
11394
|
process.exit(1);
|
|
11417
11395
|
}
|
|
11418
11396
|
});
|
|
11397
|
+
program.command("secrets:migrate").description("Copy a deployed stage's secrets from the configured store to another (file, ssm, secrets-manager)").requiredOption("--stage <stage>", "A deployed stage").requiredOption("--to <provider>", "file, ssm or secrets-manager").option("--region <region>", "The target's AWS region (default: the configured store's)").option("--profile <profile>", "AWS profile for the stage's account").option("--force", "Replace a stage the target already holds").action(async (options) => {
|
|
11398
|
+
try {
|
|
11399
|
+
const globalOptions = program.opts();
|
|
11400
|
+
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11401
|
+
const { secretsMigrateCommand } = await import("./migrate-DWVl5PQK.mjs");
|
|
11402
|
+
await secretsMigrateCommand(options);
|
|
11403
|
+
} catch (error) {
|
|
11404
|
+
console.error(formatError(error));
|
|
11405
|
+
process.exit(1);
|
|
11406
|
+
}
|
|
11407
|
+
});
|
|
11419
11408
|
program.command("deploy").description("Deploy a stage through its target").option("--target <name>", "Deploy target: dokploy, compose, sst, or one named in deploy.targets (default: deploy.default)").option("--provider <provider>", "[DEPRECATED] Use --target instead").requiredOption("--stage <stage>", "Deployment stage (e.g., production, staging)").option("--tag <tag>", "Image tag (default: stage-timestamp; compose: the commit). Compose pulls a given tag").option("--skip-push", "Skip pushing image to registry").option("--skip-build", "Skip build step (use existing build)").option("--json", "Write events as JSON lines instead of progress; never prompts").option("--dry-run", "Show what would be created or reused; change, build and push nothing").option("--atomic", "If the release fails, roll back every app it released, not only the failed ones").option("--allow-dev-services <list>", "Server targets: run MinIO and/or Mailpit (minio,mailpit) for mail and buckets the stage's secrets don't configure. Not production-grade").action(async (options) => {
|
|
11420
|
-
const { deployCli } = await import("./cli-
|
|
11409
|
+
const { deployCli } = await import("./cli-B74Ru-V1.mjs");
|
|
11421
11410
|
const globalOptions = program.opts();
|
|
11422
11411
|
const code = await deployCli({
|
|
11423
11412
|
cwd: resolve(globalOptions.cwd ?? process.cwd()),
|
|
@@ -11434,7 +11423,7 @@ program.command("deploy").description("Deploy a stage through its target").optio
|
|
|
11434
11423
|
});
|
|
11435
11424
|
program.command("deploy:rollback").description("Put a stage's app back on its previous release (Dokploy): one app with --app, every app with --atomic").requiredOption("--stage <stage>", "A deployed stage").option("--app <app>", "The app to roll back").option("--atomic", "Roll back every app that has an earlier release").action(async (options) => {
|
|
11436
11425
|
try {
|
|
11437
|
-
const { rollbackStage } = await import("./rollback-
|
|
11426
|
+
const { rollbackStage } = await import("./rollback-sg0ZhKGG.mjs").then((n) => n.a);
|
|
11438
11427
|
const { terminalCredentials } = await import("./terminal-BdvrmkaC.mjs");
|
|
11439
11428
|
const globalOptions = program.opts();
|
|
11440
11429
|
await rollbackStage({
|
|
@@ -11470,7 +11459,7 @@ program.command("deploy:github").description("Let GitHub Actions deploy a stage:
|
|
|
11470
11459
|
try {
|
|
11471
11460
|
const globalOptions = program.opts();
|
|
11472
11461
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11473
|
-
const { deployGithubCommand } = await import("./github-
|
|
11462
|
+
const { deployGithubCommand } = await import("./github-BBIqk1Jv.mjs");
|
|
11474
11463
|
await deployGithubCommand(options);
|
|
11475
11464
|
} catch (error) {
|
|
11476
11465
|
console.error(formatError(error));
|