Securely store and access API tokens, passwords, encryption keys and other things as environment variables via CLI or HTTP API.
cdEnv is a self-hostable and secured system for storing keys and variables for different environments and projects. It allows easy access via HTTP API and CLI.
Having various development environments on different platforms and you needing to update their keys and variables one by one could be a chore. cdEnv allows you to have complete control over your data and help serve it across the different environments, local or in the cloud.
- Light-Weight
- User based Access
- Environment Based Access
- Data is Encrypted at Rest
- Generation and Revoking of access tokens.
- Works anywhere you have internet access.
The variables in an environment can be accessed as a key:value pair via an HTTP API request to the hosted app. A library was developed to do this and many more. It is as simple as
let cdenv = require('cdenv');
cdenv.fetch('API-TOKEN-GENERATED-FROM-SERVER','APP-ENVIRONMENT-NAME', "URL_TO_SERVER_INSTANCE");where API-TOKEN-GENERATED-FROM-SERVER is your user generated secret token, APP-ENVIRONMENT-NAME is the name of your environment on the server and URL_TO_SERVER_INSTANCE is the url to access your server instance running cdEnv.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
If you prefer Docker for live deployment, Docker is important.
To get started, you would need to create a local copy (clone) of the code on your machine. This is done by executing
git clone https://github.com/teezzan/cdEnvNext is to enter the directory and install the required library. This can be done by the following.
cd cdEnv
npm installMake a copy of the .env.copy file, rename it as .env and populate it appropriately.
NOTE:
MAIL_USER and MAIL_PASS are the username and password of a gmail account used to send confirmaation emails.
If SEND_CONFIRMATION_MAIL is set to false, you don't have to populate MAIL_USER and MAIL_PASS.
Start the project with npm run dev command.
You should find the user interface at http://localhost:3000/ URL in your browser.
npm run dev: Start development mode (load all services locally with hot-reload & REPL)npm run start: Start production mode (setSERVICESenv variable to load certain services)
- Moleculer website: https://moleculer.services/
- Moleculer Documentation: https://moleculer.services/docs/0.14/
TBD
To deploy on a live system, ensure you have Docker installed. Ensure you have copied and edited the .env file appropriately. To expose the containers PORT 3000 to the machines PORT 4000, run
docker run --env-file .env -p 4000:3000 teehazzan/cdenvIssues and pull requests are welcome at cdEnv. This project is intended to be safe, welcoming, and open for collaboration. Users are expected to adhere to the Contributor Covenant code of conduct. We are all human.
Meg Gutshall for her README template. Helped a lot.
This project is licensed under the MIT License - see the LICENSE.md file for details.