surgioproject / surgio

Generating rules for Surge, Clash, Quantumult like a PRO
https://surgio.js.org
MIT License
1.62k stars 138 forks source link

解析 v2rayn 时提示:Provider 配置校验失败 #245

Closed ShadowsSide closed 1 year ago

ShadowsSide commented 1 year ago

Surgio: v3.10 - 3.2.0 均尝试过

Provider 配置,已尝试添加compatibleMode属性,均无效。

'use strict';

module.exports = {
  url: '',
  type: 'v2rayn_subscribe',
  startPort: 66100,
  addFlag: true,
  tfo: true,
  udpRelay: true,
  compatibleMode: true
};

将订阅文本下载后使用base64解码时可以正常解析出vmess://格式内容

Netlify 报错界面

image

Netlify Function log如下:

Nov 2, 07:24:19 AM: [Nest] 8  - 11/01/2023, 11:24:19 PM     LOG [NestFactory] Starting Nest application...
Nov 2, 07:24:20 AM: [Nest] 8  - 11/01/2023, 11:24:20 PM     LOG [InstanceLoader] PassportModule dependencies initialized +182ms
Nov 2, 07:24:20 AM: [Nest] 8  - 11/01/2023, 11:24:20 PM     LOG [InstanceLoader] ConfigHostModule dependencies initialized +1ms
Nov 2, 07:24:20 AM: [Nest] 8  - 11/01/2023, 11:24:20 PM     LOG [InstanceLoader] ServeStaticModule dependencies initialized +0ms
Nov 2, 07:24:20 AM: [Nest] 8  - 11/01/2023, 11:24:20 PM     LOG [InstanceLoader] ConfigModule dependencies initialized +0ms
Nov 2, 07:24:20 AM: [Nest] 8  - 11/01/2023, 11:24:20 PM   ERROR [ExceptionHandler] Provider 配置校验失败
Nov 2, 07:24:20 AM: SurgioError: Provider 配置校验失败
Nov 2, 07:24:20 AM: at new Provider (/var/task/node_modules/surgio/src/provider/Provider.ts:35:13)
Nov 2, 07:24:20 AM: at new V2rayNSubscribeProvider (/var/task/node_modules/surgio/src/provider/V2rayNSubscribeProvider.ts:26:5)
Nov 2, 07:24:20 AM: at getProvider (/var/task/node_modules/surgio/src/provider/index.ts:55:14)
Nov 2, 07:24:20 AM: at /var/task/node_modules/@surgio/gateway/src/surgio/surgio-helper.ts:56:29
Nov 2, 07:24:20 AM: at readProvider (/var/task/node_modules/@surgio/gateway/src/surgio/surgio-helper.ts:61:9)
Nov 2, 07:24:20 AM: at SurgioHelper.readProviders (/var/task/node_modules/@surgio/gateway/src/surgio/surgio-helper.ts:71:28)
Nov 2, 07:24:20 AM: at SurgioHelper.init (/var/task/node_modules/@surgio/gateway/src/surgio/surgio-helper.ts:35:5)
Nov 2, 07:24:20 AM: at Injector.instantiateClass (/var/task/node_modules/@nestjs/core/injector/injector.js:355:37)
Nov 2, 07:24:20 AM: at callback (/var/task/node_modules/@nestjs/core/injector/injector.js:56:34)
Nov 2, 07:24:20 AM: at Injector.resolveConstructorParams (/var/task/node_modules/@nestjs/core/injector/injector.js:136:24)
Nov 2, 07:24:20 AM: at Injector.loadInstance (/var/task/node_modules/@nestjs/core/injector/injector.js:61:13)
Nov 2, 07:24:20 AM: at Injector.loadProvider (/var/task/node_modules/@nestjs/core/injector/injector.js:88:9)
Nov 2, 07:24:20 AM: at /var/task/node_modules/@nestjs/core/injector/instance-loader.js:56:13
Nov 2, 07:24:20 AM: at async Promise.all (index 4)
Nov 2, 07:24:20 AM: at InstanceLoader.createInstancesOfProviders (/var/task/node_modules/@nestjs/core/injector/instance-loader.js:55:9)
Nov 2, 07:24:20 AM: at /var/task/node_modules/@nestjs/core/injector/instance-loader.js:40:13
Nov 2, 07:24:20 AM: RequestId: 32db57e2-d022-4ec3-8f1a-dc09fd850648 Error: Runtime exited with error: exit status 1
Runtime.ExitError
Nov 2, 07:24:20 AM: 32db57e2 Duration: 309.75 ms    Memory Usage: 96 MB
Nov 2, 07:24:20 AM: INIT_START Runtime Version: nodejs:18.v15   Runtime Version ARN: arn:aws:lambda:us-east-1::runtime:8ed78fdc4678dbafe30d2afe48bcfb27097048de7858a6fbbba5d19fdc3419db
geekdada commented 1 year ago

请检查Provider目录下有没有别的Provider格式有错误,没有生效的Provider也会影响面板启动。

ShadowsSide commented 1 year ago

请检查Provider目录下有没有别的Provider格式有错误,没有生效的Provider也会影响面板启动。

你好,我已经尝试过了。删除这个Provider就可以正常生成,一添加就报错。不知道是否和订阅内容不规范有关?

geekdada commented 1 year ago

本地生成没有问题吗

ShadowsSide commented 1 year ago

感谢指导!不知道为什么Netlify Function log里没有显示这个原因,在本地调试的时候重新修改startPort就成功了!

原因: Number must be less than or equal to 65535 at "startPort"