sitture / env-config Goto Github PK
View Code? Open in Web Editor NEWA simple utility to manage environment configs in Java-based projects by merging .properties files and environment variables overrides.
License: MIT License
A simple utility to manage environment configs in Java-based projects by merging .properties files and environment variables overrides.
License: MIT License
Add EnvConfig.has("property")
check to return a boolean.
has
functionAdd the ability to clear the property from EnvConfig.
EnvConfig.clear(property);
Currently, it listens for ENV var to decide which environment but it's too generic.
ENV
to CONFIG_ENV
ENV_DIR
to CONFIG_DIR
Put an x
in all the boxes that apply
For more information, see the CONTRIBUTING
guide.
When I deploy in aws lambda, I get a config dir not found error. Locally, the code works fine.
Expected behavior: [What you expected to happen]
The library tries to locate the config dir in /var/task/config because it's the root in the lambda environment, but can't find it because it seems like the project root is not the same as lambda root
Actual behavior: [What actually happened]
The lib finds the dir
Versions: [What version of JDK/JRE and other tools are using]
Java 8
This is more like a plea for guidance than an issue. Has anybody deployed on lambda? If so, what did you set you CONFIG_DIR environment variable to?
Relevant log:
[2021-04-30 07:54:45.374] <5e08bf1a-dee9-41a2-90fb-3f1503d7107c>
DEBUG c.g.s.e.c.ConfigLoader - config.dir set to 'config'
ERROR c.a.a.BaseFunction - Error: 1fa9abe4-779e-42b9-8b21-69dcefe29642
com.github.sitture.env.config.ConfigException: '/var/task/config/DEV' does not exist or not a valid config directory!
at com.github.sitture.env.config.ConfigLoader.getConfigFiles(ConfigLoader.java:85)
at com.github.sitture.env.config.ConfigLoader.loadFileConfigurations(ConfigLoader.java:144)
at com.github.sitture.env.config.ConfigLoader.loadConfigurations(ConfigLoader.java:123)
at com.github.sitture.env.config.EnvConfig.(EnvConfig.java:21)
at com.github.sitture.env.config.EnvConfig.getConfig(EnvConfig.java:32)
at com.github.sitture.env.config.EnvConfig.get(EnvConfig.java:132)
I'm the author of a newer SLF4J facade called RainbowGum: https://github.com/jstachio/rainbowgum
Rainbow Gum is unique for several reasons but one of the biggest reasons is that it does not provide its own configuration framework. All it needs is Function<String,String>
.
Unfortunately your library cannot be used to provide Rainbow Gum with configuration as it will initialize too soon via SLF4J.
Currently we provide support for avaje-config and soon typesafe/lightbend config.
The library is also missing module-info.java
.
However I have feeling the above will probably not interest you guys but I thought I would just mention it as I do think your library is kind of cool and have a similar in-house configuration library (as in not OSS).
Feel free to close if out of scope.
Put an x
in all the boxes that apply
For more information, see the CONTRIBUTING
guide.
[Description of the bug or feature]
Expected behavior: [What you expected to happen]
Actual behavior: [What actually happened]
Versions: [What version of JDK/JRE and other tools are using]
EnvConfig is currently using the library below for working with keepass databases, however the library is no longer maintained and deprecated.
<dependency>
<groupId>de.slackspace</groupId>
<artifactId>openkeepass</artifactId>
<version>${openkeepass.version}</version>
</dependency>
Add ISSUE_TEMPLATE.md
and PULL_REQUEST_TEMPLATE.md
under .github/
directory.
More info can be found here https://blog.github.com/2016-02-17-issue-and-pull-request-templates/
Put an x
in all the boxes that apply
For more information, see the CONTRIBUTING
guide.
This is only the issue running on windows.
Expected behavior: [What you expected to happen]
Actual behavior: [What actually happened]
Versions: [What version of JDK/JRE and other tools are using]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.