@@ -18,8 +18,13 @@ $ dotenvx set --encrypt nick Jackie
1818` application.properties ` content example:
1919
2020``` properties
21- dotenv.public.key =02e8d78f0da7fc3b529d503edd933ed8cdc79dbe5fd5d9bd480f1e63a09905f3b3
22- nick =encrypted:BFpnkHl81r6SFJlzpuCNFe70zOezu3vzkOygmRsAqy0H8zsklDBThtgVl6XDKpZOWq+qHimszEusev2xKXgG2ISdYDbcayNZB2Dd2q5qpo2RqUD0AT9XPrJqPT7DVFBw+hFCZwwqdg ==
21+ # ---
22+ # uuid: 019852dd-8798-7991-b1df-c2b388de0fc4
23+ # sign: 6xEkGwGLig9DuO+iO5jm4RTBG+oQjKZt0XHvVQ28VZIDM8PFaaHMmG+S/xfezoCUJuMvqlFFNOokCg4WIkBWsg==
24+ # ---
25+ dotenv.public.key =02324d763b27358d4229651fd9d0822fb263b07bcc3422f5bd9968cafc194011ff
26+ # ## spring configuration
27+ nick =encrypted:BDFsggcvh9IiNUIZ66YrEI10sLoUJS6WW+UiUxqfAGyHo6cfg9lQ1DhOy9z18F50aRicFHZ7dXH7CagfhonUnZA5W+l1xldVBzv4b8OJN05qih2PHIcY01spqx6RYrgg76pUsuv2eA ==
2328```
2429
2530Add the following dependency to your ` pom.xml ` :
@@ -34,13 +39,30 @@ Add the following dependency to your `pom.xml`:
3439```
3540
3641Start your Spring Boot application, and add ` -Ddotenv.private.key=your_private_key ` to the command line,
42+ or add ` DOTENV_PRIVATE_KEY=your_private_key ` to your environment variables.
3743and dotenvx start will automatically decrypt the ` encrypted: ` prefixed items in your properties or YAML files.
3844If you are using [ Spring Debugger] ( https://www.jetbrains.com/help/idea/spring-debugger.html ) ,
3945and you will notice the decrypted value as hints in the configuration files.
4046
41- ** Note** : The ` dotenv.public.key ` is from ` . env.keys` file .
47+ ** Note** : The private keys for ` application.properties ` are from ` $HOME/.dotenvx/. env.keys.key ` .
4248
43- ** Important** : Make sure to keep your ` .env.keys ` secure and do not commit it to version control.
49+ # Profile support
50+
51+ Please add ` dotenv.public.key.profile-name ` in ` application-profile.properties ` .
52+
53+ ```
54+ # ---
55+ # id: 019881d9-39b0-7ec1-a623-5829d8480774
56+ # name: project_ame
57+ # group: group_name
58+ # ---
59+ dotenv.public.key.test=03f23142c47684e0eecda5bad9c2a6a32e461e55d5db1359948aee9e169d5aed4d
60+ ### spring boot configuration
61+ nick2=encrypted:BMVDgpuPNebbj1NIHxJocBLOxBBxZM3oDqBJ8laGYYso1slYeNJcZs/7Qy1NKDsO+SPmnUd5UDV/LfEEctiyr2I81IGQfuuE8iZwVgqGq12KCa7CouLWH6cm/NRyzSr9PuqVtGdmfAk=
62+ ```
63+
64+ Start your Spring Boot application, and add ` -Ddotenv.private.key.test=your_private_key ` to the command line,
65+ or add ` DOTENV_PRIVATE_KEY_TEST=your_private_key_test ` to your environment variables.
4466
4567# Credits
4668
0 commit comments