Releases: linux-china/dotenvx-spring-boot
0.1.5
0.1.4
- Add public/private key parse with Secp256k1KeyParser
- Add JWT support with Secp256k1JwtService
- Add signature support with Secp256k1Signer
- Key pair generation enhancement
- Update to bouncycastle 1.82
0.1.3
- Update to bouncycastle 1.82
- Update to Spring Boot 3.5.6
- Update to Spring Cloud 2025.0.0
- Add Jackson support to encrypt/decrypt json fields
@Configuration
public class DotenvxJacksonConfig {
@Bean
public SimpleModule dotenvxJacksonModule(@Value("${dotenvx.public.key}") String publicKey, @Value("${dotenvx.private.key}") String privateKey) {
SimpleModule simpleModule = new SimpleModule();
simpleModule.addSerializer(new DotenvxGlobalJsonSerializer(publicKey));
simpleModule.addDeserializer(String.class, new DotenvxGlobalJsonDeserializer(privateKey));
return simpleModule;
}
} @GetMapping("/private/info")
public Map<String, String> privateInfo() {
Map<String, String> map = new HashMap<>();
map.put("email", "private:[email protected]");
return map;
}v0.1.2
Support new .env.keys.json file format
{
"version" : "0.1.0",
"metadata" : {
"uuid" : "0198c2bf-77eb-77ac-8c8c-0039ebb6f682"
},
"keys" : {
}
}0.1.1
Please install last version of dotenvx-rs, and dotenvx will detect Spring Boot automatically by src/main/resources/applications.properties.
Check the demo: https://github.com/linux-china/dotenvx-boot-demo
0.1.0
Get Started
Download dotenvx-cli from dotenvx-rs,
and execute dotenvx init to add .env and .env.keys files to your project.
Copy encrypted env variable from .env to application.properties or application.yml, example as follows:
# dotenvx public key
dotenv.public.key=02e8d78f0da7fc3b529d503edd933ed8cdc79dbe5fd5d9bd480f1e63a09905f3b3
nick=encrypted:BFpnkHl81r6SFJlzpuCNFe70zOezu3vzkOygmRsAqy0H8zsklDBThtgVl6XDKpZOWq+qHimszEusev2xKXgG2ISdYDbcayNZB2Dd2q5qpo2RqUD0AT9XPrJqPT7DVFBw+hFCZwwqdg==Add the following dependency to your pom.xml:
<dependency>
<groupId>org.mvnsearch</groupId>
<artifactId>dotenvx-spring-boot-starter</artifactId>
<version>0.1.0</version>
</dependency>Start your Spring Boot application, and add -Ddotenv.private.key=your_private_key to the command line,
and dotenvx start will automatically decrypt the encrypted: prefixed items in your properties or YAML files.
If you are using Spring Debugger,
and you will notice the decrypted value as hints in the configuration files.
Note: The dotenv.public.key is from .env.keys file.
Important: Make sure to keep your .env.keys secure and do not commit it to version control.