| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- {
- "api": {
- "url": "https://example.com/api/domains",
- "method": "GET",
- "headers": {
- "Authorization": "Bearer <token>"
- },
- "params": {
- "page": 1
- },
- "body": null,
- "timeout_sec": 10
- },
- "parser": {
- "field_paths": [
- "data.good[].ip"
- ],
- "json_paths": [],
- "regex": "[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}"
- },
- "record_mapping": {
- "_comment_required": "必填。记录白名单注册表:所有在过滤/排序里会用到的 API 字段都必须先在 field_map 注册,否则会 fail-fast。",
- "records_path": "data.good[]",
- "field_map": {
- "domain": "ip",
- "created_at": "createdTime",
- "avg_score": "avgScore",
- "yd_score": "ydScore",
- "dx_score": "dxScore",
- "lt_score": "ltScore",
- "avg_latency": "avgLatency",
- "avg_pkg_lost_rate": "avgPkgLostRate",
- "yd_latency": "ydLatency",
- "yd_pkg_lost_rate": "ydPkgLostRate",
- "lt_latency": "ltLatency",
- "lt_pkg_lost_rate": "ltPkgLostRate",
- "dx_latency": "dxLatency",
- "dx_pkg_lost_rate": "dxPkgLostRate",
- "location_country": "locationCountry",
- "location_city": "locationCity"
- },
- "created_time_formats": [
- "%Y-%m-%d %H:%M:%S"
- ],
- "created_time_timezone": "UTC"
- },
- "record_filter": {
- "_comment": "可选。按记录字段排除候选(字段名必须来自 record_mapping.field_map)。",
- "enabled": false,
- "exclude_if_any": [
- {
- "field": "location_country",
- "contains": "泛播",
- "case_sensitive": false
- },
- {
- "field": "location_city",
- "contains": "泛播",
- "case_sensitive": false
- },
- {
- "field": "domain",
- "regex": "(test|staging)",
- "case_sensitive": false
- }
- ]
- },
- "domain_filter": {
- "include_suffixes": [],
- "exclude_regex": [
- "^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}$"
- ]
- },
- "scoring": {
- "_comment_required": "enabled=true 时必须配置 strategy。weighted_average 需 weighted_fields;lexicographic 需 lexicographic_fields。",
- "enabled": true,
- "strategy": "weighted_average",
- "weighted_fields": [
- {
- "field": "avg_score",
- "weight": 0.5
- },
- {
- "field": "yd_score",
- "weight": 0.2
- },
- {
- "field": "dx_score",
- "weight": 0.1
- },
- {
- "field": "lt_score",
- "weight": 0.2
- }
- ],
- "lexicographic_fields": [
- {
- "field": "avg_score",
- "order": "desc"
- },
- {
- "field": "created_at",
- "order": "desc"
- }
- ],
- "prefer_lower": false,
- "within_hours": 24,
- "tie_breakers": [
- {
- "field": "created_at",
- "order": "desc"
- },
- {
- "field": "domain",
- "order": "asc"
- }
- ]
- },
- "healthcheck": {
- "enabled": false,
- "attempts": 2,
- "timeout_ms": 1800,
- "port": 443,
- "tls_verify": true
- },
- "selection": {
- "top_n": 3
- },
- "output": {
- "runtime_dir": "./runtime",
- "current_domain_file": "current_domain.txt",
- "current_domain_json": "current_domain.json",
- "state_file": "state.json",
- "substore_vars_file": "substore_vars.json"
- },
- "v2ray": {
- "template_file": "",
- "output_file": "",
- "replace_token": "__AUTO_DOMAIN__"
- },
- "notify": {
- "command": ""
- }
- }
|