summaryrefslogtreecommitdiff
path: root/docs/admin
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2020-06-18 18:31:46 +0200
committerMarkus Heiser <markus.heiser@darmarit.de>2020-06-18 18:31:46 +0200
commit6ff20cef7385d6827042f00d295f51bbc213afab (patch)
treea0d1792d187acd442549467f4b3a701dc175a000 /docs/admin
parentdda4a46f8ede4d4f035143cac864769873ad0236 (diff)
downloadsearxng-6ff20cef7385d6827042f00d295f51bbc213afab.tar.gz
searxng-6ff20cef7385d6827042f00d295f51bbc213afab.zip
[fix] indentation of filtron's rules (json)
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'docs/admin')
-rw-r--r--docs/admin/filtron.rst179
1 files changed, 85 insertions, 94 deletions
diff --git a/docs/admin/filtron.rst b/docs/admin/filtron.rst
index 8bf641649..93e430b1f 100644
--- a/docs/admin/filtron.rst
+++ b/docs/admin/filtron.rst
@@ -57,100 +57,91 @@ of:
.. code:: json
- [
- { "name": "search request",
- "filters": [
- "Param:q",
- "Path=^(/|/search)$"
- ],
- "interval": "<time-interval-in-sec (int)>",
- "limit": "<max-request-number-in-interval (int)>",
- "subrules": [
- {
- "name": "roboagent limit",
- "interval": "<time-interval-in-sec (int)>",
- "limit": "<max-request-number-in-interval (int)>",
- "filters": [
- "Header:User-Agent=(curl|cURL|Wget|python-requests|Scrapy|FeedFetcher|Go-http-client)"
- ],
- "actions": [
- { "name": "log"},
- { "name": "block",
- "params": {
- "message": "Rate limit exceeded"
- }
- }
- ]
- },
- {
- "name": "botlimit",
- "limit": 0,
- "stop": true,
- "filters": [
- "Header:User-Agent=(Googlebot|bingbot|Baiduspider|yacybot|YandexMobileBot|YandexBot|Yahoo! Slurp|MJ12bot|AhrefsBot|archive.org_bot|msnbot|MJ12bot|SeznamBot|linkdexbot|Netvibes|SMTBot|zgrab|James BOT)"
- ],
- "actions": [
- { "name": "log"},
- { "name": "block",
- "params": {
- "message": "Rate limit exceeded"
- }
- }
- ]
- },
- {
- "name": "IP limit",
- "interval": "<time-interval-in-sec (int)>",
- "limit": "<max-request-number-in-interval (int)>",
- "stop": true,
- "aggregations": [
- "Header:X-Forwarded-For"
- ],
- "actions": [
- { "name": "log"},
- { "name": "block",
- "params": {
- "message": "Rate limit exceeded"
- }
- }
- ]
- },
- {
- "name": "rss/json limit",
- "interval": "<time-interval-in-sec (int)>",
- "limit": "<max-request-number-in-interval (int)>",
- "stop": true,
- "filters": [
- "Param:format=(csv|json|rss)"
- ],
- "actions": [
- { "name": "log"},
- { "name": "block",
- "params": {
- "message": "Rate limit exceeded"
- }
- }
- ]
- },
- {
- "name": "useragent limit",
- "interval": "<time-interval-in-sec (int)>",
- "limit": "<max-request-number-in-interval (int)>",
- "aggregations": [
- "Header:User-Agent"
- ],
- "actions": [
- { "name": "log"},
- { "name": "block",
- "params": {
- "message": "Rate limit exceeded"
- }
- }
- ]
- }
- ]
- }
- ]
+ [
+ {
+ "name": "search request",
+ "filters": [
+ "Param:q",
+ "Path=^(/|/search)$"
+ ],
+ "interval": "<time-interval-in-sec (int)>"
+ "limit": "<max-request-number-in-interval (int)>",
+ "subrules": [
+ {
+ "name": "missing Accept-Language",
+ "filters": ["!Header:Accept-Language"],
+ "limit": "<max-request-number-in-interval (int)>",
+ "stop": true,
+ "actions": [
+ {"name":"log"},
+ {"name": "block",
+ "params": {"message": "Rate limit exceeded"}}
+ ]
+ },
+ {
+ "name": "suspiciously Connection=close header",
+ "filters": ["Header:Connection=close"],
+ "limit": "<max-request-number-in-interval (int)>",
+ "stop": true,
+ "actions": [
+ {"name":"log"},
+ {"name": "block",
+ "params": {"message": "Rate limit exceeded"}}
+ ]
+ },
+ {
+ "name": "IP limit",
+ "interval": "<time-interval-in-sec (int)>"
+ "limit": "<max-request-number-in-interval (int)>",
+ "stop": true,
+ "aggregations": [
+ "Header:X-Forwarded-For"
+ ],
+ "actions": [
+ { "name": "log"},
+ { "name": "block",
+ "params": {
+ "message": "Rate limit exceeded"
+ }
+ }
+ ]
+ },
+ {
+ "name": "rss/json limit",
+ "filters": [
+ "Param:format=(csv|json|rss)"
+ ],
+ "interval": "<time-interval-in-sec (int)>"
+ "limit": "<max-request-number-in-interval (int)>",
+ "stop": true,
+ "actions": [
+ { "name": "log"},
+ { "name": "block",
+ "params": {
+ "message": "Rate limit exceeded"
+ }
+ }
+ ]
+ },
+ {
+ "name": "useragent limit",
+ "interval": "<time-interval-in-sec (int)>"
+ "limit": "<max-request-number-in-interval (int)>",
+ "aggregations": [
+ "Header:User-Agent"
+ ],
+ "actions": [
+ { "name": "log"},
+ { "name": "block",
+ "params": {
+ "message": "Rate limit exceeded"
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
.. _filtron route request: