@geekmidas/cli 10.0.0-alpha.83 → 10.0.0-alpha.85
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{EndpointGenerator-DtnIGafh.mjs → EndpointGenerator-CVc6Oi1Y.mjs} +185 -82
- package/dist/EndpointGenerator-CVc6Oi1Y.mjs.map +1 -0
- package/dist/{EndpointGenerator-cKlnllIu.cjs → EndpointGenerator-CwLjBCFE.cjs} +203 -82
- package/dist/EndpointGenerator-CwLjBCFE.cjs.map +1 -0
- package/dist/{LegacyStateStore-DFO3aJgs.mjs → LegacyStateStore-CJ2o18nT.mjs} +2 -2
- package/dist/{LegacyStateStore-DFO3aJgs.mjs.map → LegacyStateStore-CJ2o18nT.mjs.map} +1 -1
- package/dist/{LegacyStateStore-iUWVxrXU.cjs → LegacyStateStore-xGxPwP-m.cjs} +2 -2
- package/dist/{LegacyStateStore-iUWVxrXU.cjs.map → LegacyStateStore-xGxPwP-m.cjs.map} +1 -1
- package/dist/{LocalStateStore-DIfuh0Z1.mjs → LocalStateStore-ByVjUIvS.mjs} +12 -10
- package/dist/LocalStateStore-ByVjUIvS.mjs.map +1 -0
- package/dist/{LocalStateStore-BsFHdSeA.cjs → LocalStateStore-CkjFD-4b.cjs} +11 -9
- package/dist/LocalStateStore-CkjFD-4b.cjs.map +1 -0
- package/dist/{OpenApiTsGenerator-CdUM6Hvv.cjs → OpenApiTsGenerator-B--HV-sW.cjs} +2 -2
- package/dist/{OpenApiTsGenerator-CdUM6Hvv.cjs.map → OpenApiTsGenerator-B--HV-sW.cjs.map} +1 -1
- package/dist/{OpenApiTsGenerator-ByRPMbBN.mjs → OpenApiTsGenerator-CkvsPdgg.mjs} +2 -2
- package/dist/{OpenApiTsGenerator-ByRPMbBN.mjs.map → OpenApiTsGenerator-CkvsPdgg.mjs.map} +1 -1
- package/dist/{S3StateStore-ytvpIiv8.cjs → S3StateStore-iqMezbES.cjs} +2 -2
- package/dist/{S3StateStore-ytvpIiv8.cjs.map → S3StateStore-iqMezbES.cjs.map} +1 -1
- package/dist/{S3StateStore-DR2f78Dj.mjs → S3StateStore-kpFlGVLE.mjs} +2 -2
- package/dist/{S3StateStore-DR2f78Dj.mjs.map → S3StateStore-kpFlGVLE.mjs.map} +1 -1
- package/dist/{SSMStateStore-BZ3XL0Mr.mjs → SSMStateStore-Bkz5ztfo.mjs} +2 -2
- package/dist/{SSMStateStore-BZ3XL0Mr.mjs.map → SSMStateStore-Bkz5ztfo.mjs.map} +1 -1
- package/dist/{SSMStateStore-C1JruCD9.cjs → SSMStateStore-Z2OMVCtq.cjs} +2 -2
- package/dist/{SSMStateStore-C1JruCD9.cjs.map → SSMStateStore-Z2OMVCtq.cjs.map} +1 -1
- package/dist/{SubscriberGenerator-DQZeGkDW.mjs → SubscriberGenerator-BPqQf8fB.mjs} +2 -2
- package/dist/{SubscriberGenerator-DQZeGkDW.mjs.map → SubscriberGenerator-BPqQf8fB.mjs.map} +1 -1
- package/dist/{SubscriberGenerator-CYriX5BV.cjs → SubscriberGenerator-BVn7cQ-2.cjs} +2 -2
- package/dist/{SubscriberGenerator-CYriX5BV.cjs.map → SubscriberGenerator-BVn7cQ-2.cjs.map} +1 -1
- package/dist/{add-Bwddb4KD.cjs → add-CM7RLj89.cjs} +3 -3
- package/dist/{add-Bwddb4KD.cjs.map → add-CM7RLj89.cjs.map} +1 -1
- package/dist/{add-DkBEZ5_s.mjs → add-jpX7M8RB.mjs} +3 -3
- package/dist/{add-DkBEZ5_s.mjs.map → add-jpX7M8RB.mjs.map} +1 -1
- package/dist/{bundler-B8TGsunu.mjs → bundler-CaAKsbcN.mjs} +5 -5
- package/dist/{bundler-B8TGsunu.mjs.map → bundler-CaAKsbcN.mjs.map} +1 -1
- package/dist/{bundler-BkH1kPEX.cjs → bundler-lEBH8ENP.cjs} +5 -5
- package/dist/{bundler-BkH1kPEX.cjs.map → bundler-lEBH8ENP.cjs.map} +1 -1
- package/dist/{cli-BgDd4cZB.mjs → cli-BV3jzbk0.mjs} +3 -3
- package/dist/{cli-BgDd4cZB.mjs.map → cli-BV3jzbk0.mjs.map} +1 -1
- package/dist/{cli-DO7DQqCq.cjs → cli-DQCBcNlN.cjs} +3 -3
- package/dist/{cli-DO7DQqCq.cjs.map → cli-DQCBcNlN.cjs.map} +1 -1
- package/dist/{compose-BPJ9bUKp.mjs → compose-CQK6StuE.mjs} +86 -28
- package/dist/compose-CQK6StuE.mjs.map +1 -0
- package/dist/{compose-CGyxYe-h.cjs → compose-CSR0yEJm.cjs} +85 -27
- package/dist/compose-CSR0yEJm.cjs.map +1 -0
- package/dist/{config-DMdzdO5u.d.cts → config-BzIfP8a-.d.cts} +16 -3
- package/dist/config-BzIfP8a-.d.cts.map +1 -0
- package/dist/{config-BBFiH4qk.d.mts → config-DhdzmndX.d.mts} +16 -3
- package/dist/config-DhdzmndX.d.mts.map +1 -0
- 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 +6 -6
- 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-0XpZDYAr.mjs → deploy-BuU117CA.mjs} +14 -5
- package/dist/deploy-BuU117CA.mjs.map +1 -0
- package/dist/{deploy-BlZx6J5x.cjs → deploy-Bw2Mm3x3.cjs} +14 -5
- package/dist/deploy-Bw2Mm3x3.cjs.map +1 -0
- package/dist/{dokploy-rjXmkuwH.cjs → dokploy-C81J1MVK.cjs} +2 -2
- package/dist/{dokploy-rjXmkuwH.cjs.map → dokploy-C81J1MVK.cjs.map} +1 -1
- package/dist/{dokploy-Crh4uDmP.mjs → dokploy-DWALWk7u.mjs} +2 -2
- package/dist/{dokploy-Crh4uDmP.mjs.map → dokploy-DWALWk7u.mjs.map} +1 -1
- package/dist/{drivers-B4RP2B2O.mjs → drivers-DTZzxeIl.mjs} +2 -2
- package/dist/{drivers-B4RP2B2O.mjs.map → drivers-DTZzxeIl.mjs.map} +1 -1
- package/dist/{drivers-CJx76mcb.cjs → drivers-LYSdQDmd.cjs} +2 -2
- package/dist/{drivers-CJx76mcb.cjs.map → drivers-LYSdQDmd.cjs.map} +1 -1
- package/dist/{encryption-CxTfRx4h.cjs → encryption-B8h8Tna0.cjs} +3 -3
- package/dist/{encryption-CxTfRx4h.cjs.map → encryption-B8h8Tna0.cjs.map} +1 -1
- package/dist/{encryption-0eo9aY_H.mjs → encryption-DpAum8W7.mjs} +3 -3
- package/dist/{encryption-0eo9aY_H.mjs.map → encryption-DpAum8W7.mjs.map} +1 -1
- package/dist/{engine-CMzSebbs.cjs → engine-B01fjhLt.cjs} +33 -13
- package/dist/engine-B01fjhLt.cjs.map +1 -0
- package/dist/{engine-DxWswfXe.mjs → engine-BXCtEhSH.mjs} +33 -13
- package/dist/engine-BXCtEhSH.mjs.map +1 -0
- package/dist/{github-HOfOpFI_.mjs → github-8B68qrLs.mjs} +3 -3
- package/dist/{github-HOfOpFI_.mjs.map → github-8B68qrLs.mjs.map} +1 -1
- package/dist/{github-Dukt5cJe.cjs → github-Cis9tYur.cjs} +3 -3
- package/dist/{github-Dukt5cJe.cjs.map → github-Cis9tYur.cjs.map} +1 -1
- package/dist/{index-Wuqpf316.d.mts → index-D1ODeM9s.d.cts} +2 -2
- package/dist/{index-DFrbhRwg.d.cts.map → index-D1ODeM9s.d.cts.map} +1 -1
- package/dist/{index-DFrbhRwg.d.cts → index-f77HdqN5.d.mts} +2 -2
- package/dist/{index-Wuqpf316.d.mts.map → index-f77HdqN5.d.mts.map} +1 -1
- package/dist/index.cjs +173 -70
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +173 -70
- package/dist/index.mjs.map +1 -1
- package/dist/{migrate-BgPWVnAZ.cjs → migrate-BBCp5blp.cjs} +3 -3
- package/dist/{migrate-BgPWVnAZ.cjs.map → migrate-BBCp5blp.cjs.map} +1 -1
- package/dist/{migrate-1dGEzuJ-.mjs → migrate-BeTWLSeC.mjs} +3 -3
- package/dist/{migrate-1dGEzuJ-.mjs.map → migrate-BeTWLSeC.mjs.map} +1 -1
- package/dist/{migrate-Bemd4tkz.cjs → migrate-CPWn7A51.cjs} +3 -3
- package/dist/{migrate-Bemd4tkz.cjs.map → migrate-CPWn7A51.cjs.map} +1 -1
- package/dist/{migrate-C14NNbFx.mjs → migrate-sDq7NApJ.mjs} +3 -3
- package/dist/{migrate-C14NNbFx.mjs.map → migrate-sDq7NApJ.mjs.map} +1 -1
- package/dist/openapi.cjs +3 -3
- package/dist/openapi.d.cts +1 -1
- package/dist/openapi.d.mts +1 -1
- package/dist/openapi.mjs +3 -3
- package/dist/{ready-4kx2pAhm.cjs → ready-BpNbORRB.cjs} +5 -5
- package/dist/{ready-4kx2pAhm.cjs.map → ready-BpNbORRB.cjs.map} +1 -1
- package/dist/{ready-DhZbZtFw.mjs → ready-b6vm0-W-.mjs} +5 -5
- package/dist/{ready-DhZbZtFw.mjs.map → ready-b6vm0-W-.mjs.map} +1 -1
- package/dist/reconcile/public.d.cts +1 -1
- package/dist/reconcile/public.d.mts +1 -1
- package/dist/{resolve-y1PkSZrF.mjs → resolve-CXbwJ_iu.mjs} +3 -3
- package/dist/{resolve-y1PkSZrF.mjs.map → resolve-CXbwJ_iu.mjs.map} +1 -1
- package/dist/{resolve-DCTcD823.cjs → resolve-CztIqBOI.cjs} +3 -3
- package/dist/{resolve-DCTcD823.cjs.map → resolve-CztIqBOI.cjs.map} +1 -1
- package/dist/{rollback-CwVhG_xa.mjs → rollback-ByyFE5lV.mjs} +5 -5
- package/dist/{rollback-CwVhG_xa.mjs.map → rollback-ByyFE5lV.mjs.map} +1 -1
- package/dist/{rollback-BVQFDjxr.cjs → rollback-CyIJ4xGJ.cjs} +5 -5
- package/dist/{rollback-BVQFDjxr.cjs.map → rollback-CyIJ4xGJ.cjs.map} +1 -1
- package/dist/{runtime-ekxfPNM-.d.mts → runtime-CNu2C2hB.d.mts} +2 -2
- package/dist/{runtime-D6A-C6zh.d.cts.map → runtime-CNu2C2hB.d.mts.map} +1 -1
- package/dist/{runtime-D6A-C6zh.d.cts → runtime-DMLgL26v.d.cts} +2 -2
- package/dist/{runtime-ekxfPNM-.d.mts.map → runtime-DMLgL26v.d.cts.map} +1 -1
- package/dist/{seeds-BoKQ74Od.mjs → seeds-9C5CkDon.mjs} +1736 -1613
- package/dist/seeds-9C5CkDon.mjs.map +1 -0
- package/dist/{seeds-Ccju3zGl.cjs → seeds-B_Beuv0o.cjs} +2583 -2418
- package/dist/seeds-B_Beuv0o.cjs.map +1 -0
- package/dist/{sniffer-DeyYI9Iv.cjs → sniffer-3fA0iExx.cjs} +6 -6
- package/dist/{sniffer-DeyYI9Iv.cjs.map → sniffer-3fA0iExx.cjs.map} +1 -1
- package/dist/{sniffer-6oYI-MpT.mjs → sniffer-DgBkaLAu.mjs} +6 -6
- package/dist/{sniffer-6oYI-MpT.mjs.map → sniffer-DgBkaLAu.mjs.map} +1 -1
- package/dist/{stages-CwrYVX9u.cjs → stages-CS1sjcRb.cjs} +2 -2
- package/dist/{stages-CwrYVX9u.cjs.map → stages-CS1sjcRb.cjs.map} +1 -1
- package/dist/{stages-CHF9RFog.mjs → stages-CSXt7N2b.mjs} +2 -2
- package/dist/{stages-CHF9RFog.mjs.map → stages-CSXt7N2b.mjs.map} +1 -1
- 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-BzCavjGt.d.mts → types-BZn-8ssD.d.mts} +75 -21
- package/dist/types-BZn-8ssD.d.mts.map +1 -0
- package/dist/{types-DZtj9jeI.d.cts → types-DiZj6hqp.d.cts} +75 -21
- package/dist/types-DiZj6hqp.d.cts.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 +3 -3
- package/dist/workspace/index.d.mts +3 -3
- package/dist/workspace/index.mjs +1 -1
- package/dist/{workspace-4i6Jwsoa.cjs → workspace-Bic_R3tz.cjs} +324 -98
- package/dist/workspace-Bic_R3tz.cjs.map +1 -0
- package/dist/{workspace-DD9mtPy8.mjs → workspace-Drz4jsvy.mjs} +305 -97
- package/dist/workspace-Drz4jsvy.mjs.map +1 -0
- package/package.json +15 -15
- package/dist/EndpointGenerator-DtnIGafh.mjs.map +0 -1
- package/dist/EndpointGenerator-cKlnllIu.cjs.map +0 -1
- package/dist/LocalStateStore-BsFHdSeA.cjs.map +0 -1
- package/dist/LocalStateStore-DIfuh0Z1.mjs.map +0 -1
- package/dist/compose-BPJ9bUKp.mjs.map +0 -1
- package/dist/compose-CGyxYe-h.cjs.map +0 -1
- package/dist/config-BBFiH4qk.d.mts.map +0 -1
- package/dist/config-DMdzdO5u.d.cts.map +0 -1
- package/dist/deploy-0XpZDYAr.mjs.map +0 -1
- package/dist/deploy-BlZx6J5x.cjs.map +0 -1
- package/dist/engine-CMzSebbs.cjs.map +0 -1
- package/dist/engine-DxWswfXe.mjs.map +0 -1
- package/dist/seeds-BoKQ74Od.mjs.map +0 -1
- package/dist/seeds-Ccju3zGl.cjs.map +0 -1
- package/dist/types-BzCavjGt.d.mts.map +0 -1
- package/dist/types-DZtj9jeI.d.cts.map +0 -1
- package/dist/workspace-4i6Jwsoa.cjs.map +0 -1
- package/dist/workspace-DD9mtPy8.mjs.map +0 -1
|
@@ -2,18 +2,18 @@ import { t as __exportAll } from "./rolldown-runtime-BhDjJH2R.mjs";
|
|
|
2
2
|
import { a as runOutput, i as run, s as gkmHome } from "./run-BJLIerMM.mjs";
|
|
3
3
|
import { r as discover } from "./discover-BPelzeGW.mjs";
|
|
4
4
|
import { t as appKey } from "./derive-B4vDpzgP.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { B as certificateFor, F as resolveStageTelemetry, L as telemetryEnv, P as otlpTelemetryEnv, R as LOGS_PORT, V as proxyFor, z as ComposeTlsFileMissing } from "./workspace-Drz4jsvy.mjs";
|
|
6
6
|
import { t as defineTarget } from "./define-DR8xGYfL.mjs";
|
|
7
|
-
import { $ as postgresSuperuser,
|
|
8
|
-
import { i as DEFAULT_EVENTS } from "./SubscriberGenerator-
|
|
9
|
-
import { i as installedFrom } from "./drivers-
|
|
7
|
+
import { $ as postgresSuperuser, At as WORKER_PORT, Bn as NoDomainForStage, Bt as composeFor, C as workerDockerfile, Ct as networkEnv, Dt as composeBuildPaths, Et as localRolePassword, Fn as LOGS_SERVICE, Gt as hostFor, Hn as resolveHost, I as reportDevServices, In as logsAccess, Jt as scopeTelemetryEnv, Ln as logsService, M as devServicesUsed, Mt as findBuildRoot, Ot as imageLayout, Q as loadLocalCredentials, Qt as DEFAULT_IMAGES, R as suppliedOnly, Rn as stackLogs, S as ensureDockerignore, T as validateImageRef, Tt as envFor, Ut as planFor, Vn as isMainFrontendApp, Vt as EMULATOR_ACCESS_KEY_ID, Xt as telemetryOf, Z as LOCAL_RABBITMQ_USER, Zt as usesTelemetry, _ as DeployJournal, _t as LEGACY_LOCAL_LOGIN, a as createEmptyState, at as runsRedis, b as appDockerfile, bt as pgClient, dt as applyPolicies, ft as applyPostgres, ht as postgresStatements, i as assertNoStaleSecrets, it as redisService, j as assertExternalServices, kn as initStageSecrets, kt as TURBO_VERSION, l as recordRelease, n as reportDatabaseRuns, nt as REDIS_SERVICE, ot as stackRedis, pt as bucketPolicies, q as constructGlobs, qt as isTelemetryKey, r as reportPlannedSeeds, rn as primaryPortKey, rt as STACK_CACHE, st as withRedisPassword, t as DeploySeedsFailed, tn as portKeys, tt as withGeneratedSecrets, ut as applyBuckets, vt as ensurePostgresLogin, wn as imageRef, wt as workerEnvKeys, xt as appEnvKeys, yt as bucketClient, z as workerUnits, zn as withLogsPassword } from "./seeds-9C5CkDon.mjs";
|
|
8
|
+
import { i as DEFAULT_EVENTS } from "./SubscriberGenerator-BPqQf8fB.mjs";
|
|
9
|
+
import { i as installedFrom } from "./drivers-DTZzxeIl.mjs";
|
|
10
10
|
import { f as plannedSeeds, o as SeedFailed, p as seedDatabases, u as migrateDatabases } from "./databases-CzszQV0N.mjs";
|
|
11
11
|
import { n as assertStageCredentials } from "./credentialSchemas-BJqRJNK4.mjs";
|
|
12
12
|
import { dirname, join } from "node:path";
|
|
13
13
|
import { existsSync } from "node:fs";
|
|
14
14
|
import { chmod, copyFile, mkdir, readFile, readdir, rename, rm, writeFile } from "node:fs/promises";
|
|
15
15
|
import { hostname, userInfo } from "node:os";
|
|
16
|
-
import { provideKey, provisionOrder, publicEnvFor } from "@geekmidas/manifest";
|
|
16
|
+
import { CLIENT_IP_HEADER, provideKey, provisionOrder, publicEnvFor } from "@geekmidas/manifest";
|
|
17
17
|
import { spawn } from "node:child_process";
|
|
18
18
|
import { createHash } from "node:crypto";
|
|
19
19
|
import { stringify } from "yaml";
|
|
@@ -434,8 +434,10 @@ function traefikDynamic(routes, options) {
|
|
|
434
434
|
const routers = {};
|
|
435
435
|
const services = {};
|
|
436
436
|
const middlewares = {};
|
|
437
|
+
const strip = `${project}-strip-gkm-headers`;
|
|
438
|
+
if (routes.length > 0) middlewares[strip] = { headers: { customRequestHeaders: { [CLIENT_IP_HEADER]: "" } } };
|
|
437
439
|
for (const route of routes) {
|
|
438
|
-
const chain = [];
|
|
440
|
+
const chain = [strip];
|
|
439
441
|
if (route.allow) {
|
|
440
442
|
middlewares[name(route, "allow")] = { ipAllowList: { sourceRange: [...route.allow] } };
|
|
441
443
|
chain.push(name(route, "allow"));
|
|
@@ -448,7 +450,7 @@ function traefikDynamic(routes, options) {
|
|
|
448
450
|
rule: `Host(\`${route.host}\`)`,
|
|
449
451
|
entryPoints: ["websecure"],
|
|
450
452
|
service: name(route),
|
|
451
|
-
|
|
453
|
+
middlewares: chain,
|
|
452
454
|
tls: tls.kind === "acme" ? { certResolver: ACME_RESOLVER } : {}
|
|
453
455
|
};
|
|
454
456
|
services[name(route)] = { loadBalancer: {
|
|
@@ -793,6 +795,18 @@ function pinImages(file, digests, images) {
|
|
|
793
795
|
}
|
|
794
796
|
//#endregion
|
|
795
797
|
//#region src/compose/caddyfile.ts
|
|
798
|
+
/**
|
|
799
|
+
* The stack's own edge, rendered for Caddy: one site block per route.
|
|
800
|
+
*
|
|
801
|
+
* Deployed, each host is the stage's real domain and Caddy gets it a
|
|
802
|
+
* certificate from Let's Encrypt on first request — the same automatic HTTPS
|
|
803
|
+
* it does anywhere, with nothing to configure but the name — or serves the
|
|
804
|
+
* stage's own certificate (`deploy.compose.tls`). Locally the hosts are
|
|
805
|
+
* `*.localhost` and the certificates come from Caddy's own CA, as the `gkm
|
|
806
|
+
* dev` edge does, so a local stack is `https://` like a deployed one.
|
|
807
|
+
*
|
|
808
|
+
* Pure: the routes are data (`routes.ts`), and rendering them is one string.
|
|
809
|
+
*/
|
|
796
810
|
/** Where Caddy reads a stage's own certificate, inside its container. */
|
|
797
811
|
const CADDY_TLS_DIR = "/etc/caddy/tls";
|
|
798
812
|
/** An upstream on the stack's own network: its service name. */
|
|
@@ -815,7 +829,11 @@ function edgeCaddyfile(routes, options) {
|
|
|
815
829
|
` : tls.kind === "files" ? `
|
|
816
830
|
tls ${tls.certFile} ${tls.keyFile}
|
|
817
831
|
` : "";
|
|
818
|
-
const blocks = routes.map(({ host, upstreams, prefix, allow, streaming }) => `https://${host} {${certificate}
|
|
832
|
+
const blocks = routes.map(({ host, upstreams, prefix, allow, streaming }) => `https://${host} {${certificate}
|
|
833
|
+
# gkm's own header, which only a service of this stack may send: the auth
|
|
834
|
+
# server rate-limits by the client address it carries.
|
|
835
|
+
request_header -${CLIENT_IP_HEADER}
|
|
836
|
+
${allow ? `
|
|
819
837
|
# Only these addresses — the peer Caddy sees, never a header a client
|
|
820
838
|
# could set. Everything else is refused before it reaches the upstream.
|
|
821
839
|
@denied not remote_ip ${allow.join(" ")}
|
|
@@ -880,6 +898,12 @@ const EDGE_PORT_ENV = {
|
|
|
880
898
|
http: "GKM_COMPOSE_HTTP_PORT"
|
|
881
899
|
};
|
|
882
900
|
/**
|
|
901
|
+
* The variable that moves the local stage's OpenObserve off its loopback
|
|
902
|
+
* port, 5080 — which the local stage takes from nowhere else, since it
|
|
903
|
+
* ignores `deploy.telemetry`. Another stack, or another tool, may hold 5080.
|
|
904
|
+
*/
|
|
905
|
+
const LOGS_PORT_ENV = "GKM_COMPOSE_LOGS_PORT";
|
|
906
|
+
/**
|
|
883
907
|
* Containers this target does not run.
|
|
884
908
|
*
|
|
885
909
|
* The AWS emulator never applies: a stack is a server target, whose events
|
|
@@ -956,6 +980,10 @@ function derivedCredentials(project, plan, seed) {
|
|
|
956
980
|
emulator: {
|
|
957
981
|
accessKeyId: EMULATOR_ACCESS_KEY_ID,
|
|
958
982
|
secretAccessKey: derive("emulator")
|
|
983
|
+
},
|
|
984
|
+
logs: {
|
|
985
|
+
email: `admin@${project}`,
|
|
986
|
+
password: derive("logs")
|
|
959
987
|
}
|
|
960
988
|
};
|
|
961
989
|
}
|
|
@@ -1084,9 +1112,20 @@ function composeStack(input) {
|
|
|
1084
1112
|
}
|
|
1085
1113
|
for (const worker of workers) reads.set(worker.name, [...workerEnvKeys(manifest, worker.id, input.runnables) ?? []]);
|
|
1086
1114
|
const domain = workspace.deploy?.domains?.[stage];
|
|
1087
|
-
const
|
|
1088
|
-
|
|
1089
|
-
|
|
1115
|
+
const telemetry = resolveStageTelemetry({
|
|
1116
|
+
...workspace.deploy?.telemetry ? { telemetry: workspace.deploy.telemetry } : {},
|
|
1117
|
+
stage,
|
|
1118
|
+
local,
|
|
1119
|
+
target: "compose",
|
|
1120
|
+
runtime: "server",
|
|
1121
|
+
selfHosted: true,
|
|
1122
|
+
used: usesTelemetry(manifest)
|
|
1123
|
+
});
|
|
1124
|
+
const logsBase = telemetry?.provider === "self-hosted" ? stackLogs({
|
|
1125
|
+
config: local && input.ports?.logs ? {
|
|
1126
|
+
...telemetry.selfHosted,
|
|
1127
|
+
port: input.ports.logs
|
|
1128
|
+
} : telemetry.selfHosted,
|
|
1090
1129
|
stage,
|
|
1091
1130
|
local,
|
|
1092
1131
|
project: workspace.name,
|
|
@@ -1113,7 +1152,7 @@ function composeStack(input) {
|
|
|
1113
1152
|
custom,
|
|
1114
1153
|
...local ? { localPassword: input.localCredentials.redis.password } : {}
|
|
1115
1154
|
});
|
|
1116
|
-
const infra = [...plan.containers.filter((c) => !NOT_RUN[c]).filter((c) => c !== "minio" || services.minio.length > 0).filter((c) => c !== "mailpit" || services.mailpit.length > 0).filter((c) => c !== "redis" || redis !== void 0), ...logsBase ? [LOGS_SERVICE] : []].sort();
|
|
1155
|
+
const infra = [...plan.containers.filter((c) => !NOT_RUN[c]).filter((c) => c !== LOGS_SERVICE).filter((c) => c !== "minio" || services.minio.length > 0).filter((c) => c !== "mailpit" || services.mailpit.length > 0).filter((c) => c !== "redis" || redis !== void 0), ...logsBase ? [LOGS_SERVICE] : []].sort();
|
|
1117
1156
|
const storage = infra.includes("minio") ? (() => {
|
|
1118
1157
|
const buckets = services.minio.map((id) => byId.get(id)?.name).filter((name) => Boolean(name)).sort();
|
|
1119
1158
|
return {
|
|
@@ -1199,10 +1238,15 @@ function composeStack(input) {
|
|
|
1199
1238
|
if (app.kind === "rest-api" && surface && surface !== app.id) return inside[key];
|
|
1200
1239
|
return outside[key];
|
|
1201
1240
|
};
|
|
1241
|
+
const telemetryValues = logs ? telemetryEnv({
|
|
1242
|
+
endpoint: logs.appEnv.OTEL_EXPORTER_OTLP_ENDPOINT,
|
|
1243
|
+
headers: logs.appEnv.OTEL_EXPORTER_OTLP_HEADERS
|
|
1244
|
+
}, telemetry?.sampleRate ?? 1) : telemetry?.provider === "otlp" ? otlpTelemetryEnv(telemetry) : void 0;
|
|
1202
1245
|
/** Each key one backend process reads, resolved for this stage. */
|
|
1203
1246
|
const valuesFor = (app, keys) => {
|
|
1204
1247
|
const values = {};
|
|
1205
1248
|
for (const key of [...keys].sort()) {
|
|
1249
|
+
if (isTelemetryKey(key)) continue;
|
|
1206
1250
|
const owner = owners.get(key) ?? storageOwner(key, plan);
|
|
1207
1251
|
if (!local && owner?.kind === "email" && key.endsWith("_INBOX_URL")) continue;
|
|
1208
1252
|
if (STORAGE_KEYS.includes(key)) {
|
|
@@ -1237,11 +1281,11 @@ function composeStack(input) {
|
|
|
1237
1281
|
values[trusted] = [...new Set(origins)].join(",");
|
|
1238
1282
|
}
|
|
1239
1283
|
app.env = {
|
|
1240
|
-
...values,
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
...
|
|
1244
|
-
}
|
|
1284
|
+
...scopeTelemetryEnv(values, {
|
|
1285
|
+
uses: telemetryOf(manifest, app.id) !== void 0,
|
|
1286
|
+
serviceName: app.name,
|
|
1287
|
+
...telemetryValues ? { telemetry: telemetryValues } : {}
|
|
1288
|
+
}),
|
|
1245
1289
|
NODE_ENV: "production",
|
|
1246
1290
|
PORT: String(app.port),
|
|
1247
1291
|
STAGE: stage
|
|
@@ -1251,15 +1295,15 @@ function composeStack(input) {
|
|
|
1251
1295
|
for (const worker of input.buildOnly ? [] : workers) {
|
|
1252
1296
|
const keys = workerEnvKeys(manifest, worker.id, input.runnables) ?? /* @__PURE__ */ new Set();
|
|
1253
1297
|
worker.env = {
|
|
1254
|
-
...valuesFor({
|
|
1298
|
+
...scopeTelemetryEnv(valuesFor({
|
|
1255
1299
|
name: worker.name,
|
|
1256
1300
|
id: worker.id,
|
|
1257
1301
|
kind: "rest-api"
|
|
1258
|
-
}, keys),
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
...
|
|
1262
|
-
}
|
|
1302
|
+
}, keys), {
|
|
1303
|
+
uses: telemetryOf(manifest, worker.id) !== void 0,
|
|
1304
|
+
serviceName: worker.name,
|
|
1305
|
+
...telemetryValues ? { telemetry: telemetryValues } : {}
|
|
1306
|
+
}),
|
|
1263
1307
|
NODE_ENV: "production",
|
|
1264
1308
|
PORT: String(worker.port),
|
|
1265
1309
|
STAGE: stage
|
|
@@ -1326,7 +1370,9 @@ function composeStack(input) {
|
|
|
1326
1370
|
workspaceRoot: workspace.root,
|
|
1327
1371
|
apps: workspace.apps,
|
|
1328
1372
|
manifest,
|
|
1329
|
-
cache: STACK_CACHE
|
|
1373
|
+
cache: STACK_CACHE,
|
|
1374
|
+
workspace,
|
|
1375
|
+
stage
|
|
1330
1376
|
});
|
|
1331
1377
|
}
|
|
1332
1378
|
for (const worker of workers) {
|
|
@@ -1362,6 +1408,7 @@ function composeStack(input) {
|
|
|
1362
1408
|
...storage ? { storage } : {},
|
|
1363
1409
|
devServices: local ? [] : devServicesUsed(services),
|
|
1364
1410
|
...logs ? { logs } : {},
|
|
1411
|
+
...telemetry ? { telemetry } : {},
|
|
1365
1412
|
...redis ? { redis } : {}
|
|
1366
1413
|
};
|
|
1367
1414
|
}
|
|
@@ -1767,9 +1814,11 @@ function edgePorts(env = process.env) {
|
|
|
1767
1814
|
if (!Number.isInteger(port) || port < 1 || port > 65535) throw new EdgePortInvalid(variable, value);
|
|
1768
1815
|
return port;
|
|
1769
1816
|
};
|
|
1817
|
+
const logs = env["GKM_COMPOSE_LOGS_PORT"] ? read(LOGS_PORT_ENV, 0) : void 0;
|
|
1770
1818
|
return {
|
|
1771
1819
|
https: read(EDGE_PORT_ENV.https, 443),
|
|
1772
|
-
http: read(EDGE_PORT_ENV.http, 80)
|
|
1820
|
+
http: read(EDGE_PORT_ENV.http, 80),
|
|
1821
|
+
...logs ? { logs } : {}
|
|
1773
1822
|
};
|
|
1774
1823
|
}
|
|
1775
1824
|
/**
|
|
@@ -1927,7 +1976,15 @@ async function stageSecrets(ctx, manifest) {
|
|
|
1927
1976
|
generated: []
|
|
1928
1977
|
};
|
|
1929
1978
|
const withSeed = withGeneratedSecrets(stored ?? initStageSecrets(ctx.stage), manifest);
|
|
1930
|
-
const withLogs =
|
|
1979
|
+
const withLogs = resolveStageTelemetry({
|
|
1980
|
+
...ctx.workspace.deploy?.telemetry ? { telemetry: ctx.workspace.deploy.telemetry } : {},
|
|
1981
|
+
stage: ctx.stage,
|
|
1982
|
+
local: false,
|
|
1983
|
+
target: "compose",
|
|
1984
|
+
runtime: "server",
|
|
1985
|
+
selfHosted: true,
|
|
1986
|
+
used: usesTelemetry(manifest)
|
|
1987
|
+
})?.provider === "self-hosted" ? withLogsPassword(withSeed.secrets) : {
|
|
1931
1988
|
secrets: withSeed.secrets,
|
|
1932
1989
|
generated: []
|
|
1933
1990
|
};
|
|
@@ -2565,7 +2622,8 @@ function composeTarget(options = {}) {
|
|
|
2565
2622
|
rollback: false,
|
|
2566
2623
|
migrations: "target",
|
|
2567
2624
|
images: true,
|
|
2568
|
-
localStage: true
|
|
2625
|
+
localStage: true,
|
|
2626
|
+
selfHostedTelemetry: true
|
|
2569
2627
|
},
|
|
2570
2628
|
credentials: [],
|
|
2571
2629
|
tag: ({ cwd }) => deps.revision(cwd),
|
|
@@ -2588,4 +2646,4 @@ function composeTarget(options = {}) {
|
|
|
2588
2646
|
//#endregion
|
|
2589
2647
|
export { stackOverrideFile as a, parseDigests as c, removeEdgeRoutes as d, EDGE_PROJECT as f, ComposePushNeedsBuild as i, pinnedRef as l, compose_exports as n, composeProject as o, dockerCompose as p, ComposePinNeedsPull as r, stackDir as s, composeTarget as t, edgeDir as u };
|
|
2590
2648
|
|
|
2591
|
-
//# sourceMappingURL=compose-
|
|
2649
|
+
//# sourceMappingURL=compose-CQK6StuE.mjs.map
|