From ef2ea6eeddb3977b1e9fd8afe96a520760f6e371 Mon Sep 17 00:00:00 2001 From: Natan Keddem Date: Thu, 26 Jun 2025 19:00:09 -0400 Subject: [PATCH] remove cleartext root password from settings and history --- autopve/tabs/history.py | 9 +++++++++ autopve/tabs/settings.py | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/autopve/tabs/history.py b/autopve/tabs/history.py index d33270b..0d8ab88 100644 --- a/autopve/tabs/history.py +++ b/autopve/tabs/history.py @@ -84,6 +84,15 @@ class History(Tab): el.JsonEditor(properties=properties) with ui.tab_panel(response_tab): response = e.args["data"]["response"] + lines = response.splitlines() + response_lines = [] + for line in lines: + if line.strip().startswith("root_password"): + response_lines.append('root_password = "SECRET"') + else: + response_lines.append(line) + + response = "\n".join(response_lines) ui.code(response).tailwind.height("[320px]").width("[640px]") with el.WRow() as row: diff --git a/autopve/tabs/settings.py b/autopve/tabs/settings.py index c246b40..d9f3159 100644 --- a/autopve/tabs/settings.py +++ b/autopve/tabs/settings.py @@ -66,7 +66,7 @@ class Setting(Tab): control = el.FInput( label=key, password=True if key == "root_password" else False, - password_toggle_button=True if key == "root_password" else False, + password_toggle_button=False, on_change=lambda e, key=key: self.set_key(key, e.value), ) self._elements[key] = {