BBlack has submitted this change and it was merged.

Change subject: text VCL: remove bits.wm.o stuff
......................................................................


text VCL: remove bits.wm.o stuff

Do not merge until after DNS is killed in I72d708d7

Bug: T107430
Change-Id: I076096ed56910c5d88dbb69828830c24726d1edc
---
M modules/role/manifests/cache/text.pp
M modules/varnish/templates/text-backend.inc.vcl.erb
M modules/varnish/templates/text-frontend.inc.vcl.erb
3 files changed, 11 insertions(+), 40 deletions(-)

Approvals:
  BBlack: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/role/manifests/cache/text.pp 
b/modules/role/manifests/cache/text.pp
index ec49e59..3a4ed76 100644
--- a/modules/role/manifests/cache/text.pp
+++ b/modules/role/manifests/cache/text.pp
@@ -1,7 +1,6 @@
 class role::cache::text(
     # static_host must serve MediaWiki (e.g. not wwwportal)
     $static_host = 'en.wikipedia.org',
-    $bits_domain = 'bits.wikimedia.org',
     $top_domain = 'org',
     $shortener_domain = 'w.wiki',
 ) {
@@ -100,7 +99,6 @@
     $common_vcl_config = {
         'purge_host_regex' => $::role::cache::base::purge_host_not_upload_re,
         'static_host'      => $static_host,
-        'bits_domain'      => $bits_domain,
         'top_domain'       => $top_domain,
         'shortener_domain' => $shortener_domain,
         'pass_random'      => true,
diff --git a/modules/varnish/templates/text-backend.inc.vcl.erb 
b/modules/varnish/templates/text-backend.inc.vcl.erb
index 69b56bc..4ffd136 100644
--- a/modules/varnish/templates/text-backend.inc.vcl.erb
+++ b/modules/varnish/templates/text-backend.inc.vcl.erb
@@ -50,31 +50,20 @@
 
 <% if @cache_route == 'direct' -%>
 sub misspass_mangle {
-       // BITS: legacy bits.wm.o domain support
-       if (req.http.host == "<%= @vcl_config.fetch('bits_domain') %>") {
-               // Transform backend url: /<sitename>/load.php -> /w/load.php
-               // Set host header for backend to <sitename>
-               if (req.url ~ 
"^/([a-zA-Z0-9-]+\.)?([a-zA-Z0-9-]+\.)?([a-zA-Z0-9-]+)\.<%= 
Regexp.escape(@vcl_config.fetch('top_domain')) %>/load\.php") {
-                       set bereq.http.host = regsub(req.url, 
"^/([^/]+)/(.*)$", "\1");
-                       set bereq.url = regsub(req.url, 
"^/([^/]+)/load\.php(.*)?", "/w/load.php\2");
-               }
+       // Mobile hostname mangling for MediaWiki
+       if (req.http.X-Subdomain) {
+               set bereq.http.host = req.http.x-dt-host;
        }
-       else {
-               // Mobile hostname mangling for MediaWiki
-               if (req.http.X-Subdomain) {
-                       set bereq.http.host = req.http.x-dt-host;
-               }
 
-               // RB request mangling
-               if (req.url ~ "^/api/rest_v1/") {
-                       set bereq.url = "/" + req.http.host + regsub(req.url, 
"^/api/rest_v1/", "/v1/");
-               }
+       // RB request mangling
+       if (req.url ~ "^/api/rest_v1/") {
+               set bereq.url = "/" + req.http.host + regsub(req.url, 
"^/api/rest_v1/", "/v1/");
+       }
 
-               // Redirect url shortener w.wiki urls to meta (T133485)
-               if (req.http.host == "<%= @vcl_config.fetch('shortener_domain') 
%>" && req.url != "/") {
-                       set bereq.http.host = "meta.wikimedia.<%= 
@vcl_config.fetch('top_domain') %>";
-                       set bereq.url = "/wiki/Special:UrlRedirector" + req.url;
-               }
+       // Redirect url shortener w.wiki urls to meta (T133485)
+       if (req.http.host == "<%= @vcl_config.fetch('shortener_domain') %>" && 
req.url != "/") {
+               set bereq.http.host = "meta.wikimedia.<%= 
@vcl_config.fetch('top_domain') %>";
+               set bereq.url = "/wiki/Special:UrlRedirector" + req.url;
        }
 }
 <% else -%>
diff --git a/modules/varnish/templates/text-frontend.inc.vcl.erb 
b/modules/varnish/templates/text-frontend.inc.vcl.erb
index 1bdb21d..13bc835 100644
--- a/modules/varnish/templates/text-frontend.inc.vcl.erb
+++ b/modules/varnish/templates/text-frontend.inc.vcl.erb
@@ -143,14 +143,6 @@
                <%= error_synth(741, "Buggy request, please report at 
https://phabricator.wikimedia.org/T141786";) -%>
        }
 
-       // BITS: legacy bits.wm.o domain support
-       if (req.http.host == "<%= @vcl_config.fetch('bits_domain') %>") {
-               if (req.url ~ "^/event\.gif") {
-                       error 204;
-               }
-               return (lookup);
-       }
-
        call mobile_redirect;
 
        # normalize all /static to the same hostname for caching
@@ -288,14 +280,6 @@
 }
 
 sub cluster_fe_err_synth {
-       // BITS: legacy bits.wm.o domain support
-       if (req.http.host == "<%= @vcl_config.fetch('bits_domain') %>") {
-               if (obj.status == 204) {
-                       set obj.http.Connection = "keep-alive";
-                       return (deliver);
-               }
-       }
-
        // Support mobile redirects
        if (obj.status == 666) {
                set obj.http.Location = req.http.Location;

-- 
To view, visit https://gerrit.wikimedia.org/r/305535
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I076096ed56910c5d88dbb69828830c24726d1edc
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BBlack <[email protected]>
Gerrit-Reviewer: BBlack <[email protected]>
Gerrit-Reviewer: Ema <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to