<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: TLW</title>
    <description>The latest articles on DEV Community by TLW (@tlw_c91a7f30a7a1be3158afe).</description>
    <link>https://dev.to/tlw_c91a7f30a7a1be3158afe</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3957902%2F9126563f-a384-4cce-aaea-ab7ad9790b77.png</url>
      <title>DEV Community: TLW</title>
      <link>https://dev.to/tlw_c91a7f30a7a1be3158afe</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tlw_c91a7f30a7a1be3158afe"/>
    <language>en</language>
    <item>
      <title>Your .env file has been in 6 places it shouldn't be</title>
      <dc:creator>TLW</dc:creator>
      <pubDate>Fri, 29 May 2026 07:34:31 +0000</pubDate>
      <link>https://dev.to/tlw_c91a7f30a7a1be3158afe/your-env-file-has-been-in-6-places-it-shouldnt-be-3d6k</link>
      <guid>https://dev.to/tlw_c91a7f30a7a1be3158afe/your-env-file-has-been-in-6-places-it-shouldnt-be-3d6k</guid>
      <description>&lt;p&gt;Slack. Email. Notion. A shared Google Doc.&lt;br&gt;
A DM from 2021 that's still sitting in someone's inbox.&lt;/p&gt;

&lt;p&gt;That's where your .env file has been. And you probably didn't even notice.&lt;/p&gt;


&lt;h2&gt;
  
  
  The problem nobody talks about
&lt;/h2&gt;

&lt;p&gt;It's not that developers are careless. It's that there's no good default.&lt;/p&gt;

&lt;p&gt;You finish onboarding a new teammate. You send them the &lt;code&gt;.env&lt;/code&gt;. They're set up in five minutes. It works. So you do it again next time. And the time after that.&lt;/p&gt;

&lt;p&gt;But now that file — with your database URL, your Stripe keys, your API tokens — has been:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sent over Slack (logged forever)&lt;/li&gt;
&lt;li&gt;Emailed (sitting in someone's inbox)&lt;/li&gt;
&lt;li&gt;Pasted into Notion (shared with the whole company)&lt;/li&gt;
&lt;li&gt;Saved on three laptops that may or may not have full disk encryption&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And when that person leaves the team? You &lt;em&gt;hope&lt;/em&gt; they don't still have it. But you can't know for sure.&lt;/p&gt;


&lt;h2&gt;
  
  
  "Just use Doppler"
&lt;/h2&gt;

&lt;p&gt;Fair. Tools like Doppler, Vault, and AWS Secrets Manager exist for exactly this reason.&lt;/p&gt;

&lt;p&gt;But they come with tradeoffs that many teams aren't ready for.&lt;/p&gt;

&lt;p&gt;You're now dependent on a third-party server being up. Your CI pipeline needs their API key. Your dev machines need internet access to decrypt anything. And if that SaaS goes down, gets hacked, or decides to change their pricing — your team is blocked.&lt;/p&gt;

&lt;p&gt;You traded one trust problem for another. Instead of trusting your teammates with a file, you're trusting a vendor with all your secrets.&lt;/p&gt;

&lt;p&gt;For large enterprises with dedicated DevOps teams, that's a reasonable trade. For a small team that just wants to ship — it's a lot of overhead.&lt;/p&gt;


&lt;h2&gt;
  
  
  What if secrets just lived in git?
&lt;/h2&gt;

&lt;p&gt;Here's the idea behind &lt;strong&gt;envlock-git&lt;/strong&gt;: secrets live in your repo, just like code. But encrypted — so the ciphertext in git is useless to anyone who doesn't have the right key.&lt;/p&gt;

&lt;p&gt;Here's how it works:&lt;/p&gt;

&lt;p&gt;Every developer has a keypair stored on their machine (&lt;code&gt;~/.envlock/&lt;/code&gt;). The private key never leaves. When you add a secret, envlock encrypts it separately for every teammate who has access — using their public key. Only their private key can decrypt their copy.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# add a secret&lt;/span&gt;
envlock add &lt;span class="nv"&gt;STRIPE_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;sk_live_abc123 &lt;span class="nt"&gt;--env&lt;/span&gt; prod

&lt;span class="c"&gt;# give alice access&lt;/span&gt;
envlock add-member alice &lt;span class="nt"&gt;--env&lt;/span&gt; prod &lt;span class="nt"&gt;--access&lt;/span&gt; &lt;span class="nb"&gt;read&lt;/span&gt;

&lt;span class="c"&gt;# alice decrypts on her machine&lt;/span&gt;
envlock decrypt &lt;span class="nt"&gt;--env&lt;/span&gt; prod
&lt;span class="c"&gt;# → writes .env.prod locally&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The encrypted blobs get committed to git. Your repo becomes the source of truth. Diffs are readable. Access is auditable. Rollbacks are &lt;code&gt;git revert&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;No server. No account. No vendor. Just files.&lt;/p&gt;




&lt;h2&gt;
  
  
  What it looks like day to day
&lt;/h2&gt;

&lt;p&gt;New teammate joins. They run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;envlock init    &lt;span class="c"&gt;# generates their keypair&lt;/span&gt;
envlock &lt;span class="nb"&gt;join&lt;/span&gt;    &lt;span class="c"&gt;# adds their public key to the repo&lt;/span&gt;
git push
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You pull, see their key, and grant access:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;envlock add-member sarah &lt;span class="nt"&gt;--env&lt;/span&gt; dev &lt;span class="nt"&gt;--access&lt;/span&gt; write
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Say yes when it asks to sync. Done. Sarah can now decrypt her copy of every secret she needs.&lt;/p&gt;

&lt;p&gt;When Sarah leaves, one command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;envlock revoke sarah &lt;span class="nt"&gt;--all-envs&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This removes her token and re-encrypts everything for the remaining team. Her old decrypted files still work locally until she pulls — but she can never refresh them.&lt;/p&gt;

&lt;p&gt;Git is your audit log. Every access change is a commit. Every secret change is a commit. You can always look back and see exactly what changed, when, and who did it.&lt;/p&gt;




&lt;h2&gt;
  
  
  There's also a web UI
&lt;/h2&gt;

&lt;p&gt;For teams who prefer clicking over typing, &lt;code&gt;envlock ui&lt;/code&gt; opens a local dashboard in your browser. Browse variables, reveal values, manage member access — all running locally, no data leaves your machine.&lt;/p&gt;




&lt;h2&gt;
  
  
  Works with any git host
&lt;/h2&gt;

&lt;p&gt;GitHub, GitLab, Bitbucket, Azure DevOps, self-hosted Gitea — envlock doesn't care. It's just files in a repo. There's no platform integration to set up.&lt;/p&gt;

&lt;p&gt;For CI, just add one step:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; envlock-git
envlock verify
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This checks that every member has encrypted blobs for every variable — no missing keys, no tampered tokens. Fails the build if something's off.&lt;/p&gt;




&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; envlock-git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then in any git repo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;envlock init
envlock setup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It'll walk you through the rest.&lt;/p&gt;

&lt;p&gt;The source is on GitHub: &lt;a href="https://github.com/tlw099999/envlock" rel="noopener noreferrer"&gt;github.com/tlw099999/envlock&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Built this because I got tired of finding .env files in Slack search. If you've been in the same situation — give it a try and let me know what you think.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>devops</category>
      <category>git</category>
      <category>node</category>
    </item>
  </channel>
</rss>
