Skip to content

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

Merged
merged 5 commits into from
Oct 19, 2020

Conversation

elenadimitrova
Copy link
Contributor

@elenadimitrova elenadimitrova commented Oct 8, 2020

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.

@elenadimitrova elenadimitrova self-assigned this Oct 8, 2020
} else {
const fileName = env ? `${network}.${env}.json` : `${network}.json`;
const filePath = path.join(__dirname, "./config", fileName);
configLoader = new ConfiguratorLoader.Local(filePath);
Copy link
Contributor

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?

@olivdb
Copy link
Contributor

olivdb commented Oct 13, 2020

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

@juniset
Copy link
Member

juniset commented Oct 16, 2020

@olivdb The config file contains some information about our AWS configuration which we might not want to expose publicly.

const configurator = new Configurator(configLoader);
await configurator.load();
const configuration = configurator.copyConfig();
console.log(configuration);
Copy link
Contributor

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?

@elenadimitrova elenadimitrova force-pushed the maintenance/configuration-reader branch 2 times, most recently from 01e0244 to 9cd03e7 Compare October 19, 2020 08:09
@elenadimitrova elenadimitrova requested a review from olivdb October 19, 2020 10:31
@elenadimitrova elenadimitrova force-pushed the maintenance/configuration-reader branch from ce6ba34 to 694124d Compare October 19, 2020 11:48
@elenadimitrova elenadimitrova merged commit b98ad7c into develop Oct 19, 2020
@elenadimitrova elenadimitrova deleted the maintenance/configuration-reader branch October 19, 2020 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants