diff --git a/app/assets/athshield/variables.athshield b/app/assets/athshield/variables.athshield deleted file mode 100644 index b7c29b1a..00000000 --- a/app/assets/athshield/variables.athshield +++ /dev/null @@ -1,5 +0,0 @@ -{ - "athenaShieldActivated": false, - "menuVisibility": "visible", - "debug": "false" -} \ No newline at end of file diff --git a/app/assets/athshield/athshield.js b/app/assets/extraverif/extraverif.js similarity index 51% rename from app/assets/athshield/athshield.js rename to app/assets/extraverif/extraverif.js index 15b7764c..5f285b3b 100644 --- a/app/assets/athshield/athshield.js +++ b/app/assets/extraverif/extraverif.js @@ -2,75 +2,62 @@ const fs = require('fs') const readline = require('readline') const path = require('path') -// Path to the configuration file -const configPath = path.join(__dirname, 'variables.athshield') +const configPath = path.join(__dirname, 'variables.json') -// Load the variables from the file function loadConfig() { const rawData = fs.readFileSync(configPath) - return JSON.parse(rawData.toString()) // Convert Buffer to string + return JSON.parse(rawData.toString()) } -// Save the variables to the file function saveConfig(config) { const data = JSON.stringify(config, null, 2) fs.writeFileSync(configPath, data) } -// Create the readline interface const rl = readline.createInterface({ input: process.stdin, output: process.stdout }) -// Function to ask questions to the user function startCLI() { const config = loadConfig() - rl.question('Would you like to activate Athena\'s Shield? (yes/no): ', (answer) => { - if (answer.trim().startsWith('//')) { - console.log('This is a comment; the line is ignored.') + rl.question('Would you like to activate extra file verification? (yes/no): ', (answer) => { rl.close() return - } if (answer.toLowerCase() === 'yes') { - config.athenaShieldActivated = true + config.extraFileVerifActivated = true rl.question('Would you like to activate debug mode? (yes/no): ', (debugAnswer) => { - config.debug = debugAnswer.toLowerCase() === 'yes' // Set debug to true or false + config.debug = debugAnswer.toLowerCase() === 'yes' rl.question('Would you like to hide or block the menu? (hide/block): ', (menuAnswer) => { - if (menuAnswer.trim().startsWith('//')) { - console.log('This is a comment; the line is ignored.') rl.close() return - } if (menuAnswer.toLowerCase() === 'hide') { - config.menuVisibility = 'hidden' // Set to 'hidden' - console.log('Athena\'s Shield activated. Menu hidden.') + config.menuVisibility = 'hidden' + console.log('Extra file verification is activated. Menu hidden.') } else if (menuAnswer.toLowerCase() === 'block') { - config.menuVisibility = 'blocked' // Set to 'blocked' - console.log('Athena\'s Shield activated. Menu blocked.') + config.menuVisibility = 'blocked' + console.log('Extra file verification is activated. Menu blocked.') } else { console.log('Invalid option for the menu.') rl.close() return } - // Save the modified configuration saveConfig(config) rl.close() }) }) } else if (answer.toLowerCase() === 'no') { - console.log('Athena\'s Shield not activated. Closing the CLI.') - config.athenaShieldActivated = false - config.menuVisibility = 'visible' // Reset to default - config.debug = 'false' + console.log('Extra file verification is not activated. Closing the CLI.') + config.extraFileVerifActivated = false + config.menuVisibility = 'visible' + config.debug = false - // Save the modified configuration saveConfig(config) rl.close() } else { @@ -80,5 +67,4 @@ function startCLI() { }) } -// Launch the CLI startCLI() diff --git a/app/assets/athshield/parserAthShield.js b/app/assets/extraverif/parserExtraverif.js similarity index 53% rename from app/assets/athshield/parserAthShield.js rename to app/assets/extraverif/parserExtraverif.js index 336e0d4f..43921da3 100644 --- a/app/assets/athshield/parserAthShield.js +++ b/app/assets/extraverif/parserExtraverif.js @@ -1,37 +1,30 @@ const fs = require('fs') const path = require('path') -// Chemin vers le fichier de configuration -const configPath = path.join(__dirname, 'variables.athshield') +const configPath = path.join(__dirname, 'variables.json') -// Classe pour gérer Athena's Shield -class AthenaShield { +class ExtraFileVerification { constructor() { this.config = this.loadConfig() } - // Charger les variables depuis le fichier loadConfig() { const rawData = fs.readFileSync(configPath) return JSON.parse(rawData.toString()) } - // Récupérer le statut d'Athena's Shield get status() { - return this.config.athenaShieldActivated + return this.config.extraFileVerifActivated } - // Récupérer la visibilité du menu get type() { return this.config.menuVisibility } - // Récupérer le mode debug get debug() { return this.config.debug } } -// Exporter une instance de la classe const athenaShieldInstance = new AthenaShield() module.exports = athenaShieldInstance diff --git a/app/assets/extraverif/variables.json b/app/assets/extraverif/variables.json new file mode 100644 index 00000000..42cd8264 --- /dev/null +++ b/app/assets/extraverif/variables.json @@ -0,0 +1,5 @@ +{ + "extraFileVerifActivated": false, + "menuVisibility": "visible", + "debug": "false" +}