forked from RCOSDP/weko
-
Notifications
You must be signed in to change notification settings - Fork 0
/
invenio.cfg
407 lines (374 loc) · 16.2 KB
/
invenio.cfg
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
from datetime import timedelta
from celery.schedules import crontab
from invenio_app.config import \
APP_DEFAULT_SECURE_HEADERS as INVENIO_APP_APP_DEFAULT_SECURE_HEADERS
from flask_babelex import lazy_gettext as _
from weko_search_ui.config import SEARCH_UI_SEARCH_INDEX
# Flask
TEMPLATES_AUTO_RELOAD = True
# Database
#SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://{{ environ('INVENIO_POSTGRESQL_DBUSER') }}:{{ environ('INVENIO_POSTGRESQL_DBPASS') }}@{{ environ('INVENIO_POSTGRESQL_HOST') }}:5432/{{ environ('INVENIO_POSTGRESQL_DBNAME') }}'
#: Track modifications to objects.
#SQLALCHEMY_TRACK_MODIFICATIONS = True
# Database connection pool
DB_POOL_CLASS = 'QueuePool'
# Statis files
COLLECT_STORAGE = 'flask_collect.storage.file'
# Request timeout for bulk update
INDEXER_BULK_REQUEST_TIMEOUT = 100
# Redis
CACHE_TYPE = 'redis'
CACHE_REDIS_HOST = '127.0.0.1'
CACHE_REDIS_URL = 'redis://127.0.0.1:6379/0'
ACCOUNTS_SESSION_REDIS_URL = 'redis://127.0.0.1:6379/1'
# Celery
# Celery 3
BROKER_URL = 'redis://127.0.0.1:6379/3'
# Celery 4
CELERY_BROKER_URL = 'redis://127.0.0.1:6379/3'
CELERY_RESULT_BACKEND = 'redis://127.0.0.1:6379/2'
#: Beat schedule
CELERY_BEAT_SCHEDULE = {
# Stats
'stats-process-events': {
'task': 'invenio_stats.tasks.process_events',
'schedule': timedelta(minutes=1),
'args': [('celery-task', 'item-create', 'top-view', 'record-view', 'file-download', 'file-preview', 'search')],
},
'stats-aggregate-events': {
'task': 'invenio_stats.tasks.aggregate_events',
'schedule': timedelta(days=1),
'args': [('celery-task-agg', 'file-download-agg', 'file-preview-agg', 'item-create-agg', 'record-view-agg', 'search-agg', 'top-view-agg')],
},
# WEKO-indextree-journal-export
'indextree-journal-export-journal': {
'task': 'weko_indextree_journal.tasks.export_journal_task',
'schedule': timedelta(days=1),
'args': [('p_path')],
},
'admin-send-report-emails': {
'task': 'weko_admin.tasks.check_send_all_reports',
'schedule': timedelta(days=1, minutes=0, hours=0),
'args': [],
},
'harvest-check-schedules': {
'task': 'invenio_oaiharvester.tasks.check_schedules_and_run',
'schedule': crontab(hour=0, minute=0, day_of_week=1),
'args': [],
},
'send-feedback-mail-schedules': {
'task': 'weko_admin.tasks.send_feedback_mail',
'schedule': crontab(day_of_month='1', hour=0, minute=0),
'args': [],
},
'send_storage_alert_mail': {
'task': 'invenio_files_rest.tasks.check_send_alert_mail',
'schedule': timedelta(days=1, minutes=0, hours=0),
'args': [],
},
'send_site_access_mail': {
'task': 'weko_admin.tasks.check_send_site_access_report',
'schedule': timedelta(days=1, minutes=0, hours=0),
'args': [],
},
'remove_preview_pdf': {
'task': 'invenio_files_rest.tasks.check_file_storage_time',
'schedule': timedelta(days=0, minutes=0, hours=1),
'args': [],
},
'update_sitemap': {
'task': 'weko_sitemap.tasks.update_sitemap',
'schedule': timedelta(days=3, minutes=0, hours=0),
'args': [],
},
'update_location_size': {
'task': 'invenio_files_rest.tasks.check_location_size',
'schedule': timedelta(minutes=5),
},
'resync': {
'task': 'invenio_resourcesyncclient.tasks.run_sync_auto',
'schedule': crontab(hour=0, minute=0),
},
}
# Elasticsearch
SEARCH_ELASTIC_HOSTS = '66179b6067e74257b07ea6c21ddd137e.asia-northeast1.gcp.cloud.es.io'
SEARCH_INDEX_PREFIX = 'weko3-'
SEARCH_CLIENT_CONFIG = dict(timeout=60, max_retries=5,http_auth=('elastic', '********'),scheme="https", port=443,)
# JSON Schema
JSONSCHEMAS_ENDPOINT = '/schema'
JSONSCHEMAS_HOST = '127.0.0.1:5000'
# OAI server
OAISERVER_REPOSITORY_NAME = 'WEKO'
OAISERVER_RECORD_INDEX = SEARCH_UI_SEARCH_INDEX
OAISERVER_ID_PREFIX = 'oai:127.0.0.1:'
# Default Secure Headers
APP_DEFAULT_SECURE_HEADERS = INVENIO_APP_APP_DEFAULT_SECURE_HEADERS
# Disable Content Security Policy headers.
APP_DEFAULT_SECURE_HEADERS['content_security_policy'] = {}
APP_DEFAULT_SECURE_HEADERS['content_security_policy'] = {
"default-src": ["'self'"],
"script-src": "'self' 'unsafe-inline' 'unsafe-eval' *",
"img-src": "'self' * data: blob:",
"object-src": "'self' *",
"style-src": "'self' 'unsafe-inline' 'unsafe-eval' *",
"media-src": "'self' *",
"child-src": "'self' *",
"font-src": "'self' * data:",
"connect-src": "'self' *"
}
APP_DEFAULT_SECURE_HEADERS['force_https'] = True
APP_DEFAULT_SECURE_HEADERS['session_cookie_secure'] = False
# fix same session (#14164)
SESSION_COOKIE_DOMAIN = ''
SESSION_COOKIE_SAMESITE = 'None'
SESSION_COOKIE_SECURE = True
# I18N
BABEL_DEFAULT_LOCALE = 'en'
BABEL_DEFAULT_LANGUAGE = 'en'
I18N_LANGUAGES = [('ja', 'Japanese'), ('zh', 'Chinese'), ('id', 'Indonesian'), ('vi', 'Vietnamese'),
('ms', 'Malay'), ('fil', 'Filipino (Pilipinas)'), ('th', 'Thai'), ('hi', 'Hindi'), ('ar', 'Arabic')]
I18N_TRANSLATIONS_PATHS = [
'/mnt/d/weko/invenio/translations/invenio_access/translations',
'/mnt/d/weko/invenio/translations/invenio_accounts/translations',
'/mnt/d/weko/invenio/translations/invenio_i18n/translations',
'/mnt/d/weko/invenio/translations/invenio_pidstore/translations',
'/mnt/d/weko/invenio/translations/invenio_records/translations',
'/mnt/d/weko/invenio/translations/invenio_records_rest/translations',
'/mnt/d/weko/invenio/translations/invenio_theme/translations'
]
# TODO: Remove me once the problem with email is solved in flask-security:
# https://github.com/mattupstate/flask-security/issues/685
SECURITY_EMAIL_SENDER = 'no-reply@localhost'
# For invenio-communities module
THEME_MATHJAX_CDN = '//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-AMS_HTML'
# Storage Setting for Amazon S3
FILES_REST_STORAGE_FACTORY = 'invenio_s3.s3fs_storage_factory'
S3_ACCCESS_KEY_ID = None
S3_SECRECT_ACCESS_KEY = None
S3_SEND_FILE_DIRECTLY = True
S3_ENDPOINT_URL = None
# Location type list
FILES_REST_LOCATION_TYPE_LIST = [('s3', 'Amazon S3')]
# Jupyterhub Config
WEKO_JUPYTERHUB_ENABLE = True
WEKO_JUPYTERHUB_URL = 'https://service.jupyterhub.rdm.nii.ac.jp/user-redirect/weko3nb/import/weko3sbd.ir.rcos.nii.ac.jp'
# Theme
# =====
#: Default site name.
THEME_SITENAME = 'WEKO3'
#: Default site URL (used only when not in a context - e.g. like celery tasks).
THEME_SITEURL = 'https://127.0.0.1:5000'
# Location of list license's icons.
WEKO_RECORDS_UI_LICENSE_ICON_LOCATION = "/static/images/default/"
# Location of list license's icons for PDF.
WEKO_RECORDS_UI_LICENSE_ICON_PDF_LOCATION = "/static/images/creative_commons/"
# List licenses
WEKO_RECORDS_UI_LICENSE_DICT = [
{
'name': _('write your own license'),
'value': 'license_free',
},
# version 0
{
'name': _('Creative Commons CC0 1.0 Universal Public Domain Designation'),
'code' : 'CC0',
'href_ja': 'https://creativecommons.org/publicdomain/zero/1.0/deed.ja',
'href_default': 'https://creativecommons.org/publicdomain/zero/1.0/',
'value': 'license_12',
'src': '88x31(0).png',
'src_pdf': 'cc-0.png',
'href_pdf': 'https://creativecommons.org/publicdomain/zero/1.0/'
'deed.ja',
'txt': 'This work is licensed under a Public Domain Dedication '
'International License.'
},
# version 3.0
{
'name': _('Creative Commons Attribution 3.0 Unported (CC BY 3.0)'),
'code' : 'CC BY 3.0',
'href_ja': 'https://creativecommons.org/licenses/by/3.0/deed.ja',
'href_default': 'https://creativecommons.org/licenses/by/3.0/',
'value': 'license_6',
'src': '88x31(1).png',
'src_pdf': 'by.png',
'href_pdf': 'http://creativecommons.org/licenses/by/3.0/',
'txt': 'This work is licensed under a Creative Commons Attribution'
' 3.0 International License.'
},
{
'name': _('Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)'),
'code' : 'CC BY-SA 3.0',
'href_ja': 'https://creativecommons.org/licenses/by-sa/3.0/deed.ja',
'href_default': 'https://creativecommons.org/licenses/by-sa/3.0/',
'value': 'license_7',
'src': '88x31(2).png',
'src_pdf': 'by-sa.png',
'href_pdf': 'http://creativecommons.org/licenses/by-sa/3.0/',
'txt': 'This work is licensed under a Creative Commons Attribution'
'-ShareAlike 3.0 International License.'
},
{
'name': _('Creative Commons Attribution-NoDerivs 3.0 Unported (CC BY-ND 3.0)'),
'code' : 'CC BY-ND 3.0',
'href_ja': 'https://creativecommons.org/licenses/by-nd/3.0/deed.ja',
'href_default': 'https://creativecommons.org/licenses/by-nd/3.0/',
'value': 'license_8',
'src': '88x31(3).png',
'src_pdf': 'by-nd.png',
'href_pdf': 'http://creativecommons.org/licenses/by-nd/3.0/',
'txt': 'This work is licensed under a Creative Commons Attribution'
'-NoDerivatives 3.0 International License.'
},
{
'name': _('Creative Commons Attribution-NonCommercial 3.0 Unported (CC BY-NC 3.0)'),
'code' : 'CC BY-NC 3.0',
'href_ja': 'https://creativecommons.org/licenses/by-nc/3.0/deed.ja',
'href_default': 'https://creativecommons.org/licenses/by-nc/3.0/',
'value': 'license_9',
'src': '88x31(4).png',
'src_pdf': 'by-nc.png',
'href_pdf': 'http://creativecommons.org/licenses/by-nc/3.0/',
'txt': 'This work is licensed under a Creative Commons Attribution'
'-NonCommercial 3.0 International License.'
},
{
'name': _('Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0)'),
'code' : 'CC BY-NC-SA 3.0',
'href_ja': 'https://creativecommons.org/licenses/by-nc-sa/3.0/deed.ja',
'href_default': 'https://creativecommons.org/licenses/by-nc-sa/3.0/',
'value': 'license_10',
'src': '88x31(5).png',
'src_pdf': 'by-nc-sa.png',
'href_pdf': 'http://creativecommons.org/licenses/by-nc-sa/3.0/',
'txt': 'This work is licensed under a Creative Commons Attribution'
'-NonCommercial-ShareAlike 3.0 International License.'
},
{
'name': _('Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported (CC BY-NC-ND 3.0)'),
'code' : 'CC BY-NC-ND 3.0',
'href_ja': 'https://creativecommons.org/licenses/by-nc-nd/3.0/deed.ja',
'href_default': 'https://creativecommons.org/licenses/by-nc-nd/3.0/',
'value': 'license_11',
'src': '88x31(6).png',
'src_pdf': 'by-nc-nd.png',
'href_pdf': 'http://creativecommons.org/licenses/by-nc-nd/3.0/',
'txt': 'This work is licensed under a Creative Commons Attribution'
'-NonCommercial-ShareAlike 3.0 International License.'
},
# version 4.0
{
'name': _('Creative Commons Attribution 4.0 International (CC BY 4.0)'),
'code' : 'CC BY 4.0',
'href_ja': 'https://creativecommons.org/licenses/by/4.0/deed.ja',
'href_default': 'https://creativecommons.org/licenses/by/4.0/',
'value': 'license_0',
'src': '88x31(1).png',
'src_pdf': 'by.png',
'href_pdf': 'http://creativecommons.org/licenses/by/4.0/',
'txt': 'This work is licensed under a Creative Commons Attribution'
' 4.0 International License.'
},
{
'name': _('Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)'),
'code' : 'CC BY-SA 4.0',
'href_ja': 'https://creativecommons.org/licenses/by-sa/4.0/deed.ja',
'href_default': 'https://creativecommons.org/licenses/by-sa/4.0/',
'value': 'license_1',
'src': '88x31(2).png',
'src_pdf': 'by-sa.png',
'href_pdf': 'http://creativecommons.org/licenses/by-sa/4.0/',
'txt': 'This work is licensed under a Creative Commons Attribution'
'-ShareAlike 4.0 International License.'
},
{
'name': _('Creative Commons Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0)'),
'code' : 'CC BY-ND 4.0',
'href_ja': 'https://creativecommons.org/licenses/by-nd/4.0/deed.ja',
'href_default': 'https://creativecommons.org/licenses/by-nd/4.0/',
'value': 'license_2',
'src': '88x31(3).png',
'src_pdf': 'by-nd.png',
'href_pdf': 'http://creativecommons.org/licenses/by-nd/4.0/',
'txt': 'This work is licensed under a Creative Commons Attribution'
'-NoDerivatives 4.0 International License.'
},
{
'name': _('Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)'),
'code' : 'CC BY-NC 4.0',
'href_ja': 'https://creativecommons.org/licenses/by-nc/4.0/deed.ja',
'href_default': 'https://creativecommons.org/licenses/by-nc/4.0/',
'value': 'license_3',
'src': '88x31(4).png',
'src_pdf': 'by-nc.png',
'href_pdf': 'http://creativecommons.org/licenses/by-nc/4.0/',
'txt': 'This work is licensed under a Creative Commons Attribution'
'-NonCommercial 4.0 International License.'
},
{
'name': _('Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)'),
'code' : 'CC BY-NC-SA 4.0',
'href_ja': 'https://creativecommons.org/licenses/by-nc-sa/4.0/deed.ja',
'href_default': 'https://creativecommons.org/licenses/by-nc-sa/4.0/',
'value': 'license_4',
'src': '88x31(5).png',
'src_pdf': 'by-nc-sa.png',
'href_pdf': 'http://creativecommons.org/licenses/by-nc-sa/4.0/',
'txt': 'This work is licensed under a Creative Commons Attribution'
'-NonCommercial-ShareAlike 4.0 International License.'
},
{
'name': _('Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)'),
'code' : 'CC BY-NC-ND 4.0',
'href_ja': 'https://creativecommons.org/licenses/by-nc-nd/4.0/deed.ja',
'href_default': 'https://creativecommons.org/licenses/by-nc-nd/4.0/',
'value': 'license_5',
'src': '88x31(6).png',
'src_pdf': 'by-nc-nd.png',
'href_pdf': 'http://creativecommons.org/licenses/by-nc-nd/4.0/',
'txt': 'This work is licensed under a Creative Commons Attribution'
'-NonCommercial-ShareAlike 4.0 International License.'
},
]
# Shibboleth
# =====
# 1. WEKO login only[default]:
# WEKO_ACCOUNTS_SHIB_LOGIN_ENABLED = False
# 2. WEKO login + Shibbolth(Idp):
# WEKO_ACCOUNTS_SHIB_LOGIN_ENABLED = True
# WEKO_ACCOUNTS_SHIB_IDP_LOGIN_ENABLED = True
# 3. WEKO login + Shibbolth(DS):
# WEKO_ACCOUNTS_SHIB_LOGIN_ENABLED = True
# WEKO_ACCOUNTS_SHIB_IDP_LOGIN_ENABLED = False
# 4. Shibbolth(Idp):
# WEKO_ACCOUNTS_SHIB_LOGIN_ENABLED = True
# WEKO_ACCOUNTS_SHIB_IDP_LOGIN_ENABLED = True
# WEKO_ACCOUNTS_SHIB_INST_LOGIN_DIRECTLY_ENABLED = True
# 5. Shibbolth(DS)
# WEKO_ACCOUNTS_SHIB_LOGIN_ENABLED = True
# WEKO_ACCOUNTS_SHIB_IDP_LOGIN_ENABLED = False
# WEKO_ACCOUNTS_SHIB_DP_LOGIN_DIRECTLY_ENABLED= True
# Enable Shibboleth user login system
WEKO_ACCOUNTS_SHIB_LOGIN_ENABLED = False
# Login proxy URL
WEKO_ACCOUNTS_SHIB_IDP_LOGIN_URL = '{}secure/login.php'
# IdP attribute map
WEKO_ACCOUNTS_SSO_ATTRIBUTE_MAP = {
'SHIB_ATTR_EPPN': (False, 'shib_eppn'),
'SHIB_ATTR_ROLE_AUTHORITY_NAME': (False, 'shib_role_authority_name'),
'SHIB_ATTR_SITE_USER_WITHIN_IP_RANGE_FLAG': (False, 'shib_ip_range_flag'),
'SHIB_ATTR_MAIL': (False, 'shib_mail'),
'SHIB_ATTR_USER_NAME': (False, 'shib_user_name'),
}
# Shibboleth login pattern. (True: Shibboleth IdP(JairoCloud), False: Embedded DS-Pattern 1)
WEKO_ACCOUNTS_SHIB_IDP_LOGIN_ENABLED = False
# Enable Shibboleth login system using DP selection only.
WEKO_ACCOUNTS_SHIB_DP_LOGIN_DIRECTLY_ENABLED = False
# Enable Shibboleth login system using IdP selection only
WEKO_ACCOUNTS_SHIB_INST_LOGIN_DIRECTLY_ENABLED = False
# Enable upgrade version
WEKO_ITEMTYPES_UI_UPGRADE_VERSION_ENABLED = False
# Google traking code
THEME_TRACKINGCODE_TEMPLATE = 'weko_theme/trackingcode.html'
GOOGLE_TRACKING_ID_SYSTEM = ''
GOOGLE_TRACKING_ID_USER = ''
STATS_EXCLUDED_ADDRS = ["10.0.0.0/8","172.16.0.0/12","192.168.0.0/16"]