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:export VARIABLE1=value1 export VARIABLE2=value2 - Write them inside a file named
.fractal_server.env, in your current working directory, with contents likeVARIABLE1=value1 VARIABLE2=value2
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 endpoints GET /api/settings/.
Configuration variables¶
Here are all the configuration variables with their description (note: expand the "Source code" blocks to see the default values).
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:
|
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
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 | |
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
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 | |
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
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 | |
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
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 | |
Minimal working example¶
This is a minimal working example of a .fractal_server.env, with all the required configuration variables set:
JWT_SECRET_KEY=secret-key-for-jwt-tokens
POSTGRES_DB=fractal-database-name