Nexus EPM auxillary server to facilitate additional functionality required by Scogo Iceberg
npm install @meru2802/aux-serverNexus EPM auxiliary server to facilitate additional functionality required by Scogo Iceberg.
- MeshCentral integration for remote device management
- Device group management
- Download link generation for mesh agents
- Connection URL generation for remote access (control, terminal, file system)
- Health monitoring and status endpoints
- WebSocket connectivity for real-time communication
- PostgreSQL database integration
The server includes comprehensive API documentation using Swagger/OpenAPI 3.0.
Once the server is running, you can access the interactive API documentation at:
- Swagger UI: http://localhost:3003/docs
- OpenAPI JSON Spec: http://localhost:3003/docs/json
The Swagger UI provides:
- Interactive API testing
- Detailed endpoint documentation
- Request/response schema definitions
- Example requests and responses
- Authentication information
#### Health Endpoints
- GET /health - Basic health check for load balancers
- GET /status - Detailed service status including connections and uptime
#### API Endpoints
- POST /api/generate-download-link - Generate download link for MeshCentral agent
- POST /api/generate-connect-urls - Generate authenticated URLs for device access
#### Core Endpoints
- POST /core/create-device-group - Create a new device group in MeshCentral
- POST /core/add-user-to-group - Add multiple users to a device group
- Node.js (v18 or higher)
- pnpm
- PostgreSQL database
- MeshCentral server
``bashInstall dependencies
pnpm install
$3
Ensure you have the proper configuration in
config.json with:
- MeshCentral server credentials and encryption keys
- Database connection settings
- Iceberg integration endpoints
- Logging configuration$3
Run the schema.sql file against your PostgreSQL database to set up the required tables:
`bash
pnpm run setup:db
`Configuration
The server uses a JSON configuration file (
config.json) with the following structure:-
meshcentralConfig: MeshCentral server connection and encryption settings
- dbConfig: PostgreSQL database connection settings
- icebergConfig: Iceberg integration endpoints
- logging: Logging configuration for file rotation and levelsUsage
$3
`bash
curl -X POST http://localhost:3003/api/generate-download-link \
-H "Content-Type: application/json" \
-d '{"deviceGroupName": "production-servers"}'
`$3
`bash
curl -X POST http://localhost:3003/api/generate-connect-urls \
-H "Content-Type: application/json" \
-d '{"meshNodeId": "node//abc123", "userId": "john.doe"}'
`$3
`bash
curl -X POST http://localhost:3003/core/create-device-group \
-H "Content-Type: application/json" \
-d '{"deviceGroupName": "new-group", "description": "My new device group"}'
`$3
`bash
curl -X POST http://localhost:3003/core/add-user-to-group \
-H "Content-Type: application/json" \
-d '{"deviceGroupName": "production-servers", "users": ["john.doe", "jane.smith"]}'
`Architecture
The server follows a modular architecture with:
- Controllers: Handle HTTP request/response logic
- Services: Business logic and external integrations
- Routes: API endpoint definitions and middleware
- Middleware: Request processing, error handling, and validation
- Types: TypeScript type definitions
Health Monitoring
The server provides comprehensive health monitoring:
- Basic Health Check:
/health - Quick status for load balancers
- Detailed Status: /status` - Complete service information including:All endpoints return standardized error responses with:
- HTTP status codes
- Error messages
- Timestamps
- Request correlation information
The server implements:
- CORS configuration
- Helmet security headers
- Request validation
- Encrypted cookie handling for MeshCentral integration
- Database connection pooling with proper error handling