-
Notifications
You must be signed in to change notification settings - Fork 22
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
Change the mechanism of reading configuration as well as the style of it #879
Conversation
…er port for conseil-api in docker environment
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.
LGTM
conseil-common/src/main/scala/tech/cryptonomic/conseil/common/config/Platforms.scala
Outdated
Show resolved
Hide resolved
conseil-common/src/main/scala/tech/cryptonomic/conseil/common/config/Platforms.scala
Outdated
Show resolved
Hide resolved
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.
Waiting for your feedback on open comments
…l be overwritten anyway).
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.
Let's do it
Originally taken from: #875 but I decided to create another branch due to my mistake while doing rebase
This pull-request updates the style of the configuration, which is needed to improve way of passing custom properties to configuration file from the docker. This change is needed to add support for multiple blockchains.
In this change I wanted to address couple of improvements that can be done to address this issue:
a) We should not use 'sed' from shell, to replace our own macros with environment variables. Typesafe-config already supports this feature.
b) We should not copy entire configuration and fill up all of the variables, if user wants to update only couple of them.
c) Default variables should be stored in classpath's configuration, not somewhere in shell script (due to above mechanism).
d) There should be an option to run single and/or multiple blockchains for the single Conseil API instance.
All of this can be solved by using specific macro from typesafe-config. Sadly, this macro does not work when section of configuration is dynamic. Meaning:
Works:
Won't work:
Sadly, the latter is how we have it right now. I found that not that intuitive as originally thought. Most of the things can be done by implementing this configuration as a list, instead of map.
My idea is to change the configuration into something like that:
Sadly, I tried to update pureconfig but I there is significant change in a way of reading configuration which overcomplicates things. I guess they forgot about one mechanism and it will be implemented in a future. I'll try to address that issue nonetheless but in upcoming days.
This pull-requests addresses all of the mentioned points.
Code review:
PlatformsConfiguration
Unknown
blockchain type and assign different one for ArgumentsConfigCONSEIL_API_SECURITY_KEY
toCONSEIL_API_KEY
CONSEIL_API_SECURITY_ALLOW_BLANK
toCONSEIL_API_ALLOW_BLANK_KEYS