/
sipi.knora-docker-no-auth-config.lua
223 lines (193 loc) · 6.2 KB
/
sipi.knora-docker-no-auth-config.lua
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
-- Copyright © 2015-2019 the contributors (see Contributors.md).
--
-- This file is part of Knora.
--
-- Knora is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published
-- by the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- Knora is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public
-- License along with Knora. If not, see <http://www.gnu.org/licenses/>.
--
-- configuration file for use with Knora
--
sipi = {
--
-- The user under which the Sipi server should run. Use this only if Sipi should setuid to a particular user after
-- starting. Otherwise, leave this commented out. If this setting is used, Sipi must be started as root.
--
-- userid = '_www',
--
-- Sipi's hostname as returned in the thumbnail response, default is "localhost".
-- If sipi is run behind a proxy, then this external FQDN needs to be set here.
--
hostname = '0.0.0.0',
--
-- port number the server is listening to
--
port = 1024,
--
-- Number of seconds a connection (socket) remains open
--
keep_alive = 5,
--
-- Maximal size of a post request
--
max_post_size = '30M',
--
-- indicates the path to the root of the image directory. Depending on the settings of the variable
-- "prefix_as_path" the images are search at <imgroot>/<prefix>/<imageid> (prefix_as_path = TRUE)
-- or <imgroot>/<imageid> (prefix_as_path = FALSE). Please note that "prefix" and "imageid" are
-- expected to be urlencoded. Both will be decoded. That is, "/" will be recoignized and expanded
-- in the final path the image file!
--
imgroot = '/sipi/images', -- directory for Knora Sipi integration testing
--
-- If FALSE, the prefix is not used to build the path to the image files
--
prefix_as_path = true,
--
-- Lua script which is executed on initialization of the Lua interpreter
--
initscript = '/sipi/scripts/sipi.init-knora-no-auth.lua',
--
-- path to the caching directory
--
cachedir = '/sipi/cache',
--
-- maxcimal size of the cache
--
cachesize = '100M',
--
-- if the cache becomes full, the given percentage of file space is marked for reuase
--
cache_hysteresis = 0.1,
--
-- Path to the directory where the scripts for the routes defined below are to be found
--
scriptdir = '/sipi/scripts',
---
--- Size of the thumbnails
---
thumb_size = 'pct:4',
--
-- Path to the temporary directory
--
tmpdir = '/tmp',
--
-- Path to Knora Application
--
knora_path = 'api',
--
-- In order not to accumulate to many files into one diretory (which slows down file
-- access considerabely), the images are stored in recursive subdirectories 'A'-'Z'.
-- If subdir_levels is equal 0, no subdirectories are used. The maximum is 6.
-- The recommandeation is that on average there should not me more than a few
-- thousand files in a unix directory (your mileage may vay depending on the
-- file system used).
--
subdir_levels = 0,
--
-- if subdir_levels is > 0 and if prefix_as_path is true, all prefixes will be
-- regarded as directories under imgroot. Thus, the subdirs 'A'-'Z' will be
-- created in these directories for the prefixes. However, it may make sense
-- for certain prefixes *not* to use subdirs. A list of these prefix-directories
-- can be given with this configuration parameter.
--
subdir_excludes = { "knora", "thumbs" },
--
-- Port of Knora Application
--
knora_port = '3333',
--
-- If compiled with SSL support, the port the server is listening for secure connections
--
-- ssl_port = 1025,
--
-- If compiled with SSL support, the path to the certificate (must be .pem file)
-- The follow commands can be used to generate a self-signed certificate
-- # openssl genrsa -out key.pem 2048
-- # openssl req -new -key key.pem -out csr.pem
-- #openssl req -x509 -days 365 -key key.pem -in csr.pem -out certificate.pem
--
-- ssl_certificate = '/sipi/certificate/certificate.pem',
--
-- If compiled with SSL support, the path to the key file (see above to create)
--
-- ssl_key = '/sipi/certificate/key.pem',
--
-- The secret for generating JWT's (JSON Web Tokens) (42 characters)
--
jwt_secret = 'UP 4888, nice 4-8-4 steam engine',
-- 12345678901234567890123456789012
--
-- Name of the logfile (a ".txt" is added...)
--
logfile = "sipi.log",
--
-- loglevel, one of "DEBUG", "INFO", "NOTICE", "WARNING", "ERR",
-- "CRIT", "ALERT", "EMERG"
--
loglevel = "DEBUG"
}
fileserver = {
--
-- directory where the documents for the normal webserver are located
--
docroot = '/sipi/server',
--
-- route under which the normal webserver shouöd respond to requests
--
wwwroute = '/server'
}
--
-- Custom routes. Each route is URL path associated with a Lua script.
--
routes = {
--{
-- method = 'POST',
-- route = '/Knora_login',
-- script = 'Knora_login.lua'
--},
--{
-- method = 'POST',
-- route = '/Knora_logout',
-- script = 'Knora_logout.lua'
--},
{
method = 'GET',
route = '/test_functions',
script = 'test_functions.lua'
},
{
method = 'GET',
route = '/test_file_info',
script = 'test_file_info.lua'
},
{
method = 'GET',
route = '/test_knora_session_cookie',
script = 'test_knora_session_cookie.lua'
},
{
method = 'POST',
route = '/upload',
script = 'upload.lua'
},
{
method = 'POST',
route = '/store',
script = 'store.lua'
},
{
method = 'DELETE',
route = '/delete_temp_file',
script = 'delete_temp_file.lua'
}
}