dominds 1.26.1 → 1.26.2
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/cli/webui.js +14 -4
- package/dist/server/network-hosts.js +42 -29
- package/dist/server.js +4 -4
- package/package.json +3 -3
package/dist/cli/webui.js
CHANGED
|
@@ -164,17 +164,19 @@ async function main(args = process.argv.slice(2)) {
|
|
|
164
164
|
host: started.urlHost,
|
|
165
165
|
port: started.port,
|
|
166
166
|
})}`);
|
|
167
|
+
let httpsEndpoint;
|
|
167
168
|
if (started.httpsPort !== undefined && started.httpsUrlHost !== undefined) {
|
|
169
|
+
httpsEndpoint = { host: started.httpsUrlHost, port: started.httpsPort };
|
|
168
170
|
const httpsBaseUrl = (0, auth_1.formatServerOrigin)({
|
|
169
171
|
scheme: 'https',
|
|
170
|
-
host:
|
|
171
|
-
port:
|
|
172
|
+
host: httpsEndpoint.host,
|
|
173
|
+
port: httpsEndpoint.port,
|
|
172
174
|
});
|
|
173
175
|
log.info(`HTTPS WebUI ready: ${httpsBaseUrl}`);
|
|
174
176
|
log.debug(`HTTPS WebSocket endpoint: ${formatWebSocketEndpoint({
|
|
175
177
|
scheme: 'wss',
|
|
176
|
-
host:
|
|
177
|
-
port:
|
|
178
|
+
host: httpsEndpoint.host,
|
|
179
|
+
port: httpsEndpoint.port,
|
|
178
180
|
})}`);
|
|
179
181
|
}
|
|
180
182
|
if (auth.kind === 'enabled') {
|
|
@@ -185,6 +187,14 @@ async function main(args = process.argv.slice(2)) {
|
|
|
185
187
|
authKey: auth.key,
|
|
186
188
|
});
|
|
187
189
|
log.info(`auto auth url (sensitive): ${autoAuthUrl}`);
|
|
190
|
+
if (httpsEndpoint !== undefined) {
|
|
191
|
+
log.info(`HTTPS auto auth url (sensitive): ${(0, auth_1.formatAutoAuthUrl)({
|
|
192
|
+
scheme: 'https',
|
|
193
|
+
host: httpsEndpoint.host,
|
|
194
|
+
port: httpsEndpoint.port,
|
|
195
|
+
authKey: auth.key,
|
|
196
|
+
})}`);
|
|
197
|
+
}
|
|
188
198
|
if (shouldOpen) {
|
|
189
199
|
log.debug(`Opening browser: ${autoAuthUrl}`);
|
|
190
200
|
openInBrowser(autoAuthUrl);
|
|
@@ -42,9 +42,10 @@ const dgram = __importStar(require("node:dgram"));
|
|
|
42
42
|
const net = __importStar(require("node:net"));
|
|
43
43
|
const os = __importStar(require("node:os"));
|
|
44
44
|
const log_1 = require("../log");
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
const UDP_ROUTE_PROBE_TARGETS = {
|
|
46
|
+
ipv4: { host: '192.0.2.1', port: 443 },
|
|
47
|
+
ipv6: { host: '2001:db8::1', port: 443 },
|
|
48
|
+
};
|
|
48
49
|
const log = (0, log_1.createLogger)('network-hosts');
|
|
49
50
|
function normalizeNetworkHost(host) {
|
|
50
51
|
const trimmed = host.trim();
|
|
@@ -88,7 +89,7 @@ function resolveHttpUrlHostForBindHost(bindHost) {
|
|
|
88
89
|
}
|
|
89
90
|
async function resolveLanHttpsHostsForBindHost(bindHost) {
|
|
90
91
|
const normalizedHost = normalizeNetworkHost(bindHost);
|
|
91
|
-
log.
|
|
92
|
+
log.debug('Resolving LAN HTTPS certificate hosts', undefined, {
|
|
92
93
|
bindHost,
|
|
93
94
|
normalizedHost,
|
|
94
95
|
});
|
|
@@ -105,10 +106,10 @@ async function resolveLanHttpsHostsForBindHost(bindHost) {
|
|
|
105
106
|
});
|
|
106
107
|
}
|
|
107
108
|
const accepted = isLanHttpsHost(normalizedHost);
|
|
108
|
-
log.info('Resolved
|
|
109
|
+
log.info('Resolved LAN HTTPS certificate hosts', undefined, {
|
|
109
110
|
bindHost,
|
|
110
111
|
normalizedHost,
|
|
111
|
-
accepted,
|
|
112
|
+
acceptedHosts: accepted ? [normalizedHost] : [],
|
|
112
113
|
});
|
|
113
114
|
return accepted ? [normalizedHost] : [];
|
|
114
115
|
}
|
|
@@ -118,17 +119,21 @@ async function resolveDefaultLanHttpsHosts() {
|
|
|
118
119
|
async function resolveBindAllLanHttpsHosts(params) {
|
|
119
120
|
const rawCandidates = [];
|
|
120
121
|
for (const family of params.families) {
|
|
121
|
-
rawCandidates.push(...(await
|
|
122
|
+
rawCandidates.push(...(await getUdpRouteLocalHosts(family)));
|
|
122
123
|
}
|
|
123
124
|
for (const family of params.families) {
|
|
124
125
|
rawCandidates.push(...getNetworkInterfaceHosts(family));
|
|
125
126
|
}
|
|
126
127
|
const hostname = os.hostname();
|
|
127
|
-
|
|
128
|
+
const hostnameAccepted = isDetectedHostnameCandidate(hostname);
|
|
129
|
+
log.debug('LAN HTTPS host detection hostname candidate', undefined, {
|
|
128
130
|
method: 'os.hostname',
|
|
129
131
|
host: hostname,
|
|
132
|
+
acceptedCandidate: hostnameAccepted,
|
|
130
133
|
});
|
|
131
|
-
|
|
134
|
+
if (hostnameAccepted) {
|
|
135
|
+
rawCandidates.push(hostname);
|
|
136
|
+
}
|
|
132
137
|
const uniqueCandidates = uniqueHosts(rawCandidates);
|
|
133
138
|
const acceptedHosts = [];
|
|
134
139
|
const rejectedHosts = [];
|
|
@@ -140,7 +145,12 @@ async function resolveBindAllLanHttpsHosts(params) {
|
|
|
140
145
|
rejectedHosts.push(host);
|
|
141
146
|
}
|
|
142
147
|
}
|
|
143
|
-
log.info('Resolved
|
|
148
|
+
log.info('Resolved LAN HTTPS certificate hosts', undefined, {
|
|
149
|
+
bindHost: params.bindHost,
|
|
150
|
+
families: params.families,
|
|
151
|
+
acceptedHosts,
|
|
152
|
+
});
|
|
153
|
+
log.debug('Resolved bind-all LAN HTTPS certificate host diagnostics', undefined, {
|
|
144
154
|
bindHost: params.bindHost,
|
|
145
155
|
families: params.families,
|
|
146
156
|
rawCandidates,
|
|
@@ -150,18 +160,18 @@ async function resolveBindAllLanHttpsHosts(params) {
|
|
|
150
160
|
});
|
|
151
161
|
return acceptedHosts;
|
|
152
162
|
}
|
|
153
|
-
async function
|
|
154
|
-
const host = await
|
|
163
|
+
async function getUdpRouteLocalHosts(kind) {
|
|
164
|
+
const host = await getUdpRouteLocalHost(kind);
|
|
155
165
|
return host === null ? [] : [host];
|
|
156
166
|
}
|
|
157
|
-
async function
|
|
167
|
+
async function getUdpRouteLocalHost(kind) {
|
|
158
168
|
return await new Promise((resolve) => {
|
|
159
|
-
|
|
160
|
-
|
|
169
|
+
const target = UDP_ROUTE_PROBE_TARGETS[kind];
|
|
170
|
+
log.debug('LAN HTTPS host detection UDP route probe start', undefined, {
|
|
171
|
+
method: 'udp_route_local_address_probe',
|
|
161
172
|
family: kind,
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
timeoutMs: OUTBOUND_PROBE_TIMEOUT_MS,
|
|
173
|
+
targetHost: target.host,
|
|
174
|
+
targetPort: target.port,
|
|
165
175
|
});
|
|
166
176
|
const socket = dgram.createSocket(kind === 'ipv4' ? 'udp4' : 'udp6');
|
|
167
177
|
let settled = false;
|
|
@@ -169,12 +179,11 @@ async function getUdpOutboundHost(kind) {
|
|
|
169
179
|
if (settled)
|
|
170
180
|
return;
|
|
171
181
|
settled = true;
|
|
172
|
-
clearTimeout(timeout);
|
|
173
182
|
socket.removeAllListeners('error');
|
|
174
183
|
socket.close();
|
|
175
184
|
const normalizedHost = host === null ? null : normalizeNetworkHost(host);
|
|
176
|
-
log.
|
|
177
|
-
method: '
|
|
185
|
+
log.debug('LAN HTTPS host detection UDP route probe finish', undefined, {
|
|
186
|
+
method: 'udp_route_local_address_probe',
|
|
178
187
|
family: kind,
|
|
179
188
|
reason,
|
|
180
189
|
host,
|
|
@@ -182,18 +191,14 @@ async function getUdpOutboundHost(kind) {
|
|
|
182
191
|
});
|
|
183
192
|
resolve(normalizedHost);
|
|
184
193
|
};
|
|
185
|
-
const timeout = setTimeout(() => {
|
|
186
|
-
finish(null, 'timeout');
|
|
187
|
-
}, OUTBOUND_PROBE_TIMEOUT_MS);
|
|
188
|
-
timeout.unref();
|
|
189
194
|
socket.once('error', (error) => {
|
|
190
|
-
log.
|
|
191
|
-
method: '
|
|
195
|
+
log.debug('LAN HTTPS host detection UDP route probe error', error, {
|
|
196
|
+
method: 'udp_route_local_address_probe',
|
|
192
197
|
family: kind,
|
|
193
198
|
});
|
|
194
199
|
finish(null, 'error');
|
|
195
200
|
});
|
|
196
|
-
socket.connect(
|
|
201
|
+
socket.connect(target.port, target.host, () => {
|
|
197
202
|
const address = socket.address();
|
|
198
203
|
if (typeof address === 'string') {
|
|
199
204
|
finish(null, 'non_ip_socket_address');
|
|
@@ -229,7 +234,7 @@ function getNetworkInterfaceHosts(kind) {
|
|
|
229
234
|
}
|
|
230
235
|
}
|
|
231
236
|
}
|
|
232
|
-
log.
|
|
237
|
+
log.debug('LAN HTTPS host detection networkInterfaces result', undefined, {
|
|
233
238
|
method: 'os.networkInterfaces',
|
|
234
239
|
family: kind,
|
|
235
240
|
hosts,
|
|
@@ -237,6 +242,14 @@ function getNetworkInterfaceHosts(kind) {
|
|
|
237
242
|
});
|
|
238
243
|
return hosts;
|
|
239
244
|
}
|
|
245
|
+
function isDetectedHostnameCandidate(host) {
|
|
246
|
+
const normalizedHost = normalizeNetworkHost(host);
|
|
247
|
+
if (!isLanHttpsHost(normalizedHost))
|
|
248
|
+
return false;
|
|
249
|
+
if (net.isIP(normalizedHost) !== 0)
|
|
250
|
+
return true;
|
|
251
|
+
return normalizedHost.includes('.');
|
|
252
|
+
}
|
|
240
253
|
function uniqueHosts(rawHosts) {
|
|
241
254
|
const hosts = [];
|
|
242
255
|
const seen = new Set();
|
package/dist/server.js
CHANGED
|
@@ -121,16 +121,16 @@ async function startServer(opts = {}) {
|
|
|
121
121
|
}
|
|
122
122
|
const tls = certificateLookup.kind === 'found' && !strictPort ? certificateLookup.certificate : undefined;
|
|
123
123
|
const urlHost = (0, network_hosts_1.resolveHttpUrlHostForBindHost)(host);
|
|
124
|
-
log.
|
|
124
|
+
log.debug(`Starting server in ${mode} mode on ${(0, auth_1.formatServerOrigin)({
|
|
125
125
|
scheme: 'http',
|
|
126
126
|
host: urlHost,
|
|
127
127
|
port: preferredPort,
|
|
128
128
|
})} (bind ${host}; ${strictPort ? 'strict port' : `auto port ${portAutoDirection}`}; working language: ${(0, work_language_1.getWorkLanguage)()} from ${source})`);
|
|
129
129
|
if (certificateLookup.kind === 'found' && strictPort) {
|
|
130
|
-
log.
|
|
130
|
+
log.debug(`HTTPS certificate found but Dominds HTTPS is disabled for strict --port; assuming HTTPS, if needed, is handled by a front proxy (${certificateLookup.certificate.certPath})`);
|
|
131
131
|
}
|
|
132
132
|
else if (tls !== undefined) {
|
|
133
|
-
log.
|
|
133
|
+
log.debug(`HTTPS certificate available: ${tls.certPath} (matched host ${tls.matchedHost})`);
|
|
134
134
|
}
|
|
135
135
|
let startedCore = null;
|
|
136
136
|
let boundPort = null;
|
|
@@ -208,7 +208,7 @@ async function startServer(opts = {}) {
|
|
|
208
208
|
await startedCore.stop();
|
|
209
209
|
throw new Error(`Failed to start WebUI HTTPS: no available adjacent port found from ${preferredHttpsPort}`);
|
|
210
210
|
}
|
|
211
|
-
log.
|
|
211
|
+
log.debug(`HTTPS WebUI ready: ${(0, auth_1.formatServerOrigin)({
|
|
212
212
|
scheme: 'https',
|
|
213
213
|
host: httpsUrlHost,
|
|
214
214
|
port: httpsPort,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dominds",
|
|
3
|
-
"version": "1.26.
|
|
3
|
+
"version": "1.26.2",
|
|
4
4
|
"description": "Dominds CLI and aggregation shell for the LongRun AI kernel/runtime packages.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"publishConfig": {
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
"ws": "^8.19.0",
|
|
54
54
|
"yaml": "^2.8.2",
|
|
55
55
|
"zod": "^4.3.6",
|
|
56
|
-
"@longrun-ai/kernel": "1.16.0",
|
|
57
56
|
"@longrun-ai/codex-auth": "0.13.0",
|
|
58
|
-
"@longrun-ai/shell": "1.16.0"
|
|
57
|
+
"@longrun-ai/shell": "1.16.0",
|
|
58
|
+
"@longrun-ai/kernel": "1.16.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/node": "^25.3.5",
|