]> git.openstreetmap.org Git - chef.git/blob - cookbooks/mediawiki/templates/default/parsoid-settings.js.erb
Switch ramoth to use postgresql.org packages
[chef.git] / cookbooks / mediawiki / templates / default / parsoid-settings.js.erb
1 /*
2  * This is a sample configuration file.
3  *
4  * Copy this file to localsettings.js and edit that file to fit your needs.
5  *
6  * Also see:
7  * - api/server.js for more information about passing config files via
8  *   the commandline.
9  * - lib/mediawiki.ParsoidConfig.js all the properties
10  *   that you can configure here. Not all properties are
11  *   documented here.
12  */
13 'use strict';
14
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";
19
20         // The URL of your MediaWiki API endpoint.
21         //parsoidConfig.setMwApi({ prefix: 'localhost', uri: 'http://localhost/w/api.php' });
22
23         <% node[:mediawiki][:sites].keys.sort.each do |site_url| -%>
24   parsoidConfig.setMwApi({ uri: 'http://<%= site_url %>/w/api.php' });
25         <% end -%>
26
27         // To specify a proxy (or proxy headers) specific to this prefix (which
28         // overrides defaultAPIProxyURI) use:
29         /*
30         parsoidConfig.setMwApi({
31                 prefix: 'localhost',
32                 uri: 'http://localhost/w/api.php',
33                 // set `proxy` to `null` to override and force no proxying.
34                 proxy: {
35                         uri: 'http://my.proxy:1234/',
36                         headers: { 'X-Forwarded-Proto': 'https' } // headers are optional
37                 }
38         });
39         */
40
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;
45
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';
50
51         // Enable debug mode (prints extra debugging messages)
52         //parsoidConfig.debug = true;
53
54         // Use the PHP preprocessor to expand templates via the MW API (default true)
55         //parsoidConfig.usePHPPreProcessor = false;
56
57         // Use selective serialization (default false)
58         parsoidConfig.useSelser = true;
59
60         // Allow cross-domain requests to the API (default '*')
61         // Sets Access-Control-Allow-Origin header
62         // disable:
63         //parsoidConfig.allowCORS = false;
64         // restrict:
65         //parsoidConfig.allowCORS = 'some.domain.org';
66
67         // Set to true for using the default performance metrics reporting to statsd
68         // If true, provide the statsd host/port values
69         /*
70         parsoidConfig.useDefaultPerformanceTimer = true;
71         parsoidConfig.txstatsdHost = 'statsd.domain.org';
72         parsoidConfig.txstatsdPort = 8125;
73         */
74
75         // Alternatively, define performanceTimer as follows:
76         /*
77         parsoidConfig.performanceTimer = {
78                 timing: function(metricName, time) { }, // do-something-with-it
79                 count: function(metricName, value) { }, // do-something-with-it
80         };
81         */
82
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;
88
89         // Allow override of port/interface:
90         //parsoidConfig.serverPort = 8000;
91         //parsoidConfig.serverInterface = '127.0.0.1';
92
93         // The URL of your LintBridge API endpoint
94         //parsoidConfig.linterAPI = 'http://lintbridge.wmflabs.org/add';
95
96         // Require SSL certificates to be valid (default true)
97         // Set to false when using self-signed SSL certificates
98         //parsoidConfig.strictSSL = false;
99
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;
105
106         // Suppress some warnings from the Mediawiki API
107         // (defaults to suppressing warnings which the Parsoid team knows to
108         // be harmless)
109         //parsoidConfig.suppressMwApiWarnings = /annoying warning|other warning/;
110 };