@webimpian/zonemta-log-central 1.0.2 → 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 +4 -2
  2. package/index.js +6 -1
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  [ZoneMTA](https://github.com/zone-eu/zone-mta) plugin that ships mail delivery logs to a [Log Central](https://log.dev-aplikasiniaga.com) server: every queued, delivered, deferred, and bounced message becomes a searchable log entry with message-id, recipient, sending zone, and the remote MX response.
7
7
 
8
- Built on [`@webimpian/log-central-node`](https://www.npmjs.com/package/@webimpian/log-central-node) — batched background delivery, capped backoff, and bounded memory, so a Log Central outage can never disrupt mail flow. Hook handlers swallow their own failures and always advance ZoneMTA's plugin chain.
8
+ Built on [`@webimpian/node-log-central`](https://www.npmjs.com/package/@webimpian/node-log-central) — batched background delivery, capped backoff, and bounded memory, so a Log Central outage can never disrupt mail flow. Hook handlers swallow their own failures and always advance ZoneMTA's plugin chain.
9
9
 
10
10
  ## Installation
11
11
 
@@ -64,8 +64,10 @@ raw=true
64
64
  | `environment` | `production` | Environment tag on every entry |
65
65
  | `channel` | `zonemta` | Log channel shown in the Log Central viewer |
66
66
  | `hostname` | `os.hostname()` | Hostname tag on every entry |
67
- | `batchSize` / `flushInterval` / `maxQueue` | see client | Passed through to [`@webimpian/log-central-node`](https://www.npmjs.com/package/@webimpian/log-central-node) |
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
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const { LogCentralClient } = require('@webimpian/log-central-node');
3
+ const { LogCentralClient } = require('@webimpian/node-log-central');
4
4
 
5
5
  const DEFAULT_EVENTS = {
6
6
  queued: true,
@@ -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.2",
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/log-central-node": "^1.0.0"
27
+ "@webimpian/node-log-central": "^1.1.0"
28
28
  },
29
29
  "scripts": {
30
30
  "test": "node --test"