2 Commits
v1.0.9 ... main

Author SHA1 Message Date
140d1d803f added root-password-hashed 2025-06-26 19:08:10 -04:00
ef2ea6eedd remove cleartext root password from settings and history 2025-06-26 19:00:09 -04:00
2 changed files with 11 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] = {
@ -162,6 +162,7 @@ class Global(Setting):
"mailto": {"description": "The default email address for the user root."},
"timezone": {"description": "The timezone in tzdata format. For example, Europe/Vienna or America/New_York."},
"root_password": {"description": "The password for the root user.", "type": "str"},
"root-password-hashed": {"description": "The pre-hashed password for the root user, which will be written verbatim to /etc/passwd. May be used instead of root_password and can be generated using the mkpasswd tool, for example.", "type": "str"},
"root_ssh_keys": {"description": "Optional. SSH public keys to add to the root users authorized_keys file after the installation."},
"reboot_on_error": {
"description": "If set to true, the installer will reboot automatically when an error is encountered. The default behavior is to wait to give the administrator a chance to investigate why the installation failed."