From 1c2e0d7d9f7b7be6cb5cbf6e63645dc77793c0d7 Mon Sep 17 00:00:00 2001 From: Arya Kiran Date: Thu, 10 Aug 2023 15:45:11 +0530 Subject: [PATCH] block abusive UA --- privfrontends/templates/Caddyfile.j2 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/privfrontends/templates/Caddyfile.j2 b/privfrontends/templates/Caddyfile.j2 index 6da28c2..4e2c949 100644 --- a/privfrontends/templates/Caddyfile.j2 +++ b/privfrontends/templates/Caddyfile.j2 @@ -56,6 +56,11 @@ } } } + @badbots { + header "User-Agent" "Go-http-client/2.0" + } + respond @badbots "Access to this route denied" 403 + {% if inventory_hostname == 'in' %} import acmedns {% endif %} @@ -135,6 +140,10 @@ inv.{{ server_prefix }}.projectsegfau.lt inv.projectsegfau.lt invidious.projects } } } + @badbots { + header "User-Agent" "Go-http-client/2.0" + } + respond @badbots "Access to this route denied" 403 import torloc inv {% if server_prefix == 'in' %} import acmedns @@ -277,6 +286,10 @@ search.{{ server_prefix }}.projectsegfau.lt search.projectsegfau.lt s.psf.lt s.{ } } } + @badbots { + header "User-Agent" "Go-http-client/2.0" + } + respond @badbots "Access to this route denied" 403 {% if server_prefix == 'in' %} import acmedns {% endif %} @@ -310,6 +323,10 @@ pi.{{ server_prefix }}.psf.lt pi.psf.lt { } } } + @badbots { + header "User-Agent" "Go-http-client/2.0" + } + respond @badbots "Access to this route denied" 403 } {% endif %}