This repository has been archived by the owner on Dec 18, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathakara.conf.template
328 lines (289 loc) · 11.3 KB
/
akara.conf.template
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
# -*- mode: python -*-
# This is the main Akara server configuration file. It contains
# settings for the server and for its extension modules.
# This file is preprocessed by setup.py to create akara.conf, which
# replaces tokens in this file with values from akara.ini. akara.ini
# takes the standard python ConfigParser format of:
#
# [Section]
# Key = value
#
# Tokens in this file should take the form of:
#
# ${Section__Key}
# The configuration file is written in Python. Configuration data goes
# into class attributes. If the module is "A.B.C" then the
# configuration information should be in the class named "C". If there
# is a conflict then use the parameter "akara_name" to set the full
# module name.
# class C1:
# akara_name = "akara.demo.C"
# name = "this is for one module ending with C"
#
# class C2:
# akara_name = "akara.example.C"
# name = "this is for another C module"
# An extension module should get its configuration class using
# akara.module_config(name)
# where "name" is the full module name (usually __name__).
# The name can be omitted in which case __name__ is used.
### Section 1: Global Akara Environment
# The directives in this section affect the overall operation of
# Akara, such as the number of concurrent requests it can handle and
# where it should place its PID and log files.
#
class Akara:
# Listen: interface name (optional) and port to listen for HTTP requests
Listen = ${Akara__Port}
# To specify the interface name use this format:
# Listen = "localhost:8880"
# ServerRoot = os.path.join(sys.prefix, "share", "akara")
# To simplify, set this to the location of akara.conf
ConfigRoot = "."
# PidFile: Filename which holds the process id of a running Akara
# server. The file is created when Akara starts and removed when it
# exists. It contains a single line: the pid followed by a newline.
#
PidFile = "logs/akara.pid"
# ModuleDir: directory containing the Akara extension modules
# Akara loads all of the *.py files in that directory
#
ModuleDir = "modules"
# ModuleCache: directory containing the module cache databases.
# Akara only creates such databases if the akara.caching
# feature is being used to cache GET requests
ModuleCache = "caches"
####
# Different options controlling the number of pre-forked server
# process to run at any one time.
#
# MaxServers: maximum number of servers to run at any one time
# (this is therefore the maximum number of simultaneous connections)
MaxServers = 40
#
# A 'spare' server is one which is waiting to handle an HTTP request
# MinSpareServers: minimum number of spare servers
MinSpareServers = 1
# MaxSpareServers: maximum number of spare servers
MaxSpareServers = 2
# MaxRequestsPerServer: restart a server after this many requests
MaxRequestsPerServer = 5000
#### Log configuration
# ErrorLog: The location of the error log file.
#
ErrorLog = "logs/error.log"
# AccessLog: The location of the access log file.
# Uses the Apache combined log format
#
AccessLog = "logs/access.log"
# LogLevel: Set the severity level for Akara logging messages.
# Messages below the given log level are not written. The levels are,
# from highest to lowest:
# CRITICAL, ERROR, WARN, INFO, DEBUG
# Also, WARNING is an alias for WARN
#
LogLevel = "${Akara__LogLevel}"
### Section 2: List of extension modules to install
# These are module names found on the Python path
MODULES = [
"freemix_akara.contentdm",
"freemix_akara.oai",
"dplaingestion.oai",
"dplaingestion.couch",
"dplaingestion.create_fetcher",
"dplaingestion.fetchers.fetcher",
"dplaingestion.fetchers.oai_verbs_fetcher",
"dplaingestion.fetchers.absolute_url_fetcher",
"dplaingestion.fetchers.file_fetcher",
"dplaingestion.fetchers.ia_fetcher",
"dplaingestion.fetchers.mwdl_fetcher",
"dplaingestion.fetchers.nypl_fetcher",
"dplaingestion.fetchers.uva_fetcher",
"dplaingestion.fetchers.nara_fetcher",
"dplaingestion.fetchers.edan_fetcher",
"dplaingestion.fetchers.hathi_fetcher",
"dplaingestion.create_mapper",
"dplaingestion.mappers.mapper",
"dplaingestion.mappers.dublin_core_mapper",
"dplaingestion.mappers.mods_mapper",
"dplaingestion.mappers.harvard_mapper",
"dplaingestion.mappers.bpl_mapper",
"dplaingestion.mappers.mwdl_mapper",
"dplaingestion.mappers.getty_mapper",
"dplaingestion.mappers.primo_mapper",
"dplaingestion.mappers.missouri_mapper",
"dplaingestion.akamod.enrich",
"dplaingestion.akamod.enrich-subject",
"dplaingestion.akamod.enrich-type",
"dplaingestion.akamod.enrich-format",
"dplaingestion.akamod.enrich_date",
"dplaingestion.akamod.select-id",
"dplaingestion.akamod.shred",
"dplaingestion.akamod.geocode",
"dplaingestion.akamod.oai-set-name",
"dplaingestion.akamod.dpla-list-records",
"dplaingestion.akamod.dpla-list-sets",
"dplaingestion.akamod.harvard_enrich_location",
"dplaingestion.akamod.mdl-enrich-location",
"dplaingestion.akamod.mwdl_enrich_location",
"dplaingestion.akamod.nara_enrich_location",
"dplaingestion.akamod.scdl_enrich_location",
"dplaingestion.akamod.uiuc_enrich_location",
"dplaingestion.akamod.scdl_geocode_regions",
"dplaingestion.akamod.filter_empty_values",
"dplaingestion.akamod.artstor_select_isshownat",
"dplaingestion.akamod.artstor_identify_object",
"dplaingestion.akamod.cdl_identify_object",
"dplaingestion.akamod.contentdm_identify_object",
"dplaingestion.akamod.move_date_values",
"dplaingestion.akamod.enrich_location",
"dplaingestion.akamod.remove_property",
"dplaingestion.akamod.lookup",
"dplaingestion.akamod.indiana_identify_object",
"dplaingestion.akamod.kentucky_identify_object",
"dplaingestion.akamod.georgia_identify_object",
"dplaingestion.akamod.bhl_contributor_to_collection",
"dplaingestion.akamod.copy_prop",
"dplaingestion.akamod.cleanup_value",
"dplaingestion.akamod.set_prop",
"dplaingestion.akamod.enrich_language",
"dplaingestion.akamod.mwdl_enrich_state_located_in",
"dplaingestion.akamod.artstor_cleanup",
"dplaingestion.akamod.nypl_identify_object",
"dplaingestion.akamod.nypl_coll_title",
"dplaingestion.akamod.nypl_select_hasview",
"dplaingestion.akamod.mwdl_cleanup_field",
"dplaingestion.akamod.ia_identify_object",
"dplaingestion.akamod.ia_set_rights",
"dplaingestion.akamod.dc_clean_invalid_dates",
"dplaingestion.akamod.edan_select_id",
"dplaingestion.akamod.dc_clean_invalid_dates",
"dplaingestion.akamod.decode_html",
"dplaingestion.akamod.artstor_spatial_to_dataprovider",
"dplaingestion.akamod.david_rumsey_identify_object",
"dplaingestion.akamod.dedup_value",
"dplaingestion.akamod.set_type_from_physical_format",
"dplaingestion.akamod.capitalize_value",
"dplaingestion.akamod.artstor_cleanup_creator",
"dplaingestion.akamod.replace_substring",
"dplaingestion.akamod.uiuc_cleanup_spatial_name",
"dplaingestion.akamod.remove_list_values",
"dplaingestion.akamod.usc_enrich_location",
"dplaingestion.akamod.hathi_identify_object",
"dplaingestion.akamod.texas_enrich_location",
"dplaingestion.akamod.set_spec_type",
"dplaingestion.akamod.usc_set_dataprovider",
"dplaingestion.akamod.compare_with_schema",
"dplaingestion.akamod.mdl_state_located_in",
"dplaingestion.akamod.scdl_format_to_type",
"dplaingestion.marc_code_to_relator",
"dplaingestion.akamod.dpla_mapper",
"dplaingestion.akamod.set_context",
"dplaingestion.akamod.strip_html"
]
### Section 3: Other module configuration goes here
class geocode:
twofishes_base_url = "${Twofishes__BaseUrl}"
class lookup:
# Key is passed in query param.
# Value is name of the dictionary from lookup module.
lookup_mapping = {
'test': 'test_subst',
'test2': 'test_2_subst',
'country_alias': 'COUNTRY_ALIAS',
'iso639_3': 'iso639_3_subst',
'scdl_fix_format': 'SCDL_FIX_FORMAT'
}
class identify_object:
IGNORE = 0
PENDING = 1
class contentdm_identify_object(identify_object):
pass
class indiana_identify_object(identify_object):
pass
class kentucky_identify_object(identify_object):
pass
class artstor_identify_object(identify_object):
pass
class georgia_identify_object(identify_object):
pass
class nypl_identify_object(identify_object):
pass
class ia_identify_object(identify_object):
pass
class david_rumsey_identify_object(identify_object):
pass
class hathi_identify_object(identify_object):
pass
class type_conversion:
# Map of "format" or "physical description" substring to
# sourceResource.type. This format field is considered first, and these
# values should be as specific as possible, to avoid false assignments,
# because this field is usually pretty free-form, unlike the type fields.
type_for_phys_keyword = [
('holiday card', 'image'),
('christmas card', 'image'),
('mail art', 'image'),
('postcard', 'image'),
]
# Map of type-related substring to desired sourceResource.type.
# For simple "if substr in str" matching. Place more specific
# patterns higher up, before more general ones.
type_for_ot_keyword = [
('photograph', 'image'),
('still image', 'image'),
('sample book', 'image'),
('book', 'text'),
('specimen', 'image'),
('electronic resource', 'interactive resource'),
# Keep "textile" above "text"
('textile', 'image'),
('text', 'text'),
('frame', 'image'),
('costume', 'image'),
('object', 'physical object'),
('statue', 'image'),
('sculpture', 'image'),
('container', 'image'),
('jewelry', 'image'),
('furnishing', 'image'),
('furniture', 'image'),
# Keep "moving image" above "image"
('moving image', 'moving image'),
# And, yes, "MovingImage" is a valid DC type.
('movingimage', 'moving image'),
('image', 'image'),
('drawing', 'image'),
('print', 'image'),
('painting', 'image'),
('illumination', 'image'),
('poster', 'image'),
('appliance', 'image'),
('tool', 'image'),
('electronic component', 'image'),
('publication', 'text'),
('magazine', 'text'),
('journal', 'text'),
('postcard', 'image'),
('correspondence', 'text'),
('writing', 'text'),
('manuscript', 'text'),
# keep "equipment" above "audio" ("Audiovisual equipment")
('equipment', 'image'),
('cartographic', 'image'),
('notated music', 'image'),
('mixed material', ['image', 'text']),
('audio', 'sound'),
('sound', 'sound'),
('oral history recording', 'sound'),
('finding aid', 'collection'),
('online collection', 'collection'),
('online exhibit', 'interactive resource'),
('moving image', 'moving image'),
('motion picture', 'moving image'),
('film', 'moving image'),
('video game', 'interactive resource'),
('video', 'moving image')
]
class enrich_type(type_conversion):
pass