Direnv setup
Environment Management with direnv
The development directory contains a script to configure direnv for automated environment management. This is optional but recommended for a smoother development workflow.
- Run the setup script:
cd development ./setup-direnv.sh -
Allow direnv: After configuration,
direnvwill ask for permission. Rundirenv allowin the project root.Now,
direnvwill automatically load the environment variables and activate the virtual environment when entering the project directory.
Secure Secret Storage with GPG
For enhanced security, environment files can be encrypted using GPG. The included .envrc script supports automatic decryption of files named .secrets.*.
- Import GPG Key:
gpg --import ~/.ssh/id_rsa gpg --list-secret-keys - Encrypt Environment File:
The following command encrypts
.env.development.mkdir -p secrets gpg -r <your-key-id> -o secrets/development.gpg -e .env.developmentEnsure the unencrypted source file (
.env.development) is included in.gitignore.
Tips
- Use
direnvto avoid manual activation of virtual environments and loading of secrets. - For more on configuration, see Configuration.
- For local development, see Local Development.