bdy 1.17.8-dev → 1.17.9-dev
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/distTs/package.json
CHANGED
|
@@ -68,7 +68,7 @@ class Agent extends events_1.default {
|
|
|
68
68
|
else {
|
|
69
69
|
logger_1.default.debug('Socket fetch tunnel after sync push');
|
|
70
70
|
if (this.socket) {
|
|
71
|
-
this.socket.fetch(!this.disabled, null, null, false, []);
|
|
71
|
+
this.socket.fetch(!this.disabled, null, null, false, [], false, 1000);
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
}
|
|
@@ -99,7 +99,7 @@ class Agent extends events_1.default {
|
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
if (shouldFetch && this.socket) {
|
|
102
|
-
this.socket.fetch(!this.disabled, null, null, false, []);
|
|
102
|
+
this.socket.fetch(!this.disabled, null, null, false, [], false, 1000);
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
}
|
|
@@ -115,7 +115,8 @@ class Agent extends events_1.default {
|
|
|
115
115
|
try {
|
|
116
116
|
if (data.agent.action)
|
|
117
117
|
await this.makeAction(data.agent.action);
|
|
118
|
-
|
|
118
|
+
const filtered = (data.tunnels || []).filter((t) => !!t.domain);
|
|
119
|
+
this.refreshTunnels(filtered);
|
|
119
120
|
}
|
|
120
121
|
catch (err) {
|
|
121
122
|
logger_1.default.error('Fetch error');
|
|
@@ -224,47 +225,39 @@ class Agent extends events_1.default {
|
|
|
224
225
|
if (this.tunnelsUpdating)
|
|
225
226
|
return;
|
|
226
227
|
this.tunnelsUpdating = true;
|
|
227
|
-
let hasTunnels = false;
|
|
228
|
-
let haveTunnels = false;
|
|
229
228
|
try {
|
|
230
229
|
const tt = [...this.tunnels];
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
sshHostKey
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
}
|
|
257
|
-
else if (tunnel.hasChanged(data)) {
|
|
258
|
-
tunnel.recreate(data);
|
|
259
|
-
}
|
|
260
|
-
});
|
|
261
|
-
}
|
|
230
|
+
tt.forEach((tunnel) => {
|
|
231
|
+
if (!tunnels.find((t) => t.id === tunnel.id)) {
|
|
232
|
+
this.destroyTunnel(tunnel.id);
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
tunnels.forEach((data) => {
|
|
236
|
+
let sshHostKey;
|
|
237
|
+
if (this.manager)
|
|
238
|
+
sshHostKey = this.manager.sshHostKey;
|
|
239
|
+
const tunnel = tt.find((tunnel) => data.id === tunnel.id);
|
|
240
|
+
if (!tunnel) {
|
|
241
|
+
this.addTunnel(new tunnel_1.default({
|
|
242
|
+
...data,
|
|
243
|
+
sshHostKey,
|
|
244
|
+
agent: {
|
|
245
|
+
id: this.id,
|
|
246
|
+
host: this.host,
|
|
247
|
+
token: this.token,
|
|
248
|
+
},
|
|
249
|
+
}));
|
|
250
|
+
}
|
|
251
|
+
else if (tunnel.hasChanged(data)) {
|
|
252
|
+
tunnel.recreate(data);
|
|
253
|
+
}
|
|
254
|
+
});
|
|
262
255
|
}
|
|
263
256
|
catch {
|
|
264
257
|
// do nothing
|
|
265
258
|
}
|
|
266
259
|
this.tunnelsUpdating = false;
|
|
267
|
-
if (!this.service &&
|
|
260
|
+
if (!this.service && !tunnels.length) {
|
|
268
261
|
output_1.default.exitError(texts_1.ERR_TUNNEL_REMOVED);
|
|
269
262
|
}
|
|
270
263
|
}
|
|
@@ -29,19 +29,21 @@ class AgentSocketClient extends events_1.default {
|
|
|
29
29
|
logger_1.default.debug(data);
|
|
30
30
|
this.socket.emit(msg, data);
|
|
31
31
|
}
|
|
32
|
-
fetch(activate = true, action = null, disabled = null, resetFirstHeard = false, tunnels, forceThrough = false) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
32
|
+
fetch(activate = true, action = null, disabled = null, resetFirstHeard = false, tunnels, forceThrough = false, timeout = 0) {
|
|
33
|
+
setTimeout(() => {
|
|
34
|
+
this.socketEmit('fetchTunnelAgent', {
|
|
35
|
+
id: this.id,
|
|
36
|
+
token: this.token,
|
|
37
|
+
hostname: this.hostname,
|
|
38
|
+
platform: this.platform,
|
|
39
|
+
version: this.version,
|
|
40
|
+
activate,
|
|
41
|
+
action,
|
|
42
|
+
disabled,
|
|
43
|
+
resetFirstHeard,
|
|
44
|
+
tunnels,
|
|
45
|
+
}, forceThrough);
|
|
46
|
+
}, timeout);
|
|
45
47
|
}
|
|
46
48
|
update(activate, tunnels, force = false) {
|
|
47
49
|
const now = Date.now();
|
|
@@ -21,7 +21,7 @@ commandSandboxList.action(async (options) => {
|
|
|
21
21
|
output_1.default.exitNormal('No sandboxes found');
|
|
22
22
|
}
|
|
23
23
|
const data = [
|
|
24
|
-
['NAME', 'STATUS', '
|
|
24
|
+
['NAME', 'STATUS', 'SETUP_STATUS', 'ID', 'IDENTIFIER', 'URL'],
|
|
25
25
|
];
|
|
26
26
|
for (const sandbox of sandboxes) {
|
|
27
27
|
data.push([
|