Allow (or enforce) encryption of .env file
See original GitHub issueHi - thanks for building this great repo!
I noticed that you suggest adding .env
to the .gitignore
file - presumably because the config shouldn’t be exposed as part of the repository?
Do you have a suggestion on how to share the .env file with members of my team?
The best answer I could find suggests checking in the .env
file and encrypting it as an option.
What do maintainers think about allowing encryption of the .env
file with one master password? I’d be happy to help with a PR if it would be welcomed and someone could help me think through best practice implementation.
Or, is there a better way to share the .env
file with my team?
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Enable Encryption in Transit for Environment Variables
Ensure that encryption in transit is enabled for the Lambda environment variables that store sensitive information.
Read more >How can I encrypt just the values of a .env file? - Stack Overflow
There is a nice tool by Mozilla that encrypts only the values and not the keys of your secret file https://github.com/mozilla/sops.
Read more >Encrypting and decrypting environment files in Laravel 9.x
Laravel 9.x introduces a new php artisan env:encrypt command that can be used to encrypt the environment file. For example, if you have...
Read more >Securely manage Laravel .env files - GitHub
This package helps you manage .env files for different deployment environments. Each .env file is securely encrypted and kept in your app's version...
Read more >Stop Using .env Files Now! - DEV Community
Let's explore the problem with .env files and the ultimate solution. ... all the secrets are centralized in one place, encrypted, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ah that’s another problem! What I said about copying .env.example to .env and changing values is for local dev, i.e. to help my coworkers set up their environment.
For server deployment, this becomes a config management issue. If I run on Heroku, I already have an interface to define environment variables. On another container platform, I have docker secrets. On AWS EC2, I’ll get my secrets from SSM. On another VM, maybe I’ll have an ansible vault that creates a .env file.
I think the typical way is to have
.env.example
in your repo, with comments to explain the settings, default values where possible (e.g.DATABASE_URL="postgres://localhost:5432/project"
), and instructions for real secrets (GOOGLE_MAPS_API_KEY="ask in slack channel XYZ"
or"see 1password/project/google maps key"
). Then the README can instruct people to copy that file to.env
and edit it.