Find your next open-source project

Search by name, purpose, or keyword — or paste a GitHub repository URL

Deploy a self-hosted sing-box proxy stack on a VPS with one command, plus subscriptions and traffic routing.

124
60
Go
2 days old

What it does

dun is a single-file Go program that installs and manages a self-hosted proxy stack on a Linux VPS. A single command installs Reality (with the server's own domain as the disguise target), AnyTLS, and a VLESS + WebSocket node behind Cloudflare; Hysteria2 can be added as a fourth option. The nodes are run by official sing-box, while dun's own daemon handles the decoy site, subscriptions, Cloudflare DNS records, and certificate renewal.

The tool is aimed at people who own a VPS and a Cloudflare-managed domain and want subscriptions, client-side routing rules, DNS-leak protection, and server-side outbound routing without assembling the configuration by hand.

Install and first run

Prepare a VPS with root access (Debian/Ubuntu/CentOS/Alma/Rocky with systemd, or Alpine with OpenRC; amd64 and arm64), a domain already on Cloudflare, and either a Global API Key or a domain-scoped API Token. Run the install script:

bash <(curl -fsSL https://github.com/byJoey/dun/releases/latest/download/install.sh)

On Alpine, where bash and curl are absent by default:

wget -qO- https://github.com/byJoey/dun/releases/latest/download/install.sh | sh

In the menu, choose 4 to install all three TCP protocols. Enter your Cloudflare credential type and domain when prompted; defaults work for the rest. When it finishes, it prints subscription URLs to import into your client. Thereafter, run dun to open the menu, or use subcommands such as dun install reality, dun links, and dun log. Managing outbound routing uses dun out add, dun route add, and dun route final.

Subscriptions and routing

Two subscription endpoints are generated: /sub for v2rayN, Shadowrocket, and NekoBox, and /clash for mihomo clients such as Clash Verge and FlClash. The Clash subscription includes routing groups for ad blocking, AI services, Telegram, YouTube, streaming, Google, Microsoft, Apple, and domestic traffic, plus a catch-all group; the rule sets are pulled from MetaCubeX geosite/geoip data via jsDelivr and refreshed daily. The /sub subscription does not carry these rules, so use the client's own bypass-mainland routing instead.

Server-side routing is a second layer: WARP or an imported proxy link (VLESS, VMess, Trojan, Shadowsocks, Hysteria2, TUIC, AnyTLS, WireGuard, SOCKS5/HTTP, sing-box JSON, or subscription content) can be selected for matching traffic, with rules written in Xray/3x-ui style. Changes are validated by sing-box before taking effect.

Constraints

  • Requires root and a systemd or OpenRC host; the Cloudflare API token needs DNS edit and zone read permissions, plus Origin Rules and Config Rules edit for CF WS.
  • Hysteria2 uses UDP and may need iptables forwarding for port hopping; clients must support gecko obfuscation (mihomo 1.19.34+ or sing-box 1.14+).
  • Cloud provider security groups must be opened separately; dun only manages the host firewall.
  • Dun modifies only its own DNS records and rules on your domain, and removes them on uninstall; BBR settings are left in place.
  • No license is declared in the repository, so reuse and redistribution terms are unclear.

HotRepo's take

Dun entered HotRepo's new-project list on 2026-11-27 as a Go project, gaining 11 stars and 2 forks in a window of about 1.5 hours; it recorded no overall GitHub daily rank. Its scope is narrow and operational: a one-command installer for a specific proxy stack with its own subscription and routing layer, backed by a substantial README covering edge cases such as NAT VPS port mapping and old client incompatibilities. Those details are the main signal of practical intent, though no license and a young history mean adoption and maintenance are not yet evidenced.

Written by AI from the project's public information and HotRepo's records, updated . The project's own docs are the source of truth.

You might also like

  1. SagerNet/sing-boxA universal proxy platform for building and running network proxy services, aimed at users who need self-hosted routing and tunneling.Go39,790
  2. shitouxiaoge-commits/CFAPEXDeploy a Cloudflare-hosted proxy panel with VLESS/Trojan nodes and subscription output.JavaScript119
  3. alireza0/s-uiA self-hosted web panel for managing Sing-Box proxy inbounds, routing, subscriptions and traffic limits.Go10,246
  4. daeuniverse/honkA Rust eBPF transparent proxy engine for Linux forwarding TCP and UDP traffic through configurable routing and outbound groups.Rust1,700
  5. idy/tailsplitRoute selected traffic through a Tailscale exit node while keeping other traffic direct, using sing-box rules.Go108