anywhere-ai 0.0.21 → 0.0.22
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/cli.js +13 -13
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -11,7 +11,7 @@ import readline from "readline";
|
|
|
11
11
|
import qrcode from "qrcode";
|
|
12
12
|
var args = process.argv.slice(2);
|
|
13
13
|
if (args.includes("--version") || args.includes("-v")) {
|
|
14
|
-
console.log(`anywhere-ai v${"0.0.
|
|
14
|
+
console.log(`anywhere-ai v${"0.0.22"}`);
|
|
15
15
|
process.exit(0);
|
|
16
16
|
}
|
|
17
17
|
function ask(question, preserveCase = false) {
|
|
@@ -173,7 +173,7 @@ var isVPS = publicIP && localIP && publicIP !== localIP;
|
|
|
173
173
|
await import("./server-SPM3PZ5G.js");
|
|
174
174
|
var tunnelURL = null;
|
|
175
175
|
var tunnelProcess = null;
|
|
176
|
-
async function printBanner(serverURL2) {
|
|
176
|
+
async function printBanner(serverURL2, localURL2) {
|
|
177
177
|
const qrData = `${serverURL2}#${config.authToken}`;
|
|
178
178
|
console.log(`
|
|
179
179
|
____ ____ ____ ____ ____ ____ ____ ____
|
|
@@ -182,8 +182,11 @@ async function printBanner(serverURL2) {
|
|
|
182
182
|
|/__\\|/__\\|/__\\|/__\\|/__\\|/__\\|/__\\|/__\\|
|
|
183
183
|
`);
|
|
184
184
|
console.log("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500");
|
|
185
|
-
console.log("
|
|
186
|
-
|
|
185
|
+
console.log(" Tunnel: " + serverURL2);
|
|
186
|
+
if (localURL2 && localURL2 !== serverURL2) {
|
|
187
|
+
console.log(" Direct: " + localURL2);
|
|
188
|
+
}
|
|
189
|
+
console.log(" Token: " + config.authToken);
|
|
187
190
|
console.log("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500");
|
|
188
191
|
console.log();
|
|
189
192
|
console.log(" Scan this QR code in the Anywhere app:");
|
|
@@ -194,6 +197,9 @@ async function printBanner(serverURL2) {
|
|
|
194
197
|
}
|
|
195
198
|
console.log();
|
|
196
199
|
console.log(" Or enter the URL and token manually in Settings.");
|
|
200
|
+
if (localURL2 && localURL2 !== serverURL2) {
|
|
201
|
+
console.log(" Tunnel URL changes on restart. Direct URL stays the same.");
|
|
202
|
+
}
|
|
197
203
|
if (isVPS) {
|
|
198
204
|
console.log(" Make sure port " + port + " is open in your firewall.");
|
|
199
205
|
}
|
|
@@ -248,15 +254,9 @@ if (!args.includes("--no-tunnel")) {
|
|
|
248
254
|
}
|
|
249
255
|
}
|
|
250
256
|
}
|
|
251
|
-
var
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
} else if (isVPS) {
|
|
255
|
-
serverURL = "http://" + publicIP + ":" + port;
|
|
256
|
-
} else {
|
|
257
|
-
serverURL = "http://" + (localIP || "localhost") + ":" + port;
|
|
258
|
-
}
|
|
259
|
-
await printBanner(serverURL);
|
|
257
|
+
var localURL = isVPS ? "http://" + publicIP + ":" + port : "http://" + (localIP || "localhost") + ":" + port;
|
|
258
|
+
var serverURL = tunnelURL || localURL;
|
|
259
|
+
await printBanner(serverURL, localURL);
|
|
260
260
|
function cleanup() {
|
|
261
261
|
if (tunnelProcess) {
|
|
262
262
|
tunnelProcess.kill();
|