mirror of
https://github.com/searxng/searxng.git
synced 2025-07-12 15:59:21 +02:00
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
This commit is contained in:
parent
1df4588279
commit
47721a3485
5 changed files with 14 additions and 4 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue