Initial commit
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
node_modules/
|
||||||
|
.backup/
|
||||||
|
configuration/.env
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
# LNX-Connect (WIP)
|
||||||
|
### The modular backend ecosystem by and for LupiNex Media
|
||||||
|
|
||||||
|
**LNX-Connect** is a modular server backend ecosystem designed for secure data management and flexible project deployment.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
- [LNX-Connect (WIP)](#lnx-connect-wip)
|
||||||
|
- [The modular backend ecosystem by and for LupiNex Media](#the-modular-backend-ecosystem-by-and-for-lupinex-media)
|
||||||
|
|
||||||
|
---
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
/*
|
||||||
|
! /configuration/mapping.js – Central Mapping Configuration
|
||||||
|
? This module maps system directories, and required dependencies for the ecosystem
|
||||||
|
*/
|
||||||
|
|
||||||
|
// % import nodejs packages
|
||||||
|
const path = require('path');
|
||||||
|
const fs = require('fs');
|
||||||
|
require('dotenv').config({ path: path.resolve(__dirname, '.env') });
|
||||||
|
|
||||||
|
// % declare directories
|
||||||
|
const rootDir = path.resolve(__dirname, '..');
|
||||||
|
const serverDir = path.resolve(rootDir, 'servers');
|
||||||
|
const dirs = {
|
||||||
|
rootDir: rootDir,
|
||||||
|
|
||||||
|
// § server directories
|
||||||
|
serverDir: serverDir,
|
||||||
|
gatewayDir: path.resolve(serverDir, 'gateway'),
|
||||||
|
dashboardDir: path.resolve(serverDir, 'dashboard'),
|
||||||
|
websocketDir: path.resolve(serverDir, 'websocket'),
|
||||||
|
|
||||||
|
// § data structure directories
|
||||||
|
configDir: path.resolve(rootDir, 'configuration'),
|
||||||
|
dataDir: path.resolve(rootDir, 'database'),
|
||||||
|
|
||||||
|
// § other directories
|
||||||
|
serviceDir: path.resolve(rootDir, 'services'),
|
||||||
|
interfaceDir: path.resolve(rootDir, 'ui')
|
||||||
|
};
|
||||||
|
|
||||||
|
// % declare database information
|
||||||
|
const databaseData = {
|
||||||
|
host: process.env.INTERNAL_DATABASE_HOST,
|
||||||
|
port: process.env.INTERNAL_DATABASE_PORT,
|
||||||
|
users: {
|
||||||
|
readonly: {
|
||||||
|
user: process.env.DATABASE_READONLY_USER,
|
||||||
|
pass: process.env.DATABASE_READONLY_PASS
|
||||||
|
}
|
||||||
|
},
|
||||||
|
databases: {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// $ parse all configuration files
|
||||||
|
const configFiles = fs.readdirSync(dirs.configDir).filter(file =>
|
||||||
|
/\.config\.(js|json|ya?ml)$/.test(file)
|
||||||
|
);
|
||||||
|
|
||||||
|
// § export module
|
||||||
|
module.exports = {
|
||||||
|
dirs,
|
||||||
|
configFiles,
|
||||||
|
databaseData
|
||||||
|
};
|
||||||
@@ -0,0 +1,127 @@
|
|||||||
|
/*
|
||||||
|
VS-Code Extension: Colorful Comments
|
||||||
|
|
||||||
|
This Plugin normally only has:
|
||||||
|
! Red (!)
|
||||||
|
? Blue (?)
|
||||||
|
* Green (*)
|
||||||
|
^ Yellow (^)
|
||||||
|
& Pink (&)
|
||||||
|
~ Purple (~)
|
||||||
|
todo Mustard (todo)
|
||||||
|
// Grey (//)
|
||||||
|
but was customized by me for better and more colors.
|
||||||
|
|
||||||
|
URL: https://marketplace.visualstudio.com/items?itemName=ParthR2031.colorful-comments
|
||||||
|
|
||||||
|
|
||||||
|
My Custom Colors:
|
||||||
|
! HEX: #FF2D00, Color: RED, Background: NONE, ST: false > file paths and module headers
|
||||||
|
? HEX: #0076FF, Color: BLUE, Background: NONE, ST: false > general information / explanations
|
||||||
|
?? HEX: #00CCAA, Color: TURQUOISE, Background: NONE, ST: false > usage declaration
|
||||||
|
|
||||||
|
% HEX: #00FFFF, Color: LIGHTBLUE, Background: NONE, ST: false > variable headers
|
||||||
|
$ HEX: #BFFF00, Color: LIME, Background: NONE, ST: false > function headers
|
||||||
|
~ HEX: #BE00FF, Color: PURPLE, Background: NONE, ST: false > in-function headers
|
||||||
|
§ HEX: #808080, Color: GREY, Background: NONE, ST: false > other headers
|
||||||
|
|
||||||
|
TODO HEX: #FFB84D, Color: ORANGE, Background: NONE, ST: false > todo documentation
|
||||||
|
DONE HEX: #28FF00, Color: LIGHTGREEN, Background: NONE, ST: false > optimization ideas / improvements
|
||||||
|
= HEX: #FF8C00, Color: ORANGE, Background: NONE, ST: false > temporary solutions
|
||||||
|
& HEX: #FF06A0, Color: PINK, Background: NONE, ST: false > experimental features / ideas
|
||||||
|
|
||||||
|
^ HEX: #F8FF00, Color: YELLOW, Background: NONE, ST: false > warnings
|
||||||
|
BUG HEX: #FF3333, Color: RED, Background: NONE, ST: false > bug documentation
|
||||||
|
// HEX: #474747, Color: GRAY, Background: NONE, ST: true > removed comments or fixed bugs
|
||||||
|
|
||||||
|
HEX: #5C6370, Color: GRAY, Background: NONE, ST: false > normal comments (based on "Atom One Dark Theme")
|
||||||
|
|
||||||
|
|
||||||
|
My settings.json (to change yours, simply go to the plugin, hit the cog-symbol and click on "Edit in settings.json", then find the following section at the bottom of the file and paste my config then reload extensions or restart VSCode):
|
||||||
|
"colorful-comments.tags": [
|
||||||
|
{
|
||||||
|
"tag": "!",
|
||||||
|
"color": "#FF2D00",
|
||||||
|
"strikethrough": false,
|
||||||
|
"backgroundColor": "transparent"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tag": "??",
|
||||||
|
"color": "#00CCAA",
|
||||||
|
"strikethrough": false,
|
||||||
|
"backgroundColor": "transparent"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tag": "?",
|
||||||
|
"color": "#0076FF",
|
||||||
|
"strikethrough": false,
|
||||||
|
"backgroundColor": "transparent"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tag": "//",
|
||||||
|
"color": "#474747",
|
||||||
|
"strikethrough": true,
|
||||||
|
"backgroundColor": "transparent"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tag": "^",
|
||||||
|
"color": "#F8FF00",
|
||||||
|
"strikethrough": false,
|
||||||
|
"backgroundColor": "transparent"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tag": "*",
|
||||||
|
"color": "#28FF00",
|
||||||
|
"strikethrough": false,
|
||||||
|
"backgroundColor": "transparent"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tag": "&",
|
||||||
|
"color": "#FF06A0",
|
||||||
|
"strikethrough": false,
|
||||||
|
"backgroundColor": "transparent"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tag": "~",
|
||||||
|
"color": "#BE00FF",
|
||||||
|
"strikethrough": false,
|
||||||
|
"backgroundColor": "transparent"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tag": "todo",
|
||||||
|
"color": "#FFB84D",
|
||||||
|
"strikethrough": false,
|
||||||
|
"backgroundColor": "transparent"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tag": "bug",
|
||||||
|
"color": "#FF3333",
|
||||||
|
"strikethrough": false,
|
||||||
|
"backgroundColor": "#330000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tag": "$",
|
||||||
|
"color": "#BFFF00",
|
||||||
|
"strikethrough": false,
|
||||||
|
"backgroundColor": "transparent"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tag": "%",
|
||||||
|
"color": "#00FFFF",
|
||||||
|
"strikethrough": false,
|
||||||
|
"backgroundColor": "transparent"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tag": "=",
|
||||||
|
"color": "#FF8C00",
|
||||||
|
"strikethrough": false,
|
||||||
|
"backgroundColor": "transparent"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tag": "§",
|
||||||
|
"color": "#808080",
|
||||||
|
"strikethrough": false,
|
||||||
|
"backgroundColor": "transparent"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
*/
|
||||||
Generated
+966
@@ -0,0 +1,966 @@
|
|||||||
|
{
|
||||||
|
"name": "lnx-connect",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"lockfileVersion": 3,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {
|
||||||
|
"": {
|
||||||
|
"name": "lnx-connect",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"license": "UNLICENSED",
|
||||||
|
"dependencies": {
|
||||||
|
"crypto": "^1.0.1",
|
||||||
|
"dotenv": "^17.4.2",
|
||||||
|
"ejs": "^6.0.1",
|
||||||
|
"express": "^5.2.1",
|
||||||
|
"fs": "^0.0.1-security",
|
||||||
|
"http": "^0.0.1-security",
|
||||||
|
"path": "^0.12.7",
|
||||||
|
"ws": "^8.21.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/accepts": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"mime-types": "^3.0.0",
|
||||||
|
"negotiator": "^1.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/body-parser": {
|
||||||
|
"version": "2.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.3.0.tgz",
|
||||||
|
"integrity": "sha512-2cGmJupaNgg+QUwVLAucDuWuoMZ6EX9iHDRswZ5lsNYEmwPaRknMPCLZz07yTzVq/83p4o/wzbDZbBrTvGGTIw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"bytes": "^3.1.2",
|
||||||
|
"content-type": "^2.0.0",
|
||||||
|
"debug": "^4.4.3",
|
||||||
|
"http-errors": "^2.0.1",
|
||||||
|
"iconv-lite": "^0.7.2",
|
||||||
|
"on-finished": "^2.4.1",
|
||||||
|
"qs": "^6.15.2",
|
||||||
|
"raw-body": "^3.0.2",
|
||||||
|
"type-is": "^2.1.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/express"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/body-parser/node_modules/content-type": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/content-type/-/content-type-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/express"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/bytes": {
|
||||||
|
"version": "3.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
|
||||||
|
"integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/call-bind-apply-helpers": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
|
||||||
|
"integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"es-errors": "^1.3.0",
|
||||||
|
"function-bind": "^1.1.2"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/call-bound": {
|
||||||
|
"version": "1.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz",
|
||||||
|
"integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"call-bind-apply-helpers": "^1.0.2",
|
||||||
|
"get-intrinsic": "^1.3.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/content-disposition": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.1.0.tgz",
|
||||||
|
"integrity": "sha512-5jRCH9Z/+DRP7rkvY83B+yGIGX96OYdJmzngqnw2SBSxqCFPd0w2km3s5iawpGX8krnwSGmF0FW5Nhr0Hfai3g==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/express"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/content-type": {
|
||||||
|
"version": "1.0.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz",
|
||||||
|
"integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/cookie": {
|
||||||
|
"version": "0.7.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz",
|
||||||
|
"integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/cookie-signature": {
|
||||||
|
"version": "1.2.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz",
|
||||||
|
"integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6.6.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/crypto": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/crypto/-/crypto-1.0.1.tgz",
|
||||||
|
"integrity": "sha512-VxBKmeNcqQdiUQUW2Tzq0t377b54N2bMtXO/qiLa+6eRRmmC4qT3D4OnTGoT/U6O9aklQ/jTwbOtRMTTY8G0Ig==",
|
||||||
|
"deprecated": "This package is no longer supported. It's now a built-in Node module. If you've depended on crypto, you should switch to the one that's built-in.",
|
||||||
|
"license": "ISC"
|
||||||
|
},
|
||||||
|
"node_modules/debug": {
|
||||||
|
"version": "4.4.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
|
||||||
|
"integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"ms": "^2.1.3"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6.0"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"supports-color": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/depd": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/dotenv": {
|
||||||
|
"version": "17.4.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.4.2.tgz",
|
||||||
|
"integrity": "sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw==",
|
||||||
|
"license": "BSD-2-Clause",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://dotenvx.com"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/dunder-proto": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
|
||||||
|
"integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"call-bind-apply-helpers": "^1.0.1",
|
||||||
|
"es-errors": "^1.3.0",
|
||||||
|
"gopd": "^1.2.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/ee-first": {
|
||||||
|
"version": "1.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
|
||||||
|
"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/ejs": {
|
||||||
|
"version": "6.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/ejs/-/ejs-6.0.1.tgz",
|
||||||
|
"integrity": "sha512-UaaM14yby8U3k02ihS1Bmj5Kz2d7CCQM1scxpgs4Mhkq8F1wR2gl3+Ts4h5Ne4Mnt7M9m4Dw7jsuMr3+xO4vZA==",
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"bin": {
|
||||||
|
"ejs": "bin/cli.js"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.12.18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/encodeurl": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/es-define-property": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
|
||||||
|
"integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/es-errors": {
|
||||||
|
"version": "1.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
|
||||||
|
"integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/es-object-atoms": {
|
||||||
|
"version": "1.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz",
|
||||||
|
"integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"es-errors": "^1.3.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/escape-html": {
|
||||||
|
"version": "1.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
|
||||||
|
"integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/etag": {
|
||||||
|
"version": "1.8.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
|
||||||
|
"integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/express": {
|
||||||
|
"version": "5.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz",
|
||||||
|
"integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"accepts": "^2.0.0",
|
||||||
|
"body-parser": "^2.2.1",
|
||||||
|
"content-disposition": "^1.0.0",
|
||||||
|
"content-type": "^1.0.5",
|
||||||
|
"cookie": "^0.7.1",
|
||||||
|
"cookie-signature": "^1.2.1",
|
||||||
|
"debug": "^4.4.0",
|
||||||
|
"depd": "^2.0.0",
|
||||||
|
"encodeurl": "^2.0.0",
|
||||||
|
"escape-html": "^1.0.3",
|
||||||
|
"etag": "^1.8.1",
|
||||||
|
"finalhandler": "^2.1.0",
|
||||||
|
"fresh": "^2.0.0",
|
||||||
|
"http-errors": "^2.0.0",
|
||||||
|
"merge-descriptors": "^2.0.0",
|
||||||
|
"mime-types": "^3.0.0",
|
||||||
|
"on-finished": "^2.4.1",
|
||||||
|
"once": "^1.4.0",
|
||||||
|
"parseurl": "^1.3.3",
|
||||||
|
"proxy-addr": "^2.0.7",
|
||||||
|
"qs": "^6.14.0",
|
||||||
|
"range-parser": "^1.2.1",
|
||||||
|
"router": "^2.2.0",
|
||||||
|
"send": "^1.1.0",
|
||||||
|
"serve-static": "^2.2.0",
|
||||||
|
"statuses": "^2.0.1",
|
||||||
|
"type-is": "^2.0.1",
|
||||||
|
"vary": "^1.1.2"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 18"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/express"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/finalhandler": {
|
||||||
|
"version": "2.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.1.tgz",
|
||||||
|
"integrity": "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"debug": "^4.4.0",
|
||||||
|
"encodeurl": "^2.0.0",
|
||||||
|
"escape-html": "^1.0.3",
|
||||||
|
"on-finished": "^2.4.1",
|
||||||
|
"parseurl": "^1.3.3",
|
||||||
|
"statuses": "^2.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 18.0.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/express"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/forwarded": {
|
||||||
|
"version": "0.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
|
||||||
|
"integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/fresh": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/fs": {
|
||||||
|
"version": "0.0.1-security",
|
||||||
|
"resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz",
|
||||||
|
"integrity": "sha512-3XY9e1pP0CVEUCdj5BmfIZxRBTSDycnbqhIOGec9QYtmVH2fbLpj86CFWkrNOkt/Fvty4KZG5lTglL9j/gJ87w==",
|
||||||
|
"license": "ISC"
|
||||||
|
},
|
||||||
|
"node_modules/function-bind": {
|
||||||
|
"version": "1.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
|
||||||
|
"integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/get-intrinsic": {
|
||||||
|
"version": "1.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
|
||||||
|
"integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"call-bind-apply-helpers": "^1.0.2",
|
||||||
|
"es-define-property": "^1.0.1",
|
||||||
|
"es-errors": "^1.3.0",
|
||||||
|
"es-object-atoms": "^1.1.1",
|
||||||
|
"function-bind": "^1.1.2",
|
||||||
|
"get-proto": "^1.0.1",
|
||||||
|
"gopd": "^1.2.0",
|
||||||
|
"has-symbols": "^1.1.0",
|
||||||
|
"hasown": "^2.0.2",
|
||||||
|
"math-intrinsics": "^1.1.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/get-proto": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",
|
||||||
|
"integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"dunder-proto": "^1.0.1",
|
||||||
|
"es-object-atoms": "^1.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/gopd": {
|
||||||
|
"version": "1.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
|
||||||
|
"integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/has-symbols": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
|
||||||
|
"integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/hasown": {
|
||||||
|
"version": "2.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz",
|
||||||
|
"integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"function-bind": "^1.1.2"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/http": {
|
||||||
|
"version": "0.0.1-security",
|
||||||
|
"resolved": "https://registry.npmjs.org/http/-/http-0.0.1-security.tgz",
|
||||||
|
"integrity": "sha512-RnDvP10Ty9FxqOtPZuxtebw1j4L/WiqNMDtuc1YMH1XQm5TgDRaR1G9u8upL6KD1bXHSp9eSXo/ED+8Q7FAr+g=="
|
||||||
|
},
|
||||||
|
"node_modules/http-errors": {
|
||||||
|
"version": "2.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz",
|
||||||
|
"integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"depd": "~2.0.0",
|
||||||
|
"inherits": "~2.0.4",
|
||||||
|
"setprototypeof": "~1.2.0",
|
||||||
|
"statuses": "~2.0.2",
|
||||||
|
"toidentifier": "~1.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.8"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/express"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/iconv-lite": {
|
||||||
|
"version": "0.7.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz",
|
||||||
|
"integrity": "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"safer-buffer": ">= 2.1.2 < 3.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/express"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/inherits": {
|
||||||
|
"version": "2.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||||
|
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
|
||||||
|
"license": "ISC"
|
||||||
|
},
|
||||||
|
"node_modules/ipaddr.js": {
|
||||||
|
"version": "1.9.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
|
||||||
|
"integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/is-promise": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz",
|
||||||
|
"integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/math-intrinsics": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
|
||||||
|
"integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/media-typer": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz",
|
||||||
|
"integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/merge-descriptors": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/mime-db": {
|
||||||
|
"version": "1.54.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz",
|
||||||
|
"integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/mime-types": {
|
||||||
|
"version": "3.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz",
|
||||||
|
"integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"mime-db": "^1.54.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/express"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/ms": {
|
||||||
|
"version": "2.1.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
|
||||||
|
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/negotiator": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/object-inspect": {
|
||||||
|
"version": "1.13.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz",
|
||||||
|
"integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/on-finished": {
|
||||||
|
"version": "2.4.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
|
||||||
|
"integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"ee-first": "1.1.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/once": {
|
||||||
|
"version": "1.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||||
|
"integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"wrappy": "1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/parseurl": {
|
||||||
|
"version": "1.3.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
|
||||||
|
"integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/path": {
|
||||||
|
"version": "0.12.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/path/-/path-0.12.7.tgz",
|
||||||
|
"integrity": "sha512-aXXC6s+1w7otVF9UletFkFcDsJeO7lSZBPUQhtb5O0xJe8LtYhj/GxldoL09bBj9+ZmE2hNoHqQSFMN5fikh4Q==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"process": "^0.11.1",
|
||||||
|
"util": "^0.10.3"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/path-to-regexp": {
|
||||||
|
"version": "8.4.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.4.2.tgz",
|
||||||
|
"integrity": "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/express"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/process": {
|
||||||
|
"version": "0.11.10",
|
||||||
|
"resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",
|
||||||
|
"integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/proxy-addr": {
|
||||||
|
"version": "2.0.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
|
||||||
|
"integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"forwarded": "0.2.0",
|
||||||
|
"ipaddr.js": "1.9.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/qs": {
|
||||||
|
"version": "6.15.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/qs/-/qs-6.15.3.tgz",
|
||||||
|
"integrity": "sha512-O9gl3zCl5h5blw1KGUzQKhA5oUXSl8rwUIM5o0S3nCXMliSvy5Dzx7/DJcI+SwgICv+IneSZwhBh1oSyEHA71A==",
|
||||||
|
"license": "BSD-3-Clause",
|
||||||
|
"dependencies": {
|
||||||
|
"es-define-property": "^1.0.1",
|
||||||
|
"side-channel": "^1.1.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.6"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/range-parser": {
|
||||||
|
"version": "1.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.3.0.tgz",
|
||||||
|
"integrity": "sha512-hek2mFQpPuI4E1BBKrSto+BU3e3x4xuarsbiwr3+lf7p44juvFMV0XFWQAP3xUyqXA4RrXLIoaSUGbSt056ZMw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/express"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/raw-body": {
|
||||||
|
"version": "3.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.2.tgz",
|
||||||
|
"integrity": "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"bytes": "~3.1.2",
|
||||||
|
"http-errors": "~2.0.1",
|
||||||
|
"iconv-lite": "~0.7.0",
|
||||||
|
"unpipe": "~1.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/router": {
|
||||||
|
"version": "2.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz",
|
||||||
|
"integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"debug": "^4.4.0",
|
||||||
|
"depd": "^2.0.0",
|
||||||
|
"is-promise": "^4.0.0",
|
||||||
|
"parseurl": "^1.3.3",
|
||||||
|
"path-to-regexp": "^8.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/safer-buffer": {
|
||||||
|
"version": "2.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
||||||
|
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/send": {
|
||||||
|
"version": "1.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/send/-/send-1.2.1.tgz",
|
||||||
|
"integrity": "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"debug": "^4.4.3",
|
||||||
|
"encodeurl": "^2.0.0",
|
||||||
|
"escape-html": "^1.0.3",
|
||||||
|
"etag": "^1.8.1",
|
||||||
|
"fresh": "^2.0.0",
|
||||||
|
"http-errors": "^2.0.1",
|
||||||
|
"mime-types": "^3.0.2",
|
||||||
|
"ms": "^2.1.3",
|
||||||
|
"on-finished": "^2.4.1",
|
||||||
|
"range-parser": "^1.2.1",
|
||||||
|
"statuses": "^2.0.2"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 18"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/express"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/serve-static": {
|
||||||
|
"version": "2.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.1.tgz",
|
||||||
|
"integrity": "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"encodeurl": "^2.0.0",
|
||||||
|
"escape-html": "^1.0.3",
|
||||||
|
"parseurl": "^1.3.3",
|
||||||
|
"send": "^1.2.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 18"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/express"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/setprototypeof": {
|
||||||
|
"version": "1.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
|
||||||
|
"integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==",
|
||||||
|
"license": "ISC"
|
||||||
|
},
|
||||||
|
"node_modules/side-channel": {
|
||||||
|
"version": "1.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.1.tgz",
|
||||||
|
"integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"es-errors": "^1.3.0",
|
||||||
|
"object-inspect": "^1.13.4",
|
||||||
|
"side-channel-list": "^1.0.1",
|
||||||
|
"side-channel-map": "^1.0.1",
|
||||||
|
"side-channel-weakmap": "^1.0.2"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/side-channel-list": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz",
|
||||||
|
"integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"es-errors": "^1.3.0",
|
||||||
|
"object-inspect": "^1.13.4"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/side-channel-map": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz",
|
||||||
|
"integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"call-bound": "^1.0.2",
|
||||||
|
"es-errors": "^1.3.0",
|
||||||
|
"get-intrinsic": "^1.2.5",
|
||||||
|
"object-inspect": "^1.13.3"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/side-channel-weakmap": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz",
|
||||||
|
"integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"call-bound": "^1.0.2",
|
||||||
|
"es-errors": "^1.3.0",
|
||||||
|
"get-intrinsic": "^1.2.5",
|
||||||
|
"object-inspect": "^1.13.3",
|
||||||
|
"side-channel-map": "^1.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/statuses": {
|
||||||
|
"version": "2.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz",
|
||||||
|
"integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/toidentifier": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
|
||||||
|
"integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/type-is": {
|
||||||
|
"version": "2.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/type-is/-/type-is-2.1.0.tgz",
|
||||||
|
"integrity": "sha512-faYHw0anBbc/kWF3zFTEnxSFOAGUX9GFbOBthvDdLsIlEoWOFOtS0zgCiQYwIskL9iGXZL3kAXD8OoZ4GmMATA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"content-type": "^2.0.0",
|
||||||
|
"media-typer": "^1.1.0",
|
||||||
|
"mime-types": "^3.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 18"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/express"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/type-is/node_modules/content-type": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/content-type/-/content-type-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/express"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/unpipe": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/util": {
|
||||||
|
"version": "0.10.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz",
|
||||||
|
"integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"inherits": "2.0.3"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/util/node_modules/inherits": {
|
||||||
|
"version": "2.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
|
||||||
|
"integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==",
|
||||||
|
"license": "ISC"
|
||||||
|
},
|
||||||
|
"node_modules/vary": {
|
||||||
|
"version": "1.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
|
||||||
|
"integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/wrappy": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||||
|
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
|
||||||
|
"license": "ISC"
|
||||||
|
},
|
||||||
|
"node_modules/ws": {
|
||||||
|
"version": "8.21.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/ws/-/ws-8.21.0.tgz",
|
||||||
|
"integrity": "sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10.0.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"bufferutil": "^4.0.1",
|
||||||
|
"utf-8-validate": ">=5.0.2"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"bufferutil": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"utf-8-validate": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
{
|
||||||
|
"name": "lnx-connect",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "LNX-Connect is a complete backend ecosystem for LupiNex Media infrastructure",
|
||||||
|
"keywords": [
|
||||||
|
"backend",
|
||||||
|
"infrastructure",
|
||||||
|
"ecosystem",
|
||||||
|
"controller"
|
||||||
|
],
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "gitea:LupinexMedia/LNX-Connect.git"
|
||||||
|
},
|
||||||
|
"license": "UNLICENSED",
|
||||||
|
"author": "LupiNex Media",
|
||||||
|
"type": "commonjs",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "nodemon index.js"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"crypto": "^1.0.1",
|
||||||
|
"dotenv": "^17.4.2",
|
||||||
|
"ejs": "^6.0.1",
|
||||||
|
"express": "^5.2.1",
|
||||||
|
"fs": "^0.0.1-security",
|
||||||
|
"http": "^0.0.1-security",
|
||||||
|
"path": "^0.12.7",
|
||||||
|
"ws": "^8.21.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
/*
|
||||||
|
! /servers/Dashboard/functions.js – Central Dashboard Server Functions
|
||||||
|
? This modules exports the functionality for the express dashboard server
|
||||||
|
*/
|
||||||
|
|
||||||
|
// % core variables
|
||||||
|
const ip = process.env.INTERNAL_HOST_IP;
|
||||||
|
const port = process.env.INTERNAL_DASHBOARD_PORT;
|
||||||
|
|
||||||
|
// $ server start function
|
||||||
|
async function boot(server) {
|
||||||
|
// ~ start express server
|
||||||
|
server.listen(port, ip, () => {
|
||||||
|
console.info(`Express server is now running on http://${ip}:${port}`)
|
||||||
|
});
|
||||||
|
|
||||||
|
// ~ return running express server reference
|
||||||
|
return server;
|
||||||
|
};
|
||||||
|
|
||||||
|
// $ server shutdown function
|
||||||
|
async function shutdown(server) {
|
||||||
|
// ~ shutdown running express server
|
||||||
|
server.close();
|
||||||
|
|
||||||
|
// ~ return express server reference
|
||||||
|
return server;
|
||||||
|
};
|
||||||
|
|
||||||
|
// $ server restart function
|
||||||
|
async function restart(server) {
|
||||||
|
// ~ shutdown the running express server
|
||||||
|
await shutdown(server);
|
||||||
|
|
||||||
|
// ~ restart the express server
|
||||||
|
await boot(server);
|
||||||
|
|
||||||
|
// ~ return the server reference
|
||||||
|
return server;
|
||||||
|
};
|
||||||
|
|
||||||
|
// $ server status function
|
||||||
|
async function status(server) {
|
||||||
|
// ~ get and return server listening status
|
||||||
|
return server.listening ? 'online' : 'offline';
|
||||||
|
};
|
||||||
|
|
||||||
|
// § export server functions module
|
||||||
|
module.exports = { boot, shutdown, restart, status };
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
! /servers/dashboard/routers/index.js – Central Gateway Routing Aggregator
|
||||||
|
? This module dynamically collects and registeres all modular ".router.js" files within the "routers" directory
|
||||||
|
*/
|
||||||
|
|
||||||
|
// % import nodejs packages
|
||||||
|
const router = require('express').Router();
|
||||||
|
const path = require('path');
|
||||||
|
const fs = require('fs');
|
||||||
|
|
||||||
|
// % import external dependencies
|
||||||
|
const rootDir = path.resolve(__dirname, '..', '..', '..');
|
||||||
|
const { dirs } = require(path.resolve(rootDir, 'configuration', 'mapping.js'));
|
||||||
|
|
||||||
|
// % read router files recursively
|
||||||
|
const routerRoot = path.resolve(dirs.dashboardDir, 'routers');
|
||||||
|
const routerFiles = fs.readdirSync(routerRoot)
|
||||||
|
.filter(file => /\.router\.js$/.test(file))
|
||||||
|
.sort((a, b) => {
|
||||||
|
if (a === 'root.router.js') return 1;
|
||||||
|
if (b === 'root.router.js') return -1;
|
||||||
|
return a.localeCompare(b);
|
||||||
|
});
|
||||||
|
|
||||||
|
// $ configure used routers
|
||||||
|
routerFiles.forEach(file => {
|
||||||
|
const routerPath = path.resolve(routerRoot, file);
|
||||||
|
router.use(require(routerPath));
|
||||||
|
});
|
||||||
|
|
||||||
|
// § export router module
|
||||||
|
module.exports = router;
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
/*
|
||||||
|
! /servers/dashboard/server.js – Central Dashboard Server Manager
|
||||||
|
? This module orchestrates the express lifecycle, handles initialization, middleware configs and router integrations.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// % import nodejs packages
|
||||||
|
const express = require('express');
|
||||||
|
const http = require('http');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
// % import external dependencies
|
||||||
|
const rootDir = path.resolve(__dirname, '..', '..');
|
||||||
|
const { dirs } = require(path.resolve(rootDir, 'configuration', 'mapping.js'));
|
||||||
|
|
||||||
|
// % set up express server
|
||||||
|
const app = express();
|
||||||
|
const server = http.createServer(app);
|
||||||
|
|
||||||
|
// $ server setup
|
||||||
|
app.use(express.json()); // add json support for express
|
||||||
|
app.use(express.static(path.resolve(dirs.interfaceDir, 'resources'))); // set resources directory (e.g. scripts, style sheets, images ...)
|
||||||
|
app.set('view engine', 'ejs'); // set "embedded javascript" as view engine
|
||||||
|
app.set('views', path.resolve(dirs.interfaceDir, 'views')); // set the folder where the .ejs files are located
|
||||||
|
|
||||||
|
// $ router setup
|
||||||
|
const router = require(path.resolve(dirs.dashboardDir, 'routers'));
|
||||||
|
app.use(router);
|
||||||
|
|
||||||
|
// $ server functions
|
||||||
|
const {
|
||||||
|
boot, shutdown, restart, status
|
||||||
|
} = require(path.resolve(dirs.dashboardDir, 'functions.js'));
|
||||||
|
|
||||||
|
// $ export server module
|
||||||
|
module.exports = { boot, shutdown, restart, status, server };
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
/*
|
||||||
|
! /servers/gateway/functions.js – Central Gateway Server Functions
|
||||||
|
? This modules exports the functionality for the express gateway server
|
||||||
|
*/
|
||||||
|
|
||||||
|
// % import nodejs dependencies
|
||||||
|
const WebSocket = require('ws');
|
||||||
|
|
||||||
|
// % core variables
|
||||||
|
const ip = process.env.INTERNAL_HOST_IP;
|
||||||
|
const port = process.env.INTERNAL_GATEWAY_PORT;
|
||||||
|
|
||||||
|
// % create a reference for the websocket client
|
||||||
|
let wsClient = null;
|
||||||
|
|
||||||
|
// % create an event emitter for the gateway
|
||||||
|
const EventEmitter = require('events');
|
||||||
|
const gatewayEvents = new EventEmitter();
|
||||||
|
|
||||||
|
// $ helper: send messages through websocket
|
||||||
|
function sendToWs(payload) {
|
||||||
|
if (wsClient && wsClient.readyState === WebSocket.OPEN) {
|
||||||
|
wsClient.send(JSON.stringify(payload));
|
||||||
|
} else {
|
||||||
|
console.error('WebSocket not connected.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// $ server start function
|
||||||
|
async function boot(server) {
|
||||||
|
// ~ start express server
|
||||||
|
server.listen(port, ip, () => {
|
||||||
|
console.info(`Express server is now running on http://${ip}:${port}`);
|
||||||
|
});
|
||||||
|
|
||||||
|
// ~ connect to the websocket server
|
||||||
|
const wsUrl = `ws://${process.env.INTERNAL_HOST_IP}:${process.env.INTERNAL_WEBSOCKET_PORT}?key=${process.env.INTERNAL_SECRET}&codename=gateway`;
|
||||||
|
wsClient = new WebSocket(wsUrl);
|
||||||
|
|
||||||
|
wsClient.on('open', () => {
|
||||||
|
console.info('Connected to central websocket server');
|
||||||
|
});
|
||||||
|
|
||||||
|
wsClient.on('message', (data) => {
|
||||||
|
const msg = JSON.parse(data);
|
||||||
|
gatewayEvents.emit('ws_message', msg);
|
||||||
|
});
|
||||||
|
|
||||||
|
wsClient.on('error', (err) => {
|
||||||
|
console.error('WebSocket error:', err.message);
|
||||||
|
});
|
||||||
|
|
||||||
|
// ~ return running express server reference
|
||||||
|
return server;
|
||||||
|
};
|
||||||
|
|
||||||
|
// $ server shutdown function
|
||||||
|
async function shutdown(server) {
|
||||||
|
// ~ close websocket server
|
||||||
|
if (wsClient) {
|
||||||
|
wsClient.close();
|
||||||
|
wsClient = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ~ shutdown running express server
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
server.close(() => {
|
||||||
|
console.info('Express server shut down.');
|
||||||
|
resolve(server);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// $ server restart function
|
||||||
|
async function restart(server) {
|
||||||
|
// ~ shutdown the running express server
|
||||||
|
await shutdown(server);
|
||||||
|
|
||||||
|
// ~ restart the express server
|
||||||
|
await boot(server);
|
||||||
|
|
||||||
|
// ~ return the server reference
|
||||||
|
return server;
|
||||||
|
};
|
||||||
|
|
||||||
|
// $ server status function
|
||||||
|
async function status(server) {
|
||||||
|
// ~ get and return server listening status
|
||||||
|
return server.listening ? 'online' : 'offline';
|
||||||
|
};
|
||||||
|
|
||||||
|
// § export server functions module
|
||||||
|
module.exports = { boot, shutdown, restart, status, sendToWs, gatewayEvents };
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
! /servers/gateway/routers/index.js – Central Gateway Routing Aggregator
|
||||||
|
? This module dynamically collects and registeres all modular ".router.js" files within the "routers" directory
|
||||||
|
*/
|
||||||
|
|
||||||
|
// % import nodejs packages
|
||||||
|
const router = require('express').Router();
|
||||||
|
const path = require('path');
|
||||||
|
const fs = require('fs');
|
||||||
|
|
||||||
|
// % import external dependencies
|
||||||
|
const rootDir = path.resolve(__dirname, '..', '..', '..');
|
||||||
|
const { dirs } = require(path.resolve(rootDir, 'configuration', 'mapping.js'));
|
||||||
|
|
||||||
|
// % read router files recursively
|
||||||
|
const routerRoot = path.resolve(dirs.gatewayDir, 'routers');
|
||||||
|
const routerFiles = fs.readdirSync(routerRoot)
|
||||||
|
.filter(file => /\.router\.js$/.test(file))
|
||||||
|
.sort((a, b) => {
|
||||||
|
if (a === 'root.router.js') return 1;
|
||||||
|
if (b === 'root.router.js') return -1;
|
||||||
|
return a.localeCompare(b);
|
||||||
|
});
|
||||||
|
|
||||||
|
// $ configure used routers
|
||||||
|
routerFiles.forEach(file => {
|
||||||
|
const routerPath = path.resolve(routerRoot, file);
|
||||||
|
router.use(require(routerPath));
|
||||||
|
});
|
||||||
|
|
||||||
|
// § export router module
|
||||||
|
module.exports = router;
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
/*
|
||||||
|
! /servers/gateway/routers/template.router.js –
|
||||||
|
*/
|
||||||
|
|
||||||
|
// % import nodejs dependencies
|
||||||
|
const router = require('express').Router();
|
||||||
|
|
||||||
|
// % import external dependencies
|
||||||
|
const rootDir = path.resolve(__dirname, '..', '..', '..');
|
||||||
|
const { dirs } = require(path.resolve(rootDir, 'configuration', 'mapping.js'));
|
||||||
|
const { gatewayEvents, sendToWs } = path.resolve(dirs.gateway, 'functions.js');
|
||||||
|
|
||||||
|
// $ template router with websocket integration
|
||||||
|
router.post('/test', (req, res) => {
|
||||||
|
const correlationId = '';
|
||||||
|
|
||||||
|
sendToWs({
|
||||||
|
type: 'actionName',
|
||||||
|
correlationId,
|
||||||
|
data: req.body
|
||||||
|
});
|
||||||
|
|
||||||
|
// ~ wait for callback through central event bus
|
||||||
|
gatewayEvents.once('ws_message', (msg) => {
|
||||||
|
if (msg.correlationId === correlationId) res.json(msg.data);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// § export routers
|
||||||
|
module.exports = router;
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
! /servers/gateway/server.js – Central Gateway Server Manager
|
||||||
|
? This module orchestrates the express lifecycle, handles initialization, middleware configs and router integrations
|
||||||
|
*/
|
||||||
|
|
||||||
|
// % import nodejs packages
|
||||||
|
const express = require('express');
|
||||||
|
const http = require('http');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
// % import external dependencies
|
||||||
|
const rootDir = path.resolve(__dirname, '..', '..');
|
||||||
|
const { dirs } = require(path.resolve(rootDir, 'configuration', 'mapping.js'));
|
||||||
|
|
||||||
|
// % set up express server
|
||||||
|
const app = express();
|
||||||
|
const server = http.createServer(app);
|
||||||
|
|
||||||
|
// $ server setup
|
||||||
|
app.use(express.json()); // add json support for express
|
||||||
|
|
||||||
|
// $ router setup
|
||||||
|
const router = require(path.resolve(dirs.gatewayDir, 'routers'));
|
||||||
|
app.use(router);
|
||||||
|
|
||||||
|
// $ server functions
|
||||||
|
const {
|
||||||
|
boot, shutdown, restart, status
|
||||||
|
} = require(path.resolve(dirs.gatewayDir, 'functions.js'));
|
||||||
|
|
||||||
|
// $ export server module
|
||||||
|
module.exports = { boot, shutdown, restart, status, server };
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
/*
|
||||||
|
! /servers/websocket/actions/template.js – A simple websocket action template
|
||||||
|
? This module is just a template for the websocket actions
|
||||||
|
*/
|
||||||
|
|
||||||
|
module.exports = (connectionManager, data, id) => {
|
||||||
|
|
||||||
|
};
|
||||||
@@ -0,0 +1,185 @@
|
|||||||
|
/*
|
||||||
|
! /servers/websocket/connections.js – Central WebSocket Connection Manager
|
||||||
|
? This module handles all websocket connections as a pool and automatically sends heartbeats
|
||||||
|
*/
|
||||||
|
|
||||||
|
// % import nodejs dependencies
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
// % import external dependencies
|
||||||
|
const rootDir = path.resolve(__dirname, '..', '..');
|
||||||
|
const { generatePrefixed } = require(path.resolve(rootDir, 'services', 'idgen.js'));
|
||||||
|
|
||||||
|
// % create a new connection mapping
|
||||||
|
let connections = new Map();
|
||||||
|
let registry = new Map();
|
||||||
|
|
||||||
|
// % set heartbeat settings
|
||||||
|
let heartbeatInterval = null;
|
||||||
|
const heartbeatTime = 5000; // 5 seconds
|
||||||
|
|
||||||
|
// $ add a connection
|
||||||
|
function add(socket, codename = null) {
|
||||||
|
// % generate a unique id for websocket connections
|
||||||
|
const id = generatePrefixed('ws');
|
||||||
|
|
||||||
|
// ~ add connection to connection pool
|
||||||
|
const conn = { socket, codename, lastHeartbeat: Date.now() };
|
||||||
|
connections.set(id, conn);
|
||||||
|
|
||||||
|
// ~ add registry keys if codename is provided
|
||||||
|
if (codename) registry.set(codename, id);
|
||||||
|
|
||||||
|
// ~ listen for 'pong' events from client to update heartbeat timestamp
|
||||||
|
socket.on('pong', () => conn.lastHeartbeat = Date.now());
|
||||||
|
|
||||||
|
// ~ error handling
|
||||||
|
socket.on('error', (err) => remove(id));
|
||||||
|
|
||||||
|
// ~ close connection
|
||||||
|
socket.on('close', () => remove(id));
|
||||||
|
|
||||||
|
// ~ return client id
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
// $ remove a connection by id
|
||||||
|
function remove(id) {
|
||||||
|
// % find id in connection map
|
||||||
|
const conn = connections.get(id);
|
||||||
|
|
||||||
|
// ~ close and remove connection
|
||||||
|
if (conn) {
|
||||||
|
// ~ cleanup registry if codename exists
|
||||||
|
if (conn.codename) registry.delete(conn.codename);
|
||||||
|
|
||||||
|
// ~ close connection
|
||||||
|
if (conn.socket.readyState === conn.socket.OPEN) conn.socket.close();
|
||||||
|
|
||||||
|
// ~ remove connection from pool
|
||||||
|
connections.delete(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// $ remove all connections
|
||||||
|
function removeAll() {
|
||||||
|
// ~ loop through connection mapping
|
||||||
|
for (const id of connections.keys()) {
|
||||||
|
remove(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// $ get a connection by id
|
||||||
|
function get(id) {
|
||||||
|
return connections.get(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
// $ get a connection by codename
|
||||||
|
function getByCodename(codename) {
|
||||||
|
// % get id from codename
|
||||||
|
const id = registry.get(codename);
|
||||||
|
|
||||||
|
// ~ return connection
|
||||||
|
return id ? connections.get(id) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// $ get all connections
|
||||||
|
function getAll() {
|
||||||
|
// % create a reference for all connections
|
||||||
|
const all = {};
|
||||||
|
|
||||||
|
// ~ loop through connections and fill "all" reference
|
||||||
|
for (const [id, data] of connections.entries()) {
|
||||||
|
all[id] = {
|
||||||
|
codename: data.codename,
|
||||||
|
lastHeartbeat: data.lastHeartbeat
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// ~ return the connection reference
|
||||||
|
return all;
|
||||||
|
}
|
||||||
|
|
||||||
|
// $ send a message to a specific connection by id
|
||||||
|
function send(id, message) {
|
||||||
|
// % get id
|
||||||
|
const conn = connections.get(id);
|
||||||
|
|
||||||
|
// ~ check if connection exists and is open
|
||||||
|
if (conn && conn.socket.readyState === conn.socket.OPEN) {
|
||||||
|
conn.socket.send(JSON.stringify(message));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ~ return immediately after a failure
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// $ send a message to a specific connection by codename
|
||||||
|
function sendTo(codename, message) {
|
||||||
|
// % get id
|
||||||
|
const id = registry.get(codename);
|
||||||
|
|
||||||
|
// ~ send a message if id exists
|
||||||
|
if (id) return send(id, message);
|
||||||
|
|
||||||
|
// ~ immediately return if id not exists
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// $ broadcast to all connections
|
||||||
|
function broadcast(message) {
|
||||||
|
// % serialize payload
|
||||||
|
const payload = JSON.stringify(message);
|
||||||
|
|
||||||
|
// ~ loop through all established connections
|
||||||
|
for (const conn of connections.values()) {
|
||||||
|
if (conn.socket.readyState === conn.socket.OPEN) {
|
||||||
|
conn.socket.send(payload);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// $ start the heartbeat system
|
||||||
|
function startBeat() {
|
||||||
|
if (heartbeatInterval) return;
|
||||||
|
|
||||||
|
heartbeatInterval = setInterval(() => {
|
||||||
|
const now = Date.now();
|
||||||
|
|
||||||
|
for (const [id, conn] of connections.entries()) {
|
||||||
|
// ~ send ping to active connections
|
||||||
|
if (conn.socket.readyState === conn.socket.OPEN) {
|
||||||
|
conn.socket.ping();
|
||||||
|
}
|
||||||
|
|
||||||
|
// ~ remove stale connections (no pong in 2 heartbeat intervals)
|
||||||
|
if (now - conn.lastHeartbeat > heartbeatTime * 2) {
|
||||||
|
remove(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, heartbeatTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
// $ stop the heartbeat system
|
||||||
|
function stopBeat() {
|
||||||
|
if (heartbeatInterval) {
|
||||||
|
clearInterval(heartbeatInterval);
|
||||||
|
heartbeatInterval = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// § export the websocket connection module
|
||||||
|
module.exports = {
|
||||||
|
add,
|
||||||
|
remove,
|
||||||
|
removeAll,
|
||||||
|
get,
|
||||||
|
getByCodename,
|
||||||
|
getAll,
|
||||||
|
send,
|
||||||
|
sendTo,
|
||||||
|
broadcast,
|
||||||
|
startBeat,
|
||||||
|
stopBeat
|
||||||
|
};
|
||||||
@@ -0,0 +1,134 @@
|
|||||||
|
/*
|
||||||
|
! /servers/websocket/server.js – Central Websocket Server Manager
|
||||||
|
? This module orchestrates the websocket lifecycle, handles connections, heartbeats and actions
|
||||||
|
*/
|
||||||
|
|
||||||
|
// % import nodejs packages
|
||||||
|
const path = require('path');
|
||||||
|
const fs = require('fs');
|
||||||
|
const http = require('http');
|
||||||
|
const WebSocket = require('ws');
|
||||||
|
|
||||||
|
// % import external dependencies
|
||||||
|
const rootDir = path.resolve(__dirname, '..', '..');
|
||||||
|
const { dirs } = require(path.resolve(rootDir, 'configuration', 'mapping.js'));
|
||||||
|
const connectionManager = require(path.resolve(dirs.websocketDir, 'connections.js'));
|
||||||
|
|
||||||
|
// % declare action directories
|
||||||
|
const wsActionsDir = path.resolve(dirs.websocketDir, 'actions');
|
||||||
|
|
||||||
|
// % declare reference for actions
|
||||||
|
const actions = {};
|
||||||
|
|
||||||
|
// % declare references for the websocket server
|
||||||
|
const ip = process.env.INTERNAL_HOST_IP;
|
||||||
|
const port = process.env.INTERNAL_WEBSOCKET_PORT;
|
||||||
|
let server = null;
|
||||||
|
|
||||||
|
// $ load all websocket actions recursively
|
||||||
|
// ? The loader is loading all actions with a dot notation
|
||||||
|
// ?? Usage: actionName || folder.actionName || folder.folder2.actionName ....
|
||||||
|
async function loadActions(dir = wsActionsDir, prefix = '') {
|
||||||
|
// ~ reset the action container to ensure a clean state during reloads
|
||||||
|
for (const key in actions) delete actions[key];
|
||||||
|
|
||||||
|
// % read all content synchronously
|
||||||
|
const files = fs.readdirSync(dir);
|
||||||
|
|
||||||
|
// ~ loop through each file or folder found in the directory
|
||||||
|
for (const file of files) {
|
||||||
|
// % construct the absolute path to the current item
|
||||||
|
const fullPath = path.resolve(dir, file);
|
||||||
|
|
||||||
|
// ~ retrieve file system metadata
|
||||||
|
const stat = fs.statSync(fullPath);
|
||||||
|
|
||||||
|
// ~ check if item is a folder
|
||||||
|
if (stat.isDirectory()) {
|
||||||
|
// ~ recurse into subdirs and append the folder name to the prefix
|
||||||
|
loadActions(fullPath, prefix + file + '.');
|
||||||
|
} else if (file.endsWith('.js')) {
|
||||||
|
// ~ generate a unique action name by stripping the file extension and include the prefix
|
||||||
|
const actionName = prefix + file.replace('.js', '');
|
||||||
|
|
||||||
|
// ~ invalidate the require cache to allow loading the updated code
|
||||||
|
delete require.cache[require.resolve(fullPath)];
|
||||||
|
|
||||||
|
// ~ load the fresh module version into the actions registry
|
||||||
|
actions[actionName] = require(fullPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// $ function to start the websocket server
|
||||||
|
async function start() {
|
||||||
|
// ~ initially load all websocket actions
|
||||||
|
await loadActions();
|
||||||
|
|
||||||
|
try {
|
||||||
|
// ~ set up a new websocket server
|
||||||
|
const wss = new WebSocket.Server({
|
||||||
|
host: ip,
|
||||||
|
port: port
|
||||||
|
});
|
||||||
|
|
||||||
|
wss.on('connection', async (socket, req) => {
|
||||||
|
// ~ authorize connection
|
||||||
|
const url = new URL(req.url, `http://${req.headers.host}`);
|
||||||
|
const key = url.searchParams.get('key');
|
||||||
|
const codename = url.searchParams.get('codename');
|
||||||
|
if (key !== process.env.INTERNAL_SECRET) {
|
||||||
|
socket.close(1008, 'Unauthorized');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ~ get connection id and establish connection
|
||||||
|
const id = await connectionManager.add(socket, codename);
|
||||||
|
connectionManager.sendTo(codename, id);
|
||||||
|
|
||||||
|
// ~ register websocket messages
|
||||||
|
socket.on('message', async (data) => {
|
||||||
|
// ~ parse json data
|
||||||
|
const msg = JSON.parse(data);
|
||||||
|
|
||||||
|
// % get user id and validate
|
||||||
|
const valid = connectionManager.get(id);
|
||||||
|
if (valid.socket.readyState !== valid.socket.OPEN) {
|
||||||
|
connectionManager.remove(id);
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
|
||||||
|
// % declare action type (e.g. folder.actionName)
|
||||||
|
const type = msg.type;
|
||||||
|
if (!type) {
|
||||||
|
connectionManager.send(id, 'Action value is empty. Please declare an action value.');
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
|
||||||
|
// ~ set action handler
|
||||||
|
const actionHandler = actions[msg.type];
|
||||||
|
if (!actionHandler) {
|
||||||
|
connectionManager.send(id, `Action ${actionHandler} not found.`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ~ send action to handler
|
||||||
|
try {
|
||||||
|
await actionHandler(connectionManager, msg.data, id);
|
||||||
|
} catch(e) {
|
||||||
|
console.error('Error while trying to execute the websocket action!', e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// ~ start the heartbeat system with the connection manager
|
||||||
|
connectionManager.startBeat();
|
||||||
|
} catch(e) {
|
||||||
|
console.error('Error while trying to start the websocket server', e);
|
||||||
|
connectionManager.stopBeat();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// § export websocket server and functions
|
||||||
|
module.exports = { start, loadActions };
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
/*
|
||||||
|
! /services/idgen.js – Central Unique ID-Generator
|
||||||
|
? This module will create unique ids using crypto
|
||||||
|
*/
|
||||||
|
|
||||||
|
// % import nodejs dependencies
|
||||||
|
const crypto = require('crypto');
|
||||||
|
|
||||||
|
// $ create a new unique id
|
||||||
|
const generate = () => crypto.randomBytes(32).toString('hex'); // simple id generator
|
||||||
|
const generatePrefixed = (prefix) => `${prefix}_${generate()}`; // prefixed id generator
|
||||||
|
|
||||||
|
// § export id-generator module
|
||||||
|
module.exports = { generate, generatePrefixed };
|
||||||
Reference in New Issue
Block a user