npm.io
1.1.0 • Published 4 years ago

@mailprotector/haraka-plugin-secrets-manager

Licence
MIT
Version
1.1.0
Deps
1
Size
6 kB
Vulns
0
Weekly
0

haraka-plugin-secrets-manager

A Haraka plugin for parsing config files with EJS to inject environment variables into config files on initialize

Install

Install with npm

npm install @mailprotector/haraka-plugin-secrets-manager --save

Setup

Enable Plugin

Add to plugin file in the haraka config folder

@mailprotector/haraka-plugin-secrets-manager
Setup Secrets

When Haraka initializes it loads your passed in config folder and parses each config file using EJS, passing in process.env as the model. This allows us to set configuration files through environment variables on init, instead of keeping configs in plaintext on github. Create an environment variable called CONFIG_PATH and set it to your absolute haraka config folder path.

Example
  process.env.CONFIG_PATH = '/etc/haraka/config
  process.env.TESTING = 'truth'

your_plugin_config.json

{
  "eats_cake": "<%= TESTING %>"
}

will produce:

{
  "eats_cake": "truth"
}

alt text About Mailprotector