diff --git a/api/README.md b/api/README.md index e69de29..38b06e2 100644 --- a/api/README.md +++ b/api/README.md @@ -0,0 +1,9 @@ +# OVDashboard API + +This API enables the OVDashboard UI to run. + +## Quick Start + +Preferably, use the `docker` image at `TODO` to run API and UI simultaneously. Refer to the [main config](TODO) for how to do that. + +## Running the API \ No newline at end of file diff --git a/api/ovdashboard_api/app.py b/api/ovdashboard_api/app.py index d83b7df..8e8264f 100644 --- a/api/ovdashboard_api/app.py +++ b/api/ovdashboard_api/app.py @@ -40,7 +40,7 @@ async def add_middlewares() -> None: app.mount( path="/", app=StaticFiles( - directory="/html", + directory=SETTINGS.ui_directory, html=True, ), name="frontend", diff --git a/api/ovdashboard_api/settings.py b/api/ovdashboard_api/settings.py index 43fec69..747430a 100644 --- a/api/ovdashboard_api/settings.py +++ b/api/ovdashboard_api/settings.py @@ -37,8 +37,13 @@ class Settings(BaseSettings): Per-run settings. """ + ##### + # general settings + ##### + production_mode: bool = False log_level: str = "INFO" if production_mode else "DEBUG" + ui_directory: str = "/html" cache_time: int = 30 cache_size: int = 30 @@ -46,16 +51,28 @@ class Settings(BaseSettings): ping_host: str = "10.0.0.0" ping_port: int = 1 + ##### + # openapi settings + ##### + openapi_url: str = "/openapi.json" docs_url: Optional[str] = None if production_mode else "/docs" redoc_url: Optional[str] = None if production_mode else "/redoc" + ##### + # webdav settings + ##### + webdav: DavSettings = DavSettings() webdav_disable_check: bool = False webdav_retries: int = 20 webdav_prefix: str = "/ovdashboard" config_path: str = "config.txt" + ##### + # caldav settings + ##### + caldav: DavSettings = DavSettings() class Config: