Skip to main content

A utility to encrypt and decrypt env variables to safely store them in code repositories

Project description

lockenv - encrypt and decrypt env files easily

A Helper pip package for encrypting env's to be stored safely in code repositories

Assumptions:

  • Assuming python3 is installed on your system.
  • Nano is installed on your system
  • If you have VScode installed, better !

Install lockenv on your system using :

pip install lockenv

Encryption Options

lockenv
  • The command will check for any 'fkey' files in the current path, if found will read the key, if not it will prompt to generate a new key

  • Secondly it will look for an env file in the current path, if found will read env, if nit will prompt to generate a new env

  • It will automatically open the decrypted version of env in Visual Studio Code, if it is not installed, it will open nano editor

  • After editing the env file save it and close the file, it will be encrypted automatically

lockenv -e production
  • You can specify an environment, and it will open the environment specific key and env file, if not exist will create
lockenv -e production -k keyfile or key-string
  • You can also specify keys manually
  • the key can be either the keyfile name or the key as a string
lockenv -e production -f envfile
  • The env file can also be manually specified

Examples

lockenv -k key-string N_Wctg1YY7uyUmD8Cs4bq3VY6IsOHVbbeElpC-tpvE4= -f test.env
  • encrypting specifying key and env file manually

Decryption Options

lockenv -d
  • It will decypt the env file, if multiple env or keys are found it will prompt to choose one
lockenv -d -e production
  • You can specify an environment
  • Recomended option if using inside pipelines or scripts

Examples

lockenv -d -k key-string N_Wctg1YY7uyUmD8Cs4bq3VY6IsOHVbbeElpC-tpvE4= -f test.env
  • Decrypting specifying key and env file manually

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lockenv-1.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file lockenv-1.0-py3-none-any.whl.

File metadata

  • Download URL: lockenv-1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.12

File hashes

Hashes for lockenv-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2fd20807d06b1d505c48e62cd6bd1bb4485ccc05b059f5a17e31f909958f0773
MD5 01dcc2f7f796ac2d234ddaa67835dd39
BLAKE2b-256 0aa41f19c85bfb8a72f749c8e940bacfc38e5b0937794b0b0033658ba8c0276a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page