haraka-config
Advanced tools
Comparing version 1.0.11 to 1.0.12
@@ -0,2 +1,5 @@ | ||
# 1.0.12 - 2017-05-21 | ||
- unref() the setInterval so that Haraka can gracefully exit | ||
# 1.0.11 - 2017-03-04 | ||
@@ -3,0 +6,0 @@ |
@@ -317,2 +317,3 @@ 'use strict'; | ||
}, 60 * 1000); | ||
cfreader._enoent_timer.unref(); // This shouldn't block exit | ||
}; | ||
@@ -319,0 +320,0 @@ |
@@ -6,3 +6,3 @@ { | ||
"description": "Haraka's config file loader", | ||
"version": "1.0.11", | ||
"version": "1.0.12", | ||
"homepage": "http://haraka.github.io", | ||
@@ -9,0 +9,0 @@ "repository": { |
@@ -29,12 +29,12 @@ [![Build Status][ci-img]][ci-url] | ||
# Usage | ||
```js | ||
// From within a plugin: | ||
var cfg = this.config.get(name, [type], [callback], [options]); | ||
``` | ||
This will load the file config/rambling.paths in the Haraka directory. | ||
`name` is not a full path, but a filename in the config/ directory. For example: | ||
```js | ||
var cfg = this.config.get('rambling.paths', 'list'); | ||
``` | ||
`type` can be any of the types listed above. | ||
@@ -113,3 +113,3 @@ | ||
``` | ||
```ini | ||
toplevel1=foo | ||
@@ -124,3 +124,3 @@ toplevel2=bar | ||
``` | ||
```ini | ||
toplevel2=blee | ||
@@ -134,3 +134,3 @@ | ||
``` | ||
```ini | ||
toplevel1=foo | ||
@@ -157,3 +157,3 @@ toplevel2=blee | ||
Here is a typical example: | ||
```ini | ||
first_name=Matt | ||
@@ -170,6 +170,6 @@ last_name=Sergeant | ||
spamassassin | ||
``` | ||
That produces the following Javascript object: | ||
````javascript | ||
```js | ||
{ | ||
@@ -190,3 +190,3 @@ main: { | ||
} | ||
```` | ||
``` | ||
@@ -203,5 +203,5 @@ Items before any [section] marker are in the implicit [main] section. | ||
The `options` object allows you to specify which keys are boolean: | ||
```js | ||
{ booleans: ['reject','some_true_value'] } | ||
``` | ||
On the options declarations, key names are formatted as section.key. | ||
@@ -212,5 +212,5 @@ If the key name does not specify a section, it is presumed to be [main]. | ||
and supports the following options for boolean values: | ||
``` | ||
true, yes, ok, enabled, on, 1 | ||
``` | ||
Anything else is treated as false. | ||
@@ -220,20 +220,20 @@ | ||
missing), prefix the key with +: | ||
```js | ||
{ booleans: [ '+reject' ] } | ||
``` | ||
For completeness the inverse is also allowed: | ||
```js | ||
{ booleans: [ '-reject' ] } | ||
``` | ||
Lists are supported using this syntax: | ||
```ini | ||
hosts[] = first_host | ||
hosts[] = second_host | ||
hosts[] = third_host | ||
``` | ||
which produces this javascript array: | ||
```js | ||
['first_host', 'second_host', 'third_host'] | ||
``` | ||
Flat Files | ||
@@ -261,7 +261,7 @@ ---------- | ||
`````` | ||
```js | ||
{ | ||
"!smtpgreeting": [ 'this is line one', 'this is line two' ] | ||
} | ||
````` | ||
``` | ||
@@ -268,0 +268,0 @@ If the config/smtpgreeting file did not exist, then this value would replace |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
74648
1714