@geekmidas/cli 10.0.0-alpha.133 → 10.0.0-alpha.135
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-B5Pit0k8.mjs → GoDaddyProvider-DPiJ5exO.mjs} +2 -2
- package/dist/{GoDaddyProvider-B5Pit0k8.mjs.map → GoDaddyProvider-DPiJ5exO.mjs.map} +1 -1
- package/dist/{GoDaddyProvider-CEsQbLoN.cjs → GoDaddyProvider-DZWg8Ssf.cjs} +2 -2
- package/dist/{GoDaddyProvider-CEsQbLoN.cjs.map → GoDaddyProvider-DZWg8Ssf.cjs.map} +1 -1
- package/dist/{LegacyStateStore-CguGNakY.cjs → LegacyStateStore-B9bnnATg.cjs} +3 -3
- package/dist/{LegacyStateStore-CguGNakY.cjs.map → LegacyStateStore-B9bnnATg.cjs.map} +1 -1
- package/dist/{LegacyStateStore-XUVfRMe_.mjs → LegacyStateStore-D4h5bkrb.mjs} +3 -3
- package/dist/{LegacyStateStore-XUVfRMe_.mjs.map → LegacyStateStore-D4h5bkrb.mjs.map} +1 -1
- package/dist/{LocalStateStore-DXC66Bl4.mjs → LocalStateStore-BtUPqLVd.mjs} +2 -2
- package/dist/{LocalStateStore-DXC66Bl4.mjs.map → LocalStateStore-BtUPqLVd.mjs.map} +1 -1
- package/dist/{LocalStateStore-BW7Gsr0R.cjs → LocalStateStore-DolIqU2y.cjs} +2 -2
- package/dist/{LocalStateStore-BW7Gsr0R.cjs.map → LocalStateStore-DolIqU2y.cjs.map} +1 -1
- package/dist/{S3StateStore-CBHyDZUA.mjs → S3StateStore-CDT_DkGE.mjs} +2 -2
- package/dist/{S3StateStore-CBHyDZUA.mjs.map → S3StateStore-CDT_DkGE.mjs.map} +1 -1
- package/dist/{S3StateStore-SeuomJRE.cjs → S3StateStore-CK8U4ICM.cjs} +2 -2
- package/dist/{S3StateStore-SeuomJRE.cjs.map → S3StateStore-CK8U4ICM.cjs.map} +1 -1
- package/dist/{SSMStateStore-BvTkVctp.mjs → SSMStateStore-BtPIF4Qk.mjs} +2 -2
- package/dist/{SSMStateStore-BvTkVctp.mjs.map → SSMStateStore-BtPIF4Qk.mjs.map} +1 -1
- package/dist/{SSMStateStore-CavfdmlG.cjs → SSMStateStore-DmZawuR5.cjs} +2 -2
- package/dist/{SSMStateStore-CavfdmlG.cjs.map → SSMStateStore-DmZawuR5.cjs.map} +1 -1
- package/dist/{add-DjFSA-cv.mjs → add-9t0pfwcy.mjs} +3 -3
- package/dist/{add-DjFSA-cv.mjs.map → add-9t0pfwcy.mjs.map} +1 -1
- package/dist/{add-CGiYionu.cjs → add-fXw-yJvm.cjs} +3 -3
- package/dist/{add-CGiYionu.cjs.map → add-fXw-yJvm.cjs.map} +1 -1
- package/dist/{bundler-PRvc9NCy.cjs → bundler-Bj4FgDuH.cjs} +5 -5
- package/dist/{bundler-PRvc9NCy.cjs.map → bundler-Bj4FgDuH.cjs.map} +1 -1
- package/dist/{bundler-t_4bJQOQ.mjs → bundler-DP84yfVd.mjs} +5 -5
- package/dist/{bundler-t_4bJQOQ.mjs.map → bundler-DP84yfVd.mjs.map} +1 -1
- package/dist/{cli-CYZW_byf.cjs → cli-D47RSzQn.cjs} +2 -2
- package/dist/{cli-CYZW_byf.cjs.map → cli-D47RSzQn.cjs.map} +1 -1
- package/dist/{cli-C7fpTTLI.mjs → cli-Mmy5wBuy.mjs} +2 -2
- package/dist/{cli-C7fpTTLI.mjs.map → cli-Mmy5wBuy.mjs.map} +1 -1
- package/dist/{compose-DetcV6XH.mjs → compose-CEikJR9c.mjs} +3 -3
- package/dist/{compose-DetcV6XH.mjs.map → compose-CEikJR9c.mjs.map} +1 -1
- package/dist/{compose-4fFOfKrH.cjs → compose-ht0TCG2X.cjs} +3 -3
- package/dist/{compose-4fFOfKrH.cjs.map → compose-ht0TCG2X.cjs.map} +1 -1
- package/dist/deploy/public.cjs +6 -6
- package/dist/deploy/public.mjs +6 -6
- package/dist/{deploy-dJfFZ4xl.mjs → deploy-C0TpTD1d.mjs} +5 -5
- package/dist/{deploy-dJfFZ4xl.mjs.map → deploy-C0TpTD1d.mjs.map} +1 -1
- package/dist/{deploy-DW0fl1KY.cjs → deploy-CdL9_-qw.cjs} +5 -5
- package/dist/{deploy-DW0fl1KY.cjs.map → deploy-CdL9_-qw.cjs.map} +1 -1
- package/dist/{dokploy-kLg9Medy.cjs → dokploy-BueAJuoo.cjs} +2 -2
- package/dist/{dokploy-kLg9Medy.cjs.map → dokploy-BueAJuoo.cjs.map} +1 -1
- package/dist/{dokploy-DmX7_22M.mjs → dokploy-DpvTEQV9.mjs} +2 -2
- package/dist/{dokploy-DmX7_22M.mjs.map → dokploy-DpvTEQV9.mjs.map} +1 -1
- package/dist/{eas-BTSyOfxc.cjs → eas-BPDzq2YJ.cjs} +2 -2
- package/dist/{eas-BTSyOfxc.cjs.map → eas-BPDzq2YJ.cjs.map} +1 -1
- package/dist/{eas-CkQltn55.mjs → eas-J_D0eeql.mjs} +2 -2
- package/dist/{eas-CkQltn55.mjs.map → eas-J_D0eeql.mjs.map} +1 -1
- package/dist/{encryption-CsynkPVT.mjs → encryption-D-02Ns4D.mjs} +2 -2
- package/dist/{encryption-CsynkPVT.mjs.map → encryption-D-02Ns4D.mjs.map} +1 -1
- package/dist/{encryption-B4pXK-Pf.cjs → encryption-DkVOPJHl.cjs} +2 -2
- package/dist/{encryption-B4pXK-Pf.cjs.map → encryption-DkVOPJHl.cjs.map} +1 -1
- package/dist/{engine-DJclYo_x.mjs → engine-CEg989YU.mjs} +3 -3
- package/dist/{engine-DJclYo_x.mjs.map → engine-CEg989YU.mjs.map} +1 -1
- package/dist/{engine-DL8YQxIK.cjs → engine-hYFSWxve.cjs} +3 -3
- package/dist/{engine-DL8YQxIK.cjs.map → engine-hYFSWxve.cjs.map} +1 -1
- package/dist/{github-BFeiv8qP.cjs → github-Btdbg8z3.cjs} +4 -4
- package/dist/{github-BFeiv8qP.cjs.map → github-Btdbg8z3.cjs.map} +1 -1
- package/dist/{github-B07hqQwd.mjs → github-MwKWG3rQ.mjs} +4 -4
- package/dist/{github-B07hqQwd.mjs.map → github-MwKWG3rQ.mjs.map} +1 -1
- package/dist/{googlePlay-BKbRmLry.mjs → googlePlay-BJPkSlE7.mjs} +3 -3
- package/dist/{googlePlay-BKbRmLry.mjs.map → googlePlay-BJPkSlE7.mjs.map} +1 -1
- package/dist/{googlePlay-DrbA4UZU.cjs → googlePlay-Bq3krrnh.cjs} +3 -3
- package/dist/{googlePlay-DrbA4UZU.cjs.map → googlePlay-Bq3krrnh.cjs.map} +1 -1
- package/dist/index.cjs +82 -54
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +83 -55
- package/dist/index.mjs.map +1 -1
- package/dist/{migrate-Dosw3KY0.cjs → migrate-Bz8Y9FuF.cjs} +2 -2
- package/dist/{migrate-Dosw3KY0.cjs.map → migrate-Bz8Y9FuF.cjs.map} +1 -1
- package/dist/{migrate--XDHu7qQ.mjs → migrate-CXOGn5NC.mjs} +2 -2
- package/dist/{migrate--XDHu7qQ.mjs.map → migrate-CXOGn5NC.mjs.map} +1 -1
- package/dist/{migrate-DsT5L41h.mjs → migrate-SmLqnkna.mjs} +2 -2
- package/dist/{migrate-DsT5L41h.mjs.map → migrate-SmLqnkna.mjs.map} +1 -1
- package/dist/{migrate-CCw5tnVH.cjs → migrate-ZP_zGDPZ.cjs} +2 -2
- package/dist/{migrate-CCw5tnVH.cjs.map → migrate-ZP_zGDPZ.cjs.map} +1 -1
- package/dist/{publish-rGbAgtxn.mjs → publish-BGPtiswJ.mjs} +2 -2
- package/dist/{publish-rGbAgtxn.mjs.map → publish-BGPtiswJ.mjs.map} +1 -1
- package/dist/{publish-CidTIHNJ.cjs → publish-CuvbP2bc.cjs} +2 -2
- package/dist/{publish-CidTIHNJ.cjs.map → publish-CuvbP2bc.cjs.map} +1 -1
- package/dist/{resolve-P9mHFEyT.cjs → resolve-BQ_oAZSX.cjs} +3 -3
- package/dist/{resolve-P9mHFEyT.cjs.map → resolve-BQ_oAZSX.cjs.map} +1 -1
- package/dist/{resolve-xqsaUVAR.mjs → resolve-hyZMb2z7.mjs} +3 -3
- package/dist/{resolve-xqsaUVAR.mjs.map → resolve-hyZMb2z7.mjs.map} +1 -1
- package/dist/{rollback-CQDKXqYI.cjs → rollback-BQufMCac.cjs} +4 -4
- package/dist/{rollback-CQDKXqYI.cjs.map → rollback-BQufMCac.cjs.map} +1 -1
- package/dist/{rollback-DgLvh9q2.mjs → rollback-ODQR4lLz.mjs} +4 -4
- package/dist/{rollback-DgLvh9q2.mjs.map → rollback-ODQR4lLz.mjs.map} +1 -1
- package/dist/{seeds-zx--_kQK.cjs → seeds-BeXHiiuz.cjs} +110 -23
- package/dist/seeds-BeXHiiuz.cjs.map +1 -0
- package/dist/{seeds-COUB2LUb.mjs → seeds-CNrAW2NR.mjs} +110 -23
- package/dist/seeds-CNrAW2NR.mjs.map +1 -0
- package/dist/{serverSetup-BKn0EkXd.cjs → serverSetup-ChdSMUmE.cjs} +5 -5
- package/dist/{serverSetup-BKn0EkXd.cjs.map → serverSetup-ChdSMUmE.cjs.map} +1 -1
- package/dist/{serverSetup-8xNGD4mn.mjs → serverSetup-CqaeTq8J.mjs} +5 -5
- package/dist/{serverSetup-8xNGD4mn.mjs.map → serverSetup-CqaeTq8J.mjs.map} +1 -1
- package/dist/{sniffer-CsDVEKve.cjs → sniffer-CMMqjWyj.cjs} +6 -6
- package/dist/{sniffer-CsDVEKve.cjs.map → sniffer-CMMqjWyj.cjs.map} +1 -1
- package/dist/{sniffer-Dnovwvfd.mjs → sniffer-DW4uTBXp.mjs} +6 -6
- package/dist/{sniffer-Dnovwvfd.mjs.map → sniffer-DW4uTBXp.mjs.map} +1 -1
- package/dist/{snsSubscriptions-CSh5OTse.cjs → snsSubscriptions-CLWW_I6o.cjs} +2 -2
- package/dist/{snsSubscriptions-CSh5OTse.cjs.map → snsSubscriptions-CLWW_I6o.cjs.map} +1 -1
- package/dist/{snsSubscriptions-CNJ7ThQG.mjs → snsSubscriptions-ChIUluUY.mjs} +2 -2
- package/dist/{snsSubscriptions-CNJ7ThQG.mjs.map → snsSubscriptions-ChIUluUY.mjs.map} +1 -1
- package/dist/{stage-Crt8S-3Y.cjs → stage-C1oR_hgI.cjs} +4 -4
- package/dist/{stage-Crt8S-3Y.cjs.map → stage-C1oR_hgI.cjs.map} +1 -1
- package/dist/{stage-Becolb5X.mjs → stage-DGj-LIZd.mjs} +4 -4
- package/dist/{stage-Becolb5X.mjs.map → stage-DGj-LIZd.mjs.map} +1 -1
- package/dist/target/public.cjs +1 -1
- package/dist/target/public.mjs +1 -1
- package/package.json +15 -15
- package/dist/seeds-COUB2LUb.mjs.map +0 -1
- package/dist/seeds-zx--_kQK.cjs.map +0 -1
|
@@ -9,7 +9,7 @@ import { a as startTelemetryCode, n as runtimeFor, s as writeTelemetryModule, u
|
|
|
9
9
|
import { d as ConstructGenerator, f as output, h as eventsEdgeBucket, i as discover } from "./discover-DOhYSKY_.mjs";
|
|
10
10
|
import { ConfigNotFound, NotInAnApp, loadWorkspaceAppInfo, loadWorkspaceConfig } from "./config.mjs";
|
|
11
11
|
import { i as readFakes, o as objectsRoute, r as readCredentialFakes, t as SubscriberGenerator } from "./SubscriberGenerator-CI7roxx9.mjs";
|
|
12
|
-
import { c as runtimeOf } from "./resolve-
|
|
12
|
+
import { c as runtimeOf } from "./resolve-hyZMb2z7.mjs";
|
|
13
13
|
import { basename, dirname, isAbsolute, join, parse, relative, resolve, sep } from "node:path";
|
|
14
14
|
import { constants, existsSync, readFileSync } from "node:fs";
|
|
15
15
|
import { appendFile, chmod, copyFile, mkdir, readFile, readdir, rm, stat, writeFile } from "node:fs/promises";
|
|
@@ -598,13 +598,49 @@ function sitesFor(plan, project, addresses = {}, processorAddresses = {}) {
|
|
|
598
598
|
if (!address) continue;
|
|
599
599
|
const port = portOf(address);
|
|
600
600
|
if (!port) continue;
|
|
601
|
+
const upstream = `http://${HOST_GATEWAY$1}:${port}`;
|
|
602
|
+
if (resource.subdomain === WILDCARD_SUBDOMAIN) {
|
|
603
|
+
sites.push({
|
|
604
|
+
host,
|
|
605
|
+
upstream,
|
|
606
|
+
tenants: tenantsOf(resource, host, addresses)
|
|
607
|
+
});
|
|
608
|
+
continue;
|
|
609
|
+
}
|
|
601
610
|
sites.push({
|
|
602
611
|
host,
|
|
603
|
-
upstream
|
|
612
|
+
upstream
|
|
604
613
|
});
|
|
605
614
|
}
|
|
606
615
|
return sites;
|
|
607
616
|
}
|
|
617
|
+
/**
|
|
618
|
+
* What stands between a wildcard site and a host that is not a tenant.
|
|
619
|
+
*
|
|
620
|
+
* Caddy already prefers a named host to the `*`, so `api.shop.localhost`
|
|
621
|
+
* reaches the API whatever the wildcard says. What it cannot know is the
|
|
622
|
+
* labels nothing is running on: `www`, or an app this stage has not started.
|
|
623
|
+
* Those are refused here, so no slug that a deploy would protect is ever
|
|
624
|
+
* served locally either.
|
|
625
|
+
*
|
|
626
|
+
* The `hosts` route is asked through `forward_auth`, which is a deployed
|
|
627
|
+
* edge's check in miniature: a `2xx` lets the request through, and any other
|
|
628
|
+
* answer — the app's own `404` — is what the browser gets, so a mistyped
|
|
629
|
+
* slug fails here and not first in production. Without an address for the
|
|
630
|
+
* surface serving it there is nothing to ask, and every host is served.
|
|
631
|
+
*/
|
|
632
|
+
function tenantsOf(resource, host, addresses) {
|
|
633
|
+
const domain = host.slice(`${WILDCARD_SUBDOMAIN}.`.length);
|
|
634
|
+
const surface = resource.hosts ? addresses[resource.hosts.surface] : void 0;
|
|
635
|
+
const port = surface ? portOf(surface) : void 0;
|
|
636
|
+
return {
|
|
637
|
+
protected: (resource.protectedSubdomains ?? []).map((label) => `${label}.${domain}`),
|
|
638
|
+
...resource.hosts && port ? { hosts: {
|
|
639
|
+
upstream: `http://${HOST_GATEWAY$1}:${port}`,
|
|
640
|
+
uri: `${resource.hosts.path}?domain={host}`
|
|
641
|
+
} } : {}
|
|
642
|
+
};
|
|
643
|
+
}
|
|
608
644
|
/** The port a local address answers on, defaulting by scheme. */
|
|
609
645
|
function portOf(address) {
|
|
610
646
|
try {
|
|
@@ -687,7 +723,19 @@ function toCaddyfile(sites) {
|
|
|
687
723
|
if (sites.length === 0) return `${GENERATED}
|
|
688
724
|
# No file server is declared in this stage, so it routes nothing.
|
|
689
725
|
`;
|
|
690
|
-
const blocks = sites.map(({ host, upstream, rewrite, processors }) =>
|
|
726
|
+
const blocks = sites.map(({ host, upstream, rewrite, processors, tenants }) => {
|
|
727
|
+
const proxy = `reverse_proxy ${upstream} {${rewrite ? `
|
|
728
|
+
rewrite ${rewrite}
|
|
729
|
+
# MinIO routes and signs on the Host header, so forwarding the requested
|
|
730
|
+
# hostname would make it look for a bucket named after the domain.
|
|
731
|
+
header_up Host {upstream_hostport}` : `
|
|
732
|
+
# The application reads whatever address was injected, so it has to see
|
|
733
|
+
# the one a caller used — that is what makes a redirect, a cookie domain
|
|
734
|
+
# and a generated link point back here rather than at the upstream.
|
|
735
|
+
header_up Host {host}
|
|
736
|
+
header_up X-Forwarded-Proto {scheme}`}
|
|
737
|
+
}`;
|
|
738
|
+
return `
|
|
691
739
|
https://${host} {
|
|
692
740
|
tls internal
|
|
693
741
|
|
|
@@ -704,21 +752,35 @@ ${processors ? `
|
|
|
704
752
|
header_up Host {host}
|
|
705
753
|
}
|
|
706
754
|
}
|
|
707
|
-
` : ""}
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
# MinIO routes and signs on the Host header, so forwarding the requested
|
|
711
|
-
# hostname would make it look for a bucket named after the domain.
|
|
712
|
-
header_up Host {upstream_hostport}` : `
|
|
713
|
-
# The application reads whatever address was injected, so it has to see
|
|
714
|
-
# the one a caller used — that is what makes a redirect, a cookie domain
|
|
715
|
-
# and a generated link point back here rather than at the upstream.
|
|
716
|
-
header_up Host {host}
|
|
717
|
-
header_up X-Forwarded-Proto {scheme}`}
|
|
718
|
-
}
|
|
719
|
-
}`);
|
|
755
|
+
` : ""}${tenants ? tenantBlock(tenants, proxy) : ` ${proxy}`}
|
|
756
|
+
}`;
|
|
757
|
+
});
|
|
720
758
|
return `${GENERATED}${blocks.join("\n")}\n`;
|
|
721
759
|
}
|
|
760
|
+
/**
|
|
761
|
+
* A wildcard site's routes: a protected host refused, every other host asked
|
|
762
|
+
* about before it is proxied. `handle` blocks rather than bare directives,
|
|
763
|
+
* because Caddy orders directives itself and would proxy before it refused.
|
|
764
|
+
*/
|
|
765
|
+
function tenantBlock(tenants, proxy) {
|
|
766
|
+
return `${tenants.protected.length ? `
|
|
767
|
+
# Labels an app answers on, or that the workspace protects: never a
|
|
768
|
+
# tenant's, whether or not anything is running on them.
|
|
769
|
+
@protected host ${tenants.protected.join(" ")}
|
|
770
|
+
handle @protected {
|
|
771
|
+
respond 404
|
|
772
|
+
}
|
|
773
|
+
` : ""}
|
|
774
|
+
handle {${tenants.hosts ? `
|
|
775
|
+
# Which hosts are tenants is the app's to say: its \`hosts\` route
|
|
776
|
+
# answers 200 to serve this one, and anything else goes back as is.
|
|
777
|
+
forward_auth ${tenants.hosts.upstream} {
|
|
778
|
+
uri ${tenants.hosts.uri}
|
|
779
|
+
}
|
|
780
|
+
` : ""}
|
|
781
|
+
${proxy.replaceAll("\n", "\n ")}
|
|
782
|
+
}`;
|
|
783
|
+
}
|
|
722
784
|
const GENERATED = `# Generated by gkm from the construct manifest — do not edit.
|
|
723
785
|
#
|
|
724
786
|
# One host per declared file server, in front of the object store that holds its
|
|
@@ -1165,7 +1227,7 @@ function planFor(manifest, stage, order, options = {}) {
|
|
|
1165
1227
|
name: resourceName(id, declaration.kind, stage, options.localStage),
|
|
1166
1228
|
envKey: providedKeyFor(id, declaration.kind, ROLES[declaration.kind] ?? "url"),
|
|
1167
1229
|
provisions: PROVISIONS[declaration.kind] === true,
|
|
1168
|
-
...declaration.kind === "rest-api" || declaration.kind === "websocket-api" ? { callers: dependentsOf(manifest, id) } : {},
|
|
1230
|
+
...declaration.kind === "rest-api" || declaration.kind === "websocket-api" || declaration.kind === "objects" || declaration.kind === "file-server" ? { callers: dependentsOf(manifest, id) } : {},
|
|
1169
1231
|
...declaration.kind === "site" ? { publicEnv: publicEnvFor(declaration, manifest) } : {},
|
|
1170
1232
|
...declaration.kind === "mobile-app" ? {
|
|
1171
1233
|
publicEnv: publicEnvFor(declaration, manifest),
|
|
@@ -1175,7 +1237,10 @@ function planFor(manifest, stage, order, options = {}) {
|
|
|
1175
1237
|
...declaration.kind === "file-server" && declaration.processors?.length ? { processors: [...new Set(declaration.processors.map((p) => p.prefix))].sort() } : {},
|
|
1176
1238
|
...declaration.kind === "objects" && bucketExpiry(manifest, id) ? { expire: bucketExpiry(manifest, id) } : {},
|
|
1177
1239
|
...(declaration.kind === "rest-api" || declaration.kind === "websocket-api" || declaration.kind === "site") && declaration.subdomain ? { subdomain: declaration.subdomain } : {},
|
|
1178
|
-
...isWildcardSite(declaration) ? {
|
|
1240
|
+
...isWildcardSite(declaration) ? {
|
|
1241
|
+
protectedSubdomains: protectedSubdomains(manifest, options.protectedSubdomains),
|
|
1242
|
+
...declaration.hosts ? { hosts: declaration.hosts } : {}
|
|
1243
|
+
} : {},
|
|
1179
1244
|
...fake ? { fake: {
|
|
1180
1245
|
key: fake.key,
|
|
1181
1246
|
credentials: fake.credentials
|
|
@@ -1330,8 +1395,9 @@ function envFor(plan, options) {
|
|
|
1330
1395
|
const env = {};
|
|
1331
1396
|
const credential = credentialOf(options);
|
|
1332
1397
|
const resolved = {};
|
|
1398
|
+
const devices = options.lanAddress ? deviceBuckets(plan) : /* @__PURE__ */ new Set();
|
|
1333
1399
|
for (const resource of plan.resources) {
|
|
1334
|
-
const url = urlFor(resource, plan, options.ports, options.project ?? "", options.addresses, credential);
|
|
1400
|
+
const url = urlFor(resource, plan, options.ports, options.project ?? "", options.addresses, credential, devices.has(resource.id) ? options.lanAddress : void 0);
|
|
1335
1401
|
if (url) resolved[resource.id] = url;
|
|
1336
1402
|
}
|
|
1337
1403
|
for (const resource of plan.resources) {
|
|
@@ -1448,6 +1514,25 @@ function surfaceEnv(resource, url, resolved = {}, local = {}) {
|
|
|
1448
1514
|
};
|
|
1449
1515
|
}
|
|
1450
1516
|
/**
|
|
1517
|
+
* The buckets whose links a phone opens: those a surface a mobile app calls
|
|
1518
|
+
* depends on.
|
|
1519
|
+
*
|
|
1520
|
+
* The surface hands the app a URL it built — a file server's public link, a
|
|
1521
|
+
* bucket's presigned one — and the phone cannot resolve `*.localhost`, or
|
|
1522
|
+
* reach `localhost` at all. A presigned URL's signature covers its host, so
|
|
1523
|
+
* nothing downstream can move it either: the bucket has to be resolved on the
|
|
1524
|
+
* LAN address in the first place.
|
|
1525
|
+
*/
|
|
1526
|
+
function deviceBuckets(plan) {
|
|
1527
|
+
const byId = new Map(plan.resources.map((r) => [r.id, r]));
|
|
1528
|
+
const fromApp = (id) => {
|
|
1529
|
+
const caller = byId.get(id);
|
|
1530
|
+
if (caller?.kind === "mobile-app") return true;
|
|
1531
|
+
return (caller?.kind === "rest-api" || caller?.kind === "websocket-api") && (caller.callers ?? []).some((c) => byId.get(c)?.kind === "mobile-app");
|
|
1532
|
+
};
|
|
1533
|
+
return new Set(plan.resources.filter((r) => r.kind === "objects" || r.kind === "file-server").filter((r) => (r.callers ?? []).some(fromApp)).map((r) => r.id));
|
|
1534
|
+
}
|
|
1535
|
+
/**
|
|
1451
1536
|
* Where a WebSocket surface's publisher meets its sockets: the local Redis,
|
|
1452
1537
|
* on channels named for the project and the surface, so two projects sharing
|
|
1453
1538
|
* one Redis never see each other's frames.
|
|
@@ -1537,7 +1622,7 @@ function workerBroker(plan, ports, credential) {
|
|
|
1537
1622
|
*
|
|
1538
1623
|
* Every part of it comes from the resource and the port it was published on.
|
|
1539
1624
|
*/
|
|
1540
|
-
function urlFor(resource, plan, ports, project, addresses, credential) {
|
|
1625
|
+
function urlFor(resource, plan, ports, project, addresses, credential, lan) {
|
|
1541
1626
|
if (resource.kind === "secret") return localSecret(project, plan, resource);
|
|
1542
1627
|
if (resource.kind === "encryption") return localKeyring(project, plan, resource);
|
|
1543
1628
|
if (resource.kind === "mobile-app") return schemeBase(project, resource.scheme);
|
|
@@ -1581,10 +1666,12 @@ function urlFor(resource, plan, ports, project, addresses, credential) {
|
|
|
1581
1666
|
}
|
|
1582
1667
|
case "telemetry": return `http://${LOCAL_HOST}:${port}/api/${LOGS_ORG}`;
|
|
1583
1668
|
case "email": return `smtp://${LOCAL_HOST}:${port}`;
|
|
1584
|
-
case "objects": return `s3://${resource.name}?region=${LOCAL_REGION}&endpoint=http://${LOCAL_HOST}:${port}&forcePathStyle=true`;
|
|
1669
|
+
case "objects": return `s3://${resource.name}?region=${LOCAL_REGION}&endpoint=http://${lan ?? LOCAL_HOST}:${port}&forcePathStyle=true`;
|
|
1585
1670
|
case "file-server": {
|
|
1586
1671
|
const origin = plan.resources.find((r) => r.id === resource.of);
|
|
1587
1672
|
if (!origin) return void 0;
|
|
1673
|
+
const objects = origin.container ? ports[primaryPortKey(origin.container)] : void 0;
|
|
1674
|
+
if (lan && !resource.processors?.length && objects !== void 0) return `http://${lan}:${objects}/${origin.name}`;
|
|
1588
1675
|
return plan.containers.includes("caddy") ? `https://${hostFor$1(resource, project)}:${port}` : `http://${LOCAL_HOST}:${port}/${origin.name}`;
|
|
1589
1676
|
}
|
|
1590
1677
|
case "cache":
|
|
@@ -8363,7 +8450,7 @@ async function createDnsProvider(options) {
|
|
|
8363
8450
|
});
|
|
8364
8451
|
}
|
|
8365
8452
|
if (provider === "godaddy") {
|
|
8366
|
-
const { GoDaddyProvider } = await import("./GoDaddyProvider-
|
|
8453
|
+
const { GoDaddyProvider } = await import("./GoDaddyProvider-DPiJ5exO.mjs");
|
|
8367
8454
|
return new GoDaddyProvider(options.godaddy ?? {});
|
|
8368
8455
|
}
|
|
8369
8456
|
if (provider === "cloudflare") throw new DnsProviderNotImplemented("cloudflare");
|
|
@@ -9214,4 +9301,4 @@ function reportPlannedSeeds(planned, log) {
|
|
|
9214
9301
|
//#endregion
|
|
9215
9302
|
export { ORIGIN_VERIFY_HEADER as $, telemetryOf as $n, maskPassword as $t, StageProviderDisabled as A, postgresSuperuser as An, LEGACY_LOCAL_LOGIN as At, processorDockerfile as B, redisService as Bn, createCredentialsPreload as Bt, recordRollback as C, postgresDatabaseNames as Cn, backendsOf as Ct, setPostgresBackupId as D, LOCAL_RABBITMQ_USER as Dn, workspace_exports as Dt, setGeneratedSecret as E, mergeLifecycle as En, reconcileWorkspace as Et, DockerBuildFailed as F, projectKey as Fn, composeFor as Ft, workerBundleName as G, localRolePassword as Gn, loadPortState as Gt, workerDockerfile as H, stackRedis as Hn, findAvailablePort as Ht, DockerPushFailed as I, readKey as In, cacheBackendFor as It, CronGenerator as J, resourceName as Jn, isRemoteStore as Jt, workerEntryDir as K, TELEMETRY_CONTAINER as Kn, loadSecretsForApp as Kt, appDockerfile as L, withGeneratedSecrets as Ln, eventsBackendFor as Lt, provisionCommand as M, FileSecretsStore as Mn, bucketClient as Mt, stageProviderNotes as N, getKeyPath as Nn, pgClient as Nt, DnsRecordsUnreadable as O, loadLocalCredentials as On, LOCAL_CA_PATH as Ot, PROVIDER_KINDS as P, keystoreProject as Pn, CLUSTER_DATABASE as Pt, processorInfo as Q, surfaceClientTraced as Qn, initStageSecrets as Qt, dockerCommand as R, REDIS_SERVICE as Rn, providerOf as Rt, recordRelease as S, bucketPolicies as Sn, FAKE_ENV as St, setBackupState as T, quoteIdentifier as Tn, derivedContainers as Tt, workerDockerfileOf as U, withRedisPassword as Un, isPortAvailable as Ut, processorNative as V, runsRedis as Vn, createEntryWrapper as Vt, WorkerGenerator as W, envFor as Wn, loadEnvFiles as Wt, processorBundleName as X, isTelemetryKey as Xn, storeFromConfig as Xt, ProcessorGenerator as Y, appTelemetry as Yn, secretsStoreFor as Yt, processorEntryDir as Z, scopeTelemetryEnv as Zn, store_exports as Zt, asDokployState as _, applyLifecycles as _n, withLogsPassword as _r, appEnvKeys as _t, dnsResources as a, PROCESSOR_PORT as an, DEFAULT_IMAGES as ar, AllowDevServicesTakesNoValue as at, getBackupState as b, applyPostgres as bn, resolveHost as br, processorEnvKeys as bt, currentActor as c, detectPackageManager as cn, portKeys as cr, ExternalServicesNotConfigured as ct, DeployJournal as d, isImageBuild as dn, primaryPortKey as dr, devServicesUsed as dt, storage_exports as en, usesTelemetry as er, PROCESSOR_ORIGIN_SECRET_ENV as et, extractSubdomain as f, publicBuildValues as fn, LOCAL_LOGS_EMAIL as fr, externalServices as ft, verifyDnsRecords as g, applyBuckets as gn, stackLogs as gr, suppliedOnly as gt, orchestrateDns as h, workerUnits as hn, logsService as hr, stageServiceDeclarations as ht, dnsRecordResource as i, imageLayout as in, hostFor$1 as ir, validateImageRef as it, assertStageProvidersEnabled as j, readLocalCredentials as jn, ensurePostgresLogin as jt, createDnsProvider as k, postgresRoleSlug as kn, forgetState as kt, describeActor as l, findBuildRoot as ln, portsOf as lr, STORAGE_KEY_PAIR as lt, normalizeDnsConfig as m, processorUnits as mn, logsAccess as mr, requiredStageKeys as mt, reportDatabaseRuns as n, withCustomSecret as nn, watchedBuckets as nr, originSecretKey as nt, forgetDnsResource as o, TURBO_VERSION as on, describeServices as or, DEV_SERVICES as ot, findRootDomain as p, isUnder as pn, LOGS_SERVICE as pr, reportDevServices as pt, QueueGenerator as q, planFor as qn, prepareEntryCredentials as qt, reportPlannedSeeds as r, composeBuildPaths as rn, EMULATOR_ACCESS_KEY_ID as rr, processorOriginHost as rt, recordDnsChanges as s, WORKER_PORT as sn, fakeKey as sr, DevServicesNeedServerTarget as st, DeploySeedsFailed as t, toEmbeddableSecrets as tn, minioWebhookEnv as tr, newOriginSecret as tt, isCi as u, imageBuildCredentials as un, postgresImage as ur, assertDevServicesFlag as ut, createComposeState as v, applyNotifications as vn, NoDomainForStage as vr, dockerfileOf as vt, setApplicationId as w, postgresStatements as wn, constructGlobs as wt, getGeneratedSecret as x, bucketLifecycles as xn, workerEnvKeys as xt, createEmptyState as y, applyPolicies as yn, isMainFrontendApp as yr, networkEnv as yt, ensureDockerignore as z, STACK_CACHE as zn, storageBackendFor as zt };
|
|
9216
9303
|
|
|
9217
|
-
//# sourceMappingURL=seeds-
|
|
9304
|
+
//# sourceMappingURL=seeds-CNrAW2NR.mjs.map
|