Configuration
Set configuration variables¶
There are two possibilities for setting the configuration variables that determine the settings for fractal-server:
- Define them as environment variables, in the same environment where the
fractal-serverprocess will runs: - Write them inside a file named
.fractal_server.env, in your current working directory, with contents like
Once the variables have been defined in one of these ways, they will be read automatically by the Fractal Server during the start-up phase.
If the same variable is defined twice, both as an environment variable and inside the .fractal_server.env file, the value defined in the environment takes priority.
Get current configuration¶
Admins can retrieve the current settings through the appropriate GET /api/settings/ endpoints.
Configuration variables¶
Here are all the configuration variables with their description (note: expand the "Source code" blocks to see the default values).
fractal_server.config._main.Settings
¶
Bases: BaseSettings
Contains the general configuration variables for Fractal Server.
| ATTRIBUTE | DESCRIPTION |
|---|---|
JWT_EXPIRE_SECONDS |
JWT token lifetime, in seconds.
TYPE:
|
JWT_SECRET_KEY |
JWT secret.
TYPE:
|
COOKIE_EXPIRE_SECONDS |
Cookie token lifetime, in seconds.
TYPE:
|
FRACTAL_RUNNER_BACKEND |
Select which runner backend to use.
TYPE:
|
FRACTAL_LOGGING_LEVEL |
Logging-level threshold for logging Only logs of with this level (or higher) will appear in the console logs.
TYPE:
|
LOG_CONFIG_FILE |
Path of a YAML file containing a Python
TYPE:
|
FRACTAL_API_MAX_JOB_LIST_LENGTH |
Number of ids that can be stored in the
TYPE:
|
FRACTAL_GRACEFUL_SHUTDOWN_TIME |
Waiting time for the shutdown phase of executors, in seconds.
TYPE:
|
FRACTAL_HELP_URL |
The URL of an instance-specific Fractal help page.
TYPE:
|
FRACTAL_DEFAULT_GROUP_NAME |
Name of the default user group. If set to
TYPE:
|
FRACTAL_LONG_REQUEST_TIME |
Time limit beyond which the execution of an API request is considered slow and an appropriate warning is logged by the middleware.
TYPE:
|
FRACTAL_DISABLE_BASIC_AUTH |
Remove endpoints starting with
TYPE:
|
FRACTAL_ENABLE_TASK_GROUP_RESET |
Enable admin-only endpoint to reset task groups.
TYPE:
|
Source code in fractal_server/config/_main.py
fractal_server.config._database.DatabaseSettings
¶
Bases: BaseSettings
Minimal set of configurations needed for operating on the database (e.g for schema migrations).
| ATTRIBUTE | DESCRIPTION |
|---|---|
DB_ECHO |
If
TYPE:
|
POSTGRES_USER |
User to use when connecting to the PostgreSQL database.
TYPE:
|
POSTGRES_PASSWORD |
Password to use when connecting to the PostgreSQL database.
TYPE:
|
POSTGRES_HOST |
URL to the PostgreSQL server or path to a UNIX domain socket.
TYPE:
|
POSTGRES_PORT |
Port number to use when connecting to the PostgreSQL server.
TYPE:
|
POSTGRES_DB |
Name of the PostgreSQL database to connect to.
TYPE:
|
Source code in fractal_server/config/_database.py
fractal_server.config._email.EmailSettings
¶
Bases: BaseSettings
Class with settings for email-sending feature.
| ATTRIBUTE | DESCRIPTION |
|---|---|
FRACTAL_EMAIL_SENDER |
Address of the OAuth-signup email sender.
TYPE:
|
FRACTAL_EMAIL_PASSWORD |
Password for the OAuth-signup email sender.
TYPE:
|
FRACTAL_EMAIL_SMTP_SERVER |
SMTP server for the OAuth-signup emails.
TYPE:
|
FRACTAL_EMAIL_SMTP_PORT |
SMTP server port for the OAuth-signup emails.
TYPE:
|
FRACTAL_EMAIL_INSTANCE_NAME |
Fractal instance name, to be included in the OAuth-signup emails.
TYPE:
|
FRACTAL_EMAIL_RECIPIENTS |
Comma-separated list of recipients of the OAuth-signup emails.
TYPE:
|
FRACTAL_EMAIL_USE_STARTTLS |
Whether to use StartTLS when using the SMTP server.
TYPE:
|
FRACTAL_EMAIL_USE_LOGIN |
Whether to use login when using the SMTP server. If 'true', FRACTAL_EMAIL_PASSWORD must be provided.
TYPE:
|
Source code in fractal_server/config/_email.py
fractal_server.config._oauth.OAuthSettings
¶
Bases: BaseSettings
Settings for integration with an OAuth identity provider.
| ATTRIBUTE | DESCRIPTION |
|---|---|
OAUTH_CLIENT_NAME |
Name of the client.
TYPE:
|
OAUTH_CLIENT_ID |
ID of client.
TYPE:
|
OAUTH_CLIENT_SECRET |
Secret to authorise against the identity provider.
TYPE:
|
OAUTH_OIDC_CONFIG_ENDPOINT |
OpenID Connect configuration endpoint, for autodiscovery of relevant endpoints.
TYPE:
|
OAUTH_REDIRECT_URL |
String to be used as
TYPE:
|
OAUTH_EMAIL_CLAIM |
Name of the OIDC claim with the user's email address. This is
TYPE:
|
Source code in fractal_server/config/_oauth.py
Minimal working example¶
This is a minimal working example of a .fractal_server.env, with all the required configuration variables set: