Update-IPs #3339
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update-IPs | |
on: | |
schedule: | |
- cron: '10 */8 * * *' | |
watch: | |
types: | |
- 'started' | |
jobs: | |
merge: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
ref: tmp | |
- name: Set git identity | |
run : | | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --global user.name "github-actions[bot]" | |
- name: Load new hi-freq IPs | |
run: | | |
head -n4 luci-app-ssr-plus/root/etc/ssrplus/blockipv6.sh > blockipv6.sh; mv blockipv6.sh luci-app-ssr-plus/root/etc/ssrplus/blockipv6.sh | |
shopt -s expand_aliases | |
alias blockipv6='xargs -n1 -i echo "ipset -! add blockipv6 {}" | tee -a luci-app-ssr-plus/root/etc/ssrplus/blockipv6.sh' | |
alias blackipv4='tee -a luci-app-ssr-plus/root/etc/ssrplus/blackipv4.sh' | |
curl https://www.cloudflare.com/ips-v6 | blockipv6 | |
curl https://api.fastly.com/public-ip-list | jq -r '.ipv6_addresses[]' | blockipv6 | |
curl https://ip-ranges.amazonaws.com/ip-ranges.json | jq -r '.ipv6_prefixes[] | select(.service=="S3" or .service=="CLOUDFRONT") | .ipv6_prefix' | blockipv6 | |
curl https://raw.githubusercontent.com/Gelob/azure-cdn-ips/master/edgenodes-ipv6.txt | blockipv6 | |
curl https://api.github.com/meta | jq -r '.web[]' | grep -E '(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))' | blockipv6 | |
curl https://www.cloudflare.com/ips-v4 -w "\n" > luci-app-ssr-plus/root/etc/ssrplus/blackipv4.sh | |
curl https://api.fastly.com/public-ip-list | jq -r '.addresses[]' | blackipv4 | |
echo '!gas44907'|nc whois.radb.net 43 | tail +2 | head -n -1 | xargs -n1 echo | blackipv4 | |
echo '!gas59930'|nc whois.radb.net 43 | tail +2 | head -n -1 | xargs -n1 echo | blackipv4 | |
echo '!gas62014'|nc whois.radb.net 43 | tail +2 | head -n -1 | xargs -n1 echo | blackipv4 | |
echo '!gas62041'|nc whois.radb.net 43 | tail +2 | head -n -1 | xargs -n1 echo | blackipv4 | |
echo '!gas211157'|nc whois.radb.net 43 | tail +2 | head -n -1 | xargs -n1 echo | blackipv4 | |
curl https://ip-ranges.amazonaws.com/ip-ranges.json | jq -r '.prefixes[] | select(.service=="S3" or .service=="CLOUDFRONT") | .ip_prefix' | blackipv4 | |
curl https://raw.githubusercontent.com/Gelob/azure-cdn-ips/master/edgenodes-ipv4.txt | blackipv4 | |
curl https://api.github.com/meta | jq -r '.web[]' | grep -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | blackipv4 | |
git add luci-app-ssr-plus/root/etc/ssrplus/blackipv4.sh luci-app-ssr-plus/root/etc/ssrplus/blockipv6.sh | |
git commit -am 'update cloudflare and telegram IPs' || true | |
- name: Push Commits | |
run: git push origin tmp |