Skip to content

Commit 76e1d3f

Browse files
committed
✨Add TUN config and switch Python to Golang
1 parent 197a7fc commit 76e1d3f

96 files changed

Lines changed: 7363 additions & 13362 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 33 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,42 @@
11
name: Generate Config Files
22

33
on:
4-
# Trigger when Base directory changes
54
push:
65
branches:
76
- main
87
- master
98
paths:
109
- 'Base/**'
11-
- '.github/workflows/auto_generate.yml'
12-
- 'Generator/**'
13-
- 'Wireguard_Easytier/**'
14-
- 'requirements.txt'
15-
16-
# Allow manual trigger
10+
- 'program/**'
1711
workflow_dispatch:
1812

1913
permissions:
2014
contents: write
2115

2216
jobs:
2317
generate:
18+
if: github.actor != 'github-actions[bot]'
2419
runs-on: ubuntu-latest
25-
20+
2621
steps:
2722
- name: Checkout repository
2823
uses: actions/checkout@v4
2924
with:
3025
fetch-depth: 0
3126
token: ${{ secrets.GITHUB_TOKEN }}
32-
33-
- name: Set up Python
34-
uses: actions/setup-python@v5
27+
28+
- name: Set up Go
29+
uses: actions/setup-go@v5
3530
with:
36-
python-version: '3.12'
37-
cache: 'pip'
38-
39-
- name: Install dependencies
40-
run: |
41-
python -m pip install --upgrade pip
42-
pip install -r requirements.txt
43-
31+
go-version-file: program/go.mod
32+
cache-dependency-path: program/go.sum
33+
cache: true
34+
4435
- name: Generate configuration files
36+
working-directory: program
4537
run: |
46-
python Generator/config_generator.py --tool all
47-
48-
- name: Merge Wireguard_Easytier into Mihomo scripts
49-
run: |
50-
python Wireguard_Easytier/Mihomo/merge_easytier.py
51-
38+
go run ./cmd/proxyrules --tool all
39+
5240
- name: Check for changes
5341
id: check_changes
5442
run: |
@@ -60,45 +48,53 @@ jobs:
6048
echo "has_changes=false" >> $GITHUB_OUTPUT
6149
echo "No changes detected in Config/Wireguard_Easytier directory"
6250
fi
63-
51+
6452
- name: Commit and push changes
6553
if: steps.check_changes.outputs.has_changes == 'true' && github.event_name == 'push'
6654
run: |
6755
git config --local user.email "github-actions[bot]@users.noreply.github.com"
6856
git config --local user.name "github-actions[bot]"
69-
git add Config/ Wireguard_Easytier/Mihomo/mihomo_convert_*.js
70-
71-
# 获取最近一次 Base 文件夹的 commit 消息
57+
git add Config/ Wireguard_Easytier/
58+
7259
BASE_COMMIT_MSG=$(git log -1 --pretty=format:"%s" -- Base/)
73-
74-
# 使用 Base 文件夹的 commit 消息作为提交消息
7560
git commit -m "Generator: $BASE_COMMIT_MSG" || exit 0
7661
git push
77-
62+
7863
- name: Generate summary
7964
if: always()
8065
run: |
8166
echo "## Configuration Files Generated ✅" >> $GITHUB_STEP_SUMMARY
8267
echo "" >> $GITHUB_STEP_SUMMARY
8368
echo "### Generated Files" >> $GITHUB_STEP_SUMMARY
8469
echo "" >> $GITHUB_STEP_SUMMARY
85-
70+
8671
if [ -d "Config" ]; then
8772
echo "#### Mihomo" >> $GITHUB_STEP_SUMMARY
8873
ls -lh Config/Mihomo/ 2>/dev/null | tail -n +2 | awk '{print "- " $9 " (" $5 ")"}' >> $GITHUB_STEP_SUMMARY || echo "- No files" >> $GITHUB_STEP_SUMMARY
8974
echo "" >> $GITHUB_STEP_SUMMARY
90-
75+
9176
echo "#### Stash" >> $GITHUB_STEP_SUMMARY
9277
ls -lh Config/Stash/ 2>/dev/null | tail -n +2 | awk '{print "- " $9 " (" $5 ")"}' >> $GITHUB_STEP_SUMMARY || echo "- No files" >> $GITHUB_STEP_SUMMARY
9378
echo "" >> $GITHUB_STEP_SUMMARY
94-
79+
9580
echo "#### Loon" >> $GITHUB_STEP_SUMMARY
9681
ls -lh Config/Loon/ 2>/dev/null | tail -n +2 | awk '{print "- " $9 " (" $5 ")"}' >> $GITHUB_STEP_SUMMARY || echo "- No files" >> $GITHUB_STEP_SUMMARY
82+
echo "" >> $GITHUB_STEP_SUMMARY
83+
84+
echo "#### Surge" >> $GITHUB_STEP_SUMMARY
85+
ls -lh Config/Surge/ 2>/dev/null | tail -n +2 | awk '{print "- " $9 " (" $5 ")"}' >> $GITHUB_STEP_SUMMARY || echo "- No files" >> $GITHUB_STEP_SUMMARY
86+
echo "" >> $GITHUB_STEP_SUMMARY
87+
88+
echo "#### Wireguard_Easytier / Mihomo" >> $GITHUB_STEP_SUMMARY
89+
ls -lh Wireguard_Easytier/Mihomo/mihomo_convert_*.js 2>/dev/null | awk '{print "- " $9 " (" $5 ")"}' >> $GITHUB_STEP_SUMMARY || echo "- No files" >> $GITHUB_STEP_SUMMARY
90+
echo "" >> $GITHUB_STEP_SUMMARY
91+
92+
echo "#### Wireguard_Easytier / Surge" >> $GITHUB_STEP_SUMMARY
93+
ls -lh Wireguard_Easytier/Surge/Easytier.sgmodule 2>/dev/null | awk '{print "- " $9 " (" $5 ")"}' >> $GITHUB_STEP_SUMMARY || echo "- No files" >> $GITHUB_STEP_SUMMARY
9794
else
9895
echo "⚠️ Config directory does not exist" >> $GITHUB_STEP_SUMMARY
9996
fi
100-
97+
10198
echo "" >> $GITHUB_STEP_SUMMARY
10299
echo "---" >> $GITHUB_STEP_SUMMARY
103100
echo "Generated at: $(date -u '+%Y-%m-%d %H:%M:%S UTC')" >> $GITHUB_STEP_SUMMARY
104-

