Skip to content

Commit

Permalink
don't reject unauthorized
Browse files Browse the repository at this point in the history
  • Loading branch information
Segfaultd committed Feb 14, 2024
1 parent 26fcfe4 commit ee62441
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/api.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import { NestFactory } from '@nestjs/core';
import { ConfigService } from '@nestjs/config';
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
import { RedisOptions, Transport } from '@nestjs/microservices';

import { Queue } from 'bull';
import { BullAdapter } from '@bull-board/api/bullAdapter';
import { ExpressAdapter } from '@bull-board/express';
import { createBullBoard } from '@bull-board/api';
import expressBasicAuth from 'express-basic-auth';

import * as parseRedisUrl from 'parse-redis-url-simple';

import { ApiModule } from '@app/modules';
import { AsyncQueues } from '@app/async';

Expand All @@ -16,6 +19,23 @@ async function bootstrap() {
const app = await NestFactory.create(ApiModule);
app.enableCors();

// Microservice module setup
const redisUrl = parseRedisUrl.parseRedisUrl(process.env.REDIS_URL);
app.connectMicroservice<RedisOptions>(
{
transport: Transport.REDIS,
options: {
host: redisUrl[0].host,
port: redisUrl[0].port,
password: redisUrl[0].password,
tls: {
rejectUnauthorized: false,
},
},
},
{ inheritAppConfig: true },
);

// Acquire the config service
const config = app.get(ConfigService);

Expand Down
3 changes: 3 additions & 0 deletions src/sync_consumer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ async function bootstrap() {
host: redisUrl[0].host,
port: redisUrl[0].port,
password: redisUrl[0].password,
tls: {
rejectUnauthorized: false,
},
},
});

Expand Down
3 changes: 3 additions & 0 deletions src/sync_scheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ async function bootstrap() {
host: redisUrl[0].host,
port: redisUrl[0].port,
password: redisUrl[0].password,
tls: {
rejectUnauthorized: false,
},
},
});

Expand Down

0 comments on commit ee62441

Please sign in to comment.