Skip to content

Commit

Permalink
[resotolib][feat] Support extra args to the webserver (#1793)
Browse files Browse the repository at this point in the history
* [resotolib][feat] Support extra args to the webserver
  • Loading branch information
lloesche authored Oct 2, 2023
1 parent f6ac06e commit 18d1818
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions resotolib/resotolib/web/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def __init__(
web_port: int = 9955,
ssl_cert: Optional[str] = None,
ssl_key: Optional[str] = None,
extra_config: Optional[dict[str, Any]] = None,
) -> None:
super().__init__()
self.name = "webserver"
Expand All @@ -20,6 +21,7 @@ def __init__(
self.web_port = web_port
self.ssl_cert = ssl_cert
self.ssl_key = ssl_key
self.extra_config = extra_config or {}

@property
def serving(self) -> bool:
Expand Down Expand Up @@ -69,6 +71,7 @@ def run(self) -> None:
"request.show_tracebacks": False,
"request.show_mismatched_params": False,
**ssl_args,
**self.extra_config,
}
}
)
Expand Down
3 changes: 2 additions & 1 deletion resotoworker/resotoworker/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ def send_request(request: requests.Request) -> requests.Response:
),
web_host=Config.resotoworker.web_host,
web_port=Config.resotoworker.web_port,
**web_server_args,
ssl_cert=web_server_args.get("ssl_cert"),
ssl_key=web_server_args.get("ssl_key"),
)
web_server.daemon = True
web_server.start()
Expand Down

0 comments on commit 18d1818

Please sign in to comment.