gufo.thor.config¶
Config data structures.
CliConfig
dataclass
¶
Bases: object
Config populated during runtime.
Should not be set by user. Populated from CLI options.
Config
dataclass
¶
Bases: object
The Gufo Thor config.
Attributes:
Name | Type | Description |
---|---|---|
project |
Optional[str]
|
Optional project name used to prefix the services and volumes. If not set - directory name is used. Should be unique within Thor projects on same host. |
noc |
NocConfig
|
The |
expose |
ExposeConfig
|
The |
services |
Dict[str, ServiceConfig]
|
The |
default()
staticmethod
¶
ExposeConfig
dataclass
¶
Bases: object
The expose
section of the config.
Attributes:
Name | Type | Description |
---|---|---|
domain_name |
str
|
A domain name through which the NOC's user interface will be accessed in browser. |
port |
int
|
An HTTPS port of the NOC's user interface. |
from_dict(data)
staticmethod
¶
Generate ExposeConfig instance from a dictionary.
Args: data: Incoming data.
Returns: A configured ExposeConfig instance.
NocConfig
dataclass
¶
Bases: object
The noc
section of the config.
Attributes:
Name | Type | Description |
---|---|---|
tag |
str
|
NOC image tag |
path |
Optional[str]
|
An optional path to the NOC source code. If not empty,
image's |
custom |
Optional[str]
|
Optional path to the custom, will be mounted
in the |
installation_name |
str
|
The installation name which will be shown in the interface. |
theme |
Literal['noc', 'gray']
|
Web interface theme. One of: |
migrate |
bool
|
Run migrations on start |
ServiceConfig
dataclass
¶
Bases: object
The services
section of the config.
Attributes:
Name | Type | Description |
---|---|---|
tag |
Optional[str]
|
Override |
scale |
int
|
Number of concurrently running servers. 0 - disable. |
default()
staticmethod
¶
Get default ServiceConfig.
from_dict(data)
staticmethod
¶
Generate ServiceConfig instance from a dictionary.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
Dict[str, Any]
|
Incoming data. |
required |
Returns:
Type | Description |
---|---|
ServiceConfig
|
A configured ServiceConfig instance. |
get_sample(name)
¶
Get preconfigured config sample by name.
All samples are preserved in samples
directory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
Sample name, without |
required |
Returns:
Type | Description |
---|---|
str
|
A string containinng sample code. |