$ show fscarmen/ArgoX
ArgoX is a comprehensive bash-based deployment and management tool for setting up Xray proxy servers with Cloudflare Argo tunnels on VPS. It supports 12 proxy protocols (VLESS, Hysteria2, Shadowsocks, etc.) and provides interactive and non-interactive installation, automated configuration generation, firewall management, subscription output for multiple clients (Clash, V2rayN, Sing-box, etc.), and hot-reload via Xray gRPC API. The script handles complex tasks like deriving X25519 keys, managing Cloudflare tunnels via API, selecting optimal CDN proxies, and implementing Hysteria2 Realm for NAT traversal. It is actively maintained with frequent updates and extensive error handling.
The LLM identified 5 files worth highlighting for reuse:
The `parse_preferred_addr()` function robustly parses host:port strings (IPv4, IPv6, domain) with validation, normalizing fullwidth characters and returning structured variables. It is self-contained and could be reused in any bash script requiring network address input.
The `derive_reality_public()` function derives an X25519 public key from a private key using three fallback methods: xray binary, openssl with DER encoding, and a remote API. This demonstrates non-obvious shell scripting skill and is reusable for any X25519 key manipulation in bash.
The `api_hot_reload()` function uses Xray's gRPC API to dynamically update inbounds, outbounds, and routing rules without restarting the service. It includes port conflict detection and fallback to system restart. This pattern is reusable for any Xray-based project requiring zero-downtime config updates.
The firewall management functions (`sync_firewall_rules`, `sync_port_hopping_firewall_rules`, `add_port_hopping_nat`, etc.) abstract away multiple backends (iptables, ufw, firewalld, Alpine iptables) and provide idempotent port opening, port hopping NAT, and rule persistence. This is a reusable pattern for any project needing dynamic firewall configuration.
The custom route management (`custom_route_add/view/delete/sync`) provides an interactive menu to add/remove Xray routing rules for warp outbound, with domain suffix or geosite matching. It uses jq to manipulate outbound.json and hot-reloads via API. This is a well-isolated feature that could be extracted for any Xray routing management tool.