Coder Social home page Coder Social logo

surgioproject / surgio Goto Github PK

View Code? Open in Web Editor NEW
1.6K 23.0 140.0 10.9 MB

Generating rules for Surge, Clash, Quantumult like a PRO

Home Page: https://surgio.js.org

License: MIT License

JavaScript 4.05% TypeScript 95.25% Smarty 0.51% EJS 0.18% Batchfile 0.01%
surge clash quantumult v2ray trojan shadowsocks hysteria snell vless vmess

surgio's People

Contributors

broven avatar cnsunyour avatar cooldarran avatar dependabot[bot] avatar fredliang44 avatar geekdada avatar godd6366 avatar huangyafei avatar hunshcn avatar jukrb0x avatar kotahv avatar ladit avatar mackdt avatar monkeywithacupcake avatar proletarius101 avatar quericy avatar quul avatar rulesw avatar snyk-bot avatar virgilclyne avatar wdmcheng avatar we11adam avatar x1a0ca1 avatar zieglar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

surgio's Issues

两点小建议

1.在内置的新加坡过滤器中麻烦添加”狮城“关键词;
2.Clash之前的dev已经支持snell了,可以加上;

还有就是请问Surge的Temple中无法使用Provider中自定义的过滤器吗?
Surgio真的是超级好用,开发者辛苦了!

模板中自定义函数扩展支持

目前 surgio 中内置了一些函数,如 yaml、base64、clash 等
{{ clashProxyConfig | yaml }}
{{ getQuantumultNodes(nodeList, providerName) | base64 }}

是否可以考虑增加用户自定义的函数扩展,这样的好处是可以让用户自定义输出格式,从而兼容更多的客户端模板,而这部分客户端往往不一定是主流的以及 surgio 需要兼容的

类似 {{ getNodeNames(nodeList) | customFunction }}

合并机场订阅后无法显示流量通知

合并多个provider后,quantumult x 无法显示机场流量。
直接使用机场提供的 ssr 链接时,quantumult x 会从链接中获取Response Headers,从而显示流量。
希望支持合并多个 provider 之后,依然支持 surge/quantumult x等工具显示某个机场流量。

getNodeNames 可以筛选出指定 provider 下的节点

场景是这样的,有一些小机场的场景想单独测试,而默认的 filter 机制,大部分是基于地域、国别或者应用,无法直接筛出指定 provider 的

目前自己使用了重命名节点+自定义 filter 的方式来跑通实现

provider 配置重命名节点

provider/self-build.js 中
renameNode: name => {
    return "SELF|" + name; // SELF 是自建的节点
 }

surgio.conf.js 中增加自定义过滤

customFilters: {
    selfFilter: utils.useKeywords(['SELF']),
},

模板中使用
🚀 Proxy = select, {{ getNodeNames(nodeList, customFilters.selfFilter) }}

虽然能实现,但是不够优雅,因为每新接入一个订阅会都需要这样配置一下,是否 surgio 原生可以支持

可以考虑如下方式

  1. getNodeNames(nodeList, filter?, separator?) 接口增加 provider ,实现指定在某个 provider 下

新接口签名 getNodeNames(nodeList, filter?, separator?, provider?)

  1. 增加默认的过滤器 providerFilter,支持传入多个 provider,这样 getNodeNames 无需改动
    providerFilter(['demo', 'self-build'])

  2. 增加一个 util 的内置方法 useProviders,支持传入多个 provider
    utils.useProviders(['demo', 'self-build'])

discardKeywords没有用

const { utils } = require('surgio');

module.exports = {
  url: 'https://losadhwselfff2332dasd.xyz/link/xxx?mu=0',
  type: 'shadowsocksr_subscribe',
  // 定义所有的节点都支持 udpRelay
  udpRelay: true,
  // 添加国旗 emoji
  addFlag: true,
  customFilters: {
    subscribeFilter: utils.discardKeywords(['地址','流量','时间','Free','续费','官网','回国','用户','设定'], false),
  },
};

结果中并没有过滤掉带有关键词名字的服务器

类型为 vmess 的节点生成 clash 配置时没有 udp 相关设置

./provider/test.js

'use strict';

module.exports = {
    url: 'https://test.com/subscribe?token=abcd',
    type: 'v2rayn_subscribe',
    //udpRelay: true,
    'udp-relay': true,
    addFlag: false,
};

./template/clash_list.tpl

{{ getClashNodes(nodeList) | yaml }}

test.js 中加入 udpRelay: true 或者 'udp-relay': true 在生成 clash 配置时 nodelist 里都不会有 udp: true 这个设置

请问 surge3 mac 怎么生成托管模式的?

托管api 已经按照教程配置了,用的vervel, 在clashx 和 clashR 上是托管模式,但是在surge3 for mac 上是普通的导入模式
请问是怎样配置才能在 surge 上也是托管模式?

add clash Proxy Group: load-balance

load-balance 可以使相同 eTLD 请求在同一条代理线路上

  • { name: "load-balance", type: load-balance, proxies: ["ss1", "ss2", "vmess1"] }

https://xxxxxx.xxx.now.sh/list-artifact 无法正常显示

本地可生成代理配置,未开启鉴权,部署到now.sh后,可以正常进行托管
但是无法显示 https://xxxxxx.xxx.now.sh/list-artifact
surgio版本为1.0

now.json
{
"name": "xxxx",
"version": 2,
"public": false,
"builds": [
{
"src": "gateway.js",
"use": "@now/node",
"config": {
"includeFiles": [
"provider/",
"template/
",
".js",
"
.json"
]
}
}
],
"routes": [
{
"src": "/(.*)",
"methods": ["HEAD", "GET"],
"dest": "/gateway.js"
}
]
}
surgio.config.js 内已配置
urlBase: 'https://xxx.xxx.now.sh/get-artifact/'

Support merging multi providers into one artifact

I have several providers, and I want to subscribe them via a single url.

If it can be like the following, it might be better.

{
      name:'clash.yaml',
      template:'clash',
      provider: [ 'provider_1', 'provider_2' ]
}

求一个新Feature,关于策略组复用的。

大大,您好!
有没有办法实现 proxy group 复用呢?类似现在对规则Snippet那样的处理方式。
定义一个 surge 通用的 proxy group 作为模板,clash、Quantumult X 等工具都以 surge 格式的 proxy group 的模板转化而来。这样对于同时维护 surge 、clash、quantumultx三种配置工具来说,真是非常棒。

新版 API 自定义过滤器的问题

为什么在新版 API 下,在 surgio.conf.js 里定义了自定义过滤器但在 template 中没有使用的话,网关就报错呢?旧版本定义了自定义过滤器但没有使用,是可以正常跑起来的。

我目前的使用习惯是自定义过滤器不一定在模板中使用,比较多的是使用 get-artifact 加参数的方式筛选出一些节点来用,现在在 surgio.conf.js定义了过滤器就必须要用的方式,感觉没有之前灵活了。

升级2.0.0后gateway一直提示surgio版本过低

[Nest] 25507 - 07/13/2020, 4:05:20 PM [NestFactory] Starting Nest application...
[Nest] 25507 - 07/13/2020, 4:05:21 PM
[Nest] 25507 - 07/13/2020, 4:05:21 PM Surgio 版本过低,请升级后重新运行!
[Nest] 25507 - 07/13/2020, 4:05:21 PM
[Nest] 25507 - 07/13/2020, 4:05:21 PM 命令:
[Nest] 25507 - 07/13/2020, 4:05:21 PM npm install surgio@latest
[Nest] 25507 - 07/13/2020, 4:05:21 PM
[Nest] 25507 - 07/13/2020, 4:05:21 PM [ExceptionHandler] Surgio 版本过低 +20ms
Error: Surgio 版本过低
at SurgioHelper.checkCoreVersion (/home/richie/project/gitlab/surgio-rules/node_modules/@surgio/gateway/src/surgio/surgio-helper.ts:86:13)
at SurgioHelper.init (/home/richie/project/gitlab/surgio-rules/node_modules/@surgio/gateway/src/surgio/surgio-helper.ts:33:16)
at InstanceWrapper.useFactory [as metatype] (/home/richie/project/gitlab/surgio-rules/node_modules/@surgio/gateway/src/surgio/surgio.module.ts:23:27)
at Injector.instantiateClass (/home/richie/project/gitlab/surgio-rules/node_modules/@nestjs/core/injector/injector.js:293:55)
at callback (/home/richie/project/gitlab/surgio-rules/node_modules/@nestjs/core/injector/injector.js:77:41)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at Injector.resolveConstructorParams (/home/richie/project/gitlab/surgio-rules/node_modules/@nestjs/core/injector/injector.js:118:24)
at Injector.loadInstance (/home/richie/project/gitlab/surgio-rules/node_modules/@nestjs/core/injector/injector.js:81:9)
at Injector.loadProvider (/home/richie/project/gitlab/surgio-rules/node_modules/@nestjs/core/injector/injector.js:38:9)
at async Promise.all (index 4)
at InstanceLoader.createInstancesOfProviders (/home/richie/project/gitlab/surgio-rules/node_modules/@nestjs/core/injector/instance-loader.js:43:9)
at /home/richie/project/gitlab/surgio-rules/node_modules/@nestjs/core/injector/instance-loader.js:28:13
at async Promise.all (index 5)
at InstanceLoader.createInstances (/home/richie/project/gitlab/surgio-rules/node_modules/@nestjs/core/injector/instance-loader.js:27:9)
at InstanceLoader.createInstancesOfDependencies (/home/richie/project/gitlab/surgio-rules/node_modules/@nestjs/core/injector/instance-loader.js:17:9)
at /home/richie/project/gitlab/surgio-rules/node_modules/@nestjs/core/nest-factory.js:82:17

附doctor结果:
@surgio/gateway: 0.13.6
surgio: 2.0.0
node: 14.5.0 (/home/richie/.nvm/versions/node/v14.5.0/bin/node)
npx: 6.14.5
npm: 6.14.5

请问有考虑支持Vmess和Trojan的HTTP/2吗

Clash 已经均支持,见文档

配置示例如下:

# vmess
- name: "vmess-h2"
  type: vmess
  server: server
  port: 443
  uuid: uuid
  alterId: 32
  cipher: auto
  network: h2
  tls: true
  h2-opts:
    host:
      - http.example.com
      - http-alt.example.com
    path: /

# Trojan
- name: "trojan"
  type: trojan
  server: server
  port: 443
  password: yourpsk
  # udp: true
  # sni: example.com # aka server name
  # alpn:
  #   - h2
  #   - http/1.1
  # skip-cert-verify: true

