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",
61 "verify_peer_name" => false
68 $wgDBserver = "<%= @database_params[:host] %>";
69 $wgDBname = "<%= @database_params[:name] %>";
70 $wgDBuser = "<%= @database_params[:username] %>";
71 $wgDBpassword = "<%= @database_params[:password] %>";
73 # MySQL specific settings
76 # MySQL table options to use during installation or update
77 $wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=binary";
79 # Experimental charset support for MySQL 5.0.
82 ## Shared memory settings
83 $wgMainCacheType = CACHE_MEMCACHED;
84 $wgParserCacheType = CACHE_MEMCACHED;
85 $wgMessageCacheType = CACHE_MEMCACHED;
86 $wgSessionCacheType = CACHE_MEMCACHED;
87 $wgMemCachedServers = array('127.0.0.1:11211');
88 $wgSessionsInObjectCache = TRUE;
90 ## To enable image uploads, make sure the 'images' directory
91 ## is writable, then set this to true:
92 $wgEnableUploads = true;
93 $wgUseImageMagick = true;
94 $wgImageMagickConvertCommand = "/usr/bin/convert";
96 $wgGenerateThumbnailOnParse = false;
97 $wgMaxImageArea = 125000000;
98 $wgMaxShellMemory = 5524000;
99 $wgMaxShellFileSize = 819200;
100 $wgMaxShellTime = 360;
101 $wgMaxShellWallClockTime = 360;
103 # Allow some more upload extensions
104 $wgFileExtensions[] = 'pdf';
105 $wgFileExtensions[] = 'odt';
106 $wgFileExtensions[] = 'odp';
107 $wgFileExtensions[] = 'ods';
108 $wgFileExtensions[] = 'svg';
109 $wgFileExtensions[] = 'osm';
110 $wgFileExtensions[] = 'odg';
111 <% @mediawiki[:extra_file_extensions].each do |mw_extra_file_extension| -%>
112 $wgFileExtensions[] = '<%= mw_extra_file_extension %>';
115 # Add OSM XML file format per http://www.iana.org/assignments/media-types/media-types.xhtml
116 # Shout out to Paul Norman for reserving this.
117 # Helps MimeMagic determine XML-based formats and chooses the correct MimeType
119 $wgXMLMimeTypes[] = array('osm' => 'application/vnd.openstreetmap.data+xml');
121 $wgTrustedMediaFormats[] = 'application/vnd.openstreetmap.data+xml';
123 $wgSVGConverters = array( 'rsvg' => '/usr/bin/rsvg-convert -w $width -h $height -o $output $input');
124 $wgSVGConverter = 'rsvg';
125 $wgSVGMaxSize = 2000;
127 ## If you use ImageMagick (or any other shell command) on a
128 ## Linux server, this will need to be set to the name of an
129 ## available UTF-8 locale
130 $wgShellLocale = "en_US.utf8";
132 ## If you want to use image uploads under safe mode,
133 ## create the directories images/archive, images/thumb and
134 ## images/temp, and make them all writable. Then uncomment
135 ## this, if it's not already uncommented:
136 #$wgHashedUploadDirectory = false;
138 ## Set $wgCacheDirectory to a writable directory on the web server
139 ## to make your wiki go slightly faster. The directory should not
140 ## be publically accessible from the web.
141 $wgCacheDirectory = "$IP/cache";
143 # Site language code, should be one of the list in ./languages/Names.php
144 $wgLanguageCode = "en";
146 ## Enable setting the page content language by users
147 $wgPageLanguageUseDB = true;
148 $wgGroupPermissions['user']['pagelang'] = true;
150 $wgSecretKey = '<%= @secret_key %>';
152 # Site upgrade key. Must be set to a string (default provided) to turn on the
153 # web installer while LocalSettings.php is in place
154 #$wgUpgradeKey = "6ad907e74fc65836";
156 ## Default skin: you can change the default skin. Use the internal symbolic
157 ## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook', 'vector':
158 $wgDefaultSkin = "<%= @mediawiki[:skin] %>";
160 ## For attaching licensing metadata to pages, and displaying an
161 ## appropriate copyright notice / icon. GNU Free Documentation
162 ## License and Creative Commons licenses are supported so far.
163 $wgRightsPage = "Wiki_content_license"; # Set to the title of a wiki page that describes your license/copyright
164 $wgRightsUrl = "https://creativecommons.org/licenses/by-sa/2.0/";
165 $wgRightsText = "Creative Commons Attribution-ShareAlike 2.0 license";
166 $wgRightsIcon = "/cc-wiki.png";
168 # Path to the GNU diff3 utility. Used for conflict resolution.
169 $wgDiff3 = "/usr/bin/diff3";
171 $wgExternalDiffEngine = 'wikidiff2';
173 # Query string length limit for ResourceLoader. You should only set this if
174 # your web server has a query string length limit (then set it to that limit),
175 # or if you have suhosin.get.max_value_length set in php.ini (then set it to
177 $wgResourceLoaderMaxQueryLength = -1;
179 # End of automatically generated settings.
180 # Add more configuration options below.
182 # Only Allow Signed-in users to edit
183 $wgGroupPermissions['*']['edit'] = false;
185 # Allow bureaucrat group access to oversight options
186 $wgGroupPermissions['bureaucrat']['hideuser'] = true;
187 $wgGroupPermissions['bureaucrat']['deletelogentry'] = true;
188 $wgGroupPermissions['bureaucrat']['deleterevision'] = true;
189 $wgGroupPermissions['bureaucrat']['suppressrevision'] = true;
190 $wgGroupPermissions['bureaucrat']['suppressionlog'] = true;
192 # Since 1.32 MW introduced interface-admin group to separate all UI-related rights. This makes sense for bigger sites,
193 # but for OSM it makes more sense to keep group structure simple. Give all interface-admin rights to sysops.
194 # Also remove the interface-admin group to avoid confusion.
195 $wgGroupPermissions['sysop'] = array_merge( $wgGroupPermissions['sysop'], $wgGroupPermissions['interface-admin'] );
196 unset( $wgGroupPermissions['interface-admin'] );
197 unset( $wgRevokePermissions['interface-admin'] );
198 unset( $wgAddGroups['interface-admin'] );
199 unset( $wgRemoveGroups['interface-admin'] );
200 unset( $wgGroupsAddToSelf['interface-admin'] );
201 unset( $wgGroupsRemoveFromSelf['interface-admin'] );
203 # The v1.32+ gadget system also requires two additional rights
204 # See https://www.mediawiki.org/wiki/Extension:Gadgets
205 $wgGroupPermissions['sysop']['gadgets-edit'] = true;
206 $wgGroupPermissions['sysop']['gadgets-definition-edit'] = true;
208 <% if @mediawiki[:private_accounts] -%>
209 # Prevent new user registrations except by existing users
210 $wgGroupPermissions['*']['createaccount'] = false;
211 $wgGroupPermissions['user']['createaccount'] = true;
214 <% if @mediawiki[:private_site] -%>
215 # Disable reading by anonymous users
216 $wgGroupPermissions['*']['read'] = false;
218 # Allow anonymous users to access the login page
219 $wgWhitelistRead = array ("Special:Userlogin");
221 # Prevent new user registrations except by sysops
222 $wgGroupPermissions['*']['createaccount'] = false;
224 # Restrict access to the upload directory
225 $wgUploadPath = "$wgScriptPath/img_auth.php";
228 # Allow Subpages on Main Namespace
229 $wgNamespacesWithSubpages[NS_MAIN] = true;
231 # DNS Blacklists to use
232 $wgEnableDnsBlacklist = true;
233 $wgDnsBlacklistUrls = [
234 'http.dnsbl.sorbs.net.',
235 'dnsbl-1.uceprotect.net.'
238 # Require validated email to edit
239 $wgEmailConfirmToEdit = true;
241 # Extend autoblock period
242 $wgAutoblockExpiry = 7776000; // 90 days
244 # Disable Hit Counter for Performance
245 $wgDisableCounters = TRUE;
246 # Disable IP in Header to avoid cache issue
247 $wgShowIPinHeader = FALSE;
252 # dissolves double redirects automatically
253 $wgFixDoubleRedirects = TRUE;
255 # Allow external images from a few sites
256 $wgAllowExternalImagesFrom = [
257 'http://tile.openstreetmap.org/',
258 'https://tile.openstreetmap.org',
259 'http://josm.openstreetmap.de/'
262 $wgNoFollowDomainExceptions = [
263 'www.openstreetmap.org',
264 'josm.openstreetmap.de',
265 'taginfo.openstreetmap.org',
266 'blog.openstreetmap.org',
267 'forum.openstreetmap.org',
268 'community.openstreetmap.org',
269 'lists.openstreetmap.org',
270 'help.openstreetmap.org',
272 'wiki.osmfoundation.org',
273 'www.openstreetmap.us',
276 'openstreetmap.community',
277 'www.openstreetbrowser.org',
282 # FIXME - move to specific
283 $wgAllowUserJs = TRUE;
284 $wgAllowUserCss = TRUE;
286 # Raise expensive lua (and other function) call limits to match WP
287 # Docs: https://www.mediawiki.org/wiki/Manual:$wgExpensiveParserFunctionLimit
288 # Wikipedia's Config: https://noc.wikimedia.org/conf/highlight.php?file=CommonSettings.php
289 $wgExpensiveParserFunctionLimit = 500;
292 <% if @mediawiki[:site_notice] -%>
293 $wgSiteNotice = "<%= @mediawiki[:site_notice] %>";
295 <% if @mediawiki[:site_readonly] -%>
296 $wgReadOnly = "<%= @mediawiki[:site_readonly] %>";
299 <% if @name == "wiki.openstreetmap.org" -%>
301 define('NS_LANG_DE', 200);
302 $wgExtraNamespaces[NS_LANG_DE] = 'DE';
303 $wgNamespacesWithSubpages[NS_LANG_DE] = TRUE;
304 $wgContentNamespaces[] = NS_LANG_DE;
305 define('NS_LANG_DE_TALK', 201);
306 $wgExtraNamespaces[NS_LANG_DE_TALK] = 'DE_talk';
307 $wgNamespacesWithSubpages[NS_LANG_DE_TALK] = TRUE;
310 define('NS_LANG_FR', 202);
311 $wgExtraNamespaces[NS_LANG_FR] = 'FR';
312 $wgNamespacesWithSubpages[NS_LANG_FR] = TRUE;
313 $wgContentNamespaces[] = NS_LANG_FR;
314 define('NS_LANG_FR_TALK', 203);
315 $wgExtraNamespaces[NS_LANG_FR_TALK] = 'FR_talk';
316 $wgNamespacesWithSubpages[NS_LANG_FR_TALK] = TRUE;
319 define('NS_LANG_ES', 204);
320 $wgExtraNamespaces[NS_LANG_ES] = 'ES';
321 $wgNamespacesWithSubpages[NS_LANG_ES] = TRUE;
322 $wgContentNamespaces[] = NS_LANG_ES;
323 define('NS_LANG_ES_TALK', 205);
324 $wgExtraNamespaces[NS_LANG_ES_TALK] = 'ES_talk';
325 $wgNamespacesWithSubpages[NS_LANG_ES_TALK] = TRUE;
328 define('NS_LANG_IT', 206);
329 $wgExtraNamespaces[NS_LANG_IT] = 'IT';
330 $wgNamespacesWithSubpages[NS_LANG_IT] = TRUE;
331 $wgContentNamespaces[] = NS_LANG_IT;
332 define('NS_LANG_IT_TALK', 207);
333 $wgExtraNamespaces[NS_LANG_IT_TALK] = 'IT_talk';
334 $wgNamespacesWithSubpages[NS_LANG_IT_TALK] = TRUE;
337 define('NS_LANG_NL', 208);
338 $wgExtraNamespaces[NS_LANG_NL] = 'NL';
339 $wgNamespacesWithSubpages[NS_LANG_NL] = TRUE;
340 $wgContentNamespaces[] = NS_LANG_NL;
341 define('NS_LANG_NL_TALK', 209);
342 $wgExtraNamespaces[NS_LANG_NL_TALK] = 'NL_talk';
343 $wgNamespacesWithSubpages[NS_LANG_NL_TALK] = TRUE;
346 define('NS_LANG_RU', 210);
347 $wgExtraNamespaces[NS_LANG_RU] = 'RU';
348 $wgNamespacesWithSubpages[NS_LANG_RU] = TRUE;
349 $wgContentNamespaces[] = NS_LANG_RU;
350 define('NS_LANG_RU_TALK', 211);
351 $wgExtraNamespaces[NS_LANG_RU_TALK] = 'RU_talk';
352 $wgNamespacesWithSubpages[NS_LANG_RU_TALK] = TRUE;
355 define('NS_LANG_JA', 212);
356 $wgExtraNamespaces[NS_LANG_JA] = 'JA';
357 $wgNamespacesWithSubpages[NS_LANG_JA] = TRUE;
358 $wgContentNamespaces[] = NS_LANG_JA;
359 define('NS_LANG_JA_TALK', 213);
360 $wgExtraNamespaces[NS_LANG_JA_TALK] = 'JA_talk';
361 $wgNamespacesWithSubpages[NS_LANG_JA_TALK] = TRUE;
364 # namespace features a specific search weight defined at
365 # cookbooks/mediawiki/templates/default/mw-ext-CirrusSearch.inc.php.erb
366 define('NS_PROPOSAL', 3000);
367 $wgExtraNamespaces[NS_PROPOSAL] = 'Proposal';
368 $wgNamespacesWithSubpages[NS_PROPOSAL] = TRUE;
369 $wgContentNamespaces[] = NS_PROPOSAL;
370 define('NS_PROPOSAL_TALK', 3001);
371 $wgExtraNamespaces[NS_PROPOSAL_TALK] = 'Proposal_talk';
372 $wgNamespacesWithSubpages[NS_PROPOSAL_TALK] = TRUE;
374 $wgNamespacesToBeSearchedDefault[NS_LANG_DE] = TRUE;
375 $wgNamespacesToBeSearchedDefault[NS_LANG_FR] = TRUE;
376 $wgNamespacesToBeSearchedDefault[NS_LANG_ES] = TRUE;
377 $wgNamespacesToBeSearchedDefault[NS_LANG_IT] = TRUE;
378 $wgNamespacesToBeSearchedDefault[NS_LANG_NL] = TRUE;
379 $wgNamespacesToBeSearchedDefault[NS_LANG_RU] = TRUE;
380 $wgNamespacesToBeSearchedDefault[NS_LANG_JA] = TRUE;
381 $wgNamespacesToBeSearchedDefault[NS_PROPOSAL] = TRUE;
383 # defines which links of the sidebar are translatable
384 $wgForceUIMsgAsContentMsg = array( 'mainpage-url', 'mapfeatures-url', 'contributors-url', 'helppage', 'blogs-url', 'shop-url', 'sitesupport-url' );
388 <% Dir.glob("#{@directory}/LocalSettings.d/*.php") do |file| -%>
389 <%= "require_once('#{file}');" %>
392 <% if @name == "wiki.openstreetmap.org" -%>
393 # wiki.openstreetmap.org specific config loaded after extensions
394 $wgRCWatchCategoryMembership = true;
397 <% if not(@mediawiki[:private_accounts]) and not(@mediawiki[:private_site]) -%>
398 # require user confirmation for certain actions
399 $wgGroupPermissions['user']['move'] = false;
400 $wgGroupPermissions['user']['movefile'] = false;
401 $wgGroupPermissions['user']['move-categorypages'] = false;
402 $wgGroupPermissions['user']['upload'] = false;
403 $wgGroupPermissions['autoconfirmed']['move'] = true;
404 $wgGroupPermissions['autoconfirmed']['movefile'] = true;
405 $wgGroupPermissions['autoconfirmed']['move-categorypages'] = true;
406 $wgGroupPermissions['autoconfirmed']['upload'] = true;
407 # Autopromote users to autoconfirmed
408 $wgAutoConfirmAge = 345600; // 4 days
409 $wgAutoConfirmCount = 10;
411 # user group "confirmed" with identical rights as "autoconfirmed", but assigned manually by sysops
412 $wgGroupPermissions['confirmed'] = $wgGroupPermissions['autoconfirmed'];
413 $wgAddGroups['sysop'][] = 'confirmed';
414 $wgRemoveGroups['sysop'][] = 'confirmed';
417 <% if @mediawiki[:private_accounts] or @mediawiki[:private_site] -%>
418 # disable automatic confirmation of users, grant all "autoconfirmed" rights to all users
419 $wgAutoConfirmAge = 0;
420 $wgAutoConfirmCount = 0;
421 $wgGroupPermissions['user'] = array_merge( $wgGroupPermissions['user'], $wgGroupPermissions['autoconfirmed'] );
423 unset( $wgGroupPermissions['autoconfirmed'] );
424 unset( $wgRevokePermissions['autoconfirmed'] );
425 unset( $wgAddGroups['autoconfirmed'] );
426 unset( $wgRemoveGroups['autoconfirmed'] );
427 unset( $wgGroupsAddToSelf['autoconfirmed'] );
428 unset( $wgGroupsRemoveFromSelf['autoconfirmed'] );
431 # Increase curl timeout to allow parsoid requests to heavy pages like Map Features
432 # Mediawiki 1.38 has fix to allow this to be set by $wgVirtualRestConfig
433 # https://phabricator.wikimedia.org/T285478
434 $wgHTTPTimeout = 240;