mirror of
https://github.com/itdoginfo/allow-domains.git
synced 2026-04-05 20:28:51 +03:00
Compare commits
6 Commits
2025-06-02
...
2025-06-09
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e9c980992d | ||
|
|
2f1d84f8b9 | ||
|
|
b5213e4967 | ||
|
|
a88d3f75cb | ||
|
|
8097852b8b | ||
|
|
3c8b49c2bf |
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.17
|
||||
itdoginfo/compilesrs:0.1.18
|
||||
|
||||
- name: Check Russia/inside-dnsmasq-ipset
|
||||
uses: itdoginfo/dnsmasq-action@0.1
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
31.24.253.0/24
|
||||
31.41.37.0/24
|
||||
31.56.52.0/22
|
||||
31.56.59.0/24
|
||||
31.56.77.0/24
|
||||
31.57.199.0/24
|
||||
31.59.68.0/24
|
||||
@@ -66,7 +65,6 @@
|
||||
45.95.80.0/24
|
||||
45.112.195.0/24
|
||||
45.135.161.0/24
|
||||
45.146.80.0/24
|
||||
45.149.63.0/24
|
||||
45.149.243.0/24
|
||||
46.8.116.0/24
|
||||
@@ -109,6 +107,7 @@
|
||||
77.73.34.0/24
|
||||
77.74.120.0/23
|
||||
77.74.122.0/24
|
||||
77.75.195.0/24
|
||||
77.81.138.0/24
|
||||
77.90.33.0/24
|
||||
77.246.211.0/24
|
||||
@@ -118,6 +117,7 @@
|
||||
80.87.206.0/24
|
||||
80.253.249.0/24
|
||||
82.22.118.0/24
|
||||
82.22.196.0/24
|
||||
82.23.190.0/24
|
||||
82.24.96.0/22
|
||||
82.25.135.0/24
|
||||
@@ -136,7 +136,7 @@
|
||||
86.54.24.0/24
|
||||
86.110.56.0/24
|
||||
87.98.128.0/17
|
||||
88.216.90.0/24
|
||||
87.229.8.0/24
|
||||
88.218.34.0/24
|
||||
89.19.44.0/24
|
||||
89.39.120.0/24
|
||||
@@ -159,9 +159,9 @@
|
||||
92.246.224.0/19
|
||||
93.114.69.0/24
|
||||
94.23.0.0/16
|
||||
95.134.149.0/24
|
||||
95.135.58.0/24
|
||||
95.169.162.0/24
|
||||
96.62.105.0/24
|
||||
103.5.12.0/22
|
||||
103.102.231.0/24
|
||||
103.199.80.0/24
|
||||
@@ -216,7 +216,6 @@
|
||||
145.239.0.0/16
|
||||
146.19.9.0/24
|
||||
146.59.0.0/16
|
||||
146.103.10.0/24
|
||||
146.103.49.0/24
|
||||
147.135.0.0/16
|
||||
148.113.0.0/18
|
||||
@@ -235,6 +234,7 @@
|
||||
151.242.159.0/24
|
||||
151.243.6.0/24
|
||||
151.243.160.0/22
|
||||
151.244.78.0/24
|
||||
151.245.112.0/24
|
||||
152.228.128.0/17
|
||||
157.254.30.0/24
|
||||
@@ -250,6 +250,7 @@
|
||||
164.153.166.0/24
|
||||
166.1.231.0/24
|
||||
167.114.0.0/16
|
||||
167.148.33.0/24
|
||||
167.234.38.0/24
|
||||
167.253.62.0/24
|
||||
168.245.185.0/24
|
||||
@@ -289,8 +290,8 @@
|
||||
185.241.50.0/23
|
||||
185.255.28.0/24
|
||||
188.68.164.0/22
|
||||
188.164.154.0/24
|
||||
188.165.0.0/16
|
||||
188.209.140.0/24
|
||||
191.96.153.0/24
|
||||
191.101.177.0/24
|
||||
192.31.246.0/24
|
||||
|
||||
60
convert.py
60
convert.py
@@ -362,28 +362,55 @@ def generate_srs_combined(input_subnets_file, input_domains_file, output_json_di
|
||||
print(f"Compile error {output_file_path}: {e}")
|
||||
|
||||
|
||||
def prepare_dat_domains(domains_or_dirs, output_name):
|
||||
def prepare_dat_domains(domains, output_name, dirs=[]):
|
||||
output_lists_directory = 'geosite_data'
|
||||
|
||||
os.makedirs(output_lists_directory, exist_ok=True)
|
||||
|
||||
extracted_domains = []
|
||||
domain_attrs = {domain: [] for domain in domains}
|
||||
|
||||
if all(os.path.isdir(d) for d in domains_or_dirs):
|
||||
for directory in domains_or_dirs:
|
||||
for filename in os.listdir(directory):
|
||||
file_path = os.path.join(directory, filename)
|
||||
for directory in dirs:
|
||||
if not os.path.isdir(directory):
|
||||
continue
|
||||
for filename in os.listdir(directory):
|
||||
file_path = os.path.join(directory, filename)
|
||||
if not os.path.isfile(file_path):
|
||||
continue
|
||||
|
||||
if os.path.isfile(file_path):
|
||||
with open(file_path, 'r', encoding='utf-8') as file:
|
||||
attribute = os.path.splitext(filename)[0]
|
||||
extracted_domains.extend(f"{line.strip()} @{attribute}" for line in file if line.strip())
|
||||
else:
|
||||
extracted_domains = domains_or_dirs
|
||||
attribute = os.path.splitext(filename)[0].replace('_', '-')
|
||||
|
||||
with open(file_path, 'r', encoding='utf-8') as f:
|
||||
for line in f:
|
||||
domain = line.strip()
|
||||
if not domain:
|
||||
continue
|
||||
if domain in domain_attrs:
|
||||
domain_attrs[domain].append(f" @{attribute}")
|
||||
|
||||
output_file_path = os.path.join(output_lists_directory, output_name)
|
||||
with open(output_file_path, 'w', encoding='utf-8') as file:
|
||||
file.writelines(f"{name}\n" for name in extracted_domains)
|
||||
with open(output_file_path, 'w', encoding='utf-8') as out_f:
|
||||
for domain, attrs in domain_attrs.items():
|
||||
line = domain + "".join(attrs)
|
||||
out_f.write(f"{line}\n")
|
||||
|
||||
def prepare_dat_combined(dirs):
|
||||
import shutil
|
||||
|
||||
output_lists_directory = 'geosite_data'
|
||||
os.makedirs(output_lists_directory, exist_ok=True)
|
||||
|
||||
for directory in dirs:
|
||||
if not os.path.isdir(directory):
|
||||
continue
|
||||
|
||||
for filename in os.listdir(directory):
|
||||
source_path = os.path.join(directory, filename)
|
||||
if not os.path.isfile(source_path):
|
||||
continue
|
||||
|
||||
new_name = os.path.splitext(filename)[0].replace('_', '-')
|
||||
destination_path = os.path.join(output_lists_directory, new_name)
|
||||
|
||||
shutil.copyfile(source_path, destination_path)
|
||||
|
||||
def generate_dat_domains(data_path='geosite_data', output_name='geosite.dat', output_directory='DAT'):
|
||||
os.makedirs(output_directory, exist_ok=True)
|
||||
@@ -462,7 +489,8 @@ if __name__ == '__main__':
|
||||
generate_srs_combined(OVHSubnets, "Services/ovh.lst")
|
||||
|
||||
# Xray domains
|
||||
prepare_dat_domains(directories, 'russia-inside')
|
||||
prepare_dat_domains(russia_inside, 'russia-inside', directories)
|
||||
prepare_dat_domains(russia_outside, 'russia-outside')
|
||||
prepare_dat_domains(ukraine_inside, 'ukraine-inside')
|
||||
prepare_dat_combined(directories)
|
||||
generate_dat_domains()
|
||||
|
||||
Reference in New Issue
Block a user