From ea9bc401e2a0a7de3c7a97a6e7399de166e922f5 Mon Sep 17 00:00:00 2001 From: Milos <161627443+BEdev24@users.noreply.github.com> Date: Wed, 11 Sep 2024 12:21:53 +0200 Subject: [PATCH] refactor: add redis username Added username env variable within backend/worker-service/ipfs-service --- 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..6437ba86 100644 --- a/backend/example.env +++ b/backend/example.env @@ -21,6 +21,7 @@ JWT_REFRESH_TOKEN_EXPIRES_IN=7d # Redis REDIS_HOST=cache REDIS_PORT=6379 +REDIS_USERNAME=redis REDIS_PASSWORD=password # AWS SES diff --git a/backend/src/redis/client/redis-client.ts b/backend/src/redis/client/redis-client.ts index f11a65a3..1d08a87d 100644 --- a/backend/src/redis/client/redis-client.ts +++ b/backend/src/redis/client/redis-client.ts @@ -9,6 +9,7 @@ export const redisClientFactory: FactoryProvider = { const redisInstance = new Redis({ host: configService.getOrThrow('REDIS_HOST'), port: configService.getOrThrow('REDIS_PORT'), + username: configService.getOrThrow('REDIS_USERNAME'), password: configService.getOrThrow('REDIS_PASSWORD'), }); diff --git a/ipfs-service/example.env b/ipfs-service/example.env index 8da0740b..5f855877 100644 --- a/ipfs-service/example.env +++ b/ipfs-service/example.env @@ -10,6 +10,7 @@ IPNS_CONSTITUTION_KEY_NAME='some-key-name' # Redis REDIS_HOST=localhost REDIS_PORT=6379 +REDIS_USERNAME=redis REDIS_PASSWORD=password ## DHT QUEUE ## diff --git a/ipfs-service/src/bullmq/bullmq.module.ts b/ipfs-service/src/bullmq/bullmq.module.ts index 8dd4d1fd..9f661e19 100644 --- a/ipfs-service/src/bullmq/bullmq.module.ts +++ b/ipfs-service/src/bullmq/bullmq.module.ts @@ -13,6 +13,7 @@ import { ExpressAdapter } from "@bull-board/express"; connection: { host: configService.getOrThrow("REDIS_HOST"), port: configService.getOrThrow("REDIS_PORT"), + username: configService.getOrThrow("REDIS_USERNAME"), password: configService.getOrThrow("REDIS_PASSWORD"), }, }), diff --git a/worker-service/example.env b/worker-service/example.env index f15d8584..cfc77466 100644 --- a/worker-service/example.env +++ b/worker-service/example.env @@ -16,6 +16,7 @@ DB_SYNC_POSTGRES_PASSWORD=password # Redis REDIS_HOST=cache REDIS_PORT=6379 +REDIS_USERNAME=redis REDIS_PASSWORD=password # PAGINATION diff --git a/worker-service/src/bullmq/bullmq.module.ts b/worker-service/src/bullmq/bullmq.module.ts index 0b0cbb58..b3075bfa 100644 --- a/worker-service/src/bullmq/bullmq.module.ts +++ b/worker-service/src/bullmq/bullmq.module.ts @@ -16,6 +16,7 @@ import { ExpressAdapter } from '@bull-board/express'; connection: { host: configService.getOrThrow('REDIS_HOST'), port: configService.getOrThrow('REDIS_PORT'), + username: configService.getOrThrow('REDIS_USERNAME'), password: configService.getOrThrow('REDIS_PASSWORD'), }, }),