mirror of
https://github.com/itdoginfo/allow-domains.git
synced 2025-04-16 19:49:08 +00:00
Added srs for subnets
This commit is contained in:
parent
05b0fdc03b
commit
e243c5e671
2 changed files with 27 additions and 12 deletions
2
.github/workflows/create-lists.yml
vendored
2
.github/workflows/create-lists.yml
vendored
|
@ -30,7 +30,7 @@ jobs:
|
||||||
-v ${{ github.workspace }}/Categories:/app/Categories \
|
-v ${{ github.workspace }}/Categories:/app/Categories \
|
||||||
-v ${{ github.workspace }}/Services:/app/Services \
|
-v ${{ github.workspace }}/Services:/app/Services \
|
||||||
-v ${{ github.workspace }}/SRS:/app/SRS \
|
-v ${{ github.workspace }}/SRS:/app/SRS \
|
||||||
itdoginfo/compilesrs:0.1.2
|
itdoginfo/compilesrs:0.1.3
|
||||||
|
|
||||||
- name: Check Russia/inside-dnsmasq-ipset
|
- name: Check Russia/inside-dnsmasq-ipset
|
||||||
uses: itdoginfo/dnsmasq-action@0.1
|
uses: itdoginfo/dnsmasq-action@0.1
|
||||||
|
|
37
convert.py
37
convert.py
|
@ -17,6 +17,8 @@ rusDomainsOutsideOut='Russia/outside'
|
||||||
uaDomainsSrc='src/Ukraine-domains-inside.lst'
|
uaDomainsSrc='src/Ukraine-domains-inside.lst'
|
||||||
uaDomainsOut='Ukraine/inside'
|
uaDomainsOut='Ukraine/inside'
|
||||||
DiscordSubnets = 'Subnets/IPv4/Discord.lst'
|
DiscordSubnets = 'Subnets/IPv4/Discord.lst'
|
||||||
|
MetaSubnets = 'Subnets/IPv4/Meta.lst'
|
||||||
|
TwitterSubnets = 'Subnets/IPv4/Twitter.lst'
|
||||||
|
|
||||||
def raw(src, out):
|
def raw(src, out):
|
||||||
domains = set()
|
domains = set()
|
||||||
|
@ -265,16 +267,27 @@ def generate_srs_subnets(input_file, output_json_directory='JSON', compiled_outp
|
||||||
if subnet:
|
if subnet:
|
||||||
subnets.append(subnet)
|
subnets.append(subnet)
|
||||||
|
|
||||||
data = {
|
if input_file == "Subnets/IPv4/Discord.lst":
|
||||||
"version": 2,
|
data = {
|
||||||
"rules": [
|
"version": 2,
|
||||||
{
|
"rules": [
|
||||||
"network": ["udp"],
|
{
|
||||||
"ip_cidr": subnets,
|
"network": ["udp"],
|
||||||
"port_range": ["50000:65535"]
|
"ip_cidr": subnets,
|
||||||
}
|
"port_range": ["50000:65535"]
|
||||||
]
|
}
|
||||||
}
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
else:
|
||||||
|
data = {
|
||||||
|
"version": 2,
|
||||||
|
"rules": [
|
||||||
|
{
|
||||||
|
"ip_cidr": subnets
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
filename = os.path.splitext(os.path.basename(input_file))[0]
|
filename = os.path.splitext(os.path.basename(input_file))[0]
|
||||||
output_file_path = os.path.join(output_json_directory, f"{filename}-subnets.json")
|
output_file_path = os.path.join(output_json_directory, f"{filename}-subnets.json")
|
||||||
|
@ -347,4 +360,6 @@ if __name__ == '__main__':
|
||||||
generate_srs_for_categories(directories)
|
generate_srs_for_categories(directories)
|
||||||
|
|
||||||
# Sing-box subnets
|
# Sing-box subnets
|
||||||
generate_srs_subnets(DiscordSubnets)
|
generate_srs_subnets(DiscordSubnets)
|
||||||
|
generate_srs_subnets(TwitterSubnets)
|
||||||
|
generate_srs_subnets(MetaSubnets)
|
Loading…
Add table
Reference in a new issue