From 5277d150cdc935d419a129b8082791e27325b39b Mon Sep 17 00:00:00 2001 From: Milos <161627443+BEdev24@users.noreply.github.com> Date: Tue, 17 Sep 2024 20:25:33 +0200 Subject: [PATCH] fix: ipfs-redis-service (#360) * fix/ipfs-redis-service: tls connection to redis * fix/ipfs-redis-service: tls connection to redis --- backend/example.env | 1 + backend/src/redis/client/redis-client.ts | 1 + ipfs-service/example.env | 1 + ipfs-service/src/bullmq/bullmq.module.ts | 1 + worker-service/example.env | 1 + worker-service/src/bullmq/bullmq.module.ts | 1 + 6 files changed, 6 insertions(+) diff --git a/backend/example.env b/backend/example.env index d15953a9..1c9e1497 100644 --- a/backend/example.env +++ b/backend/example.env @@ -22,6 +22,7 @@ JWT_REFRESH_TOKEN_EXPIRES_IN=7d REDIS_HOST=cache REDIS_PORT=6379 REDIS_PASSWORD=password +REDIS_TLS=false # AWS SES AWS_ACCESS_KEY_ID=your_access_key_id diff --git a/backend/src/redis/client/redis-client.ts b/backend/src/redis/client/redis-client.ts index f11a65a3..763d9d5f 100644 --- a/backend/src/redis/client/redis-client.ts +++ b/backend/src/redis/client/redis-client.ts @@ -10,6 +10,7 @@ export const redisClientFactory: FactoryProvider = { host: configService.getOrThrow('REDIS_HOST'), port: configService.getOrThrow('REDIS_PORT'), password: configService.getOrThrow('REDIS_PASSWORD'), + ...(configService.get('REDIS_TLS') === 'false' ? {} : { tls: {} }), }); redisInstance.on('error', (e) => { diff --git a/ipfs-service/example.env b/ipfs-service/example.env index 8da0740b..e5bf4a07 100644 --- a/ipfs-service/example.env +++ b/ipfs-service/example.env @@ -11,6 +11,7 @@ IPNS_CONSTITUTION_KEY_NAME='some-key-name' REDIS_HOST=localhost REDIS_PORT=6379 REDIS_PASSWORD=password +REDIS_TLS=false ## DHT QUEUE ## # Attempts diff --git a/ipfs-service/src/bullmq/bullmq.module.ts b/ipfs-service/src/bullmq/bullmq.module.ts index 8dd4d1fd..a616bf14 100644 --- a/ipfs-service/src/bullmq/bullmq.module.ts +++ b/ipfs-service/src/bullmq/bullmq.module.ts @@ -14,6 +14,7 @@ import { ExpressAdapter } from "@bull-board/express"; host: configService.getOrThrow("REDIS_HOST"), port: configService.getOrThrow("REDIS_PORT"), password: configService.getOrThrow("REDIS_PASSWORD"), + ...(configService.get('REDIS_TLS') === 'false' ? {} : { tls: {} }), }, }), inject: [ConfigService], diff --git a/worker-service/example.env b/worker-service/example.env index f15d8584..1265c48c 100644 --- a/worker-service/example.env +++ b/worker-service/example.env @@ -17,6 +17,7 @@ DB_SYNC_POSTGRES_PASSWORD=password REDIS_HOST=cache REDIS_PORT=6379 REDIS_PASSWORD=password +REDIS_TLS=false # PAGINATION HOT_ADDRESSES_PER_PAGE=10 diff --git a/worker-service/src/bullmq/bullmq.module.ts b/worker-service/src/bullmq/bullmq.module.ts index 0b0cbb58..68523009 100644 --- a/worker-service/src/bullmq/bullmq.module.ts +++ b/worker-service/src/bullmq/bullmq.module.ts @@ -17,6 +17,7 @@ import { ExpressAdapter } from '@bull-board/express'; host: configService.getOrThrow('REDIS_HOST'), port: configService.getOrThrow('REDIS_PORT'), password: configService.getOrThrow('REDIS_PASSWORD'), + ...(configService.get('REDIS_TLS') === 'false' ? {} : { tls: {} }), }, }), inject: [ConfigService],