|
|
3 weeks ago | |
|---|---|---|
| docs | 3 weeks ago | |
| group_vars | 3 weeks ago | |
| inventory | 3 weeks ago | |
| openspec | 3 weeks ago | |
| roles | 3 weeks ago | |
| README.md | 3 weeks ago | |
| ansible.cfg | 3 weeks ago | |
| site.yml | 3 weeks ago |
Ansible playbook for provisioning a two-server chained proxy setup:
Client-side Surge uses underlying-proxy to chain connections:
Client → Relay (SS) → Landing (Trojan) → Internet # chained
Client → Landing (Trojan) → Internet # direct
Client → Relay (SS) → Internet # relay only
community.general Ansible collection: ansible-galaxy collection install community.generalEdit inventory/hosts.yml with your server IPs:
all:
children:
relay:
hosts:
relay-server:
ansible_host: "1.2.3.4"
landing:
hosts:
landing-server:
ansible_host: "5.6.7.8"
cp group_vars/vault.yml.example group_vars/vault.yml
# Edit vault.yml with your passwords
ansible-vault encrypt group_vars/vault.yml
Edit group_vars/relay.yml:
ss_port: Shadowsocks listen port (default: 8388)ss_cipher: Encryption method (default: aes-256-gcm)Edit group_vars/landing.yml:
trojan_domain: Your domain namecertbot_email: Email for Let's Encrypt notificationsansible-playbook site.yml --ask-vault-pass
See docs/surge-client.conf for a reference Surge client configuration with:
├── ansible.cfg
├── inventory/
│ └── hosts.yml
├── group_vars/
│ ├── all.yml
│ ├── relay.yml
│ ├── landing.yml
│ └── vault.yml.example
├── roles/
│ ├── base/ # SSH hardening, UFW, fail2ban
│ ├── shadowsocks/ # shadowsocks-rust (relay)
│ └── trojan/ # trojan-go + certbot (landing)
├── docs/
│ └── surge-client.conf
└── site.yml
| Variable | Default | Description |
|---|---|---|
ss_port |
8388 | Shadowsocks listen port |
ss_cipher |
aes-256-gcm | Shadowsocks encryption method |
ss_version |
1.21.2 | shadowsocks-rust release version |
trojan_port |
443 | Trojan listen port |
trojan_domain |
— | Domain name for TLS certificate |
trojan_fallback_port |
8080 | Fallback port for non-Trojan traffic |
trojan_version |
0.10.6 | trojan-go release version |
certbot_email |
— | Email for Let's Encrypt |
ssh_port |
22 | SSH listen port |