mirror of
https://github.com/searxng/searxng
synced 2024-01-01 19:24:07 +01:00

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>
58 lines
1.6 KiB
TOML
58 lines
1.6 KiB
TOML
[real_ip]
|
|
|
|
# Number of values to trust for X-Forwarded-For.
|
|
|
|
x_for = 1
|
|
|
|
# The prefix defines the number of leading bits in an address that are compared
|
|
# to determine whether or not an address is part of a (client) network.
|
|
|
|
ipv4_prefix = 32
|
|
ipv6_prefix = 48
|
|
|
|
[botdetection.redis]
|
|
|
|
# FQDN of a function definition. A function with which the DB keys of the Redis
|
|
# DB are to be annonymized.
|
|
secret_hash = ''
|
|
|
|
# A prefix to all keys store by the botdetection in the redis DB
|
|
REDIS_KEY_PREFIX = 'botdetection_'
|
|
|
|
[botdetection.ip_limit]
|
|
|
|
# To get unlimited access in a local network, by default link-lokal addresses
|
|
# (networks) are not monitored by the ip_limit
|
|
filter_link_local = false
|
|
|
|
# activate link_token method in the ip_limit method
|
|
link_token = false
|
|
|
|
[botdetection.link_token]
|
|
# Livetime (sec) of limiter's CSS token.
|
|
TOKEN_LIVE_TIME = 600
|
|
|
|
# Livetime (sec) of the ping-key from a client (request)
|
|
PING_LIVE_TIME = 3600
|
|
|
|
# Prefix of all ping-keys generated by link_token.get_ping_key
|
|
PING_KEY = 'botdetection.link_token.PING_KEY'
|
|
|
|
# Key for which the current token is stored in the DB
|
|
TOKEN_KEY = 'botdetection.link_token.TOKEN_KEY'
|
|
|
|
[botdetection.ip_lists]
|
|
|
|
# In the limiter, the ip_lists method has priority over all other methods -> if
|
|
# an IP is in the pass_ip list, it has unrestricted access and it is also not
|
|
# checked if e.g. the "user agent" suggests a bot (e.g. curl).
|
|
|
|
block_ip = [
|
|
# '93.184.216.34', # IPv4 of example.org
|
|
# '257.1.1.1', # invalid IP --> will be ignored, logged in ERROR class
|
|
]
|
|
|
|
pass_ip = [
|
|
# '192.168.0.0/16', # IPv4 private network
|
|
# 'fe80::/10' # IPv6 linklocal / wins over botdetection.ip_limit.filter_link_local
|
|
]
|