-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Athena's Shield | The Extra File Verification System #364
Open
Sandro642
wants to merge
56
commits into
dscalzi:master
Choose a base branch
from
Sandro642:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+391
−51
Open
Changes from 53 commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
3ee4c73
Add documentation for Athena's Shield feature
Sandro642 9813802
Add Athena's Shield configuration and CLI
Sandro642 5f3e229
Add new dlAsync function and mod validation messages
Sandro642 3790b52
Update landing.js dependencies and add new features
Sandro642 85cb733
Fix typo in game launch message
Sandro642 7073c27
Add mod whitelist and new HeliosLauncher support
Sandro642 886b29e
Use AthShield for mod verification
Sandro642 1476dbb
Merge remote-tracking branch 'origin/master'
Sandro642 2fc9c3e
Add mod verification logic using Athena's Shield
Sandro642 b435f7a
Refactor project structure by moving athshield files
Sandro642 e3c6a18
Add Athena's Shield activation messages
Sandro642 ae9e7b5
Update athshield script path in package.json
Sandro642 fc5a2d4
Rename view method to type and integrate athShield in settings
Sandro642 96e0ca1
Refactor menu visibility logic in athshield.js
Sandro642 297a3a0
Refactor comments and questions from French to English
Sandro642 9d4c8cc
Fix escape character handling in console log messages
Sandro642 4835001
Refactor dataPath assignment
Sandro642 1f4df6b
Refactor config path retrieval in landing.js
Sandro642 980c836
Make package public
Sandro642 0964648
Add project configuration and settings files
Sandro642 3cdad51
Add debug mode option to Athena's Shield configuration
Sandro642 485facf
Enable debug logging conditionally for AthShield
Sandro642 33788d4
Update REMOTE_DISTRO_URL to new API endpoint
Sandro642 84b4ba9
Refactor identity check error message
Sandro642 f366b8b
Update distribution URL in distromanager.js
Sandro642 50ad0e8
Enable detailed debug logging for mod identity validation
Sandro642 a94aa49
Fix typo in comment annotation
Sandro642 1515571
Remove deprecated Athena Shield and HeliosLauncher code
Sandro642 db49984
Update documentation: Move Athena's Shield docs to /docs
Sandro642 1608983
Add crypto package to dependencies
Sandro642 a9c81a1
Update review date in landing.js header comment
Sandro642 d0c5bf1
Set package to private
Sandro642 5ffa732
Remove outdated .idea configuration files
Sandro642 068ca6b
Remove French configuration and distribution files
Sandro642 a8a00e4
Add Athena's Shield section to README
Sandro642 aab9ff5
Update launch process with Discord RPC enhancements
Sandro642 8744d3b
Remove unnecessary comment separators
Sandro642 0893cf5
Update landing script to improve debug capabilities
Sandro642 f0321e1
Reorder function calls in prepareModsTab.
Sandro642 0348e83
Refactor Athena's Shield configuration handling
Sandro642 f68165c
Refactor class name in parserExtraverif.js
Sandro642 040ca97
Refactor CLI activation logic and improve debug capabilities
Sandro642 aef5e02
Refactor mod verification logic and improve debug capabilities
Sandro642 1614b63
Refactor language file and update mod verification messages
Sandro642 93bca16
Refactor documentation and file names for mod verification
Sandro642 bd67015
Refactor package.json to update extraverif script
Sandro642 e51eefa
Refactor mod verification system and improve debug capabilities
Sandro642 745a11e
Refactor landing.js: Remove unnecessary blank lines and comments
Sandro642 4732ee5
Refactor landing.js: Update logger name in dlAsync function
Sandro642 d659e0f
Refactor README.md: Remove ExtraFileVerification section
Sandro642 07ed316
Refactor package.json: Remove unused crypto dependency
Sandro642 7f33a1d
Refactor landing.js: Update modIdentity assignment in dlAsync function
Sandro642 2f0a054
Refactor variables.json: Add newline at end of file
Sandro642 d4437c7
Update variables.json
Sandro642 0770d65
Refactor settings.js: Update variable and comment names in manageMods…
Sandro642 092f36a
Refactor variables.json: Add newline at end of file
Sandro642 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
const fs = require('fs') | ||
const readline = require('readline') | ||
const path = require('path') | ||
|
||
const configPath = path.join(__dirname, 'variables.json') | ||
|
||
function loadConfig() { | ||
const rawData = fs.readFileSync(configPath) | ||
return JSON.parse(rawData.toString()) | ||
} | ||
|
||
function saveConfig(config) { | ||
const data = JSON.stringify(config, null, 2) | ||
fs.writeFileSync(configPath, data) | ||
} | ||
|
||
const rl = readline.createInterface({ | ||
input: process.stdin, | ||
output: process.stdout | ||
}) | ||
|
||
function startCLI() { | ||
const config = loadConfig() | ||
|
||
rl.question('Would you like to activate extra file verification? (yes/no): ', (answer) => { | ||
if (answer.trim().startsWith('//')) { | ||
console.log('This is a comment; the line is ignored.') | ||
rl.close() | ||
return | ||
} | ||
|
||
if (answer.toLowerCase() === 'yes') { | ||
config.extraFileVerifActivated = true | ||
|
||
rl.question('Would you like to activate debug mode? (yes/no): ', (debugAnswer) => { | ||
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' | ||
console.log('Extra file verification activated. Menu hidden.') | ||
} else if (menuAnswer.toLowerCase() === 'block') { | ||
config.menuVisibility = 'blocked' | ||
console.log('Extra file verification activated. Menu blocked.') | ||
} else { | ||
console.log('Invalid option for the menu.') | ||
rl.close() | ||
return | ||
} | ||
|
||
saveConfig(config) | ||
rl.close() | ||
}) | ||
}) | ||
} else if (answer.toLowerCase() === 'no') { | ||
console.log('Extra file verification not activated. Closing the CLI.') | ||
config.extraFileVerifActivated = false | ||
config.menuVisibility = 'visible' | ||
config.debug = false | ||
|
||
saveConfig(config) | ||
rl.close() | ||
} else { | ||
console.log('Invalid response.') | ||
rl.close() | ||
} | ||
}) | ||
} | ||
|
||
startCLI() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
const fs = require('fs') | ||
const path = require('path') | ||
|
||
const configPath = path.join(__dirname, 'variables.json') | ||
|
||
class ExtraFileVerification { | ||
constructor() { | ||
this.config = this.loadConfig() | ||
} | ||
|
||
loadConfig() { | ||
const rawData = fs.readFileSync(configPath) | ||
return JSON.parse(rawData.toString()) | ||
} | ||
|
||
get status() { | ||
return this.config.extraFileVerifActivated | ||
} | ||
|
||
get type() { | ||
return this.config.menuVisibility | ||
} | ||
|
||
get debug() { | ||
return this.config.debug | ||
} | ||
} | ||
|
||
const ExtraFileVerificationInstance = new ExtraFileVerification() | ||
module.exports = ExtraFileVerificationInstance |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"extraFileVerifActivated": false, | ||
"menuVisibility": "visible", | ||
"debug": false | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that a workaround for your editor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean by that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The empty line before the closing bracket
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will remove the space