Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dep: redis 3 -> 4, API change to promises #31

Merged
merged 4 commits into from
Mar 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
engines:
eslint:
enabled: true
channel: "eslint-3"
channel: "eslint-8"
config:
config: ".eslintrc"
config: ".eslintrc.yaml"

ratings:
paths:
Expand Down
3 changes: 3 additions & 0 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ extends: [ eslint:recommended, plugin:haraka/recommended ]

root: true

parserOptions:
ecmaVersion: 2020

globals:
OK: true
CONT: true
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Tests

on: [ push ]

env:
CI: true

jobs:

ci-test:
Expand All @@ -17,12 +20,9 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest ]
node-version: [ 12, 14, 16]
node-version: [ 14, 16 ]
fail-fast: false

env:
CI: true

steps:
- uses: actions/checkout@v2
name: Checkout Code
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Lint

on: [ push ]

env:
CI: true

jobs:

lint:
Expand All @@ -28,6 +31,3 @@ jobs:

- name: Lint
run: npm run lint

env:
CI: true
1 change: 1 addition & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
- master

env:
CI: true
node_version: 14

jobs:
Expand Down
5 changes: 4 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
.gitignore
.gitmodules
.lgtm.yml
appveyor.yml
http/bower_components
http/node_modules
.travis.yml
appveyor.yml
.eslintrc.yaml
.eslintrc.json
codecov.yml
.codeclimate.yml
10 changes: 10 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@


### 2.0.0 - 2022-03-29

- bump redis major version 3 -> 4
- API change, callbacks replaced by promises
- config.ini
- [server] -> [socket]
- opts.db -> opts.database (to match upstream)


### 1.0.13 - 2021-10-14

- switch CI from Travis to GitHub Actions
Expand Down
24 changes: 11 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ attached to another database.

The `redis.ini` file has the following sections (defaults shown):

### [server]
### [socket]

```ini
; host=127.0.0.1
Expand All @@ -25,13 +25,13 @@ The `redis.ini` file has the following sections (defaults shown):
; port=6379
```

Publish & Subscribe are DB agnostic and thus have no db setting. If host and port and not defined, they default to the same as [server] settings.
Publish & Subscribe are DB agnostic and thus have no db setting. If host and port and not defined, they default to the same as [socket] settings.

### [opts]

```ini
; see https://www.npmjs.com/package/redis#options-object-properties
; db=0
; see https://github.com/redis/node-redis/blob/HEAD/docs/client-configuration.md
; database=0
; password=battery-horse-staple
```

Expand Down Expand Up @@ -74,17 +74,16 @@ optionally with a redis db ID. All redis config options must be listed in your p

```js
exports.register = function () {
const plugin = this;
plugin.inherits('redis');
this.inherits('redis');

plugin.cfg = plugin.config.get('my-plugin.ini');
this.cfg = this.config.get('my-plugin.ini');

// populate plugin.cfg.redis with defaults from redis.ini
plugin.merge_redis_ini();
this.merge_redis_ini();

// cluster aware redis connection(s)
plugin.register_hook('init_master', 'init_redis_plugin');
plugin.register_hook('init_child', 'init_redis_plugin');
this.register_hook('init_master', 'init_redis_plugin');
this.register_hook('init_child', 'init_redis_plugin');
}
```

Expand All @@ -101,8 +100,7 @@ Notice the database ID numbers appended to each plugins redis connection
message.



[ci-img]: https://github.com/haraka/haraka-plugin-redis/workflows/Tests/badge.svg
[ci-url]: https://github.com/haraka/haraka-plugin-redis/actions?query=workflow%3ATests
[ci-img]: https://github.com/haraka/haraka-plugin-redis/actions/workflows/ci-test.yml/badge.svg
[ci-url]: https://github.com/haraka/haraka-plugin-redis/actions/workflows/ci-test.yml
[clim-img]: https://codeclimate.com/github/haraka/haraka-plugin-redis/badges/gpa.svg
[clim-url]: https://codeclimate.com/github/haraka/haraka-plugin-redis
5 changes: 2 additions & 3 deletions config/redis.ini
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@

[server]
[socket]
; host=127.0.0.1
; port=6379
; db=0

[pubsub]
; host=127.0.0.1
; port=6379

[opts]
; db=0
; database=0
; password=dontUseThisOne
Loading