-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLocalSettings.php
391 lines (337 loc) · 13.3 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
<?php
# This file was automatically generated by the MediaWiki 1.39.3
# installer. If you make manual changes, please keep track in case you
# need to recreate them later.
#
# See docs/Configuration.md 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
# php debugging
$_ENV["php_debug_config"];
# Protect against web entry
if ( !defined( 'MEDIAWIKI' ) ) {
exit;
}
## Uncomment this to disable output compression
# $wgDisableOutputCompression = true;
$wgReadOnly = 'Maintenance is underway. Website is on read-only mode. 维护正在进行中, 网站处于只读模式。若需帮助请咨询QQ群:669376880';
$wgSitename = $_ENV["SiteName"];
## 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 = "";
$wgArticlePath = "/$1";
$wgUsePathInfo = true;
## The protocol and server name to use in fully-qualified URLs
$wgServer = $_ENV["Server"];
## The URL path to static resources (images, scripts, etc.)
$wgResourceBasePath = $wgScriptPath;
## The URL paths to the logo. Make sure you change this from the default,
## or else you'll overwrite your logo when you upgrade!
$wgLogos = [
'1x' => "$wgResourceBasePath/resources/assets/sitelogoo.svg",
'icon' => "$wgResourceBasePath/resources/assets/sitelogo.svg",
];
$wgFavicon = "$wgResourceBasePath/resources/assets/favicon.ico";
## UPO means: this is also a user preference option
$wgEnableEmail = false;
$wgEnableUserEmail = true; # UPO
$wgEmergencyContact = "";
$wgPasswordSender = "";
$wgEnotifUserTalk = false; # UPO
$wgEnotifWatchlist = false; # UPO
$wgEmailAuthentication = true;
## Database settings
$wgDBtype = $_ENV["DbType"];
$wgDBserver = $_ENV["DbServer"];
$wgDBname = $_ENV["DbName"];
$wgDBuser = $_ENV["DbUser"];
$wgDBpassword = $_ENV["DbPassword"];
# MySQL specific settings
$wgDBprefix = "cnwiki_";
# MySQL table options to use during installation or update
$wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=binary";
# Shared database table
# This has no effect unless $wgSharedDB is also set.
$wgSharedTables[] = "actor";
## Shared memory settings
$wgMainCacheType = 'redis';
$wgSessionCacheType = 'redis';
$wgMemCachedServers = [];
$wgObjectCaches['redis'] = [
'class' => 'RedisBagOStuff',
'servers' => [ $_ENV["RedisAddress"] ],
'connectTimeout' => 30,
'persistent' => false,
'password' => $_ENV["RedisPassword"],
'automaticFailOver' => true,
];
$wgJobTypeConf['default'] = [
'class' => 'JobQueueRedis',
'order' => 'fifo',
'redisServer' => $_ENV["RedisAddress"],
'checkDelay' => true,
'daemonized' => true
];
$wgJobQueueAggregator = [
'class' => 'JobQueueAggregatorRedis',
'redisServer' => $_ENV["RedisAddress"],
];
$wgMessageCacheType = 'redis';
$wgParserCacheType = 'redis';
$wgLanguageConverterCacheType = 'redis';
$wgUseFileCache = true; /* default: false */
$wgFileCacheDirectory = "$IP/cache";
$wgShowIPinHeader = false;
## To enable image uploads, make sure the 'images' directory
## is writable, then set this to true:
$wgEnableUploads = true;
#$wgUseImageMagick = true;
#$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 = true;
# Site language code, should be one of the list in ./includes/languages/data/Names.php
$wgLanguageCode = "zh-cn";
# Time zone
$wgLocaltimezone = "Asia/Shanghai";
## Set $wgCacheDirectory to a writable directory on the web server
## to make your wiki go slightly faster. The directory should not
## be publicly accessible from the web.
#$wgCacheDirectory = "$IP/cache";
$wgSecretKey = $_ENV["SecretKey"];
# Changing this will log out all existing sessions.
$wgAuthenticationTokenVersion = "1";
# Site upgrade key. Must be set to a string (default provided) to turn on the
# web installer while LocalSettings.php is in place
$wgUpgradeKey = $_ENV["UpgradeKey"];
## 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 = "知识共享署名-相同方式共享";
$wgRightsIcon = "$wgResourceBasePath/resources/assets/licenses/cc-by-sa.png";
# 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['*']['autocreateaccount'] = true;
$wgGroupPermissions['*']['edit'] = false;
## Default skin: you can change the default skin. Use the internal symbolic
## names, e.g. 'vector' or 'monobook':
$wgDefaultSkin = "citizen";
# Enabled skins.
# The following skins were automatically enabled:
wfLoadSkin( 'Citizen' );
# Enabled extensions. Most of the extensions are enabled by adding
# wfLoadExtension( 'ExtensionName' );
# to LocalSettings.php. Check specific extension documentation for more details.
# The following extensions were automatically enabled:
wfLoadExtension( 'AbuseFilter' );
wfLoadExtension( 'AWS' );
wfLoadExtension( 'Babel' );
wfLoadExtension( 'CategoryTree' );
// wfLoadExtension( 'CirrusSearch' );
wfLoadExtension( 'Cite' );
wfLoadExtension( 'CiteThisPage' );
wfLoadExtension( 'CodeEditor' );
wfLoadExtension( 'CodeMirror' );
wfLoadExtension( 'ConfirmEdit' );
wfLoadExtension( 'DynamicPageList3' );
wfLoadExtension( 'DisplayTitle' );
// wfLoadExtension( 'Elastica' );
wfLoadExtension( 'Gadgets' );
wfLoadExtension( 'ImageMap' );
wfLoadExtension( 'InputBox' );
wfLoadExtension( 'intersection' );
wfLoadExtension( 'Interwiki' );
wfLoadExtension( 'Loops' );
wfLoadExtension( 'Math' );
wfLoadExtension( 'MultimediaViewer' );
wfLoadExtension( 'Nuke' );
wfLoadExtension( 'OATHAuth' );
wfLoadExtension( 'PageImages' );
wfLoadExtension( 'ParserFunctions' );
wfLoadExtension( 'PdfHandler' );
wfLoadExtension( 'Poem' );
wfLoadExtension( 'Purge' );
wfLoadExtension( 'Renameuser' );
wfLoadExtension( 'ReplaceText' );
wfLoadExtension( 'SandboxLink' );
wfLoadExtension( 'Scribunto' );
$wgScribuntoDefaultEngine = 'luastandalone';
wfLoadExtension( 'SecureLinkFixer' );
wfLoadExtension( 'ShortDescription' );
wfLoadExtension( 'SpamBlacklist' );
wfLoadExtension( 'SyntaxHighlight_GeSHi' );
wfLoadExtension( 'TemplateData' );
wfLoadExtension( 'TemplateSandbox' );
wfLoadExtension( 'TemplateStyles' );
wfLoadExtension( 'TemplateStylesExtender' );
wfLoadExtension( 'TextExtracts' );
wfLoadExtension( 'TitleBlacklist' );
wfLoadExtension( 'UserGroups' );
wfLoadExtension( 'VisualEditor' );
wfLoadExtension( 'WikiEditor' );
wfLoadExtension( 'WikiSeo' );
wfLoadExtension( 'Variables' );
$wgDeprecationReleaseLimit = "1.34.0";
#关闭Variables的警告
wfLoadExtension( 'TabberNeue' );
wfLoadExtension( 'SimpleBatchUpload' );
wfLoadExtension( 'NativeSvgHandler' );
wfLoadExtension( 'MultiPurge' );
wfLoadExtension( 'PluggableAuth' );
wfLoadExtension( 'OpenIDConnect' );
# End of automatically generated settings.
# Add more configuration options below.
$wgFileExtensions[] = 'svg'; // 允许上传svg文件
$wgDefaultUserOptions['usebetatoolbar'] = 1; // user option provided by WikiEditor extension
$wgGroupPermissions['*']['edit'] = false;
unset( $wgGroupPermissions['user'] );
# End of automatically generated settings.
# Add more configuration options below.
$wgGroupPermissions['确认用户']['browsearchive'] = true;
$wgGroupPermissions['确认用户']['createpage'] = true;
$wgGroupPermissions['确认用户']['createtalk'] = true;
$wgGroupPermissions['确认用户']['delete'] = true;
$wgGroupPermissions['确认用户']['deletedhistory'] = true;
$wgGroupPermissions['确认用户']['deletedtext'] = true;
$wgGroupPermissions['确认用户']['deleterevision'] = true;
$wgGroupPermissions['确认用户']['import'] = true;
$wgGroupPermissions['确认用户']['importupload'] = true;
$wgGroupPermissions['确认用户']['managechangetags'] = true;
$wgGroupPermissions['确认用户']['mergehistory'] = true;
$wgGroupPermissions['确认用户']['minoredit'] = true;
$wgGroupPermissions['确认用户']['move'] = true;
$wgGroupPermissions['确认用户']['move-categorypages'] = true;
$wgGroupPermissions['确认用户']['move-subpages'] = true;
$wgGroupPermissions['确认用户']['movefile'] = true;
$wgGroupPermissions['确认用户']['noratelimit'] = true;
$wgGroupPermissions['确认用户']['read'] = true;
$wgGroupPermissions['确认用户']['reupload'] = true;
$wgGroupPermissions['确认用户']['rollback'] = true;
$wgGroupPermissions['确认用户']['writeapi'] = true;
$wgGroupPermissions['确认用户']['edit'] = true;
$wgGroupPermissions['确认用户']['editinterface'] = true;
$wgGroupPermissions['确认用户']['editmyoptions'] = true;
$wgGroupPermissions['确认用户']['editmyprivateinfo'] = true;
$wgGroupPermissions['确认用户']['editmywatchlist'] = true;
$wgGroupPermissions['确认用户']['upload'] = true;
# 启用VisualEditor的Wikitext
$wgVisualEditorEnableWikitext = true;
# 启用编辑模式选择列表
$wgVisualEditorUseSingleEditTab = true;
# 关闭默认编辑完毕监视页面
$wgDefaultUserOptions['watchdefault'] = 0;
# 将首页设置为根目录
$wgMainPageIsDomainRoot = true;
# 启用链接展示重定向后页面标题
$wgDisplayTitleFollowRedirects = true;
# 启用搜索展示重定向前页面标题
$wgSearchDefaultRedirects = true;
#添加Railway标志
$wgFooterIcons['poweredby']['railway'] = [
"src" => "$wgResourceBasePath/resources/assets/powered_by_railway.png",
"url" => "http://railway.app/",
"alt" => "Power by Railway",
];
#扩大创建略缩图限制
$wgMaxImageArea = 4.9e7;
#新窗口中打开外部链接
$wgExternalLinkTarget = '_blank';
# Interwiki settings https://www.mediawiki.org/wiki/Extension:Interwiki
$wgGroupPermissions['sysop']['interwiki'] = true;
# Enable MW native image lazy load
$wgNativeImageLazyLoading = true;
#Debugging
#$_ENV["wiki_debug_config"];
$wgShowExceptionDetails = true;
$wgShowDebug = true;
#调用英文站图片
// $wgForeignFileRepos[] = [
// 'class' => ForeignAPIRepo::class,
// 'name' => 'StarCitizenTools', // Must be a distinct name
// 'apibase' => 'https://starcitizen.tools/api.php',
// 'hashLevels' => 2,
// 'fetchDescription' => false, // Optional
// 'apiThumbCacheExpiry' => 86400, // 24 hours, optional, but required for local thumb caching
// ];
#AWS插件 | Cloudflare R2 储存桶配置
$wgAWSCredentials = [
'key' => $_ENV["S3Key"],
'secret' => $_ENV["S3Secret"],
'token' => false
];
$wgAWSRegion = $_ENV["S3Region"]; # Northern Virginia
// Replace <something> with the name of your S3 bucket, e.g. wonderfulbali234.
$wgAWSBucketName = $_ENV["S3BucketName"];
$wgAWSBucketDomain = $_ENV["S3BucketDomain"];
$wgFileBackends['s3']['endpoint'] = $_ENV["S3Endpoint"];
$wgAWSRepoHashLevels = '2';
// If you anticipate using several hundred buckets, one per wiki, then it's probably better to use one bucket
// with the top level subdirectory as the wiki's name, and permissions properly configured of course.
// While there are no more performance losses by using such a scheme, it might make things messy. Hence, it's
// still a good idea to use one bucket per wiki unless you are approaching your 1,000 bucket per account limit.
$wgAWSBucketTopSubdirectory = ""; # leading slash is required
$wgResponsiveImages = false;
# Cloudflare CDN
# IP range: https://www.cloudflare.com/ips/
$wgUseCdn = true;
$wgCdnServersNoPurge = [
'173.245.48.0/20',
'103.21.244.0/22',
'103.22.200.0/22',
'103.31.4.0/22',
'141.101.64.0/18',
'108.162.192.0/18',
'190.93.240.0/20',
'188.114.96.0/20',
'197.234.240.0/22',
'198.41.128.0/17',
'162.158.0.0/15',
'104.16.0.0/13',
'104.24.0.0/14',
'172.64.0.0/13',
'131.0.72.0/22',
'2400:cb00::/32',
'2606:4700::/32',
'2803:f800::/32',
'2405:b500::/32',
'2405:8100::/32',
'2a06:98c0::/29',
'2c0f:f248::/32'
];
# MultiPurge config https://github.com/octfx/mediawiki-extensions-MultiPurge/
$wgMultiPurgeCloudFlareZoneId = $_ENV["wgMultiPurgeCloudFlareZoneId"];
$wgMultiPurgeCloudFlareApiToken = $_ENV["wgMultiPurgeCloudFlareApiToken"];
$wgMultiPurgeEnabledServices = [
'cloudflare'
];
$wgMultiPurgeServiceOrder = [
'cloudflare'
];
# PluggableAuth
$wgPluggableAuth_EnableAutoLogin = false;
$wgPluggableAuth_EnableLocalLogin = true;
$wgOpenIDConnect_MigrateUsersByEmail = true;
$wgOpenIDConnect_MigrateUsersByUserName = true;
$wgOpenIDConnect_SingleLogout = true;
$wgPluggableAuth_Config[] = [
'plugin' => 'OpenIDConnect',
'buttonLabelMessage' => '[建议使用]42KIT 注册/登录',
'data' => [
'providerURL' => $_ENV["OpenIDConnectProviderUrl"],
'clientID' => $_ENV["OpenIDConnectClientID"],
'clientsecret' => $_ENV["OpenIDConnectClientSecret"],
]
];