diff --git a/packages/cli/src/commands/start.ts b/packages/cli/src/commands/start.ts index c7a7fb18842c1..53075f1abd43a 100644 --- a/packages/cli/src/commands/start.ts +++ b/packages/cli/src/commands/start.ts @@ -350,6 +350,7 @@ export class Start extends Command { if (config.getEnv('executions.mode') === 'queue') { const redisHost = config.getEnv('queue.bull.redis.host'); + const redisUsername = config.getEnv('queue.bull.redis.username'); const redisPassword = config.getEnv('queue.bull.redis.password'); const redisPort = config.getEnv('queue.bull.redis.port'); const redisDB = config.getEnv('queue.bull.redis.db'); @@ -383,6 +384,9 @@ export class Start extends Command { if (redisHost) { settings.host = redisHost; } + if (redisUsername) { + settings.username = redisUsername; + } if (redisPassword) { settings.password = redisPassword; } diff --git a/packages/cli/src/commands/webhook.ts b/packages/cli/src/commands/webhook.ts index d8f4a0f97dfee..7ad1305b39001 100644 --- a/packages/cli/src/commands/webhook.ts +++ b/packages/cli/src/commands/webhook.ts @@ -159,6 +159,7 @@ export class Webhook extends Command { if (config.getEnv('executions.mode') === 'queue') { const redisHost = config.getEnv('queue.bull.redis.host'); + const redisUsername = config.getEnv('queue.bull.redis.username'); const redisPassword = config.getEnv('queue.bull.redis.password'); const redisPort = config.getEnv('queue.bull.redis.port'); const redisDB = config.getEnv('queue.bull.redis.db'); @@ -192,6 +193,9 @@ export class Webhook extends Command { if (redisHost) { settings.host = redisHost; } + if (redisUsername) { + settings.username = redisUsername; + } if (redisPassword) { settings.password = redisPassword; } diff --git a/packages/cli/src/config/schema.ts b/packages/cli/src/config/schema.ts index ee459209a029e..aeacab0b87128 100644 --- a/packages/cli/src/config/schema.ts +++ b/packages/cli/src/config/schema.ts @@ -380,6 +380,12 @@ export const schema = { default: 10000, env: 'QUEUE_BULL_REDIS_TIMEOUT_THRESHOLD', }, + username: { + doc: 'Redis Username (needs Redis >= 6)', + format: String, + default: '', + env: 'QUEUE_BULL_REDIS_USERNAME', + }, }, queueRecoveryInterval: { doc: 'If > 0 enables an active polling to the queue that can recover for Redis crashes. Given in seconds; 0 is disabled. May increase Redis traffic significantly.',