Skip to content

Commit 3041822

Browse files
committed
Merge branch 'dev'
2 parents 1496179 + c10be33 commit 3041822

30 files changed

+2252
-804
lines changed

.github/workflows/compile_new_ipk.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,15 @@ jobs:
6767
- name: Install OpenWrt SNAPSHPT SDK
6868
run: |
6969
cd ..
70-
curl -SLk --connect-timeout 30 --retry 2 "https://downloads.openwrt.org/snapshots/targets/x86/64/openwrt-sdk-x86-64_gcc-13.3.0_musl.Linux-x86_64.tar.zst" -o "./tmp/SNAPSDK.tar.zst"
71-
cd \tmp
70+
mkdir -p tmp
71+
BASE_URL="https://downloads.openwrt.org/snapshots/targets/x86/64/"
72+
SDK_NAME=$(curl -s $BASE_URL | grep -oE 'openwrt-sdk-x86-64[^"]+\.tar\.zst' | head -n 1)
73+
curl -SLk --connect-timeout 30 --retry 2 "$BASE_URL/$SDK_NAME" -o "./tmp/SNAPSDK.tar.zst"
74+
cd tmp
7275
zstd -d SNAPSDK.tar.zst
7376
tar xf SNAPSDK.tar
74-
mv "openwrt-sdk-x86-64_gcc-13.3.0_musl.Linux-x86_64" "SNAPSDK"
77+
SDK_DIR=$(tar tf SNAPSDK.tar | head -n 1 | cut -d/ -f1)
78+
mv "$SDK_DIR" "SNAPSDK"
7579
7680
- name: Copy OpenClash Source Codes
7781
run: |
Lines changed: 268 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,268 @@
1+
name: Update Third-Party Resources
2+
3+
on:
4+
schedule:
5+
- cron: '30 0 */3 * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
update-resources:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout Repository
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
ref: dev
17+
18+
- name: Set up environment
19+
run: |
20+
sudo apt-get update
21+
sudo apt-get -y install curl wget unzip git jq coreutils
22+
23+
- name: Set file paths
24+
run: |
25+
echo "CHNR_PATH=luci-app-openclash/root/etc/openclash/china_ip_route.ipset" >> $GITHUB_ENV
26+
echo "CHNR6_PATH=luci-app-openclash/root/etc/openclash/china_ip6_route.ipset" >> $GITHUB_ENV
27+
echo "YACD_PATH=luci-app-openclash/root/usr/share/openclash/ui/yacd" >> $GITHUB_ENV
28+
echo "ZASHBOARD_PATH=luci-app-openclash/root/usr/share/openclash/ui/zashboard" >> $GITHUB_ENV
29+
echo "METACUBEXD_PATH=luci-app-openclash/root/usr/share/openclash/ui/metacubexd" >> $GITHUB_ENV
30+
echo "GEOIP_PATH=luci-app-openclash/root/etc/openclash/GeoIP.dat" >> $GITHUB_ENV
31+
echo "GEOSITE_PATH=luci-app-openclash/root/etc/openclash/GeoSite.dat" >> $GITHUB_ENV
32+
echo "COUNTRY_MMDB_PATH=luci-app-openclash/root/etc/openclash/Country.mmdb" >> $GITHUB_ENV
33+
34+
- name: Update China IP Route Files
35+
run: |
36+
mkdir -p tmp
37+
echo "Downloading China IP Route files..."
38+
39+
curl -sSL https://ispip.clang.cn/all_cn.txt -o tmp/china_ip_route.ipset
40+
41+
mkdir -p $(dirname $CHNR_PATH)
42+
43+
if [ -f "$CHNR_PATH" ]; then
44+
if ! cmp -s tmp/china_ip_route.ipset "$CHNR_PATH"; then
45+
echo "China IP Route list has been updated, replacing old version."
46+
cp tmp/china_ip_route.ipset "$CHNR_PATH"
47+
echo "CHNR_UPDATED=1" >> $GITHUB_ENV
48+
else
49+
echo "China IP Route list is up to date."
50+
fi
51+
else
52+
echo "China IP Route list file doesn't exist, creating it."
53+
cp tmp/china_ip_route.ipset "$CHNR_PATH"
54+
echo "CHNR_UPDATED=1" >> $GITHUB_ENV
55+
fi
56+
57+
curl -sSL https://ispip.clang.cn/all_cn_ipv6.txt -o tmp/china_ip6_route.ipset
58+
59+
mkdir -p $(dirname $CHNR6_PATH)
60+
61+
if [ -f "$CHNR6_PATH" ]; then
62+
if ! cmp -s tmp/china_ip6_route.ipset "$CHNR6_PATH"; then
63+
echo "China IP6 Route list has been updated, replacing old version."
64+
cp tmp/china_ip6_route.ipset "$CHNR6_PATH"
65+
echo "CHNR6_UPDATED=1" >> $GITHUB_ENV
66+
else
67+
echo "China IP6 Route list is up to date."
68+
fi
69+
else
70+
echo "China IP6 Route list file doesn't exist, creating it."
71+
cp tmp/china_ip6_route.ipset "$CHNR6_PATH"
72+
echo "CHNR6_UPDATED=1" >> $GITHUB_ENV
73+
fi
74+
75+
- name: Update MetaCubeXD UI
76+
run: |
77+
echo "Downloading latest MetaCubeXD UI from gh-pages branch..."
78+
mkdir -p tmp/metacubexd
79+
git clone --depth=1 -b gh-pages https://github.com/MetaCubeX/metacubexd.git tmp/metacubexd_clone
80+
81+
mkdir -p "$METACUBEXD_PATH"
82+
83+
if [ -d "$METACUBEXD_PATH" ]; then
84+
if ! diff -r tmp/metacubexd_clone "$METACUBEXD_PATH" > /dev/null 2>&1; then
85+
echo "MetaCubeXD UI has been updated, replacing old version."
86+
rm -rf "$METACUBEXD_PATH"/*
87+
cp -rf tmp/metacubexd_clone/* "$METACUBEXD_PATH"
88+
echo "METACUBEXD_UPDATED=1" >> $GITHUB_ENV
89+
else
90+
echo "MetaCubeXD UI is up to date."
91+
fi
92+
else
93+
echo "MetaCubeXD UI directory doesn't exist, creating it."
94+
mkdir -p "$METACUBEXD_PATH"
95+
cp -rf tmp/metacubexd_clone/* "$METACUBEXD_PATH"
96+
echo "METACUBEXD_UPDATED=1" >> $GITHUB_ENV
97+
fi
98+
99+
echo "MetaCubeXD UI update check completed."
100+
101+
- name: Update Yacd UI
102+
run: |
103+
echo "Downloading latest Yacd UI from MetaCubeX/metacubexd gh-pages branch..."
104+
mkdir -p tmp/yacd
105+
git clone --depth=1 -b gh-pages https://github.com/MetaCubeX/metacubexd.git tmp/yacd_clone
106+
107+
mkdir -p "$YACD_PATH"
108+
109+
if [ -d "$YACD_PATH" ]; then
110+
if ! diff -r tmp/yacd_clone "$YACD_PATH" > /dev/null 2>&1; then
111+
echo "Yacd UI has been updated, replacing old version."
112+
rm -rf "$YACD_PATH"/*
113+
cp -rf tmp/yacd_clone/* "$YACD_PATH"
114+
echo "YACD_UPDATED=1" >> $GITHUB_ENV
115+
else
116+
echo "Yacd UI is up to date."
117+
fi
118+
else
119+
echo "Yacd UI directory doesn't exist, creating it."
120+
mkdir -p "$YACD_PATH"
121+
cp -rf tmp/yacd_clone/* "$YACD_PATH"
122+
echo "YACD_UPDATED=1" >> $GITHUB_ENV
123+
fi
124+
125+
echo "Yacd UI update check completed."
126+
127+
- name: Update ZashBoard UI
128+
run: |
129+
echo "Downloading latest Clash Dashboard UI from gh-pages branch..."
130+
mkdir -p tmp/zashboard
131+
git clone --depth=1 -b gh-pages https://github.com/zzzgydi/clash-dashboard.git tmp/zashboard_clone
132+
133+
mkdir -p "$ZASHBOARD_PATH"
134+
135+
if [ -d "$ZASHBOARD_PATH" ]; then
136+
if ! diff -r tmp/zashboard_clone "$ZASHBOARD_PATH" > /dev/null 2>&1; then
137+
echo "ZashBoard UI has been updated, replacing old version."
138+
rm -rf "$ZASHBOARD_PATH"/*
139+
cp -rf tmp/zashboard_clone/* "$ZASHBOARD_PATH"
140+
echo "ZASHBOARD_UPDATED=1" >> $GITHUB_ENV
141+
else
142+
echo "ZashBoard UI is up to date."
143+
fi
144+
else
145+
echo "ZashBoard UI directory doesn't exist, creating it."
146+
mkdir -p "$ZASHBOARD_PATH"
147+
cp -rf tmp/zashboard_clone/* "$ZASHBOARD_PATH"
148+
echo "ZASHBOARD_UPDATED=1" >> $GITHUB_ENV
149+
fi
150+
151+
echo "ZashBoard UI update check completed."
152+
153+
- name: Update GeoIP and GeoSite files
154+
run: |
155+
RULES_RELEASE=$(curl -s https://api.github.com/repos/Loyalsoldier/v2ray-rules-dat/releases/latest | jq -r '.tag_name')
156+
echo "Latest v2ray-rules-dat version: $RULES_RELEASE"
157+
158+
curl -sSL "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/download/${RULES_RELEASE}/geoip.dat" -o tmp/GeoIP.dat
159+
160+
mkdir -p $(dirname "$GEOIP_PATH")
161+
if [ -f "$GEOIP_PATH" ]; then
162+
if ! cmp -s tmp/GeoIP.dat "$GEOIP_PATH"; then
163+
echo "GeoIP.dat has been updated, replacing old version."
164+
cp tmp/GeoIP.dat "$GEOIP_PATH"
165+
echo "GEOIP_UPDATED=1" >> $GITHUB_ENV
166+
else
167+
echo "GeoIP.dat is up to date."
168+
fi
169+
else
170+
echo "GeoIP.dat file doesn't exist, creating it."
171+
cp tmp/GeoIP.dat "$GEOIP_PATH"
172+
echo "GEOIP_UPDATED=1" >> $GITHUB_ENV
173+
fi
174+
175+
curl -sSL "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/download/${RULES_RELEASE}/geosite.dat" -o tmp/GeoSite.dat
176+
177+
mkdir -p $(dirname "$GEOSITE_PATH")
178+
if [ -f "$GEOSITE_PATH" ]; then
179+
if ! cmp -s tmp/GeoSite.dat "$GEOSITE_PATH"; then
180+
echo "GeoSite.dat has been updated, replacing old version."
181+
cp tmp/GeoSite.dat "$GEOSITE_PATH"
182+
echo "GEOSITE_UPDATED=1" >> $GITHUB_ENV
183+
else
184+
echo "GeoSite.dat is up to date."
185+
fi
186+
else
187+
echo "GeoSite.dat file doesn't exist, creating it."
188+
cp tmp/GeoSite.dat "$GEOSITE_PATH"
189+
echo "GEOSITE_UPDATED=1" >> $GITHUB_ENV
190+
fi
191+
192+
- name: Update Country.mmdb
193+
run: |
194+
curl -sSL "https://github.com/alecthw/mmdb_china_ip_list/releases/latest/download/Country-lite.mmdb" -o tmp/Country.mmdb
195+
196+
mkdir -p $(dirname "$COUNTRY_MMDB_PATH")
197+
if [ -f "$COUNTRY_MMDB_PATH" ]; then
198+
if ! cmp -s tmp/Country.mmdb "$COUNTRY_MMDB_PATH"; then
199+
echo "Country.mmdb has been updated, replacing old version."
200+
cp tmp/Country.mmdb "$COUNTRY_MMDB_PATH"
201+
echo "MMDB_UPDATED=1" >> $GITHUB_ENV
202+
else
203+
echo "Country.mmdb is up to date."
204+
fi
205+
else
206+
echo "Country.mmdb file doesn't exist, creating it."
207+
cp tmp/Country.mmdb "$COUNTRY_MMDB_PATH"
208+
echo "MMDB_UPDATED=1" >> $GITHUB_ENV
209+
fi
210+
211+
- name: Commit changes
212+
run: |
213+
git config user.name 'github-actions[bot]'
214+
git config user.email 'github-actions[bot]@users.noreply.github.com'
215+
216+
UPDATED=0
217+
UPDATE_MSG="Chore: update resources:"
218+
219+
if [ "${CHNR_UPDATED}" = "1" ]; then
220+
UPDATE_MSG="${UPDATE_MSG} china_ip_route.ipset"
221+
UPDATED=1
222+
fi
223+
224+
if [ "${CHNR6_UPDATED}" = "1" ]; then
225+
UPDATE_MSG="${UPDATE_MSG} china_ip6_route.ipset"
226+
UPDATED=1
227+
fi
228+
229+
if [ "${GEOIP_UPDATED}" = "1" ]; then
230+
UPDATE_MSG="${UPDATE_MSG} GeoIP.dat"
231+
UPDATED=1
232+
fi
233+
234+
if [ "${GEOSITE_UPDATED}" = "1" ]; then
235+
UPDATE_MSG="${UPDATE_MSG} GeoSite.dat"
236+
UPDATED=1
237+
fi
238+
239+
if [ "${MMDB_UPDATED}" = "1" ]; then
240+
UPDATE_MSG="${UPDATE_MSG} Country.mmdb"
241+
UPDATED=1
242+
fi
243+
244+
if [ "${METACUBEXD_UPDATED}" = "1" ]; then
245+
UPDATE_MSG="${UPDATE_MSG} MetaCubeXD"
246+
UPDATED=1
247+
fi
248+
249+
if [ "${YACD_UPDATED}" = "1" ]; then
250+
UPDATE_MSG="${UPDATE_MSG} Yacd"
251+
UPDATED=1
252+
fi
253+
254+
if [ "${ZASHBOARD_UPDATED}" = "1" ]; then
255+
UPDATE_MSG="${UPDATE_MSG} Zashboard"
256+
UPDATED=1
257+
fi
258+
259+
if [ $UPDATED -eq 1 ]; then
260+
git add .
261+
git commit -m "${UPDATE_MSG}"
262+
git push
263+
echo "Changes committed and pushed to repository."
264+
else
265+
echo "No changes to commit."
266+
fi
267+
268+
rm -rf tmp

announcement

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[
2+
{
3+
"zh": "Smart 策略组内核现已支持 policy-priority 参数来自定义调整节点权重,请自行替换测试、使用。",
4+
"en": "The Smart policy group core now supports the policy-priority parameter to customize node weights. Please replace it for testing and use."
5+
},
6+
{
7+
"zh": "如在更新内核后出现【Parse config error: path is not subpath of home directory】的错误时请在最新版插件设置页面启用【跳过安全路径检查】选项。",
8+
"en": "If you get [Parse config error: path is not subpath of home directory] after updating the core, please enable [Skip Safe Path Check] option in the settings page of the latest dev version of the OpenClash."
9+
}
10+
]

luci-app-openclash/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
include $(TOPDIR)/rules.mk
22

33
PKG_NAME:=luci-app-openclash
4-
PKG_VERSION:=0.46.079
4+
PKG_VERSION:=0.46.086
55
PKG_MAINTAINER:=vernesong <https://github.com/vernesong/OpenClash>
66

77
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
@@ -147,6 +147,8 @@ define Package/$(PKG_NAME)/postrm
147147
rm -rf /tmp/dler* >/dev/null 2>&1
148148
rm -rf /tmp/etc/openclash >/dev/null 2>&1
149149
rm -rf /tmp/openclash_edit_file_name >/dev/null 2>&1
150+
rm -rf /tmp/openclash_announcement >/dev/null 2>&1
151+
rm -rf /usr/share/openclash/ui/xd >/dev/null 2>&1
150152
sed -i '/OpenClash Append/,/OpenClash Append End/d' "/usr/lib/lua/luci/model/network.lua" >/dev/null 2>&1
151153
sed -i '/.*kB maximum content size*/c\HTTP_MAX_CONTENT = 1024*100 -- 100 kB maximum content size' /usr/lib/lua/luci/http.lua >/dev/null 2>&1
152154
sed -i '/.*kB maximum content size*/c\export let HTTP_MAX_CONTENT = 1024*100; // 100 kB maximum content size' /usr/share/ucode/luci/http.uc >/dev/null 2>&1

0 commit comments

Comments
 (0)