buildwithnexus 0.4.2 → 0.4.3
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/bin.js +10 -10
- package/dist/nexus-release.tar.gz +0 -0
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -524,8 +524,10 @@ async function launchVm(platform, diskPath, initIsoPath, ram, cpus, ports) {
|
|
|
524
524
|
];
|
|
525
525
|
try {
|
|
526
526
|
await execa(platform.qemuBinary, buildArgs(platform.qemuCpuFlag.split(" ")), { env: scrubEnv() });
|
|
527
|
+
process.stderr.write(" [vm] Hardware acceleration (HVF) active\n");
|
|
527
528
|
} catch {
|
|
528
529
|
const fallbackCpu = platform.os === "mac" ? ["-cpu", "max"] : ["-cpu", "qemu64"];
|
|
530
|
+
process.stderr.write(" [vm] WARNING: HVF unavailable \u2014 using software emulation (VM will be slower)\n");
|
|
529
531
|
await execa(platform.qemuBinary, buildArgs(fallbackCpu), { env: scrubEnv() });
|
|
530
532
|
}
|
|
531
533
|
return ports;
|
|
@@ -671,7 +673,7 @@ function addSshConfig(port) {
|
|
|
671
673
|
fs4.writeFileSync(sshConfigPath, block, { mode: 384 });
|
|
672
674
|
}
|
|
673
675
|
}
|
|
674
|
-
async function waitForSsh(port, timeoutMs =
|
|
676
|
+
async function waitForSsh(port, timeoutMs = 9e5) {
|
|
675
677
|
const start = Date.now();
|
|
676
678
|
while (Date.now() - start < timeoutMs) {
|
|
677
679
|
try {
|
|
@@ -681,13 +683,13 @@ async function waitForSsh(port, timeoutMs = 3e5) {
|
|
|
681
683
|
port,
|
|
682
684
|
username: "nexus",
|
|
683
685
|
privateKeyPath: SSH_KEY,
|
|
684
|
-
readyTimeout:
|
|
686
|
+
readyTimeout: 1e4,
|
|
685
687
|
hostVerifier: getHostVerifier()
|
|
686
688
|
});
|
|
687
689
|
ssh.dispose();
|
|
688
690
|
return true;
|
|
689
691
|
} catch {
|
|
690
|
-
await new Promise((r) => setTimeout(r,
|
|
692
|
+
await new Promise((r) => setTimeout(r, 1e4));
|
|
691
693
|
}
|
|
692
694
|
}
|
|
693
695
|
return false;
|
|
@@ -1115,14 +1117,12 @@ async function installCloudflared(sshPort, arch) {
|
|
|
1115
1117
|
].join(" && "));
|
|
1116
1118
|
}
|
|
1117
1119
|
async function startTunnel(sshPort) {
|
|
1118
|
-
await sshExec(
|
|
1119
|
-
|
|
1120
|
-
"&& nohup cloudflared tunnel --no-autoupdate --url http://localhost:4200"
|
|
1121
|
-
|
|
1122
|
-
"disown"
|
|
1123
|
-
].join(" "));
|
|
1120
|
+
await sshExec(
|
|
1121
|
+
sshPort,
|
|
1122
|
+
"install -m 600 /dev/null /home/nexus/.nexus/tunnel.log && bash -c 'nohup cloudflared tunnel --no-autoupdate --url http://localhost:4200 > /home/nexus/.nexus/tunnel.log 2>&1 &'"
|
|
1123
|
+
);
|
|
1124
1124
|
const start = Date.now();
|
|
1125
|
-
while (Date.now() - start <
|
|
1125
|
+
while (Date.now() - start < 12e4) {
|
|
1126
1126
|
try {
|
|
1127
1127
|
const { stdout } = await sshExec(sshPort, "grep -oE 'https://[a-z0-9-]+\\.trycloudflare\\.com' /home/nexus/.nexus/tunnel.log 2>/dev/null | head -1");
|
|
1128
1128
|
if (stdout.includes("https://")) {
|
|
Binary file
|