From 7f9927dc93b3ef220d980bc897fa1ea599171390 Mon Sep 17 00:00:00 2001 From: loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com> Date: Tue, 4 Aug 2020 10:56:16 +0800 Subject: [PATCH] Update due to https://github.com/Loyalsoldier/v2ray-rules-dat/commit/af804d9879e18768b4497b24d6ed6d1a96d78122 --- .github/workflows/build.yml | 75 +++++++++---------------------------- 1 file changed, 18 insertions(+), 57 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 73b6123..bfa1d1b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,9 +16,6 @@ jobs: run: | echo "::set-env name=RELEASE_NAME::Released on $(date +%Y%m%d%H%M)" echo "::set-env name=TAG_NAME::$(date +%Y%m%d%H%M)" - echo "::set-env name=v2fly_reject::https://raw.githubusercontent.com/v2fly/domain-list-community/release/category-ads-all.txt" - echo "::set-env name=v2fly_not_cn::https://raw.githubusercontent.com/v2fly/domain-list-community/release/geolocation-!cn.txt" - echo "::set-env name=v2fly_cn::https://raw.githubusercontent.com/v2fly/domain-list-community/release/cn.txt" echo "::set-env name=v2fly_icloud::https://raw.githubusercontent.com/v2fly/domain-list-community/release/icloud.txt" echo "::set-env name=v2fly_apple::https://raw.githubusercontent.com/v2fly/domain-list-community/release/apple.txt" echo "::set-env name=Loyalsoldier_reject::https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/reject-list.txt" @@ -37,70 +34,34 @@ jobs: - name: Generate icloud.txt file run: | echo "payload:" > icloud.txt - curl -sSL ${v2fly_icloud} | grep -e "^full:" -e "^domain:" | awk -F ':' '{printf " - |+.%s|\n", $2}' | sed "s/|/'/g" >> icloud.txt + curl -sSL ${v2fly_icloud} | grep -E "^(full|domain):" | awk -F ':' '{printf " - |+.%s|\n", $2}' | sed "s/|/'/g" >> icloud.txt - name: Generate google.txt file run: | echo "payload:" > google.txt - curl -sSL ${felixonmars_google} | awk -F '/' '{printf " - |+.%s|\n", $2}' | sed "s/|/'/g" >> google.txt + curl -sSL ${felixonmars_google} | perl -ne '/^server=\/([^\/]+)\// && print " - |+.$1|\n"' | sed "s/|/'/g" >> google.txt - - name: Get and add apple domains into apple.temp file - run: | - curl -sSL ${felixonmars_apple} | awk -F '/' '{print $2}' > apple.temp - curl -sSL ${v2fly_apple} | grep -e "^full:" -e "^domain:" | awk -F ':' '{print $2}' >> apple.temp - - - name: Get and add direct domains into direct.temp file - run: | - curl -sSL ${Loyalsoldier_direct} | perl -ne '/^([-_a-zA-Z0-9]+(\.[-_a-zA-Z0-9]+)+)\n/ && print "$1\n"' > direct.temp - curl -sSL ${v2fly_cn} | grep -e "^full:" -e "^domain:" | awk -F ':' '{print $2}' >> direct.temp - - - name: Get and add proxy domains into proxy.temp file - run: | - curl -sSL ${Loyalsoldier_proxy} | perl -ne '/^([-_a-zA-Z0-9]+(\.[-_a-zA-Z0-9]+)+)\n/ && print "$1\n"' > proxy.temp - curl -sSL ${v2fly_not_cn} | grep -e "^full:" -e "^domain:" | awk -F ':' '{print $2}' | perl -ne 'print if not /(.+\.cn$)/' >> proxy.temp - - - name: Get and add reject domains into reject.temp file - run: | - curl -sSL ${Loyalsoldier_reject} | perl -ne '/^([-_a-zA-Z0-9]+(\.[-_a-zA-Z0-9]+)+)\n/ && print "$1\n"' > reject.temp - curl -sSL ${v2fly_reject} | grep -e "^full:" -e "^domain:" | awk -F ':' '{print $2}' >> reject.temp - - - name: Sort and generate redundant lists - run: | - cat apple.temp | sort --ignore-case -u > apple-list-with-redundant - cat direct.temp | sort --ignore-case -u > direct-list-with-redundant - cat proxy.temp | sort --ignore-case -u > proxy-list-with-redundant - cat reject.temp | sort --ignore-case -u > reject-list-with-redundant - - - name: Remove redundant domains - run: | - chmod +x findRedundantDomain.py - ./findRedundantDomain.py ./apple-list-with-redundant ./apple-list-deleted-unsort - ./findRedundantDomain.py ./direct-list-with-redundant ./direct-list-deleted-unsort - ./findRedundantDomain.py ./proxy-list-with-redundant ./proxy-list-deleted-unsort - ./findRedundantDomain.py ./reject-list-with-redundant ./reject-list-deleted-unsort - [ ! -f "apple-list-deleted-unsort" ] && touch apple-list-deleted-unsort - [ ! -f "direct-list-deleted-unsort" ] && touch direct-list-deleted-unsort - [ ! -f "proxy-list-deleted-unsort" ] && touch proxy-list-deleted-unsort - [ ! -f "reject-list-deleted-unsort" ] && touch reject-list-deleted-unsort - sort ./apple-list-deleted-unsort > ./apple-list-deleted-sort - sort ./direct-list-deleted-unsort > ./direct-list-deleted-sort - sort ./proxy-list-deleted-unsort > ./proxy-list-deleted-sort - sort ./reject-list-deleted-unsort > ./reject-list-deleted-sort - diff ./apple-list-deleted-sort ./apple-list-with-redundant | awk '/^>/{print $2}' > ./apple-list-without-redundant - diff ./direct-list-deleted-sort ./direct-list-with-redundant | awk '/^>/{print $2}' > ./direct-list-without-redundant - diff ./proxy-list-deleted-sort ./proxy-list-with-redundant | awk '/^>/{print $2}' > ./proxy-list-without-redundant - diff ./reject-list-deleted-sort ./reject-list-with-redundant | awk '/^>/{print $2}' > ./reject-list-without-redundant - - - name: Write to files + - name: Generate apple.txt file run: | + curl -sSL ${felixonmars_apple} | perl -ne '/^server=\/([^\/]+)\// && print "$1\n"' > apple.temp + curl -sSL ${v2fly_apple} | grep -E "^(full|domain):" | awk -F ':' '{print $2}' >> apple.temp echo "payload:" > apple.txt + cat apple.temp | perl -ne '/^([-_a-zA-Z0-9]+(\.[-_a-zA-Z0-9]+)*)/ && print " - |+.$1|\n"' | sed "s/|/'/g" >> apple.txt + + - name: Generate direct.txt file + run: | echo "payload:" > direct.txt + curl -sSL ${Loyalsoldier_direct} | grep -Ev "^(regex|keyword):" | perl -ne '/^([-_a-zA-Z0-9]+(\.[-_a-zA-Z0-9]+)*)/ && print " - |+.$1|\n"' | sed "s/|/'/g" >> direct.txt + + - name: Generate proxy.txt file + run: | echo "payload:" > proxy.txt + curl -sSL ${Loyalsoldier_proxy} | grep -Ev "^(regex|keyword):" | perl -ne '/^([-_a-zA-Z0-9]+(\.[-_a-zA-Z0-9]+)*)/ && print " - |+.$1|\n"' | sed "s/|/'/g" >> proxy.txt + + - name: Generate reject.txt file + run: | echo "payload:" > reject.txt - cat apple-list-without-redundant | awk '{printf " - |+.%s|\n", $1}' | sed "s/|/'/g" >> apple.txt - cat direct-list-without-redundant | awk '{printf " - |+.%s|\n", $1}' | sed "s/|/'/g" >> direct.txt - cat proxy-list-without-redundant | awk '{printf " - |+.%s|\n", $1}' | sed "s/|/'/g" >> proxy.txt - cat reject-list-without-redundant | awk '{printf " - |+.%s|\n", $1}' | sed "s/|/'/g" >> reject.txt + curl -sSL ${Loyalsoldier_reject} | grep -Ev "^(regex|keyword):" | perl -ne '/^([-_a-zA-Z0-9]+(\.[-_a-zA-Z0-9]+)*)/ && print " - |+.$1|\n"' | sed "s/|/'/g" >> reject.txt - name: Generate cncidr.txt file run: |