remove cleartext root password from settings and history

This commit is contained in:
Natan Keddem
2025-06-26 19:00:09 -04:00
parent b790be713a
commit ef2ea6eedd
2 changed files with 10 additions and 1 deletions

View File

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

View File

@ -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] = {