Base/Head/Head_Mihomo.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@ find-process-mode: strict
99
global-client-fingerprint: chrome
1010
log-level: info
1111
geodata-loader: standard
12-
external-controller: :9999
13-
external-ui: ui
14-
external-ui-url: "https://github.com/MetaCubeX/metacubexd/archive/refs/heads/gh-pages.zip"
12+
external-controller: :9090
13+
external-ui: ./dashboard
14+
external-ui-url: "https://github.com/Zephyruso/zashboard/archive/refs/heads/gh-pages.zip"
1515
disable-keep-alive: true
1616
profile:
1717
store-selected: true
1818

1919
# Normal Start From Here
2020
dns:
2121
enable: true
22-
ipv6: false
22+
ipv6: true
2323
enhanced-mode: fake-ip
2424
default-nameserver: {DNS_IP_List}
25-
nameserver: {DNS_IP_List}
25+
nameserver: {DNS_DoH_List}
2626
fake-ip-filter: {Fake_IP_Filter_List}
2727

2828
sniffer:
@@ -46,4 +46,4 @@ geox-url:
4646
geoip: https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip-lite.dat
4747
geosite: https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geosite.dat
4848
mmdb: https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip.metadb
49-
asn: https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/GeoLite2-ASN.mmdb
49+
asn: https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/GeoLite2-ASN.mmdb

