@decentnetwork/lan 0.1.202 → 0.1.204

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.
@@ -743,7 +743,13 @@ export class DaemonServer {
743
743
  identity: this.peerManager?.getIdentity(),
744
744
  node: { name: this.config.node.name, statusMessage: this.config.node.statusMessage ?? "" },
745
745
  tun: this.tunDevice?.getConfig(),
746
- allocatedIp: this.doraIntegration?.getAllocatedIp() ?? this.config.network.ip,
746
+ // When Dora is unavailable, config.network.ip can still be the
747
+ // init placeholder (10.86.1.10). The TUN holds the deterministic
748
+ // fallback actually configured on the host, so report that live
749
+ // address rather than a value the node cannot route.
750
+ allocatedIp: this.doraIntegration?.getAllocatedIp() ??
751
+ this.tunDevice?.getConfig().ip ??
752
+ this.config.network.ip,
747
753
  dht: this.peerManager?.getDhtHealth() ?? null,
748
754
  dns: this.dnsServer
749
755
  ? { domain: this.dnsServer.getDomain(), port: this.dnsServer.getBoundPort() }
@@ -1564,7 +1570,9 @@ export class DaemonServer {
1564
1570
  // handles it). Pass the TUN IP so macOS cleanup also removes
1565
1571
  // the lo0 self-alias.
1566
1572
  const ifname = this.tunDevice?.getInterface() || this.config.network.interface;
1567
- const ip = this.doraIntegration?.getAllocatedIp() ?? this.config.network.ip;
1573
+ const ip = this.doraIntegration?.getAllocatedIp() ??
1574
+ this.tunDevice?.getConfig().ip ??
1575
+ this.config.network.ip;
1568
1576
  await this.routeManager.cleanup(ifname, this.config.network.subnet, ip);
1569
1577
  }
1570
1578
  }
@@ -1515,14 +1515,12 @@ function CopyBtn({ value, copiedText = "Copied", copyFailedText = "Copy failed",
1515
1515
  return /* @__PURE__ */ React.createElement("span", { "aria-live": "polite", style: { display: "inline-flex", flexShrink: 0 } }, /* @__PURE__ */ React.createElement(
1516
1516
  Btn,
1517
1517
  {
1518
- icon: status === "copied" ? "check" : "copy",
1518
+ icon: status === "copied" ? "check" : status === "failed" ? "x" : "copy",
1519
1519
  tone: status === "copied" ? "ok" : status === "failed" ? "danger" : "ghost",
1520
1520
  size: "sm",
1521
1521
  title: status ? message : copyTitle,
1522
- onClick: onCopy,
1523
- style: { minWidth: 82 }
1524
- },
1525
- status ? message : copyTitle
1522
+ onClick: onCopy
1523
+ }
1526
1524
  ));
1527
1525
  }
1528
1526
  function FieldRow({ T, label, value, mono = true, copy, qr, onQr, last }) {
package/dist/ui/server.js CHANGED
@@ -432,7 +432,9 @@ export function startFriendUi(opts) {
432
432
  const me = {
433
433
  userid: identity.userid,
434
434
  address: identity.address,
435
- ip: d.allocatedIp ?? tun.ip,
435
+ // The configured TUN address is what this host can actually route.
436
+ // Prefer it over a stale init/default allocation during Dora outage.
437
+ ip: tun.ip ?? d.allocatedIp,
436
438
  installed: !!tun.ip, // lan/TUN is up
437
439
  };
438
440
  const friends = d.friends ?? [];
@@ -488,7 +490,7 @@ export function startFriendUi(opts) {
488
490
  userId: identity.userid ?? "",
489
491
  carrier: identity.address ?? "",
490
492
  netKey: identity.userid ?? "",
491
- ip: d.allocatedIp ?? tun.ip ?? "",
493
+ ip: tun.ip ?? d.allocatedIp ?? "",
492
494
  online: !!tun.ip,
493
495
  lanVer: opts.meExtra?.lanVer ?? "",
494
496
  peerVer: opts.meExtra?.peerVer ?? "",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decentnetwork/lan",
3
- "version": "0.1.202",
3
+ "version": "0.1.204",
4
4
  "description": "Private virtual LAN for self-hosted services and AI agents, built on Elastos Carrier. NAT-traversal, name service, ACL, all over a peer-to-peer mesh — no public IP required.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -84,7 +84,7 @@
84
84
  },
85
85
  "dependencies": {
86
86
  "@decentnetwork/dora": "^0.1.13",
87
- "@decentnetwork/peer": "^0.1.94",
87
+ "@decentnetwork/peer": "^0.1.95",
88
88
  "@decentnetwork/peer-webrtc": "^0.2.10",
89
89
  "ink": "^5.2.1",
90
90
  "js-yaml": "^4.1.0",