Dr0ptp4kt has uploaded a new change for review.
https://gerrit.wikimedia.org/r/103385
Change subject: Updates to documentation. We'll probably move this to
MediaWiki.org.
......................................................................
Updates to documentation. We'll probably move this to MediaWiki.org.
Change-Id: Ib156c2f7050e6b96266cc08b146a859454e16821
---
M README
1 file changed, 46 insertions(+), 22 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ZeroRatedMobileAccess
refs/changes/85/103385/1
diff --git a/README b/README
index a0be4fa..2f4f73a 100644
--- a/README
+++ b/README
@@ -28,9 +28,8 @@
+---------------------+
The ZeroRatedMobileAccess extension to MediaWiki detects a carrier based on an
-"X-CS" HTTP header injected by our Varnish proxy servers. This is done in
-Varnish with netmapper for performance, so that the majority of traffic never
-goes through any Zero-specific processing in slower origin server PHP code.
+"X-CS" and "X-Subdomain" HTTP header injected by our Varnish proxy servers.
+Th X-CS header is injected in Varnish with netmapper for performance.
== Varnish configuration ==
@@ -50,17 +49,16 @@
An X-CS header with the carrier MCC/MNC code and an X-Analytics header
key/value pair
-with the same value (eg X-Analytics: zero=502-13) are set.
-
-Note that for testing convenience, access from the Wikimedia offices in San
Francisco
-gets marked as a faux carrier.
+with the same value (eg X-Analytics: zero=502-13) are set. Additionally, the
X-Subdomain
+header is set - an "mdot" subdomain is one such as en.m.wikipedia.org and a
"zerodot"
+one ru.zero.wikipedia.org - the X-Subdomain value is either "M" or "ZERO".
== ZeroRatedMobileAccess configuration ==
ZeroRatedMobileAccess normally enables itself only if the MediaWiki site
configuration
-lists the site as 'wikipedia'; other Wikimedia sites do not participate in the
Zero
-program.
+lists the site as 'wikipedia'; as of 23-December-2013, other Wikimedia sites
do not
+have banners and URL rewriting turned on for the Wikipedia Zero program.
To test on your own instance edit LocalSettings.php and add:
@@ -69,7 +67,8 @@
$wgMFAutodetectMobileView = true; // autodetects mobile User-Agent
require_once("$IP/extensions/ZeroRatedMobileAccess/ZeroRatedMobileAccess.php");
$wgEnableZeroRatedMobileAccessTesting = true;
- $wgZeroRatedMobileAccessApiUri = 'http://127.0.0.1/w/api.php';
+ // $wgZeroRatedMobileAccessApiUri = 'http://127.0.0.1/w/api.php';
+ $wgZeroRatedMobileAccessApiUri = 'http://meta.wikimedia.org/w/api.php'; //
to read from prod
$wgZeroRatedMobileAccessDisableCache = true;
$wgZeroRatedMobileAccessEnableZeroConfigPages = true;
$wgRightsText = 'Sweet license';
@@ -77,6 +76,11 @@
Notice that the MobileFront extension needs to be installed, as does the
ZeroRatedMobileAccess extension.
+
+Also notice that the $wgZeroRatedMobileAccessApiUri points at
meta.wikimedia.org.
+So please don't run high velocity checks. If you're going to run high velocity
+checks, change the URI to the localhost 127.0.0.1 one, and ensure that you have
+setup legitimate Zero:-namespaced carrier configurations of your own.
The CodeEditor extension is also highly recommended but not required.
CodeEditor is used for the Zero Configuration pages to make JSON more readable.
@@ -88,6 +92,22 @@
http[s]://<host>[:port]/wiki/Special:UserRights is used for adding or removing
perms.
+Speaking of rights, to emulate the Wikimedia production configuration, you'll
want to
+download and turn on the FlaggedRevs extension locally.
+
+ require_once("$IP/extensions/FlaggedRevs/FlaggedRevs.php");
+ $wgFlaggedRevsNamespaces = array ( 480 );
+ $wgFlaggedRevsTags = array(
+ 'safeness' => array( 'levels' => 1, 'quality' => 2, 'pristine' => 3 ),
+ );
+ $wgFlagRestrictions = array( 'safeness' => array( 'review' => 1 ) );
+ $wgFlaggedRevsAutopromote = false;
+
+ unset( $wgGroupPermissions['editor'] ); // no Editor group
+ unset( $wgGroupPermissions['reviewer'] ); // no Reviewer group
+ $wgGroupPermissions['zeroadmin']['review'] = true;
+ $wgGroupPermissions['zeroadmin']['autoreview'] = true;
+
In the Wikimedia production environment, the
$wgZeroRatedMobileAccessEnableZeroConfigPage
variable should be set to true only on Meta-Wiki, as it controls whether a
page save hook
will be set on Zero: namespace configuration entry saves.
@@ -98,33 +118,37 @@
As noted above, on a local test wiki you will need to enable several settings.
-You can manually add X-CS headers via browser addons such as:
+You will want to manually add X-CS headers via browser addons such as:
* 'Modify Headers' add-on for Firefox
* 'ModHeaders' extension for Chrome
-You can change your User-Agent string via broaswer addons such as:
+Be sure to set the following headers when testing against your local instance:
+
+* X-CS (should match an article name in the Zero: namespace; e.g., "-TEST")
+* X-Subdomain (set to "M" or "ZERO" to spoof whether you're on "mdot" or
"zerodot")
+
+
+You can change your User-Agent string via brower addons such as:
* 'Modify Headers' add-on for Firefox
* 'Default User Agent' add-on for Firefox
* 'ModHeaders' extension for Chrome
-Note that if testing in production, any such custom headers will be
overwritten by the
+Set your User-Agent to a value like "android" so that mobile detection works.
+
+Note that if testing in production, most custom headers will be overwritten by
the
Varnish server if you're coming from an IP block that's recognized for
Wikipedia Zero -- this
includes the Wikimedia San Francisco office. D'oh! This shouldn't happen with
a local test
server, though
+== Local Configuration Blobs ==
-You will need to create a Zero: namespaced configuration entry to match the
X-CS header
+For people not interested in editing configurations, just use the API URL
supplied
+above. But if you want to be able to edit configurations locally for testing
purposes,
+you will need to create a Zero:-namespaced configuration entry to match the
X-CS header
that you add using 'Modify Headers'.
For example, go to
http://127.0.0.1:8080/w/index.php?title=Zero:999-88&action=edit
-and populate the article with the data contained in this repo's
SampleConfigPage.json.
-Note that when you copy and paste the data from SampleConfigPage.json into the
editor
-you may be presented with some errors. This is by design to confirm that data
validation
-works upon saving of Zero: namespaced content. The data requires some
cleaning: make
-'showLangs' have only one item, and make sure that 'ips' contains the CIDR
block of
-computers you will use when connecting with the altered X-CS header. IP
addresses in CIDR
-blocks in the JSON configuration entries must be non-local and non-reserved.
grep for
-FILTER_VALIDATE_IP in the code for the implementation.
+and populate the article with the data from
https://meta.wikimedia.org/wiki/Zero:-TEST.
== Testing specific modes ==
--
To view, visit https://gerrit.wikimedia.org/r/103385
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib156c2f7050e6b96266cc08b146a859454e16821
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ZeroRatedMobileAccess
Gerrit-Branch: master
Gerrit-Owner: Dr0ptp4kt <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits