-
Notifications
You must be signed in to change notification settings - Fork 5
/
invenio.cfg
238 lines (187 loc) · 7.47 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
#
# This file is part of GEO Knowledge Hub.
# Copyright 2020-2021 GEO Secretariat.
#
# GEO Knowledge Hub is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
#
"""InvenioRDM settings for GEO Knowledge Hub project."""
from datetime import datetime
from os.path import abspath, join
from flask_babelex import lazy_gettext as _
# Flask
# =====
# See https://flask.palletsprojects.com/en/1.1.x/config/
# SECURITY WARNING: keep the secret key used in production secret!
# 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.
APP_ALLOWED_HOSTS = ['0.0.0.0', 'localhost', '127.0.0.1']
# Flask-SQLAlchemy
# ================
# See https://flask-sqlalchemy.palletsprojects.com/en/2.x/config/
SQLALCHEMY_DATABASE_URI="postgresql+psycopg2://geo-knowledge-hub:geo-knowledge-hub@localhost/geo-knowledge-hub"
# 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://pythonhosted.org/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
THEME_FRONTPAGE_TITLE = "GEO Knowledge Hub"
"""Frontpage title."""
THEME_LOGO = 'images/logo-full-white.svg'
"""Theme logo."""
THEME_SITENAME = 'GEO Knowledge Hub'
"""Site name."""
THEME_FRONTPAGE = True
"""Use GEO Knowledge Hub frontpage."""
THEME_FRONTPAGE_TEMPLATE = 'geo-knowledge-hub/frontpage.html'
"""Frontpage template."""
THEME_HEADER_TEMPLATE = 'geo-knowledge-hub/header.html'
"""Header base template."""
THEME_FOOTER_TEMPLATE = 'geo-knowledge-hub/footer.html'
"""Footer base template."""
# Invenio-App-RDM
# ===============
# See https://invenio-app-rdm.readthedocs.io/en/latest/configuration.html
# Instance's theme entrypoint file. Path relative to the ``assets/`` folder.
INSTANCE_THEME_FILE = './less/theme.less'
# Invenio-Files-Rest
# ==================
FILES_REST_STORAGE_FACTORY='invenio_s3.s3fs_storage_factory'
# Invenio-S3
# ==========
S3_ENDPOINT_URL='http://localhost:9000/'
S3_SECRET_ACCESS_KEY='CHANGE_ME'
S3_ACCESS_KEY_ID='CHANGE_ME'
# Allow S3 endpoint in the CSP rules
APP_DEFAULT_SECURE_HEADERS['content_security_policy']['default-src'].append(
S3_ENDPOINT_URL
)
# 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_HOSTNAME = "127.0.0.1"
SITE_HOSTPORT = "5000"
SITE_UI_URL = f"https://{SITE_HOSTNAME}:{SITE_HOSTPORT}"
SITE_API_URL = f"https://{SITE_HOSTNAME}:{SITE_HOSTPORT}/api"
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": "GEO Knowledge Hub",
}
# Invenio-RDM-Records
# ===================
# See https://github.com/inveniosoftware/invenio-rdm-records/blob/master/invenio_rdm_records/config.py
RDM_RECORDS_DOI_DATACITE_ENABLED = True
RDM_RECORDS_DOI_DATACITE_USERNAME = ""
RDM_RECORDS_DOI_DATACITE_PASSWORD = ""
RDM_RECORDS_DOI_DATACITE_PREFIX = "10.5072"
RDM_RECORDS_DOI_DATACITE_TEST_MODE = True
# 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 # require users to confirm e-mail address
# 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...)
# Invenio-Communities
# ===================
COMMUNITIES_ENABLED = False
# Flask-Mail
# ===================
MAIL_SUPPRESS_SEND = True
MAIL_PORT = 587
MAIL_SERVER = ""
MAIL_USE_TLS = False
MAIL_USE_SSL = False
MAIL_USERNAME = ""
MAIL_PASSWORD = ""
MAIL_MAX_EMAILS = 100
MAIL_DEFAULT_SENDER = ""
"""Server configurations"""
## See more configurations options at: https://pythonhosted.org/Flask-Mail/#configuring-flask-mail
# Flask-Discussion (with Isso engine)
# ===================================
ISSO_ENGINE_PORT = 443
ISSO_ENGINE_SUBURI = "isso"
DISCUSSION_SYSTEM = "isso"
DISCUSSION_ISSO_URL = f"{SITE_HOSTNAME}:{ISSO_ENGINE_PORT}/{ISSO_ENGINE_SUBURI}"
"""Isso commenting server configurations"""
DISCUSSION_ISSO_VOTE = "true"
DISCUSSION_ISSO_FEED = "true"
DISCUSSION_ISSO_REPLY_TO_SELF = "false"
DISCUSSION_ISSO_REQUIRE_AUTHOR = "true"
DISCUSSION_ISSO_REQUIRE_EMAIL = "true"
DISCUSSION_ISSO_REPLY_NOTIFICATIONS = "false"
DISCUSSION_ISSO_MAX_COMMENTS_TOP = 3
DISCUSSION_ISSO_MAX_COMMENTS_NESTED = 2
"""Isso commenting client configurations (GEO Default)"""
## See more Flask-Discussion options for Isso at: https://flask-discussion.readthedocs.io/en/latest/configs/isso.html