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