From 34e260f88f561cf26454fe72a10a3a403faf2ff3 Mon Sep 17 00:00:00 2001 From: Alexandre Flament Date: Fri, 11 Nov 2022 20:14:47 +0100 Subject: [PATCH] [fix] follow up of PR-1856 - the environment variable SEARXNG_REDIS_URL overrides the setting value redis.url - ./manage sets SEARXNG_REDIS_URL to unix:///usr/local/searxng-redis/run/redis.sock if: - the socket exists - SEARXNG_REDIS_URL is not already defined Update of PR #1856 Co-authored-by: Markus Heiser --- manage | 12 ++++++++++++ searx/settings_defaults.py | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/manage b/manage index c887826e2..d61237984 100755 --- a/manage +++ b/manage @@ -32,6 +32,12 @@ export NODE_MINIMUM_VERSION="16.13.0" BLACK_OPTIONS=("--target-version" "py37" "--line-length" "120" "--skip-string-normalization") BLACK_TARGETS=("--exclude" "searx/static,searx/languages.py" "--include" 'searxng.msg|\.pyi?$' "searx" "searxng_extra" "tests") +_dev_redis_sock="/usr/local/searxng-redis/run/redis.sock" +# set SEARXNG_REDIS_URL if it is not defined and "{_dev_redis_sock}" exists. +if [ -S "${_dev_redis_sock}" ] && [ -z "${SEARXNG_REDIS_URL}" ]; then + export SEARXNG_REDIS_URL="unix://${_dev_redis_sock}?db=0" +fi + pylint.FILES() { # List files tagged by comment: @@ -65,6 +71,8 @@ help() { cat <