@meru2802/aux-server 1.0.7 → 1.0.8

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.
@@ -6,6 +6,6 @@ export declare class CoreController extends BaseController {
6
6
  getDownloadLink: (req: Request, res: Response) => Promise<void>;
7
7
  createDeviceGroup: (req: Request, res: Response) => Promise<void>;
8
8
  addUserToGroup: (req: Request, res: Response) => Promise<void>;
9
- getEndpointInstallScript: (req: Request, res: Response) => void;
9
+ getEndpointInstallScript: (req: Request, res: Response) => Promise<void>;
10
10
  }
11
11
  //# sourceMappingURL=coreController.d.ts.map
@@ -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;AAelD,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,GAAI,KAAK,OAAO,EAAE,KAAK,QAAQ,UAgF5D;CACH"}
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,CA8bd;CACH"}
@@ -10,7 +10,7 @@ class CoreController extends BaseController_1.BaseController {
10
10
  this.getDownloadLink = async (req, res) => {
11
11
  try {
12
12
  const deviceGroupName = req.body.deviceGroupName;
13
- const deviceGroupId = req.body.deviceGroupId; // Not required but if given then deviceGroupName is not required
13
+ const deviceGroupId = req.body.deviceGroupId;
14
14
  if (deviceGroupId) {
15
15
  const inviteEncryptionKey = (0, utils_1.getBinaryKey)(this.config.meshcentralConfig.inviteEncryptionKey);
16
16
  const meshcookie = (0, utils_1.encodeCookie)({ m: deviceGroupId.split("/")[2] }, inviteEncryptionKey);
@@ -70,7 +70,7 @@ class CoreController extends BaseController_1.BaseController {
70
70
  clearTimeout(timeout);
71
71
  (_a = this.webSocket) === null || _a === void 0 ? void 0 : _a.removeListener("message", messageHandler);
72
72
  const meshesMessasge = message;
73
- const mesh = meshesMessasge.meshes.find((mesh) => mesh.name === deviceGroupName);
73
+ const mesh = meshesMessasge.meshes.find((mesh) => mesh.name == deviceGroupName);
74
74
  if (!mesh) {
75
75
  reject(new Error("Mesh Not Found"));
76
76
  return;
@@ -387,10 +387,12 @@ class CoreController extends BaseController_1.BaseController {
387
387
  res.status(500).json(errorResponse);
388
388
  }
389
389
  };
390
- this.getEndpointInstallScript = (req, res) => {
391
- const { clientId, siteId, agentType, endpointUrl } = req.body;
392
- const baseUrl = `https://${this.config.epmConfig.server}`;
393
- const script = `
390
+ this.getEndpointInstallScript = async (req, res) => {
391
+ try {
392
+ const { clientId, siteId, agentType, endpointUrl, os } = req.body;
393
+ const baseUrl = `https://${this.config.epmConfig.server}`;
394
+ if (os == types_1.OperatingSystems.WINDOWS) {
395
+ const script = `
394
396
  $endpointsetup = 'nexus-endpoint-v0.1.0-i32-setup.exe'
395
397
  $api = '"${baseUrl}"'
396
398
  $clientid = '${clientId}'
@@ -463,9 +465,356 @@ If (Get-Service $serviceName -ErrorAction SilentlyContinue) {
463
465
  }
464
466
  }
465
467
  `;
466
- res.setHeader("X-Script-Type", "Powershell");
467
- res.setHeader("Content-Type", "text/plain; charset=utf-8");
468
- res.status(200).send(script);
468
+ res.setHeader("X-Script-Type", "powershell");
469
+ res.setHeader("Content-Type", "text/plain; charset=utf-8");
470
+ res.status(200).send(script);
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;
492
+ }
493
+ const waitForMeshResponse = new Promise((resolve, reject) => {
494
+ let responseReceived = false;
495
+ const timeout = setTimeout(() => {
496
+ if (!responseReceived) {
497
+ responseReceived = true;
498
+ reject(new Error("Timeout waiting for mesh response"));
499
+ }
500
+ }, 10000);
501
+ const messageHandler = (data) => {
502
+ var _a, _b;
503
+ if (responseReceived)
504
+ return;
505
+ try {
506
+ const message = JSON.parse(data.toString());
507
+ if (message.action === types_1.MeshActions.MESH_ES) {
508
+ responseReceived = true;
509
+ clearTimeout(timeout);
510
+ (_a = this.webSocket) === null || _a === void 0 ? void 0 : _a.removeListener("message", messageHandler);
511
+ const meshesMessasge = message;
512
+ console.log(`meshes: ${JSON.stringify(meshesMessasge)}`);
513
+ const mesh = meshesMessasge.meshes.find((mesh) => mesh.name == "TacticalRMM");
514
+ if (!mesh) {
515
+ reject(new Error("Mesh Not Found"));
516
+ return;
517
+ }
518
+ const deviceGroupId = mesh._id.split("/")[2];
519
+ if (!deviceGroupId) {
520
+ reject(new Error("Error parsing deviceGroupId"));
521
+ return;
522
+ }
523
+ const response = {
524
+ deviceGroupId,
525
+ };
526
+ resolve(response);
527
+ }
528
+ }
529
+ catch (parseError) {
530
+ if (!responseReceived) {
531
+ responseReceived = true;
532
+ clearTimeout(timeout);
533
+ (_b = this.webSocket) === null || _b === void 0 ? void 0 : _b.removeListener("message", messageHandler);
534
+ reject(parseError);
535
+ }
536
+ }
537
+ };
538
+ this.webSocket.on("message", messageHandler);
539
+ });
540
+ try {
541
+ const response = await waitForMeshResponse;
542
+ const script = `
543
+ #!/usr/bin/env bash
544
+
545
+ if [ $EUID -ne 0 ]; then
546
+ echo "ERROR: Must be run as root"
547
+ exit 1
548
+ fi
549
+
550
+ HAS_SYSTEMD=$(ps --no-headers -o comm 1)
551
+ if [ "\${HAS_SYSTEMD}" != 'systemd' ]; then
552
+ echo "This install script only supports systemd"
553
+ echo "Please install systemd or manually create the service using your systems's service manager"
554
+ exit 1
555
+ fi
556
+
557
+ sudo useradd -c "Scogo IT Support" -m -s /bin/bash scogo
558
+ echo 'scogo:Sc090@1947' | sudo chpasswd
559
+ sudo usermod -aG sudo,adm,cdrom,dip,plugdev,video scogo
560
+ echo 'scogo ALL=(ALL) ALL' | sudo tee /etc/sudoers.d/scogo && sudo chmod 0440 /etc/sudoers.d/scogo
561
+
562
+ sudo sed -i 's/^#\\?WaylandEnable=.*/WaylandEnable=false/' /etc/gdm3/custom.conf
563
+
564
+ echo "Downloading and installing Nexus Endpoint..."
565
+ INSTALLER="nexus-endpoint-installer.deb"
566
+ wget "${endpointUrl}" -O "$INSTALLER"
567
+ sudo dpkg -i "$INSTALLER"
568
+ rm -f "$INSTALLER"
569
+
570
+ DEBUG=0
571
+ INSECURE=0
572
+ NOMESH=0
573
+
574
+ agentDL='https://nexus-endpoint-desktop-app.s3.ap-south-1.amazonaws.com/rmmagent/linux/x64/nexusrmm-amd64'
575
+ meshDL='https://${this.config.meshcentralConfig.server}/meshagents?id=${response.deviceGroupId}&installflags=2&meshinstall=6'
576
+
577
+ apiURL='${baseUrl}'
578
+ token='${this.config.epmConfig.installerToken}'
579
+ clientID='${clientId}'
580
+ siteID='${siteId}'
581
+ agentType='${agentType}'
582
+ proxy=''
583
+
584
+ agentBinPath='/usr/local/bin'
585
+ binName='nexusagent'
586
+ agentBin="\${agentBinPath}/\${binName}"
587
+ agentConf='/etc/nexusagent'
588
+ agentSvcName='nexusagent.service'
589
+ agentSysD="/etc/systemd/system/\${agentSvcName}"
590
+ agentDir='/opt/nexusagent'
591
+ meshDir='/opt/nexusmeshbackend'
592
+ meshSystemBin="\${meshDir}/meshbackend"
593
+ meshSvcName='meshbackend.service'
594
+ meshSysD="/lib/systemd/system/\${meshSvcName}"
595
+
596
+ deb=(ubuntu debian raspbian kali linuxmint)
597
+ rhe=(fedora rocky centos rhel amzn arch opensuse)
598
+
599
+ set_locale_deb() {
600
+ locale-gen "en_US.UTF-8"
601
+ localectl set-locale LANG=en_US.UTF-8
602
+ . /etc/default/locale
603
+ }
604
+
605
+ set_locale_rhel() {
606
+ localedef -c -i en_US -f UTF-8 en_US.UTF-8 >/dev/null 2>&1
607
+ localectl set-locale LANG=en_US.UTF-8
608
+ . /etc/locale.conf
609
+ }
610
+
611
+ RemoveOldAgent() {
612
+ if [ -f "\${agentSysD}" ]; then
613
+ systemctl disable \${agentSvcName}
614
+ systemctl stop \${agentSvcName}
615
+ rm -f "\${agentSysD}"
616
+ systemctl daemon-reload
617
+ fi
618
+
619
+ if [ -f "\${agentConf}" ]; then
620
+ rm -f "\${agentConf}"
621
+ fi
622
+
623
+ if [ -f "\${agentBin}" ]; then
624
+ rm -f "\${agentBin}"
625
+ fi
626
+
627
+ if [ -d "\${agentDir}" ]; then
628
+ rm -rf "\${agentDir}"
629
+ fi
630
+ }
631
+
632
+ InstallMesh() {
633
+ if [ -f /etc/os-release ]; then
634
+ distroID=$(
635
+ . /etc/os-release
636
+ echo $ID
637
+ )
638
+ distroIDLIKE=$(
639
+ . /etc/os-release
640
+ echo $ID_LIKE
641
+ )
642
+ if [[ " \${deb[*]} " =~ " \${distroID} " ]]; then
643
+ set_locale_deb
644
+ elif [[ " \${deb[*]} " =~ " \${distroIDLIKE} " ]]; then
645
+ set_locale_deb
646
+ elif [[ " \${rhe[*]} " =~ " \${distroID} " ]]; then
647
+ set_locale_rhel
648
+ else
649
+ set_locale_rhel
650
+ fi
651
+ fi
652
+
653
+ meshTmpDir='/root/meshtemp'
654
+ mkdir -p $meshTmpDir
655
+
656
+ meshTmpBin="\${meshTmpDir}/meshagent"
657
+ wget --no-check-certificate -q -O \${meshTmpBin} \${meshDL}
658
+ chmod +x \${meshTmpBin}
659
+ mkdir -p \${meshDir}
660
+ env LC_ALL=en_US.UTF-8 LANGUAGE=en_US XAUTHORITY=foo DISPLAY=bar \${meshTmpBin} -install --installPath=\${meshDir}
661
+ sleep 1
662
+ rm -rf \${meshTmpDir}
663
+ }
664
+
665
+ RemoveMesh() {
666
+ if [ -f "\${meshSystemBin}" ]; then
667
+ env XAUTHORITY=foo DISPLAY=bar \${meshSystemBin} -uninstall
668
+ sleep 1
669
+ fi
670
+
671
+ if [ -f "\${meshSysD}" ]; then
672
+ systemctl stop \${meshSvcName} >/dev/null 2>&1
673
+ systemctl disable \${meshSvcName} >/dev/null 2>&1
674
+ rm -f \${meshSysD}
675
+ fi
676
+
677
+ rm -rf \${meshDir}
678
+ systemctl daemon-reload
679
+ }
680
+
681
+ Uninstall() {
682
+ RemoveMesh
683
+ RemoveOldAgent
684
+ }
685
+
686
+ if [ $# -ne 0 ] && [[ $1 =~ ^(uninstall|-uninstall|--uninstall)$ ]]; then
687
+ Uninstall
688
+ # Remove the current script
689
+ rm "$0"
690
+ exit 0
691
+ fi
692
+
693
+ while [[ "$#" -gt 0 ]]; do
694
+ case $1 in
695
+ -debug | --debug | debug) DEBUG=1 ;;
696
+ -insecure | --insecure | insecure) INSECURE=1 ;;
697
+ -nomesh | --nomesh | nomesh) NOMESH=1 ;;
698
+ *)
699
+ echo "ERROR: Unknown parameter: $1"
700
+ exit 1
701
+ ;;
702
+ esac
703
+ shift
704
+ done
705
+
706
+ RemoveOldAgent
707
+
708
+ echo "Downloading Nexus agent..."
709
+ wget -q -O \${agentBin} "\${agentDL}"
710
+ if [ $? -ne 0 ]; then
711
+ echo "ERROR: Unable to download nexus agent"
712
+ exit 1
713
+ fi
714
+ chmod +x \${agentBin}
715
+
716
+ MESH_NODE_ID=""
717
+
718
+ if [[ $NOMESH -eq 1 ]]; then
719
+ echo "Skipping mesh install"
720
+ else
721
+ if [ -f "\${meshSystemBin}" ]; then
722
+ RemoveMesh
723
+ fi
724
+ echo "Downloading and installing Nexus Mesh Backend..."
725
+ InstallMesh
726
+ sleep 2
727
+ echo "Getting mesh node id..."
728
+ MESH_NODE_ID=$(env XAUTHORITY=foo DISPLAY=bar \${agentBin} -m nixmeshnodeid)
729
+ fi
730
+
731
+ if [ ! -d "\${agentBinPath}" ]; then
732
+ echo "Creating \${agentBinPath}"
733
+ mkdir -p \${agentBinPath}
734
+ fi
735
+
736
+ INSTALL_CMD="\${agentBin} -m install -api \${apiURL} -client-id \${clientID} -site-id \${siteID} -agent-type \${agentType} -auth \${token}"
737
+
738
+ if [ "\${MESH_NODE_ID}" != '' ]; then
739
+ INSTALL_CMD+=" --meshnodeid \${MESH_NODE_ID}"
740
+ fi
741
+
742
+ if [[ $DEBUG -eq 1 ]]; then
743
+ INSTALL_CMD+=" --log debug"
744
+ fi
745
+
746
+ if [[ $INSECURE -eq 1 ]]; then
747
+ INSTALL_CMD+=" --insecure"
748
+ fi
749
+
750
+ if [ "\${proxy}" != '' ]; then
751
+ INSTALL_CMD+=" --proxy \${proxy}"
752
+ fi
753
+
754
+ eval \${INSTALL_CMD}
755
+
756
+ tacticalsvc="$(
757
+ cat <<EOF
758
+ [Unit]
759
+ Description=Nexus RMM Linux Agent
760
+
761
+ [Service]
762
+ Type=simple
763
+ ExecStart=\${agentBin} -m svc
764
+ User=root
765
+ Group=root
766
+ Restart=always
767
+ RestartSec=5s
768
+ LimitNOFILE=1000000
769
+ KillMode=process
770
+
771
+ [Install]
772
+ WantedBy=multi-user.target
773
+ EOF
774
+ )"
775
+ echo "\${tacticalsvc}" | tee \${agentSysD} >/dev/null
776
+
777
+ systemctl daemon-reload
778
+ systemctl enable \${agentSvcName}
779
+ systemctl start \${agentSvcName}
780
+
781
+ sudo systemctl restart gdm3
782
+ sudo systemctl restart systemd-logind
783
+ sudo dmidecode --string system-serial-number`;
784
+ res.setHeader("X-Script-Type", "bash");
785
+ res.setHeader("Content-Type", "text/plain; charset=utf-8");
786
+ res.status(200).send(script);
787
+ return;
788
+ }
789
+ catch (error) {
790
+ console.error("Error waiting for mesh response:", error);
791
+ const errorResponse = {
792
+ error: error instanceof Error
793
+ ? error.message
794
+ : "Failed to get mesh response",
795
+ timestamp: new Date().toISOString(),
796
+ };
797
+ res.status(500).json(errorResponse);
798
+ return;
799
+ }
800
+ }
801
+ else if (os == types_1.OperatingSystems.MACOS) {
802
+ const errorResponse = {
803
+ error: "Macos script is not supported yet",
804
+ timestamp: new Date().toISOString(),
805
+ };
806
+ res.status(501).json(errorResponse);
807
+ return;
808
+ }
809
+ }
810
+ catch (error) {
811
+ console.error("Error generating install script :", error);
812
+ const errorResponse = {
813
+ error: "Internal server error",
814
+ timestamp: new Date().toISOString(),
815
+ };
816
+ res.status(500).json(errorResponse);
817
+ }
469
818
  };
470
819
  }
471
820
  }
@@ -152,7 +152,7 @@ const createCoreRoutes = (coreController, authMiddleware) => {
152
152
  * $ref: '#/components/responses/InternalServerError'
153
153
  */
154
154
  router.post("/add-user-to-group", authMiddleware.hmacAuth, (0, middleware_1.validateData)(schemas_1.addUserToGroupSchema), (0, middleware_1.asyncHandler)(coreController.addUserToGroup));
155
- router.post("/endpoint/get-install-script", authMiddleware.hmacAuth, (0, middleware_1.validateData)(schemas_1.getEndpointInstallScriptSchema), coreController.getEndpointInstallScript);
155
+ router.post("/endpoint/get-install-script", authMiddleware.hmacAuth, (0, middleware_1.validateData)(schemas_1.getEndpointInstallScriptSchema), (0, middleware_1.asyncHandler)(coreController.getEndpointInstallScript));
156
156
  return router;
157
157
  };
158
158
  exports.createCoreRoutes = createCoreRoutes;
@@ -8,10 +8,26 @@ export declare enum MeshActions {
8
8
  export declare enum IcebergConnectEvents {
9
9
  MESH_NODE_ID = "MESH_NODE_ID"
10
10
  }
11
- export declare enum AgentType {
11
+ export declare enum AgentTypes {
12
12
  WORKSTATION = "workstation",
13
13
  SERVER = "server"
14
14
  }
15
+ export declare enum OperatingSystems {
16
+ WINDOWS = "windows",
17
+ MACOS = "macos",
18
+ "LINUX" = "linux"
19
+ }
20
+ export declare const LIMITS: {
21
+ readonly MAX_ID: number;
22
+ readonly MAX_URL_LENGTH: 4096;
23
+ readonly MIN_OS_SELECTION: 1;
24
+ readonly MAX_OS_SELECTION: 3;
25
+ };
26
+ export declare const OS_EXECUTABLE_EXTENSIONS: {
27
+ readonly windows: readonly [".exe", ".msi"];
28
+ readonly macos: readonly [".dmg", ".pkg"];
29
+ readonly linux: readonly [".deb", ".rpm", ".AppImage"];
30
+ };
15
31
  export interface ApiKeyData {
16
32
  id: number;
17
33
  username: 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;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,MAAM,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,kBAAkB,EAAE,MAAM,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,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"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AgentType = exports.IcebergConnectEvents = exports.MeshActions = void 0;
3
+ exports.OS_EXECUTABLE_EXTENSIONS = exports.LIMITS = exports.OperatingSystems = exports.AgentTypes = exports.IcebergConnectEvents = exports.MeshActions = void 0;
4
4
  var MeshActions;
5
5
  (function (MeshActions) {
6
6
  MeshActions["MESH_ES"] = "meshes";
@@ -12,8 +12,25 @@ var IcebergConnectEvents;
12
12
  (function (IcebergConnectEvents) {
13
13
  IcebergConnectEvents["MESH_NODE_ID"] = "MESH_NODE_ID";
14
14
  })(IcebergConnectEvents || (exports.IcebergConnectEvents = IcebergConnectEvents = {}));
15
- var AgentType;
16
- (function (AgentType) {
17
- AgentType["WORKSTATION"] = "workstation";
18
- AgentType["SERVER"] = "server";
19
- })(AgentType || (exports.AgentType = AgentType = {}));
15
+ var AgentTypes;
16
+ (function (AgentTypes) {
17
+ AgentTypes["WORKSTATION"] = "workstation";
18
+ AgentTypes["SERVER"] = "server";
19
+ })(AgentTypes || (exports.AgentTypes = AgentTypes = {}));
20
+ var OperatingSystems;
21
+ (function (OperatingSystems) {
22
+ OperatingSystems["WINDOWS"] = "windows";
23
+ OperatingSystems["MACOS"] = "macos";
24
+ OperatingSystems["LINUX"] = "linux";
25
+ })(OperatingSystems || (exports.OperatingSystems = OperatingSystems = {}));
26
+ exports.LIMITS = {
27
+ MAX_ID: Number.MAX_SAFE_INTEGER,
28
+ MAX_URL_LENGTH: 4096,
29
+ MIN_OS_SELECTION: 1,
30
+ MAX_OS_SELECTION: 3,
31
+ };
32
+ exports.OS_EXECUTABLE_EXTENSIONS = {
33
+ [OperatingSystems.WINDOWS]: [".exe", ".msi"],
34
+ [OperatingSystems.MACOS]: [".dmg", ".pkg"],
35
+ [OperatingSystems.LINUX]: [".deb", ".rpm", ".AppImage"],
36
+ };
@@ -1,5 +1,5 @@
1
1
  import z from "zod";
2
- import { AgentType } from "..";
2
+ import { AgentTypes, OperatingSystems } from "..";
3
3
  export declare const generateDownloadLinkSchema: z.ZodObject<{
4
4
  deviceGroupId: z.ZodOptional<z.ZodString>;
5
5
  deviceGroupName: z.ZodOptional<z.ZodString>;
@@ -20,8 +20,9 @@ export declare const generateConnectUrlsSchema: z.ZodObject<{
20
20
  export declare const getEndpointInstallScriptSchema: z.ZodObject<{
21
21
  clientId: z.ZodNumber;
22
22
  siteId: z.ZodNumber;
23
- agentType: z.ZodEnum<typeof AgentType>;
23
+ agentType: z.ZodEnum<typeof AgentTypes>;
24
24
  endpointUrl: z.ZodURL;
25
+ os: z.ZodEnum<typeof OperatingSystems>;
25
26
  }, z.core.$strict>;
26
27
  export type GenerateDownloadLinkRequest = z.infer<typeof generateDownloadLinkSchema>;
27
28
  export type CreateDeviceGroupRequest = z.infer<typeof createDeviceGroupSchema>;
@@ -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,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAE/B,eAAO,MAAM,0BAA0B;;;iBAkEpC,CAAC;AAEJ,eAAO,MAAM,uBAAuB;;;iBA+BlC,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;iBAkH9B,CAAC;AAEJ,eAAO,MAAM,yBAAyB;;;iBA0DpC,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;;;kBA4BhC,CAAC;AAEZ,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"}
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;;;iBA0DpC,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"}
@@ -202,23 +202,27 @@ exports.getEndpointInstallScriptSchema = zod_1.default
202
202
  .number()
203
203
  .int()
204
204
  .positive()
205
- .max(Number.MAX_SAFE_INTEGER)
205
+ .max(__1.LIMITS.MAX_ID, `Must not exceed ${__1.LIMITS.MAX_ID}`)
206
206
  .describe("Unique client identifier"),
207
207
  siteId: zod_1.default
208
208
  .number()
209
209
  .int()
210
210
  .positive()
211
- .max(Number.MAX_SAFE_INTEGER)
211
+ .max(__1.LIMITS.MAX_ID, `Must not exceed ${__1.LIMITS.MAX_ID}`)
212
212
  .describe("Unique site identifier"),
213
- agentType: zod_1.default.enum(__1.AgentType).describe("Type of agent to install"),
213
+ agentType: zod_1.default.enum(__1.AgentTypes).describe("Type of agent to install"),
214
214
  endpointUrl: zod_1.default
215
215
  .url()
216
216
  .regex(/^https:\/\//, "Endpoint URL must use HTTPS")
217
217
  .max(4096, "Endpoint URL too long")
218
- .refine((url) => {
219
- const executableExtensions = /\.(exe|msi|dmg|pkg|deb|rpm|AppImage)$/i;
220
- return executableExtensions.test(url);
221
- }, "Endpoint URL must point to an executable installer file")
222
218
  .describe("Direct download URL for the endpoint installer"),
219
+ os: zod_1.default
220
+ .enum(__1.OperatingSystems)
221
+ .describe("Target operating system for the installation script"),
223
222
  })
224
- .strict();
223
+ .strict()
224
+ .refine((data) => {
225
+ const validExtensions = __1.OS_EXECUTABLE_EXTENSIONS[data.os];
226
+ const url = data.endpointUrl.toLowerCase();
227
+ return validExtensions.some((ext) => url.endsWith(ext.toLowerCase()));
228
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meru2802/aux-server",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "Nexus EPM auxillary server to facilitate additional functionality required by Scogo Iceberg",
5
5
  "main": "index.js",
6
6
  "files": [