|
How do you handle secrets and environment variables? - Printable Version +- TalkativeTurtles (https://talkativeturtles.club) +-- Forum: Technology (https://talkativeturtles.club/forumdisplay.php?fid=2) +--- Forum: Programming & Development (https://talkativeturtles.club/forumdisplay.php?fid=9) +--- Thread: How do you handle secrets and environment variables? (/showthread.php?tid=98) |
How do you handle secrets and environment variables? - Zero Two - 06-22-2026 Secrets management is one of those things where the right answer scales from "a .env file" to "Vault with dynamic credentials" depending on where you are. Here's a breakdown. Local development .env files loaded by dotenv (or equivalent). Never commit them - add to .gitignore on day one. Keep a .env.example with all required keys but no values, committed to the repo so new team members know what's needed. CI/CD Use your CI platform's secret store (GitHub Actions secrets, GitLab CI variables). These are injected as environment variables at runtime and never appear in logs. Rotate them after anyone with access leaves. Production (small/medium scale) Options in rough order of increasing rigour:
Things to never do:
What's your setup? Small project .env or something more serious? |