@geekmidas/cli 10.0.0-alpha.165 → 10.0.0-alpha.166
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/{GoDaddyProvider-Dx6v4Goj.cjs → GoDaddyProvider-DClFHezd.cjs} +2 -2
- package/dist/{GoDaddyProvider-Dx6v4Goj.cjs.map → GoDaddyProvider-DClFHezd.cjs.map} +1 -1
- package/dist/{GoDaddyProvider-C7zClznh.mjs → GoDaddyProvider-mnY-cdD2.mjs} +2 -2
- package/dist/{GoDaddyProvider-C7zClznh.mjs.map → GoDaddyProvider-mnY-cdD2.mjs.map} +1 -1
- package/dist/{HostingerProvider-BALtMnss.mjs → HostingerProvider-39eSGyBa.mjs} +2 -2
- package/dist/{HostingerProvider-BALtMnss.mjs.map → HostingerProvider-39eSGyBa.mjs.map} +1 -1
- package/dist/{HostingerProvider-COuTy74z.cjs → HostingerProvider-BMyz2LnZ.cjs} +2 -2
- package/dist/{HostingerProvider-COuTy74z.cjs.map → HostingerProvider-BMyz2LnZ.cjs.map} +1 -1
- package/dist/{LegacyStateStore-CcNLLGX-.mjs → LegacyStateStore-B2TBaSMq.mjs} +2 -2
- package/dist/{LegacyStateStore-CcNLLGX-.mjs.map → LegacyStateStore-B2TBaSMq.mjs.map} +1 -1
- package/dist/{LegacyStateStore-C0rh3dKV.cjs → LegacyStateStore-BJY7ntQk.cjs} +2 -2
- package/dist/{LegacyStateStore-C0rh3dKV.cjs.map → LegacyStateStore-BJY7ntQk.cjs.map} +1 -1
- package/dist/{LocalStateStore-CxCCBQkS.mjs → LocalStateStore-8LFd-aMA.mjs} +2 -2
- package/dist/{LocalStateStore-CxCCBQkS.mjs.map → LocalStateStore-8LFd-aMA.mjs.map} +1 -1
- package/dist/{LocalStateStore-Dcq3wd1v.cjs → LocalStateStore-BvoEjPi5.cjs} +2 -2
- package/dist/{LocalStateStore-Dcq3wd1v.cjs.map → LocalStateStore-BvoEjPi5.cjs.map} +1 -1
- package/dist/{S3StateStore-DUwCcCgj.mjs → S3StateStore-DMzsqfSa.mjs} +4 -4
- package/dist/{S3StateStore-DUwCcCgj.mjs.map → S3StateStore-DMzsqfSa.mjs.map} +1 -1
- package/dist/{S3StateStore-Cgf1owUZ.cjs → S3StateStore-eeA5NXRa.cjs} +4 -4
- package/dist/{S3StateStore-Cgf1owUZ.cjs.map → S3StateStore-eeA5NXRa.cjs.map} +1 -1
- package/dist/{SSMStateStore-BarWA07O.cjs → SSMStateStore-BUv-du0T.cjs} +2 -2
- package/dist/{SSMStateStore-BarWA07O.cjs.map → SSMStateStore-BUv-du0T.cjs.map} +1 -1
- package/dist/{SSMStateStore-A_N_T4b0.mjs → SSMStateStore-CE2DTAtT.mjs} +2 -2
- package/dist/{SSMStateStore-A_N_T4b0.mjs.map → SSMStateStore-CE2DTAtT.mjs.map} +1 -1
- package/dist/{add-DAeCqI9O.mjs → add-BgCYGJpE.mjs} +6 -6
- package/dist/{add-DAeCqI9O.mjs.map → add-BgCYGJpE.mjs.map} +1 -1
- package/dist/{add-DVSNjsI8.cjs → add-Dp0KQNkQ.cjs} +7 -7
- package/dist/{add-DVSNjsI8.cjs.map → add-Dp0KQNkQ.cjs.map} +1 -1
- package/dist/{apps-Ck_Ie6gN.mjs → apps-CJTOIaz3.mjs} +4 -5
- package/dist/{apps-Ck_Ie6gN.mjs.map → apps-CJTOIaz3.mjs.map} +1 -1
- package/dist/{apps-S3RMvFyk.cjs → apps-DkMR-qvD.cjs} +22 -23
- package/dist/{apps-S3RMvFyk.cjs.map → apps-DkMR-qvD.cjs.map} +1 -1
- package/dist/{bundler-B_vQ_591.cjs → bundler-CA7KimJ0.cjs} +6 -6
- package/dist/{bundler-B_vQ_591.cjs.map → bundler-CA7KimJ0.cjs.map} +1 -1
- package/dist/{bundler-Bbn0opSb.mjs → bundler-Dt1ffXl6.mjs} +6 -6
- package/dist/{bundler-Bbn0opSb.mjs.map → bundler-Dt1ffXl6.mjs.map} +1 -1
- package/dist/{cli-CMykD9Py.mjs → cli-C-fdEb8N.mjs} +5 -5
- package/dist/{cli-CMykD9Py.mjs.map → cli-C-fdEb8N.mjs.map} +1 -1
- package/dist/{cli-fs4D-3cd.cjs → cli-CY1Cp8yN.cjs} +5 -5
- package/dist/{cli-fs4D-3cd.cjs.map → cli-CY1Cp8yN.cjs.map} +1 -1
- package/dist/{compose-CNJO99Tv.cjs → compose-BIm9yNH7.cjs} +6 -6
- package/dist/{compose-CNJO99Tv.cjs.map → compose-BIm9yNH7.cjs.map} +1 -1
- package/dist/{compose-Cm6EWvjX.mjs → compose-CZGeE6QJ.mjs} +6 -6
- package/dist/{compose-Cm6EWvjX.mjs.map → compose-CZGeE6QJ.mjs.map} +1 -1
- package/dist/{compose-DmcYTLhO.cjs → compose-SmuCWWUh.cjs} +8 -8
- package/dist/{compose-DmcYTLhO.cjs.map → compose-SmuCWWUh.cjs.map} +1 -1
- package/dist/{compose-BtjZNCC-.mjs → compose-tX6YTa1U.mjs} +8 -8
- package/dist/{compose-BtjZNCC-.mjs.map → compose-tX6YTa1U.mjs.map} +1 -1
- package/dist/config.cjs +457 -19
- package/dist/config.cjs.map +1 -0
- package/dist/config.mjs +440 -2
- package/dist/config.mjs.map +1 -0
- package/dist/{credentials-DVYgFK_H.cjs → credentials-CS3Dr-pv.cjs} +6 -6
- package/dist/{credentials-DVYgFK_H.cjs.map → credentials-CS3Dr-pv.cjs.map} +1 -1
- package/dist/{credentials-C-yuISKH.mjs → credentials-V3WgiKmZ.mjs} +6 -6
- package/dist/{credentials-C-yuISKH.mjs.map → credentials-V3WgiKmZ.mjs.map} +1 -1
- package/dist/deploy/public.cjs +12 -12
- package/dist/deploy/public.mjs +12 -12
- package/dist/{deploy-DGXMqTan.cjs → deploy--ia-CGMv.cjs} +25 -25
- package/dist/deploy--ia-CGMv.cjs.map +1 -0
- package/dist/{deploy-CuSF9y7t.mjs → deploy-BWFFSN5p.mjs} +16 -16
- package/dist/deploy-BWFFSN5p.mjs.map +1 -0
- package/dist/{destroy-BROvAzQQ.cjs → destroy-CrxF8Dlk.cjs} +10 -10
- package/dist/{destroy-BROvAzQQ.cjs.map → destroy-CrxF8Dlk.cjs.map} +1 -1
- package/dist/{destroy-DpRGLdt1.mjs → destroy-ZNiKL3--.mjs} +10 -10
- package/dist/{destroy-DpRGLdt1.mjs.map → destroy-ZNiKL3--.mjs.map} +1 -1
- package/dist/{docker-qq5xNUP2.cjs → docker-BtUjo-J_.cjs} +9 -8
- package/dist/{docker-qq5xNUP2.cjs.map → docker-BtUjo-J_.cjs.map} +1 -1
- package/dist/{docker-CRVWdGH9.mjs → docker-DhmU416x.mjs} +6 -5
- package/dist/{docker-CRVWdGH9.mjs.map → docker-DhmU416x.mjs.map} +1 -1
- package/dist/{dokploy-DcH7hY84.mjs → dokploy-BszAUbbA.mjs} +2 -2
- package/dist/{dokploy-DcH7hY84.mjs.map → dokploy-BszAUbbA.mjs.map} +1 -1
- package/dist/{dokploy-Duyj4-pa.cjs → dokploy-ComPiFLl.cjs} +2 -2
- package/dist/{dokploy-Duyj4-pa.cjs.map → dokploy-ComPiFLl.cjs.map} +1 -1
- package/dist/{eas-C11dyfIw.mjs → eas-DQudP2g2.mjs} +3 -3
- package/dist/{eas-C11dyfIw.mjs.map → eas-DQudP2g2.mjs.map} +1 -1
- package/dist/{eas-DqTDImhv.cjs → eas-zxVAWY6c.cjs} +6 -6
- package/dist/{eas-DqTDImhv.cjs.map → eas-zxVAWY6c.cjs.map} +1 -1
- package/dist/{encryption-DsZwqQyL.mjs → encryption-BCaweYBJ.mjs} +4 -4
- package/dist/{encryption-DsZwqQyL.mjs.map → encryption-BCaweYBJ.mjs.map} +1 -1
- package/dist/{encryption-CsOfA6QT.cjs → encryption-CU5O0Y61.cjs} +4 -4
- package/dist/{encryption-CsOfA6QT.cjs.map → encryption-CU5O0Y61.cjs.map} +1 -1
- package/dist/{engine-CdU3Oggs.mjs → engine-BzeCK6e8.mjs} +9 -10
- package/dist/{engine-CdU3Oggs.mjs.map → engine-BzeCK6e8.mjs.map} +1 -1
- package/dist/{engine-WllCnGNy.cjs → engine-xrlcbr1g.cjs} +10 -11
- package/dist/{engine-WllCnGNy.cjs.map → engine-xrlcbr1g.cjs.map} +1 -1
- package/dist/{github-Bt3V7pdf.mjs → github-CHClpJZS.mjs} +116 -72
- package/dist/github-CHClpJZS.mjs.map +1 -0
- package/dist/{github-B3lKrKIn.cjs → github-Jcrqfzg0.cjs} +116 -72
- package/dist/github-Jcrqfzg0.cjs.map +1 -0
- package/dist/{googlePlay-D-6pUHGU.mjs → googlePlay-Dk_pnif9.mjs} +5 -5
- package/dist/{googlePlay-D-6pUHGU.mjs.map → googlePlay-Dk_pnif9.mjs.map} +1 -1
- package/dist/{googlePlay-B7P3Ahps.cjs → googlePlay-e_tIBr4n.cjs} +5 -5
- package/dist/{googlePlay-B7P3Ahps.cjs.map → googlePlay-e_tIBr4n.cjs.map} +1 -1
- package/dist/{iam-BVPpX76R.cjs → iam-B6WLUf_x.cjs} +2 -2
- package/dist/{iam-BVPpX76R.cjs.map → iam-B6WLUf_x.cjs.map} +1 -1
- package/dist/{iam-q9ALh-Y5.mjs → iam-BKfO7u14.mjs} +2 -2
- package/dist/{iam-q9ALh-Y5.mjs.map → iam-BKfO7u14.mjs.map} +1 -1
- package/dist/index.cjs +70 -70
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +64 -64
- package/dist/index.mjs.map +1 -1
- package/dist/{local-B4H2Lsr6.mjs → local-DUi3f-WB.mjs} +2 -2
- package/dist/{local-B4H2Lsr6.mjs.map → local-DUi3f-WB.mjs.map} +1 -1
- package/dist/{local-Cs_aQJ45.cjs → local-Dc2h2Ex3.cjs} +2 -2
- package/dist/{local-Cs_aQJ45.cjs.map → local-Dc2h2Ex3.cjs.map} +1 -1
- package/dist/{migrate-BQSPfKHa.cjs → migrate-BU4eyd7z.cjs} +6 -6
- package/dist/{migrate-BQSPfKHa.cjs.map → migrate-BU4eyd7z.cjs.map} +1 -1
- package/dist/{migrate-CQ-PNghX.mjs → migrate-BxFCXc7M.mjs} +6 -6
- package/dist/{migrate-CQ-PNghX.mjs.map → migrate-BxFCXc7M.mjs.map} +1 -1
- package/dist/{migrate-CphnV0sY.cjs → migrate-CIjcBr96.cjs} +4 -4
- package/dist/{migrate-CphnV0sY.cjs.map → migrate-CIjcBr96.cjs.map} +1 -1
- package/dist/{migrate-C8JFuMT-.mjs → migrate-CbpeVxEW.mjs} +4 -4
- package/dist/{migrate-C8JFuMT-.mjs.map → migrate-CbpeVxEW.mjs.map} +1 -1
- package/dist/{notes-BtyuHcKA.cjs → notes-DJyFkK13.cjs} +7 -8
- package/dist/{notes-BtyuHcKA.cjs.map → notes-DJyFkK13.cjs.map} +1 -1
- package/dist/{notes-IlQ35E3R.mjs → notes-TDHMzdVt.mjs} +3 -4
- package/dist/{notes-IlQ35E3R.mjs.map → notes-TDHMzdVt.mjs.map} +1 -1
- package/dist/openapi.cjs +3 -3
- package/dist/openapi.cjs.map +1 -1
- package/dist/openapi.mjs +2 -2
- package/dist/{projectBucket-SHlF0_Pr.mjs → projectBucket-BPzx0b0t.mjs} +2 -2
- package/dist/{projectBucket-SHlF0_Pr.mjs.map → projectBucket-BPzx0b0t.mjs.map} +1 -1
- package/dist/{projectBucket-0Lvy2J0h.cjs → projectBucket-CoskwJC5.cjs} +2 -2
- package/dist/{projectBucket-0Lvy2J0h.cjs.map → projectBucket-CoskwJC5.cjs.map} +1 -1
- package/dist/{publish-igpjCzZj.cjs → publish-DB3-zkpm.cjs} +2 -2
- package/dist/{publish-igpjCzZj.cjs.map → publish-DB3-zkpm.cjs.map} +1 -1
- package/dist/{publish-C9IJb1Ez.mjs → publish-LZ1eb-MI.mjs} +2 -2
- package/dist/{publish-C9IJb1Ez.mjs.map → publish-LZ1eb-MI.mjs.map} +1 -1
- package/dist/{resolve-5T34quci.cjs → resolve-B5_tOTJG.cjs} +4 -4
- package/dist/{resolve-5T34quci.cjs.map → resolve-B5_tOTJG.cjs.map} +1 -1
- package/dist/{resolve-Cl8CVASM.mjs → resolve-jez3Y1S0.mjs} +4 -4
- package/dist/{resolve-Cl8CVASM.mjs.map → resolve-jez3Y1S0.mjs.map} +1 -1
- package/dist/{rollback-DMPb940C.cjs → rollback-BNo1bCLO.cjs} +7 -7
- package/dist/{rollback-DMPb940C.cjs.map → rollback-BNo1bCLO.cjs.map} +1 -1
- package/dist/{rollback-1JLE6qPo.mjs → rollback-BtOfxwo-.mjs} +7 -7
- package/dist/{rollback-1JLE6qPo.mjs.map → rollback-BtOfxwo-.mjs.map} +1 -1
- package/dist/{s3-CCuNLgHk.mjs → s3-Bf_75vVl.mjs} +3 -3
- package/dist/{s3-CCuNLgHk.mjs.map → s3-Bf_75vVl.mjs.map} +1 -1
- package/dist/{s3-DkiOi5J1.cjs → s3-BlPwyu1L.cjs} +3 -3
- package/dist/{s3-DkiOi5J1.cjs.map → s3-BlPwyu1L.cjs.map} +1 -1
- package/dist/{serverSetup-C0pLpF5w.mjs → serverSetup-D0Zor2i4.mjs} +7 -7
- package/dist/{serverSetup-C0pLpF5w.mjs.map → serverSetup-D0Zor2i4.mjs.map} +1 -1
- package/dist/{serverSetup-JYZxj371.cjs → serverSetup-D30vVD6t.cjs} +7 -7
- package/dist/{serverSetup-JYZxj371.cjs.map → serverSetup-D30vVD6t.cjs.map} +1 -1
- package/dist/{sniffer-DB4Ocija.cjs → sniffer-Bw00z3I8.cjs} +7 -7
- package/dist/{sniffer-DB4Ocija.cjs.map → sniffer-Bw00z3I8.cjs.map} +1 -1
- package/dist/{sniffer-CiV4xGbe.mjs → sniffer-DdPDiNmc.mjs} +7 -7
- package/dist/{sniffer-CiV4xGbe.mjs.map → sniffer-DdPDiNmc.mjs.map} +1 -1
- package/dist/{snsSubscriptions-C_-6fqBd.mjs → snsSubscriptions-DBxVTR6Y.mjs} +3 -3
- package/dist/{snsSubscriptions-C_-6fqBd.mjs.map → snsSubscriptions-DBxVTR6Y.mjs.map} +1 -1
- package/dist/{snsSubscriptions-DpYvMVR9.cjs → snsSubscriptions-g7apv_fy.cjs} +3 -3
- package/dist/{snsSubscriptions-DpYvMVR9.cjs.map → snsSubscriptions-g7apv_fy.cjs.map} +1 -1
- package/dist/{sst-D1oSl_1d.cjs → sst-CEs0bMxj.cjs} +6 -6
- package/dist/{sst-D1oSl_1d.cjs.map → sst-CEs0bMxj.cjs.map} +1 -1
- package/dist/{sst-BUzuE84X.mjs → sst-DJ22YDEq.mjs} +5 -5
- package/dist/{sst-BUzuE84X.mjs.map → sst-DJ22YDEq.mjs.map} +1 -1
- package/dist/{stack-TUs2DY7v.cjs → stack-BmG-lKgD.cjs} +12 -13
- package/dist/{stack-TUs2DY7v.cjs.map → stack-BmG-lKgD.cjs.map} +1 -1
- package/dist/{stack-DhBBTTIa.mjs → stack-Ds9jjpE1.mjs} +7 -8
- package/dist/{stack-DhBBTTIa.mjs.map → stack-Ds9jjpE1.mjs.map} +1 -1
- package/dist/{stage-DuLwZ9wu.mjs → stage-D9dfV1Ey.mjs} +7 -7
- package/dist/{stage-DuLwZ9wu.mjs.map → stage-D9dfV1Ey.mjs.map} +1 -1
- package/dist/{stage-B3qg7LoZ.cjs → stage-kGc9L3yB.cjs} +7 -7
- package/dist/{stage-B3qg7LoZ.cjs.map → stage-kGc9L3yB.cjs.map} +1 -1
- package/dist/{stages-CW7qtiJ2.mjs → stages-BL22BLJS.mjs} +3 -3
- package/dist/{stages-CW7qtiJ2.mjs.map → stages-BL22BLJS.mjs.map} +1 -1
- package/dist/{stages-CtqmEJJW.cjs → stages-CN53nNOK.cjs} +3 -3
- package/dist/{stages-CtqmEJJW.cjs.map → stages-CN53nNOK.cjs.map} +1 -1
- package/dist/target/public.cjs +1 -1
- package/dist/target/public.mjs +1 -1
- package/dist/{terminal-B_TanNPL.mjs → terminal-C0A7S7fB.mjs} +2 -2
- package/dist/{terminal-B_TanNPL.mjs.map → terminal-C0A7S7fB.mjs.map} +1 -1
- package/dist/{terminal-CXZWPHMW.cjs → terminal-DVlIWcUb.cjs} +2 -2
- package/dist/{terminal-CXZWPHMW.cjs.map → terminal-DVlIWcUb.cjs.map} +1 -1
- package/dist/types-DEmuMHsS.d.cts.map +1 -1
- package/dist/types-g_S0_RAi.d.mts.map +1 -1
- package/dist/workspace/index.cjs +1 -1
- package/dist/workspace/index.mjs +1 -1
- package/dist/{workspace-D5Vm2qcy.mjs → workspace-D4hzz6Xb.mjs} +331 -3
- package/dist/workspace-D4hzz6Xb.mjs.map +1 -0
- package/dist/{workspace-VhzmoxOv.cjs → workspace-DPSdiv-b.cjs} +371 -1
- package/dist/workspace-DPSdiv-b.cjs.map +1 -0
- package/package.json +15 -15
- package/dist/config-CXj-9eRo.cjs +0 -890
- package/dist/config-CXj-9eRo.cjs.map +0 -1
- package/dist/config-Di0oJwM9.mjs +0 -759
- package/dist/config-Di0oJwM9.mjs.map +0 -1
- package/dist/deploy-CuSF9y7t.mjs.map +0 -1
- package/dist/deploy-DGXMqTan.cjs.map +0 -1
- package/dist/github-B3lKrKIn.cjs.map +0 -1
- package/dist/github-Bt3V7pdf.mjs.map +0 -1
- package/dist/workspace-D5Vm2qcy.mjs.map +0 -1
- package/dist/workspace-VhzmoxOv.cjs.map +0 -1
|
@@ -5,7 +5,7 @@ import { n as isDeployTarget, o as builtinTarget, r as BUILTIN_TARGETS, s as con
|
|
|
5
5
|
import { basename, isAbsolute, join, resolve } from "node:path";
|
|
6
6
|
import { isIP } from "node:net";
|
|
7
7
|
import { randomInt } from "node:crypto";
|
|
8
|
-
import { kebabCase } from "@geekmidas/manifest";
|
|
8
|
+
import { WILDCARD_SUBDOMAIN, dependenciesOf, isWildcardSite, kebabCase } from "@geekmidas/manifest";
|
|
9
9
|
//#region src/compose/dnsConfig.ts
|
|
10
10
|
/**
|
|
11
11
|
* `dns['<root domain>'].records` — how a domain's hosts point at a compose
|
|
@@ -699,6 +699,323 @@ const S3_PROVISIONING = {
|
|
|
699
699
|
],
|
|
700
700
|
describe: "the stage's AWS account — AWS_PROFILE, or AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY (in CI, what aws-actions/configure-aws-credentials exports)"
|
|
701
701
|
};
|
|
702
|
+
//#endregion
|
|
703
|
+
//#region src/workspace/fileServerLabel.ts
|
|
704
|
+
/**
|
|
705
|
+
* The name a file server answers on.
|
|
706
|
+
*
|
|
707
|
+
* `new FileServer('Assets', …)` is two manifest nodes: the bucket, which keeps
|
|
708
|
+
* the id (`Assets`, `ASSETS_URL`), and the surface in front of it,
|
|
709
|
+
* `AssetsServer` (`ASSETS_SERVER_URL`). The suffix keeps the two nodes and
|
|
710
|
+
* their keys apart, and that is all it is for. A host is not a key, so it
|
|
711
|
+
* takes the name the construct was given: `assets.<domain>`, never
|
|
712
|
+
* `assets-server.<domain>`.
|
|
713
|
+
*
|
|
714
|
+
* Read off the surface's id rather than its `of`: with `{ origin }` the bucket
|
|
715
|
+
* is another construct's, and its id is not this file server's name.
|
|
716
|
+
*
|
|
717
|
+
* Every host a file server has — its CDN alias and certificate, its edge
|
|
718
|
+
* route, its local `*.localhost` address, its processors' origin and unit —
|
|
719
|
+
* is built from this one label, so no two of them can disagree.
|
|
720
|
+
*
|
|
721
|
+
* @example fileServerLabel('AssetsServer') // 'assets'
|
|
722
|
+
* @example fileServerLabel('UserUploadsServer') // 'user-uploads'
|
|
723
|
+
*/
|
|
724
|
+
function fileServerLabel(serverId) {
|
|
725
|
+
return kebabCase(serverId.replace(/Server$/, ""));
|
|
726
|
+
}
|
|
727
|
+
//#endregion
|
|
728
|
+
//#region src/workspace/subdomains.ts
|
|
729
|
+
/**
|
|
730
|
+
* The subdomains of a stage's domain, as a wildcard site sees them.
|
|
731
|
+
*
|
|
732
|
+
* A site declared `subdomain: '*'` answers on every label nothing else does,
|
|
733
|
+
* so the labels something else does answer on are the ones a tenant can never
|
|
734
|
+
* take. They come from two places and from nowhere else: every app's own
|
|
735
|
+
* label, read off the constructs and never listed by hand, and the names no
|
|
736
|
+
* construct declares (`www`, `mail`, `status`), listed once in the workspace
|
|
737
|
+
* config as `protectedSubdomains`.
|
|
738
|
+
*/
|
|
739
|
+
/** A `protectedSubdomains` entry an app already answers on. */
|
|
740
|
+
var ProtectedSubdomainIsAnApp = class extends GkmError {
|
|
741
|
+
subdomain;
|
|
742
|
+
app;
|
|
743
|
+
constructor(subdomain, app) {
|
|
744
|
+
super(`protectedSubdomains lists '${subdomain}', which '${app}' already answers on — a construct's own subdomain is protected without being listed. Remove it from protectedSubdomains.`);
|
|
745
|
+
this.subdomain = subdomain;
|
|
746
|
+
this.app = app;
|
|
747
|
+
this.name = "ProtectedSubdomainIsAnApp";
|
|
748
|
+
}
|
|
749
|
+
};
|
|
750
|
+
/** Two sites that both answer on every subdomain. */
|
|
751
|
+
var SecondWildcardSite = class extends GkmError {
|
|
752
|
+
sites;
|
|
753
|
+
constructor(sites) {
|
|
754
|
+
super(`${sites.join(" and ")} both declare subdomain: '*', and two sites cannot share the same hosts. Keep one wildcard site per project; give the other a subdomain of its own.`);
|
|
755
|
+
this.sites = sites;
|
|
756
|
+
this.name = "SecondWildcardSite";
|
|
757
|
+
}
|
|
758
|
+
};
|
|
759
|
+
/** A wildcard site whose `hosts` route is on no surface the project declares. */
|
|
760
|
+
var SiteHostsEndpointMissing = class extends GkmError {
|
|
761
|
+
site;
|
|
762
|
+
surface;
|
|
763
|
+
path;
|
|
764
|
+
constructor(site, surface, path) {
|
|
765
|
+
super(`'${site}' checks its hosts with GET ${path} on '${surface}', but '${surface}' serves no such route. Export the endpoint from the surface's endpoints, or point \`hosts\` at one it serves.`);
|
|
766
|
+
this.site = site;
|
|
767
|
+
this.surface = surface;
|
|
768
|
+
this.path = path;
|
|
769
|
+
this.name = "SiteHostsEndpointMissing";
|
|
770
|
+
}
|
|
771
|
+
};
|
|
772
|
+
/**
|
|
773
|
+
* A file server whose host another construct already answers on.
|
|
774
|
+
*
|
|
775
|
+
* A file server answers on its own name — `FileServer('Assets')` on
|
|
776
|
+
* `assets.<domain>` — so an app named `Assets` beside it would claim the same
|
|
777
|
+
* host, and whichever deployed second would take it from the first.
|
|
778
|
+
*/
|
|
779
|
+
var FileServerHostTaken = class extends GkmError {
|
|
780
|
+
fileServer;
|
|
781
|
+
subdomain;
|
|
782
|
+
app;
|
|
783
|
+
constructor(fileServer, subdomain, app) {
|
|
784
|
+
super(`'${fileServer}' answers on '${subdomain}', which '${app}' answers on too, and two constructs cannot share a host. Rename one of them, or give '${app}' a subdomain of its own.`);
|
|
785
|
+
this.fileServer = fileServer;
|
|
786
|
+
this.subdomain = subdomain;
|
|
787
|
+
this.app = app;
|
|
788
|
+
this.name = "FileServerHostTaken";
|
|
789
|
+
}
|
|
790
|
+
};
|
|
791
|
+
/** The project's one wildcard site, or `undefined` when it has none. */
|
|
792
|
+
function wildcardSite(manifest) {
|
|
793
|
+
return Object.values(manifest).find(isWildcardSite);
|
|
794
|
+
}
|
|
795
|
+
/**
|
|
796
|
+
* Every label an app answers on, by the app it belongs to — what a deploy
|
|
797
|
+
* puts under the stage's domain: a surface's or site's `subdomain` (or its id
|
|
798
|
+
* kebab-cased), each file server and its processors' origin, and each worker,
|
|
799
|
+
* which SNS may push to on a host of its own.
|
|
800
|
+
*
|
|
801
|
+
* The root site's is kept although it answers on the domain itself: which
|
|
802
|
+
* site is the root can change without a tenant's slug changing meaning. The
|
|
803
|
+
* wildcard site has none — its labels are whatever is left.
|
|
804
|
+
*/
|
|
805
|
+
function appSubdomains(manifest) {
|
|
806
|
+
return new Map(claimedLabels(manifest));
|
|
807
|
+
}
|
|
808
|
+
/** Each label a construct answers on, with that construct's id, in manifest order. */
|
|
809
|
+
function* claimedLabels(manifest) {
|
|
810
|
+
for (const [id, declaration] of Object.entries(manifest)) switch (declaration.kind) {
|
|
811
|
+
case "rest-api":
|
|
812
|
+
case "websocket-api":
|
|
813
|
+
yield [declaration.subdomain ?? kebabCase(id), id];
|
|
814
|
+
break;
|
|
815
|
+
case "site":
|
|
816
|
+
if (declaration.subdomain === WILDCARD_SUBDOMAIN) break;
|
|
817
|
+
yield [declaration.subdomain ?? kebabCase(id), id];
|
|
818
|
+
break;
|
|
819
|
+
case "file-server":
|
|
820
|
+
yield [fileServerLabel(id), id];
|
|
821
|
+
if (declaration.processors?.length) yield [`${fileServerLabel(id)}-processors`, id];
|
|
822
|
+
break;
|
|
823
|
+
case "worker": yield [kebabCase(id), id];
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
/**
|
|
827
|
+
* The labels no tenant may take: every app's own and the workspace's
|
|
828
|
+
* `protectedSubdomains`, sorted.
|
|
829
|
+
*/
|
|
830
|
+
function protectedSubdomains(manifest, configured = []) {
|
|
831
|
+
return [.../* @__PURE__ */ new Set([...appSubdomains(manifest).keys(), ...configured])].sort();
|
|
832
|
+
}
|
|
833
|
+
/**
|
|
834
|
+
* What a project's subdomains have to satisfy before anything is derived
|
|
835
|
+
* from them.
|
|
836
|
+
*
|
|
837
|
+
* @throws {SecondWildcardSite} when two sites declare `subdomain: '*'`
|
|
838
|
+
* @throws {SiteHostsEndpointMissing} when the wildcard site's `hosts` route is not served
|
|
839
|
+
* @throws {ProtectedSubdomainIsAnApp} when `protectedSubdomains` repeats an app's own
|
|
840
|
+
* @throws {FileServerHostTaken} when a file server's host is another construct's
|
|
841
|
+
*/
|
|
842
|
+
function assertSubdomains(manifest, configured = []) {
|
|
843
|
+
const wildcards = Object.values(manifest).filter(isWildcardSite);
|
|
844
|
+
if (wildcards.length > 1) throw new SecondWildcardSite(wildcards.map((site) => site.id).sort());
|
|
845
|
+
const site = wildcards[0];
|
|
846
|
+
if (site?.hosts) {
|
|
847
|
+
const surface = manifest[site.hosts.surface];
|
|
848
|
+
if (!(surface?.kind === "rest-api" && surface.endpoints.some((endpoint) => endpoint.method.toUpperCase() === "GET" && endpoint.path === site.hosts?.path))) throw new SiteHostsEndpointMissing(site.id, site.hosts.surface, site.hosts.path);
|
|
849
|
+
}
|
|
850
|
+
assertFileServerHosts(manifest);
|
|
851
|
+
const labels = appSubdomains(manifest);
|
|
852
|
+
for (const subdomain of configured) {
|
|
853
|
+
const app = labels.get(subdomain);
|
|
854
|
+
if (app) throw new ProtectedSubdomainIsAnApp(subdomain, app);
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
/**
|
|
858
|
+
* Every host a file server answers on — its own and its processors' origin —
|
|
859
|
+
* is no other construct's. {@link appSubdomains} keeps one owner per label,
|
|
860
|
+
* so the clash it would hide is found here, before either is deployed.
|
|
861
|
+
*/
|
|
862
|
+
function assertFileServerHosts(manifest) {
|
|
863
|
+
const owners = /* @__PURE__ */ new Map();
|
|
864
|
+
for (const [label, id] of claimedLabels(manifest)) {
|
|
865
|
+
const other = owners.get(label);
|
|
866
|
+
owners.set(label, id);
|
|
867
|
+
if (other === void 0 || other === id) continue;
|
|
868
|
+
if (manifest[id]?.kind === "file-server") throw new FileServerHostTaken(id, label, other);
|
|
869
|
+
if (manifest[other]?.kind === "file-server") throw new FileServerHostTaken(other, label, id);
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
//#endregion
|
|
873
|
+
//#region src/workspace/derive.ts
|
|
874
|
+
/**
|
|
875
|
+
* The apps a manifest implies.
|
|
876
|
+
*
|
|
877
|
+
* `gkm.config.ts` used to carry an `apps` block naming every app: its type, its
|
|
878
|
+
* path, its port, its framework, which other apps it depended on. Every one of
|
|
879
|
+
* those facts was already declared. A `StaticSite('Web', { path: 'apps/web' })`
|
|
880
|
+
* and an `apps.web = { type: 'web', path: 'apps/web', framework: 'vite',
|
|
881
|
+
* dependencies: ['api'] }` are the same statement written twice, and only one of
|
|
882
|
+
* them was checked against anything — so the copy in config was free to drift,
|
|
883
|
+
* and a surface config had no entry for simply never deployed.
|
|
884
|
+
*
|
|
885
|
+
* So the list comes from the graph. A `site` is an app, and so is every
|
|
886
|
+
* `rest-api` — one surface, one container, at the `path` it declared.
|
|
887
|
+
*
|
|
888
|
+
* What config still supplies is what no graph can answer: the backends a cache
|
|
889
|
+
* and a mailer resolve to, the deploy endpoint, the stage's domain.
|
|
890
|
+
*/
|
|
891
|
+
/** Which frontend framework builds each site variant. */
|
|
892
|
+
const FRAMEWORKS = {
|
|
893
|
+
static: "vite",
|
|
894
|
+
next: "nextjs",
|
|
895
|
+
tanstack: "tanstack-start"
|
|
896
|
+
};
|
|
897
|
+
/**
|
|
898
|
+
* The app key a construct id becomes.
|
|
899
|
+
*
|
|
900
|
+
* The same kebab form every physical name is built from, so `Api` is `api` in
|
|
901
|
+
* the config, `production-kitchen-sink-api` on Dokploy, and `API_URL` in an
|
|
902
|
+
* environment — one id, three renderings, no second list.
|
|
903
|
+
*/
|
|
904
|
+
function appKey(id) {
|
|
905
|
+
return kebabCase(id);
|
|
906
|
+
}
|
|
907
|
+
/**
|
|
908
|
+
* The app serving a surface: its own, always.
|
|
909
|
+
*
|
|
910
|
+
* Every surface gets a container. There is no arrangement in which one runs
|
|
911
|
+
* inside another — two surfaces in a process share a filesystem, an
|
|
912
|
+
* environment, and every credential either was granted, so an auth server
|
|
913
|
+
* beside an API is one bug in the API away from being read by it.
|
|
914
|
+
*/
|
|
915
|
+
function hostOf(manifest, id) {
|
|
916
|
+
const declaration = manifest[id];
|
|
917
|
+
if (!declaration || declaration.kind !== "rest-api" && declaration.kind !== "websocket-api") return void 0;
|
|
918
|
+
return id;
|
|
919
|
+
}
|
|
920
|
+
/**
|
|
921
|
+
* Local ports, assigned so that adding a site does not renumber the others.
|
|
922
|
+
*
|
|
923
|
+
* Backends first, then the site holding the base domain, then the rest
|
|
924
|
+
* alphabetically. The ordering is arbitrary but it is *fixed*, which is the
|
|
925
|
+
* property that matters: a port that moves when an unrelated app is added is a
|
|
926
|
+
* port nobody can put in a bookmark. A construct that names its own port keeps
|
|
927
|
+
* it, and is skipped here.
|
|
928
|
+
*/
|
|
929
|
+
function assignPorts(apps) {
|
|
930
|
+
const rank = (name, app) => [
|
|
931
|
+
app.type === "backend" ? 0 : app.type === "web" ? 1 : 2,
|
|
932
|
+
app.root ? 0 : 1,
|
|
933
|
+
name
|
|
934
|
+
];
|
|
935
|
+
const ordered = Object.entries(apps).sort(([aName, a], [bName, b]) => {
|
|
936
|
+
const [at, ar, an] = rank(aName, a);
|
|
937
|
+
const [bt, br, bn] = rank(bName, b);
|
|
938
|
+
return at - bt || ar - br || an.localeCompare(bn);
|
|
939
|
+
});
|
|
940
|
+
const taken = new Set(ordered.map(([, app]) => app.port).filter((p) => !!p));
|
|
941
|
+
let next = 3e3;
|
|
942
|
+
for (const [, app] of ordered) {
|
|
943
|
+
if (app.port) continue;
|
|
944
|
+
while (taken.has(next)) next += 1;
|
|
945
|
+
app.port = next;
|
|
946
|
+
taken.add(next);
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
/**
|
|
950
|
+
* Whichever site holds the base domain.
|
|
951
|
+
*
|
|
952
|
+
* The convention first — a site named `web` — because it is one people already
|
|
953
|
+
* rely on. Then an explicit `root: true`. A project with one site needs neither.
|
|
954
|
+
*/
|
|
955
|
+
function markRoot(apps) {
|
|
956
|
+
const sites = Object.entries(apps).filter(([, a]) => a.type === "web" && a.subdomain !== WILDCARD_SUBDOMAIN);
|
|
957
|
+
if (sites.length === 0) return;
|
|
958
|
+
if (sites.some(([, a]) => a.root)) return;
|
|
959
|
+
const chosen = sites.find(([name]) => name === "web") ?? (sites.length === 1 ? sites[0] : void 0);
|
|
960
|
+
if (chosen) chosen[1].root = true;
|
|
961
|
+
}
|
|
962
|
+
function derivedApps(manifest, workspace) {
|
|
963
|
+
assertSubdomains(manifest, workspace.protectedSubdomains);
|
|
964
|
+
const apps = {};
|
|
965
|
+
const defaultTarget = workspace.deploy?.default ?? "dokploy";
|
|
966
|
+
for (const [id, declaration] of Object.entries(manifest)) {
|
|
967
|
+
if (declaration.kind !== "site" && declaration.kind !== "mobile-app" && declaration.kind !== "rest-api" && declaration.kind !== "websocket-api") continue;
|
|
968
|
+
const spec = declaration.kind === "site" || declaration.kind === "mobile-app" ? declaration.app : {
|
|
969
|
+
path: declaration.path,
|
|
970
|
+
...declaration.kind === "rest-api" && declaration.telescope ? { telescope: true } : {}
|
|
971
|
+
};
|
|
972
|
+
const name = appKey(id);
|
|
973
|
+
const configured = workspace.apps[name];
|
|
974
|
+
apps[name] = {
|
|
975
|
+
...configured,
|
|
976
|
+
type: declaration.kind === "site" ? "web" : declaration.kind === "mobile-app" ? "mobile" : "backend",
|
|
977
|
+
path: spec.path,
|
|
978
|
+
port: spec.port ?? configured?.port ?? 0,
|
|
979
|
+
...(declaration.kind === "rest-api" || declaration.kind === "websocket-api" || declaration.kind === "site") && declaration.subdomain ? { subdomain: declaration.subdomain } : {},
|
|
980
|
+
dependencies: [],
|
|
981
|
+
resolvedDeployTarget: configured?.resolvedDeployTarget ?? defaultTarget,
|
|
982
|
+
...declaration.kind === "site" ? {
|
|
983
|
+
framework: configured?.framework ?? FRAMEWORKS[declaration.variant],
|
|
984
|
+
...declaration.root ? { root: true } : {},
|
|
985
|
+
...spec.config ? { config: spec.config } : {}
|
|
986
|
+
} : {},
|
|
987
|
+
...declaration.kind === "mobile-app" ? {
|
|
988
|
+
framework: configured?.framework ?? declaration.variant,
|
|
989
|
+
...spec.config ? { config: spec.config } : {}
|
|
990
|
+
} : {},
|
|
991
|
+
...spec.telescope !== void 0 ? { telescope: spec.telescope } : {},
|
|
992
|
+
...spec.openapi !== void 0 ? { openapi: spec.openapi } : {},
|
|
993
|
+
...spec.runtime !== void 0 ? { runtime: spec.runtime } : {},
|
|
994
|
+
...spec.env !== void 0 ? { env: spec.env } : {},
|
|
995
|
+
...spec.entry !== void 0 ? { entry: spec.entry } : {},
|
|
996
|
+
...configured?.domain ? { domain: configured.domain } : {}
|
|
997
|
+
};
|
|
998
|
+
}
|
|
999
|
+
for (const [id, declaration] of Object.entries(manifest)) {
|
|
1000
|
+
if (declaration.kind !== "site" && declaration.kind !== "mobile-app" && declaration.kind !== "rest-api" && declaration.kind !== "websocket-api") continue;
|
|
1001
|
+
const app = apps[appKey(id)];
|
|
1002
|
+
if (!app) continue;
|
|
1003
|
+
const edges = dependenciesOf(declaration);
|
|
1004
|
+
const names = /* @__PURE__ */ new Set();
|
|
1005
|
+
for (const edge of edges) {
|
|
1006
|
+
if (edge.kind !== "rest-api") continue;
|
|
1007
|
+
const host = hostOf(manifest, edge.target);
|
|
1008
|
+
if (!host) continue;
|
|
1009
|
+
const key = appKey(host);
|
|
1010
|
+
if (key !== appKey(id) && apps[key]) names.add(key);
|
|
1011
|
+
}
|
|
1012
|
+
app.dependencies = [...names].sort();
|
|
1013
|
+
}
|
|
1014
|
+
markRoot(apps);
|
|
1015
|
+
assignPorts(apps);
|
|
1016
|
+
for (const [name, app] of Object.entries(workspace.apps)) if (!apps[name]) apps[name] = app;
|
|
1017
|
+
return apps;
|
|
1018
|
+
}
|
|
702
1019
|
const SUFFIX_ALPHABET = "abcdefghijklmnopqrstuvwxyz0123456789";
|
|
703
1020
|
/** A name that S3 would refuse — what the name builder never returns. */
|
|
704
1021
|
var InvalidBucketName = class extends GkmError {
|
|
@@ -886,6 +1203,17 @@ function emailUserName(scope, stage, id) {
|
|
|
886
1203
|
id
|
|
887
1204
|
});
|
|
888
1205
|
}
|
|
1206
|
+
/**
|
|
1207
|
+
* What an inbox's bucket and its IAM user are named for, after the stage:
|
|
1208
|
+
* `requests-mail`.
|
|
1209
|
+
*/
|
|
1210
|
+
function inboxBucketId(inbox) {
|
|
1211
|
+
return `${appKey(inbox)}-mail`;
|
|
1212
|
+
}
|
|
1213
|
+
/** The SNS topic SES announces an inbox's mail on. */
|
|
1214
|
+
function inboxTopicName(scope, stage, inbox) {
|
|
1215
|
+
return `gkm-${scope}-${stage}-${inboxBucketId(inbox)}`.replace(/[^A-Za-z0-9_-]/g, "-").slice(0, 256);
|
|
1216
|
+
}
|
|
889
1217
|
/** The stage's AWS account, as every AWS provider asks for it. */
|
|
890
1218
|
const SES_PROVISIONING = S3_PROVISIONING;
|
|
891
1219
|
//#endregion
|
|
@@ -2631,6 +2959,6 @@ function getEndpointForStage(dokployConfig, stage) {
|
|
|
2631
2959
|
return dokployConfig.endpoint;
|
|
2632
2960
|
}
|
|
2633
2961
|
//#endregion
|
|
2634
|
-
export {
|
|
2962
|
+
export { SesReceivingUnsupported as $, InvalidStages as A, s3SecretsKey as At, LOGS_PORT as B, WorkspaceConfigSchema as C, RotationInProgress as Ct, isPhase2DeployTarget as D, proxyFor as Dt, isDeployTargetSupported as E, certificateFor as Et, stageProblems as F, cnameTarget as Ft, checkSesConfig as G, provisioningOf as H, otlpTelemetryEnv as I, isReservedStageKey as It, inboxBucketId as J, checkSesEmailConfig as K, resolveStageTelemetry as L, UndeclaredStage as M, checkStageBackups as Mt, assertDeployedStage as N, SERVER_IPV4_KEY as Nt, safeValidateWorkspaceConfig as O, SECRETS_STORE_PROVIDERS as Ot, deployedProblems as P, SERVER_IPV6_KEY as Pt, InboxNotProvisioned as Q, stageSampleRate as R, SUPPORTED_DEPLOY_TARGETS as S, RecordedBucketUnreachable as St, getDeployTargetError as T, ComposeTlsFileMissing as Tt, stageProvider as U, UnknownStageProvider as V, SES_PROVISIONING as W, EmailNotProvisioned as X, inboxTopicName as Y, EmailSenderUnknown as Z, PUBLIC_ENV_PREFIXES as _, BucketProbeFailed as _t, allConstructGlobs as a, suffixedBucketName as at, isWorkspaceConfig as b, IamUserNotOwned as bt, constructPatterns as c, protectedSubdomains as ct, getAppGkmConfig as d, S3_PROVISIONING as dt, IAM_POLICY_NAME as et, getEndpointForStage as f, checkS3Config as ft, wrapSingleAppAsWorkspace as g, BucketOwnedByAnotherProject as gt, workspaceConstructGlobs as h, BucketNameUnavailable as ht, InvalidWorkspaceConfig as i, randomSuffix as it, TEST_STAGE as j, s3SecretsLocation as jt, validateWorkspaceConfig as k, UnknownSecretsStoreProvider as kt, defineWorkspace as l, wildcardSite as lt, processConfig as m, BucketKeySetElsewhere as mt, DokployRegistryMoved as n, bucketName as nt, appConstructGlobs as o, appKey as ot, normalizeWorkspace as p, AccessKeyLimit as pt, emailUserName as q, DomainsMoved as r, iamUserName as rt, assertNoMovedDeployKeys as s, derivedApps as st, DnsMoved as t, IAM_USER_PATH as tt, getAppBuildOrder as u, fileServerLabel as ut, getPublicEnvPrefix as v, BucketRegionMismatch as vt, formatValidationErrors as w, S3RegionRequired as wt, PHASE_2_DEPLOY_TARGETS as x, ProvisionedBucketUnreachable as xt, stripPublicPrefix as y, BucketRegionUnknown as yt, telemetryEnv as z };
|
|
2635
2963
|
|
|
2636
|
-
//# sourceMappingURL=workspace-
|
|
2964
|
+
//# sourceMappingURL=workspace-D4hzz6Xb.mjs.map
|