From e3eaf5ffe29eaa998bab2e3a9a01b50a1da65584 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mose=20M=C3=BCller?= Date: Tue, 19 Dec 2023 16:11:32 +0100 Subject: [PATCH] adds ServiceConfig and WebServerConfig --- src/pydase/config.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/pydase/config.py b/src/pydase/config.py index 4e30b8b..65af08c 100644 --- a/src/pydase/config.py +++ b/src/pydase/config.py @@ -1,3 +1,4 @@ +from pathlib import Path from typing import Literal from confz import BaseConfig, EnvSource @@ -7,3 +8,15 @@ class OperationMode(BaseConfig): # type: ignore[misc] environment: Literal["development", "production"] = "development" CONFIG_SOURCES = EnvSource(allow=["ENVIRONMENT"]) + + +class ServiceConfig(BaseConfig): # type: ignore[misc] + service_config_dir: Path = Path("config") + + CONFIG_SOURCES = EnvSource(allow=["SERVICE_CONFIG_DIR"]) + + +class WebServerConfig(BaseConfig): # type: ignore[misc] + generate_new_web_settings: bool = False + + CONFIG_SOURCES = EnvSource(allow=["GENERATE_NEW_WEB_SETTINGS"])