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

Add settings option to disable webui #85

Merged
merged 1 commit into from
Feb 3, 2025
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
1 change: 1 addition & 0 deletions libpermian/default.ini
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ additional_reporting=
throttleInterval=0

[WebUI]
enabled=True
listen_ip=0.0.0.0
listen_port=random
# Create static version of WebUI before pipeline ends
Expand Down
7 changes: 4 additions & 3 deletions libpermian/pipeline/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,10 @@ def _startWebUI(self):
Start WebUI daemon thread and start providing the pipeline status over
HTTP.
"""
self.webUI = WebUI(self)
self.webUI.start()
self.webUI.waitUntilStarted()
if self.settings.getboolean('WebUI', 'enabled'):
self.webUI = WebUI(self)
self.webUI.start()
self.webUI.waitUntilStarted()

def _cloneLibrary(self, target_directory=None):
"""
Expand Down
2 changes: 1 addition & 1 deletion libpermian/webui/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def render_static(pipeline):

Creates static version of WebUI that can be accessed after pipeline ends.
"""
if not pipeline.settings.get('WebUI', 'create_static_webui'):
if not pipeline.settings.get('WebUI', 'create_static_webui') or not pipeline.settings.getboolean('WebUI', 'enabled'):
return

LOGGER.info('Generating static WebUI')
Expand Down