checkout runetfreedom

This commit is contained in:
ElonJunior 2025-01-20 01:07:33 +08:00
parent 9bb63514a4
commit a60a081fd4
4 changed files with 58 additions and 8 deletions

View File

@ -72,6 +72,13 @@ jobs:
run: |
bash workflow/resouces/cn_adblockfilters.sh ./sing-rule
- name: Checkout runetfreedom
uses: actions/checkout@v4
with:
repository: runetfreedom/russia-v2ray-rules-dat
path: runetfreedom
ref: release
- name: RU antizapret
env:
NO_SKIP: true

View File

@ -22,18 +22,56 @@ sing_exe="${work_dir}/sing-box"
# ———————————————————————————————————————————————————————————————————————————————————————————————
AD_KEYWORDS="# 广告关键词
DOMAIN-KEYWORD,admarvel
DOMAIN-KEYWORD,admaster
DOMAIN-KEYWORD,adsage
DOMAIN-KEYWORD,adsensor
DOMAIN-KEYWORD,adsmogo
DOMAIN-KEYWORD,adsrvmedia
DOMAIN-KEYWORD,adsserving
DOMAIN-KEYWORD,adsystem
DOMAIN-KEYWORD,adwords
DOMAIN-KEYWORD,applovin
DOMAIN-KEYWORD,appsflyer
DOMAIN-KEYWORD,domob
DOMAIN-KEYWORD,duomeng
DOMAIN-KEYWORD,dwtrack
DOMAIN-KEYWORD,guanggao
DOMAIN-KEYWORD,omgmta
DOMAIN-KEYWORD,omniture
DOMAIN-KEYWORD,openx
DOMAIN-KEYWORD,partnerad
DOMAIN-KEYWORD,pingfore
DOMAIN-KEYWORD,socdm
DOMAIN-KEYWORD,supersonicads
DOMAIN-KEYWORD,wlmonitor
DOMAIN-KEYWORD,zjtoolbar
"
# ———————————————————————————————————————————————————————————————————————————————————————————————
function download_adblockfilters() {
mkdir -p $target_dir/adblockfilters
cd $target_dir/adblockfilters/
file_array=("AdGuard_Base_filter.txt" "AdGuard_Chinese_filter.txt" "AdGuard_DNS_filter.txt" "AdGuard_Mobile_Ads_filter.txt" "adblockclashlite.list" "adblockclash.list")
for file in "${file_array[@]}"; do
wget --no-check-certificate -q --show-progress -T10 -t3 -O $file "https://github.com/217heidai/adblockfilters/raw/refs/heads/main/rules/${file}"
# --show-progress
wget --no-check-certificate -q -T10 -t3 -O $file "https://github.com/217heidai/adblockfilters/raw/refs/heads/main/rules/${file}"
if [[ "$file" == *.list ]]; then
basename=${file%.list}
echo "source << ${basename}"
# ad keys
if [[ "$file" == "adblockclashlite.list" ]]; then
echo "$AD_KEYWORDS" > temp_file && cat "$file" >> temp_file
mv temp_file "$file"
# echo "$AD_KEYWORDS" >> $file
fi
#convert to json
python $CURRENT_DIR/convert_json.py --single $target_dir/adblockfilters/$file $basename.json

View File

@ -48,7 +48,7 @@ OPT_RULESET_GROUPS['default'] = {
'default': 'off',
'outbound': 'block_out',
'rules': [
'acl:BanAD',
# 'acl:BanAD',
'geosite:category-ads',
],
},
@ -120,7 +120,7 @@ OPT_RULESET_GROUPS['cn'] = {
'default': 'off',
'outbound': 'block_out',
'rules': [
'acl:BanAD', # 3.7K
'acl:BanAD', # 135K = adblockclashlite
'geosite:category-ads', # 6.0K
],
},
@ -236,7 +236,7 @@ OPT_RULESET_GROUPS['cn'] = {
##start ru
OPT_RULESET_GROUPS['ru'] = OPT_RULESET_GROUPS['default'].copy()
OPT_RULESET_GROUPS['ru']['🇷🇺 blocked'] = {
OPT_RULESET_GROUPS['ru']['🇷🇺 antizapret'] = {
'default': 'on',
'outbound': 'selector_out',
'rules': [

View File

@ -23,8 +23,13 @@ target_dir="${work_dir}/russia"
## runetfreedom/russia-v2ray-rules-dat
function clone_runetfreedom(){
git clone -b release --single-branch --depth=1 git@github.com:runetfreedom/russia-v2ray-rules-dat.git runetfreedom
rm -rf runetfreedom/.git
#git clone -b release --single-branch --depth=1 git@github.com:runetfreedom/russia-v2ray-rules-dat.git runetfreedom
gitclone_dir=$(dirname $work_dir)/runetfreedom
if [[ ! -d "$gitclone_dir" ]]; then
echo "${gitclone_dir} unkown directory"
exit -1
fi
cp -r $gitclone_dir . && rm -rf runetfreedom/.git
cd runetfreedom/sing-box/
cp rule-set-geoip/geoip-ru-blocked.srs $work_dir/geo/geoip/blocked@ru.srs
cp rule-set-geoip/geoip-ru-blocked-community.srs $work_dir/geo/geoip/blocked-community@ru.srs
@ -41,7 +46,7 @@ function download_antizapret(){
file_array=("antizapret.srs" "antizapret.srs.sha256sum")
for file in "${file_array[@]}"; do
echo $file
wget --no-check-certificate -q --show-progress -T10 -t3 "https://github.com/savely-krasovsky/antizapret-sing-box/releases/latest/download/${file}"
wget --no-check-certificate -q -T10 -t3 -O $file "https://github.com/savely-krasovsky/antizapret-sing-box/releases/latest/download/${file}"
done
}