bdy 1.22.43-dev-distro → 1.22.44-dev-distro
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/distTs/package.json
CHANGED
|
@@ -43,20 +43,41 @@ commandDomainBuy.action(async (text, options) => {
|
|
|
43
43
|
}
|
|
44
44
|
output_1.default.exitNormal();
|
|
45
45
|
});
|
|
46
|
+
const outputRouteExample = (domain) => {
|
|
47
|
+
output_1.default.normal('\nRoute this zone to an artifact:');
|
|
48
|
+
output_1.default.dim('bdy distro route create <distro-identifier> \\');
|
|
49
|
+
output_1.default.dim(` --domain="${domain}" \\`);
|
|
50
|
+
output_1.default.dim(' --target "artifact=<artifact-identifier>:<version>"');
|
|
51
|
+
output_1.default.normal(`\nRoute a NEW sub-name within the zone (e.g. api.${domain}):`);
|
|
52
|
+
output_1.default.dim('bdy distro route create <distro-identifier> \\');
|
|
53
|
+
output_1.default.dim(' --subdomain="api" \\');
|
|
54
|
+
output_1.default.dim(` --domain="${domain}" \\`);
|
|
55
|
+
output_1.default.dim(' --target "artifact=<artifact-identifier>:<version>"');
|
|
56
|
+
};
|
|
57
|
+
const outputClaimed = (domain) => {
|
|
58
|
+
output_1.default.okSign();
|
|
59
|
+
output_1.default.cyan(domain, false);
|
|
60
|
+
output_1.default.normal(' claimed');
|
|
61
|
+
outputRouteExample(domain);
|
|
62
|
+
};
|
|
63
|
+
const outputBought = (domain) => {
|
|
64
|
+
output_1.default.okSign();
|
|
65
|
+
output_1.default.cyan(domain, false);
|
|
66
|
+
output_1.default.normal(' bought');
|
|
67
|
+
outputRouteExample(domain);
|
|
68
|
+
};
|
|
46
69
|
const claimNonInteractive = async (client, workspace, domain, onOwnerBehalf) => {
|
|
47
70
|
output_1.default.arrowSign();
|
|
48
71
|
output_1.default.normal(`Matched: ${output_1.default.formatDomainClaim(domain, true)}`);
|
|
49
72
|
await client.domainClaim(workspace, domain, onOwnerBehalf);
|
|
50
|
-
|
|
51
|
-
output_1.default.normal(`${domain} claimed`);
|
|
73
|
+
outputClaimed(domain);
|
|
52
74
|
};
|
|
53
75
|
const buyNonInteractive = async (client, workspace, domain, onOwnerBehalf) => {
|
|
54
76
|
output_1.default.arrowSign();
|
|
55
77
|
output_1.default.normal(`Matched: ${output_1.default.formatDomain(domain)}`);
|
|
56
78
|
if (domain.available && !domain.premium) {
|
|
57
79
|
await client.domainBuy(workspace, domain.name, onOwnerBehalf, true);
|
|
58
|
-
|
|
59
|
-
output_1.default.normal(`${domain.name} bought`);
|
|
80
|
+
outputBought(domain.name);
|
|
60
81
|
}
|
|
61
82
|
};
|
|
62
83
|
const interactive = async (client, workspace, prompt, tlds, onOwnerBehalf, onlyAvailable, sort) => {
|
|
@@ -235,13 +256,11 @@ const interactive = async (client, workspace, prompt, tlds, onOwnerBehalf, onlyA
|
|
|
235
256
|
}
|
|
236
257
|
else if (type === 'claim') {
|
|
237
258
|
await client.domainClaim(workspace, name, onOwnerBehalf);
|
|
238
|
-
|
|
239
|
-
output_1.default.normal(`${name} claimed`);
|
|
259
|
+
outputClaimed(name);
|
|
240
260
|
}
|
|
241
261
|
else {
|
|
242
262
|
await client.domainBuy(workspace, name, onOwnerBehalf);
|
|
243
|
-
|
|
244
|
-
output_1.default.normal(`${name} bought`);
|
|
263
|
+
outputBought(name);
|
|
245
264
|
}
|
|
246
265
|
};
|
|
247
266
|
const nonInteractive = async (client, workspace, prompt, tlds, onOwnerBehalf) => {
|
package/distTs/src/texts.js
CHANGED
|
@@ -869,13 +869,13 @@ exports.DESC_COMMAND_DISTRO_DELETE = 'Delete distribution. Required scopes: DIST
|
|
|
869
869
|
exports.DESC_COMMAND_DISTRO_LIST = 'List distributions. Required scopes: DISTRIBUTION_INFO';
|
|
870
870
|
exports.DESC_COMMAND_ROUTE_LIST = 'List routes. Required scopes: DISTRIBUTION_INFO';
|
|
871
871
|
exports.DESC_COMMAND_ROUTE_DELETE = 'Delete route. Required scopes: DISTRIBUTION_MANAGE';
|
|
872
|
-
exports.DESC_COMMAND_ROUTE = 'Manage distribution routes
|
|
872
|
+
exports.DESC_COMMAND_ROUTE = 'Manage distribution routes';
|
|
873
873
|
exports.OPT_COMMAND_DISTRO_SCOPE = 'Force distribution scope (WORKSPACE, PROJECT). By default calculated by provided options and environmental variables';
|
|
874
874
|
exports.OPT_COMMAND_DISTRO_IDENTIFIER = 'Human-readable ID of the distribution';
|
|
875
875
|
exports.OPT_COMMAND_ROUTE_ID = 'ID of the route (find via "bdy distro route ls")';
|
|
876
876
|
exports.OPT_COMMAND_ROUTE_TYPE = 'Type of the route. Allowed: PROXY, PROXY_NO_CACHE, REDIRECT, CLOAKING';
|
|
877
|
-
exports.OPT_COMMAND_ROUTE_SUBDOMAIN = '
|
|
878
|
-
exports.OPT_COMMAND_ROUTE_DOMAIN = '
|
|
877
|
+
exports.OPT_COMMAND_ROUTE_SUBDOMAIN = 'Optional sub-name prepended to --domain (e.g. --subdomain=api --domain=example.com → api.example.com). Omit to route the zone itself. Do NOT use this to peel a label off a multi-level zone — the zone always goes whole into --domain';
|
|
878
|
+
exports.OPT_COMMAND_ROUTE_DOMAIN = 'Zone for the route — pass the WHOLE string from `bdy domain ls` (e.g. "example.com" or "my-app.example.dev"). Do NOT split a multi-level zone into subdomain+domain; the entire bought/claimed string is one zone and goes here as-is. Use --subdomain only to route a sub-name within this zone';
|
|
879
879
|
exports.OPT_COMMAND_ROUTE_PATH = 'Path of the route';
|
|
880
880
|
exports.OPT_COMMAND_ROUTE_TARGET = `Target of the route (can be used multiple times).
|
|
881
881
|
Format: "region=default,url=https://example.com,artifact=artifact:version,sandbox=sandbox:endpoint"
|
|
@@ -905,7 +905,7 @@ const ERR_WRONG_ROUTE_TARGET = (v, msg) => `Target has wrong format: ${v}. ${msg
|
|
|
905
905
|
exports.ERR_WRONG_ROUTE_TARGET = ERR_WRONG_ROUTE_TARGET;
|
|
906
906
|
exports.ERR_ROUTE_NO_DEFAULT = 'Target in Default region is mandatory';
|
|
907
907
|
// domain commands
|
|
908
|
-
exports.DESC_COMMAND_DOMAIN = 'Manage domains';
|
|
908
|
+
exports.DESC_COMMAND_DOMAIN = 'Manage zones (called "domains" in Buddy). A zone can be used in distribution routes. Zones can be apex (example.com) or multi-level (my-app.example.dev) — the whole string is one zone';
|
|
909
909
|
exports.DESC_COMMAND_DOMAIN_BUY = 'Buy domain';
|
|
910
910
|
exports.DESC_COMMAND_DOMAIN_SEARCH = 'Search domain';
|
|
911
911
|
exports.DESC_COMMAND_DOMAIN_LIST = 'List domains';
|
|
@@ -1058,13 +1058,19 @@ exports.EXAMPLE_ROUTE_LIST = `
|
|
|
1058
1058
|
### list routes
|
|
1059
1059
|
bdy distro route ls distro-identifier`;
|
|
1060
1060
|
exports.EXAMPLE_ROUTE_CREATE = `
|
|
1061
|
-
###
|
|
1062
|
-
|
|
1063
|
-
###
|
|
1061
|
+
### --domain is the WHOLE zone string from \`bdy domain ls\` (apex like "example.com" or multi-level like "my-app.example.dev").
|
|
1062
|
+
### --subdomain is OPTIONAL and only prepends a NEW sub-name to that zone. Never split a multi-level zone — it goes whole into --domain.
|
|
1063
|
+
### route an apex zone you bought ("example.com") to an artifact
|
|
1064
|
+
bdy distro route create distro-identifier --domain="example.com" --target "artifact=artifact-identifier:version"
|
|
1065
|
+
### route a multi-level zone you claimed ("my-app.example.dev") to an artifact — pass it WHOLE, do NOT split
|
|
1066
|
+
bdy distro route create distro-identifier --domain="my-app.example.dev" --target "artifact=artifact-identifier:version"
|
|
1067
|
+
### route a NEW sub-name within a zone ("api.example.com") — subdomain is "api", zone is "example.com"
|
|
1068
|
+
bdy distro route create distro-identifier --subdomain="api" --domain="example.com" --target "url=https://backend.internal"
|
|
1069
|
+
### route to a sandbox endpoint (no zone, distro's default domain is used)
|
|
1064
1070
|
bdy distro route create distro-identifier --subdomain="sandbox" --target "sandbox=sandbox-identifier:endpoint-name"
|
|
1065
|
-
###
|
|
1071
|
+
### route to an artifact in two locations (default + Europe override)
|
|
1066
1072
|
bdy distro route create distro-identifier --subdomain="artifact" --target "artifact=artifact-identifier:version" --target "region=Europe,artifact=artifact-identifier:version2"
|
|
1067
|
-
###
|
|
1073
|
+
### route only for js files under a sub-name
|
|
1068
1074
|
bdy distro route create distro-identifier --path="*.js" --subdomain="cdn" --target "artifact=artifact-identifier:version"
|
|
1069
1075
|
### create redirect route
|
|
1070
1076
|
bdy distro route create distro-identifier --type="REDIRECT" --path="/my-url" --target "url=https://example.com/page"`;
|
|
@@ -652,6 +652,13 @@ class Tunnel extends events_1.default {
|
|
|
652
652
|
if (!user || !user.name || !user.pass)
|
|
653
653
|
return false;
|
|
654
654
|
const client = this._getHttpAuthClient();
|
|
655
|
+
let ipAddress;
|
|
656
|
+
if (req.httpVersion === '2.0') {
|
|
657
|
+
ipAddress = req.socket.stream ? req.socket.stream.remoteAddress : '::1';
|
|
658
|
+
}
|
|
659
|
+
else {
|
|
660
|
+
ipAddress = req.socket.remoteAddress;
|
|
661
|
+
}
|
|
655
662
|
try {
|
|
656
663
|
const { statusCode, body } = await client.request({
|
|
657
664
|
path: `/tunnel/auth/pat`,
|
|
@@ -664,6 +671,7 @@ class Tunnel extends events_1.default {
|
|
|
664
671
|
agentId: this.agent.id,
|
|
665
672
|
login: user.name,
|
|
666
673
|
password: user.pass,
|
|
674
|
+
ipAddress,
|
|
667
675
|
}),
|
|
668
676
|
});
|
|
669
677
|
if (statusCode !== 200) {
|