@meru2802/aux-server 1.0.12 → 1.0.14
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/config/index.d.ts +1 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/controllers/apiController.d.ts.map +1 -1
- package/dist/controllers/apiController.js +158 -3
- package/dist/controllers/coreController.d.ts.map +1 -1
- package/dist/controllers/coreController.js +153 -86
- package/dist/controllers/healthController.js +1 -1
- package/dist/types/index.d.ts +4 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/schemas/index.d.ts +1 -0
- package/dist/types/schemas/index.d.ts.map +1 -1
- package/dist/types/schemas/index.js +8 -0
- package/package.json +2 -2
package/dist/config/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAgB;IACvC,OAAO,CAAC,MAAM,CAAS;IAEvB,OAAO;WAIO,WAAW,IAAI,aAAa;IAO1C,OAAO,CAAC,UAAU;IAwDX,SAAS,IAAI,MAAM;IAInB,aAAa;;;;;;;IAIb,WAAW;;;;;;;IAIX,gBAAgB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAgB;IACvC,OAAO,CAAC,MAAM,CAAS;IAEvB,OAAO;WAIO,WAAW,IAAI,aAAa;IAO1C,OAAO,CAAC,UAAU;IAwDX,SAAS,IAAI,MAAM;IAInB,aAAa;;;;;;;IAIb,WAAW;;;;;;;IAIX,gBAAgB;;;;;;IAIhB,gBAAgB;;;;;;;;CAGxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apiController.d.ts","sourceRoot":"","sources":["../../src/controllers/apiController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"apiController.d.ts","sourceRoot":"","sources":["../../src/controllers/apiController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAOjE,qBAAa,aAAc,SAAQ,cAAc;gBACnC,gBAAgB,CAAC,EAAE,iBAAiB;IAIzC,YAAY,GAAU,KAAK,OAAO,EAAE,KAAK,QAAQ,KAAG,OAAO,CAAC,IAAI,CAAC,CA2EtE;IAEK,cAAc,GACnB,KAAK,OAAO,EACZ,KAAK,QAAQ,KACZ,OAAO,CAAC,IAAI,CAAC,CA+Pd;CACH"}
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.ApiController = void 0;
|
|
7
7
|
const BaseController_1 = require("./BaseController");
|
|
8
8
|
const utils_1 = require("../lib/utils");
|
|
9
|
+
const utils_2 = require("@meru2802/rmm-lib/utils");
|
|
9
10
|
const axios_1 = __importDefault(require("axios"));
|
|
10
11
|
class ApiController extends BaseController_1.BaseController {
|
|
11
12
|
constructor(serviceContainer) {
|
|
@@ -71,10 +72,11 @@ class ApiController extends BaseController_1.BaseController {
|
|
|
71
72
|
}
|
|
72
73
|
};
|
|
73
74
|
this.getConnectUrls = async (req, res) => {
|
|
74
|
-
var _a;
|
|
75
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
75
76
|
try {
|
|
76
77
|
const meshNodeId = req.body.meshNodeId;
|
|
77
78
|
const userId = req.body.userId;
|
|
79
|
+
const isApplet = req.body.isApplet;
|
|
78
80
|
if (!meshNodeId || !userId) {
|
|
79
81
|
const errorResponse = {
|
|
80
82
|
error: "'meshNodeId' or 'userId' are missing in body params",
|
|
@@ -83,7 +85,7 @@ class ApiController extends BaseController_1.BaseController {
|
|
|
83
85
|
res.status(400).json(errorResponse);
|
|
84
86
|
return;
|
|
85
87
|
}
|
|
86
|
-
const nexus_epm_user_id_query = "SELECT id FROM accounts_user WHERE username= $1";
|
|
88
|
+
const nexus_epm_user_id_query = "SELECT id, role_id FROM accounts_user WHERE username= $1";
|
|
87
89
|
const nexus_epm_user_id = await this.dbPool.query(nexus_epm_user_id_query, [userId]);
|
|
88
90
|
if (nexus_epm_user_id.rows.length === 0) {
|
|
89
91
|
const errorResponse = {
|
|
@@ -93,7 +95,160 @@ class ApiController extends BaseController_1.BaseController {
|
|
|
93
95
|
res.status(400).json(errorResponse);
|
|
94
96
|
return;
|
|
95
97
|
}
|
|
96
|
-
|
|
98
|
+
if (!isApplet) {
|
|
99
|
+
const nexus_epm_agent_id_query = "SELECT agent_id, site_id FROM agents_agent where mesh_node_id= $1";
|
|
100
|
+
const nexus_epm_agent_id = await this.dbPool.query(nexus_epm_agent_id_query, [meshNodeId]);
|
|
101
|
+
if (!((_a = nexus_epm_user_id.rows[0]) === null || _a === void 0 ? void 0 : _a.role_id)) {
|
|
102
|
+
const errorResponse = {
|
|
103
|
+
error: `'Role id corresponding to user ${userId}' Not Found`,
|
|
104
|
+
timestamp: new Date().toISOString(),
|
|
105
|
+
};
|
|
106
|
+
res.status(400).json(errorResponse);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
if (nexus_epm_agent_id.rows.length === 0) {
|
|
110
|
+
const errorResponse = {
|
|
111
|
+
error: `'Agent Id corresponding to mesh node id ${meshNodeId}' Not Found`,
|
|
112
|
+
timestamp: new Date().toISOString(),
|
|
113
|
+
};
|
|
114
|
+
res.status(400).json(errorResponse);
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
const nexus_epm_agent_client_id_query = "SELECT client_id FROM clients_site WHERE id= $1";
|
|
118
|
+
const nexus_epm_agent_client_id = await this.dbPool.query(nexus_epm_agent_client_id_query, [
|
|
119
|
+
(_b = nexus_epm_agent_id.rows[0]) === null || _b === void 0 ? void 0 : _b.site_id,
|
|
120
|
+
]);
|
|
121
|
+
if (nexus_epm_agent_client_id.rows.length === 0) {
|
|
122
|
+
const errorResponse = {
|
|
123
|
+
error: `'Client ID corresponding to site id ${(_c = nexus_epm_agent_id.rows[0]) === null || _c === void 0 ? void 0 : _c.site_id}' Not Found`,
|
|
124
|
+
timestamp: new Date().toISOString(),
|
|
125
|
+
};
|
|
126
|
+
res.status(400).json(errorResponse);
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
const nexus_epm_role_client_ids_query = "SELECT client_id FROM accounts_role_can_view_clients WHERE role_id= $1";
|
|
130
|
+
const nexus_epm_role_site_ids_query = "SELECT site_id FROM accounts_role_can_view_sites WHERE role_id= $1";
|
|
131
|
+
const [nexus_epm_role_client_ids, nexus_epm_role_site_ids] = await Promise.all([
|
|
132
|
+
this.dbPool.query(nexus_epm_role_client_ids_query, [
|
|
133
|
+
(_d = nexus_epm_user_id.rows[0]) === null || _d === void 0 ? void 0 : _d.role_id,
|
|
134
|
+
]),
|
|
135
|
+
this.dbPool.query(nexus_epm_role_site_ids_query, [
|
|
136
|
+
(_e = nexus_epm_user_id.rows[0]) === null || _e === void 0 ? void 0 : _e.role_id,
|
|
137
|
+
]),
|
|
138
|
+
]);
|
|
139
|
+
const roleHasPermissionForAgentClient = () => {
|
|
140
|
+
var _a, _b;
|
|
141
|
+
for (let i = 0; i < nexus_epm_role_client_ids.rows.length; i++) {
|
|
142
|
+
if (((_a = nexus_epm_role_client_ids.rows[i]) === null || _a === void 0 ? void 0 : _a.client_id) ==
|
|
143
|
+
((_b = nexus_epm_agent_client_id.rows[0]) === null || _b === void 0 ? void 0 : _b.client_id)) {
|
|
144
|
+
return true;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return false;
|
|
148
|
+
};
|
|
149
|
+
const roleHasPermissionForAgentSite = () => {
|
|
150
|
+
var _a, _b;
|
|
151
|
+
for (let i = 0; i < nexus_epm_role_site_ids.rows.length; i++) {
|
|
152
|
+
if (((_a = nexus_epm_role_site_ids.rows[i]) === null || _a === void 0 ? void 0 : _a.site_id) ==
|
|
153
|
+
((_b = nexus_epm_agent_id.rows[0]) === null || _b === void 0 ? void 0 : _b.site_id)) {
|
|
154
|
+
return true;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return false;
|
|
158
|
+
};
|
|
159
|
+
if (!roleHasPermissionForAgentSite &&
|
|
160
|
+
!roleHasPermissionForAgentClient) {
|
|
161
|
+
const errorResponse = {
|
|
162
|
+
error: `'User ${userId}' does not have permission to take control of machine with mesh node id ${meshNodeId}`,
|
|
163
|
+
timestamp: new Date().toISOString(),
|
|
164
|
+
};
|
|
165
|
+
res.status(401).json(errorResponse);
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
const meshUser = `user//${userId}___${(_f = nexus_epm_user_id.rows[0]) === null || _f === void 0 ? void 0 : _f.id}`.toLowerCase();
|
|
170
|
+
const meshUserWithoutDomain = `${userId}___${(_g = nexus_epm_user_id.rows[0]) === null || _g === void 0 ? void 0 : _g.id}`.toLowerCase();
|
|
171
|
+
const addUserToDevice = async () => {
|
|
172
|
+
const rights = 4088024;
|
|
173
|
+
const responseId = `id-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
174
|
+
const base64NodeId = (0, utils_2.hexToBase64)(meshNodeId);
|
|
175
|
+
const addDeviceUserMessage = {
|
|
176
|
+
action: "adddeviceuser",
|
|
177
|
+
responseid: responseId,
|
|
178
|
+
usernames: [meshUserWithoutDomain],
|
|
179
|
+
nodeid: base64NodeId,
|
|
180
|
+
rights: rights,
|
|
181
|
+
};
|
|
182
|
+
console.log(JSON.stringify(addDeviceUserMessage));
|
|
183
|
+
const messageSent = this.WebSocketService.sendMessage(addDeviceUserMessage);
|
|
184
|
+
if (!messageSent) {
|
|
185
|
+
console.error("Could not send adddeviceuser message over socket");
|
|
186
|
+
return false;
|
|
187
|
+
}
|
|
188
|
+
if (!this.webSocket) {
|
|
189
|
+
console.error("Socket not found");
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
return new Promise((resolve, reject) => {
|
|
193
|
+
let responseReceived = false;
|
|
194
|
+
const timeout = setTimeout(() => {
|
|
195
|
+
if (!responseReceived) {
|
|
196
|
+
responseReceived = true;
|
|
197
|
+
console.error("Timeout waiting for adddeviceuser response");
|
|
198
|
+
resolve(false);
|
|
199
|
+
}
|
|
200
|
+
}, 10000);
|
|
201
|
+
const messageHandler = (data) => {
|
|
202
|
+
var _a, _b;
|
|
203
|
+
if (responseReceived)
|
|
204
|
+
return;
|
|
205
|
+
try {
|
|
206
|
+
const message = JSON.parse(data.toString());
|
|
207
|
+
if (message.responseid === responseId) {
|
|
208
|
+
responseReceived = true;
|
|
209
|
+
clearTimeout(timeout);
|
|
210
|
+
(_a = this.webSocket) === null || _a === void 0 ? void 0 : _a.removeListener("message", messageHandler);
|
|
211
|
+
if (message.result === "ok" || message.success === true) {
|
|
212
|
+
console.log(`Successfully added user ${meshUser} to device ${base64NodeId}`);
|
|
213
|
+
resolve(true);
|
|
214
|
+
}
|
|
215
|
+
else {
|
|
216
|
+
console.error(`Failed to add user to device: ${message.result || message.error}`);
|
|
217
|
+
resolve(false);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
else if (message.action === "adddeviceuser" &&
|
|
221
|
+
!message.responseid) {
|
|
222
|
+
responseReceived = true;
|
|
223
|
+
clearTimeout(timeout);
|
|
224
|
+
(_b = this.webSocket) === null || _b === void 0 ? void 0 : _b.removeListener("message", messageHandler);
|
|
225
|
+
if (message.result === "ok" || message.success === true) {
|
|
226
|
+
console.log(`Successfully added user ${meshUser} to device ${base64NodeId}`);
|
|
227
|
+
resolve(true);
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
console.error(`Failed to add user to device: ${message.result || message.error}`);
|
|
231
|
+
resolve(false);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
catch (parseError) {
|
|
236
|
+
console.error("Error parsing WebSocket message:", parseError);
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
this.webSocket.on("message", messageHandler);
|
|
240
|
+
});
|
|
241
|
+
};
|
|
242
|
+
const userAdded = await addUserToDevice();
|
|
243
|
+
if (!userAdded) {
|
|
244
|
+
console.warn(`Could not add user ${meshUser} to device ${meshNodeId}, proceeding anyway`);
|
|
245
|
+
const errorResponse = {
|
|
246
|
+
error: `Failed to grant user ${userId} access to device`,
|
|
247
|
+
timestamp: new Date().toISOString(),
|
|
248
|
+
};
|
|
249
|
+
res.status(500).json(errorResponse);
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
97
252
|
const loginEncryptionKey = (0, utils_1.getBinaryKey)(this.config.meshcentralConfig.loginEncryptionKey);
|
|
98
253
|
const authRelayCookie = (0, utils_1.encodeCookie)({ a: 3, u: meshUser }, loginEncryptionKey);
|
|
99
254
|
const token_param = `login=${authRelayCookie}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coreController.d.ts","sourceRoot":"","sources":["../../src/controllers/coreController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAgBlD,qBAAa,cAAe,SAAQ,cAAc;gBACpC,gBAAgB,CAAC,EAAE,iBAAiB;IAIzC,eAAe,GACpB,KAAK,OAAO,EACZ,KAAK,QAAQ,KACZ,OAAO,CAAC,IAAI,CAAC,CAkJd;IAEK,iBAAiB,GACtB,KAAK,OAAO,EACZ,KAAK,QAAQ,KACZ,OAAO,CAAC,IAAI,CAAC,CAoHd;IAEK,cAAc,GACnB,KAAK,OAAO,EACZ,KAAK,QAAQ,KACZ,OAAO,CAAC,IAAI,CAAC,CA8Ld;IAEK,wBAAwB,GAC7B,KAAK,OAAO,EACZ,KAAK,QAAQ,KACZ,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"coreController.d.ts","sourceRoot":"","sources":["../../src/controllers/coreController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAgBlD,qBAAa,cAAe,SAAQ,cAAc;gBACpC,gBAAgB,CAAC,EAAE,iBAAiB;IAIzC,eAAe,GACpB,KAAK,OAAO,EACZ,KAAK,QAAQ,KACZ,OAAO,CAAC,IAAI,CAAC,CAkJd;IAEK,iBAAiB,GACtB,KAAK,OAAO,EACZ,KAAK,QAAQ,KACZ,OAAO,CAAC,IAAI,CAAC,CAoHd;IAEK,cAAc,GACnB,KAAK,OAAO,EACZ,KAAK,QAAQ,KACZ,OAAO,CAAC,IAAI,CAAC,CA8Ld;IAEK,wBAAwB,GAC7B,KAAK,OAAO,EACZ,KAAK,QAAQ,KACZ,OAAO,CAAC,IAAI,CAAC,CA8iBd;CACH"}
|
|
@@ -391,8 +391,56 @@ class CoreController extends BaseController_1.BaseController {
|
|
|
391
391
|
try {
|
|
392
392
|
const { clientId, siteId, agentType, endpointUrl, os } = req.body;
|
|
393
393
|
const baseUrl = `https://${this.config.epmConfig.server}`;
|
|
394
|
-
|
|
395
|
-
|
|
394
|
+
//Get Org_id, Site_id, AssetTypeID, and Org_token form db
|
|
395
|
+
const iceberg_org_id_query = "SELECT string_value FROM clients_clientcustomfield WHERE client_id = $1";
|
|
396
|
+
const iceberg_site_id_query = "SELECT string_value FROM clients_sitecustomfield WHERE site_id = $1";
|
|
397
|
+
const iceberg_org_token_query = "SELECT string_value FROM clients_clientcustomfield WHERE client_id = $1 AND field_id = $2";
|
|
398
|
+
const iceberg_asset_type_id_query = "SELECT string_value FROM clients_clientcustomfield WHERE client_id = $1 AND field_id = $2";
|
|
399
|
+
console.log(`[getAgentDetails] Executing parallel queries for iceberg details`);
|
|
400
|
+
const iceberg_org_id_promise = this.dbPool.query(iceberg_org_id_query, [clientId]);
|
|
401
|
+
const iceberg_site_id_promise = this.dbPool.query(iceberg_site_id_query, [siteId]);
|
|
402
|
+
const iceberg_org_token_promise = this.dbPool.query(iceberg_org_token_query, [
|
|
403
|
+
clientId,
|
|
404
|
+
this.config.epmConfig.tokenFieldId,
|
|
405
|
+
]);
|
|
406
|
+
const iceberg_asset_type_id_promise = this.dbPool.query(iceberg_asset_type_id_query, [
|
|
407
|
+
clientId,
|
|
408
|
+
this.config.epmConfig.assetTypeFieldId,
|
|
409
|
+
]);
|
|
410
|
+
let [iceberg_ord_id, iceberg_site_id, iceberg_org_token, iceberg_asset_type_id,] = await Promise.all([
|
|
411
|
+
iceberg_org_id_promise,
|
|
412
|
+
iceberg_site_id_promise,
|
|
413
|
+
iceberg_org_token_promise,
|
|
414
|
+
iceberg_asset_type_id_promise,
|
|
415
|
+
]);
|
|
416
|
+
console.log(`[getAgentDetails] Iceberg queries completed with results:`, {
|
|
417
|
+
org_id_rows: iceberg_ord_id.rows.length,
|
|
418
|
+
site_id_rows: iceberg_site_id.rows.length,
|
|
419
|
+
org_token_rows: iceberg_org_token.rows.length,
|
|
420
|
+
asset_type_id_rows: iceberg_asset_type_id.rows.length,
|
|
421
|
+
});
|
|
422
|
+
if (iceberg_ord_id.rows.length > 0 &&
|
|
423
|
+
iceberg_site_id.rows.length > 0 &&
|
|
424
|
+
iceberg_org_token.rows.length > 0 &&
|
|
425
|
+
iceberg_asset_type_id.rows.length > 0) {
|
|
426
|
+
const siteRow = iceberg_site_id.rows[0];
|
|
427
|
+
const orgRow = iceberg_ord_id.rows[0];
|
|
428
|
+
const orgTokenRow = iceberg_org_token.rows[0];
|
|
429
|
+
const assetTypeRow = iceberg_asset_type_id.rows[0];
|
|
430
|
+
if (!siteRow || !orgRow || !orgTokenRow || !assetTypeRow) {
|
|
431
|
+
const errorResponse = {
|
|
432
|
+
error: "Either SiteId, OrgId, OrgToken, or AssetTypeId is missing",
|
|
433
|
+
timestamp: new Date().toISOString(),
|
|
434
|
+
};
|
|
435
|
+
res.status(501).json(errorResponse);
|
|
436
|
+
return;
|
|
437
|
+
}
|
|
438
|
+
const assetTypeId = assetTypeRow.string_value;
|
|
439
|
+
const icebergSiteId = siteRow.string_value;
|
|
440
|
+
const icebergOrgId = orgRow.string_value;
|
|
441
|
+
const icebergOrgToken = orgTokenRow.string_value;
|
|
442
|
+
if (os == types_1.OperatingSystems.WINDOWS) {
|
|
443
|
+
const script = `
|
|
396
444
|
$endpointsetup = 'nexus-endpoint-v0.1.0-i32-setup.exe'
|
|
397
445
|
$api = '"${baseUrl}"'
|
|
398
446
|
$clientid = '${clientId}'
|
|
@@ -404,13 +452,18 @@ $ping = 0
|
|
|
404
452
|
$auth = '"${this.config.epmConfig.installerToken}"'
|
|
405
453
|
$endpointdownloadlink = '${endpointUrl}'
|
|
406
454
|
$apilink = $endpointdownloadlink.split('/')
|
|
455
|
+
$assetTypeId = '"${assetTypeId}"'
|
|
456
|
+
$icebergSiteId = '"${icebergSiteId}"'
|
|
457
|
+
$icebergOrgId = '"${icebergOrgId}"'
|
|
458
|
+
$icebergOrgToken = '"${icebergOrgToken}"'
|
|
459
|
+
$assetEndpoint = '"${this.config.icebergConfig.assetEndpoint}"'
|
|
407
460
|
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
|
408
461
|
$serviceName = 'nexusrmm'
|
|
409
462
|
If (Get-Service $serviceName -ErrorAction SilentlyContinue) {
|
|
410
463
|
write-host ('Nexus RMM Agent Is Already Installed')
|
|
411
464
|
} Else {
|
|
412
465
|
$OutPath = $env:TMP
|
|
413
|
-
$installArgs = @('-m install --api ', "$api", '--client-id', $clientid, '--site-id', $siteid, '--agent-type', "$agenttype", '--auth', "$auth", '-silent')
|
|
466
|
+
$installArgs = @('-m install --api ', "$api", '--client-id', $clientid, '--site-id', $siteid, '--agent-type', "$agenttype", '--auth', "$auth", '--asset-type-id', "$assetTypeId", '--iceberg-site-id', "$icebergSiteId", '--iceberg-org-id', "$icebergOrgId", '--iceberg-org-token', "$icebergOrgToken", '--asset-api', "$assetEndpoint", '-silent')
|
|
414
467
|
if ($power) {
|
|
415
468
|
$installArgs += "--power"
|
|
416
469
|
}
|
|
@@ -465,81 +518,81 @@ If (Get-Service $serviceName -ErrorAction SilentlyContinue) {
|
|
|
465
518
|
}
|
|
466
519
|
}
|
|
467
520
|
`;
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
}
|
|
472
|
-
else if (os == types_1.OperatingSystems.LINUX) {
|
|
473
|
-
const meshesMessageSent = this.WebSocketService.sendMessage({
|
|
474
|
-
action: "meshes",
|
|
475
|
-
responseid: "meshctrl",
|
|
476
|
-
});
|
|
477
|
-
if (!meshesMessageSent) {
|
|
478
|
-
const errorResponse = {
|
|
479
|
-
error: "Could Not Send Message Over Socket",
|
|
480
|
-
timestamp: new Date().toISOString(),
|
|
481
|
-
};
|
|
482
|
-
res.status(500).json(errorResponse);
|
|
483
|
-
return;
|
|
484
|
-
}
|
|
485
|
-
if (!this.webSocket) {
|
|
486
|
-
const errorResponse = {
|
|
487
|
-
error: "Socket Not Found",
|
|
488
|
-
timestamp: new Date().toISOString(),
|
|
489
|
-
};
|
|
490
|
-
res.status(500).json(errorResponse);
|
|
491
|
-
return;
|
|
521
|
+
res.setHeader("X-Script-Type", "powershell");
|
|
522
|
+
res.setHeader("Content-Type", "text/plain; charset=utf-8");
|
|
523
|
+
res.status(200).send(script);
|
|
492
524
|
}
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
525
|
+
else if (os == types_1.OperatingSystems.LINUX) {
|
|
526
|
+
const meshesMessageSent = this.WebSocketService.sendMessage({
|
|
527
|
+
action: "meshes",
|
|
528
|
+
responseid: "meshctrl",
|
|
529
|
+
});
|
|
530
|
+
if (!meshesMessageSent) {
|
|
531
|
+
const errorResponse = {
|
|
532
|
+
error: "Could Not Send Message Over Socket",
|
|
533
|
+
timestamp: new Date().toISOString(),
|
|
534
|
+
};
|
|
535
|
+
res.status(500).json(errorResponse);
|
|
536
|
+
return;
|
|
537
|
+
}
|
|
538
|
+
if (!this.webSocket) {
|
|
539
|
+
const errorResponse = {
|
|
540
|
+
error: "Socket Not Found",
|
|
541
|
+
timestamp: new Date().toISOString(),
|
|
542
|
+
};
|
|
543
|
+
res.status(500).json(errorResponse);
|
|
544
|
+
return;
|
|
545
|
+
}
|
|
546
|
+
const waitForMeshResponse = new Promise((resolve, reject) => {
|
|
547
|
+
let responseReceived = false;
|
|
548
|
+
const timeout = setTimeout(() => {
|
|
549
|
+
if (!responseReceived) {
|
|
508
550
|
responseReceived = true;
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
551
|
+
reject(new Error("Timeout waiting for mesh response"));
|
|
552
|
+
}
|
|
553
|
+
}, 10000);
|
|
554
|
+
const messageHandler = (data) => {
|
|
555
|
+
var _a, _b;
|
|
556
|
+
if (responseReceived)
|
|
557
|
+
return;
|
|
558
|
+
try {
|
|
559
|
+
const message = JSON.parse(data.toString());
|
|
560
|
+
if (message.action === types_1.MeshActions.MESH_ES) {
|
|
561
|
+
responseReceived = true;
|
|
562
|
+
clearTimeout(timeout);
|
|
563
|
+
(_a = this.webSocket) === null || _a === void 0 ? void 0 : _a.removeListener("message", messageHandler);
|
|
564
|
+
const meshesMessasge = message;
|
|
565
|
+
console.log(`meshes: ${JSON.stringify(meshesMessasge)}`);
|
|
566
|
+
const mesh = meshesMessasge.meshes.find((mesh) => mesh.name == "TacticalRMM");
|
|
567
|
+
if (!mesh) {
|
|
568
|
+
reject(new Error("Mesh Not Found"));
|
|
569
|
+
return;
|
|
570
|
+
}
|
|
571
|
+
const deviceGroupId = mesh._id.split("/")[2];
|
|
572
|
+
if (!deviceGroupId) {
|
|
573
|
+
reject(new Error("Error parsing deviceGroupId"));
|
|
574
|
+
return;
|
|
575
|
+
}
|
|
576
|
+
const response = {
|
|
577
|
+
deviceGroupId,
|
|
578
|
+
};
|
|
579
|
+
resolve(response);
|
|
522
580
|
}
|
|
523
|
-
const response = {
|
|
524
|
-
deviceGroupId,
|
|
525
|
-
};
|
|
526
|
-
resolve(response);
|
|
527
581
|
}
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
582
|
+
catch (parseError) {
|
|
583
|
+
if (!responseReceived) {
|
|
584
|
+
responseReceived = true;
|
|
585
|
+
clearTimeout(timeout);
|
|
586
|
+
(_b = this.webSocket) === null || _b === void 0 ? void 0 : _b.removeListener("message", messageHandler);
|
|
587
|
+
reject(parseError);
|
|
588
|
+
}
|
|
535
589
|
}
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
const script = `
|
|
590
|
+
};
|
|
591
|
+
this.webSocket.on("message", messageHandler);
|
|
592
|
+
});
|
|
593
|
+
try {
|
|
594
|
+
const response = await waitForMeshResponse;
|
|
595
|
+
const script = `
|
|
543
596
|
#!/usr/bin/env bash
|
|
544
597
|
|
|
545
598
|
if [ $EUID -ne 0 ]; then
|
|
@@ -589,6 +642,11 @@ token='${this.config.epmConfig.installerToken}'
|
|
|
589
642
|
clientID='${clientId}'
|
|
590
643
|
siteID='${siteId}'
|
|
591
644
|
agentType='${agentType}'
|
|
645
|
+
assetTypeId='${assetTypeId}'
|
|
646
|
+
icebergSiteId='${icebergSiteId}'
|
|
647
|
+
icebergOrgId='${icebergOrgId}'
|
|
648
|
+
icebergOrgToken='${icebergOrgToken}'
|
|
649
|
+
assetEndpoint='${this.config.icebergConfig.assetEndpoint}'
|
|
592
650
|
proxy=''
|
|
593
651
|
|
|
594
652
|
agentBinPath='/usr/local/bin'
|
|
@@ -743,7 +801,7 @@ if [ ! -d "\${agentBinPath}" ]; then
|
|
|
743
801
|
mkdir -p \${agentBinPath}
|
|
744
802
|
fi
|
|
745
803
|
|
|
746
|
-
INSTALL_CMD="\${agentBin} -m install -api \${apiURL} -client-id \${clientID} -site-id \${siteID} -agent-type \${agentType} -auth \${token}"
|
|
804
|
+
INSTALL_CMD="\${agentBin} -m install -api \${apiURL} -client-id \${clientID} -site-id \${siteID} -agent-type \${agentType} -auth \${token} -asset-type-id \${assetTypeId} -iceberg-site-id \${icebergSiteId} -iceberg-org-id \${icebergOrgId} -iceberg-org-token \${icebergOrgToken} -asset-api \${assetEndpoint}"
|
|
747
805
|
|
|
748
806
|
if [ "\${MESH_NODE_ID}" != '' ]; then
|
|
749
807
|
INSTALL_CMD+=" --meshnodeid \${MESH_NODE_ID}"
|
|
@@ -791,26 +849,35 @@ systemctl start \${agentSvcName}
|
|
|
791
849
|
sudo systemctl restart gdm3
|
|
792
850
|
sudo systemctl restart systemd-logind
|
|
793
851
|
sudo dmidecode --string system-serial-number`;
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
852
|
+
res.setHeader("X-Script-Type", "bash");
|
|
853
|
+
res.setHeader("Content-Type", "text/plain; charset=utf-8");
|
|
854
|
+
res.status(200).send(script);
|
|
855
|
+
return;
|
|
856
|
+
}
|
|
857
|
+
catch (error) {
|
|
858
|
+
console.error("Error waiting for mesh response:", error);
|
|
859
|
+
const errorResponse = {
|
|
860
|
+
error: error instanceof Error
|
|
861
|
+
? error.message
|
|
862
|
+
: "Failed to get mesh response",
|
|
863
|
+
timestamp: new Date().toISOString(),
|
|
864
|
+
};
|
|
865
|
+
res.status(500).json(errorResponse);
|
|
866
|
+
return;
|
|
867
|
+
}
|
|
798
868
|
}
|
|
799
|
-
|
|
800
|
-
console.error("Error waiting for mesh response:", error);
|
|
869
|
+
else if (os == types_1.OperatingSystems.MACOS) {
|
|
801
870
|
const errorResponse = {
|
|
802
|
-
error:
|
|
803
|
-
? error.message
|
|
804
|
-
: "Failed to get mesh response",
|
|
871
|
+
error: "Macos script is not supported yet",
|
|
805
872
|
timestamp: new Date().toISOString(),
|
|
806
873
|
};
|
|
807
|
-
res.status(
|
|
874
|
+
res.status(501).json(errorResponse);
|
|
808
875
|
return;
|
|
809
876
|
}
|
|
810
877
|
}
|
|
811
|
-
else
|
|
878
|
+
else {
|
|
812
879
|
const errorResponse = {
|
|
813
|
-
error: "
|
|
880
|
+
error: "Either SiteId, OrgId, OrgToken, or AssetTypeId is missing",
|
|
814
881
|
timestamp: new Date().toISOString(),
|
|
815
882
|
};
|
|
816
883
|
res.status(501).json(errorResponse);
|
|
@@ -17,7 +17,7 @@ class HealthController extends BaseController_1.BaseController {
|
|
|
17
17
|
this.status = (req, res) => {
|
|
18
18
|
const response = {
|
|
19
19
|
service: "aux-server",
|
|
20
|
-
version: "1.0.
|
|
20
|
+
version: "1.0.14",
|
|
21
21
|
meshCentral: {
|
|
22
22
|
connected: this.isWebSocketConnected,
|
|
23
23
|
server: this.meshServer,
|
package/dist/types/index.d.ts
CHANGED
|
@@ -104,12 +104,15 @@ export interface Config {
|
|
|
104
104
|
epmConfig: {
|
|
105
105
|
server: string;
|
|
106
106
|
installerToken: string;
|
|
107
|
-
masterApiKey:
|
|
107
|
+
masterApiKey: string;
|
|
108
|
+
tokenFieldId: number;
|
|
109
|
+
assetTypeFieldId: number;
|
|
108
110
|
};
|
|
109
111
|
icebergConfig: {
|
|
110
112
|
eventsEndpoint: string;
|
|
111
113
|
introspectEndpoint: string;
|
|
112
114
|
HMAC_SECRET: string;
|
|
115
|
+
assetEndpoint: string;
|
|
113
116
|
};
|
|
114
117
|
dbConfig: {
|
|
115
118
|
host: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAEnC,oBAAY,WAAW;IACrB,OAAO,WAAW;IAClB,KAAK,UAAU;IACf,WAAW,eAAe;IAC1B,aAAa,gBAAgB;CAC9B;AAED,oBAAY,oBAAoB;IAC9B,YAAY,iBAAiB;CAC9B;AAED,oBAAY,UAAU;IACpB,WAAW,gBAAgB;IAC3B,MAAM,WAAW;CAClB;AAED,oBAAY,gBAAgB;IAC1B,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,OAAO,UAAU;CAClB;AAED,eAAO,MAAM,MAAM;;;;;CAKT,CAAC;AAEX,eAAO,MAAM,wBAAwB;;;;CAI3B,CAAC;AAEX,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAkB;IACj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,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,uCAAuC,EAAE,MAAM,CAAC;IAChD,yCAAyC,EAAE,MAAM,CAAC;IAClD,mDAAmD,EAAE,MAAM,CAAC;IAC5D,sDAAsD,EAAE,WAAW,CAAC;IACpE,mCAAmC,EAAE,WAAW,CAAC;CAClD;AAED,UAAU,WAAW;IACnB,CAAC,QAAQ,EAAE,MAAM,GAAG;QAClB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAAC;KAClC,CAAC;CACH"}
|
|
@@ -16,6 +16,7 @@ export declare const addUserToGroupSchema: z.ZodObject<{
|
|
|
16
16
|
export declare const generateConnectUrlsSchema: z.ZodObject<{
|
|
17
17
|
meshNodeId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
18
18
|
userId: z.ZodString;
|
|
19
|
+
isApplet: z.ZodPipe<z.ZodOptional<z.ZodBoolean>, z.ZodTransform<boolean | undefined, boolean | undefined>>;
|
|
19
20
|
}, z.core.$strip>;
|
|
20
21
|
export declare const getEndpointInstallScriptSchema: z.ZodObject<{
|
|
21
22
|
clientId: z.ZodNumber;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AACpB,OAAO,EACL,UAAU,EACV,gBAAgB,EAGjB,MAAM,IAAI,CAAC;AAEZ,eAAO,MAAM,0BAA0B;;;iBAkEpC,CAAC;AAEJ,eAAO,MAAM,uBAAuB;;;iBA+BlC,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;iBAkH9B,CAAC;AAEJ,eAAO,MAAM,yBAAyB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AACpB,OAAO,EACL,UAAU,EACV,gBAAgB,EAGjB,MAAM,IAAI,CAAC;AAEZ,eAAO,MAAM,0BAA0B;;;iBAkEpC,CAAC;AAEJ,eAAO,MAAM,uBAAuB;;;iBA+BlC,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;iBAkH9B,CAAC;AAEJ,eAAO,MAAM,yBAAyB;;;;iBAmEpC,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;;;;kBA6BvC,CAAC;AAEL,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAC/C,OAAO,0BAA0B,CAClC,CAAC;AACF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAC/E,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACzE,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,yBAAyB,CACjC,CAAC;AACF,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CACnD,OAAO,8BAA8B,CACtC,CAAC"}
|
|
@@ -195,6 +195,14 @@ exports.generateConnectUrlsSchema = zod_1.default.object({
|
|
|
195
195
|
}, {
|
|
196
196
|
message: "User ID cannot contain consecutive dots",
|
|
197
197
|
}),
|
|
198
|
+
isApplet: zod_1.default
|
|
199
|
+
.boolean()
|
|
200
|
+
.optional()
|
|
201
|
+
.describe("Indicates whether the connection URL is for an applet or standard application")
|
|
202
|
+
.refine((value) => value === undefined || typeof value === "boolean", {
|
|
203
|
+
message: "isApplet must be a boolean value",
|
|
204
|
+
})
|
|
205
|
+
.transform((value) => (value === undefined ? undefined : Boolean(value))),
|
|
198
206
|
});
|
|
199
207
|
exports.getEndpointInstallScriptSchema = zod_1.default
|
|
200
208
|
.object({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meru2802/aux-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.14",
|
|
4
4
|
"description": "Nexus EPM auxillary server to facilitate additional functionality required by Scogo Iceberg",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"author": "meru2802",
|
|
31
31
|
"license": "ISC",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@meru2802/rmm-lib": "^1.0.
|
|
33
|
+
"@meru2802/rmm-lib": "^1.0.6",
|
|
34
34
|
"axios": "^1.9.0",
|
|
35
35
|
"base-64": "^1.0.0",
|
|
36
36
|
"cookie-parser": "^1.4.7",
|