From b780f994350a2063151d08fce8eec618c42badbb Mon Sep 17 00:00:00 2001 From: Milos <161627443+BEdev24@users.noreply.github.com> Date: Tue, 17 Sep 2024 20:36:52 +0200 Subject: [PATCH] fix:redis-tls (#361) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix dockle scan on ci * fix registry login * debug imgs * scan tar imgs * test * add tar cleanup * test * pr workflow fix * declutter dockle * add comment * add microservice in pr comment * test w/ individual service failing * fix dockerfile * fix: vote table row responsiveness * Refactor/change logic for file upload to S3 (#328) * refactor: changed getFileUrl function in order to display images on website for longer than 7 days * refactor: changed getFileUrl function in order to display images on website for longer than 7 days * feat: dht-queue (#336) Added persistent dht-queue which will be responsible for publishing cid to dht * refactor: image upload to S3 (#337) * fitx/rationale-governance-format Rationale - Removed body.references since it will be empty until CC-portal enables that feature GAP title and abstract is now parsing in compatibility with CIP-0108 (body.title, body.abstract) * chore: change guides btn link * fix: rm-gap-title-abstract-len-constraint Remove len constraints for gap.title and gap.abstract (was 80 and 2500 char length) fixed error if db data is undefined when fetching from db sync * refactor: add redis username Added username env variable within backend/worker-service/ipfs-service * Fix add redis creds (#343) * feat: add redis user * fix: add config to worker-service * fix-add-redis-creds: fixed order within example.env * fix: add docker compose args --------- Co-authored-by: nike-getto Co-authored-by: BEDev24 * Fix add redis creds (#344) * feat: add redis user * fix: add config to worker-service * fix-add-redis-creds: fixed order within example.env * fix: add docker compose args * refactor: cache docker-compose --------- Co-authored-by: nike-getto Co-authored-by: BEDev24 * fix: typo * fix: typo * refactor: cache service * refactor/redis-auth (#345) * fix: plural grammar corrections * refactor: pruning worker processors (#346) * fix: latest updates content overlaping * refactor: ipfs service path and minor refactoring * fix: usersnap remove other buttons (#323) * fix: Overlapping on tables * fix: don't show top banner on mainnet * fix: show more btn not loading more content, update env example * refactor: renamed migration name for gap len constraint removal * refactor: ipfs volume * add correct vars (#352) Co-authored-by: nike-getto * fix: ipfs-redis-service (#360) * fix/ipfs-redis-service: tls connection to redis * fix/ipfs-redis-service: tls connection to redis --------- Co-authored-by: Baja-KS Co-authored-by: Lazar Lukić <57199246+Baja-KS@users.noreply.github.com> Co-authored-by: Vojimirovich Co-authored-by: Vojimirovich <85948457+Vojimirovich@users.noreply.github.com> Co-authored-by: nike-getto Co-authored-by: BEDev24 Co-authored-by: kubet --- 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],