@cardelli/ambit 0.1.5 → 0.2.0
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/esm/cli/commands/create/index.d.ts +2 -0
- package/esm/cli/commands/create/index.d.ts.map +1 -0
- package/esm/cli/commands/create/index.js +292 -0
- package/esm/cli/commands/create/machine.d.ts +33 -0
- package/esm/cli/commands/create/machine.d.ts.map +1 -0
- package/esm/cli/commands/create/machine.js +162 -0
- package/esm/cli/commands/deploy/index.d.ts +2 -0
- package/esm/cli/commands/deploy/index.d.ts.map +1 -0
- package/esm/cli/commands/deploy/index.js +290 -0
- package/esm/cli/commands/deploy/machine.d.ts +52 -0
- package/esm/cli/commands/deploy/machine.d.ts.map +1 -0
- package/esm/cli/commands/deploy/machine.js +116 -0
- package/esm/cli/commands/deploy/modes.d.ts +18 -0
- package/esm/cli/commands/deploy/modes.d.ts.map +1 -0
- package/esm/cli/commands/deploy/modes.js +152 -0
- package/esm/cli/commands/destroy/app.d.ts +2 -0
- package/esm/cli/commands/destroy/app.d.ts.map +1 -0
- package/esm/cli/commands/destroy/app.js +173 -0
- package/esm/cli/commands/destroy/index.d.ts +2 -0
- package/esm/cli/commands/destroy/index.d.ts.map +1 -0
- package/esm/cli/commands/destroy/index.js +63 -0
- package/esm/cli/commands/destroy/network.d.ts +2 -0
- package/esm/cli/commands/destroy/network.d.ts.map +1 -0
- package/esm/cli/commands/destroy/network.js +210 -0
- package/esm/cli/commands/doctor.d.ts.map +1 -0
- package/esm/cli/commands/doctor.js +295 -0
- package/esm/{src/cli → cli}/commands/list.d.ts.map +1 -1
- package/esm/{src/cli → cli}/commands/list.js +39 -54
- package/esm/cli/commands/status.d.ts.map +1 -0
- package/esm/cli/commands/status.js +331 -0
- package/esm/cli/mod.d.ts.map +1 -0
- package/esm/{src/cli → cli}/mod.js +4 -4
- package/esm/deno.d.ts +4 -18
- package/esm/deno.js +5 -19
- package/esm/deps/jsr.io/@std/path/1.1.4/constants.d.ts +1 -1
- package/esm/lib/args.d.ts +11 -0
- package/esm/lib/args.d.ts.map +1 -0
- package/esm/lib/args.js +28 -0
- package/esm/lib/cli.d.ts +0 -1
- package/esm/lib/cli.d.ts.map +1 -1
- package/esm/lib/cli.js +0 -1
- package/esm/lib/command.d.ts +0 -3
- package/esm/lib/command.d.ts.map +1 -1
- package/esm/lib/command.js +2 -13
- package/esm/lib/machine.d.ts +11 -0
- package/esm/lib/machine.d.ts.map +1 -0
- package/esm/lib/machine.js +15 -0
- package/esm/lib/output.d.ts +2 -1
- package/esm/lib/output.d.ts.map +1 -1
- package/esm/lib/output.js +21 -3
- package/esm/lib/result.d.ts +0 -1
- package/esm/lib/result.d.ts.map +1 -1
- package/esm/lib/result.js +0 -1
- package/esm/main.d.ts +6 -6
- package/esm/main.d.ts.map +1 -1
- package/esm/main.js +7 -9
- package/esm/providers/fly.d.ts +81 -0
- package/esm/providers/fly.d.ts.map +1 -0
- package/esm/providers/fly.js +372 -0
- package/esm/providers/tailscale.d.ts +31 -0
- package/esm/providers/tailscale.d.ts.map +1 -0
- package/esm/providers/tailscale.js +150 -0
- package/esm/{src/schemas → schemas}/fly.d.ts +1 -11
- package/esm/schemas/fly.d.ts.map +1 -0
- package/esm/{src/schemas → schemas}/fly.js +14 -56
- package/esm/{src/schemas → schemas}/tailscale.d.ts +1 -2
- package/esm/schemas/tailscale.d.ts.map +1 -0
- package/esm/{src/schemas → schemas}/tailscale.js +2 -3
- package/esm/src/{docker/router → router}/Dockerfile +0 -11
- package/esm/src/{docker/router → router}/start.sh +18 -9
- package/esm/util/constants.d.ts +13 -0
- package/esm/util/constants.d.ts.map +1 -0
- package/esm/util/constants.js +34 -0
- package/esm/{src → util}/credentials.d.ts +0 -1
- package/esm/util/credentials.d.ts.map +1 -0
- package/esm/{src → util}/credentials.js +3 -5
- package/esm/{src → util}/discovery.d.ts +16 -3
- package/esm/util/discovery.d.ts.map +1 -0
- package/esm/{src → util}/discovery.js +24 -15
- package/esm/util/fly-transforms.d.ts +27 -0
- package/esm/util/fly-transforms.d.ts.map +1 -0
- package/esm/util/fly-transforms.js +87 -0
- package/esm/{src → util}/guard.d.ts +1 -2
- package/esm/util/guard.d.ts.map +1 -0
- package/esm/{src → util}/guard.js +27 -27
- package/esm/util/naming.d.ts +5 -0
- package/esm/util/naming.d.ts.map +1 -0
- package/esm/util/naming.js +12 -0
- package/esm/{src → util}/resolve.d.ts +2 -3
- package/esm/util/resolve.d.ts.map +1 -0
- package/esm/{src → util}/resolve.js +1 -2
- package/esm/util/session.d.ts +16 -0
- package/esm/util/session.d.ts.map +1 -0
- package/esm/util/session.js +19 -0
- package/esm/util/tailscale-local.d.ts +13 -0
- package/esm/util/tailscale-local.d.ts.map +1 -0
- package/esm/util/tailscale-local.js +63 -0
- package/esm/{src → util}/template.d.ts +0 -1
- package/esm/util/template.d.ts.map +1 -0
- package/esm/{src → util}/template.js +0 -1
- package/package.json +1 -49
- package/esm/lib/paths.d.ts +0 -3
- package/esm/lib/paths.d.ts.map +0 -1
- package/esm/lib/paths.js +0 -5
- package/esm/src/cli/commands/create.d.ts +0 -2
- package/esm/src/cli/commands/create.d.ts.map +0 -1
- package/esm/src/cli/commands/create.js +0 -308
- package/esm/src/cli/commands/deploy.d.ts +0 -2
- package/esm/src/cli/commands/deploy.d.ts.map +0 -1
- package/esm/src/cli/commands/deploy.js +0 -430
- package/esm/src/cli/commands/destroy.d.ts +0 -2
- package/esm/src/cli/commands/destroy.d.ts.map +0 -1
- package/esm/src/cli/commands/destroy.js +0 -340
- package/esm/src/cli/commands/doctor.d.ts.map +0 -1
- package/esm/src/cli/commands/doctor.js +0 -141
- package/esm/src/cli/commands/status.d.ts.map +0 -1
- package/esm/src/cli/commands/status.js +0 -152
- package/esm/src/cli/mod.d.ts.map +0 -1
- package/esm/src/credentials.d.ts.map +0 -1
- package/esm/src/discovery.d.ts.map +0 -1
- package/esm/src/guard.d.ts.map +0 -1
- package/esm/src/providers/fly.d.ts +0 -76
- package/esm/src/providers/fly.d.ts.map +0 -1
- package/esm/src/providers/fly.js +0 -407
- package/esm/src/providers/tailscale.d.ts +0 -31
- package/esm/src/providers/tailscale.d.ts.map +0 -1
- package/esm/src/providers/tailscale.js +0 -189
- package/esm/src/resolve.d.ts.map +0 -1
- package/esm/src/schemas/config.d.ts +0 -5
- package/esm/src/schemas/config.d.ts.map +0 -1
- package/esm/src/schemas/config.js +0 -22
- package/esm/src/schemas/fly.d.ts.map +0 -1
- package/esm/src/schemas/tailscale.d.ts.map +0 -1
- package/esm/src/template.d.ts.map +0 -1
- /package/esm/{src/cli → cli}/commands/doctor.d.ts +0 -0
- /package/esm/{src/cli → cli}/commands/list.d.ts +0 -0
- /package/esm/{src/cli → cli}/commands/status.d.ts +0 -0
- /package/esm/{src/cli → cli}/mod.d.ts +0 -0
- /package/esm/src/{docker/router → router}/fly.toml +0 -0
|
@@ -1,308 +0,0 @@
|
|
|
1
|
-
// =============================================================================
|
|
2
|
-
// Create Command - Create Tailscale Subnet Router on Fly.io Custom Network
|
|
3
|
-
// =============================================================================
|
|
4
|
-
import { parseArgs } from "../../../deps/jsr.io/@std/cli/1.0.28/mod.js";
|
|
5
|
-
import { bold, randomId, readSecret } from "../../../lib/cli.js";
|
|
6
|
-
import { createOutput } from "../../../lib/output.js";
|
|
7
|
-
import { registerCommand } from "../mod.js";
|
|
8
|
-
import { extractSubnet, getRouterTag } from "../../schemas/config.js";
|
|
9
|
-
import { isPublicTld } from "../../guard.js";
|
|
10
|
-
import { createFlyProvider, FlyDeployError, getRouterAppName, } from "../../providers/fly.js";
|
|
11
|
-
import { createTailscaleProvider, enableAcceptRoutes, isAcceptRoutesEnabled, isTailscaleInstalled, waitForDevice, } from "../../providers/tailscale.js";
|
|
12
|
-
import { getCredentialStore } from "../../credentials.js";
|
|
13
|
-
import { resolveOrg } from "../../resolve.js";
|
|
14
|
-
import { findRouterApp } from "../../discovery.js";
|
|
15
|
-
// =============================================================================
|
|
16
|
-
// Create Command
|
|
17
|
-
// =============================================================================
|
|
18
|
-
const create = async (argv) => {
|
|
19
|
-
const args = parseArgs(argv, {
|
|
20
|
-
string: ["org", "region", "api-key", "tag"],
|
|
21
|
-
boolean: ["help", "yes", "json", "no-auto-approve"],
|
|
22
|
-
alias: { y: "yes" },
|
|
23
|
-
});
|
|
24
|
-
if (args.help) {
|
|
25
|
-
console.log(`
|
|
26
|
-
${bold("ambit create")} - Create Tailscale Subnet Router
|
|
27
|
-
|
|
28
|
-
${bold("USAGE")}
|
|
29
|
-
ambit create <network> [options]
|
|
30
|
-
|
|
31
|
-
${bold("OPTIONS")}
|
|
32
|
-
--org <org> Fly.io organization slug
|
|
33
|
-
--region <region> Fly.io region (default: iad)
|
|
34
|
-
--api-key <key> Tailscale API access token (tskey-api-...)
|
|
35
|
-
--tag <tag> Tailscale ACL tag for the router (default: tag:ambit-<network>)
|
|
36
|
-
--no-auto-approve Skip waiting for router and approving routes
|
|
37
|
-
-y, --yes Skip confirmation prompts
|
|
38
|
-
--json Output as JSON (implies --no-auto-approve)
|
|
39
|
-
|
|
40
|
-
${bold("DESCRIPTION")}
|
|
41
|
-
Deploys a Tailscale subnet router onto a Fly.io custom private network.
|
|
42
|
-
The network name becomes a TLD on your tailnet:
|
|
43
|
-
|
|
44
|
-
my-app.${args._[0] || "<network>"} resolves to my-app.flycast
|
|
45
|
-
|
|
46
|
-
${bold("EXAMPLES")}
|
|
47
|
-
ambit create browsers
|
|
48
|
-
ambit create browsers --org my-org --region sea
|
|
49
|
-
`);
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
const out = createOutput(args.json);
|
|
53
|
-
const networkArg = args._[0];
|
|
54
|
-
if (!networkArg || typeof networkArg !== "string") {
|
|
55
|
-
return out.die("Network Name Required. Usage: ambit create <network>");
|
|
56
|
-
}
|
|
57
|
-
const network = networkArg;
|
|
58
|
-
if (isPublicTld(network)) {
|
|
59
|
-
return out.die(`"${network}" Is a Public TLD and Cannot Be Used as a Network Name`);
|
|
60
|
-
}
|
|
61
|
-
const tag = args.tag || getRouterTag(network);
|
|
62
|
-
const shouldApprove = !(args["no-auto-approve"] || args.json);
|
|
63
|
-
out.blank()
|
|
64
|
-
.header("=".repeat(50))
|
|
65
|
-
.header(` ambit Create: ${network}`)
|
|
66
|
-
.header("=".repeat(50))
|
|
67
|
-
.blank();
|
|
68
|
-
// ==========================================================================
|
|
69
|
-
// Step 1: Fly.io Authentication
|
|
70
|
-
// ==========================================================================
|
|
71
|
-
out.header("Step 1: Fly.io Configuration").blank();
|
|
72
|
-
const fly = createFlyProvider();
|
|
73
|
-
await fly.ensureInstalled();
|
|
74
|
-
const email = await fly.ensureAuth({ interactive: !args.json });
|
|
75
|
-
out.ok(`Authenticated as ${email}`);
|
|
76
|
-
const org = await resolveOrg(fly, args, out);
|
|
77
|
-
const region = args.region || "iad";
|
|
78
|
-
out.ok(`Using Region: ${region}`);
|
|
79
|
-
const existingRouter = await findRouterApp(fly, org, network);
|
|
80
|
-
if (existingRouter) {
|
|
81
|
-
return out.die(`A Router Already Exists for Network "${network}": ${existingRouter.appName}. ` +
|
|
82
|
-
`Use "ambit destroy ${network}" First, or Choose a Different Network Name.`);
|
|
83
|
-
}
|
|
84
|
-
out.blank();
|
|
85
|
-
// ==========================================================================
|
|
86
|
-
// Step 2: Tailscale Configuration
|
|
87
|
-
// ==========================================================================
|
|
88
|
-
out.header("Step 2: Tailscale Configuration").blank();
|
|
89
|
-
const credentials = getCredentialStore();
|
|
90
|
-
let apiKey = args["api-key"] || (await credentials.getTailscaleApiKey());
|
|
91
|
-
if (!apiKey) {
|
|
92
|
-
if (args.json) {
|
|
93
|
-
return out.die("--api-key Is Required in JSON Mode");
|
|
94
|
-
}
|
|
95
|
-
out.dim("Ambit Needs an API Access Token (Not an Auth Key) to Manage Your Tailnet.")
|
|
96
|
-
.dim("Create One at: https://login.tailscale.com/admin/settings/keys")
|
|
97
|
-
.blank();
|
|
98
|
-
apiKey = await readSecret("API access token (tskey-api-...): ");
|
|
99
|
-
if (!apiKey) {
|
|
100
|
-
return out.die("Tailscale API Access Token Required");
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
if (!apiKey.startsWith("tskey-api-")) {
|
|
104
|
-
return out.die("Invalid Token Format. Expected 'tskey-api-...' (API access token, not auth key)");
|
|
105
|
-
}
|
|
106
|
-
const tailscale = createTailscaleProvider("-", apiKey);
|
|
107
|
-
const validateSpinner = out.spinner("Validating API Access Token");
|
|
108
|
-
const isValid = await tailscale.validateApiKey();
|
|
109
|
-
if (!isValid) {
|
|
110
|
-
validateSpinner.fail("Invalid API Access Token");
|
|
111
|
-
return out.die("Failed to Validate Tailscale API Access Token");
|
|
112
|
-
}
|
|
113
|
-
validateSpinner.success("API Access Token Validated");
|
|
114
|
-
await credentials.setTailscaleApiKey(apiKey);
|
|
115
|
-
// ==========================================================================
|
|
116
|
-
// Step 2.5: Check tagOwners
|
|
117
|
-
// ==========================================================================
|
|
118
|
-
const tagOwnerSpinner = out.spinner(`Checking tagOwners for ${tag}`);
|
|
119
|
-
const hasTagOwner = await tailscale.isTagOwnerConfigured(tag);
|
|
120
|
-
if (!hasTagOwner) {
|
|
121
|
-
tagOwnerSpinner.fail(`Tag ${tag} Not Configured in tagOwners`);
|
|
122
|
-
out.blank()
|
|
123
|
-
.text(` The Tag ${tag} Does Not Exist in Your Tailscale ACL tagOwners.`)
|
|
124
|
-
.text(" Tailscale Will Reject Auth Keys for Undefined Tags.")
|
|
125
|
-
.blank()
|
|
126
|
-
.text(" Add This Tag in Your Tailscale ACL Settings:")
|
|
127
|
-
.dim(" https://login.tailscale.com/admin/acls/visual/tags")
|
|
128
|
-
.blank()
|
|
129
|
-
.dim(` "tagOwners": { "${tag}": ["autogroup:admin"] }`)
|
|
130
|
-
.blank();
|
|
131
|
-
return out.die(`Add ${tag} to tagOwners Before Creating Router`);
|
|
132
|
-
}
|
|
133
|
-
tagOwnerSpinner.success(`Tag ${tag} Configured in tagOwners`);
|
|
134
|
-
out.blank();
|
|
135
|
-
// ==========================================================================
|
|
136
|
-
// Step 3: Deploy Router on Custom 6PN
|
|
137
|
-
// ==========================================================================
|
|
138
|
-
let hasAutoApprover = false;
|
|
139
|
-
out.header("Step 3: Deploy Subnet Router").blank();
|
|
140
|
-
const suffix = randomId(8);
|
|
141
|
-
const routerAppName = getRouterAppName(network, suffix);
|
|
142
|
-
out.info(`Creating Router App: ${routerAppName}`)
|
|
143
|
-
.info(`Custom Network: ${network}`)
|
|
144
|
-
.info(`Router Tag: ${tag}`);
|
|
145
|
-
await fly.createApp(routerAppName, org, { network });
|
|
146
|
-
out.ok(`Created App: ${routerAppName}`);
|
|
147
|
-
const authKeySpinner = out.spinner("Creating Tag-Scoped Auth Key");
|
|
148
|
-
const authKey = await tailscale.createAuthKey({
|
|
149
|
-
reusable: false,
|
|
150
|
-
ephemeral: false,
|
|
151
|
-
preauthorized: true,
|
|
152
|
-
tags: [tag],
|
|
153
|
-
});
|
|
154
|
-
authKeySpinner.success("Auth Key Created (Single-Use, 5min Expiry)");
|
|
155
|
-
await fly.setSecrets(routerAppName, {
|
|
156
|
-
TAILSCALE_AUTHKEY: authKey,
|
|
157
|
-
NETWORK_NAME: network,
|
|
158
|
-
ROUTER_ID: suffix,
|
|
159
|
-
}, { stage: true });
|
|
160
|
-
out.ok("Set Router Secrets");
|
|
161
|
-
const dockerDir = new URL("../../docker/router", globalThis[Symbol.for("import-meta-ponyfill-esmodule")](import.meta).url).pathname;
|
|
162
|
-
out.blank().dim("Deploying Router...");
|
|
163
|
-
try {
|
|
164
|
-
await fly.routerDeploy(routerAppName, dockerDir, { region });
|
|
165
|
-
}
|
|
166
|
-
catch (e) {
|
|
167
|
-
if (e instanceof FlyDeployError) {
|
|
168
|
-
out.dim(` ${e.detail}`);
|
|
169
|
-
return out.die(e.message);
|
|
170
|
-
}
|
|
171
|
-
throw e;
|
|
172
|
-
}
|
|
173
|
-
out.ok("Router Deployed");
|
|
174
|
-
// ==========================================================================
|
|
175
|
-
// Step 4: Wait for Router, Approve Routes, Configure DNS
|
|
176
|
-
// ==========================================================================
|
|
177
|
-
let device = null;
|
|
178
|
-
let routerMachine;
|
|
179
|
-
let subnet = null;
|
|
180
|
-
if (shouldApprove) {
|
|
181
|
-
out.blank();
|
|
182
|
-
const joinSpinner = out.spinner("Waiting for Router to Join Tailnet");
|
|
183
|
-
device = await waitForDevice(tailscale, routerAppName, 180000);
|
|
184
|
-
joinSpinner.success(`Router Joined Tailnet: ${device.addresses[0]}`);
|
|
185
|
-
const machines = await fly.listMachines(routerAppName);
|
|
186
|
-
routerMachine = machines.find((m) => m.private_ip);
|
|
187
|
-
subnet = routerMachine?.private_ip
|
|
188
|
-
? extractSubnet(routerMachine.private_ip)
|
|
189
|
-
: null;
|
|
190
|
-
if (subnet) {
|
|
191
|
-
out.ok(`Subnet: ${subnet}`);
|
|
192
|
-
hasAutoApprover = await tailscale.isAutoApproverConfigured(tag);
|
|
193
|
-
if (!hasAutoApprover) {
|
|
194
|
-
const approveSpinner = out.spinner("Approving Subnet Routes");
|
|
195
|
-
await tailscale.approveSubnetRoutes(device.id, [subnet]);
|
|
196
|
-
approveSpinner.success("Subnet Routes Approved");
|
|
197
|
-
}
|
|
198
|
-
else {
|
|
199
|
-
out.ok("Routes Auto-Approved via ACL Policy");
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
if (device.advertisedRoutes && device.advertisedRoutes.length > 0) {
|
|
203
|
-
out.ok(`Routes: ${device.advertisedRoutes.join(", ")}`);
|
|
204
|
-
}
|
|
205
|
-
const dnsSpinner = out.spinner("Configuring Split DNS");
|
|
206
|
-
await tailscale.setSplitDns(network, [device.addresses[0]]);
|
|
207
|
-
dnsSpinner.success(`Split DNS Configured: *.${network} -> Router`);
|
|
208
|
-
// ========================================================================
|
|
209
|
-
// Step 5: Local Client Configuration
|
|
210
|
-
// ========================================================================
|
|
211
|
-
out.blank().header("Step 5: Local Client Configuration").blank();
|
|
212
|
-
if (await isTailscaleInstalled()) {
|
|
213
|
-
if (await isAcceptRoutesEnabled()) {
|
|
214
|
-
out.ok("Accept Routes Already Enabled");
|
|
215
|
-
}
|
|
216
|
-
else {
|
|
217
|
-
const routeSpinner = out.spinner("Enabling Accept Routes");
|
|
218
|
-
if (await enableAcceptRoutes()) {
|
|
219
|
-
routeSpinner.success("Accept Routes Enabled");
|
|
220
|
-
}
|
|
221
|
-
else {
|
|
222
|
-
routeSpinner.fail("Could Not Enable Accept Routes");
|
|
223
|
-
out.blank()
|
|
224
|
-
.dim("Run Manually With Elevated Permissions:")
|
|
225
|
-
.dim(" sudo tailscale set --accept-routes");
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
else {
|
|
230
|
-
out.warn("Tailscale CLI Not Found")
|
|
231
|
-
.dim(" Ensure Accept-Routes is Enabled on This Device");
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
else {
|
|
235
|
-
out.blank().info("Skipping Route Approval and DNS Configuration (Use ambit doctor to Verify Later)");
|
|
236
|
-
}
|
|
237
|
-
// ==========================================================================
|
|
238
|
-
// Done
|
|
239
|
-
// ==========================================================================
|
|
240
|
-
out.done({
|
|
241
|
-
network,
|
|
242
|
-
router: {
|
|
243
|
-
appName: routerAppName,
|
|
244
|
-
tailscaleIp: device?.addresses[0] ?? "pending",
|
|
245
|
-
},
|
|
246
|
-
subnet: subnet || "pending",
|
|
247
|
-
tag,
|
|
248
|
-
});
|
|
249
|
-
out.blank()
|
|
250
|
-
.header("=".repeat(50))
|
|
251
|
-
.header(" Router Created!")
|
|
252
|
-
.header("=".repeat(50))
|
|
253
|
-
.blank()
|
|
254
|
-
.text(`Any Flycast app on the "${network}" network is reachable as:`)
|
|
255
|
-
.text(` <app-name>.${network}`)
|
|
256
|
-
.blank();
|
|
257
|
-
if (routerMachine?.private_ip) {
|
|
258
|
-
out.text("SOCKS5 Proxy Available at:")
|
|
259
|
-
.text(` socks5://[${routerMachine.private_ip}]:1080`)
|
|
260
|
-
.dim("Containers on This Network Can Use It to Reach Your Tailnet.")
|
|
261
|
-
.blank();
|
|
262
|
-
}
|
|
263
|
-
out.dim("Deploy an App to This Network:")
|
|
264
|
-
.dim(` ambit deploy my-app --network ${network}`)
|
|
265
|
-
.blank()
|
|
266
|
-
.dim("Invite People to Your Tailnet:")
|
|
267
|
-
.dim(" https://login.tailscale.com/admin/users")
|
|
268
|
-
.dim("Control Their Access:")
|
|
269
|
-
.dim(" https://login.tailscale.com/admin/acls/visual/general-access-rules")
|
|
270
|
-
.blank();
|
|
271
|
-
if (subnet && !hasAutoApprover) {
|
|
272
|
-
out.header("Recommended: Configure autoApprovers")
|
|
273
|
-
.blank()
|
|
274
|
-
.dim(" Add to Your Tailnet Policy File at:")
|
|
275
|
-
.dim(" https://login.tailscale.com/admin/acls/file")
|
|
276
|
-
.blank()
|
|
277
|
-
.text(` "autoApprovers": { "routes": { "${subnet}": ["${tag}"] } }`)
|
|
278
|
-
.blank()
|
|
279
|
-
.dim(" Routes Were Approved via API for This Session.")
|
|
280
|
-
.dim(" autoApprovers Will Auto-Approve on Future Restarts.")
|
|
281
|
-
.blank();
|
|
282
|
-
}
|
|
283
|
-
if (subnet) {
|
|
284
|
-
out.header("Recommended ACL Rules:")
|
|
285
|
-
.blank()
|
|
286
|
-
.dim(" To Restrict Access, Add ACL Rules to Your Policy File:")
|
|
287
|
-
.dim(" https://login.tailscale.com/admin/acls/file")
|
|
288
|
-
.blank()
|
|
289
|
-
.dim(` {"action": "accept", "src": ["group:YOUR_GROUP"], "dst": ["${tag}:53"]}`)
|
|
290
|
-
.dim(` {"action": "accept", "src": ["group:YOUR_GROUP"], "dst": ["${subnet}:*"]}`)
|
|
291
|
-
.blank();
|
|
292
|
-
}
|
|
293
|
-
if (!shouldApprove) {
|
|
294
|
-
out.dim("Route Approval Was Skipped. To Complete Setup:")
|
|
295
|
-
.dim(` ambit doctor --network ${network}`)
|
|
296
|
-
.blank();
|
|
297
|
-
}
|
|
298
|
-
out.print();
|
|
299
|
-
};
|
|
300
|
-
// =============================================================================
|
|
301
|
-
// Register Command
|
|
302
|
-
// =============================================================================
|
|
303
|
-
registerCommand({
|
|
304
|
-
name: "create",
|
|
305
|
-
description: "Create a Tailscale subnet router on a Fly.io custom network",
|
|
306
|
-
usage: "ambit create <network> [--org <org>] [--region <region>]",
|
|
307
|
-
run: create,
|
|
308
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../../../src/src/cli/commands/deploy.ts"],"names":[],"mappings":""}
|