Skip to content
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

Support environment variables as an alternative to any system properties #62

Merged
merged 2 commits into from
Sep 26, 2023

Conversation

jampukka
Copy link
Collaborator

@jampukka jampukka commented Sep 25, 2023

System properties [{context_path}.]hakuna.config.path can now be configured via {CONTEXT_PATH}_HAKUNA_CONFIG_PATH or HAKUNA_CONFIG_PATH env variables.

env variables take higher precedence, but only within the same key, meaning in here the priority is (see the added unit test):

  1. env variable {CONTEXT_PATH}_HAKUNA_CONFIG_PATH
  2. system property {context_path}.hakuna.config.path
  3. env variable HAKUNA_CONFIG_PATH
  4. system property hakuna.config.path

Related issue #50

@jampukka jampukka added this to the 1.2.0 milestone Sep 25, 2023
@tsallinen
Copy link

Looks good to me!

Although HAKUNAPI_HAKUNA is a bit redundant, perhaps this should be left as it is for backwards compatibility?

@jampukka
Copy link
Collaborator Author

jampukka commented Sep 26, 2023

Yes it's redundant as I didn't want to change the System.property key in 1.0.0 away from [{context_path}.]hakuna.config.path.

Alternatively, as these are already hakuna prefixed, just accept that these keys have a legacy behind them and drop the HAKUNAPI_ prefix from env variables altogether.

@jampukka
Copy link
Collaborator Author

Changed it now @tsallinen

@jampukka jampukka merged commit 13c42ac into main Sep 26, 2023
2 checks passed
@jampukka jampukka deleted the feature/env-variables branch September 26, 2023 08:37
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.

2 participants