-
Notifications
You must be signed in to change notification settings - Fork 217
Add configuration reader script #162
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
Conversation
scripts/configReader.js
Outdated
} else { | ||
const fileName = env ? `${network}.${env}.json` : `${network}.json`; | ||
const filePath = path.join(__dirname, "./config", fileName); | ||
configLoader = new ConfiguratorLoader.Local(filePath); |
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 this really useful? If there is a local json config file, we could just open this file directly without requiring a script, no?
Instead of having to read it via a script, could we not simply have an unauthenticated GET request that returns the file from S3? @gergold |
@olivdb The config file contains some information about our AWS configuration which we might not want to expose publicly. |
scripts/configReader.js
Outdated
const configurator = new Configurator(configLoader); | ||
await configurator.load(); | ||
const configuration = configurator.copyConfig(); | ||
console.log(configuration); |
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.
Could we JSON.stringify
the configuration
so that all subfields display properly?
01e0244
to
9cd03e7
Compare
ce6ba34
to
694124d
Compare
Allows us to read configuration files easily. Note that config is read without verification to allow us to read potentially invalid config. The script does the validation at the end and logs any schema validation errors. I added this logic after noticing the current staging configuration is invalid due to the missing
ArgentWalletDetector
schema property.