From 94595292338d62640383ff4a6a9d45e249a9e18f Mon Sep 17 00:00:00 2001 From: ElonJunior Date: Thu, 23 May 2024 21:37:24 +0800 Subject: [PATCH 1/6] add geoip geosite --- .github/workflows/run.yml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run.yml b/.github/workflows/run.yml index 19d02be4..af9a3bef 100644 --- a/.github/workflows/run.yml +++ b/.github/workflows/run.yml @@ -2,7 +2,7 @@ name: Convert other rules to sing-box rule set on: workflow_dispatch: schedule: - - cron: "30 22 * * *" # 6:30 AM UTC+8 + - cron: "30 06 * * *" # 6:30 AM UTC+8 push: branches: - workflow @@ -58,6 +58,29 @@ jobs: git remote add origin "https://${{ github.actor }}:${{ secrets.GH_TOKEN }}@github.com/${{ github.repository }}" git push -f -u origin sing + - name: Checkout meta-rules-dat + uses: actions/checkout@v4 + with: + repository: MetaCubeX/meta-rules-dat + path: meta-rules-dat + ref: sing + + - name: Checkout Iran-sing-box-rules + uses: actions/checkout@v4 + with: + repository: Chocolate4U/Iran-sing-box-rules + path: Iran-sing-box-rules + ref: rule-set + + - name: copy geo rules + env: + NO_SKIP: true + run: | + cd sing-rule || exit 1 + cp -r ../meta-rules-dat/geo ./ + cp -r ../Iran-sing-box-rules/geoip-ir.srs ./geo/geoip/ir.srs + cp -r ../Iran-sing-box-rules/geosite*ir.srs ./geo/geosite/ + cd ./geo/geosite/ && find ./ -type f -name "geosite-*ir.srs" -exec bash -c 'mv "$1" "${1/geosite-/}"' _ {} \; - name: Purge jsdelivr CDN run: | From 2d85c44662861da1e86205bd834cc44d00878036 Mon Sep 17 00:00:00 2001 From: ElonJunior Date: Thu, 23 May 2024 21:41:16 +0800 Subject: [PATCH 2/6] push to branch sing --- .github/workflows/run.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/run.yml b/.github/workflows/run.yml index af9a3bef..60bad1c7 100644 --- a/.github/workflows/run.yml +++ b/.github/workflows/run.yml @@ -44,20 +44,6 @@ jobs: chmod 755 sing-box ACL4SSR/convert_srs.sh && ./ACL4SSR/convert_srs.sh ../sing-box rm -rf sing-box* LICENSE README.md ACL4SSR/convert_* - - name: Git push assets to "sing-rule" branch - run: | - cd sing-rule || exit 1 - cp ../workflow/README.md . - ls - git init - git config --local user.name "github-actions[bot]" - git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" - git checkout -b sing - git add . - git commit -m "Released on ${{ env.BUILDTIME }}" - git remote add origin "https://${{ github.actor }}:${{ secrets.GH_TOKEN }}@github.com/${{ github.repository }}" - git push -f -u origin sing - - name: Checkout meta-rules-dat uses: actions/checkout@v4 with: @@ -82,6 +68,20 @@ jobs: cp -r ../Iran-sing-box-rules/geosite*ir.srs ./geo/geosite/ cd ./geo/geosite/ && find ./ -type f -name "geosite-*ir.srs" -exec bash -c 'mv "$1" "${1/geosite-/}"' _ {} \; + - name: Git push assets to "sing-rule" branch + run: | + cd sing-rule || exit 1 + cp ../workflow/README.md . + ls + git init + git config --local user.name "github-actions[bot]" + git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" + git checkout -b sing + git add . + git commit -m "Released on ${{ env.BUILDTIME }}" + git remote add origin "https://${{ github.actor }}:${{ secrets.GH_TOKEN }}@github.com/${{ github.repository }}" + git push -f -u origin sing + - name: Purge jsdelivr CDN run: | cd sing-rule || exit 1 From a6fdd6a57cbaa5f28f0f649bd24b4b8d3488a713 Mon Sep 17 00:00:00 2001 From: ElonJunior Date: Thu, 23 May 2024 21:59:23 +0800 Subject: [PATCH 3/6] purge jsdelivr --- .github/workflows/run.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run.yml b/.github/workflows/run.yml index 60bad1c7..8e1abab4 100644 --- a/.github/workflows/run.yml +++ b/.github/workflows/run.yml @@ -83,9 +83,16 @@ jobs: git push -f -u origin sing - name: Purge jsdelivr CDN + # find . -type f \( -name "*.json" -o -name "*.srs" \) -printf "%P\n" | while read file; do + # curl -i -Ls "https://purge.jsdelivr.net/gh/${{ github.repository }}@sing/${file}" + # echo -e "\t${file} PURGE...\n" + # done run: | - cd sing-rule || exit 1 - find . -type f \( -name "*.json" -o -name "*.srs" \) -printf "%P\n" | while read file; do - curl -i -Ls "https://purge.jsdelivr.net/gh/${{ github.repository }}@sing/${file}" - echo -e "\t${file} PURGE...\n" + cd sing-rule/ACL4SSR || exit 1 + for file in $(ls); do + curl -i "https://purge.jsdelivr.net/gh/${{ github.repository }}@release/${file}" done + curl -i -Ls "https://purge.jsdelivr.net/gh/KaringX/karing-ruleset@sing/ACL4SSR/Ruleset" + curl -i -Ls "https://purge.jsdelivr.net/gh/KaringX/karing-ruleset@sing/geo/geoip" + curl -i -Ls "https://purge.jsdelivr.net/gh/KaringX/karing-ruleset@sing/geo/geosite" + From 62c10da45088e36f049dbe504af449a57575b0e1 Mon Sep 17 00:00:00 2001 From: ElonJunior Date: Thu, 23 May 2024 22:00:52 +0800 Subject: [PATCH 4/6] purge 2 --- .github/workflows/run.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run.yml b/.github/workflows/run.yml index 8e1abab4..f34d06e5 100644 --- a/.github/workflows/run.yml +++ b/.github/workflows/run.yml @@ -90,7 +90,7 @@ jobs: run: | cd sing-rule/ACL4SSR || exit 1 for file in $(ls); do - curl -i "https://purge.jsdelivr.net/gh/${{ github.repository }}@release/${file}" + curl -i "https://purge.jsdelivr.net/gh/${{ github.repository }}@sing/ACL4SSR/${file}" done curl -i -Ls "https://purge.jsdelivr.net/gh/KaringX/karing-ruleset@sing/ACL4SSR/Ruleset" curl -i -Ls "https://purge.jsdelivr.net/gh/KaringX/karing-ruleset@sing/geo/geoip" From b860fdc1fe253045844a2fc8c988b57212aa4ab7 Mon Sep 17 00:00:00 2001 From: ElonJunior Date: Thu, 23 May 2024 22:16:37 +0800 Subject: [PATCH 5/6] doc --- README.md | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 382b728c..87632c60 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,31 @@ -# ACL4SSR规则碎片 sing-box rule-set版本 -- fork from https://github.com/ACL4SSR/ACL4SSR -- 基于clash规则源文件生成的json和srs规则文件 +# rule-set collection for sing-box/karing + +## Thanks to +- [meta-rules-dat](https://github.com/MetaCubeX/meta-rules-dat/raw/sing/geo) +- [Chocolate4U-Iran](https://github.com/Chocolate4U/Iran-sing-box-rules/tree/rule-set?tab=readme-ov-file) +- [ACL4SSR](https://github.com/ACL4SSR/ACL4SSR) + + +# sing-box/karing rule-set规则碎片 +- 基于ACL4SSR和geoip、geosite规则源文件生成的json和srs规则文件 - 推荐配合[karing](https://github.com/KaringX/karing)食用更佳 ## 下载链接 ### 方案1 github - 比如需要国内IP直连, 对应文件为 `ChinaIp.srs` - 访问链接: -https://raw.githubusercontent.com/KaringX/ACL4SSR/sing/ChinaIp.srs +https://raw.githubusercontent.com/KaringX/karing-ruleset/sing/ACL4SSR/ChinaIp.srs ### 方案2 CDN:jsdelivr - 比如需要去广告功能, 对应文件为 `BanAD.srs` - 访问链接: -https://fastly.jsdelivr.net/gh/karingX/ACL4SSR@sing/BanAD.srs +https://fastly.jsdelivr.net/gh/karingX/karing-ruleset@sing/ACL4SSR/BanAD.srs ## 规则碎片 -- 主要文件在**sing分支**根目录和*Ruleset*文件夹下,可以配合一些订阅转换或者代理工具进行使用。 +- 主要文件在**sing分支**根目录和*ACL4SSR/Ruleset*文件夹下,可以配合一些订阅转换或者代理工具进行使用。 -- 下面是部分文件的注释,所有文件列表查看 [sing分支目录](https://github.com/KaringX/ACL4SSR/tree/sing) +- 下面是部分文件的注释,所有文件列表查看 [sing分支目录](https://github.com/KaringX/karing-ruleset/tree/sing) | 文件 | 类型 | 解释 | | ---------------------- | -------------------- | ------------------------------------------------------------ | From 7954ab7b5e378218d20e41390ddbcd90f1426ff6 Mon Sep 17 00:00:00 2001 From: ElonJunior Date: Fri, 24 May 2024 00:27:04 +0800 Subject: [PATCH 6/6] geo file list --- README.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/README.md b/README.md index 87632c60..24ecf3c3 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,36 @@ - [ACL4SSR](https://github.com/ACL4SSR/ACL4SSR) +# GeoIP/GeoSite +- The source files of Iran come from **Chocolate4U** +``` +│ +├──geoip +│ └── ir.srs +│ +└── geosite + ├── ir.srs + ├── category-ads-ir.srs + ├── category-bank-ir.srs + ├── category-bourse-ir.srs + ├── category-education-ir.srs + ├── category-forums-ir.srs + ├── category-gov-ir.srs + ├── category-insurance-ir.srs + ├── category-ir.srs + ├── category-media-ir.srs + ├── category-news-ir.srs + ├── category-payment-ir.srs + ├── category-scholar-ir.srs + ├── category-shopping-ir.srs + ├── category-social-media-ir.srs + ├── category-tech-ir.srs + └── category-travel-ir.srs + +``` + + + # sing-box/karing rule-set规则碎片 - 基于ACL4SSR和geoip、geosite规则源文件生成的json和srs规则文件 - 推荐配合[karing](https://github.com/KaringX/karing)食用更佳