Configuration

Default configuration for TDotDat.

You overwrite and set instance-specific configuration by either:

  • Configuration file: <virtualenv prefix>/var/instance/invenio.cfg

  • Environment variables: APP_<variable name>

tdotdat.config.ACCOUNTS_SESSION_REDIS_URL = 'redis://localhost:6379/1'

Redis session storage URL.

tdotdat.config.ACCOUNTS_USERINFO_HEADERS = True

Enable session/user id request tracing. This feature will add X-Session-ID and X-User-ID headers to HTTP response. You MUST ensure that NGINX (or other proxies) removes these headers again before sending the response to the client. Set to False, in case of doubt.

tdotdat.config.APP_ALLOWED_HOSTS = ['tdotdat.york.ac.uk', 'localhost', '127.0.0.1']

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.

tdotdat.config.APP_THEME = ['semantic-ui']

The Invenio theme.

tdotdat.config.BABEL_DEFAULT_LANGUAGE = 'en'

Default language

tdotdat.config.BABEL_DEFAULT_TIMEZONE = 'Europe/London'

Default time zone

tdotdat.config.BASE_TEMPLATE = 'invenio_theme/page.html'

Global base template.

tdotdat.config.CELERY_BEAT_SCHEDULE = {'accounts': {'schedule': datetime.timedelta(seconds=3600), 'task': 'invenio_accounts.tasks.clean_session_table'}, 'indexer': {'schedule': datetime.timedelta(seconds=300), 'task': 'invenio_indexer.tasks.process_bulk_queue'}}

Scheduled tasks configuration (aka cronjobs).

tdotdat.config.CELERY_BROKER_URL = 'amqp://guest:guest@localhost:5672/'

URL of message broker for Celery (default is RabbitMQ).

tdotdat.config.CELERY_RESULT_BACKEND = 'redis://localhost:6379/2'

URL of backend for result storage (default is Redis).

tdotdat.config.COLLECT_STORAGE = 'flask_collect.storage.file'

Static files collection method (defaults to copying files).

tdotdat.config.COVER_TEMPLATE = 'invenio_theme/page_cover.html'

Cover page base template (used for e.g. login/sign-up).

tdotdat.config.DEBUG_TB_INTERCEPT_REDIRECTS = False

Switches off incept of redirects by Flask-DebugToolbar.

tdotdat.config.FOOTER_TEMPLATE = 'invenio_theme/footer.html'

Footer base template.

tdotdat.config.HEADER_TEMPLATE = 'invenio_theme/header.html'

Header base template.

tdotdat.config.I18N_LANGUAGES = []

Other supported languages (do not include the default language in list).

tdotdat.config.JSONSCHEMAS_HOST = 'tdotdat.com'

Hostname used in URLs for local JSONSchemas.

tdotdat.config.MAIL_SUPPRESS_SEND = True

Disable email sending by default.

tdotdat.config.MAX_CONTENT_LENGTH = 104857600

Max upload size for form data via application/mulitpart-formdata.

tdotdat.config.PREVIEWER_PREFERENCE = ['iiif_image', 'csv_dthreejs', 'simple_image', 'json_prismjs', 'xml_prismjs', 'mistune', 'pdfjs', 'ipynb', 'zip']

Include IIIF preview for images.

tdotdat.config.RATELIMIT_STORAGE_URL = 'redis://localhost:6379/3'

Storage for ratelimiter.

tdotdat.config.SECRET_KEY = 'CHANGE_ME'

Secret key - each installation (dev, production, …) needs a separate key. It should be changed before deploying.

tdotdat.config.SECURITY_EMAIL_SENDER = 'peter.hill@york.ac.uk'

Email address used as sender of account registration emails.

tdotdat.config.SECURITY_EMAIL_SUBJECT_REGISTER = 'Welcome to TDotDat!'

Email subject for account registration emails.

Sets cookie with the samesite flag to ‘Strict’ by default. Possible values are ‘Strict’, ‘Lax’ or None to disable it.

Sets cookie with the secure flag by default

tdotdat.config.SETTINGS_TEMPLATE = 'invenio_theme/page_settings.html'

Settings base template.

tdotdat.config.SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://tdotdat:tdotdat@localhost/tdotdat'

Database URI including user and password

tdotdat.config.SUPPORT_EMAIL = 'peter.hill@york.ac.uk'

Email address for support.

tdotdat.config.THEME_FRONTPAGE = True

Use default frontpage.

tdotdat.config.THEME_FRONTPAGE_TEMPLATE = 'tdotdat/frontpage.html'

Frontpage template.

tdotdat.config.THEME_FRONTPAGE_TITLE = 'TDotDat'

Frontpage title.

tdotdat.config.THEME_HEADER_TEMPLATE = 'tdotdat/header.html'

Header template

tdotdat.config.THEME_SITENAME = 'TDotDat'

Site name.