Base/Head/Head_Mihomo_Tun.yaml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# 此为精简配置,如需更为详细的配置,可参考 https://wiki.metacubex.one/config
2+
# 如不会配置,也可自行寻找懒人配置,例如(Surfing 模块配置):https://raw.githubusercontent.com/GitMetaio/Surfing/refs/heads/main/box_bll/clash/config.yaml
3+
4+
proxy-providers:
5+
proxy1:
6+
type: http
7+
url: "填写订阅链接"
8+
path: ./proxy_provider/proxy1.yaml
9+
interval: 3600
10+
health-check:
11+
enable: true
12+
url: https://cp.cloudflare.com
13+
interval: 300
14+
timeout: 1000
15+
tolerance: 100
16+
# 多订阅按照下面照葫芦画瓢即可
17+
# proxy2:
18+
# type: http
19+
# url: "填写订阅链接"
20+
# path: ./proxy_provider/proxy2.yaml
21+
# interval: 3600
22+
# health-check:
23+
# enable: true
24+
# url: https://cp.cloudflare.com
25+
# interval: 300
26+
# timeout: 1000
27+
# tolerance: 100
28+
29+
mixed-port: 56365
30+
redir-port: 9797
31+
tproxy-port: 9898
32+
mode: Rule
33+
bind-address: '*'
34+
ipv6: true
35+
allow-lan: true
36+
unified-delay: true
37+
tcp-concurrent: true
38+
log-level: error
39+
find-process-mode: always
40+
# global-client-fingerprint: random
41+
external-controller: 0.0.0.0:9090
42+
external-ui: ./dashboard
43+
external-ui-url: "https://github.com/Zephyruso/zashboard/archive/refs/heads/gh-pages.zip"
44+
45+
geodata-mode: true
46+
geo-auto-update: true
47+
geo-update-interval: 24
48+
geox-url:
49+
geoip: https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip-lite.dat
50+
geosite: https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geosite.dat
51+
mmdb: https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip.metadb
52+
asn: https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/GeoLite2-ASN.mmdb
53+
54+
tun:
55+
enable: true
56+
device: umihomo
57+
stack: mixed
58+
dns-hijack: [any:53, tcp://any:53]
59+
udp-timeout: 300
60+
auto-route: true
61+
strict-route: true
62+
auto-redirect: false
63+
auto-detect-interface: true
64+
65+
profile:
66+
store-selected: true
67+
store-fake-ip: true
68+
69+
proxies:
70+
- {name: DNS_Hijack, type: dns}
71+
72+
# Normal Start From Here
73+
dns:
74+
enable: true
75+
ipv6: false
76+
enhanced-mode: fake-ip
77+
listen: 0.0.0.0:1053
78+
fake-ip-range: 198.18.0.1/16
79+
default-nameserver: {DNS_IP_List}
80+
nameserver: {DNS_IP_List}
81+
fake-ip-filter: {Fake_IP_Filter_List}
82+
83+
sniffer:
84+
sniff:
85+
HTTP:
86+
ports: [80, 8080-8880]
87+
override-destination: true
88+
TLS:
89+
ports: [443, 8443]
90+
QUIC:
91+
ports: [443, 8443]
92+
skip-domain:
93+
- "Mijia Cloud"
94+
- "dlg.io.mi.com"
95+
- "+.push.apple.com"

Base/Head/Head_Stash.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ log-level: info
44

55
dns:
66
ipv6: true
7+
enhanced-mode: fake-ip
78
default-nameserver: {DNS_IP_List}
89
nameserver: {DNS_DoH_List}
9-
fake-ip-filter: {Fake_IP_Filter_List}
10+
fake-ip-filter: {Fake_IP_Filter_List}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!name=Easytier 组网接入
2+
#!desc=连接到 Easytier WireGuard 节点
3+
4+
[Proxy]
5+
Easytier = wireguard, section-name=Easytier
6+
7+
[WireGuard Easytier]
8+
private-key = <填入你的客户端 PrivateKey>
9+
self-ip = <填入你的客户端 Address,例如 10.14.14.2>
10+
mtu = 1280
11+
peer = (public-key = <填入服务端 PublicKey>, allowed-ips = "0.0.0.0/0, ::/0", endpoint = <填入 Endpoint,例如 1.2.3.4:11013>, keepalive = 25)
12+
13+
[Rule]
14+
# 将 Easytier 相关的虚拟网段流量路由到 WireGuard 代理
15+
# 请根据你实际配置的 IP 段进行修改
16+
IP-CIDR,10.19.19.0/24,Easytier,no-resolve
17+
IP-CIDR,10.11.45.0/24,Easytier,no-resolve

Config/Loon/Loon_config.lcf

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
# UpdateTime: 2025.11.05 18:00:00 +0000
2-
# Author: PianCat
1+
# Generated at (UTC): 2026-03-23T16:36:17Z
2+
3+
#Update Date: 2025.11.05 18:00:00 +0800
4+
#author: PianCat
35

46
[General]
57
ip-mode = dual
@@ -24,31 +26,33 @@ interface-mode = auto
2426

2527
# resource-parser = https://www.nsloon.com/openloon/import?parser=https://github.com/sub-store-org/Sub-Store/releases/latest/download/sub-store-parser.loon.min.js
2628

29+
[Plugin]
30+
https://raw.githubusercontent.com/Peng-YM/Loon-Gallery/master/loon-gallery.plugin, enable = true
31+
2732
[Proxy]
33+
# Your Proxy Nodes Here
2834

2935
[Remote Proxy]
30-
31-
[Plugin]
32-
https://raw.githubusercontent.com/Peng-YM/Loon-Gallery/master/loon-gallery.plugin, enable = true
36+
# Your Node or Proxy Subscription Links Here
3337

3438
[Remote Filter]
3539
# 全部节点筛选
3640
ALL_Filter = NameRegex, FilterKey = ".*"
3741

3842
# 香港节点筛选
39-
HK_Filter = NameRegex, FilterKey = "(?i)(香港|港|HK|Hong Kong|HongKong|hongkong|🇭🇰)"
43+
HK_Filter = NameRegex, FilterKey = "(?i)香港|港|HK|hk|Hong Kong|HongKong|hongkong|🇭🇰"
4044

4145
# 台湾节点筛选
42-
TW_Filter = NameRegex, FilterKey = "(?i)(台|新北|彰化|TW|Taiwan|🇹🇼)"
46+
TW_Filter = NameRegex, FilterKey = "(?i)台|新北|彰化|TW|Taiwan|🇹🇼"
4347

4448
# 新加坡节点筛选
45-
SG_Filter = NameRegex, FilterKey = "(?i)(新加坡|坡|狮城|SG|Singapore|🇸🇬)"
49+
SG_Filter = NameRegex, FilterKey = "(?i)新加坡|坡|狮城|SG|Singapore|🇸🇬"
4650

4751
# 日本节点筛选
48-
JP_Filter = NameRegex, FilterKey = "(?i)(日本|川日|东京|大阪|泉日|埼玉|沪日|深日|JP|Japan|🇯🇵)"
52+
JP_Filter = NameRegex, FilterKey = "(?i)日本|川日|东京|大阪|泉日|埼玉|沪日|深日|JP|Japan|🇯🇵"
4953

5054
# 美国节点筛选
51-
US_Filter = NameRegex, FilterKey = "(?i)(美国|美|US|United States|🇺🇸)"
55+
US_Filter = NameRegex, FilterKey = "(?i)美国|美|US|United States|🇺🇸"
5256

5357
# 其他节点筛选(排除以上所有地区)
5458
# 使用负向预查来排除特定关键词:不含香港、台湾、新加坡、日本、美国
@@ -114,4 +118,4 @@ https://ruleset.skk.moe/List/ip/lan.conf, policy = DIRECT, tag = LocalNetworkIP,
114118

115119
[Rule]
116120
GEOIP, CN, 直接连接
117-
FINAL, 选择代理
121+
FINAL, 选择代理

0 commit comments

Comments
 (0)