2023-05-31 13:58:18 +02:00
|
|
|
from typing import Literal, Optional
|
|
|
|
|
2022-03-01 13:22:24 +01:00
|
|
|
from libretime_shared.config import (
|
|
|
|
BaseConfig,
|
|
|
|
DatabaseConfig,
|
|
|
|
GeneralConfig,
|
|
|
|
RabbitMQConfig,
|
2022-04-18 20:34:38 +02:00
|
|
|
StorageConfig,
|
2022-03-01 13:22:24 +01:00
|
|
|
)
|
2023-05-31 13:58:18 +02:00
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
|
|
|
|
|
|
class EmailConfig(BaseModel):
|
|
|
|
from_email: str = "no-reply@libretime.org"
|
|
|
|
|
|
|
|
host: str = "localhost"
|
|
|
|
port: int = 25
|
|
|
|
user: str = ""
|
|
|
|
password: str = ""
|
|
|
|
encryption: Optional[Literal["ssl/tls", "starttls"]] = None
|
|
|
|
timeout: Optional[int] = None
|
|
|
|
key_file: Optional[str] = None
|
|
|
|
cert_file: Optional[str] = None
|
2022-03-01 13:22:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
class Config(BaseConfig):
|
|
|
|
general: GeneralConfig
|
|
|
|
database: DatabaseConfig = DatabaseConfig()
|
|
|
|
rabbitmq: RabbitMQConfig = RabbitMQConfig()
|
2022-04-18 20:34:38 +02:00
|
|
|
storage: StorageConfig = StorageConfig()
|
2023-05-31 13:58:18 +02:00
|
|
|
email: EmailConfig = EmailConfig()
|