This commit is contained in:
Jörn-Michael Miehe 2022-09-21 00:13:06 +00:00
parent a0fb8fcc1c
commit 289cc01544
3 changed files with 27 additions and 1 deletions

View file

@ -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

View file

@ -40,7 +40,7 @@ async def add_middlewares() -> None:
app.mount( app.mount(
path="/", path="/",
app=StaticFiles( app=StaticFiles(
directory="/html", directory=SETTINGS.ui_directory,
html=True, html=True,
), ),
name="frontend", name="frontend",

View file

@ -37,8 +37,13 @@ class Settings(BaseSettings):
Per-run settings. Per-run settings.
""" """
#####
# general settings
#####
production_mode: bool = False production_mode: bool = False
log_level: str = "INFO" if production_mode else "DEBUG" log_level: str = "INFO" if production_mode else "DEBUG"
ui_directory: str = "/html"
cache_time: int = 30 cache_time: int = 30
cache_size: int = 30 cache_size: int = 30
@ -46,16 +51,28 @@ class Settings(BaseSettings):
ping_host: str = "10.0.0.0" ping_host: str = "10.0.0.0"
ping_port: int = 1 ping_port: int = 1
#####
# openapi settings
#####
openapi_url: str = "/openapi.json" openapi_url: str = "/openapi.json"
docs_url: Optional[str] = None if production_mode else "/docs" docs_url: Optional[str] = None if production_mode else "/docs"
redoc_url: Optional[str] = None if production_mode else "/redoc" redoc_url: Optional[str] = None if production_mode else "/redoc"
#####
# webdav settings
#####
webdav: DavSettings = DavSettings() webdav: DavSettings = DavSettings()
webdav_disable_check: bool = False webdav_disable_check: bool = False
webdav_retries: int = 20 webdav_retries: int = 20
webdav_prefix: str = "/ovdashboard" webdav_prefix: str = "/ovdashboard"
config_path: str = "config.txt" config_path: str = "config.txt"
#####
# caldav settings
#####
caldav: DavSettings = DavSettings() caldav: DavSettings = DavSettings()
class Config: class Config: