@camstack/system 1.2.359 → 1.2.360
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/addon-runner.js +1 -1
- package/dist/addon-runner.mjs +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/dist/builtins/alerts/alerts.addon.js +1 -1
- package/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/dist/builtins/autotrack/index.js +1 -1
- package/dist/builtins/autotrack/index.mjs +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
- package/dist/builtins/calendars/calendars.addon.js +1 -1
- package/dist/builtins/calendars/calendars.addon.mjs +1 -1
- package/dist/builtins/camera-grid/index.js +1 -1
- package/dist/builtins/camera-grid/index.mjs +1 -1
- package/dist/builtins/composer/composer.addon.js +2 -2
- package/dist/builtins/composer/composer.addon.mjs +2 -2
- package/dist/builtins/console-logging/index.js +1 -1
- package/dist/builtins/console-logging/index.mjs +1 -1
- package/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
- package/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
- package/dist/builtins/device-manager/device-manager.addon.js +2 -2
- package/dist/builtins/device-manager/device-manager.addon.mjs +2 -2
- package/dist/builtins/hub-forwarder/index.js +1 -1
- package/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/dist/builtins/local-auth/local-auth.addon.js +1 -1
- package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
- package/dist/builtins/local-network/address-book.d.ts +17 -17
- package/dist/builtins/local-network/local-network.addon.d.ts +21 -18
- package/dist/builtins/local-network/local-network.addon.js +85 -83
- package/dist/builtins/local-network/local-network.addon.mjs +85 -83
- package/dist/builtins/loki-logging/index.js +1 -1
- package/dist/builtins/loki-logging/index.mjs +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/dist/builtins/platform-probe/index.js +1 -1
- package/dist/builtins/platform-probe/index.mjs +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/dist/builtins/snapshot/index.js +1 -1
- package/dist/builtins/snapshot/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +0 -0
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +0 -0
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/dist/builtins/system-config/system-config.addon.js +1 -1
- package/dist/builtins/system-config/system-config.addon.mjs +1 -1
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{child-cap-dispatch-Dm1TRDCr.mjs → child-cap-dispatch-StBHObCA.mjs} +1 -1
- package/dist/{child-cap-dispatch-t61ohDpb.js → child-cap-dispatch-T3Kdhbb3.js} +1 -1
- package/dist/{composition-sources-CHlfWHl6.mjs → composition-sources-DASc7NBj.mjs} +1 -1
- package/dist/{composition-sources-CCU_KizO.js → composition-sources-DFgayxCc.js} +1 -1
- package/dist/{dist-pTfD_M-U.mjs → dist-C9Rk6KVv.mjs} +100 -84
- package/dist/{dist-W_X44h-s.js → dist-Cv1lnnQq.js} +109 -93
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{retired-settings-keys-jglEzgWR.js → retired-settings-keys-BGNqRNhu.js} +1 -1
- package/dist/{retired-settings-keys-CK_ifret.mjs → retired-settings-keys-BjG8bQVI.mjs} +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
3
|
-
const require_dist = require("../../dist-
|
|
3
|
+
const require_dist = require("../../dist-Cv1lnnQq.js");
|
|
4
4
|
const require_tls = require("../../tls-CCMX7MjX.js");
|
|
5
5
|
let zod = require("zod");
|
|
6
6
|
let node_os = require("node:os");
|
|
@@ -12,24 +12,26 @@ let node_net = require("node:net");
|
|
|
12
12
|
* The Network page's address book, as pure functions: custom addresses plus
|
|
13
13
|
* the role flags carried by detected and custom addresses alike.
|
|
14
14
|
*
|
|
15
|
-
* ## Storage
|
|
15
|
+
* ## Storage (D734)
|
|
16
16
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* `
|
|
20
|
-
* `signInBaseUrl` (agents / sign-in, D729 amendment). A single-valued role is
|
|
17
|
+
* One key per role: `appConnectionUrls` (`appConnections`, many),
|
|
18
|
+
* `notificationTapUrl` (`notificationTaps`), `publicEndpointUrl`
|
|
19
|
+
* (`publicEndpoint`) and `internalUrl` (`internal`). A single-valued role is
|
|
21
20
|
* one URL — at most one address carries it, by construction. `''` / `[]` is
|
|
22
21
|
* automatic. The custom addresses are `customAddresses` (url + label).
|
|
23
22
|
*
|
|
24
|
-
*
|
|
23
|
+
* The keys of the earlier role names (`viewerBaseUrls`, `notificationBaseUrl`,
|
|
24
|
+
* `signInBaseUrl`, `agentBaseUrl`) are not read: a value stored under one is
|
|
25
|
+
* ignored, and that role is automatic until the operator flags it again
|
|
26
|
+
* (D734 — one install, re-set by hand, no migration code).
|
|
25
27
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* as a custom row instead of vanishing
|
|
28
|
+
* ## A flag on an address that is in no row
|
|
29
|
+
*
|
|
30
|
+
* A flagged detected address can disappear (a DHCP move) while it still wins
|
|
31
|
+
* its role. {@link normalizeAddressBook} turns every single-valued flag that
|
|
32
|
+
* names neither a detected address, a custom one nor the app link into a
|
|
33
|
+
* custom address carrying that role, on every read; the next write persists
|
|
34
|
+
* the result — so the address shows as a custom row instead of vanishing.
|
|
33
35
|
*/
|
|
34
36
|
var CustomAddressListSchema = zod.z.array(zod.z.object({
|
|
35
37
|
baseUrl: zod.z.string(),
|
|
@@ -37,14 +39,14 @@ var CustomAddressListSchema = zod.z.array(zod.z.object({
|
|
|
37
39
|
}));
|
|
38
40
|
/** The label a flag promoted to a custom address is given. */
|
|
39
41
|
var PROMOTED_LABEL = {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
notificationTaps: "Notification taps address",
|
|
43
|
+
internal: "Internal address",
|
|
44
|
+
publicEndpoint: "Public endpoint"
|
|
43
45
|
};
|
|
44
46
|
var SINGLE_ROLES = [
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
47
|
+
"notificationTaps",
|
|
48
|
+
"internal",
|
|
49
|
+
"publicEndpoint"
|
|
48
50
|
];
|
|
49
51
|
function flagOf(value) {
|
|
50
52
|
return value === "" ? null : value;
|
|
@@ -61,10 +63,10 @@ function parseCustomAddresses(raw) {
|
|
|
61
63
|
*/
|
|
62
64
|
function normalizeAddressBook(stored, detectedUrls) {
|
|
63
65
|
const flags = {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
appConnections: stored.appConnectionUrls,
|
|
67
|
+
notificationTaps: flagOf(stored.notificationTapUrl),
|
|
68
|
+
internal: flagOf(stored.internalUrl),
|
|
69
|
+
publicEndpoint: flagOf(stored.publicEndpointUrl)
|
|
68
70
|
};
|
|
69
71
|
const custom = [...parseCustomAddresses(stored.customAddresses)];
|
|
70
72
|
for (const role of SINGLE_ROLES) {
|
|
@@ -85,10 +87,10 @@ function normalizeAddressBook(stored, detectedUrls) {
|
|
|
85
87
|
function addressBookPatch(state) {
|
|
86
88
|
return {
|
|
87
89
|
customAddresses: state.custom,
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
appConnectionUrls: state.flags.appConnections,
|
|
91
|
+
notificationTapUrl: state.flags.notificationTaps ?? "",
|
|
92
|
+
publicEndpointUrl: state.flags.publicEndpoint ?? "",
|
|
93
|
+
internalUrl: state.flags.internal ?? ""
|
|
92
94
|
};
|
|
93
95
|
}
|
|
94
96
|
function withCustomAddress(state, entry) {
|
|
@@ -104,20 +106,20 @@ function withoutCustomAddress(state, baseUrl) {
|
|
|
104
106
|
return {
|
|
105
107
|
custom: state.custom.filter((c) => c.baseUrl !== baseUrl),
|
|
106
108
|
flags: {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
appConnections: state.flags.appConnections.filter((u) => u !== baseUrl),
|
|
110
|
+
notificationTaps: clear(state.flags.notificationTaps),
|
|
111
|
+
internal: clear(state.flags.internal),
|
|
112
|
+
publicEndpoint: clear(state.flags.publicEndpoint)
|
|
111
113
|
}
|
|
112
114
|
};
|
|
113
115
|
}
|
|
114
116
|
/** Every role back to automatic for `role`. */
|
|
115
117
|
function withRoleAutomatic(state, role) {
|
|
116
|
-
return role === "
|
|
118
|
+
return role === "appConnections" ? {
|
|
117
119
|
...state,
|
|
118
120
|
flags: {
|
|
119
121
|
...state.flags,
|
|
120
|
-
|
|
122
|
+
appConnections: []
|
|
121
123
|
}
|
|
122
124
|
} : {
|
|
123
125
|
...state,
|
|
@@ -130,24 +132,24 @@ function withRoleAutomatic(state, role) {
|
|
|
130
132
|
/**
|
|
131
133
|
* Flag or unflag `baseUrl` for `role`. A single-valued role flagged here moves
|
|
132
134
|
* off every other address (it is one URL); unflagging the address that carries
|
|
133
|
-
* it returns the role to automatic. The app link flagged for
|
|
134
|
-
* the automatic answer, stored as automatic — one representation.
|
|
135
|
-
* toggles inside the set; toggling while automatic starts
|
|
136
|
-
* set (`
|
|
135
|
+
* it returns the role to automatic. The app link flagged for notification
|
|
136
|
+
* taps IS the automatic answer, stored as automatic — one representation.
|
|
137
|
+
* `appConnections` toggles inside the set; toggling while automatic starts
|
|
138
|
+
* from the automatic set (`autoApp`) so the other addresses keep racing.
|
|
137
139
|
*/
|
|
138
|
-
function withRoleFlag(state, role, baseUrl, enabled,
|
|
139
|
-
if (role === "
|
|
140
|
-
const without = (state.flags.
|
|
141
|
-
const
|
|
140
|
+
function withRoleFlag(state, role, baseUrl, enabled, autoApp) {
|
|
141
|
+
if (role === "appConnections") {
|
|
142
|
+
const without = (state.flags.appConnections.length === 0 ? autoApp : state.flags.appConnections).filter((u) => u !== baseUrl);
|
|
143
|
+
const appConnections = enabled ? [...without, baseUrl] : without;
|
|
142
144
|
return {
|
|
143
145
|
...state,
|
|
144
146
|
flags: {
|
|
145
147
|
...state.flags,
|
|
146
|
-
|
|
148
|
+
appConnections
|
|
147
149
|
}
|
|
148
150
|
};
|
|
149
151
|
}
|
|
150
|
-
if (role === "
|
|
152
|
+
if (role === "notificationTaps" && require_dist.isAppLinkBase(baseUrl)) return withRoleAutomatic(state, role);
|
|
151
153
|
if (enabled) return {
|
|
152
154
|
...state,
|
|
153
155
|
flags: {
|
|
@@ -160,12 +162,12 @@ function withRoleFlag(state, role, baseUrl, enabled, autoViewer) {
|
|
|
160
162
|
/** What a row may be flagged with. */
|
|
161
163
|
function eligibleRoles(endpoint) {
|
|
162
164
|
if (endpoint.kind === "loopback") return [];
|
|
163
|
-
if (endpoint.kind === "app-link") return ["
|
|
165
|
+
if (endpoint.kind === "app-link") return ["notificationTaps"];
|
|
164
166
|
return [
|
|
165
|
-
"
|
|
166
|
-
"
|
|
167
|
-
"
|
|
168
|
-
"
|
|
167
|
+
"appConnections",
|
|
168
|
+
"notificationTaps",
|
|
169
|
+
"internal",
|
|
170
|
+
"publicEndpoint"
|
|
169
171
|
];
|
|
170
172
|
}
|
|
171
173
|
/** A custom address as a palette entry (`kind: 'custom'`). */
|
|
@@ -182,27 +184,27 @@ function customEndpoint(entry) {
|
|
|
182
184
|
}
|
|
183
185
|
/**
|
|
184
186
|
* The palette a client races: the detected endpoints plus the custom
|
|
185
|
-
* addresses flagged `
|
|
187
|
+
* addresses flagged `appConnections` (a detected URL is never listed twice).
|
|
186
188
|
*/
|
|
187
|
-
function
|
|
189
|
+
function withAppConnectionCustomEndpoints(detected, state) {
|
|
188
190
|
const known = new Set(detected.map((e) => e.baseUrl));
|
|
189
|
-
const wanted = new Set(state.flags.
|
|
191
|
+
const wanted = new Set(state.flags.appConnections);
|
|
190
192
|
const extra = state.custom.filter((c) => wanted.has(c.baseUrl) && !known.has(c.baseUrl)).map(customEndpoint);
|
|
191
193
|
return [...detected, ...extra];
|
|
192
194
|
}
|
|
193
195
|
/** Every role's answer — the resolvers from `@camstack/types`, nothing else. */
|
|
194
|
-
function resolveRoles(state,
|
|
195
|
-
return require_dist.resolveHubAddressRoles(
|
|
196
|
+
function resolveRoles(state, appPalette, httpsPalette) {
|
|
197
|
+
return require_dist.resolveHubAddressRoles(withAppConnectionCustomEndpoints(appPalette, state), httpsPalette, state.flags);
|
|
196
198
|
}
|
|
197
199
|
function flagsOn(state, baseUrl) {
|
|
198
200
|
const out = [];
|
|
199
|
-
if (state.flags.
|
|
201
|
+
if (state.flags.appConnections.includes(baseUrl)) out.push("appConnections");
|
|
200
202
|
for (const role of SINGLE_ROLES) if (state.flags[role] === baseUrl) out.push(role);
|
|
201
203
|
return out;
|
|
202
204
|
}
|
|
203
205
|
function inUseOn(roles, baseUrl) {
|
|
204
206
|
const out = [];
|
|
205
|
-
if (roles.
|
|
207
|
+
if (roles.appConnections.resolved.includes(baseUrl)) out.push("appConnections");
|
|
206
208
|
for (const role of SINGLE_ROLES) if (roles[role].resolved === baseUrl) out.push(role);
|
|
207
209
|
return out;
|
|
208
210
|
}
|
|
@@ -216,7 +218,7 @@ function buildAddressBook(state, inputs) {
|
|
|
216
218
|
detected,
|
|
217
219
|
custom: customUrls.has(endpoint.baseUrl),
|
|
218
220
|
flags: endpoint.kind === "app-link" ? [] : flagsOn(state, endpoint.baseUrl),
|
|
219
|
-
inUse: endpoint.kind === "app-link" ? roles.
|
|
221
|
+
inUse: endpoint.kind === "app-link" ? roles.notificationTaps.resolved === "https://camstack.zentik.app" ? ["notificationTaps"] : [] : inUseOn(roles, endpoint.baseUrl),
|
|
220
222
|
eligible: eligibleRoles(endpoint)
|
|
221
223
|
});
|
|
222
224
|
return {
|
|
@@ -421,20 +423,20 @@ var LocalNetworkAddon = class extends require_dist.BaseAddon {
|
|
|
421
423
|
super({
|
|
422
424
|
allowedAddresses: [],
|
|
423
425
|
bootSeeded: false,
|
|
424
|
-
|
|
425
|
-
|
|
426
|
+
notificationTapUrl: "",
|
|
427
|
+
appConnectionUrls: [],
|
|
426
428
|
customAddresses: [],
|
|
427
429
|
httpEnabled: true,
|
|
428
430
|
httpPort: require_tls.DEFAULT_LAN_HTTP_PORT,
|
|
429
431
|
localHostname: "",
|
|
430
|
-
|
|
431
|
-
|
|
432
|
+
internalUrl: "",
|
|
433
|
+
publicEndpointUrl: ""
|
|
432
434
|
});
|
|
433
435
|
}
|
|
434
436
|
/**
|
|
435
|
-
* The detected palettes, with the mesh reconciled once: `https` (what
|
|
436
|
-
* and
|
|
437
|
-
*
|
|
437
|
+
* The detected palettes, with the mesh reconciled once: `https` (what
|
|
438
|
+
* `internal` and `publicEndpoint` resolve over, and the app link's `hub=`)
|
|
439
|
+
* and `http` (what the app-connections race resolves over).
|
|
438
440
|
*/
|
|
439
441
|
async palettes() {
|
|
440
442
|
const port = (await this.resolveAdvertisedListenPort(null)).port;
|
|
@@ -472,7 +474,7 @@ var LocalNetworkAddon = class extends require_dist.BaseAddon {
|
|
|
472
474
|
const detectedUrls = new Set(detected.map((e) => e.baseUrl));
|
|
473
475
|
const changed = change(this.addressState(detected), {
|
|
474
476
|
detectedUrls,
|
|
475
|
-
|
|
477
|
+
autoApp: [...new Set(detected.filter(require_dist.isDefaultAppConnectionEndpoint).map((e) => e.baseUrl))]
|
|
476
478
|
});
|
|
477
479
|
const after = normalizeAddressBook({
|
|
478
480
|
...addressBookPatch(changed),
|
|
@@ -489,18 +491,18 @@ var LocalNetworkAddon = class extends require_dist.BaseAddon {
|
|
|
489
491
|
source: r.source === "flagged" ? "override" : r.source
|
|
490
492
|
});
|
|
491
493
|
return {
|
|
492
|
-
cluster: legacy(roles.
|
|
493
|
-
browser: legacy(roles.
|
|
494
|
+
cluster: legacy(roles.internal),
|
|
495
|
+
browser: legacy(roles.publicEndpoint)
|
|
494
496
|
};
|
|
495
497
|
}
|
|
496
498
|
/**
|
|
497
499
|
* Flag / unflag `baseUrl` for `role`, or (`baseUrl: null`) return the role
|
|
498
500
|
* to automatic. Validated: the address must be a row (detected, custom, or
|
|
499
|
-
* the app link for
|
|
500
|
-
* http only when accepted. A refusal stores nothing.
|
|
501
|
+
* the app link for `notificationTaps`), never loopback, and
|
|
502
|
+
* `publicEndpoint` on plain http only when accepted. A refusal stores nothing.
|
|
501
503
|
*/
|
|
502
504
|
async setRole(role, baseUrl, enabled, acceptInsecureHttp) {
|
|
503
|
-
if (baseUrl === null || baseUrl.trim() === "" && role !== "
|
|
505
|
+
if (baseUrl === null || baseUrl.trim() === "" && role !== "appConnections") {
|
|
504
506
|
await this.changeAddressBook((state) => withRoleAutomatic(state, role));
|
|
505
507
|
this.ctx.logger.info("local-network: address role set to automatic", { meta: { role } });
|
|
506
508
|
return;
|
|
@@ -513,8 +515,8 @@ var LocalNetworkAddon = class extends require_dist.BaseAddon {
|
|
|
513
515
|
}
|
|
514
516
|
await this.changeAddressBook((state, ctx) => {
|
|
515
517
|
const known = require_dist.isAppLinkBase(target) || ctx.detectedUrls.has(target) || state.custom.some((c) => c.baseUrl === target);
|
|
516
|
-
if (enabled && !known && role !== "
|
|
517
|
-
return withRoleFlag(state, role, target, enabled, ctx.
|
|
518
|
+
if (enabled && !known && role !== "notificationTaps") throw new Error(`${target} is not in the address list — add it as a custom address first.`);
|
|
519
|
+
return withRoleFlag(state, role, target, enabled, ctx.autoApp);
|
|
518
520
|
});
|
|
519
521
|
this.ctx.logger.info("local-network: address role set", { meta: {
|
|
520
522
|
role,
|
|
@@ -523,7 +525,7 @@ var LocalNetworkAddon = class extends require_dist.BaseAddon {
|
|
|
523
525
|
} });
|
|
524
526
|
}
|
|
525
527
|
async notificationEndpointSnapshot() {
|
|
526
|
-
const resolution = require_dist.
|
|
528
|
+
const resolution = require_dist.resolveNotificationTapAddress(this.storedFlags());
|
|
527
529
|
const port = (await this.resolveAdvertisedListenPort(null)).port;
|
|
528
530
|
return {
|
|
529
531
|
baseUrl: resolution.flagged,
|
|
@@ -532,7 +534,7 @@ var LocalNetworkAddon = class extends require_dist.BaseAddon {
|
|
|
532
534
|
};
|
|
533
535
|
}
|
|
534
536
|
async snapshotViewerEndpoints() {
|
|
535
|
-
const resolution = require_dist.
|
|
537
|
+
const resolution = require_dist.resolveAppConnections(await this.buildAdvertisedEndpoints(false, false, "http", (await this.resolveAdvertisedListenPort(null)).port), this.storedFlags());
|
|
536
538
|
return {
|
|
537
539
|
baseUrls: resolution.flagged,
|
|
538
540
|
resolved: resolution.resolved
|
|
@@ -540,14 +542,14 @@ var LocalNetworkAddon = class extends require_dist.BaseAddon {
|
|
|
540
542
|
}
|
|
541
543
|
/**
|
|
542
544
|
* Palette shown to clients: LAN IPv4, stable LAN IPv6, public, mesh, and
|
|
543
|
-
* the custom addresses flagged `
|
|
544
|
-
* HTTP/WS race is a subset (`
|
|
545
|
+
* the custom addresses flagged `appConnections` (`kind: 'custom'`). The app
|
|
546
|
+
* HTTP/WS race is a subset (`selectAppConnectionEndpoints`) — IPv6 stays in this
|
|
545
547
|
* list because ICE/WebRTC gathers it regardless.
|
|
546
548
|
*/
|
|
547
549
|
async buildAdvertisedEndpoints(includeLoopback, ipv4Only, scheme, httpsPort) {
|
|
548
550
|
await this.reconcileMeshEndpoint();
|
|
549
551
|
const detected = this.endpointsNow(includeLoopback, ipv4Only, scheme, httpsPort);
|
|
550
|
-
return
|
|
552
|
+
return withAppConnectionCustomEndpoints(detected, this.addressState(detected));
|
|
551
553
|
}
|
|
552
554
|
/** The DETECTED palette from the cached interface/tunnel/mesh state. */
|
|
553
555
|
endpointsNow(includeLoopback, ipv4Only, scheme, httpsPort) {
|
|
@@ -594,22 +596,22 @@ var LocalNetworkAddon = class extends require_dist.BaseAddon {
|
|
|
594
596
|
},
|
|
595
597
|
getNotificationEndpoint: async () => this.notificationEndpointSnapshot(),
|
|
596
598
|
setNotificationEndpoint: async ({ baseUrl }) => {
|
|
597
|
-
await this.setRole("
|
|
599
|
+
await this.setRole("notificationTaps", baseUrl, true, false);
|
|
598
600
|
return this.notificationEndpointSnapshot();
|
|
599
601
|
},
|
|
600
602
|
getViewerEndpoints: async () => this.snapshotViewerEndpoints(),
|
|
601
603
|
setViewerEndpoints: async ({ baseUrls }) => {
|
|
602
|
-
const
|
|
604
|
+
const appConnections = [...new Set(baseUrls.filter((u) => u.length > 0))];
|
|
603
605
|
await this.changeAddressBook((state) => ({
|
|
604
606
|
...state,
|
|
605
607
|
flags: {
|
|
606
608
|
...state.flags,
|
|
607
|
-
|
|
609
|
+
appConnections
|
|
608
610
|
}
|
|
609
611
|
}));
|
|
610
|
-
this.ctx.logger.info("local-network:
|
|
611
|
-
count:
|
|
612
|
-
auto:
|
|
612
|
+
this.ctx.logger.info("local-network: app connections set", { meta: {
|
|
613
|
+
count: appConnections.length,
|
|
614
|
+
auto: appConnections.length === 0
|
|
613
615
|
} });
|
|
614
616
|
return this.snapshotViewerEndpoints();
|
|
615
617
|
},
|