DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» is a community of 968,873 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in
Cover image for backup the .env files to git/gist/dropbox in old school way!
Andres 🐍 in πŸ‡¨πŸ‡¦
Andres 🐍 in πŸ‡¨πŸ‡¦

Posted on • Updated on

backup the .env files to git/gist/dropbox in old school way!

Hi guys...

Here is a little tip that I like.

Sometimes we need to save the local.env, prod.env file or the stg.env file ... But you don't look where is the best place to backup it .. adding to git it's not a good idea because you are storing secrets is very dangerous...

exists projects like git-secrets1, but in my opinion, it's another layer of knowledge you need to dominate.

let's keep it simple:

cp .env local.env
gpg --armor -c local.env # enter a password
ls local.env.asc # file encrypted created
Enter fullscreen mode Exit fullscreen mode

with that you have a file encrypted symmetrical and it can be stored on your:

$ git add *.asc # your git
$ cp *.asc ~/Dropbox # your dropbox
$ gh gist create local.env.asc # to gist 
Enter fullscreen mode Exit fullscreen mode

For decrypt:

gpg -d local.env.asc # entering the password

Enter fullscreen mode Exit fullscreen mode

When your coworkers saw that they will say:

what are you doing? soo old school!!

oldschool

Top comments (0)

Update Your DEV Experience Level:

Settings

Go to your customization settings to nudge your home feed to show content more relevant to your developer experience level. πŸ›