mirror of
https://github.com/searxng/searxng.git
synced 2025-08-03 02:22:22 +02:00
[enh] introduce private engines
This PR adds a new setting to engines named `tokens`. It expects a list of tokens which lets searx validate if the request should be accepted or not.
This commit is contained in:
parent
f9c7a678d2
commit
99435381a8
10 changed files with 161 additions and 28 deletions
|
@ -407,7 +407,7 @@ def get_search_query_from_webapp(preferences, form):
|
|||
|
||||
return (SearchQuery(query, query_engines, query_categories,
|
||||
query_lang, query_safesearch, query_pageno,
|
||||
query_time_range, query_timeout),
|
||||
query_time_range, query_timeout, preferences),
|
||||
raw_text_query)
|
||||
|
||||
|
||||
|
@ -459,6 +459,9 @@ class Search(object):
|
|||
|
||||
engine = engines[selected_engine['name']]
|
||||
|
||||
if not search_query.preferences.validate_token(engine):
|
||||
continue
|
||||
|
||||
# skip suspended engines
|
||||
if engine.suspend_end_time >= time():
|
||||
logger.debug('Engine currently suspended: %s', selected_engine['name'])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue