@geekmidas/cli 10.0.0-alpha.184 → 10.0.0-alpha.185
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-BtDLNkIH.cjs → LegacyStateStore-BtN83gfS.cjs} +2 -2
- package/dist/{LegacyStateStore-BtDLNkIH.cjs.map → LegacyStateStore-BtN83gfS.cjs.map} +1 -1
- package/dist/{LegacyStateStore-CTfoMtC2.mjs → LegacyStateStore-DKyEAWGI.mjs} +2 -2
- package/dist/{LegacyStateStore-CTfoMtC2.mjs.map → LegacyStateStore-DKyEAWGI.mjs.map} +1 -1
- package/dist/{LocalStateStore-BKp45OoB.cjs → LocalStateStore-BFh6rPhX.cjs} +2 -2
- package/dist/{LocalStateStore-BKp45OoB.cjs.map → LocalStateStore-BFh6rPhX.cjs.map} +1 -1
- package/dist/{LocalStateStore-C4zDHVM-.mjs → LocalStateStore-Dc3aGvQi.mjs} +2 -2
- package/dist/{LocalStateStore-C4zDHVM-.mjs.map → LocalStateStore-Dc3aGvQi.mjs.map} +1 -1
- package/dist/{S3StateStore-B6SjbLxh.cjs → S3StateStore-DZMpqbvD.cjs} +5 -5
- package/dist/{S3StateStore-B6SjbLxh.cjs.map → S3StateStore-DZMpqbvD.cjs.map} +1 -1
- package/dist/{S3StateStore-S0TXLlMW.mjs → S3StateStore-p6DyuAFZ.mjs} +4 -4
- package/dist/{S3StateStore-S0TXLlMW.mjs.map → S3StateStore-p6DyuAFZ.mjs.map} +1 -1
- package/dist/{SSMStateStore-ClPHFhRQ.mjs → SSMStateStore-BvH8XX4O.mjs} +2 -2
- package/dist/{SSMStateStore-ClPHFhRQ.mjs.map → SSMStateStore-BvH8XX4O.mjs.map} +1 -1
- package/dist/{SSMStateStore-6Di_zxwC.cjs → SSMStateStore-sbaLlCmj.cjs} +2 -2
- package/dist/{SSMStateStore-6Di_zxwC.cjs.map → SSMStateStore-sbaLlCmj.cjs.map} +1 -1
- package/dist/{add-Bd9MDHuU.cjs → add-CdVGxiKW.cjs} +13 -14
- package/dist/{add-Bd9MDHuU.cjs.map → add-CdVGxiKW.cjs.map} +1 -1
- package/dist/{add-BR8XW4IH.mjs → add-dOvgsAU6.mjs} +4 -5
- package/dist/{add-BR8XW4IH.mjs.map → add-dOvgsAU6.mjs.map} +1 -1
- package/dist/backups/runner.cjs +501 -13
- package/dist/backups/runner.cjs.map +1 -1
- package/dist/backups/runner.d.cts +87 -2
- package/dist/backups/runner.d.cts.map +1 -1
- package/dist/backups/runner.d.mts +87 -2
- package/dist/backups/runner.d.mts.map +1 -1
- package/dist/backups/runner.mjs +493 -15
- package/dist/backups/runner.mjs.map +1 -1
- package/dist/{bundler-4E-CGdL3.cjs → bundler-B5ioF-1Q.cjs} +9 -9
- package/dist/{bundler-4E-CGdL3.cjs.map → bundler-B5ioF-1Q.cjs.map} +1 -1
- package/dist/{bundler-Cwr4YSpp.mjs → bundler-Cvx6Bt3e.mjs} +6 -6
- package/dist/{bundler-Cwr4YSpp.mjs.map → bundler-Cvx6Bt3e.mjs.map} +1 -1
- package/dist/{cli-C3mHXsAE.mjs → cli-BjapgcXG.mjs} +4 -4
- package/dist/{cli-C3mHXsAE.mjs.map → cli-BjapgcXG.mjs.map} +1 -1
- package/dist/{cli-CrPJr29x.cjs → cli-PLhqvPOC.cjs} +6 -6
- package/dist/{cli-CrPJr29x.cjs.map → cli-PLhqvPOC.cjs.map} +1 -1
- package/dist/{clientTelemetry-Ej1tf1VE.d.cts → clientTelemetry-Bzc4KXz5.d.mts} +2 -2
- package/dist/clientTelemetry-Bzc4KXz5.d.mts.map +1 -0
- package/dist/{clientTelemetry-crdjgehZ.d.mts → clientTelemetry-N8NAguGI.d.cts} +2 -2
- package/dist/clientTelemetry-N8NAguGI.d.cts.map +1 -0
- package/dist/{compose-CKBieltT.cjs → compose-BEVBxf4w.cjs} +87 -948
- package/dist/compose-BEVBxf4w.cjs.map +1 -0
- package/dist/{compose-DPXoarGI.mjs → compose-Dx_nSZYU.mjs} +23 -842
- package/dist/compose-Dx_nSZYU.mjs.map +1 -0
- package/dist/{config-q4ewzIA_.d.mts → config-CTrfNKYd.d.mts} +3 -3
- package/dist/{config-lSOwPbUy.d.cts.map → config-CTrfNKYd.d.mts.map} +1 -1
- package/dist/{config-lSOwPbUy.d.cts → config-D9g_nYIu.d.cts} +3 -3
- package/dist/{config-q4ewzIA_.d.mts.map → config-D9g_nYIu.d.cts.map} +1 -1
- package/dist/config.cjs +1 -1
- package/dist/config.d.cts +3 -3
- package/dist/config.d.mts +3 -3
- package/dist/config.mjs +1 -1
- package/dist/{compose-CJznzQc7.mjs → credentials-DW5MvS4A.mjs} +1148 -1261
- package/dist/credentials-DW5MvS4A.mjs.map +1 -0
- package/dist/{compose-CvNyjqwL.cjs → credentials-Eyx2tM7B.cjs} +1175 -1288
- package/dist/credentials-Eyx2tM7B.cjs.map +1 -0
- package/dist/{dns-BzYrbB2Y.cjs → credentials-n2abUWwJ.cjs} +6 -847
- package/dist/credentials-n2abUWwJ.cjs.map +1 -0
- package/dist/{dns-C0wbTjVX.mjs → credentials-ztezRtR4.mjs} +5 -708
- package/dist/credentials-ztezRtR4.mjs.map +1 -0
- package/dist/{dbTunnel-DSzAG_wy.cjs → dbTunnel-DVohSZJQ.cjs} +8 -9
- package/dist/{dbTunnel-DSzAG_wy.cjs.map → dbTunnel-DVohSZJQ.cjs.map} +1 -1
- package/dist/{dbTunnel-CphoKGyk.mjs → dbTunnel-bV1CPWUv.mjs} +5 -6
- package/dist/{dbTunnel-CphoKGyk.mjs.map → dbTunnel-bV1CPWUv.mjs.map} +1 -1
- package/dist/deploy/public.cjs +25 -26
- package/dist/deploy/public.cjs.map +1 -1
- package/dist/deploy/public.d.cts +5 -5
- package/dist/deploy/public.d.mts +5 -5
- package/dist/deploy/public.mjs +10 -11
- package/dist/deploy/public.mjs.map +1 -1
- package/dist/{deploy-BaSYxpny.cjs → deploy-CDUWcl58.cjs} +72 -62
- package/dist/deploy-CDUWcl58.cjs.map +1 -0
- package/dist/{deploy-C_uZBzvS.mjs → deploy-Cpz5sKbh.mjs} +25 -15
- package/dist/deploy-Cpz5sKbh.mjs.map +1 -0
- package/dist/{destroy-yTBmL1jf.mjs → destroy-DRlcWJwm.mjs} +9 -9
- package/dist/{destroy-yTBmL1jf.mjs.map → destroy-DRlcWJwm.mjs.map} +1 -1
- package/dist/{destroy-PvrHxZDu.cjs → destroy-DzeV0EdY.cjs} +21 -21
- package/dist/{destroy-PvrHxZDu.cjs.map → destroy-DzeV0EdY.cjs.map} +1 -1
- package/dist/{dokploy-DYUMx2MY.cjs → dokploy-BTNfj3Zt.cjs} +2 -2
- package/dist/{dokploy-DYUMx2MY.cjs.map → dokploy-BTNfj3Zt.cjs.map} +1 -1
- package/dist/{dokploy-DqL3jeDu.mjs → dokploy-BveqiW2h.mjs} +2 -2
- package/dist/{dokploy-DqL3jeDu.mjs.map → dokploy-BveqiW2h.mjs.map} +1 -1
- package/dist/{eas-DHDU86PL.mjs → eas-BmYTfjY6.mjs} +3 -3
- package/dist/{eas-DHDU86PL.mjs.map → eas-BmYTfjY6.mjs.map} +1 -1
- package/dist/{eas-DEM-iWg6.cjs → eas-Dt_vRzb4.cjs} +3 -3
- package/dist/{eas-DEM-iWg6.cjs.map → eas-Dt_vRzb4.cjs.map} +1 -1
- package/dist/{encryption-BKWmbKkN.cjs → encryption-BE2wxfyH.cjs} +6 -6
- package/dist/{encryption-BKWmbKkN.cjs.map → encryption-BE2wxfyH.cjs.map} +1 -1
- package/dist/{encryption-CbMprdAb.mjs → encryption-DqoQltP8.mjs} +3 -3
- package/dist/{encryption-CbMprdAb.mjs.map → encryption-DqoQltP8.mjs.map} +1 -1
- package/dist/{engine-DaI4iScI.mjs → engine-B72vyrO8.mjs} +7 -9
- package/dist/{engine-DaI4iScI.mjs.map → engine-B72vyrO8.mjs.map} +1 -1
- package/dist/{engine-3imTFxdN.cjs → engine-BevpkNZe.cjs} +100 -102
- package/dist/{engine-3imTFxdN.cjs.map → engine-BevpkNZe.cjs.map} +1 -1
- package/dist/{github-Y6NAwHG1.cjs → github-DoHdtsDX.cjs} +18 -18
- package/dist/{github-Y6NAwHG1.cjs.map → github-DoHdtsDX.cjs.map} +1 -1
- package/dist/{github-Dijjr__H.mjs → github-hxvid6J3.mjs} +7 -7
- package/dist/{github-Dijjr__H.mjs.map → github-hxvid6J3.mjs.map} +1 -1
- package/dist/{googlePlay-Dcp3Yycu.cjs → googlePlay-CYney-Of.cjs} +5 -5
- package/dist/{googlePlay-Dcp3Yycu.cjs.map → googlePlay-CYney-Of.cjs.map} +1 -1
- package/dist/{googlePlay-SDT3j9Kf.mjs → googlePlay-DsvZTWgP.mjs} +4 -4
- package/dist/{googlePlay-SDT3j9Kf.mjs.map → googlePlay-DsvZTWgP.mjs.map} +1 -1
- package/dist/{iam-CqW9hsd2.mjs → iam-DloEBLXZ.mjs} +2 -2
- package/dist/{iam-CqW9hsd2.mjs.map → iam-DloEBLXZ.mjs.map} +1 -1
- package/dist/{iam-DeBQcSvw.cjs → iam-SxPKYCI_.cjs} +2 -2
- package/dist/{iam-DeBQcSvw.cjs.map → iam-SxPKYCI_.cjs.map} +1 -1
- package/dist/{index-DJzVO6Ht.d.cts → index-BThTZV8T.d.mts} +2 -2
- package/dist/{index-Ccsgoq3_.d.mts.map → index-BThTZV8T.d.mts.map} +1 -1
- package/dist/{index-Ccsgoq3_.d.mts → index-Cgd-ouyI.d.cts} +2 -2
- package/dist/{index-DJzVO6Ht.d.cts.map → index-Cgd-ouyI.d.cts.map} +1 -1
- package/dist/index.cjs +590 -246
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +443 -99
- package/dist/index.mjs.map +1 -1
- package/dist/{local-DjaAcHZb.cjs → local-BuR4fIW6.cjs} +3 -3
- package/dist/{local-DjaAcHZb.cjs.map → local-BuR4fIW6.cjs.map} +1 -1
- package/dist/{local-4gzM52HT.mjs → local-Cmq75U_o.mjs} +2 -2
- package/dist/{local-4gzM52HT.mjs.map → local-Cmq75U_o.mjs.map} +1 -1
- package/dist/{migrate-0Rfhftef.mjs → migrate-Bf-EG8Fj.mjs} +5 -5
- package/dist/{migrate-0Rfhftef.mjs.map → migrate-Bf-EG8Fj.mjs.map} +1 -1
- package/dist/{migrate-DDIc3twm.cjs → migrate-CDMdrniJ.cjs} +13 -13
- package/dist/{migrate-DDIc3twm.cjs.map → migrate-CDMdrniJ.cjs.map} +1 -1
- package/dist/{migrate-CuHGYJL9.cjs → migrate-CuTQha4s.cjs} +6 -6
- package/dist/{migrate-CuHGYJL9.cjs.map → migrate-CuTQha4s.cjs.map} +1 -1
- package/dist/{migrate-BLW4BwLd.mjs → migrate-DYJffHOm.mjs} +3 -3
- package/dist/{migrate-BLW4BwLd.mjs.map → migrate-DYJffHOm.mjs.map} +1 -1
- package/dist/openapi.cjs +1 -1
- package/dist/openapi.d.cts +2 -2
- package/dist/openapi.d.mts +2 -2
- package/dist/openapi.mjs +1 -1
- package/dist/{projectBucket-BhEOVVch.mjs → projectBucket-B5YkuSVr.mjs} +2 -2
- package/dist/{projectBucket-BhEOVVch.mjs.map → projectBucket-B5YkuSVr.mjs.map} +1 -1
- package/dist/{projectBucket-C5Ap5kGw.cjs → projectBucket-NcgqleyH.cjs} +2 -2
- package/dist/{projectBucket-C5Ap5kGw.cjs.map → projectBucket-NcgqleyH.cjs.map} +1 -1
- package/dist/{publish-BELe2FO2.cjs → publish--EQ4Tw3F.cjs} +2 -2
- package/dist/{publish-BELe2FO2.cjs.map → publish--EQ4Tw3F.cjs.map} +1 -1
- package/dist/{publish-DiDv40hA.mjs → publish-YL8WZHSo.mjs} +2 -2
- package/dist/{publish-DiDv40hA.mjs.map → publish-YL8WZHSo.mjs.map} +1 -1
- package/dist/{ready--_hMxbUX.cjs → ready-DCvnFZnJ.cjs} +2 -2
- package/dist/{ready--_hMxbUX.cjs.map → ready-DCvnFZnJ.cjs.map} +1 -1
- package/dist/{ready-CjIqXFXe.mjs → ready-sSPuiZ7N.mjs} +2 -2
- package/dist/{ready-CjIqXFXe.mjs.map → ready-sSPuiZ7N.mjs.map} +1 -1
- package/dist/reconcile/public.d.cts +1 -1
- package/dist/reconcile/public.d.mts +1 -1
- package/dist/{resolve-DIPHwLan.cjs → resolve-Ced8-gj4.cjs} +4 -4
- package/dist/{resolve-DIPHwLan.cjs.map → resolve-Ced8-gj4.cjs.map} +1 -1
- package/dist/{resolve-N8EZzWqJ.mjs → resolve-DcG10_JV.mjs} +4 -4
- package/dist/{resolve-N8EZzWqJ.mjs.map → resolve-DcG10_JV.mjs.map} +1 -1
- package/dist/{rollback-DIeA6dba.mjs → rollback-BxI2p53H.mjs} +7 -6
- package/dist/{rollback-DIeA6dba.mjs.map → rollback-BxI2p53H.mjs.map} +1 -1
- package/dist/{rollback-Bp6hepUh.cjs → rollback-C6bCANv7.cjs} +10 -9
- package/dist/{rollback-Bp6hepUh.cjs.map → rollback-C6bCANv7.cjs.map} +1 -1
- package/dist/{runtime-D_UphAAH.d.cts → runtime-BtoiRP5G.d.cts} +2 -2
- package/dist/{runtime-BZlClwy2.d.mts.map → runtime-BtoiRP5G.d.cts.map} +1 -1
- package/dist/{runtime-BZlClwy2.d.mts → runtime-Ct41f0tN.d.mts} +2 -2
- package/dist/{runtime-D_UphAAH.d.cts.map → runtime-Ct41f0tN.d.mts.map} +1 -1
- package/dist/{s3-CIEf4puu.mjs → s3-BAI0ELtE.mjs} +3 -3
- package/dist/{s3-CIEf4puu.mjs.map → s3-BAI0ELtE.mjs.map} +1 -1
- package/dist/{s3-Bwd6lhTU.cjs → s3-DucPHZAn.cjs} +3 -3
- package/dist/{s3-Bwd6lhTU.cjs.map → s3-DucPHZAn.cjs.map} +1 -1
- package/dist/{serverSetup-C9DP30J4.cjs → serverSetup-D3-FE7Dj.cjs} +9 -8
- package/dist/{serverSetup-C9DP30J4.cjs.map → serverSetup-D3-FE7Dj.cjs.map} +1 -1
- package/dist/{serverSetup-mRCLdZQW.mjs → serverSetup-DS9tW50_.mjs} +7 -6
- package/dist/{serverSetup-mRCLdZQW.mjs.map → serverSetup-DS9tW50_.mjs.map} +1 -1
- package/dist/{sniffer-01tbQFmg.mjs → sniffer-CX8sI8Cu.mjs} +7 -7
- package/dist/{sniffer-01tbQFmg.mjs.map → sniffer-CX8sI8Cu.mjs.map} +1 -1
- package/dist/{sniffer-CkPIytPI.cjs → sniffer-XlvJLrhZ.cjs} +7 -7
- package/dist/{sniffer-CkPIytPI.cjs.map → sniffer-XlvJLrhZ.cjs.map} +1 -1
- package/dist/{snsSubscriptions-DmKrw7AF.cjs → snsSubscriptions-CJAOhWq9.cjs} +11 -12
- package/dist/{snsSubscriptions-DmKrw7AF.cjs.map → snsSubscriptions-CJAOhWq9.cjs.map} +1 -1
- package/dist/{snsSubscriptions-k61hsIRw.mjs → snsSubscriptions-DDrra9rN.mjs} +3 -4
- package/dist/{snsSubscriptions-k61hsIRw.mjs.map → snsSubscriptions-DDrra9rN.mjs.map} +1 -1
- package/dist/{sst-CvOnXAel.mjs → sst-CdHflajE.mjs} +6 -6
- package/dist/{sst-CvOnXAel.mjs.map → sst-CdHflajE.mjs.map} +1 -1
- package/dist/{sst-DGsteg5j.cjs → sst-CsEjVFtz.cjs} +8 -8
- package/dist/{sst-DGsteg5j.cjs.map → sst-CsEjVFtz.cjs.map} +1 -1
- package/dist/stack-BYhtz-bE.cjs +11449 -0
- package/dist/stack-BYhtz-bE.cjs.map +1 -0
- package/dist/stack-CLHY-_2m.mjs +10474 -0
- package/dist/stack-CLHY-_2m.mjs.map +1 -0
- package/dist/{stage-8KJCtYtl.cjs → stage-Bc_BtQeG.cjs} +11 -12
- package/dist/stage-Bc_BtQeG.cjs.map +1 -0
- package/dist/{stage-CXIdtjY2.mjs → stage-C7aYyDMr.mjs} +5 -6
- package/dist/stage-C7aYyDMr.mjs.map +1 -0
- package/dist/{stages-BNoiMXfL.mjs → stages-DFvE7iEO.mjs} +2 -2
- package/dist/{stages-BNoiMXfL.mjs.map → stages-DFvE7iEO.mjs.map} +1 -1
- package/dist/{stages-tdJKM9qp.cjs → stages-Dk6Lv7DY.cjs} +2 -2
- package/dist/{stages-tdJKM9qp.cjs.map → stages-Dk6Lv7DY.cjs.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-GzAW5lzO.mjs → terminal-BZzK69T9.mjs} +2 -2
- package/dist/{terminal-GzAW5lzO.mjs.map → terminal-BZzK69T9.mjs.map} +1 -1
- package/dist/{terminal-DSQgidon.cjs → terminal-DXUXlqrO.cjs} +5 -5
- package/dist/{terminal-DSQgidon.cjs.map → terminal-DXUXlqrO.cjs.map} +1 -1
- package/dist/{types-BRnmoWCt.d.cts → types-BVDaaLas.d.cts} +22 -4
- package/dist/{types-BRnmoWCt.d.cts.map → types-BVDaaLas.d.cts.map} +1 -1
- package/dist/{types-Bg7LSAD2.d.mts → types-CJTKWLkK.d.mts} +22 -4
- package/dist/{types-Bg7LSAD2.d.mts.map → types-CJTKWLkK.d.mts.map} +1 -1
- package/dist/{utils-D_fxUqvU.mjs → utils-CdKxD8Lt.mjs} +2 -2
- package/dist/{utils-D_fxUqvU.mjs.map → utils-CdKxD8Lt.mjs.map} +1 -1
- package/dist/{utils-D2Nk1Nv2.cjs → utils-DBqXbB8P.cjs} +2 -2
- package/dist/{utils-D2Nk1Nv2.cjs.map → utils-DBqXbB8P.cjs.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-fGwzXa5l.cjs → workspace-CTspddnJ.cjs} +55 -16
- package/dist/workspace-CTspddnJ.cjs.map +1 -0
- package/dist/{workspace-DTX6CJi2.mjs → workspace-CdiCMRap.mjs} +55 -16
- package/dist/workspace-CdiCMRap.mjs.map +1 -0
- package/package.json +16 -16
- package/dist/apps-CXzjaPWR.mjs +0 -4650
- package/dist/apps-CXzjaPWR.mjs.map +0 -1
- package/dist/apps-vLzb0ZSA.cjs +0 -5174
- package/dist/apps-vLzb0ZSA.cjs.map +0 -1
- package/dist/clientTelemetry-Ej1tf1VE.d.cts.map +0 -1
- package/dist/clientTelemetry-crdjgehZ.d.mts.map +0 -1
- package/dist/compose-CJznzQc7.mjs.map +0 -1
- package/dist/compose-CKBieltT.cjs.map +0 -1
- package/dist/compose-CvNyjqwL.cjs.map +0 -1
- package/dist/compose-DPXoarGI.mjs.map +0 -1
- package/dist/deploy-BaSYxpny.cjs.map +0 -1
- package/dist/deploy-C_uZBzvS.mjs.map +0 -1
- package/dist/dns-BzYrbB2Y.cjs.map +0 -1
- package/dist/dns-C0wbTjVX.mjs.map +0 -1
- package/dist/docker-CPoUMg5X.mjs +0 -1649
- package/dist/docker-CPoUMg5X.mjs.map +0 -1
- package/dist/docker-CrhpQWnL.cjs +0 -1798
- package/dist/docker-CrhpQWnL.cjs.map +0 -1
- package/dist/notes-6F8YXU8m.mjs +0 -409
- package/dist/notes-6F8YXU8m.mjs.map +0 -1
- package/dist/notes-DMOLnNJI.cjs +0 -510
- package/dist/notes-DMOLnNJI.cjs.map +0 -1
- package/dist/stack-Dd-egttk.mjs +0 -1777
- package/dist/stack-Dd-egttk.mjs.map +0 -1
- package/dist/stack-vBnc84e8.cjs +0 -1887
- package/dist/stack-vBnc84e8.cjs.map +0 -1
- package/dist/stage-8KJCtYtl.cjs.map +0 -1
- package/dist/stage-CXIdtjY2.mjs.map +0 -1
- package/dist/workspace-DTX6CJi2.mjs.map +0 -1
- package/dist/workspace-fGwzXa5l.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -2,31 +2,28 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const require_rolldown_runtime = require("./rolldown-runtime-C0BPl7ul.cjs");
|
|
4
4
|
const require_errors = require("./errors-D1x8duqI.cjs");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const require_workspace = require("./workspace-
|
|
8
|
-
const
|
|
5
|
+
const require_credentials = require("./credentials-n2abUWwJ.cjs");
|
|
6
|
+
const require_stack = require("./stack-BYhtz-bE.cjs");
|
|
7
|
+
const require_workspace = require("./workspace-CTspddnJ.cjs");
|
|
8
|
+
const require_compose = require("./compose-BEVBxf4w.cjs");
|
|
9
9
|
const require_schemas = require("./schemas-BQ_v0lEX.cjs");
|
|
10
|
-
const
|
|
11
|
-
const require_SubscriberGenerator = require("./SubscriberGenerator-CxzECrfj.cjs");
|
|
10
|
+
const require_credentials$1 = require("./credentials-Eyx2tM7B.cjs");
|
|
12
11
|
const require_drivers = require("./drivers-DP7__dJX.cjs");
|
|
12
|
+
const require_SubscriberGenerator = require("./SubscriberGenerator-CxzECrfj.cjs");
|
|
13
13
|
const require_EndpointGenerator = require("./EndpointGenerator-iyA3HkOH.cjs");
|
|
14
14
|
const require_discover = require("./discover-OXczlq08.cjs");
|
|
15
15
|
const require_config = require("./config.cjs");
|
|
16
|
-
const require_notes = require("./notes-DMOLnNJI.cjs");
|
|
17
|
-
const require_stack = require("./stack-vBnc84e8.cjs");
|
|
18
|
-
const require_docker = require("./docker-CrhpQWnL.cjs");
|
|
19
16
|
const require_openapi = require("./openapi.cjs");
|
|
20
17
|
const require_appPorts = require("./appPorts-IW-OZmRi.cjs");
|
|
21
18
|
const require_emit = require("./emit-DiW0kbue.cjs");
|
|
22
|
-
const require_local = require("./local-
|
|
23
|
-
const require_sniffer = require("./sniffer-
|
|
24
|
-
const require_deploy = require("./deploy-
|
|
19
|
+
const require_local = require("./local-BuR4fIW6.cjs");
|
|
20
|
+
const require_sniffer = require("./sniffer-XlvJLrhZ.cjs");
|
|
21
|
+
const require_deploy = require("./deploy-CDUWcl58.cjs");
|
|
25
22
|
const require_seeds = require("./seeds-Bc3niNVb.cjs");
|
|
26
23
|
const require_credentialSchemas = require("./credentialSchemas-DjK6xKMk.cjs");
|
|
27
|
-
const require_LocalStateStore = require("./LocalStateStore-
|
|
28
|
-
const require_utils = require("./utils-
|
|
29
|
-
const require_ready = require("./ready
|
|
24
|
+
const require_LocalStateStore = require("./LocalStateStore-BFh6rPhX.cjs");
|
|
25
|
+
const require_utils = require("./utils-DBqXbB8P.cjs");
|
|
26
|
+
const require_ready = require("./ready-DCvnFZnJ.cjs");
|
|
30
27
|
let node_path = require("node:path");
|
|
31
28
|
let commander = require("commander");
|
|
32
29
|
let node_process = require("node:process");
|
|
@@ -44,11 +41,11 @@ let _geekmidas_edge_proxy_traefik = require("@geekmidas/edge/proxy/traefik");
|
|
|
44
41
|
let _geekmidas_manifest = require("@geekmidas/manifest");
|
|
45
42
|
let node_module = require("node:module");
|
|
46
43
|
let node_url = require("node:url");
|
|
44
|
+
let yaml = require("yaml");
|
|
47
45
|
let node_util = require("node:util");
|
|
48
46
|
let _geekmidas_constructs_functions = require("@geekmidas/constructs/functions");
|
|
49
47
|
let fast_glob = require("fast-glob");
|
|
50
48
|
fast_glob = require_rolldown_runtime.__toESM(fast_glob, 1);
|
|
51
|
-
let yaml = require("yaml");
|
|
52
49
|
let chokidar = require("chokidar");
|
|
53
50
|
chokidar = require_rolldown_runtime.__toESM(chokidar, 1);
|
|
54
51
|
let prompts = require("prompts");
|
|
@@ -62,7 +59,7 @@ let crypto = require("crypto");
|
|
|
62
59
|
crypto = require_rolldown_runtime.__toESM(crypto, 1);
|
|
63
60
|
let _geekmidas_constructs_topic = require("@geekmidas/constructs/topic");
|
|
64
61
|
//#region package.json
|
|
65
|
-
var version = "10.0.0-alpha.
|
|
62
|
+
var version = "10.0.0-alpha.185";
|
|
66
63
|
//#endregion
|
|
67
64
|
//#region src/prompt.ts
|
|
68
65
|
/**
|
|
@@ -145,7 +142,7 @@ const logger$8 = console;
|
|
|
145
142
|
* Validate Dokploy token by making a test API call
|
|
146
143
|
*/
|
|
147
144
|
async function validateDokployToken(endpoint, token) {
|
|
148
|
-
const { DokployApi } = await Promise.resolve().then(() => require("./sniffer-
|
|
145
|
+
const { DokployApi } = await Promise.resolve().then(() => require("./sniffer-XlvJLrhZ.cjs")).then((n) => n.dokploy_api_exports);
|
|
149
146
|
return new DokployApi({
|
|
150
147
|
baseUrl: endpoint,
|
|
151
148
|
token
|
|
@@ -186,10 +183,10 @@ async function loginCommand(options) {
|
|
|
186
183
|
logger$8.error("\n✗ Invalid credentials. Please check your token and try again.");
|
|
187
184
|
process.exit(1);
|
|
188
185
|
}
|
|
189
|
-
await
|
|
186
|
+
await require_credentials.storeDokployCredentials(token, endpoint);
|
|
190
187
|
logger$8.log("\n✓ Successfully logged in to Dokploy!");
|
|
191
188
|
logger$8.log(` Endpoint: ${endpoint}`);
|
|
192
|
-
logger$8.log(` Credentials stored in: ${
|
|
189
|
+
logger$8.log(` Credentials stored in: ${require_credentials.getCredentialsPath()}`);
|
|
193
190
|
logger$8.log("\nYou can now use deploy commands without setting DOKPLOY_API_TOKEN.");
|
|
194
191
|
}
|
|
195
192
|
if (provider === "godaddy") {
|
|
@@ -210,9 +207,9 @@ async function loginCommand(options) {
|
|
|
210
207
|
logger$8.error("Token is required");
|
|
211
208
|
process.exit(1);
|
|
212
209
|
}
|
|
213
|
-
await
|
|
210
|
+
await require_credentials.storeHostingerToken(token);
|
|
214
211
|
logger$8.log("\n✓ Hostinger token stored.");
|
|
215
|
-
logger$8.log(` Credentials stored in: ${
|
|
212
|
+
logger$8.log(` Credentials stored in: ${require_credentials.getCredentialsPath()}`);
|
|
216
213
|
logger$8.log(" Not validated here: every DNS endpoint is scoped to a domain, so the\n first deploy that touches DNS is where a bad token reports itself.");
|
|
217
214
|
logger$8.log("\nYou can now use it as a DNS provider without setting HOSTINGER_API_TOKEN.");
|
|
218
215
|
}
|
|
@@ -238,10 +235,10 @@ async function loginGoDaddy(options) {
|
|
|
238
235
|
process.exit(1);
|
|
239
236
|
}
|
|
240
237
|
const where = options.home ? { home: options.home } : void 0;
|
|
241
|
-
await
|
|
238
|
+
await require_credentials.storeGoDaddyToken(token, where);
|
|
242
239
|
logger$8.log("\n✓ GoDaddy token stored.");
|
|
243
240
|
logger$8.log(` Token: ${maskToken(token)}`);
|
|
244
|
-
logger$8.log(` Credentials stored in: ${
|
|
241
|
+
logger$8.log(` Credentials stored in: ${require_credentials.getCredentialsPath(where)}`);
|
|
245
242
|
logger$8.log(" Not validated here: proving a token without a domain needs an account\n scope a DNS-only token does not have, so the first deploy that\n writes a record is where a bad token reports itself.");
|
|
246
243
|
logger$8.log("\nYou can now use it as a DNS provider without setting GODADDY_API_TOKEN.");
|
|
247
244
|
}
|
|
@@ -251,19 +248,19 @@ async function loginGoDaddy(options) {
|
|
|
251
248
|
async function logoutCommand(options) {
|
|
252
249
|
const { provider = "dokploy" } = options;
|
|
253
250
|
if (provider === "all") {
|
|
254
|
-
const dokployRemoved = await
|
|
255
|
-
const godaddyRemoved = await
|
|
251
|
+
const dokployRemoved = await require_credentials.removeDokployCredentials();
|
|
252
|
+
const godaddyRemoved = await require_credentials.removeGoDaddyCredentials();
|
|
256
253
|
if (dokployRemoved || godaddyRemoved) logger$8.log("\n✓ Logged out from all services");
|
|
257
254
|
else logger$8.log("\nNo stored credentials found");
|
|
258
255
|
return;
|
|
259
256
|
}
|
|
260
257
|
if (provider === "godaddy") {
|
|
261
|
-
const removed = await
|
|
258
|
+
const removed = await require_credentials.removeGoDaddyCredentials();
|
|
262
259
|
logger$8.log(removed ? "\n✓ Logged out from GoDaddy" : "\nNo GoDaddy credentials found");
|
|
263
260
|
return;
|
|
264
261
|
}
|
|
265
262
|
if (provider === "dokploy") {
|
|
266
|
-
if (await
|
|
263
|
+
if (await require_credentials.removeDokployCredentials()) logger$8.log("\n✓ Logged out from Dokploy");
|
|
267
264
|
else logger$8.log("\nNo Dokploy credentials found");
|
|
268
265
|
}
|
|
269
266
|
}
|
|
@@ -272,15 +269,15 @@ async function logoutCommand(options) {
|
|
|
272
269
|
*/
|
|
273
270
|
async function whoamiCommand() {
|
|
274
271
|
logger$8.log("\n📋 Current credentials:\n");
|
|
275
|
-
const dokploy = await
|
|
272
|
+
const dokploy = await require_credentials.getDokployCredentials();
|
|
276
273
|
if (dokploy) {
|
|
277
274
|
logger$8.log(" Dokploy:");
|
|
278
275
|
logger$8.log(` Endpoint: ${dokploy.endpoint}`);
|
|
279
276
|
logger$8.log(` Token: ${maskToken(dokploy.token)}`);
|
|
280
277
|
} else logger$8.log(" Dokploy: Not logged in");
|
|
281
|
-
const godaddy = (await
|
|
278
|
+
const godaddy = (await require_credentials.readCredentials()).godaddy;
|
|
282
279
|
logger$8.log(godaddy ? ` GoDaddy:\n Token: ${maskToken(godaddy.token)}` : " GoDaddy: Not logged in");
|
|
283
|
-
logger$8.log(`\n Credentials file: ${
|
|
280
|
+
logger$8.log(`\n Credentials file: ${require_credentials.getCredentialsPath()}`);
|
|
284
281
|
}
|
|
285
282
|
/**
|
|
286
283
|
* Mask a token for display
|
|
@@ -307,6 +304,14 @@ function maskToken(token) {
|
|
|
307
304
|
* stage's `imports/` instead: the stack's apps are stopped, the database's
|
|
308
305
|
* other sessions ended, and the file run inside it in one transaction —
|
|
309
306
|
* then the apps are started again, whatever happened.
|
|
307
|
+
* - **restore --to** (point-in-time recovery) brings the whole cluster back
|
|
308
|
+
* to a moment: a fresh base backup, then — in a one-off container, with
|
|
309
|
+
* the caller's credentials — the newest base backup that had finished by
|
|
310
|
+
* then, fetched and replayed with WAL to that second. The stack is stopped
|
|
311
|
+
* while the recovered cluster is swapped in, then started again; with
|
|
312
|
+
* `--into <name>` each database is copied beside the live one instead.
|
|
313
|
+
* - **list** also shows the restore window, and **now --base** takes a base
|
|
314
|
+
* backup, when the stage has point-in-time recovery.
|
|
310
315
|
*/
|
|
311
316
|
/** A stage that has no backups to list or restore. */
|
|
312
317
|
var BackupsNotOn = class extends require_errors.GkmError {
|
|
@@ -323,7 +328,7 @@ var BackupsNotOn = class extends require_errors.GkmError {
|
|
|
323
328
|
var BackupsNotProvisioned = class extends require_errors.GkmError {
|
|
324
329
|
stage;
|
|
325
330
|
constructor(stage) {
|
|
326
|
-
super(`'${stage}' has no ${
|
|
331
|
+
super(`'${stage}' has no ${require_stack.BACKUPS_URL_KEY} in its secrets, so it has never been deployed with backups. Deploy it: gkm deploy --stage ${stage}.`);
|
|
327
332
|
this.stage = stage;
|
|
328
333
|
this.name = "BackupsNotProvisioned";
|
|
329
334
|
}
|
|
@@ -353,7 +358,7 @@ var BackupRunNotFound = class extends require_errors.GkmError {
|
|
|
353
358
|
/** Not exactly one of `--at`, `--latest` and `--from`. */
|
|
354
359
|
var BackupRunNotChosen = class extends require_errors.GkmError {
|
|
355
360
|
constructor() {
|
|
356
|
-
super("Say which backup to restore, and only one: --latest; --at <time> — a run folder (2026-10-10/02-00-00Z) or a time, for the newest run at or before it;
|
|
361
|
+
super("Say which backup to restore, and only one: --latest; --at <time> — a run folder (2026-10-10/02-00-00Z) or a time, for the newest run at or before it; --from imports/<file>.sql.gz, a prepared import; or --to <time>, the whole cluster as it was at that moment (point-in-time recovery).");
|
|
357
362
|
this.name = "BackupRunNotChosen";
|
|
358
363
|
}
|
|
359
364
|
};
|
|
@@ -497,7 +502,7 @@ var RestoreNotConfirmed = class extends require_errors.GkmError {
|
|
|
497
502
|
var BackupsContainerNotRunning = class extends require_errors.GkmError {
|
|
498
503
|
project;
|
|
499
504
|
constructor(project) {
|
|
500
|
-
super(`No ${
|
|
505
|
+
super(`No ${require_stack.BACKUPS_SERVICE} container of ${project} is running on this Docker. Point Docker at the stage's server, or deploy the stage.`);
|
|
501
506
|
this.project = project;
|
|
502
507
|
this.name = "BackupsContainerNotRunning";
|
|
503
508
|
}
|
|
@@ -507,7 +512,7 @@ var BackupRunFailed = class extends require_errors.GkmError {
|
|
|
507
512
|
project;
|
|
508
513
|
code;
|
|
509
514
|
constructor(project, code) {
|
|
510
|
-
super(`The backup of ${project} failed (exit ${code}); its result is the last line above. docker logs on the ${
|
|
515
|
+
super(`The backup of ${project} failed (exit ${code}); its result is the last line above. docker logs on the ${require_stack.BACKUPS_SERVICE} container shows every run.`);
|
|
511
516
|
this.project = project;
|
|
512
517
|
this.code = code;
|
|
513
518
|
this.name = "BackupRunFailed";
|
|
@@ -554,7 +559,7 @@ async function listBackups(s3, bucket, prefix) {
|
|
|
554
559
|
for (const object of page.Contents ?? []) {
|
|
555
560
|
const rest = object.Key?.slice(prefix.length + 1) ?? "";
|
|
556
561
|
const match = /^(\d{4}-\d{2}-\d{2}\/\d{2}-\d{2}-\d{2}Z)\/(.+)\.sql\.gz$/.exec(rest);
|
|
557
|
-
const at = match ?
|
|
562
|
+
const at = match ? require_stack.runTime(match[1]) : void 0;
|
|
558
563
|
if (!match || !at) continue;
|
|
559
564
|
const run = runs.get(match[1]) ?? {
|
|
560
565
|
folder: match[1],
|
|
@@ -605,10 +610,10 @@ async function backupNow(options) {
|
|
|
605
610
|
file: "",
|
|
606
611
|
cwd: process.cwd(),
|
|
607
612
|
...options.engine?.host ? { host: options.engine.host } : {}
|
|
608
|
-
},
|
|
613
|
+
}, require_stack.BACKUPS_SERVICE, [
|
|
609
614
|
"node",
|
|
610
|
-
|
|
611
|
-
"run"
|
|
615
|
+
require_stack.RUNNER_PATH,
|
|
616
|
+
options.base ? "base" : "run"
|
|
612
617
|
]);
|
|
613
618
|
for (const line of `${result.stdout}${result.stderr}`.split("\n")) if (line.trim()) options.log?.(line);
|
|
614
619
|
if (result.code === null) throw new BackupsContainerNotRunning(options.project);
|
|
@@ -687,7 +692,7 @@ async function restoreBackup(options) {
|
|
|
687
692
|
const { engine, image } = await beforeRestore(options, `Replace ${targets.map((t) => t.name).join(", ")} on '${options.stage}' with the backup ${run.folder}? Everything written since is lost (a backup is taken first).`);
|
|
688
693
|
const restored = [];
|
|
689
694
|
for (const target of targets) {
|
|
690
|
-
const Key = `${options.prefix}/${run.folder}/${
|
|
695
|
+
const Key = `${options.prefix}/${run.folder}/${require_stack.backupFile(target)}`;
|
|
691
696
|
options.log(`♻️ Restoring ${target.name} from s3://${options.bucket}/${Key}…`);
|
|
692
697
|
const file = await download(options, Key);
|
|
693
698
|
let code;
|
|
@@ -744,7 +749,7 @@ async function importBackup(options) {
|
|
|
744
749
|
async function loadImport(options, engine, image, target, path) {
|
|
745
750
|
const keep = [
|
|
746
751
|
"postgres",
|
|
747
|
-
|
|
752
|
+
require_stack.BACKUPS_SERVICE,
|
|
748
753
|
...options.keep ?? []
|
|
749
754
|
];
|
|
750
755
|
options.log(`⏸️ Stopping ${options.project}'s apps…`);
|
|
@@ -752,7 +757,7 @@ async function loadImport(options, engine, image, target, path) {
|
|
|
752
757
|
try {
|
|
753
758
|
stopped = await options.docker.stop(engine, options.project, keep);
|
|
754
759
|
} catch (error) {
|
|
755
|
-
if (error instanceof
|
|
760
|
+
if (error instanceof require_stack.ContainersNotStopped) await options.docker.start(engine, error.ids).catch(() => {});
|
|
756
761
|
throw error;
|
|
757
762
|
}
|
|
758
763
|
let code;
|
|
@@ -771,7 +776,7 @@ async function loadImport(options, engine, image, target, path) {
|
|
|
771
776
|
try {
|
|
772
777
|
await options.docker.start(engine, stopped);
|
|
773
778
|
} catch (error) {
|
|
774
|
-
throw new AppsNotRestarted(options.project, target.name, code === 0, stopped, error instanceof
|
|
779
|
+
throw new AppsNotRestarted(options.project, target.name, code === 0, stopped, error instanceof require_stack.ContainersNotStarted ? error.output : String(error));
|
|
775
780
|
}
|
|
776
781
|
if (code !== 0) throw new RestoreFailed(target.name, code);
|
|
777
782
|
return {
|
|
@@ -786,7 +791,7 @@ async function loadImport(options, engine, image, target, path) {
|
|
|
786
791
|
*/
|
|
787
792
|
async function beforeRestore(options, question) {
|
|
788
793
|
const engine = options.engine ?? {};
|
|
789
|
-
const container = await options.docker.container(engine, options.project,
|
|
794
|
+
const container = await options.docker.container(engine, options.project, require_stack.BACKUPS_SERVICE);
|
|
790
795
|
if (!container) throw new BackupsContainerNotRunning(options.project);
|
|
791
796
|
if (!await options.confirm(question)) throw new RestoreNotConfirmed(options.stage);
|
|
792
797
|
options.log("💾 Taking a backup before restoring…");
|
|
@@ -851,7 +856,7 @@ async function download(options, Key) {
|
|
|
851
856
|
async function loadInto(options, engine, image, file) {
|
|
852
857
|
return options.docker.runOnce(engine, {
|
|
853
858
|
image,
|
|
854
|
-
network:
|
|
859
|
+
network: require_stack.projectNetwork(options.project),
|
|
855
860
|
command: [
|
|
856
861
|
"sh",
|
|
857
862
|
"-c",
|
|
@@ -869,26 +874,313 @@ async function loadInto(options, engine, image, file) {
|
|
|
869
874
|
...options.output ? { output: options.output } : {}
|
|
870
875
|
});
|
|
871
876
|
}
|
|
877
|
+
/** A stage whose entry does not turn point-in-time recovery on. */
|
|
878
|
+
var PitrNotOn = class extends require_errors.GkmError {
|
|
879
|
+
stage;
|
|
880
|
+
flag;
|
|
881
|
+
constructor(stage, flag) {
|
|
882
|
+
super(`${flag} needs point-in-time recovery, and '${stage}' does not have it. Turn it on with deploy.backups.${stage}.pitr: true and deploy; the scheduled dumps restore with --at or --latest.`);
|
|
883
|
+
this.stage = stage;
|
|
884
|
+
this.flag = flag;
|
|
885
|
+
this.name = "PitrNotOn";
|
|
886
|
+
}
|
|
887
|
+
};
|
|
888
|
+
/** `--to` is not a time, or is still to come. */
|
|
889
|
+
var PitrTargetInvalid = class extends require_errors.GkmError {
|
|
890
|
+
to;
|
|
891
|
+
reason;
|
|
892
|
+
constructor(to, reason) {
|
|
893
|
+
super(`--to '${to}' ${reason}. Give a moment in the past, with its zone: --to 2026-11-16T09:41:00Z.`);
|
|
894
|
+
this.to = to;
|
|
895
|
+
this.reason = reason;
|
|
896
|
+
this.name = "PitrTargetInvalid";
|
|
897
|
+
}
|
|
898
|
+
};
|
|
899
|
+
/** `--into` is not a name a database can take. */
|
|
900
|
+
var PitrIntoInvalid = class extends require_errors.GkmError {
|
|
901
|
+
into;
|
|
902
|
+
constructor(into) {
|
|
903
|
+
super(`--into '${into}' is not a database name prefix: use lowercase letters, digits and underscores, starting with a letter — --into drill.`);
|
|
904
|
+
this.into = into;
|
|
905
|
+
this.name = "PitrIntoInvalid";
|
|
906
|
+
}
|
|
907
|
+
};
|
|
908
|
+
/** `--into` or `--database` beside the wrong restore. */
|
|
909
|
+
var PitrFlagsInvalid = class extends require_errors.GkmError {
|
|
910
|
+
reason;
|
|
911
|
+
constructor(reason) {
|
|
912
|
+
super(`${reason}. A point-in-time restore (--to) brings back the whole cluster — every database together — into the live one, or with --into <name> beside it; one database alone restores from the dumps (--at, --latest, --database).`);
|
|
913
|
+
this.reason = reason;
|
|
914
|
+
this.name = "PitrFlagsInvalid";
|
|
915
|
+
}
|
|
916
|
+
};
|
|
917
|
+
/** The archive holds no base backup yet. */
|
|
918
|
+
var NoPitrBackups = class extends require_errors.GkmError {
|
|
919
|
+
stage;
|
|
920
|
+
location;
|
|
921
|
+
constructor(stage, location) {
|
|
922
|
+
super(`'${stage}' has no base backup at ${location} yet, so there is nothing to restore to a moment from. Take one: gkm backup:now --stage ${stage} --base.`);
|
|
923
|
+
this.stage = stage;
|
|
924
|
+
this.location = location;
|
|
925
|
+
this.name = "NoPitrBackups";
|
|
926
|
+
}
|
|
927
|
+
};
|
|
928
|
+
/** `--to` is before the earliest moment the archive can restore. */
|
|
929
|
+
var PitrTargetOutsideWindow = class extends require_errors.GkmError {
|
|
930
|
+
to;
|
|
931
|
+
earliest;
|
|
932
|
+
latest;
|
|
933
|
+
constructor(to, earliest, latest) {
|
|
934
|
+
super(`--to ${to} is before the earliest moment '${formatTime(earliest)}' that can be restored (the window is ${formatWindow({
|
|
935
|
+
earliest,
|
|
936
|
+
...latest ? { latest } : {}
|
|
937
|
+
})}). Older moments restore only from the dumps: --at.`);
|
|
938
|
+
this.to = to;
|
|
939
|
+
this.earliest = earliest;
|
|
940
|
+
this.latest = latest;
|
|
941
|
+
this.name = "PitrTargetOutsideWindow";
|
|
942
|
+
}
|
|
943
|
+
};
|
|
944
|
+
/** The one-off container that recovers the cluster failed. */
|
|
945
|
+
var PitrRestoreFailed = class extends require_errors.GkmError {
|
|
946
|
+
to;
|
|
947
|
+
code;
|
|
948
|
+
constructor(to, code) {
|
|
949
|
+
super(`Recovering the cluster to ${to} failed (exit ${code}); what it said is above. Nothing live was changed.`);
|
|
950
|
+
this.to = to;
|
|
951
|
+
this.code = code;
|
|
952
|
+
this.name = "PitrRestoreFailed";
|
|
953
|
+
}
|
|
954
|
+
};
|
|
955
|
+
/**
|
|
956
|
+
* Putting the recovered cluster in place failed, or the stack did not start
|
|
957
|
+
* again after it. `swapped` says whether the recovered cluster is live.
|
|
958
|
+
*/
|
|
959
|
+
var PitrSwapFailed = class extends require_errors.GkmError {
|
|
960
|
+
project;
|
|
961
|
+
swapped;
|
|
962
|
+
ids;
|
|
963
|
+
output;
|
|
964
|
+
constructor(project, swapped, ids, output) {
|
|
965
|
+
super(`${swapped ? "The recovered cluster is in place" : "The live cluster was left in place"}, but ${project}'s containers, stopped for it, did not start again (docker said: ${output.trim() || "nothing"}). Start them on the stage's server with \`docker start ${ids.join(" ")}\`, or deploy the stage.`);
|
|
966
|
+
this.project = project;
|
|
967
|
+
this.swapped = swapped;
|
|
968
|
+
this.ids = ids;
|
|
969
|
+
this.output = output;
|
|
970
|
+
this.name = "PitrSwapFailed";
|
|
971
|
+
}
|
|
972
|
+
};
|
|
973
|
+
/** `base_000000010000000000000002_backup_stop_sentinel.json`. */
|
|
974
|
+
const SENTINEL = /^(base_[0-9A-F]{24}(?:_D_[0-9A-F]{24})?)_backup_stop_sentinel\.json$/;
|
|
975
|
+
/** Every key under `prefix`, with when it was put. */
|
|
976
|
+
async function listKeys(s3, bucket, prefix) {
|
|
977
|
+
const { ListObjectsV2Command } = await import("@aws-sdk/client-s3");
|
|
978
|
+
const keys = [];
|
|
979
|
+
let token;
|
|
980
|
+
do {
|
|
981
|
+
const page = await s3.send(new ListObjectsV2Command({
|
|
982
|
+
Bucket: bucket,
|
|
983
|
+
Prefix: prefix,
|
|
984
|
+
...token ? { ContinuationToken: token } : {}
|
|
985
|
+
}));
|
|
986
|
+
for (const object of page.Contents ?? []) {
|
|
987
|
+
if (!object.Key) continue;
|
|
988
|
+
keys.push({
|
|
989
|
+
key: object.Key.slice(prefix.length),
|
|
990
|
+
...object.LastModified ? { modified: object.LastModified } : {}
|
|
991
|
+
});
|
|
992
|
+
}
|
|
993
|
+
token = page.IsTruncated ? page.NextContinuationToken : void 0;
|
|
994
|
+
} while (token);
|
|
995
|
+
return keys;
|
|
996
|
+
}
|
|
997
|
+
/**
|
|
998
|
+
* The stage's restore window, read from its archive with the caller's
|
|
999
|
+
* credentials: from when its oldest base backup finished — a base backup's
|
|
1000
|
+
* stop sentinel is put last — to when its newest WAL segment was put.
|
|
1001
|
+
* `undefined` when there is no base backup yet.
|
|
1002
|
+
*/
|
|
1003
|
+
async function pitrWindow(s3, bucket, prefix) {
|
|
1004
|
+
const bases = (await listKeys(s3, bucket, `${prefix}/${require_stack.BASE_BACKUPS_FOLDER}/`)).map(({ key, modified }) => ({
|
|
1005
|
+
match: SENTINEL.exec(key),
|
|
1006
|
+
modified
|
|
1007
|
+
})).filter((b) => b.match !== null && b.modified !== void 0).map(({ match, modified }) => ({
|
|
1008
|
+
name: match[1],
|
|
1009
|
+
finished: modified
|
|
1010
|
+
})).sort((a, b) => a.finished.getTime() - b.finished.getTime());
|
|
1011
|
+
if (bases.length === 0) return void 0;
|
|
1012
|
+
const latest = (await listKeys(s3, bucket, `${prefix}/${require_stack.WAL_FOLDER}/`)).map((k) => k.modified?.getTime() ?? 0).reduce((a, b) => Math.max(a, b), 0);
|
|
1013
|
+
return {
|
|
1014
|
+
earliest: bases[0].finished,
|
|
1015
|
+
...latest > 0 ? { latest: new Date(latest) } : {},
|
|
1016
|
+
bases
|
|
1017
|
+
};
|
|
1018
|
+
}
|
|
1019
|
+
/** `2026-11-02 02:04:11Z → 2026-11-16 09:41:07Z`. */
|
|
1020
|
+
function formatWindow(window) {
|
|
1021
|
+
return `${formatTime(window.earliest)} → ${window.latest ? formatTime(window.latest) : "no WAL archived yet"}`;
|
|
1022
|
+
}
|
|
1023
|
+
/** The lines `backup:list` prints for the restore window. */
|
|
1024
|
+
function formatPitr(window) {
|
|
1025
|
+
return [`restore window ${formatWindow(window)}`, ...[...window.bases].reverse().map((b) => `${formatTime(b.finished)} ${b.name}`)];
|
|
1026
|
+
}
|
|
1027
|
+
/**
|
|
1028
|
+
* `--to` read: a time that parses and is not still to come.
|
|
1029
|
+
*
|
|
1030
|
+
* @throws {PitrTargetInvalid}
|
|
1031
|
+
*/
|
|
1032
|
+
function pitrTarget(to, now = /* @__PURE__ */ new Date()) {
|
|
1033
|
+
const target = new Date(to);
|
|
1034
|
+
if (Number.isNaN(target.getTime())) throw new PitrTargetInvalid(to, "is not a time");
|
|
1035
|
+
if (!/(?:Z|[+-]\d{2}:?\d{2})$/i.test(to.trim())) throw new PitrTargetInvalid(to, "has no time zone");
|
|
1036
|
+
if (target.getTime() > now.getTime()) throw new PitrTargetInvalid(to, "is still to come");
|
|
1037
|
+
return target;
|
|
1038
|
+
}
|
|
1039
|
+
/** `--into` checked: a prefix every database's copy is named with. */
|
|
1040
|
+
function pitrInto(into) {
|
|
1041
|
+
if (!/^[a-z][a-z0-9_]{0,30}$/.test(into)) throw new PitrIntoInvalid(into);
|
|
1042
|
+
return into;
|
|
1043
|
+
}
|
|
1044
|
+
/**
|
|
1045
|
+
* Restore the whole cluster to a moment: asks, takes a fresh base backup,
|
|
1046
|
+
* then — in a one-off container of the backups image, with the caller's
|
|
1047
|
+
* credentials — fetches the newest base backup that had finished by then and
|
|
1048
|
+
* replays WAL up to it. With `into`, each database is copied beside the live
|
|
1049
|
+
* one as `<into>_<database>`, and nothing live stops. Without, the stack is
|
|
1050
|
+
* stopped, the recovered cluster swapped in for the live one in its volume,
|
|
1051
|
+
* the stack started again, and a base backup taken on the new timeline.
|
|
1052
|
+
* Returns the moment restored to.
|
|
1053
|
+
*
|
|
1054
|
+
* @throws {PitrTargetInvalid}, {PitrIntoInvalid}, {NoPitrBackups},
|
|
1055
|
+
* {PitrTargetOutsideWindow}, {BackupsContainerNotRunning},
|
|
1056
|
+
* {RestoreNotConfirmed}, {BackupRunFailed}, {PitrRestoreFailed},
|
|
1057
|
+
* {ContainersNotStopped}, {PitrSwapFailed}
|
|
1058
|
+
*/
|
|
1059
|
+
async function restoreToTime(options) {
|
|
1060
|
+
const target = pitrTarget(options.to, options.now);
|
|
1061
|
+
const into = options.into ? pitrInto(options.into) : void 0;
|
|
1062
|
+
const { archive } = options;
|
|
1063
|
+
const window = await pitrWindow(options.s3, archive.bucket, archive.prefix);
|
|
1064
|
+
if (!window) throw new NoPitrBackups(options.stage, `s3://${archive.bucket}/${archive.prefix}/`);
|
|
1065
|
+
if (target.getTime() < window.earliest.getTime()) throw new PitrTargetOutsideWindow(options.to, window.earliest, window.latest);
|
|
1066
|
+
const engine = options.engine ?? {};
|
|
1067
|
+
const container = await options.docker.container(engine, options.project, require_stack.BACKUPS_SERVICE);
|
|
1068
|
+
if (!container) throw new BackupsContainerNotRunning(options.project);
|
|
1069
|
+
const copies = into ? options.databases.map((d) => require_stack.intoDatabase(into, d.file)) : void 0;
|
|
1070
|
+
const question = copies ? `Restore '${options.stage}' as it was at ${formatTime(target)} into ${copies.join(", ")}? Those databases are replaced; nothing live changes.` : `Replace every database on '${options.stage}' with the cluster as it was at ${formatTime(target)}? Its apps stop while it is swapped, and everything written since is lost (a base backup is taken first).`;
|
|
1071
|
+
if (!await options.confirm(question)) throw new RestoreNotConfirmed(options.stage);
|
|
1072
|
+
options.log("💾 Taking a base backup before restoring…");
|
|
1073
|
+
await backupNow({
|
|
1074
|
+
docker: options.docker,
|
|
1075
|
+
project: options.project,
|
|
1076
|
+
engine,
|
|
1077
|
+
log: options.log,
|
|
1078
|
+
base: true
|
|
1079
|
+
});
|
|
1080
|
+
const volumes = into ? [] : [`${require_stack.projectVolume(options.project, require_credentials$1.volumeOf(require_stack.POSTGRES_SERVICE))}:${require_credentials$1.POSTGRES_MOUNT}`];
|
|
1081
|
+
const env = {
|
|
1082
|
+
...require_stack.walgEnv({
|
|
1083
|
+
bucket: archive.bucket,
|
|
1084
|
+
...archive.region ? { region: archive.region } : {},
|
|
1085
|
+
...archive.endpoint ? { endpoint: archive.endpoint } : {},
|
|
1086
|
+
...options.credentials,
|
|
1087
|
+
prefix: archive.prefix,
|
|
1088
|
+
key: archive.key
|
|
1089
|
+
}),
|
|
1090
|
+
PGHOST: "postgres",
|
|
1091
|
+
PGPORT: "5432",
|
|
1092
|
+
PGUSER: options.superuser.user,
|
|
1093
|
+
PGPASSWORD: options.superuser.password,
|
|
1094
|
+
RECOVER_TARGET: target.toISOString(),
|
|
1095
|
+
RECOVER_SUPERUSER: options.superuser.user,
|
|
1096
|
+
RECOVER_DATABASES: JSON.stringify(options.databases.map(({ file, name }) => ({
|
|
1097
|
+
file,
|
|
1098
|
+
name
|
|
1099
|
+
}))),
|
|
1100
|
+
...into ? { RECOVER_INTO: into } : {}
|
|
1101
|
+
};
|
|
1102
|
+
const network = require_stack.projectNetwork(options.project);
|
|
1103
|
+
const run = (command) => options.docker.runOnce(engine, {
|
|
1104
|
+
image: container.image,
|
|
1105
|
+
network,
|
|
1106
|
+
command: [
|
|
1107
|
+
"node",
|
|
1108
|
+
require_stack.RUNNER_PATH,
|
|
1109
|
+
command
|
|
1110
|
+
],
|
|
1111
|
+
env,
|
|
1112
|
+
...volumes.length > 0 ? { volumes } : {},
|
|
1113
|
+
...options.output ? { output: options.output } : {}
|
|
1114
|
+
});
|
|
1115
|
+
options.log(`♻️ Recovering the cluster to ${formatTime(target)}…`);
|
|
1116
|
+
const code = await run("recover");
|
|
1117
|
+
if (code !== 0) throw new PitrRestoreFailed(options.to, code);
|
|
1118
|
+
if (copies) return {
|
|
1119
|
+
target,
|
|
1120
|
+
into: copies
|
|
1121
|
+
};
|
|
1122
|
+
const keep = (options.keep ?? []).filter((s) => s !== require_stack.POSTGRES_SERVICE);
|
|
1123
|
+
const postgres = await options.docker.container(engine, options.project, require_stack.POSTGRES_SERVICE);
|
|
1124
|
+
options.log(`⏸️ Stopping ${options.project}…`);
|
|
1125
|
+
let stopped;
|
|
1126
|
+
try {
|
|
1127
|
+
stopped = await options.docker.stop(engine, options.project, keep);
|
|
1128
|
+
} catch (error) {
|
|
1129
|
+
if (error instanceof require_stack.ContainersNotStopped) await options.docker.start(engine, error.ids).catch(() => {});
|
|
1130
|
+
throw error;
|
|
1131
|
+
}
|
|
1132
|
+
const order = postgres ? [...stopped.filter((id) => id === postgres.id), ...stopped.filter((id) => id !== postgres.id)] : stopped;
|
|
1133
|
+
const startAll = async () => {
|
|
1134
|
+
const first = order.filter((id) => id === postgres?.id);
|
|
1135
|
+
await options.docker.start(engine, first);
|
|
1136
|
+
await options.docker.start(engine, order.filter((id) => id !== postgres?.id));
|
|
1137
|
+
};
|
|
1138
|
+
options.log("🔁 Swapping the recovered cluster in…");
|
|
1139
|
+
let swapped;
|
|
1140
|
+
try {
|
|
1141
|
+
swapped = await run("swap");
|
|
1142
|
+
} catch (error) {
|
|
1143
|
+
await startAll().catch(() => {});
|
|
1144
|
+
throw error;
|
|
1145
|
+
}
|
|
1146
|
+
options.log(`▶️ Starting ${options.project} again…`);
|
|
1147
|
+
try {
|
|
1148
|
+
await startAll();
|
|
1149
|
+
} catch (error) {
|
|
1150
|
+
throw new PitrSwapFailed(options.project, swapped === 0, order, error instanceof require_stack.ContainersNotStarted ? error.output : String(error));
|
|
1151
|
+
}
|
|
1152
|
+
if (swapped !== 0) throw new PitrRestoreFailed(options.to, swapped);
|
|
1153
|
+
options.log("💾 Taking a base backup of the restored cluster…");
|
|
1154
|
+
await backupNow({
|
|
1155
|
+
docker: options.docker,
|
|
1156
|
+
project: options.project,
|
|
1157
|
+
engine,
|
|
1158
|
+
log: options.log,
|
|
1159
|
+
base: true
|
|
1160
|
+
}).catch((error) => options.log(`⚠️ The base backup after the restore failed: ${error instanceof Error ? error.message : String(error)}. Take one: gkm backup:now --stage ${options.stage} --base.`));
|
|
1161
|
+
return { target };
|
|
1162
|
+
}
|
|
872
1163
|
async function resolveStage(options) {
|
|
873
1164
|
const { workspace } = await require_config.loadWorkspaceConfig(options.cwd);
|
|
874
1165
|
const { stage } = options;
|
|
875
1166
|
const manifest = await require_discover.discover({
|
|
876
|
-
patterns:
|
|
1167
|
+
patterns: require_stack.constructGlobs(workspace),
|
|
877
1168
|
cwd: workspace.root
|
|
878
1169
|
});
|
|
879
|
-
const choice =
|
|
1170
|
+
const choice = require_stack.stageBackups(workspace, manifest, stage);
|
|
880
1171
|
if (choice.mode === "disabled") throw new BackupsNotOn(stage, `deploy.backups.${stage} is false`);
|
|
881
1172
|
if (choice.mode === "none") throw new BackupsNotOn(stage, choice.reason === "local" ? "it is the local stage" : choice.reason === "no-postgres" ? "its stack runs no Postgres" : "the compose target does not deploy it");
|
|
882
|
-
const secrets = await (await
|
|
1173
|
+
const secrets = await (await require_credentials.secretsStoreFor(workspace, stage)).read(stage);
|
|
883
1174
|
return {
|
|
884
1175
|
workspace,
|
|
885
1176
|
manifest,
|
|
886
|
-
project: require_stack.composeProject(
|
|
887
|
-
prefix:
|
|
888
|
-
databases:
|
|
1177
|
+
project: require_stack.composeProject(require_credentials.deployIdentity(workspace, stage)),
|
|
1178
|
+
prefix: require_stack.backupsPrefix(workspace, stage),
|
|
1179
|
+
databases: require_stack.backupDatabases(require_stack.stackPlan(workspace, manifest, stage).resources),
|
|
889
1180
|
custom: secrets?.custom ?? {},
|
|
890
1181
|
...secrets?.seed ? { seed: secrets.seed } : {},
|
|
891
|
-
engine: stageEngine(workspace, stage, secrets?.custom)
|
|
1182
|
+
engine: stageEngine(workspace, stage, secrets?.custom),
|
|
1183
|
+
backups: choice.backups
|
|
892
1184
|
};
|
|
893
1185
|
}
|
|
894
1186
|
/** The stage's server's Docker engine, as every deploy of it reaches it. */
|
|
@@ -906,7 +1198,7 @@ function stageEngine(workspace, stage, custom) {
|
|
|
906
1198
|
* `BACKUPS_URL` — and an S3 client with the caller's own credentials.
|
|
907
1199
|
*/
|
|
908
1200
|
async function callerS3(resolved, options) {
|
|
909
|
-
const url = resolved.custom[
|
|
1201
|
+
const url = resolved.custom[require_stack.BACKUPS_URL_KEY];
|
|
910
1202
|
if (!url) throw new BackupsNotProvisioned(options.stage);
|
|
911
1203
|
const address = (await import("@geekmidas/storage/s3-url")).parse(url);
|
|
912
1204
|
const credential = await require_stack.awsProvisioningCredentials({
|
|
@@ -926,7 +1218,11 @@ async function callerS3(resolved, options) {
|
|
|
926
1218
|
forcePathStyle: true
|
|
927
1219
|
} : {}
|
|
928
1220
|
}),
|
|
929
|
-
bucket: address.bucket
|
|
1221
|
+
bucket: address.bucket,
|
|
1222
|
+
address: {
|
|
1223
|
+
...address.region ? { region: address.region } : {},
|
|
1224
|
+
...address.endpoint ? { endpoint: address.endpoint } : {}
|
|
1225
|
+
}
|
|
930
1226
|
};
|
|
931
1227
|
}
|
|
932
1228
|
/** `gkm backup:list --stage <stage>`. */
|
|
@@ -935,39 +1231,44 @@ async function backupListCommand(options) {
|
|
|
935
1231
|
const { s3, bucket } = await callerS3(resolved, options);
|
|
936
1232
|
const runs = await listBackups(s3, bucket, resolved.prefix);
|
|
937
1233
|
const imports = await listImports(s3, bucket, resolved.prefix);
|
|
1234
|
+
const archive = resolved.backups.pitr ? require_stack.pitrPrefix(resolved.workspace, options.stage) : void 0;
|
|
1235
|
+
const pitr = archive ? await pitrWindow(s3, bucket, archive) : void 0;
|
|
1236
|
+
const listing = {
|
|
1237
|
+
runs,
|
|
1238
|
+
imports,
|
|
1239
|
+
...pitr ? { pitr } : {}
|
|
1240
|
+
};
|
|
938
1241
|
if (options.json) {
|
|
939
|
-
console.log(JSON.stringify(
|
|
940
|
-
|
|
941
|
-
imports
|
|
942
|
-
}, null, 2));
|
|
943
|
-
return {
|
|
944
|
-
runs,
|
|
945
|
-
imports
|
|
946
|
-
};
|
|
1242
|
+
console.log(JSON.stringify(listing, null, 2));
|
|
1243
|
+
return listing;
|
|
947
1244
|
}
|
|
948
1245
|
if (runs.length === 0) console.log(`No backups of '${options.stage}' yet.`);
|
|
949
1246
|
else {
|
|
950
1247
|
console.log(`💾 s3://${bucket}/${resolved.prefix}/ — newest first\n`);
|
|
951
1248
|
for (const line of formatRuns(runs)) console.log(line);
|
|
952
1249
|
}
|
|
1250
|
+
if (archive) {
|
|
1251
|
+
console.log(`\n⏱️ Point-in-time — gkm backup:restore --stage ${options.stage} --to <time>\n`);
|
|
1252
|
+
if (pitr) for (const line of formatPitr(pitr)) console.log(line);
|
|
1253
|
+
else console.log(`No base backup at s3://${bucket}/${archive}/ yet: gkm backup:now --stage ${options.stage} --base.`);
|
|
1254
|
+
}
|
|
953
1255
|
if (imports.length > 0) {
|
|
954
1256
|
console.log(`\n📥 Imports — gkm backup:restore --stage ${options.stage} --from <file> --database <name>\n`);
|
|
955
1257
|
for (const line of formatImports(imports)) console.log(line);
|
|
956
1258
|
}
|
|
957
|
-
return
|
|
958
|
-
runs,
|
|
959
|
-
imports
|
|
960
|
-
};
|
|
1259
|
+
return listing;
|
|
961
1260
|
}
|
|
962
|
-
/** `gkm backup:now --stage <stage
|
|
963
|
-
async function backupNowCommand(options, docker =
|
|
1261
|
+
/** `gkm backup:now --stage <stage> [--base]`. */
|
|
1262
|
+
async function backupNowCommand(options, docker = require_stack.dockerCompose) {
|
|
964
1263
|
const resolved = await resolveStage(options);
|
|
965
|
-
|
|
1264
|
+
if (options.base && !resolved.backups.pitr) throw new PitrNotOn(options.stage, "--base");
|
|
1265
|
+
console.log(`💾 ${options.base ? "Taking a base backup of" : "Backing up"} ${resolved.project}…`);
|
|
966
1266
|
await backupNow({
|
|
967
1267
|
docker,
|
|
968
1268
|
project: resolved.project,
|
|
969
1269
|
engine: resolved.engine,
|
|
970
|
-
log: (line) => console.log(line)
|
|
1270
|
+
log: (line) => console.log(line),
|
|
1271
|
+
...options.base ? { base: true } : {}
|
|
971
1272
|
});
|
|
972
1273
|
console.log("✅ Backed up.");
|
|
973
1274
|
}
|
|
@@ -975,21 +1276,68 @@ async function backupNowCommand(options, docker = require_compose.dockerCompose)
|
|
|
975
1276
|
const STACK_PROXY_SERVICE = "caddy";
|
|
976
1277
|
/**
|
|
977
1278
|
* `gkm backup:restore --stage <stage> (--at <time> | --latest |
|
|
978
|
-
* --from imports/<file> --database <name>)`.
|
|
1279
|
+
* --from imports/<file> --database <name> | --to <time> [--into <name>])`.
|
|
979
1280
|
*/
|
|
980
|
-
async function backupRestoreCommand(options, docker =
|
|
1281
|
+
async function backupRestoreCommand(options, docker = require_stack.dockerCompose) {
|
|
981
1282
|
if ([
|
|
982
1283
|
options.at,
|
|
983
1284
|
options.latest,
|
|
984
|
-
options.from
|
|
1285
|
+
options.from,
|
|
1286
|
+
options.to
|
|
985
1287
|
].filter(Boolean).length !== 1) throw new BackupRunNotChosen();
|
|
986
1288
|
if (options.from) importKey("", options.from);
|
|
1289
|
+
if (options.into && !options.to) throw new PitrFlagsInvalid("--into goes with --to");
|
|
1290
|
+
if (options.to) {
|
|
1291
|
+
if (options.database) throw new PitrFlagsInvalid("--database does not go with --to");
|
|
1292
|
+
pitrTarget(options.to);
|
|
1293
|
+
if (options.into) pitrInto(options.into);
|
|
1294
|
+
}
|
|
987
1295
|
const resolved = await resolveStage(options);
|
|
1296
|
+
if (options.to && !resolved.backups.pitr) throw new PitrNotOn(options.stage, "--to");
|
|
988
1297
|
if (options.from && !options.database) throw new ImportNeedsDatabase(options.from, resolved.databases.map((d) => d.file));
|
|
989
|
-
const { s3, bucket } = await callerS3(resolved, options);
|
|
1298
|
+
const { s3, bucket, address } = await callerS3(resolved, options);
|
|
990
1299
|
if (!resolved.seed) throw new BackupsNotProvisioned(options.stage);
|
|
991
1300
|
const plan = require_stack.stackPlan(resolved.workspace, resolved.manifest, options.stage);
|
|
992
1301
|
const superuser = require_stack.derivedCredentials(resolved.workspace.name, plan, resolved.seed).postgres;
|
|
1302
|
+
const keep = [...plan.containers, STACK_PROXY_SERVICE];
|
|
1303
|
+
const confirm = async (question) => {
|
|
1304
|
+
if (options.yes) return true;
|
|
1305
|
+
const answer = await prompt(`${question} [y/N] `, { instead: "Pass --yes to restore without asking." });
|
|
1306
|
+
return /^y(es)?$/i.test(answer.trim());
|
|
1307
|
+
};
|
|
1308
|
+
const log = (line) => console.log(line);
|
|
1309
|
+
if (options.to) {
|
|
1310
|
+
const key = resolved.custom[require_stack.PITR_KEY];
|
|
1311
|
+
if (!key) throw new require_stack.PitrKeyMissing(options.stage);
|
|
1312
|
+
const credentials = await s3.config.credentials();
|
|
1313
|
+
const { target, into } = await restoreToTime({
|
|
1314
|
+
s3,
|
|
1315
|
+
archive: {
|
|
1316
|
+
bucket,
|
|
1317
|
+
...address,
|
|
1318
|
+
prefix: require_stack.pitrPrefix(resolved.workspace, options.stage),
|
|
1319
|
+
key
|
|
1320
|
+
},
|
|
1321
|
+
credentials: {
|
|
1322
|
+
accessKeyId: credentials.accessKeyId,
|
|
1323
|
+
secretAccessKey: credentials.secretAccessKey,
|
|
1324
|
+
...credentials.sessionToken ? { sessionToken: credentials.sessionToken } : {}
|
|
1325
|
+
},
|
|
1326
|
+
docker,
|
|
1327
|
+
project: resolved.project,
|
|
1328
|
+
engine: resolved.engine,
|
|
1329
|
+
stage: options.stage,
|
|
1330
|
+
superuser,
|
|
1331
|
+
databases: resolved.databases,
|
|
1332
|
+
to: options.to,
|
|
1333
|
+
...options.into ? { into: options.into } : {},
|
|
1334
|
+
keep,
|
|
1335
|
+
confirm,
|
|
1336
|
+
log
|
|
1337
|
+
});
|
|
1338
|
+
console.log(into ? `✅ Restored '${options.stage}' as it was at ${formatTime(target)} into ${into.join(", ")}.` : `✅ Restored '${options.stage}' to ${formatTime(target)}.`);
|
|
1339
|
+
return;
|
|
1340
|
+
}
|
|
993
1341
|
const { run, restored } = await restoreBackup({
|
|
994
1342
|
s3,
|
|
995
1343
|
bucket,
|
|
@@ -1000,17 +1348,13 @@ async function backupRestoreCommand(options, docker = require_compose.dockerComp
|
|
|
1000
1348
|
stage: options.stage,
|
|
1001
1349
|
superuser,
|
|
1002
1350
|
databases: resolved.databases,
|
|
1003
|
-
keep
|
|
1351
|
+
keep,
|
|
1004
1352
|
...options.at ? { at: options.at } : {},
|
|
1005
1353
|
...options.latest ? { latest: true } : {},
|
|
1006
1354
|
...options.from ? { from: options.from } : {},
|
|
1007
1355
|
...options.database ? { database: options.database } : {},
|
|
1008
|
-
confirm
|
|
1009
|
-
|
|
1010
|
-
const answer = await prompt(`${question} [y/N] `, { instead: "Pass --yes to restore without asking." });
|
|
1011
|
-
return /^y(es)?$/i.test(answer.trim());
|
|
1012
|
-
},
|
|
1013
|
-
log: (line) => console.log(line)
|
|
1356
|
+
confirm,
|
|
1357
|
+
log
|
|
1014
1358
|
});
|
|
1015
1359
|
console.log(`✅ Restored ${restored.join(", ")} on '${options.stage}' from ${run ? run.folder : options.from}.`);
|
|
1016
1360
|
}
|
|
@@ -1035,7 +1379,7 @@ function serviceLogins(options) {
|
|
|
1035
1379
|
logins.push({
|
|
1036
1380
|
service: "postgres",
|
|
1037
1381
|
label: "Postgres",
|
|
1038
|
-
url: `postgres://${user}:${encodeURIComponent(password)}@localhost:${ports.postgres}/${
|
|
1382
|
+
url: `postgres://${user}:${encodeURIComponent(password)}@localhost:${ports.postgres}/${require_credentials$1.CLUSTER_DATABASE}`,
|
|
1039
1383
|
user,
|
|
1040
1384
|
password
|
|
1041
1385
|
});
|
|
@@ -1166,7 +1510,7 @@ function installation(platform, certificate) {
|
|
|
1166
1510
|
* same entry, so running it twice is not an error.
|
|
1167
1511
|
*/
|
|
1168
1512
|
async function trustCommand(options = {}) {
|
|
1169
|
-
const { certFile: certificate } = await (0, _geekmidas_edge_certificates_local.ensureLocalAuthority)(options.authority ?? (0, _geekmidas_edge_certificates_local.localAuthorityPaths)(
|
|
1513
|
+
const { certFile: certificate } = await (0, _geekmidas_edge_certificates_local.ensureLocalAuthority)(options.authority ?? (0, _geekmidas_edge_certificates_local.localAuthorityPaths)(require_credentials.gkmHome()));
|
|
1170
1514
|
const { describe, asks, steps } = installation(process.platform, certificate);
|
|
1171
1515
|
logger$7.log(`\n🔐 Trusting the local authority in ${describe}`);
|
|
1172
1516
|
logger$7.log(` ${certificate}\n`);
|
|
@@ -1378,7 +1722,7 @@ var NoLocalCredentials = class extends require_errors.GkmError {
|
|
|
1378
1722
|
};
|
|
1379
1723
|
/** The logins of every service the workspace last published. */
|
|
1380
1724
|
function devCredentials(workspace, credentials, ports) {
|
|
1381
|
-
const containers = SIGNED_IN.filter((container) =>
|
|
1725
|
+
const containers = SIGNED_IN.filter((container) => require_credentials$1.portsOf(container).some((port) => ports[port.key] !== void 0));
|
|
1382
1726
|
const local = ports.openobserve !== void 0 ? {
|
|
1383
1727
|
url: `http://localhost:${ports.openobserve}`,
|
|
1384
1728
|
via: "gkm dev"
|
|
@@ -1396,9 +1740,9 @@ function devCredentials(workspace, credentials, ports) {
|
|
|
1396
1740
|
}
|
|
1397
1741
|
async function devCredentialsCommand(options = {}, print = (line) => console.log(line)) {
|
|
1398
1742
|
const { workspace } = await require_config.loadWorkspaceConfig(process.cwd());
|
|
1399
|
-
const credentials = await
|
|
1743
|
+
const credentials = await require_credentials$1.readLocalCredentials(workspace);
|
|
1400
1744
|
if (!credentials) throw new NoLocalCredentials(workspace.name);
|
|
1401
|
-
const output = devCredentials(workspace, credentials, await
|
|
1745
|
+
const output = devCredentials(workspace, credentials, await require_credentials$1.loadPortState(workspace.root));
|
|
1402
1746
|
if (options.json) {
|
|
1403
1747
|
print(JSON.stringify(output, null, 2));
|
|
1404
1748
|
return output;
|
|
@@ -2485,7 +2829,7 @@ async function serveFakes(fakes, ports) {
|
|
|
2485
2829
|
const served = [];
|
|
2486
2830
|
for (const [id, local] of Object.entries(fakes)) {
|
|
2487
2831
|
if (local.image) continue;
|
|
2488
|
-
const port = ports[
|
|
2832
|
+
const port = ports[require_credentials$1.fakeKey(id)];
|
|
2489
2833
|
if (port === void 0) continue;
|
|
2490
2834
|
const { handler } = (await import((0, node_url.pathToFileURL)(local.file).href)).default;
|
|
2491
2835
|
const server = serve({
|
|
@@ -2529,8 +2873,8 @@ var NoCommandSpecified = class extends require_errors.GkmError {
|
|
|
2529
2873
|
async function execCommand(commandArgs, options = {}, stageDeps) {
|
|
2530
2874
|
const cwd = options.cwd ?? process.cwd();
|
|
2531
2875
|
if (!commandArgs[0]) throw new NoCommandSpecified();
|
|
2532
|
-
if (options.stage && !
|
|
2533
|
-
const { execOnStage } = await Promise.resolve().then(() => require("./stage-
|
|
2876
|
+
if (options.stage && !require_stack.isImageBuild()) {
|
|
2877
|
+
const { execOnStage } = await Promise.resolve().then(() => require("./stage-Bc_BtQeG.cjs")).then((n) => n.stage_exports);
|
|
2534
2878
|
const { loadWorkspaceConfig } = await Promise.resolve().then(() => require("./config.cjs"));
|
|
2535
2879
|
const { workspace } = await loadWorkspaceConfig(cwd);
|
|
2536
2880
|
if (options.stage !== workspace.stages.local) {
|
|
@@ -2545,19 +2889,19 @@ async function execCommand(commandArgs, options = {}, stageDeps) {
|
|
|
2545
2889
|
return;
|
|
2546
2890
|
}
|
|
2547
2891
|
}
|
|
2548
|
-
const defaultEnv =
|
|
2892
|
+
const defaultEnv = require_credentials$1.loadEnvFiles(".env");
|
|
2549
2893
|
if (defaultEnv.loaded.length > 0) logger$6.log(`📦 Loaded env: ${defaultEnv.loaded.join(", ")}`);
|
|
2550
|
-
const { credentials, secretsJsonPath, appName } =
|
|
2894
|
+
const { credentials, secretsJsonPath, appName } = require_stack.isImageBuild() ? await imageBuildEntry(cwd) : await require_credentials$1.prepareEntryCredentials({
|
|
2551
2895
|
cwd,
|
|
2552
2896
|
scoped: true
|
|
2553
2897
|
});
|
|
2554
2898
|
if (appName) logger$6.log(`📦 App: ${appName}`);
|
|
2555
2899
|
const secretCount = Object.keys(credentials).filter((k) => k !== "PORT").length;
|
|
2556
|
-
if (secretCount > 0 && !
|
|
2900
|
+
if (secretCount > 0 && !require_stack.isImageBuild()) logger$6.log(`🔐 Loaded ${secretCount} secret(s)`);
|
|
2557
2901
|
const preloadDir = (0, node_path.join)(cwd, ".gkm");
|
|
2558
2902
|
await (0, node_fs_promises.mkdir)(preloadDir, { recursive: true });
|
|
2559
2903
|
const preloadPath = (0, node_path.join)(preloadDir, "credentials-preload.mjs");
|
|
2560
|
-
await
|
|
2904
|
+
await require_credentials$1.createCredentialsPreload(preloadPath, secretsJsonPath);
|
|
2561
2905
|
const [cmd, ...args] = commandArgs;
|
|
2562
2906
|
logger$6.log(`🚀 Running: ${[cmd, ...args].join(" ")}`);
|
|
2563
2907
|
const nodeOptions = [(process.env.NODE_OPTIONS ?? "").replace(/--import[= ]\S+/g, "").trim(), `--import=${preloadPath}`].filter(Boolean).join(" ");
|
|
@@ -2585,7 +2929,7 @@ async function execCommand(commandArgs, options = {}, stageDeps) {
|
|
|
2585
2929
|
* secret read and no address resolved.
|
|
2586
2930
|
*/
|
|
2587
2931
|
async function imageBuildEntry(cwd) {
|
|
2588
|
-
const credentials =
|
|
2932
|
+
const credentials = require_stack.imageBuildCredentials();
|
|
2589
2933
|
logger$6.log(`🐳 Image build: ${Object.keys(credentials).length} public value(s) from the build args`);
|
|
2590
2934
|
const dir = (0, node_path.join)(cwd, ".gkm");
|
|
2591
2935
|
await (0, node_fs_promises.mkdir)(dir, { recursive: true });
|
|
@@ -2666,7 +3010,7 @@ const SUBSCRIBERS_ENV = "GKM_SUBSCRIBERS";
|
|
|
2666
3010
|
async function devCommand(options) {
|
|
2667
3011
|
if (options.subscribers === false) process.env[SUBSCRIBERS_ENV] = "off";
|
|
2668
3012
|
if (options.entry) return entryDevCommand(options);
|
|
2669
|
-
const defaultEnv =
|
|
3013
|
+
const defaultEnv = require_credentials$1.loadEnvFiles(".env");
|
|
2670
3014
|
if (defaultEnv.loaded.length > 0) logger$5.log(`📦 Loaded env: ${defaultEnv.loaded.join(", ")}`);
|
|
2671
3015
|
const appConfig = await require_config.loadAppConfig().catch((error) => {
|
|
2672
3016
|
if (error instanceof require_config.NotInAnApp || error instanceof require_config.NotABackendApp) return;
|
|
@@ -2684,7 +3028,7 @@ async function devCommand(options) {
|
|
|
2684
3028
|
const secretsRoot = appConfig.workspaceRoot;
|
|
2685
3029
|
const workspaceAppName = appConfig.appName;
|
|
2686
3030
|
const assigned = await require_appPorts.assignAppPorts(appConfig.workspace, [workspaceAppName], {
|
|
2687
|
-
free:
|
|
3031
|
+
free: require_credentials$1.isPortAvailable,
|
|
2688
3032
|
holder: require_appPorts.holderOf
|
|
2689
3033
|
});
|
|
2690
3034
|
if (assigned.running.length > 0) throw new WorkspacePortsInUse(assigned.running);
|
|
@@ -2702,7 +3046,7 @@ async function devCommand(options) {
|
|
|
2702
3046
|
});
|
|
2703
3047
|
}
|
|
2704
3048
|
if (config.env) {
|
|
2705
|
-
const { loaded, missing } =
|
|
3049
|
+
const { loaded, missing } = require_credentials$1.loadEnvFiles(config.env, appRoot);
|
|
2706
3050
|
if (loaded.length > 0) logger$5.log(`📦 Loaded env: ${loaded.join(", ")}`);
|
|
2707
3051
|
if (missing.length > 0) logger$5.warn(`⚠️ Missing env files: ${missing.join(", ")}`);
|
|
2708
3052
|
}
|
|
@@ -2716,8 +3060,8 @@ async function devCommand(options) {
|
|
|
2716
3060
|
app: workspaceAppName,
|
|
2717
3061
|
target: "server",
|
|
2718
3062
|
enableOpenApi,
|
|
2719
|
-
cacheBackend:
|
|
2720
|
-
eventsBackend:
|
|
3063
|
+
cacheBackend: require_credentials.cacheBackendFor(require_credentials.providerOf(workspace ?? config)),
|
|
3064
|
+
eventsBackend: require_credentials.eventsBackendFor(require_credentials.providerOf(workspace ?? config)),
|
|
2721
3065
|
telescope,
|
|
2722
3066
|
databaseApi: true,
|
|
2723
3067
|
hooks,
|
|
@@ -2734,16 +3078,16 @@ async function devCommand(options) {
|
|
|
2734
3078
|
let publicUrl;
|
|
2735
3079
|
let manifest;
|
|
2736
3080
|
let telemetryUi;
|
|
2737
|
-
const appSecrets = await
|
|
3081
|
+
const appSecrets = await require_credentials$1.loadSecretsForApp(workspace ? await require_credentials.secretsStoreFor(workspace, config.stages.local) : new require_credentials.FileSecretsStore(secretsRoot), config.stages.local);
|
|
2738
3082
|
if (workspace) {
|
|
2739
|
-
const reconciled = await
|
|
3083
|
+
const reconciled = await require_stack.reconcileWorkspace(workspace, {
|
|
2740
3084
|
stage: workspace.stages.local,
|
|
2741
3085
|
...options.fake ? { fake: true } : {},
|
|
2742
3086
|
progress: (message) => logger$5.log(message)
|
|
2743
3087
|
});
|
|
2744
3088
|
if (reconciled.services.length > 0) {
|
|
2745
3089
|
logger$5.log("🐳 Services");
|
|
2746
|
-
for (const line of
|
|
3090
|
+
for (const line of require_credentials$1.describeServices(reconciled.services)) logger$5.log(line);
|
|
2747
3091
|
}
|
|
2748
3092
|
if (!process.env["GKM_DISCOVERY_QUIET"] && reconciled.credentials && reconciled.ports) {
|
|
2749
3093
|
const { services: logins } = devCredentials(workspace, reconciled.credentials, reconciled.ports);
|
|
@@ -2752,12 +3096,12 @@ async function devCommand(options) {
|
|
|
2752
3096
|
for (const line of describeLogins(logins)) logger$5.log(line);
|
|
2753
3097
|
}
|
|
2754
3098
|
}
|
|
2755
|
-
const processValues =
|
|
3099
|
+
const processValues = require_stack.processEnv(reconciled.manifest, require_stack.appProcess(workspace, reconciled.manifest, reconciled.background, workspaceAppName), { ...appSecrets }, reconciled.env);
|
|
2756
3100
|
for (const key of Object.keys(appSecrets)) delete appSecrets[key];
|
|
2757
3101
|
Object.assign(appSecrets, processValues);
|
|
2758
3102
|
const declared = reconciled.manifest;
|
|
2759
|
-
const scoped =
|
|
2760
|
-
uses: declared !== void 0 && (
|
|
3103
|
+
const scoped = require_credentials$1.scopeTelemetryEnv(appSecrets, {
|
|
3104
|
+
uses: declared !== void 0 && (require_credentials$1.appTelemetry(declared, workspaceAppName) !== void 0 || (initial.workers ?? []).some((id) => require_credentials$1.telemetryOf(declared, id) !== void 0)),
|
|
2761
3105
|
serviceName: workspaceAppName,
|
|
2762
3106
|
telemetry: reconciled.env
|
|
2763
3107
|
});
|
|
@@ -3041,8 +3385,8 @@ async function validateFrontendApps(workspace) {
|
|
|
3041
3385
|
async function loadDevSecrets(workspace) {
|
|
3042
3386
|
if (!workspace.secrets.enabled) return {};
|
|
3043
3387
|
const stage = workspace.stages.local;
|
|
3044
|
-
const secrets = await (await
|
|
3045
|
-
if (secrets) return
|
|
3388
|
+
const secrets = await (await require_credentials.secretsStoreFor(workspace, stage)).read(stage);
|
|
3389
|
+
if (secrets) return require_credentials.toEmbeddableSecrets(secrets);
|
|
3046
3390
|
return {};
|
|
3047
3391
|
}
|
|
3048
3392
|
/**
|
|
@@ -3057,7 +3401,7 @@ async function loadDevSecrets(workspace) {
|
|
|
3057
3401
|
async function workspaceDevCommand(configured, options) {
|
|
3058
3402
|
const scoped = options.app ? [options.app] : options.filter ? [] : Object.keys(configured.apps);
|
|
3059
3403
|
const assigned = await require_appPorts.assignAppPorts(configured, scoped, {
|
|
3060
|
-
free:
|
|
3404
|
+
free: require_credentials$1.isPortAvailable,
|
|
3061
3405
|
holder: require_appPorts.holderOf
|
|
3062
3406
|
});
|
|
3063
3407
|
if (assigned.running.length > 0) throw new WorkspacePortsInUse(assigned.running);
|
|
@@ -3084,21 +3428,21 @@ async function workspaceDevCommand(configured, options) {
|
|
|
3084
3428
|
if (hasErrors) throw new Error("Frontend app validation failed. Fix the issues above and try again.");
|
|
3085
3429
|
}
|
|
3086
3430
|
const rawSecrets = await loadDevSecrets(workspace);
|
|
3087
|
-
const reconciled = await
|
|
3431
|
+
const reconciled = await require_stack.reconcileWorkspace(workspace, {
|
|
3088
3432
|
stage: workspace.stages.local,
|
|
3089
3433
|
...options.fake ? { fake: true } : {},
|
|
3090
3434
|
progress: (message) => logger$5.log(message)
|
|
3091
3435
|
});
|
|
3092
3436
|
if (reconciled.services.length > 0) {
|
|
3093
3437
|
logger$5.log("🐳 Services");
|
|
3094
|
-
for (const line of
|
|
3438
|
+
for (const line of require_credentials$1.describeServices(reconciled.services)) logger$5.log(line);
|
|
3095
3439
|
}
|
|
3096
3440
|
const { services: logins } = devCredentials(workspace, reconciled.credentials, reconciled.ports);
|
|
3097
3441
|
if (logins.length > 0) {
|
|
3098
3442
|
logger$5.log("🔑 Logins (again any time: gkm dev:credentials)");
|
|
3099
3443
|
for (const line of describeLogins(logins)) logger$5.log(line);
|
|
3100
3444
|
}
|
|
3101
|
-
const secretsEnv =
|
|
3445
|
+
const secretsEnv = require_credentials$1.scopeTelemetryEnv(require_stack.stageEnv(rawSecrets, reconciled.env), {
|
|
3102
3446
|
uses: false,
|
|
3103
3447
|
serviceName: workspace.name
|
|
3104
3448
|
});
|
|
@@ -3106,9 +3450,9 @@ async function workspaceDevCommand(configured, options) {
|
|
|
3106
3450
|
for (const { id, port } of fakes) logger$5.log(`🎭 ${id} fake: http://localhost:${port}`);
|
|
3107
3451
|
logger$5.log(options.migrate || options.seed ? "🗄️ Migrating the databases" : "🗄️ Checking for pending migrations");
|
|
3108
3452
|
if (options.migrate || options.seed) {
|
|
3109
|
-
const { prepareDevDatabases } = await Promise.resolve().then(() => require("./migrate-
|
|
3453
|
+
const { prepareDevDatabases } = await Promise.resolve().then(() => require("./migrate-CDMdrniJ.cjs"));
|
|
3110
3454
|
await prepareDevDatabases(workspace, secretsEnv, { seed: !!options.seed });
|
|
3111
|
-
} else await Promise.resolve().then(() => require("./migrate-
|
|
3455
|
+
} else await Promise.resolve().then(() => require("./migrate-CDMdrniJ.cjs")).then(({ reportPendingMigrations }) => reportPendingMigrations(workspace, reconciled.env)).catch((error) => {
|
|
3112
3456
|
logger$5.log(`⚠️ Could not check for pending migrations: ${error instanceof Error ? error.message : String(error)}`);
|
|
3113
3457
|
});
|
|
3114
3458
|
const appUrls = {};
|
|
@@ -3193,10 +3537,10 @@ async function workspaceDevCommand(configured, options) {
|
|
|
3193
3537
|
announce(discovery);
|
|
3194
3538
|
const turboEnv = {
|
|
3195
3539
|
...process.env,
|
|
3196
|
-
...
|
|
3540
|
+
...require_stack.processEnv(reconciled.manifest, {}, rawSecrets, reconciled.env),
|
|
3197
3541
|
NODE_ENV: "development",
|
|
3198
3542
|
...configPath ? { GKM_CONFIG_PATH: configPath } : {},
|
|
3199
|
-
...options.fake ? { [
|
|
3543
|
+
...options.fake ? { [require_stack.FAKE_ENV]: "1" } : {},
|
|
3200
3544
|
[DISCOVERY_QUIET_ENV]: "1"
|
|
3201
3545
|
};
|
|
3202
3546
|
logger$5.log(`🚀 Starting ${appCount} app(s) — each builds before it answers, and says so when it is ready`);
|
|
@@ -3255,9 +3599,9 @@ async function entryDevCommand(options) {
|
|
|
3255
3599
|
if (!entry) throw new Error("--entry requires a file path");
|
|
3256
3600
|
const entryPath = (0, node_path.resolve)(process.cwd(), entry);
|
|
3257
3601
|
if (!(0, node_fs.existsSync)(entryPath)) throw new Error(`Entry file not found: ${entryPath}`);
|
|
3258
|
-
const defaultEnv =
|
|
3602
|
+
const defaultEnv = require_credentials$1.loadEnvFiles(".env");
|
|
3259
3603
|
if (defaultEnv.loaded.length > 0) logger$5.log(`📦 Loaded env: ${defaultEnv.loaded.join(", ")}`);
|
|
3260
|
-
const { credentials, resolvedPort, secretsJsonPath, appName } = await
|
|
3604
|
+
const { credentials, resolvedPort, secretsJsonPath, appName } = await require_credentials$1.prepareEntryCredentials({
|
|
3261
3605
|
explicitPort: options.portExplicit ? options.port : void 0,
|
|
3262
3606
|
scoped: true
|
|
3263
3607
|
});
|
|
@@ -3267,7 +3611,7 @@ async function entryDevCommand(options) {
|
|
|
3267
3611
|
const wrapperDir = (0, node_path.join)(process.cwd(), ".gkm");
|
|
3268
3612
|
await (0, node_fs_promises.mkdir)(wrapperDir, { recursive: true });
|
|
3269
3613
|
const wrapperPath = (0, node_path.join)(wrapperDir, "entry-wrapper.ts");
|
|
3270
|
-
await
|
|
3614
|
+
await require_credentials$1.createEntryWrapper(wrapperPath, entryPath, secretsJsonPath);
|
|
3271
3615
|
const runner = new EntryRunner(wrapperPath, entryPath, watch, resolvedPort);
|
|
3272
3616
|
await runner.start();
|
|
3273
3617
|
let isShuttingDown = false;
|
|
@@ -3375,11 +3719,11 @@ var EntryRunner = class {
|
|
|
3375
3719
|
* one — for the discovery endpoint, which is told no password.
|
|
3376
3720
|
*/
|
|
3377
3721
|
function telemetryUiOf(services) {
|
|
3378
|
-
const ui = services.find((s) => s.container ===
|
|
3722
|
+
const ui = services.find((s) => s.container === require_credentials$1.TELEMETRY_CONTAINER);
|
|
3379
3723
|
if (!ui) return void 0;
|
|
3380
3724
|
return {
|
|
3381
3725
|
url: ui.address,
|
|
3382
|
-
email:
|
|
3726
|
+
email: require_credentials$1.LOCAL_LOGS_EMAIL
|
|
3383
3727
|
};
|
|
3384
3728
|
}
|
|
3385
3729
|
/**
|
|
@@ -3607,10 +3951,10 @@ var DevServer = class {
|
|
|
3607
3951
|
this.startTime = Date.now();
|
|
3608
3952
|
if (this.isRunning) await this.stop();
|
|
3609
3953
|
if (this.portExplicit) {
|
|
3610
|
-
if (!await
|
|
3954
|
+
if (!await require_credentials$1.isPortAvailable(this.requestedPort)) throw new DevPortInUse(this.requestedPort, listenerOn(this.requestedPort));
|
|
3611
3955
|
this.actualPort = this.requestedPort;
|
|
3612
3956
|
} else {
|
|
3613
|
-
this.actualPort = await
|
|
3957
|
+
this.actualPort = await require_credentials$1.findAvailablePort(this.requestedPort);
|
|
3614
3958
|
if (this.actualPort !== this.requestedPort) logger$5.log(`ℹ️ Port ${this.requestedPort} was in use, using port ${this.actualPort} instead`);
|
|
3615
3959
|
}
|
|
3616
3960
|
const serverEntryPath = (0, node_path.join)(this.serverDir, "server.ts");
|
|
@@ -3681,7 +4025,7 @@ var DevServer = class {
|
|
|
3681
4025
|
await this.stop();
|
|
3682
4026
|
let attempts = 0;
|
|
3683
4027
|
while (attempts < 30) {
|
|
3684
|
-
if (await
|
|
4028
|
+
if (await require_credentials$1.isPortAvailable(portToReuse)) break;
|
|
3685
4029
|
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
3686
4030
|
attempts++;
|
|
3687
4031
|
}
|
|
@@ -3788,7 +4132,7 @@ function servesItself(construct) {
|
|
|
3788
4132
|
*/
|
|
3789
4133
|
function selfServingSurface(options) {
|
|
3790
4134
|
const { declared, sources, workspaceRoot, appRoot, app } = options;
|
|
3791
|
-
const served =
|
|
4135
|
+
const served = require_stack.surfaceAt(declared, workspaceRoot, appRoot, app);
|
|
3792
4136
|
const source = served ? sources[served.id] : void 0;
|
|
3793
4137
|
if (!served || !source || !servesItself(source.construct)) return void 0;
|
|
3794
4138
|
return {
|
|
@@ -4070,7 +4414,7 @@ async function buildCommand(options) {
|
|
|
4070
4414
|
config: rootGkmConfig(loadedConfig.workspace),
|
|
4071
4415
|
appRoot: process.cwd()
|
|
4072
4416
|
} : await appHere();
|
|
4073
|
-
const target = options.provider ??
|
|
4417
|
+
const target = options.provider ?? require_credentials.providerOf(loadedConfig.workspace);
|
|
4074
4418
|
const workspaceRoot = loadedConfig.workspace.root;
|
|
4075
4419
|
const output = await buildOneApp({
|
|
4076
4420
|
config,
|
|
@@ -4135,15 +4479,15 @@ async function declaredIn(config, cwd) {
|
|
|
4135
4479
|
*/
|
|
4136
4480
|
function backendsOf(workspace) {
|
|
4137
4481
|
return {
|
|
4138
|
-
cache:
|
|
4482
|
+
cache: require_credentials.cacheBackendFor(require_credentials.providerOf(workspace)),
|
|
4139
4483
|
email: "ses"
|
|
4140
4484
|
};
|
|
4141
4485
|
}
|
|
4142
4486
|
/** One app's build, from its config and the command's options. */
|
|
4143
4487
|
async function buildOneApp(input) {
|
|
4144
4488
|
const { config, options, workspace, appRoot, appName, target } = input;
|
|
4145
|
-
const cacheBackend = options.cache ??
|
|
4146
|
-
const eventsBackend =
|
|
4489
|
+
const cacheBackend = options.cache ?? require_credentials.cacheBackendFor(require_credentials.providerOf(workspace));
|
|
4490
|
+
const eventsBackend = require_credentials.eventsBackendFor(require_credentials.providerOf(workspace));
|
|
4147
4491
|
const production = normalizeProductionConfig(options.production ?? false);
|
|
4148
4492
|
if (production) logger$4.log(`🏭 Building for PRODUCTION`);
|
|
4149
4493
|
logger$4.log(`Building for ${target}`);
|
|
@@ -4227,8 +4571,8 @@ async function buildApp(input) {
|
|
|
4227
4571
|
background,
|
|
4228
4572
|
served
|
|
4229
4573
|
}) : {};
|
|
4230
|
-
const tree =
|
|
4231
|
-
const outputOf = (target) =>
|
|
4574
|
+
const tree = require_stack.sharedDirectoryTree(declared, workspaceRoot, appRoot, appName);
|
|
4575
|
+
const outputOf = (target) => require_stack.appOutputDir(appRoot, target, tree);
|
|
4232
4576
|
const serverDir = outputOf("server");
|
|
4233
4577
|
const selfServing = selfServingSurface({
|
|
4234
4578
|
declared,
|
|
@@ -4240,7 +4584,7 @@ async function buildApp(input) {
|
|
|
4240
4584
|
if (selfServing) {
|
|
4241
4585
|
await writeSurfaceEntry(serverDir, selfServing.source, served[selfServing.id] ?? []);
|
|
4242
4586
|
const telemetry = require_EndpointGenerator.telemetryFor({
|
|
4243
|
-
node:
|
|
4587
|
+
node: require_credentials$1.telemetryOf(declared, selfServing.id),
|
|
4244
4588
|
appRoot,
|
|
4245
4589
|
app: appName,
|
|
4246
4590
|
cwd: workspaceRoot,
|
|
@@ -4256,7 +4600,7 @@ async function buildApp(input) {
|
|
|
4256
4600
|
...telemetry ? { telemetry } : {},
|
|
4257
4601
|
trustedOriginsKey: (0, _geekmidas_manifest.providedKeyFor)(selfServing.id, "rest-api", "trustedOrigins")
|
|
4258
4602
|
});
|
|
4259
|
-
const { bundleServer } = await Promise.resolve().then(() => require("./bundler-
|
|
4603
|
+
const { bundleServer } = await Promise.resolve().then(() => require("./bundler-B5ioF-1Q.cjs"));
|
|
4260
4604
|
await bundleServer({
|
|
4261
4605
|
entryPoint,
|
|
4262
4606
|
outputDir: (0, node_path.join)(outputDir, "dist"),
|
|
@@ -4296,7 +4640,7 @@ async function buildApp(input) {
|
|
|
4296
4640
|
serverDir
|
|
4297
4641
|
};
|
|
4298
4642
|
}
|
|
4299
|
-
const derived =
|
|
4643
|
+
const derived = require_stack.ownersContext({
|
|
4300
4644
|
declared,
|
|
4301
4645
|
sources: constructSources,
|
|
4302
4646
|
workspaceRoot,
|
|
@@ -4316,9 +4660,9 @@ async function buildApp(input) {
|
|
|
4316
4660
|
};
|
|
4317
4661
|
const endpointGenerator = new require_EndpointGenerator.EndpointGenerator();
|
|
4318
4662
|
const functionGenerator = new FunctionGenerator();
|
|
4319
|
-
const cronGenerator = new
|
|
4663
|
+
const cronGenerator = new require_stack.CronGenerator();
|
|
4320
4664
|
const subscriberGenerator = new require_SubscriberGenerator.SubscriberGenerator();
|
|
4321
|
-
const queueGenerator = new
|
|
4665
|
+
const queueGenerator = new require_stack.QueueGenerator();
|
|
4322
4666
|
const topicGenerator = new TopicGenerator();
|
|
4323
4667
|
const code = constructGlobs;
|
|
4324
4668
|
const [loadedEndpoints, allFunctions, allCrons, allSubscribers, allQueues, allTopics] = await Promise.all([
|
|
@@ -4329,14 +4673,14 @@ async function buildApp(input) {
|
|
|
4329
4673
|
queueGenerator.load(code, appRoot, bustCache),
|
|
4330
4674
|
topicGenerator.load(code, appRoot, bustCache)
|
|
4331
4675
|
]);
|
|
4332
|
-
const allEndpoints =
|
|
4333
|
-
const hosted =
|
|
4676
|
+
const allEndpoints = require_stack.servedBy(loadedEndpoints, derived.surface);
|
|
4677
|
+
const hosted = require_stack.workerUnits(input.workspace, declared, background).filter((unit) => unit.app === appName);
|
|
4334
4678
|
const hostedIds = new Set(hosted.map((unit) => unit.id));
|
|
4335
4679
|
const appRootAbs = (0, node_path.resolve)(appRoot);
|
|
4336
|
-
const hostedHere = (list) => list.filter(({ construct, path }) => construct.owner !== void 0 ? hostedIds.has(construct.owner) :
|
|
4337
|
-
const processorGenerator = new
|
|
4680
|
+
const hostedHere = (list) => list.filter(({ construct, path }) => construct.owner !== void 0 ? hostedIds.has(construct.owner) : require_stack.isUnder(path.absolute, appRootAbs));
|
|
4681
|
+
const processorGenerator = new require_stack.ProcessorGenerator();
|
|
4338
4682
|
const loadedProcessors = await processorGenerator.load(code, appRoot, bustCache);
|
|
4339
|
-
const hostedUnits = input.workspace ?
|
|
4683
|
+
const hostedUnits = input.workspace ? require_stack.processorUnits(input.workspace, declared).filter((unit) => unit.app === appName) : [];
|
|
4340
4684
|
const hostedProcessors = input.workspace ? loadedProcessors.filter(({ construct }) => hostedUnits.some((unit) => unit.id === construct.surfaceId)) : loadedProcessors;
|
|
4341
4685
|
const hostedCrons = hostedHere(allCrons);
|
|
4342
4686
|
const hostedQueues = hostedHere(allQueues);
|
|
@@ -4351,7 +4695,7 @@ async function buildApp(input) {
|
|
|
4351
4695
|
queues: hostedQueues,
|
|
4352
4696
|
subscribers: hostedSubscribers
|
|
4353
4697
|
};
|
|
4354
|
-
const reach = derived.surface ?
|
|
4698
|
+
const reach = derived.surface ? require_stack.reachedBy(declared, [
|
|
4355
4699
|
derived.surface.id,
|
|
4356
4700
|
...servesOnly ? [] : hosted.map((unit) => unit.id),
|
|
4357
4701
|
...production?.enabled ? [] : hostedUnits.flatMap((unit) => {
|
|
@@ -4373,7 +4717,7 @@ async function buildApp(input) {
|
|
|
4373
4717
|
eventsBackend,
|
|
4374
4718
|
target
|
|
4375
4719
|
}));
|
|
4376
|
-
if (target === "aws") buildContext.handlerDrivers =
|
|
4720
|
+
if (target === "aws") buildContext.handlerDrivers = require_stack.handlerDriversFor({
|
|
4377
4721
|
declared,
|
|
4378
4722
|
appRoot,
|
|
4379
4723
|
cacheBackend,
|
|
@@ -4412,14 +4756,14 @@ async function buildApp(input) {
|
|
|
4412
4756
|
...buildContext,
|
|
4413
4757
|
...runtimeDrivers({
|
|
4414
4758
|
appRoot,
|
|
4415
|
-
reach:
|
|
4759
|
+
reach: require_stack.reachedBy(declared, [workerId], work),
|
|
4416
4760
|
cacheBackend,
|
|
4417
4761
|
eventsBackend,
|
|
4418
4762
|
target
|
|
4419
4763
|
})
|
|
4420
4764
|
}),
|
|
4421
4765
|
telemetry: (workerId) => require_EndpointGenerator.telemetryFor({
|
|
4422
|
-
node:
|
|
4766
|
+
node: require_credentials$1.telemetryOf(declared, workerId),
|
|
4423
4767
|
appRoot,
|
|
4424
4768
|
app: appName,
|
|
4425
4769
|
cwd: workspaceRoot,
|
|
@@ -4445,7 +4789,7 @@ async function buildApp(input) {
|
|
|
4445
4789
|
serverDir,
|
|
4446
4790
|
processors: hostedProcessors,
|
|
4447
4791
|
telemetry: (fileServerId) => require_EndpointGenerator.telemetryFor({
|
|
4448
|
-
node:
|
|
4792
|
+
node: require_credentials$1.telemetryOf(declared, fileServerId),
|
|
4449
4793
|
appRoot,
|
|
4450
4794
|
app: appName,
|
|
4451
4795
|
cwd: workspaceRoot,
|
|
@@ -4484,7 +4828,7 @@ async function buildApp(input) {
|
|
|
4484
4828
|
*/
|
|
4485
4829
|
function processTelemetry(declared, surfaceId, workers) {
|
|
4486
4830
|
for (const id of [...surfaceId ? [surfaceId] : [], ...workers]) {
|
|
4487
|
-
const node =
|
|
4831
|
+
const node = require_credentials$1.telemetryOf(declared, id);
|
|
4488
4832
|
if (node) return node;
|
|
4489
4833
|
}
|
|
4490
4834
|
}
|
|
@@ -4514,7 +4858,7 @@ function runtimeDrivers(options) {
|
|
|
4514
4858
|
* runnables built from that worker, and nothing built from another.
|
|
4515
4859
|
*/
|
|
4516
4860
|
async function buildWorkers(input) {
|
|
4517
|
-
const generator = new
|
|
4861
|
+
const generator = new require_stack.WorkerGenerator();
|
|
4518
4862
|
for (const worker of input.workers) {
|
|
4519
4863
|
const owned = (list) => list.filter(({ construct }) => construct.owner === worker.id);
|
|
4520
4864
|
const crons = owned(input.crons);
|
|
@@ -4530,15 +4874,15 @@ async function buildWorkers(input) {
|
|
|
4530
4874
|
context,
|
|
4531
4875
|
workerId: worker.id,
|
|
4532
4876
|
...telemetry ? { telemetry } : {},
|
|
4533
|
-
outputDir:
|
|
4877
|
+
outputDir: require_stack.workerEntryDir(input.serverDir, worker.id),
|
|
4534
4878
|
crons,
|
|
4535
4879
|
queues,
|
|
4536
4880
|
subscribers
|
|
4537
4881
|
});
|
|
4538
4882
|
logger$4.log(`Generated worker ${worker.id}: ${crons.length} crons, ${queues.length} queues, ${subscribers.length} subscribers`);
|
|
4539
4883
|
if (!input.bundle) continue;
|
|
4540
|
-
const { bundleServer } = await Promise.resolve().then(() => require("./bundler-
|
|
4541
|
-
const outfile =
|
|
4884
|
+
const { bundleServer } = await Promise.resolve().then(() => require("./bundler-B5ioF-1Q.cjs"));
|
|
4885
|
+
const outfile = require_stack.workerBundleName(worker.id);
|
|
4542
4886
|
await bundleServer({
|
|
4543
4887
|
entryPoint,
|
|
4544
4888
|
outputDir: (0, node_path.join)(input.serverDir, "dist"),
|
|
@@ -4561,7 +4905,7 @@ async function buildWorkers(input) {
|
|
|
4561
4905
|
* processors of its file server and no other.
|
|
4562
4906
|
*/
|
|
4563
4907
|
async function buildProcessors(input) {
|
|
4564
|
-
const generator = new
|
|
4908
|
+
const generator = new require_stack.ProcessorGenerator();
|
|
4565
4909
|
const infos = [];
|
|
4566
4910
|
for (const fileServerId of input.units) {
|
|
4567
4911
|
const processors = input.processors.filter(({ construct }) => construct.surfaceId === fileServerId);
|
|
@@ -4572,15 +4916,15 @@ async function buildProcessors(input) {
|
|
|
4572
4916
|
context,
|
|
4573
4917
|
fileServerId,
|
|
4574
4918
|
...telemetry ? { telemetry } : {},
|
|
4575
|
-
outputDir:
|
|
4919
|
+
outputDir: require_stack.processorEntryDir(input.serverDir, fileServerId),
|
|
4576
4920
|
processors
|
|
4577
4921
|
});
|
|
4578
4922
|
const handler = (0, node_path.relative)(input.workspaceRoot, entryPoint);
|
|
4579
|
-
for (const { key, construct } of processors) infos.push(await
|
|
4923
|
+
for (const { key, construct } of processors) infos.push(await require_stack.processorInfo(key, construct, handler, context));
|
|
4580
4924
|
logger$4.log(`Generated processors for ${fileServerId}: ${processors.map(({ key }) => key).join(", ")}`);
|
|
4581
4925
|
if (!input.bundle) continue;
|
|
4582
|
-
const { bundleServer } = await Promise.resolve().then(() => require("./bundler-
|
|
4583
|
-
const outfile =
|
|
4926
|
+
const { bundleServer } = await Promise.resolve().then(() => require("./bundler-B5ioF-1Q.cjs"));
|
|
4927
|
+
const outfile = require_stack.processorBundleName(fileServerId);
|
|
4584
4928
|
await bundleServer({
|
|
4585
4929
|
entryPoint,
|
|
4586
4930
|
outputDir: (0, node_path.join)(input.serverDir, "dist"),
|
|
@@ -4602,7 +4946,7 @@ async function buildProcessors(input) {
|
|
|
4602
4946
|
* for no stage. Off for a stage that sends no telemetry.
|
|
4603
4947
|
*/
|
|
4604
4948
|
function clientTelemetry(options) {
|
|
4605
|
-
if (!
|
|
4949
|
+
if (!require_credentials$1.surfaceClientTraced(options.manifest, options.surfaceId)) return {};
|
|
4606
4950
|
const local = !options.stage || options.stage === options.localStage;
|
|
4607
4951
|
const sampleRate = require_workspace.stageSampleRate(options.telemetry, options.stage ?? "", local);
|
|
4608
4952
|
return sampleRate === void 0 ? {} : { telemetry: { sampleRate } };
|
|
@@ -4665,7 +5009,7 @@ async function buildForTarget(target, context, appRoot, outputDir, workspaceRoot
|
|
|
4665
5009
|
let masterKey;
|
|
4666
5010
|
if (context.production?.bundle && !skipBundle) {
|
|
4667
5011
|
logger$4.log(`\n📦 Bundling production server...`);
|
|
4668
|
-
const { bundleServer } = await Promise.resolve().then(() => require("./bundler-
|
|
5012
|
+
const { bundleServer } = await Promise.resolve().then(() => require("./bundler-B5ioF-1Q.cjs"));
|
|
4669
5013
|
const allConstructs = [
|
|
4670
5014
|
...endpoints.map((e) => e.construct),
|
|
4671
5015
|
...functions.map((f) => f.construct),
|
|
@@ -4797,7 +5141,7 @@ async function workspaceBuildCommand(workspace, options) {
|
|
|
4797
5141
|
const buildOrder = require_workspace.getAppBuildOrder(workspace);
|
|
4798
5142
|
logger$4.log(` Build order: ${buildOrder.join(" → ")}`);
|
|
4799
5143
|
try {
|
|
4800
|
-
const target = options.provider ??
|
|
5144
|
+
const target = options.provider ?? require_credentials.providerOf(workspace);
|
|
4801
5145
|
const builds = [];
|
|
4802
5146
|
for (const appName of buildOrder) {
|
|
4803
5147
|
const app = workspace.apps[appName];
|
|
@@ -4842,10 +5186,10 @@ async function workspaceBuildCommand(workspace, options) {
|
|
|
4842
5186
|
...sandbox.env,
|
|
4843
5187
|
NODE_ENV: options.production ? "production" : "development"
|
|
4844
5188
|
},
|
|
4845
|
-
timeoutMs:
|
|
5189
|
+
timeoutMs: require_stack.DEFAULT_TIMEOUT_MS,
|
|
4846
5190
|
output: "inherit"
|
|
4847
5191
|
});
|
|
4848
|
-
if (built.exitCode !== 0) throw new
|
|
5192
|
+
if (built.exitCode !== 0) throw new require_stack.CommandFailed(turboBin, turboArgs, built.exitCode, built.signal);
|
|
4849
5193
|
}
|
|
4850
5194
|
for (const [appName, app] of apps) {
|
|
4851
5195
|
const outputPath = getAppOutputPath(workspace, appName, app);
|
|
@@ -4944,7 +5288,7 @@ async function composeCommand(options, deps = {}) {
|
|
|
4944
5288
|
["tag", "--tag"]
|
|
4945
5289
|
].find(([key]) => options[key] !== void 0 && options[key] !== false)?.[1];
|
|
4946
5290
|
if (flag) throw new ComposeDestroyConflict(flag);
|
|
4947
|
-
const { composeDestroyCommand } = await Promise.resolve().then(() => require("./destroy-
|
|
5291
|
+
const { composeDestroyCommand } = await Promise.resolve().then(() => require("./destroy-DzeV0EdY.cjs"));
|
|
4948
5292
|
await composeDestroyCommand({
|
|
4949
5293
|
stage: options.stage,
|
|
4950
5294
|
...options.cwd ? { cwd: options.cwd } : {},
|
|
@@ -4962,12 +5306,12 @@ async function composeCommand(options, deps = {}) {
|
|
|
4962
5306
|
const { workspace } = loaded;
|
|
4963
5307
|
const { stage } = options;
|
|
4964
5308
|
if (options.down) {
|
|
4965
|
-
const { composeStackRef } = await Promise.resolve().then(() => require("./destroy-
|
|
5309
|
+
const { composeStackRef } = await Promise.resolve().then(() => require("./destroy-DzeV0EdY.cjs"));
|
|
4966
5310
|
const { ref, dir, server } = await composeStackRef(workspace, stage);
|
|
4967
|
-
const docker = deps.docker ??
|
|
5311
|
+
const docker = deps.docker ?? require_stack.dockerCompose;
|
|
4968
5312
|
if (server) console.log(`→ ${require_compose.sshTarget(server)} (docker over ssh)`);
|
|
4969
5313
|
const edgeFile = (0, node_path.join)(dir, `${_geekmidas_edge_proxy_traefik.EDGE_PROJECT}.yml`);
|
|
4970
|
-
if ((server || (0, node_fs.existsSync)(edgeFile)) && await
|
|
5314
|
+
if ((server || (0, node_fs.existsSync)(edgeFile)) && await require_stack.removeEdgeRoutes(docker, require_stack.edgeRef(edgeFile, { host: ref.host }), ref.project)) console.log(`🌐 Removed ${ref.project}'s routes from ${_geekmidas_edge_proxy_traefik.EDGE_PROJECT}.`);
|
|
4971
5315
|
await docker.down(ref);
|
|
4972
5316
|
console.log(`🛑 Stopped ${ref.project}. Its volumes are kept.`);
|
|
4973
5317
|
return;
|
|
@@ -5082,7 +5426,7 @@ const logger$3 = console;
|
|
|
5082
5426
|
* Get the Dokploy API token from stored credentials or environment
|
|
5083
5427
|
*/
|
|
5084
5428
|
async function getApiToken() {
|
|
5085
|
-
const token = await
|
|
5429
|
+
const token = await require_credentials.getDokployToken();
|
|
5086
5430
|
if (!token) throw new Error("Dokploy credentials not found.\nRun \"gkm login --service dokploy\" to authenticate, or set DOKPLOY_API_TOKEN.");
|
|
5087
5431
|
return token;
|
|
5088
5432
|
}
|
|
@@ -5091,7 +5435,7 @@ async function getApiToken() {
|
|
|
5091
5435
|
*/
|
|
5092
5436
|
async function getEndpoint(providedEndpoint) {
|
|
5093
5437
|
if (providedEndpoint) return providedEndpoint;
|
|
5094
|
-
const stored = await
|
|
5438
|
+
const stored = await require_credentials.getDokployCredentials();
|
|
5095
5439
|
if (stored) return stored.endpoint;
|
|
5096
5440
|
throw new Error("Dokploy endpoint not specified.\nEither run \"gkm login --service dokploy\" first, or provide --endpoint.");
|
|
5097
5441
|
}
|
|
@@ -5194,7 +5538,7 @@ async function deployListCommand(options) {
|
|
|
5194
5538
|
logger$3.log(" Run \"gkm registry:setup\" to configure a registry");
|
|
5195
5539
|
return;
|
|
5196
5540
|
}
|
|
5197
|
-
const storedRegistryId = await
|
|
5541
|
+
const storedRegistryId = await require_credentials.getDokployRegistryId();
|
|
5198
5542
|
for (const registry of registries) {
|
|
5199
5543
|
const marker = registry.registryId === storedRegistryId ? " (default)" : "";
|
|
5200
5544
|
logger$3.log(`\n ${registry.registryName}${marker} (${registry.registryId})`);
|
|
@@ -6543,25 +6887,25 @@ function loadPackageJson() {
|
|
|
6543
6887
|
* Run: pnpm --filter @geekmidas/cli sync-versions
|
|
6544
6888
|
*/
|
|
6545
6889
|
const GEEKMIDAS_VERSIONS = {
|
|
6546
|
-
"@geekmidas/audit": ">=10.0.0-alpha.
|
|
6547
|
-
"@geekmidas/auth": ">=10.0.0-alpha.
|
|
6548
|
-
"@geekmidas/cache": ">=10.0.0-alpha.
|
|
6549
|
-
"@geekmidas/client": ">=10.0.0-alpha.
|
|
6550
|
-
"@geekmidas/cloud": ">=10.0.0-alpha.
|
|
6551
|
-
"@geekmidas/constructs": ">=10.0.0-alpha.
|
|
6552
|
-
"@geekmidas/db": ">=10.0.0-alpha.
|
|
6553
|
-
"@geekmidas/emailkit": ">=10.0.0-alpha.
|
|
6554
|
-
"@geekmidas/envkit": ">=10.0.0-alpha.
|
|
6555
|
-
"@geekmidas/errors": ">=10.0.0-alpha.
|
|
6556
|
-
"@geekmidas/events": ">=10.0.0-alpha.
|
|
6557
|
-
"@geekmidas/logger": ">=10.0.0-alpha.
|
|
6558
|
-
"@geekmidas/manifest": ">=10.0.0-alpha.
|
|
6559
|
-
"@geekmidas/rate-limit": ">=10.0.0-alpha.
|
|
6560
|
-
"@geekmidas/schema": ">=10.0.0-alpha.
|
|
6561
|
-
"@geekmidas/services": ">=10.0.0-alpha.
|
|
6562
|
-
"@geekmidas/storage": ">=10.0.0-alpha.
|
|
6563
|
-
"@geekmidas/telescope": ">=10.0.0-alpha.
|
|
6564
|
-
"@geekmidas/testkit": ">=10.0.0-alpha.
|
|
6890
|
+
"@geekmidas/audit": ">=10.0.0-alpha.185 <10.0.0",
|
|
6891
|
+
"@geekmidas/auth": ">=10.0.0-alpha.185 <10.0.0",
|
|
6892
|
+
"@geekmidas/cache": ">=10.0.0-alpha.185 <10.0.0",
|
|
6893
|
+
"@geekmidas/client": ">=10.0.0-alpha.185 <10.0.0",
|
|
6894
|
+
"@geekmidas/cloud": ">=10.0.0-alpha.185 <10.0.0",
|
|
6895
|
+
"@geekmidas/constructs": ">=10.0.0-alpha.185 <10.0.0",
|
|
6896
|
+
"@geekmidas/db": ">=10.0.0-alpha.185 <10.0.0",
|
|
6897
|
+
"@geekmidas/emailkit": ">=10.0.0-alpha.185 <10.0.0",
|
|
6898
|
+
"@geekmidas/envkit": ">=10.0.0-alpha.185 <10.0.0",
|
|
6899
|
+
"@geekmidas/errors": ">=10.0.0-alpha.185 <10.0.0",
|
|
6900
|
+
"@geekmidas/events": ">=10.0.0-alpha.185 <10.0.0",
|
|
6901
|
+
"@geekmidas/logger": ">=10.0.0-alpha.185 <10.0.0",
|
|
6902
|
+
"@geekmidas/manifest": ">=10.0.0-alpha.185 <10.0.0",
|
|
6903
|
+
"@geekmidas/rate-limit": ">=10.0.0-alpha.185 <10.0.0",
|
|
6904
|
+
"@geekmidas/schema": ">=10.0.0-alpha.185 <10.0.0",
|
|
6905
|
+
"@geekmidas/services": ">=10.0.0-alpha.185 <10.0.0",
|
|
6906
|
+
"@geekmidas/storage": ">=10.0.0-alpha.185 <10.0.0",
|
|
6907
|
+
"@geekmidas/telescope": ">=10.0.0-alpha.185 <10.0.0",
|
|
6908
|
+
"@geekmidas/testkit": ">=10.0.0-alpha.185 <10.0.0",
|
|
6565
6909
|
"@geekmidas/cli": versionRange(loadPackageJson().version)
|
|
6566
6910
|
};
|
|
6567
6911
|
//#endregion
|
|
@@ -7754,7 +8098,7 @@ const COMMIT = /^[0-9a-f]{40}$/;
|
|
|
7754
8098
|
* The `uses:` value for the stages action, with a comment saying which CLI
|
|
7755
8099
|
* release the pinned commit is.
|
|
7756
8100
|
*/
|
|
7757
|
-
function stagesActionUses(commit = "
|
|
8101
|
+
function stagesActionUses(commit = "2bc5a7fe4dc142d47e03826ca6d410ea66e72483", version = cliVersion()) {
|
|
7758
8102
|
return commit && COMMIT.test(commit) ? `${STAGES_ACTION}@${commit} # @geekmidas/cli ${version}` : `${STAGES_ACTION}@main # pin to a commit SHA: see the action's README`;
|
|
7759
8103
|
}
|
|
7760
8104
|
//#endregion
|
|
@@ -8304,7 +8648,7 @@ function targetDeploy(options) {
|
|
|
8304
8648
|
role-to-assume: \${{ vars.AWS_ROLE_ARN }}
|
|
8305
8649
|
aws-region: ${options.region}
|
|
8306
8650
|
` : "";
|
|
8307
|
-
const keyDir = `~/.gkm/keys/${
|
|
8651
|
+
const keyDir = `~/.gkm/keys/${require_credentials.projectKey({ name: options.name })}`;
|
|
8308
8652
|
const stageSecrets = sst ? credentials : `
|
|
8309
8653
|
# The stage's secrets are kept in the encrypted .gkm/secrets/<stage>.json,
|
|
8310
8654
|
# and each environment holds its key as GKM_SECRETS_KEY. .gkm/ is
|
|
@@ -15829,11 +16173,11 @@ async function initCommand(projectName, options = {}) {
|
|
|
15829
16173
|
}
|
|
15830
16174
|
devSecrets.custom = customSecrets;
|
|
15831
16175
|
const keys = {
|
|
15832
|
-
key:
|
|
16176
|
+
key: require_credentials.projectKey({ name }),
|
|
15833
16177
|
legacy: [(0, node_path.basename)(targetDir)]
|
|
15834
16178
|
};
|
|
15835
|
-
await new
|
|
15836
|
-
const keyPath =
|
|
16179
|
+
await new require_credentials.FileSecretsStore(targetDir, keys).write(local, devSecrets);
|
|
16180
|
+
const keyPath = require_credentials.getKeyPath(local, keys);
|
|
15837
16181
|
console.log(` Secrets: .gkm/secrets/${local}.json (encrypted)`);
|
|
15838
16182
|
console.log(` Key: ${keyPath}\n`);
|
|
15839
16183
|
if (!options.skipInstall) {
|
|
@@ -16061,9 +16405,9 @@ const logger$2 = console;
|
|
|
16061
16405
|
*/
|
|
16062
16406
|
async function storeFor(stage) {
|
|
16063
16407
|
try {
|
|
16064
|
-
return await
|
|
16408
|
+
return await require_credentials.secretsStoreFor(await require_config.loadWorkspaceSettings(), stage);
|
|
16065
16409
|
} catch (error) {
|
|
16066
|
-
if (error instanceof require_config.ConfigNotFound) return new
|
|
16410
|
+
if (error instanceof require_config.ConfigNotFound) return new require_credentials.FileSecretsStore(process.cwd());
|
|
16067
16411
|
throw error;
|
|
16068
16412
|
}
|
|
16069
16413
|
}
|
|
@@ -16134,7 +16478,7 @@ async function secretsSetCommand(key, value, options) {
|
|
|
16134
16478
|
process.exit(1);
|
|
16135
16479
|
}
|
|
16136
16480
|
await assertCredentialValue(key, secretValue, stage);
|
|
16137
|
-
await store.write(stage,
|
|
16481
|
+
await store.write(stage, require_credentials.withCustomSecret(secrets, key, secretValue));
|
|
16138
16482
|
logger$2.log(`\n✓ Secret "${key}" set for stage "${stage}" (${store.name})`);
|
|
16139
16483
|
}
|
|
16140
16484
|
/** `gkm secrets:unset` for a key the stage does not hold. */
|
|
@@ -16197,7 +16541,7 @@ async function assertCredentialValue(key, value, stage) {
|
|
|
16197
16541
|
}
|
|
16198
16542
|
const check = await (await require_credentialSchemas.loadCredentialSchemas({
|
|
16199
16543
|
root: workspace.root,
|
|
16200
|
-
patterns:
|
|
16544
|
+
patterns: require_stack.constructGlobs(workspace)
|
|
16201
16545
|
})).check(key, value);
|
|
16202
16546
|
if (!check.ok) throw new require_credentialSchemas.CredentialsInvalid(stage, [{
|
|
16203
16547
|
key,
|
|
@@ -16223,7 +16567,7 @@ async function secretsShowCommand(options) {
|
|
|
16223
16567
|
logger$2.log(` host: ${creds.host}`);
|
|
16224
16568
|
logger$2.log(` port: ${creds.port}`);
|
|
16225
16569
|
logger$2.log(` username: ${creds.username}`);
|
|
16226
|
-
logger$2.log(` password: ${reveal ? creds.password :
|
|
16570
|
+
logger$2.log(` password: ${reveal ? creds.password : require_credentials.maskPassword(creds.password)}`);
|
|
16227
16571
|
if (creds.database) logger$2.log(` database: ${creds.database}`);
|
|
16228
16572
|
if (creds.bucket) logger$2.log(` bucket: ${creds.bucket}`);
|
|
16229
16573
|
}
|
|
@@ -16233,7 +16577,7 @@ async function secretsShowCommand(options) {
|
|
|
16233
16577
|
if (secrets.urls.STORAGE_ENDPOINT) logger$2.log(` STORAGE_ENDPOINT: ${secrets.urls.STORAGE_ENDPOINT}`);
|
|
16234
16578
|
if (Object.keys(secrets.custom).length > 0) {
|
|
16235
16579
|
logger$2.log("\nCustom Secrets:");
|
|
16236
|
-
for (const [key, value] of Object.entries(secrets.custom)) logger$2.log(` ${key}: ${reveal ? value :
|
|
16580
|
+
for (const [key, value] of Object.entries(secrets.custom)) logger$2.log(` ${key}: ${reveal ? value : require_credentials.maskPassword(value)}`);
|
|
16237
16581
|
}
|
|
16238
16582
|
if (!reveal) logger$2.log("\nUse --reveal to show actual values");
|
|
16239
16583
|
}
|
|
@@ -16313,7 +16657,7 @@ async function secretsImportCommand(file, options) {
|
|
|
16313
16657
|
function maskUrl(url) {
|
|
16314
16658
|
try {
|
|
16315
16659
|
const parsed = new URL(url);
|
|
16316
|
-
if (parsed.password) parsed.password =
|
|
16660
|
+
if (parsed.password) parsed.password = require_credentials.maskPassword(parsed.password);
|
|
16317
16661
|
return parsed.toString();
|
|
16318
16662
|
} catch {
|
|
16319
16663
|
return url;
|
|
@@ -16379,7 +16723,7 @@ async function setupCommand(options = {}) {
|
|
|
16379
16723
|
* free and quiet.
|
|
16380
16724
|
*/
|
|
16381
16725
|
async function reconcileLocal(workspace, stage, options) {
|
|
16382
|
-
const result = await
|
|
16726
|
+
const result = await require_stack.reconcileWorkspace(workspace, { stage });
|
|
16383
16727
|
if (result.plan.containers.length === 0) {
|
|
16384
16728
|
logger$1.log("🐳 No containers declared");
|
|
16385
16729
|
return;
|
|
@@ -16389,7 +16733,7 @@ async function reconcileLocal(workspace, stage, options) {
|
|
|
16389
16733
|
return;
|
|
16390
16734
|
}
|
|
16391
16735
|
logger$1.log("🐳 Services");
|
|
16392
|
-
for (const line of
|
|
16736
|
+
for (const line of require_credentials$1.describeServices(result.services)) logger$1.log(line);
|
|
16393
16737
|
const url = result.plan.resources.filter((r) => r.kind === "rest-api" || r.kind === "site" || r.kind === "file-server").map((r) => result.env[r.envKey]).find((address) => address?.startsWith("https://"));
|
|
16394
16738
|
if (url) await ensureTrusted(workspace.root, url, { ...options.yes ? { assumeYes: true } : {} });
|
|
16395
16739
|
}
|
|
@@ -16406,11 +16750,11 @@ async function resolveSecrets(stage, workspace, options) {
|
|
|
16406
16750
|
logger$1.log("🔐 Generating fresh secrets (--force)...");
|
|
16407
16751
|
return generateFreshSecrets(stage, workspace);
|
|
16408
16752
|
}
|
|
16409
|
-
const store = await
|
|
16753
|
+
const store = await require_credentials.secretsStoreFor(workspace, stage);
|
|
16410
16754
|
const secrets = await store.read(stage);
|
|
16411
16755
|
if (secrets) {
|
|
16412
16756
|
logger$1.log("🔐 Using existing secrets");
|
|
16413
|
-
const reconciled = reconcileSecrets(secrets, workspace, await
|
|
16757
|
+
const reconciled = reconcileSecrets(secrets, workspace, await require_stack.derivedContainers(workspace, stage));
|
|
16414
16758
|
if (reconciled) await store.write(stage, reconciled);
|
|
16415
16759
|
return reconciled ?? secrets;
|
|
16416
16760
|
}
|
|
@@ -16512,9 +16856,9 @@ function createFreshWorkspaceSecrets(stage, workspace, containers = []) {
|
|
|
16512
16856
|
*/
|
|
16513
16857
|
async function ensureStageSecrets(stage, cwd = process.cwd()) {
|
|
16514
16858
|
const { workspace } = await require_config.loadWorkspaceConfig(cwd);
|
|
16515
|
-
const store = await
|
|
16859
|
+
const store = await require_credentials.secretsStoreFor(workspace, stage);
|
|
16516
16860
|
if (await store.read(stage)) return false;
|
|
16517
|
-
const secrets = createFreshWorkspaceSecrets(stage, workspace, await
|
|
16861
|
+
const secrets = createFreshWorkspaceSecrets(stage, workspace, await require_stack.derivedContainers(workspace, stage));
|
|
16518
16862
|
await store.write(stage, secrets);
|
|
16519
16863
|
return true;
|
|
16520
16864
|
}
|
|
@@ -16522,8 +16866,8 @@ async function ensureStageSecrets(stage, cwd = process.cwd()) {
|
|
|
16522
16866
|
* Generate fresh secrets for the workspace.
|
|
16523
16867
|
*/
|
|
16524
16868
|
async function generateFreshSecrets(stage, workspace) {
|
|
16525
|
-
const secrets = createFreshWorkspaceSecrets(stage, workspace, await
|
|
16526
|
-
const store = await
|
|
16869
|
+
const secrets = createFreshWorkspaceSecrets(stage, workspace, await require_stack.derivedContainers(workspace, stage));
|
|
16870
|
+
const store = await require_credentials.secretsStoreFor(workspace, stage);
|
|
16527
16871
|
await store.write(stage, secrets);
|
|
16528
16872
|
logger$1.log(` Secrets written to the "${stage}" store (${store.name})`);
|
|
16529
16873
|
return secrets;
|
|
@@ -16571,9 +16915,9 @@ async function dropTestDatabases(cwd, root, sql) {
|
|
|
16571
16915
|
const client = sql(recorded.port);
|
|
16572
16916
|
for (const name of recorded.names) {
|
|
16573
16917
|
if (!name.endsWith(`_test`)) throw new NotATestDatabase(name);
|
|
16574
|
-
await client.query(void 0, `DROP DATABASE IF EXISTS ${
|
|
16918
|
+
await client.query(void 0, `DROP DATABASE IF EXISTS ${require_stack.quoteIdentifier(name)} WITH (FORCE)`);
|
|
16575
16919
|
}
|
|
16576
|
-
await
|
|
16920
|
+
await require_stack.forgetState(root, require_workspace.TEST_STAGE);
|
|
16577
16921
|
const { databases: _dropped, ...rest } = ready;
|
|
16578
16922
|
await (0, node_fs_promises.writeFile)(readyPath, JSON.stringify(rest, null, 2));
|
|
16579
16923
|
return recorded.names;
|
|
@@ -16613,10 +16957,10 @@ async function testCommand(options = {}) {
|
|
|
16613
16957
|
const { ensureStageSecrets } = await Promise.resolve().then(() => setup_exports);
|
|
16614
16958
|
if (await ensureStageSecrets(stage, cwd)) console.log(` 🔐 Generated fresh ${stage} secrets (auto-setup)`);
|
|
16615
16959
|
}
|
|
16616
|
-
const defaultEnv =
|
|
16960
|
+
const defaultEnv = require_credentials$1.loadEnvFiles(".env");
|
|
16617
16961
|
if (defaultEnv.loaded.length > 0) console.log(` 📦 Loaded env: ${defaultEnv.loaded.join(", ")}`);
|
|
16618
16962
|
if (!options.prepare) await teardown(cwd);
|
|
16619
|
-
const result = await
|
|
16963
|
+
const result = await require_credentials$1.prepareEntryCredentials({
|
|
16620
16964
|
stage,
|
|
16621
16965
|
startDocker: !options.prepare,
|
|
16622
16966
|
secretsFileName: "test-secrets.json",
|
|
@@ -16641,15 +16985,15 @@ async function testCommand(options = {}) {
|
|
|
16641
16985
|
await (0, node_fs_promises.writeFile)(result.secretsJsonPath, JSON.stringify(finalCredentials, null, 2));
|
|
16642
16986
|
const gkmDir = (0, node_path.join)(cwd, ".gkm");
|
|
16643
16987
|
const preloadPath = (0, node_path.join)(gkmDir, "test-credentials-preload.ts");
|
|
16644
|
-
await
|
|
16988
|
+
await require_credentials$1.createCredentialsPreload(preloadPath, result.secretsJsonPath);
|
|
16645
16989
|
const workspace = await require_config.loadWorkspaceConfig(cwd).then((loaded) => loaded.workspace).catch(() => void 0);
|
|
16646
16990
|
if (workspace) await writeStageTypes(workspace.root, workspace.stages);
|
|
16647
16991
|
const manifestPath = workspace ? await require_ready.writeTestHarness({
|
|
16648
16992
|
root: workspace.root,
|
|
16649
16993
|
targets: [workspace.root, ...Object.values(workspace.apps).map((app) => (0, node_path.isAbsolute)(app.path) ? app.path : (0, node_path.join)(workspace.root, app.path))],
|
|
16650
|
-
patterns:
|
|
16651
|
-
cacheBackend:
|
|
16652
|
-
eventsBackend:
|
|
16994
|
+
patterns: require_stack.constructGlobs(workspace),
|
|
16995
|
+
cacheBackend: require_stack.backendsOf(workspace).cache,
|
|
16996
|
+
eventsBackend: require_stack.backendsOf(workspace).events,
|
|
16653
16997
|
stage: require_workspace.TEST_STAGE,
|
|
16654
16998
|
env: finalCredentials,
|
|
16655
16999
|
factories: (0, node_path.join)(workspace.root, workspace.test.factories ?? "test/factories")
|
|
@@ -16705,9 +17049,9 @@ async function testCommand(options = {}) {
|
|
|
16705
17049
|
/** Drop what the last setup created — see `dropTestDatabases`. */
|
|
16706
17050
|
async function teardown(cwd) {
|
|
16707
17051
|
const workspace = await require_config.loadWorkspaceConfig(cwd).then((loaded) => loaded.workspace).catch(() => void 0);
|
|
16708
|
-
const credentials = workspace ? await
|
|
17052
|
+
const credentials = workspace ? await require_credentials$1.readLocalCredentials(workspace) : null;
|
|
16709
17053
|
if (!workspace || !credentials) return;
|
|
16710
|
-
const dropped = await dropTestDatabases(cwd, workspace.root, (port) =>
|
|
17054
|
+
const dropped = await dropTestDatabases(cwd, workspace.root, (port) => require_stack.pgClient(port, credentials.postgres));
|
|
16711
17055
|
if (dropped.length > 0) console.log(` 🧹 Dropped ${dropped.join(", ")}`);
|
|
16712
17056
|
}
|
|
16713
17057
|
/**
|
|
@@ -16715,8 +17059,8 @@ async function teardown(cwd) {
|
|
|
16715
17059
|
* the plan provisions, on the port the shared container answers.
|
|
16716
17060
|
*/
|
|
16717
17061
|
function testDatabases(reconciled) {
|
|
16718
|
-
const port = reconciled?.ports[
|
|
16719
|
-
const names = reconciled ?
|
|
17062
|
+
const port = reconciled?.ports[require_credentials$1.primaryPortKey("postgres")];
|
|
17063
|
+
const names = reconciled ? require_stack.postgresDatabaseNames(reconciled.plan) : [];
|
|
16720
17064
|
return port !== void 0 && names.length > 0 ? { databases: {
|
|
16721
17065
|
port,
|
|
16722
17066
|
names
|
|
@@ -16727,11 +17071,11 @@ function testDatabases(reconciled) {
|
|
|
16727
17071
|
* starts without the reference data the app needs.
|
|
16728
17072
|
*/
|
|
16729
17073
|
async function migrateTestStage(workspace, env) {
|
|
16730
|
-
const { migrateAndSeed } = await Promise.resolve().then(() => require("./migrate-
|
|
17074
|
+
const { migrateAndSeed } = await Promise.resolve().then(() => require("./migrate-CDMdrniJ.cjs"));
|
|
16731
17075
|
const { discover } = await Promise.resolve().then(() => require("./discover-OXczlq08.cjs")).then((n) => n.discover_exports);
|
|
16732
17076
|
const sources = {};
|
|
16733
17077
|
const manifest = await discover({
|
|
16734
|
-
patterns:
|
|
17078
|
+
patterns: require_stack.constructGlobs(workspace),
|
|
16735
17079
|
cwd: workspace.root,
|
|
16736
17080
|
sources
|
|
16737
17081
|
});
|
|
@@ -16741,7 +17085,7 @@ async function migrateTestStage(workspace, env) {
|
|
|
16741
17085
|
sources,
|
|
16742
17086
|
env,
|
|
16743
17087
|
stage: require_workspace.TEST_STAGE,
|
|
16744
|
-
backends:
|
|
17088
|
+
backends: require_stack.backendsOf(workspace)
|
|
16745
17089
|
});
|
|
16746
17090
|
for (const { target, applied } of migrations) if (applied.length > 0) console.log(` 🗄️ ${target.migrations}: applied ${applied.join(", ")}`);
|
|
16747
17091
|
for (const { target, seeded } of seeds) if (seeded.length > 0) console.log(` 🌱 ${target.seeds}: ran ${seeded.join(", ")}`);
|
|
@@ -17181,7 +17525,7 @@ program.command("db:tunnel").description("Open an SSH tunnel to a deployed compo
|
|
|
17181
17525
|
try {
|
|
17182
17526
|
const globalOptions = program.opts();
|
|
17183
17527
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
17184
|
-
const { dbTunnel } = await Promise.resolve().then(() => require("./dbTunnel-
|
|
17528
|
+
const { dbTunnel } = await Promise.resolve().then(() => require("./dbTunnel-DVohSZJQ.cjs"));
|
|
17185
17529
|
await dbTunnel({
|
|
17186
17530
|
...options,
|
|
17187
17531
|
...construct ? { construct } : {}
|
|
@@ -17194,7 +17538,7 @@ program.command("eas:sync").description("Set up a mobile app's EAS project for a
|
|
|
17194
17538
|
try {
|
|
17195
17539
|
const globalOptions = program.opts();
|
|
17196
17540
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
17197
|
-
const { easSync } = await Promise.resolve().then(() => require("./eas-
|
|
17541
|
+
const { easSync } = await Promise.resolve().then(() => require("./eas-Dt_vRzb4.cjs"));
|
|
17198
17542
|
await easSync(options);
|
|
17199
17543
|
} catch (error) {
|
|
17200
17544
|
exitWithError(error);
|
|
@@ -17204,7 +17548,7 @@ program.command("publish").description("Ship a mobile app for a deployed stage:
|
|
|
17204
17548
|
try {
|
|
17205
17549
|
const globalOptions = program.opts();
|
|
17206
17550
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
17207
|
-
const { publish, PublishModeConflict } = await Promise.resolve().then(() => require("./publish
|
|
17551
|
+
const { publish, PublishModeConflict } = await Promise.resolve().then(() => require("./publish--EQ4Tw3F.cjs"));
|
|
17208
17552
|
if (options.build && options.update) throw new PublishModeConflict();
|
|
17209
17553
|
const { build, update, ...rest } = options;
|
|
17210
17554
|
await publish({
|
|
@@ -17220,7 +17564,7 @@ program.command("deploy:google-play").description("Let EAS Submit publish a mobi
|
|
|
17220
17564
|
try {
|
|
17221
17565
|
const globalOptions = program.opts();
|
|
17222
17566
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
17223
|
-
const { deployGooglePlay } = await Promise.resolve().then(() => require("./googlePlay-
|
|
17567
|
+
const { deployGooglePlay } = await Promise.resolve().then(() => require("./googlePlay-CYney-Of.cjs"));
|
|
17224
17568
|
await deployGooglePlay(options);
|
|
17225
17569
|
} catch (error) {
|
|
17226
17570
|
exitWithError(error);
|
|
@@ -17242,7 +17586,7 @@ program.command("migrate").description("Apply each database construct's migratio
|
|
|
17242
17586
|
try {
|
|
17243
17587
|
const globalOptions = program.opts();
|
|
17244
17588
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
17245
|
-
const { migrateCommand } = await Promise.resolve().then(() => require("./migrate-
|
|
17589
|
+
const { migrateCommand } = await Promise.resolve().then(() => require("./migrate-CDMdrniJ.cjs"));
|
|
17246
17590
|
await migrateCommand({
|
|
17247
17591
|
...options,
|
|
17248
17592
|
...construct ? { construct } : {}
|
|
@@ -17255,7 +17599,7 @@ program.command("seed").description("Migrate, then run each database construct's
|
|
|
17255
17599
|
try {
|
|
17256
17600
|
const globalOptions = program.opts();
|
|
17257
17601
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
17258
|
-
const { seedCommand } = await Promise.resolve().then(() => require("./migrate-
|
|
17602
|
+
const { seedCommand } = await Promise.resolve().then(() => require("./migrate-CDMdrniJ.cjs"));
|
|
17259
17603
|
await seedCommand({
|
|
17260
17604
|
...options,
|
|
17261
17605
|
...construct ? { construct } : {}
|
|
@@ -17268,7 +17612,7 @@ program.command("migration").description("Write a construct's next migration: an
|
|
|
17268
17612
|
try {
|
|
17269
17613
|
const globalOptions = program.opts();
|
|
17270
17614
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
17271
|
-
const { migrationCommand } = await Promise.resolve().then(() => require("./migrate-
|
|
17615
|
+
const { migrationCommand } = await Promise.resolve().then(() => require("./migrate-CDMdrniJ.cjs"));
|
|
17272
17616
|
await migrationCommand({
|
|
17273
17617
|
construct,
|
|
17274
17618
|
...name ? { name } : {}
|
|
@@ -17309,7 +17653,7 @@ program.command("docker").description("Generate Docker deployment files").option
|
|
|
17309
17653
|
try {
|
|
17310
17654
|
const globalOptions = program.opts();
|
|
17311
17655
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
17312
|
-
await
|
|
17656
|
+
await require_stack.dockerCommand(options);
|
|
17313
17657
|
} catch (error) {
|
|
17314
17658
|
exitWithError(error);
|
|
17315
17659
|
}
|
|
@@ -17327,7 +17671,7 @@ program.command("prepack").description("Generate Docker files for production dep
|
|
|
17327
17671
|
try {
|
|
17328
17672
|
const globalOptions = program.opts();
|
|
17329
17673
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
17330
|
-
await
|
|
17674
|
+
await require_stack.dockerCommand({
|
|
17331
17675
|
build: options.build,
|
|
17332
17676
|
push: options.push,
|
|
17333
17677
|
tag: options.tag,
|
|
@@ -17368,7 +17712,7 @@ program.command("secrets:add").description("Build the keys a stage must be given
|
|
|
17368
17712
|
try {
|
|
17369
17713
|
const globalOptions = program.opts();
|
|
17370
17714
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
17371
|
-
const { secretsAddCommand } = await Promise.resolve().then(() => require("./add-
|
|
17715
|
+
const { secretsAddCommand } = await Promise.resolve().then(() => require("./add-CdVGxiKW.cjs"));
|
|
17372
17716
|
await secretsAddCommand(options);
|
|
17373
17717
|
} catch (error) {
|
|
17374
17718
|
exitWithError(error);
|
|
@@ -17378,7 +17722,7 @@ program.command("encryption:rotate").description("Add a new current key to an En
|
|
|
17378
17722
|
try {
|
|
17379
17723
|
const globalOptions = program.opts();
|
|
17380
17724
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
17381
|
-
const { encryptionRotateCommand } = await Promise.resolve().then(() => require("./encryption-
|
|
17725
|
+
const { encryptionRotateCommand } = await Promise.resolve().then(() => require("./encryption-BE2wxfyH.cjs"));
|
|
17382
17726
|
await encryptionRotateCommand(construct, options);
|
|
17383
17727
|
} catch (error) {
|
|
17384
17728
|
exitWithError(error);
|
|
@@ -17388,7 +17732,7 @@ program.command("encryption:retire").description("Remove an old key from an Encr
|
|
|
17388
17732
|
try {
|
|
17389
17733
|
const globalOptions = program.opts();
|
|
17390
17734
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
17391
|
-
const { encryptionRetireCommand } = await Promise.resolve().then(() => require("./encryption-
|
|
17735
|
+
const { encryptionRetireCommand } = await Promise.resolve().then(() => require("./encryption-BE2wxfyH.cjs"));
|
|
17392
17736
|
await encryptionRetireCommand(construct, key, options);
|
|
17393
17737
|
} catch (error) {
|
|
17394
17738
|
exitWithError(error);
|
|
@@ -17427,7 +17771,7 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
|
|
|
17427
17771
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
17428
17772
|
const { loadWorkspaceConfig } = await Promise.resolve().then(() => require("./config.cjs"));
|
|
17429
17773
|
const { reconcileMissingSecrets } = await Promise.resolve().then(() => require("./reconcile-CuCQBa5-.cjs"));
|
|
17430
|
-
const { secretsStoreFor } = await Promise.resolve().then(() => require("./
|
|
17774
|
+
const { secretsStoreFor } = await Promise.resolve().then(() => require("./credentials-n2abUWwJ.cjs")).then((n) => n.store_exports);
|
|
17431
17775
|
const { workspace } = await loadWorkspaceConfig();
|
|
17432
17776
|
const stage = options.stage ?? workspace.stages.local;
|
|
17433
17777
|
const store = await secretsStoreFor(workspace, stage);
|
|
@@ -17436,7 +17780,7 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
|
|
|
17436
17780
|
console.error(`No secrets found for stage "${stage}". Run "gkm secrets:init --stage ${stage}" first.`);
|
|
17437
17781
|
process.exit(1);
|
|
17438
17782
|
}
|
|
17439
|
-
const { derivedContainers } = await Promise.resolve().then(() => require("./
|
|
17783
|
+
const { derivedContainers } = await Promise.resolve().then(() => require("./stack-BYhtz-bE.cjs")).then((n) => n.workspace_exports);
|
|
17440
17784
|
const result = reconcileMissingSecrets(secrets, workspace, await derivedContainers(workspace, stage));
|
|
17441
17785
|
if (!result) {
|
|
17442
17786
|
console.log(`\n✓ Secrets for stage "${stage}" are up-to-date`);
|
|
@@ -17453,14 +17797,14 @@ program.command("secrets:migrate").description("Copy a deployed stage's secrets
|
|
|
17453
17797
|
try {
|
|
17454
17798
|
const globalOptions = program.opts();
|
|
17455
17799
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
17456
|
-
const { secretsMigrateCommand } = await Promise.resolve().then(() => require("./migrate-
|
|
17800
|
+
const { secretsMigrateCommand } = await Promise.resolve().then(() => require("./migrate-CuTQha4s.cjs"));
|
|
17457
17801
|
await secretsMigrateCommand(options);
|
|
17458
17802
|
} catch (error) {
|
|
17459
17803
|
exitWithError(error);
|
|
17460
17804
|
}
|
|
17461
17805
|
});
|
|
17462
17806
|
program.command("deploy").description("Deploy a stage through its target").option("--target <name>", "Deploy target: dokploy, compose, sst, or one named in deploy.targets (default: deploy.default)").option("--provider <provider>", "[DEPRECATED] Use --target instead").requiredOption("--stage <stage>", "Deployment stage (e.g., production, staging)").option("--tag <tag>", "Release tag (default: a timestamp; compose: the commit). Each image is tagged <tag>-<stage>. Compose pulls a given tag").option("--skip-push", "Skip pushing image to registry").option("--skip-build", "Skip build step (use existing build)").option("--json", "Write events as JSON lines instead of progress; never prompts").option("--dry-run", "Show what would be created or reused; change, build and push nothing").option("--atomic", "If the release fails, roll back every app it released, not only the failed ones").option("--allow-dev-services", "Server targets: run the dev service (MinIO, Mailpit) for every bucket and mail the stage doesn't account for. Not production-grade").option("--skip-dns", "Compose: neither write the public hosts' DNS records nor check they point at GKM_SERVER_IPV4 (a CDN or proxy in front, or records written elsewhere)").option("--rotate-keys", "Deployed stage: each provider issues its runtime keys a successor (the old one is deleted by the next deploy)").option("--retire-old-keys", "Deployed stage: delete a rotated-out key now instead of on the next deploy").action(async (options) => {
|
|
17463
|
-
const { deployCli } = await Promise.resolve().then(() => require("./cli-
|
|
17807
|
+
const { deployCli } = await Promise.resolve().then(() => require("./cli-PLhqvPOC.cjs"));
|
|
17464
17808
|
const globalOptions = program.opts();
|
|
17465
17809
|
const code = await deployCli({
|
|
17466
17810
|
cwd: (0, node_path.resolve)(globalOptions.cwd ?? process.cwd()),
|
|
@@ -17480,8 +17824,8 @@ program.command("deploy").description("Deploy a stage through its target").optio
|
|
|
17480
17824
|
});
|
|
17481
17825
|
program.command("deploy:rollback").description("Put a stage's app back on its previous release (Dokploy): one app with --app, every app with --atomic").requiredOption("--stage <stage>", "A deployed stage").option("--app <app>", "The app to roll back").option("--atomic", "Roll back every app that has an earlier release").action(async (options) => {
|
|
17482
17826
|
try {
|
|
17483
|
-
const { rollbackStage } = await Promise.resolve().then(() => require("./rollback-
|
|
17484
|
-
const { terminalCredentials } = await Promise.resolve().then(() => require("./terminal-
|
|
17827
|
+
const { rollbackStage } = await Promise.resolve().then(() => require("./rollback-C6bCANv7.cjs")).then((n) => n.rollback_exports);
|
|
17828
|
+
const { terminalCredentials } = await Promise.resolve().then(() => require("./terminal-DXUXlqrO.cjs"));
|
|
17485
17829
|
const globalOptions = program.opts();
|
|
17486
17830
|
await rollbackStage({
|
|
17487
17831
|
cwd: (0, node_path.resolve)(globalOptions.cwd ?? process.cwd()),
|
|
@@ -17499,7 +17843,7 @@ program.command("compose:server").description("Set up a stage's server for compo
|
|
|
17499
17843
|
try {
|
|
17500
17844
|
const globalOptions = program.opts();
|
|
17501
17845
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
17502
|
-
const { composeServerCommand } = await Promise.resolve().then(() => require("./serverSetup-
|
|
17846
|
+
const { composeServerCommand } = await Promise.resolve().then(() => require("./serverSetup-D3-FE7Dj.cjs"));
|
|
17503
17847
|
await composeServerCommand(options);
|
|
17504
17848
|
} catch (error) {
|
|
17505
17849
|
exitWithError(error);
|
|
@@ -17524,7 +17868,7 @@ program.command("deploy:github").description("Let GitHub Actions deploy a stage:
|
|
|
17524
17868
|
try {
|
|
17525
17869
|
const globalOptions = program.opts();
|
|
17526
17870
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
17527
|
-
const { deployGithubCommand } = await Promise.resolve().then(() => require("./github-
|
|
17871
|
+
const { deployGithubCommand } = await Promise.resolve().then(() => require("./github-DoHdtsDX.cjs"));
|
|
17528
17872
|
await deployGithubCommand(options);
|
|
17529
17873
|
} catch (error) {
|
|
17530
17874
|
exitWithError(error);
|
|
@@ -17534,7 +17878,7 @@ program.command("stages").description("The workspace's stages from gkm.config.ts
|
|
|
17534
17878
|
try {
|
|
17535
17879
|
const globalOptions = program.opts();
|
|
17536
17880
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
17537
|
-
const { stagesCommand } = await Promise.resolve().then(() => require("./stages-
|
|
17881
|
+
const { stagesCommand } = await Promise.resolve().then(() => require("./stages-Dk6Lv7DY.cjs"));
|
|
17538
17882
|
await stagesCommand(options);
|
|
17539
17883
|
} catch (error) {
|
|
17540
17884
|
exitWithError(error);
|
|
@@ -17660,7 +18004,7 @@ program.command("state:diff").description("Compare local and remote deployment s
|
|
|
17660
18004
|
exitWithError(error);
|
|
17661
18005
|
}
|
|
17662
18006
|
});
|
|
17663
|
-
program.command("backup:list").description("List a compose stage's backups, newest first: when, which databases, how big").requiredOption("--stage <stage>", "Deployed stage").option("--profile <profile>", "AWS profile for the stage's account").option("--json", "Output as JSON").action(async (options) => {
|
|
18007
|
+
program.command("backup:list").description("List a compose stage's backups, newest first: when, which databases, how big — and its point-in-time restore window").requiredOption("--stage <stage>", "Deployed stage").option("--profile <profile>", "AWS profile for the stage's account").option("--json", "Output as JSON").action(async (options) => {
|
|
17664
18008
|
try {
|
|
17665
18009
|
const globalOptions = program.opts();
|
|
17666
18010
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
@@ -17669,7 +18013,7 @@ program.command("backup:list").description("List a compose stage's backups, newe
|
|
|
17669
18013
|
exitWithError(error);
|
|
17670
18014
|
}
|
|
17671
18015
|
});
|
|
17672
|
-
program.command("backup:now").description("Back up a compose stage now: runs its stack's backups container (docker exec)").requiredOption("--stage <stage>", "Deployed stage").action(async (options) => {
|
|
18016
|
+
program.command("backup:now").description("Back up a compose stage now: runs its stack's backups container (docker exec)").requiredOption("--stage <stage>", "Deployed stage").option("--base", "A base backup for point-in-time recovery (wal-g backup-push), rather than the dumps").action(async (options) => {
|
|
17673
18017
|
try {
|
|
17674
18018
|
const globalOptions = program.opts();
|
|
17675
18019
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
@@ -17678,7 +18022,7 @@ program.command("backup:now").description("Back up a compose stage now: runs its
|
|
|
17678
18022
|
exitWithError(error);
|
|
17679
18023
|
}
|
|
17680
18024
|
});
|
|
17681
|
-
program.command("backup:restore").description("Restore a compose stage's databases from a backup — after taking a fresh one").requiredOption("--stage <stage>", "Deployed stage").option("--at <time>", "A run (2026-10-10/02-00-00Z), or a time: the newest run at or before it").option("--latest", "The newest run").option("--from <file>", "A prepared data-only import in the stage's backups prefix (imports/app.sql.gz); needs --database").option("--database <name>", "One database, by its file name (auth-database); every one by default").option("--profile <profile>", "AWS profile for the stage's account").option("-y, --yes", "Restore without asking").action(async (options) => {
|
|
18025
|
+
program.command("backup:restore").description("Restore a compose stage's databases from a backup, or to a moment (--to) — after taking a fresh one").requiredOption("--stage <stage>", "Deployed stage").option("--at <time>", "A run (2026-10-10/02-00-00Z), or a time: the newest run at or before it").option("--latest", "The newest run").option("--from <file>", "A prepared data-only import in the stage's backups prefix (imports/app.sql.gz); needs --database").option("--database <name>", "One database, by its file name (auth-database); every one by default").option("--to <time>", "Point-in-time recovery: the whole cluster as it was at a moment (2026-11-16T09:41:00Z)").option("--into <name>", "With --to: copy each database beside the live one, as <name>_<database>, instead of replacing it").option("--profile <profile>", "AWS profile for the stage's account").option("-y, --yes", "Restore without asking").action(async (options) => {
|
|
17682
18026
|
try {
|
|
17683
18027
|
const globalOptions = program.opts();
|
|
17684
18028
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
@@ -17697,7 +18041,7 @@ program.command("upgrade").description("Upgrade @geekmidas/cli (with --all, ever
|
|
|
17697
18041
|
}
|
|
17698
18042
|
});
|
|
17699
18043
|
try {
|
|
17700
|
-
|
|
18044
|
+
require_stack.assertDevServicesFlag(process.argv.slice(2));
|
|
17701
18045
|
} catch (error) {
|
|
17702
18046
|
exitWithError(error);
|
|
17703
18047
|
}
|