@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.
Files changed (3) hide show
  1. package/install.js +17 -10
  2. package/install.sh +15 -9
  3. 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 isPrivateIp(ip) {
264
- const parts = ip.split(".").map(Number);
265
- if (parts[0] === 127) return true; // loopback
266
- if (parts[0] === 10) return true; // RFC 1918
267
- if (parts[0] === 172 && parts[1] >= 16 && parts[1] <= 31) return true; // RFC 1918
268
- if (parts[0] === 192 && parts[1] === 168) return true; // RFC 1918
269
- if (parts[0] === 169 && parts[1] === 254) return true; // link-local
270
- if (parts[0] === 100 && parts[1] >= 64 && parts[1] <= 127) return true; // CGNAT / Tailscale
271
- return false;
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
- if (isPrivateIp(ip)) {
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 isPrivateIp(ip) {
235
+ function classifyIp(ip) {
236
236
  var p = ip.split(".").map(Number);
237
- if (p[0] === 127) return true;
238
- if (p[0] === 10) return true;
239
- if (p[0] === 172 && p[1] >= 16 && p[1] <= 31) return true;
240
- if (p[0] === 192 && p[1] === 168) return true;
241
- if (p[0] === 169 && p[1] === 254) return true;
242
- if (p[0] === 100 && p[1] >= 64 && p[1] <= 127) return true;
243
- return false;
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 (isPrivateIp(host)) {
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syengup/friday-channel-next",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "description": "OpenClaw Friday Next Apple channel plugin",
5
5
  "type": "module",
6
6
  "files": [