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
This commit is contained in:
rcourtman 2025-11-06 17:35:28 +00:00
parent a1dc451ed4
commit ead325942e

View file

@ -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
}