surge-client.conf.j2 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. [General]
  2. loglevel = notify
  3. [Proxy]
  4. # Relay server - Shadowsocks (中转机)
  5. Relay-SS = ss, {{ hostvars[groups['relay'][0]]['ansible_host'] }}, {{ hostvars[groups['relay'][0]]['ss_port'] }}, encrypt-method={{ hostvars[groups['relay'][0]]['ss_cipher'] }}, password={{ hostvars[groups['relay'][0]]['ss_password'] }}
  6. # Landing server - Trojan direct (落地机直连)
  7. Landing-Trojan = trojan, {{ trojan_domain }}, {{ trojan_port }}, password={{ trojan_password }}
  8. # Landing server - chained through relay (落地机经中转)
  9. Landing-Chain = trojan, {{ trojan_domain }}, {{ trojan_port }}, password={{ trojan_password }}, underlying-proxy=Relay-SS
  10. [Proxy Group]
  11. # For services needing landing server's local IP (AI, streaming)
  12. Chain = select, Landing-Chain
  13. # For direct access to landing server
  14. Direct-Landing = select, Landing-Trojan
  15. [Rule]
  16. # Sukka's Rulesets (https://github.com/SukkaW/Surge)
  17. # DOMAIN-SET and non_ip rules MUST come before ip rules
  18. # --- AI Services → Chain (exit from landing IP) ---
  19. DOMAIN-SET,https://ruleset.skk.moe/List/domainset/ai.conf,Chain
  20. RULE-SET,https://ruleset.skk.moe/List/non_ip/ai.conf,Chain
  21. # --- Streaming Services → Chain (exit from landing IP) ---
  22. RULE-SET,https://ruleset.skk.moe/List/non_ip/stream_us.conf,Chain
  23. # --- China Direct (domain rules) ---
  24. DOMAIN-SET,https://ruleset.skk.moe/List/domainset/cn.conf,DIRECT
  25. RULE-SET,https://ruleset.skk.moe/List/non_ip/domestic.conf,DIRECT
  26. # --- IP-based rules (must come after domain rules) ---
  27. RULE-SET,https://ruleset.skk.moe/List/ip/stream_us.conf,Chain
  28. # --- China Direct (IP rules) ---
  29. RULE-SET,https://ruleset.skk.moe/List/ip/domestic.conf,DIRECT
  30. # --- Default: all other traffic through relay ---
  31. FINAL,Relay-SS