@geekmidas/cli 10.0.0-alpha.124 → 10.0.0-alpha.126
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-B2MUa4M2.cjs → EndpointGenerator-BGxf9jWE.cjs} +8 -4
- package/dist/{EndpointGenerator-B2MUa4M2.cjs.map → EndpointGenerator-BGxf9jWE.cjs.map} +1 -1
- package/dist/{EndpointGenerator-Z_BUTocT.mjs → EndpointGenerator-errMeldx.mjs} +8 -4
- package/dist/{EndpointGenerator-Z_BUTocT.mjs.map → EndpointGenerator-errMeldx.mjs.map} +1 -1
- package/dist/{GoDaddyProvider-55x4o-4z.mjs → GoDaddyProvider-CvRVmN4W.mjs} +2 -2
- package/dist/{GoDaddyProvider-55x4o-4z.mjs.map → GoDaddyProvider-CvRVmN4W.mjs.map} +1 -1
- package/dist/{GoDaddyProvider-0z5RAN1k.cjs → GoDaddyProvider-DFfpzCOP.cjs} +2 -2
- package/dist/{GoDaddyProvider-0z5RAN1k.cjs.map → GoDaddyProvider-DFfpzCOP.cjs.map} +1 -1
- package/dist/{LegacyStateStore-DRpB-yC5.cjs → LegacyStateStore-BFrCHrFQ.cjs} +3 -3
- package/dist/{LegacyStateStore-DRpB-yC5.cjs.map → LegacyStateStore-BFrCHrFQ.cjs.map} +1 -1
- package/dist/{LegacyStateStore-C-vumKSN.mjs → LegacyStateStore-CgfENrXF.mjs} +3 -3
- package/dist/{LegacyStateStore-C-vumKSN.mjs.map → LegacyStateStore-CgfENrXF.mjs.map} +1 -1
- package/dist/{LocalStateStore-C3ummuDT.cjs → LocalStateStore-BU5z_IOE.cjs} +2 -2
- package/dist/{LocalStateStore-C3ummuDT.cjs.map → LocalStateStore-BU5z_IOE.cjs.map} +1 -1
- package/dist/{LocalStateStore-CtOjpV1w.mjs → LocalStateStore-DxoNpiBg.mjs} +2 -2
- package/dist/{LocalStateStore-CtOjpV1w.mjs.map → LocalStateStore-DxoNpiBg.mjs.map} +1 -1
- package/dist/{OpenApiTsGenerator-MtnMQL_g.mjs → OpenApiTsGenerator-W_HRXH1X.mjs} +2 -2
- package/dist/{OpenApiTsGenerator-MtnMQL_g.mjs.map → OpenApiTsGenerator-W_HRXH1X.mjs.map} +1 -1
- package/dist/{OpenApiTsGenerator-t3_E98Fi.cjs → OpenApiTsGenerator-cQgtxWQo.cjs} +2 -2
- package/dist/{OpenApiTsGenerator-t3_E98Fi.cjs.map → OpenApiTsGenerator-cQgtxWQo.cjs.map} +1 -1
- package/dist/{S3StateStore-BC4Jm3Tw.mjs → S3StateStore-CGMSDilh.mjs} +2 -2
- package/dist/{S3StateStore-BC4Jm3Tw.mjs.map → S3StateStore-CGMSDilh.mjs.map} +1 -1
- package/dist/{S3StateStore-BeArp0aF.cjs → S3StateStore-DiekMLpn.cjs} +2 -2
- package/dist/{S3StateStore-BeArp0aF.cjs.map → S3StateStore-DiekMLpn.cjs.map} +1 -1
- package/dist/{SSMStateStore-DcstR6cW.cjs → SSMStateStore-BDCOFdKq.cjs} +2 -2
- package/dist/{SSMStateStore-DcstR6cW.cjs.map → SSMStateStore-BDCOFdKq.cjs.map} +1 -1
- package/dist/{SSMStateStore-Crl76aYZ.mjs → SSMStateStore-Cq2H9MlF.mjs} +2 -2
- package/dist/{SSMStateStore-Crl76aYZ.mjs.map → SSMStateStore-Cq2H9MlF.mjs.map} +1 -1
- package/dist/{SubscriberGenerator-COAVPgM-.mjs → SubscriberGenerator-BALddfuW.mjs} +4 -62
- package/dist/SubscriberGenerator-BALddfuW.mjs.map +1 -0
- package/dist/{SubscriberGenerator-C3QTae-R.cjs → SubscriberGenerator-LgyTxZ8r.cjs} +3 -91
- package/dist/SubscriberGenerator-LgyTxZ8r.cjs.map +1 -0
- package/dist/{add-BFjb6mMq.cjs → add-BsiBYkAW.cjs} +6 -6
- package/dist/{add-BFjb6mMq.cjs.map → add-BsiBYkAW.cjs.map} +1 -1
- package/dist/{add-CIjmgzkb.mjs → add-CamA9Uqv.mjs} +6 -6
- package/dist/{add-CIjmgzkb.mjs.map → add-CamA9Uqv.mjs.map} +1 -1
- package/dist/{bundler-D6KFNpQk.mjs → bundler-2V2PR_E-.mjs} +5 -5
- package/dist/{bundler-D6KFNpQk.mjs.map → bundler-2V2PR_E-.mjs.map} +1 -1
- package/dist/{bundler-CiUoIsku.cjs → bundler-CijtdIZ2.cjs} +5 -5
- package/dist/{bundler-CiUoIsku.cjs.map → bundler-CijtdIZ2.cjs.map} +1 -1
- package/dist/{cli-r4eUr98C.cjs → cli-7gc1QG8X.cjs} +3 -3
- package/dist/{cli-r4eUr98C.cjs.map → cli-7gc1QG8X.cjs.map} +1 -1
- package/dist/{cli-DNtSTtMc.mjs → cli-PiyYqHGx.mjs} +3 -3
- package/dist/{cli-DNtSTtMc.mjs.map → cli-PiyYqHGx.mjs.map} +1 -1
- package/dist/{compose-BfXXWJSp.cjs → compose-8e2xJ61E.cjs} +236 -39
- package/dist/compose-8e2xJ61E.cjs.map +1 -0
- package/dist/{compose-DJvvmF3X.mjs → compose-CvHIjMDd.mjs} +235 -38
- package/dist/compose-CvHIjMDd.mjs.map +1 -0
- package/dist/{config-IgK6YaGp.d.cts → config-CdytFgSR.d.cts} +3 -3
- package/dist/{config-IgK6YaGp.d.cts.map → config-CdytFgSR.d.cts.map} +1 -1
- package/dist/{config-kE-p5hxq.d.mts → config-_y1FGBWR.d.mts} +3 -3
- package/dist/{config-kE-p5hxq.d.mts.map → config-_y1FGBWR.d.mts.map} +1 -1
- package/dist/config.cjs +2 -2
- package/dist/config.d.cts +3 -3
- package/dist/config.d.mts +3 -3
- package/dist/config.mjs +2 -2
- package/dist/{credentialSchemas-AhIBuQxQ.cjs → credentialSchemas-DFxvGEwa.cjs} +2 -2
- package/dist/{credentialSchemas-AhIBuQxQ.cjs.map → credentialSchemas-DFxvGEwa.cjs.map} +1 -1
- package/dist/{credentialSchemas-DLKbxYBy.mjs → credentialSchemas-DaMpt-Dx.mjs} +2 -2
- package/dist/{credentialSchemas-DLKbxYBy.mjs.map → credentialSchemas-DaMpt-Dx.mjs.map} +1 -1
- package/dist/{databases-BPOgTn1u.mjs → databases-6GD0tI2F.mjs} +65 -3
- package/dist/databases-6GD0tI2F.mjs.map +1 -0
- package/dist/{databases-fOaoBInm.cjs → databases-CuVGf7-M.cjs} +75 -1
- package/dist/databases-CuVGf7-M.cjs.map +1 -0
- package/dist/deploy/public.cjs +8 -8
- 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 +8 -8
- package/dist/{deploy-CiRYwFmr.mjs → deploy-CIPwTJ47.mjs} +797 -25
- package/dist/deploy-CIPwTJ47.mjs.map +1 -0
- package/dist/{deploy-BbI1UMh3.cjs → deploy-wSlIRPn5.cjs} +796 -24
- package/dist/deploy-wSlIRPn5.cjs.map +1 -0
- package/dist/{discover-BvJOVsYG.mjs → discover-CzGM5P3p.mjs} +71 -1
- package/dist/discover-CzGM5P3p.mjs.map +1 -0
- package/dist/{discover-ojkcbxHw.cjs → discover-DL6h-J97.cjs} +71 -1
- package/dist/discover-DL6h-J97.cjs.map +1 -0
- package/dist/{dokploy-C0aQrCgs.cjs → dokploy-BKbUrz05.cjs} +2 -2
- package/dist/{dokploy-C0aQrCgs.cjs.map → dokploy-BKbUrz05.cjs.map} +1 -1
- package/dist/{dokploy-MM7c3IE0.mjs → dokploy-BZf1AHd0.mjs} +2 -2
- package/dist/{dokploy-MM7c3IE0.mjs.map → dokploy-BZf1AHd0.mjs.map} +1 -1
- package/dist/{drivers-CQ32PB5w.cjs → drivers-C47nm-wB.cjs} +91 -4
- package/dist/drivers-C47nm-wB.cjs.map +1 -0
- package/dist/{drivers-Chb5Akov.mjs → drivers-CDjpjakg.mjs} +60 -3
- package/dist/drivers-CDjpjakg.mjs.map +1 -0
- package/dist/{eas-1Ee6kql0.mjs → eas-CxX2RCE_.mjs} +2 -2
- package/dist/{eas-1Ee6kql0.mjs.map → eas-CxX2RCE_.mjs.map} +1 -1
- package/dist/{eas-CJoys9yh.cjs → eas-DzDMGzfc.cjs} +2 -2
- package/dist/{eas-CJoys9yh.cjs.map → eas-DzDMGzfc.cjs.map} +1 -1
- package/dist/{emit-qvHxMV9b.cjs → emit-CYloptRS.cjs} +18 -1
- package/dist/emit-CYloptRS.cjs.map +1 -0
- package/dist/{emit-CNpuV_6Q.mjs → emit-CiJGdy_f.mjs} +18 -1
- package/dist/emit-CiJGdy_f.mjs.map +1 -0
- package/dist/{encryption-B8Bk1Mvu.mjs → encryption-BFSrt89F.mjs} +3 -3
- package/dist/{encryption-B8Bk1Mvu.mjs.map → encryption-BFSrt89F.mjs.map} +1 -1
- package/dist/{encryption-Bo9VlRnl.cjs → encryption-RNcBnG4Z.cjs} +3 -3
- package/dist/{encryption-Bo9VlRnl.cjs.map → encryption-RNcBnG4Z.cjs.map} +1 -1
- package/dist/{engine-esxTxcIx.cjs → engine-Dqe9KQCm.cjs} +142 -15
- package/dist/engine-Dqe9KQCm.cjs.map +1 -0
- package/dist/{engine-BuinpJfS.mjs → engine-_0pjyCd_.mjs} +142 -15
- package/dist/engine-_0pjyCd_.mjs.map +1 -0
- package/dist/{github-BEA4K3_X.cjs → github-Csev5EFf.cjs} +41 -6
- package/dist/github-Csev5EFf.cjs.map +1 -0
- package/dist/{github-BUlKJfOV.mjs → github-Dck0nLW9.mjs} +41 -6
- package/dist/github-Dck0nLW9.mjs.map +1 -0
- package/dist/{googlePlay-CiqAS2ma.cjs → googlePlay-DBtDAGBk.cjs} +3 -3
- package/dist/{googlePlay-CiqAS2ma.cjs.map → googlePlay-DBtDAGBk.cjs.map} +1 -1
- package/dist/{googlePlay-CK05QiTq.mjs → googlePlay-DTuvDHi5.mjs} +3 -3
- package/dist/{googlePlay-CK05QiTq.mjs.map → googlePlay-DTuvDHi5.mjs.map} +1 -1
- package/dist/{index-DhUf0B0m.d.mts → index-DrkV7N5w.d.mts} +2 -2
- package/dist/{index-4CO0HD27.d.cts.map → index-DrkV7N5w.d.mts.map} +1 -1
- package/dist/{index-4CO0HD27.d.cts → index-yaXZ9m-J.d.cts} +2 -2
- package/dist/{index-DhUf0B0m.d.mts.map → index-yaXZ9m-J.d.cts.map} +1 -1
- package/dist/index.cjs +150 -67
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +149 -66
- package/dist/index.mjs.map +1 -1
- package/dist/{migrate-C-hmbjpG.cjs → migrate-3ZEoqx5q.cjs} +3 -3
- package/dist/{migrate-C-hmbjpG.cjs.map → migrate-3ZEoqx5q.cjs.map} +1 -1
- package/dist/{migrate-BzCHT9qs.mjs → migrate-BABIuzQj.mjs} +3 -3
- package/dist/{migrate-BzCHT9qs.mjs.map → migrate-BABIuzQj.mjs.map} +1 -1
- package/dist/{migrate-CnbvrVag.mjs → migrate-DZeNpuX2.mjs} +8 -6
- package/dist/migrate-DZeNpuX2.mjs.map +1 -0
- package/dist/{migrate-DeQJBexh.cjs → migrate-pGiUqvBi.cjs} +8 -6
- package/dist/migrate-pGiUqvBi.cjs.map +1 -0
- 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/{publish-BISBrrqR.mjs → publish-BsnDeOVL.mjs} +2 -2
- package/dist/{publish-BISBrrqR.mjs.map → publish-BsnDeOVL.mjs.map} +1 -1
- package/dist/{publish-DtSIB-hZ.cjs → publish-CS6xDvGT.cjs} +2 -2
- package/dist/{publish-DtSIB-hZ.cjs.map → publish-CS6xDvGT.cjs.map} +1 -1
- package/dist/{ready-IVGu-q18.cjs → ready-CxPJm0Hc.cjs} +6 -6
- package/dist/{ready-IVGu-q18.cjs.map → ready-CxPJm0Hc.cjs.map} +1 -1
- package/dist/{ready-DqsyadOs.mjs → ready-DrvaAwKv.mjs} +6 -6
- package/dist/{ready-DqsyadOs.mjs.map → ready-DrvaAwKv.mjs.map} +1 -1
- package/dist/reconcile/public.cjs +2 -2
- package/dist/reconcile/public.d.cts +1 -1
- package/dist/reconcile/public.d.cts.map +1 -1
- package/dist/reconcile/public.d.mts +1 -1
- package/dist/reconcile/public.d.mts.map +1 -1
- package/dist/reconcile/public.mjs +2 -2
- package/dist/{resolve-BT7fkPN5.mjs → resolve-fCGJmM-R.mjs} +3 -3
- package/dist/{resolve-BT7fkPN5.mjs.map → resolve-fCGJmM-R.mjs.map} +1 -1
- package/dist/{resolve-C7GKQcE4.cjs → resolve-zqCMFio0.cjs} +3 -3
- package/dist/{resolve-C7GKQcE4.cjs.map → resolve-zqCMFio0.cjs.map} +1 -1
- package/dist/{rollback-DbP0KuDw.mjs → rollback-BkhVrtAf.mjs} +5 -5
- package/dist/{rollback-DbP0KuDw.mjs.map → rollback-BkhVrtAf.mjs.map} +1 -1
- package/dist/{rollback-BEiB-Pje.cjs → rollback-qc79mj6L.cjs} +5 -5
- package/dist/{rollback-BEiB-Pje.cjs.map → rollback-qc79mj6L.cjs.map} +1 -1
- package/dist/{runtime-BFJQNqwd.d.mts → runtime-DCkfI2E7.d.mts} +2 -2
- package/dist/{runtime-BFJQNqwd.d.mts.map → runtime-DCkfI2E7.d.mts.map} +1 -1
- package/dist/{runtime-BJO-FFef.d.cts → runtime-Ie4znWIB.d.cts} +2 -2
- package/dist/{runtime-BJO-FFef.d.cts.map → runtime-Ie4znWIB.d.cts.map} +1 -1
- package/dist/{s3-B4FTQQkV.mjs → s3-BZzSnker.mjs} +2 -2
- package/dist/{s3-B4FTQQkV.mjs.map → s3-BZzSnker.mjs.map} +1 -1
- package/dist/{s3-DwKLXwUT.cjs → s3-pqgmCTOq.cjs} +2 -2
- package/dist/{s3-DwKLXwUT.cjs.map → s3-pqgmCTOq.cjs.map} +1 -1
- package/dist/sandbox/credentials-worker.cjs +2 -2
- package/dist/sandbox/credentials-worker.mjs +2 -2
- package/dist/sandbox/discover-worker.cjs +1 -1
- package/dist/sandbox/discover-worker.mjs +1 -1
- package/dist/sandbox/migrate-worker.cjs +5 -4
- package/dist/sandbox/migrate-worker.cjs.map +1 -1
- package/dist/sandbox/migrate-worker.mjs +5 -4
- package/dist/sandbox/migrate-worker.mjs.map +1 -1
- package/dist/{seeds-DOfxmDRO.cjs → seeds-3awh33Wz.cjs} +607 -45
- package/dist/seeds-3awh33Wz.cjs.map +1 -0
- package/dist/{seeds-rG-Evfz9.mjs → seeds-Cfejy8wj.mjs} +517 -39
- package/dist/seeds-Cfejy8wj.mjs.map +1 -0
- package/dist/{serverSetup-CWWVcU6Y.cjs → serverSetup-BFQuwUeL.cjs} +6 -6
- package/dist/{serverSetup-CWWVcU6Y.cjs.map → serverSetup-BFQuwUeL.cjs.map} +1 -1
- package/dist/{serverSetup-xGw1fxuZ.mjs → serverSetup-C8ZbHTm_.mjs} +6 -6
- package/dist/{serverSetup-xGw1fxuZ.mjs.map → serverSetup-C8ZbHTm_.mjs.map} +1 -1
- package/dist/{sniffer-DVPgfyHr.mjs → sniffer-CCkdzjiU.mjs} +8 -8
- package/dist/{sniffer-DVPgfyHr.mjs.map → sniffer-CCkdzjiU.mjs.map} +1 -1
- package/dist/{sniffer-C7O9Pna_.cjs → sniffer-Cq1nhxIB.cjs} +8 -8
- package/dist/{sniffer-C7O9Pna_.cjs.map → sniffer-Cq1nhxIB.cjs.map} +1 -1
- package/dist/{snsSubscriptions-CSkteK2J.cjs → snsSubscriptions-DYyYP0Xf.cjs} +15 -3
- package/dist/snsSubscriptions-DYyYP0Xf.cjs.map +1 -0
- package/dist/{snsSubscriptions-CvBIGGp0.mjs → snsSubscriptions-R_AKBZYK.mjs} +4 -4
- package/dist/snsSubscriptions-R_AKBZYK.mjs.map +1 -0
- package/dist/{stage-fRfFtLwj.cjs → stage-BkgbVJ9Z.cjs} +6 -6
- package/dist/{stage-fRfFtLwj.cjs.map → stage-BkgbVJ9Z.cjs.map} +1 -1
- package/dist/{stage-2EKpzPQ1.mjs → stage-DCaxqm-G.mjs} +6 -6
- package/dist/{stage-2EKpzPQ1.mjs.map → stage-DCaxqm-G.mjs.map} +1 -1
- package/dist/{stages-B7mCWI_R.cjs → stages-3yUZaZeA.cjs} +2 -2
- package/dist/{stages-B7mCWI_R.cjs.map → stages-3yUZaZeA.cjs.map} +1 -1
- package/dist/{stages-DSltTW2d.mjs → stages-DTTv0NZW.mjs} +2 -2
- package/dist/{stages-DSltTW2d.mjs.map → stages-DTTv0NZW.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/{terminal-D1aeTkgv.cjs → terminal-PKhPAajN.cjs} +2 -2
- package/dist/{terminal-D1aeTkgv.cjs.map → terminal-PKhPAajN.cjs.map} +1 -1
- package/dist/{terminal-BAVrDhhN.mjs → terminal-bqY33lpN.mjs} +2 -2
- package/dist/{terminal-BAVrDhhN.mjs.map → terminal-bqY33lpN.mjs.map} +1 -1
- package/dist/{types-CFU2uvrz.d.cts → types-Bmjs4jZV.d.mts} +8 -2
- package/dist/{types-D3BeGucy.d.mts.map → types-Bmjs4jZV.d.mts.map} +1 -1
- package/dist/{types-D3BeGucy.d.mts → types-D0IsQxES.d.cts} +9 -1
- package/dist/{types-CFU2uvrz.d.cts.map → types-D0IsQxES.d.cts.map} +1 -1
- package/dist/vitest.cjs +1 -1
- package/dist/vitest.mjs +1 -1
- package/dist/workspace/index.cjs +1 -1
- package/dist/workspace/index.d.cts +2 -2
- package/dist/workspace/index.d.mts +2 -2
- package/dist/workspace/index.mjs +1 -1
- package/dist/{workspace-DUnnVjqC.mjs → workspace-DBHF9Gba.mjs} +5 -3
- package/dist/workspace-DBHF9Gba.mjs.map +1 -0
- package/dist/{workspace-C82GLPnf.cjs → workspace-Du4Afb03.cjs} +5 -3
- package/dist/workspace-Du4Afb03.cjs.map +1 -0
- package/package.json +17 -15
- package/dist/SubscriberGenerator-C3QTae-R.cjs.map +0 -1
- package/dist/SubscriberGenerator-COAVPgM-.mjs.map +0 -1
- package/dist/compose-BfXXWJSp.cjs.map +0 -1
- package/dist/compose-DJvvmF3X.mjs.map +0 -1
- package/dist/databases-BPOgTn1u.mjs.map +0 -1
- package/dist/databases-fOaoBInm.cjs.map +0 -1
- package/dist/deploy-BbI1UMh3.cjs.map +0 -1
- package/dist/deploy-CiRYwFmr.mjs.map +0 -1
- package/dist/discover-BvJOVsYG.mjs.map +0 -1
- package/dist/discover-ojkcbxHw.cjs.map +0 -1
- package/dist/drivers-CQ32PB5w.cjs.map +0 -1
- package/dist/drivers-Chb5Akov.mjs.map +0 -1
- package/dist/emit-CNpuV_6Q.mjs.map +0 -1
- package/dist/emit-qvHxMV9b.cjs.map +0 -1
- package/dist/engine-BuinpJfS.mjs.map +0 -1
- package/dist/engine-esxTxcIx.cjs.map +0 -1
- package/dist/github-BEA4K3_X.cjs.map +0 -1
- package/dist/github-BUlKJfOV.mjs.map +0 -1
- package/dist/migrate-CnbvrVag.mjs.map +0 -1
- package/dist/migrate-DeQJBexh.cjs.map +0 -1
- package/dist/seeds-DOfxmDRO.cjs.map +0 -1
- package/dist/seeds-rG-Evfz9.mjs.map +0 -1
- package/dist/snsSubscriptions-CSkteK2J.cjs.map +0 -1
- package/dist/snsSubscriptions-CvBIGGp0.mjs.map +0 -1
- package/dist/workspace-C82GLPnf.cjs.map +0 -1
- package/dist/workspace-DUnnVjqC.mjs.map +0 -1
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BhDjJH2R.mjs";
|
|
2
2
|
import { t as GkmError } from "./errors-D8Gwp5kU.mjs";
|
|
3
3
|
import { s as run$1, x as gkmHome } from "./credentials-DpfnUvIR.mjs";
|
|
4
|
-
import { B as LOGS_PORT, H as provisioningOf, R as stageSampleRate, U as stageProvider, _ as PUBLIC_ENV_PREFIXES, a as allConstructGlobs, ct as UnknownSecretsStoreProvider, ft as SERVER_IPV4_KEY, ht as isReservedStageKey, j as TEST_STAGE, pt as SERVER_IPV6_KEY, ut as s3SecretsLocation, v as getPublicEnvPrefix, z as telemetryEnv } from "./workspace-
|
|
4
|
+
import { B as LOGS_PORT, H as provisioningOf, R as stageSampleRate, U as stageProvider, _ as PUBLIC_ENV_PREFIXES, a as allConstructGlobs, ct as UnknownSecretsStoreProvider, ft as SERVER_IPV4_KEY, ht as isReservedStageKey, j as TEST_STAGE, pt as SERVER_IPV6_KEY, ut as s3SecretsLocation, v as getPublicEnvPrefix, z as telemetryEnv } from "./workspace-DBHF9Gba.mjs";
|
|
5
5
|
import { t as appKey } from "./derive-B4vDpzgP.mjs";
|
|
6
|
-
import { c as
|
|
6
|
+
import { c as DEFAULT_STORAGE, l as holdsEveryCache, o as DEFAULT_CACHE, s as DEFAULT_EVENTS$1 } from "./drivers-CDjpjakg.mjs";
|
|
7
7
|
import { n as deployIdentity } from "./identity-CBXr4wNi.mjs";
|
|
8
|
-
import { a as startTelemetryCode, n as runtimeFor, s as writeTelemetryModule, u as telemetryArgs } from "./EndpointGenerator-
|
|
9
|
-
import { d as ConstructGenerator, f as output, h as eventsEdgeBucket, i as discover } from "./discover-
|
|
8
|
+
import { a as startTelemetryCode, n as runtimeFor, s as writeTelemetryModule, u as telemetryArgs } from "./EndpointGenerator-errMeldx.mjs";
|
|
9
|
+
import { d as ConstructGenerator, f as output, h as eventsEdgeBucket, i as discover } from "./discover-CzGM5P3p.mjs";
|
|
10
10
|
import { ConfigNotFound, NotInAnApp, loadWorkspaceAppInfo, loadWorkspaceConfig } from "./config.mjs";
|
|
11
|
-
import {
|
|
11
|
+
import { i as readFakes, o as objectsRoute, r as readCredentialFakes, t as SubscriberGenerator } from "./SubscriberGenerator-BALddfuW.mjs";
|
|
12
|
+
import { c as runtimeOf } from "./resolve-fCGJmM-R.mjs";
|
|
12
13
|
import { basename, dirname, isAbsolute, join, parse, relative, resolve, sep } from "node:path";
|
|
13
14
|
import { constants, existsSync, readFileSync } from "node:fs";
|
|
14
15
|
import { appendFile, chmod, copyFile, mkdir, readFile, readdir, rm, stat, writeFile } from "node:fs/promises";
|
|
@@ -16,7 +17,7 @@ import { homedir, hostname, networkInterfaces, userInfo } from "node:os";
|
|
|
16
17
|
import { execFile, spawn } from "node:child_process";
|
|
17
18
|
import { createServer } from "node:net";
|
|
18
19
|
import { createCipheriv, createDecipheriv, createHash, randomBytes, randomInt } from "node:crypto";
|
|
19
|
-
import { CLIENT_IP_HEADER, DEFAULT_POSTGRES_VERSION, PUBLIC_PREFIX, TELEMETRY_KEYS, cacheTable, cookieDomain, dependenciesOf, dependentsOf, drawSecret, externalApiUrl, kebabCase, mobileOrigins, provideKey, providedKeyFor, provisionOrder, publicEnvFor, schemeBase } from "@geekmidas/manifest";
|
|
20
|
+
import { CLIENT_IP_HEADER, DEFAULT_POSTGRES_VERSION, PUBLIC_PREFIX, TELEMETRY_KEYS, bucketExpiry, cacheTable, cookieDomain, dependenciesOf, dependentsOf, drawSecret, externalApiUrl, kebabCase, mobileOrigins, provideKey, providedKeyFor, provisionOrder, publicEnvFor, schemeBase } from "@geekmidas/manifest";
|
|
20
21
|
import { formatKeyring, generateKeyring } from "@geekmidas/constructs/encryption";
|
|
21
22
|
import { ownerRole, readerRole, roleStatements } from "@geekmidas/db/pg/roles";
|
|
22
23
|
import * as snsUrl from "@geekmidas/events/sns/url";
|
|
@@ -25,6 +26,7 @@ import { cacheTableStatements } from "@geekmidas/cache/postgres";
|
|
|
25
26
|
import { config } from "dotenv";
|
|
26
27
|
import { promisify } from "node:util";
|
|
27
28
|
import { Cron } from "@geekmidas/constructs/crons";
|
|
29
|
+
import { Processor } from "@geekmidas/constructs/processors";
|
|
28
30
|
import { Queue } from "@geekmidas/constructs/queue";
|
|
29
31
|
import { CreateBucketCommand, DeleteBucketLifecycleCommand, GetBucketLifecycleConfigurationCommand, GetBucketNotificationConfigurationCommand, GetBucketPolicyCommand, HeadBucketCommand, ListBucketsCommand, PutBucketLifecycleConfigurationCommand, PutBucketNotificationConfigurationCommand, PutBucketPolicyCommand, S3Client } from "@aws-sdk/client-s3";
|
|
30
32
|
import { CreateTopicCommand, GetTopicAttributesCommand, SNSClient } from "@aws-sdk/client-sns";
|
|
@@ -486,6 +488,21 @@ function volumeOf(container) {
|
|
|
486
488
|
}[container];
|
|
487
489
|
}
|
|
488
490
|
//#endregion
|
|
491
|
+
//#region src/generators/processorRoute.ts
|
|
492
|
+
/**
|
|
493
|
+
* Where `gkm dev` serves a file server's processors, on the dev server of the
|
|
494
|
+
* app holding them: named after the file server.
|
|
495
|
+
*
|
|
496
|
+
* One definition for both sides — the dev server mounts it, and the local
|
|
497
|
+
* edge rewrites each processor pattern on the file server's host onto it — so
|
|
498
|
+
* the path the edge sends and the path the server answers cannot drift.
|
|
499
|
+
*/
|
|
500
|
+
const PROCESSORS_DEV_PREFIX = "/__gkm/processors/";
|
|
501
|
+
/** The base a file server's processors answer under, in `gkm dev`. */
|
|
502
|
+
function processorsDevRoute(fileServerId) {
|
|
503
|
+
return `${PROCESSORS_DEV_PREFIX}${fileServerId}`;
|
|
504
|
+
}
|
|
505
|
+
//#endregion
|
|
489
506
|
//#region src/reconcile/caddyfile.ts
|
|
490
507
|
/**
|
|
491
508
|
* The Caddy configuration a plan implies.
|
|
@@ -552,19 +569,26 @@ const LOCAL_TLD = "localhost";
|
|
|
552
569
|
* are a legitimate arrangement — two cache behaviours, one origin — and naming
|
|
553
570
|
* the host after the bucket would make them collide.
|
|
554
571
|
*/
|
|
555
|
-
function sitesFor(plan, project, addresses = {}) {
|
|
572
|
+
function sitesFor(plan, project, addresses = {}, processorAddresses = {}) {
|
|
556
573
|
const byId = new Map(plan.resources.map((r) => [r.id, r]));
|
|
557
574
|
const sites = [];
|
|
558
575
|
for (const resource of plan.resources) {
|
|
559
576
|
if (!EDGE_KINDS[resource.kind]) continue;
|
|
560
|
-
const host = hostFor(resource, project);
|
|
577
|
+
const host = hostFor$1(resource, project);
|
|
561
578
|
if (resource.kind === "file-server") {
|
|
562
579
|
const origin = resource.of ? byId.get(resource.of) : void 0;
|
|
563
580
|
if (!origin) continue;
|
|
581
|
+
const address = processorAddresses[resource.id];
|
|
582
|
+
const port = address ? portOf(address) : void 0;
|
|
564
583
|
sites.push({
|
|
565
584
|
host,
|
|
566
585
|
upstream: "http://minio:9000",
|
|
567
|
-
rewrite: `/${origin.name}{uri}
|
|
586
|
+
rewrite: `/${origin.name}{uri}`,
|
|
587
|
+
...resource.processors?.length && port ? { processors: {
|
|
588
|
+
prefixes: resource.processors,
|
|
589
|
+
upstream: `http://${HOST_GATEWAY$1}:${port}`,
|
|
590
|
+
under: processorsDevRoute(resource.id)
|
|
591
|
+
} } : {}
|
|
568
592
|
});
|
|
569
593
|
continue;
|
|
570
594
|
}
|
|
@@ -596,7 +620,7 @@ function portOf(address) {
|
|
|
596
620
|
* name, because an empty label makes `uploads..localhost` — a host nothing
|
|
597
621
|
* resolves and no certificate can be issued for.
|
|
598
622
|
*/
|
|
599
|
-
function hostFor(resource, project) {
|
|
623
|
+
function hostFor$1(resource, project) {
|
|
600
624
|
return [
|
|
601
625
|
resource.root && project ? stageOf(resource) : labelOf(resource),
|
|
602
626
|
project,
|
|
@@ -654,14 +678,24 @@ function toCaddyfile(sites) {
|
|
|
654
678
|
if (sites.length === 0) return `${GENERATED}
|
|
655
679
|
# No file server is declared in this stage, so it routes nothing.
|
|
656
680
|
`;
|
|
657
|
-
const blocks = sites.map(({ host, upstream, rewrite }) => `
|
|
681
|
+
const blocks = sites.map(({ host, upstream, rewrite, processors }) => `
|
|
658
682
|
https://${host} {
|
|
659
683
|
tls internal
|
|
660
684
|
|
|
661
685
|
# gkm's own header, which only a service of this stack may send: the auth
|
|
662
686
|
# server rate-limits by the client address it carries.
|
|
663
687
|
request_header -${CLIENT_IP_HEADER}
|
|
664
|
-
|
|
688
|
+
${processors ? `
|
|
689
|
+
# Its processors' patterns, to the dev server holding them — under the
|
|
690
|
+
# route it mounts them on. Answered there, so the bucket below never is.
|
|
691
|
+
@processors path ${processors.prefixes.map((prefix) => `${prefix}*`).join(" ")}
|
|
692
|
+
handle @processors {
|
|
693
|
+
reverse_proxy ${processors.upstream} {
|
|
694
|
+
rewrite ${processors.under}{uri}
|
|
695
|
+
header_up Host {host}
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
` : ""}
|
|
665
699
|
reverse_proxy ${upstream} {${rewrite ? `
|
|
666
700
|
rewrite ${rewrite}
|
|
667
701
|
# MinIO routes and signs on the Host header, so forwarding the requested
|
|
@@ -846,13 +880,14 @@ function nodeOf(manifest, id) {
|
|
|
846
880
|
return node?.kind === "telemetry" ? node : void 0;
|
|
847
881
|
}
|
|
848
882
|
/**
|
|
849
|
-
* The `Telemetry` node the process for `id` — a surface
|
|
850
|
-
* construct id — emits through, or undefined
|
|
883
|
+
* The `Telemetry` node the process for `id` — a surface, a worker, or a file
|
|
884
|
+
* server's processor unit, by construct id — emits through, or undefined
|
|
885
|
+
* when it has no edge to one.
|
|
851
886
|
*/
|
|
852
887
|
function telemetryOf(manifest, id) {
|
|
853
888
|
const declaration = manifest[id];
|
|
854
889
|
if (!declaration) return void 0;
|
|
855
|
-
if (declaration.kind === "worker") return nodeOf(manifest, declaration.telemetry);
|
|
890
|
+
if (declaration.kind === "worker" || declaration.kind === "file-server") return nodeOf(manifest, declaration.telemetry);
|
|
856
891
|
if (declaration.kind !== "rest-api") return void 0;
|
|
857
892
|
return nodeOf(manifest, declaration.telemetry);
|
|
858
893
|
}
|
|
@@ -866,7 +901,7 @@ function appTelemetry(manifest, appName) {
|
|
|
866
901
|
}
|
|
867
902
|
/** Whether any process in the manifest emits through a `Telemetry` node. */
|
|
868
903
|
function usesTelemetry(manifest) {
|
|
869
|
-
return Object.entries(manifest).some(([id, d]) => (d.kind === "rest-api" || d.kind === "worker") && telemetryOf(manifest, id) !== void 0);
|
|
904
|
+
return Object.entries(manifest).some(([id, d]) => (d.kind === "rest-api" || d.kind === "worker" || d.kind === "file-server") && telemetryOf(manifest, id) !== void 0);
|
|
870
905
|
}
|
|
871
906
|
/**
|
|
872
907
|
* One process's share of the telemetry keys a stage resolved: all of them,
|
|
@@ -1127,7 +1162,8 @@ function planFor(manifest, stage, order, options = {}) {
|
|
|
1127
1162
|
...declaration.scheme ? { scheme: declaration.scheme } : {}
|
|
1128
1163
|
} : {},
|
|
1129
1164
|
...declaration.kind === "file-server" && declaration.open?.length ? { open: declaration.open } : {},
|
|
1130
|
-
...declaration.kind === "
|
|
1165
|
+
...declaration.kind === "file-server" && declaration.processors?.length ? { processors: [...new Set(declaration.processors.map((p) => p.prefix))].sort() } : {},
|
|
1166
|
+
...declaration.kind === "objects" && bucketExpiry(manifest, id) ? { expire: bucketExpiry(manifest, id) } : {},
|
|
1131
1167
|
...(declaration.kind === "rest-api" || declaration.kind === "site") && declaration.subdomain ? { subdomain: declaration.subdomain } : {},
|
|
1132
1168
|
...fake ? { fake: {
|
|
1133
1169
|
key: fake.key,
|
|
@@ -1476,7 +1512,7 @@ function urlFor(resource, plan, ports, project, addresses, credential) {
|
|
|
1476
1512
|
if (resource.kind === "rest-api" || resource.kind === "site") {
|
|
1477
1513
|
const address = addresses?.[resource.id];
|
|
1478
1514
|
const edge = plan.containers.includes("caddy") ? ports[primaryPortKey("caddy")] : void 0;
|
|
1479
|
-
return address && edge !== void 0 ? `https://${hostFor(resource, project)}:${edge}` : address;
|
|
1515
|
+
return address && edge !== void 0 ? `https://${hostFor$1(resource, project)}:${edge}` : address;
|
|
1480
1516
|
}
|
|
1481
1517
|
if (!resource.container) return void 0;
|
|
1482
1518
|
const port = ports[primaryPortKey(resource.container)];
|
|
@@ -1503,7 +1539,7 @@ function urlFor(resource, plan, ports, project, addresses, credential) {
|
|
|
1503
1539
|
case "file-server": {
|
|
1504
1540
|
const origin = plan.resources.find((r) => r.id === resource.of);
|
|
1505
1541
|
if (!origin) return void 0;
|
|
1506
|
-
return plan.containers.includes("caddy") ? `https://${hostFor(resource, project)}:${port}` : `http://${LOCAL_HOST}:${port}/${origin.name}`;
|
|
1542
|
+
return plan.containers.includes("caddy") ? `https://${hostFor$1(resource, project)}:${port}` : `http://${LOCAL_HOST}:${port}/${origin.name}`;
|
|
1507
1543
|
}
|
|
1508
1544
|
case "cache":
|
|
1509
1545
|
if (resource.of) {
|
|
@@ -2863,14 +2899,7 @@ var WorkerNameTaken = class extends GkmError {
|
|
|
2863
2899
|
* @param background Each worker's files, from discovery's `background`.
|
|
2864
2900
|
*/
|
|
2865
2901
|
function workerUnits(workspace, manifest, background) {
|
|
2866
|
-
const hosts =
|
|
2867
|
-
const surface = Object.entries(manifest).find(([id, d]) => d.kind === "rest-api" && appKey(id) === name)?.[1];
|
|
2868
|
-
return {
|
|
2869
|
-
name,
|
|
2870
|
-
root: isAbsolute(app.path) ? app.path : join(workspace.root, app.path),
|
|
2871
|
-
generated: !(surface?.kind === "rest-api" && surface.endpoints.length > 0)
|
|
2872
|
-
};
|
|
2873
|
-
}).sort((a, b) => a.name.localeCompare(b.name));
|
|
2902
|
+
const hosts = hostApps(workspace, manifest);
|
|
2874
2903
|
const units = [];
|
|
2875
2904
|
for (const [id, declaration] of Object.entries(manifest)) {
|
|
2876
2905
|
if (declaration.kind !== "worker") continue;
|
|
@@ -2878,12 +2907,8 @@ function workerUnits(workspace, manifest, background) {
|
|
|
2878
2907
|
if (files.length === 0) continue;
|
|
2879
2908
|
const name = appKey(id);
|
|
2880
2909
|
if (workspace.apps[name]) throw new WorkerNameTaken(id, name);
|
|
2881
|
-
const
|
|
2882
|
-
|
|
2883
|
-
holds: files.filter((file) => isUnder(file, host.root)).length
|
|
2884
|
-
})).sort((a, b) => b.holds - a.holds || Number(b.host.generated) - Number(a.host.generated));
|
|
2885
|
-
const host = ranked[0]?.host;
|
|
2886
|
-
if (!host || ranked[0].holds === 0 && !host.generated) throw new WorkerHasNoApp(id);
|
|
2910
|
+
const host = hostFor(hosts, files);
|
|
2911
|
+
if (!host) throw new WorkerHasNoApp(id);
|
|
2887
2912
|
units.push({
|
|
2888
2913
|
id,
|
|
2889
2914
|
name,
|
|
@@ -2892,6 +2917,70 @@ function workerUnits(workspace, manifest, background) {
|
|
|
2892
2917
|
}
|
|
2893
2918
|
return units.sort((a, b) => a.name.localeCompare(b.name));
|
|
2894
2919
|
}
|
|
2920
|
+
/** The service and image name of a file server's processors: `assets-processors`. */
|
|
2921
|
+
function processorUnitName(fileServerId) {
|
|
2922
|
+
return `${appKey(fileServerId.replace(/Server$/, ""))}-processors`;
|
|
2923
|
+
}
|
|
2924
|
+
/** A file server with processors and no backend app to build them from. */
|
|
2925
|
+
var ProcessorsHaveNoApp = class extends GkmError {
|
|
2926
|
+
fileServer;
|
|
2927
|
+
constructor(fileServer) {
|
|
2928
|
+
super(`The file server '${fileServer}' has processors, and the workspace has no backend app that builds a server to carry their entry. Declare a RestApi whose app holds the processors' code.`);
|
|
2929
|
+
this.fileServer = fileServer;
|
|
2930
|
+
this.name = "ProcessorsHaveNoApp";
|
|
2931
|
+
}
|
|
2932
|
+
};
|
|
2933
|
+
/**
|
|
2934
|
+
* The processor units a workspace deploys — each file server with processors
|
|
2935
|
+
* — and the app each is built from, chosen as a worker's is: the backend app
|
|
2936
|
+
* holding the most of its processors' files.
|
|
2937
|
+
*/
|
|
2938
|
+
function processorUnits(workspace, manifest) {
|
|
2939
|
+
const hosts = hostApps(workspace, manifest);
|
|
2940
|
+
const units = [];
|
|
2941
|
+
for (const declaration of Object.values(manifest)) {
|
|
2942
|
+
if (declaration.kind !== "file-server") continue;
|
|
2943
|
+
const processors = declaration.processors ?? [];
|
|
2944
|
+
if (processors.length === 0) continue;
|
|
2945
|
+
const host = hostFor(hosts, processors.map(({ handler }) => {
|
|
2946
|
+
const file = handler.split("#")[0] ?? handler;
|
|
2947
|
+
return isAbsolute(file) ? file : join(workspace.root, file);
|
|
2948
|
+
}));
|
|
2949
|
+
if (!host) throw new ProcessorsHaveNoApp(declaration.id);
|
|
2950
|
+
const name = processorUnitName(declaration.id);
|
|
2951
|
+
if (workspace.apps[name]) throw new WorkerNameTaken(declaration.id, name);
|
|
2952
|
+
units.push({
|
|
2953
|
+
id: declaration.id,
|
|
2954
|
+
name,
|
|
2955
|
+
app: host.name
|
|
2956
|
+
});
|
|
2957
|
+
}
|
|
2958
|
+
return units.sort((a, b) => a.name.localeCompare(b.name));
|
|
2959
|
+
}
|
|
2960
|
+
/** The backend apps whose builds generate a server, each where it lives. */
|
|
2961
|
+
function hostApps(workspace, manifest) {
|
|
2962
|
+
return Object.entries(workspace.apps).filter(([, app]) => app.type === "backend" && !app.entry).map(([name, app]) => {
|
|
2963
|
+
const surface = Object.entries(manifest).find(([id, d]) => d.kind === "rest-api" && appKey(id) === name)?.[1];
|
|
2964
|
+
return {
|
|
2965
|
+
name,
|
|
2966
|
+
root: isAbsolute(app.path) ? app.path : join(workspace.root, app.path),
|
|
2967
|
+
generated: !(surface?.kind === "rest-api" && surface.endpoints.length > 0)
|
|
2968
|
+
};
|
|
2969
|
+
}).sort((a, b) => a.name.localeCompare(b.name));
|
|
2970
|
+
}
|
|
2971
|
+
/**
|
|
2972
|
+
* The app holding the most of these files; then one that generates a server;
|
|
2973
|
+
* then by name. None when no app holds any and none generates a server.
|
|
2974
|
+
*/
|
|
2975
|
+
function hostFor(hosts, files) {
|
|
2976
|
+
const ranked = hosts.map((host) => ({
|
|
2977
|
+
host,
|
|
2978
|
+
holds: files.filter((file) => isUnder(file, host.root)).length
|
|
2979
|
+
})).sort((a, b) => b.holds - a.holds || Number(b.host.generated) - Number(a.host.generated));
|
|
2980
|
+
const host = ranked[0]?.host;
|
|
2981
|
+
if (!host || ranked[0].holds === 0 && !host.generated) return void 0;
|
|
2982
|
+
return host;
|
|
2983
|
+
}
|
|
2895
2984
|
/** Whether `file` is inside `dir`. */
|
|
2896
2985
|
function isUnder(file, dir) {
|
|
2897
2986
|
const rel = relative(dir, file);
|
|
@@ -3541,6 +3630,8 @@ function generateBackendDockerfile(options) {
|
|
|
3541
3630
|
}
|
|
3542
3631
|
/** The port a worker answers its health check on, inside its container. */
|
|
3543
3632
|
const WORKER_PORT = 3e3;
|
|
3633
|
+
/** The port a processor unit answers on, inside its container. */
|
|
3634
|
+
const PROCESSOR_PORT = 3e3;
|
|
3544
3635
|
/**
|
|
3545
3636
|
* A Worker's image: the same build as its host app's backend — a pruned
|
|
3546
3637
|
* slice, `gkm build --provider server --production` in the image, with the
|
|
@@ -3557,6 +3648,19 @@ function generateWorkerDockerfile(options) {
|
|
|
3557
3648
|
expose: false
|
|
3558
3649
|
});
|
|
3559
3650
|
}
|
|
3651
|
+
/**
|
|
3652
|
+
* A file server's processor unit: its host app's build, and the unit's bundle
|
|
3653
|
+
* as the runner. Its native packages — `sharp` — are installed for the image's
|
|
3654
|
+
* platform beside the bundle, at the versions the build resolved.
|
|
3655
|
+
*/
|
|
3656
|
+
function generateProcessorDockerfile(options) {
|
|
3657
|
+
return gkmBundleDockerfile(options, {
|
|
3658
|
+
title: `Processors Dockerfile (${options.fileServer})`,
|
|
3659
|
+
bundle: options.bundle,
|
|
3660
|
+
as: "processors.mjs",
|
|
3661
|
+
expose: true
|
|
3662
|
+
});
|
|
3663
|
+
}
|
|
3560
3664
|
function gkmBundleDockerfile(options, runner) {
|
|
3561
3665
|
const { port, healthCheckPath = "/health" } = options;
|
|
3562
3666
|
const { app } = layout(options);
|
|
@@ -3583,7 +3687,7 @@ RUN apk add --no-cache tini
|
|
|
3583
3687
|
RUN addgroup --system --gid 1001 nodejs && \\
|
|
3584
3688
|
adduser --system --uid 1001 hono
|
|
3585
3689
|
|
|
3586
|
-
# The bundled ${runner.as
|
|
3690
|
+
# The bundled ${runner.as.replace(/\.mjs$/, "")}
|
|
3587
3691
|
COPY --from=builder --chown=hono:nodejs ${app}/.gkm/server/dist/${runner.bundle} ./${runner.as === runner.bundle ? "" : runner.as}${externals.copy}
|
|
3588
3692
|
|
|
3589
3693
|
ENV NODE_ENV=production
|
|
@@ -4075,7 +4179,7 @@ async function storeFromConfig(workspace, config, options = {}) {
|
|
|
4075
4179
|
const profile = options.profile ? { profile: options.profile } : {};
|
|
4076
4180
|
switch (config.provider) {
|
|
4077
4181
|
case "s3": {
|
|
4078
|
-
const { S3SecretsStore } = await import("./s3-
|
|
4182
|
+
const { S3SecretsStore } = await import("./s3-BZzSnker.mjs");
|
|
4079
4183
|
const { deployIdentity } = await import("./identity-CBXr4wNi.mjs").then((n) => n.r);
|
|
4080
4184
|
const location = s3SecretsLocation(config, workspace.state);
|
|
4081
4185
|
return new S3SecretsStore({
|
|
@@ -5679,7 +5783,7 @@ async function reconcile(options) {
|
|
|
5679
5783
|
...options.apps ? { apps: options.apps(plan.containers) } : {},
|
|
5680
5784
|
...options.objectWebhooks?.length ? { objectWebhooks: options.objectWebhooks } : {}
|
|
5681
5785
|
});
|
|
5682
|
-
const caddyfile = toCaddyfile(sitesFor(plan, project, options.addresses));
|
|
5786
|
+
const caddyfile = toCaddyfile(sitesFor(plan, project, options.addresses, options.processorAddresses));
|
|
5683
5787
|
const hash = planHash(plan, compose, {
|
|
5684
5788
|
caddyfile,
|
|
5685
5789
|
postgres: postgresStatements(plan, project, seed).map((statement) => statement.create).join(";\n")
|
|
@@ -5858,6 +5962,7 @@ var workspace_exports = /* @__PURE__ */ __exportAll({
|
|
|
5858
5962
|
fakesApply: () => fakesApply,
|
|
5859
5963
|
localObjectWebhooks: () => localObjectWebhooks,
|
|
5860
5964
|
metroPorts: () => metroPorts,
|
|
5965
|
+
processorAddresses: () => processorAddresses,
|
|
5861
5966
|
reconcileWorkspace: () => reconcileWorkspace,
|
|
5862
5967
|
surfaceAddresses: () => surfaceAddresses
|
|
5863
5968
|
});
|
|
@@ -5949,6 +6054,7 @@ async function reconcileWorkspace(workspace, options) {
|
|
|
5949
6054
|
...backendsOf(workspace),
|
|
5950
6055
|
saved: await loadPortState(workspace.root),
|
|
5951
6056
|
addresses: surfaceAddresses(workspace, manifest),
|
|
6057
|
+
processorAddresses: processorAddresses(workspace, manifest),
|
|
5952
6058
|
metroPorts: metroPorts(workspace, manifest),
|
|
5953
6059
|
fakes,
|
|
5954
6060
|
credentialFakes,
|
|
@@ -6015,6 +6121,19 @@ function metroPorts(workspace, manifest) {
|
|
|
6015
6121
|
return ports;
|
|
6016
6122
|
}
|
|
6017
6123
|
/**
|
|
6124
|
+
* Where each file server's processors answer locally: the dev server of the
|
|
6125
|
+
* app holding them, which `gkm dev` mounts them on — the same app whose build
|
|
6126
|
+
* writes their unit deployed.
|
|
6127
|
+
*/
|
|
6128
|
+
function processorAddresses(workspace, manifest) {
|
|
6129
|
+
const addresses = {};
|
|
6130
|
+
for (const unit of processorUnits(workspace, manifest)) {
|
|
6131
|
+
const port = workspace.apps[unit.app]?.port;
|
|
6132
|
+
if (port) addresses[unit.id] = localAddress(port);
|
|
6133
|
+
}
|
|
6134
|
+
return addresses;
|
|
6135
|
+
}
|
|
6136
|
+
/**
|
|
6018
6137
|
* Where each declared surface and site answers locally.
|
|
6019
6138
|
*
|
|
6020
6139
|
* The addresses come from the ports the workspace already assigns; which
|
|
@@ -6193,6 +6312,21 @@ function workerEnvKeys(manifest, workerId, runnables = {}) {
|
|
|
6193
6312
|
return keys;
|
|
6194
6313
|
}
|
|
6195
6314
|
/** What each construct an edge reaches hands the process that reaches it. */
|
|
6315
|
+
/**
|
|
6316
|
+
* The keys a file server's processor unit reads: its bucket's, and what each
|
|
6317
|
+
* of its processors depends on. `undefined` for a file server with none.
|
|
6318
|
+
*/
|
|
6319
|
+
function processorEnvKeys(manifest, fileServerId, runnables = {}) {
|
|
6320
|
+
const server = manifest[fileServerId];
|
|
6321
|
+
if (server?.kind !== "file-server" || !server.processors?.length) return;
|
|
6322
|
+
const keys = /* @__PURE__ */ new Set();
|
|
6323
|
+
addEdgeKeys(manifest, [
|
|
6324
|
+
server.of,
|
|
6325
|
+
...server.processors.flatMap((p) => p.dependencies.map((d) => d.target)),
|
|
6326
|
+
...runnables[fileServerId] ?? []
|
|
6327
|
+
], keys);
|
|
6328
|
+
return keys;
|
|
6329
|
+
}
|
|
6196
6330
|
function addEdgeKeys(manifest, edges, keys) {
|
|
6197
6331
|
for (const id of edges) {
|
|
6198
6332
|
const bucket = eventsEdgeBucket(id);
|
|
@@ -6660,6 +6794,308 @@ function validateImageRef(ref) {
|
|
|
6660
6794
|
return ref;
|
|
6661
6795
|
}
|
|
6662
6796
|
//#endregion
|
|
6797
|
+
//#region src/providers/processorOrigin.ts
|
|
6798
|
+
/**
|
|
6799
|
+
* A file server's processors as a CDN origin: the names both sides agree on.
|
|
6800
|
+
*
|
|
6801
|
+
* On a compose stage whose bucket is on S3, the CDN serves the bucket and
|
|
6802
|
+
* sends each processor pattern to the stack's processor unit, at a host of
|
|
6803
|
+
* its own. That host is public — a CDN reaches its origin over the internet —
|
|
6804
|
+
* so the CDN adds a secret header and the edge refuses any request without
|
|
6805
|
+
* it. One definition, read by the CDN that sends the header and by the stack
|
|
6806
|
+
* whose edge checks it, so the two cannot drift.
|
|
6807
|
+
*/
|
|
6808
|
+
/** The header the CDN adds to every request it sends a processor. */
|
|
6809
|
+
const ORIGIN_VERIFY_HEADER = "X-Gkm-Origin-Verify";
|
|
6810
|
+
/** Where a file server's processors answer the CDN: `<fileserver>-processors.<domain>`. */
|
|
6811
|
+
function processorOriginHost(serverId, domain) {
|
|
6812
|
+
return `${appKey(serverId)}-processors.${domain}`.toLowerCase();
|
|
6813
|
+
}
|
|
6814
|
+
/** The stage secret holding the header's value: `ASSETS_SERVER_ORIGIN_SECRET`. */
|
|
6815
|
+
function originSecretKey(serverId) {
|
|
6816
|
+
return provideKey(serverId, "originSecret");
|
|
6817
|
+
}
|
|
6818
|
+
/**
|
|
6819
|
+
* What the processor unit reads that secret from. Set wherever the CDN fronts
|
|
6820
|
+
* it, so the unit refuses a request without the header itself — on Dokploy,
|
|
6821
|
+
* whose edge cannot match a header, the only check; behind the stack's own
|
|
6822
|
+
* edge, a second one.
|
|
6823
|
+
*/
|
|
6824
|
+
const PROCESSOR_ORIGIN_SECRET_ENV = "GKM_PROCESSOR_ORIGIN_SECRET";
|
|
6825
|
+
/** A new value for that secret: random, generated once, kept in the stage. */
|
|
6826
|
+
function newOriginSecret() {
|
|
6827
|
+
return randomBytes(32).toString("base64url");
|
|
6828
|
+
}
|
|
6829
|
+
//#endregion
|
|
6830
|
+
//#region src/generators/ProcessorGenerator.ts
|
|
6831
|
+
/** Where a file server's processor entry lives, under an app's `.gkm/server`. */
|
|
6832
|
+
function processorEntryDir(serverDir, fileServerId) {
|
|
6833
|
+
return join(serverDir, "processors", processorUnitName(fileServerId));
|
|
6834
|
+
}
|
|
6835
|
+
/** The file its bundle is written to, beside the server's. */
|
|
6836
|
+
function processorBundleName(fileServerId) {
|
|
6837
|
+
return `${processorUnitName(fileServerId)}.mjs`;
|
|
6838
|
+
}
|
|
6839
|
+
/**
|
|
6840
|
+
* A file server's processors, as the build generates them.
|
|
6841
|
+
*
|
|
6842
|
+
* On AWS each is a Lambda behind a function URL — the CDN's origin for its
|
|
6843
|
+
* pattern. On a server they are one process per file server, the processor
|
|
6844
|
+
* unit (see {@link ProcessorGenerator.buildEntry}), so the `server` target
|
|
6845
|
+
* generates nothing per processor here.
|
|
6846
|
+
*/
|
|
6847
|
+
var ProcessorGenerator = class extends ConstructGenerator {
|
|
6848
|
+
isConstruct(value) {
|
|
6849
|
+
return Processor.isProcessor(value);
|
|
6850
|
+
}
|
|
6851
|
+
async build(context, constructs, outputDir, options) {
|
|
6852
|
+
if ((options?.target ?? "aws") !== "aws" || constructs.length === 0) return [];
|
|
6853
|
+
const dir = join(outputDir, "processors");
|
|
6854
|
+
await mkdir(dir, { recursive: true });
|
|
6855
|
+
const infos = [];
|
|
6856
|
+
for (const { key, construct, path } of constructs) {
|
|
6857
|
+
const file = join(dir, `${key}.ts`);
|
|
6858
|
+
const importPath = relative(dirname(file), path.relative).replace(/\.ts$/, ".js");
|
|
6859
|
+
await writeFile(file, `import { AWSLambdaProcessor } from '@geekmidas/constructs/processors';
|
|
6860
|
+
import { ${key} } from '${importPath}';
|
|
6861
|
+
${context.storageDrivers?.imports ?? ""}
|
|
6862
|
+
${context.storageDrivers?.setup ? `\n// The handler registers the drivers its target needs.\n${context.storageDrivers.setup}\n` : ""}
|
|
6863
|
+
const adapter = new AWSLambdaProcessor(${key});
|
|
6864
|
+
|
|
6865
|
+
export const handler = adapter.handler;
|
|
6866
|
+
`);
|
|
6867
|
+
infos.push(await processorInfo(key, construct, relative(options?.root ?? process.cwd(), file).replace(/\.ts$/, ".handler"), context));
|
|
6868
|
+
}
|
|
6869
|
+
return infos;
|
|
6870
|
+
}
|
|
6871
|
+
/**
|
|
6872
|
+
* `gkm dev`'s half: `processors.ts` beside the dev server's app, mounting
|
|
6873
|
+
* each file server's processors under `/__gkm/processors/<FileServer>`.
|
|
6874
|
+
* The local edge sends each pattern on the file server's host there, so
|
|
6875
|
+
* `processedUrl()` answers locally as it does deployed.
|
|
6876
|
+
*
|
|
6877
|
+
* In the dev server's own process rather than a unit of its own: locally
|
|
6878
|
+
* there is no CPU to protect, and the dev server already reloads on change.
|
|
6879
|
+
*/
|
|
6880
|
+
async buildDev(outputDir, processors) {
|
|
6881
|
+
await mkdir(outputDir, { recursive: true });
|
|
6882
|
+
const file = join(outputDir, "processors.ts");
|
|
6883
|
+
const imports = processors.map(({ key, path }) => {
|
|
6884
|
+
const specifier = relative(outputDir, path.absolute).replace(/\.ts$/, ".js");
|
|
6885
|
+
return `import { ${key} } from '${specifier.startsWith(".") ? specifier : `./${specifier}`}';`;
|
|
6886
|
+
}).join("\n");
|
|
6887
|
+
const byServer = /* @__PURE__ */ new Map();
|
|
6888
|
+
for (const { key, construct } of processors) byServer.set(construct.surfaceId, [...byServer.get(construct.surfaceId) ?? [], key]);
|
|
6889
|
+
const units = [...byServer.entries()].map(([id, keys]) => ` ${JSON.stringify(id)}: [${keys.join(", ")}],`).join("\n");
|
|
6890
|
+
await writeFile(file, `/**
|
|
6891
|
+
* Generated processors setup for \`gkm dev\`.
|
|
6892
|
+
*
|
|
6893
|
+
* Each file server's processors, under ${PROCESSORS_DEV_PREFIX}<FileServer>: the
|
|
6894
|
+
* local edge rewrites each processor pattern on the file server's host here.
|
|
6895
|
+
*/
|
|
6896
|
+
import type { EnvironmentParser } from '@geekmidas/envkit';
|
|
6897
|
+
import { processorServer } from '@geekmidas/constructs/processors';
|
|
6898
|
+
${imports}
|
|
6899
|
+
|
|
6900
|
+
export function setupProcessors(
|
|
6901
|
+
app: { all: (path: string, handler: (c: any) => unknown) => unknown },
|
|
6902
|
+
envParser: EnvironmentParser<any>,
|
|
6903
|
+
): void {
|
|
6904
|
+
const units: Record<string, ReturnType<typeof processorServer>> = Object.fromEntries(
|
|
6905
|
+
Object.entries({
|
|
6906
|
+
${units}
|
|
6907
|
+
}).map(([id, processors]) => [id, processorServer(processors, envParser)]),
|
|
6908
|
+
);
|
|
6909
|
+
|
|
6910
|
+
app.all('${PROCESSORS_DEV_PREFIX}:server/*', async (c: any) => {
|
|
6911
|
+
const server = c.req.param('server') as string;
|
|
6912
|
+
const serve = units[server];
|
|
6913
|
+
if (!serve) return c.notFound();
|
|
6914
|
+
const path = c.req.path.slice(\`${PROCESSORS_DEV_PREFIX}\${server}\`.length) || '/';
|
|
6915
|
+
const response = await serve({ method: c.req.method, path });
|
|
6916
|
+
if (!response) {
|
|
6917
|
+
return new Response(null, {
|
|
6918
|
+
status: 404,
|
|
6919
|
+
headers: { 'cache-control': 'public, max-age=60' },
|
|
6920
|
+
});
|
|
6921
|
+
}
|
|
6922
|
+
return new Response(c.req.method === 'HEAD' ? null : response.body, {
|
|
6923
|
+
status: response.status,
|
|
6924
|
+
headers: response.headers,
|
|
6925
|
+
});
|
|
6926
|
+
});
|
|
6927
|
+
}
|
|
6928
|
+
`);
|
|
6929
|
+
return file;
|
|
6930
|
+
}
|
|
6931
|
+
/**
|
|
6932
|
+
* A file server's processor unit: one process answering each of its
|
|
6933
|
+
* processors' patterns, and `/health`. Returns its entry, `processors.ts`.
|
|
6934
|
+
*
|
|
6935
|
+
* Its own process because making a derivative is CPU-bound — a resize
|
|
6936
|
+
* spike in the API's process would be every request's latency.
|
|
6937
|
+
*/
|
|
6938
|
+
async buildEntry(input) {
|
|
6939
|
+
const { context, outputDir, processors } = input;
|
|
6940
|
+
await mkdir(outputDir, { recursive: true });
|
|
6941
|
+
await writeTelemetryModule(outputDir, input.telemetry);
|
|
6942
|
+
const healthCheck = context.production?.healthCheck ?? "/health";
|
|
6943
|
+
const imports = processors.map(({ key, path }) => {
|
|
6944
|
+
const specifier = relative(outputDir, path.absolute).replace(/\.ts$/, ".js");
|
|
6945
|
+
return `import { ${key} } from '${specifier.startsWith(".") ? specifier : `./${specifier}`}';`;
|
|
6946
|
+
}).join("\n");
|
|
6947
|
+
const entry = join(outputDir, "processors.ts");
|
|
6948
|
+
await writeFile(entry, `#!/usr/bin/env node
|
|
6949
|
+
/**
|
|
6950
|
+
* Production entry for ${input.fileServerId}'s processors.
|
|
6951
|
+
* Generated by 'gkm build --production'.
|
|
6952
|
+
*
|
|
6953
|
+
* Answers each processor's pattern, and ${healthCheck} on PORT. The edge
|
|
6954
|
+
* routes only those patterns here; everything else on the file server's
|
|
6955
|
+
* domain is the bucket.
|
|
6956
|
+
*/
|
|
6957
|
+
import { timingSafeEqual } from 'node:crypto';
|
|
6958
|
+
import { createServer } from 'node:http';
|
|
6959
|
+
import { runShutdownHooks } from '@geekmidas/constructs';
|
|
6960
|
+
import { processorServer } from '@geekmidas/constructs/processors';
|
|
6961
|
+
${context.storageDrivers?.imports ?? ""}
|
|
6962
|
+
${imports}
|
|
6963
|
+
|
|
6964
|
+
${startTelemetryCode([healthCheck])}
|
|
6965
|
+
${context.storageDrivers?.setup ? `// The entry point registers the drivers its target needs.\n${context.storageDrivers.setup}\n` : ""}
|
|
6966
|
+
process.env.GKM_APP_NAME ??= ${JSON.stringify(processorUnitName(input.fileServerId))};
|
|
6967
|
+
|
|
6968
|
+
const processors = [${processors.map(({ key }) => key).join(", ")}];
|
|
6969
|
+
const serve = processorServer(processors);
|
|
6970
|
+
const port = Number(process.env.PORT) || 3000;
|
|
6971
|
+
let stopping = false;
|
|
6972
|
+
|
|
6973
|
+
${input.telemetry ? REQUEST_SPANS : NO_REQUEST_SPANS}
|
|
6974
|
+
// Where the CDN fronts this unit, the secret it adds to every request: one
|
|
6975
|
+
// without it is refused here, whatever the edge in front did or could not.
|
|
6976
|
+
const originSecret = process.env.${PROCESSOR_ORIGIN_SECRET_ENV}
|
|
6977
|
+
? Buffer.from(process.env.${PROCESSOR_ORIGIN_SECRET_ENV})
|
|
6978
|
+
: undefined;
|
|
6979
|
+
const fromOrigin = (header: string | string[] | undefined) => {
|
|
6980
|
+
if (!originSecret) return true;
|
|
6981
|
+
const given = Buffer.from(typeof header === 'string' ? header : '');
|
|
6982
|
+
return given.length === originSecret.length && timingSafeEqual(given, originSecret);
|
|
6983
|
+
};
|
|
6984
|
+
|
|
6985
|
+
const server = createServer(async (req, res) => {
|
|
6986
|
+
const method = req.method ?? 'GET';
|
|
6987
|
+
const path = (req.url ?? '/').split('?')[0] ?? '/';
|
|
6988
|
+
if (path === ${JSON.stringify(healthCheck)}) {
|
|
6989
|
+
res.writeHead(stopping ? 503 : 200, { 'content-type': 'application/json' });
|
|
6990
|
+
res.end(JSON.stringify({ status: stopping ? 'stopping' : 'ok' }));
|
|
6991
|
+
return;
|
|
6992
|
+
}
|
|
6993
|
+
if (!fromOrigin(req.headers[${JSON.stringify(ORIGIN_VERIFY_HEADER.toLowerCase())}])) {
|
|
6994
|
+
res.writeHead(403, { 'cache-control': 'no-store' }).end();
|
|
6995
|
+
return;
|
|
6996
|
+
}
|
|
6997
|
+
await traced(method, path, async () => {
|
|
6998
|
+
try {
|
|
6999
|
+
const response = await serve({ method, path });
|
|
7000
|
+
if (!response) {
|
|
7001
|
+
res.writeHead(404, { 'cache-control': 'public, max-age=60' }).end();
|
|
7002
|
+
return 404;
|
|
7003
|
+
}
|
|
7004
|
+
res.writeHead(response.status, response.headers);
|
|
7005
|
+
res.end(method === 'HEAD' ? undefined : response.body);
|
|
7006
|
+
return response.status;
|
|
7007
|
+
} catch (error) {
|
|
7008
|
+
console.error(error);
|
|
7009
|
+
res.writeHead(500, { 'cache-control': 'no-store' }).end();
|
|
7010
|
+
return 500;
|
|
7011
|
+
}
|
|
7012
|
+
});
|
|
7013
|
+
});
|
|
7014
|
+
server.listen(port);
|
|
7015
|
+
|
|
7016
|
+
const shutdown = async () => {
|
|
7017
|
+
if (stopping) return;
|
|
7018
|
+
stopping = true;
|
|
7019
|
+
setTimeout(() => process.exit(1), Number(process.env.GKM_SHUTDOWN_TIMEOUT_MS) || 8000).unref();
|
|
7020
|
+
server.close();
|
|
7021
|
+
await runShutdownHooks((error) => console.error(error));
|
|
7022
|
+
process.exit(0);
|
|
7023
|
+
};
|
|
7024
|
+
process.on('SIGTERM', shutdown);
|
|
7025
|
+
process.on('SIGINT', shutdown);
|
|
7026
|
+
`);
|
|
7027
|
+
return entry;
|
|
7028
|
+
}
|
|
7029
|
+
};
|
|
7030
|
+
/**
|
|
7031
|
+
* A SERVER span per request, once telemetry has started — opened by the unit
|
|
7032
|
+
* rather than by hooking node:http, which sees nothing inside a bundle. Named
|
|
7033
|
+
* after the processor's pattern, never the key, which has no bound.
|
|
7034
|
+
*
|
|
7035
|
+
* Only in an entry whose file server has a `Telemetry` node: the bundle
|
|
7036
|
+
* follows the import, and an app without one need not install the API.
|
|
7037
|
+
*/
|
|
7038
|
+
const REQUEST_SPANS = `const tracing = requestSpans ? await import('@opentelemetry/api') : undefined;
|
|
7039
|
+
const routeOf = (path: string) =>
|
|
7040
|
+
processors.find((processor) => path.startsWith(processor.prefix))?.pattern;
|
|
7041
|
+
|
|
7042
|
+
async function traced(
|
|
7043
|
+
method: string,
|
|
7044
|
+
path: string,
|
|
7045
|
+
run: () => Promise<number>,
|
|
7046
|
+
): Promise<void> {
|
|
7047
|
+
if (!tracing) {
|
|
7048
|
+
await run();
|
|
7049
|
+
return;
|
|
7050
|
+
}
|
|
7051
|
+
const route = routeOf(path);
|
|
7052
|
+
await tracing.trace.getTracer('@geekmidas/processors').startActiveSpan(
|
|
7053
|
+
route ? \`\${method} \${route}\` : method,
|
|
7054
|
+
{
|
|
7055
|
+
kind: tracing.SpanKind.SERVER,
|
|
7056
|
+
attributes: {
|
|
7057
|
+
'http.request.method': method,
|
|
7058
|
+
'url.path': path,
|
|
7059
|
+
...(route ? { 'http.route': route } : {}),
|
|
7060
|
+
},
|
|
7061
|
+
},
|
|
7062
|
+
async (span) => {
|
|
7063
|
+
try {
|
|
7064
|
+
const status = await run();
|
|
7065
|
+
span.setAttribute('http.response.status_code', status);
|
|
7066
|
+
if (status >= 500) span.setStatus({ code: tracing.SpanStatusCode.ERROR });
|
|
7067
|
+
} finally {
|
|
7068
|
+
span.end();
|
|
7069
|
+
}
|
|
7070
|
+
},
|
|
7071
|
+
);
|
|
7072
|
+
}
|
|
7073
|
+
`;
|
|
7074
|
+
/** The same shape without telemetry: each request just runs. */
|
|
7075
|
+
const NO_REQUEST_SPANS = `async function traced(
|
|
7076
|
+
_method: string,
|
|
7077
|
+
_path: string,
|
|
7078
|
+
run: () => Promise<number>,
|
|
7079
|
+
): Promise<void> {
|
|
7080
|
+
await run();
|
|
7081
|
+
}
|
|
7082
|
+
`;
|
|
7083
|
+
/** What the manifest records of one processor. */
|
|
7084
|
+
async function processorInfo(name, processor, handler, context) {
|
|
7085
|
+
return {
|
|
7086
|
+
name,
|
|
7087
|
+
handler,
|
|
7088
|
+
fileServer: processor.surfaceId,
|
|
7089
|
+
path: processor.pattern,
|
|
7090
|
+
prefix: processor.prefix,
|
|
7091
|
+
...processor.native.length ? { native: [...processor.native] } : {},
|
|
7092
|
+
...processor.timeout !== void 0 ? { timeout: processor.timeout } : {},
|
|
7093
|
+
...processor.memorySize !== void 0 ? { memorySize: processor.memorySize } : {},
|
|
7094
|
+
environment: await processor.getEnvironment({ markOptional: context.markOptional }),
|
|
7095
|
+
dependencies: processor.constructs
|
|
7096
|
+
};
|
|
7097
|
+
}
|
|
7098
|
+
//#endregion
|
|
6663
7099
|
//#region src/generators/CronGenerator.ts
|
|
6664
7100
|
var CronGenerator = class extends ConstructGenerator {
|
|
6665
7101
|
async build(context, constructs, outputDir, options) {
|
|
@@ -7570,6 +8006,25 @@ async function workspaceDockerCommand(workspace, manifest, imageNames = {}, back
|
|
|
7570
8006
|
imageName: imageNames[worker.name] ?? worker.name
|
|
7571
8007
|
});
|
|
7572
8008
|
}
|
|
8009
|
+
for (const unit of manifest ? processorUnits(workspace, manifest) : []) {
|
|
8010
|
+
logger$1.log(`\n 📄 Generating Dockerfile for ${unit.name} (processors of ${unit.id}, built from ${unit.app})`);
|
|
8011
|
+
const dockerfile = processorDockerfile(unit, workspace.apps[unit.app], {
|
|
8012
|
+
layout,
|
|
8013
|
+
workspaceRoot: workspace.root,
|
|
8014
|
+
native: processorNative(manifest, unit.id)
|
|
8015
|
+
});
|
|
8016
|
+
const path = workerDockerfileOf(unit.name);
|
|
8017
|
+
const dockerfilePath = join(workspace.root, path);
|
|
8018
|
+
await mkdir(dirname(dockerfilePath), { recursive: true });
|
|
8019
|
+
await writeFile(dockerfilePath, dockerfile);
|
|
8020
|
+
logger$1.log(` Generated: ${path}`);
|
|
8021
|
+
results.push({
|
|
8022
|
+
appName: unit.name,
|
|
8023
|
+
type: "backend",
|
|
8024
|
+
dockerfile: dockerfilePath,
|
|
8025
|
+
imageName: imageNames[unit.name] ?? unit.name
|
|
8026
|
+
});
|
|
8027
|
+
}
|
|
7573
8028
|
const dockerignorePath = await ensureDockerignore(layout.buildRoot);
|
|
7574
8029
|
logger$1.log(`\n Ensured: ${dockerignorePath}`);
|
|
7575
8030
|
const composePath = await writeConstructsCompose(workspace);
|
|
@@ -7629,6 +8084,29 @@ function workerDockerfile(worker, host, options) {
|
|
|
7629
8084
|
...options.cache ? { cache: options.cache } : {}
|
|
7630
8085
|
});
|
|
7631
8086
|
}
|
|
8087
|
+
/** The native packages a file server's processors named, once each. */
|
|
8088
|
+
function processorNative(manifest, fileServerId) {
|
|
8089
|
+
const server = manifest[fileServerId];
|
|
8090
|
+
if (server?.kind !== "file-server") return [];
|
|
8091
|
+
return [...new Set((server.processors ?? []).flatMap((p) => p.native ?? []))].sort();
|
|
8092
|
+
}
|
|
8093
|
+
/**
|
|
8094
|
+
* A file server's processor unit's Dockerfile: its host app's build, and the
|
|
8095
|
+
* unit's bundle as the runner, with its processors' native packages
|
|
8096
|
+
* installed beside it — see `generateProcessorDockerfile`.
|
|
8097
|
+
*/
|
|
8098
|
+
function processorDockerfile(unit, host, options) {
|
|
8099
|
+
return generateProcessorDockerfile({
|
|
8100
|
+
...appImageOptions(options.layout, unit.app, host, options.workspaceRoot),
|
|
8101
|
+
imageName: unit.name,
|
|
8102
|
+
port: PROCESSOR_PORT,
|
|
8103
|
+
fileServer: unit.id,
|
|
8104
|
+
bundle: processorBundleName(unit.id),
|
|
8105
|
+
healthCheckPath: "/health",
|
|
8106
|
+
...options.native.length ? { external: [...options.native] } : {},
|
|
8107
|
+
...options.cache ? { cache: options.cache } : {}
|
|
8108
|
+
});
|
|
8109
|
+
}
|
|
7632
8110
|
/**
|
|
7633
8111
|
* A site's Dockerfile, with an `ARG` for every key its bundler inlines.
|
|
7634
8112
|
*
|
|
@@ -7806,7 +8284,7 @@ async function createDnsProvider(options) {
|
|
|
7806
8284
|
});
|
|
7807
8285
|
}
|
|
7808
8286
|
if (provider === "godaddy") {
|
|
7809
|
-
const { GoDaddyProvider } = await import("./GoDaddyProvider-
|
|
8287
|
+
const { GoDaddyProvider } = await import("./GoDaddyProvider-CvRVmN4W.mjs");
|
|
7810
8288
|
return new GoDaddyProvider(options.godaddy ?? {});
|
|
7811
8289
|
}
|
|
7812
8290
|
if (provider === "cloudflare") throw new DnsProviderNotImplemented("cloudflare");
|
|
@@ -8655,6 +9133,6 @@ function reportPlannedSeeds(planned, log) {
|
|
|
8655
9133
|
for (const { folder, seeds } of planned) log(`🌱 ${folder}: would run ${seeds.length} (${seeds.join(", ")})`);
|
|
8656
9134
|
}
|
|
8657
9135
|
//#endregion
|
|
8658
|
-
export {
|
|
9136
|
+
export { ORIGIN_VERIFY_HEADER as $, telemetryOf as $n, maskPassword as $t, StageProviderDisabled as A, postgresSuperuser as An, LEGACY_LOCAL_LOGIN as At, processorDockerfile as B, redisService as Bn, createCredentialsPreload as Bt, recordRollback as C, postgresDatabaseNames as Cn, backendsOf as Ct, setPostgresBackupId as D, LOCAL_RABBITMQ_USER as Dn, workspace_exports as Dt, setGeneratedSecret as E, mergeLifecycle as En, reconcileWorkspace as Et, DockerBuildFailed as F, projectKey as Fn, composeFor as Ft, workerBundleName as G, localRolePassword as Gn, loadPortState as Gt, workerDockerfile as H, stackRedis as Hn, findAvailablePort as Ht, DockerPushFailed as I, readKey as In, cacheBackendFor as It, CronGenerator as J, resourceName as Jn, isRemoteStore as Jt, workerEntryDir as K, TELEMETRY_CONTAINER as Kn, loadSecretsForApp as Kt, appDockerfile as L, withGeneratedSecrets as Ln, eventsBackendFor as Lt, provisionCommand as M, FileSecretsStore as Mn, bucketClient as Mt, stageProviderNotes as N, getKeyPath as Nn, pgClient as Nt, DnsRecordsUnreadable as O, loadLocalCredentials as On, LOCAL_CA_PATH as Ot, PROVIDER_KINDS as P, keystoreProject as Pn, CLUSTER_DATABASE as Pt, processorInfo as Q, surfaceClientTraced as Qn, initStageSecrets as Qt, dockerCommand as R, REDIS_SERVICE as Rn, providerOf as Rt, recordRelease as S, bucketPolicies as Sn, FAKE_ENV as St, setBackupState as T, quoteIdentifier as Tn, derivedContainers as Tt, workerDockerfileOf as U, withRedisPassword as Un, isPortAvailable as Ut, processorNative as V, runsRedis as Vn, createEntryWrapper as Vt, WorkerGenerator as W, envFor as Wn, loadEnvFiles as Wt, processorBundleName as X, isTelemetryKey as Xn, storeFromConfig as Xt, ProcessorGenerator as Y, appTelemetry as Yn, secretsStoreFor as Yt, processorEntryDir as Z, scopeTelemetryEnv as Zn, store_exports as Zt, asDokployState as _, applyLifecycles as _n, withLogsPassword as _r, appEnvKeys as _t, dnsResources as a, PROCESSOR_PORT as an, DEFAULT_IMAGES as ar, AllowDevServicesTakesNoValue as at, getBackupState as b, applyPostgres as bn, resolveHost as br, processorEnvKeys as bt, currentActor as c, detectPackageManager as cn, portKeys as cr, ExternalServicesNotConfigured as ct, DeployJournal as d, isImageBuild as dn, primaryPortKey as dr, devServicesUsed as dt, storage_exports as en, usesTelemetry as er, PROCESSOR_ORIGIN_SECRET_ENV as et, extractSubdomain as f, publicBuildValues as fn, LOCAL_LOGS_EMAIL as fr, externalServices as ft, verifyDnsRecords as g, applyBuckets as gn, stackLogs as gr, suppliedOnly as gt, orchestrateDns as h, workerUnits as hn, logsService as hr, stageServiceDeclarations as ht, dnsRecordResource as i, imageLayout as in, hostFor$1 as ir, validateImageRef as it, assertStageProvidersEnabled as j, readLocalCredentials as jn, ensurePostgresLogin as jt, createDnsProvider as k, postgresRoleSlug as kn, forgetState as kt, describeActor as l, findBuildRoot as ln, portsOf as lr, STORAGE_KEY_PAIR as lt, normalizeDnsConfig as m, processorUnits as mn, logsAccess as mr, requiredStageKeys as mt, reportDatabaseRuns as n, withCustomSecret as nn, watchedBuckets as nr, originSecretKey as nt, forgetDnsResource as o, TURBO_VERSION as on, describeServices as or, DEV_SERVICES as ot, findRootDomain as p, isUnder as pn, LOGS_SERVICE as pr, reportDevServices as pt, QueueGenerator as q, planFor as qn, prepareEntryCredentials as qt, reportPlannedSeeds as r, composeBuildPaths as rn, EMULATOR_ACCESS_KEY_ID as rr, processorOriginHost as rt, recordDnsChanges as s, WORKER_PORT as sn, fakeKey as sr, DevServicesNeedServerTarget as st, DeploySeedsFailed as t, toEmbeddableSecrets as tn, minioWebhookEnv as tr, newOriginSecret as tt, isCi as u, imageBuildCredentials as un, postgresImage as ur, assertDevServicesFlag as ut, createComposeState as v, applyNotifications as vn, NoDomainForStage as vr, dockerfileOf as vt, setApplicationId as w, postgresStatements as wn, constructGlobs as wt, getGeneratedSecret as x, bucketLifecycles as xn, workerEnvKeys as xt, createEmptyState as y, applyPolicies as yn, isMainFrontendApp as yr, networkEnv as yt, ensureDockerignore as z, STACK_CACHE as zn, storageBackendFor as zt };
|
|
8659
9137
|
|
|
8660
|
-
//# sourceMappingURL=seeds-
|
|
9138
|
+
//# sourceMappingURL=seeds-Cfejy8wj.mjs.map
|