Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

653 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Cascade

Cascade

Self-hosted WireGuard / AmneziaWG router management platform

Build License Go 1.23 AmneziaWG 2.0

πŸ‡·πŸ‡Ί Русский Β Β·Β  πŸ“– User Manual


image

✨ Features

Module Description
πŸ”Œ Interfaces Multiple WireGuard / AmneziaWG tunnel interfaces, quick-create in one click, import .conf as uplink, per-interface MSS clamping
πŸ‘₯ Peers Client and site-to-site (S2S) interconnect peers with QR codes, lifetime traffic stats, per-client bandwidth limiting and group membership
🌐 Routing Static routes, policy-based routing (PBR), kernel route inspection, OSPF is on plans
πŸ”€ NAT Outbound MASQUERADE / SNAT with alias support + Port Forwarding (DNAT) with per-interface scoping
πŸ›‘οΈ Firewall Filter rules (ACCEPT / DROP / REJECT) + PBR via gateway
πŸ“‹ Aliases 7 types: host, network, ipset, client-group, group, port, port-group. Client groups are ipset-backed and auto-updated on peer changes
πŸ“‘ Gateways Live ping + HTTP monitoring, gateway groups, automatic failover
πŸŽ›οΈ AWG2 Templates AmneziaWG 2.0 obfuscation parameter templates with built-in generator
πŸ” Auth Multi-user accounts, TOTP 2FA (Google Authenticator), long-lived API tokens
πŸ”’ TLS Let's Encrypt via acme.sh (bare IP shortlived cert or domain)
🎭 Decoy site Caddy reverse proxy serves a fake streaming site on /; admin UI hidden behind a secret path
πŸ–₯️ Multi-Server πŸ†• Manage multiple Cascade routers from one UI β€” switch servers in the sidebar, proxy all API calls transparently, self-signed cert support
πŸ“Š Monitoring πŸ†• Real-time traffic metrics per interface, gateway status history (stacked bar chart), Diagnostics page with per-period history
⚑ Speed Test πŸ†• iperf3-based speed test between any two managed servers β€” Auto / Tunnel / Internet mode, S2S tunnel autodetect, result history
🚦 Rate Limits πŸ†• Per-client-group bandwidth limiting via tc HTB (kbps down/up enforced per IP)
πŸ§™ Wizards πŸ†• Step-by-step setup wizards: Simple Client VPN, Cascade via WireGuard Uplink, Cascade ↔ Cascade S2S interconnect

🎯 Why Cascade?

  • βœ… Go binary β€” single static binary, no Node.js, no npm, no dependencies
  • βœ… Multi-interface β€” manage multiple WireGuard/AWG interfaces from one UI
  • βœ… Full AmneziaWG 2.0 β€” S3, S4, I5 parameters, H-range obfuscation, 7 CPS profiles + browser fingerprint
  • βœ… Policy-based routing β€” route traffic per-source through different gateways
  • βœ… Port Forwarding (DNAT) β€” transparent traffic cascading with optional source NAT
  • βœ… Import .conf as uplink β€” connect Cascade as a client to any WireGuard server; use as PBR gateway without touching the routing table
  • βœ… Gateway monitoring β€” ICMP ping + HTTP/S probes, auto-fallback on failure
  • βœ… Multi-user + TOTP 2FA β€” per-user accounts with Google Authenticator support
  • βœ… HTTPS by default β€” Caddy + acme.sh, works with bare IPs via Let's Encrypt shortlived certs
  • βœ… Decoy protection β€” admin path is hidden; visitors see a fake streaming site
  • βœ… πŸ†• Multi-server management β€” control multiple Cascade routers from one browser tab, with transparent API proxying
  • βœ… πŸ†• Built-in speed test β€” iperf3 between any managed servers, S2S tunnel autodetect, result history
  • βœ… πŸ†• Traffic monitoring β€” per-interface metrics and gateway health history with configurable time periods
  • βœ… πŸ†• Setup wizards β€” guided wizards for Uplink VPN and S2S interconnect; auto-create interfaces, aliases, gateways, PBR rules and NAT in one flow

πŸ“‹ Requirements

  • Ubuntu 22.04 or 24.04 (other distros: manual setup)
  • Root access
  • Public IP address or domain name
  • Ports: 443/tcp (HTTPS), 51820+/udp (WireGuard)

πŸš€ Quick Install

Userspace mode β€” recommended

Works on any VPS without a custom kernel. No reboot needed, no deadlocks.

