diff --git a/README.md b/README.md index c60bcea..6e8c15d 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,7 @@ The following environment variables are supported: | `REDIS_HOST` | x | `null` | Redis host (**IMPORTANT** must be same redis instance that stores bull jobs!) | | `REDIS_PORT` | x | `null` | Redis port | | `REDIS_PASSWORD` | | `null` | Redis password | +| `REDIS_TLS` | | `false` | Redis tls option | | `REDIS_DB` | | `0` | Redis database index to use (see `options.db` from [docs](https://ioredis.readthedocs.io/en/latest/API/#new-redisport-host-options)) | | `UI` | | `bull-board` | UI to use (supported: `arena`, `bull-board`) | | `BULL_WATCH_QUEUE_PREFIXES` | | `bull` | Bull prefixes to monitor (globs like `prefix*` are supported) | diff --git a/src/bull/bull.module.ts b/src/bull/bull.module.ts index b0f60c3..3b3b39c 100644 --- a/src/bull/bull.module.ts +++ b/src/bull/bull.module.ts @@ -25,6 +25,7 @@ import { BullMQMetricsFactory } from './bullmq-metrics.factory'; port: configService.config.REDIS_PORT, db: configService.config.REDIS_DB, enableReadyCheck: true, + tls: configService.config.REDIS_TLS ? {} : null, reconnectOnError: () => true, }; }, diff --git a/src/config/config.service.ts b/src/config/config.service.ts index 579073a..d2becbc 100644 --- a/src/config/config.service.ts +++ b/src/config/config.service.ts @@ -39,6 +39,10 @@ export class ConfigService { * Redis password (if needed) */ REDIS_PASSWORD: str({ default: '' }), + /** + * Redis tls option + */ + REDIS_TLS: bool({ default: false }), /** * Comma separate list of bull queue prefixes to * monitor (default: bull)