Comparing version 2.3.59 to 2.3.71
{ | ||
"name": "netget", | ||
"version": "2.3.59", | ||
"version": "2.3.71", | ||
"description": "Rette Adepto/ Recibido Directamente.", | ||
@@ -33,2 +33,3 @@ "type": "module", | ||
"commander": "^12.0.0", | ||
"express": "^4.19.2", | ||
"inquirer": "^9.2.17", | ||
@@ -35,0 +36,0 @@ "morgan": "^1.10.0", |
@@ -56,21 +56,38 @@ //src/gateway.js | ||
this.app.use((req, res) => { | ||
const hostname = req.hostname || req.headers['host']; | ||
const fullUrl = `${req.hostname || req.headers['host']}${req.url}`; | ||
let handler = null; | ||
// Iterate over the routes to find a match | ||
Object.keys(this.routes).forEach(pattern => { | ||
if (pattern === hostname) { | ||
// Direct hostname match | ||
handler = this.routes[pattern]; | ||
} else if (pattern.startsWith('*.')) { | ||
// Wildcard domain match | ||
const baseDomain = pattern.slice(2); | ||
if (hostname.endsWith(baseDomain) && (hostname.split('.').length === baseDomain.split('.').length + 1)) { | ||
handler = this.routes[pattern]; | ||
// Check for exact match first (full URL) | ||
Object.keys(this.routes).some(pattern => { | ||
const regexPattern = new RegExp(`^${pattern.replace(/\*/g, '.*')}$`); // Convert pattern to regex, replacing * with .* | ||
if (regexPattern.test(fullUrl)) { | ||
handler = this.routes[pattern]; | ||
return true; // Stop iteration once match is found | ||
} | ||
} | ||
return false; | ||
}); | ||
// Use the found handler or fallback to default | ||
// If no handler found, check if there's a more general match or use default | ||
if (!handler) { | ||
// Extract hostname for broader match | ||
const hostname = req.hostname || req.headers['host']; | ||
Object.keys(this.routes).some(pattern => { | ||
if (pattern === hostname) { | ||
handler = this.routes[pattern]; | ||
return true; | ||
} else if (pattern.startsWith('*.')) { | ||
const baseDomain = pattern.slice(2); | ||
if (hostname.endsWith(baseDomain) && (hostname.split('.').length === baseDomain.split('.').length + 1)) { | ||
handler = this.routes[pattern]; | ||
return true; | ||
} | ||
} | ||
return false; | ||
}); | ||
} | ||
// Fallback to default if no specific handler is found | ||
handler = handler || defaultRoutes; | ||
handler(req, res); | ||
}); | ||
}); | ||
@@ -77,0 +94,0 @@ |
@@ -34,3 +34,3 @@ // netget_MainMenu.js | ||
case 'NetGetX': | ||
console.log(chalk.blue('Initializing NetGetX v0.0.0...')); | ||
console.log(chalk.blue('Initializing NetGetX v0.0.1...')); | ||
try { | ||
@@ -37,0 +37,0 @@ const setupVerified = await i_DefaultNetGetX(); |
//i_DefaultNetGetX.js | ||
import chalk from 'chalk'; | ||
import os from 'os'; | ||
import { verifyNginxInstallation } from './verifyNginxInstallation.js'; | ||
@@ -10,2 +11,12 @@ import { nginxInstallationOptions } from './nginxInstallationOptions.cli.js'; | ||
console.log(chalk.blue('Running Enviroment Check...')); | ||
// Get the operating system platform | ||
const platform = os.platform(); // possible values are 'darwin', 'win32','linux', etc. | ||
// Get the operating system name | ||
const type = os.type(); // possible values are 'Linux', 'Darwin', 'Windows_NT', etc. | ||
// Get the operating system release | ||
const release = os.release(); | ||
// Output the information | ||
console.log(`Operating System: ${type} (${platform})`); | ||
console.log(`Release: ${release}`); | ||
// Check for public IP first | ||
@@ -22,3 +33,3 @@ const publicIP = await checkPublicIP(); | ||
// Verify NGINX installation and configuration | ||
let nginxVerified = await verifyNginxInstallation(); | ||
let nginxVerified = await verifyNginxInstallation(); // from './verifyNginxInstallation.js'; | ||
@@ -30,3 +41,3 @@ if (!nginxVerified) { | ||
// Recheck after installation options might have changed the state | ||
nginxVerified = await verifyNginxInstallation(); | ||
nginxVerified = await verifyNginxInstallation(); | ||
if (!nginxVerified) { | ||
@@ -33,0 +44,0 @@ console.log(chalk.red('NGINX installation or configuration still incorrect after attempted fixes.')); |
862580
925
6
+ Addedexpress@^4.19.2
+ Addedaccepts@1.3.8(transitive)
+ Addedarray-flatten@1.1.1(transitive)
+ Addedbody-parser@1.20.3(transitive)
+ Addedbytes@3.1.2(transitive)
+ Addedcall-bind-apply-helpers@1.0.2(transitive)
+ Addedcall-bound@1.0.3(transitive)
+ Addedcontent-disposition@0.5.4(transitive)
+ Addedcontent-type@1.0.5(transitive)
+ Addedcookie@0.7.1(transitive)
+ Addedcookie-signature@1.0.6(transitive)
+ Addeddestroy@1.2.0(transitive)
+ Addeddunder-proto@1.0.1(transitive)
+ Addedencodeurl@1.0.22.0.0(transitive)
+ Addedes-define-property@1.0.1(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedes-object-atoms@1.1.1(transitive)
+ Addedescape-html@1.0.3(transitive)
+ Addedetag@1.8.1(transitive)
+ Addedexpress@4.21.2(transitive)
+ Addedfinalhandler@1.3.1(transitive)
+ Addedforwarded@0.2.0(transitive)
+ Addedfresh@0.5.2(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-intrinsic@1.2.7(transitive)
+ Addedget-proto@1.0.1(transitive)
+ Addedgopd@1.2.0(transitive)
+ Addedhas-symbols@1.1.0(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedhttp-errors@2.0.0(transitive)
+ Addedipaddr.js@1.9.1(transitive)
+ Addedmath-intrinsics@1.1.0(transitive)
+ Addedmedia-typer@0.3.0(transitive)
+ Addedmerge-descriptors@1.0.3(transitive)
+ Addedmethods@1.1.2(transitive)
+ Addedmime@1.6.0(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedms@2.1.3(transitive)
+ Addednegotiator@0.6.3(transitive)
+ Addedobject-inspect@1.13.4(transitive)
+ Addedon-finished@2.4.1(transitive)
+ Addedparseurl@1.3.3(transitive)
+ Addedpath-to-regexp@0.1.12(transitive)
+ Addedproxy-addr@2.0.7(transitive)
+ Addedqs@6.13.0(transitive)
+ Addedrange-parser@1.2.1(transitive)
+ Addedraw-body@2.5.2(transitive)
+ Addedsend@0.19.0(transitive)
+ Addedserve-static@1.16.2(transitive)
+ Addedsetprototypeof@1.2.0(transitive)
+ Addedside-channel@1.1.0(transitive)
+ Addedside-channel-list@1.0.0(transitive)
+ Addedside-channel-map@1.0.1(transitive)
+ Addedside-channel-weakmap@1.0.2(transitive)
+ Addedstatuses@2.0.1(transitive)
+ Addedtoidentifier@1.0.1(transitive)
+ Addedtype-is@1.6.18(transitive)
+ Addedunpipe@1.0.0(transitive)
+ Addedutils-merge@1.0.1(transitive)
+ Addedvary@1.1.2(transitive)