git clone https://github.com/JohnnyVBut/cascade.git
cd cascade
sudo bash deploy/setup.sh --yes

--yes picks all defaults: userspace mode, auto-detected public IP, random admin path.

Kernel module mode

Maximum throughput, but the AmneziaWG kernel module has known deadlock issues that can freeze tunnel operations. Only recommended if you need peak performance and can tolerate occasional interface restarts.

git clone https://github.com/JohnnyVBut/cascade.git
cd cascade
# Interactive setup β€” choose [2] Kernel module at Step 2
sudo bash deploy/setup.sh

Switch mode on a running system

sudo bash deploy/switch-mode.sh --userspace   # β†’ amneziawg-go (stable)
sudo bash deploy/switch-mode.sh --kernel      # β†’ kernel module (fast)

The script handles kernel module install/unload, blacklisting, and container restart automatically.


πŸš€ Deployment Options

Option A β€” Router only (advanced users)

Run just the Cascade container. The web UI listens on localhost only β€” no public exposure, no TLS. You are responsible for network security, authentication and access control.

git clone https://github.com/JohnnyVBut/cascade.git
cd cascade
docker compose -f docker-compose.yml pull
docker compose -f docker-compose.yml up -d
# UI available at http://127.0.0.1:8888/

Use this if you already have a reverse proxy, firewall, or VPN-only access in place. Step-by-step guide: docs/DEPLOY.md

Option B β€” Full stack (recommended)

One command sets up everything: AmneziaWG, TLS certificate, Caddy reverse proxy with a decoy streaming site, and a hidden admin path. The router is never exposed directly to the internet.

