@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
|
@@ -2,9 +2,9 @@ const require_rolldown_runtime = require("./rolldown-runtime-C0BPl7ul.cjs");
|
|
|
2
2
|
const require_run = require("./run-fVZ-rLnc.cjs");
|
|
3
3
|
const require_discover = require("./discover-D1It5r_h.cjs");
|
|
4
4
|
const require_derive = require("./derive-DAbo49sm.cjs");
|
|
5
|
-
const require_workspace = require("./workspace-
|
|
5
|
+
const require_workspace = require("./workspace-DOm81oUo.cjs");
|
|
6
6
|
const require_define = require("./define-DzRz8FgH.cjs");
|
|
7
|
-
const
|
|
7
|
+
const require_stale = require("./stale-yu2FkH3G.cjs");
|
|
8
8
|
const require_SubscriberGenerator = require("./SubscriberGenerator-CajwOa5W.cjs");
|
|
9
9
|
const require_drivers = require("./drivers-BdvtCKc7.cjs");
|
|
10
10
|
const require_databases = require("./databases-C2p5LGAp.cjs");
|
|
@@ -496,9 +496,9 @@ function otlpHeaders(email, password) {
|
|
|
496
496
|
/** The stack's OpenObserve for one stage. */
|
|
497
497
|
function stackLogs(options) {
|
|
498
498
|
const { config, stage, local, custom } = options;
|
|
499
|
-
const conflicting = Object.keys(custom).filter(
|
|
499
|
+
const conflicting = Object.keys(custom).filter(require_stale.isOtlpDestination).sort();
|
|
500
500
|
if (conflicting.length > 0) throw new LogsEndpointConflict(stage, conflicting);
|
|
501
|
-
if (!local && !options.domain) throw new
|
|
501
|
+
if (!local && !options.domain) throw new require_stale.NoDomainForStage(stage);
|
|
502
502
|
const email = custom["ZO_ROOT_USER_EMAIL"] ?? (local ? "admin@gkm.localhost" : `admin@${options.domain}`);
|
|
503
503
|
const set = custom[LOGS_PASSWORD_KEY];
|
|
504
504
|
if (!set && !local) throw new LogsPasswordMissing(stage);
|
|
@@ -596,7 +596,7 @@ const REDIS_SERVICE = "redis";
|
|
|
596
596
|
/** The port it answers on, inside the network. */
|
|
597
597
|
const REDIS_PORT = 6379;
|
|
598
598
|
/** Reconcile's pin, so `gkm dev` and the stack run one Redis. */
|
|
599
|
-
const REDIS_IMAGE =
|
|
599
|
+
const REDIS_IMAGE = require_stale.DEFAULT_IMAGES.redis;
|
|
600
600
|
/**
|
|
601
601
|
* How much it may hold before it evicts. A cache that grows until the box
|
|
602
602
|
* runs out of memory takes the apps with it; 256 MB is a lot of sessions and
|
|
@@ -907,7 +907,7 @@ function composeStack(input) {
|
|
|
907
907
|
const custom = input.secrets?.custom ?? {};
|
|
908
908
|
const https = input.ports?.https ?? 443;
|
|
909
909
|
const http = input.ports?.http ?? 80;
|
|
910
|
-
const plan =
|
|
910
|
+
const plan = require_stale.planFor(manifest, stage, (0, _geekmidas_manifest.provisionOrder)(manifest), {
|
|
911
911
|
localStage: workspace.stages.local,
|
|
912
912
|
events: require_SubscriberGenerator.DEFAULT_EVENTS.server,
|
|
913
913
|
cache: STACK_CACHE,
|
|
@@ -917,7 +917,7 @@ function composeStack(input) {
|
|
|
917
917
|
const seed = local ? void 0 : input.secrets?.seed;
|
|
918
918
|
if (!local && !seed) throw new StageSeedMissing(stage);
|
|
919
919
|
const credential = {
|
|
920
|
-
master: local ? "geekmidas" :
|
|
920
|
+
master: local ? "geekmidas" : require_stale.localRolePassword(workspace.name, plan, "master", seed),
|
|
921
921
|
...seed ? { seed } : {}
|
|
922
922
|
};
|
|
923
923
|
const apps = stackApps(workspace, manifest, plan, {
|
|
@@ -927,7 +927,7 @@ function composeStack(input) {
|
|
|
927
927
|
identity,
|
|
928
928
|
images: input.images
|
|
929
929
|
});
|
|
930
|
-
const workers = stackWorkers(
|
|
930
|
+
const workers = stackWorkers(require_stale.workerUnits(workspace, manifest, input.background ?? {}), {
|
|
931
931
|
stage,
|
|
932
932
|
identity,
|
|
933
933
|
images: input.images
|
|
@@ -945,9 +945,9 @@ function composeStack(input) {
|
|
|
945
945
|
const reads = /* @__PURE__ */ new Map();
|
|
946
946
|
for (const app of apps) {
|
|
947
947
|
const site = manifest[app.id];
|
|
948
|
-
reads.set(app.name, site?.kind === "site" ? Object.values((0, _geekmidas_manifest.publicEnvFor)(site, manifest)) : [...
|
|
948
|
+
reads.set(app.name, site?.kind === "site" ? Object.values((0, _geekmidas_manifest.publicEnvFor)(site, manifest)) : [...require_stale.appEnvKeys(manifest, app.name, input.runnables) ?? []]);
|
|
949
949
|
}
|
|
950
|
-
for (const worker of workers) reads.set(worker.name, [...
|
|
950
|
+
for (const worker of workers) reads.set(worker.name, [...require_stale.workerEnvKeys(manifest, worker.id, input.runnables) ?? []]);
|
|
951
951
|
const domain = workspace.deploy?.domains?.[stage];
|
|
952
952
|
const logsConfig = require_workspace.resolveLogs(workspace.deploy?.compose?.logs);
|
|
953
953
|
const logs = logsConfig ? stackLogs({
|
|
@@ -963,7 +963,7 @@ function composeStack(input) {
|
|
|
963
963
|
missing: [],
|
|
964
964
|
minio: plan.resources.filter((r) => r.kind === "objects").map((r) => r.id),
|
|
965
965
|
mailpit: plan.resources.filter((r) => r.kind === "email").map((r) => r.id)
|
|
966
|
-
} :
|
|
966
|
+
} : require_stale.assertExternalServices({
|
|
967
967
|
stage,
|
|
968
968
|
declarations: serviceDeclarations(plan, reads, owners),
|
|
969
969
|
supplied: custom,
|
|
@@ -981,9 +981,9 @@ function composeStack(input) {
|
|
|
981
981
|
const buckets = services.minio.map((id) => byId.get(id)?.name).filter((name) => Boolean(name)).sort();
|
|
982
982
|
return {
|
|
983
983
|
user: custom.AWS_ACCESS_KEY_ID ?? (local ? "geekmidas" : `${workspace.name}-minio`),
|
|
984
|
-
password: custom.AWS_SECRET_ACCESS_KEY ?? (local ? "geekmidas" :
|
|
984
|
+
password: custom.AWS_SECRET_ACCESS_KEY ?? (local ? "geekmidas" : require_stale.localRolePassword(workspace.name, plan, "minio", seed)),
|
|
985
985
|
buckets,
|
|
986
|
-
policies:
|
|
986
|
+
policies: require_stale.bucketPolicies(plan).filter((p) => buckets.includes(p.bucket))
|
|
987
987
|
};
|
|
988
988
|
})() : void 0;
|
|
989
989
|
const derivation = {
|
|
@@ -992,11 +992,11 @@ function composeStack(input) {
|
|
|
992
992
|
...credential.seed ? { seed: credential.seed } : {},
|
|
993
993
|
...!local && domain ? { mailFrom: `noreply@${domain}` } : {}
|
|
994
994
|
};
|
|
995
|
-
const outside =
|
|
995
|
+
const outside = require_stale.networkEnv(plan, {
|
|
996
996
|
...derivation,
|
|
997
997
|
addresses: Object.fromEntries(apps.map((app) => [app.id, app.url]))
|
|
998
998
|
});
|
|
999
|
-
const inside =
|
|
999
|
+
const inside = require_stale.networkEnv(plan, {
|
|
1000
1000
|
...derivation,
|
|
1001
1001
|
addresses: Object.fromEntries(apps.map((app) => [app.id, `http://${app.name}:${app.port}`]))
|
|
1002
1002
|
});
|
|
@@ -1008,9 +1008,9 @@ function composeStack(input) {
|
|
|
1008
1008
|
const bucket = byId.get(resource.of);
|
|
1009
1009
|
if (!bucket) continue;
|
|
1010
1010
|
let host;
|
|
1011
|
-
if (local) host =
|
|
1011
|
+
if (local) host = require_stale.hostFor(resource, workspace.name);
|
|
1012
1012
|
else {
|
|
1013
|
-
if (!domain) throw new
|
|
1013
|
+
if (!domain) throw new require_stale.NoDomainForStage(stage);
|
|
1014
1014
|
host = `${resource.subdomain ?? require_derive.appKey(resource.id)}.${domain}`;
|
|
1015
1015
|
}
|
|
1016
1016
|
fileServers.set(resource.id, {
|
|
@@ -1034,7 +1034,7 @@ function composeStack(input) {
|
|
|
1034
1034
|
if (owner.kind === "file-server") return fileServers.get(owner.id)?.url;
|
|
1035
1035
|
return outside[key];
|
|
1036
1036
|
}
|
|
1037
|
-
if (owner &&
|
|
1037
|
+
if (owner && require_stale.suppliedOnly(owner.kind, owner.id, key, local)) {
|
|
1038
1038
|
const value = custom[key];
|
|
1039
1039
|
if (value === void 0) throw new StageSecretMissing(app.name, key, stage);
|
|
1040
1040
|
return value;
|
|
@@ -1074,7 +1074,7 @@ function composeStack(input) {
|
|
|
1074
1074
|
continue;
|
|
1075
1075
|
}
|
|
1076
1076
|
if (input.buildOnly) continue;
|
|
1077
|
-
const keys =
|
|
1077
|
+
const keys = require_stale.appEnvKeys(manifest, app.name, input.runnables) ?? /* @__PURE__ */ new Set();
|
|
1078
1078
|
const values = valuesFor(app, keys);
|
|
1079
1079
|
const trusted = (0, _geekmidas_manifest.provideKey)(app.id, "trustedOrigins");
|
|
1080
1080
|
if (keys.has(trusted)) {
|
|
@@ -1084,7 +1084,7 @@ function composeStack(input) {
|
|
|
1084
1084
|
}
|
|
1085
1085
|
app.env = {
|
|
1086
1086
|
...values,
|
|
1087
|
-
...
|
|
1087
|
+
...require_stale.otelEnv({
|
|
1088
1088
|
...custom,
|
|
1089
1089
|
...logs?.appEnv
|
|
1090
1090
|
}, app.name),
|
|
@@ -1095,14 +1095,14 @@ function composeStack(input) {
|
|
|
1095
1095
|
for (const [key, value] of Object.entries(app.env)) if (/[\r\n]/.test(value)) throw new EnvValueMultiline(app.name, key);
|
|
1096
1096
|
}
|
|
1097
1097
|
for (const worker of input.buildOnly ? [] : workers) {
|
|
1098
|
-
const keys =
|
|
1098
|
+
const keys = require_stale.workerEnvKeys(manifest, worker.id, input.runnables) ?? /* @__PURE__ */ new Set();
|
|
1099
1099
|
worker.env = {
|
|
1100
1100
|
...valuesFor({
|
|
1101
1101
|
name: worker.name,
|
|
1102
1102
|
id: worker.id,
|
|
1103
1103
|
kind: "rest-api"
|
|
1104
1104
|
}, keys),
|
|
1105
|
-
...
|
|
1105
|
+
...require_stale.otelEnv({
|
|
1106
1106
|
...custom,
|
|
1107
1107
|
...logs?.appEnv
|
|
1108
1108
|
}, worker.name),
|
|
@@ -1145,16 +1145,17 @@ function composeStack(input) {
|
|
|
1145
1145
|
const dockerfiles = {};
|
|
1146
1146
|
for (const app of apps) {
|
|
1147
1147
|
if (!app.build) continue;
|
|
1148
|
-
dockerfiles[app.build.dockerfile] =
|
|
1148
|
+
dockerfiles[app.build.dockerfile] = require_stale.appDockerfile(app.name, workspace.apps[app.name], {
|
|
1149
1149
|
layout,
|
|
1150
1150
|
workspaceRoot: workspace.root,
|
|
1151
|
+
apps: workspace.apps,
|
|
1151
1152
|
manifest,
|
|
1152
1153
|
cache: STACK_CACHE
|
|
1153
1154
|
});
|
|
1154
1155
|
}
|
|
1155
1156
|
for (const worker of workers) {
|
|
1156
1157
|
if (!worker.build) continue;
|
|
1157
|
-
dockerfiles[worker.build.dockerfile] =
|
|
1158
|
+
dockerfiles[worker.build.dockerfile] = require_stale.workerDockerfile({
|
|
1158
1159
|
id: worker.id,
|
|
1159
1160
|
name: worker.name,
|
|
1160
1161
|
app: worker.host
|
|
@@ -1177,7 +1178,7 @@ function composeStack(input) {
|
|
|
1177
1178
|
plan,
|
|
1178
1179
|
credential,
|
|
1179
1180
|
...storage ? { storage } : {},
|
|
1180
|
-
devServices: local ? [] :
|
|
1181
|
+
devServices: local ? [] : require_stale.devServicesUsed(services),
|
|
1181
1182
|
...logs ? { logs } : {},
|
|
1182
1183
|
...redis ? { redis } : {}
|
|
1183
1184
|
};
|
|
@@ -1238,7 +1239,7 @@ function stackApps(workspace, manifest, plan, options) {
|
|
|
1238
1239
|
if (!app || !resource || !app.port) continue;
|
|
1239
1240
|
const host = hostOf(name, app, workspace, resource, options);
|
|
1240
1241
|
const tag = declaration.kind === "site" ? siteTag(options.images.tag, options.stage) : options.images.tag;
|
|
1241
|
-
const ref =
|
|
1242
|
+
const ref = require_stale.validateImageRef(require_stale.imageRef(options.identity, name, options.images.registry, tag));
|
|
1242
1243
|
apps.push({
|
|
1243
1244
|
app: name,
|
|
1244
1245
|
name,
|
|
@@ -1262,8 +1263,8 @@ function stackWorkers(units, options) {
|
|
|
1262
1263
|
name: unit.name,
|
|
1263
1264
|
id: unit.id,
|
|
1264
1265
|
host: unit.app,
|
|
1265
|
-
port:
|
|
1266
|
-
ref:
|
|
1266
|
+
port: require_stale.WORKER_PORT,
|
|
1267
|
+
ref: require_stale.validateImageRef(require_stale.imageRef(options.identity, unit.name, options.images.registry, options.images.tag)),
|
|
1267
1268
|
tag: options.images.tag,
|
|
1268
1269
|
...options.images.mode === "build" ? { build: { dockerfile: `${stackDir(options.stage)}/Dockerfile.${unit.name}` } } : {}
|
|
1269
1270
|
}));
|
|
@@ -1274,19 +1275,19 @@ function stackWorkers(units, options) {
|
|
|
1274
1275
|
* same rule a deploy follows — for any other.
|
|
1275
1276
|
*/
|
|
1276
1277
|
function hostOf(name, app, workspace, resource, options) {
|
|
1277
|
-
if (options.local) return
|
|
1278
|
-
return
|
|
1278
|
+
if (options.local) return require_stale.hostFor(resource, workspace.name);
|
|
1279
|
+
return require_stale.resolveHost(name, app, options.stage, workspace.deploy?.domains, require_stale.isMainFrontendApp(name, app, workspace.apps));
|
|
1279
1280
|
}
|
|
1280
1281
|
/** The compose document: the infrastructure, the apps, and the edge. */
|
|
1281
1282
|
function stackFile(options) {
|
|
1282
1283
|
const { project, plan, apps } = options;
|
|
1283
1284
|
const infra = options.infra.filter((name) => name !== LOGS_SERVICE);
|
|
1284
|
-
const derived =
|
|
1285
|
+
const derived = require_stale.composeFor({
|
|
1285
1286
|
...plan,
|
|
1286
1287
|
containers: [...infra]
|
|
1287
1288
|
}, {
|
|
1288
1289
|
project,
|
|
1289
|
-
ports: Object.fromEntries(
|
|
1290
|
+
ports: Object.fromEntries(require_stale.portKeys(infra, plan.fakes).map((key) => [key, 0]))
|
|
1290
1291
|
});
|
|
1291
1292
|
const services = {};
|
|
1292
1293
|
const volumes = {
|
|
@@ -1324,7 +1325,7 @@ function stackFile(options) {
|
|
|
1324
1325
|
for (const app of apps) services[app.name] = {
|
|
1325
1326
|
image: app.ref,
|
|
1326
1327
|
...app.build ? { build: {
|
|
1327
|
-
...
|
|
1328
|
+
...require_stale.composeBuildPaths({
|
|
1328
1329
|
composeDir: options.composeDir,
|
|
1329
1330
|
buildRoot: options.buildRoot,
|
|
1330
1331
|
workspaceRoot: options.workspaceRoot,
|
|
@@ -1344,7 +1345,7 @@ function stackFile(options) {
|
|
|
1344
1345
|
};
|
|
1345
1346
|
for (const worker of options.workers) services[worker.name] = {
|
|
1346
1347
|
image: worker.ref,
|
|
1347
|
-
...worker.build ? { build:
|
|
1348
|
+
...worker.build ? { build: require_stale.composeBuildPaths({
|
|
1348
1349
|
composeDir: options.composeDir,
|
|
1349
1350
|
buildRoot: options.buildRoot,
|
|
1350
1351
|
workspaceRoot: options.workspaceRoot,
|
|
@@ -1359,7 +1360,7 @@ function stackFile(options) {
|
|
|
1359
1360
|
healthcheck: probe(worker.port, "/health")
|
|
1360
1361
|
};
|
|
1361
1362
|
services.caddy = {
|
|
1362
|
-
image:
|
|
1363
|
+
image: require_stale.DEFAULT_IMAGES.caddy,
|
|
1363
1364
|
restart: "unless-stopped",
|
|
1364
1365
|
ports: [`${options.https}:443`, `${options.http}:80`],
|
|
1365
1366
|
volumes: [
|
|
@@ -1402,7 +1403,7 @@ function defaultLayout(root) {
|
|
|
1402
1403
|
gkmRoot: ".",
|
|
1403
1404
|
tools: {
|
|
1404
1405
|
packageManager: "pnpm",
|
|
1405
|
-
turboVersion:
|
|
1406
|
+
turboVersion: require_stale.TURBO_VERSION,
|
|
1406
1407
|
monorepo: true
|
|
1407
1408
|
},
|
|
1408
1409
|
gkmPaths: ["gkm.config.*"]
|
|
@@ -1582,8 +1583,8 @@ function edgePorts(env = process.env) {
|
|
|
1582
1583
|
const defaultDeps = {
|
|
1583
1584
|
docker: dockerCompose,
|
|
1584
1585
|
revision: gitRevision,
|
|
1585
|
-
sql:
|
|
1586
|
-
buckets:
|
|
1586
|
+
sql: require_stale.pgClient,
|
|
1587
|
+
buckets: require_stale.bucketClient,
|
|
1587
1588
|
migrate: require_databases.migrateDatabases,
|
|
1588
1589
|
probe: httpsProbe,
|
|
1589
1590
|
healthAttempts: 90,
|
|
@@ -1603,24 +1604,31 @@ async function validateCompose(ctx, deps, options = {}) {
|
|
|
1603
1604
|
if (push && mode !== "build") throw new ComposePushNeedsBuild();
|
|
1604
1605
|
if (options.pin && mode !== "pull") throw new ComposePinNeedsPull();
|
|
1605
1606
|
const registry = workspace.deploy?.registry;
|
|
1606
|
-
if (!registry && (push || mode === "pull")) throw new RegistryRequired(push ? "push" : "pull",
|
|
1607
|
+
if (!registry && (push || mode === "pull")) throw new RegistryRequired(push ? "push" : "pull", require_stale.imageRef(identity, ctx.apps[0] ?? workspace.name, void 0, tag));
|
|
1607
1608
|
const runnables = {};
|
|
1608
1609
|
const background = {};
|
|
1609
1610
|
const manifest = await require_discover.discover({
|
|
1610
|
-
patterns:
|
|
1611
|
+
patterns: require_stale.constructGlobs(workspace),
|
|
1611
1612
|
cwd: root,
|
|
1612
1613
|
runnables,
|
|
1613
1614
|
background
|
|
1614
1615
|
});
|
|
1615
1616
|
const { secrets, generated } = await stageSecrets(ctx, manifest);
|
|
1616
|
-
if (!push)
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1617
|
+
if (!push) {
|
|
1618
|
+
require_stale.assertNoStaleSecrets({
|
|
1619
|
+
manifest,
|
|
1620
|
+
stage,
|
|
1621
|
+
supplied: secrets?.custom ?? {}
|
|
1622
|
+
});
|
|
1623
|
+
await require_credentialSchemas.assertStageCredentials({
|
|
1624
|
+
root,
|
|
1625
|
+
patterns: require_stale.constructGlobs(workspace),
|
|
1626
|
+
manifest,
|
|
1627
|
+
stage,
|
|
1628
|
+
supplied: secrets?.custom ?? {}
|
|
1629
|
+
});
|
|
1630
|
+
}
|
|
1631
|
+
const layout = mode === "build" ? require_stale.imageLayout(workspace) : void 0;
|
|
1624
1632
|
const composed = composeStack({
|
|
1625
1633
|
workspace,
|
|
1626
1634
|
manifest,
|
|
@@ -1639,7 +1647,7 @@ async function validateCompose(ctx, deps, options = {}) {
|
|
|
1639
1647
|
...layout ? { layout } : {},
|
|
1640
1648
|
...push ? { buildOnly: true } : {}
|
|
1641
1649
|
});
|
|
1642
|
-
|
|
1650
|
+
require_stale.reportDevServices(ctx, composed.devServices);
|
|
1643
1651
|
if (mode === "build") assertRedisClient(workspace, composed);
|
|
1644
1652
|
const stack = options.pin ? withPinnedImages(composed, options.pin.file, options.pin.digests) : composed;
|
|
1645
1653
|
if (mode === "pull" && !ctx.dryRun) await assertImagesExist(deps.docker, tag, [...stack.apps, ...stack.workers]);
|
|
@@ -1716,7 +1724,7 @@ async function stageSecrets(ctx, manifest) {
|
|
|
1716
1724
|
secrets: stored,
|
|
1717
1725
|
generated: []
|
|
1718
1726
|
};
|
|
1719
|
-
const withSeed =
|
|
1727
|
+
const withSeed = require_stale.withGeneratedSecrets(stored ?? require_stale.initStageSecrets(ctx.stage), manifest);
|
|
1720
1728
|
const withLogs = require_workspace.resolveLogs(ctx.workspace.deploy?.compose?.logs) ? withLogsPassword(withSeed.secrets) : {
|
|
1721
1729
|
secrets: withSeed.secrets,
|
|
1722
1730
|
generated: []
|
|
@@ -1854,7 +1862,7 @@ async function prepareBuckets(ctx, run, deps) {
|
|
|
1854
1862
|
if (storage.buckets.length === 0) return;
|
|
1855
1863
|
const port = await deps.docker.port(run.ref, "minio", 9e3);
|
|
1856
1864
|
const client = deps.buckets(port, storage);
|
|
1857
|
-
const created = [...await
|
|
1865
|
+
const created = [...await require_stale.applyBuckets(client, storage.buckets), ...await require_stale.applyPolicies(client, storage.policies)].filter((entry) => entry.created).length;
|
|
1858
1866
|
ctx.logger.info(`🪣 Buckets: ${storage.buckets.join(", ")}${created ? ` (${created} change(s))` : ""}`);
|
|
1859
1867
|
}
|
|
1860
1868
|
/** Create what the plan names in the stack's Postgres, then migrate it. */
|
|
@@ -1862,19 +1870,19 @@ async function prepareDatabases(ctx, run, deps) {
|
|
|
1862
1870
|
const { stack } = run;
|
|
1863
1871
|
const workspace = ctx.workspace;
|
|
1864
1872
|
const port = await deps.docker.port(run.ref, "postgres", 5432);
|
|
1865
|
-
const statements =
|
|
1873
|
+
const statements = require_stale.postgresStatements(stack.plan, workspace.name, stack.credential.seed);
|
|
1866
1874
|
if (statements.length > 0) {
|
|
1867
1875
|
ctx.logger.info("🗄️ Creating databases, roles and grants…");
|
|
1868
|
-
await
|
|
1876
|
+
await require_stale.applyPostgres(deps.sql(port, stack.credential.master), statements);
|
|
1869
1877
|
}
|
|
1870
1878
|
const sources = {};
|
|
1871
1879
|
const manifest = await require_discover.discover({
|
|
1872
|
-
patterns:
|
|
1880
|
+
patterns: require_stale.constructGlobs(workspace),
|
|
1873
1881
|
cwd: workspace.root,
|
|
1874
1882
|
sources
|
|
1875
1883
|
});
|
|
1876
|
-
const env =
|
|
1877
|
-
ports: { [
|
|
1884
|
+
const env = require_stale.envFor(stack.plan, {
|
|
1885
|
+
ports: { [require_stale.primaryPortKey("postgres")]: port },
|
|
1878
1886
|
project: workspace.name,
|
|
1879
1887
|
master: stack.credential.master,
|
|
1880
1888
|
...stack.credential.seed ? { seed: stack.credential.seed } : {}
|
|
@@ -1976,13 +1984,13 @@ async function releaseCompose(ctx, run, deps) {
|
|
|
1976
1984
|
* the tag resolved to.
|
|
1977
1985
|
*/
|
|
1978
1986
|
async function recordImages(ctx, run) {
|
|
1979
|
-
const journal = await
|
|
1987
|
+
const journal = await require_stale.DeployJournal.open(ctx.state, ctx.stage, () => require_stale.createEmptyState(ctx.stage, "", ""));
|
|
1980
1988
|
for (const app of [...run.stack.apps, ...run.stack.workers]) {
|
|
1981
1989
|
const image = run.images[app.app] ?? {
|
|
1982
1990
|
ref: app.ref,
|
|
1983
1991
|
tag: app.tag
|
|
1984
1992
|
};
|
|
1985
|
-
|
|
1993
|
+
require_stale.recordRelease(journal.state, app.app, image);
|
|
1986
1994
|
}
|
|
1987
1995
|
journal.state.identity = ctx.identity.key;
|
|
1988
1996
|
await journal.save();
|
|
@@ -2195,7 +2203,7 @@ async function writeStack(root, dir, stack) {
|
|
|
2195
2203
|
if (stack.redis && stack.compose.services["redis"]?.env_file) await write((0, node_path.join)(dir, `${REDIS_SERVICE}.env`), envFile(stack.redis.env), 384);
|
|
2196
2204
|
for (const entry of await (0, node_fs_promises.readdir)(dir)) if (entry.endsWith(".credentials")) await (0, node_fs_promises.rm)((0, node_path.join)(dir, entry));
|
|
2197
2205
|
for (const [path, content] of Object.entries(stack.dockerfiles)) await write((0, node_path.join)(root, path), content);
|
|
2198
|
-
await
|
|
2206
|
+
await require_stale.ensureDockerignore(require_stale.findBuildRoot(root));
|
|
2199
2207
|
return files;
|
|
2200
2208
|
}
|
|
2201
2209
|
function composeYaml(stack) {
|
|
@@ -2346,4 +2354,4 @@ Object.defineProperty(exports, "stackOverrideFile", {
|
|
|
2346
2354
|
}
|
|
2347
2355
|
});
|
|
2348
2356
|
|
|
2349
|
-
//# sourceMappingURL=compose-
|
|
2357
|
+
//# sourceMappingURL=compose-CePlrbUw.cjs.map
|