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