You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Lift4: Support for Env Vars in configuration #2011
Lift's properties/configuration mechanism is based on named files. However, this means storing secrets (e.g., DB credentials, etc.) in files and potentially checking those files into source control systems. Yikes!!
The industry is moving to using Env Vars for configuration/secrets.
The proposal is to extend Lift's configuration system to support referencing Env Vars from configuration files (Rust has an env!(...) macro.
Thus if a line in a configuration file looks like:
foo.bar.baz=env!("VAR_NAME")
Lift's configuration system will read the env var and if the env var isn't define, the config system will throw an exception which will halt the Lift boot cycle.
Many projects use Spring Boot and use its properties-loading mechanism.; It'd be nice if we could weave in some kind of interop with Spring Boot's properties.
I am suggesting a very simple extension to the existing Props mechanism that allows injection of environment variables into properties.
There's nothing in Lift that defaults to using the Props system... it's mostly stand-alone.
If there are other properties systems that are used with other systems, why not use those natively in the Lift app rather than trying to wrap Props (which is simple and dumb by design) around them?
Activity
andreak commentedon Oct 19, 2023
Many projects use Spring Boot and use its properties-loading mechanism.; It'd be nice if we could weave in some kind of interop with Spring Boot's properties.
dpp commentedon Oct 19, 2023
Do you have a pointer to the Spring Boot properties package? Lemme see if I can do something with reflection so if it's there, it'll be used.
andreak commentedon Oct 19, 2023
We inject Spring's
org.springframework.core.env.Environmentin Boot:https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/core/env/Environment.html
We use AspectJ's
META-INF/aop.xmlto configure how Spring should process "non-Spring managed classes":lvitaly commentedon Oct 19, 2023
Maybe it is worth supporting different config providers? For example, lightbend/config supports env variable out of the box.
dpp commentedon Oct 20, 2023
I am suggesting a very simple extension to the existing
Propsmechanism that allows injection of environment variables into properties.There's nothing in Lift that defaults to using the
Propssystem... it's mostly stand-alone.If there are other properties systems that are used with other systems, why not use those natively in the Lift app rather than trying to wrap
Props(which is simple and dumb by design) around them?