@geekmidas/cli 10.0.0-alpha.185 → 10.0.0-alpha.187
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-BtN83gfS.cjs → LegacyStateStore-B3kv1Dlb.cjs} +2 -2
- package/dist/{LegacyStateStore-BtN83gfS.cjs.map → LegacyStateStore-B3kv1Dlb.cjs.map} +1 -1
- package/dist/{LegacyStateStore-DKyEAWGI.mjs → LegacyStateStore-BYJwVE8_.mjs} +2 -2
- package/dist/{LegacyStateStore-DKyEAWGI.mjs.map → LegacyStateStore-BYJwVE8_.mjs.map} +1 -1
- package/dist/{LocalStateStore-Dc3aGvQi.mjs → LocalStateStore-CIT6SyRe.mjs} +2 -2
- package/dist/{LocalStateStore-Dc3aGvQi.mjs.map → LocalStateStore-CIT6SyRe.mjs.map} +1 -1
- package/dist/{LocalStateStore-BFh6rPhX.cjs → LocalStateStore-D7QcuAVb.cjs} +2 -2
- package/dist/{LocalStateStore-BFh6rPhX.cjs.map → LocalStateStore-D7QcuAVb.cjs.map} +1 -1
- package/dist/{S3StateStore-p6DyuAFZ.mjs → S3StateStore-BufODsIW.mjs} +4 -4
- package/dist/{S3StateStore-p6DyuAFZ.mjs.map → S3StateStore-BufODsIW.mjs.map} +1 -1
- package/dist/{S3StateStore-DZMpqbvD.cjs → S3StateStore-DenzHSZI.cjs} +4 -4
- package/dist/{S3StateStore-DZMpqbvD.cjs.map → S3StateStore-DenzHSZI.cjs.map} +1 -1
- package/dist/{SSMStateStore-sbaLlCmj.cjs → SSMStateStore-BcsFXUE4.cjs} +2 -2
- package/dist/{SSMStateStore-sbaLlCmj.cjs.map → SSMStateStore-BcsFXUE4.cjs.map} +1 -1
- package/dist/{SSMStateStore-BvH8XX4O.mjs → SSMStateStore-DK8GsGGP.mjs} +2 -2
- package/dist/{SSMStateStore-BvH8XX4O.mjs.map → SSMStateStore-DK8GsGGP.mjs.map} +1 -1
- package/dist/{add-CdVGxiKW.cjs → add-BWr0-iEz.cjs} +3 -3
- package/dist/{add-CdVGxiKW.cjs.map → add-BWr0-iEz.cjs.map} +1 -1
- package/dist/{add-dOvgsAU6.mjs → add-Bp-Rr-CO.mjs} +3 -3
- package/dist/{add-dOvgsAU6.mjs.map → add-Bp-Rr-CO.mjs.map} +1 -1
- package/dist/{bundler-B5ioF-1Q.cjs → bundler-Cox-23P6.cjs} +6 -6
- package/dist/{bundler-B5ioF-1Q.cjs.map → bundler-Cox-23P6.cjs.map} +1 -1
- package/dist/{bundler-Cvx6Bt3e.mjs → bundler-aW-QiGWN.mjs} +6 -6
- package/dist/{bundler-Cvx6Bt3e.mjs.map → bundler-aW-QiGWN.mjs.map} +1 -1
- package/dist/{cli-BjapgcXG.mjs → cli-BsiXqFrT.mjs} +4 -4
- package/dist/{cli-BjapgcXG.mjs.map → cli-BsiXqFrT.mjs.map} +1 -1
- package/dist/{cli-PLhqvPOC.cjs → cli-Crhs1fmo.cjs} +4 -4
- package/dist/{cli-PLhqvPOC.cjs.map → cli-Crhs1fmo.cjs.map} +1 -1
- package/dist/{compose-Dx_nSZYU.mjs → compose-BcL1Swdp.mjs} +41 -193
- package/dist/compose-BcL1Swdp.mjs.map +1 -0
- package/dist/{compose-BEVBxf4w.cjs → compose-BiQ6kNhM.cjs} +41 -193
- package/dist/compose-BiQ6kNhM.cjs.map +1 -0
- package/dist/{config-CTrfNKYd.d.mts → config-DpqIrrRJ.d.mts} +12 -3
- package/dist/config-DpqIrrRJ.d.mts.map +1 -0
- package/dist/{config-D9g_nYIu.d.cts → config-KFyPSS0R.d.cts} +12 -3
- package/dist/config-KFyPSS0R.d.cts.map +1 -0
- package/dist/config.cjs +15 -10
- package/dist/config.cjs.map +1 -1
- package/dist/config.d.cts +1 -1
- package/dist/config.d.mts +1 -1
- package/dist/config.mjs +15 -10
- package/dist/config.mjs.map +1 -1
- package/dist/{credentials-ztezRtR4.mjs → credentials-8EmlMGSU.mjs} +3 -3
- package/dist/{credentials-ztezRtR4.mjs.map → credentials-8EmlMGSU.mjs.map} +1 -1
- package/dist/{credentials-Eyx2tM7B.cjs → credentials-BsgMQm1V.cjs} +102 -4
- package/dist/credentials-BsgMQm1V.cjs.map +1 -0
- package/dist/{credentials-n2abUWwJ.cjs → credentials-CJyYk-m9.cjs} +3 -3
- package/dist/{credentials-n2abUWwJ.cjs.map → credentials-CJyYk-m9.cjs.map} +1 -1
- package/dist/{credentials-DW5MvS4A.mjs → credentials-N_yElkgc.mjs} +73 -5
- package/dist/credentials-N_yElkgc.mjs.map +1 -0
- package/dist/{dbTunnel-bV1CPWUv.mjs → dbTunnel-Bmj9fmXv.mjs} +5 -5
- package/dist/{dbTunnel-bV1CPWUv.mjs.map → dbTunnel-Bmj9fmXv.mjs.map} +1 -1
- package/dist/{dbTunnel-DVohSZJQ.cjs → dbTunnel-CZ-6PUzq.cjs} +5 -5
- package/dist/{dbTunnel-DVohSZJQ.cjs.map → dbTunnel-CZ-6PUzq.cjs.map} +1 -1
- package/dist/deploy/public.cjs +9 -9
- package/dist/deploy/public.d.cts +1 -1
- package/dist/deploy/public.d.cts.map +1 -1
- package/dist/deploy/public.d.mts +1 -1
- package/dist/deploy/public.d.mts.map +1 -1
- package/dist/deploy/public.mjs +9 -9
- package/dist/{deploy-Cpz5sKbh.mjs → deploy-DokDmyUV.mjs} +9 -9
- package/dist/{deploy-Cpz5sKbh.mjs.map → deploy-DokDmyUV.mjs.map} +1 -1
- package/dist/{deploy-CDUWcl58.cjs → deploy-DtO1rC_U.cjs} +9 -9
- package/dist/{deploy-CDUWcl58.cjs.map → deploy-DtO1rC_U.cjs.map} +1 -1
- package/dist/{destroy-DzeV0EdY.cjs → destroy-BKZY6QLy.cjs} +7 -7
- package/dist/{destroy-DzeV0EdY.cjs.map → destroy-BKZY6QLy.cjs.map} +1 -1
- package/dist/{destroy-DRlcWJwm.mjs → destroy-BwKhuhFd.mjs} +7 -7
- package/dist/{destroy-DRlcWJwm.mjs.map → destroy-BwKhuhFd.mjs.map} +1 -1
- package/dist/{dokploy-BTNfj3Zt.cjs → dokploy-BJEAhFPx.cjs} +2 -2
- package/dist/{dokploy-BTNfj3Zt.cjs.map → dokploy-BJEAhFPx.cjs.map} +1 -1
- package/dist/{dokploy-BveqiW2h.mjs → dokploy-Clnb-dRK.mjs} +2 -2
- package/dist/{dokploy-BveqiW2h.mjs.map → dokploy-Clnb-dRK.mjs.map} +1 -1
- package/dist/{eas-Dt_vRzb4.cjs → eas-PwJTBvEv.cjs} +2 -2
- package/dist/{eas-Dt_vRzb4.cjs.map → eas-PwJTBvEv.cjs.map} +1 -1
- package/dist/{eas-BmYTfjY6.mjs → eas-RRLe1Ykb.mjs} +2 -2
- package/dist/{eas-BmYTfjY6.mjs.map → eas-RRLe1Ykb.mjs.map} +1 -1
- package/dist/{encryption-BE2wxfyH.cjs → encryption-C0Obifb1.cjs} +2 -2
- package/dist/{encryption-BE2wxfyH.cjs.map → encryption-C0Obifb1.cjs.map} +1 -1
- package/dist/{encryption-DqoQltP8.mjs → encryption-DsiFDtEs.mjs} +2 -2
- package/dist/{encryption-DqoQltP8.mjs.map → encryption-DsiFDtEs.mjs.map} +1 -1
- package/dist/{engine-B72vyrO8.mjs → engine-C0gShT3p.mjs} +11 -6
- package/dist/engine-C0gShT3p.mjs.map +1 -0
- package/dist/{engine-BevpkNZe.cjs → engine-DVDe8Hx_.cjs} +11 -6
- package/dist/engine-DVDe8Hx_.cjs.map +1 -0
- package/dist/{github-DoHdtsDX.cjs → github-B0Al5cId.cjs} +6 -6
- package/dist/{github-DoHdtsDX.cjs.map → github-B0Al5cId.cjs.map} +1 -1
- package/dist/{github-hxvid6J3.mjs → github-o9OKgpAz.mjs} +6 -6
- package/dist/{github-hxvid6J3.mjs.map → github-o9OKgpAz.mjs.map} +1 -1
- package/dist/{googlePlay-DsvZTWgP.mjs → googlePlay-CgEgbCVa.mjs} +4 -4
- package/dist/{googlePlay-DsvZTWgP.mjs.map → googlePlay-CgEgbCVa.mjs.map} +1 -1
- package/dist/{googlePlay-CYney-Of.cjs → googlePlay-INjqj3Sc.cjs} +4 -4
- package/dist/{googlePlay-CYney-Of.cjs.map → googlePlay-INjqj3Sc.cjs.map} +1 -1
- package/dist/index.cjs +60 -60
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +60 -60
- package/dist/index.mjs.map +1 -1
- package/dist/{local-BuR4fIW6.cjs → local-BiM__VCH.cjs} +2 -2
- package/dist/{local-BuR4fIW6.cjs.map → local-BiM__VCH.cjs.map} +1 -1
- package/dist/{local-Cmq75U_o.mjs → local-Cnbc8rQp.mjs} +2 -2
- package/dist/{local-Cmq75U_o.mjs.map → local-Cnbc8rQp.mjs.map} +1 -1
- package/dist/{migrate-CuTQha4s.cjs → migrate-BIuREfyX.cjs} +2 -2
- package/dist/{migrate-CuTQha4s.cjs.map → migrate-BIuREfyX.cjs.map} +1 -1
- package/dist/{migrate-CDMdrniJ.cjs → migrate-DMePGfDk.cjs} +4 -4
- package/dist/{migrate-CDMdrniJ.cjs.map → migrate-DMePGfDk.cjs.map} +1 -1
- package/dist/{migrate-DYJffHOm.mjs → migrate-DgONWHqx.mjs} +2 -2
- package/dist/{migrate-DYJffHOm.mjs.map → migrate-DgONWHqx.mjs.map} +1 -1
- package/dist/{migrate-Bf-EG8Fj.mjs → migrate-dgTtl7hO.mjs} +4 -4
- package/dist/{migrate-Bf-EG8Fj.mjs.map → migrate-dgTtl7hO.mjs.map} +1 -1
- package/dist/{projectBucket-NcgqleyH.cjs → projectBucket-D33fcuVv.cjs} +2 -2
- package/dist/{projectBucket-NcgqleyH.cjs.map → projectBucket-D33fcuVv.cjs.map} +1 -1
- package/dist/{projectBucket-B5YkuSVr.mjs → projectBucket-DS8YAcjG.mjs} +2 -2
- package/dist/{projectBucket-B5YkuSVr.mjs.map → projectBucket-DS8YAcjG.mjs.map} +1 -1
- package/dist/{publish--EQ4Tw3F.cjs → publish-DTESp-zL.cjs} +2 -2
- package/dist/{publish--EQ4Tw3F.cjs.map → publish-DTESp-zL.cjs.map} +1 -1
- package/dist/{publish-YL8WZHSo.mjs → publish-DayqXMgK.mjs} +2 -2
- package/dist/{publish-YL8WZHSo.mjs.map → publish-DayqXMgK.mjs.map} +1 -1
- package/dist/{resolve-DcG10_JV.mjs → resolve-CFrS9f8t.mjs} +4 -4
- package/dist/{resolve-DcG10_JV.mjs.map → resolve-CFrS9f8t.mjs.map} +1 -1
- package/dist/{resolve-Ced8-gj4.cjs → resolve-smEj5R9u.cjs} +4 -4
- package/dist/{resolve-Ced8-gj4.cjs.map → resolve-smEj5R9u.cjs.map} +1 -1
- package/dist/{rollback-C6bCANv7.cjs → rollback-Di2aDQd8.cjs} +6 -6
- package/dist/{rollback-C6bCANv7.cjs.map → rollback-Di2aDQd8.cjs.map} +1 -1
- package/dist/{rollback-BxI2p53H.mjs → rollback-Nh0ECNZP.mjs} +6 -6
- package/dist/{rollback-BxI2p53H.mjs.map → rollback-Nh0ECNZP.mjs.map} +1 -1
- package/dist/{s3-BAI0ELtE.mjs → s3-NJ6g9LT4.mjs} +2 -2
- package/dist/{s3-BAI0ELtE.mjs.map → s3-NJ6g9LT4.mjs.map} +1 -1
- package/dist/{s3-DucPHZAn.cjs → s3-w4NEUmAb.cjs} +2 -2
- package/dist/{s3-DucPHZAn.cjs.map → s3-w4NEUmAb.cjs.map} +1 -1
- package/dist/{serverSetup-DS9tW50_.mjs → serverSetup-C7M3XUzI.mjs} +6 -6
- package/dist/{serverSetup-DS9tW50_.mjs.map → serverSetup-C7M3XUzI.mjs.map} +1 -1
- package/dist/{serverSetup-D3-FE7Dj.cjs → serverSetup-QLq-WZ-0.cjs} +6 -6
- package/dist/{serverSetup-D3-FE7Dj.cjs.map → serverSetup-QLq-WZ-0.cjs.map} +1 -1
- package/dist/{sniffer-CX8sI8Cu.mjs → sniffer-Cg5jF0Ks.mjs} +6 -6
- package/dist/{sniffer-CX8sI8Cu.mjs.map → sniffer-Cg5jF0Ks.mjs.map} +1 -1
- package/dist/{sniffer-XlvJLrhZ.cjs → sniffer-DaDiVZV2.cjs} +6 -6
- package/dist/{sniffer-XlvJLrhZ.cjs.map → sniffer-DaDiVZV2.cjs.map} +1 -1
- package/dist/{snsSubscriptions-CJAOhWq9.cjs → snsSubscriptions-5EWtnPvE.cjs} +2 -2
- package/dist/{snsSubscriptions-CJAOhWq9.cjs.map → snsSubscriptions-5EWtnPvE.cjs.map} +1 -1
- package/dist/{snsSubscriptions-DDrra9rN.mjs → snsSubscriptions-Ct4_v2HZ.mjs} +2 -2
- package/dist/{snsSubscriptions-DDrra9rN.mjs.map → snsSubscriptions-Ct4_v2HZ.mjs.map} +1 -1
- package/dist/{sst-CsEjVFtz.cjs → sst-BlXVHMle.cjs} +17 -4
- package/dist/sst-BlXVHMle.cjs.map +1 -0
- package/dist/{sst-CdHflajE.mjs → sst-DD9MlGXY.mjs} +17 -4
- package/dist/sst-DD9MlGXY.mjs.map +1 -0
- package/dist/{stack-CLHY-_2m.mjs → stack-DWsG_ZL-.mjs} +2462 -2188
- package/dist/stack-DWsG_ZL-.mjs.map +1 -0
- package/dist/{stack-BYhtz-bE.cjs → stack-dyeQ8u3c.cjs} +2491 -2211
- package/dist/stack-dyeQ8u3c.cjs.map +1 -0
- package/dist/{stage-Bc_BtQeG.cjs → stage-Dkd13Ije.cjs} +4 -4
- package/dist/{stage-Bc_BtQeG.cjs.map → stage-Dkd13Ije.cjs.map} +1 -1
- package/dist/{stage-C7aYyDMr.mjs → stage-QJk7pMSh.mjs} +4 -4
- package/dist/{stage-C7aYyDMr.mjs.map → stage-QJk7pMSh.mjs.map} +1 -1
- package/dist/target/public.cjs +1 -1
- package/dist/target/public.mjs +1 -1
- package/dist/{terminal-BZzK69T9.mjs → terminal-ByYXHXDB.mjs} +2 -2
- package/dist/{terminal-BZzK69T9.mjs.map → terminal-ByYXHXDB.mjs.map} +1 -1
- package/dist/{terminal-DXUXlqrO.cjs → terminal-CsRESfL9.cjs} +2 -2
- package/dist/{terminal-DXUXlqrO.cjs.map → terminal-CsRESfL9.cjs.map} +1 -1
- package/package.json +16 -16
- package/dist/compose-BEVBxf4w.cjs.map +0 -1
- package/dist/compose-Dx_nSZYU.mjs.map +0 -1
- package/dist/config-CTrfNKYd.d.mts.map +0 -1
- package/dist/config-D9g_nYIu.d.cts.map +0 -1
- package/dist/credentials-DW5MvS4A.mjs.map +0 -1
- package/dist/credentials-Eyx2tM7B.cjs.map +0 -1
- package/dist/engine-B72vyrO8.mjs.map +0 -1
- package/dist/engine-BevpkNZe.cjs.map +0 -1
- package/dist/sst-CdHflajE.mjs.map +0 -1
- package/dist/sst-CsEjVFtz.cjs.map +0 -1
- package/dist/stack-BYhtz-bE.cjs.map +0 -1
- package/dist/stack-CLHY-_2m.mjs.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BhDjJH2R.mjs";
|
|
2
2
|
import { t as GkmError } from "./errors-C9uIyIDt.mjs";
|
|
3
|
-
import { L as stageTag, M as imageRef, f as initStageSecrets, h as toEmbeddableSecrets } from "./credentials-
|
|
4
|
-
import {
|
|
3
|
+
import { L as stageTag, M as imageRef, f as initStageSecrets, h as toEmbeddableSecrets } from "./credentials-8EmlMGSU.mjs";
|
|
4
|
+
import { $n as runOutput, $t as imageLayout, An as envFor, At as backendsOf, Bt as assertEdgeHostsFree, Cn as applyNotifications, Dn as postgresStatements, Gt as removeEdgeRoutes, Ht as edgePorts, It as LEGACY_LOCAL_LOGIN, K as ensureDockerignore, Kn as dockerCompose, Kt as writeEdgeRoutes, Lt as ensurePostgresLogin, Mn as stageEnv, Ot as workerEnvKeys, Qt as fromBuildRoot, Rt as bucketClient, Sn as applyLifecycles, St as appEnvKeys, T as createComposeState, Tn as applyPostgres, Ut as edgeRef, Vt as assertEdgePorts, Wt as ensureEdge, _ as ensureEdgeDnsSecrets, c as replicaNames, d as withCaddyConfigs, f as withLogsPort, fn as BACKUPS_SERVICE, g as ensureEdgeAcmeKey, h as acmeDnsZone, hn as POSTGRES_SERVICE, i as composeStack, in as nextPrerenderManifest, jt as constructGlobs, k as recordRelease, l as stackDir, m as acmeDnsSecrets, n as LOOPBACK_SERVICES, r as composeProject, rn as findBuildRoot, s as envFile, t as LOG_ROTATION, vn as backupsRoleStatements, wn as applyPolicies, xn as applyBuckets, zt as pgClient } from "./stack-DWsG_ZL-.mjs";
|
|
5
5
|
import { B as LOGS_PORT, Dt as ComposeTlsFileMissing, Ft as SERVER_IPV4_KEY, L as resolveStageTelemetry, Rt as isReservedStageKey } from "./workspace-CdiCMRap.mjs";
|
|
6
6
|
import { t as defineTarget } from "./define-BfrNaY82.mjs";
|
|
7
|
-
import { C as
|
|
7
|
+
import { C as REDIS_SERVICE, Ct as logsAccess, E as runsRedis, O as withRedisPassword, St as LogsPortTaken, X as usesTelemetry, d as loadLocalCredentials, g as withGeneratedSecrets, kt as withLogsLogin, mt as primaryPortKey, xt as LOGS_SERVICE } from "./credentials-N_yElkgc.mjs";
|
|
8
8
|
import { o as installedFrom } from "./drivers-BQRb3KsL.mjs";
|
|
9
9
|
import { i as discover } from "./discover-Dfmn6HQ7.mjs";
|
|
10
|
-
import { a as provisionedTopics, c as subscriptionResource, f as isLocalHost, g as serverAddressHint, h as requiredServerAddress, i as confirmPendingSubscriptions, l as topicConnection, n as SUBSCRIPTION_TYPE, o as recordedPushSubscriptions, s as subscriptionKey, t as PushSubscriptionsUnconfirmed, u as HostNotPointingAtServer, v as stackHosts, x as systemLookup, y as stageDns } from "./snsSubscriptions-
|
|
10
|
+
import { a as provisionedTopics, c as subscriptionResource, f as isLocalHost, g as serverAddressHint, h as requiredServerAddress, i as confirmPendingSubscriptions, l as topicConnection, n as SUBSCRIPTION_TYPE, o as recordedPushSubscriptions, s as subscriptionKey, t as PushSubscriptionsUnconfirmed, u as HostNotPointingAtServer, v as stackHosts, x as systemLookup, y as stageDns } from "./snsSubscriptions-Ct4_v2HZ.mjs";
|
|
11
11
|
import { d as dnsResources, f as forgetDnsResource, i as currentActor, n as reportDatabaseRuns, p as recordDnsChanges, r as reportPlannedSeeds, s as DeployJournal, t as DeploySeedsFailed, u as dnsResourceKey } from "./seeds-Ccn0Ru2T.mjs";
|
|
12
12
|
import { f as plannedSeeds, o as SeedFailed, p as seedDatabases, u as migrateDatabases } from "./databases-CV22HzrI.mjs";
|
|
13
13
|
import { dirname, join, relative } from "node:path";
|
|
@@ -17,9 +17,8 @@ import { chmod, mkdir, readFile, readdir, rm, writeFile } from "node:fs/promises
|
|
|
17
17
|
import { hostname, userInfo } from "node:os";
|
|
18
18
|
import { spawn } from "node:child_process";
|
|
19
19
|
import { createConnection, createServer } from "node:net";
|
|
20
|
-
import { createHash } from "node:crypto";
|
|
21
20
|
import { ensureLocalAuthority, ensureLocalCertificate, localCertificateNames, readLocalAuthority } from "@geekmidas/edge/certificates/local";
|
|
22
|
-
import {
|
|
21
|
+
import { EDGE_PROJECT, EDGE_SERVICE } from "@geekmidas/edge/proxy/traefik";
|
|
23
22
|
import { providedKeyFor } from "@geekmidas/manifest";
|
|
24
23
|
import { stringify } from "yaml";
|
|
25
24
|
import { request } from "node:http";
|
|
@@ -215,176 +214,6 @@ const sshAccess = {
|
|
|
215
214
|
}
|
|
216
215
|
};
|
|
217
216
|
//#endregion
|
|
218
|
-
//#region src/compose/acmeDns.ts
|
|
219
|
-
/**
|
|
220
|
-
* The key the server's shared Traefik edge answers Let's Encrypt's DNS
|
|
221
|
-
* challenge with, for a stage with a wildcard site.
|
|
222
|
-
*
|
|
223
|
-
* A wildcard certificate is issued only over the DNS challenge: the edge
|
|
224
|
-
* proves it holds `<domain>` by writing a TXT record at
|
|
225
|
-
* `_acme-challenge.<domain>`. So it needs a key that can write that record —
|
|
226
|
-
* and nothing else, because it lives on the server.
|
|
227
|
-
*
|
|
228
|
-
* - **The user**: one per server, under `/gkm/`, tagged with the server it
|
|
229
|
-
* is for. One that exists without that tag is someone else's, and is
|
|
230
|
-
* refused rather than taken over.
|
|
231
|
-
* - **Its policies**: one per stack on the server, named for its compose
|
|
232
|
-
* project, allowing `ChangeResourceRecordSets` on the stage's hosted zone
|
|
233
|
-
* for TXT records named `_acme-challenge.<domain>` alone — plus what
|
|
234
|
-
* finding the zone and waiting for the change take, which read and write
|
|
235
|
-
* nothing. Put back on every deploy.
|
|
236
|
-
* - **Its key**: written into the edge's container, never into the stage's
|
|
237
|
-
* secrets or onto the machine running the deploy. Issued when the edge
|
|
238
|
-
* has none, or holds one IAM no longer knows — and then the edge is
|
|
239
|
-
* restarted, since it keeps the key it first read.
|
|
240
|
-
*/
|
|
241
|
-
/** Where gkm's IAM users live. */
|
|
242
|
-
const USER_PATH = "/gkm/";
|
|
243
|
-
/** The tag a server's edge user is found by. */
|
|
244
|
-
const TAG_EDGE = "gkm:edge";
|
|
245
|
-
/** The edge user's name for a server: stable, and safe for IAM. */
|
|
246
|
-
function edgeAcmeUser(server) {
|
|
247
|
-
return `gkm-edge-acme-${createHash("sha256").update(server).digest("hex").slice(0, 12)}`;
|
|
248
|
-
}
|
|
249
|
-
/**
|
|
250
|
-
* What one stage's wildcard certificate needs: its challenge record written
|
|
251
|
-
* in its zone, the change waited on, and the zone found by name — which is
|
|
252
|
-
* how the edge's ACME client finds it.
|
|
253
|
-
*/
|
|
254
|
-
function acmeDnsPolicy(zoneId, domain) {
|
|
255
|
-
return JSON.stringify({
|
|
256
|
-
Version: "2012-10-17",
|
|
257
|
-
Statement: [
|
|
258
|
-
{
|
|
259
|
-
Effect: "Allow",
|
|
260
|
-
Action: "route53:ChangeResourceRecordSets",
|
|
261
|
-
Resource: `arn:aws:route53:::hostedzone/${zoneId}`,
|
|
262
|
-
Condition: { "ForAllValues:StringEquals": {
|
|
263
|
-
"route53:ChangeResourceRecordSetsNormalizedRecordNames": [`_acme-challenge.${domain.toLowerCase()}`],
|
|
264
|
-
"route53:ChangeResourceRecordSetsRecordTypes": ["TXT"]
|
|
265
|
-
} }
|
|
266
|
-
},
|
|
267
|
-
{
|
|
268
|
-
Effect: "Allow",
|
|
269
|
-
Action: "route53:ListResourceRecordSets",
|
|
270
|
-
Resource: `arn:aws:route53:::hostedzone/${zoneId}`
|
|
271
|
-
},
|
|
272
|
-
{
|
|
273
|
-
Effect: "Allow",
|
|
274
|
-
Action: "route53:GetChange",
|
|
275
|
-
Resource: "arn:aws:route53:::change/*"
|
|
276
|
-
},
|
|
277
|
-
{
|
|
278
|
-
Effect: "Allow",
|
|
279
|
-
Action: "route53:ListHostedZonesByName",
|
|
280
|
-
Resource: "*"
|
|
281
|
-
}
|
|
282
|
-
]
|
|
283
|
-
});
|
|
284
|
-
}
|
|
285
|
-
/** An IAM user by the edge user's name that gkm did not create for this server. */
|
|
286
|
-
var EdgeAcmeUserNotOwned = class extends GkmError {
|
|
287
|
-
user;
|
|
288
|
-
server;
|
|
289
|
-
constructor(user, server) {
|
|
290
|
-
super(`The IAM user ${user} exists but is not tagged ${TAG_EDGE}=${server}, so gkm will not take it over to write the shared edge's DNS challenge records. Delete it, or tag it ${TAG_EDGE}=${server} if it is the one gkm created for this server.`);
|
|
291
|
-
this.user = user;
|
|
292
|
-
this.server = server;
|
|
293
|
-
this.name = "EdgeAcmeUserNotOwned";
|
|
294
|
-
}
|
|
295
|
-
};
|
|
296
|
-
/** A wildcard site's domain with no Route 53 hosted zone to answer it in. */
|
|
297
|
-
var AcmeHostedZoneMissing = class extends GkmError {
|
|
298
|
-
domain;
|
|
299
|
-
constructor(domain) {
|
|
300
|
-
super(`No Route 53 hosted zone holds ${domain}, so the shared edge cannot answer the DNS challenge for its wildcard certificate. Create the zone, or set hostedZoneId in its dns entry.`);
|
|
301
|
-
this.domain = domain;
|
|
302
|
-
this.name = "AcmeHostedZoneMissing";
|
|
303
|
-
}
|
|
304
|
-
};
|
|
305
|
-
/**
|
|
306
|
-
* The edge's key for `domain`'s challenge record: its user, this stack's
|
|
307
|
-
* policy on it, and a key in the edge that IAM knows.
|
|
308
|
-
*
|
|
309
|
-
* @throws {EdgeAcmeUserNotOwned} when the user is someone else's
|
|
310
|
-
* @throws {AcmeHostedZoneMissing} when no hosted zone holds the domain
|
|
311
|
-
*/
|
|
312
|
-
async function ensureEdgeAcmeKey(docker, options) {
|
|
313
|
-
const { clients, edge, server, project, domain } = options;
|
|
314
|
-
const log = options.log ?? ((line) => console.log(line));
|
|
315
|
-
const IAM = await import("@aws-sdk/client-iam");
|
|
316
|
-
const user = edgeAcmeUser(server);
|
|
317
|
-
const zoneId = options.hostedZoneId ?? await hostedZoneId(clients.route53, options.zone);
|
|
318
|
-
if (!zoneId) throw new AcmeHostedZoneMissing(domain);
|
|
319
|
-
if (options.dryRun) {
|
|
320
|
-
log(`🔑 Would let ${EDGE_PROJECT} write _acme-challenge.${domain} TXT records in ${zoneId}, as IAM user ${user} (dry run — nothing is written)`);
|
|
321
|
-
return {
|
|
322
|
-
user,
|
|
323
|
-
zoneId,
|
|
324
|
-
issued: false
|
|
325
|
-
};
|
|
326
|
-
}
|
|
327
|
-
if (!(await clients.iam.send(new IAM.GetUserCommand({ UserName: user })).catch((error) => {
|
|
328
|
-
if (error?.name === "NoSuchEntity" || error?.name === "NoSuchEntityException") return;
|
|
329
|
-
throw error;
|
|
330
|
-
}))?.User) await clients.iam.send(new IAM.CreateUserCommand({
|
|
331
|
-
UserName: user,
|
|
332
|
-
Path: USER_PATH,
|
|
333
|
-
Tags: [{
|
|
334
|
-
Key: TAG_EDGE,
|
|
335
|
-
Value: server
|
|
336
|
-
}]
|
|
337
|
-
}));
|
|
338
|
-
else {
|
|
339
|
-
const { Tags = [] } = await clients.iam.send(new IAM.ListUserTagsCommand({ UserName: user }));
|
|
340
|
-
if (!Tags.some((t) => t.Key === "gkm:edge" && t.Value === server)) throw new EdgeAcmeUserNotOwned(user, server);
|
|
341
|
-
}
|
|
342
|
-
await clients.iam.send(new IAM.PutUserPolicyCommand({
|
|
343
|
-
UserName: user,
|
|
344
|
-
PolicyName: project,
|
|
345
|
-
PolicyDocument: acmeDnsPolicy(zoneId, domain)
|
|
346
|
-
}));
|
|
347
|
-
log(`🔑 ${EDGE_PROJECT} may write _acme-challenge.${domain} TXT records in ${zoneId}, and nothing else there, as IAM user ${user}`);
|
|
348
|
-
const written = await readEdgeFile(docker, edge, EDGE_AWS_CREDENTIALS);
|
|
349
|
-
const held = written?.match(/aws_access_key_id\s*=\s*(\S+)/)?.[1];
|
|
350
|
-
const { AccessKeyMetadata = [] } = await clients.iam.send(new IAM.ListAccessKeysCommand({ UserName: user }));
|
|
351
|
-
if (held && AccessKeyMetadata.some((k) => k.AccessKeyId === held)) return {
|
|
352
|
-
user,
|
|
353
|
-
zoneId,
|
|
354
|
-
issued: false
|
|
355
|
-
};
|
|
356
|
-
for (const key of AccessKeyMetadata) {
|
|
357
|
-
if (!key.AccessKeyId) continue;
|
|
358
|
-
await clients.iam.send(new IAM.DeleteAccessKeyCommand({
|
|
359
|
-
UserName: user,
|
|
360
|
-
AccessKeyId: key.AccessKeyId
|
|
361
|
-
}));
|
|
362
|
-
}
|
|
363
|
-
const { AccessKey } = await clients.iam.send(new IAM.CreateAccessKeyCommand({ UserName: user }));
|
|
364
|
-
await writeEdgeSecret(docker, edge, EDGE_AWS_CREDENTIALS, `# Written by gkm compose — the key ${EDGE_PROJECT} answers DNS challenges with.
|
|
365
|
-
[default]
|
|
366
|
-
aws_access_key_id = ${AccessKey?.AccessKeyId}
|
|
367
|
-
aws_secret_access_key = ${AccessKey?.SecretAccessKey}
|
|
368
|
-
`);
|
|
369
|
-
log(`🔑 Wrote a new key for ${user} to ${EDGE_PROJECT} (${EDGE_AWS_CREDENTIALS})`);
|
|
370
|
-
if (written !== void 0) await restartEdge(docker, edge);
|
|
371
|
-
return {
|
|
372
|
-
user,
|
|
373
|
-
zoneId,
|
|
374
|
-
issued: true
|
|
375
|
-
};
|
|
376
|
-
}
|
|
377
|
-
/** The id of the hosted zone named exactly `zone`, if there is one. */
|
|
378
|
-
async function hostedZoneId(route53, zone) {
|
|
379
|
-
const { ListHostedZonesByNameCommand } = await import("@aws-sdk/client-route-53");
|
|
380
|
-
const name = zone.endsWith(".") ? zone : `${zone}.`;
|
|
381
|
-
const { HostedZones = [] } = await route53.send(new ListHostedZonesByNameCommand({
|
|
382
|
-
DNSName: name,
|
|
383
|
-
MaxItems: 1
|
|
384
|
-
}));
|
|
385
|
-
return HostedZones.find((z) => z.Name === name)?.Id?.replace("/hostedzone/", "");
|
|
386
|
-
}
|
|
387
|
-
//#endregion
|
|
388
217
|
//#region src/compose/images.ts
|
|
389
218
|
/**
|
|
390
219
|
* Which image each app runs — and, for a tag, whether every one exists.
|
|
@@ -1208,7 +1037,13 @@ async function validateCompose(ctx, deps, options = {}) {
|
|
|
1208
1037
|
ctx.secrets.mask(stack.logs.password);
|
|
1209
1038
|
ctx.secrets.mask(stack.logs.appEnv.OTEL_EXPORTER_OTLP_HEADERS);
|
|
1210
1039
|
}
|
|
1211
|
-
if (!push && !stack.local)
|
|
1040
|
+
if (!push && !stack.local) {
|
|
1041
|
+
requiredServerAddress(stage, workspace.domains?.[stage], secrets?.custom);
|
|
1042
|
+
if (stack.proxy === "traefik" && stack.wildcard?.tls === "dns") {
|
|
1043
|
+
const zone = acmeDnsZone(workspace, stage);
|
|
1044
|
+
if (zone) acmeDnsSecrets(zone, stage, secrets?.custom);
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1212
1047
|
const server = push ? void 0 : composeServer({
|
|
1213
1048
|
stage,
|
|
1214
1049
|
local: stack.local,
|
|
@@ -1592,33 +1427,46 @@ async function planCompose(ctx, run) {
|
|
|
1592
1427
|
});
|
|
1593
1428
|
}
|
|
1594
1429
|
/**
|
|
1595
|
-
* The shared edge's key for the stage's wildcard certificate
|
|
1596
|
-
*
|
|
1597
|
-
*
|
|
1430
|
+
* The shared edge's key for the stage's wildcard certificate, through the
|
|
1431
|
+
* DNS provider holding the stage's domain — before the stack's routes ask
|
|
1432
|
+
* for the certificate. Route 53's is issued through IAM, allowed the DNS
|
|
1433
|
+
* challenge's record and nothing else; every other provider's is the
|
|
1434
|
+
* stage's own secrets, written into the edge.
|
|
1598
1435
|
*/
|
|
1599
1436
|
async function edgeAcmeKey(ctx, run, deps) {
|
|
1600
1437
|
const { workspace, stage } = ctx;
|
|
1601
|
-
const
|
|
1602
|
-
|
|
1603
|
-
const
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1438
|
+
const zone = acmeDnsZone(workspace, stage);
|
|
1439
|
+
if (!zone) return;
|
|
1440
|
+
const edge = edgeRef(edgeFile(run), {
|
|
1441
|
+
...run.ref.host ? { host: run.ref.host } : {},
|
|
1442
|
+
...run.ref.output ? { output: run.ref.output } : {}
|
|
1443
|
+
});
|
|
1444
|
+
const log = (line) => ctx.logger.info(line);
|
|
1445
|
+
if (zone.provider !== "route53") {
|
|
1446
|
+
await ensureEdgeDnsSecrets(deps.docker, {
|
|
1447
|
+
edge,
|
|
1448
|
+
zone,
|
|
1449
|
+
stage,
|
|
1450
|
+
custom: run.secrets?.custom,
|
|
1451
|
+
...ctx.dryRun ? { dryRun: true } : {},
|
|
1452
|
+
log
|
|
1453
|
+
});
|
|
1454
|
+
return;
|
|
1455
|
+
}
|
|
1456
|
+
const { domain } = zone;
|
|
1457
|
+
const route53 = zone.config;
|
|
1607
1458
|
const server = requiredServerAddress(stage, domain, run.secrets?.custom)?.ipv4 ?? run.server?.host ?? "local";
|
|
1608
1459
|
const clients = await (deps.acmeClients ?? defaultAcmeClients)(route53);
|
|
1609
1460
|
await ensureEdgeAcmeKey(deps.docker, {
|
|
1610
1461
|
clients,
|
|
1611
|
-
edge
|
|
1612
|
-
...run.ref.host ? { host: run.ref.host } : {},
|
|
1613
|
-
...run.ref.output ? { output: run.ref.output } : {}
|
|
1614
|
-
}),
|
|
1462
|
+
edge,
|
|
1615
1463
|
server,
|
|
1616
1464
|
project: run.stack.project,
|
|
1617
1465
|
domain,
|
|
1618
|
-
zone,
|
|
1466
|
+
zone: zone.zone,
|
|
1619
1467
|
...route53.hostedZoneId ? { hostedZoneId: route53.hostedZoneId } : {},
|
|
1620
1468
|
...ctx.dryRun ? { dryRun: true } : {},
|
|
1621
|
-
log
|
|
1469
|
+
log
|
|
1622
1470
|
});
|
|
1623
1471
|
}
|
|
1624
1472
|
/** IAM and Route 53 through the AWS SDK's own chain, or the entry's profile. */
|
|
@@ -2643,4 +2491,4 @@ function composeTarget(options = {}) {
|
|
|
2643
2491
|
//#endregion
|
|
2644
2492
|
export { stackOverrideFile as a, pinnedRef as c, sshAccess as d, sshTarget as f, ComposePushNeedsBuild as i, composeServer as l, compose_exports as n, deployedStackSecrets as o, ComposePinNeedsPull as r, parseDigests as s, composeTarget as t, dockerHost as u };
|
|
2645
2493
|
|
|
2646
|
-
//# sourceMappingURL=compose-
|
|
2494
|
+
//# sourceMappingURL=compose-BcL1Swdp.mjs.map
|