diff options
author | Emilien Devos <4016501+unixfox@users.noreply.github.com> | 2023-09-24 11:02:29 +0200 |
---|---|---|
committer | Alexandre Flament <alex@al-f.net> | 2023-09-25 22:31:14 +0200 |
commit | 47721a34855d2a68aef7f96dd7d297965d28416c (patch) | |
tree | dddb048599a9e40e1c80c98825924d26080ad36f /searx/botdetection | |
parent | 1df4588279aba55b40010e286191dcf4518ffd16 (diff) | |
download | searxng-47721a34855d2a68aef7f96dd7d297965d28416c.tar.gz searxng-47721a34855d2a68aef7f96dd7d297965d28416c.zip |
add new parameter called server.public_instance
for enabling by default advanced limiter functions
in the future allow us to add features just for the public instances
Diffstat (limited to 'searx/botdetection')
-rw-r--r-- | searx/botdetection/ip_limit.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/searx/botdetection/ip_limit.py b/searx/botdetection/ip_limit.py index 70863265e..5ff3c87ca 100644 --- a/searx/botdetection/ip_limit.py +++ b/searx/botdetection/ip_limit.py @@ -47,6 +47,7 @@ from ipaddress import ( import flask import werkzeug from searx.tools import config +from searx import settings from searx import redisdb from searx.redislib import incr_sliding_window, drop_counter @@ -109,7 +110,7 @@ def filter_request( if c > API_MAX: return too_many_requests(network, "too many request in API_WINDOW") - if cfg['botdetection.ip_limit.link_token']: + if settings['server']['public_instance'] or cfg['botdetection.ip_limit.link_token']: suspicious = link_token.is_suspicious(network, request, True) |