@decentnetwork/lan 0.1.6 → 0.1.8
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/bin/tun-helper-darwin-amd64 +0 -0
- package/bin/tun-helper-darwin-arm64 +0 -0
- package/bin/tun-helper-linux-amd64 +0 -0
- package/bin/tun-helper-linux-arm64 +0 -0
- package/dist/config/loader.js +7 -5
- package/dist/daemon/server.js +12 -6
- package/dist/dora/dora-integration.js +10 -8
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/config/loader.js
CHANGED
|
@@ -108,11 +108,13 @@ export class ConfigLoader {
|
|
|
108
108
|
enabled: false,
|
|
109
109
|
userids: [],
|
|
110
110
|
refreshIntervalMs: 60_000,
|
|
111
|
-
// Default:
|
|
112
|
-
//
|
|
113
|
-
//
|
|
114
|
-
//
|
|
115
|
-
|
|
111
|
+
// Default: auto-friend every peer in the dora roster. Dora
|
|
112
|
+
// membership IS the trust statement — joining a dora means
|
|
113
|
+
// "I want to be on this network", and a single-tenant lab is
|
|
114
|
+
// the common case. Operators on a multi-tenant / public
|
|
115
|
+
// dora opt out with `agentnet dora autofriend none` or
|
|
116
|
+
// whitelist via `agentnet dora autofriend allow <peer>...`.
|
|
117
|
+
autoFriend: "all",
|
|
116
118
|
},
|
|
117
119
|
};
|
|
118
120
|
}
|
package/dist/daemon/server.js
CHANGED
|
@@ -90,15 +90,21 @@ export class DaemonServer {
|
|
|
90
90
|
// optional dora registration can decide our IP.
|
|
91
91
|
const keyFile = resolve(this.config.carrier.dataDir, "keypair.json");
|
|
92
92
|
this.peerManager = new PeerManager();
|
|
93
|
-
//
|
|
94
|
-
//
|
|
95
|
-
//
|
|
96
|
-
//
|
|
97
|
-
//
|
|
93
|
+
// Use express nodes. Previously the daemon passed an empty array
|
|
94
|
+
// here on the theory that "express is for offline messages, not
|
|
95
|
+
// live packet forwarding". But asymmetric Carrier sessions (peer
|
|
96
|
+
// A thinks B is online, B thinks A is offline — common across
|
|
97
|
+
// China-WAN paths) make dora's sendText reply fail direct and
|
|
98
|
+
// fall back to express; if we don't subscribe to express we
|
|
99
|
+
// never see the response. dora -> cn for register-ok / list-ok
|
|
100
|
+
// hits this exact case. The cost of enabling express here is
|
|
101
|
+
// that idle text messages may take an extra hop through the
|
|
102
|
+
// HTTPS relay — packet-router doesn't use sendText, so its
|
|
103
|
+
// hot path is unaffected.
|
|
98
104
|
await this.peerManager.create({
|
|
99
105
|
keyFile,
|
|
100
106
|
bootstrapNodes: this.config.carrier.bootstrapNodes,
|
|
101
|
-
expressNodes: [],
|
|
107
|
+
expressNodes: this.config.carrier.expressNodes ?? [],
|
|
102
108
|
});
|
|
103
109
|
await this.peerManager.start();
|
|
104
110
|
this.logger.info(`Identity: ${this.peerManager.getAddress()}`);
|
|
@@ -318,14 +318,16 @@ export class DoraIntegration {
|
|
|
318
318
|
this.friendRequested.add(entry.userid);
|
|
319
319
|
return;
|
|
320
320
|
}
|
|
321
|
-
// Policy gate.
|
|
322
|
-
//
|
|
323
|
-
//
|
|
324
|
-
//
|
|
325
|
-
//
|
|
326
|
-
//
|
|
327
|
-
//
|
|
328
|
-
|
|
321
|
+
// Policy gate. The undefined default is "all" because a peer
|
|
322
|
+
// that just joined a dora explicitly said "I want to be on
|
|
323
|
+
// this network" — that's the trust statement. Without "all"
|
|
324
|
+
// as the legacy-config default, new peers can never join an
|
|
325
|
+
// existing mesh: their roster fills up but everyone else's
|
|
326
|
+
// legacy configs (lacking autoFriend) silently refuse to
|
|
327
|
+
// friend them back. Operators on a public / multi-tenant dora
|
|
328
|
+
// can opt out with `agentnet dora autofriend none` or supply
|
|
329
|
+
// a whitelist via `agentnet dora autofriend allow <peer>...`.
|
|
330
|
+
const policy = this.opts.config.autoFriend ?? "all";
|
|
329
331
|
if (!this.policyAllows(entry, policy)) {
|
|
330
332
|
// Mark as "seen" so we don't re-evaluate the policy every
|
|
331
333
|
// 60s for entries we deliberately skip — but DON'T mark as
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decentnetwork/lan",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
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",
|