feat(install): show copyable install token in server start banner

Color the install URL and add a separate block that prints the install
token on its own line so users can copy it without parsing the query
string. The token block shows in both the URL and reverse-proxy branches.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Bryan Helmkamp 2026-04-24 13:04:02 -04:00
parent 68214575e3
commit 701598a472

View file

@ -222,7 +222,7 @@ fn announce_install_mode(bind: &Bind, token: &str, styles: &Styles, printer: Pri
match install_url_hint(bind, token) {
Some(url) => {
fabro_util::printerr!(printer, " Open this URL in your browser to finish setup:");
fabro_util::printerr!(printer, " {url}");
fabro_util::printerr!(printer, " {}", styles.cyan.apply_to(&url));
if let Err(e) = browser::try_open(&url) {
fabro_util::printerr!(printer, "");
fabro_util::printerr!(printer, " Could not open a browser automatically: {e}");
@ -237,6 +237,9 @@ fn announce_install_mode(bind: &Bind, token: &str, styles: &Styles, printer: Pri
}
}
fabro_util::printerr!(printer, "");
fabro_util::printerr!(printer, " If prompted, paste the install token:");
fabro_util::printerr!(printer, " {}", styles.bold_cyan.apply_to(token));
fabro_util::printerr!(printer, "");
fabro_util::printerr!(
printer,
"{}",