From 788a0aeb382c934a744147a4be73d29adb856cf2 Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Mon, 9 Jun 2025 17:26:32 +0100 Subject: [PATCH] git: block fake scraper from additional URLs --- cookbooks/git/templates/default/apache.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cookbooks/git/templates/default/apache.erb b/cookbooks/git/templates/default/apache.erb index d58e3b9bc..843503717 100644 --- a/cookbooks/git/templates/default/apache.erb +++ b/cookbooks/git/templates/default/apache.erb @@ -69,7 +69,9 @@ # Prevent abuse by an anonymous AI bot RewriteCond %{REQUEST_METHOD} ^(GET|HEAD)$ - RewriteCond %{REQUEST_URI} ^/[^/]+\.git/blobdiff + RewriteCond %{REQUEST_URI} ^/[^/]+\.git/blob [OR] + RewriteCond %{REQUEST_URI} ^/[^/]+\.git/history [OR] + RewriteCond %{REQUEST_URI} ^/[^/]+\.git/tree RewriteCond %{HTTP_REFERER} ^-?$ RewriteCond %{HTTP_USER_AGENT} ((CriOS|Chrome)/[1-9][0-9]?\.0\.|Chrome/100\.0\.|Chrome/122\.0\.0\.0|(Firefox|FxiOS)/[1-6]?[0-9]\.|MSIE\ [5-9]\.0|Opera/[8-9]\.|Windows\ NT\ [3-5]\.|Version/[3-5]\.[0-1]) [NC] RewriteRule ^ - [R=429,L] -- 2.39.5