-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinvenio.cfg
More file actions
496 lines (400 loc) · 18.2 KB
/
invenio.cfg
File metadata and controls
496 lines (400 loc) · 18.2 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
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
"""
# =============================================================================
# InvenioRDM settings for instance project.
# =============================================================================
This file was automatically generated by 'invenio-cli init'.
For the full list of settings and their values, see
https://inveniordm.docs.cern.ch/reference/configuration/.
"""
from datetime import datetime
from invenio_i18n import lazy_gettext as _
from invenio_app_rdm.config import NOTIFICATIONS_BUILDERS as RDM_NOTIFICATIONS_BUILDERS
from invenio_curations.config import CURATIONS_NOTIFICATIONS_BUILDERS
from invenio_curations.services import facets as curations_facets
from invenio_curations.services.components import CurationComponent
from invenio_curations.services.permissions import (
CurationRDMRecordPermissionPolicy,
CurationRDMRequestsPermissionPolicy,
)
from invenio_rdm_records.services.components import DefaultRecordsComponents
from invenio_override.config import OVERRIDE_RDM_RECORDS_SERVICE_COMPONENTS
def _(x): # needed to avoid start time failure with lazy strings
return x
# =============================================================================
# Flask
# See: https://flask.palletsprojects.com/en/1.1.x/config/
# =============================================================================
# Define the value of the cache control header `max-age` returned by the server when serving
# public files. Files will be cached by the browser for the provided number of seconds.
# See flask documentation for more information:
# https://flask.palletsprojects.com/en/2.1.x/config/#SEND_FILE_MAX_AGE_DEFAULT
SEND_FILE_MAX_AGE_DEFAULT = 300
# SECURITY WARNING: keep the secret key used in production secret!
# Do not commit it to a source code repository.
# TODO: Set
SECRET_KEY = "CHANGE_ME"
# Since HAProxy and Nginx route all requests no matter the host header
# provided, the allowed hosts variable is set to localhost. In production it
# should be set to the correct host and it is strongly recommended to only
# route correct hosts to the application.
TRUSTED_HOSTS = ["0.0.0.0", "localhost", "127.0.0.1"]
# =============================================================================
# Flask-SQLAlchemy
# See: https://flask-sqlalchemy.palletsprojects.com/en/2.x/config/
# =============================================================================
# TODO: Set
SQLALCHEMY_DATABASE_URI = "postgresql+psycopg2://instance:instance@localhost/instance"
# =============================================================================
# Invenio-App
# See: https://invenio-app.readthedocs.io/en/latest/configuration.html
# =============================================================================
APP_DEFAULT_SECURE_HEADERS = {
"content_security_policy": {
"default-src": [
"'self'",
"data:", # for fonts
"'unsafe-inline'", # for inline scripts and styles
"blob:", # for pdf preview
# Add your own policies here (e.g. analytics)
],
},
"content_security_policy_report_only": False,
"content_security_policy_report_uri": None,
"force_file_save": False,
"force_https": True,
"force_https_permanent": False,
"frame_options": "sameorigin",
"frame_options_allow_from": None,
"session_cookie_http_only": True,
"session_cookie_secure": True,
"strict_transport_security": True,
"strict_transport_security_include_subdomains": True,
"strict_transport_security_max_age": 31556926, # One year in seconds
"strict_transport_security_preload": False,
}
# =============================================================================
# Flask-Babel
# See: https://python-babel.github.io/flask-babel/#configuration
# =============================================================================
# # Default locale (language)
# BABEL_DEFAULT_LOCALE = 'en'
# # Default time zone
# BABEL_DEFAULT_TIMEZONE = 'Europe/Zurich'
# =============================================================================
# Invenio-I18N
# See: https://invenio-i18n.readthedocs.io/en/latest/configuration.html
# =============================================================================
# Other supported languages (do not include BABEL_DEFAULT_LOCALE in list).
# I18N_LANGUAGES = [
# # ('de', _('German')),
# # ('tr', _('Turkish')),
# ]
# =============================================================================
# Invenio-Theme
# See: https://invenio-theme.readthedocs.io/en/latest/configuration.html
# =============================================================================
# Name used in header and UI
THEME_SITENAME = "instance"
# Frontpage title
THEME_FRONTPAGE_TITLE = "instance"
# Header logo
# THEME_LOGO = 'images/invenio-rdm.svg'
# =============================================================================
# Invenio-App-RDM
# See: https://github.com/inveniosoftware/invenio-app-rdm/blob/master/invenio_app_rdm/config.py
# =============================================================================
# Instance's theme entrypoint file. Path relative to the ``assets/`` folder.
INSTANCE_THEME_FILE = "./less/theme.less"
# Email address for administrator emails (like file checksum alerts)
APP_RDM_ADMIN_EMAIL_RECIPIENT = "info@instance.com"
# Default values for the deposit form
APP_RDM_DEPOSIT_FORM_DEFAULTS = {
"publication_date": lambda: datetime.now().strftime("%Y-%m-%d"),
"rights": [
{
"id": "cc-by-4.0",
"title": "Creative Commons Attribution 4.0 International",
"description": (
"The Creative Commons Attribution license allows "
"re-distribution and re-use of a licensed work "
"on the condition that the creator is "
"appropriately credited."
),
"link": "https://creativecommons.org/licenses/by/4.0/legalcode",
}
],
"publisher": "instance",
}
APP_RDM_DEPOSIT_FORM_AUTOCOMPLETE_NAMES = "search" # "search_only" or "off"
# =============================================================================
# Invenio-Records-Resources
# See: https://github.com/inveniosoftware/invenio-records-resources/blob/master/invenio_records_resources/config.py
# =============================================================================
# TODO: Set with your own hostname when deploying to production
SITE_UI_URL = "https://127.0.0.1"
SITE_API_URL = "https://127.0.0.1/api"
# =============================================================================
# Invenio-RDM-Records
# See: https://inveniordm.docs.cern.ch/customize/dois/
# =============================================================================
DATACITE_ENABLED = False
DATACITE_USERNAME = ""
DATACITE_PASSWORD = ""
DATACITE_PREFIX = ""
DATACITE_TEST_MODE = True
DATACITE_DATACENTER_SYMBOL = ""
# =============================================================================
# Authentication — Invenio-Accounts and Invenio-OAuthclient
# See: https://inveniordm.docs.cern.ch/customize/authentication/
# =============================================================================
# Invenio-Accounts
# See: https://github.com/inveniosoftware/invenio-accounts/blob/master/invenio_accounts/config.py
ACCOUNTS_LOCAL_LOGIN_ENABLED = True # enable local login
SECURITY_REGISTERABLE = True # local login: allow users to register
SECURITY_RECOVERABLE = True # local login: allow users to reset the password
SECURITY_CHANGEABLE = True # local login: allow users to change psw
# SECURITY_CONFIRMABLE = True # local login: users can confirm e-mail address
SECURITY_LOGIN_WITHOUT_CONFIRMATION = (
True # require users to confirm email before being able to login
)
# Invenio-OAuthclient
# See: https://github.com/inveniosoftware/invenio-oauthclient/blob/master/invenio_oauthclient/config.py
OAUTHCLIENT_REMOTE_APPS = {} # configure external login providers
from invenio_oauthclient.views.client import auto_redirect_login
ACCOUNTS_LOGIN_VIEW_FUNCTION = (
auto_redirect_login # autoredirect to external login if enabled
)
OAUTHCLIENT_AUTO_REDIRECT_TO_EXTERNAL_LOGIN = False # autoredirect to external login
# Invenio-UserProfiles
USERPROFILES_READ_ONLY = (
False # allow users to change profile info (name, email, etc...)
)
# =============================================================================
# OAI-PMH
# See: https://github.com/inveniosoftware/invenio-oaiserver/blob/master/invenio_oaiserver/config.py
# =============================================================================
OAISERVER_ID_PREFIX = "instance.com"
"""The prefix that will be applied to the generated OAI-PMH ids."""
OAISERVER_ADMIN_EMAILS = [
"info@instance.com",
]
# =============================================================================
# Invenio-Search
# =============================================================================
SEARCH_INDEX_PREFIX = "instance-"
# =============================================================================
# Invenio-Users-Resources
# =============================================================================
USERS_RESOURCES_ADMINISTRATION_ENABLED = True
"""Enable the user administration"""
# =============================================================================
# Invenio-Administration
# =============================================================================
from invenio_app_rdm import __version__
ADMINISTRATION_DISPLAY_VERSIONS = [
("invenio-app-rdm", f"v{__version__}"),
("instance", "v1.0.0"),
]
# =============================================================================
# Invenio-I18N
# See: https://invenio-i18n.readthedocs.io/en/latest/configuration.html
# =============================================================================
BABEL_DEFAULT_LOCALE = "en"
# Default time zone
BABEL_DEFAULT_TIMEZONE = "Europe/Vienna"
# Other supported languages (do not include BABEL_DEFAULT_LOCALE in list).
I18N_LANGUAGES = [("de", _("German"))]
# =============================================================================
# Invenio-Curations
# =============================================================================
NOTIFICATIONS_BUILDERS = {
**RDM_NOTIFICATIONS_BUILDERS,
**CURATIONS_NOTIFICATIONS_BUILDERS,
}
RDM_RECORDS_SERVICE_COMPONENTS = OVERRIDE_RDM_RECORDS_SERVICE_COMPONENTS + [CurationComponent]
REQUESTS_FACETS = {
"type": {"facet": curations_facets.type, "ui": {"field": "type"}},
"status": {"facet": curations_facets.status, "ui": {"field": "status"}},
}
CURATIONS_MODERATION_ROLE = "administration-rdm-records-curation"
CURATIONS_PRIVILEGED_ROLES = ["administration", "bypass-curation"]
RDM_PERMISSION_POLICY = CurationRDMRecordPermissionPolicy
REQUESTS_PERMISSION_POLICY = CurationRDMRequestsPermissionPolicy
CURATIONS_ENABLE_REQUEST_COMMENTS = True
CURATIONS_COMMENT_TEMPLATE_FILE = "comment-template.html"
# =============================================================================
# Extras
# =============================================================================
# INVENIO_THEME_SHOW_FRONTPAGE_INTRO_SECTION=False
THEME_SHOW_FRONTPAGE_INTRO_SECTION = False
"""Set True for frontpage Intrp."""
RDM_USER_MODERATION_ENABLED = True
"""User moderation feature enabled."""
RDM_SEARCH_SORT_BY_VERIFIED = True
"""Enable the sorting of records by verified."""
USERS_RESOURCES_ADMINISTRATION_ENABLED = True
"""Enable user administration."""
USERS_RESOURCES_GROUPS_ENABLED = True
"""Config to enable features related to existence of groups."""
COMMUNITIES_ADMINISTRATION_DISABLED = False # this enables it
"""Enable communities administration."""
APP_RDM_SUBCOMMUNITIES_LABEL = "Projects"
"""Label for subcommunities in communities browse page."""
COMMUNITIES_SHOW_BROWSE_MENU_ENTRY = True
"""Toggle to show or hide the 'Browse' menu entry for communities."""
JOBS_ADMINISTRATION_ENABLED = True
"""Enable Jobs administration view."""
# =============================================================================
# Invenio-Override
# =============================================================================
# from invenio_override.config import OVERRIDE_RDM_RECORDS_SERVICE_COMPONENTS
# RDM_RECORDS_SERVICE_COMPONENTS = OVERRIDE_RDM_RECORDS_SERVICE_COMPONENTS
# """Build RDM Service components."""
# --- TUG (active) ---
OVERRIDE_LOGO = "images/TUG.png"
OVERRIDE_FAVICON = "tug.ico"
OVERRIDE_PRODUCTION = True
OVERRIDE_ICON = "images/icon_use.png"
OVERRIDE_CONTACT_FORM = False
OVERRIDE_SHIBBOLETH = False
OVERRIDE_FRONTPAGE_RIGHT = False
OVERRIDE_FRONTPAGE_SHOW_RECENT_UPLOADS = True
OVERRIDE_SHOW_PUBLICATIONS_SEARCH = True
OVERRIDE_SHOW_EDUCATIONAL_RESOURCES = True
OVERRIDE_SHOW_PUBLICATIONS_CARD = True
OVERRIDE_SHOW_EDUCATIONAL_RESOURCES_CARD = True
OVERRIDE_SHOW_RDM_SEARCH = True
GLOBAL_SEARCH_SCHEMAS = {
"rdm": {
"schema": "rdm",
"name_l10n": "Research Result",
},
"marc21": {
"schema": "marc21",
"name_l10n": "Publication",
},
"lom": {
"schema": "lom",
"name_l10n": "OER",
},
}
# ============================================================================
# Invenio-Records-LOM (OER / Educational Resources)
# ============================================================================
from invenio_records_lom.services.components import DefaultRecordsComponents as LOMDefaultRecordsComponents
from invenio_global_search.components import LOMToGlobalSearchComponent
from invenio_records_lom.config import (
LOM_STATS_CELERY_TASKS,
LOM_STATS_EVENTS,
LOM_STATS_AGGREGATIONS,
LOM_STATS_QUERIES,
)
LOM_RECORDS_SERVICE_COMPONENTS = LOMDefaultRecordsComponents + [LOMToGlobalSearchComponent]
"""Wire LOM records into global search."""
LOM_CREATOR_ROLE = "oer_curator"
"""Role required to create OER records."""
CELERY_BEAT_SCHEDULE = LOM_STATS_CELERY_TASKS
STATS_EVENTS = LOM_STATS_EVENTS
STATS_AGGREGATIONS = LOM_STATS_AGGREGATIONS
STATS_QUERIES = LOM_STATS_QUERIES
OVERRIDE_HEADER_LOGO_LEFT = "images/library_logo.png"
OVERRIDE_HEADER_TEXT_LINE1 = "TU GRAZ"
OVERRIDE_HEADER_TEXT_LINE2 = "REPOSITORY"
OVERRIDE_HEADER_TEXT_LINE3 = "LIBRARY & ARCHIVES"
OVERRIDE_HEADER_LOGO_SVG = "images/tu_graz_logo.svg"
OVERRIDE_HEADER_LOGO_LINK = "https://www.tugraz.at"
OVERRIDE_HEADER_CLAIM_WORDS = ["SCIENCE", "TECHNOLOGY", "PASSION"]
THEME_SITENAME = "TU Graz Repository"
THEME_FRONTPAGE_TITLE = "TU Graz Research Data Repository"
OVERRIDE_FRONTPAGE_SUBTITLE = "Publish and share your research data — citable, visible, and FAIR."
OVERRIDE_FRONTPAGE_FEATURES = [
{"icon": "check circle", "text": "FAIR Data"},
{"icon": "quote left", "text": "Citable with DOI"},
{"icon": "lock open", "text": "Open Access"},
{"icon": "shield alternate", "text": "Long-term Preservation"},
]
OVERRIDE_REASONS_PARTNER = "TU Graz & CERN"
THEME_FOOTER_TEMPLATE = "invenio_override/footer.html"
OVERRIDE_FOOTER_BACKGROUND = "#4a4a4a"
OVERRIDE_FOOTER_FG_COLOR = "#ffffff"
OVERRIDE_FOOTER_LOGO_FILTER = "brightness(0) invert(1)"
OVERRIDE_FOOTER_DIVIDER_COLOR = "rgba(255,255,255,0.1)"
OVERRIDE_DOC_REDIRECTS = {
"/guide": "https://doi.org/10.3217/dgpcz-td505",
"/terms": "https://doi.org/10.3217/k3dsw-rv326",
"/gdpr": "https://doi.org/10.3217/xream-wzp39",
"/accessibility": "https://doi.org/10.3217/psmeb-84429",
"/file-formats": "https://doi.org/10.3217/3c0k5-zqh95",
"/curations": "https://doi.org/10.3217/h1zfa-4fb59",
}
OVERRIDE_FOOTER_LINKS = {
"Repository": [
{"label": "Documentation", "url": "https://tu-graz-library.github.io/docs-repository", "external": True},
{"label": "Reference Guide", "url": "/guide", "external": True},
{"label": "Search Guide", "url": "/help/search"},
{"label": "Data Protection", "url": "/gdpr", "external": True},
{"label": "Terms and Conditions", "url": "/terms", "external": True},
{"label": "Accessibility Statement", "url": "/accessibility", "external": True},
{"label": "List of preferred file formats", "url": "/file-formats", "external": True},
{"label": "Curation Workflow", "url": "/curations", "external": True},
],
"Features": [
{"label": "Scalability"},
{"label": "Institutional integration"},
{"label": "Next Generation Repository"},
{"label": "Repository Profiles"},
{"label": "Resilient"},
],
"Connected Services": [
{"label": "PURE", "url": "https://pure.tugraz.at", "external": True},
{"label": "CampusOnline", "url": "http://campusonline.tugraz.at", "external": True},
{"label": "Research Data Management", "url": "https://rdm.tugraz.at", "external": True},
],
"Accessibility": [
{"label": "Tipp:"},
{"label": "Use Ctrl + and Ctrl -"},
{"label": "to change the font size."},
],
}
# --- MUG (commented) ---
# OVERRIDE_LOGO = "images/MUG.svg"
# OVERRIDE_FAVICON = "mug.ico"
# OVERRIDE_PRODUCTION = True
# OVERRIDE_ICON = "images/icon_use.png"
# OVERRIDE_CONTACT_FORM = False
# OVERRIDE_SHIBBOLETH = False
# OVERRIDE_FRONTPAGE_RIGHT = False
# OVERRIDE_FRONTPAGE_SHOW_RECENT_UPLOADS = True
#
# OVERRIDE_SHOW_PUBLICATIONS_SEARCH = False
# OVERRIDE_SHOW_EDUCATIONAL_RESOURCES = False
# OVERRIDE_SHOW_PUBLICATIONS_CARD = False
# OVERRIDE_SHOW_EDUCATIONAL_RESOURCES_CARD = False
# OVERRIDE_SHOW_RDM_SEARCH = True
#
# OVERRIDE_HEADER_LOGO_LEFT = None
# OVERRIDE_HEADER_TEXT_LINE1 = None
# OVERRIDE_HEADER_TEXT_LINE2 = None
# OVERRIDE_HEADER_TEXT_LINE3 = None
# OVERRIDE_HEADER_LOGO_SVG = None
# OVERRIDE_HEADER_LOGO_LINK = None
# OVERRIDE_HEADER_CLAIM_WORDS = []
#
# THEME_FRONTPAGE_TITLE = "Medical University of Graz Repository"
# OVERRIDE_FRONTPAGE_SUBTITLE = None
# OVERRIDE_FRONTPAGE_FEATURES = []
# OVERRIDE_REASONS_PARTNER = "Meduni Graz & TUG"
#
# THEME_FOOTER_TEMPLATE = "invenio_override/footer.html"
# OVERRIDE_FOOTER_BACKGROUND = "#4a4a4a"
# OVERRIDE_FOOTER_FG_COLOR = "#ffffff"
# OVERRIDE_FOOTER_LOGO_FILTER = "brightness(0) invert(1)"
# OVERRIDE_FOOTER_DIVIDER_COLOR = "rgba(255,255,255,0.1)"
# OVERRIDE_FOOTER_LINKS = {
#
# "Connected Services": [
# {"label": "Research Portal", "url": "https://forschung.medunigraz.at/", "external": True},
# {"label": "MED Online", "url": "https://online.medunigraz.at/", "external": True},
# {"label": "Research Data Management", "url": "https://muniverse.medunigraz.at/forschung/forschungsdatenmanagement/fdm-checklisten-vorlagen", "external": True},
# ],
# }