This repository was archived by the owner on May 16, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLocalSettings.php
More file actions
202 lines (156 loc) · 7.57 KB
/
LocalSettings.php
File metadata and controls
202 lines (156 loc) · 7.57 KB
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
<?php
# Protect against web entry
if ( !defined( 'MEDIAWIKI' ) ) { exit; }
$wgSitename = $_ENV["SITE_NAME"];
$wgMetaNamespace = "Project";
# Configured web paths & short URLs
# This allows use of the /wiki/* path
## https://www.mediawiki.org/wiki/Manual:Short_URL
$wgScriptPath = "/w"; // this should already have been configured this way
$wgArticlePath = "/wiki/$1";
## The protocol and server name to use in fully-qualified URLs
$wgServer = $_ENV["WG_SERVER"];
## The URL path to static resources (images, scripts, etc.)
$wgResourceBasePath = $wgScriptPath;
## The URL paths to the logo
$wgLogos = [ '1x' => "$wgResourceBasePath/resources/assets/logo.jpg" ];
$wgFavicon = "$wgResourceBasePath/resources/assets/favicon.ico";
## UPO means: this is also a user preference option
$wgEnableEmail = true;
$wgEnableUserEmail = true; # UPO
$wgEmergencyContact = "hello@inventaire.io";
$wgEnotifUserTalk = false; # UPO
$wgEnotifWatchlist = false; # UPO
$wgEmailAuthentication = true;
## Database settings
$wgDBtype = "mysql";
$wgDBserver = $_ENV["MYSQL_SERVER"];
$wgDBname = $_ENV["MYSQL_DATABASE"];
$wgDBuser = $_ENV["MYSQL_USER"];
$wgDBpassword = $_ENV["MYSQL_PASSWORD"];
# 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;
$wgImageMagickConvertCommand = "/usr/bin/convert";
// Tmp directory should be owned by www-data user
$wgTmpDirectory = '/tmp/mediawiki';
# InstantCommons allows wiki to use images from https://commons.wikimedia.org
# See https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:$wgUseInstantCommons
$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 publicly accessible from the web.
#$wgCacheDirectory = "$IP/cache";
# Site language code, should be one of the list in ./languages/data/Names.php
$wgLanguageCode = $_ENV["SITE_LANG"];
$wgSecretKey = $_ENV["SECRET_KEY"];
# 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 = "e5b45eb671248d69";
## 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/publicdomain/zero/1.0/";
$wgRightsText = "Creative Commons Zero (Public Domain)";
$wgRightsIcon = "$wgResourceBasePath/resources/assets/licenses/cc-0.png";
# Path to the GNU diff3 utility. Used for conflict resolution.
$wgDiff3 = "/usr/bin/diff3";
## 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( 'Vector' );
# End of automatically generated settings.
# Add more configuration options below.
$wgAllowExternalImages = true;
$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['*']['createaccount'] = false;
$wgDebugLogFile = "/var/log/mediawiki.log";
// See: https://www.mediawiki.org/wiki/Extension:SendGrid
$wgSendGridAPIKey = $_ENV["WG_SENDGRD_API_KEY"];
// git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/UniversalLanguageSelector.git
// See: https://www.mediawiki.org/wiki/Extension:UniversalLanguageSelector
# Translation extensions
$wgCCTrailerFilter = true;
$wgCCUserFilter = false;
$wgDefaultUserOptions['usenewrc'] = 1;
$wgLocalisationUpdateDirectory = "$IP/cache";
$wgGroupPermissions['user']['translate'] = true;
$wgGroupPermissions['user']['translate-messagereview'] = true;
$wgGroupPermissions['user']['translate-groupreview'] = true;
$wgGroupPermissions['user']['translate-import'] = true;
$wgGroupPermissions['user']['skipcaptcha'] = true;
$wgGroupPermissions['user']['pagelang'] = true;
$wgGroupPermissions['sysop']['pagetranslation'] = true;
$wgGroupPermissions['sysop']['translate-manage'] = true;
$wgGroupPermissions['bureaucrat']['deletebatch'] = false;
$wgGroupPermissions['sysop']['deletebatch'] = true;
// How to translate step by step guide: https://www.mediawiki.org/wiki/Help:Extension:Translate/Page_translation_example
$wgEnablePageTranslation = true;
$wgTranslatePageTranslationULS = false;
$wgPageLanguageUseDB = true; // manually changing page language
$wgScribuntoDefaultEngine = 'luastandalone';
$invHost = $_ENV['INV_HOST'];
// Remove login links from all pages
// https://www.mediawiki.org/wiki/Manual:Preventing_access#Removing_the_Login_link_from_all_pages
function NoLoginLinkOnMainPage( &$personal_urls ){
unset( $personal_urls['login'] );
unset( $personal_urls['anonlogin'] );
return true;
}
$wgHooks['PersonalUrls'][]='NoLoginLinkOnMainPage';
$wgOAuth2Client['client']['id'] = $_ENV['OAUTH_CLIENT_ID']; // The client ID assigned to you by the provider
$wgOAuth2Client['client']['secret'] = $_ENV['OAUTH_CLIENT_SECRET']; // The client secret assigned to you by the provider
$wgOAuth2Client['configuration']['authorize_endpoint'] = "$invHost/authorize";
$wgOAuth2Client['configuration']['access_token_endpoint'] = "$invHost/api/oauth/token";
$wgOAuth2Client['configuration']['api_endpoint'] = "$invHost/api/user";
$wgOAuth2Client['configuration']['redirect_uri'] = "$wgServer/wiki/Special:OAuth2Client/callback";
// Using the stableUsername as it will then be used as the user identifier by mediawiki
// To change a user username, you would thus need to simultaneously rename the mediawiki user
// (using the not yet installed https://www.mediawiki.org/wiki/Extension:Renameuser)
// and update their 'stableUsername' in the Inventaire user database
$wgOAuth2Client['configuration']['username'] = 'stableUsername'; // JSON path to stableUsername in the api_endpoint response
$wgOAuth2Client['configuration']['email'] = 'email'; // JSON path to email in the api_endpoint response
$wgOAuth2Client['configuration']['scopes'] = 'stable-username email';
$wgOAuth2Client['configuration']['service_name'] = $wgSitename;
$wgOAuth2Client['configuration']['service_login_link_text'] = "Login with Inventaire";
$wgCookieSecure = true;
$wgCookieSameSite = 'Lax';
wfLoadExtension( 'Babel' );
wfLoadExtension( 'Cite' );
wfLoadExtension( 'cldr' );
wfLoadExtension( 'CleanChanges' );
wfLoadExtension( 'CodeEditor' );
wfLoadExtension( 'DeleteBatch' );
wfLoadExtension( 'ExternalData' );
wfLoadExtension( 'LocalisationUpdate' );
wfLoadExtension( 'MobileFrontend' );
wfLoadExtension( 'MW-OAuth2Client' );
wfLoadExtension( 'ParserFunctions' );
wfLoadExtension( 'Scribunto' );
wfLoadExtension( 'SendGrid' );
wfLoadExtension( 'SyntaxHighlight_GeSHi' );
wfLoadExtension( 'TemplateStyles' );
wfLoadExtension( 'Translate' );
wfLoadExtension( 'UniversalLanguageSelector' );
wfLoadExtension( 'WikiEditor' );