@decentnetwork/beagle 0.1.68 → 0.1.69
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/config/bootstrap-nodes.yaml +13 -0
- package/dist/desktop/app.js +1 -1
- package/dist/node-config.js +19 -6
- package/package.json +1 -1
|
@@ -48,3 +48,16 @@ bootstrapNodes:
|
|
|
48
48
|
- host: 52.83.191.228
|
|
49
49
|
port: 33445
|
|
50
50
|
pk: 3khtxZo89SBScAMaHhTvD68pPHiKxgZT6hTCSZZVgNEm
|
|
51
|
+
|
|
52
|
+
# Store-and-forward relays. Shipped for the same reason the bootstraps are:
|
|
53
|
+
# without them a fresh install has no express client at all, so it never
|
|
54
|
+
# collects offline mail and a friend request sent while it was away is never
|
|
55
|
+
# seen. Previously these came only from config.yaml, which a new install does
|
|
56
|
+
# not have — measured 2026-08-30: a browser posted a friend request to express
|
|
57
|
+
# (recipient inbox grew 320 -> 672 bytes) and the recipient, a fresh desktop
|
|
58
|
+
# install, never pulled it.
|
|
59
|
+
expressNodes:
|
|
60
|
+
- host: lens.beagle.chat
|
|
61
|
+
port: 443
|
|
62
|
+
pk: ECbs4GxwGzxGerNkmqDJFibEmevu8jAXqAZtikccvD95
|
|
63
|
+
tls: true
|
package/dist/desktop/app.js
CHANGED
package/dist/node-config.js
CHANGED
|
@@ -12,16 +12,26 @@ import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
|
12
12
|
import { fileURLToPath } from "node:url";
|
|
13
13
|
import { dirname, resolve } from "node:path";
|
|
14
14
|
import yaml from "js-yaml";
|
|
15
|
-
function
|
|
15
|
+
function shippedConfig() {
|
|
16
16
|
try {
|
|
17
17
|
const file = resolve(dirname(fileURLToPath(import.meta.url)), "..", "config", "bootstrap-nodes.yaml");
|
|
18
|
-
|
|
19
|
-
return (parsed?.bootstrapNodes ?? []).filter((n) => n?.host && n?.pk);
|
|
18
|
+
return (yaml.load(readFileSync(file, "utf-8")) ?? {});
|
|
20
19
|
}
|
|
21
20
|
catch {
|
|
22
|
-
return
|
|
21
|
+
return {};
|
|
23
22
|
}
|
|
24
23
|
}
|
|
24
|
+
function shippedBootstraps() {
|
|
25
|
+
return (shippedConfig().bootstrapNodes ?? []).filter((n) => n?.host && n?.pk);
|
|
26
|
+
}
|
|
27
|
+
/** Store-and-forward relays, shipped like the bootstraps.
|
|
28
|
+
*
|
|
29
|
+
* These used to come ONLY from config.yaml, which a fresh install does not
|
|
30
|
+
* have — so a new desktop had no express client, never pulled offline mail,
|
|
31
|
+
* and silently missed every friend request sent while it was away. */
|
|
32
|
+
function shippedExpress() {
|
|
33
|
+
return (shippedConfig().expressNodes ?? []).filter((n) => n?.host && n?.pk);
|
|
34
|
+
}
|
|
25
35
|
function valid(nodes) {
|
|
26
36
|
return Array.isArray(nodes) && nodes.length > 0 && nodes.every((n) => n && typeof n.host === "string" && typeof n.pk === "string");
|
|
27
37
|
}
|
|
@@ -39,7 +49,8 @@ export function loadNodeConfig(configDir) {
|
|
|
39
49
|
const merged = valid(fromFile) ? [...fromFile, ...extra] : shipped;
|
|
40
50
|
return {
|
|
41
51
|
bootstrapNodes: merged.length ? merged : shipped,
|
|
42
|
-
|
|
52
|
+
// Config first, shipped defaults when it says nothing.
|
|
53
|
+
expressNodes: cfg.carrier?.expressNodes?.length ? cfg.carrier.expressNodes : shippedExpress(),
|
|
43
54
|
nickname: cfg.node?.name,
|
|
44
55
|
statusMessage: cfg.node?.statusMessage,
|
|
45
56
|
autoAccept: cfg.friends?.autoAccept ?? true,
|
|
@@ -49,7 +60,9 @@ export function loadNodeConfig(configDir) {
|
|
|
49
60
|
// Malformed config must not stop the app — fall through to defaults.
|
|
50
61
|
}
|
|
51
62
|
}
|
|
52
|
-
|
|
63
|
+
// No config.yaml at all — a fresh install. It still needs the express
|
|
64
|
+
// relays, or it will never collect a friend request sent while it was away.
|
|
65
|
+
return { bootstrapNodes: shipped, expressNodes: shippedExpress(), autoAccept: true };
|
|
53
66
|
}
|
|
54
67
|
/** Persist the auto-accept switch into config.yaml, preserving everything
|
|
55
68
|
* else in the file. Without this the runtime toggle lasted until the next
|
package/package.json
CHANGED