diff options
author | Jean Lucas | 2018-07-09 23:06:42 -0400 |
---|---|---|
committer | Jean Lucas | 2018-07-09 23:06:42 -0400 |
commit | dcacdf0ad67772767527fdf3e9103fa5a20906a2 (patch) | |
tree | 9f5c4df26685e210f4562fbac8414f1a255bc07c | |
parent | d031b1c0ae8c685f8173ba412afdbd4b657ab28a (diff) | |
download | aur-dcacdf0ad67772767527fdf3e9103fa5a20906a2.tar.gz |
Set to static commit, add rules.json
-rw-r--r-- | .SRCINFO | 10 | ||||
-rw-r--r-- | PKGBUILD | 11 | ||||
-rw-r--r-- | rules.json | 62 |
3 files changed, 75 insertions, 8 deletions
@@ -1,9 +1,9 @@ # Generated by mksrcinfo v8 -# Mon Jul 2 23:04:42 UTC 2018 +# Tue Jul 10 03:05:49 UTC 2018 pkgbase = filtron - pkgdesc = Filtering reverse HTTP proxy + pkgdesc = Filtering reverse-HTTP proxy pkgver = 0+51+93f8b22 - pkgrel = 1 + pkgrel = 2 url = https://github.com/asciimoo/filtron arch = any license = AGPL3 @@ -14,9 +14,11 @@ pkgbase = filtron optdepends = morty: Privacy-aware web content sanitizer proxy-as-a-service optdepends = morty-git: Privacy-aware web content sanitizer proxy-as-a-service (Git) conflicts = filtron-git - source = git+https://github.com/asciimoo/filtron + source = git+https://github.com/asciimoo/filtron#commit=93f8b22bc42fabb57d8a4c0ce7b7de706e6034b6 + source = rules.json source = filtron.service sha512sums = SKIP + sha512sums = 2668deb746ad361ebe32ea46b361f69c0eaf591b7faebb10dd2de11e114645c5fd726d45bb6aebec5b5bcef8dcad51d4b681a5e4b1ec83f918de4929aa237285 sha512sums = 0b7bbe55b3fd89d589e5662699f93d7aaf3c1d77d29be9cc568f8430e4a2491ba4920ca153f4d887a29da1f51670ec06346809cc5d1f373af540e252feccc799 pkgname = filtron @@ -2,10 +2,10 @@ pkgname=filtron pkgver=0+51+93f8b22 -pkgrel=1 -pkgdesc='Filtering reverse HTTP proxy' +pkgrel=2 +pkgdesc='Filtering reverse-HTTP proxy' arch=(any) -url='https://github.com/asciimoo/filtron' +url=https://github.com/asciimoo/filtron license=(AGPL3) conflicts=(filtron-git) makedepends=(git go) @@ -13,9 +13,11 @@ optdepends=('searx: A privacy-respecting, hackable metasearch engine' 'searx-git: A privacy-respecting, hackable metasearch engine (Git)' 'morty: Privacy-aware web content sanitizer proxy-as-a-service' 'morty-git: Privacy-aware web content sanitizer proxy-as-a-service (Git)') -source=(git+https://github.com/asciimoo/filtron +source=(git+$url#commit=93f8b22bc42fabb57d8a4c0ce7b7de706e6034b6 + rules.json filtron.service) sha512sums=(SKIP + 2668deb746ad361ebe32ea46b361f69c0eaf591b7faebb10dd2de11e114645c5fd726d45bb6aebec5b5bcef8dcad51d4b681a5e4b1ec83f918de4929aa237285 0b7bbe55b3fd89d589e5662699f93d7aaf3c1d77d29be9cc568f8430e4a2491ba4920ca153f4d887a29da1f51670ec06346809cc5d1f373af540e252feccc799) pkgver() { @@ -31,6 +33,7 @@ build() { package() { cd filtron install -D bin/filtron $pkgdir/usr/bin/filtron + install -Dm 644 ../rules.json $pkgdir/etc/filtron/rules.json install -Dm 644 ../filtron.service $pkgdir/usr/lib/systemd/system/filtron.service install -Dm 644 LICENSE $pkgdir/usr/share/licenses/filtron/LICENSE } diff --git a/rules.json b/rules.json new file mode 100644 index 000000000000..487b61c9ef48 --- /dev/null +++ b/rules.json @@ -0,0 +1,62 @@ +[ + { + "name": "Search request", + "filters": ["Param:q", "Path=^(/|/search)$"], + "interval": 5, + "limit": 1, + "subrules": [ + { + "name": "Robo-agent limit", + "interval": 5, + "limit": 1, + "filters": ["Header:User-Agent=(curl|cURL|Wget|python-requests|Scrapy|FeedFetcher|Go-http-client)"], + "actions": [ + { "name": "block", + "params": { "message": "Rate limit exceeded" } } + ] + }, + { + "name": "Bot limit", + "limit": 0, + "stop": true, + "filters": ["Header:User-Agent=(Googlebot|bingbot|Baiduspider|yacybot|YandexMobileBot|YandexBot|Yahoo! Slurp|MJ11bot|AhrefsBot|archive.org_bot|msnbot|MJ11bot|SeznamBot|linkdexbot|Netvibes|SMTBot|zgrab|James BOT)"], + "actions": [ + { "name": "block", + "params": { "message": "Rate limit exceeded" } } + ] + }, + { + "name": "IP limit", + "interval": 5, + "limit": 1, + "stop": true, + "aggregations": ["Header:X-Forwarded-For"], + "actions": [ + { "name": "block", + "params": { "message": "Rate limit exceeded" } } + ] + }, + { + "name": "RSS/JSON limit", + "interval": 5, + "limit": 1, + "stop": true, + "filters": ["Param:format=(csv|json|rss)"], + "actions": [ + { "name": "block", + "params": { "message": "Rate limit exceeded" } } + ] + }, + { + "name": "User-agent limit", + "interval": 5, + "limit": 1, + "aggregations": ["Header:User-Agent"], + "actions": [ + { "name": "block", + "params": { "message": "Rate limit exceeded" } } + ] + } + ] + } +] |