-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathLocalSettings.php
More file actions
149 lines (124 loc) · 5.09 KB
/
LocalSettings.php
File metadata and controls
149 lines (124 loc) · 5.09 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
<?php
/*******************************/
/* Enable Federated properties */
/*******************************/
#$wgWBRepoSettings['federatedPropertiesEnabled'] = true;
/*******************************/
/* Enables ConfirmEdit Captcha */
/*******************************/
#wfLoadExtension( 'ConfirmEdit/QuestyCaptcha' );
#$wgCaptchaQuestions = [
# 'What animal' => 'dog',
#];
#$wgCaptchaTriggers['edit'] = true;
#$wgCaptchaTriggers['create'] = true;
#$wgCaptchaTriggers['createtalk'] = true;
#$wgCaptchaTriggers['addurl'] = true;
#$wgCaptchaTriggers['createaccount'] = true;
#$wgCaptchaTriggers['badlogin'] = true;
/*******************************/
/* Disable UI error-reporting */
/*******************************/
#ini_set( 'display_errors', 0 );
# Increase the memory limit
ini_set('memory_limit', '1536M');
# Disallow anonymous editing
$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['user']['edit'] = false;
$wgGroupPermissions['editor']['edit'] = true;
$wgGroupPermissions['sysop']['edit'] = true;
# Disallow anonymous viewing as well!
#${DOLLAR}wgGroupPermissions['*']['read'] = false;
#${DOLLAR}wgGroupPermissions['user']['read'] = true;
# And don't let users create their own accounts!
$wgGroupPermissions['*']['createaccount'] = false;
$wgGroupPermissions['sysop']['createaccount'] = true;
$wgFavicon = 'https://linkedopendata.eu/w/images/4/4e/Icon-Logo_EU_knowledgegraph.png';
$wgLogos = [
'1x' => 'https://linkedopendata.eu/w/images/9/98/1x-Logo_EU_knowledgegraph.png',
'1.5x' => 'https://linkedopendata.eu/w/images/b/bc/1.5x-Logo_EU_knowledgegraph.png',
'2x' => 'https://linkedopendata.eu/w/images/5/5b/2x-Logo_EU_knowledgegraph.png',
'icon' => 'https://linkedopendata.eu/w/images/4/4e/Icon-Logo_EU_knowledgegraph.png'
];
# set the name of the site
$wgSitename = "EU Knowledge Graph";
# enable file upload
$wgEnableUploads = true;
# Add this to separate the identifiers in a separate section
$wgWBRepoSettings['statementSections'] = array(
'item' => array(
'statements' => null,
'identifiers' => array(
'type' => 'dataType',
'dataTypes' => array( 'external-id' ),
),
),
);
#Enable Kartographer
wfLoadExtension( 'JsonConfig' );
wfLoadExtension( 'Kartographer' );
$wgKartographerMapServer = 'https://a.tile.openstreetmap.org';
$wgKartographerDfltStyle = '';
$wgKartographerSrcsetScales = [1];
$wgKartographerStyles = [];
$wgKartographerUseMarkerStyle = true;
$wgWBRepoSettings['useKartographerGlobeCoordinateFormatter'] = true;
# Allow longer strings
$wgWBRepoSettings['string-limits'] = array (
'multilang' => array (
'length' => 400, // length constraint
),
'VT:monolingualtext' => array (
'length' => 5000, // length constraint
),
'VT:string' => array (
'length' => 5000, // length constraint
),
'PT:url' => array (
'length' => 500,
),
);
# Setting formatter url
$wgWBRepoSettings['formatterUrlProperty'] = 'P877';
# Activate constrain plugin
wfLoadExtension( 'WikibaseQualityConstraints' );
#CAS
$wgOAuth2Client['client']['id'] = $_ENV["CAS_CLIENT_ID"];
$wgOAuth2Client['client']['secret'] = $_ENV["CAS_CLIENT_SECRET"];
$wgOAuth2Client['configuration']['authorize_endpoint'] = 'https://ecas.ec.europa.eu/cas/oauth2/authorize'; // Authorization URL
$wgOAuth2Client['configuration']['access_token_endpoint'] = 'https://ecas.ec.europa.eu/cas/oauth2/token'; // Token URL
$wgOAuth2Client['configuration']['api_endpoint'] = 'https://ecas.ec.europa.eu/cas/oauth2'; // URL to fetch user JSON
$wgOAuth2Client['configuration']['redirect_uri'] = 'http://linkedopendata.eu/wiki/Special:OAuth2Client/callback'; // URL for OAuth2 server to redirect to
$wgOAuth2Client['configuration']['username'] = 'user.name'; // JSON path to username
$wgOAuth2Client['configuration']['email'] = 'user.email'; // JSON path to email
$wgOAuth2Client['configuration']['scopes'] = 'openid email profile';
#CAS Authentication
require_once "$IP/extensions/CASAuth/CASAuth.php";
#External Storage for Text/Blob table
$wgExternalStores = [ 'DB' ];
$wgExternalServers = [ 'externalStorage01' => [
[ 'host' => $_ENV["EXTERNAL_STORAGE_SERVICE"], 'user' => 'admin', 'password' =>$_ENV["EXTERNAL_STORAGE_PASSWORD"], 'dbname' => 'my_wiki', 'type' => "mysql", 'load' => 1 ]
] ];
$wgDefaultExternalStore = [ 'DB://externalStorage01' ];
#Enable the compression
$wgCompressRevisions = true;
#Open external links in new tab
$wgExternalLinkTarget = '_blank';
# Activate batch ingestion plugin
wfLoadExtension( 'BatchIngestion' );
# plugins needed to render some templates related to SPARQL examples
wfLoadExtension( 'TemplateData' );
wfLoadExtension( 'TemplateStyles' );
wfLoadExtension( 'SyntaxHighlight_GeSHi' );
wfLoadExtension( 'ParserFunctions' );
wfLoadExtension( 'WikibaseSync' );
$wgWikibaseSyncUrl = 'https://wikibase-sync.linkedopendata.eu';
$wgApiKey = 'nafcyg-Pihceb-1xokji';
$wgQID = 'P1';
$wgPID = 'P2';
$wgOpen = true;
# Enable wikimedia commons images
$wgUseInstantCommons = true;
$wgShowExceptionDetails = true;
$wgDefaultSkin = 'vector';
$wgRestAPIAdditionalRouteFiles[] = 'extensions/Wikibase/repo/rest-api/routes.json';