@syengup/friday-channel-next 0.0.10 → 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 +24 -3
  2. package/install.sh +22 -3
  3. package/package.json +1 -1
package/install.js CHANGED
@@ -260,7 +260,28 @@ log("");
260
260
  log("Gateway URL: " + BOLD_YELLOW(gatewayUrl));
261
261
  log("Bearer Token: " + BOLD_YELLOW(gatewayToken));
262
262
  log("");
263
- log("This is a LOCAL network URL (bind=" + bindMode + ").");
264
- log("If you need a public URL for remote access, configure it");
265
- log("via HTTPS, Tailscale, or a reverse proxy yourself.");
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
+ }
273
+ const ip = new URL(gatewayUrl).hostname;
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") {
279
+ log("This is a LOCAL network URL (" + ip + ", bind=" + bindMode + ").");
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.");
284
+ } else {
285
+ log("This URL appears to be publicly accessible (" + ip + ").");
286
+ }
266
287
  log("--------------------------------------------------");
package/install.sh CHANGED
@@ -232,9 +232,28 @@ 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
- console.log("This is a LOCAL network URL (bind=" + bind + ").");
236
- console.log("If you need a public URL for remote access, configure it");
237
- console.log("via HTTPS, Tailscale, or a reverse proxy yourself.");
235
+ function classifyIp(ip) {
236
+ var p = ip.split(".").map(Number);
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
+ }
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") {
249
+ console.log("This is a LOCAL network URL (" + host + ", bind=" + bind + ").");
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.");
254
+ } else {
255
+ console.log("This URL appears to be publicly accessible (" + host + ").");
256
+ }
238
257
  ' "$OPENCLAW_CONFIG"
239
258
 
240
259
  log "--------------------------------------------------"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syengup/friday-channel-next",
3
- "version": "0.0.10",
3
+ "version": "0.0.12",
4
4
  "description": "OpenClaw Friday Next Apple channel plugin",
5
5
  "type": "module",
6
6
  "files": [