在下载规则途中停止,且没有任何报错信息

在运行的过程中,出现了下载过程中就停止运行的情况,且过程中没有报错。之前用的时候没有这种问题。
系统:Arch Linux
surgio version: 1.13.4
网络情况: 透明代理,可任意访问外网
截图:
image

rixCloud api订阅返回503

provider配置文件开启relayUrl后rixcloud api订阅失败,返回503。

⚠️ 发生错误
⚠️ HTTPError: 获取 rixCloud_subscribe 节点时出现错误,相关文件 /home/richie/project/gitlab/surgio-rules/provider/rixCloud_subscribe.js ,错误原因: Response code 503 (Service Unavailable)
⚠️ 版本号: 2.3.5
⚠️ 常见问题: https://bit.ly/2KVLjvZ
⚠️ 加入交流群汇报问题 https://t.me/surgiotg

HTTPError: 获取 rixCloud_subscribe 节点时出现错误,相关文件 /home/richie/project/gitlab/surgio-rules/provider/rixCloud_subscribe.js ,错误原因: Response code 503 (Service Unavailable)
at onResponse (/home/richie/project/gitlab/surgio-rules/node_modules/surgio/node_modules/got/dist/source/as-promise/index.js:132:28)
at processTicksAndRejections (internal/process/task_queues.js:93:5)

为Surge for Mac external proxy provider生成的v2ray配置无法运行

最新的v2ray下,手动运行生成的config提示端口解析失败,因为是go解析,配置中的端口格式基本要求是Number类型的json字段,而Surgio生成的是String类型,希望能修复一下。
不过beta版的surge提供了native v2ray支持,在代码里好像有看到为native生成,该如何使用呢?
感谢作者的项目!

访问 now.sh 报错

