privacy-toolkit/tools/simplex/install-appimage.sh
2025-12-31 19:44:07 -07:00

107 lines
3.2 KiB
Bash
Executable file

#!/bin/bash
set -euo pipefail
# ==============================================================================
# SimpleX AppImage Installation (Recommended for Debian Trixie)
# ==============================================================================
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
NC='\033[0m'
log() { echo -e "${GREEN}[INFO]${NC} $*"; }
warn() { echo -e "${YELLOW}[WARN]${NC} $*"; }
error() { echo -e "${RED}[ERROR]${NC} $*"; exit 1; }
echo "=== SimpleX AppImage Installation ==="
echo ""
log "Fetching latest release info..."
LATEST_RELEASE=$(curl -s https://api.github.com/repos/simplex-chat/simplex-chat/releases/latest)
# Get AppImage URL
APPIMAGE_URL=$(echo "$LATEST_RELEASE" | jq -r '.assets[] | select(.name == "simplex-desktop-x86_64.AppImage") | .browser_download_url')
# Get SHA256 checksum URL
CHECKSUM_URL=$(echo "$LATEST_RELEASE" | jq -r '.assets[] | select(.name == "simplex-desktop-x86_64.AppImage.sha256sum") | .browser_download_url')
if [ -z "$APPIMAGE_URL" ]; then
error "Could not find AppImage in latest release"
fi
VERSION=$(echo "$LATEST_RELEASE" | jq -r '.tag_name')
log "Latest version: $VERSION"
log "AppImage URL: $APPIMAGE_URL"
# Download AppImage
log "Downloading SimpleX AppImage..."
mkdir -p ~/.local/bin
cd /tmp
wget --show-progress -O SimpleX.AppImage "$APPIMAGE_URL"
# Download and verify checksum
if [ -n "$CHECKSUM_URL" ]; then
log "Downloading checksum..."
wget -q -O SimpleX.AppImage.sha256sum "$CHECKSUM_URL"
log "Verifying checksum..."
if sha256sum -c SimpleX.AppImage.sha256sum 2>&1 | grep -q "OK"; then
log "✅ Checksum verified"
else
error "Checksum verification failed! Download may be corrupted or compromised."
fi
rm SimpleX.AppImage.sha256sum
else
warn "⚠️ No checksum file found - skipping verification"
warn "This is less secure. Continue anyway? [y/N]"
read -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
log "Installation cancelled"
rm SimpleX.AppImage
exit 0
fi
fi
# Install to ~/.local/bin
log "Installing to ~/.local/bin..."
mv SimpleX.AppImage ~/.local/bin/
chmod +x ~/.local/bin/SimpleX.AppImage
# Create simplex symlink for easier CLI access
log "Creating 'simplex' symlink..."
ln -sf ~/.local/bin/SimpleX.AppImage ~/.local/bin/simplex
# Create desktop entry
log "Creating desktop entry..."
mkdir -p ~/.local/share/applications
cat > ~/.local/share/applications/simplex.desktop << DESKTOP
[Desktop Entry]
Name=SimpleX
Comment=Private messaging without identifiers
Exec=$HOME/.local/bin/SimpleX.AppImage
Icon=simplex
Type=Application
Categories=Network;Chat;
DESKTOP
log "✅ SimpleX installed successfully!"
echo ""
echo "=== Installation Complete ==="
echo ""
echo "Launch from:"
echo " • Application menu: 'SimpleX'"
echo " • Terminal: simplex"
echo " • Or: ~/.local/bin/SimpleX.AppImage"
echo ""
echo "Your restored data:"
echo " ~/.local/share/simplex/ (messages, contacts)"
echo " ~/.config/simplex/ (settings)"
echo ""
echo "First launch:"
echo " SimpleX should automatically detect your restored data"
echo " Verify your contacts and messages appear"
echo ""
echo "📖 Documentation: https://simplex.chat/docs/"