0.1.3 • Published 12 months ago

adonis-secrets v0.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

adonis-secrets

Safely store your AdonisJS environment variables in your repositories

PRs Welcome License

adonis-secrets

🔨 Install🚀 Get started🔧 Environments

ContributeLicense

Introduction

This AdonisJS library allows you to safely store your environment variable files in your repository by bringing two commands env:encrypt and env:decrypt. It is heavily inspired by the popular framework Laravel.

🔨 Install

node ace add adonis-secrets

🚀 Get started

You can encrypt your local environment file (.env) by using the env:encrypt command. It will create a new file .env.encrypted

node ace env:encrypt

And then decrypt it using env:decrypt.

APP_KEY=myappkey node ace env:decrypt

Under the hood, your files are encrypted using the APP_KEY environment variable. When decrypting a file the variable might not be available (as it might be inside the encrypted file). When it is the case, you have to provide it manually.

🔧 Environments

You might want to store the environment variables of other environments. You can do this by simply using the NODE_ENV variable. This will encrypt/decrypt your .env.[environment] file.

NODE_ENV=staging APP_KEY=myappkey node ace env:encrypt
NODE_ENV=staging APP_KEY=myappkey node ace env:decrypt

When providing development or nothing it will default to the .env file.

⚠ For security reasons, make sure you a different key for each environment.

Contributing

I'd love for you to contribute to this project. You can request new features by creating an issue, or submit a pull request with your contribution.

0.1.3

12 months ago

0.1.2

12 months ago

0.1.1

12 months ago

0.1.0

12 months ago

0.0.6

12 months ago

0.0.5

12 months ago

0.0.4

12 months ago

0.0.3

12 months ago

0.0.2

12 months ago

0.0.1

12 months ago