mirror of
https://github.com/itdoginfo/allow-domains.git
synced 2025-09-01 18:19:41 +00:00
Added CloudFlare
This commit is contained in:
parent
3b00d19887
commit
4e1a6bd87d
4 changed files with 20 additions and 5 deletions
2
.github/workflows/create-lists.yml
vendored
2
.github/workflows/create-lists.yml
vendored
|
@ -31,7 +31,7 @@ jobs:
|
|||
-v ${{ github.workspace }}/Services:/app/Services \
|
||||
-v ${{ github.workspace }}/SRS:/app/SRS \
|
||||
-v ${{ github.workspace }}/DAT:/app/DAT \
|
||||
itdoginfo/compilesrs:0.1.14
|
||||
itdoginfo/compilesrs:0.1.15
|
||||
|
||||
- name: Check Russia/inside-dnsmasq-ipset
|
||||
uses: itdoginfo/dnsmasq-action@0.1
|
||||
|
|
4
Services/cloudflare.lst
Normal file
4
Services/cloudflare.lst
Normal file
|
@ -0,0 +1,4 @@
|
|||
cloudflare.com
|
||||
one.one.one.one
|
||||
cloudflarestatus.com
|
||||
cdnjs.com
|
|
@ -20,7 +20,8 @@ DiscordSubnets = 'Subnets/IPv4/discord.lst'
|
|||
MetaSubnets = 'Subnets/IPv4/meta.lst'
|
||||
TwitterSubnets = 'Subnets/IPv4/twitter.lst'
|
||||
TelegramSubnets = 'Subnets/IPv4/telegram.lst'
|
||||
ExcludeServices = {"telegram.lst"}
|
||||
CloudflareSubnets = 'Subnets/IPv4/cloudflare.lst'
|
||||
ExcludeServices = {"telegram.lst", "cloudflare.lst"}
|
||||
|
||||
def raw(src, out):
|
||||
domains = set()
|
||||
|
@ -454,6 +455,7 @@ if __name__ == '__main__':
|
|||
generate_srs_combined(TwitterSubnets, "Services/twitter.lst")
|
||||
generate_srs_combined(MetaSubnets, "Services/meta.lst")
|
||||
generate_srs_combined(TelegramSubnets, "Services/telegram.lst")
|
||||
generate_srs_combined(CloudflareSubnets, "Services/cloudflare.lst")
|
||||
|
||||
# Xray domains
|
||||
prepare_dat_domains(directories, 'russia-inside')
|
||||
|
|
|
@ -6,7 +6,7 @@ import os
|
|||
import shutil
|
||||
|
||||
BGP_TOOLS_URL = 'https://bgp.tools/table.txt'
|
||||
USER_AGENT = 'itdog.info - hi@itdog.info'
|
||||
HEADERS = { 'User-Agent': 'itdog.info - hi@itdog.info' }
|
||||
AS_FILE = 'AS.lst'
|
||||
IPv4_DIR = 'Subnets/IPv4'
|
||||
IPv6_DIR = 'Subnets/IPv6'
|
||||
|
@ -16,6 +16,7 @@ AS_TWITTER = '13414'
|
|||
META = 'meta.lst'
|
||||
TWITTER = 'twitter.lst'
|
||||
TELEGRAM = 'telegram.lst'
|
||||
CLOUDFLARE = 'cloudflare.lst'
|
||||
|
||||
# From https://iplist.opencck.org/
|
||||
DISCORD_VOICE_V4='https://iplist.opencck.org/?format=text&data=cidr4&site=discord.gg&site=discord.media'
|
||||
|
@ -25,6 +26,9 @@ DISCORD = 'discord.lst'
|
|||
|
||||
TELEGRAM_CIDR_URL = 'https://core.telegram.org/resources/cidr.txt'
|
||||
|
||||
CLOUDFLARE_V4='https://www.cloudflare.com/ips-v4'
|
||||
CLOUDFLARE_V6='https://www.cloudflare.com/ips-v6'
|
||||
|
||||
subnet_list = []
|
||||
|
||||
def subnet_summarization(subnet_list):
|
||||
|
@ -59,7 +63,7 @@ def download_ready_subnets(url_v4, url_v6):
|
|||
urls = [(url_v4, 4), (url_v6, 6)]
|
||||
|
||||
for url, version in urls:
|
||||
req = urllib.request.Request(url)
|
||||
req = urllib.request.Request(url, headers=HEADERS)
|
||||
try:
|
||||
with urllib.request.urlopen(req) as response:
|
||||
if response.status == 200:
|
||||
|
@ -100,7 +104,7 @@ def copy_file_legacy(src_filename):
|
|||
shutil.copy(src_filename, os.path.join(os.path.dirname(src_filename), new_filename))
|
||||
|
||||
if __name__ == '__main__':
|
||||
request = urllib.request.Request(BGP_TOOLS_URL, headers={'User-Agent': USER_AGENT})
|
||||
request = urllib.request.Request(BGP_TOOLS_URL, headers=HEADERS)
|
||||
|
||||
with urllib.request.urlopen(request) as response:
|
||||
for line in response:
|
||||
|
@ -128,6 +132,11 @@ if __name__ == '__main__':
|
|||
write_subnets_to_file(ipv4_telegram, f'{IPv4_DIR}/{TELEGRAM}')
|
||||
write_subnets_to_file(ipv6_telegram, f'{IPv6_DIR}/{TELEGRAM}')
|
||||
|
||||
# Cloudflare
|
||||
ipv4_cloudflare, ipv6_cloudflare = download_ready_subnets(CLOUDFLARE_V4, CLOUDFLARE_V6)
|
||||
write_subnets_to_file(ipv4_cloudflare, f'{IPv4_DIR}/{CLOUDFLARE}')
|
||||
write_subnets_to_file(ipv6_cloudflare, f'{IPv6_DIR}/{CLOUDFLARE}')
|
||||
|
||||
# Legacy name
|
||||
copy_file_legacy(f'{IPv4_DIR}/{META}')
|
||||
copy_file_legacy(f'{IPv6_DIR}/{META}')
|
||||
|
|
Loading…
Add table
Reference in a new issue