Alex Monk has uploaded a new change for review.
https://gerrit.wikimedia.org/r/249182
Change subject: Revert "Revert "dynamicproxy: Make blocked user agents
configurable""
......................................................................
Revert "Revert "dynamicproxy: Make blocked user agents configurable""
This reverts commit f64ff16ed666ccef2e8b14d38c58563922bf4464.
Change-Id: I5a2999abb687174b70187c0999a5265840517899
---
M modules/dynamicproxy/manifests/init.pp
M modules/dynamicproxy/templates/urlproxy.conf
2 files changed, 3 insertions(+), 3 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/operations/puppet
refs/changes/82/249182/1
diff --git a/modules/dynamicproxy/manifests/init.pp
b/modules/dynamicproxy/manifests/init.pp
index 527f69d..9bbb30c 100644
--- a/modules/dynamicproxy/manifests/init.pp
+++ b/modules/dynamicproxy/manifests/init.pp
@@ -31,6 +31,7 @@
$error_description = "Our servers are currently experiencing a
technical problem. This is probably temporary and should be fixed soon. Please
try again later.",
$error_details = undef,
$web_domain = undef,
+ $blocked_user_agent_regex = "TweetmemeBot", # T73120 - misbehaving crawler
) {
if $ssl_certificate_name != false and $ssl_settings == undef {
fail('ssl_certificate_nme set but ssl_settings not set')
diff --git a/modules/dynamicproxy/templates/urlproxy.conf
b/modules/dynamicproxy/templates/urlproxy.conf
index 7f99639..de69767 100644
--- a/modules/dynamicproxy/templates/urlproxy.conf
+++ b/modules/dynamicproxy/templates/urlproxy.conf
@@ -72,9 +72,8 @@
return 403 "Requests must have a user agent";
}
- # Block crawlers that do not behave well
- if ($http_user_agent ~* "TweetmemeBot") { # T73120
- return 403;
+ if ($http_user_agent ~* "<% @blocked_user_agent_regex -%>") {
+ return 403 "Blocked user agent";
}
include uwsgi_params;
--
To view, visit https://gerrit.wikimedia.org/r/249182
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5a2999abb687174b70187c0999a5265840517899
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alex Monk <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits