Comparing version 2.4.2 to 2.4.3
{ | ||
"name": "netget", | ||
"version": "2.4.2", | ||
"version": "2.4.3", | ||
"description": "Rette Adepto/ Recibido Directamente.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -8,8 +8,10 @@ <img src="https://suign.github.io/assets/imgs/netget.png" alt="netget.me" width="244" height="203"> | ||
In development stage and subject to changes. | ||
> In development stage and subject to changes. | ||
> | ||
> Learn more at: [netget.me](https://netget.me) | ||
**NetGet** streamlines the orchestration of digital domains with the simplicity of a pedal's press, enabling seamless symphonies across networked realms. Acts as a dynamic conduit, **directing internet traffic to local services**. Inspired by the vast digital landscapes of cyberpunk lore. | ||
**NetGet** streamlines the orchestration of digital domains with the simplicity of a pedal's press, enabling seamless symphonies across networked realms. Acts as a dynamic conduit, **directing internet traffic to local services**. Inspired by the vast digital landscapes of cyberpunk lore and the simplicity of guitar pedals. | ||
Visit [netget.me](https://netget.me) | ||
## Installation | ||
@@ -33,3 +35,3 @@ | ||
NetGetX serves as the backbone for configuring NGINX under the NetGet ecosystem. Here’s what it primarily focuses on: | ||
**NetGetX** serves as the backbone for configuring NGINX under the NetGet ecosystem. Here’s what it primarily focuses on: | ||
@@ -36,0 +38,0 @@ - **Verifying NGINX Server Block:** Ensures the default NGINX server block matches the expected setup for optimal traffic handling. |
// configureDefaultServerBlock.js | ||
import fs from 'fs'; | ||
import chalk from 'chalk'; | ||
import defaultServerBlock from './defaultServerBlock.js'; | ||
import getDefaultServerBlock from './defaultServerBlock.js'; | ||
import inquirer from 'inquirer'; | ||
@@ -9,4 +9,5 @@ import { execShellCommand } from '../../utils/execShellCommand.js'; // Make sure this is correctly imported | ||
export const configureDefaultServerBlock = async (userConfig) => { | ||
const serverBlock = getDefaultServerBlock(userConfig); | ||
try { | ||
fs.writeFileSync(userConfig.nginxPath, defaultServerBlock); | ||
fs.writeFileSync(userConfig.nginxPath, serverBlock); | ||
console.log(chalk.green(`NGINX default server block has been configured at ${userConfig.nginxPath}.`)); | ||
@@ -16,3 +17,3 @@ } catch (error) { | ||
console.error(chalk.red(`Permission denied writing to ${userConfig.nginxPath}.`)); | ||
await handlePermissionError(userConfig.nginxPath, defaultServerBlock); | ||
await handlePermissionError(userConfig.nginxPath, serverBlock); | ||
} else { | ||
@@ -19,0 +20,0 @@ console.error(chalk.red(`Error writing to ${userConfig.nginxPath}: ${error.message}`)); |
// defaultServerBlock.js | ||
const defaultServerBlock = ` | ||
const getDefaultServerBlock = (userConfig) => ` | ||
events { | ||
@@ -8,4 +8,4 @@ worker_connections 1024; | ||
http { | ||
include /etc/nginx/conf.d/*.conf; | ||
include /etc/nginx/sites-enabled/*; | ||
include ${userConfig.nginxSitesAvailable}/*.conf; | ||
include ${userConfig.nginxSitesEnabled}/*; | ||
@@ -22,2 +22,3 @@ server { | ||
`; | ||
export default defaultServerBlock; | ||
export default getDefaultServerBlock; |
{ | ||
"nginxConfigurationProceed": false, | ||
"nginxPath": "", | ||
"nginxSitesAvailable": "", | ||
"nginxSitesEnabled": "", | ||
"nginxPath": "/opt/homebrew/etc/nginx/nginx.conf", | ||
"nginxSitesAvailable": "/opt/homebrew/etc/nginx/sites-available", | ||
"nginxSitesEnabled": "/opt/homebrew/etc/nginx/sites-enabled", | ||
"useSudo": false, | ||
"nginxExecutable": "" | ||
"nginxExecutable": "/opt/homebrew/bin/nginx" | ||
} |
@@ -1,5 +0,5 @@ | ||
// verifyServerBlock.js | ||
// netget/src/modules/NetGetX/config/verifyServerBlock.js | ||
import fs from 'fs'; | ||
import chalk from 'chalk'; | ||
import defaultServerBlock from './defaultServerBlock.js'; // This contains the expected default server block configuration | ||
import getDefaultServerBlock from './defaultServerBlock.js'; // Adjusted import to get the function | ||
import { serverBlockConfigOptions } from './serverBlockConfigOptions.cli.js'; | ||
@@ -11,6 +11,7 @@ | ||
const nginxConfigPath = userConfig.nginxPath; // Path to nginx.conf | ||
const expectedServerBlock = getDefaultServerBlock(userConfig); // Get the dynamic server block | ||
try { | ||
const configData = fs.readFileSync(nginxConfigPath, 'utf8'); | ||
if (configData.includes(defaultServerBlock.trim())) { | ||
if (configData.includes(expectedServerBlock.trim())) { | ||
console.log(chalk.green('Default NGINX server block is correctly configured.')); | ||
@@ -17,0 +18,0 @@ return true; |
@@ -7,2 +7,3 @@ // NetGetX.cli.js | ||
import { NetGetMainMenu } from '../netget_MainMenu.cli.js'; | ||
import {nginxMenu } from './NGINX/nginx_menu.cli.js'; | ||
//import { showNGXBlocks, addNewNGXBlock, showNGXDiscoveryNode, addNewNGXDiscoveryNode, netGetXSettings, aboutNetGetX } from './netGetXOptions.js'; | ||
@@ -17,6 +18,7 @@ export async function NetGetX() { | ||
'Add New XBlock', | ||
'Show X Discovery Nodes', | ||
'Add New X Discovery Node', | ||
'NetGetX Settings', | ||
'About NetGetX', | ||
'NGINX Menu', | ||
//'Show X Discovery Nodes', | ||
//'Add New X Discovery Node', | ||
//'NetGetX Settings', | ||
//'About NetGetX', | ||
'Main Menu', | ||
@@ -36,2 +38,5 @@ 'Exit' | ||
break; | ||
case 'NGINX Menu': | ||
await nginxMenu(); | ||
break; | ||
case 'Main Menu': | ||
@@ -38,0 +43,0 @@ console.log(chalk.blue('Returning to the main menu...')); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
879678
53
1307
147
16
7