From 0dec5b792888f613fb5227b2094f59bae13d7a64 Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Sat, 14 Mar 2026 18:11:32 -0400 Subject: [PATCH] fix(install): robust onionshare-cli and pipx fallbacks for Debian --- install.sh | 26 +++++++++++++++++++++++++- voxvera-install.sh | 25 ++++++++++++++++++++++--- 2 files changed, 47 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index b6f569a..c98b7ed 100755 --- a/install.sh +++ b/install.sh @@ -60,7 +60,31 @@ require_pkg tor tor if [ "$PM" = "brew" ]; then require_pkg onionshare onionshare else - require_pkg onionshare-cli onionshare-cli + # Onionshare-cli is often missing or outdated in apt/dnf repos. + # We try system install first, then fallback to pipx. + if ! command_exists onionshare-cli; then + echo "Installing onionshare-cli..." + if ! install_pkg onionshare-cli; then + echo "Onionshare-cli not found in system repositories. Attempting pipx install fallback." + if ! command_exists pipx; then + echo "Installing pipx and python3-venv..." + if [ "$PM" = "apt" ]; then + install_pkg pipx python3-venv + else + install_pkg pipx + fi + pipx ensurepath --force + export PATH="$HOME/.local/bin:$PATH" + fi + if command_exists pipx; then + echo "Installing onionshare-cli via pipx..." + pipx install git+https://github.com/onionshare/onionshare.git#subdirectory=cli + else + echo "Could not install pipx. Please install onionshare-cli manually." >&2 + exit 1 + fi + fi + fi fi download_binary() { diff --git a/voxvera-install.sh b/voxvera-install.sh index 636f3a7..19c1f68 100644 --- a/voxvera-install.sh +++ b/voxvera-install.sh @@ -29,11 +29,30 @@ msg ">> Detected package manager: $PM" # Only runtime dependencies for Tor hosting are needed as system packages. # Build tools (QR, minification, PDF parsing) are all Python packages now. SYSTEM_PKGS=(tor curl) -# OnionShare package name differs per repo: -[[ $PM =~ (apt|dnf|yum) ]] && SYSTEM_PKGS+=(onionshare-cli) || SYSTEM_PKGS+=(onionshare) - $UPDATE && $INSTALL "${SYSTEM_PKGS[@]}" +# Handle OnionShare separately to allow fallback to pipx +if ! command_exists onionshare-cli && ! command_exists onionshare; then + msg "Attempting to install OnionShare..." + OS_PKG="onionshare-cli" + [[ ! $PM =~ (apt|dnf|yum) ]] && OS_PKG="onionshare" + + if ! $INSTALL "$OS_PKG"; then + warn "OnionShare not found in system repositories. Attempting pipx install fallback." + if ! command_exists pipx; then + msg "Installing pipx..." + [ "$PM" = "apt" ] && $INSTALL pipx python3-venv || $INSTALL pipx + pipx ensurepath --force + export PATH="$HOME/.local/bin:$PATH" + fi + if command_exists pipx; then + pipx install git+https://github.com/onionshare/onionshare.git#subdirectory=cli || warn "pipx OnionShare install failed" + else + warn "pipx not found. Skipping OnionShare installation." + fi + fi +fi + ## -------- install VoxVera (prefers pipx, falls back) --------------- install_voxvera() { if command_exists pipx; then