2  * This is a sample configuration file.
 
   4  * Copy this file to localsettings.js and edit that file to fit your needs.
 
   7  * - api/server.js for more information about passing config files via
 
   9  * - lib/mediawiki.ParsoidConfig.js all the properties
 
  10  *   that you can configure here. Not all properties are
 
  15 exports.setup = function(parsoidConfig) {
 
  16         // Set your own user-agent string
 
  17         // Otherwise, defaults to "Parsoid/<current-version-defined-in-package.json>"
 
  18         //parsoidConfig.userAgent = "My-User-Agent-String";
 
  20         // The URL of your MediaWiki API endpoint.
 
  21         //parsoidConfig.setMwApi({ prefix: 'localhost', uri: 'http://localhost/w/api.php' });
 
  23         <% node[:mediawiki][:sites].keys.sort.each do |site_url| -%>
 
  24   parsoidConfig.setMwApi({ uri: 'http://<%= site_url %>/w/api.php' });
 
  27         // To specify a proxy (or proxy headers) specific to this prefix (which
 
  28         // overrides defaultAPIProxyURI) use:
 
  30         parsoidConfig.setMwApi({
 
  32                 uri: 'http://localhost/w/api.php',
 
  33                 // set `proxy` to `null` to override and force no proxying.
 
  35                         uri: 'http://my.proxy:1234/',
 
  36                         headers: { 'X-Forwarded-Proto': 'https' } // headers are optional
 
  41         // We pre-define wikipedias as 'enwiki', 'dewiki' etc. Similarly
 
  42         // for other projects: 'enwiktionary', 'enwikiquote', 'enwikibooks',
 
  43         // 'enwikivoyage' etc. (default true)
 
  44         //parsoidConfig.loadWMF = false;
 
  46         // A default proxy to connect to the API endpoints.
 
  47         // Default: undefined (no proxying).
 
  48         // Overridden by per-wiki proxy config in setMwApi.
 
  49         //parsoidConfig.defaultAPIProxyURI = 'http://proxy.example.org:8080';
 
  51         // Enable debug mode (prints extra debugging messages)
 
  52         //parsoidConfig.debug = true;
 
  54         // Use the PHP preprocessor to expand templates via the MW API (default true)
 
  55         //parsoidConfig.usePHPPreProcessor = false;
 
  57         // Use selective serialization (default false)
 
  58         parsoidConfig.useSelser = true;
 
  60         // Allow cross-domain requests to the API (default '*')
 
  61         // Sets Access-Control-Allow-Origin header
 
  63         //parsoidConfig.allowCORS = false;
 
  65         //parsoidConfig.allowCORS = 'some.domain.org';
 
  67         // Set to true for using the default performance metrics reporting to statsd
 
  68         // If true, provide the statsd host/port values
 
  70         parsoidConfig.useDefaultPerformanceTimer = true;
 
  71         parsoidConfig.txstatsdHost = 'statsd.domain.org';
 
  72         parsoidConfig.txstatsdPort = 8125;
 
  75         // Alternatively, define performanceTimer as follows:
 
  77         parsoidConfig.performanceTimer = {
 
  78                 timing: function(metricName, time) { }, // do-something-with-it
 
  79                 count: function(metricName, value) { }, // do-something-with-it
 
  83         // How often should we emit a heap sample? Time in ms.
 
  84         // This setting is only relevant if you have enabled
 
  85         // performance monitoring either via the default metrics
 
  86         // OR by defining your own performanceTimer properties
 
  87         //parsoidConfig.heapUsageSampleInterval = 5 * 60 * 1000;
 
  89         // Allow override of port/interface:
 
  90         //parsoidConfig.serverPort = 8000;
 
  91         //parsoidConfig.serverInterface = '127.0.0.1';
 
  93         // The URL of your LintBridge API endpoint
 
  94         //parsoidConfig.linterAPI = 'http://lintbridge.wmflabs.org/add';
 
  96         // Require SSL certificates to be valid (default true)
 
  97         // Set to false when using self-signed SSL certificates
 
  98         //parsoidConfig.strictSSL = false;
 
 100         // Use a different server for CSS style modules.
 
 101         // Set to true to use bits.wikimedia.org, or to a string with the URI.
 
 102         // Leaving it undefined (the default) will use the same URI as the MW API,
 
 103         // changing api.php for load.php.
 
 104         //parsoidConfig.modulesLoadURI = true;
 
 106         // Suppress some warnings from the Mediawiki API
 
 107         // (defaults to suppressing warnings which the Parsoid team knows to
 
 109         //parsoidConfig.suppressMwApiWarnings = /annoying warning|other warning/;