Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[resotolib][feat] Support extra args to the webserver #1793

Merged
merged 3 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading