From d451fddf490c82e216dd27b97848c84f7315caa2 Mon Sep 17 00:00:00 2001 From: neon_arch Date: Sat, 2 Sep 2023 20:18:09 +0300 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20add=20new=20config=20option?= =?UTF-8?q?=20to=20configure=20rate=20limiting=20middleware=20(#203)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- websurfx/config.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/websurfx/config.lua b/websurfx/config.lua index 4f2633c..3335ae8 100644 --- a/websurfx/config.lua +++ b/websurfx/config.lua @@ -10,6 +10,10 @@ production_use = false -- whether to use production mode or not (in other words -- if production_use is set to true -- There will be a random delay before sending the request to the search engines, this is to prevent DDoSing the upstream search engines from a large number of simultaneous requests. request_timeout = 30 -- timeout for the search requests sent to the upstream search engines to be fetched (value in seconds). +rate_limiter = { + number_of_requests = 20, -- The number of request that are allowed within a provided time limit. + time_limit = 3, -- The time limit in which the quantity of requests that should be accepted. +} -- ### Website ### -- The different colorschemes provided are: @@ -34,4 +38,7 @@ theme = "simple" -- the theme name which should be used for the website redis_url = "redis://127.0.0.1:8082" -- redis connection url address on which the client should connect on. -- ### Search Engines ### -upstream_search_engines = { DuckDuckGo = true, Searx = false } -- select the upstream search engines from which the results should be fetched. +upstream_search_engines = { + DuckDuckGo = true, + Searx = false, +} -- select the upstream search engines from which the results should be fetched.