-
Notifications
You must be signed in to change notification settings - Fork 0
/
LocalSettings.php
executable file
·320 lines (259 loc) · 10.4 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
<?php
# This file was automatically generated by the MediaWiki 1.31.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;
}
require_once("./sensitiveSettings.php");
// Allow PDF uploads
$wgFileExtensions[] = 'pdf';
// Namespace for archived pages
define("NS_ARCHIVED", 3000);
$wgExtraNamespaces[NS_ARCHIVED] = "Archived";
define("NS_ARCHIVED_TALK", 3001);
$wgExtraNamespaces[NS_ARCHIVED_TALK] = "Archived_Talk";
## Uncomment this to disable output compression
# $wgDisableOutputCompression = true;
$wgSitename = "DTEK-wiki";
## 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";
## The protocol and server name to use in fully-qualified URLs
$wgServer = "https://wiki.dtek.se";
## 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.svg";
## UPO means: this is also a user preference option
$wgEnableEmail = true;
$wgEnableUserEmail = false; # UPO
$wgEmergencyContact = "[email protected]";
$wgPasswordSender = "[email protected]";
$wgEnotifUserTalk = false; # UPO
$wgEnotifWatchlist = true; # UPO
$wgEmailAuthentication = true;
$wgEmailConfirmToEdit = true;
# MySQL specific settings
$wgDBprefix = "";
# MySQL table options to use during installation or update
$wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=binary";
## Shared memory settings
$wgMainCacheType = CACHE_ACCEL;
$wgMemCachedServers = [];
## To enable image uploads, make sure the 'images' directory
## is writable, then set this to true:
$wgEnableUploads = true;
$wgUseImageMagick = true;
$wgGenerateThumbnailOnParse = false;
$wgImageMagickConvertCommand = "/usr/bin/convert";
# InstantCommons allows wiki to use images from https://commons.wikimedia.org
$wgUseInstantCommons = false;
# 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 = false;
## 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 = "";
$wgRightsText = "";
$wgRightsIcon = "";
# Path to the GNU diff3 utility. Used for conflict resolution.
$wgDiff3 = "/usr/bin/diff3";
# The following permissions were set based on your choice in the installer
$wgGroupPermissions['*']['createaccount'] = true;
$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['*']['read'] = false;
$wgWhitelistRead = array (
"Special:CreateAccount",
"Styrdokument",
"Sektionsmötesprotokoll",
"Sektionsmöteskallelser",
"Styrelsemötesprotokoll",
"Gamla_styrelsemötesprotokoll",
"Styrelsemötesprotokoll_för_verksamhetsåret_2018/2019",
"Styrelsemötesprotokoll_för_verksamhetsåret_2019/2020",
"Styret",
"Presidiet",
"DNS",
"Talhenspresidiet",
"DRUST",
"DAG",
"Delta",
"D6",
"DNollK",
"DFoto",
"D-Lat",
"DBus",
"D-lirium",
"IDrott",
"DAF",
"DHack",
"Ståthållarämbetet",
"DLude",
"Datas_Vargbröder",
"DBrus",
"DMNollK",
"DKock",
"JämställD",
"Øhllista",
"Valberedning",
"Inval",
"Barspeglar",
"Mottagning",
"File:Amazing_Race.jpeg",
"File:Öfningsgasque.jpg",
"File:Phaderplugg.jpg",
"File:Nollbrickstillverkning.jpg",
"File:Nollrocken.jpg2",
"Protokoll",
"Sektionsmöte",
"Category:Grupperingar",
"Category:Kommittéer"
);
## Default skin: you can change the default skin. Use the internal symbolic
## names, ie 'vector', 'monobook':
$wgDefaultSkin = "vector";
# Enabled skins.
# The following skins were automatically enabled:
wfLoadSkin( 'MonoBook' );
wfLoadSkin( 'Timeless' );
wfLoadSkin( 'Vector' );
# Enabled extensions. Most of the extensions are enabled by adding
# wfLoadExtensions('ExtensionName');
# to LocalSettings.php. Check specific extension documentation for more details.
# The following extensions were automatically enabled:
wfLoadExtension( 'CategoryTree' );
wfLoadExtension( 'Cite' );
wfLoadExtension( 'CiteThisPage' );
wfLoadExtension( 'ConfirmEdit' );
wfLoadExtension( 'Gadgets' );
wfLoadExtension( 'ImageMap' );
wfLoadExtension( 'InputBox' );
wfLoadExtension( 'Interwiki' );
# wfLoadExtension( 'LocalisationUpdate' );
wfLoadExtension( 'MultimediaViewer' );
wfLoadExtension( 'ParserFunctions' );
wfLoadExtension( 'PdfHandler' );
wfLoadExtension( 'Poem' );
wfLoadExtension( 'Renameuser' );
wfLoadExtension( 'ReplaceText' );
wfLoadExtension( 'SpamBlacklist' );
wfLoadExtension( 'SyntaxHighlight_GeSHi' );
wfLoadExtension( 'TitleBlacklist' );
# End of automatically generated settings.
# Add more configuration options below.
#Default user options:
$wgDefaultUserOptions['riched_disable'] = false;
$wgDefaultUserOptions['riched_start_disabled'] = false;
$wgDefaultUserOptions['riched_use_toggle'] = true;
$wgDefaultUserOptions['riched_use_popup'] = false;
$wgDefaultUserOptions['riched_toggle_remember_state'] = true;
$wgDefaultUserOptions['riched_link_paste_text'] = true;
//To enable us to "delete" users via the extension UserMerge. Available at Special:UserMerge.
wfLoadExtension( 'UserMerge' );
$wgGroupPermissions['bureaucrat']['usermerge'] = true;
error_reporting(0);
ini_set('display_errors', 0);
$wgShowExceptionDetails = true;
$wgShowDBErrorBacktrace = true;
$wgShowSQLErrors = true;
function abortOnBadDomain($user, &$message) {
global $wgRequest;
$allowedDomains = array( "student.chalmers.se" );
$email = $user->getEmail();
$emailSplitList = explode("@", $email, 2);
if ( isset( $emailSplitList[1] ) ) {
foreach( $allowedDomains as $domain ) {
if ( $emailSplitList[1] === $domain ) {
return true;
}
}
}
$message = "You need a whitelisted chalmers email address";
return false;
}
$wgHooks['AbortNewAccount'][] = 'abortOnBadDomain';
// =======================================================================
// =======================================================================
// This configuration is for getting the visualeditor and parsoid to work
// =======================================================================
// =======================================================================
// wfLoadExtension( 'VisualEditor' );
// Enable by default for everybody
// $wgDefaultUserOptions['visualeditor-enable'] = 1;
// $wgVisualEditorNamespaces = array_merge( $wgContentNamespaces, array( NS_USER, NS_CATEGORY ) );
// Optional: Set VisualEditor as the default for anonymous users
// otherwise they will have to switch to VE
// $wgDefaultUserOptions['visualeditor-editor'] = "visualeditor";
// Don't allow users to disable it
//$wgHiddenPrefs[] = 'visualeditor-enable';
// OPTIONAL: Enable VisualEditor's experimental code features
//$wgDefaultUserOptions['visualeditor-enable-experimental'] = 1;
// $wgVirtualRestConfig['modules']['parsoid'] = array(
// URL to the Parsoid instance
// 'url' => 'http://parsoid:8000',
// );
//============================
// Parsoid for private wikis
//============================
// This feature requires a non-locking session store. The default session store will not work and
// will cause deadlocks (connection timeouts from Parsoid) when trying to use this feature. Only required for MediaWiki 1.26.x and earlier!
// $wgSessionsInObjectCache = true;
// Forward users' Cookie: headers to Parsoid. Required for private wikis (login required to read).
// If the wiki is not private (i.e. $wgGroupPermissions['*']['read'] is true) this configuration
// variable will be ignored.
//
// WARNING: ONLY enable this on private wikis and ONLY IF you understand the SECURITY IMPLICATIONS
// of sending Cookie headers to Parsoid over HTTP. For security reasons, it is strongly recommended
// that $wgVirtualRestConfig['modules']['parsoid']['url'] be pointed to localhost if this setting is enabled.
// $wgVirtualRestConfig['modules']['parsoid']['forwardCookies'] = true;
/*
// Load external mediawiki extensions from docker volume
if ($handle = opendir("/var/www/html/external_extensions")) {
while (false !== ($entry = readdir($handle))) {
echo "$entry\n";
copy("/var/www/html/external_extensions" . $entry, "/var/www/html/external_extensions" . $entry);
}
closedir($handle);
}
*/
// =======================================================================
// =======================================================================
// END OF configuration for getting the visualeditor and parsoid to work
// =======================================================================
// =======================================================================
//
// Enables different displaytitles than pagename
$wgAllowDisplayTitle = true;
// Allow names to be not only be normalizations
$wgRestrictDisplayTitle = false;
$wgLocaltimezone = "Europe/Stockholm";