1 Commits

Author SHA1 Message Date
ef2ea6eedd remove cleartext root password from settings and history 2025-06-26 19:00:09 -04:00
2 changed files with 10 additions and 1 deletions

View File

@ -84,6 +84,15 @@ class History(Tab):
el.JsonEditor(properties=properties) el.JsonEditor(properties=properties)
with ui.tab_panel(response_tab): with ui.tab_panel(response_tab):
response = e.args["data"]["response"] 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]") ui.code(response).tailwind.height("[320px]").width("[640px]")
with el.WRow() as row: with el.WRow() as row:

View File

@ -66,7 +66,7 @@ class Setting(Tab):
control = el.FInput( control = el.FInput(
label=key, label=key,
password=True if key == "root_password" else False, 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), on_change=lambda e, key=key: self.set_key(key, e.value),
) )
self._elements[key] = { self._elements[key] = {