immortalwrt / homeproxy

The modern ImmortalWrt proxy platform for ARM64/AMD64 (powered by sing-box)
GNU General Public License v2.0
532 stars 159 forks source link

导入配置报错 #138

Closed w0330t closed 3 months ago

w0330t commented 3 months ago

我用sing-box-subscribe转换了一个简单的配置,订阅节点报错,但将该配置iOS客户端订阅使用运行正常。 错误信息如下

2024-08-07 10:44:44 [SUBSCRIBE] Failed to update subscriptions: no valid node found.
2024-08-07 10:44:44 [SUBSCRIBE] Starting service...
Type error: attempt to set property on null value
In /etc/homeproxy/scripts/generate_client.uc, line 539, byte 53:

 `    config.outbounds[length(config.outbounds)-1].tag = 'main-out';`
  Near here ---------------------------------------------^

2024-08-07 10:44:44 [DAEMON] Error: failed to generate client configuration.

配置文件如下

{
  "log": {
    "level": "debug",
    "timestamp": true
  },
  "experimental": {
    "clash_api": {
      "external_controller": "127.0.0.1:9090",
      "external_ui": "ui",
      "secret": "",
      "external_ui_download_url": "https://github.com/MetaCubeX/Yacd-meta/archive/gh-pages.zip",
      "external_ui_download_detour": "",
      "default_mode": "rule"
    },
    "cache_file": {
      "enabled": true,
      "store_fakeip": false
    }
  },
  "dns": {
    "servers": [
      {
        "tag": "proxyDns",
        "address": "tls://8.8.8.8",
        "detour": "proxy"
      },
      {
        "tag": "localDns",
        "address": "https://223.5.5.5/dns-query",
        "detour": "direct"
      },
      {
        "tag": "block",
        "address": "rcode://success"
      }
    ],
    "rules": [
      {
        "domain": [
          "ghproxy.com",
          "cdn.jsdelivr.net",
          "testingcf.jsdelivr.net"
        ],
        "server": "localDns"
      },
      {
        "rule_set": "geosite-category-ads-all",
        "server": "block"
      },
      {
        "outbound": "any",
        "server": "localDns",
        "disable_cache": true
      },
      {
        "clash_mode": "direct",
        "server": "localDns"
      },
      {
        "clash_mode": "global",
        "server": "proxyDns"
      }
    ],
    "strategy": "ipv4_only"
  },
  "inbounds": [
    {
      "type": "tun",
      "inet4_address": "172.19.0.1/30",
      "mtu": 9000,
      "auto_route": true,
      "strict_route": true,
      "sniff": true,
      "endpoint_independent_nat": false,
      "stack": "system",
      "platform": {
        "http_proxy": {
          "enabled": true,
          "server": "127.0.0.1",
          "server_port": 2080
        }
      }
    },
    {
      "type": "mixed",
      "listen": "127.0.0.1",
      "listen_port": 2080,
      "sniff": true,
      "users": []
    }
  ],
  "outbounds": [
    {
      "tag": "proxy",
      "type": "selector",
      "outbounds": [
        "auto",
        "direct",
        "1-vless",
        "2-vless",
        "3-vless",
        "4-vless",
        "5-vless",
        "6-vless",
        "7-vless"
      ]
    },
    {
      "tag": "auto",
      "type": "urltest",
      "outbounds": [
        "1-vless",
        "2-vless",
        "3-vless",
        "4-vless",
        "5-vless",
        "6-vless",
        "7-vless"
      ],
      "url": "http://www.gstatic.com/generate_204",
      "interval": "10m",
      "tolerance": 50
    },
    {
      "type": "direct",
      "tag": "direct"
    },
    {
      "type": "dns",
      "tag": "dns-out"
    },
    {
      "type": "block",
      "tag": "block"
    },
    {
      "tag": "1-vless",
      "type": "vless",
      "server": "1.xxx.com",
      "server_port": 12345,
      "uuid": "xxxxxxxx",
      "packet_encoding": "xudp",
      "flow": "xtls-rprx-vision",
      "tls": {
        "enabled": true,
        "insecure": true,
        "server_name": ""
      }
    },
    {
      "tag": "2-vless",
      "type": "vless",
      "server": "2.xxx.com",
      "server_port": 12345,
      "uuid": "xxxxxxxx",
      "packet_encoding": "xudp",
      "flow": "xtls-rprx-vision",
      "tls": {
        "enabled": true,
        "insecure": true,
        "server_name": ""
      }
    },
    {
      "tag": "3-vless",
      "type": "vless",
      "server": "3.xxx.com",
      "server_port": 12345,
      "uuid": "xxxxxxxx",
      "packet_encoding": "xudp",
      "flow": "xtls-rprx-vision",
      "tls": {
        "enabled": true,
        "insecure": true,
        "server_name": ""
      }
    },
    {
      "tag": "4-vless",
      "type": "vless",
      "server": "4.xxx.com",
      "server_port": 12345,
      "uuid": "xxxxxxxx",
      "packet_encoding": "xudp",
      "flow": "xtls-rprx-vision",
      "tls": {
        "enabled": true,
        "insecure": true,
        "server_name": ""
      }
    },
    {
      "tag": "5-vless",
      "type": "vless",
      "server": "5.xxx.com",
      "server_port": 12345,
      "uuid": "xxxxxxxx",
      "packet_encoding": "xudp",
      "flow": "xtls-rprx-vision",
      "tls": {
        "enabled": true,
        "insecure": true,
        "server_name": ""
      }
    },
    {
      "tag": "6-vless",
      "type": "vless",
      "server": "6.xxx.com",
      "server_port": 12345,
      "uuid": "xxxxxxxx",
      "packet_encoding": "xudp",
      "flow": "xtls-rprx-vision",
      "tls": {
        "enabled": true,
        "insecure": true,
        "server_name": ""
      }
    },
    {
      "tag": "7-vless",
      "type": "vless",
      "server": "7.xxx.com",
      "server_port": 12345,
      "uuid": "xxxxxxxx",
      "packet_encoding": "xudp",
      "flow": "xtls-rprx-vision",
      "tls": {
        "enabled": true,
        "insecure": true,
        "server_name": ""
      }
    }
  ],
  "route": {
    "auto_detect_interface": true,
    "final": "proxy",
    "rules": [
      {
        "protocol": "dns",
        "outbound": "dns-out"
      },
      {
        "network": "udp",
        "port": 443,
        "outbound": "block"
      },
      {
        "rule_set": "geosite-category-ads-all",
        "outbound": "block"
      },
      {
        "clash_mode": "direct",
        "outbound": "direct"
      },
      {
        "clash_mode": "global",
        "outbound": "proxy"
      },
      {
        "domain": [
          "clash.razord.top",
          "yacd.metacubex.one",
          "yacd.haishan.me",
          "d.metacubex.one"
        ],
        "outbound": "direct"
      }
    ],
    "rule_set": [
      {
        "tag": "geosite-category-ads-all",
        "type": "remote",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/sing/geo/geosite/category-ads-all.srs",
        "download_detour": "direct"
      }
    ]
  }
}
muink commented 3 months ago

订阅功能只接受v2ray格式的仅节点配置文件 不支持singbox的配置文件格式