Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): Add compatibility to redis > 6 ACLs system using username in queue-mode #5048

Merged
merged 2 commits into from
Jan 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/cli/src/commands/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -383,6 +384,9 @@ export class Start extends Command {
if (redisHost) {
settings.host = redisHost;
}
if (redisUsername) {
settings.username = redisUsername;
}
if (redisPassword) {
settings.password = redisPassword;
}
Expand Down
4 changes: 4 additions & 0 deletions packages/cli/src/commands/webhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -192,6 +193,9 @@ export class Webhook extends Command {
if (redisHost) {
settings.host = redisHost;
}
if (redisUsername) {
settings.username = redisUsername;
}
if (redisPassword) {
settings.password = redisPassword;
}
Expand Down
6 changes: 6 additions & 0 deletions packages/cli/src/config/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
Expand Down