Repository navigation
Expand file tree
/
Copy pathconfig.sample.php
More file actions
282 lines (236 loc) · 10.4 KB
/
Copy pathconfig.sample.php
File metadata and controls
282 lines (236 loc) · 10.4 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
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
<?php
/**
* OPTV bootstrap guard — prevents direct access to template files.
* Every template starts with: defined('OPTV') or die();
* config.php is required by all entry points (index.php, player.php,
* api/index.php, meta-image.php, …), so defining it here means any file that
* loads config automatically sets the constant.
*/
if (!defined('OPTV')) {
define('OPTV', true);
}
/**
* Version Number
* (mostly used for refreshing cached resources of previous version)
* Example: "1.5"
* String
*/
$config["version"] = "";
/**
* The URI to your Open Parliament TV instance
* Example: https://de.openparliament.tv
*/
$config["dir"]["root"] = "";
/**
* Runtime state directory (absolute filesystem path). Holds everything the
* platform writes at runtime: caches, logs, import working files and the
* cloned parliament data repositories. Must be writable by the PHP user and
* is never served directly (it ships with a deny-all .htaccess).
* Leave empty to use the default: <platform root>/var
*/
$config["dir"]["var"] = "";
/**
* Display NER results in UI
* true or false
*/
$config["display"]["ner"] = true;
/**
* Speeches per page
* Number
*/
$config["display"]["speechesPerPage"] = 40;
/**
* Allow user to register
* true or false
*/
$config["allow"]["register"] = true;
/**
* Allow registered user to login
* true or false
*/
$config["allow"]["login"] = true;
/**
* Allow public access to all none administrative data and functions
* true or false
*/
$config["allow"]["publicAccess"] = true;
/**
* Enable the notifications & alerts feature (Plan B)
* Controls alert matching during imports and rendering of the bell / subscribe UI.
* true or false
*/
$config["allow"]["notifications"] = true;
/**
* Enable playlists
* Controls the playlist API, the /playlist and /manage/playlists pages, every "add to playlist" affordance, and the media player's queue panel with its header controls (skip-video buttons, queue toggle).
* true or false
*/
$config["allow"]["playlists"] = true;
/**
* Enable statistics
* Controls the /statistics page, the Statistics tab on entity, session, electoral period and agenda item pages, and public access to the statistics API. Switched off, the statistics API stays available to admins and the statistics index keeps being written.
* true or false
*/
$config["allow"]["statistics"] = true;
/**
* A complicated string to salt the user account password hashes
*/
$config["salt"] = "";
/**
* Available languages of the platform (translation files can be found at /lang/*.json
*/
$acceptLang = array(
"de"=>array(
"short"=>"de",
"name"=>"Deutsch",
"icon"=>"",
"default"=>true
),
"en"=>array(
"short"=>"en",
"name"=>"English",
"icon"=>""
)
);
/**
* for debugging and developing
* Example: "dev" or "production"
*/
$config["mode"] = "dev";
/**
* Mail Settings
*/
$config["mail"]["from"]["email"] = "noreply@openparliament.tv";
$config["mail"]["from"]["name"] = "Open Parliament TV";
$config["mail"]["replyto"] = "noreply@openparliament.tv";
// SMTP Configuration (optional - leave empty to use PHP mail())
$config["mail"]["smtp"]["enabled"] = false;
$config["mail"]["smtp"]["host"] = ""; // E.g. "smtp.gmail.com"
$config["mail"]["smtp"]["port"] = 587; // 587 for TLS, 465 for SSL, 25 for no encryption
$config["mail"]["smtp"]["username"] = "";
$config["mail"]["smtp"]["password"] = "";
$config["mail"]["smtp"]["encryption"] = "tls"; // "tls", "ssl", or "" for no encryption
// Development Mode: When $config["mode"] is "dev", emails are saved to files instead of being sent
$config["mail"]["dev"]["file_path"] = ""; // Leave empty for the default (<var>/log/mail)
/**
* Executables
*/
$config["bin"]["git"] = "git";
$config["bin"]["php"] = "php";
/**
* Additional Data Service of OPTV
*/
$config["ads"]["api"]["uri"] = "";
$config["ads"]["api"]["key"] = "";
/**
* Local cache directory (absolute filesystem path) for downloaded & optimized
* entity thumbnails (Wikimedia Commons images served via the local image proxy).
* Leave empty to use the default: <var directory>/cache/images
*
* The generated meta-image cards are cached in a sibling directory
* (<imageCache>/../meta-images), so a custom path here moves both.
*/
$config["dir"]["imageCache"] = "";
/**
* Platform Database (mariadb/MySQL) information
*/
$config["platform"]["sql"]["access"]["host"] = "";
$config["platform"]["sql"]["access"]["user"] = "";
$config["platform"]["sql"]["access"]["passwd"] = "";
$config["platform"]["sql"]["db"] = "";
$config["platform"]["sql"]["tbl"]["Organisation"] = "organisation";
$config["platform"]["sql"]["tbl"]["Term"] = "term";
$config["platform"]["sql"]["tbl"]["Document"] = "document";
$config["platform"]["sql"]["tbl"]["Person"] = "person";
$config["platform"]["sql"]["tbl"]["Auth"] = "auth";
$config["platform"]["sql"]["tbl"]["Conflict"] = "conflict";
$config["platform"]["sql"]["tbl"]["ConflictMedia"] = "conflict_media";
$config["platform"]["sql"]["tbl"]["Entitysuggestion"] = "entitysuggestion";
$config["platform"]["sql"]["tbl"]["User"] = "user";
$config["platform"]["sql"]["tbl"]["Alert"] = "alert";
$config["platform"]["sql"]["tbl"]["Notification"] = "notification";
$config["platform"]["sql"]["tbl"]["SystemMessage"] = "system_message";
$config["platform"]["sql"]["tbl"]["NotificationPreference"] = "notification_preference";
$config["platform"]["sql"]["tbl"]["ApiRateLimit"] = "apiratelimit";
$config["platform"]["sql"]["tbl"]["ApiKey"] = "apikey";
$config["platform"]["sql"]["tbl"]["EntityRemap"] = "entity_remap";
$config["platform"]["sql"]["tbl"]["Playlist"] = "playlist";
$config["platform"]["sql"]["tbl"]["PlaylistItem"] = "playlist_item";
/**
* Request rate limiting. Two independent surfaces, both DB-backed fixed-window
* (shared `apiratelimit` table, separate namespaces). Logged-in users and
* exemptIPs are exempt on both; the API also skips exemptActions.
*
* ["api"] — external API HTTP entry (api/v1/index.php). Internal apiV1()
* calls from page handlers are never limited. A request carrying a
* valid API key (X-API-Key header or ?apikey=) is counted per key
* rather than per IP, at keyedLimit or the key's own ApiKeyRateLimit;
* the session/exemptIPs exemptions do not apply to it. Keys are
* issued under /manage/settings and only raise the limit — they grant
* no additional access.
* ["pages"] — web router entry (index.php). Static files, AJAX fragments and
* the image proxy are served directly by Apache and NOT counted,
* so this only caps true page navigations (coarse anti-scrape).
*/
$config["rateLimit"]["api"]["enabled"] = true;
$config["rateLimit"]["api"]["window"] = 60; // seconds
$config["rateLimit"]["api"]["limit"] = 240; // requests per window per client IP
$config["rateLimit"]["api"]["keyedLimit"] = 2000; // requests per window for a request carrying a valid API key (used when ApiKeyRateLimit is NULL)
$config["rateLimit"]["api"]["trustProxy"] = false; // honor X-Forwarded-For / CF-Connecting-IP (only behind a trusted proxy)
$config["rateLimit"]["api"]["exemptActions"] = ["autocomplete", "status", "lang", "systemMessage", "notification"];
$config["rateLimit"]["api"]["exemptIPs"] = [];
$config["rateLimit"]["pages"]["enabled"] = true;
$config["rateLimit"]["pages"]["window"] = 60; // seconds
$config["rateLimit"]["pages"]["limit"] = 200; // page requests per window per client IP
$config["rateLimit"]["pages"]["trustProxy"] = false;
$config["rateLimit"]["pages"]["exemptIPs"] = [];
/**
* Parliament Database information
* This is an example for a parliament called "DE" (as it can be seen by the key ["DE"] at the object $config["parliament"])
* There also can be multiple parliaments available at the platform by duplicating the configuration under different keys
*/
$config["parliament"]["DE"]["label"] = ""; //E.g. "Deutscher Bundestag"
$config["parliament"]["DE"]["sql"]["access"]["host"] = "";
$config["parliament"]["DE"]["sql"]["access"]["user"] = "";
$config["parliament"]["DE"]["sql"]["access"]["passwd"] = "";
$config["parliament"]["DE"]["sql"]["db"] = "";
$config["parliament"]["DE"]["sql"]["tbl"]["AgendaItem"] = "agendaitem";
$config["parliament"]["DE"]["sql"]["tbl"]["ElectoralPeriod"] = "electoralperiod";
$config["parliament"]["DE"]["sql"]["tbl"]["Session"] = "session";
$config["parliament"]["DE"]["sql"]["tbl"]["Media"] = "media";
$config["parliament"]["DE"]["sql"]["tbl"]["Annotation"] = "annotation";
$config["parliament"]["DE"]["sql"]["tbl"]["Text"] = "text";
$config["parliament"]["DE"]["git"]["repository"] = ""; //e.g. https://github.com/OpenParliamentTV/OpenParliamentTV-Data-DE.git
$config["parliament"]["DE"]["OpenSearch"]["index"] = "de"; // openparliamenttv_THIS
// Language of this parliament's transcripts. Selects the stopword list in
// $config["statistics"]["stopwords"] when a transcript does not declare its own.
$config["parliament"]["DE"]["statistics"]["language"] = "de";
// OpenSearch stemmer used to group word forms in the statistics index, so that
// "Flüchtling" and "Flüchtlinge" are one trend line. Leave unset for no stemming:
// grouping then falls back to exact matching and everything keeps working.
$config["parliament"]["DE"]["statistics"]["stemFilter"] = "light_german";
/**
* Statistics
* Minimum word length for word-frequency statistics, in CHARACTERS. This is the
* single length rule the word filter applies; anything shorter is dropped, and
* anything longer is only dropped if it is on the stopword list for its language
* (those live in api/v1/config-api.php). Three suits German; a language that
* writes shorter words meaningfully would want less.
*
* Whether statistics are shown is $config["allow"]["statistics"]; whether they have data is observed. The statistics index existing means it is set up, and the search index carrying the cleanText field means distinctive-word features can run.
*/
$config["statistics"]["minWordLength"] = 3;
/**
* Configuration for the OpenSearch server
*/
$config["OpenSearch"]["hosts"] = []; // E.g. ["https://@localhost:9200"]
$config["OpenSearch"]["BasicAuthentication"]["user"] = "";
$config["OpenSearch"]["BasicAuthentication"]["passwd"] = "";
$config["OpenSearch"]["SSL"]["pem"] = ""; // E.g. realpath(__DIR__."/../opensearch-root-ssl.pem");
/**
* Customization
*/
$config["customization"]["wordmark"] = ""; //e.g. "Open <b>Parliament TV</b>"
// Include API config
require_once(__DIR__."/api/v1/config-api.php");
?>