asyx 0.9.0 → 0.9.2
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/README.md +11 -1
- package/package.json +1 -1
- package/src/commands/setup.js +1 -1
- package/src/commands/tunnel.js +26 -1
- package/vendor/tunnel-core/dist/flows/tcp.d.ts +7 -0
package/README.md
CHANGED
|
@@ -130,7 +130,7 @@ Names use 3–30 characters: lowercase letters, digits and hyphens, starting and
|
|
|
130
130
|
With `--json`, `asyx setup` prints one JSON object per line on stdout and nothing else:
|
|
131
131
|
|
|
132
132
|
```text
|
|
133
|
-
{"event":"approval_required","url":"https://www.asyx.ai/console/
|
|
133
|
+
{"event":"approval_required","url":"https://www.asyx.ai/console/devices?...","code":"ABC-123","clientId":"cli_…","expiresInSeconds":600}
|
|
134
134
|
{"event":"enrolled","clientId":"cli_…","hostname":"orders-api.tunnel.asyx.ai"}
|
|
135
135
|
```
|
|
136
136
|
|
|
@@ -256,6 +256,16 @@ asyx tunnel --minecraft --to <hostname> [--port <n>] [--name <alias>]
|
|
|
256
256
|
|
|
257
257
|
---
|
|
258
258
|
|
|
259
|
+
## What's new in 0.9.2
|
|
260
|
+
|
|
261
|
+
**Minecraft records follow a moved port** — when a TCP port moves to another of your addresses (`--to slow.tunnel.asyx.ai --external-port 10000`), its Minecraft record moves too, and the CLI says so: `Minecraft players now find it at slow.tunnel.asyx.ai.` If the new address already has a Minecraft record for another port, that one stays and the CLI tells you.
|
|
262
|
+
|
|
263
|
+
## What's new in 0.9.1
|
|
264
|
+
|
|
265
|
+
**The live line names your public address** — an HTTP tunnel now prints `Tunnel live at https://<your address>` and then `Forwarding to http://localhost:<port>`, instead of only the local address.
|
|
266
|
+
|
|
267
|
+
**Approval opens on the Devices page** — the link `asyx setup` prints now opens asyx.ai/console/devices, where the new computer is approved above your device list. Links printed by older versions still work.
|
|
268
|
+
|
|
259
269
|
## What's new in 0.9.0
|
|
260
270
|
|
|
261
271
|
**Pick one of your addresses at setup** — `asyx setup --address <name>` makes one of your account's existing addresses this device's default instead of creating a new one. On a device that is already set up, it changes its default. The approval page also lists your addresses next to "A new address".
|
package/package.json
CHANGED
package/src/commands/setup.js
CHANGED
|
@@ -7,7 +7,7 @@ import { ensureKeyAndCsr } from '../lib/csr.js';
|
|
|
7
7
|
import { loadOrCreateClientId } from '../lib/device.js';
|
|
8
8
|
import { parseSetupArgs, approvalUrl, checkName, describeAnswer, setupCode, EXIT } from '../lib/naming.js';
|
|
9
9
|
|
|
10
|
-
const CONSOLE_URL = process.env.ASYX_CONSOLE_URL || 'https://www.asyx.ai/console/
|
|
10
|
+
const CONSOLE_URL = process.env.ASYX_CONSOLE_URL || 'https://www.asyx.ai/console/devices'; // Story 4.15 c4: approval opens on the Devices page
|
|
11
11
|
const STS_URL = process.env.ASYX_STS_URL || 'https://www.asyx.ai/www/sts';
|
|
12
12
|
// A person has to open the link, maybe sign in, and press Approve (4.7): wait up to 10 minutes.
|
|
13
13
|
const APPROVAL_DEADLINE_MS = Number(process.env.ASYX_SETUP_TIMEOUT_MS || 10 * 60_000);
|
package/src/commands/tunnel.js
CHANGED
|
@@ -620,7 +620,7 @@ async function httpTunnel(localPort, secGroupSlug) {
|
|
|
620
620
|
if (secGroupSlug && assignment.quickpassSlug) {
|
|
621
621
|
process.stdout.write(`🛡️ QuickPass secured (group=${assignment.quickpassSlug})\n`);
|
|
622
622
|
}
|
|
623
|
-
process.stdout.write(
|
|
623
|
+
process.stdout.write(httpLiveLines(assignment, localPort));
|
|
624
624
|
// QPA-CLI-12: Lease and relay info only shown with LOG_LEVEL=info or higher
|
|
625
625
|
const logLevel = (process.env.ASYX_LOG_LEVEL || process.env.LOG_LEVEL || 'warn').toLowerCase();
|
|
626
626
|
if (logLevel === 'info' || logLevel === 'debug') {
|
|
@@ -771,6 +771,8 @@ async function tcpTunnel(localPort, serviceName, kind = null, requestedExternalP
|
|
|
771
771
|
handle.on('assigned', ({ tcpAliasFqdn, srvProvisioned, srvFqdn, fqdn, publicPort, aliasRequestedButFailed, portMoved }) => {
|
|
772
772
|
// Story 2.11 c3: naming a port labelled for another address moved its label here
|
|
773
773
|
if (portMoved?.from) process.stdout.write(`Port ${portMoved.port} moved from ${portMoved.from} to ${portMoved.to}.\n`);
|
|
774
|
+
const mc = minecraftMoveLine(portMoved); // Story 1.7 r8
|
|
775
|
+
if (mc) process.stdout.write(mc);
|
|
774
776
|
if (tcpAliasFqdn) {
|
|
775
777
|
process.stdout.write(`Your TCP server is available at:\n\n`);
|
|
776
778
|
process.stdout.write(` ${tcpAliasFqdn}\n`);
|
|
@@ -984,3 +986,26 @@ async function udpTunnel(targetPort, requestedExternalPort = null, targetHost =
|
|
|
984
986
|
function sleep(ms) { return new Promise(r => setTimeout(r, ms)); }
|
|
985
987
|
|
|
986
988
|
// Story 11.2: exp claim (seconds) of an assignment token, or null
|
|
989
|
+
|
|
990
|
+
/** Defect 11.47: the HTTP live line names the public address visitors use, then the local port. */
|
|
991
|
+
export function httpLiveLines(assignment, localPort) {
|
|
992
|
+
const publicHost = typeof assignment?.fqdn === 'string' && assignment.fqdn.trim() ? assignment.fqdn.trim() : null;
|
|
993
|
+
return publicHost
|
|
994
|
+
? `🌐 Tunnel live at https://${publicHost}\n Forwarding to http://localhost:${localPort}\n`
|
|
995
|
+
: `🌐 Tunnel live at http://localhost:${localPort}\n`;
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
/** Story 1.7 r8: what happened to the port's Minecraft record when its label moved (TCP). */
|
|
999
|
+
export function minecraftMoveLine(portMoved) {
|
|
1000
|
+
const m = portMoved?.minecraft;
|
|
1001
|
+
if (!portMoved?.from || !m) return '';
|
|
1002
|
+
const to = portMoved.toHostname || portMoved.to;
|
|
1003
|
+
const from = portMoved.fromHostname || portMoved.from;
|
|
1004
|
+
switch (m.status) {
|
|
1005
|
+
case 'moved': return `Minecraft players now find it at ${to}. For a few minutes ${from} may still lead there.\n`;
|
|
1006
|
+
case 'kept_existing': return `${to} already points Minecraft players at port ${m.existingPort}, so that stays. The Minecraft record for port ${portMoved.port} under ${from} was removed.\n`;
|
|
1007
|
+
case 'pending': return `The Minecraft record is not updated yet; it follows within a few minutes.\n`;
|
|
1008
|
+
case 'not_updated': return `The Minecraft record for port ${portMoved.port} could not be moved to ${to}. Players can still connect with ${to}:${portMoved.port}.\n`;
|
|
1009
|
+
default: return '';
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
@@ -35,6 +35,13 @@ export type TcpAssignedEvent = {
|
|
|
35
35
|
kind: string;
|
|
36
36
|
from: string;
|
|
37
37
|
to: string;
|
|
38
|
+
fromHostname?: string | null;
|
|
39
|
+
toHostname?: string | null;
|
|
40
|
+
/** Story 1.7 r8: what happened to the port's Minecraft record */
|
|
41
|
+
minecraft?: {
|
|
42
|
+
status: 'moved' | 'nothing' | 'kept_existing' | 'pending' | 'not_updated';
|
|
43
|
+
existingPort?: number | null;
|
|
44
|
+
} | null;
|
|
38
45
|
} | null;
|
|
39
46
|
};
|
|
40
47
|
/** What open() resolves to and the 'live' state carries. */
|