Zero

From Wikitech
This page contains historical information. It may be outdated or unreliable.

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. Provides an API for zero configuration content for non-web consumers (e.g., the mobile apps).
  • 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 Wikipedias) 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/ 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.