Skip to content

Commit 0c2657e

Browse files
borelpbb
and
pbb
authored
fix(6423): add username and password for redis connection (#6745)
Co-authored-by: pbb <[email protected]>
1 parent 7a282b4 commit 0c2657e

File tree

5 files changed

+17
-0
lines changed

5 files changed

+17
-0
lines changed

packages/twenty-server/.env.example

+2
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ SIGN_IN_PREFILLED=true
5252
# MESSAGE_QUEUE_TYPE=pg-boss
5353
# REDIS_HOST=127.0.0.1
5454
# REDIS_PORT=6379
55+
# REDIS_USERNAME=
56+
# REDIS_PASSWORD=
5557
# DEMO_WORKSPACE_IDS=REPLACE_ME_WITH_A_RANDOM_UUID
5658
# SERVER_URL=http://localhost:3000
5759
# WORKSPACE_INACTIVE_DAYS_BEFORE_NOTIFICATION=30

packages/twenty-server/src/engine/integrations/cache-storage/cache-storage.module-factory.ts

+5
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,17 @@ export const cacheStorageModuleFactory = (
2929
);
3030
}
3131

32+
const username = environmentService.get('REDIS_USERNAME');
33+
const password = environmentService.get('REDIS_PASSWORD');
34+
3235
return {
3336
...cacheModuleOptions,
3437
store: redisStore,
3538
socket: {
3639
host,
3740
port,
41+
username,
42+
password,
3843
},
3944
};
4045
}

packages/twenty-server/src/engine/integrations/environment/environment-variables.ts

+4
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,10 @@ export class EnvironmentVariables {
368368
@CastToPositiveNumber()
369369
REDIS_PORT = 6379;
370370

371+
REDIS_USERNAME: string;
372+
373+
REDIS_PASSWORD: string;
374+
371375
API_TOKEN_EXPIRES_IN = '100y';
372376

373377
SHORT_TERM_TOKEN_EXPIRES_IN = '5m';

packages/twenty-server/src/engine/integrations/message-queue/message-queue.module-factory.ts

+4
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,17 @@ export const messageQueueModuleFactory = async (
3434
case MessageQueueDriverType.BullMQ: {
3535
const host = environmentService.get('REDIS_HOST');
3636
const port = environmentService.get('REDIS_PORT');
37+
const username = environmentService.get('REDIS_USERNAME');
38+
const password = environmentService.get('REDIS_PASSWORD');
3739

3840
return {
3941
type: MessageQueueDriverType.BullMQ,
4042
options: {
4143
connection: {
4244
host,
4345
port,
46+
username,
47+
password,
4448
},
4549
},
4650
};

packages/twenty-website/src/content/developers/self-hosting/self-hosting-var.mdx

+2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ yarn command:prod cron:calendar:calendar-event-list-fetch
3636
['PG_SSL_ALLOW_SELF_SIGNED', 'false', 'Allow self signed certificates'],
3737
['REDIS_HOST', '127.0.0.1', 'Redis connection host'],
3838
['REDIS_PORT', '6379', 'Redis connection port'],
39+
['REDIS_USERNAME', 'redis_username', 'Redis connection username'],
40+
['REDIS_PASSWORD', 'redis_pwd', 'Redis connection password'],
3941
['FRONT_BASE_URL', 'http://localhost:3001', 'Url to the hosted frontend'],
4042
['SERVER_URL', 'http://localhost:3000', 'Url to the hosted server'],
4143
['PORT', '3000', 'Port'],

0 commit comments

Comments
 (0)