diff --git a/.codeclimate.yml b/.codeclimate.yml
index 0e443ca..563da6b 100644
--- a/.codeclimate.yml
+++ b/.codeclimate.yml
@@ -1,10 +1,10 @@
engines:
eslint:
enabled: true
- channel: "eslint-8"
+ channel: 'eslint-9'
config:
- config: ".eslintrc.yaml"
+ config: 'eslint.config.mjs'
ratings:
- paths:
- - "**.js"
+ paths:
+ - '**.js'
diff --git a/.eslintrc.yaml b/.eslintrc.yaml
deleted file mode 100644
index b6d6abf..0000000
--- a/.eslintrc.yaml
+++ /dev/null
@@ -1,21 +0,0 @@
-env:
- node: true
- es6: true
- mocha: true
-
-plugins: [ haraka ]
-
-extends: [ eslint:recommended, plugin:haraka/recommended ]
-
-root: true
-
-rules:
- indent: [2, 2, { SwitchCase: 1 } ]
-
-globals:
- OK: true
- CONT: true
- DENY: true
- DENYSOFT: true
- DENYDISCONNECT: true
- DENYSOFTDISCONNECT: true
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 0449e4a..d450132 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -2,9 +2,9 @@
version: 2
updates:
- - package-ecosystem: "npm"
- directory: "/"
+ - package-ecosystem: 'npm'
+ directory: '/'
schedule:
- interval: "weekly"
+ interval: 'weekly'
allow:
- dependency-type: production
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 5360933..3d01042 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,12 +1,11 @@
name: CI
-on: [ push, pull_request ]
+on: [push, pull_request]
env:
CI: true
jobs:
-
lint:
uses: haraka/.github/.github/workflows/lint.yml@master
@@ -14,28 +13,10 @@ jobs:
# uses: haraka/.github/.github/workflows/coverage.yml@master
# secrets: inherit
- test:
- needs: [ lint, get-lts ]
- runs-on: ${{ matrix.os }}
- strategy:
- matrix:
- os: [ ubuntu-latest, windows-latest ]
- node-version: ${{ fromJson(needs.get-lts.outputs.active) }}
- fail-fast: false
- steps:
- - uses: actions/checkout@v3
- - uses: actions/setup-node@v3
- name: Node ${{ matrix.node-version }} on ${{ matrix.os }}
- with:
- node-version: ${{ matrix.node-version }}
- - run: npm install
- - run: npm test
+ ubuntu:
+ needs: [lint]
+ uses: haraka/.github/.github/workflows/ubuntu.yml@master
- get-lts:
- runs-on: ubuntu-latest
- steps:
- - id: get
- uses: msimerson/node-lts-versions@v1
- outputs:
- active: ${{ steps.get.outputs.active }}
- lts: ${{ steps.get.outputs.lts }}
+ windows:
+ needs: [lint]
+ uses: haraka/.github/.github/workflows/windows.yml@master
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index 383aca2..816e8c3 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -1,10 +1,10 @@
-name: "CodeQL"
+name: 'CodeQL'
on:
push:
- branches: [ master ]
+ branches: [master]
pull_request:
- branches: [ master ]
+ branches: [master]
schedule:
- cron: '18 7 * * 4'
diff --git a/.release b/.release
index 0890e94..7307651 160000
--- a/.release
+++ b/.release
@@ -1 +1 @@
-Subproject commit 0890e945e4e061c96c7b2ab45017525904c17728
+Subproject commit 73076513e83c2057a32515831b638771c15b1d83
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..1ba5c37
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,90 @@
+# Changelog
+
+The format is based on [Keep a Changelog](https://keepachangelog.com/).
+
+### Unreleased
+
+### [1.0.15] - 2025-01-31
+
+- doc: mv Changes.md CHANGELOG.md
+- populate [files] in package.json.
+- dep(eslint): upgrade to v9
+- doc(CONTRIBUTORS): added
+- ci: use shared Haraka workflows
+- style(prettier): added
+
+### [1.0.14] - 2023-12-12
+
+- style: remove useless variable
+- ci(publish): constrain to when package.json changes
+- ci: run on PR
+
+### [1.0.13] - 2022-06-05
+
+- doc(README): update CI badge URL
+- ci: update dependabot config to production only
+
+### [1.0.12] - 2022-06-05
+
+- ci: update GHA workflow with shared
+- ci: add submodule .release
+
+### 1.0.11 - 2022-03-31
+
+- node 12 EOL, drop testing.
+
+### 1.0.10 - 2019-03-22
+
+- Add an 'if' to "blocked message" HTML header
+- CI testing updates (node.js versions)
+- moved config/karma.ini to test/config/karma.ini
+
+### 1.0.9 - 2017-08-17
+
+- also prune syslog hostname when no PID in entry
+
+### 1.0.8 - 2017-06-16
+
+- depend on haraka-eslint for rules
+- lint fixes
+
+### 1.0.7 - 2017-05-04
+
+- add --text flag to grep call, in case log file has binary chars
+
+### 1.0.6 - 2017-01-23
+
+- remove host & pid detail from syslog lines
+
+### 1.0.5 - 2016-11-04
+
+- display log entries for transactions
+- display just transaction ID in place of full UUID.id
+- refactored most of get logs into grepWithShell & asHtml
+ - with test coverage for the latter two
+
+### 1.0.4 - 2016-10-25
+
+- remove useless $UUID token from display
+
+### Oct 2 12:57:42 2016
+
+- trim uuids more reliably (#4)
+
+### Oct 2 12:08:44 2016
+
+- Duplicate resolutions (#2)
+- suppress duplicate actions
+
+### Sep 29 23:10:33 2016
+
+- add missing eslint definition
+- added README
+- add .travis.yml
+- initial commit
+
+[1.0.11]: https://github.com/haraka/haraka-plugin-log-reader/releases/tag/1.0.11
+[1.0.12]: https://github.com/haraka/haraka-plugin-log-reader/releases/tag/1.0.12
+[1.0.13]: https://github.com/haraka/haraka-plugin-log-reader/releases/tag/1.0.13
+[1.0.14]: https://github.com/haraka/haraka-plugin-log-reader/releases/tag/v1.0.14
+[1.0.15]: https://github.com/haraka/haraka-plugin-log-reader/releases/tag/v1.0.15
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
new file mode 100644
index 0000000..b6b5e58
--- /dev/null
+++ b/CONTRIBUTORS.md
@@ -0,0 +1,9 @@
+# Contributors
+
+This handcrafted artisinal software is brought to you by:
+
+| 
msimerson (32) |
+| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
+
+this file is generated by [.release](https://github.com/msimerson/.release).
+Contribute to this project to get your GitHub profile included here.
diff --git a/Changes.md b/Changes.md
deleted file mode 100644
index 5cb0ea9..0000000
--- a/Changes.md
+++ /dev/null
@@ -1,90 +0,0 @@
-### Unreleased
-
-
-### [1.0.14] - 2023-12-12
-
-- style: remove useless variable
-- ci(publish): constrain to when package.json changes
-- ci: run on PR
-
-
-### [1.0.13] - 2022-06-05
-
-- doc(README): update CI badge URL
-- ci: update dependabot config to production only
-
-
-### [1.0.12] - 2022-06-05
-
-- ci: update GHA workflow with shared
-- ci: add submodule .release
-
-
-### 1.0.11 - 2022-03-31
-
-- node 12 EOL, drop testing.
-
-
-### 1.0.10 - 2019-03-22
-
-* Add an 'if' to "blocked message" HTML header
-* CI testing updates (node.js versions)
-* moved config/karma.ini to test/config/karma.ini
-
-
-### 1.0.9 - 2017-08-17
-
-* also prune syslog hostname when no PID in entry
-
-
-### 1.0.8 - 2017-06-16
-
-* depend on haraka-eslint for rules
-* lint fixes
-
-
-### 1.0.7 - 2017-05-04
-
-* add --text flag to grep call, in case log file has binary chars
-
-
-### 1.0.6 - 2017-01-23
-
-* remove host & pid detail from syslog lines
-
-
-### 1.0.5 - 2016-11-04
-
-* display log entries for transactions
-* display just transaction ID in place of full UUID.id
-* refactored most of get logs into grepWithShell & asHtml
- * with test coverage for the latter two
-
-
-### 1.0.4 - 2016-10-25
-
-* remove useless $UUID token from display
-
-
-### Oct 2 12:57:42 2016
-
-* trim uuids more reliably (#4)
-
-
-### Oct 2 12:08:44 2016
-
-* Duplicate resolutions (#2)
-* suppress duplicate actions
-
-
-### Sep 29 23:10:33 2016
-
-* add missing eslint definition
-* added README
-* add .travis.yml
-* initial commit
-
-
-[1.0.12]: https://github.com/haraka/haraka-plugin-log-reader/releases/tag/1.0.12
-[1.0.13]: https://github.com/haraka/haraka-plugin-log-reader/releases/tag/1.0.13
-[1.0.14]: https://github.com/haraka/haraka-plugin-log-reader/releases/tag/1.0.14
diff --git a/README.md b/README.md
index b52cee1..d61d444 100644
--- a/README.md
+++ b/README.md
@@ -3,60 +3,54 @@
# haraka-plugin-log-reader
-
extracts matching log entries from the haraka log file
-
# Install
-
-````
+```
cd /my/haraka/config/dir
npm install haraka-plugin-log-reader
-````
-
+```
## Enable
Add `log-reader` to `haraka/config/plugins` file.
-
# Usage
When enabled, this plugin registers two URL routes in Haraka's http server:
-* karma/rules
-* /logs/:uuid
+- karma/rules
+- /logs/:uuid
The former rule simply returns a list of the Haraka rules in use. The http client uses those rules (the ID, reason, and value) to display the `Policy Rules` and `Steps to Resolve` sections in the web page.
# Example
-
### Sorry we blocked your message:
Our filters mistook your server for a malicious computer attempting to send spam. To improve your mail servers reputation, please contact your IT helpdesk or Systems Administrator and ask them for help.
-----------
+---
### Policy Rules
-* -7, DNS Blacklist (b.barracudacentral.org)
-* -5, DNS Blacklist (zen.spamhaus.org)
-* -3, DNS Blacklist (dnsbl-1.uceprotect.net)
-* -3, DNS Blacklist (bl.spamcop.net)
-* -3, ASN reputation is spam-only (asn_all_bad)
-* -1, Geographic distance is unusual for ham (4000)
-* -1, Geographic distance is unusual for ham (8000)
-* -1, ASN reputation is bad (karma)
+- -7, DNS Blacklist (b.barracudacentral.org)
+- -5, DNS Blacklist (zen.spamhaus.org)
+- -3, DNS Blacklist (dnsbl-1.uceprotect.net)
+- -3, DNS Blacklist (bl.spamcop.net)
+- -3, ASN reputation is spam-only (asn_all_bad)
+- -1, Geographic distance is unusual for ham (4000)
+- -1, Geographic distance is unusual for ham (8000)
+- -1, ASN reputation is bad (karma)
-----------
+---
### Steps to Resolve
-* Disinfect your host/network
+- Disinfect your host/network
-----------
+---
## Raw Logs
@@ -75,12 +69,9 @@ Our filters mistook your server for a malicious computer attempting to send spam
[NOTICE] [core] disconnect ip=95.160.74.108 rdns="095160074108.gdansk.vectranet.pl" helo="" relay=N early=N esmtp=N tls=N pipe=N errors=0 txns=0 rcpts=0/0/0 msgs=0/0/0 bytes=0 lr="" time=12.752