v2fly-domain-list-community/README.md

121 lines
4.6 KiB
Markdown
Raw Normal View History

2018-12-08 10:13:40 +02:00
# Domain list community
2018-08-20 21:42:51 +03:00
2018-12-08 10:13:40 +02:00
This project manages a list of domains, to be used as geosites for routing purpose in Project V.
2018-08-20 21:42:51 +03:00
2018-12-08 10:20:53 +02:00
## Purpose of this project
2020-02-08 09:58:08 +02:00
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.
2018-12-08 10:20:53 +02:00
## Download links
- **dlc.dat**[https://github.com/v2ray/domain-list-community/raw/release/dlc.dat](https://github.com/v2ray/domain-list-community/raw/release/dlc.dat)
- **dlc.dat.sha256sum**[https://github.com/v2ray/domain-list-community/raw/release/dlc.dat.sha256sum](https://github.com/v2ray/domain-list-community/raw/release/dlc.dat.sha256sum)
2020-04-23 05:04:38 +03:00
## Usage example
Each file in the `data/` directory can be used as a rule in this format: `geosite:filename`.
```json
"routing": {
"domainStrategy": "IPIfNonMatch",
"rules": [
{
"type": "field",
"outboundTag": "Reject",
"domain": [
"geosite:category-ads-all",
"geosite:category-porn"
]
},
{
"type": "field",
"outboundTag": "Direct",
"domain": [
"domain:v2ex.com",
"domain:icloud.com",
"domain:icloud-content.com",
"domain:cdn-apple.com",
"geosite:jsdelivr",
"geosite:cn"
]
},
{
"type": "field",
"outboundTag": "Proxy-1",
"domain": [
"geosite:category-anticensorship",
"geosite:category-media",
"geosite:category-vpnservices"
]
},
{
"type": "field",
"outboundTag": "Proxy-2",
"domain": [
"geosite:category-dev"
]
},
{
"type": "field",
"outboundTag": "Proxy-3",
"domain": [
"geosite:geolocation-!cn"
]
}
]
}
```
2018-08-20 21:42:51 +03:00
## Structure of data
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.
```
# comments
include:another-file
2018-12-08 10:13:40 +02:00
domain:google.com @attr1 @att2
2018-08-20 21:42:51 +03:00
keyword:google
regex:www\.google\.com
2018-08-21 22:44:20 +03:00
full:www.google.com
2018-08-20 21:42:51 +03:00
```
Syntax:
2020-01-06 08:56:55 +02:00
* Comment begins with `#`. It may begin anywhere in the file. The content in the line after `#` is treated as comment and ignored in production.
2018-08-20 21:42:51 +03:00
* Inclusion begins with `include:`, followed by the file name of an existing file in the same directory.
* Subdomain begins with `domain:`, followed by a valid domain name. The prefix `domain:` may be omitted.
2020-01-06 08:56:55 +02:00
* Keyword begins with `keyword:`, followed by a string.
2018-08-20 21:42:51 +03:00
* Regular expression begins with `regex:`, followed by a valid regular expression (per Golang's standard).
2020-02-08 09:58:08 +02:00
* Full domain begins with `full:`, followed by a complete and valid domain name.
* Domains (including `domain`, `keyword`, `regex` and `full`) may have one or more attributes. Each attribute begins with `@` and followed by the name of the attribute.
2018-08-20 21:42:51 +03:00
## How it works
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.
To generate a section:
1. Remove all the comments in the file.
2020-01-06 08:56:55 +02:00
2. Replace `include:` lines with the actual content of the file.
3. Omit all empty lines.
4. Generate each `domain:` line into a [sub-domain routing rule](https://github.com/v2ray/v2ray-core/blob/master/app/router/config.proto#L21).
5. Generate each `keyword:` line into a [plain domain routing rule](https://github.com/v2ray/v2ray-core/blob/master/app/router/config.proto#L17).
2020-02-08 09:58:08 +02:00
6. Generate each `regex:` line into a [regex domain routing rule](https://github.com/v2ray/v2ray-core/blob/master/app/router/config.proto#L19).
7. Generate each `full:` line into a [full domain routing rule](https://github.com/v2ray/v2ray-core/blob/master/app/router/config.proto#L23).
2018-08-20 21:42:51 +03:00
2020-01-06 08:56:55 +02:00
## How to organize domains
2018-08-20 21:42:51 +03:00
2018-12-08 10:13:40 +02:00
### File name
2020-01-06 08:56:55 +02:00
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".
2018-12-08 10:13:40 +02:00
### Attributes
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.
2018-08-20 21:42:51 +03:00
## Contribution guideline
* Please begin with small size PRs, say modification in a single file.
* A PR must be reviewed and approved by another member.
2020-02-08 09:58:08 +02:00
* After a few successful PRs, you may apply for manager access of this repository.