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.',
236 'dnsbl-1.uceprotect.net.'
239 # Require validated email to edit
240 $wgEmailConfirmToEdit = true;
242 # Extend autoblock period
243 $wgAutoblockExpiry = 7776000; // 90 days
245 # Disable Hit Counter for Performance
246 $wgDisableCounters = TRUE;
247 # Disable IP in Header to avoid cache issue
248 $wgShowIPinHeader = FALSE;
253 # dissolves double redirects automatically
254 $wgFixDoubleRedirects = TRUE;
256 # Allow external images from a few sites
257 $wgAllowExternalImagesFrom = [
258 'http://tile.openstreetmap.org/',
259 'https://tile.openstreetmap.org',
260 'http://josm.openstreetmap.de/'
263 $wgNoFollowDomainExceptions = [
264 'www.openstreetmap.org',
265 'josm.openstreetmap.de',
266 'taginfo.openstreetmap.org',
267 'blog.openstreetmap.org',
268 'forum.openstreetmap.org',
269 'community.openstreetmap.org',
270 'lists.openstreetmap.org',
271 'help.openstreetmap.org',
273 'wiki.osmfoundation.org',
274 'www.openstreetmap.us',
277 'openstreetmap.community',
278 'www.openstreetbrowser.org',
283 # FIXME - move to specific
284 $wgAllowUserJs = TRUE;
285 $wgAllowUserCss = TRUE;
287 # Raise expensive lua (and other function) call limits to match WP
288 # Docs: https://www.mediawiki.org/wiki/Manual:$wgExpensiveParserFunctionLimit
289 # Wikipedia's Config: https://noc.wikimedia.org/conf/highlight.php?file=CommonSettings.php
290 $wgExpensiveParserFunctionLimit = 500;
293 <% if @mediawiki[:site_notice] -%>
294 $wgSiteNotice = "<%= @mediawiki[:site_notice] %>";
296 <% if @mediawiki[:site_readonly] -%>
297 $wgReadOnly = "<%= @mediawiki[:site_readonly] %>";
300 <% if @name == "wiki.openstreetmap.org" -%>
302 define('NS_LANG_DE', 200);
303 $wgExtraNamespaces[NS_LANG_DE] = 'DE';
304 $wgNamespacesWithSubpages[NS_LANG_DE] = TRUE;
305 $wgContentNamespaces[] = NS_LANG_DE;
306 define('NS_LANG_DE_TALK', 201);
307 $wgExtraNamespaces[NS_LANG_DE_TALK] = 'DE_talk';
308 $wgNamespacesWithSubpages[NS_LANG_DE_TALK] = TRUE;
311 define('NS_LANG_FR', 202);
312 $wgExtraNamespaces[NS_LANG_FR] = 'FR';
313 $wgNamespacesWithSubpages[NS_LANG_FR] = TRUE;
314 $wgContentNamespaces[] = NS_LANG_FR;
315 define('NS_LANG_FR_TALK', 203);
316 $wgExtraNamespaces[NS_LANG_FR_TALK] = 'FR_talk';
317 $wgNamespacesWithSubpages[NS_LANG_FR_TALK] = TRUE;
320 define('NS_LANG_ES', 204);
321 $wgExtraNamespaces[NS_LANG_ES] = 'ES';
322 $wgNamespacesWithSubpages[NS_LANG_ES] = TRUE;
323 $wgContentNamespaces[] = NS_LANG_ES;
324 define('NS_LANG_ES_TALK', 205);
325 $wgExtraNamespaces[NS_LANG_ES_TALK] = 'ES_talk';
326 $wgNamespacesWithSubpages[NS_LANG_ES_TALK] = TRUE;
329 define('NS_LANG_IT', 206);
330 $wgExtraNamespaces[NS_LANG_IT] = 'IT';
331 $wgNamespacesWithSubpages[NS_LANG_IT] = TRUE;
332 $wgContentNamespaces[] = NS_LANG_IT;
333 define('NS_LANG_IT_TALK', 207);
334 $wgExtraNamespaces[NS_LANG_IT_TALK] = 'IT_talk';
335 $wgNamespacesWithSubpages[NS_LANG_IT_TALK] = TRUE;
338 define('NS_LANG_NL', 208);
339 $wgExtraNamespaces[NS_LANG_NL] = 'NL';
340 $wgNamespacesWithSubpages[NS_LANG_NL] = TRUE;
341 $wgContentNamespaces[] = NS_LANG_NL;
342 define('NS_LANG_NL_TALK', 209);
343 $wgExtraNamespaces[NS_LANG_NL_TALK] = 'NL_talk';
344 $wgNamespacesWithSubpages[NS_LANG_NL_TALK] = TRUE;
347 define('NS_LANG_RU', 210);
348 $wgExtraNamespaces[NS_LANG_RU] = 'RU';
349 $wgNamespacesWithSubpages[NS_LANG_RU] = TRUE;
350 $wgContentNamespaces[] = NS_LANG_RU;
351 define('NS_LANG_RU_TALK', 211);
352 $wgExtraNamespaces[NS_LANG_RU_TALK] = 'RU_talk';
353 $wgNamespacesWithSubpages[NS_LANG_RU_TALK] = TRUE;
356 define('NS_LANG_JA', 212);
357 $wgExtraNamespaces[NS_LANG_JA] = 'JA';
358 $wgNamespacesWithSubpages[NS_LANG_JA] = TRUE;
359 $wgContentNamespaces[] = NS_LANG_JA;
360 define('NS_LANG_JA_TALK', 213);
361 $wgExtraNamespaces[NS_LANG_JA_TALK] = 'JA_talk';
362 $wgNamespacesWithSubpages[NS_LANG_JA_TALK] = TRUE;
365 # namespace features a specific search weight defined at
366 # cookbooks/mediawiki/templates/default/mw-ext-CirrusSearch.inc.php.erb
367 define('NS_PROPOSAL', 3000);
368 $wgExtraNamespaces[NS_PROPOSAL] = 'Proposal';
369 $wgNamespacesWithSubpages[NS_PROPOSAL] = TRUE;
370 $wgContentNamespaces[] = NS_PROPOSAL;
371 define('NS_PROPOSAL_TALK', 3001);
372 $wgExtraNamespaces[NS_PROPOSAL_TALK] = 'Proposal_talk';
373 $wgNamespacesWithSubpages[NS_PROPOSAL_TALK] = TRUE;
375 $wgNamespacesToBeSearchedDefault[NS_LANG_DE] = TRUE;
376 $wgNamespacesToBeSearchedDefault[NS_LANG_FR] = TRUE;
377 $wgNamespacesToBeSearchedDefault[NS_LANG_ES] = TRUE;
378 $wgNamespacesToBeSearchedDefault[NS_LANG_IT] = TRUE;
379 $wgNamespacesToBeSearchedDefault[NS_LANG_NL] = TRUE;
380 $wgNamespacesToBeSearchedDefault[NS_LANG_RU] = TRUE;
381 $wgNamespacesToBeSearchedDefault[NS_LANG_JA] = TRUE;
382 $wgNamespacesToBeSearchedDefault[NS_PROPOSAL] = TRUE;
384 # defines which links of the sidebar are translatable
385 $wgForceUIMsgAsContentMsg = array( 'mainpage-url', 'mapfeatures-url', 'contributors-url', 'helppage', 'blogs-url', 'shop-url', 'sitesupport-url' );
389 <% Dir.glob("#{@directory}/LocalSettings.d/*.php") do |file| -%>
390 <%= "require_once('#{file}');" %>
393 <% if @name == "wiki.openstreetmap.org" -%>
394 # wiki.openstreetmap.org specific config loaded after extensions
395 $wgRCWatchCategoryMembership = true;
398 <% if not(@mediawiki[:private_accounts]) and not(@mediawiki[:private_site]) -%>
399 # require user confirmation for certain actions
400 $wgGroupPermissions['user']['move'] = false;
401 $wgGroupPermissions['user']['movefile'] = false;
402 $wgGroupPermissions['user']['move-categorypages'] = false;
403 $wgGroupPermissions['user']['upload'] = false;
404 $wgGroupPermissions['autoconfirmed']['move'] = true;
405 $wgGroupPermissions['autoconfirmed']['movefile'] = true;
406 $wgGroupPermissions['autoconfirmed']['move-categorypages'] = true;
407 $wgGroupPermissions['autoconfirmed']['upload'] = true;
408 # Autopromote users to autoconfirmed
409 $wgAutoConfirmAge = 345600; // 4 days
410 $wgAutoConfirmCount = 10;
412 # user group "confirmed" with identical rights as "autoconfirmed", but assigned manually by sysops
413 $wgGroupPermissions['confirmed'] = $wgGroupPermissions['autoconfirmed'];
414 $wgAddGroups['sysop'][] = 'confirmed';
415 $wgRemoveGroups['sysop'][] = 'confirmed';
418 <% if @mediawiki[:private_accounts] or @mediawiki[:private_site] -%>
419 # disable automatic confirmation of users, grant all "autoconfirmed" rights to all users
420 $wgAutoConfirmAge = 0;
421 $wgAutoConfirmCount = 0;
422 $wgGroupPermissions['user'] = array_merge( $wgGroupPermissions['user'], $wgGroupPermissions['autoconfirmed'] );
424 unset( $wgGroupPermissions['autoconfirmed'] );
425 unset( $wgRevokePermissions['autoconfirmed'] );
426 unset( $wgAddGroups['autoconfirmed'] );
427 unset( $wgRemoveGroups['autoconfirmed'] );
428 unset( $wgGroupsAddToSelf['autoconfirmed'] );
429 unset( $wgGroupsRemoveFromSelf['autoconfirmed'] );
432 # Increase curl timeout to allow parsoid requests to heavy pages like Map Features
433 # Mediawiki 1.38 has fix to allow this to be set by $wgVirtualRestConfig
434 # https://phabricator.wikimedia.org/T285478
435 $wgHTTPTimeout = 240;