|
| 1 | +#!/bin/bash |
| 2 | +# Bootstrap script for fresh Tails installations |
| 3 | +# This script sets up SecureDrop admin tools on Tails via APT |
| 4 | +set -e |
| 5 | +set -o pipefail |
| 6 | + |
| 7 | +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" |
| 8 | + |
| 9 | +# Check if running on Tails |
| 10 | +if ! grep -q 'NAME="Tails"' /etc/os-release; then |
| 11 | + zenity --error \ |
| 12 | + --title="Unsupported Platform" \ |
| 13 | + --width=500 \ |
| 14 | + --text="This command only works on Tails.\n\nCurrent platform is not supported." |
| 15 | + exit 1 |
| 16 | +fi |
| 17 | + |
| 18 | +echo "========================================" |
| 19 | +echo "SecureDrop Admin Tools Bootstrap" |
| 20 | +echo "========================================" |
| 21 | +echo "" |
| 22 | +echo "This will install the SecureDrop admin tools on Tails..." |
| 23 | +echo "" |
| 24 | + |
| 25 | +# Run the root script |
| 26 | +ROOT_SCRIPT="$SCRIPT_DIR/configure-tails-persistence.sh" |
| 27 | +echo "Configuring Tails persistence (requires password)..." |
| 28 | +if ! pkexec bash "$ROOT_SCRIPT"; then |
| 29 | + echo "" |
| 30 | + echo "========================================" |
| 31 | + echo "ERROR: Bootstrap failed!" |
| 32 | + echo "========================================" |
| 33 | + echo "" |
| 34 | + zenity --error \ |
| 35 | + --title="Bootstrap Failed" \ |
| 36 | + --width=500 \ |
| 37 | + --text="Failed to configure Tails persistence.\n\nPlease see the terminal output for details." |
| 38 | + exit 1 |
| 39 | +fi |
| 40 | + |
| 41 | +# Verify installation |
| 42 | +if ! command -v /usr/bin/securedrop-admin >/dev/null 2>&1; then |
| 43 | + echo "" |
| 44 | + echo "========================================" |
| 45 | + echo "ERROR: Installation failed!" |
| 46 | + echo "========================================" |
| 47 | + echo "" |
| 48 | + zenity --error \ |
| 49 | + --title="Bootstrap Failed" \ |
| 50 | + --width=500 \ |
| 51 | + --text="Package installed but securedrop-admin command not found.\n\nInstallation may have failed." |
| 52 | + exit 1 |
| 53 | +fi |
| 54 | + |
| 55 | +echo "" |
| 56 | +echo "========================================" |
| 57 | +echo "Bootstrap completed successfully!" |
| 58 | +echo "========================================" |
| 59 | +echo "" |
| 60 | + |
| 61 | +# Inform user to click Install Every Time |
| 62 | +zenity --info \ |
| 63 | + --title="Click Install Every Time" \ |
| 64 | + --width=500 \ |
| 65 | + --text="In the Additional Software notification above, click \"Install Every Time\"." |
| 66 | + |
| 67 | +# Show final instructions |
| 68 | +zenity --info \ |
| 69 | + --title="Reboot Tails" \ |
| 70 | + --width=500 \ |
| 71 | + --text="Please REBOOT Tails to complete bootstrapping SecureDrop Admin Tools." |
| 72 | + |
| 73 | +exit 0 |
0 commit comments