haraka-plugin-karma 2.0.3 → 2.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.
- package/.gitmodules +3 -0
- package/Changes.md +13 -0
- package/index.js +3 -3
- package/package.json +3 -3
- package/.release/base.sh +0 -40
- package/.release/do.sh +0 -51
- package/.release/push.sh +0 -23
package/.gitmodules
ADDED
package/Changes.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
#### N.N.N - YYYY-MM-DD
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
### [2.1.0] - 2022-11-29
|
|
6
|
+
|
|
7
|
+
- fix: in disconnect, call redis_unsub after skip check
|
|
8
|
+
- dep(redis): 4 -> 4.1
|
|
9
|
+
- dep(pi-redis): 2 -> 2.0.5
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
#### 2.0.4 - 2022-05-28
|
|
13
|
+
|
|
14
|
+
- use .release as submodule
|
|
15
|
+
|
|
16
|
+
|
|
5
17
|
#### 2.0.3 - 2022-05-28
|
|
6
18
|
|
|
7
19
|
- fix: depend directly on redis
|
|
@@ -92,3 +104,4 @@
|
|
|
92
104
|
#### 1.0.2 - 2017-01-24
|
|
93
105
|
|
|
94
106
|
- use redis.merge_redis_ini()
|
|
107
|
+
[2.1.0]: https://github.com/haraka/haraka-plugin-karma/releases/tag/2.1.0
|
package/index.js
CHANGED
|
@@ -684,10 +684,10 @@ exports.increment = function (connection, key, val) {
|
|
|
684
684
|
exports.hook_disconnect = function (next, connection) {
|
|
685
685
|
const plugin = this
|
|
686
686
|
|
|
687
|
-
plugin.redis_unsubscribe(connection)
|
|
688
|
-
|
|
689
687
|
if (plugin.should_we_skip(connection)) return next()
|
|
690
688
|
|
|
689
|
+
plugin.redis_unsubscribe(connection)
|
|
690
|
+
|
|
691
691
|
const k = connection.results.get('karma')
|
|
692
692
|
if (!k || k.score === undefined) {
|
|
693
693
|
connection.results.add(plugin, {err: 'karma results missing'})
|
|
@@ -708,7 +708,7 @@ exports.hook_disconnect = function (next, connection) {
|
|
|
708
708
|
}
|
|
709
709
|
|
|
710
710
|
connection.results.add(plugin, {emit: true })
|
|
711
|
-
|
|
711
|
+
next()
|
|
712
712
|
}
|
|
713
713
|
|
|
714
714
|
exports.get_award_loc_from_note = function (connection, award) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "haraka-plugin-karma",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "A heuristics scoring and reputation engine for SMTP connections",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"address-rfc2821": "*",
|
|
27
27
|
"haraka-constants": ">=1.0.2",
|
|
28
28
|
"haraka-utils": "*",
|
|
29
|
-
"haraka-plugin-redis": "2",
|
|
30
|
-
"redis": "4"
|
|
29
|
+
"haraka-plugin-redis": "2.0.5",
|
|
30
|
+
"redis": "4.1"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"eslint": "8",
|
package/.release/base.sh
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
|
|
3
|
-
branch_is_master()
|
|
4
|
-
{
|
|
5
|
-
if [ "$(git branch --show-current)" = "master" ]; then
|
|
6
|
-
return 0
|
|
7
|
-
fi
|
|
8
|
-
|
|
9
|
-
return 1
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
repo_is_clean()
|
|
13
|
-
{
|
|
14
|
-
if [ -z "$(git status --porcelain)" ]; then
|
|
15
|
-
return 0
|
|
16
|
-
fi
|
|
17
|
-
|
|
18
|
-
return 1
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
assure_repo_is_clean()
|
|
22
|
-
{
|
|
23
|
-
if repo_is_clean; then return 0; fi
|
|
24
|
-
|
|
25
|
-
echo
|
|
26
|
-
echo "ERROR: Uncommitted changes, cowardly refusing to continue..."
|
|
27
|
-
echo
|
|
28
|
-
sleep 2
|
|
29
|
-
|
|
30
|
-
git status
|
|
31
|
-
|
|
32
|
-
return 1
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
find_changelog()
|
|
36
|
-
{
|
|
37
|
-
CHANGELOG=$(ls [Cc][Hh][Aa]*.md)
|
|
38
|
-
export CHANGELOG
|
|
39
|
-
#echo "I found your CHANGELOG at: $CHANGELOG"
|
|
40
|
-
}
|
package/.release/do.sh
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
|
|
3
|
-
usage() {
|
|
4
|
-
echo "do.sh {major | minor | patch}"
|
|
5
|
-
exit
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
. .release/base.sh || exit
|
|
9
|
-
|
|
10
|
-
case "$1" in
|
|
11
|
-
"major" )
|
|
12
|
-
;;
|
|
13
|
-
"minor" )
|
|
14
|
-
;;
|
|
15
|
-
"patch" )
|
|
16
|
-
;;
|
|
17
|
-
*)
|
|
18
|
-
usage
|
|
19
|
-
;;
|
|
20
|
-
esac
|
|
21
|
-
|
|
22
|
-
NEW_VERSION=$(npm --no-git-tag-version version "$1")
|
|
23
|
-
|
|
24
|
-
YMD=$(date "+%Y-%m-%d")
|
|
25
|
-
# echo "Preparing $NEW_VERSION - $YMD"
|
|
26
|
-
|
|
27
|
-
if branch_is_master; then
|
|
28
|
-
git checkout -b "release-${NEW_VERSION}"
|
|
29
|
-
fi
|
|
30
|
-
|
|
31
|
-
update_changes() {
|
|
32
|
-
tee .release/new.txt <<EO_CHANGE
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
#### ${NEW_VERSION//v} - $YMD
|
|
36
|
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
EO_CHANGE
|
|
40
|
-
|
|
41
|
-
sed -i '' -e "/#### N.N.N.*$/r .release/new.txt" "$CHANGELOG"
|
|
42
|
-
rm .release/new.txt
|
|
43
|
-
|
|
44
|
-
if command -v open; then open "$CHANGELOG"; fi
|
|
45
|
-
|
|
46
|
-
echo
|
|
47
|
-
echo "AFTER editing $CHANGELOG, run: .release/push.sh"
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
find_changelog
|
|
51
|
-
update_changes
|
package/.release/push.sh
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
|
|
3
|
-
. .release/base.sh || exit
|
|
4
|
-
|
|
5
|
-
if branch_is_master; then
|
|
6
|
-
echo "ERROR: run the release scripts in a feature branch! (not master)"
|
|
7
|
-
exit
|
|
8
|
-
fi
|
|
9
|
-
|
|
10
|
-
VERSION=$(node -e 'console.log(require("./package.json").version)')
|
|
11
|
-
|
|
12
|
-
find_changelog
|
|
13
|
-
|
|
14
|
-
git add package.json
|
|
15
|
-
git add "$CHANGELOG"
|
|
16
|
-
|
|
17
|
-
git commit -m "Release v$VERSION"
|
|
18
|
-
|
|
19
|
-
git push --set-upstream origin "$(git branch --show-current)"
|
|
20
|
-
|
|
21
|
-
if command -v gh; then
|
|
22
|
-
gh pr create
|
|
23
|
-
fi
|