-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathLocalSettings.php
436 lines (354 loc) · 15.5 KB
/
LocalSettings.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
<?php
# This file was automatically generated by the MediaWiki 1.30.0
# installer. If you make manual changes, please keep track in case you
# need to recreate them later.
#
# See includes/DefaultSettings.php for all configurable settings
# and their default values, but don't forget to make changes in _this_
# file, not there.
#
# Further documentation for configuration settings may be found at:
# https://www.mediawiki.org/wiki/Manual:Configuration_settings
# Protect against web entry
if ( !defined( 'MEDIAWIKI' ) ) {
exit;
}
## Uncomment this to disable output compression
# $wgDisableOutputCompression = true;
$wgSitename = "Lingua Libre";
$wgMetaNamespace = "LinguaLibre";
# Private settings such as passwords, that shouldn't be published
# Needs to be before db.php
require __DIR__ . "/private/PrivateSettings.php";
## The URL base path to the directory containing the wiki;
## defaults for all runtime URL paths are based off of this.
## For more information on customizing the URLs
## (like /w/index.php/Page_title to /wiki/Page_title) please see:
## https://www.mediawiki.org/wiki/Manual:Short_URL
$wgScriptPath = "";
$wgScriptExtension = ".php";
$wgArticlePath = "/wiki/$1";
$wgUsePathInfo = true;
if($_SERVER['SERVER_NAME'] == 'lingualibre.org') {
$isBeta = False;
$wgServer = "https://lingualibre.org";
}
else {
$isBeta = True;
$wgServer = "https://" . $_SERVER['SERVER_NAME'];
}
## The URL path to static resources (images, scripts, etc.)
$wgResourceBasePath = $wgScriptPath;
## The URL path to the logo. Make sure you change this from the default,
## or else you'll overwrite your logo when you upgrade!
$wgLogo = "$wgResourceBasePath/resources/assets/logo/lingualibre-logo-2x.png";
# For the future, when switching to MW 1.35
#$wgLogos = [
# '1x' => "$wgResourceBasePath/resources/assets/logo/lingualibre-logo-1x.png",
# '1.5x' => "$wgResourceBasePath/resources/assets/logo/lingualibre-logo-1,5x.png",
# '2x' => "$wgResourceBasePath/resources/assets/logo/lingualibre-logo-2x.png",
# 'svg' => "$wgResourceBasePath/resources/assets/logo/lingualibre-logo.svg"
#];
$wgFavicon = "$wgResourceBasePath/resources/assets/logo/lingualibre-favicon.ico";
## UPO means: this is also a user preference option
$wgEnableEmail = false;
$wgEnableUserEmail = false; # UPO
$wgEmergencyContact = "contact@lingualibre.org";
$wgPasswordSender = "contact@lingualibre.org";
$wgEnotifUserTalk = false; # UPO
$wgEnotifWatchlist = false; # UPO
$wgEmailAuthentication = true;
## Database settings
$wgDBtype = "mysql";
$wgDBserver = "localhost";
# MySQL specific settings
$wgDBprefix = "";
# MySQL table options to use during installation or update
$wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=binary";
# Experimental charset support for MySQL 5.0.
$wgDBmysql5 = false;
## Shared memory settings
$wgMainCacheType = CACHE_ACCEL;
$wgSessionCacheType = CACHE_DB;
$wgMemCachedServers = [];
$wgObjectCacheSessionExpiry = 864000;
## To enable image uploads, make sure the 'images' directory
## is writable, then set this to true:
$wgEnableUploads = true;
$wgFileExtensions[] = 'wav';
$wgFileExtensions[] = 'ogg';
$wgFileExtensions[] = 'flac';
$wgFileExtensions[] = 'mp3';
$wgFileExtensions[] = 'webm';
#$wgUseImageMagick = true;
#$wgImageMagickConvertCommand = "/usr/bin/convert";
# InstantCommons allows wiki to use images from https://commons.wikimedia.org
$wgUseInstantCommons = true;
# Periodically send a pingback to https://www.mediawiki.org/ with basic data
# about this MediaWiki instance. The Wikimedia Foundation shares this data
# with MediaWiki developers to help guide future development efforts.
$wgPingback = true;
## If you use ImageMagick (or any other shell command) on a
## Linux server, this will need to be set to the name of an
## available UTF-8 locale
$wgShellLocale = "C.UTF-8";
## Set $wgCacheDirectory to a writable directory on the web server
## to make your wiki go slightly faster. The directory should not
## be publically accessible from the web.
#$wgCacheDirectory = "$IP/cache";
# Site language code, should be one of the list in ./languages/data/Names.php
$wgLanguageCode = "en";
# Changing this will log out all existing sessions.
$wgAuthenticationTokenVersion = "1";
## For attaching licensing metadata to pages, and displaying an
## appropriate copyright notice / icon. GNU Free Documentation
## License and Creative Commons licenses are supported so far.
$wgRightsPage = ""; # Set to the title of a wiki page that describes your license/copyright
$wgRightsUrl = "https://creativecommons.org/licenses/by-sa/4.0/";
$wgRightsText = "Creative Commons 4.0 Attribution-ShareAlike";
$wgRightsIcon = "$wgResourceBasePath/resources/assets/licenses/cc-by-sa.png";
# Path to the GNU diff3 utility. Used for conflict resolution.
$wgDiff3 = "/usr/bin/diff3";
# Permissions
## Disable annon editing
$wgGroupPermissions['*']['edit'] = false;
## Enable revision hiding for sysops
$wgGroupPermissions['sysop']['deletelogentry'] = true;
$wgGroupPermissions['sysop']['deleterevision'] = true;
## Default skin: you can change the default skin. Use the internal symbolic
## names, ie 'vector', 'monobook':
$wgDefaultSkin = "bluell";
# Enabled skins.
# The following skins were automatically enabled:
wfLoadSkin( 'BlueLL' );
/**
* Specify the names of skins that should not be presented in the list of
* available skins in user preferences.
*
* NOTE: This does not uninstall the skin, and it will still be accessible
* via the `useskin` query parameter. To uninstall a skin, remove its inclusion
* from LocalSettings.php.
*
* @see Skin::getAllowedSkins
*/
$wgSkipSkins = ['vector'];
# Change some footer links
$wgHooks['SkinTemplateOutputPageBeforeExec'][] = function ( $sk, &$tpl ) {
# Add About Wikimedia France link
$aboutLink = Html::element( 'a', [ 'href' => $sk->msg( 'aboutwmfr-url' )->escaped() ],
$sk->msg( 'aboutwmfr' )->text() );
$tpl->set( 'aboutwmfr', $aboutLink );
$tpl->data['footerlinks']['places'][] = 'aboutwmfr';
# Add a contact link
$contactLink = Html::element( 'a', [ 'href' => $sk->msg( 'contact-url' )->escaped() ],
$sk->msg( 'contact' )->text() );
$tpl->set( 'contact', $contactLink );
$tpl->data['footerlinks']['places'][] = 'contact';
# Add a twitter link
$tpl->data['footerlinks']['social'] = [];
$contactLink = Html::element( 'a', [ 'href' => $sk->msg( 'twitter-url' )->escaped() ],
$sk->msg( 'twitter' )->text() );
$tpl->set( 'twitter', $contactLink );
$tpl->data['footerlinks']['social'][] = 'twitter';
# remove both aboutsite and disclaimer links
\array_splice($tpl->data['footerlinks']['places'], 1, 2);
return true;
};
# Enable user custom js and css
$wgAllowUserJs = true;
$wgAllowUserCss = true;
# Enabled extensions.
# The following extensions were automatically enabled:
wfLoadExtension( 'Cite' );
wfLoadExtension( 'Gadgets' );
wfLoadExtension( 'InputBox' );
wfLoadExtension( 'Interwiki' );
wfLoadExtension( 'Nuke' );
wfLoadExtension( 'ParserFunctions' );
wfLoadExtension( 'PdfHandler' );
wfLoadExtension( 'Poem' );
wfLoadExtension( 'SpamBlacklist' );
wfLoadExtension( 'SyntaxHighlight_GeSHi' );
wfLoadExtension( 'TitleBlacklist' );
wfLoadExtension( 'WikiEditor' );
wfLoadExtension( 'CodeEditor' );
wfLoadExtension( 'Scribunto' );
wfLoadExtension( 'Echo' );
wfLoadExtension( 'Thanks' );
wfLoadExtension( 'CustomSubtitle' );
#Configure echo
$wgEchoEmailFooterAddress = 'info@wikimedia.fr';
$wgNotificationSender = 'noreply@lingualibre.org';
$wgNotificationSenderName = 'Lingua Libre';
$wgEchoMaxMentionsInEditSummary = 20;
$wgEchoNotifiers = [
'web' => [ 'EchoNotifier', 'notifyWithNotification' ],
#'email' => [ 'EchoNotifier', 'notifyWithEmail' ],
];
#Configure scribunto
$wgScribuntoDefaultEngine = 'luastandalone';
# Edit toolbars configurations
$wgHiddenPrefs[] = 'usebetatoolbar';
$wgDefaultUserOptions['usebetatoolbar'] = 1;
$wgScribuntoUseCodeEditor = true;
$wgScribuntoUseGeSHi = true;
# Remove the default TemporaryPassword and LocalPassword authentication provider
# to let OAuth as the only authentication provider usable.
$wgAuthManagerAutoConfig['primaryauth'] = [];
# Activate the OAuthAuthentication extension
wfLoadExtension( 'OAuthAuthentication' );
if($isBeta) {
$wgOAuthAuthenticationUrl = 'https://oauth.0x010c.fr/index.php?title=Special:OAuth';
$wgOAuthAuthenticationCanonicalUrl = 'https://oauth.0x010c.fr';
$wgOAuthAuthenticationRemoteName = 'OAuthWiki';
} else {
$wgOAuthAuthenticationUrl = 'https://commons.wikimedia.org/w/index.php?title=Special:OAuth';
$wgOAuthAuthenticationCanonicalUrl = 'https://commons.wikimedia.org';
$wgOAuthAuthenticationRemoteName = 'Wikimedia Commons';
}
$wgOAuthAuthenticationAllowLocalUsers = false;
$wgOAuthAuthenticationAccountUsurpation = true;
$wgOAuthAuthenticationReplaceLoginLink = true;
$wgOAuthAuthenticationValidateSSL = true;
$wgOAuthAuthenticationCallbackUrl = 'https://lingualibre.org/wiki/Special:OAuthLogin/finish';
# Activate the Wikibase Repository extension
$wgEnableWikibaseRepo = true;
$wgEnableWikibaseClient = true;
require_once "$IP/extensions/Wikibase/repo/Wikibase.php";
require_once "$IP/extensions/Wikibase/repo/ExampleSettings.php";
require_once "$IP/extensions/Wikibase/client/WikibaseClient.php";
require_once "$IP/extensions/Wikibase/client/ExampleSettings.php";
$wgWBRepoSettings['entityNamespaces']['item'] = NS_MAIN;
$wgWBRepoSettings['entityNamespaces']['property'] = WB_NS_PROPERTY;
$wgWBRepoSettings['siteLinkGroups'] = array(); #We don't need sitelinks
$wgWBRepoSettings['formatterUrlProperty'] = 'P10'; # see https://github.com/wikimedia/mediawiki-extensions-Wikibase/blob/master/docs/options.wiki
$wgWBRepoSettings['canonicalUriProperty'] = 'P22';
#$wgWBRepoSettings['sparqlEndpoint'] = 'URL to the service description of the SPARQL end point for the repository'
# Activate the Upload2Commons extension
wfLoadExtension( 'Upload2Commons' );
if($isBeta) {
$wgUpload2CommonsApiUrl = 'https://oauth.0x010c.fr/api.php';
} else {
$wgUpload2CommonsApiUrl = 'https://commons.wikimedia.org/w/api.php';
}
# Namespaces
# Create the "list" namespace
define('NS_LIST', 142);
define('NS_LIST_TALK', 143);
$wgExtraNamespaces[NS_LIST] = 'List';
$wgExtraNamespaces[NS_LIST_TALK] = 'List_talk';
$wgNamespacesWithSubpages[NS_LIST] = true;
# Add a "DataViz" namespace alias, to manage old links in the wild to this removed namespace
$wgNamespaceAliases['DataViz'] = NS_PROJECT;
# Additional aliases
$wgNamespaceAliases['LL'] = NS_PROJECT;
$wgNamespaceAliases['LL_talk'] = NS_PROJECT_TALK;
# Activate the RecordingExtension
wfLoadExtension( 'RecordWizard' );
$wgRecordWizardConfig['properties']['langCode'] = 'P17';
$wgRecordWizardConfig['properties']['iso3'] = 'P13';
$wgRecordWizardConfig['properties']['gender'] = 'P8';
$wgRecordWizardConfig['properties']['spokenLanguages'] = 'P4';
$wgRecordWizardConfig['properties']['instanceOf'] = 'P2';
$wgRecordWizardConfig['properties']['linkedUser'] = 'P11';
$wgRecordWizardConfig['properties']['subclassOf'] = 'P9';
$wgRecordWizardConfig['properties']['audioRecord'] = 'P3';
$wgRecordWizardConfig['properties']['speaker'] = 'P5';
$wgRecordWizardConfig['properties']['date'] = 'P6';
$wgRecordWizardConfig['properties']['transcription'] = 'P7';
$wgRecordWizardConfig['properties']['wikidataId'] = 'P12';
$wgRecordWizardConfig['properties']['languageLevel'] = 'P16';
$wgRecordWizardConfig['properties']['residencePlace'] = 'P14';
$wgRecordWizardConfig['properties']['learningPlace'] = 'P15';
$wgRecordWizardConfig['properties']['qualifier'] = 'P18';
$wgRecordWizardConfig['properties']['wikipediaTitle'] = 'P19';
$wgRecordWizardConfig['properties']['wiktionaryEntry'] = 'P20';
$wgRecordWizardConfig['properties']['mediaType'] = 'P24';
$wgRecordWizardConfig['items']['genderMale'] = 'Q16';
$wgRecordWizardConfig['items']['genderFemale'] = 'Q17';
$wgRecordWizardConfig['items']['genderOther'] = 'Q18';
$wgRecordWizardConfig['items']['language'] = 'Q4';
$wgRecordWizardConfig['items']['speaker'] = 'Q3';
$wgRecordWizardConfig['items']['record'] = 'Q2';
$wgRecordWizardConfig['items']['word'] = 'Q8';
$wgRecordWizardConfig['items']['langLevelNative'] = 'Q15';
$wgRecordWizardConfig['items']['langLevelGood'] = 'Q14';
$wgRecordWizardConfig['items']['langLevelAverage'] = 'Q13';
$wgRecordWizardConfig['items']['langLevelBeginner'] = 'Q12';
$wgRecordWizardConfig['items']['mediaTypeAudio'] = 'Q88889';
$wgRecordWizardConfig['items']['mediaTypeVideo'] = 'Q88890';
$wgRecordWizardConfig['listNamespace'] = NS_LIST;
# Activate QueryViz extension
wfLoadExtension( 'QueryViz' );
$wgQueryVizEndpoint = "https://lingualibre.org/bigdata/namespace/wdq/sparql";
# Activate i18n-related extensions
wfLoadExtension( 'Babel' );
wfLoadExtension( 'cldr' );
wfLoadExtension( 'CleanChanges' );
$wgCCTrailerFilter = true;
$wgCCUserFilter = false;
$wgDefaultUserOptions['usenewrc'] = 1;
wfLoadExtension( 'LocalisationUpdate' );
$wgLocalisationUpdateDirectory = "$IP/cache";
wfLoadExtension( 'Translate' );
$wgGroupPermissions['user']['translate'] = true;
$wgGroupPermissions['user']['translate-messagereview'] = true;
$wgGroupPermissions['user']['translate-groupreview'] = true;
$wgGroupPermissions['user']['translate-import'] = true;
$wgGroupPermissions['sysop']['pagetranslation'] = true;
$wgGroupPermissions['sysop']['translate-manage'] = true;
$wgGroupPermissions['translationadmin']['pagetranslation'] = true;
$wgGroupPermissions['translationadmin']['translate-manage'] = true;
$wgTranslateDocumentationLanguageCode = 'qqq';
$wgExtraLanguageNames['qqq'] = 'Message documentation';
wfLoadExtension( 'UniversalLanguageSelector' );
$wgULSGeoService = false;
$wgForceUIMsgAsContentMsg = array( 'licenses' );
# Activate a media player extension
wfLoadExtension( 'TimedMediaHandler' );
$wgEnableTranscode = true;
// The total amout of time a transcoding shell command can take:
$wgTranscodeBackgroundTimeLimit = 3600 * 8;
// Maximum amount of virtual memory available to transcoding processes in KB
$wgTranscodeBackgroundMemoryLimit = 2 * 1024 * 1024; // 2GB avconv, ffmpeg2theora mmap resources so virtual memory needs to be high enough
// Maximum file size transcoding processes can create, in KB
$wgTranscodeBackgroundSizeLimit = 3 * 1024 * 1024; // 3GB
// Number of threads to use in avconv for transcoding
$wgFFmpegThreads = 1;
// The NS for TimedText (registered on MediaWiki.org)
$wgTimedTextNS = 710;
$wgEnabledAudioTranscodeSet = [
'vorbis',
'mp3',
];
// If mp3 source assets can be ingested:
$wgTmhEnableMp3Uploads = true;
# Activate logging
$wgDebugLogFile = '/var/log/mediawiki/' . $wgDBname . '.log';
# Allow the magic word {{DISPLAYTITLE}}
$wgAllowDisplayTitle = true;
$wgRestrictDisplayTitle = false;
# Add some languages not supported by default in MediaWiki
$wgExtraLanguageNames['kea'] = 'Kabuverdianu';
$wgExtraLanguageNames['nod'] = 'ᨣᩴᩤᨾᩮᩥᨦ';
$wgExtraLanguageNames['nys'] = 'Noongar';
$wgExtraLanguageNames['ota'] = 'ﻞﺳﺎﻧ ﺕﻭﺮﻛﻯ';
$wgExtraLanguageNames['rwr'] = 'मारवाड़ी';
$wgExtraLanguageNames['sje'] = 'bidumsámegiella';
$wgExtraLanguageNames['smj'] = 'julevsámegiella';
$wgExtraLanguageNames['srq'] = 'mbia cheë';
$wgExtraLanguageNames['tokipona'] = 'Toki Pona';
$wgExtraLanguageNames['shy-latn'] = 'Tacawit';
# Raise limit for heavy jobs
$wgMemoryLimit = '128M';
# Apply temporary security mitigation (remove when updated to >=1.35.5; see CVE-2021-44857)
$wgActions['mcrundo'] = false;
$wgActions['mcrrestore'] = false;
# Activate the debug toolbar; do not leave it in production!
if($isBeta) {
$wgDebugToolbar = true;
error_reporting( -1 );
ini_set( 'display_errors', 1 );
}
ini_set( 'display_errors', 1 );
error_reporting( -1 );