vert-x3 / vertx-config

Vert.x Configuration Service
Apache License 2.0
54 stars 64 forks source link

support CONFIG_FORCE_ environment variables with HOCON config file format #143

Closed nareshv closed 1 year ago

nareshv commented 2 years ago

Describe the feature

typesafe config supports overriding the config key/value pairs using environment variables using CONFIGFORCE mechanism

Reference: https://github.com/lightbend/config#optional-system-or-env-variable-overrides

Use cases

This will enable overriding configurations using the typesafe config way.

Contribution

As vert.x supports both ENV & HOCON formats, not sure where this feature will go. After exploring the ENV config engine, SYS config engine found out that there are some features in the SYS engine (hierarchical=true) can be useful in ENV engine and HOCON + ENV engine as well.

Open for suggestions and direction on this ?

gaol commented 1 year ago

I think this can be done in HoconProcessor with a specified flag to respect overridden environment variables or not.