Config
BasicAuthConfig
pydantic-model
¶
Bases: BaseModel
The configuration for username and password based authentication.
Fields:
Source code in src/signalbot/bot_config.py
BearerAuthConfig
pydantic-model
¶
Bases: BaseModel
The configuration for token based authentication.
Fields:
Source code in src/signalbot/bot_config.py
Config
pydantic-model
¶
Bases: BaseModel
The configuration for SignalBot.
Fields:
-
phone_number(str) -
signal_service(str) -
auth(BasicAuthConfig | BearerAuthConfig | None) -
storage(RedisConfig | SQLiteConfig | InMemoryConfig | None) -
retry_interval(int) -
download_attachments(bool) -
connection_mode(ConnectionMode) -
logging_level(int)
Source code in src/signalbot/bot_config.py
auth
pydantic-field
¶
auth: BasicAuthConfig | BearerAuthConfig | None = None
The authentication config used for http requests.
connection_mode
pydantic-field
¶
connection_mode: ConnectionMode = ConnectionMode.AUTO
The connection mode to use when connecting to the Signal service.
download_attachments
pydantic-field
¶
download_attachments: bool = True
Whether to download attachments from messages.
retry_interval
pydantic-field
¶
retry_interval: int = 1
The interval in seconds to wait before retrying a failed connection to the signal service.
signal_service
pydantic-field
¶
signal_service: str = 'localhost:8080'
The URL of the signal-cli-rest-api service to connect to, without protocol.
storage
pydantic-field
¶
storage: (
RedisConfig | SQLiteConfig | InMemoryConfig | None
) = None
The configuration for the storage backend to use.
InMemoryConfig
pydantic-model
¶
Bases: BaseModel
The configuration for the in-memory storage backend, which defaults to SQLiteStorage with memory storage.
Fields:
Source code in src/signalbot/bot_config.py
RedisConfig
pydantic-model
¶
Bases: BaseModel
The configuration for the RedisStorage backend.
Fields:
Source code in src/signalbot/bot_config.py
SQLiteConfig
pydantic-model
¶
Bases: BaseModel
The configuration for the SQLiteStorage backend.
Fields:
Source code in src/signalbot/bot_config.py
load_config ¶
Coerce a Config, mapping, or path to a JSON/YAML file into a Config.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
Config | Mapping | Path | str
|
An already-built |
required |
Returns:
| Type | Description |
|---|---|
Config
|
The resulting |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |