rnetx / sing-box

https://sing-box.sagernet.org
Other
71 stars 8 forks source link

启动显示decode config at /data/adb/box/sing-box/config.json: json: cannot unmarshal array into Go struct field _Options.proxyproviders of type option.ProxyProviderOptions #8

Closed Yuu518 closed 1 year ago

Yuu518 commented 1 year ago

Welcome

Description of the problem

启动显示decode config at /data/adb/box/sing-box/config.json: json: cannot unmarshal array into Go struct field _Options.proxyproviders of type option.ProxyProviderOptions

Version of sing-box

```console $ sing-box version sing-box version 1.3-beta12-yaott-1123e35 ```

Server and client configuration file

```console # paste json here ```

Server and client log file

```console decode config at /data/adb/box/sing-box/config.json: json: cannot unmarshal array into Go struct field _Options.proxyproviders of type option.ProxyProviderOptions ```
0xffffharry commented 1 year ago

请贴上配置文件,隐私信息请打码

Yuu518 commented 1 year ago

请贴上配置文件,隐私信息请打码

Server and client configuration file

```console { "log": { "disabled": false, "level": "info", "output": "box.log", "timestamp": true }, "dns": { "servers": [ { "tag": "cloudflare", "address": "https://dns.cloudflare.com/dns-query", "address_resolver": "dnspod", "strategy": "prefer_ipv4", "detour": "direct" }, { "tag": "dnspod", "address": "119.29.29.29", "strategy": "prefer_ipv4", "detour": "direct" } ], "rules": [ { "outbound":[ "any" ], "server": "dnspod" }, { "geosite": [ "cn" ], "server": "dnspod" } ], "final": "google", "disable_cache": false, "disable_expire": false }, "inbounds": [ { "type": "tun", "tag": "tun", "interface_name": "BOX", "mtu": 9000, "stack": "system", "inet4_address": "172.19.0.1/30", "inet6_address": "fdfe:dcba:9876::1/126", "auto_route": true, "strict_route": true, "sniff": true } ], "proxyproviders": [ { "tag": "Kuromis", // 机场标识,会在下方outbounds里自动生成一个同名的节点组,类型为selector "url": "", "cache_file": "./proxy_providers/Kuromis.cache", // 缓存文件,可以减少每次启动时间 "force_update": "24h", // 强制每隔一小时自动更新订阅文件 "custom_group": [ // 此订阅的自定义分组 { "tag": "Kuromis·HK", // 分组标识,会在下方outbounds里自动生成一个同名的节点组,类型为selector/urltest "type": "selector", "filter": { "rule": "Hong Kong" }, "white_mode": true // 节点过滤规则,true:白名单,false:黑名单 }, { "tag": "Kuromis·TW", "type": "selector", "filter": { "rule": "Taiwan" }, "white_mode": true }, { "tag": "Kuromis·Singapore", "type": "selector", "filter": { "rule": "Singapore" }, "white_mode": true }, { "tag": "Kuromis·JP", "type": "selector", "filter": { "rule": "Japan" }, "white_mode": true }, { "tag": "Kuromis·US", "type": "selector", "filter": { "rule": "United States" }, "white_mode": true } // { // "tag": "Kuromis·Other", // "type": "selector", // "rule": [], // "white_mode": false // } ] }, { "tag": "Paoluz", "url": "", "cache_file": "./proxy_providers/Paoluz.cache", "force_update": "24h", "custom_group": [ { "tag": "Paoluz·HK", "type": "selector", "filter": { "rule": "香港" }, "white_mode": true }, { "tag": "Paoluz·TW", "type": "selector", "filter": { "rule": "台湾" }, "white_mode": true }, { "tag": "Paoluz·Singapore", "type": "selector", "filter": { "rule": "新加坡" }, "white_mode": true }, { "tag": "Paoluz·JP", "type": "selector", "filter": { "rule": "日本" }, "white_mode": true }, { "tag": "Paoluz·US", "type": "selector", "filter": { "rule": "美国" }, "white_mode": true } // { // "tag": "Paoluz·Other", // "type": "selector", // "rule": [], // "white_mode": false // } ] } ], "outbounds": [ { "tag": "Proxies", "type": "selector", "outbounds": [ "Kuromis", "Paoluz" // "Kuromis·HK", // "Kuromis·TW", // "Kuromis·Singapore", // "Kuromis·JP", // "Kuromis·US", // "Kuromis·Other", // "Paoluz·HK", // "Paoluz·TW", // "Paoluz·Singapore", // "Paoluz·JPP", // "Paoluz·US", // "Paoluz·Other" ] }, { "tag": "HK", "type": "selector", "outbounds": [ "Kuromis·HK", "Paoluz·HK" ] }, { "tag": "TW", "type": "selector", "outbounds": [ "Kuromis·TW", "Paoluz·TW" ] }, { "tag": "Singapore", "type": "selector", "outbounds": [ "Kuromis·Singapore", "Paoluz·Singapore" ] }, { "tag": "JP", "type": "selector", "outbounds": [ "Kuromis·JP", "Paoluz·JP" ] }, { "tag": "US", "type": "selector", "outbounds": [ "Kuromis·US", "Paoluz·US" ] } //{ // "tag": "Other", // "type": "selector", // "outbounds": [ // "Kuromis·Other", // "Paoluz·Other" // ] //} ], "route": { "geoip": { "path": "geoip.db", "download_url": "https://github.com/SagerNet/sing-geoip/releases/latest/download/geoip.db", "download_detour": "Proxies" }, "geosite": { "path": "geosite.db", "download_url": "https://github.com/SagerNet/sing-geosite/releases/latest/download/geosite.db", "download_detour": "Proxies" }, "rules": [ { "geosite": "telegram", "geoip": "telegram", "outbound": [ "Proxies", "Kuromis·HK", "Kuromis·TW", "Kuromis·Singapore", "Kuromis·JP", "Kuromis·US", "Kuromis·Other", "Paoluz·HK", "Paoluz·TW", "Paoluz·Singapore", "Paoluz·JP", "Paoluz·US", "Paoluz·Other" ] }, { "geosite": "youtube", "geoip": "youtube", "outbound": [ "Proxies", "Kuromis·HK", "Kuromis·TW", "Kuromis·Singapore", "Kuromis·JP", "Kuromis·US", "Kuromis·Other", "Paoluz·HK", "Paoluz·TW", "Paoluz·Singapore", "Paoluz·JP", "Paoluz·US", "Paoluz·Other" ] }, { "geosite": "netflix", "geoip": "netflix", "outbound": [ "Proxies", "Kuromis·HK", "Kuromis·TW", "Kuromis·Singapore", "Kuromis·JP", "Kuromis·US", "Kuromis·Other", "Paoluz·HK", "Paoluz·TW", "Paoluz·Singapore", "Paoluz·JP", "Paoluz·US", "Paoluz·Other" ] }, { "geosite": "bilibili", "outbound": [ "direct", "Kuromis·HK", "Paoluz·HK" ] }, { "geosite": "bahamut", "outbound": [ "Kuromis·TW", "Paoluz·TW" ] }, { "geosite": "google", "geoip": "google", "outbound": [ "Proxies", "Kuromis·HK", "Kuromis·TW", "Kuromis·Singapore", "Kuromis·JP", "Kuromis·US", "Kuromis·Other", "Paoluz·HK", "Paoluz·TW", "Paoluz·Singapore", "Paoluz·JP", "Paoluz·US", "Paoluz·Other" ] }, { "geosite": "microsoft", "geoip": "microsoft", "outbound": [ "Proxies", "Kuromis·HK", "Kuromis·TW", "Kuromis·Singapore", "Kuromis·JP", "Kuromis·US", "Kuromis·Other", "Paoluz·HK", "Paoluz·TW", "Paoluz·Singapore", "Paoluz·JP", "Paoluz·US", "Paoluz·Other" ] }, { "geosite": "steam", "outbound": [ "Proxies", "Kuromis·HK", "Kuromis·TW", "Kuromis·Singapore", "Kuromis·JP", "Kuromis·US", "Kuromis·Other", "Paoluz·HK", "Paoluz·TW", "Paoluz·Singapore", "Paoluz·JP", "Paoluz·US", "Paoluz·Other" ] }, { "geosite": "openai", "outbound": [ "Proxies", "Kuromis·HK", "Kuromis·TW", "Kuromis·Singapore", "Kuromis·JP", "Kuromis·US", "Kuromis·Other", "Paoluz·HK", "Paoluz·TW", "Paoluz·Singapore", "Paoluz·JP", "Paoluz·US", "Paoluz·Other" ] }, { "protocol": "dns", "outbound": "dns-out" }, { "geosite": "cn", "outbound": "direct" }, { "geoip": "private", "outbound": "direct" }, { "geoip": "cn", "outbound": "direct" } ], "final": "Proxies", "auto_detect_interface": true }, "experimental": { "clash_api": { "external_controller": "127.0.0.1:5618", "external_ui_build_in": true, "default_mode": "rule", "store_selected": true, "cache_file": "cache.db" } } } ```
0xffffharry commented 1 year ago

你配置的问题:

  1. proxyprovider - custom_group 没有 filter 字段,直接写 rule 即可,自己看 dev-next-yaott 分支的 README.md
    {
                    "tag": "Paoluz·HK",
                    "type": "selector",
                    "rule": "香港",
                    "white_mode": true
    },
  2. route - rules 每一项规则只允许一个 outbound,自己查文档