bdy 1.22.8-dev → 1.22.10-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
|
@@ -59,7 +59,9 @@ class AgentManagerClass {
|
|
|
59
59
|
this.ws.close();
|
|
60
60
|
}
|
|
61
61
|
if (this.server) {
|
|
62
|
-
|
|
62
|
+
if (!(0, utils_1.isWindows)()) {
|
|
63
|
+
this.connections.forEach((socket) => socket.resetAndDestroy());
|
|
64
|
+
}
|
|
63
65
|
this.server.close(() => {
|
|
64
66
|
process.exit(0);
|
|
65
67
|
});
|
|
@@ -100,6 +100,7 @@ class AgentWindows extends system_1.default {
|
|
|
100
100
|
}
|
|
101
101
|
if (user && pass) {
|
|
102
102
|
await this.nssm(`set bdy ObjectName ${user} ${pass}`);
|
|
103
|
+
await this.grantAccess(user);
|
|
103
104
|
}
|
|
104
105
|
else {
|
|
105
106
|
await this.nssm('reset bdy ObjectName');
|
|
@@ -149,6 +150,7 @@ class AgentWindows extends system_1.default {
|
|
|
149
150
|
await this.nssm(`set bdy AppEnvironmentExtra DEBUG=${debug ? 1 : 0}`);
|
|
150
151
|
if (user && pass) {
|
|
151
152
|
await this.nssm(`set bdy ObjectName ${user} ${pass}`);
|
|
153
|
+
await this.grantAccess(user);
|
|
152
154
|
}
|
|
153
155
|
if (start) {
|
|
154
156
|
try {
|
|
@@ -190,5 +192,15 @@ class AgentWindows extends system_1.default {
|
|
|
190
192
|
});
|
|
191
193
|
});
|
|
192
194
|
}
|
|
195
|
+
grantAccess(user) {
|
|
196
|
+
return new Promise((resolve, reject) => {
|
|
197
|
+
(0, child_process_1.exec)(`icacls "${this.getSystemConfigDir()}" /grant "${user}":(OI)(CI)F /T`, (err) => {
|
|
198
|
+
if (!err)
|
|
199
|
+
resolve();
|
|
200
|
+
else
|
|
201
|
+
reject(err);
|
|
202
|
+
});
|
|
203
|
+
});
|
|
204
|
+
}
|
|
193
205
|
}
|
|
194
206
|
exports.default = AgentWindows;
|
|
@@ -20,7 +20,7 @@ const openSocket = (port, path) => {
|
|
|
20
20
|
};
|
|
21
21
|
const makeRequest = async (port, path, body) => {
|
|
22
22
|
const c = new AbortController();
|
|
23
|
-
setTimeout(() => {
|
|
23
|
+
const timer = setTimeout(() => {
|
|
24
24
|
c.abort();
|
|
25
25
|
}, TIMEOUT);
|
|
26
26
|
logger_1.default.debug(`TUNNEL API AGENT REQUEST: :${port}${path}`);
|
|
@@ -31,6 +31,7 @@ const makeRequest = async (port, path, body) => {
|
|
|
31
31
|
method: 'POST',
|
|
32
32
|
signal: c.signal,
|
|
33
33
|
});
|
|
34
|
+
clearTimeout(timer);
|
|
34
35
|
logger_1.default.debug(`TUNNEL API AGENT RESPONSE: ${response.status}`);
|
|
35
36
|
if (response.status === 404) {
|
|
36
37
|
throw new Error(texts_1.ERR_NOT_FOUND);
|