Have you ever wanted to back up all your .env files in case your hard drive gets
nuked? envr makes it easier.
envr is a binary application that tracks your .env files
in an encyrpted sqlite database. Changes can be effortlessly synced with
envr sync, and restored with envr restore.
envr puts all your .env files in one safe place, so you can back them up with
the tool of your choosing.
Please read the AI Disclosure if you're concerned about AI code.
- Encrypted Storage: All
.envfiles are encrypted using your ssh key and libsodium. - Automatic Sync: Update the database with one command, which can easily be run on a cron.
- Smart Scanning: Automatically discover and import
.envfiles in your home directory. - Rename Detection: Automatically find and updates renamed/moved repositories.
- Rename Detection: automatically update moved files.
- Allow use of keys from
ssh-agent - Allow configuration of ssh key.
- Allow multiple ssh keys.
You will need an SSH key pair for encryption and decryption. You can generate one
with ssh-keygen -t ed25519. It will be saved to ~/.ssh/id_ed25519.
If you already have odin installed:
# You'll need libsodium and sqlite
odin build -o:speed
envr initIf you are a nix user
nix run github.com:sbrow/envr --# /etc/nixos/configuration.nix
{ config, envr, system, ... }: {
environment.systemPackages = [
envr.packages.${system}.default
];
}Check out the man page for the quick setup guide.
Caution
Do not lose your SSH key pair! Your backup will be lost forever.
See the docs for the current list of available commands.
The configuration file is created during initialization:
envr merely gathers your .env files in one local place. It is up to you to
back up the database (found at ~/.envr/data.envr) to a secure and remote
location.
envr preserves inodes when updating the database, so you can safely hardlink
~/.envr/data.envr into your GNU Stow,
Home Manager, or
NixOS repository.
Caution
For maximum security, only save your data.envr file to a local
(i.e. non-cloud) git server that you personally control.
I take no responsibility if you push all your secrets to a public GitHub repo.
This project was largely built by AI. The original project (written in go) was written almost entirely with AI, using libraries that I requested (i.e. cobra).
I wrote it at work because I needed the tool and wanted it fast. The Odin version was also primarily written by AI, but I stepped in a lot more, and took care to architect the project in the way that I wanted, and made sure tests were written to catch leaks.
Most of the documentation was written by hand, but I think the original README.md
was at least fleshed out by AI.
It is by no means perfect, but I have spent a lot of time doing code review and testing to make sure the program (and documentation) meet my personal standards.
This project is licensed under the MIT License.
For issues, feature requests, or questions, please open an issue.
# Example ~/.envr/config.json { "keys": [ { "private": "/home/ubuntu/.ssh/id_ed25519", "public": "/home/ubuntu/.ssh/id_ed25519.pub" } ], "scan": { "matcher": "\\.env", "exclude": [ "*\\.envrc", "\\.local/", "node_modules", "vendor" ], "include": "~" } }