Skip to content

Commit f0750d4

Browse files
authored
Refine the available options for RQ_QUEUES settings #1465 (#1467)
Signed-off-by: tdruez <tdruez@nexb.com>
1 parent d3e537a commit f0750d4

File tree

4 files changed

+45
-5
lines changed

4 files changed

+45
-5
lines changed

CHANGELOG.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
Changelog
22
=========
33

4+
v34.9.3 (unreleased)
5+
--------------------
6+
7+
- Refine the available settings for RQ_QUEUES:
8+
* Rename the RQ_QUEUES sub-settings to SCANCODEIO_RQ_REDIS_*
9+
* Add SCANCODEIO_RQ_REDIS_SSL setting to enable SSL.
10+
https://github.com/aboutcode-org/scancode.io/issues/1465
11+
412
v34.9.2 (2024-12-10)
513
--------------------
614

docker.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ POSTGRES_PASSWORD=scancodeio
44
POSTGRES_INITDB_ARGS=--encoding=UTF-8 --lc-collate=en_US.UTF-8 --lc-ctype=en_US.UTF-8
55

66
SCANCODEIO_DB_HOST=db
7-
SCANCODEIO_REDIS_HOST=redis
7+
SCANCODEIO_RQ_REDIS_HOST=redis
88
SCANCODEIO_ASYNC=True
99
SCANCODEIO_WORKSPACE_LOCATION=/var/scancodeio/workspace/

docs/application-settings.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,3 +444,29 @@ SCANCODEIO_SKOPEO_AUTHFILE_LOCATION
444444
Specify the path of the Skopeo authentication file using the following setting::
445445

446446
SCANCODEIO_SKOPEO_AUTHFILE_LOCATION="/path/to/auth.json"
447+
448+
.. _scancodeio_settings_job_queue_and_workers:
449+
450+
Job Queue and Workers
451+
---------------------
452+
453+
ScanCode.io leverages the RQ (Redis Queue) Python library for job queuing and background
454+
processing with workers.
455+
456+
By default, it is configured to use the "redis" service in the Docker Compose stack.
457+
458+
For deployments where Redis is hosted on a separate system
459+
(e.g., a cloud-based deployment or a remote Redis server),
460+
the Redis instance used by RQ can be customized using the following settings::
461+
462+
SCANCODEIO_RQ_REDIS_HOST=localhost
463+
SCANCODEIO_RQ_REDIS_PORT=6379
464+
SCANCODEIO_RQ_REDIS_DB=0
465+
SCANCODEIO_RQ_REDIS_USERNAME=<username>
466+
SCANCODEIO_RQ_REDIS_PASSWORD=<password>
467+
SCANCODEIO_RQ_REDIS_DEFAULT_TIMEOUT=360
468+
469+
To enhance security, it is recommended to enable SSL for Redis connections.
470+
SSL is disabled by default but can be enabled with the following configuration::
471+
472+
SCANCODEIO_RQ_REDIS_SSL=True

scancodeio/settings.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -356,10 +356,16 @@
356356

357357
RQ_QUEUES = {
358358
"default": {
359-
"HOST": env.str("SCANCODEIO_REDIS_HOST", default="localhost"),
360-
"PORT": env.str("SCANCODEIO_REDIS_PORT", default="6379"),
361-
"PASSWORD": env.str("SCANCODEIO_REDIS_PASSWORD", default=""),
362-
"DEFAULT_TIMEOUT": env.int("SCANCODEIO_REDIS_DEFAULT_TIMEOUT", default=360),
359+
"HOST": env.str("SCANCODEIO_RQ_REDIS_HOST", default="localhost"),
360+
"PORT": env.str("SCANCODEIO_RQ_REDIS_PORT", default="6379"),
361+
"DB": env.int("SCANCODEIO_RQ_REDIS_DB", default=0),
362+
"USERNAME": env.str("SCANCODEIO_RQ_REDIS_USERNAME", default=None),
363+
"PASSWORD": env.str("SCANCODEIO_RQ_REDIS_PASSWORD", default=""),
364+
"DEFAULT_TIMEOUT": env.int("SCANCODEIO_RQ_REDIS_DEFAULT_TIMEOUT", default=360),
365+
# Enable SSL for Redis connections when deploying ScanCode.io in environments
366+
# where Redis is hosted on a separate system (e.g., cloud deployment or remote
367+
# Redis server) to secure data in transit.
368+
"SSL": env.bool("SCANCODEIO_RQ_REDIS_SSL", default=False),
363369
},
364370
}
365371

0 commit comments

Comments
 (0)