@@ -231,16 +231,20 @@ def _prompt_storage(existing: dict[str, str]) -> dict[str, str]:
231231 return env
232232
233233
234- def _prompt_admin () -> dict [str , str ]:
235- """Display admin account info. The API seeds a hardcoded admin on first startup."""
234+ def _prompt_admin (existing : dict [ str , str ] ) -> dict [str , str ]:
235+ """Prompt for the default admin email used during first API startup."""
236236 console .print ("\n [bold header]3. Admin Account[/bold header]" )
237+ default_email = existing .get ("TLAB_DEFAULT_ADMIN_EMAIL" , "admin@example.com" )
238+ admin_email = typer .prompt ("Default admin email" , default = default_email ).strip ()
239+ if not admin_email :
240+ admin_email = "admin@example.com"
237241 console .print (
238242 "[dim]A default admin account is created automatically on first startup:[/dim]"
239- "\n Email: [bold]admin@example.com [/bold]"
243+ f "\n Email: [bold]{ admin_email } [/bold]"
240244 "\n Password: [bold]admin123[/bold]"
241245 "\n [warning]Change the default password immediately after first login![/warning]"
242246 )
243- return {}
247+ return {"TLAB_DEFAULT_ADMIN_EMAIL" : admin_email }
244248
245249
246250def _prompt_compute (existing : dict [str , str ]) -> dict [str , str ]:
@@ -508,6 +512,7 @@ def _offer_install_script() -> int:
508512 (
509513 "Authentication" ,
510514 [
515+ "TLAB_DEFAULT_ADMIN_EMAIL" ,
511516 "EMAIL_AUTH_ENABLED" ,
512517 "GOOGLE_OAUTH_ENABLED" ,
513518 "GOOGLE_OAUTH_CLIENT_ID" ,
@@ -592,11 +597,12 @@ def _write_env_file(path: str, env_vars: dict[str, str]) -> None:
592597def _print_next_steps (env_vars : dict [str , str ]) -> None :
593598 """Print post-install guidance."""
594599 frontend_url = env_vars .get ("FRONTEND_URL" , "http://localhost:8338" )
600+ admin_email = env_vars .get ("TLAB_DEFAULT_ADMIN_EMAIL" , "admin@example.com" )
595601 console .print ("\n [bold header]Next Steps[/bold header]" )
596602 console .print (" 1. Start the server:" )
597603 console .print (" [bold]cd ~/.transformerlab/src && ./run.sh[/bold]" )
598604 console .print (f" 2. Open { frontend_url } in your browser" )
599- console .print (" 3. Log in with [bold]admin@example.com [/bold] / [bold]admin123[/bold]" )
605+ console .print (f " 3. Log in with [bold]{ admin_email } [/bold] / [bold]admin123[/bold]" )
600606 console .print (" [warning]Change the default password immediately![/warning]" )
601607
602608
@@ -748,7 +754,7 @@ def _install_interactive(dry_run: bool) -> None:
748754 provider = env_vars .get ("TFL_STORAGE_PROVIDER" , "unknown" ),
749755 )
750756
751- env_vars .update (_prompt_admin ())
757+ env_vars .update (_prompt_admin (existing ))
752758
753759 env_vars .update (_prompt_compute (existing ))
754760 if env_vars .get ("DEFAULT_COMPUTE_PROVIDER" ):
0 commit comments