Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

Release v1.10 #94

Merged
merged 11 commits into from
Jul 10, 2019
Next Next commit
Add config for redis auth and check for auth in redis setup.
  • Loading branch information
rain2o committed Jun 4, 2019
commit c7d17778d7bd4172ec06c6d2703444920e85cd2d
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

<<<<<<< HEAD
# [Unreleased]
### Added
- Added optional Redis Auth functionality. @rain2o (#42)

## [1.9]
### Added
- New ENV variable `SEO_USE_URL_DISPATCHER` (default = true) added. When set, then the `product.url_path` and `category.url_path` are automatically populated for the UrlDispatche featu$
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ node --harmony cli.js productsworker
```

**Please note:** We're using [kue based on Redis queue](https://github.com/Automattic/kue) which may be configured via `src/config.js` - `kue` + `redis` section.
**Please note:** There is no authorization mechanism in place for the webapi calls. Please keep it local / private networked or add some kind of authorization as a PR to this project please :-)

**Please note:** Redis now supports auth. In order to use Redis with auth simply pass the password to the `REDIS_AUTH` env variable.


### Multistore setup
Expand Down
4 changes: 4 additions & 0 deletions src/adapters/abstract.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ class AbstractAdapter {
this.cache.on('error', (err) => { // workaround for https://github.com/NodeRedis/node_redis/issues/713
global.cache = Redis.createClient(this.config.redis); // redis client
});
// redis auth if provided
if (this.config.redis.auth) {
this.cache.auth(this.config.redis.auth);
}
global.cache = this.cache;
} else this.cache = global.cache;

Expand Down
1 change: 1 addition & 0 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ module.exports = {
redis: {
host: process.env.REDIS_HOST || '127.0.0.1',
port: process.env.REDIS_PORT || 6379,
auth: process.env.REDIS_AUTH || false,
db: process.env.REDIS_DB || 0
},

Expand Down