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;
59 $wgDBserver = "<%= @database_params[:host] %>";
60 $wgDBname = "<%= @database_params[:name] %>";
61 $wgDBuser = "<%= @database_params[:username] %>";
62 $wgDBpassword = "<%= @database_params[:password] %>";
64 # MySQL specific settings
67 # MySQL table options to use during installation or update
68 $wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=binary";
70 # Experimental charset support for MySQL 5.0.
73 ## Shared memory settings
74 $wgMainCacheType = CACHE_MEMCACHED;
75 $wgMemCachedServers = array('127.0.0.1:11211');
76 $wgSessionsInObjectCache = TRUE;
78 ## To enable image uploads, make sure the 'images' directory
79 ## is writable, then set this to true:
80 $wgEnableUploads = true;
81 $wgUseImageMagick = true;
82 $wgImageMagickConvertCommand = "/usr/bin/convert";
84 $wgGenerateThumbnailOnParse = false;
85 $wgMaxImageArea = 125000000;
86 $wgMaxShellMemory = 5524000;
87 $wgMaxShellFileSize = 819200;
88 $wgMaxShellTime = 360;
89 $wgMaxShellWallClockTime = 360;
91 # Allow some more upload extensions
92 $wgFileExtensions[] = 'pdf';
93 $wgFileExtensions[] = 'odt';
94 $wgFileExtensions[] = 'odp';
95 $wgFileExtensions[] = 'ods';
96 $wgFileExtensions[] = 'svg';
97 $wgFileExtensions[] = 'osm';
98 <% @mediawiki[:extra_file_extensions].each do |mw_extra_file_extension| -%>
99 $wgFileExtensions[] = '<%= mw_extra_file_extension %>';
102 # Add OSM XML file format per http://www.iana.org/assignments/media-types/media-types.xhtml
103 # Shout out to Paul Norman for reserving this.
104 # Helps MimeMagic determine XML-based formats and chooses the correct MimeType
106 $wgXMLMimeTypes[] = array('osm' => 'application/vnd.openstreetmap.data+xml');
108 $wgTrustedMediaFormats[] = 'application/vnd.openstreetmap.data+xml';
110 $wgSVGConverters = array( 'rsvg' => '/usr/bin/rsvg-convert -w $width -h $height -o $output $input');
111 $wgSVGConverter = 'rsvg';
112 $wgSVGMaxSize = 2000;
114 ## If you use ImageMagick (or any other shell command) on a
115 ## Linux server, this will need to be set to the name of an
116 ## available UTF-8 locale
117 $wgShellLocale = "en_US.utf8";
119 ## If you want to use image uploads under safe mode,
120 ## create the directories images/archive, images/thumb and
121 ## images/temp, and make them all writable. Then uncomment
122 ## this, if it's not already uncommented:
123 #$wgHashedUploadDirectory = false;
125 ## Set $wgCacheDirectory to a writable directory on the web server
126 ## to make your wiki go slightly faster. The directory should not
127 ## be publically accessible from the web.
128 #$wgCacheDirectory = "$IP/cache";
130 # Site language code, should be one of the list in ./languages/Names.php
131 $wgLanguageCode = "en";
133 ## Enable setting the page content language by users
134 $wgPageLanguageUseDB = true;
135 $wgGroupPermissions['user']['pagelang'] = true;
137 $wgSecretKey = '<%= @secret_key %>';
139 # Site upgrade key. Must be set to a string (default provided) to turn on the
140 # web installer while LocalSettings.php is in place
141 #$wgUpgradeKey = "6ad907e74fc65836";
143 ## Default skin: you can change the default skin. Use the internal symbolic
144 ## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook', 'vector':
145 $wgDefaultSkin = "<%= @mediawiki[:skin] %>";
147 ## For attaching licensing metadata to pages, and displaying an
148 ## appropriate copyright notice / icon. GNU Free Documentation
149 ## License and Creative Commons licenses are supported so far.
150 $wgRightsPage = "Wiki_content_license"; # Set to the title of a wiki page that describes your license/copyright
151 $wgRightsUrl = "https://creativecommons.org/licenses/by-sa/2.0/";
152 $wgRightsText = "Creative Commons Attribution-ShareAlike 2.0 license";
153 $wgRightsIcon = "/cc-wiki.png";
155 # Path to the GNU diff3 utility. Used for conflict resolution.
156 $wgDiff3 = "/usr/bin/diff3";
158 $wgExternalDiffEngine = 'wikidiff2';
160 # Query string length limit for ResourceLoader. You should only set this if
161 # your web server has a query string length limit (then set it to that limit),
162 # or if you have suhosin.get.max_value_length set in php.ini (then set it to
164 $wgResourceLoaderMaxQueryLength = -1;
166 # End of automatically generated settings.
167 # Add more configuration options below.
169 # Only Allow Signed-in users to edit
170 $wgGroupPermissions['*']['edit'] = false;
172 # Only allow autoconfirmed for a few actions
173 $wgGroupPermissions['user']['move'] = false;
174 $wgGroupPermissions['user']['movefile'] = false;
175 $wgGroupPermissions['user']['move-categorypages'] = false;
176 $wgGroupPermissions['user']['upload'] = false;
177 $wgGroupPermissions['autoconfirmed']['move'] = true;
178 $wgGroupPermissions['autoconfirmed']['movefile'] = true;
179 $wgGroupPermissions['autoconfirmed']['move-categorypages'] = true;
180 $wgGroupPermissions['autoconfirmed']['upload'] = true;
182 # Allow bureaucrat group access to oversight options
183 $wgGroupPermissions['bureaucrat']['hideuser'] = true;
184 $wgGroupPermissions['bureaucrat']['deletelogentry'] = true;
185 $wgGroupPermissions['bureaucrat']['deleterevision'] = true;
186 $wgGroupPermissions['bureaucrat']['suppressrevision'] = true;
187 $wgGroupPermissions['bureaucrat']['suppressionlog'] = true;
189 # Since 1.32 MW introduced interface-admin group to separate all UI-related rights. This makes sense for bigger sites,
190 # but for OSM it makes more sense to keep group structure simple. Give all interface-admin rights to sysops.
191 # Also remove the interface-admin group to avoid confusion.
192 $wgGroupPermissions['sysop'] = array_merge( $wgGroupPermissions['sysop'], $wgGroupPermissions['interface-admin'] );
193 unset( $wgGroupPermissions['interface-admin'] );
194 unset( $wgRevokePermissions['interface-admin'] );
195 unset( $wgAddGroups['interface-admin'] );
196 unset( $wgRemoveGroups['interface-admin'] );
197 unset( $wgGroupsAddToSelf['interface-admin'] );
198 unset( $wgGroupsRemoveFromSelf['interface-admin'] );
200 # The v1.32+ gadget system also requires two additional rights
201 # See https://www.mediawiki.org/wiki/Extension:Gadgets
202 $wgGroupPermissions['sysop']['gadgets-edit'] = true;
203 $wgGroupPermissions['sysop']['gadgets-definition-edit'] = true;
205 <% if @mediawiki[:private_accounts] -%>
206 # Prevent new user registrations except by existing users
207 $wgGroupPermissions['*']['createaccount'] = false;
208 $wgGroupPermissions['user']['createaccount'] = true;
210 <% if @mediawiki[:private_site] -%>
212 # Disable reading by anonymous users
213 $wgGroupPermissions['*']['read'] = false;
215 # Allow anonymous users to access the login page
216 $wgWhitelistRead = array ("Special:Userlogin");
218 # Prevent new user registrations except by sysops
219 $wgGroupPermissions['*']['createaccount'] = false;
221 # Restrict access to the upload directory
222 $wgUploadPath = "$wgScriptPath/img_auth.php";
225 <% if not(@mediawiki[:private_accounts]) and not(@mediawiki[:private_site]) -%>
226 # user group "confirmed" with identical rights as "autoconfirmed", but assigned manually by sysops
227 $wgGroupPermissions['confirmed'] = $wgGroupPermissions['autoconfirmed'];
228 $wgAddGroups['sysop'][] = 'confirmed';
229 $wgRemoveGroups['sysop'][] = 'confirmed';
232 # Allow Subpages on Main Namespace
233 $wgNamespacesWithSubpages[NS_MAIN] = true;
235 # DNS Blacklists to use
236 $wgEnableDnsBlacklist = true;
237 $wgDnsBlacklistUrls = array( 'proxies.dnsbl.sorbs.net.', 'opm.tornevall.org.', 'xbl.spamhaus.org.', 'dnsbl-2.uceprotect.net.' );
239 # Require validated email to edit
240 $wgEmailConfirmToEdit = true;
242 # Extend autoblock period
243 $wgAutoblockExpiry = 7776000; // 90 days
245 # Autopromote users to autoconfirmed
246 $wgAutoConfirmAge = 345600; // 4 days
247 $wgAutoConfirmCount = 10;
249 # Disable Hit Counter for Performance
250 $wgDisableCounters = TRUE;
251 # Disable IP in Header to avoid cache issue
252 $wgShowIPinHeader = FALSE;
254 # Job Runs mostly by cron
255 $wgJobRunRate = 0.01;
257 # dissolves double redirects automatically
258 $wgFixDoubleRedirects = TRUE;
260 # Allow external images from a few sites
261 $wgAllowExternalImagesFrom = array( 'http://tile.openstreetmap.org/', 'https://tile.openstreetmap.org', 'http://josm.openstreetmap.de/', 'http://trac.openstreetmap.org/', 'http://rweait.dev.openstreetmap.org/' );
263 $wgNoFollowDomainExceptions = array( 'www.openstreetmap.org', 'josm.openstreetmap.de', 'taginfo.openstreetmap.org', 'blog.openstreetmap.org', 'wiki.osmfoundation.org' );
265 # FIXME - move to specific
266 # defines which links of the sidebar are translatable
267 $wgForceUIMsgAsContentMsg = array( 'mainpage-url', 'mapfeatures-url', 'contributors-url', 'helppage', 'blogs-url', 'shop-url', 'sitesupport-url' );
269 # FIXME - move to specific
270 $wgAllowUserJs = TRUE;
271 $wgAllowUserCss = TRUE;
273 # FIXME - move to specific
275 define('NS_LANG_DE', 200);
276 $wgExtraNamespaces[NS_LANG_DE] = 'DE';
277 $wgNamespacesWithSubpages[NS_LANG_DE] = TRUE;
278 $wgContentNamespaces[] = NS_LANG_DE;
279 define('NS_LANG_DE_TALK', 201);
280 $wgExtraNamespaces[NS_LANG_DE_TALK] = 'DE_talk';
281 $wgNamespacesWithSubpages[NS_LANG_DE_TALK] = TRUE;
284 define('NS_LANG_FR', 202);
285 $wgExtraNamespaces[NS_LANG_FR] = 'FR';
286 $wgNamespacesWithSubpages[NS_LANG_FR] = TRUE;
287 $wgContentNamespaces[] = NS_LANG_FR;
288 define('NS_LANG_FR_TALK', 203);
289 $wgExtraNamespaces[NS_LANG_FR_TALK] = 'FR_talk';
290 $wgNamespacesWithSubpages[NS_LANG_FR_TALK] = TRUE;
293 define('NS_LANG_ES', 204);
294 $wgExtraNamespaces[NS_LANG_ES] = 'ES';
295 $wgNamespacesWithSubpages[NS_LANG_ES] = TRUE;
296 $wgContentNamespaces[] = NS_LANG_ES;
297 define('NS_LANG_ES_TALK', 205);
298 $wgExtraNamespaces[NS_LANG_ES_TALK] = 'ES_talk';
299 $wgNamespacesWithSubpages[NS_LANG_ES_TALK] = TRUE;
302 define('NS_LANG_IT', 206);
303 $wgExtraNamespaces[NS_LANG_IT] = 'IT';
304 $wgNamespacesWithSubpages[NS_LANG_IT] = TRUE;
305 $wgContentNamespaces[] = NS_LANG_IT;
306 define('NS_LANG_IT_TALK', 207);
307 $wgExtraNamespaces[NS_LANG_IT_TALK] = 'IT_talk';
308 $wgNamespacesWithSubpages[NS_LANG_IT_TALK] = TRUE;
311 define('NS_LANG_NL', 208);
312 $wgExtraNamespaces[NS_LANG_NL] = 'NL';
313 $wgNamespacesWithSubpages[NS_LANG_NL] = TRUE;
314 $wgContentNamespaces[] = NS_LANG_NL;
315 define('NS_LANG_NL_TALK', 209);
316 $wgExtraNamespaces[NS_LANG_NL_TALK] = 'NL_talk';
317 $wgNamespacesWithSubpages[NS_LANG_NL_TALK] = TRUE;
320 define('NS_LANG_RU', 210);
321 $wgExtraNamespaces[NS_LANG_RU] = 'RU';
322 $wgNamespacesWithSubpages[NS_LANG_RU] = TRUE;
323 $wgContentNamespaces[] = NS_LANG_RU;
324 define('NS_LANG_RU_TALK', 211);
325 $wgExtraNamespaces[NS_LANG_RU_TALK] = 'RU_talk';
326 $wgNamespacesWithSubpages[NS_LANG_RU_TALK] = TRUE;
329 define('NS_LANG_JA', 212);
330 $wgExtraNamespaces[NS_LANG_JA] = 'JA';
331 $wgNamespacesWithSubpages[NS_LANG_JA] = TRUE;
332 $wgContentNamespaces[] = NS_LANG_JA;
333 define('NS_LANG_JA_TALK', 213);
334 $wgExtraNamespaces[NS_LANG_JA_TALK] = 'JA_talk';
335 $wgNamespacesWithSubpages[NS_LANG_JA_TALK] = TRUE;
337 $wgNamespacesToBeSearchedDefault[NS_LANG_DE] = TRUE;
338 $wgNamespacesToBeSearchedDefault[NS_LANG_FR] = TRUE;
339 $wgNamespacesToBeSearchedDefault[NS_LANG_ES] = TRUE;
340 $wgNamespacesToBeSearchedDefault[NS_LANG_IT] = TRUE;
341 $wgNamespacesToBeSearchedDefault[NS_LANG_NL] = TRUE;
342 $wgNamespacesToBeSearchedDefault[NS_LANG_RU] = TRUE;
343 $wgNamespacesToBeSearchedDefault[NS_LANG_JA] = TRUE;
346 # Raise expensive lua (and other function) call limits to match WP
347 # Docs: https://www.mediawiki.org/wiki/Manual:$wgExpensiveParserFunctionLimit
348 # Wikipedia's Config: https://noc.wikimedia.org/conf/highlight.php?file=CommonSettings.php
349 $wgExpensiveParserFunctionLimit = 500;
352 <% if @mediawiki[:site_notice] -%>
353 $wgSiteNotice = "<%= @mediawiki[:site_notice] %>";
355 <% if @mediawiki[:site_readonly] -%>
356 $wgReadOnly = "<%= @mediawiki[:site_readonly] %>";
359 <% Dir.glob("#{@directory}/LocalSettings.d/*.php") do |file| -%>
360 <%= "require_once('#{file}');" %>