-
Notifications
You must be signed in to change notification settings - Fork 62
Open
Description
Hello, thanks for this project! I wasn't sure how to make a PR, but I solved this for myself and thought I'd quickly share back the code here.
Allowing override of any config file variable with an associated environment variable makes running in a dynamically provisioned container much easier.
This minor adaption will enable override of, e.g. gitea.personal_access_token by setting ${KOODER_GITEA_PERSONAL_ACCESS_TOKEN}
In Configuration.java:
// allow override of any config vars with environment vars
private String getEnvironmentVarName(String key) {
return "KOODER_" + key.replace('.', '_').toUpperCase();
}
public String getProperty(String key) {
// allow override with environment vars
String value = System.getenv(getEnvironmentVarName(key));
if(value != null) {
return value;
}
return this.props.getProperty(key);
}
[... do the same in each getProperty(...) ...]
Metadata
Metadata
Assignees
Labels
No labels