@syengup/friday-channel-next 0.0.11 → 0.0.12
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/install.js +17 -10
- package/install.sh +15 -9
- package/package.json +1 -1
package/install.js
CHANGED
|
@@ -260,20 +260,27 @@ log("");
|
|
|
260
260
|
log("Gateway URL: " + BOLD_YELLOW(gatewayUrl));
|
|
261
261
|
log("Bearer Token: " + BOLD_YELLOW(gatewayToken));
|
|
262
262
|
log("");
|
|
263
|
-
function
|
|
264
|
-
const
|
|
265
|
-
if (
|
|
266
|
-
if (
|
|
267
|
-
if (
|
|
268
|
-
if (
|
|
269
|
-
if (
|
|
270
|
-
if (
|
|
271
|
-
return
|
|
263
|
+
function classifyIp(ip) {
|
|
264
|
+
const p = ip.split(".").map(Number);
|
|
265
|
+
if (p[0] === 100 && p[1] >= 64 && p[1] <= 127) return "tailscale";
|
|
266
|
+
if (p[0] === 127) return "loopback";
|
|
267
|
+
if (p[0] === 10) return "private";
|
|
268
|
+
if (p[0] === 172 && p[1] >= 16 && p[1] <= 31) return "private";
|
|
269
|
+
if (p[0] === 192 && p[1] === 168) return "private";
|
|
270
|
+
if (p[0] === 169 && p[1] === 254) return "private";
|
|
271
|
+
return "public";
|
|
272
272
|
}
|
|
273
273
|
const ip = new URL(gatewayUrl).hostname;
|
|
274
|
-
|
|
274
|
+
const ipType = classifyIp(ip);
|
|
275
|
+
if (ipType === "tailscale") {
|
|
276
|
+
log("This is a Tailscale network URL (" + ip + ").");
|
|
277
|
+
log("Accessible from your Tailnet devices.");
|
|
278
|
+
} else if (ipType === "private") {
|
|
275
279
|
log("This is a LOCAL network URL (" + ip + ", bind=" + bindMode + ").");
|
|
276
280
|
log("If you need public access, configure HTTPS, Tailscale, or a reverse proxy.");
|
|
281
|
+
} else if (ipType === "loopback") {
|
|
282
|
+
log("This is a LOOPBACK URL (" + ip + ").");
|
|
283
|
+
log("Only accessible from this machine.");
|
|
277
284
|
} else {
|
|
278
285
|
log("This URL appears to be publicly accessible (" + ip + ").");
|
|
279
286
|
}
|
package/install.sh
CHANGED
|
@@ -232,19 +232,25 @@ console.log("");
|
|
|
232
232
|
console.log("Gateway URL: " + YB + "http://" + host + ":" + port + N);
|
|
233
233
|
console.log("Bearer Token: " + YB + token + N);
|
|
234
234
|
console.log("");
|
|
235
|
-
function
|
|
235
|
+
function classifyIp(ip) {
|
|
236
236
|
var p = ip.split(".").map(Number);
|
|
237
|
-
if (p[0] === 127) return
|
|
238
|
-
if (p[0] ===
|
|
239
|
-
if (p[0] ===
|
|
240
|
-
if (p[0] ===
|
|
241
|
-
if (p[0] ===
|
|
242
|
-
if (p[0] ===
|
|
243
|
-
return
|
|
237
|
+
if (p[0] === 100 && p[1] >= 64 && p[1] <= 127) return "tailscale";
|
|
238
|
+
if (p[0] === 127) return "loopback";
|
|
239
|
+
if (p[0] === 10) return "private";
|
|
240
|
+
if (p[0] === 172 && p[1] >= 16 && p[1] <= 31) return "private";
|
|
241
|
+
if (p[0] === 192 && p[1] === 168) return "private";
|
|
242
|
+
if (p[0] === 169 && p[1] === 254) return "private";
|
|
243
|
+
return "public";
|
|
244
244
|
}
|
|
245
|
-
if (
|
|
245
|
+
if (classifyIp(host) === "tailscale") {
|
|
246
|
+
console.log("This is a Tailscale network URL (" + host + ").");
|
|
247
|
+
console.log("Accessible from your Tailnet devices.");
|
|
248
|
+
} else if (classifyIp(host) === "private") {
|
|
246
249
|
console.log("This is a LOCAL network URL (" + host + ", bind=" + bind + ").");
|
|
247
250
|
console.log("If you need public access, configure HTTPS, Tailscale, or a reverse proxy.");
|
|
251
|
+
} else if (classifyIp(host) === "loopback") {
|
|
252
|
+
console.log("This is a LOOPBACK URL (" + host + ").");
|
|
253
|
+
console.log("Only accessible from this machine.");
|
|
248
254
|
} else {
|
|
249
255
|
console.log("This URL appears to be publicly accessible (" + host + ").");
|
|
250
256
|
}
|