mirror of
https://github.com/rommapp/romm.git
synced 2026-11-30 10:32:57 +01:00
fix(docker): keep the Redis password out of the RQ worker command line
The worker received its connection string through `rq worker --url`, which put the password in argv for the life of the process, readable via /proc/<pid>/cmdline, ps, and any monitoring or diagnostic tooling that collects command lines (CWE-214). RQ's `--url` option already reads from RQ_REDIS_URL, so passing it through the environment instead is behavior-preserving. This matches how the RQ scheduler alongside it already takes its credentials. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -251,15 +251,18 @@ start_bin_rq_worker() {
|
||||
fi
|
||||
|
||||
# Set PYTHONPATH so RQ can find the tasks module.
|
||||
# The connection URL goes through RQ_REDIS_URL rather than --url, so the
|
||||
# embedded password stays out of the worker's world-readable command line.
|
||||
# Use a worker class that drops the noisy per-sweep "cleaning registries for
|
||||
# queue" log line. The maintenance interval keeps its default (~10 min) so
|
||||
# orphaned STARTED jobs and stale workers are still pruned promptly, which the
|
||||
# watcher's Worker.all() scan dedupe relies on.
|
||||
PYTHONPATH="/backend:${PYTHONPATH-}" rq worker \
|
||||
PYTHONPATH="/backend:${PYTHONPATH-}" \
|
||||
RQ_REDIS_URL="${redis_url}" \
|
||||
rq worker \
|
||||
--path /backend \
|
||||
--worker-class handler.rq_worker.RomMWorker \
|
||||
--pid /tmp/rq_worker.pid \
|
||||
--url "${redis_url}" \
|
||||
--results-ttl "${TASK_RESULT_TTL:-86400}" \
|
||||
--logging_level "${LOGLEVEL}" \
|
||||
high default low &
|
||||
|
||||
@@ -69,15 +69,18 @@ else
|
||||
fi
|
||||
|
||||
# Set PYTHONPATH so RQ can find the tasks module.
|
||||
# The connection URL goes through RQ_REDIS_URL rather than --url, so the
|
||||
# embedded password stays out of the worker's world-readable command line.
|
||||
# Use a worker class that drops the noisy per-sweep "cleaning registries for
|
||||
# queue" log line. The maintenance interval keeps its default (~10 min) so
|
||||
# orphaned STARTED jobs and stale workers are still pruned promptly, which the
|
||||
# watcher's Worker.all() scan dedupe relies on.
|
||||
PYTHONPATH="/app/backend:${PYTHONPATH-}" rq worker \
|
||||
PYTHONPATH="/app/backend:${PYTHONPATH-}" \
|
||||
RQ_REDIS_URL="${REDIS_URL}" \
|
||||
rq worker \
|
||||
--path /app/backend \
|
||||
--worker-class handler.rq_worker.RomMWorker \
|
||||
--pid /tmp/rq_worker.pid \
|
||||
--url "${REDIS_URL}" \
|
||||
--logging_level "${LOGLEVEL:-INFO}" \
|
||||
high default low &
|
||||
|
||||
|
||||
Reference in New Issue
Block a user