forked from miraheze/mw-config
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDatabase.php
89 lines (82 loc) · 2.48 KB
/
Database.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
<?php
$wgLBFactoryConf = [
'class' => \Wikimedia\Rdbms\LBFactoryMulti::class,
'secret' => $wgSecretKey,
'sectionsByDB' => $wi->wikiDBClusters,
'sectionLoads' => [
'DEFAULT' => [
'db131' => 0,
],
'c1' => [
'db131' => 0,
],
'c2' => [
'db101' => 0,
],
'c3' => [
'db142' => 0,
],
'c4' => [
'db121' => 0,
],
'c5' => [
'db131' => 0,
],
],
'serverTemplate' => [
'dbname' => $wgDBname,
'user' => $wgDBuser,
'password' => $wgDBpassword,
'type' => 'mysql',
'ssl' => true,
'flags' => DBO_DEFAULT | ( $wgCommandLineMode ? DBO_DEBUG : 0 ),
'variables' => [
// https://mariadb.com/docs/reference/mdb/system-variables/innodb_lock_wait_timeout
'innodb_lock_wait_timeout' => 15,
],
/**
* MediaWiki checks if the certificate presented by MariaDB is signed
* by the certificate authority listed in 'sslCAFile'. In emergencies
* this could be set to /etc/ssl/certs/ca-certificates.crt (all trusted
* CAs), but setting this to one CA reduces attack vector and CAs
* to dig through when checking the certificate provided by MariaDB.
*/
'sslCAFile' => '/etc/ssl/certs/Sectigo.crt',
],
'hostsByName' => [
'db101' => 'db101.miraheze.org',
'db121' => 'db121.miraheze.org',
'db131' => 'db131.miraheze.org',
'db142' => 'db142.miraheze.org',
],
'externalLoads' => [
'beta' => [
/** where the metawikibeta database is located */
'db121' => 0,
],
'echo' => [
/** where the metawiki database is located */
'db131' => 0,
],
],
'readOnlyBySection' => [
// 'DEFAULT' => 'DC Switchover in progress. Please try again in a few minutes.',
// 'c1' => 'DC Switchover in progress. Please try again in a few minutes.',
// 'c2' => 'DC Switchover in progress. Please try again in a few minutes.',
// 'c3' => 'DC Switchover in progress. Please try again in a few minutes.',
// 'c4' => 'DC Switchover in progress. Please try again in a few minutes.',
// 'c5' => 'DC Switchover in progress. Please try again in a few minutes.',
],
];
// Disable LoadMonitor in CLI, it doesn't provide much value in CLI.
if ( PHP_SAPI === 'cli' ) {
$wgLBFactoryConf['loadMonitorClass'] = '\Wikimedia\Rdbms\LoadMonitorNull';
}
// Disallow web request database transactions that are slower than 10 seconds
$wgMaxUserDBWriteDuration = 10;
// Max execution time for expensive queries of special pages (in milliseconds)
$wgMaxExecutionTimeForExpensiveQueries = 30000;
$wgMiserMode = true;
// Compress revisions
$wgCompressRevisions = true;
$wgSQLMode = null;