Skip to content

Commit 4e5e4b4

Browse files
riskrisk
authored andcommitted
Simplify temporary Nekobox config and fix validation paths
1 parent e5e205d commit 4e5e4b4

3 files changed

Lines changed: 27 additions & 478 deletions

File tree

.github/workflows/validate.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ jobs:
2424
2525
- name: Basic file checks
2626
run: |
27-
test -f stash/Stash-v4-public-airport.yaml
2827
test -f stash/Stash-v4-public-airport-android.yaml
28+
test -f temp/NekoBox-Temporary-Import.yaml
2929
test -f custom-rules/My-Crypto.list
3030
test -f custom-rules/My-Finance-Direct.list
3131
test -f custom-rules-clash/My-Crypto.yaml
@@ -37,8 +37,8 @@ jobs:
3737
python3 - <<'PY'
3838
import yaml
3939
for path in [
40-
'stash/Stash-v4-public-airport.yaml',
4140
'stash/Stash-v4-public-airport-android.yaml',
41+
'temp/NekoBox-Temporary-Import.yaml',
4242
'custom-rules-clash/My-Crypto.yaml',
4343
'custom-rules-clash/My-Finance-Direct.yaml',
4444
]:
@@ -52,7 +52,6 @@ jobs:
5252
python3 - <<'PY'
5353
from collections import Counter
5454
from pathlib import Path
55-
5655
for rel in ['custom-rules/My-Crypto.list', 'custom-rules/My-Finance-Direct.list']:
5756
p = Path(rel)
5857
lines = []

scripts/validate-local.sh

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,24 @@
11
#!/bin/bash
2-
# 本地验证脚本
3-
# Usage: bash scripts/validate-local.sh
4-
52
set -e
63

74
echo "=== 配置验证开始 ==="
85

9-
# 1. 检查当前 YAML 配置语法
106
echo "📋 检查当前 YAML 配置..."
11-
if command -v python3 &> /dev/null; then
12-
python3 - <<'PY'
7+
python3 - <<'PY'
138
import yaml
149
for path in [
15-
'stash/Stash-v4-public-airport.yaml',
1610
'stash/Stash-v4-public-airport-android.yaml',
11+
'temp/NekoBox-Temporary-Import.yaml',
1712
'custom-rules-clash/My-Crypto.yaml',
1813
'custom-rules-clash/My-Finance-Direct.yaml',
1914
]:
2015
with open(path, encoding='utf-8') as f:
2116
yaml.safe_load(f)
2217
print('✅ YAML 语法正确:', path)
2318
PY
24-
else
25-
echo "⚠️ 未安装 python3,跳过 YAML 检查"
26-
fi
2719

28-
# 2. 检查重复策略组
2920
echo "📋 检查重复策略组..."
30-
for f in stash/Stash-v4-public-airport.yaml stash/Stash-v4-public-airport-android.yaml; do
21+
for f in stash/Stash-v4-public-airport-android.yaml temp/NekoBox-Temporary-Import.yaml; do
3122
DUPS=$(grep "^ - name:" "$f" 2>/dev/null | sort | uniq -d)
3223
if [ -n "$DUPS" ]; then
3324
echo "❌ 存在重复策略组: $f"
@@ -37,28 +28,19 @@ for f in stash/Stash-v4-public-airport.yaml stash/Stash-v4-public-airport-androi
3728
done
3829
echo "✅ 无重复策略组"
3930

40-
# 3. 检查当前自维护规则文件存在
4131
echo "📋 检查自维护规则文件..."
4232
for f in custom-rules/My-Crypto.list custom-rules/My-Finance-Direct.list custom-rules-clash/My-Crypto.yaml custom-rules-clash/My-Finance-Direct.yaml; do
43-
if [ -f "$f" ]; then
44-
echo "$f"
45-
else
46-
echo " ❌ 缺失: $f"
47-
exit 1
48-
fi
33+
test -f "$f"
34+
echo "$f"
4935
done
5036

51-
# 4. 测试关键 URL 可访问性
5237
echo "📋 测试关键 URL 可访问性..."
5338
FAILED=0
5439
TEST_URLS=(
55-
"https://cdn.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Clash/OpenAI/OpenAI.yaml"
56-
"https://cdn.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Clash/Google/Google.yaml"
57-
"https://cdn.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Clash/Netflix/Netflix.yaml"
40+
"https://raw.githubusercontent.com/dodo258/surge/main/temp/NekoBox-Temporary-Import.yaml"
5841
"https://raw.githubusercontent.com/dodo258/surge/main/custom-rules-clash/My-Crypto.yaml"
5942
"https://raw.githubusercontent.com/dodo258/surge/main/custom-rules-clash/My-Finance-Direct.yaml"
6043
)
61-
6244
for url in "${TEST_URLS[@]}"; do
6345
HTTP_CODE=$(curl -L -s -o /dev/null -w "%{http_code}" "$url" 2>/dev/null)
6446
if [ "$HTTP_CODE" = "404" ]; then
@@ -70,7 +52,6 @@ for url in "${TEST_URLS[@]}"; do
7052
echo " ⚠️ $HTTP_CODE: $url"
7153
fi
7254
done
73-
7455
if [ $FAILED -eq 1 ]; then
7556
exit 1
7657
fi

0 commit comments

Comments
 (0)