git clone https://github.com/JohnnyVBut/cascade.git
cd cascade
sudo bash deploy/setup.sh
Step What happens
0 1 GB swap (prevents OOM during build)
1 Kernel upgrade to HWE 6.x (Ubuntu 22.04 only) β€” reboot, then re-run
2 AmneziaWG run mode β€” choose Userspace (recommended) or Kernel module
2b Docker network mode β€” choose Host (default) or Bridge (port range for Docker publish)
3 Docker CE install
4 sysctl: ip_forward, UDP buffers
4b TCP tuning: BBR congestion control, FQ scheduler, rp_filter
5a Generate decoy video via ffmpeg (60 s noise β€” looks like a real stream)
5 Build Cascade Docker image
6 Collect config interactively (IP, secret path, email)
7 Start Cascade (localhost only)
8 Issue TLS certificate via acme.sh (Let's Encrypt)
9 Start Caddy (HTTPS + decoy site + hidden admin path)
10 Verify: health-check Cascade + Caddy, print summary

At the end you get:

Admin URL: https://YOUR_IP/<secret-path>/

Open it β€” first-run shows a Create First User form (no auth required until the first account exists). After creating your account, enable TOTP 2FA in Settings β†’ Users for an extra layer of protection.

Re-run safe: setup.sh is idempotent β€” safe to run again after a reboot or update. On re-run, Step 2 asks Change run mode? [y/N] β€” press y to switch between modes.

Testing TLS without rate limits: use --staging to issue an untrusted certificate from the Let's Encrypt staging CA. Switch to production later by removing ACME_STAGING=1 from deploy/.env and re-running setup.sh.

sudo bash deploy/setup.sh --staging        # staging CA (browser shows warning β€” expected)
sudo bash deploy/setup.sh --yes --staging  # non-interactive + staging

βš™οΈ AWG Run Modes

Userspace (amneziawg-go) Kernel module
Performance ~70% of kernel Maximum
Stability βœ… Stable ⚠️ Known deadlocks
Kernel module required ❌ No βœ… Yes
Works on any VPS βœ… Yes Depends on kernel
Reboot after install ❌ No Sometimes

The current mode is shown as a badge in the sidebar of the web UI (blue = userspace, green = kernel). The Docker network mode is shown as a separate badge (gray = HOST, amber = BRIDGE, red = NONE).


βš™οΈ Configuration

Configuration is collected interactively by setup.sh and saved to deploy/.env.

Variable Default Description
WG_HOST auto-detected Public IP or domain of the server
ADMIN_PATH random hex Secret path for admin UI (e.g. /a1b2c3d4.../)
PORT 8888 Internal port for Cascade (Caddy proxies to this)
BIND_ADDR 127.0.0.1 Bind address for Cascade (use 127.0.0.1 behind Caddy)
ACME_EMAIL optional Email for Let's Encrypt notifications
ACME_STAGING 0 1 = use LE staging CA (untrusted cert, no rate limits β€” for testing)
AWG_USERSPACE_IMPL amneziawg-go amneziawg-go or kernel
NETWORK_MODE host host or bridge β€” Docker network mode
BRIDGE_PORT_RANGE (bridge only) Published UDP port range for WireGuard in bridge mode (e.g. 51831-65535)

Additional settings (WireGuard defaults, DNS, etc.) are configurable in the Web UI under Settings.

πŸ”’ Security Model

  • Admin UI is served only via https://HOST/<ADMIN_PATH>/ β€” plain https://HOST/ shows a decoy site
  • HTTPS with HTTP/3 (QUIC) via Caddy
  • TLS certificates: shortlived (6-day) for bare IPs, standard 90-day for domains
  • Session cookie: HttpOnly, Secure, SameSite=Strict
  • bcrypt password hashing (cost 12)
  • Multi-user accounts β€” each user has a separate username and password
  • TOTP 2FA β€” Google Authenticator / Authy (enable per-user in Settings β†’ Users)
  • API tokens β€” long-lived bearer tokens for scripts; bypass TOTP; revocable
  • Input validation on all API endpoints

Full threat model: docs/SECURITY.md

πŸ”„ Updating

Host network mode (default)

git pull origin master
docker compose -f docker-compose.yml pull
docker compose -f docker-compose.yml up -d

Full stack (Caddy + setup.sh)

git pull origin master
sudo bash deploy/setup.sh --yes

πŸ“± Compatible VPN Clients

⚠️ Standard WireGuard clients do NOT work with AmneziaWG 2.0 interfaces. WireGuard 1.0 interfaces work with standard clients normally.

Platform App
Android Amnezia VPN Β· AmneziaWG
iOS / macOS Amnezia VPN Β· AmneziaWG
Windows Amnezia VPN Β· AmneziaWG
Linux amneziawg-tools Β· Amnezia VPN

πŸ› οΈ Troubleshooting

Check container status:

docker logs cascade
docker compose -f deploy/caddy/docker-compose.yml logs

Check WireGuard interfaces:

docker exec cascade awg show
docker exec cascade wg show

Check AWG run mode:

docker exec cascade env | grep WG_QUICK
# WG_QUICK_USERSPACE_IMPLEMENTATION=amneziawg-go  β†’ userspace
# (empty or not present)                          β†’ kernel module

Check firewall / NAT:

docker exec cascade iptables-nft -t nat -L -n -v
docker exec cascade ip rule show

Switch AWG mode:

sudo bash deploy/switch-mode.sh --userspace
sudo bash deploy/switch-mode.sh --kernel

Re-run setup (e.g. after reboot or cert renewal):

sudo bash deploy/setup.sh

πŸ”Œ REST API

Cascade exposes a full REST API β€” everything the web UI does, your scripts can do too.

# Authenticate
curl -c cookies.txt -X POST http://127.0.0.1:8888/api/login \
  -H "Content-Type: application/json" \
  -d '{"username":"admin","password":"yourpassword"}'

# List interfaces
curl -b cookies.txt http://127.0.0.1:8888/api/tunnel-interfaces

# Create a peer
curl -b cookies.txt -X POST http://127.0.0.1:8888/api/tunnel-interfaces/wg10/peers \
  -H "Content-Type: application/json" \
  -d '{"name":"laptop"}'

Use it to automate peer provisioning, integrate with your own dashboards, or build custom clients.

Full reference: docs/API.en.md Β· docs/API.md (RU)

πŸ“– Documentation

πŸ—οΈ Stack

Layer Technology
Backend Go 1.23, Fiber v2
Frontend Vue 2, Tailwind CSS (embedded in binary)
Database SQLite (modernc.org/sqlite, CGO-free)
Reverse proxy Caddy 2 (HTTP/3 + QUIC)
VPN AmneziaWG 2.0 / WireGuard 1.0

β˜• Support the Project

If Cascade is useful to you, consider supporting its development:

Method Address
TRC20 TDm1VvwoLaRdjpp7149QNacBzQtXnGresW
Yoomoney RU https://yoomoney.ru/to/4100119568549598

πŸ™ Credits

πŸ“„ License

MIT β€” see LICENSE


Made with ❀️ for secure and private internet access

About

No description, website, or topics provided.

Resources

Security policy

Stars

65 stars

Watchers

4 watching

Forks

Releases

Packages

Contributors

Languages