@syengup/friday-channel-next 0.0.10 → 0.0.11

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 -3
  2. package/install.sh +16 -3
  3. package/package.json +1 -1
package/install.js CHANGED
@@ -260,7 +260,21 @@ 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 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;
272
+ }
273
+ const ip = new URL(gatewayUrl).hostname;
274
+ if (isPrivateIp(ip)) {
275
+ log("This is a LOCAL network URL (" + ip + ", bind=" + bindMode + ").");
276
+ log("If you need public access, configure HTTPS, Tailscale, or a reverse proxy.");
277
+ } else {
278
+ log("This URL appears to be publicly accessible (" + ip + ").");
279
+ }
266
280
  log("--------------------------------------------------");
package/install.sh CHANGED
@@ -232,9 +232,22 @@ 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 isPrivateIp(ip) {
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;
244
+ }
245
+ if (isPrivateIp(host)) {
246
+ console.log("This is a LOCAL network URL (" + host + ", bind=" + bind + ").");
247
+ console.log("If you need public access, configure HTTPS, Tailscale, or a reverse proxy.");
248
+ } else {
249
+ console.log("This URL appears to be publicly accessible (" + host + ").");
250
+ }
238
251
  ' "$OPENCLAW_CONFIG"
239
252
 
240
253
  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.11",
4
4
  "description": "OpenClaw Friday Next Apple channel plugin",
5
5
  "type": "module",
6
6
  "files": [