Commit Graph

30 Commits

Author SHA1 Message Date
SamNet-dev
de8442c712 fix: randomize VIO seq/ack and correct SOCKS5 display for panel users
Randomize TCP seq/ack numbers in VIO packets on both client and server
to reduce packet fingerprinting. Fix misleading SOCKS5 port display
when panel is detected but SOCKS5 auto-add didn't complete — previously
showed the panel port (e.g. 443) labeled as SOCKS5.

Ref #27, Fixes #35
2026-02-07 10:26:24 -06:00
SamNet-dev
18147a7fdd chore: bump pinned paqet version to v1.0.0-alpha.15
alpha.15 fixes zero-copy concurrent read buffer invalidation and
simplifies client connection logic.
2026-02-06 23:50:15 -06:00
SamNet-dev
2aa4de7dd6 fix: add client-side firewall rules for GFK VIO port
GFK Linux clients had zero iptables rules, leaving the VIO client port
(default 40000) unprotected. The kernel's conntrack could drop incoming
VIO packets as INVALID, and the TCP stack would send RST responses to
the crafted VIO packets.

Added NOTRACK + INPUT DROP + RST DROP rules for GFK_VIO_CLIENT_PORT in:
- _apply_firewall() / _remove_firewall() in embedded script
- Outer install flow (replaces "no firewall rules needed")
- start-both.sh service startup script
2026-02-06 23:39:07 -06:00
SamNet-dev
4609a00b9a feat: persist SOCKS5 settings and show proxy ports in status/install
- Add GFK_SOCKS_PORT, GFK_SOCKS_VIO_PORT, XRAY_PANEL_DETECTED to
  save_settings() and _load_settings() across all script locations
- Status menu labels mappings as (panel)/(SOCKS5) when panel detected
- Status shows server-side and client-side proxy ports clearly
- Install summary CLIENT CONNECTION INFO box now shows which port
  is SOCKS5 proxy vs panel, so users know exactly what to configure
2026-02-06 21:56:02 -06:00
SamNet-dev
fc8102c585 feat: auto-add SOCKS5 proxy alongside existing xray panel
When a server has an existing xray panel (3x-ui, Marzban), paqctl now
adds a SOCKS5 inbound on a free port (10443+) instead of skipping xray
setup entirely. This gives users two connections automatically:
- Panel mapping (e.g. 14000:443) for server-to-server panel traffic
- SOCKS5 mapping (e.g. 14001:10443) for direct proxy from Windows/Mac

Updates README with Setup A (server-to-server) and Setup B (direct
client) guides in both English and Farsi.
2026-02-06 21:24:21 -06:00
SamNet-dev
60b613afc9 feat: xray panel compatibility for GFK with setup guide
When an existing xray panel is detected, skip SOCKS5 setup entirely
since GFK is a raw TCP forwarder that works with any service on the
target port. Warn users to configure Iran panel outbound accordingly.

- Detect existing xray panel and skip SOCKS5 installation
- Check all target ports in multi-port mappings and report status
- Show clear ACTION REQUIRED warnings for Iran panel configuration
- Panel-aware install summary (not misleading SOCKS5 message)
- Clean up legacy standalone gfk-socks on reconfigure/uninstall
- Use ss -tln (not -tlnH) for broader iproute2 compatibility
- Add step-by-step panel setup guide in English and Farsi to README
2026-02-06 20:52:03 -06:00
SamNet-dev
d1dd506b9c fix: skip xray setup if already running to preserve existing panels 2026-02-06 17:12:48 -06:00
SamNet-dev
4eb099030d fix: auto-install openssl for GFK certificate generation 2026-02-06 12:51:23 -06:00
SamNet-dev
95cd496f42 feat: add NOTRACK iptables rules for GFK VIO port
Add iptables raw table NOTRACK rules for the VIO port, matching
what Paqet already has. Without NOTRACK, conntrack tracks the
crafted TCP packets which can cause them to be dropped by
hypervisor bridge netfilter (e.g. Proxmox).

Added to: boot script, _apply_firewall, _remove_firewall, and
install section.