[GET] /
21:30:17:89
�[32m[Nest] 8   - �[39m07/13/2020, 1:30:19 PM   �[38;5;3m[NestFactory] �[39m�[32mStarting Nest application...�[39m
�[33m[Nest] 8   - �[39m07/13/2020, 1:30:19 PM   �[33m�[39m
�[33m[Nest] 8   - �[39m07/13/2020, 1:30:19 PM   �[33mSurgio 版本过低,请升级后重新运行!�[39m
�[33m[Nest] 8   - �[39m07/13/2020, 1:30:19 PM   �[33m�[39m
�[33m[Nest] 8   - �[39m07/13/2020, 1:30:19 PM   �[33m  命令:�[39m
�[33m[Nest] 8   - �[39m07/13/2020, 1:30:19 PM   �[33m  npm install surgio@latest�[39m
�[33m[Nest] 8   - �[39m07/13/2020, 1:30:19 PM   �[33m�[39m
�[32m[Nest] 8   - �[39m07/13/2020, 1:30:19 PM   �[38;5;3m[InstanceLoader] �[39m�[32mPassportModule dependencies initialized�[39m�[38;5;3m +1ms�[39m
�[31m[Nest] 8   - �[39m07/13/2020, 1:30:19 PM   �[38;5;3m[ExceptionHandler] �[39m�[31mSurgio 版本过低�[39m�[38;5;3m +1ms�[39m
Error: Surgio 版本过低
    at SurgioHelper.checkCoreVersion (/var/task/node_modules/@surgio/gateway/dist/surgio/surgio-helper.js:75:19)
    at SurgioHelper.init (/var/task/node_modules/@surgio/gateway/dist/surgio/surgio-helper.js:33:20)
    at InstanceWrapper.useFactory [as metatype] (/var/task/node_modules/@surgio/gateway/dist/surgio/surgio.module.js:30:45)
    at Injector.instantiateClass (/var/task/node_modules/@nestjs/core/injector/injector.js:291:55)
    at callback (/var/task/node_modules/@nestjs/core/injector/injector.js:75:41)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Injector.resolveConstructorParams (/var/task/node_modules/@nestjs/core/injector/injector.js:116:24)
    at async Injector.loadInstance (/var/task/node_modules/@nestjs/core/injector/injector.js:79:9)
    at async Injector.loadProvider (/var/task/node_modules/@nestjs/core/injector/injector.js:36:9)
    at async Promise.all (index 4)
    at async InstanceLoader.createInstancesOfProviders (/var/task/node_modules/@nestjs/core/injector/instance-loader.js:41:9)
    at async /var/task/node_modules/@nestjs/core/injector/instance-loader.js:27:13
    at async Promise.all (index 5)
    at async InstanceLoader.createInstances (/var/task/node_modules/@nestjs/core/injector/instance-loader.js:26:9)
    at async InstanceLoader.createInstancesOfDependencies (/var/task/node_modules/@nestjs/core/injector/instance-loader.js:16:9)
    at async /var/task/node_modules/@nestjs/core/nest-factory.js:81:17
RequestId: e66817a7-ba2c-4686-a066-d9855335ef9b Error: Runtime exited with error: exit status 1
Runtime.ExitError

运行doctor后发现是最新版本:

$ npx surgio doctor                                                                                                                                                                                       
@surgio/gateway: 0.7.0
surgio: 2.0.0
node: 14.2.0 (/usr/local/Cellar/node/14.2.0/bin/node)
npx: 6.14.4
yarn: 1.19.1
npm: 6.14.4

请问能增加一个返回remoteSnippets链接的函数吗

例如我在surgio.conf.js中定义:

remoteSnippets: [
    {
      url: 'https://raw.githubusercontent.com/ConnersHua/Profiles/master/Surge/Ruleset/Media/Netflix.list',
      name: 'Netflix',
    }
]

在template中:

{{ remoteSnippets.cn.link }}

返回其该list的链接:
https://raw.githubusercontent.com/ConnersHua/Profiles/master/Surge/Ruleset/Media/Netflix.list

[bug report]npm init surgio-store my-rule-store

今天跑初始化脚手架发现只初始化了一个 package.json, 我记得之前是初始化 包含 provider 和 template 等文件夹的

(base) ➜  rule-store
(base) ➜  rule-store cd ..
(base) ➜  lab rm -rf rule-store
(base) ➜  lab npm init surgio-store my-rule-store --use-cnpm

This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.

See `npm help json` for definitive documentation on these fields
and exactly what they do.

Use `npm install <pkg>` afterwards to install a package and
save it as a dependency in the package.json file.

Press ^C at any time to quit.
package name: (lab) npm WARN init canceled
(base) ➜  lab mkdir rule
(base) ➜  lab cd rule
(base) ➜  rule npm init surgio-store my-rule-store
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.

See `npm help json` for definitive documentation on these fields
and exactly what they do.

Use `npm install <pkg>` afterwards to install a package and
save it as a dependency in the package.json file.

Press ^C at any time to quit.
package name: (rule)
version: (1.0.0)
description:
entry point: (index.js)
test command:
git repository:
keywords:
author:
license: (ISC)
About to write to /Users/zhangyao/project/lab/rule/package.json:

{
  "name": "rule",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC"
}


Is this ok? (yes)
(base) ➜  rule ls
package.json
(base) ➜  rule pwd
/Users/zhangyao/project/lab/rule
(base) ➜  rule

Build failed

运行 vercel --prod 开始 Build

结果:

Error! Build failed
Error! Check your logs at https://******.vercel.app/_logs or run vercel logs ******.vercel.app

查看日志 vercel logs ******.vercel.app

结果:

Fetched deployment "******.vercel.app" in *** [1s]
2020-08-06T10:03:26.475Z [now] [mutex] command is "install"
2020-08-06T10:03:26.475Z [now] [mutex] trying to acquire for 184
2020-08-06T10:03:26.479Z [now] [mutex] running instance 184
2020-08-06T10:03:26.628Z yarn add v1.22.4
2020-08-06T10:03:26.644Z info No lockfile found.
2020-08-06T10:03:26.663Z [1/4] Resolving packages...
2020-08-06T10:03:26.774Z error An unexpected error occurred: "https://registry.yarnpkg.com/@vercel%2fbuild-utils: Not found".
2020-08-06T10:03:26.774Z info If you think this is a bug, please open a bug report with the information provided in "/vercel/7c32e42b/.build-utils/yarn-error.log".
2020-08-06T10:03:26.774Z info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
2020-08-06T10:03:28.784Z yarn add @vercel/build-utils@latest, @now/build-utils@latest...
2020-08-06T10:03:28.844Z [now] [mutex] process.argv is ["/node12/bin/node","/vercel/.yarn/bin/yarn.js","--prod","--cwd","/vercel/7c32e42b/.build-utils","add","@vercel/build-utils@latest","@now/build-utils@latest"]
2020-08-06T10:03:28.844Z [now] [mutex] process.cwd is "/vercel/7c32e42b/.build-utils"
2020-08-06T10:03:28.844Z [now] [mutex] command is "install"
2020-08-06T10:03:28.844Z [now] [mutex] trying to acquire for 216
2020-08-06T10:03:28.848Z [now] [mutex] running instance 216
2020-08-06T10:03:28.999Z yarn add v1.22.4
2020-08-06T10:03:29.016Z info No lockfile found.
2020-08-06T10:03:29.035Z [1/4] Resolving packages...
2020-08-06T10:03:29.138Z error An unexpected error occurred: "https://registry.yarnpkg.com/@vercel%2fbuild-utils: Not found".
2020-08-06T10:03:29.138Z info If you think this is a bug, please open a bug report with the information provided in "/vercel/7c32e42b/.build-utils/yarn-error.log".
2020-08-06T10:03:29.138Z info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
2020-08-06T10:03:30.148Z yarn add @vercel/build-utils@latest, @now/build-utils@latest...
2020-08-06T10:03:30.208Z [now] [mutex] process.argv is ["/node12/bin/node","/vercel/.yarn/bin/yarn.js","--prod","--cwd","/vercel/7c32e42b/.build-utils","add","@vercel/build-utils@latest","@now/build-utils@latest"]
2020-08-06T10:03:30.208Z [now] [mutex] process.cwd is "/vercel/7c32e42b/.build-utils"
2020-08-06T10:03:30.208Z [now] [mutex] command is "install"
2020-08-06T10:03:30.208Z [now] [mutex] trying to acquire for 248
2020-08-06T10:03:30.213Z [now] [mutex] running instance 248
2020-08-06T10:03:30.362Z yarn add v1.22.4
2020-08-06T10:03:30.378Z info No lockfile found.
2020-08-06T10:03:30.397Z [1/4] Resolving packages...
2020-08-06T10:03:30.498Z error An unexpected error occurred: "https://registry.yarnpkg.com/@vercel%2fbuild-utils: Not found".
2020-08-06T10:03:30.499Z info If you think this is a bug, please open a bug report with the information provided in "/vercel/7c32e42b/.build-utils/yarn-error.log".
2020-08-06T10:03:30.499Z info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
2020-08-06T10:03:31.508Z yarn add @vercel/build-utils@latest, @now/build-utils@latest...
2020-08-06T10:03:31.567Z [now] [mutex] process.argv is ["/node12/bin/node","/vercel/.yarn/bin/yarn.js","--prod","--cwd","/vercel/7c32e42b/.build-utils","add","@vercel/build-utils@latest","@now/build-utils@latest"]
2020-08-06T10:03:31.567Z [now] [mutex] process.cwd is "/vercel/7c32e42b/.build-utils"
2020-08-06T10:03:31.568Z [now] [mutex] command is "install"
2020-08-06T10:03:31.568Z [now] [mutex] trying to acquire for 281
2020-08-06T10:03:31.572Z [now] [mutex] running instance 281
2020-08-06T10:03:31.721Z yarn add v1.22.4
2020-08-06T10:03:31.736Z info No lockfile found.
2020-08-06T10:03:31.755Z [1/4] Resolving packages...
2020-08-06T10:03:31.860Z error An unexpected error occurred: "https://registry.yarnpkg.com/@vercel%2fbuild-utils: Not found".
2020-08-06T10:03:31.860Z info If you think this is a bug, please open a bug report with the information provided in "/vercel/7c32e42b/.build-utils/yarn-error.log".
2020-08-06T10:03:31.861Z info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
2020-08-06T10:03:33.869Z yarn add @vercel/build-utils@latest, @now/build-utils@latest...
2020-08-06T10:03:33.929Z [now] [mutex] process.argv is ["/node12/bin/node","/vercel/.yarn/bin/yarn.js","--prod","--cwd","/vercel/7c32e42b/.build-utils","add","@vercel/build-utils@latest","@now/build-utils@latest"]
2020-08-06T10:03:33.929Z [now] [mutex] process.cwd is "/vercel/7c32e42b/.build-utils"
2020-08-06T10:03:33.929Z [now] [mutex] command is "install"
2020-08-06T10:03:33.929Z [now] [mutex] trying to acquire for 313
2020-08-06T10:03:33.933Z [now] [mutex] running instance 313
2020-08-06T10:03:34.082Z yarn add v1.22.4
2020-08-06T10:03:34.097Z info No lockfile found.
2020-08-06T10:03:34.116Z [1/4] Resolving packages...
2020-08-06T10:03:34.216Z error An unexpected error occurred: "https://registry.yarnpkg.com/@vercel%2fbuild-utils: Not found".
2020-08-06T10:03:34.216Z info If you think this is a bug, please open a bug report with the information provided in "/vercel/7c32e42b/.build-utils/yarn-error.log".
2020-08-06T10:03:34.216Z info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
2020-08-06T10:03:36.226Z yarn add @vercel/build-utils@latest, @now/build-utils@latest...
2020-08-06T10:03:36.285Z [now] [mutex] process.argv is ["/node12/bin/node","/vercel/.yarn/bin/yarn.js","--prod","--cwd","/vercel/7c32e42b/.build-utils","add","@vercel/build-utils@latest","@now/build-utils@latest"]
2020-08-06T10:03:36.286Z [now] [mutex] process.cwd is "/vercel/7c32e42b/.build-utils"
2020-08-06T10:03:36.286Z [now] [mutex] command is "install"
2020-08-06T10:03:36.286Z [now] [mutex] trying to acquire for 345
2020-08-06T10:03:36.290Z [now] [mutex] running instance 345
2020-08-06T10:03:36.438Z yarn add v1.22.4
2020-08-06T10:03:36.453Z info No lockfile found.
2020-08-06T10:03:36.472Z [1/4] Resolving packages...
2020-08-06T10:03:36.583Z error An unexpected error occurred: "https://registry.yarnpkg.com/@vercel%2fbuild-utils: Not found".
2020-08-06T10:03:36.583Z info If you think this is a bug, please open a bug report with the information provided in "/vercel/7c32e42b/.build-utils/yarn-error.log".
2020-08-06T10:03:36.583Z info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
2020-08-06T10:03:37.592Z yarn add @vercel/build-utils@latest, @now/build-utils@latest...
2020-08-06T10:03:37.651Z [now] [mutex] process.argv is ["/node12/bin/node","/vercel/.yarn/bin/yarn.js","--prod","--cwd","/vercel/7c32e42b/.build-utils","add","@vercel/build-utils@latest","@now/build-utils@latest"]
2020-08-06T10:03:37.651Z [now] [mutex] process.cwd is "/vercel/7c32e42b/.build-utils"
2020-08-06T10:03:37.651Z [now] [mutex] command is "install"
2020-08-06T10:03:37.651Z [now] [mutex] trying to acquire for 377
2020-08-06T10:03:37.656Z [now] [mutex] running instance 377
2020-08-06T10:03:37.804Z yarn add v1.22.4
2020-08-06T10:03:37.819Z info No lockfile found.
2020-08-06T10:03:37.838Z [1/4] Resolving packages...
2020-08-06T10:03:37.940Z error An unexpected error occurred: "https://registry.yarnpkg.com/@vercel%2fbuild-utils: Not found".
2020-08-06T10:03:37.940Z info If you think this is a bug, please open a bug report with the information provided in "/vercel/7c32e42b/.build-utils/yarn-error.log".
2020-08-06T10:03:37.940Z info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
2020-08-06T10:03:39.950Z yarn add @vercel/build-utils@latest, @now/build-utils@latest...
2020-08-06T10:03:40.009Z [now] [mutex] process.argv is ["/node12/bin/node","/vercel/.yarn/bin/yarn.js","--prod","--cwd","/vercel/7c32e42b/.build-utils","add","@vercel/build-utils@latest","@now/build-utils@latest"]
2020-08-06T10:03:40.009Z [now] [mutex] process.cwd is "/vercel/7c32e42b/.build-utils"
2020-08-06T10:03:40.010Z [now] [mutex] command is "install"
2020-08-06T10:03:40.010Z [now] [mutex] trying to acquire for 409
2020-08-06T10:03:40.014Z [now] [mutex] running instance 409
2020-08-06T10:03:40.163Z yarn add v1.22.4
2020-08-06T10:03:40.179Z info No lockfile found.
2020-08-06T10:03:40.199Z [1/4] Resolving packages...
2020-08-06T10:03:40.316Z error An unexpected error occurred: "https://registry.yarnpkg.com/@vercel%2fbuild-utils: Not found".
2020-08-06T10:03:40.316Z info If you think this is a bug, please open a bug report with the information provided in "/vercel/7c32e42b/.build-utils/yarn-error.log".
2020-08-06T10:03:40.316Z info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
2020-08-06T10:03:40.324Z Error: Exited with 1
2020-08-06T10:03:40.324Z at ChildProcess. (/var/task/sandbox-worker.js:21953:21)
2020-08-06T10:03:40.324Z at ChildProcess.emit (events.js:310:20)
2020-08-06T10:03:40.324Z at ChildProcess.EventEmitter.emit (domain.js:482:12)
2020-08-06T10:03:40.324Z at maybeClose (internal/child_process.js:1021:16)
2020-08-06T10:03:40.324Z at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
2020-08-06T10:03:42.359Z Done with "gateway.js"

生成的clash配置文件有点问题,不是标准的yaml格式的文件

使用的surgio版本 1.24.4
使用的clash.tpl

proxies: {{ getClashNodes(nodeList) | json }}

proxy-groups:
- type: select
  name: 🚀 Proxy
  proxies: {{ getClashNodeNames(nodeList) | json }}
- type: select
  name: 🎬 Netflix
  proxies: {{ getClashNodeNames(nodeList, netflixFilter) | json }}

生成的结果

proxies: [{"type":"trojan","name":"test","server":"test","port":test,"password":"test","skip-cert-verify":false}]

proxy-groups:
- type: select
  name: 🚀 Proxy
  proxies: ["test"]

隐去了一些节点信息,但是应该能看出来生成的节点信息是json而不是按照yaml格式来生成的,希望能帮忙看看,谢谢

【建议】生成规则时先替换片段再替换节点信息

在不同模板间使用同一片段生成节点信息

例如

[Proxy Group]
{{ remoteSnippets.Common.text }}

替换片段后为:

[Proxy Group]
🇨🇳 回国节点 = url-test, {{ getNodeNames(nodeList, customFilters.cnFilter) }}, url = {{ proxyTestUrl }}

再替换节点信息:

[Proxy Group]
🇨🇳 回国节点 = url-test, 回国节点 1, 回国节点 2  回国节点 3, url = http://www.gstatic.com/generate_204

Feature: 对不同的 ssr_subscribe 订阅文件分别定义 local_port

发现生成的两个机场的订阅文件的 local_port 都是 61100 开头,不知道能不能随机生成或者对于不同的机场生成不同的端口,或者能在 provider/surgio_config.js 文件里面自定义所需的端口

因为都是一样所以不知道会不会有什么不可预料的事情

getMellowNodes()函数

测试订阅 https://jiang.netlify.app/

得到的vmess节点缺少:
&ws.host=example.com

&http.host=example.com%2Cexample1.com

&tls.allowinsecure=true

surgio生成的quantumlt订阅,混合vmess 和 http 协议生成的订阅不能识别, 导入的时候只导入了一个节点?

生成的订阅base64


写了个测试脚本 看看啥内容, 不清楚是不是没达到quan的规范, 解析的问题

decode_quan.exs 代码

# getQuantumultNodes
# https://github.com/geekdada/surgio/blob/cef5c3f2cc672b562942b12cb210418f97ce1225/lib/utils/index.ts#L812

str = File.read!("./dist/quan_subscribe.conf")
# str内容示例 surgio生成
# {{ getQuantumultNodes(nodeList, provider) | base64 }}


{:ok, text} = Base.decode64 str

all_nodes = String.split(text, "\n")
Enum.map(all_nodes, fn node -> IO.puts(node) end)

# 示例输出
# vmess://8J+HrfCfh7BISyBhcHAuZnNzLnJ1biB2bWVzcyA9IHZtZXNzLGFwcC5mYXMucnVuLDEwMDAsbm9uZSwiMTVhNmYyMTU4Ny00MWVmLWI0NTgtMmRlYzQ4NDk1ZDgxIiwyMzMsZ3JvdXA9YWxpeXVuX3ZtZXNzLG92ZXItdGxzPWZhbHNlLGNlcnRpZmljYXRlPTEsb2Jmcz10Y3Asb2Jmcy1wYXRoPSIvIixvYmZzLWhlYWRlcj0iaG9zdDphcHAuZmFzLnJ1bltScl1bTm5ddXNlci1hZ2VudDpNb3ppbGxhLzUuMCAoaVBob25lOyBDUFUgaVBob25lIE9TIDEyXzNfMSBsaWtlIE1hYyBPUyBYKSBBcHBsZVdlYktpdC82MDUuMS4xNSAoS0hUTUwsIGxpa2UgR2Vja28pIE1vYmlsZS8xNUUxNDgi
# http://8J+HsPCfh7fpn6nlm70gS1QgeDAuNCA9IGh0dHAsIHVwc3RyZWFtLXByb3h5LWFkZHJlc3M9dGVzdC5hcHAuY29tLCB1cHN0cmVhbS1wcm94eS1wb3J0PTExMSwgdXBzdHJlYW0tcHJveHktYXV0aD10cnVlLCB1cHN0cmVhbS1wcm94eS11c2VybmFtZT1oZWxsb3dvcmxkLCB1cHN0cmVhbS1wcm94eS1wYXNzd29yZD1wYXNzd29yZCwgb3Zlci10bHM9dHJ1ZSwgY2VydGlmaWNhdGU9MQ==
# http://8J+Hr/Cfh7Xml6XmnKwgQVdTIHgwLjQgPSBodHRwLCB1cHN0cmVhbS1wcm94eS1hZGRyZXNzPXRlc3QuYXBwLmNvbSwgdXBzdHJlYW0tcHJveHktcG9ydD0xMTEsIHVwc3RyZWFtLXByb3h5LWF1dGg9dHJ1ZSwgdXBzdHJlYW0tcHJveHktdXNlcm5hbWU9aGVsbG93b3JsZCwgdXBzdHJlYW0tcHJveHktcGFzc3dvcmQ9cGFzc3dvcmQsIG92ZXItdGxzPXRydWUsIGNlcnRpZmljYXRlPTE=
# http://8J+Ps++5j+KAjfCfjIjlj7Dmub4gQVBURyB4MC40ID0gaHR0cCwgdXBzdHJlYW0tcHJveHktYWRkcmVzcz10ZXN0LmFwcC5jb20sIHVwc3RyZWFtLXByb3h5LXBvcnQ9MTExLCB1cHN0cmVhbS1wcm94eS1hdXRoPXRydWUsIHVwc3RyZWFtLXByb3h5LXVzZXJuYW1lPWhlbGxvd29ybGQsIHVwc3RyZWFtLXByb3h5LXBhc3N3b3JkPXBhc3N3b3JkLCBvdmVyLXRscz10cnVlLCBjZXJ0aWZpY2F0ZT0x
# http://8J+Ps++4j+KAjfCfjIjlj7Dmub4gQVBURzIgeDAuNCA9IGh0dHAsIHVwc3RyZWFtLXByb3h5LWFkZHJlc3M9dGVzdC5hcHAuY29tLCB1cHN0cmVhbS1wcm94eS1wb3J0PTExMSwgdXBzdHJlYW0tcHJveHktYXV0aD10cnVlLCB1cHN0cmVhbS1wcm94eS11c2VybmFtZT1oZWxsb3dvcmxkLCB1cHN0cmVhbS1wcm94eS1wYXNzd29yZD1wYXNzd29yZCwgb3Zlci10bHM9dHJ1ZSwgY2VydGlmaWNhdGU9MQ==
# http://8J+HrfCfh7DpppnmuK8gSEtCTiB4MC40ID0gaHR0cCwgdXBzdHJlYW0tcHJveHktYWRkcmVzcz10ZXN0LmFwcC5jb20sIHVwc3RyZWFtLXByb3h5LXBvcnQ9MTExLCB1cHN0cmVhbS1wcm94eS1hdXRoPXRydWUsIHVwc3RyZWFtLXByb3h5LXVzZXJuYW1lPWhlbGxvd29ybGQsIHVwc3RyZWFtLXByb3h5LXBhc3N3b3JkPXBhc3N3b3JkLCBvdmVyLXRscz10cnVlLCBjZXJ0aWZpY2F0ZT0x
# http://8J+HrfCfh7DpppnmuK8gSEtCTjIgeDAuNCA9IGh0dHAsIHVwc3RyZWFtLXByb3h5LWFkZHJlc3M9dGVzdC5hcHAuY29tLCB1cHN0cmVhbS1wcm94eS1wb3J0PTExMSwgdXBzdHJlYW0tcHJveHktYXV0aD10cnVlLCB1cHN0cmVhbS1wcm94eS11c2VybmFtZT1oZWxsb3dvcmxkLCB1cHN0cmVhbS1wcm94eS1wYXNzd29yZD1wYXNzd29yZCwgb3Zlci10bHM9dHJ1ZSwgY2VydGlmaWNhdGU9MQ==


Enum.map(all_nodes, fn node -> 
  case node do
     "vmess://" <> vmess_str ->
        IO.puts "vmess 协议: " <> inspect(Base.decode64(vmess_str, padding: false))
     "http://" <> http_str ->
        IO.puts "http协议: " <> inspect(Base.decode64(http_str, padding: false))
  end
end )

示例输出
# vmess 协议: {:ok, "🇭🇰HK app.fss.run vmess = vmess,app.fas.run,1000,none,\"15a6f21587-41ef-b458-2dec48495d81\",233,group=aliyun_vmess,over-tls=false,certificate=1,obfs=tcp,obfs-path=\"/\",obfs-header=\"host:app.fas.run[Rr][Nn]user-agent:Mozilla/5.0 (iPhone; CPU iPhone OS 12_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148\""}
# http协议: {:ok, "🇰🇷韩国 KT x0.4 = http, upstream-proxy-address=test.app.com, upstream-proxy-port=111, upstream-proxy-auth=true, upstream-proxy-username=helloworld, upstream-proxy-password=password, over-tls=true, certificate=1"}
# http协议: {:ok, "🇯🇵日本 AWS x0.4 = http, upstream-proxy-address=test.app.com, upstream-proxy-port=111, upstream-proxy-auth=true, upstream-proxy-username=helloworld, upstream-proxy-password=password, over-tls=true, certificate=1"}
# http协议: {:ok, "🏳️‍🌈** APTG x0.4 = http, upstream-proxy-address=test.app.com, upstream-proxy-port=111, upstream-proxy-auth=true, upstream-proxy-username=helloworld, upstream-proxy-password=password, over-tls=true, certificate=1"}
# http协议: {:ok, "🏳️‍🌈** APTG2 x0.4 = http, upstream-proxy-address=test.app.com, upstream-proxy-port=111, upstream-proxy-auth=true, upstream-proxy-username=helloworld, upstream-proxy-password=password, over-tls=true, certificate=1"}
# http协议: {:ok, "🇭🇰香港 HKBN x0.4 = http, upstream-proxy-address=test.app.com, upstream-proxy-port=111, upstream-proxy-auth=true, upstream-proxy-username=helloworld, upstream-proxy-password=password, over-tls=true, certificate=1"}
# http协议: {:ok, "🇭🇰香港 HKBN2 x0.4 = http, upstream-proxy-address=test.app.com, upstream-proxy-port=111, upstream-proxy-auth=true, upstream-proxy-username=helloworld, upstream-proxy-password=password, over-tls=true, certificate=1"}

这个在quantumult里订阅后 只识别了一个节点

image

大大请问Richcloud的SSR订阅返回403怎么处理呢

具体报错信息如下:

HTTPError: 获取 rixcloud_ssr 节点时出现错误,相关文件 /var/task/provider/rixcloud_ssr.js ,错误原因: Response code 403 (Forbidden)

Stack:

HTTPError: 获取 rixcloud_ssr 节点时出现错误,相关文件 /var/task/provider/rixcloud_ssr.js ,错误原因: Response code 403 (Forbidden)
at EventEmitter.emitter.on (/var/task/node_modules/got/dist/source/as-promise.js:118:31)
at process._tickCallback (internal/process/next_tick.js:68:7)

[New Features Discussion] Optimize the Clash template file

将Clash的模板文件写在surgui.conf.js不仅有强烈的割裂感,而且不易于管理。对于Clash模板文件的修改方向,我有个不成熟的想法。希望可以在此一起讨论。

port: 7890
socks-port: 7891
allow-lan: true

Proxy:
{{ getClashNodes(nodeList) | yamlArrayPatch | indent(1) }}

Proxy Group:
  - { type: 'select', name: '🕹PROXY', proxies: [ '🌏Group1', '🌏Group2', '🌏Group3' ] }
  - { type: 'select', name: '🌏Group1', proxies: {{ getNodeNames(nodeList, customFilters.aFilter) | yamlInlineArrayPatch }} }
  - { type: 'select', name: '🌏Group2', proxies: {{ getNodeNames(nodeList, customFilters.bFilter) | yamlInlineArrayPatch }} }
  - { type: 'select', name: '🌏Group3', proxies: {{ getNodeNames(nodeList, customFilters.cFilter) | yamlInlineArrayPatch }} }

Rule:
- GEOIP,CN,DIRECT
- MATCH,🕹PROXY
port: 7890
socks-port: 7891
allow-lan: true

Proxy:
  - { type: 'ss', cipher: 'chacha20-ietf', name: 'Node1', password: '000000', port: 1, server: 'example.com', udp: false }
  - { type: 'ss', cipher: 'chacha20-ietf', name: 'Node2', password: '000000', port: 1, server: 'example.com', udp: false }
  - { type: 'ss', cipher: 'chacha20-ietf', name: 'Node3', password: '000000', port: 1, server: 'example.com', udp: false }
  - { type: 'ss', cipher: 'chacha20-ietf', name: 'Node4', password: '000000', port: 1, server: 'example.com', udp: false }
  - { type: 'ss', cipher: 'chacha20-ietf', name: 'Node5', password: '000000', port: 1, server: 'example.com', udp: false }
  - { type: 'ss', cipher: 'chacha20-ietf', name: 'Node6', password: '000000', port: 1, server: 'example.com', udp: false }

Proxy Group:
  - { type: 'select', name: '🕹PROXY', proxies: [ '🌏Group1', '🌏Group2', '🌏Group3' ] }
  - { type: 'select', name: '🌏Group1', proxies: [ 'Node1', 'Node2' ] }
  - { type: 'select', name: '🌏Group2', proxies: [ 'Node3', 'Node4' ] }
  - { type: 'select', name: '🌏Group3', proxies: [ 'Node5', 'Node6' ] }

Rule:
- GEOIP,CN,DIRECT
- MATCH,🕹PROXY

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.