@decentnetwork/lan 0.1.203 → 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.
- package/dist/daemon/server.js +10 -2
- package/dist/ui/server.js +4 -2
- package/package.json +1 -1
package/dist/daemon/server.js
CHANGED
|
@@ -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
|
-
|
|
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() ??
|
|
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
|
}
|
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
|
-
|
|
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:
|
|
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.
|
|
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",
|