[mod] isolation of botdetection from SearXNG core

In PR-2894[1] we isolated botdetection from the limiter, this PR isolates the
botdetection from the SearXNG core code.

This PR also fixes the issue [2] that the ``server.public_instance`` option
needs to activate the limiter.

- [1] https://github.com/searxng/searxng/pull/2894
- [2] https://github.com/searxng/searxng/issues/2975

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
Markus Heiser 2023-11-01 14:18:44 +01:00
parent c0b97c6543
commit 523a875f1e
20 changed files with 555 additions and 373 deletions

View file

@ -11,8 +11,9 @@
port: 8888
bind_address: "127.0.0.1"
secret_key: "ultrasecretkey" # change this!
limiter: false
public_instance: false
limiter: false
pass_searxng_org: false
image_proxy: false
default_http_headers:
X-Content-Type-Options : nosniff
@ -31,10 +32,6 @@
``secret_key`` : ``$SEARXNG_SECRET``
Used for cryptography purpose.
``limiter`` :
Rate limit the number of request on the instance, block some bots. The
:ref:`limiter` requires a :ref:`settings redis` database.
.. _public_instance:
``public_instance`` :
@ -43,8 +40,22 @@
needed for local usage). By set to ``true`` the following features are
activated:
- ``server: limiter`` option :ref:`see below <activate limiter>`
- ``server: pass_searxng_org`` option :ref:`see below <pass_searxng_org>`
- :py:obj:`searx.botdetection.link_token` in the :ref:`limiter`
.. _activate limiter:
``limiter`` :
Rate limit the number of request on the instance, block some bots. The
:ref:`limiter` requires a :ref:`settings redis` database.
.. _pass_searxng_org:
``pass_searxng_org`` :
In the limiter activates the passlist of (hardcoded) IPs of the SearXNG
organization, e.g. ``check.searx.space``.
.. _image_proxy:
``image_proxy`` :