Skip to content

Commit

Permalink
make docs better reflect reality (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
msimerson committed Feb 13, 2017
1 parent 3ab1d7c commit 888f0dd
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
4 changes: 4 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@

# 1.0.11 - 2017-0_-_

-

# 1.0.10 - 2017-02-05

- log error vs throw on bad YAML
Expand Down
24 changes: 15 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# haraka-config

Haraka config file loader and parser
Haraka config file loader, parser, and watcher.

# Config Files

Expand Down Expand Up @@ -56,15 +56,15 @@ exports.register = function () {
exports.load_my_plugin_ini = function () {
var plugin = this;
plugin.cfg = plugin.config.get('my_plugin.ini', function onCfgChange () {
// This closure is run a few milliseconds after my_plugin.ini changes
// This closure is run a few seconds after my_plugin.ini changes
// Re-run the outer function again
plugin.load_my_plugin_ini();
});
plugin.loginfo('cfg=' + JSON.stringify(plugin.cfg));
}

exports.hook_connect = function (next, connection) {
// plugin.cfg in here will always be up-to-date
// plugin.cfg here will be kept updated
}
```

Expand All @@ -78,12 +78,18 @@ loop, and will slow down Haraka.
* `booleans` (default: none) - for .ini files, this allows specifying
boolean type keys. Default true or false can be specified.

<a name="overrides">Default Config and Overrides</a>
===========
## <a name="overrides">Default Config and Overrides</a>

The config loader supports dual config files - a file containing default
values, and overridden values installed by a user. This can be useful if
publishing your plugin to npm (and is used by some core plugins).
The config loader supports dual config files - a file containing defaults,
and another user installed file containing overrides. The default configs
reside:

- Haraka: within the config directory in the Haraka install (where `npm i`
installed Haraka)
- NPM plugins - inside the module/config directory

Config files with overrides are **always** installed in the Haraka config
directory, which you specified when you ran `haraka -i`.

Overrides work in the following manner:

Expand Down Expand Up @@ -290,6 +296,6 @@ Haraka will be unable to update them after changes.
[clim-img]: https://codeclimate.com/github/haraka/haraka-config/badges/gpa.svg
[clim-url]: https://codeclimate.com/github/haraka/haraka-config
[apv-img]: https://ci.appveyor.com/api/projects/status/9qh720gq77e2h5x4?svg=true
[apv-url]: https://ci.appveyor.com/project/msimerson/haraka-config/branch/master
[apv-url]: https://ci.appveyor.com/project/msimerson/haraka-config
[gk-img]: https://badges.greenkeeper.io/haraka/haraka-config.svg
[gk-url]: https://greenkeeper.io/
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "haraka-config",
"license": "MIT",
"description": "Haraka's config file loader",
"version": "1.0.10",
"version": "1.0.11",
"homepage": "http://haraka.github.io",
"repository": {
"type": "git",
Expand Down

0 comments on commit 888f0dd

Please sign in to comment.