fix(install): robust onionshare-cli and pipx fallbacks for Debian

This commit is contained in:
thePR0M3TH3AN committed 2026-03-14 18:11:32 -04:00
1 parent da987d028f
commit 0dec5b7928
2 files changed
+47 -4

No files matched your search

+25 -1
View File
@@ -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() {
+22 -3
View File
@@ -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