├── resouces
├── direct.txt
├── reject.txt
├── proxy.txt
├── proxy-need-to-remove.txt
├── direct-need-to-remove.txt
├── reject-need-to-remove.txt
├── removeFrom.py
├── convert.sh
├── convert-clash.sh
├── findRedundantDomain.py
└── bm7.sh
├── .github
├── workflows
│ ├── delete.yml
│ └── run.yml
└── dependabot.yml
├── README.md
└── LICENSE
/resouces/direct.txt:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/resouces/reject.txt:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/resouces/proxy.txt:
--------------------------------------------------------------------------------
1 | supertop.co
2 | hk.chinamobile.com
3 |
--------------------------------------------------------------------------------
/resouces/proxy-need-to-remove.txt:
--------------------------------------------------------------------------------
1 | ifanr.com
2 | weibo.com
3 | www.baidu.com
4 |
--------------------------------------------------------------------------------
/.github/workflows/delete.yml:
--------------------------------------------------------------------------------
1 | name: Delete old workflow runs
2 | on:
3 | schedule:
4 | - cron: '0 0 * * 0'
5 | # Run monthly, at 00:00 on the 1st day of month.
6 |
7 | jobs:
8 | del_runs:
9 | runs-on: ubuntu-latest
10 | steps:
11 | - name: Delete workflow runs
12 | uses: GitRML/delete-workflow-runs@main
13 | with:
14 | token: ${{ secrets.AUTH_PAT }}
15 | repository: ${{ github.repository }}
16 | retain_days: 7
17 |
--------------------------------------------------------------------------------
/resouces/direct-need-to-remove.txt:
--------------------------------------------------------------------------------
1 | 103.com
2 | 123cha.com
3 | 95081.com
4 | acg.rip
5 | airasia.com
6 | baid.us
7 | baidu.jp
8 | bussou.com
9 | busytrade.com
10 | cnbeta.com
11 | cnbetacdn.com
12 | cnpolitics.org
13 | dm530.net
14 | duanzhihu.com
15 | dysfz.cc
16 | emacs-china.org
17 | galaxymacau.com
18 | galstars.net
19 | haitum.com
20 | hostloc.com
21 | jiaoyou8.com
22 | kh.google.com
23 | laonanren.com
24 | mysinablog.com
25 | ntrqq.com
26 | nytlog.com
27 | shuangtv.net
28 | suppig.net
29 | top
30 | xclient.info
31 | xjp.cc
32 | yanghengjun.com
33 | ydy.com
34 | yslang.com
35 | yysub.net
36 | hamreus.com
37 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | # To get started with Dependabot version updates, you'll need to specify which
2 | # package ecosystems to update and where the package manifests are located.
3 | # Please see the documentation for all configuration options:
4 | # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5 |
6 | version: 2
7 | updates:
8 | - package-ecosystem: "github-actions"
9 | directory: "/"
10 | schedule:
11 | interval: "daily"
12 | timezone: "Asia/Shanghai"
13 | time: "07:00"
14 | pull-request-branch-name:
15 | separator: "-"
16 |
--------------------------------------------------------------------------------
/resouces/reject-need-to-remove.txt:
--------------------------------------------------------------------------------
1 | 4paradigm.com
2 | addthis.com
3 | addthisedge.com
4 | alimama.alicdn.com
5 | alimama.com
6 | analytics.google.com
7 | app.chat.xiaomi.net
8 | bdtj.tagtic.cn
9 | cdn.onesignal.com
10 | click.discord.com
11 | click.redditmail.com
12 | ctrip.com
13 | d.ifengimg.com
14 | icons.mydrivers.com
15 | img.alibaba.com
16 | jav321.com
17 | knet.cn
18 | mail.tsinghua.edu.cn
19 | mtalk.google.com
20 | mx.technolutions.net
21 | newrelic.com
22 | offer.alibaba.com
23 | pingjs.qq.com
24 | qlogo.cn
25 | resolver.msg.xiaomi.net
26 | s.youtube.com
27 | sf3-ttcdn-tos.pstatp.com
28 | t.co
29 | tagtic.cn
30 | telegra.ph
31 | tongji.baidu.com
32 | tv.sohu.com
33 | ue.yeyoucdn.com
34 |
--------------------------------------------------------------------------------
/resouces/removeFrom.py:
--------------------------------------------------------------------------------
1 | import argparse
2 |
3 |
4 | def remove_domains(file_to_remove, file_to_remove_from, output_file):
5 | with open(file_to_remove, "r") as f_remove, open(
6 | file_to_remove_from, "r"
7 | ) as f_from:
8 | domains_to_remove = set(line.strip() for line in f_remove)
9 | all_domains = set(line.strip() for line in f_from)
10 |
11 | remaining_domains = all_domains - domains_to_remove
12 |
13 | with open(output_file, "w") as output:
14 | output.write("\n".join(remaining_domains))
15 |
16 |
17 | if __name__ == "__main__":
18 | parser = argparse.ArgumentParser(description="Remove domains from a file.")
19 | parser.add_argument(
20 | "-remove", required=True, help="File containing domains to be removed"
21 | )
22 | parser.add_argument(
23 | "-from", required=True, dest="from_file", help="File to remove domains from"
24 | )
25 | parser.add_argument("-out", required=True, help="Output file")
26 |
27 | args = parser.parse_args()
28 |
29 | remove_domains(args.remove, args.from_file, args.out)
30 |
--------------------------------------------------------------------------------
/resouces/convert.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | mkdir -p geoip
4 | ./mosdns v2dat unpack-ip -o ./geoip/ geoip.dat
5 | list=($(ls ./geoip | sed 's/geoip_//g' | sed 's/\.txt//g'))
6 | for ((i = 0; i < ${#list[@]}; i++)); do
7 | sed -i 's/^/ "/g' ./geoip/geoip_${list[i]}.txt
8 | sed -i 's/$/",/g' ./geoip/geoip_${list[i]}.txt
9 | sed -i '1s/^/{\n "version": 1,\n "rules": [\n {\n "ip_cidr": [\n/g' ./geoip/geoip_${list[i]}.txt
10 | sed -i '$ s/,$/\n ]\n }\n ]\n}/g' ./geoip/geoip_${list[i]}.txt
11 | mv ./geoip/geoip_${list[i]}.txt ./geoip/${list[i]}.json
12 | ./sing-box rule-set compile "./geoip/${list[i]}.json" -o ./geoip/${list[i]}.srs
13 | done
14 |
15 | list=($(./sing-box geosite list | sed 's/ (.*)$//g'))
16 | mkdir -p geosite
17 | for ((i = 0; i < ${#list[@]}; i++)); do
18 | ./sing-box geosite export ${list[i]} -o ./geosite/${list[i]}.json
19 | ./sing-box rule-set compile ./geosite/${list[i]}.json -o ./geosite/${list[i]}.srs
20 | done
21 |
22 | # mkdir -p mixed
23 | # for file in $(find geoip -type f | grep -v srs | awk -F "/" '{print $NF}'); do
24 | # if [ -n "$(find geosite -type f -iname "$file")" ]; then
25 | # file=$(find ./geosite -type f -iname "$file" | awk -F"/" '{print $NF}' | sed 's/\.json//g')
26 | # head -n -3 ./geoip/${file}.json >./mixed/${file}.json
27 | # sed -i 's/]/],/g' ./mixed/${file}.json
28 | # tail -n +5 ./geosite/${file}.json >>./mixed/${file}.json
29 | # ./sing-box rule-set compile ./mixed/${file}.json -o ./mixed/${file}.srs
30 | # fi
31 | # done
32 |
--------------------------------------------------------------------------------
/resouces/convert-clash.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | mkdir -p geoip
4 | ./mosdns v2dat unpack-ip -o ./geoip/ geoip.dat
5 | list=($(ls ./geoip | sed 's/geoip_//g' | sed 's/\.txt//g'))
6 | for ((i = 0; i < ${#list[@]}; i++)); do
7 | # echo "${list[i]}"
8 | mv ./geoip/geoip_${list[i]}.txt ./geoip/${list[i]}.list
9 | echo "payload:" >./geoip/${list[i]}.yaml
10 | cat ./geoip/${list[i]}.list | sed 's/^/- "/g' | sed 's/$/"/g' >>./geoip/${list[i]}.yaml
11 | done
12 |
13 | mkdir -p geosite
14 | ./mosdns v2dat unpack-domain -o ./geosite/ geosite.dat
15 | list=($(ls ./geosite | sed 's/geosite_//g' | sed 's/\.txt//g'))
16 | for ((i = 0; i < ${#list[@]}; i++)); do
17 | # echo "${list[i]}"
18 | mv ./geosite/geosite_${list[i]}.txt ./geosite/${list[i]}.list
19 | sed -i '/^#/d' geosite/${list[i]}.list
20 | sed -i '/^keyword:/d' geosite/${list[i]}.list
21 | sed -i '/^regexp:/d' geosite/${list[i]}.list
22 | sed -i 's/^/+./g' ./geosite/${list[i]}.list
23 | sed -i 's/+.full://g' ./geosite/${list[i]}.list
24 | sed -i 's/+.domain:/+./g' ./geosite/${list[i]}.list
25 | echo "payload:" >./geosite/${list[i]}.yaml
26 | cat ./geosite/${list[i]}.list | sed 's/^/- "/g' | sed 's/$/"/g' >>./geosite/${list[i]}.yaml
27 | done
28 |
29 | #mkdir -p mixed
30 | #for file in $(find geoip -type f | grep -v srs | awk -F "/" '{print $NF}'); do
31 | # if [ -n "$(find geosite -type f -iname "$file")" ]; then
32 | # file=$(find ./geosite -type f -iname "$file" | awk -F"/" '{print $NF}' | sed 's/\.json//g')
33 | # head -n -3 ./geoip/${file}.json >./mixed/${file}.json
34 | # sed -i 's/]/],/g' ./mixed/${file}.json
35 | # tail -n +5 ./geosite/${file}.json >>./mixed/${file}.json
36 | # ./sing-box rule-set compile ./mixed/${file}.json -o ./mixed/${file}.srs
37 | # fi
38 | #done
39 |
--------------------------------------------------------------------------------
/resouces/findRedundantDomain.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 |
3 | import sys
4 | print(sys.argv[1], sys.argv[2])
5 |
6 | ''' Find redundant items in domain lists.
7 | e.g. 'bar.foo.com' is redundant for 'foo.com'.
8 | '''
9 |
10 | def load(list):
11 | ''' Parse conf file & Prepare data structure
12 | Returns: [ ['abc', 'com'],
13 | ['bar', 'foo', 'com'],
14 | ... ]
15 | '''
16 |
17 | results = []
18 | with open(list, 'r') as f:
19 | for line in f.readlines():
20 | line = line.strip()
21 | if line == '' or line.startswith('#'):
22 | continue
23 | # A domain name is case-insensitive and
24 | # consists of several labels, separated by a full stop
25 | domain_labels = line.lower().split('.')
26 | results.append(domain_labels)
27 |
28 | # Sort results by domain labels' length
29 | results.sort(key=len)
30 | return results
31 |
32 | def find(labelses, removedDomainFile):
33 | ''' Find redundant items by a tree of top-level domain label to sub-level.
34 | `tree` is like { 'com': { 'foo: { 'bar': LEAF },
35 | 'abc': LEAF },
36 | 'org': ... }
37 | '''
38 |
39 | tree = {}
40 | LEAF = 1
41 | for labels in labelses:
42 | domain = '.'.join(labels)
43 | # Init root node as current node
44 | node = tree
45 | while len(labels) > 0:
46 | label = labels.pop()
47 | if label in node:
48 | # If child node is a LEAF node,
49 | # current domain must be an existed domain or a subdomain of an existed.
50 | if node[label] == LEAF:
51 | print(f"Redundant found: {domain} at {'.'.join(labels)}")
52 | with open(removedDomainFile, "a") as f:
53 | f.write(domain)
54 | f.write("\n")
55 | break
56 | else:
57 | # Create a leaf node if current label is last one
58 | if len(labels) == 0:
59 | node[label] = LEAF
60 | # Create a branch node
61 | else:
62 | node[label] = {}
63 | # Iterate to child node
64 | node = node[label]
65 |
66 | if __name__ == '__main__':
67 | find(load(sys.argv[1]), sys.argv[2])
68 |
--------------------------------------------------------------------------------
/resouces/bm7.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # 拉文件
4 | if [ ! -d rule ]; then
5 | git init
6 | git remote add origin https://github.com/blackmatrix7/ios_rule_script.git
7 | git config core.sparsecheckout true
8 | echo "rule/Clash" >>.git/info/sparse-checkout
9 | git pull --depth 1 origin master
10 | rm -rf .git
11 | fi
12 | # 移动文件/目录到同一文件夹
13 | list=($(find ./rule/Clash/ | awk -F '/' '{print $5}' | sed '/^$/d' | grep -v '\.' | sort -u))
14 | for ((i = 0; i < ${#list[@]}; i++)); do
15 | path=$(find ./rule/Clash/ -name ${list[i]})
16 | mv $path ./rule/Clash/
17 | done
18 |
19 | list=($(ls ./rule/Clash/))
20 | for ((i = 0; i < ${#list[@]}; i++)); do
21 | if [ -z "$(ls ./rule/Clash/${list[i]} | grep '.yaml')" ]; then
22 | directory=($(ls ./rule/Clash/${list[i]}))
23 | for ((x = 0; x < ${#directory[@]}; x++)); do
24 | mv ./rule/Clash/${list[i]}/${directory[x]} ./rule/Clash/${directory[x]}
25 | done
26 | rm -r ./rule/Clash/${list[i]}
27 | fi
28 | done
29 |
30 | list=($(ls ./rule/Clash/))
31 | for ((i = 0; i < ${#list[@]}; i++)); do
32 | if [ -f "./rule/Clash/${list[i]}/${list[i]}_Classical.yaml" ]; then
33 | mv ./rule/Clash/${list[i]}/${list[i]}_Classical.yaml ./rule/Clash/${list[i]}/${list[i]}.yaml
34 | fi
35 | done
36 |
37 | # 处理文件
38 | list=($(ls ./rule/Clash/))
39 | for ((i = 0; i < ${#list[@]}; i++)); do
40 | mkdir -p ${list[i]}
41 | # 归类
42 | # android package
43 | if [ -n "$(cat ./rule/Clash/${list[i]}/${list[i]}.yaml | grep -v '#' | grep PROCESS | grep -v '\.exe' | grep -v '/' | grep '\.')" ]; then
44 | cat ./rule/Clash/${list[i]}/${list[i]}.yaml | grep -v '#' | grep PROCESS | grep -v '\.exe' | grep -v '/' | grep '\.' | sed 's/ - PROCESS-NAME,//g' > ${list[i]}/package.json
45 | fi
46 | # process name
47 | if [ -n "$(cat ./rule/Clash/${list[i]}/${list[i]}.yaml | grep -v '#' | grep PROCESS | grep -v '/' | grep -v '\.')" ]; then
48 | cat ./rule/Clash/${list[i]}/${list[i]}.yaml | grep -v '#' | grep -v '#' | grep PROCESS | grep -v '/' | grep -v '\.' | sed 's/ - PROCESS-NAME,//g' > ${list[i]}/process.json
49 | fi
50 | if [ -n "$(cat ./rule/Clash/${list[i]}/${list[i]}.yaml | grep -v '#' | grep PROCESS | grep '\.exe')" ]; then
51 | cat ./rule/Clash/${list[i]}/${list[i]}.yaml | grep -v '#' | grep -v '#' | grep PROCESS | grep '\.exe' | sed 's/ - PROCESS-NAME,//g' >> ${list[i]}/process.json
52 | fi
53 | # domain
54 | if [ -n "$(cat ./rule/Clash/${list[i]}/${list[i]}.yaml | grep '\- DOMAIN-SUFFIX,')" ]; then
55 | cat ./rule/Clash/${list[i]}/${list[i]}.yaml | grep -v '#' | grep '\- DOMAIN-SUFFIX,' | sed 's/ - DOMAIN-SUFFIX,//g' > ${list[i]}/domain.json
56 | cat ./rule/Clash/${list[i]}/${list[i]}.yaml | grep -v '#' | grep '\- DOMAIN-SUFFIX,' | sed 's/ - DOMAIN-SUFFIX,/./g' > ${list[i]}/suffix.json
57 | fi
58 | if [ -n "$(cat ./rule/Clash/${list[i]}/${list[i]}.yaml | grep '\- DOMAIN,')" ]; then
59 | cat ./rule/Clash/${list[i]}/${list[i]}.yaml | grep -v '#' | grep '\- DOMAIN,' | sed 's/ - DOMAIN,//g' >> ${list[i]}/domain.json
60 | fi
61 | if [ -n "$(cat ./rule/Clash/${list[i]}/${list[i]}.yaml | grep '\- DOMAIN-KEYWORD,')" ]; then
62 | cat ./rule/Clash/${list[i]}/${list[i]}.yaml | grep -v '#' | grep '\- DOMAIN-KEYWORD,' | sed 's/ - DOMAIN-KEYWORD,//g' > ${list[i]}/keyword.json
63 | fi
64 | # ipcidr
65 | if [ -n "$(cat ./rule/Clash/${list[i]}/${list[i]}.yaml | grep '\- IP-CIDR')" ]; then
66 | cat ./rule/Clash/${list[i]}/${list[i]}.yaml | grep -v '#' | grep '\- IP-CIDR' | sed 's/ - IP-CIDR,//g' | sed 's/ - IP-CIDR6,//g' > ${list[i]}/ipcidr.json
67 | fi
68 | # 转成json格式
69 | # android package
70 | if [ -f "${list[i]}/package.json" ]; then
71 | sed -i 's/^/ "/g' ${list[i]}/package.json
72 | sed -i 's/$/",/g' ${list[i]}/package.json
73 | sed -i '1s/^/ "package_name": [\n/g' ${list[i]}/package.json
74 | sed -i '$ s/,$/\n ],/g' ${list[i]}/package.json
75 | fi
76 | # process name
77 | if [ -f "${list[i]}/process.json" ]; then
78 | sed -i 's/^/ "/g' ${list[i]}/process.json
79 | sed -i 's/$/",/g' ${list[i]}/process.json
80 | sed -i '1s/^/ "process_name": [\n/g' ${list[i]}/process.json
81 | sed -i '$ s/,$/\n ],/g' ${list[i]}/process.json
82 | fi
83 | # domain
84 | if [ -f "${list[i]}/domain.json" ]; then
85 | sed -i 's/^/ "/g' ${list[i]}/domain.json
86 | sed -i 's/$/",/g' ${list[i]}/domain.json
87 | sed -i '1s/^/ "domain": [\n/g' ${list[i]}/domain.json
88 | sed -i '$ s/,$/\n ],/g' ${list[i]}/domain.json
89 | fi
90 | if [ -f "${list[i]}/suffix.json" ]; then
91 | sed -i 's/^/ "/g' ${list[i]}/suffix.json
92 | sed -i 's/$/",/g' ${list[i]}/suffix.json
93 | sed -i '1s/^/ "domain_suffix": [\n/g' ${list[i]}/suffix.json
94 | sed -i '$ s/,$/\n ],/g' ${list[i]}/suffix.json
95 | fi
96 | if [ -f "${list[i]}/keyword.json" ]; then
97 | sed -i 's/^/ "/g' ${list[i]}/keyword.json
98 | sed -i 's/$/",/g' ${list[i]}/keyword.json
99 | sed -i '1s/^/ "domain_keyword": [\n/g' ${list[i]}/keyword.json
100 | sed -i '$ s/,$/\n ],/g' ${list[i]}/keyword.json
101 | fi
102 | # ipcidr
103 | if [ -f "${list[i]}/ipcidr.json" ]; then
104 | sed -i 's/^/ "/g' ${list[i]}/ipcidr.json
105 | sed -i 's/$/",/g' ${list[i]}/ipcidr.json
106 | sed -i '1s/^/ "ip_cidr": [\n/g' ${list[i]}/ipcidr.json
107 | sed -i '$ s/,$/\n ],/g' ${list[i]}/ipcidr.json
108 | fi
109 | # 合并文件
110 | if [ -f "${list[i]}/package.json" -a -f "${list[i]}/process.json" ]; then
111 | mv ${list[i]}/package.json ${list[i]}.json
112 | sed -i '$ s/,$/\n },\n {/g' ${list[i]}.json
113 | cat ${list[i]}/process.json >> ${list[i]}.json
114 | rm ${list[i]}/process.json
115 | elif [ -f "${list[i]}/package.json" ]; then
116 | mv ${list[i]}/package.json ${list[i]}.json
117 | elif [ -f "${list[i]}/process.json" ]; then
118 | mv ${list[i]}/process.json ${list[i]}.json
119 | fi
120 |
121 | if [ "$(ls ${list[i]})" = "" ]; then
122 | sed -i '1s/^/{\n "version": 1,\n "rules": [\n {\n/g' ${list[i]}.json
123 | elif [ -f "${list[i]}.json" ]; then
124 | sed -i '1s/^/{\n "version": 1,\n "rules": [\n {\n/g' ${list[i]}.json
125 | sed -i '$ s/,$/\n },\n {/g' ${list[i]}.json
126 | cat ${list[i]}/* >> ${list[i]}.json
127 | else
128 | cat ${list[i]}/* >> ${list[i]}.json
129 | sed -i '1s/^/{\n "version": 1,\n "rules": [\n {\n/g' ${list[i]}.json
130 | fi
131 | sed -i '$ s/,$/\n }\n ]\n}/g' ${list[i]}.json
132 | rm -r ${list[i]}
133 | ./sing-box rule-set compile ${list[i]}.json -o ${list[i]}.srs
134 | done
135 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## **下载地址**:
2 |
3 | | 文件名 | Github release | JSdelivr | JSdelivr-CF |
4 | |---------------------|---------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------|
5 | | country.mmdb | [下载](https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/country.mmdb) | [下载](https://cdn.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/country.mmdb) | [下载](https://testingcf.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/country.mmdb) |
6 | | geoip.dat | [下载](https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip.dat) | [下载](https://cdn.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geoip.dat) | [下载](https://testingcf.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geoip.dat) |
7 | | geoip.db | [下载](https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip.db) | [下载](https://cdn.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geoip.db) | [下载](https://testingcf.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geoip.db) |
8 | | geoip.metadb | [下载](https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip.metadb) | [下载](https://cdn.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geoip.metadb) | [下载](https://testingcf.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geoip.metadb) |
9 | | country-lite.mmdb | [下载](https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/country-lite.mmdb) | [下载](https://cdn.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/country-lite.mmdb) | [下载](https://testingcf.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/country-lite.mmdb) |
10 | | geoip-lite.dat | [下载](https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip-lite.dat) | [下载](https://cdn.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geoip-lite.dat) | [下载](https://testingcf.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geoip-lite.dat) |
11 | | geoip-lite.db | [下载](https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip-lite.db) | [下载](https://cdn.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geoip-lite.db) | [下载](https://testingcf.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geoip-lite.db) |
12 | | geosite.dat | [下载](https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geosite.dat) | [下载](https://cdn.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geosite.dat) | [下载](https://testingcf.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geosite.dat) |
13 | | geosite.db | [下载](https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geosite.db) | [下载](https://cdn.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geosite.db) | [下载](https://testingcf.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geosite.db) |
14 | | geosite-lite.dat | [下载](https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geosite-lite.dat) | [下载](https://cdn.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geosite-lite.dat) | [下载](https://testingcf.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geosite-lite.dat) |
15 | | geosite-lite.db | [下载](https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geosite-lite.db) | [下载](https://cdn.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geosite-lite.db) | [下载](https://testingcf.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geosite-lite.db) |
16 | | GeoLite2-ASN.mmdb | [下载](https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/GeoLite2-ASN.mmdb) | [下载](https://cdn.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/GeoLite2-ASN.mmdb) | [下载](https://testingcf.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/GeoLite2-ASN.mmdb) |
17 |
18 | ### **rule-set**
19 |
20 | mihomo:[meta branch](https://github.com/MetaCubeX/meta-rules-dat/tree/meta)
21 |
22 | sing-box: [sing branch](https://github.com/MetaCubeX/meta-rules-dat/tree/sing)
23 |
24 | ## **country.mmdb,geoip.dat,geoip.db 内容**
25 |
26 | 同 [Loyalsoldier/v2ray-rules-dat](https://github.com/Loyalsoldier/v2ray-rules-dat)
27 |
28 | - 新增类别(方便有特殊需求的用户使用):
29 | - `geoip:cloudflare`
30 | - `geoip:cloudfront`
31 | - `geoip:facebook`
32 | - `geoip:fastly`
33 | - `geoip:google`
34 | - `geoip:netflix`
35 | - `geoip:telegram`
36 | - `geoip:twitter`
37 |
38 | ## **country-lite.mmdb,geoip-lite.dat,geoip-lite.db 内容**
39 |
40 | 国家仅包含 CN/JP,精简体积,替换一些类别
41 |
42 | - 新增类别(方便有特殊需求的用户使用):
43 | - `geoip:cloudflare`
44 | - `geoip:cloudfront`
45 | - `geoip:facebook`
46 | - `geoip:bilibili`
47 | - `geoip:google`
48 | - `geoip:netflix`
49 | - `geoip:telegram`
50 | - `geoip:twitter`
51 | - `geoip:apple`
52 |
53 | ## **geosite.dat,geosite.db 内容**
54 |
55 | 用法同 [Loyalsoldier/v2ray-rules-dat](https://github.com/Loyalsoldier/v2ray-rules-dat)
56 |
57 | - `geosite:category-ads-all` 仅使用域名作为广告拦截用途作用有限,因此不作额外域名添加
58 | - `geosite:cn` 源替换为 [ios_rule_script/ChinaMax_Domain](https://github.com/blackmatrix7/ios_rule_script/tree/master/rule/Clash/ChinaMax)
59 | - `geosite:onedrive` 合并 [ios_rule_script/OneDrive](https://github.com/blackmatrix7/ios_rule_script/tree/master/rule/Clash/OneDrive)
60 | - `geosite:steam@cn` 合并 [ios_rule_script/SteamCN](https://github.com/blackmatrix7/ios_rule_script/tree/master/rule/Clash/SteamCN) 的内数据
61 | - 新增类别 - `geosite:biliintl` 来源 [biliintl](https://raw.githubusercontent.com/xishang0128/rules/main/biliintl.list) - `geosite:tracker` 来源 [TrackersList](https://trackerslist.com/#/zh)以及[blackmatrix7
62 | /
63 | ios_rule_script](https://github.com/blackmatrix7/ios_rule_script/tree/master/rule/Clash/PrivateTracker)
64 |
65 | ## **geosite-lite.dat,geosite-lite.db 内容**
66 |
67 | 仅包含常用集合,cn 为精简集合,可能不全
68 | 集合内容均来自 https://github.com/blackmatrix7/ios_rule_script/tree/master/rule/Clash
69 |
70 | 集合包含 `abema / apple / applemusic / bilibili / biliintl / bahamut / cn / ehentai / google / github / microsoft / netflix / openai / onedrive / pixiv / proxy / spotify / telegram / twitter / tiktok / youtube / proxymedia`
71 |
72 | ## **示例**
73 |
74 | ```yaml
75 | rule-providers:
76 | cn:
77 | behavior: domain
78 | interval: 86400
79 | path: ./provider/rule-set/cn_domain.yaml
80 | type: http
81 | url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/cn.yaml"
82 |
83 | rules:
84 | - RULE-SET,cn,DIRECT
85 | - GEOSITE,category-ads-all,REJECT
86 | - GEOSITE,private,DIRECT
87 | - GEOSITE,youtube,PROXY
88 | - GEOSITE,google,PROXY
89 | - GEOSITE,twitter,PROXY
90 | - GEOSITE,pixiv,PROXY
91 | - GEOSITE,category-scholar-!cn,PROXY
92 | - GEOSITE,biliintl,PROXY
93 | - GEOSITE,onedrive,DIRECT
94 | - GEOSITE,microsoft@cn,DIRECT
95 | - GEOSITE,apple-cn,DIRECT
96 | - GEOSITE,steam@cn,DIRECT
97 | - GEOSITE,category-games@cn,DIRECT
98 | - GEOSITE,geolocation-!cn,PROXY
99 | - GEOSITE,cn,DIRECT
100 |
101 | #GEOIP 规则
102 | - GEOIP,private,DIRECT,no-resolve
103 | - GEOIP,telegram,PROXY
104 | - GEOIP,JP,PROXY
105 | - GEOIP,CN,DIRECT
106 | - DST-PORT,80/8080/443/8443,PROXY
107 | - MATCH,DIRECT
108 | ```
109 |
110 | ## 辅助工具
111 |
112 | https://github.com/MetaCubeX/geo
113 |
114 | 🗺 An easy way to manage all your Geo resources.
115 |
116 | ## 致谢
117 |
118 | - [@Loyalsoldier/geoip](https://github.com/Loyalsoldier/geoip)
119 | - [@v2fly/domain-list-community](https://github.com/v2fly/domain-list-community)
120 | - [@Loyalsoldier/domain-list-custom](https://github.com/Loyalsoldier/domain-list-custom)
121 | - [@felixonmars/dnsmasq-china-list](https://github.com/felixonmars/dnsmasq-china-list)
122 | - [@gfwlist/gfwlist](https://github.com/gfwlist/gfwlist)
123 | - [@cokebar/gfwlist2dnsmasq](https://github.com/cokebar/gfwlist2dnsmasq)
124 | - [@Loyalsoldier/cn-blocked-domain](https://github.com/Loyalsoldier/cn-blocked-domain)
125 | - [@AdblockPlus/EasylistChina+Easylist.txt](https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt)
126 | - [@AdGuard/DNS-filter](https://kb.adguard.com/en/general/adguard-ad-filters#dns-filter)
127 | - [@PeterLowe/adservers](https://pgl.yoyo.org/adservers)
128 | - [@DanPollock/hosts](https://someonewhocares.org/hosts)
129 | - [@crazy-max/WindowsSpyBlocker](https://github.com/crazy-max/WindowsSpyBlocker)
130 | - [@blackmatrix7/ios_rule_script](https://github.com/blackmatrix7/ios_rule_script)
131 |
--------------------------------------------------------------------------------
/.github/workflows/run.yml:
--------------------------------------------------------------------------------
1 | name: Build rules dat files
2 | on:
3 | workflow_dispatch:
4 | schedule:
5 | - cron: "30 22 * * *" # 6:30 AM UTC+8
6 | push:
7 | branches:
8 | - master
9 | paths-ignore:
10 | - "**/README.md"
11 | jobs:
12 | build:
13 | runs-on: ubuntu-latest
14 | steps:
15 | - name: Set variables
16 | run: |
17 | echo "GOAMD64=v3" >> $GITHUB_ENV
18 | echo "BUILDTIME=$(TZ=Asia/Shanghai date +'%Y-%m-%d %H:%M')" >> $GITHUB_ENV
19 | echo "CHINA_DOMAINS_URL=https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/ChinaMax/ChinaMax_Domain.txt" >> $GITHUB_ENV
20 | echo "GOOGLE_DOMAINS_URL=https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/google.china.conf" >> $GITHUB_ENV
21 | echo "APPLE_DOMAINS_URL=https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/apple.china.conf" >> $GITHUB_ENV
22 | # echo "CUSTOM_DIRECT=https://raw.githubusercontent.com/Loyalsoldier/domain-list-custom/release/cn.txt" >> $GITHUB_ENV
23 | echo "CUSTOM_PROXY=https://raw.githubusercontent.com/Loyalsoldier/domain-list-custom/release/geolocation-!cn.txt" >> $GITHUB_ENV
24 | echo "WIN_SPY=https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/spy.txt" >> $GITHUB_ENV
25 | echo "WIN_UPDATE=https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/update.txt" >> $GITHUB_ENV
26 | echo "WIN_EXTRA=https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/extra.txt" >> $GITHUB_ENV
27 | shell: bash
28 |
29 | - name: Checkout
30 | uses: actions/checkout@v4
31 | with:
32 | repository: MetaCubeX/meta-rules-dat
33 |
34 | - name: Checkout Loyalsoldier/domain-list-custom
35 | uses: actions/checkout@v4
36 | with:
37 | repository: Loyalsoldier/domain-list-custom
38 | path: custom
39 |
40 | - name: Checkout v2fly/domain-list-community
41 | uses: actions/checkout@v4
42 | with:
43 | repository: v2fly/domain-list-community
44 | path: community
45 |
46 | - name: Checkout MetaCubeX/meta-rules-converter
47 | uses: actions/checkout@v4
48 | with:
49 | repository: MetaCubeX/meta-rules-converter
50 | path: convert
51 |
52 | - name: Checkout cokebar/gfwlist2dnsmasq
53 | uses: actions/checkout@v4
54 | with:
55 | repository: cokebar/gfwlist2dnsmasq
56 | path: gfwlist2dnsmasq
57 |
58 | - name: Setup Go
59 | uses: actions/setup-go@v5
60 | with:
61 | go-version: '1.22'
62 | cache-dependency-path: ./custom/go.sum
63 |
64 | - name: Generate GFWList domains
65 | run: |
66 | cd gfwlist2dnsmasq || exit 1
67 | chmod +x ./gfwlist2dnsmasq.sh
68 | ./gfwlist2dnsmasq.sh -l -o ./temp-gfwlist.txt
69 |
70 | - name: Get and add direct domains into temp-direct.txt file
71 | run: |
72 | curl -sSL ${CHINA_DOMAINS_URL} | sed '/^\s*#/d' | sed '/^[^\.]/ s/^/full:/' | sed 's/^\.\([^.]*\)/\1/' > temp-direct.txt
73 | # curl -sSL ${CUSTOM_DIRECT} | perl -ne '/^(domain):([^:]+)(\n$|:@.+)/ && print "$2\n"' >> temp-direct.txt
74 |
75 | - name: Get and add proxy domains into temp-proxy.txt file
76 | run: |
77 | cat ./gfwlist2dnsmasq/temp-gfwlist.txt | perl -ne '/^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/ && print "$1\n"' > temp-proxy.txt
78 | curl -sSL $GOOGLE_DOMAINS_URL | perl -ne '/^server=\/([^\/]+)\// && print "$1\n"' >> temp-proxy.txt
79 | curl -sSL $APPLE_DOMAINS_URL | perl -ne '/^server=\/([^\/]+)\// && print "$1\n"' >> temp-proxy.txt
80 | curl -sSL ${CUSTOM_PROXY} | grep -Ev ":@cn" | perl -ne '/^(domain):([^:]+)(\n$|:@.+)/ && print "$2\n"' >> temp-proxy.txt
81 |
82 | - name: Reserve `full`, `regexp` and `keyword` type of rules from custom lists to "reserve" files
83 | run: |
84 | # curl -sSL ${CUSTOM_DIRECT} | grep -v google | grep -v manhua | grep -v ooklaserver | grep -v "acg.rip" | perl -ne '/^((full|regexp|keyword):[^:]+)(\n$|:@.+)/ && print "$1\n"' | sort --ignore-case -u > direct-reserve.txt
85 | curl -sSL ${CUSTOM_PROXY} | grep -Ev ":@cn" | perl -ne '/^((full|regexp|keyword):[^:]+)(\n$|:@.+)/ && print "$1\n"' | sort --ignore-case -u > proxy-reserve.txt
86 |
87 | - name: Add proxy, direct and reject domains from "hidden" branch to appropriate temp files
88 | run: |
89 | cat ./resouces/proxy.txt >> temp-proxy.txt
90 | cat ./resouces/direct.txt >> temp-direct.txt
91 | # cat reject.txt >> temp-reject.txt
92 |
93 | - name: Sort and generate redundant lists
94 | run: |
95 | cat temp-proxy.txt | sort --ignore-case -u > proxy-list-with-redundant
96 | cat temp-direct.txt | sort --ignore-case -u > direct-list-with-redundant
97 | # cat temp-reject.txt | sort --ignore-case -u > reject-list-with-redundant
98 |
99 | - name: Remove redundant domains
100 | run: |
101 | chmod +x ./resouces/*.py
102 | python ./resouces/findRedundantDomain.py ./direct-list-with-redundant ./direct-list-deleted-unsort
103 | python ./resouces/findRedundantDomain.py ./proxy-list-with-redundant ./proxy-list-deleted-unsort
104 | [ ! -f "direct-list-deleted-unsort" ] && touch direct-list-deleted-unsort
105 | [ ! -f "proxy-list-deleted-unsort" ] && touch proxy-list-deleted-unsort
106 | sort ./direct-list-deleted-unsort > ./direct-list-deleted-sort
107 | sort ./proxy-list-deleted-unsort > ./proxy-list-deleted-sort
108 | python ./resouces/removeFrom.py -remove ./direct-list-deleted-sort -from ./direct-list-with-redundant -out direct-list-without-redundant
109 | python ./resouces/removeFrom.py -remove ./proxy-list-deleted-sort -from ./proxy-list-with-redundant -out proxy-list-without-redundant
110 |
111 | - name: Remove domains from "need-to-remove" lists in "hidden" branch
112 | run: |
113 | python ./resouces/removeFrom.py -remove ./resouces/direct-need-to-remove.txt -from ./direct-list-without-redundant -out ./temp-cn.txt
114 | python ./resouces/removeFrom.py -remove ./resouces/proxy-need-to-remove.txt -from ./proxy-list-without-redundant -out ./temp-geolocation-\!cn.txt
115 |
116 | - name: Remove domains end with ".cn" in "temp-geolocation-!cn.txt" and write lists to data directory
117 | run: |
118 | cat temp-cn.txt | grep -v google | grep -v manhua | grep -v ooklaserver | grep -v "acg.rip" | sort --ignore-case -u | perl -ne '/^((?=^.{1,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})*)/ && print "$1\n"' > ./community/data/cn
119 | cat temp-cn.txt | sort --ignore-case -u | perl -ne 'print if not /^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/' > direct-tld-list.txt
120 | cat temp-geolocation-\!cn.txt | sort --ignore-case -u | perl -ne '/^((?=^.{1,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})*)/ && print "$1\n"' | perl -ne 'print if not /\.cn$/' > ./community/data/geolocation-\!cn
121 | cat temp-geolocation-\!cn.txt | sort --ignore-case -u | perl -ne 'print if not /^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/' > proxy-tld-list.txt
122 |
123 | - name: Add `full`, `regexp` and `keyword` type of rules back into "cn", and "geolocation-!cn" list
124 | run: |
125 | [ -f "direct-reserve.txt" ] && cat direct-reserve.txt >> ./community/data/cn
126 | [ -f "proxy-reserve.txt" ] && cat proxy-reserve.txt >> ./community/data/geolocation-\!cn
127 | cp ./community/data/cn direct-list.txt
128 | cp ./community/data/geolocation-\!cn proxy-list.txt
129 |
130 | - name: Create `google-cn`、`apple-cn`、`gfw` lists
131 | run: |
132 | curl -sSL $GOOGLE_DOMAINS_URL | perl -ne '/^server=\/([^\/]+)\// && print "full:$1\n"' > ./community/data/google-cn
133 | curl -sSL $APPLE_DOMAINS_URL | perl -ne '/^server=\/([^\/]+)\// && print "full:$1\n"' > ./community/data/apple-cn
134 | cat ./gfwlist2dnsmasq/temp-gfwlist.txt | perl -ne '/^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/ && print "$1\n"' >> ./community/data/gfw
135 | curl -sSL $WIN_SPY | grep "0.0.0.0" | awk '{print $2}' > ./community/data/win-spy
136 | curl -sSL $WIN_UPDATE | grep "0.0.0.0" | awk '{print $2}' > ./community/data/win-update
137 | curl -sSL $WIN_EXTRA | grep "0.0.0.0" | awk '{print $2}' > ./community/data/win-extra
138 |
139 | - name: merge 'ios_rule_script/SteamCN'
140 | env:
141 | SED: sed '/^\s*#/d' | sed 's/DOMAIN,//g' | sed 's/DOMAIN-SUFFIX,//g' | sed 's/DOMAIN-KEYWORD,/keyword:/g'
142 | run: |
143 | curl -sSL https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/SteamCN/SteamCN.list | ${{ env.SED }} > steamcn.txt
144 | while read line; do grep -q "$line @cn" ./community/data/steam || sed -i "/$line/ s/$/ @cn/" ./community/data/steam; done < steamcn.txt
145 | cat ./community/data/steam
146 |
147 | - name: Add data for `meta`
148 | env:
149 | SED: sed '/^\s*#/d' | sed 's/^PROCESS-NAME,//' | sed 's/DOMAIN,/full:/g' | sed 's/DOMAIN-SUFFIX,//g' | sed 's/DOMAIN-KEYWORD,/keyword:/g' | sed '/^\s*IP-CIDR/d'
150 | run: |
151 | curl -sSL https://raw.githubusercontent.com/xishang0128/rules/main/biliintl.list > ./community/data/biliintl
152 | curl -sSL https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/OneDrive/OneDrive.list | ${{ env.SED }} > ./community/data/onedrive
153 | echo "sharepoint.cn" >> ./community/data/onedrive
154 | curl -sSL https://raw.githubusercontent.com/xishang0128/rules/main/sharepoint.list > ./community/data/sharepoint
155 | curl -sSL https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/PrivateTracker/PrivateTracker.list | ${{ env.SED }} > ./community/data/tracker
156 | curl -sSL https://gitea.com/XIU2/TrackersListCollection/raw/branch/master/all.txt | grep -i "\.[A-Z]" | grep -v tracker | sed 's/^.*\/\///g' | sed 's/:.*\/.*//g' >> ./community/data/tracker
157 | curl -sSL https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/BlockHttpDNS/BlockHttpDNS.list | ${{ env.SED }} > ./community/data/httpdns
158 |
159 | - name: Build geosite.dat file
160 | run: |
161 | cd custom || exit 1
162 | # echo sentry.io >> ../community/data/openai
163 | echo ipleak.net >> ../community/data/geolocation-\!cn && echo browserleaks.org >> ../community/data/geolocation-\!cn
164 | go run ./ --datapath=../community/data
165 |
166 | - name: Build geosite-lite.dat file
167 | env:
168 | NO_SKIP: true
169 | SED: grep DOMAIN | grep -v "#" | sed 's/ - DOMAIN,/full:/g' | sed 's/ - DOMAIN-SUFFIX,//g' | sed 's/ - DOMAIN-KEYWORD,/keyword:/g'
170 | run: |
171 | cd community || exit 1
172 | mkdir -p data-lite
173 | curl -sSL https://raw.githubusercontent.com/xishang0128/rules/main/biliintl.list > ./data-lite/biliintl
174 | curl -sSL https://github.com/v2fly/domain-list-community/raw/master/data/ehentai > ./data-lite/ehentai
175 | curl -sSL https://github.com/v2fly/domain-list-community/raw/master/data/private > ./data-lite/private
176 |
177 | curl -sSL https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/AbemaTV/AbemaTV.yaml | ${{ env.SED }} > ./data-lite/abema
178 | curl -sSL https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/Apple/Apple_Classical.yaml | ${{ env.SED }} > ./data-lite/apple
179 | curl -sSL https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/AppleMusic/AppleMusic.yaml | ${{ env.SED }} > ./data-lite/applemusic
180 | curl -sSL https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/BiliBili/BiliBili.yaml | ${{ env.SED }} > ./data-lite/bilibili
181 | curl -sSL https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/Bahamut/Bahamut.yaml | ${{ env.SED }} > ./data-lite/bahamut
182 |
183 | curl -sSL https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/China/China_Domain.yaml | grep - | sed "s/ - '+.//g" | sed "s/ - '/full:/g" | grep -v "#" | grep -v "acg.rip" | sed "s/'//g" > ./data-lite/cn
184 | curl -sSL https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/Cloudflare/Cloudflare.yaml | ${{ env.SED }} > ./data-lite/cloudflare
185 | curl -sSL https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/Google/Google.yaml | ${{ env.SED }} > ./data-lite/google
186 | curl -sSL https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/GitHub/GitHub.yaml | ${{ env.SED }} > ./data-lite/github
187 | curl -sSL https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/Microsoft/Microsoft.yaml | ${{ env.SED }} > ./data-lite/microsoft
188 | curl -sSL https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/Netflix/Netflix.yaml | ${{ env.SED }} > ./data-lite/netflix
189 | curl -sSL https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/OpenAI/OpenAI.yaml | ${{ env.SED }} > ./data-lite/openai
190 | curl -sSL https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/OneDrive/OneDrive.yaml | ${{ env.SED }} > ./data-lite/onedrive
191 | curl -sSL https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/Pixiv/Pixiv.yaml | ${{ env.SED }} > ./data-lite/pixiv
192 | curl -sSL https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/ProxyLite/ProxyLite.yaml | ${{ env.SED }} > ./data-lite/proxy
193 | curl -sSL https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/Spotify/Spotify.yaml | ${{ env.SED }} > ./data-lite/spotify
194 | curl -sSL https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/Telegram/Telegram.yaml | ${{ env.SED }} > ./data-lite/telegram
195 | curl -sSL https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/Twitter/Twitter.yaml | ${{ env.SED }} > ./data-lite/twitter
196 | curl -sSL https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/TikTok/TikTok.yaml | ${{ env.SED }} > ./data-lite/tiktok
197 | curl -sSL https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/YouTube/YouTube.yaml | ${{ env.SED }} > ./data-lite/youtube
198 | curl -sSL https://github.com/blackmatrix7/ios_rule_script/raw/master/rule/Clash/GlobalMedia/GlobalMedia.yaml | ${{ env.SED }} > ./data-lite/proxymedia
199 |
200 | echo include:google >> ./data-lite/proxy && echo include:github >> ./data-lite/proxy && echo include:netflix >> ./data-lite/proxy
201 | echo ipleak.net >> ./data-lite/proxy && echo browserleaks.org >> ./data-lite/proxy
202 | echo "full:o33249.ingest.sentry.io" >> ./data-lite/openai
203 | echo "openai.com" >> ./data-lite/openai
204 | go run ./ --datapath=./data-lite --outputname geosite-lite.dat
205 |
206 | - name: Get geoip.dat relative files
207 | run: |
208 | wget -O geoip-lite.dat https://github.com/xishang0128/geoip/raw/release/geoip.dat
209 | wget https://github.com/Loyalsoldier/geoip/raw/release/geoip.dat
210 |
211 | - name: Build db and metadb file
212 | env:
213 | NO_SKIP: true
214 | run: |
215 | go install -trimpath -ldflags="-s -w -buildid=" github.com/metacubex/geo/cmd/geo@master
216 | geo convert site -i v2ray -o sing -f geosite.db ./custom/publish/geosite.dat
217 | geo convert site -i v2ray -o sing -f geosite-lite.db ./community/geosite-lite.dat
218 | geo convert ip -i v2ray -o sing -f geoip.db ./geoip.dat
219 | geo convert ip -i v2ray -o meta -f geoip.metadb ./geoip.dat
220 | geo convert ip -i v2ray -o sing -f geoip-lite.db ./geoip-lite.dat
221 | geo convert ip -i v2ray -o meta -f geoip-lite.metadb ./geoip-lite.dat
222 |
223 | - name: Convert geo to sing-rule-set
224 | env:
225 | NO_SKIP: true
226 | run: |
227 | mkdir -p sing-rule/geo/geosite && mkdir -p sing-rule/geo/geoip
228 | cd convert
229 | go run ./ geosite -f ../custom/publish/geosite.dat -o ../sing-rule/geo/geosite -t sing-box
230 | go run ./ geoip -f ../geoip.dat -o ../sing-rule/geo/geoip -t sing-box
231 |
232 | - name: Convert geo-lite to sing-rule-set
233 | env:
234 | NO_SKIP: true
235 | run: |
236 | mkdir -p sing-rule/geo-lite/geosite && mkdir -p sing-rule/geo-lite/geoip
237 | cd convert
238 | go run ./ geosite -f ../community/geosite-lite.dat -o ../sing-rule/geo-lite/geosite -t sing-box
239 | go run ./ geoip -f ../geoip-lite.dat -o ../sing-rule/geo-lite/geoip -t sing-box
240 |
241 | - name: Convert geo to meta-rule-set
242 | env:
243 | NO_SKIP: true
244 | run: |
245 | mkdir -p meta-rule/geo/geosite && mkdir -p meta-rule/geo/geoip
246 | cd convert
247 | go run ./ geosite -f ../custom/publish/geosite.dat -o ../meta-rule/geo/geosite
248 | go run ./ geoip -f ../geoip.dat -o ../meta-rule/geo/geoip
249 |
250 | - name: Convert geo-lite to meta-rule-set
251 | env:
252 | NO_SKIP: true
253 | run: |
254 | mkdir -p meta-rule/geo-lite/geosite && mkdir -p meta-rule/geo-lite/geoip
255 | cd convert
256 | go run ./ geosite -f ../community/geosite-lite.dat -o ../meta-rule/geo-lite/geosite
257 | go run ./ geoip -f ../geoip-lite.dat -o ../meta-rule/geo-lite/geoip
258 |
259 | - name: Convert asn
260 | env:
261 | NO_SKIP: true
262 | run: |
263 | mkdir -p meta-rule/asn && mkdir -p sing-rule/asn
264 | cd convert
265 | wget https://raw.githubusercontent.com/xishang0128/geoip/release/GeoLite2-ASN.mmdb
266 | go run ./ asn -o ../meta-rule/asn
267 | go run ./ asn -o ../sing-rule/asn -t sing-box
268 |
269 | # - name: Convert bm7-rule-set to sing-rule-set
270 | # env:
271 | # NO_SKIP: true
272 | # run: |
273 | # mkdir -p ./sing-rule/bm7
274 | # cp ./resouces/bm7.sh ./sing-rule/bm7/
275 | # cd ./sing-rule/bm7
276 | # wget https://github.com/SagerNet/sing-box/releases/download/v1.8.0-alpha.1/sing-box-1.8.0-alpha.1-linux-amd64.tar.gz -O sing-box.tar.gz && tar zxvf sing-box.tar.gz && mv sing-box-1.8.0-alpha.1-linux-amd64/sing-box ./ && rm -r sing-box-1.8.0-alpha.1-linux-amd64
277 | # ls
278 | # chmod 755 bm7.sh && ./bm7.sh
279 | # rm -r bm7.sh sing-box* rule
280 |
281 | - name: Move and zip files
282 | run: |
283 | mkdir -p ./publish/
284 | wget https://raw.githubusercontent.com/xishang0128/geoip/release/Country.mmdb -O ./publish/country-lite.mmdb
285 | wget https://raw.githubusercontent.com/Loyalsoldier/geoip/release/Country.mmdb -O ./publish/country.mmdb
286 | wget https://raw.githubusercontent.com/xishang0128/geoip/release/GeoLite2-ASN.mmdb -O ./publish/GeoLite2-ASN.mmdb
287 | install -Dp ./geoip-lite.dat ./publish/
288 | install -Dp ./geoip.dat ./publish/
289 | install -Dp ./custom/publish/geosite.dat ./publish/
290 | install -Dp ./community/geosite-lite.dat ./publish/
291 | install -Dp ./geosite.db ./publish/
292 | install -Dp ./geosite-lite.db ./publish/
293 | install -Dp ./geoip.db ./publish/
294 | install -Dp ./geoip-lite.db ./publish/
295 | install -Dp ./geoip.metadb ./publish/
296 | install -Dp ./geoip-lite.metadb ./publish/
297 | cd ./publish || exit 1
298 | sha256sum country.mmdb > country.mmdb.sha256sum
299 | sha256sum country-lite.mmdb > country-lite.mmdb.sha256sum
300 | sha256sum geoip-lite.dat > geoip-lite.dat.sha256sum
301 | sha256sum geoip.dat > geoip.dat.sha256sum
302 | sha256sum geosite.dat > geosite.dat.sha256sum
303 | sha256sum geosite-lite.dat > geosite-lite.dat.sha256sum
304 | sha256sum geosite.db > geosite.db.sha256sum
305 | sha256sum geosite-lite.db > geosite-lite.db.sha256sum
306 | sha256sum geoip.db > geoip.db.sha256sum
307 | sha256sum geoip-lite.db > geoip-lite.db.sha256sum
308 | sha256sum geoip.metadb > geoip.metadb.sha256sum
309 | sha256sum geoip-lite.metadb > geoip-lite.metadb.sha256sum
310 | sha256sum GeoLite2-ASN.mmdb > GeoLite2-ASN.mmdb.sha256sum
311 |
312 | - name: Delete current release assets
313 | uses: andreaswilli/delete-release-assets-action@v3.0.0
314 | with:
315 | github_token: ${{ secrets.GITHUB_TOKEN }}
316 | tag: latest
317 | deleteOnlyFromDrafts: false
318 |
319 | - name: Create and Upload Release
320 | id: upload_release
321 | uses: svenstaro/upload-release-action@v2
322 | with:
323 | repo_token: ${{ secrets.GITHUB_TOKEN }}
324 | release_name: Release ${{ env.BUILDTIME }}
325 | tag: latest
326 | file_glob: true
327 | overwrite: true
328 | file: ./publish/*
329 |
330 | - name: Git push assets to "release" branch
331 | run: |
332 | cd publish || exit 1
333 | git init
334 | git config --local user.name "github-actions[bot]"
335 | git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
336 | git checkout -b release
337 | git add .
338 | git commit -m "Released on ${{ env.BUILDTIME }}"
339 | git remote add origin "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}"
340 | git push -f -u origin release
341 |
342 | - name: Git push assets to "sing-rule" branch
343 | run: |
344 | cd sing-rule || exit 1
345 | git init
346 | git config --local user.name "github-actions[bot]"
347 | git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
348 | git checkout -b sing
349 | git add .
350 | git commit -m "Released on ${{ env.BUILDTIME }}"
351 | git remote add origin "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}"
352 | git push -f -u origin sing
353 |
354 | - name: Git push assets to "meta-rule" branch
355 | run: |
356 | cd meta-rule || exit 1
357 | git init
358 | git config --local user.name "github-actions[bot]"
359 | git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
360 | git checkout -b meta
361 | git add .
362 | git commit -m "Released on ${{ env.BUILDTIME }}"
363 | git remote add origin "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}"
364 | git push -f -u origin meta
365 |
366 |
367 | - name: Purge jsdelivr CDN
368 | run: |
369 | cd publish || exit 1
370 | for file in $(ls); do
371 | curl -i "https://purge.jsdelivr.net/gh/${{ github.repository }}@release/${file}"
372 | done
373 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------