diff --git a/install.sh b/install.sh index e961c03..3a01b17 100644 --- a/install.sh +++ b/install.sh @@ -108,9 +108,42 @@ else sed -i 's/^TPM_ENABLED=.*/TPM_ENABLED=false/' /root/post-install.sh fi -read -p "Do you have Tang servers configured? [y/N]: " USE_TANG +read -p "Do you want to configure remote unlock Tang servers? [y/N]: " USE_TANG if [[ "$USE_TANG" =~ ^[Yy]$ ]]; then - echo "Please edit /root/post-install.sh after installation to add Tang servers." + echo "Configuring Tang servers..." + TANG_CONFIG="" + + while true; do + read -p "Enter Tang server URL (or press Enter to finish): " TANG_URL + if [ -z "$TANG_URL" ]; then + break + fi + + read -p "Enter thumbprint for $TANG_URL: " TANG_THUMBPRINT + if [ -n "$TANG_THUMBPRINT" ]; then + TANG_CONFIG+=" \"$TANG_URL $TANG_THUMBPRINT\"\n" + echo "Added Tang server: $TANG_URL" + else + echo "Skipping server (no thumbprint provided)" + fi + done + + if [ -n "$TANG_CONFIG" ]; then + # Update the TANG_SERVERS array in post-install.sh + sed -i '/^TANG_SERVERS=(/,/^)/ { + /^TANG_SERVERS=(/ { + r /dev/stdin + d + } + /^)/ !d + }' /root/post-install.sh << EOF +TANG_SERVERS=( +$TANG_CONFIG) +EOF + echo "Configured Tang servers in post-install script." + else + echo "No Tang servers configured." + fi fi # Final confirmation @@ -118,7 +151,7 @@ echo -e "\n[+] Ready to install with these settings:" echo " Hostname: $HOSTNAME" echo " Username: $USERNAME" echo " SSH Key: ${SSH_KEY:0:50}..." -echo " LUKS Passphrase: [HIDDEN]" +echo " LUKS Passphrase: $LUKS_PASS" echo "" read -p "Proceed with installation? [Y/n]: " CONFIRM if [[ "$CONFIRM" =~ ^[Nn]$ ]]; then