diff --git a/shared/libretime_shared/config.py b/shared/libretime_shared/config.py index abb49729c..18de14728 100644 --- a/shared/libretime_shared/config.py +++ b/shared/libretime_shared/config.py @@ -107,6 +107,13 @@ class DatabaseConfig(BaseModel): user: str = "libretime" password: str = "libretime" + @property + def url(self) -> str: + return ( + f"postgresql://{self.user}:{self.password}" + f"@{self.host}:{self.port}/{self.name}" + ) + # pylint: disable=too-few-public-methods class RabbitMQConfig(BaseModel): @@ -116,3 +123,10 @@ class RabbitMQConfig(BaseModel): user: str = "libretime" password: str = "libretime" vhost: str = "/libretime" + + @property + def url(self) -> str: + return ( + f"amqp://{self.user}:{self.password}" + f"@{self.host}:{self.port}/{self.vhost.lstrip('/')}" + )