Minimal Spring Boot app with secrets injected by envlock.
npx envlock-core dev # uses .env.development (default)
npx envlock-core dev --staging # uses .env.staging
npx envlock-core dev --production # uses .env.production| Flag | Description |
|---|---|
| (none) | Uses .env.development (default) |
--staging |
Uses .env.staging and injects staging secrets from 1Password |
--production |
Uses .env.production and injects production secrets from 1Password |
The server starts at http://localhost:8080 with secrets decrypted from .env.development via 1Password.
- Encrypt your
.env.development:npx @dotenvx/dotenvx encrypt -f .env.development - Store the generated
DOTENV_PRIVATE_KEY_DEVELOPMENTin a 1Password Environment - Set
onePasswordEnvIdinenvlock.config.js:
export default {
onePasswordEnvId: "your-1password-environment-id",
commands: {
dev: "./mvnw spring-boot:run",
},
};