You are browsing a read-only backup copy of Wikitech. The live site can be found at wikitech.wikimedia.org

Zero

From Wikitech-static
Revision as of 00:51, 7 February 2017 by imported>Gergő Tisza
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

wmf:Wikipedia Zero is short for zero-rated access to some Wikimedia sites, available from certain mobile ISPs who have partnered with the WMF. Technical information is available at wmf:Wikipedia Zero/Development and mw:Wikipedia Zero.

Code involved

  • mw:Extension:ZeroBanner - shows landing page, banner explaining the zero-rating, and warnings if the user is about to navigate to non-zero-rated content
  • mw:Extension:ZeroPortal - uses JsonConfig to store and manage Zero-related configuration data
  • mw:Extension:JsonConfig - stores JSON data in wiki pages; can be configured to use another wiki as a remote (do for wiki pages what InstantCommons does for images). Used for non-Zero-related things as well.
  • netmapper - Varnish module that tags requests based on what IP range they come from
  • zerofetch.py - Puppet-hosted script that pulls configuration from a wiki that has JsonConfig

Partners sign up and manage IP range, messaging and other configuration via ZeroPortal (on zerowiki). zerofetch.py syncs the IP configuration to Varnish/netmapper which add an X-CS header to zero-rated requests. ZeroBanner (installed on all Wikimedia wikis) detects the header, fetches configuration via JsonConfig's remote repository feature from zerowiki and displays banners.

Testing changes

For local testing, see Zerobanner's README. For live testing:

1. Visit https://en.m.wikipedia.org/ (you probably need to use a real mobile phone?) and you are not getting zero-rating messages. 2. Do no-op config change on zerowiki's Zero:TEST1 page. Verify zerofetch ran successfully (how?) 3. Add your own IP to Zero:TEST1. Verify zerofetch ran successfully (how?) 4. Wait 15 minutes. 5. Visit https://en.m.wikipedia.org/ and verify getting zero-rating chrome.