Skip to content

Commit 3e71c36

Browse files
author
Lune
committed
Import default template
0 parents  commit 3e71c36

File tree

6 files changed

+1167
-0
lines changed

6 files changed

+1167
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.idea

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018-2019 V2Ray
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+134
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
# Domain list community
2+
3+
This project manages a list of domains, to be used as geosites for routing purpose in Project V.
4+
5+
## Purpose of this project
6+
7+
This project is not opinionated. In other words, it does NOT endorse, claim or imply that a domain should be blocked or proxied. It can be used to generate routing rules on demand.
8+
9+
## Download links
10+
11+
- **dlc.dat**[https://github.com/v2fly/domain-list-community/releases/latest/download/dlc.dat](https://github.com/v2fly/domain-list-community/releases/latest/download/dlc.dat)
12+
- **dlc.dat.sha256sum**[https://github.com/v2fly/domain-list-community/releases/latest/download/dlc.dat.sha256sum](https://github.com/v2fly/domain-list-community/releases/latest/download/dlc.dat.sha256sum)
13+
14+
## Usage example
15+
16+
Each file in the `data` directory can be used as a rule in this format: `geosite:filename`.
17+
18+
```json
19+
"routing": {
20+
"domainStrategy": "IPIfNonMatch",
21+
"rules": [
22+
{
23+
"type": "field",
24+
"outboundTag": "Reject",
25+
"domain": [
26+
"geosite:category-ads-all",
27+
"geosite:category-porn"
28+
]
29+
},
30+
{
31+
"type": "field",
32+
"outboundTag": "Direct",
33+
"domain": [
34+
"domain:icloud.com",
35+
"domain:icloud-content.com",
36+
"domain:cdn-apple.com",
37+
"geosite:cn",
38+
"geosite:private"
39+
]
40+
},
41+
{
42+
"type": "field",
43+
"outboundTag": "Proxy-1",
44+
"domain": [
45+
"geosite:category-anticensorship",
46+
"geosite:category-media",
47+
"geosite:category-vpnservices"
48+
]
49+
},
50+
{
51+
"type": "field",
52+
"outboundTag": "Proxy-2",
53+
"domain": [
54+
"geosite:category-dev"
55+
]
56+
},
57+
{
58+
"type": "field",
59+
"outboundTag": "Proxy-3",
60+
"domain": [
61+
"geosite:geolocation-!cn"
62+
]
63+
}
64+
]
65+
}
66+
```
67+
68+
## Generate `dlc.dat` manually
69+
70+
- Install `golang` and `git`
71+
- Clone project code: `git clone https://github.com/v2fly/domain-list-community.git`
72+
- Navigate to project root directory: `cd domain-list-community`
73+
- Install project dependencies: `go mod download`
74+
- Generate `dlc.dat` (without `datapath` option means to use domain lists in `data` directory of current working directory):
75+
- `go run ./`
76+
- `go run ./ --datapath=/path/to/your/custom/data/directory`
77+
78+
Run `go run ./ --help` for more usage information.
79+
80+
## Structure of data
81+
82+
All data are under `data` directory. Each file in the directory represents a sub-list of domains, named by the file name. File content is in the following format.
83+
84+
```
85+
# comments
86+
include:another-file
87+
domain:google.com @attr1 @attr2
88+
keyword:google
89+
regexp:www\.google\.com$
90+
full:www.google.com
91+
```
92+
93+
**Syntax:**
94+
95+
> The following types of rules are **NOT** fully compatible with the ones that defined by user in V2Ray config file. Do **Not** copy and paste directly.
96+
97+
* Comment begins with `#`. It may begin anywhere in the file. The content in the line after `#` is treated as comment and ignored in production.
98+
* Inclusion begins with `include:`, followed by the file name of an existing file in the same directory.
99+
* Subdomain begins with `domain:`, followed by a valid domain name. The prefix `domain:` may be omitted.
100+
* Keyword begins with `keyword:`, followed by a string.
101+
* Regular expression begins with `regexp:`, followed by a valid regular expression (per Golang's standard).
102+
* Full domain begins with `full:`, followed by a complete and valid domain name.
103+
* Domains (including `domain`, `keyword`, `regexp` and `full`) may have one or more attributes. Each attribute begins with `@` and followed by the name of the attribute.
104+
105+
## How it works
106+
107+
The entire `data` directory will be built into an external `geosite` file for Project V. Each file in the directory represents a section in the generated file.
108+
109+
To generate a section:
110+
111+
1. Remove all the comments in the file.
112+
2. Replace `include:` lines with the actual content of the file.
113+
3. Omit all empty lines.
114+
4. Generate each `domain:` line into a [sub-domain routing rule](https://github.com/v2fly/v2ray-core/blob/master/app/router/config.proto#L21).
115+
5. Generate each `keyword:` line into a [plain domain routing rule](https://github.com/v2fly/v2ray-core/blob/master/app/router/config.proto#L17).
116+
6. Generate each `regexp:` line into a [regex domain routing rule](https://github.com/v2fly/v2ray-core/blob/master/app/router/config.proto#L19).
117+
7. Generate each `full:` line into a [full domain routing rule](https://github.com/v2fly/v2ray-core/blob/master/app/router/config.proto#L23).
118+
119+
## How to organize domains
120+
121+
### File name
122+
123+
Theoretically any string can be used as the name, as long as it is a valid file name. In practice, we prefer names for determinic group of domains, such as the owner (usually a company name) of the domains, e.g., "google", "netflix". Names with unclear scope are generally unrecommended, such as "evil", or "local".
124+
125+
### Attributes
126+
127+
Attribute is useful for sub-group of domains, especially for filtering purpose. For example, the list of `google` domains may contains its main domains, as well as domains that serve ads. The ads domains may be marked by attribute `@ads`, and can be used as `geosite:google@ads` in V2Ray routing.
128+
129+
## Contribution guideline
130+
131+
* Fork this repo, make modifications to your own repo, file a PR.
132+
* Please begin with small size PRs, say modification in a single file.
133+
* A PR must be reviewed and approved by another member.
134+
* After a few successful PRs, you may apply for manager access to this repository.

go.mod

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module github.com/v2fly/domain-list-community
2+
3+
go 1.17
4+
5+
require (
6+
github.com/v2fly/v2ray-core/v4 v4.43.0
7+
google.golang.org/protobuf v1.27.1
8+
)
9+
10+
require (
11+
github.com/golang/protobuf v1.5.2 // indirect
12+
github.com/pires/go-proxyproto v0.6.1 // indirect
13+
go.starlark.net v0.0.0-20210901212718-87f333178d59 // indirect
14+
go4.org/intern v0.0.0-20210108033219-3eb7198706b2 // indirect
15+
go4.org/unsafe/assume-no-moving-gc v0.0.0-20201222180813-1025295fd063 // indirect
16+
golang.org/x/sys v0.0.0-20210903071746-97244b99971b // indirect
17+
inet.af/netaddr v0.0.0-20210903134321-85fa6c94624e // indirect
18+
)

0 commit comments

Comments
 (0)