Page MenuHomePhabricator

Vagrant wikis should have mobile site setup when MobileFrontend role is enabled
Open, HighPublic


Each wiki should set the following:
$wgMobileUrlTemplate = '%h0.m.%h1.%h2.%h3.%h4';
$wgMFMobileHeader = 'X-Subdomain';

A visit to should send a X-Subdomain header
A visit to should not

With the above true, we will be more closely replicating production by running a separate mobile site.

Event Timeline

Jdlrobson raised the priority of this task from to Needs Triage.
Jdlrobson updated the task description. (Show Details)
Jdlrobson added a project: MediaWiki-Vagrant.
Jdlrobson added a subscriber: Jdlrobson.

In meantime this can be hacked in using this in your LocalSettings...

if ( strpos( $_SERVER['HTTP_HOST'], '.m.' ) ) {
$wgMFMobileHeader = "Host";
$wgMobileUrlTemplate = '%h0.m.%h1.%h2.%h3.%h4';

Something like this in an apache config should work to set the header:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^[^.]+\.m\.wiki\.wmftest\.net$
RewriteRule ^.*$ - [E=MOBILE]
RequestHeader set X-Subdomain 1 env=MOBILE

This would need template magic to work properly with a non-standard mediawiki::multiwiki::base_domain hiera setting (eg on a Labs host).

I spent the better part of an afternoon working on this. I've come to the conclusion that there is no nice or easy way to implement it in MediaWiki-Vagrant.

In the WMF production environment we do this Host header detection and munging in the Varnish layer. Varnish adds the X-Subdomain header and rewrites the Host header in the request that is eventually forwarded on to the MediaWiki backend host. A pure Apache setup is not capable of munging the Host header for the inflight request in this way.

bd808 triaged this task as Medium priority.Aug 19 2015, 11:49 PM
bd808 changed the task status from Open to Stalled.Aug 19 2015, 11:53 PM

Either needs Varnish or a different way to munge URLs for mobile IMO. If MobileFrontend supported path based munging (eg we could add the needed header easily and make things work with some Apache rewrite magic. This would also nicely sidestep the problem of differing hostname patterns for MediaWiki-Vagrant hosts in the Labs environment.

Why is this still stalled, and normal priority? The blocker was marked as resolved and it has two blocking entries, one of them an unbreak now, the other a high priority task.

Muedigkeit changed the task status from Stalled to Open.Dec 6 2015, 5:07 PM
Muedigkeit raised the priority of this task from Medium to Unbreak Now!.
Muedigkeit set Security to None.

Changed priority and status according to my own comment

bd808 lowered the priority of this task from Unbreak Now! to High.Dec 6 2015, 8:41 PM

Nothing in MediaWiki-Vagrant is UBN! priority. UBN! is for urgent production issues.

This task was made to block T100413, which is UBN!, as it was/is quite difficult for the Reading Web team to verify the behaviour of the proposed changes.

I'd say that this task tracks T100413 rather than blocks it.