EnvManager is a CLI tool written in Python that helps developers securely push their .env
files to production or GitHub. The tool encrypts the .env
files using a hybrid encryption method, ensuring sensitive information is not exposed accidentally. A better way to push your .env files to production without leaking your secret keys.
-
Generate RSA key pairs for encryption and decryption.
-
Encrypt
.env
files using AES encryption with an RSA-encrypted AES key. -
Decrypt
.env
files. -
Optionally push encrypted
.env
files to a GitHub repository.
-
Clone the repository:
git clone https://github.com/yourusername/EnvManager.git cd EnvManager
-
Setup the package:
bash setup.sh
- Generate a new RSA key pair for encryption and decryption:
envmanager generate-keys
This command will create private.pem
and public.pem
files in the current directory.
- Encrypt a
.env
file using the public key:envmanager encrypt .env --key public.pem
This will create an encrypted file named .env.enc
.
- Decrypt a
.env.enc
file using the private key:envmanager decrypt .env.enc --key private.pem
This will create a decrypted file named .env
.
Encrypt a .env
file and push the encrypted file to a GitHub repository:
EnvManager/ ├── main.py ├── requirements.txt ├── README.md └── utils/ └── encrypt.py └── decrypt.py └── generate.py └── push.py
- Python 3.6+
- pycryptodome
- GitPython
Contributions are welcome! Please open an issue or submit a pull request for any changes.
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes.
- Commit your changes (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
- This project uses pycryptodome for cryptographic functions.
- This project uses GitPython for Git operations.