]> git.openstreetmap.org Git - chef.git/blob - cookbooks/mediawiki/templates/default/LocalSettings.php.erb
Mediawiki: additional words in SpamRegex
[chef.git] / cookbooks / mediawiki / templates / default / LocalSettings.php.erb
1 <?php
2 # DO NOT EDIT - This file is being maintained by Chef
3
4 # Protect against web entry
5 if ( !defined( 'MEDIAWIKI' ) ) {
6         exit;
7 }
8
9 ## Uncomment this to disable output compression
10 # $wgDisableOutputCompression = true;
11
12 $wgSitename      = '<%= @mediawiki[:sitename] %>';
13 $wgMetaNamespace = '<%= @mediawiki[:metanamespace] %>';
14
15
16 ## The URL base path to the directory containing the wiki;
17 ## defaults for all runtime URL paths are based off of this.
18 ## For more information on customizing the URLs
19 ## (like /w/index.php/Page_title to /wiki/Page_title) please see:
20 ## http://www.mediawiki.org/wiki/Manual:Short_URL
21 $wgScriptPath       = "/w";
22 $wgArticlePath      = '/wiki/$1';
23 $wgUsePathInfo      = true;
24 $wgScriptExtension  = ".php";
25
26 ## The protocol and server name to use in fully-qualified URLs
27 $wgServer           = "//<%= @name %>";
28 $wgInternalServer   = 'http://<%= @name %>';
29
30 <% if @mediawiki[:ssl_enabled] -%>
31 $wgSecureLogin = true;
32 $wgDefaultUserOptions['prefershttps'] = 0;
33 <% end -%>
34 $wgCookieSecure = false;
35
36 ## The relative URL path to the skins directory
37 $wgStylePath        = "$wgScriptPath/skins";
38
39 ## The relative URL path to the logo.  Make sure you change this from the default,
40 ## or else you'll overwrite your logo when you upgrade!
41 $wgLogo             = "<%= @mediawiki[:logo] %>";
42
43 ## UPO means: this is also a user preference option
44
45 $wgEnableEmail      = true;
46 $wgEnableUserEmail  = true; # UPO
47
48 $wgEmergencyContact = "<%= @mediawiki[:email_contact] %>";
49 $wgPasswordSender   = "<%= @mediawiki[:email_sender] %>";
50 $wgPasswordSenderName = "<%= @mediawiki[:email_sender_name] %>"; //Replaced by MediaWiki:Emailsender in v1.23.0
51
52 $wgEnotifUserTalk      = true; # UPO
53 $wgEnotifWatchlist     = true; # UPO
54 $wgEmailAuthentication = true;
55
56 $wgEnotifUseJobQ       = true;
57
58 ## Database settings
59 $wgDBtype           = "mysql";
60 $wgDBserver         = "<%= @database_params[:host] %>";
61 $wgDBname           = "<%= @database_params[:name] %>";
62 $wgDBuser           = "<%= @database_params[:username] %>";
63 $wgDBpassword       = "<%= @database_params[:password] %>";
64
65 # MySQL specific settings
66 $wgDBprefix         = "";
67
68 # MySQL table options to use during installation or update
69 $wgDBTableOptions   = "ENGINE=InnoDB, DEFAULT CHARSET=binary";
70
71 # Experimental charset support for MySQL 5.0.
72 $wgDBmysql5 = false;
73
74 ## Shared memory settings
75 $wgMainCacheType    = CACHE_MEMCACHED;
76 $wgMemCachedServers = array('127.0.0.1:11211');
77 $wgSessionsInObjectCache = TRUE;
78
79 ## To enable image uploads, make sure the 'images' directory
80 ## is writable, then set this to true:
81 $wgEnableUploads  = true;
82 $wgUseImageMagick = true;
83 $wgImageMagickConvertCommand = "/usr/bin/convert";
84
85 $wgGenerateThumbnailOnParse = false;
86 $wgMaxImageArea = 125000000;
87 $wgMaxShellMemory = 5524000;
88 $wgMaxShellFileSize = 819200;
89 $wgMaxShellTime = 360;
90 $wgMaxShellWallClockTime = 360;
91
92 # Allow some more upload extensions
93 $wgFileExtensions[] = 'doc';
94 $wgFileExtensions[] = 'pdf';
95 $wgFileExtensions[] = 'odt';
96 $wgFileExtensions[] = 'odp';
97 $wgFileExtensions[] = 'svg';
98 <% @mediawiki[:extra_file_extensions].each do |mw_extra_file_extension| -%>
99         $wgFileExtensions[] = '<%= mw_extra_file_extension %>';
100 <% end -%>
101
102 $wgSVGConverters = array( 'rsvg' => '/usr/bin/rsvg-convert -w $width -h $height -o $output $input');
103 $wgSVGConverter = 'rsvg';
104 $wgSVGMaxSize = 2000;
105
106 # InstantCommons allows wiki to use images from http://commons.wikimedia.org
107 <% if @mediawiki[:commons] -%>
108 $wgUseInstantCommons  = true;
109 <% else -%>
110 $wgUseInstantCommons  = false;
111 <% end -%>
112
113 ## If you use ImageMagick (or any other shell command) on a
114 ## Linux server, this will need to be set to the name of an
115 ## available UTF-8 locale
116 $wgShellLocale = "en_US.utf8";
117
118 ## If you want to use image uploads under safe mode,
119 ## create the directories images/archive, images/thumb and
120 ## images/temp, and make them all writable. Then uncomment
121 ## this, if it's not already uncommented:
122 #$wgHashedUploadDirectory = false;
123
124 ## Set $wgCacheDirectory to a writable directory on the web server
125 ## to make your wiki go slightly faster. The directory should not
126 ## be publically accessible from the web.
127 #$wgCacheDirectory = "$IP/cache";
128
129 # Site language code, should be one of the list in ./languages/Names.php
130 $wgLanguageCode = "en";
131
132 $wgSecretKey = '<%= @node[:mediawiki][:sites][@name][:wgSecretKey] %>';
133
134 # Site upgrade key. Must be set to a string (default provided) to turn on the
135 # web installer while LocalSettings.php is in place
136 #$wgUpgradeKey = "6ad907e74fc65836";
137
138 ## Default skin: you can change the default skin. Use the internal symbolic
139 ## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook', 'vector':
140 $wgDefaultSkin = "<%= @mediawiki[:skin] %>";
141
142 ## For attaching licensing metadata to pages, and displaying an
143 ## appropriate copyright notice / icon. GNU Free Documentation
144 ## License and Creative Commons licenses are supported so far.
145 $wgRightsPage = "OpenStreetMap_License"; # Set to the title of a wiki page that describes your license/copyright
146 $wgRightsUrl  = "http://creativecommons.org/licenses/by-sa/2.0/";
147 $wgRightsText = "Creative Commons Attribution-ShareAlike 2.0 license";
148 $wgRightsIcon = "/cc-wiki.png";
149
150 # Path to the GNU diff3 utility. Used for conflict resolution.
151 $wgDiff3 = "/usr/bin/diff3";
152
153 $wgExternalDiffEngine = 'wikidiff2';
154
155 # Query string length limit for ResourceLoader. You should only set this if
156 # your web server has a query string length limit (then set it to that limit),
157 # or if you have suhosin.get.max_value_length set in php.ini (then set it to
158 # that value)
159 $wgResourceLoaderMaxQueryLength = -1;
160
161 # End of automatically generated settings.
162 # Add more configuration options below.
163
164 #Only Allow Signed-in users to edit
165 $wgGroupPermissions['*']['edit'] = false;
166
167 #Only allow autoconfirmed for a few actions
168 $wgGroupPermissions['user']['move'] = false;
169 $wgGroupPermissions['user']['movefile'] = false;
170 $wgGroupPermissions['user']['move-categorypages'] = false;
171 $wgGroupPermissions['user']['upload'] = false;
172 $wgGroupPermissions['autoconfirmed']['move'] = false;
173 $wgGroupPermissions['autoconfirmed']['movefile'] = false;
174 $wgGroupPermissions['autoconfirmed']['move-categorypages'] = false;
175 $wgGroupPermissions['autoconfirmed']['upload'] = true;
176
177 #Allow bureaucrat group access to oversight options
178 $wgGroupPermissions['bureaucrat']['hideuser'] = true;
179 $wgGroupPermissions['bureaucrat']['deletelogentry'] = true;
180 $wgGroupPermissions['bureaucrat']['deleterevision'] = true;
181 $wgGroupPermissions['bureaucrat']['suppressrevision'] = true;
182 $wgGroupPermissions['bureaucrat']['suppressionlog'] = true;
183
184 <% if @mediawiki[:private_accounts] -%>
185 #Prevent new user registrations except by existing users
186 $wgGroupPermissions['*']['createaccount'] = false;
187 $wgGroupPermissions['user']['createaccount'] = true;
188 <% end -%>
189 <% if @mediawiki[:private] -%>
190
191 #Disable reading by anonymous users
192 $wgGroupPermissions['*']['read'] = false;
193
194 #Allow anonymous users to access the login page
195 $wgWhitelistRead = array ("Special:Userlogin");
196
197 #Prevent new user registrations except by sysops
198 $wgGroupPermissions['*']['createaccount'] = false;
199
200 #Restrict access to the upload directory
201 $wgUploadPath = "$wgScriptPath/img_auth.php";
202 <% end -%>
203
204 #Allow Subpages on Main Namespace
205 $wgNamespacesWithSubpages[NS_MAIN] = true;
206
207 #DNS Blacklists to use
208 $wgEnableDnsBlacklist = true;
209 $wgDnsBlacklistUrls = array( 'proxies.dnsbl.sorbs.net.', 'opm.tornevall.org.', 'xbl.spamhaus.org.', 'dnsbl-3.uceprotect.net.' );
210
211 #Require validated email to edit
212 $wgEmailConfirmToEdit = true;
213
214 # Extend autoblock period
215 $wgAutoblockExpiry = 7776000; // 90 days
216
217 # Spam filter regex
218 $wgSpamRegex = '/\b(epson|brother|canon|hp|kodak|lexmark|mcafee|norton|avira|kaspersky|avg|avast|microsoft|outlook|printer|quickbooks( payroll)?)( helpline| customer|( technical| tech)| customer service)? (support number|phone number|support phone number|care number)\b/i';
219
220 #Autopromote users to autoconfirmed
221 $wgAutoConfirmAge = 345600; // 4 days
222 $wgAutoConfirmCount = 10;
223
224 #Disable Hit Counter for Performance
225 $wgDisableCounters = TRUE;
226 #Disable IP in Header to avoid cache issue
227 $wgShowIPinHeader = FALSE;
228
229 #Job Runs by cron
230 $wgJobRunRate = 0;
231
232 # Allow external images from a few sites
233 $wgAllowExternalImagesFrom = array( 'http://tile.openstreetmap.org/', 'http://svenanders.openstreetmap.de/', 'http://josm.openstreetmap.de/', 'http://trac.openstreetmap.org/', 'http://rweait.dev.openstreetmap.org/' );
234
235 $wgNoFollowDomainExceptions = array( 'www.openstreetmap.org', 'josm.openstreetmap.de', 'taginfo.openstreetmap.org', 'blog.openstreetmap.org', 'wiki.osmfoundation.org' );
236
237 #FIXME - move to specific
238 $wgForceUIMsgAsContentMsg = array( 'mainpage-url', 'portal-url', 'mapfeatures-url', 'helppage' );
239
240 #FIXME - move to specific
241 $wgAllowUserJs = TRUE;
242 $wgAllowUserCss = TRUE;
243
244 #FIXME - move to specific
245 #DE
246 define('NS_LANG_DE', 200);
247 $wgExtraNamespaces[NS_LANG_DE] = 'DE';
248 $wgNamespacesWithSubpages[NS_LANG_DE] = TRUE;
249 $wgContentNamespaces[] = NS_LANG_DE;
250 define('NS_LANG_DE_TALK', 201);
251 $wgExtraNamespaces[NS_LANG_DE_TALK] = 'DE_talk';
252 $wgNamespacesWithSubpages[NS_LANG_DE_TALK] = TRUE;
253
254 #FR
255 define('NS_LANG_FR', 202);
256 $wgExtraNamespaces[NS_LANG_FR] = 'FR';
257 $wgNamespacesWithSubpages[NS_LANG_FR] = TRUE;
258 $wgContentNamespaces[] = NS_LANG_FR;
259 define('NS_LANG_FR_TALK', 203);
260 $wgExtraNamespaces[NS_LANG_FR_TALK] = 'FR_talk';
261 $wgNamespacesWithSubpages[NS_LANG_FR_TALK] = TRUE;
262
263 #ES
264 define('NS_LANG_ES', 204);
265 $wgExtraNamespaces[NS_LANG_ES] = 'ES';
266 $wgNamespacesWithSubpages[NS_LANG_ES] = TRUE;
267 $wgContentNamespaces[] = NS_LANG_ES;
268 define('NS_LANG_ES_TALK', 205);
269 $wgExtraNamespaces[NS_LANG_ES_TALK] = 'ES_talk';
270 $wgNamespacesWithSubpages[NS_LANG_ES_TALK] = TRUE;
271
272 #IT
273 define('NS_LANG_IT', 206);
274 $wgExtraNamespaces[NS_LANG_IT] = 'IT';
275 $wgNamespacesWithSubpages[NS_LANG_IT] = TRUE;
276 $wgContentNamespaces[] = NS_LANG_IT;
277 define('NS_LANG_IT_TALK', 207);
278 $wgExtraNamespaces[NS_LANG_IT_TALK] = 'IT_talk';
279 $wgNamespacesWithSubpages[NS_LANG_IT_TALK] = TRUE;
280
281 #NL
282 define('NS_LANG_NL', 208);
283 $wgExtraNamespaces[NS_LANG_NL] = 'NL';
284 $wgNamespacesWithSubpages[NS_LANG_NL] = TRUE;
285 $wgContentNamespaces[] = NS_LANG_NL;
286 define('NS_LANG_NL_TALK', 209);
287 $wgExtraNamespaces[NS_LANG_NL_TALK] = 'NL_talk';
288 $wgNamespacesWithSubpages[NS_LANG_NL_TALK] = TRUE;
289
290 #RU
291 define('NS_LANG_RU', 210);
292 $wgExtraNamespaces[NS_LANG_RU] = 'RU';
293 $wgNamespacesWithSubpages[NS_LANG_RU] = TRUE;
294 $wgContentNamespaces[] = NS_LANG_RU;
295 define('NS_LANG_RU_TALK', 211);
296 $wgExtraNamespaces[NS_LANG_RU_TALK] = 'RU_talk';
297 $wgNamespacesWithSubpages[NS_LANG_RU_TALK] = TRUE;
298
299 #JA
300 define('NS_LANG_JA', 212);
301 $wgExtraNamespaces[NS_LANG_JA] = 'JA';
302 $wgNamespacesWithSubpages[NS_LANG_JA] = TRUE;
303 $wgContentNamespaces[] = NS_LANG_JA;
304 define('NS_LANG_JA_TALK', 213);
305 $wgExtraNamespaces[NS_LANG_JA_TALK] = 'JA_talk';
306 $wgNamespacesWithSubpages[NS_LANG_JA_TALK] = TRUE;
307
308 $wgNamespacesToBeSearchedDefault[NS_LANG_DE] = TRUE;
309 $wgNamespacesToBeSearchedDefault[NS_LANG_FR] = TRUE;
310 $wgNamespacesToBeSearchedDefault[NS_LANG_ES] = TRUE;
311 $wgNamespacesToBeSearchedDefault[NS_LANG_IT] = TRUE;
312 $wgNamespacesToBeSearchedDefault[NS_LANG_NL] = TRUE;
313 $wgNamespacesToBeSearchedDefault[NS_LANG_RU] = TRUE;
314 $wgNamespacesToBeSearchedDefault[NS_LANG_JA] = TRUE;
315
316 <% if @mediawiki[:site_readonly] -%>
317 $wgReadOnly = "<%= @mediawiki[:site_readonly] %>";
318 <% end -%>
319
320 <% Dir.glob("#{@directory}/LocalSettings.d/*.php") do |file| -%>
321 <%= "require_once('#{file}');" %>
322 <% end -%>