Configuration options

How to change settings

Settings are stored in the thunor-app.env and thunor-db.env files as environment variables: one variable per line, in the format VARIABLE=value. Most configuration will go in thunor-app.env, except the database configuration, which goes in thunor-db.env.

To change a variable, simply open the relevant file in a text editor, and enter in the new value. Allowed values are shown in a table below.

For the changes to take effect, you must restart Thunor Web:

python thunorctl.py restart

Public user signup

By default, only administrators can create users, and the public signup facility is disabled. To enable it, set the environment variable THUNOR_SIGNUP_OPEN=True. Users can then create an account by visiting the URL /accounts/signup on your server. It is strongly recommended that you also set THUNOR_EMAIL_VERIFICATION=mandatory to require new users to verify their email addresses if your server will be publicly accessible (see Email server configuration).

Dataset access without login

By default, users will need to be logged in to access any dataset or tag labeled "Public". To enable anonymous access (i.e. without an account, or when logged out), set the THUNOR_LOGIN_REQUIRED environment variable to False.

Email server configuration

An email server is required to enable the THUNOR_EMAIL_VERIFICATION option. Enter the details of an SMTP server using the DJANGO_EMAIL_HOST, DJANGO_EMAIL_PORT etc. variables.

Integration with Sentry

Sentry is an error monitoring and aggregation system. For example, if an error occurs when a user loads a page on the site, the error will be logged in Sentry. Administrators can be alerted by email.

Sentry is available as a service (free for small use cases and academic use), or can be installed locally.

See the Sentry quickstart guide to create a project to track Thunor alerts. When you have a Sentry DSN (a URL to which software can report errors), set that value as the environment variable DJANGO_SENTRY_DSN to enable Thunor's Sentry integration.

Complete list of settings

Thunor Web is configured through the use of environment variables, which are listed below.

Remember to restart Thunor Web after changing configuration: python thunorctl.py restart

Name Default Description
THUNOR_LOGIN_REQUIRED True Set to False to allow anonymous access to public datasets. Set to True if an account is required to use the system.
THUNOR_SIGNUP_OPEN False Set to True to allow anyone with access to the server to create an account.
THUNOR_EMAIL_VERIFICATION none none: Don't verify accounts by email
mandatory: Require email verification of accounts (recommended)
DJANGO_SENTRY_DSN None A Sentry DSN value to enable Sentry, a system for logging and aggregating errors.
DJANGO_EMAIL_HOST None Hostname of email server
DJANGO_EMAIL_PORT None Email server port, e.g. 587 for a TLS connection
DJANGO_EMAIL_USER None User account name on email server
DJANGO_EMAIL_PASSWORD None User password on email server
DJANGO_EMAIL_FROM Same as user Account to send email from, e.g. An Example <an.example@example.com>
DJANGO_SECRET_KEY (random) A secret key for this instance used by Django. Typically 50 random characters. You can use an online tool to generate one, if desired.
DJANGO_DEBUG False Set to True to enable debug information. Do not use in production or on publicly accessible servers.
DJANGO_HOSTNAME None Hostname of the server e.g. thunor.example.com
DJANGO_STATIC_URL /static/ Location to serve static files from. This only needs changing if you wish to serve static files from a separate domain.
DJANGO_ACCOUNTS_TLS False Set to True to use https:// links for account emails, e.g. password reset
DATA_UPLOAD_MAX_NUMBER_FIELDS 1000 The maximum number of form fields the server will process. If you have datasets with lots of cell lines and drugs, you may wish to increase this number, at the expense of system memory.
POSTGRES_HOST localhost Hostname of the postgres server, or postgres to use the Docker Compose-launched postgres instance.
POSTGRES_USER postgres Postgres username
POSTGRES_PASSWORD (random) Postgres password
DJANGO_REDIS_URL redis://redis:6379/1 A Redis URL. If provided, the Redis instance will be used as a system cache, to improve response times. The default URL uses a Redis instance provisioned by Docker Compose.
DJANGO_DB_CACHE False Set to True to use a database cache. The cache table must be created before first use, as described in the installation procedure. If a DJANGO_REDIS_URL is provided, that option supersedes this one.
UWSGI_PROCESSES 5 Number of processes to use for the application server (uWSGI)
UWSGI_BUFFER_SIZE 32768 Buffer size for the application server (uWSGI)