2 # DO NOT EDIT - This file is being maintained by Chef
4 # Protect against web entry
5 if ( !defined( 'MEDIAWIKI' ) ) {
9 ## Uncomment this to disable output compression
10 # $wgDisableOutputCompression = true;
12 $wgSitename = '<%= @mediawiki[:sitename] %>';
13 $wgMetaNamespace = '<%= @mediawiki[:metanamespace] %>';
15 ## The URL base path to the directory containing the wiki;
16 ## defaults for all runtime URL paths are based off of this.
17 ## For more information on customizing the URLs
18 ## (like /w/index.php/Page_title to /wiki/Page_title) please see:
19 ## https://www.mediawiki.org/wiki/Manual:Short_URL
21 $wgArticlePath = '/wiki/$1';
22 $wgUsePathInfo = true;
23 $wgScriptExtension = ".php";
25 ## The protocol and server name to use in fully-qualified URLs
26 $wgServer = "//<%= @name %>";
27 $wgInternalServer = 'https://<%= @name %>';
28 $wgCanonicalServer = 'https://<%= @name %>';
30 $wgSecureLogin = true;
31 $wgDefaultUserOptions['prefershttps'] = 1;
32 $wgCookieSecure = true;
34 ## The relative URL path to the skins directory
35 $wgStylePath = "$wgScriptPath/skins";
37 ## The relative URL path to the logo. Make sure you change this from the default,
38 ## or else you'll overwrite your logo when you upgrade!
39 $wgLogo = "<%= @mediawiki[:logo] %>";
41 ## UPO means: this is also a user preference option
43 $wgEnableEmail = true;
44 $wgEnableUserEmail = true; # UPO
46 $wgEmergencyContact = "<%= @mediawiki[:email_contact] %>";
47 $wgPasswordSender = "<%= @mediawiki[:email_sender] %>";
48 $wgPasswordSenderName = "<%= @mediawiki[:email_sender_name] %>"; //Replaced by MediaWiki:Emailsender in v1.23.0
49 $wgNoReplyAddress = "<%= @mediawiki[:email_sender] %>";
51 $wgEnotifUserTalk = true; # UPO
52 $wgEnotifWatchlist = true; # UPO
53 $wgEmailAuthentication = true;
55 $wgEnotifUseJobQ = true;
58 "host" => "localhost",
59 "localhost" => "<%= node[:fqdn] %>",
62 "verify_peer_name" => false
69 $wgDBserver = "<%= @database_params[:host] %>";
70 $wgDBname = "<%= @database_params[:name] %>";
71 $wgDBuser = "<%= @database_params[:username] %>";
72 $wgDBpassword = "<%= @database_params[:password] %>";
74 # MySQL specific settings
77 # MySQL table options to use during installation or update
78 $wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=binary";
80 # Experimental charset support for MySQL 5.0.
83 ## Shared memory settings
84 $wgMainCacheType = CACHE_MEMCACHED;
85 $wgParserCacheType = CACHE_MEMCACHED;
86 $wgMessageCacheType = CACHE_MEMCACHED;
87 $wgSessionCacheType = CACHE_MEMCACHED;
88 $wgMemCachedServers = array('127.0.0.1:11211');
89 $wgSessionsInObjectCache = TRUE;
91 ## To enable image uploads, make sure the 'images' directory
92 ## is writable, then set this to true:
93 $wgEnableUploads = true;
94 $wgUseImageMagick = true;
95 $wgImageMagickConvertCommand = "/usr/bin/convert";
97 $wgGenerateThumbnailOnParse = false;
98 $wgMaxImageArea = 125000000;
99 $wgMaxShellMemory = 5524000;
100 $wgMaxShellFileSize = 819200;
101 $wgMaxShellTime = 360;
102 $wgMaxShellWallClockTime = 360;
104 # Allow some more upload extensions
105 $wgFileExtensions[] = 'pdf';
106 $wgFileExtensions[] = 'odt';
107 $wgFileExtensions[] = 'odp';
108 $wgFileExtensions[] = 'ods';
109 $wgFileExtensions[] = 'svg';
110 $wgFileExtensions[] = 'osm';
111 $wgFileExtensions[] = 'odg';
112 <% @mediawiki[:extra_file_extensions].each do |mw_extra_file_extension| -%>
113 $wgFileExtensions[] = '<%= mw_extra_file_extension %>';
116 # Add OSM XML file format per http://www.iana.org/assignments/media-types/media-types.xhtml
117 # Shout out to Paul Norman for reserving this.
118 # Helps MimeMagic determine XML-based formats and chooses the correct MimeType
120 $wgXMLMimeTypes[] = array('osm' => 'application/vnd.openstreetmap.data+xml');
122 $wgTrustedMediaFormats[] = 'application/vnd.openstreetmap.data+xml';
124 $wgSVGConverters = array( 'rsvg' => '/usr/bin/rsvg-convert -w $width -h $height -o $output $input');
125 $wgSVGConverter = 'rsvg';
126 $wgSVGMaxSize = 2000;
128 ## If you use ImageMagick (or any other shell command) on a
129 ## Linux server, this will need to be set to the name of an
130 ## available UTF-8 locale
131 $wgShellLocale = "en_US.utf8";
133 ## If you want to use image uploads under safe mode,
134 ## create the directories images/archive, images/thumb and
135 ## images/temp, and make them all writable. Then uncomment
136 ## this, if it's not already uncommented:
137 #$wgHashedUploadDirectory = false;
139 ## Set $wgCacheDirectory to a writable directory on the web server
140 ## to make your wiki go slightly faster. The directory should not
141 ## be publically accessible from the web.
142 #$wgCacheDirectory = "$IP/cache";
144 # Site language code, should be one of the list in ./languages/Names.php
145 $wgLanguageCode = "en";
147 ## Enable setting the page content language by users
148 $wgPageLanguageUseDB = true;
149 $wgGroupPermissions['user']['pagelang'] = true;
151 $wgSecretKey = '<%= @secret_key %>';
153 # Site upgrade key. Must be set to a string (default provided) to turn on the
154 # web installer while LocalSettings.php is in place
155 #$wgUpgradeKey = "6ad907e74fc65836";
157 ## Default skin: you can change the default skin. Use the internal symbolic
158 ## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook', 'vector':
159 $wgDefaultSkin = "<%= @mediawiki[:skin] %>";
161 ## For attaching licensing metadata to pages, and displaying an
162 ## appropriate copyright notice / icon. GNU Free Documentation
163 ## License and Creative Commons licenses are supported so far.
164 $wgRightsPage = "Wiki_content_license"; # Set to the title of a wiki page that describes your license/copyright
165 $wgRightsUrl = "https://creativecommons.org/licenses/by-sa/2.0/";
166 $wgRightsText = "Creative Commons Attribution-ShareAlike 2.0 license";
167 $wgRightsIcon = "/cc-wiki.png";
169 # Path to the GNU diff3 utility. Used for conflict resolution.
170 $wgDiff3 = "/usr/bin/diff3";
172 $wgExternalDiffEngine = 'wikidiff2';
174 # Query string length limit for ResourceLoader. You should only set this if
175 # your web server has a query string length limit (then set it to that limit),
176 # or if you have suhosin.get.max_value_length set in php.ini (then set it to
178 $wgResourceLoaderMaxQueryLength = -1;
180 # End of automatically generated settings.
181 # Add more configuration options below.
183 # Only Allow Signed-in users to edit
184 $wgGroupPermissions['*']['edit'] = false;
186 # Allow bureaucrat group access to oversight options
187 $wgGroupPermissions['bureaucrat']['hideuser'] = true;
188 $wgGroupPermissions['bureaucrat']['deletelogentry'] = true;
189 $wgGroupPermissions['bureaucrat']['deleterevision'] = true;
190 $wgGroupPermissions['bureaucrat']['suppressrevision'] = true;
191 $wgGroupPermissions['bureaucrat']['suppressionlog'] = true;
193 # Since 1.32 MW introduced interface-admin group to separate all UI-related rights. This makes sense for bigger sites,
194 # but for OSM it makes more sense to keep group structure simple. Give all interface-admin rights to sysops.
195 # Also remove the interface-admin group to avoid confusion.
196 $wgGroupPermissions['sysop'] = array_merge( $wgGroupPermissions['sysop'], $wgGroupPermissions['interface-admin'] );
197 unset( $wgGroupPermissions['interface-admin'] );
198 unset( $wgRevokePermissions['interface-admin'] );
199 unset( $wgAddGroups['interface-admin'] );
200 unset( $wgRemoveGroups['interface-admin'] );
201 unset( $wgGroupsAddToSelf['interface-admin'] );
202 unset( $wgGroupsRemoveFromSelf['interface-admin'] );
204 # The v1.32+ gadget system also requires two additional rights
205 # See https://www.mediawiki.org/wiki/Extension:Gadgets
206 $wgGroupPermissions['sysop']['gadgets-edit'] = true;
207 $wgGroupPermissions['sysop']['gadgets-definition-edit'] = true;
209 <% if @mediawiki[:private_accounts] -%>
210 # Prevent new user registrations except by existing users
211 $wgGroupPermissions['*']['createaccount'] = false;
212 $wgGroupPermissions['user']['createaccount'] = true;
215 <% if @mediawiki[:private_site] -%>
216 # Disable reading by anonymous users
217 $wgGroupPermissions['*']['read'] = false;
219 # Allow anonymous users to access the login page
220 $wgWhitelistRead = array ("Special:Userlogin");
222 # Prevent new user registrations except by sysops
223 $wgGroupPermissions['*']['createaccount'] = false;
225 # Restrict access to the upload directory
226 $wgUploadPath = "$wgScriptPath/img_auth.php";
229 # Allow Subpages on Main Namespace
230 $wgNamespacesWithSubpages[NS_MAIN] = true;
232 # DNS Blacklists to use
233 $wgEnableDnsBlacklist = true;
234 $wgDnsBlacklistUrls = [
235 'proxies.dnsbl.sorbs.net.',
236 'opm.tornevall.org.',
238 'dnsbl-2.uceprotect.net.'
241 # Require validated email to edit
242 $wgEmailConfirmToEdit = true;
244 # Extend autoblock period
245 $wgAutoblockExpiry = 7776000; // 90 days
247 # Disable Hit Counter for Performance
248 $wgDisableCounters = TRUE;
249 # Disable IP in Header to avoid cache issue
250 $wgShowIPinHeader = FALSE;
255 # dissolves double redirects automatically
256 $wgFixDoubleRedirects = TRUE;
258 # Allow external images from a few sites
259 $wgAllowExternalImagesFrom = [
260 'http://tile.openstreetmap.org/',
261 'https://tile.openstreetmap.org',
262 'http://josm.openstreetmap.de/'
265 $wgNoFollowDomainExceptions = [
266 'www.openstreetmap.org',
267 'josm.openstreetmap.de',
268 'taginfo.openstreetmap.org',
269 'blog.openstreetmap.org',
270 'forum.openstreetmap.org',
271 'community.openstreetmap.org',
272 'lists.openstreetmap.org',
273 'help.openstreetmap.org',
275 'wiki.osmfoundation.org',
276 'www.openstreetmap.us',
279 'openstreetmap.community',
280 'www.openstreetbrowser.org',
285 # FIXME - move to specific
286 $wgAllowUserJs = TRUE;
287 $wgAllowUserCss = TRUE;
289 # Raise expensive lua (and other function) call limits to match WP
290 # Docs: https://www.mediawiki.org/wiki/Manual:$wgExpensiveParserFunctionLimit
291 # Wikipedia's Config: https://noc.wikimedia.org/conf/highlight.php?file=CommonSettings.php
292 $wgExpensiveParserFunctionLimit = 500;
295 <% if @mediawiki[:site_notice] -%>
296 $wgSiteNotice = "<%= @mediawiki[:site_notice] %>";
298 <% if @mediawiki[:site_readonly] -%>
299 $wgReadOnly = "<%= @mediawiki[:site_readonly] %>";
302 <% if @name == "wiki.openstreetmap.org" -%>
304 define('NS_LANG_DE', 200);
305 $wgExtraNamespaces[NS_LANG_DE] = 'DE';
306 $wgNamespacesWithSubpages[NS_LANG_DE] = TRUE;
307 $wgContentNamespaces[] = NS_LANG_DE;
308 define('NS_LANG_DE_TALK', 201);
309 $wgExtraNamespaces[NS_LANG_DE_TALK] = 'DE_talk';
310 $wgNamespacesWithSubpages[NS_LANG_DE_TALK] = TRUE;
313 define('NS_LANG_FR', 202);
314 $wgExtraNamespaces[NS_LANG_FR] = 'FR';
315 $wgNamespacesWithSubpages[NS_LANG_FR] = TRUE;
316 $wgContentNamespaces[] = NS_LANG_FR;
317 define('NS_LANG_FR_TALK', 203);
318 $wgExtraNamespaces[NS_LANG_FR_TALK] = 'FR_talk';
319 $wgNamespacesWithSubpages[NS_LANG_FR_TALK] = TRUE;
322 define('NS_LANG_ES', 204);
323 $wgExtraNamespaces[NS_LANG_ES] = 'ES';
324 $wgNamespacesWithSubpages[NS_LANG_ES] = TRUE;
325 $wgContentNamespaces[] = NS_LANG_ES;
326 define('NS_LANG_ES_TALK', 205);
327 $wgExtraNamespaces[NS_LANG_ES_TALK] = 'ES_talk';
328 $wgNamespacesWithSubpages[NS_LANG_ES_TALK] = TRUE;
331 define('NS_LANG_IT', 206);
332 $wgExtraNamespaces[NS_LANG_IT] = 'IT';
333 $wgNamespacesWithSubpages[NS_LANG_IT] = TRUE;
334 $wgContentNamespaces[] = NS_LANG_IT;
335 define('NS_LANG_IT_TALK', 207);
336 $wgExtraNamespaces[NS_LANG_IT_TALK] = 'IT_talk';
337 $wgNamespacesWithSubpages[NS_LANG_IT_TALK] = TRUE;
340 define('NS_LANG_NL', 208);
341 $wgExtraNamespaces[NS_LANG_NL] = 'NL';
342 $wgNamespacesWithSubpages[NS_LANG_NL] = TRUE;
343 $wgContentNamespaces[] = NS_LANG_NL;
344 define('NS_LANG_NL_TALK', 209);
345 $wgExtraNamespaces[NS_LANG_NL_TALK] = 'NL_talk';
346 $wgNamespacesWithSubpages[NS_LANG_NL_TALK] = TRUE;
349 define('NS_LANG_RU', 210);
350 $wgExtraNamespaces[NS_LANG_RU] = 'RU';
351 $wgNamespacesWithSubpages[NS_LANG_RU] = TRUE;
352 $wgContentNamespaces[] = NS_LANG_RU;
353 define('NS_LANG_RU_TALK', 211);
354 $wgExtraNamespaces[NS_LANG_RU_TALK] = 'RU_talk';
355 $wgNamespacesWithSubpages[NS_LANG_RU_TALK] = TRUE;
358 define('NS_LANG_JA', 212);
359 $wgExtraNamespaces[NS_LANG_JA] = 'JA';
360 $wgNamespacesWithSubpages[NS_LANG_JA] = TRUE;
361 $wgContentNamespaces[] = NS_LANG_JA;
362 define('NS_LANG_JA_TALK', 213);
363 $wgExtraNamespaces[NS_LANG_JA_TALK] = 'JA_talk';
364 $wgNamespacesWithSubpages[NS_LANG_JA_TALK] = TRUE;
367 # namespace features a specific search weight defined at
368 # cookbooks/mediawiki/templates/default/mw-ext-CirrusSearch.inc.php.erb
369 define('NS_PROPOSAL', 3000);
370 $wgExtraNamespaces[NS_PROPOSAL] = 'Proposal';
371 $wgNamespacesWithSubpages[NS_PROPOSAL] = TRUE;
372 $wgContentNamespaces[] = NS_PROPOSAL;
373 define('NS_PROPOSAL_TALK', 3001);
374 $wgExtraNamespaces[NS_PROPOSAL_TALK] = 'Proposal_talk';
375 $wgNamespacesWithSubpages[NS_PROPOSAL_TALK] = TRUE;
377 $wgNamespacesToBeSearchedDefault[NS_LANG_DE] = TRUE;
378 $wgNamespacesToBeSearchedDefault[NS_LANG_FR] = TRUE;
379 $wgNamespacesToBeSearchedDefault[NS_LANG_ES] = TRUE;
380 $wgNamespacesToBeSearchedDefault[NS_LANG_IT] = TRUE;
381 $wgNamespacesToBeSearchedDefault[NS_LANG_NL] = TRUE;
382 $wgNamespacesToBeSearchedDefault[NS_LANG_RU] = TRUE;
383 $wgNamespacesToBeSearchedDefault[NS_LANG_JA] = TRUE;
384 $wgNamespacesToBeSearchedDefault[NS_PROPOSAL] = TRUE;
386 # defines which links of the sidebar are translatable
387 $wgForceUIMsgAsContentMsg = array( 'mainpage-url', 'mapfeatures-url', 'contributors-url', 'helppage', 'blogs-url', 'shop-url', 'sitesupport-url' );
391 <% Dir.glob("#{@directory}/LocalSettings.d/*.php") do |file| -%>
392 <%= "require_once('#{file}');" %>
395 <% if @name == "wiki.openstreetmap.org" -%>
396 # Placeholder for the wiki.openstreetmap.org specific config
399 <% if not(@mediawiki[:private_accounts]) and not(@mediawiki[:private_site]) -%>
400 # require user confirmation for certain actions
401 $wgGroupPermissions['user']['move'] = false;
402 $wgGroupPermissions['user']['movefile'] = false;
403 $wgGroupPermissions['user']['move-categorypages'] = false;
404 $wgGroupPermissions['user']['upload'] = false;
405 $wgGroupPermissions['autoconfirmed']['move'] = true;
406 $wgGroupPermissions['autoconfirmed']['movefile'] = true;
407 $wgGroupPermissions['autoconfirmed']['move-categorypages'] = true;
408 $wgGroupPermissions['autoconfirmed']['upload'] = true;
409 # Autopromote users to autoconfirmed
410 $wgAutoConfirmAge = 345600; // 4 days
411 $wgAutoConfirmCount = 10;
413 # user group "confirmed" with identical rights as "autoconfirmed", but assigned manually by sysops
414 $wgGroupPermissions['confirmed'] = $wgGroupPermissions['autoconfirmed'];
415 $wgAddGroups['sysop'][] = 'confirmed';
416 $wgRemoveGroups['sysop'][] = 'confirmed';
419 <% if @mediawiki[:private_accounts] or @mediawiki[:private_site] -%>
420 # disable automatic confirmation of users, grant all "autoconfirmed" rights to all users
421 $wgAutoConfirmAge = 0;
422 $wgAutoConfirmCount = 0;
423 $wgGroupPermissions['user'] = array_merge( $wgGroupPermissions['user'], $wgGroupPermissions['autoconfirmed'] );
425 unset( $wgGroupPermissions['autoconfirmed'] );
426 unset( $wgRevokePermissions['autoconfirmed'] );
427 unset( $wgAddGroups['autoconfirmed'] );
428 unset( $wgRemoveGroups['autoconfirmed'] );
429 unset( $wgGroupsAddToSelf['autoconfirmed'] );
430 unset( $wgGroupsRemoveFromSelf['autoconfirmed'] );
433 # Increase curl timeout to allow parsoid requests to heavy pages like Map Features
434 # Mediawiki 1.38 has fix to allow this to be set by $wgVirtualRestConfig
435 # https://phabricator.wikimedia.org/T285478
436 $wgHTTPTimeout = 240;