@webimpian/zonemta-log-central 1.0.3 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +2 -0
  2. package/index.js +5 -0
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -66,6 +66,8 @@ raw=true
66
66
  | `hostname` | `os.hostname()` | Hostname tag on every entry |
67
67
  | `batchSize` / `flushInterval` / `maxQueue` | see client | Passed through to [`@webimpian/node-log-central`](https://www.npmjs.com/package/@webimpian/node-log-central) |
68
68
  | `events` | all on, `raw` off | Toggle individual hooks (see above) |
69
+ | `packages` | `true` | Send the installed npm package versions at startup and once a day from the `main` process (keep `main` in `enabled`), for Log Central's Vulnerabilities page (needs Log Central v1.16.4+) |
70
+ | `packagesDir` | `process.cwd()` | Folder that holds ZoneMTA's `package-lock.json` |
69
71
 
70
72
  If `url`, `token`, or `app` is missing, the plugin logs a warning through ZoneMTA's logger and disables itself — it never prevents ZoneMTA from starting.
71
73
 
package/index.js CHANGED
@@ -40,6 +40,11 @@ module.exports.init = function (app, done) {
40
40
 
41
41
  app.logCentral = client;
42
42
 
43
+ // ZoneMTA loads the plugin in every process type; one report per app is enough.
44
+ if (config.packages !== false && app.manager && app.manager.context === 'main') {
45
+ client.reportPackages({ dir: config.packagesDir });
46
+ }
47
+
43
48
  const events = Object.assign({}, DEFAULT_EVENTS, config.events);
44
49
 
45
50
  // A hook that throws breaks ZoneMTA's plugin chain and with it the mail
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webimpian/zonemta-log-central",
3
- "version": "1.0.3",
3
+ "version": "1.1.0",
4
4
  "description": "ZoneMTA plugin that ships mail delivery logs (queued, delivered, deferred, bounced) to a Log Central server.",
5
5
  "keywords": [
6
6
  "zonemta",
@@ -24,7 +24,7 @@
24
24
  "README.md"
25
25
  ],
26
26
  "dependencies": {
27
- "@webimpian/node-log-central": "^1.0.2"
27
+ "@webimpian/node-log-central": "^1.1.0"
28
28
  },
29
29
  "scripts": {
30
30
  "test": "node --test"