Initial commit: zapret-discord-youtube-linux v1.9.8c-linux

This commit is contained in:
2026-05-10 19:06:04 +04:00
commit 80e0a116e1
40 changed files with 2599 additions and 0 deletions
+118
View File
@@ -0,0 +1,118 @@
#!/bin/bash
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
BIN_DIR="$SCRIPT_DIR/bin"
BUILD_DIR="/tmp/zapret-build-$$"
echo "=============================================="
echo " Zapret Builder for Linux"
echo " Target: nfqws binary"
echo "=============================================="
echo ""
if [ -f /etc/os-release ]; then
. /etc/os-release
DISTRO="$ID"
else
DISTRO="unknown"
fi
echo "[*] Detected distro: $DISTRO"
echo "[*] Installing build dependencies..."
install_deps() {
case "$DISTRO" in
ubuntu|debian|linuxmint|pop|zorin|kubuntu|xubuntu|lubuntu)
sudo apt-get update
sudo apt-get install -y git make gcc curl iptables nftables libnetfilter-queue-dev libcap-dev build-essential
;;
arch|manjaro|endeavouros|garuda|artix|arcolinux|blackarch)
if command -v pacman >/dev/null 2>&1; then
sudo pacman -Syu --noconfirm git make gcc curl iptables nftables libnetfilter_queue libcap
elif command -v yay >/dev/null 2>&1; then
yay -Syu --noconfirm git make gcc curl iptables nftables libnetfilter_queue libcap
elif command -v paru >/dev/null 2>&1; then
paru -Syu --noconfirm git make gcc curl iptables nftables libnetfilter_queue libcap
fi
;;
fedora|rhel|centos|almalinux|rocky)
sudo dnf install -y git make gcc curl iptables nftables libnetfilter_queue-devel libcap-devel
;;
alpine)
sudo apk add --no-cache git make gcc curl iptables nftables libnetfilter_queue-dev libcap-dev linux-headers
;;
*)
echo "[!] Unknown/unsupported distro: $DISTRO"
echo " Required packages: git, make, gcc, libnetfilter_queue (dev), curl"
read -rp "Continue anyway? [y/N]: " ans
if [[ "$ans" != [yY]* ]]; then
exit 1
fi
;;
esac
}
install_deps
echo ""
echo "[*] Cloning bol-van/zapret..."
mkdir -p "$BUILD_DIR"
cd "$BUILD_DIR"
if ! git clone --depth=1 https://github.com/bol-van/zapret.git; then
echo "[!] Failed to clone repository. Check your internet connection."
exit 1
fi
cd zapret
echo "[*] Building nfqws..."
if ! make -C nfq; then
echo "[!] Build failed!"
echo " Check that you have all dependencies installed."
exit 1
fi
if [ ! -f "$BUILD_DIR/zapret/nfq/nfqws" ]; then
echo "[!] Build failed: nfqws not found after compilation"
exit 1
fi
mkdir -p "$BIN_DIR"
cp "$BUILD_DIR/zapret/nfq/nfqws" "$BIN_DIR/"
chmod +x "$BIN_DIR/nfqws"
echo ""
echo "[*] Installing fake packet binaries..."
FAKE_BIN_URL="https://github.com/bol-van/zapret/raw/master/files/fake"
for f in quic_initial_www_google_com.bin quic_initial_dbankcloud_ru.bin tls_clienthello_www_google_com.bin tls_clienthello_4pda_to.bin tls_clienthello_max_ru.bin stun.bin; do
if curl -sfL "$FAKE_BIN_URL/$f" -o "$BIN_DIR/$f" 2>/dev/null; then
echo " [OK] $f"
else
echo " [SKIP] $f (will try to find local alternatives)"
fi
done
echo ""
echo "[*] Setting capabilities (optional, allows running without root)..."
if command -v setcap >/dev/null 2>&1; then
sudo setcap cap_net_admin,cap_net_raw+eip "$BIN_DIR/nfqws" 2>/dev/null || true
echo " [OK] cap_net_admin,cap_net_raw set on nfqws"
fi
echo ""
echo "[*] Cleanup..."
cd "$SCRIPT_DIR"
rm -rf "$BUILD_DIR"
echo ""
echo "=============================================="
echo " Build complete!"
echo " Binary: $BIN_DIR/nfqws"
echo "=============================================="
echo ""
echo "Next steps:"
echo " 1. Run './service.sh' to manage strategies"
echo " 2. Or run any './general*.sh' script directly"
echo ""