Ref #27
2026-02-06 08:25:57 -06:00
SamNet-dev
0fddb190c9 feat: add wget fallback for paqet download
When curl fails (common in restricted networks), automatically
fallback to wget with retries. Also:
- Increased timeout from 120s to 180s
- Added 3 retries with 5s delay for curl
- Added 3 tries for wget
- Show helpful manual download instructions on failure
2026-02-05 10:32:58 -06:00
SamNet-dev
fcc18542f3 fix: handle OpenVZ network detection (Issue #25)
OpenVZ containers use a different route format:
- Standard: "default via 192.168.1.1 dev eth0"
- OpenVZ:   "default dev venet0 scope link"

The old code used awk '{print $5}' which returned "link" instead
of "venet0" on OpenVZ, causing the script to fail silently when
trying to get IP info from a non-existent "link" interface.

Changes:
- Parse route format to detect "via" vs "dev" patterns
- Use appropriate awk field based on route type
- Validate detected interface exists before using it
- Handle OpenVZ having no gateway (no "via" in route)
- Wrap IP detection pipeline in subshell with || true
2026-02-05 09:52:24 -06:00
SamNet-dev
5e6bc97ff6 feat: add TCP flags configuration for paqet backend
Adds support for custom TCP flags (local_flag, remote_flag) in paqet backend:
- Added to config.yaml generation with YAML array format ["PA"]
- Added to Change configuration menu with clear instructions
- Valid flags: S(SYN) A(ACK) P(PSH) R(RST) F(FIN) U(URG) E(ECE) C(CWR)
- Supports multiple values: PA,A (tries PA first, then A)
- Input validation prevents invalid flags

Fixes #21
2026-02-05 08:53:15 -06:00
SamNet-dev
6481762d23 fix: support Fedora/RHEL/Arch/openSUSE for GFK installation
On Fedora/RHEL, python3-venv package doesn't exist because the venv
module is already included with python3. The script was failing with:
  "No match for argument: python3-venv"

Fix: Handle venv installation per package manager:
- apt (Debian/Ubuntu): install python3.X-venv
- dnf (Fedora/RHEL 8+): just install python3-pip (venv included)
- yum (RHEL/CentOS 7): just install python3-pip
- pacman (Arch): install python-pip (venv included)
- zypper (openSUSE): install python3-pip (venv included)
- apk (Alpine): install py3-pip

Fixes #24
2026-02-05 08:38:42 -06:00
SamNet-dev
21a591b748 fix: prevent silent exit during network detection (pipefail + grep)
The script uses 'set -eo pipefail' which causes grep to exit the script
silently when no matches are found (grep returns exit code 1).

Root cause: When a system only has loopback interface (lo), the command
  grep -vE '^(lo|docker...)' returns exit 1 (no matches)

With pipefail, this causes the entire pipeline to fail, and with set -e,
the script exits silently without any error message.

Fix: Wrap grep commands in { grep ... || true; } to prevent pipeline
failures when grep finds no matches.

Affected functions:
- detect_network() in outer installer script
- detect_network() in embedded management script
- Network detection in settings menu

Fixes #25
2026-02-05 08:33:47 -06:00
SamNet-dev
2c69164faa docs: fix paqet description and add Android client
- Correct description: KCP over raw TCP packets with custom flags (not UDP)
- Add paqetNG Android client link to README and TUI About section
- Thanks to paqet creator for the correction
2026-02-05 08:12:01 -06:00
SamNet-dev
a4f5b033b3 chore: update to paqet v1.0.0-alpha.14
- Bump PAQET_VERSION_PINNED to v1.0.0-alpha.14 in paqctl.sh (both outer and embedded scripts)
- Update Windows client version in paqet-client.ps1
- Update all version references in README.md (English and Farsi)
- Add ARM 32-bit (armv7) architecture support to detect_arch functions
- Update README platform tables to include ARM 32-bit downloads
2026-02-05 01:09:54 -06:00
SamNet-dev
6ab630f679 fix: add update_management_script call to update_gfk function 2026-02-04 20:58:25 -06:00
SamNet-dev
ead1a9da4f fix: add missing detect_network function to embedded management script
The embedded heredoc script (installed to /usr/local/bin/paqctl) was calling
detect_network but the function was only defined in the outer installer script.
This caused "command not found" errors when adding paqet alongside gfw-knocker.
2026-02-04 20:55:00 -06:00
SamNet-dev
e1cf7a9d3b feat: add configurable TCP flags for GFK backend (#21)
Add GFK_TCP_FLAGS setting to allow customizing TCP flags used in
violated TCP packets. This addresses cases where different flag
combinations (e.g. 'S', 'RA') may work better for certain networks.

Changes:
- Add tcp_flags parameter to vio_server.py and vio_client.py
- Add GFK_TCP_FLAGS to settings save/load with validation
- Add TCP flags menu option in change config for both server/client
- Default remains 'AP' for backwards compatibility

Validation: Only uppercase TCP flags allowed (F,S,R,P,A,U,E,C)
2026-02-04 19:17:44 -06:00
SamNet-dev
4b14413623 fix: add error handling for GFK install steps 2026-02-04 18:34:13 -06:00
SamNet-dev
6bcb5341da fix: remove confusing switch-backend message (#20)
Removed the misleading "Both backends remain installed" line from the
switch_backend confirmation dialog. The remaining messages "Stop X"
and "Start Y" already clearly explain what happens.
2026-02-04 18:25:19 -06:00
SamNet-dev
a92f4b4b03 feat: telegram bot improvements (#16)
- Send startup notification when telegram service starts
- Use generic "Service" messages (works for both/single backend)
2026-02-04 18:15:14 -06:00
SamNet-dev
0d8796929b fix: auto-install python3-venv and improve venv error handling (#17)
- Install python3.X-venv before creating virtual environment
- Add Python 3.10+ version check
- Add safety check to verify pip exists after venv creation
- Add dnf package manager support
- Improve error messages with actionable hints
- Refactor _install_gfk_components to use install_python_deps()
2026-02-04 18:01:42 -06:00
SamNet-dev
ec34a28c50 fix: startup script sources wrong config file for custom ports
The start-both.sh script was sourcing paqctl.conf which doesn't exist.
Changed to settings.conf where LISTEN_PORT and GFK_VIO_PORT are saved.

This caused iptables rules to always use default ports (8443/45000)
even when user configured different ports, resulting in port mismatch.
2026-02-04 17:37:53 -06:00
SamNet-dev
627e39d40b fix: auto-install iptables if missing (#14)
Debian Trixie and other newer distros use nftables by default
and don't have iptables installed. Add iptables to dependency
check so it gets installed automatically during setup.

Reported-by: @Shaheding
2026-02-04 15:55:19 -06:00
SamNet-dev
8f634a5de0 feat: add Windows update function and switch to upstream paqet repo
Windows client (paqet-client.ps1):
- Added Update-Paqet function with version tracking
- Added Get-InstalledPaqetVersion and Save-PaqetVersion helpers
- Creates backup before updating, restores on failure
- Added menu option 7 for update, moved About to option 8

All platforms:
- Switched paqet binary downloads from SamNet-dev/paqctl to hanselime/paqet
- Updated paqctl.sh PAQET_REPO to hanselime/paqet
- Updated README.md download URLs to hanselime/paqet
- Users now get paqet updates directly from upstream source
- Allows paqctl script releases without affecting paqet binary updates
2026-02-04 14:44:35 -06:00
SamNet-dev
b325644920 fix: GFK firewall rule consistency and health check accuracy
- Fix health check to detect both tagged and untagged iptables rules
- Add missing RST DROP rule to install wizard (prevents kernel interference)
- Add missing IPv6 rules to boot script and install wizard
- Add iptables existence check in install wizard with warning
- Improve status display to show partial firewall state
- Use local variables with defaults for robustness

The health check was failing because it looked for untagged rules while
_apply_firewall() adds rules with -m comment --comment "paqctl" tag.
Now checks for both variants for backwards compatibility.
2026-02-04 11:13:35 -06:00
SamNet-dev
6e4544c8f4 chore: update paqet to v1.0.0-alpha.13 2026-02-04 10:13:39 -06:00
SamNet-dev
bc7d6e45e9 Fix download URLs and repository links
- Update README.md download URLs to match actual release filenames
- Add tar extraction commands for .tar.gz files
- Fix repository links from /paqet to /paqctl
2026-02-04 04:37:57 -06:00
SamNet-dev
975acc4cf5 paqctl v1.0.0 - Unified proxy manager for bypassing firewalls
Features:
- Dual backend support: paqet (KCP) and GFW-knocker (violated TCP + QUIC)
- Both backends can run simultaneously when both are installed
- Automatic config.yaml generation for paqet backend
- Windows client support with PowerShell script
- Telegram monitoring integration
- Systemd service management

Backends:
- paqet: Single Go binary with built-in SOCKS5 (port 1080)
- GFW-knocker: Python-based with violated TCP tunneling (port 14000)
2026-02-04 04:25:33 -06:00