Skip to content

_main

Settings

Bases: BaseSettings

Contains the general configuration variables for Fractal Server.

ATTRIBUTE DESCRIPTION
JWT_EXPIRE_SECONDS

JWT token lifetime, in seconds.

TYPE: int

JWT_SECRET_KEY

JWT secret.
⚠️ Set this variable to a secure string, and do not disclose it.

TYPE: SecretStr

COOKIE_EXPIRE_SECONDS

Cookie token lifetime, in seconds.

TYPE: int

FRACTAL_RUNNER_BACKEND

Select which runner backend to use.

TYPE: Literal['local', 'slurm_ssh', 'slurm_sudo']

FRACTAL_LOGGING_LEVEL

Logging-level threshold for logging Only logs of with this level (or higher) will appear in the console logs.

TYPE: int

FRACTAL_API_MAX_JOB_LIST_LENGTH

Number of ids that can be stored in the jobsV2 attribute of app.state.

TYPE: int

FRACTAL_GRACEFUL_SHUTDOWN_TIME

Waiting time for the shutdown phase of executors, in seconds.

TYPE: float

FRACTAL_HELP_URL

The URL of an instance-specific Fractal help page.

TYPE: HttpUrl | None

FRACTAL_DEFAULT_GROUP_NAME

Name of the default user group.

If set to "All", then the user group with that name is a special user group (e.g. it cannot be deleted, and new users are automatically added to it). If set to None (the default value), then user groups are all equivalent, independently on their name.

TYPE: Literal['All'] | None

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
class Settings(BaseSettings):
    """
    Contains the general configuration variables for Fractal Server.

    Attributes:
        JWT_EXPIRE_SECONDS:
            JWT token lifetime, in seconds.
        JWT_SECRET_KEY:
            JWT secret.<br>
            ⚠️ Set this variable to a secure string, and do not disclose it.
        COOKIE_EXPIRE_SECONDS:
            Cookie token lifetime, in seconds.
        FRACTAL_RUNNER_BACKEND:
            Select which runner backend to use.
        FRACTAL_LOGGING_LEVEL:
            Logging-level threshold for logging
            Only logs of with this level (or higher) will appear in the console
            logs.
        FRACTAL_API_MAX_JOB_LIST_LENGTH:
            Number of ids that can be stored in the `jobsV2` attribute of
            `app.state`.
        FRACTAL_GRACEFUL_SHUTDOWN_TIME:
            Waiting time for the shutdown phase of executors, in seconds.
        FRACTAL_HELP_URL:
            The URL of an instance-specific Fractal help page.
        FRACTAL_DEFAULT_GROUP_NAME:
            Name of the default user group.

            If set to `"All"`, then the user group with that name is a special
            user group (e.g. it cannot be deleted, and new users are
            automatically added to it). If set to `None` (the default value),
            then user groups are all equivalent, independently on their name.
    """

    model_config = SettingsConfigDict(**SETTINGS_CONFIG_DICT)

    JWT_EXPIRE_SECONDS: int = 180
    JWT_SECRET_KEY: SecretStr
    COOKIE_EXPIRE_SECONDS: int = 86400
    # Note: we do not use ResourceType here to avoid circular imports
    FRACTAL_RUNNER_BACKEND: Literal[
        "local", "slurm_ssh", "slurm_sudo"
    ] = "local"
    FRACTAL_LOGGING_LEVEL: int = logging.INFO
    FRACTAL_API_MAX_JOB_LIST_LENGTH: int = 25
    FRACTAL_GRACEFUL_SHUTDOWN_TIME: float = 30.0
    FRACTAL_HELP_URL: HttpUrl | None = None
    FRACTAL_DEFAULT_GROUP_NAME: Literal["All"] | None = None