From ead325942ecfed511bf18c2de4102e7a9716e3b0 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Thu, 6 Nov 2025 17:35:28 +0000 Subject: [PATCH] Add bootstrap token display to install.sh completion message Enhances discoverability for non-Docker installations (bare metal, LXC) by displaying the bootstrap token prominently at the end of install.sh. Changes: - Add ASCII box display matching Docker startup format - Show token value and file location - Include usage instructions for first-time setup - Only display if .bootstrap_token file exists - Auto-cleanup note matches behavior With this change, bootstrap token is now prominently displayed across all installation methods: - Docker: startup logs (commit 731eb586) - Bare metal/LXC: install.sh completion (this commit) - CLI: pulse bootstrap-token command (commit 731eb586) Related to #645 --- install.sh | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 8ce1ecb..abaa375 100755 --- a/install.sh +++ b/install.sh @@ -2517,7 +2517,26 @@ print_completion() { echo " Enable: systemctl enable --now pulse-update.timer" fi fi - + + # Show bootstrap token on fresh install + local DATA_DIR="${DATA_PATH:-/var/lib/pulse}" + local TOKEN_FILE="$DATA_DIR/.bootstrap_token" + if [[ -f "$TOKEN_FILE" ]]; then + BOOTSTRAP_TOKEN=$(cat "$TOKEN_FILE" 2>/dev/null | tr -d '\n') + if [[ -n "$BOOTSTRAP_TOKEN" ]]; then + echo + echo -e "${YELLOW}╔═══════════════════════════════════════════════════════════════════════╗${NC}" + echo -e "${YELLOW}║ BOOTSTRAP TOKEN REQUIRED FOR FIRST-TIME SETUP ║${NC}" + echo -e "${YELLOW}╠═══════════════════════════════════════════════════════════════════════╣${NC}" + printf "${YELLOW}║${NC} Token: ${GREEN}%-61s${YELLOW}║${NC}\n" "$BOOTSTRAP_TOKEN" + printf "${YELLOW}║${NC} File: %-61s${YELLOW}║${NC}\n" "$TOKEN_FILE" + echo -e "${YELLOW}╠═══════════════════════════════════════════════════════════════════════╣${NC}" + echo -e "${YELLOW}║${NC} Copy this token and paste it into the unlock screen in your browser. ${YELLOW}║${NC}" + echo -e "${YELLOW}║${NC} This token will be automatically deleted after successful setup. ${YELLOW}║${NC}" + echo -e "${YELLOW}╚═══════════════════════════════════════════════════════════════════════╝${NC}" + fi + fi + echo }