$ show 233boy/v2ray
This is a comprehensive V2Ray installation and management script written in Bash. It provides a one-click installer (install.sh) and a management CLI (v2ray.sh) for deploying and operating V2Ray proxy servers on Linux (Ubuntu/Debian/CentOS). The script automates V2Ray core installation, configuration generation for multiple protocols (VMess, VLESS, Trojan, Shadowsocks, Socks, Dokodemo-Door), TLS certificate management via Caddy, dynamic port allocation, BBR enablement, and DNS configuration. It uses a modular architecture with separate source files for each functional area (core.sh for protocol logic, caddy.sh for TLS, dns.sh, bbr.sh, systemd.sh for service management, download.sh for fetching binaries, log.sh, old.sh for migration). The script manages multiple simultaneous configurations via JSON files in /etc/v2ray/conf/ and uses V2Ray's API for hot-reloading. It supports both interactive menu-driven operation and direct command-line arguments for automation.
The LLM identified 4 files worth highlighting for reuse:
Core configuration engine that abstracts 15+ V2Ray protocols (VMess, VLESS, Trojan, Shadowsocks, etc.) and their transport layers (TCP, mKCP, QUIC, WebSocket, HTTP/2, gRPC, Reality) into a unified JSON generation pipeline. Uses jq for programmatic JSON construction, supports dynamic port allocation, and generates both server and client configurations. Demonstrates non-trivial protocol abstraction and JSON templating in pure Bash.
Automated Caddy configuration generator for TLS termination. Creates Caddyfile snippets for WebSocket, HTTP/2, and gRPC reverse proxies with automatic certificate management. Handles virtual host routing, path-based matching, and upstream proxying. Reusable pattern for any project needing automated TLS with Caddy for gRPC/WebSocket/h2c backends.
Robust binary downloader that fetches V2Ray core, script updates, geoip/geosite dat files, and Caddy from GitHub releases. Implements version resolution via GitHub API, supports custom versions, handles architecture detection (amd64/arm64), and verifies downloads. Reusable pattern for any Bash project needing to fetch versioned binaries from GitHub releases.
Generates hardened systemd service units for V2Ray and Caddy with security best practices: PrivateTmp, ProtectSystem=full, LimitNOFILE/NPROC, NoNewPrivileges, Restart=on-failure. Handles version-specific argument differences (V2Ray v4 vs v5+ 'run' subcommand). Reusable template for deploying Go-based network services with proper sandboxing.