/
application.conf
501 lines (425 loc) · 20.1 KB
/
application.conf
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
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
akka {
log-config-on-start = off
log-config-on-start = ${?KNORA_AKKA_LOG_CONFIG_ON_START}
loggers = ["akka.event.slf4j.Slf4jLogger"]
loglevel = "ERROR"
loglevel = ${?KNORA_AKKA_LOGLEVEL}
stdout-loglevel = "ERROR"
stdout-loglevel = ${?KNORA_AKKA_STDOUT_LOGLEVEL}
logging-filter = "akka.event.slf4j.Slf4jLoggingFilter"
log-dead-letters = off
log-dead-letters-during-shutdown = off
// akka-http configuration
http {
server {
# The requested maximum length of the queue of incoming connections.
# If the server is busy and the backlog is full the OS will start dropping
# SYN-packets and connection attempts may fail. Note, that the backlog
# size is usually only a maximum size hint for the OS and the OS can
# restrict the number further based on global limits.
backlog = 1024
# The time after which an idle connection will be automatically closed.
# Set to `infinite` to completely disable idle connection timeouts.
#
# Must be larger then request-timeout
idle-timeout = 120 minutes
# Defines the default time period within which the application has to
# produce an HttpResponse for any given HttpRequest it received.
# The timeout begins to run when the *end* of the request has been
# received, so even potentially long uploads can have a short timeout.
# Set to `infinite` to completely disable request timeout checking.
#
# If this setting is not `infinite` the HTTP server layer attaches a
# `Timeout-Access` header to the request, which enables programmatic
# customization of the timeout period and timeout response for each
# request individually.
#
# Must be smaller then idle-timeout
request-timeout = 120 minutes
# The time period within which the TCP binding process must be completed.
bind-timeout = 5 seconds
# The maximum number of concurrently accepted connections when using the
# `Http().bindAndHandle` methods.
#
# This setting doesn't apply to the `Http().bind` method which will still
# deliver an unlimited backpressured stream of incoming connections.
#
# Note, that this setting limits the number of the connections on a best-effort basis.
# It does *not* strictly guarantee that the number of established TCP connections will never
# exceed the limit (but it will be approximately correct) because connection termination happens
# asynchronously. It also does *not* guarantee that the number of concurrently active handler
# flow materializations will never exceed the limit for the reason that it is impossible to reliably
# detect when a materialization has ended.
max-connections = 1024
# The maximum number of requests that are accepted (and dispatched to
# the application) on one single connection before the first request
# has to be completed.
# Incoming requests that would cause the pipelining limit to be exceeded
# are not read from the connections socket so as to build up "back-pressure"
# to the client via TCP flow control.
# A setting of 1 disables HTTP pipelining, since only one request per
# connection can be "open" (i.e. being processed by the application) at any
# time. Set to higher values to enable HTTP pipelining.
# This value must be > 0 and <= 1024.
pipelining-limit = 1
parsing {
max-content-length = 110M
# Defines the maximum length of the URL
# Set to 10k because Sparql queries for the extended search v2 are submitted as segments of the URL
max-uri-length = 10k
}
}
client {
# The time period within which the TCP connecting process must be completed.
connecting-timeout = 479999 ms // 480 s
# The time after which an idle connection will be automatically closed.
# Set to `infinite` to completely disable idle timeouts.
idle-timeout = 479999 ms // 480 s
parsing {
max-chunk-size = 2m
max-response-reason-length = 1024
}
}
host-connection-pool {
# The maximum number of parallel connections that a connection pool to a
# single host endpoint is allowed to establish. Must be greater than zero.
max-connections = 15
# The minimum number of parallel connections that a pool should keep alive ("hot").
# If the number of connections is falling below the given threshold, new ones are being spawned.
# You can use this setting to build a hot pool of "always on" connections.
# Default is 0, meaning there might be no active connection at given moment.
# Keep in mind that `min-connections` should be smaller than `max-connections` or equal
min-connections = 0
# The maximum number of times failed requests are attempted again,
# (if the request can be safely retried) before giving up and returning an error.
# Set to zero to completely disable request retries.
max-retries = 3
# The maximum number of open requests accepted into the pool across all
# materializations of any of its client flows.
# Protects against (accidentally) overloading a single pool with too many client flow materializations.
# Note that with N concurrent materializations the max number of open request in the pool
# will never exceed N * max-connections * pipelining-limit.
# Must be a power of 2 and > 0!
max-open-requests = 64
# The maximum number of requests that are dispatched to the target host in
# batch-mode across a single connection (HTTP pipelining).
# A setting of 1 disables HTTP pipelining, since only one request per
# connection can be "in flight" at any time.
# Set to higher values to enable HTTP pipelining.
# This value must be > 0.
# (Note that, independently of this setting, pipelining will never be done
# on a connection that still has a non-idempotent request in flight.
#
# Before increasing this value, make sure you understand the effects of head-of-line blocking.
# Using a connection pool, a request may be issued on a connection where a previous
# long-running request hasn't finished yet. The response to the pipelined requests may then be stuck
# behind the response of the long-running previous requests on the server. This may introduce an
# unwanted "coupling" of run time between otherwise unrelated requests.
#
# See http://tools.ietf.org/html/rfc7230#section-6.3.2 for more info.)
pipelining-limit = 1
# The time after which an idle connection pool (without pending requests)
# will automatically terminate itself. Set to `infinite` to completely disable idle timeouts.
idle-timeout = 30 s
# Modify to tweak client settings for host connection pools only.
#
# IMPORTANT:
# Please note that this section mirrors `akka.http.client` however is used only for pool-based APIs,
# such as `Http().superPool` or `Http().singleRequest`.
client = {
# no overrides, see `akka.http.client` for used values
}
}
}
}
// all responder actors should run on this dispatcher
knora-actor-dispatcher {
type = Dispatcher
executor = "fork-join-executor"
# Configuration for the fork join pool
fork-join-executor {
parallelism-min = 8
parallelism-factor = 2.0
parallelism-max = 32
}
throughput = 5
}
// any futures or blocking code should run on this dispatcher
knora-blocking-dispatcher {
type = Dispatcher
executor = "thread-pool-executor"
thread-pool-executor {
core-pool-size-min = 8
core-pool-size-factor = 2.0
core-pool-size-max = 32
}
throughput = 1
}
akka-http-cors {
# If enabled, allow generic requests (that are outside the scope of the specification)
# to pass through the directive. Else, strict CORS filtering is applied and any
# invalid request will be rejected.
allow-generic-http-requests = yes
# Indicates whether the resource supports user credentials. If enabled, the header
# `Access-Control-Allow-Credentials` is set in the response, indicating that the
# actual request can include user credentials. Examples of user credentials are:
# cookies, HTTP authentication or client-side certificates.
allow-credentials = yes
# List of origins that the CORS filter must allow. Can also be set to `*` to allow
# access to the resource from any origin. Controls the content of the
# `Access-Control-Allow-Origin` response header: if parameter is `*` and credentials
# are not allowed, a `*` is set in `Access-Control-Allow-Origin`. Otherwise, the
# origins given in the `Origin` request header are echoed.
#
# Hostname starting with `*.` will match any sub-domain.
# The scheme and the port are always strictly matched.
#
# The actual or preflight request is rejected if any of the origins from the request
# is not allowed.
allowed-origins = "*"
# List of request headers that can be used when making an actual request. Controls
# the content of the `Access-Control-Allow-Headers` header in a preflight response:
# if parameter is `*`, the headers from `Access-Control-Request-Headers` are echoed.
# Otherwise the parameter list is returned as part of the header.
allowed-headers = "*"
# List of methods that can be used when making an actual request. The list is
# returned as part of the `Access-Control-Allow-Methods` preflight response header.
#
# The preflight request will be rejected if the `Access-Control-Request-Method`
# header's method is not part of the list.
allowed-methods = ["GET", "PUT", "POST", "DELETE", "PATCH", "HEAD", "OPTIONS"]
# List of headers (other than simple response headers) that browsers are allowed to access.
# If not empty, this list is returned as part of the `Access-Control-Expose-Headers`
# header in the actual response.
exposed-headers = ["Server"]
# When set, the amount of seconds the browser is allowed to cache the results of a preflight request.
# This value is returned as part of the `Access-Control-Max-Age` preflight response header.
# If `null`, the header is not added to the preflight response.
max-age = 1800 seconds
}
app {
print-extended-config = false // If true, an extended list of configuration parameters will be printed out at startup.
print-extended-config = ${?KNORA_WEBAPI_PRINT_EXTENDED_CONFIG}
// default ask timeout. can be same or lower then akka.http.server.request-timeout.
default-timeout = 120 minutes // a timeout here should never happen
// If true, log all messages sent from and received by routes. Since messages are logged at DEBUG level, you will
// need to set loglevel = "DEBUG" in the akka section of this file, and <root level="DEBUG"> in logback.xml.
dump-messages = false
show-internal-errors = true // If true, clients will see error messages from internal errors. Useful for debugging. If false, those error messages will appear only in the log.
bcrypt-password-strength = 12 // Value range is 4-31.
bcrypt-password-strength = ${?KNORA_WEBAPI_BCRYPT_PASSWORD_STRENGTH}
// the JSON Web Token secret which should be changed.
jwt-secret-key = "UP 4888, nice 4-8-4 steam engine"
jwt-secret-key = ${?KNORA_WEBAPI_JWT_SECRET_KEY}
// the JSON Web Token longevity
jwt-longevity = 30 days
jwt-longevity = ${?KNORA_WEBAPI_JWT_LONGEVITY}
// this domain will be set in the session cookie. needs to be set to the parent domain
// under which webapi and sipi will run, i.e. example.com if 'api.example.com' and 'iiif.example.com'
// are used for webapi and sipi.
cookie-domain = "0.0.0.0"
cookie-domain = ${?KNORA_WEBAPI_COOKIE_DOMAIN}
// DANGER: If true, will accept messages to the /admin/store route, which allows to restore the contend of the triplestore
allow-reload-over-http = false
allow-reload-over-http = ${?KNORA_WEBAPI_ALLOW_RELOAD_OVER_HTTP}
fallback-language = "en"
knora-api {
// relevant for direct communication inside the knora stack
internal-host = "0.0.0.0"
internal-host = ${?KNORA_WEBAPI_KNORA_API_INTERNAL_HOST}
internal-port = 3333
internal-port = ${?KNORA_WEBAPI_KNORA_API_INTERNAL_PORT}
// relevant for the client, i.e. browser
external-protocol = "http" // optional ssl termination needs to be done by the proxy
external-protocol = ${?KNORA_WEBAPI_KNORA_API_EXTERNAL_PROTOCOL}
external-host = "0.0.0.0"
external-host = ${?KNORA_WEBAPI_KNORA_API_EXTERNAL_HOST}
external-port = 3333
external-port = ${?KNORA_WEBAPI_KNORA_API_EXTERNAL_PORT}
external-zio-port = 5555
}
sipi {
// relevant for direct communication inside the knora stack
internal-protocol = "http"
internal-protocol = ${?KNORA_WEBAPI_SIPI_INTERNAL_PROTOCOL}
internal-host = "0.0.0.0"
internal-host = ${?KNORA_WEBAPI_SIPI_INTERNAL_HOST}
internal-port = 1024
internal-port = ${?KNORA_WEBAPI_SIPI_INTERNAL_PORT}
timeout = 120 seconds
// relevant for the client, i.e. browser
external-protocol = "http"
external-protocol = ${?KNORA_WEBAPI_SIPI_EXTERNAL_PROTOCOL}
external-host = "0.0.0.0"
external-host = ${?KNORA_WEBAPI_SIPI_EXTERNAL_HOST}
external-port = 1024
external-port = ${?KNORA_WEBAPI_SIPI_EXTERNAL_PORT}
file-server-path = "server"
move-file-route = "store"
delete-temp-file-route = "delete_temp_file"
image-mime-types = ["image/tiff", "image/jpeg", "image/png", "image/jp2", "image/jpx"]
document-mime-types = [
"application/pdf",
"application/msword",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"application/vnd.ms-excel",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"application/vnd.ms-powerpoint",
"application/vnd.openxmlformats-officedocument.presentationml.presentation",
]
text-mime-types = ["application/xml", "text/xml", "text/csv", "text/plain"]
video-mime-types = ["video/mp4"]
audio-mime-types = ["audio/mpeg", "audio/wav", "audio/x-wav", "audio/vnd.wave"]
archive-mime-types = [
"application/zip",
"application/x-tar",
"application/gzip",
"application/x-7z-compressed",
"application/x-compress"
]
}
ark {
resolver = "http://0.0.0.0:3336"
resolver = ${?KNORA_WEBAPI_ARK_RESOLVER_URL}
assigned-number = 72163
assigned-number = ${?KNORA_WEBAPI_ARK_NAAN}
}
salsah1 {
base-url = "http://0.0.0.0:3335/"
base-url = ${?KNORA_WEBAPI_SALSAH1_BASE_URL}
project-icons-basepath = "project-icons/"
}
// http://www.ehcache.org/apidocs/2.10/index.html
caches = [
{
cache-name = "ontologyCache"
max-elements-in-memory = 0
overflow-to-disk = false
eternal = true
time-to-live-seconds = 0
time-to-idle-seconds = 0
},
{
cache-name = "userProfileCache"
max-elements-in-memory = 0
overflow-to-disk = false
eternal = true
time-to-live-seconds = 600
time-to-idle-seconds = 0
},
{
cache-name = "userADMCache"
max-elements-in-memory = 0
overflow-to-disk = false
eternal = true
time-to-live-seconds = 600
time-to-idle-seconds = 0
},
{
cache-name = "permissionsCache"
max-elements-in-memory = 0
overflow-to-disk = false
eternal = true
time-to-live-seconds = 0
time-to-idle-seconds = 0
},
{
cache-name = "authenticationInvalidationCache"
max-elements-in-memory = 0
overflow-to-disk = false
eternal = true
time-to-live-seconds = 2592000
time-to-idle-seconds = 0
},
{
cache-name = "mappingCache"
max-elements-in-memory = 0
overflow-to-disk = false
eternal = true
time-to-live-seconds = 600
time-to-idle-seconds = 0
},
{
cache-name = "xsltCache"
max-elements-in-memory = 100
overflow-to-disk = false
eternal = true
time-to-live-seconds = 600
time-to-idle-seconds = 0
}
]
tmp-datadir = "/tmp/webapi_tmp/" // dir must exist on disk!
datadir = "/tmp/webapi/" // dir must exist on disk!
max-results-per-search-result-page = 500
standoff-per-page = 100 // the number of standoff tags to be returned per page
v2 {
resources-sequence {
results-per-page = 25 // results to be returned per page
},
fulltext-search {
search-value-min-length = 3
},
graph-route {
default-graph-depth = 4
max-graph-depth = 10
max-graph-breadth = 50
}
}
gui {
// The default size of resource type icons. TODO: put icon sizes in the triplestore instead.
default-icon-size {
dim-x = 32
dim-y = 32
}
}
# Array containing route paths which should be rejected. This can be used to selectively disable routes
# in the configuration.
routes-to-reject = []
triplestore {
dbtype = "fuseki"
dbtype = ${?KNORA_WEBAPI_TRIPLESTORE_DBTYPE}
use-https = false
use-https = ${?KNORA_WEBAPI_TRIPLESTORE_USE_HTTPS}
host = "localhost"
host = ${?KNORA_WEBAPI_TRIPLESTORE_HOST}
// timeout for triplestore queries. can be same or lower then akka.http.server.request-timeout.
query-timeout = 20 seconds
// timeout for Gravsearch queries. can be same or lower then akka.http.server.request-timeout.
gravsearch-timeout = 120 seconds
// triplestore auto init. initialize triplestore at startup if necessary.
auto-init = false
auto-init = ${?KNORA_WEBAPI_TRIPLESTORE_AUTOINIT}
fuseki {
port = 3030
port = ${?KNORA_WEBAPI_TRIPLESTORE_FUSEKI_PORT}
repository-name = "knora-test"
repository-name = ${?KNORA_WEBAPI_TRIPLESTORE_FUSEKI_REPOSITORY_NAME}
username = "admin"
username = ${?KNORA_WEBAPI_TRIPLESTORE_FUSEKI_USERNAME}
password = "test"
password = ${?KNORA_WEBAPI_TRIPLESTORE_FUSEKI_PASSWORD}
}
// If true, the time taken by each SPARQL query is logged at DEBUG level. To see these messages,
// set loglevel = "DEBUG" above, and
// <logger name="org.knora.webapi.store.triplestore.http.HttpTriplestoreConnector" level="DEBUG"/>
// in logback.xml.
profile-queries = false
}
shacl {
# The directory that SHACL shapes are loaded from.
shapes-dir = "../test_data/shacl"
shapes-dir = ${?KNORA_WEBAPI_SHACLE_SHAPES_DIR}
}
cache-service {
enabled = true
enabled = ${?KNORA_WEBAPI_CACHE_SERVICE_ENABLED}
}
client-test-data-service {
collect-client-test-data = false
}
instrumentation-server-config {
port = 3339
port = ${?KNORA_INSTRUMENTATION_SERVER_PORT}
interval = 5 seconds
}
}