aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorDan Fandrich <danf@mageia.org>2025-05-23 17:41:33 -0700
committerDan Fandrich <danf@mageia.org>2025-05-23 18:38:09 -0700
commitde3c56d3dff7c23adf9e6f1b6ebd141dcfb4efdc (patch)
tree1c649f6b36385b1a6dfa0b6d33820d398adce87e /modules
parente4a4e66b66e3a3dcf844475fc8f01293b655e537 (diff)
downloadpuppet-de3c56d3dff7c23adf9e6f1b6ebd141dcfb4efdc.tar
puppet-de3c56d3dff7c23adf9e6f1b6ebd141dcfb4efdc.tar.gz
puppet-de3c56d3dff7c23adf9e6f1b6ebd141dcfb4efdc.tar.bz2
puppet-de3c56d3dff7c23adf9e6f1b6ebd141dcfb4efdc.tar.xz
puppet-de3c56d3dff7c23adf9e6f1b6ebd141dcfb4efdc.zip
Reduce the number of SVN paths considered too expensive
These two don't seem to contribute much to the load seen when robots start hitting svnweb that hard. Also, remove a separate query block that seems to not help much (and which was hard to find in a different location in the file).
Diffstat (limited to 'modules')
-rw-r--r--modules/apache/templates/vhost_fcgid.conf7
1 files changed, 3 insertions, 4 deletions
diff --git a/modules/apache/templates/vhost_fcgid.conf b/modules/apache/templates/vhost_fcgid.conf
index 57eba1d5..75ac9300 100644
--- a/modules/apache/templates/vhost_fcgid.conf
+++ b/modules/apache/templates/vhost_fcgid.conf
@@ -17,7 +17,9 @@ RewriteRule . - [R=403,L]
# Block expensive SVN operations on all common robots ("spider" covers a
# bunch). "Expensive" is considered to be most operations other than showing a
# directory or downloading a specific version of a file.
-RewriteCond %{QUERY_STRING} pathrev=|annotate=|view=log|r1=
+# Note: eliminating view=log and annotate= doesn't make much difference to the
+# CPU load when robots are hitting the server in real world operation.
+RewriteCond %{QUERY_STRING} pathrev=|r1=
RewriteCond %{HTTP_USER_AGENT} "Googlebot|GoogleOther|bingbot|Yahoo! Slurp|ClaudeBot|Amazonbot|YandexBot|SemrushBot|Barkrowler|DataForSeoBot|PetalBot|facebookexternalhit|GPTBot|ImagesiftBot|spider|Spider|iPod|Trident|Presto"
RewriteRule . - [R=403,L]
@@ -26,7 +28,4 @@ RewriteRule . - [R=403,L]
RewriteCond expr "-R '47.76.0.0/14' || -R '47.80.0.0/14' || -R '47.208.0.0/16' || -R '47.238.0.0/16' || -R '8.210.0.0/16' || -R '8.218.0.0/16' || -R '188.239.0.0/18' || -R '166.108.192.0/18' || -R '124.243.160.0/19' || -R '101.46.0.0/20'"
RewriteRule . - [R=403,L]
-RewriteCond %{QUERY_STRING} "sortby=.*view=(log|patch)"
-RewriteRule . - [R=403,L]
-
ErrorDocument 403 "<html><body>Impolite robots are not allowed</body></html>"