@@ -411,26 +411,31 @@ def gettext_noop(s):
411
411
"django.core.files.uploadhandler.TemporaryFileUploadHandler" ,
412
412
]
413
413
414
- REDIS_URL = env .str ("REDIS_URL" , default = "redis://127.0.0.1:6379" )
415
-
416
414
# Default setup for the cache
417
415
# See https://docs.djangoproject.com/en/dev/topics/cache/
418
416
CACHE_BACKEND = env .str ("CACHE_BACKEND" , default = "django.core.cache.backends.locmem.LocMemCache" )
417
+ # Set CACHE_REDIS_URL to the URL pointing to your Redis instance available for caching,
418
+ # using the appropriate scheme.
419
+ # For example: "redis://[[username]:[password]]@localhost:6379/0"
420
+ # See the redis-py docs for details on the available schemes at
421
+ # https://redis-py.readthedocs.io/en/stable/connections.html#redis.connection.ConnectionPool.from_url
422
+ CACHE_REDIS_URL = env .str ("CACHE_REDIS_URL" , default = "redis://127.0.0.1:6379" )
423
+
419
424
CACHES = {
420
425
"default" : {
421
426
"BACKEND" : CACHE_BACKEND ,
422
- "LOCATION" : REDIS_URL ,
427
+ "LOCATION" : CACHE_REDIS_URL ,
423
428
"TIMEOUT" : 900 , # 15 minutes, in seconds
424
429
},
425
430
"licensing" : {
426
431
"BACKEND" : CACHE_BACKEND ,
427
- "LOCATION" : REDIS_URL ,
432
+ "LOCATION" : CACHE_REDIS_URL ,
428
433
"TIMEOUT" : 300 , # 10 minutes, in seconds
429
434
"KEY_PREFIX" : "licensing" ,
430
435
},
431
436
"vulnerabilities" : {
432
437
"BACKEND" : CACHE_BACKEND ,
433
- "LOCATION" : REDIS_URL ,
438
+ "LOCATION" : CACHE_REDIS_URL ,
434
439
"TIMEOUT" : 3600 , # 1 hour, in seconds
435
440
"KEY_PREFIX" : "vuln" ,
436
441
},
@@ -439,10 +444,16 @@ def gettext_noop(s):
439
444
# Job Queue
440
445
RQ_QUEUES = {
441
446
"default" : {
442
- "HOST" : env .str ("DEJACODE_REDIS_HOST" , default = "localhost" ),
443
- "PORT" : env .str ("DEJACODE_REDIS_PORT" , default = "6379" ),
444
- "PASSWORD" : env .str ("DEJACODE_REDIS_PASSWORD" , default = "" ),
445
- "DEFAULT_TIMEOUT" : env .int ("DEJACODE_RQ_DEFAULT_TIMEOUT" , default = 360 ),
447
+ "HOST" : env .str ("DEJACODE_RQ_REDIS_HOST" , default = "localhost" ),
448
+ "PORT" : env .str ("DEJACODE_RQ_REDIS_PORT" , default = "6379" ),
449
+ "DB" : env .int ("DEJACODE_RQ_REDIS_DB" , default = 0 ),
450
+ "USERNAME" : env .str ("DEJACODE_RQ_REDIS_USERNAME" , default = None ),
451
+ "PASSWORD" : env .str ("DEJACODE_RQ_REDIS_PASSWORD" , default = "" ),
452
+ "DEFAULT_TIMEOUT" : env .int ("DEJACODE_RQ_REDIS_DEFAULT_TIMEOUT" , default = 360 ),
453
+ # Enable SSL for Redis connections when deploying DejaCode in environments where
454
+ # Redis is hosted on a separate system (e.g., cloud deployment or remote
455
+ # Redis server) to secure data in transit.
456
+ "SSL" : env .bool ("DEJACODE_RQ_REDIS_SSL" , default = False ),
446
457
},
447
458
}
448
459
0 commit comments