Compare commits

..

1078 Commits

Author SHA1 Message Date
xream
312caa6880 feat: patch http-proxy; 使用 undici 替代 request 2025-03-13 13:02:19 +08:00
xream
15a51e0dd0 fix: 修复文件预览未使用代理策略的问题 2025-03-12 19:44:54 +08:00
xream
8116c78dda feat: 升级 http-proxy-middleware 2025-03-12 15:30:14 +08:00
xream
6a026a3d07 feat: mihomo hysteria2 兼容 obfs_password 字段
Some checks failed
build / build (push) Has been cancelled
2025-03-10 23:06:33 +08:00
xream
cef931fa5d feat: Hysteria2 URI 输入输出支持 hop-interval 和 keepalive 参数, 为保证兼容性, 输出时多端口暂时保持使用 mport 参数 2025-03-10 19:52:15 +08:00
xream
29525b3e22 feat: sing-box hop_interval 和 server_ports 不需要 includeUnsupportedProxy 2025-03-10 19:36:41 +08:00
xream
8f701570e4 feat: Stash 使用 includeUnsupportedProxy 参数开启 XTLS-uTLS-Vision-REALITY(版本>=2.8.0 时自动开启)
Some checks failed
build / build (push) Has been cancelled
2025-03-07 14:09:56 +08:00
xream
3f8269e835 feat: Node.js 环境支持自定义 JSON Body limit, 例: SUB_STORE_BODY_JSON_LIMIT=10mb 2025-03-07 13:59:22 +08:00
xream
465b62218a feat: 验证 mihomo ss cipher
Some checks failed
build / build (push) Has been cancelled
2025-03-05 15:25:16 +08:00
xream
d255390d48 fix: 修复 Surge shadow-tls-password 引号解析
Some checks are pending
build / build (push) Waiting to run
2025-03-04 22:36:47 +08:00
xream
72c7f4333a feat: SurgeMac mihomo 配置中支持自定义 DNS 2025-03-04 20:11:22 +08:00
xream
f35837ff9f feat: 支持 AnyTLS URI
Some checks are pending
build / build (push) Waiting to run
2025-03-03 20:52:31 +08:00
xream
c2c39c5de6 fix: 修复 Egern 输出
Some checks are pending
build / build (push) Waiting to run
2025-03-03 10:42:44 +08:00
xream
87a4b14ae2 feat(wip): 本地脚本支持传入参数 2025-03-02 19:02:15 +08:00
xream
ff1dacda87 区域过滤和协议过滤支持保留模式和过滤模式(后端需 >= 2.17.0, 前端需 >= 2.15.0)
Some checks are pending
build / build (push) Waiting to run
2025-03-02 11:06:33 +08:00
xream
9426f128c4 feat: Surge 输出会判断 HTTP 是否 headers 字段
Some checks are pending
build / build (push) Waiting to run
2025-03-01 21:43:14 +08:00
xream
ebc7173c95 feat: 文件类型为 mihomo 配置时, 来源可以为无
Some checks are pending
build / build (push) Waiting to run
2025-03-01 08:45:17 +08:00
xream
dd4e0cef68 feat: 扩展 scriptResourceCache 缓存, 详见 demo.js
Some checks are pending
build / build (push) Waiting to run
2025-02-28 15:54:04 +08:00
xream
b1618c3803 feat: 支持使用环境变量 SUB_STORE_PRODUCE_CRON 在后台定时处理订阅, 格式为 0 */2 * * *,sub,a;0 */3 * * *,col,b 2025-02-28 14:07:35 +08:00
xream
1b4c046b75 fix: mihomo 覆写可以多次使用
Some checks are pending
build / build (push) Waiting to run
2025-02-27 23:37:39 +08:00
xream
41034ceb46 feat: 规范化 subscription-userinfo 2025-02-27 23:23:32 +08:00
xream
6efb19c856 feat: geo 更新 2025-02-27 17:27:15 +08:00
xream
2cd30dfe68 feat: 内容无变化时 不进行上传; 增加 gist 数量日志
Some checks are pending
build / build (push) Waiting to run
2025-02-26 18:50:11 +08:00
xream
d53947d820 feat: sing-box 支持 anytls
Some checks failed
build / build (push) Has been cancelled
2025-02-23 09:48:09 +08:00
xream
7e75031e92 fix: 修复 short-id 正则
Some checks are pending
build / build (push) Waiting to run
2025-02-22 14:25:06 +08:00
xream
4a07c02dc1 feat: 支持 Shadowrocket Shadowsocks 输入中的 Shadow TLS 参数
Some checks failed
build / build (push) Has been cancelled
2025-02-21 01:44:34 +08:00
xream
95d6688539 fix: 修复 Shadowrocket 输出的 Shadow TLS
Some checks are pending
build / build (push) Waiting to run
2025-02-21 00:50:38 +08:00
xream
a23e2ffcd6 fix: uuid 只辅助判断, 不直接过滤 2025-02-20 22:52:35 +08:00
xream
fda1252d0e fix: 修复 Egern http 传输层 2025-02-20 22:24:39 +08:00
xream
62c5c2e15b fix: 修复 Loon ip-mode
Some checks are pending
build / build (push) Waiting to run
2025-02-19 17:15:31 +08:00
xream
ffabcc9391 feat: 支持 anytls 协议
Some checks are pending
build / build (push) Waiting to run
2025-02-19 17:01:40 +08:00
xream
0825f15d04 feat: Egern 支持 Shadow TLS
Some checks failed
build / build (push) Has been cancelled
2025-02-18 15:07:24 +08:00
xream
fbf6b5ce6e fix: UUID
Some checks failed
build / build (push) Has been cancelled
2025-02-16 05:05:33 +08:00
xream
3eb0816c88 fix: 修复 TUIC URI
Some checks are pending
build / build (push) Waiting to run
2025-02-15 20:47:34 +08:00
xream
8fc755ff02 fix: 文件类型为 mihomo 配置时, 不应处理本地或远程内容字段 2025-02-15 20:32:29 +08:00
xream
6d3d6fa1b3 feat: 仅匹配 UUIDv4 2025-02-15 19:58:34 +08:00
xream
4ef4431c2c feat: 兼容更多 TUIC URI 字段
Some checks are pending
build / build (push) Waiting to run
2025-02-14 23:27:01 +08:00
xream
5058662651 feat: 下载文件名增加前后缀
Some checks are pending
build / build (push) Waiting to run
2025-02-14 15:39:13 +08:00
xream
f9d120bac3 feat: 兼容 v2rayN 非标 TUIC URI
Some checks failed
build / build (push) Has been cancelled
2025-02-13 20:26:59 +08:00
xream
72a445ae33 doc: README 2025-02-12 22:39:18 +08:00
xream
5e2a87e250 fix: 修复 Shadowsocks URI 解析
Some checks are pending
build / build (push) Waiting to run
2025-02-12 19:21:24 +08:00
xream
71fc9affbf feat: 支持 v2ray SOCKS URI 的输入和输出
Some checks are pending
build / build (push) Waiting to run
2025-02-12 03:27:40 +08:00
xream
6f82294c49 fix: 修复 Egern VMess tcp 2025-02-11 23:56:45 +08:00
xream
7c398ba51c fix: 修复 mihomo 覆写配置无法使用普通脚本的问题
Some checks are pending
build / build (push) Waiting to run
2025-02-11 13:18:42 +08:00
xream
7002eee88d feat: 调整 Egern VMess 传输层
Some checks are pending
build / build (push) Waiting to run
2025-02-10 21:02:40 +08:00
xream
bd21d58fe7 feat: VMess/VLESS 校验 uuid
Some checks are pending
build / build (push) Waiting to run
2025-02-10 13:34:58 +08:00
xream
2ea46dcbf1 feat: Shadowsocks URI 部分逻辑修正
Some checks are pending
build / build (push) Waiting to run
2025-02-10 06:44:24 +08:00
xream
4a2a2297f6 feat: Shadowsocks URI 支持 Shadow TLS plugin 2025-02-10 06:32:17 +08:00
xream
07d5a913f0 feat: 同步配置逻辑优化
Some checks are pending
build / build (push) Waiting to run
2025-02-09 20:58:27 +08:00
xream
421df8f0d4 doc: README 2025-02-07 19:43:06 +08:00
xream
e14944dd19 feat: 调整 Egern VMess security 逻辑
Some checks failed
build / build (push) Has been cancelled
2025-02-06 18:18:15 +08:00
xream
bf18c51f6a feat: mihomo 和 Shadowrocket VMess cipher 支持 zero 2025-02-06 18:08:46 +08:00
xream
23e8fbd1b7 feat: Proxy URI Scheme 支持省略端口号(http 默认为 80, tls 默认为 443) 2025-02-06 14:59:50 +08:00
xream
b94b3c366b feat: Egern 正式支持 Shadowsocks 2022
Some checks are pending
build / build (push) Waiting to run
2025-02-06 00:04:54 +08:00
xream
afb5f7b880 feat: 支持 VLESS spx 参数; 支持 Trojan 结合 REALITY/XHTTP 2025-02-05 20:01:41 +08:00
xream
74ec133a79 feat: Loon 正式支持 Shadow-TLS
Some checks failed
build / build (push) Has been cancelled
2025-02-03 13:47:17 +08:00
xream
2a76eb6462 feat: mihomo snell 版本小于 3 的节点, 强制去除 udp 字段, 防止内核报错
Some checks are pending
build / build (push) Waiting to run
2025-02-02 18:59:14 +08:00
xream
9ac5e136a6 feat: 去除订阅流量信息中空字段, 增强兼容性 2025-02-02 18:39:46 +08:00
xream
38f5a97a20 fix: 修复 Surge 输入的 tfo
Some checks failed
build / build (push) Has been cancelled
2025-01-31 15:14:19 +08:00
xream
14a3488ce2 fix: 修复 Egern 和 Stash 可根据 User-Agent 自动包含官方/商店版/未续费订阅不支持的协议
Some checks failed
build / build (push) Has been cancelled
2025-01-26 20:41:57 +08:00
xream
6afec4f668 feat: Egern 增加 TUIC
Some checks failed
build / build (push) Has been cancelled
2025-01-23 08:22:48 +08:00
xream
b1874e510d feat: 支持 VLESS XHTTP extra
Some checks are pending
build / build (push) Waiting to run
2025-01-22 09:43:43 +08:00
xream
48aaaf5c99 doc: README 2025-01-21 12:02:49 +08:00
xream
7385e17a4c fix: 修复 Base64 合法性判断
Some checks failed
build / build (push) Has been cancelled
2025-01-17 16:34:30 +08:00
xream
c3daea55ab feat: Loon 节点支持 ip-mode
Some checks failed
build / build (push) Has been cancelled
2025-01-15 23:54:35 +08:00
xream
fc9ff48b1f fix: ss none 必须配置 password 2025-01-15 23:11:34 +08:00
xream
fb21890b68 fix: 修复组合订阅空 subscription-userinfo 的问题
Some checks failed
build / build (push) Has been cancelled
2025-01-14 11:34:02 +08:00
xream
2155cc9639 fix: 修复组合订阅中的单条订阅透传 User-Agent 2025-01-14 08:25:53 +08:00
xream
03e320cbd0 feat: 组合订阅中的单条订阅也支持透传 User-Agent
Some checks are pending
build / build (push) Waiting to run
2025-01-13 20:09:00 +08:00
xream
e325b9a39a feat: Loon 排除 XTLS; 切换使用 esbuild 打包 2025-01-13 16:03:52 +08:00
xream
87597f6fc2 ci: pnpm
Some checks are pending
build / build (push) Waiting to run
2025-01-13 14:44:34 +08:00
xream
3462d36c35 feat: Egern 和 Stash 可根据 User-Agent 自动包含官方/商店版/未续费订阅不支持的协议 2025-01-13 14:27:08 +08:00
xream
02946ec81c feat: Surge 默认开启 Shadowsocks 2022 2025-01-13 14:00:38 +08:00
xream
c963c872ff feat: Egern 使用 includeUnsupportedProxy 参数开启 Shadowsocks 2022
Some checks failed
build / build (push) Has been cancelled
2025-01-12 06:12:14 +08:00
xream
c4a1bb4ea1 feat: Loon 使用 includeUnsupportedProxy 参数开启 Shadowsocks/ShadowsocksR + Shadow TLS 2025-01-11 23:34:00 +08:00
xream
f96d9dea74 feat: 日志中增加上传配置的响应
Some checks failed
build / build (push) Has been cancelled
2025-01-09 18:56:36 +08:00
xream
01eb69d8ae ci: GitHub Action
Some checks are pending
build / build (push) Waiting to run
2025-01-09 09:35:07 +08:00
xream
797ba6f601 fix: 修复 Loon Shadow TLS 2025-01-09 09:30:16 +08:00
xream
128353a7f3 feat: gist 单页数量改为 100 2025-01-09 09:14:36 +08:00
xream
e6f6d51608 feat: Loon 使用 includeUnsupportedProxy 参数开启 Shadowsocks + Shadow TLS V3
Some checks are pending
build / build (push) Waiting to run
2025-01-08 22:52:00 +08:00
xream
589a6bfadb feat: Base64 Pre-processor 检测解码是否正常
Some checks are pending
build / build (push) Waiting to run
2025-01-08 20:13:46 +08:00
xream
75012503f8 fix: 修复 Clash Pre-processor 2025-01-08 19:49:34 +08:00
xream
85a3e2ee54 feat: 文件支持 Mihomo 配置, 支持使用覆写; target 名称适配大小写和别名
Some checks failed
build / build (push) Has been cancelled
2025-01-03 23:37:50 +08:00
xream
95b7557635 feat: Loon 正式支持 Shadowsocks 2022
Some checks failed
build / build (push) Has been cancelled
2024-12-31 23:24:35 +08:00
xream
14ca62db4a doc: demo.js
Some checks are pending
build / build (push) Waiting to run
2024-12-31 15:28:32 +08:00
xream
a2a754adb7 feat: sing-box 支持使用 _network 字段来设置 network 2024-12-31 15:27:14 +08:00
xream
6b23f82953 fix: 修复代理 App 版中路由 target 参数为空的情况
Some checks are pending
build / build (push) Waiting to run
2024-12-30 21:36:45 +08:00
xream
e071a7f253 feat: 组合订阅和文件的导出导入 2024-12-30 21:21:18 +08:00
xream
b9bba895e1 feat: 支持订阅级别的 noCache 2024-12-29 23:37:07 +08:00
xream
8090d678ee feat: 分享支持多一级路由指定输出目标 2024-12-29 22:08:24 +08:00
xream
ff4be7ac38 feat: 订阅支持开关 passThroughUA 透传请求的 User-Agent 2024-12-29 21:33:15 +08:00
xream
7e2109dc68 feat: 支持订阅参数 url 同时支持单条本地节点内容, 支持多一级路由指定输出目标 2024-12-29 21:03:52 +08:00
xream
278beae99a feat: 支持 Egern 前置代理 prev_hop 和 Hysteria2 端口跳跃 2024-12-29 20:05:55 +08:00
xream
3aedd5943d feat: sing-box includeUnsupportedProxy 开启支持 Hysteria2 端口跳跃 2024-12-29 16:07:33 +08:00
xream
222551eb20 feat: Egern 增加默认 sni 2024-12-28 21:00:40 +08:00
xream
0d5e1ab38b feat: 下载订阅的日志中增加请求 target 和实际输出 2024-12-28 17:42:26 +08:00
xream
a3ec98caa9 feat: Clash 订阅仅缓存 proxies 数据 2024-12-27 21:55:13 +08:00
xream
d9e4d814bb feat: geo 更新 2024-12-27 21:35:51 +08:00
xream
e843aa3702 feat: geo 更新 2024-12-26 03:40:53 +08:00
xream
66464645f2 feat: UDP 协议跳过设置 utls 2024-12-24 21:43:23 +08:00
xream
9ccd6b3816 doc: demo.js 2024-12-24 20:49:41 +08:00
xream
74be1e3d82 doc: README 2024-12-24 15:10:38 +08:00
xream
6d78eb7356 feat: Clash 系输入支持 mieru; 调整 juicity 和 mieru 相关过滤逻辑 2024-12-24 15:08:28 +08:00
xream
38eccca8b4 feat: 组合订阅支持手动设置流量信息. 支持使用链接. 此时使用响应内容 2024-12-24 01:20:38 +08:00
xream
33e5aeceb5 fix: 修复订阅不存在时不打印错误日志的问题 2024-12-23 14:14:10 +08:00
xream
837667edc9 feat: 手动设置流量信息时, 支持使用链接. 此时使用响应内容 2024-12-22 21:57:01 +08:00
xream
0069b0ce83 feat: sing-box 支持 detour 参数(之前只能用 underlying-proxy 或 dialer-proxy 来设置) 2024-12-22 20:06:00 +08:00
xream
fcc9d047ae fix: 修复 edns sourcePrefixLength 2024-12-21 21:13:09 +08:00
xream
382d22e622 feat: 支持 socks5, socks5+tls, http, https(便于输入) 格式输入 2024-12-16 21:06:46 +08:00
xream
06f3e97af2 feat: 支持 Shadowsocks 2022 的 URI 输入/输出 2024-12-15 23:03:41 +08:00
xream
bd87e9231e fix: 修复 Surge SOCKS5 解析 2024-12-13 02:27:03 +08:00
xream
d1d6d19542 feat: Mihomo 支持 direct 2024-12-12 18:35:55 +08:00
xream
08bf0b78bb feat: Surge 支持 direct 2024-12-12 18:22:25 +08:00
xream
9a3cd4f57c feat: 处理状态码 2024-12-12 15:35:19 +08:00
xream
d015c7867e fix: 修复 SS URI 解析 2024-12-08 11:24:46 +08:00
xream
4713b63083 feat: Loon 使用 includeUnsupportedProxy 参数开启 Shadowsocks 2022 2024-12-05 23:50:51 +08:00
xream
dbf9e7c360 feat: 优化去除无效节点逻辑 感谢群友 Cooip JM 2024-12-05 12:45:07 +08:00
xream
4ea84118c4 feat: gRPC 支持 authority 2024-12-05 00:52:11 +08:00
xream
dda8113a42 feat: 增加 subscription-userinfo 兼容性 2024-12-04 00:56:53 +08:00
xream
f16b2d34f1 feat: geo 更新 2024-11-30 13:58:04 +08:00
xream
5b28e1a4c9 feat: 支持禁用节点操作 2024-11-29 21:03:29 +08:00
xream
8d0a71d983 feat: VMess URI 输出支持 alterId; Trojan 支持 fp 和 alpn 2024-11-28 16:04:52 +08:00
xream
815552d470 feat: 找不到资源时不通知, 仅保留日志 2024-11-28 15:44:55 +08:00
xream
9d90369594 feat: Trojan URI 支持省略端口号 2024-11-28 13:15:22 +08:00
xream
6aece471aa feat: Stash 使用 includeUnsupportedProxy 参数开启 Shadowsocks 2022 2024-11-27 15:20:20 +08:00
xream
99396773f6 ci: 去除 GitLab Sync 2024-11-26 15:01:04 +08:00
xream
e229408a2d feat: 默认缓存阈值 1024KB 2024-11-24 12:31:18 +08:00
xream
514414587b feat: 默认超时 8000ms 2024-11-24 12:13:52 +08:00
egerndaddy
d4c419745e Update Egern.yaml 2024-11-22 23:59:59 +08:00
xream
fe3da254f4 feat: 支持 Egern 输出 2024-11-21 13:16:04 +08:00
xream
7d8132d7cd feat: 默认输出格式改为 V2Ray; accept 为 application/json 时, 输出 JSON; 响应增加 X-Powered-By Sub-Store 2024-11-19 23:06:45 +08:00
xream
bc1247efaf feat: 手动设置的订阅流量信息会附加到订阅自己的流量信息之前 2024-11-17 23:40:03 +08:00
xream
dea937df66 feat: 默认查询流量信息的 User-AgentQuantumult%20X/1.0.30 (iPhone14,2; iOS 15.6) 改为 clash; 流量信息缓存逻辑调整 2024-11-17 02:10:38 +08:00
xream
cfb5a8e082 feat: 支持解析订阅中的 profile-web-page-url 字段 2024-11-17 01:02:28 +08:00
xream
4790bf47d1 feat: Surge 密码解析支持首尾成对的单引号双引号, 输出时增加双引号 2024-11-16 21:50:52 +08:00
xream
56fd495fb6 feat: 支持更多的 subscription-userinfo 2024-11-12 22:20:46 +08:00
xream
f4639d9a34 feat: 支持更多的 subscription-userinfo 2024-11-12 22:06:22 +08:00
xream
cc58a5541e feat: 订阅刷新按钮逻辑调整为无缓存刷新订阅和流量 2024-11-10 01:22:48 +08:00
xream
772f431887 feat: 模块版文件中增加 token 路由 2024-11-08 18:10:39 +08:00
xream
2b60c515cd feat: 支持管理 token 2024-11-04 13:59:57 +08:00
xream
c8c22c3901 fix: 修复 VMess URI SNI 2024-11-01 20:27:23 +08:00
xream
d8f9466b84 feat(wip): 支持自定义 share token 2024-10-31 23:33:34 +08:00
xream
d12ccad382 feat: MMDB 加入 $utils.ipasn 2024-10-31 01:39:13 +08:00
xream
b4358663cc feat(wip): 支持 JWT 2024-10-31 00:23:45 +08:00
xream
aba6264988 feat(wip): 支持 JWT 2024-10-30 23:08:01 +08:00
xream
2320ab3838 feat(wip): 支持 JWT 2024-10-30 22:51:31 +08:00
xream
542957d34a feat(wip): 支持 JWT 2024-10-30 22:27:39 +08:00
xream
07e50175f9 feat: cipher 应为小写 2024-10-30 16:07:27 +08:00
xream
e09d66060d feat: 远程订阅支持 insecure 不验证服务器证书 2024-10-30 14:33:34 +08:00
xream
b048ecdfff fix: 修复 surge mac 未开启 mihomo 时, 对于不支持的节点未报错, 导致出现 proxy 为 undefined 的问题 2024-10-29 18:31:02 +08:00
xream
aac72fb9a3 feat: Surge 支持 udp-port, 修复 udp-relay 参数解析 2024-10-27 19:00:42 +08:00
xream
baec193e5c feat: 支持 VLESS mKcp 2024-10-23 17:38:59 +08:00
xream
8fe818f826 fix: 处理乱填的订阅流量信息解析报错 2024-10-19 19:12:25 +08:00
xream
72286984ec fix: 修复 YAML 处理 undefined 的问题 2024-10-18 12:38:58 +08:00
xream
27e693c308 feat: ⚠️ BREAKING CHANG 仅手动指定 target 为 SurgeMac 时, 启用 mihomo 来支援 Surge 本身不支持的协议 2024-10-17 20:26:07 +08:00
xream
6cf8080cd3 fix: 修复 VMess VLESS servername 2024-10-17 14:01:44 +08:00
xream
839fcacf63 fix: 修复传输层和 SNI 的问题(有问题麻烦即时反馈 谢谢) 2024-10-16 21:31:41 +08:00
xream
a2e45bcb10 commit
feat: Surge 支持 Shadowsocks 2022(为了兼容 必须使用 `includeUnsupportedProxy` 参数或开启 `包含官方/商店版不支持的协议` 开关)
2024-10-15 17:00:13 +08:00
xream
ea0eb91691 doc: README 2024-10-12 14:51:58 +08:00
xream
1f0ddf2d28 fix: 修复组合订阅预览 2024-10-12 10:46:39 +08:00
xream
a660c6ff90 feat: 组合订阅支持通过单条订阅的标签进行关联 2024-10-11 20:57:45 +08:00
xream
71d9adbc07 chore: bump release version 2024-10-11 20:00:09 +08:00
pillarcoin
97bec9183a fix: clash 配置中 VLESS 节点的 short-id 值被错误解析 2024-10-11 19:10:02 +08:00
xream
ef85b6d0e9 feat: 文件支持设置代理/策略, 链接支持传入 proxy 参数指定代理/策略; 修复代理/策略优先级 2024-10-07 22:05:07 +08:00
xream
8ffb060cb4 feat: 组合订阅支持设置代理/策略, 链接支持传入 proxy 参数指定代理/策略 2024-10-07 20:56:33 +08:00
xream
6d43961e96 feat: Node.js 支持使用环境变量 SUB_STORE_BACKEND_DEFAULT_PROXY 设置默认代理; ProxyUtils 增加 download 方法 2024-10-07 18:43:29 +08:00
xream
f3200aea8c feat: 流量和同步配置也使用默认代理/策略 2024-10-07 18:34:39 +08:00
xream
e2346d16a2 feat: 新增全局代理/策略设置, 前端 > 2.14.265 2024-10-07 18:05:06 +08:00
xream
dc320eaa6c feat(file): 新增启用下载(文件名为显示名称), 前端 > 2.14.264 2024-10-07 17:26:15 +08:00
xream
02031019f7 doc: demo.js 2024-09-22 06:02:58 +08:00
xream
5d09fe782f feat: 增加 _subDisplayName _collectionDisplayName 2024-09-18 19:42:53 +08:00
xream
6e425e5908 doc: demo.js 2024-09-18 19:22:12 +08:00
xream
d10c9233c0 feat: 正式弃用旧的 subName 和 collectionName 2024-09-18 19:18:50 +08:00
xream
cc556b641d fix: 修复 password 为数字时的 bug 2024-09-16 01:43:16 +08:00
xream
de2813b035 feat: 使用自定义缓存时 cacheKey 的值不能为空 2024-09-13 23:42:55 +08:00
xream
c9158ceb1d feat: 内置的 Google/Cloudflare DNS 更换为 DoH 2024-09-09 14:56:47 +08:00
xream
5cf0c98f5f chroe: 修改脚本链接为 release 分支 2024-09-07 23:21:42 +08:00
xream
7d0414f8ca fix: 传输层 path 应为以 / 开头的字符串 2024-09-05 17:39:42 +08:00
xream
bee1d62a1a fix: 传输层 path 应以 / 开头 2024-09-05 17:15:30 +08:00
xream
72bc9b9456 feat: 处理非字符串的 ports 字段 2024-09-04 13:40:17 +08:00
xream
3b4c14e7d0 doc: README 2024-09-04 10:49:52 +08:00
xream
59d93483bb feat: Node.js 版支持环境变量 SUB_STORE_BACKEND_DOWNLOAD_CRON 设置定时恢复配置, SUB_STORE_BACKEND_UPLOAD_CRON 设置定时备份配置, SUB_STORE_BACKEND_SYNC_CRON 设置定时同步订阅/文件 2024-09-04 02:20:28 +08:00
xream
75d88c02c7 feat: SurgeMac 支持使用 mihomo 来支援 Surge 本身不支持的协议; 弃用旧的 ssr-local 方案 2024-09-03 20:31:42 +08:00
xream
99d5868cff feat: 订阅和文件的请求链接支持传入 $options , 可在脚本中使用 2024-09-03 13:58:10 +08:00
xream
e1489a3cf7 feat: sing-box VLESS Reality uTLS 默认启用 2024-09-02 21:20:22 +08:00
xream
59fe16a7b0 feat: Surge Hysteria2 与 TUIC 协议支持端口跳跃; Hysteria2 URI 的端口部分支持 端口跳跃 的「多端口地址格式」 2024-09-02 16:38:21 +08:00
xream
562d349629 feat: 脚本操作传入上下文 require (仅对应的环境支持)" 2024-08-31 22:39:54 +08:00
egerndaddy
9ce14351c5 doc: 添加 Egern 模块链接 2024-08-29 13:26:27 +08:00
egerndaddy
76e781c711 Create Egern.yaml 2024-08-29 13:09:59 +08:00
xream
f0acf4a2a7 fix: DoH 结果过滤 2024-08-29 12:30:49 +08:00
xream
9abeb4ce7b fix: 修复 SurgeMac ShadowsocksR obfs-param 2024-08-28 14:51:06 +08:00
xream
153802c7c4 feat: Loon SOCKS5 UDP 2024-08-26 00:33:22 +08:00
xream
19418b631f feat(uri): VMess URI 输入支持 allowInsecure(输出不支持, 与 2dust/v2rayN 分享链接逻辑一致) 2024-08-18 15:53:13 +08:00
xream
97caeed208 feat(geo): 增加 利雅得 Riyadh 2024-08-17 14:06:28 +08:00
xream
dd8d1d85e8 feat: 支持 Loon tls-pubkey-sha256, tls-cert-sha256 2024-07-30 22:17:25 +08:00
xream
14ed56b5d5 chore: 传输层应该有配置, 暂时不考虑兼容不给配置的节点 2024-07-24 11:27:33 +08:00
xream
9785271c5b chore: 增加部分 clash.meta(mihomo) 内核客户端的 User-Agent(clash-verge, flclash) 2024-07-20 14:48:39 +08:00
xream
05bdf95a29 feat: 处理端口跳跃(感谢亚托莉佬) 2024-07-19 15:23:44 +08:00
xream
317a804b36 fix: 修复 URI 报错 2024-07-19 14:33:34 +08:00
xream
10ec8a25a2 feat: 处理不规范的 hysteria2 节点 2024-07-19 09:45:28 +08:00
xream
aa0943a909 fix: 被识别为 IP4P 的域名解析结果均增加 _IP4P 字段; 修复报错 2024-07-18 19:48:01 +08:00
xream
a0c1bbbf70 fix: 域名解析修复; 结果增加 _IP4P 字段 2024-07-18 19:42:57 +08:00
xream
fea9de4fae feat: IP4P 合并进 IPv6; ProxyUtils 中增加 ipAddress 2024-07-18 18:35:22 +08:00
xream
cddd1818fe chore: bump release version 2024-07-08 02:51:21 +08:00
xream
f94830b2df Merge pull request #339 from zhiqiang02/add-tai-wan-keyword
Add 'Tai Wan' as a keyword for Taiwan flag
2024-07-08 02:50:13 +08:00
zhiqiang02
e02a26040e Add 'Tai Wan' as a keyword for Taiwan flag
碰到了某机场奇奇怪怪的节点名
2024-07-08 02:38:50 +08:00
xream
6906efdd55 chore: bump release version 2024-07-02 21:04:14 +08:00
xream
9558b63261 Merge pull request #336 from cooip-jm/patch-1
处理grpc-opts为 {} 的情况
2024-07-02 21:03:30 +08:00
cooip-jm
4bfdef17ee 处理grpc-opts为 {} 的情况
该字段仅影响sing-box内核,对mihomo无影响
2024-07-02 21:01:11 +08:00
xream
9d29fc8a09 feat: 处理 reality-opts 为 {} 的情况 2024-07-02 20:39:04 +08:00
xream
f524920c13 feat: 文件支持设置 查询流量信息订阅链接. 服务器版中使用此链接可在响应中传递订阅流量信息 2024-06-28 18:34:26 +08:00
xream
bfe072cbdf feat: 域名解析支持自定义 EDNS(需新版前端) 2024-06-22 11:45:37 +08:00
xream
32dcca4a26 feat: 域名解析支持自定义 DoH(需新版前端) 2024-06-20 21:42:15 +08:00
xream
a5d77c39c8 feat: 域名解析增加超时参数(默认使用全局超时) 2024-06-20 13:41:05 +08:00
xream
6ea1b69a62 doc: demo.js 增加更多字段的说明 2024-06-20 11:44:07 +08:00
xream
2b3b9177e5 feat: 域名解析新增 _resolved_ips 为解析出的所有 IP 2024-06-20 11:28:17 +08:00
xream
91aab3ca7a fix: 修复 Tencent DNS 缓存 2024-06-20 10:59:06 +08:00
xream
c1a9fc6abc fix: 修复 Loon Hysteria2 salamander 混淆 2024-06-17 11:08:43 +08:00
xream
11d9ce7372 feat: 支持 Loon Hysteria2 salamander 混淆 2024-06-16 21:49:13 +08:00
xream
ad3d2270ac feat: 读取节点的 ca-str 和 _ca (后端文件路径) 字段, 自动计算 fingerprint 2024-06-13 20:44:12 +08:00
xream
3ad42f2c10 feat: Stash 支持 juicity, ssh 2024-06-12 15:16:56 +08:00
xream
ec06eb8659 fix: sing-box tls cert 应该为数组 2024-06-10 19:10:57 +08:00
xream
4a23a4d8b6 fix: tlsParser typo 2024-06-10 19:07:19 +08:00
xream
913638a233 feat: /api/sub/flow/:name 接口支持指定远程订阅 url(可携带订阅 url 支持的参数, 例如 flowUserAgent) 2024-06-10 13:24:06 +08:00
xream
bf642ce0e6 fix: 兼容空的订阅链接 2024-06-09 01:42:40 +08:00
xream
1ecac9da92 chore: demo.js 2024-06-06 21:50:13 +08:00
xream
c5a417da8f feat: VMess URI 支持 TCP/H2 传输层 2024-06-03 21:14:07 +08:00
xream
8cd0545023 feat: ws, http, h2 传输层补全 path 2024-06-03 00:34:03 +08:00
xream
b6f848a6e6 feat: ProxyUtils.removeFlag 2024-06-02 18:30:53 +08:00
xream
99d058bcf1 feat: 支持 flowUrl 2024-06-02 16:03:01 +08:00
xream
533103e765 feat: 进一步优化乐观缓存和同步配置的逻辑 2024-06-01 20:09:57 +08:00
xream
cf82764171 feat: 进一步优化乐观缓存和同步配置的逻辑 2024-06-01 19:50:16 +08:00
xream
7b783c1fe3 fix: 简单修复乐观缓存(当异步更新乐观缓存时, 若存在常规缓存, 将使用常规缓存) 2024-05-31 20:52:01 +08:00
xream
372eff9a44 chore: 文案 2024-05-31 11:42:23 +08:00
xream
d3b5a529d7 doc: README 2024-05-30 21:32:48 +08:00
xream
8049134bb5 feat: Surge includeUnsupportedProxy 去除 HTTP 传输层(不一定能通, 由服务端配置确定) 2024-05-30 18:41:56 +08:00
xream
3f620700a4 feat: GUIforCores 请求增加参数 proxy, timeout 2024-05-30 17:19:38 +08:00
xream
9e64a68481 fix: VMess URI 输入传输层为 HTTP 时, path 默认为 / 2024-05-30 14:28:02 +08:00
xream
9ce5916414 fix: 乐观缓存未捕获错误 2024-05-30 13:10:08 +08:00
xream
047c21fe70 feat: 节点上的额外参数调整为下划线开头, 原参数目前仍保留, 若有脚本需要使用这些参数请尽快修改(_subName, _collectionName, _resolved, _no-resolve) 2024-05-30 04:48:13 +08:00
xream
47849dc6d0 feat: 节点上的额外参数调整为下划线开头, 原参数目前仍保留, 若有脚本需要使用这些参数请尽快修改(_subName, _collectionName, _resolved) 2024-05-30 04:28:54 +08:00
xream
af06086c1b chore: 去除 Surge/Surfboard 输出节点名中的逗号和等号 2024-05-29 19:15:52 +08:00
xream
4a6a147667 feat: 新增 定时处理订阅 功能, 避免 App 内拉取超时 2024-05-28 12:05:35 +08:00
xream
c6540d14cd feat: Surge Beta 模块支持定时处理订阅. 一般用于定时处理耗时较长的订阅, 以更新缓存. 这样 Surge 中拉取时就能用到缓存, 不至于总是超时 2024-05-28 02:31:25 +08:00
xream
3db71ec531 fix: Base64 输入支持 hy2:// 2024-05-26 10:28:46 +08:00
xream
cf156c2f17 fix: Stash 服务器证书 SHA256 指纹字段为 server-cert-fingerprint 2024-05-25 18:54:51 +08:00
xream
e28e2a78fb feat: 下载订阅日志中增加请求的 User-Agent 2024-05-25 18:29:48 +08:00
xream
b0a2c709e8 fix: Stash 服务器证书 SHA256 指纹字段为 server-cert-fingerprint 2024-05-21 11:05:45 +08:00
xream
5dc2c8ced7 chore: demo.js 2024-05-20 17:42:09 +08:00
xream
d2a65ee0fe chore: demo.js 2024-05-20 17:38:49 +08:00
xream
4dd4ae98ca chore: 最新版 Surge 已删除 ability: http-client-policy 参数, 模块暂不做修改, 对测落地功能无影响 2024-05-18 23:57:18 +08:00
xream
0d41eb467f feat: 某些域名仅支持从国内 DNS 解析正确结果, 为方便部署在海外的用户, 使用国内 DNS 解析时, ECS IP 指定为国内 IP 2024-05-18 22:24:58 +08:00
xream
ba1c91a7a5 chore: 文案 2024-05-17 17:49:10 +08:00
xream
30fa87c172 doc: Shadowrocket 模块 2024-05-15 20:58:55 +08:00
xream
1eaa33948b chore: bump release version 2024-05-14 20:45:39 +08:00
xream
619e256ed8 Merge pull request #322 from onejibang/master
chore: Change network request method
2024-05-14 20:45:00 +08:00
onejibang
b46209e164 chore: Change network request method 2024-05-14 16:51:05 +08:00
xream
a1ba4e273e chore: bump release version 2024-05-13 19:44:27 +08:00
xream
bfc95ed92a Merge pull request #320 from onejibang/feature-gui-for-cores
feat: 适配GUI.for.Cores项目组下的客户端程序
2024-05-13 19:41:45 +08:00
xream
32f591ec56 Merge branch 'master' into feature-gui-for-cores 2024-05-13 19:41:28 +08:00
onejibang
cea16d8c44 chore: Canonical variable name 2024-05-13 19:22:33 +08:00
onejibang
93a1ba7b50 feat: support HEAD method 2024-05-13 19:12:22 +08:00
xream
e6d1aa1150 feat: 使用了自定义缓存 cacheKey 的远程订阅 调整为乐观缓存 2024-05-13 17:08:17 +08:00
onejibang
26e83798da feat: Provide virtual disk operation API 2024-05-13 16:35:05 +08:00
xream
b083d2d840 feat: Node.js 版支持 MMDB, 通过环境变量或在脚本中传入数据库文件路径, 可使用 ipaso 和 geoip 方法 2024-05-12 23:17:11 +08:00
onejibang
cf35afcab2 Adapted for GUI.for.Cores 2024-05-11 17:32:01 +08:00
xream
d073dfeef8 feat: 支持 Trojan, VMess, VLESS httpupgrade(暂不支持 Shadowsocks v2ray-plugin) 2024-05-10 10:15:11 +08:00
Peng-YM
f970ea3361 Update README.md 2024-05-09 09:38:36 +08:00
xream
630bac0575 fix: 简单修复 SS URI 多参数拼接 2024-05-05 02:14:55 +08:00
xream
7f3cb2b191 feat: 当无插件参数时, 去除 SS URI 输出中的 / 以兼容部分客户端 2024-05-05 02:11:50 +08:00
xream
92e1e4a0fb feat: ProxyUtils 中增加 Gist 类; 补充 demo.js 中的示例 2024-05-04 21:35:27 +08:00
xream
3b85d313fe fix: 兼容不规范的 QX URI 2024-05-03 03:56:59 +08:00
xream
c91d8e28e4 fix: 哪吒探针在线时长 2024-04-30 15:39:14 +08:00
xream
8cbb4492be feat: 全部是 WireGuard 节点的订阅, 支持输出为 Surge 模块 2024-04-25 16:55:32 +08:00
xream
6f7da57e3a fix: 旗帜操作中将 🏴‍☠️ 🏳️‍🌈 也视为已有旗帜并在删除后添加新旗帜 2024-04-25 13:38:01 +08:00
xream
2586c29746 fix: 处理手动删除 Gist 之后, Sub-Store 侧重新同步的逻辑 2024-04-23 09:28:39 +08:00
xream
6f7fe8204b feat: 支持完整导出和导入 Sub-Store 单条订阅数据 2024-04-22 15:15:57 +08:00
xream
bafaf07743 Merge pull request #314 from eric-gitta-moore/master
feat: script ip-flag for node
2024-04-22 13:09:33 +08:00
Eric Moore
9962eb0947 feat: script ip-flag for node 2024-04-22 12:59:06 +08:00
xream
ac5232a7bc ci: restore the functionality of generating conventional changelog 2024-04-22 04:25:19 +08:00
xream
2301ccbfb5 fix: 修复对不规范的节点名称的处理 2024-04-22 02:51:44 +08:00
xream
0b5761e5fc feat: QX 输出正式支持 VLESS 2024-04-22 02:15:54 +08:00
xream
3ab21b0e26 feat: 支持 Loon SOCKS5/SOCKS5-TLS 2024-04-21 12:36:11 +08:00
xream
89ab72e46c doc: README 2024-04-21 11:32:23 +08:00
xream
18bd6526d0 chore: 增加探针版本(没有自定义的必要吧 默认为 0.0.1) 2024-04-20 07:45:49 +08:00
xream
c7329c32eb feat: 哪吒探针网络监控接口支持用参数传入检测次数; 节点字段上自定义的多个次数, 只取最大值 2024-04-19 06:27:45 +08:00
xream
4819ae95e4 feat: 哪吒探针网络监控接口提示不兼容的节点, 支持传入节点名 2024-04-19 05:57:26 +08:00
xream
370d228b04 feat: 订阅兼容哪吒探针网络监控接口(Loon/Surge 可输出节点延迟) 2024-04-19 05:16:24 +08:00
xream
d092916168 fix: sing-box wireguard 2024-04-17 11:36:23 +08:00
xream
0c93de48ab feat: GEO 增加 TYO 2024-04-17 05:50:50 +08:00
xream
274aa50373 ci: GitHub Actions: Transitioning from Node 16 to Node 20 2024-04-17 01:12:07 +08:00
xream
e24de8d0b6 feat: 支持 WireGuard URI 输入和输出 2024-04-17 00:56:53 +08:00
xream
93a5ce6c3b feat: 支持 dialer-proxy, detour 2024-04-14 21:34:45 +08:00
xream
cb66c8daa2 feat: fancy-characters 增加 modifier-letter(小写没有 q, 用 ᵠ 替代. 大写缺的太多, 用小写替代) 2024-04-12 22:39:59 +08:00
xream
f4cdc953e6 feat: 支持设置并在远程订阅失败时读取最近一次成功的缓存 2024-04-09 20:49:42 +08:00
xream
2a1c2eb9df chore: 处理订阅输出哪吒探针兼容响应的 Uptime 字段 2024-04-09 13:48:33 +08:00
xream
6217c2e5cd fix: 修复 sing-box wireguard reserved 2024-04-07 19:48:08 +08:00
xream
f90d9c2fd1 chore: Surge 模块文案 2024-04-07 16:40:09 +08:00
xream
3e952e9e88 chore: Surge 默认模块更新为支持编辑参数的版本 2024-04-06 19:40:30 +08:00
xream
a81b55f752 doc: demo.js 2024-04-05 13:46:07 +08:00
xream
33652af516 feat: 订阅支持输出哪吒探针兼容响应; 清理输出数据; 增加内部数据字段 2024-04-05 13:37:15 +08:00
xream
2bca669930 fix: 修复 SS URI 解析错误 2024-04-04 16:52:46 +08:00
xream
f1bf0e1e8d fix: 修复 Tencent DNS 解析 2024-04-04 15:26:19 +08:00
xream
16b9cd9aaf feat: GEO 增加 AMS 2024-04-03 00:45:48 +08:00
xream
32eb069ab2 feat: GEO 增加 JNB, SJC, SEL 2024-04-02 21:06:56 +08:00
xream
4c9f8011c7 fix: 修复内蒙古识别为蒙古的问题 2024-04-02 20:56:07 +08:00
xream
bd26b0a561 feat: 区域过滤增加韩国德国 2024-04-02 20:40:13 +08:00
xream
958d1e52c8 chore: 日志输出增加订阅的来源 User-Agent 2024-03-31 10:59:49 +08:00
xream
e7a2e60963 feat: sing-box 订阅格式修改(如需原始格式 请使用 target=sing-box&produceType=internal); 清理 Clash 系无效字段 2024-03-31 09:36:32 +08:00
xream
fa6a274f79 feat: ProxyUtils 增加 getFlag, getISO 方法 2024-03-31 08:20:51 +08:00
xream
e40b3f88d5 chore: geo 增加关键词 德意志 2024-03-31 06:59:31 +08:00
xream
163ad9ee09 feat: JSON 输出支持 produceType internal 2024-03-31 04:45:57 +08:00
xream
abb6f2dec1 feat: 处理 sni off 的情况. 若出现问题, 麻烦大家及时反馈 2024-03-30 01:12:34 +08:00
xream
56870bbd5f fix: 修复组合订阅子订阅失败导致预览失败 2024-03-26 14:59:24 +08:00
xream
efbc6ecd84 feat: 流量单位显示由 EB 提升到 YB 2024-03-25 03:50:47 +08:00
xream
c27c589024 chore: 调整部分日志 2024-03-25 02:47:06 +08:00
xream
0efed4f1a0 feat: 处理传入 httpClient 的 timeout 参数 2024-03-24 07:28:16 +08:00
xream
e3a514d1fb feat: hysteria2 支持 mport, clash.meta(mihomo) 支持 ports 2024-03-21 20:07:24 +08:00
xream
64478c7a27 feat: 刷新时 清除所有缓存 2024-03-21 02:37:21 +08:00
xream
dc8f19f350 doc: demo.js 2024-03-21 01:52:42 +08:00
xream
b4ccfc7e07 chore: Sub-Store Simple 脚本增加脚本超时(默认 120) 可能会影响某些逻辑 待观察 2024-03-19 23:48:26 +08:00
xream
3f1940630a chore: 增加 gist 错误日志 2024-03-19 21:30:52 +08:00
xream
5a0bdb1276 doc: demo.js 2024-03-18 20:24:18 +08:00
xream
a1b86e26a2 chore: 增加上传同步配置的详细日志 2024-03-16 02:47:01 +08:00
xream
6ec8c29f6a feat: 规则中处理 GEOIP/GEOSITE, Loon 已支持 SRC-PORT/DEST-PORT/PROTOCOL 2024-03-15 08:49:36 +08:00
xream
bbb9602f9f release: backend version 2.14.256 2024-03-15 08:12:06 +08:00
xream
6db6153672 Merge pull request #295 from makaspacex/master
[Feat]规则转换增加对GEOIP与GEOSITE的支持
2024-03-15 08:10:30 +08:00
makabaka
b66189948a 规则转换增加对GEOIP与GEOSITE的支持 2024-03-14 22:07:45 +08:00
xream
2611dccc73 feat: 支持设置查询远程订阅流量信息时的 User-Agent 2024-03-14 19:45:39 +08:00
xream
25d3cf6ca4 feat: 通过代理/节点/策略获取订阅 现已支持 Surge, Loon, Stash, Shadowrocket, QX, Node.js 2024-03-14 01:54:07 +08:00
xream
3637c5eb74 feat: SSH 协议跟进 clash.meta(mihomo) 的修改 2024-03-13 16:24:30 +08:00
xream
80d46597b4 feat: 支持使用代理/节点/策略获取订阅 2024-03-13 05:33:52 +08:00
xream
ca65e4209e feat: 支持自定义订阅流量信息 2024-03-12 01:17:56 +08:00
xream
53bb4866e7 fix: 修复订阅流量传递 2024-03-12 00:55:30 +08:00
xream
09495fa607 fix: 修复重置天数微妙的偏差 2024-03-11 19:33:51 +08:00
xream
4b27d40602 feat: 订阅支持开始日期和重置周期 2024-03-11 13:39:52 +08:00
xream
518de2e919 feat: 订阅支持每月重置天数 2024-03-10 23:08:56 +08:00
xream
078bf228de feat: produceArtifact 方法支持传入自定义 subscription; VLESS 非 reality 删除空 flow 2024-03-10 17:22:25 +08:00
xream
aaef97cf5d feat: SSH 新增 clash.meta(mihomo), 调整 Surge 和 sing-box 2024-03-08 19:01:01 +08:00
xream
7beff4013f feat: 订阅列表的流量信息兼容远程和本地合并的情况, 排除设置了不查询订阅信息的链接 2024-03-08 18:40:44 +08:00
xream
23cf81d0a5 feat: Node.js 版 /api/utils/env 增加 meta 信息 2024-03-08 14:20:55 +08:00
xream
572f2f5533 feat: OpenAPI 增加 isEgern, isLanceX; /api/utils/env 增加 meta 信息 2024-03-08 13:56:59 +08:00
xream
1c6d761e09 fix: 修复 Surge WireGuard allowed-ips 双引号 2024-03-07 17:24:49 +08:00
xream
437297b8b0 feat: 增加下载缓存阈值 2024-03-05 05:03:17 +08:00
xream
ca437865e6 feat: 域名解析新增 IP4P, 支持禁用缓存 2024-03-05 01:01:46 +08:00
xream
739100c873 feat: Stash/clash.meta(mihomo) 支持 interface-name 字段 2024-03-04 11:43:07 +08:00
xream
a4384f4f13 fix: 修复 Clash 节点名为 binary 的情况 2024-03-03 14:33:49 +08:00
xream
468d136f0e ci: git push assets to "release" branch 2024-02-28 23:07:16 +08:00
xream
b0c1157fe1 feat: 调整规则参数 2024-02-28 22:36:22 +08:00
xream
56626dabc7 Merge pull request #289 from makaspacex/master
修复IP-CIDR的option错误
2024-02-28 22:19:11 +08:00
makabaka
2a87f7b3c3 修复IP-CIDR的option错误 2024-02-28 20:06:03 +08:00
xream
81adfbc461 doc: README 2024-02-23 22:03:10 +08:00
xream
e04217c50d fix: 参数对象 2024-02-23 20:15:37 +08:00
xream
391a5aa2e4 chore: 调整默认定时为每天 23 点 55 分 2024-02-23 20:05:48 +08:00
xream
2f3b42f552 fix: Surge TUIC server-cert-fingerprint-sha256 2024-02-22 11:37:18 +08:00
xream
76302f9d53 fix: sing-box wireguard reserved 2024-02-21 19:09:23 +08:00
xream
1924e9735c feat: Surge 参数 tos allow-other-interface interface test-udp test-timeout hybrid; Stash 参数 benchmark-timeout; Surge 新增 SSH(仅密码方式), sing-box 新增 SSH 2024-02-18 05:25:31 +08:00
xream
6a8cee3cd5 feat: 节点名称为空时, 添加默认节点名称 2024-02-17 17:41:54 +08:00
xream
9b2209cc8b chore: sing-box grpc servicename 应为字符串 2024-02-17 12:03:25 +08:00
xream
c585785c50 fix: 兼容不规范的 VLESS URI 2024-02-17 11:39:04 +08:00
xream
c3e5da7ee4 fix: 兼容不规范的 VLESS URI 2024-02-17 10:50:33 +08:00
xream
2ecad8bbb8 feat: 旗帜操作(支持更多选项) 2024-02-17 08:32:37 +08:00
xream
a642213928 feat: 脚本操作完整支持 /api/file/name 的内部文件调用路径 2024-02-15 03:30:53 +08:00
xream
f85e360ea8 feat: 同步配置前, 预处理订阅, 防止同时请求过多 2024-02-14 19:51:44 +08:00
xream
1b948cdf52 doc: 补充文档 2024-02-13 15:30:13 +08:00
xream
556d5f393c feat: 带参数 includeUnsupportedProxy 时, 支持输出 Surge WireGuard Section 2024-02-13 15:21:29 +08:00
xream
a8c05207c0 chore: dev 调整 2024-02-11 01:10:01 +08:00
xream
e97fb1e6d9 fix: 兼容更多 Trojan URI 格式 2024-02-08 23:06:39 +08:00
xream
e40b9a77c4 fix: 修复 Loon UDP 参数 2024-02-07 15:14:24 +08:00
xream
df0ac8a218 fix: 缓存不合法时即刻重置 2024-02-07 01:14:52 +08:00
xream
36377f3c20 fix: 修复 Surge 协议 test-url 字段 2024-02-06 22:59:54 +08:00
xream
47f26bdac8 feat: Loon 解析器支持参数 ua=clash.meta&timeout=3000, 支持从链接重新获取 2024-02-06 21:29:10 +08:00
xream
a8a89ee2a2 fix: 修复 PassWall VLESS URI 兼容性 2024-02-06 00:30:53 +08:00
xream
199c5fb337 fix: 修复域名解析 2024-02-05 13:19:22 +08:00
xream
df505616ec chore: Stash 覆写增加图标 2024-02-05 11:40:02 +08:00
xream
c5b11f8b36 fix: 修复过滤非法节点功能 2024-02-04 01:22:27 +08:00
xream
b19b49d2fa chore: 端口号允许为 0 2024-02-03 23:59:26 +08:00
xream
395c6e4e4a chore: 在 bundle 文件顶部添加版本号 2024-02-03 22:34:58 +08:00
xream
ae1c738f70 chore: 开发流程使用 esbuild 2024-02-03 21:30:27 +08:00
xream
02d54208b0 feat: 支持 Hysteria(v1) URI 2024-02-03 17:54:37 +08:00
xream
5d3fc499ce feat: 支持 TUIC v5 URI 2024-02-03 16:17:26 +08:00
xream
d23bc7663e feat: 支持 Loon fast-open 2024-02-02 22:55:00 +08:00
xream
15704ea1c9 chore: 增加 esbuild bundle(暂不启用 仅本地使用) 2024-02-02 19:53:14 +08:00
xream
68cb393a7e feat: 更新 Surge, Loon, QX 输入的 Shadowsocks cipher 2024-02-02 13:23:59 +08:00
xream
2e99f28aa5 feat: 输出时校验 Surge, Surfboard, Loon, QX Shadowsocks cipher 2024-02-02 13:04:32 +08:00
xream
1a18e65e47 chore: VLESS HTTP 传输层增加默认 path 2024-02-02 12:44:08 +08:00
xream
bbd5341d7a chore: 脚本说明 2024-02-02 11:58:01 +08:00
xream
623802d73f chore: 增加脚本说明 2024-02-01 21:59:24 +08:00
xream
19920dbfa3 chore: 增加脚本说明 2024-02-01 21:58:30 +08:00
xream
8764e01d7e chore: 增加脚本说明 2024-02-01 21:58:17 +08:00
xream
31b6dd0507 chore: YAML 解析兼容(保持类型) 2024-01-31 03:27:07 +08:00
xream
a84007d39e chore: Clash 系输出中 tls 字段存在且不为布尔值时, 删除该字段防止客户端解析报错 2024-01-30 23:32:39 +08:00
xream
751e50bf99 chore: YAML 解析兼容 2024-01-30 22:23:57 +08:00
xream
a91f978042 feat: 远程订阅 URL 新增参数 validCheck 将检查订阅有效期和剩余流量 2024-01-30 14:14:57 +08:00
xream
1248e6b32a fix: v2ray-plugin 2024-01-30 03:24:42 +08:00
xream
d0f255d9c6 feat: h2 传输层修正 host 为数组, path 不为数组 2024-01-30 02:17:58 +08:00
xream
060415584e feat: 支持 tls 的 plugin 中跳过证书验证; Surge Shadow TLS 默认版本为 2; sing-box 支持 Shadowsocks Shadow TLS 2024-01-30 01:53:22 +08:00
xream
8a2087c53a feat: 支持更多不规范的 SS URI; 去除 Surfboard 节点名中的等号; 支持 Mihomo shadowsocks shadow-tls 2024-01-30 00:49:41 +08:00
xream
64117c50c7 feat: 支持更多不规范的 VLESS/SS URI 2024-01-29 23:38:21 +08:00
xream
6564d9497a chore: 增加定时任务默认为每天 0 点的说明 2024-01-24 15:17:45 +08:00
xream
1c03e46bbb chore: Beta 模块, 支持最新 Surge iOS TestFlight 版本的分类,参数设置和参数说明(增加双引号 确保兼容性) 2024-01-23 12:45:02 +08:00
xream
084b385fdb chore: Beta 模块, 支持最新 Surge iOS TestFlight 版本的分类,参数设置和参数说明 2024-01-23 04:03:35 +08:00
xream
290b9b5411 chore: 新增 Beta 模块, 支持最新 Surge iOS TestFlight 版本的分类和参数设置 2024-01-22 04:48:34 +08:00
xream
e5c1ae9ed8 feat: 优化流量解析规则 2024-01-20 23:00:37 +08:00
xream
9b6d9d49f9 Merge pull request #275 from dnomd343/master
fix: 流量信息匹配错误
2024-01-20 22:40:13 +08:00
xream
a12adf5255 chore: 脚本操作时不使用空值合并运算符 2024-01-20 22:14:23 +08:00
Dnomd343
8682f14ee7 fix: scientific counting matching error 2024-01-20 13:16:11 +08:00
xream
b3de7a4bc5 feat: 优化调整 Gist 同步逻辑; 增加 GitLab Snippet 同步 2024-01-20 05:33:31 +08:00
xream
099ae5ad83 fix: 配置接口补齐错误处理 2024-01-20 00:50:35 +08:00
xream
c7d00ac512 feat: 域名解析支持类型和过滤 2024-01-19 21:43:54 +08:00
xream
ca0d800bbb release: backend version 2.14.184 2024-01-19 12:54:40 +08:00
xream
31b48d7a6c Merge pull request #274 from izhangxm/feat_add_proxy_convter_api
增加规则转换与协议转换API接口
2024-01-19 12:35:32 +08:00
makabaka
ab96ae9413 增加规则转换与协议转换API接口 2024-01-19 12:23:04 +08:00
xream
3fc507b576 feat: 解析并删除旧的 ws-path ws-headers 字段 2024-01-19 10:18:27 +08:00
xream
2f2dbbdb68 release: backend version 2.14.182 2024-01-18 17:17:15 +08:00
xream
1543e76841 Merge pull request #273 from izhangxm/master
修复clash规则头部有注释的情况下规则转换功能失败的问题
2024-01-18 17:07:59 +08:00
makabaka
74c4719806 fix_clashprovider_test 2024-01-18 15:09:24 +08:00
xream
b80d7f5875 feat: Clash 节点支持 fingerprint(内部转为 tls-fingerprint); 支持 Clash 配置文件中的 global-client-fingerprint 优先级低于 proxy 内的 client-fingerprint 2024-01-18 12:14:35 +08:00
xream
779950ab11 Revert "fix: sing-box fingerprint"
This reverts commit 42404537e8.
2024-01-18 11:36:07 +08:00
xream
42404537e8 fix: sing-box fingerprint 2024-01-18 11:29:15 +08:00
xream
228566116d feat: 支持同步配置时选择包含官方/商店版不支持的协议; 同步配置优化 2024-01-18 06:18:05 +08:00
xream
9bb06bf438 feat: 兼容不规范的 VLESS URI 2024-01-18 01:17:06 +08:00
xream
88e52f9787 revert: 去除 Loon Trojan HTTP 传输层 2024-01-17 22:13:54 +08:00
xream
845a173738 chore: README 2024-01-17 21:55:56 +08:00
xream
4a6bcbc9b4 chore: README 2024-01-17 21:49:56 +08:00
xream
bbaac2de6f fix: Loon 传输层 2024-01-17 21:24:17 +08:00
xream
614438ae3d feat: 支持 QX VLESS 输出(不支持 XTLS/REALITY) 2024-01-17 21:16:34 +08:00
xream
4966132397 feat: produceArtifact 支持 Stash internal (Fixes #271) 2024-01-17 20:31:43 +08:00
xream
059c4bd148 chore: README 2024-01-17 19:55:22 +08:00
xream
63887e3dad feat: 支持解析 QX VLESS 输入; VLESS 无 network 时, 默认为 tcp 2024-01-17 19:30:23 +08:00
xream
7fd585b5d4 feat: SurgeMac 支持 external 2024-01-17 09:15:33 +08:00
xream
16c79ac0fc feat: 支持从 gist 获取不在同步配置中的 gist 文件 2024-01-17 01:10:54 +08:00
xream
14d9885db8 fix: 不上传没有设置来源的同步配置 2024-01-16 23:41:51 +08:00
xream
1e61088ed8 chore: README 2024-01-16 20:52:46 +08:00
xream
af6904ea50 feat: 取消 github 用户名绑定关系(现在用户名错误只影响头像), 增加最近一次 gist 检查状态 2024-01-16 09:44:02 +08:00
xream
1bc44ccde8 feat: 订阅链接可使用标准参数格式 #noCache&noFlow 或 井号附加 #noCache#noFlow 2024-01-16 08:11:34 +08:00
xream
bdc7ee50f7 fix: 修复 sing-box wireguard 输出 2024-01-16 07:24:30 +08:00
xream
812f24d102 feat: 以 #noFlow 结尾的远程链接不查询订阅流量信息 2024-01-16 07:07:55 +08:00
xream
8c943176a5 feat: VLESS URI 输入兼容 Shadowrocket 导出格式 2024-01-16 01:00:22 +08:00
xream
f4c4cdba67 fix: 修复响应头缓存 2024-01-14 23:44:15 +08:00
xream
ada03be05f chore: Loon 插件支持修改响应头缓存有效期 2024-01-14 23:39:27 +08:00
xream
5584225413 feat: 优化订阅流量获取, 启用共享缓存(默认一分钟) 并优先尝试 HEAD 方法 2024-01-14 23:37:55 +08:00
xream
5cbcf4fce4 feat: Node.js 版本体支持定时任务, 环境变量 SUB_STORE_BACKEND_CRON 2024-01-14 18:45:31 +08:00
xream
89931c0032 chore: 文案调整 2024-01-14 15:46:56 +08:00
xream
88f3198320 fix: 找不到资源时报错; 调整脚本操作类型判断; 执行脚本失败时, 同时输出普通脚本和快捷脚本错误 2024-01-14 15:45:08 +08:00
xream
27a14bb255 revert: 回滚文件模板功能 2024-01-14 12:33:36 +08:00
xream
5ecce27f4e feat: 脚本内部 produceArtifact 支持指定 produceType: 'internal', produceOpts: { 'include-unsupported-proxy': true } 来获得内部的数据结构; 订阅链接参数支持 type=internal&includeUnsupportedProxy=true; 文件支持 nunjucks 模板, 为 sing-box 增加的 Filter 用法 sub/col 为订阅/组合订阅中的节点名 {{ '订阅的name' | sub('美国|🇺🇸|us', 'i') }}, subNode/colNode 为订阅/组合订阅中的节点 {{ '订阅的name' | subNode('美国|🇺🇸|us', 'i') }}, 底层 produceArtifact('subscription', 'sing-box', 'internal', '美国|🇺🇸|us', 'i') 2024-01-14 12:13:29 +08:00
xream
12903d77f7 fix: 修复无脚本操作时 文件数据结构错误 2024-01-13 22:01:02 +08:00
xream
0c6ec7f82a revert: 同步接口支持 POST 2024-01-13 20:40:45 +08:00
xream
ba251ced34 fix: 同步接口支持 POST 2024-01-13 19:56:30 +08:00
xream
d96a0421f7 fix: Surge Snell TFO 2024-01-13 16:51:48 +08:00
xream
aff7ddf41e feat: 脚本筛选的快捷操作支持 await 2024-01-13 13:55:07 +08:00
xream
164ae9a7a8 feat: 快捷脚本支持 await; 脚本操作支持 produceArtifact 2024-01-13 13:40:34 +08:00
xream
3aacd26b79 feat: 支持输出到 sing-box; 文件脚本支持 ` ; 脚本支持 ProxyUtils.yaml` 2024-01-13 10:28:07 +08:00
xream
5915416232 feat: 文件支持远程/合并, /api/file/name 接口支持参数覆盖 2024-01-12 07:22:25 +08:00
xream
c059296224 feat: 文件支持脚本操作 2024-01-12 06:16:39 +08:00
xream
9ae70eca09 feat: 同步配置支持文件 2024-01-12 03:52:41 +08:00
xream
d0acf49b83 feat: 文件接口 2024-01-12 02:23:57 +08:00
xream
c51f3511dd fix: 兼容部分不带节点名的 URI 2024-01-08 09:44:53 +08:00
xream
ee2fcc7ee3 fix: 兼容部分不带参数的 URI 输入 2024-01-08 09:28:33 +08:00
xream
95615d1877 feat: 支持全局请求超时(前端 > 2.14.29) 2024-01-08 07:22:03 +08:00
xream
962bcda9dd chore: 同步远程配置输出更多日志 2024-01-07 17:44:03 +08:00
xream
9bb4739d56 Node.js 版的通知支持第三方推送服务. 环境变量名 SUB_STORE_PUSH_SERVICE. 支持 Bark/PushPlus 等服务. 形如: https://api.day.app/XXXXXXXXX/[推送标题]/[推送内容]?group=SubStore&autoCopy=1&isArchive=1&sound=shake&level=timeSensitivehttp://www.pushplus.plus/send?token=XXXXXXXXX&title=[推送标题]&content=[推送内容]&channel=wechat 的 URL, [推送标题][推送内容] 会被自动替换 2024-01-02 22:52:33 +08:00
xream
de1d40f41a feat: Wireguard 结构跟进 Clash.Meta, allowed_ips 改为 allowed-ips 2024-01-02 16:38:48 +08:00
xream
c0ab301160 feat: Trojan URI 支持 gRPC 2023-12-29 16:08:02 +08:00
xream
a22df97a51 release: backend version 2.14.135 2023-12-29 15:42:31 +08:00
xream
45772ade4d Merge pull request #263 from Ariesly/ipv6-uri
fix: Handles node-info IPv6 address URIs
2023-12-29 15:39:03 +08:00
Ariesly
e8dab545f5 fix: Handles node-info IPv6 address URIs 2023-12-29 07:10:47 +00:00
xream
c2bd80207a doc: 补充文档 2023-12-27 02:55:04 +08:00
xream
bc5ae9a2ef feat: 支持 Surfboard(前端 > 2.14.27) 2023-12-27 00:28:15 +08:00
xream
36db057e32 feat: 当节点端口号为合法端口号时, 将类型转为整数(便于脚本判断) 2023-12-23 21:02:39 +08:00
xream
5ac73b863a feat: 支持忽略失败的远程订阅(前端版本 > 2.14.20) 2023-12-18 01:42:33 +08:00
xream
23042c33d6 feat: 支持忽略失败的远程订阅(前端版本 > 2.14.20) 2023-12-18 01:41:37 +08:00
xream
4ca5f5e355 feat: 支持忽略失败的远程订阅(前端版本 > 2.14.20) 2023-12-18 01:24:48 +08:00
xream
f10e5913fb feat: 兼容部分不规范的机场 Hysteria/Hysteria2 端口跳跃字段为空时 删除此字段 2023-12-17 18:31:12 +08:00
xream
8b75c11587 feat: Hysteria2 URI 输入支持 hy2:// 2023-12-17 16:13:34 +08:00
xream
c287dcad3b fix: 过滤 Stash/Clash Shadowsocks cipher 2023-12-13 20:11:36 +08:00
xream
ce6cd794c8 feat: 环境变量 SUB_STORE_DATA_URL 启动时自动从此地址拉取并恢复数据 2023-12-13 09:54:57 +08:00
xream
e05475aa5e feat: Node.js 前端代理后端路由 需设置环境变量 注意安全 SUB_STORE_FRONTEND_PATH=/prefix 2023-12-13 02:04:24 +08:00
xream
c35e9d37ae feat: Node.js 前端代理后端路由 需设置环境变量 注意安全 SUB_STORE_FRONTEND_BACKEND_PATH=/prefix 2023-12-13 01:26:16 +08:00
xream
8f2dbfe3df feat: Node.js 前端代理后端路由 需设置环境变量 注意安全 SUB_STORE_FRONTEND_BACKEND_PATH=/prefix 2023-12-13 00:34:08 +08:00
xream
a0a998dfdd feat: Node.js 前端代理后端路由 需设置环境变量 注意安全 SUB_STORE_FRONTEND_PATH=/prefix 2023-12-13 00:26:11 +08:00
xream
12491ac7c0 feat: Node.js 前端代理后端路由 需设置环境变量 注意安全 SUB_STORE_FRONTEND_PATH=/prefix 2023-12-13 00:26:03 +08:00
xream
78e3024cec feat: Node.js 前端代理后端路由 2023-12-12 22:52:50 +08:00
xream
5e21a20e37 fix: 修复 Loon Trojan WS 传输层 2023-12-12 21:13:17 +08:00
xream
76b5dc5809 feat: 脚本筛选支持节点快捷脚本. 语法与 Shadowrocket 脚本类似
```
const port = Number($server.port)

return [80, 443].includes(port)
```
2023-12-11 11:57:12 +08:00
xream
a1776644a0 feat: Node 版后端支持挂载前端文件夹, 环境变量 SUB_STORE_FRONTEND_PATH, SUB_STORE_FRONTEND_HOST, SUB_STORE_FRONTEND_PORT 2023-12-10 13:13:39 +08:00
xream
7aaa03d4ca chore: workflow 2023-12-10 09:32:56 +08:00
xream
d0cba285ab fix: 处理 Hysteria2 URI 中的密码部分 2023-12-09 02:08:59 +08:00
xream
d636e1b94c fix: 处理预览时子订阅出错的情况 2023-12-08 18:16:50 +08:00
xream
69726cd5c4 fix: 处理 IPv6 地址 URI 2023-12-08 17:53:07 +08:00
xream
8918479b9e release: backend version 2.14.114 2023-12-08 11:49:11 +08:00
xream
17504ab5aa Merge pull request #261 from Ariesly/master 2023-12-08 11:45:58 +08:00
Ariesly
0d8fa91cd5 fix(hysteria2): For shadowrocket obfs 2023-12-08 01:51:54 +00:00
Ariesly
e7dfa1ce38 chore(hysteria2): Uri support with tfo 2023-12-08 01:34:53 +00:00
Ariesly
fe937d6ebf fix(hysteria2): Change to TLS Fingerprint 2023-12-08 01:30:09 +00:00
xream
b7b734f529 release: backend version 2.14.113 2023-12-07 18:15:21 +08:00
xream
f5ef6010bc Merge pull request #260 from Ariesly/master
feat: Hysteria2 URI
2023-12-07 18:03:26 +08:00
Ariesly
0e82a7669d feat: Hysteria2 URI 2023-12-07 06:25:33 +00:00
xream
6d11ea0fcc feat: ProxyUtils.produce 增加第二个参数 type, 暂时仅支持目标为 ClashMetainternal 输出节点数组供开发者使用 2023-12-05 21:53:22 +08:00
xream
75f802f607 fix: 默认 User-Agent 改为 clash.meta 后, 调整订阅预处理器的逻辑, 减少 Base64 误判 2023-12-05 12:43:13 +08:00
xream
000e90d114 feat: 手动下载备份文件和使用备份上传恢复(前端版本 > 2.14.15) 2023-12-04 16:07:10 +08:00
xream
c2499f6779 fix: 修复 Base64 内容的判断 2023-12-02 16:14:11 +08:00
xream
bf9210fc5a fix: 修复多行订阅流量(仅传递首个订阅的流量信息) 2023-12-01 17:09:56 +08:00
xream
53dd1fd4c5 feat: 支持不规范的 Loon ss+simple obfs 协议格式 2023-11-30 16:01:13 +08:00
xream
c541b83037 feat: 支持按顺序合并本地和远程订阅(前端版本 > 2.14.14 可输入) 2023-11-29 03:57:20 +08:00
xream
3054d5cd5d feat: 远程订阅支持换行符连接的多个订阅链接(前端版本 > 2.14.13 可输入) 2023-11-29 02:24:03 +08:00
xream
5a645081d1 fix: SS URI 端口取整数部分 2023-11-28 23:14:45 +08:00
xream
1fc5b764fe feat: 支持设置默认 User-Agent 2023-11-25 04:31:17 +08:00
xream
5f1415d9d4 feat: 后端支持自定义 hostport. 环境变量 SUB_STORE_BACKEND_API_HOST 默认 ::, SUB_STORE_BACKEND_API_PORT 默认 3000 2023-11-24 18:31:13 +08:00
xream
1e3b4a147a feat: 增加了节点字段 1. no-resolve, 可用于跳过域名解析 2. resolved 用来标记域名解析是否成功 2023-11-21 20:10:05 +08:00
xream
905a50c0b9 fix: Hysteria/Hysteria2 输出到 Stash 时 down-speed 和 up-speed 字段截取数字部分 2023-11-20 11:22:01 +08:00
xream
89e8a99729 Merge pull request #250 from YES-Lee/patch-1
feat: add sync task for qx
2023-11-19 11:44:04 +08:00
xream
ff8573cae7 fix: 修复 app 版参数 2023-11-16 12:49:06 +08:00
xream
1ae1ec40ca feat: 补全 Surge 全协议的 no-error-alert 和 ip-version 字段 2023-11-15 15:16:34 +08:00
xream
53925518b4 feat: Sub-Store 生成的订阅地址支持传入 订阅链接/User-Agent/节点内容 可以复用此订阅的其他设置
例如: 建一个 name 为 sub 的订阅, 配置好节点操作

以后可以自由传入参数 无需在 Sub-Store 前端创建新的配置

`/download/sub?target=Surge&content=encodeURIComponent编码过的本地节点`

`/download/sub?target=Surge&url=encodeURIComponent编码过的订阅链接&ua=encodeURIComponent编码过的User-Agent`
2023-11-14 21:46:56 +08:00
xream
f3de132d70 feat: 脚本链接的末尾加上 #noCache 关闭缓存 2023-11-14 21:14:47 +08:00
xream
3e30a35bc4 feat: 脚本操作支持节点快捷脚本. 语法与 Shadowrocket 脚本类似
```
$server.name = '前缀-' + $server.name
$server.ecn = true
$server['test-url'] = 'http://1.0.0.1/generate_204'
```
2023-11-14 17:07:01 +08:00
xream
3e5f3eafdd feat: 脚本操作 ProxyUtils 增加了 isIPv4, isIPv6, isIP 方法 2023-11-14 00:57:52 +08:00
xream
9c78b87834 feat: 兼容某些格式的 Trojan URI(首个 # 之后的字符串均视为节点名称) 2023-11-13 18:49:50 +08:00
xream
ea88cc1794 feat: 支持 QX tls-pubkey-sha256 tls-alpn tls-no-session-ticket tls-no-session-reuse 字段 2023-11-13 14:34:36 +08:00
xream
c8b197c0a1 feat: 支持 QX server_check_url 和 Stash benchmark-url 字段 2023-11-13 14:06:44 +08:00
xream
69fab11344 feat: 兼容传输层 headers 中小写的 host 字段 2023-11-08 09:54:53 +08:00
xream
955c74a77d feat: 兼容某些机场订阅 hysteria 节点中的 auth_str 字段(将会在未来某个时候删除 但是有的机场不规范) 2023-11-08 07:44:12 +08:00
xream
6d51774d36 feat: 为脚本操作增加流量信息操作 flowUtils 2023-11-07 16:42:28 +08:00
xream
a91f9d7728 feat: 兼容另一种 username password 格式 2023-10-31 21:59:34 +08:00
xream
df366cf8eb doc: pnpm 2023-10-30 01:44:18 +08:00
xream
c547f34f57 feat: 支持 Loon Hysteria2(ecn, 流量控制参数未知) 2023-10-29 23:04:56 +08:00
xream
a4ff32331a fix: 简单限制一下订阅/组合订阅的名称(不可包含 "/" ) 2023-10-29 22:38:20 +08:00
xream
14648d6401 feat: 订阅链接支持参数(例: https://foo.com#noCache 关闭缓存) 2023-10-26 11:26:31 +08:00
Johnson
6216217286 feat: add qx sync task 2023-10-25 10:44:22 -05:00
xream
6a66475154 feat: Surge 支持 block-quic 参数 2023-10-24 09:31:48 +08:00
xream
adc95bba60 feat: Surge 全协议支持 Shadow TLS, 部分协议增加 TLS Fingerprint 支持 2023-10-24 07:26:34 +08:00
xream
fab3644b86 feat: 支持 Shadowrocket Hysteria2 URI 格式输入 2023-10-18 23:48:45 +08:00
xream
c21ce0be16 fix: Surge Hysteria2 输出重复添加 tfo 的 bug 2023-10-18 05:09:10 +08:00
xream
fa65eb1850 feat: Base64 订阅关键词增加 VLESS 和 Hysteria2 2023-10-16 22:11:26 +08:00
xream
79c9b89c5f feat: Stash Hysteria2 2023-10-15 15:55:19 +08:00
xream
fca508ba8a feat: Surge Hysteria2 输入/输出增加 ecn 参数 2023-10-12 22:15:10 +08:00
xream
21b531a44d feat: Surge TUIC 输入/输出增加 ecn 参数 2023-10-12 22:09:58 +08:00
xream
4e5b46a43d feat: Surge Hysteria2 输出增加 download-bandwidth(若有值但解析失败则为 0) 2023-10-12 00:39:10 +08:00
xream
bf81ca4acf feat: 输入增加 Hysteria2 URI 支持; Surge Hysteria2 输出增加 fingerprint 2023-10-11 23:35:42 +08:00
xream
e7c0b23222 feat: Surge 输入输出增加 Hysteria2 2023-10-09 23:42:22 +08:00
xream
40fb0fd7f3 feat: 兼容更多 VMess URI 格式 2023-10-09 17:36:11 +08:00
xream
b061fca356 feat: Surge Snell 输入支持解析 reuse 字段 2023-10-08 16:42:35 +08:00
xream
d3c6c99b0a feat: proxy 增加 subName(订阅名), collectionName(组合订阅名); 脚本增加第三个参数 env(包含订阅/组合订阅/环境/版本等信息) 2023-10-08 13:21:22 +08:00
xream
3fbc280e28 [+] 重复节点通知中增加订阅名称和重复节点名称 2023-10-02 16:21:08 +08:00
xream
9e3e4c6e46 [+] Surge 输出支持 underlying-proxy; VMess/Vless URI 支持 gRPC mode(默认为 gun) 2023-10-01 22:05:51 +08:00
xream
bc0dd4b175 feat: 支持 hysteria2 2023-09-22 14:43:43 +08:00
xream
7603fac036 fix: 修复部分环境无 clearTimeout 的问题 2023-09-18 20:09:03 +08:00
K
9acc161684 fix @ 2023-09-15 18:52:21 +08:00
xream
024582a99d fix: 修复 sub-store-0 路由 2023-09-15 18:42:53 +08:00
xream
1d31a80b9f fix: 修复文件和模块命名/重复添加的逻辑 2023-09-15 10:08:36 +08:00
xream
b2d0276836 feat: 文件和模块接口获取原始内容; 文件列表不返回原始内容 2023-09-14 18:51:23 +08:00
xream
3211fbf357 feat: 模块接口; 脚本参数支持 JSON 和 URL编码 2023-09-14 17:34:24 +08:00
xream
33a17c2d66 feat: 实验性支持本地脚本复用 2023-09-14 08:56:33 +08:00
xream
2c89a0ddbd feat: 支持 Clash VLESS 输出(与 Clash.Meta 的区别为: 无 XTLS 2023-09-11 02:35:36 +08:00
xream
939022e5a3 fix: 修复了 Clash.Meta 输出 VLESS 时 内部字段 sni 未作用到 servername 的问题 2023-09-09 14:03:40 +08:00
xream
59bca5670d fix: 预览时脚本下载报错导致的崩溃 2023-09-07 23:17:36 +08:00
Peng-YM
07b38cf971 release: backend version 2.14.49 2023-09-04 23:16:52 +08:00
Peng-YM
28186f596f feat: added the ability to change the base path for the data files
before starting node, use the command `export SUB_STORE_DATA_BASE_PATH="<YOUR_PATH>"`
2023-09-04 23:16:13 +08:00
xream
ea31b1d0ec fix: 排序接口修正为使用 name 排序 2023-09-04 21:31:55 +08:00
xream
77191f9caa feat: 为 Gist 备份还原增加基础校验逻辑 2023-09-04 17:06:37 +08:00
xream
07a270963e feat: 支持 Surge WireGuard 的输入和输出(由于 Surge 配置的特殊性, 仅支持 同进同出) 支持的字段格式: HK WARP = wireguard, section-name=Cloudflare, no-error-alert=true, underlying-proxy=HK, test-url=http://1.0.0.1/generate_204, ip-version=v4-only 2023-09-01 02:44:43 +08:00
xream
f1e1d50a2c fix: 暂时将后端上传限制放宽到 1mb 2023-09-01 02:07:24 +08:00
Peng-YM
a65cd1f1c9 Update README.md 2023-08-31 16:41:50 +08:00
xream
5b0e2e1ef2 docs: config 2023-08-30 22:52:05 +08:00
xream
b29266ac57 chore: sync to GitLab 2023-08-30 16:19:17 +08:00
xream
336ddd6706 chore: 调整部分日志 2023-08-29 13:52:02 +08:00
xream
25ec219659 docs: 更新 Surge SSR 协议说明; 模块说明页增加更新说明的链接 2023-08-29 01:59:01 +08:00
xream
41d24b131a feat: 根据 UA 识别 macOS 版 Surge(也可指定参数 target=SurgeMac) 并支持 SSR 协议(节点字段 exec 为 ssr-local 路径, 默认 /usr/local/bin/ssr-local; 端口从 10000 开始递增, 暂不支持配置) 2023-08-29 01:46:49 +08:00
xream
ba78982f41 feat: 统一将 VMess 和 VLESS 的 http 传输层的 path 和 Host 处理为数组 2023-08-28 23:47:10 +08:00
xream
26193301b3 fix: 仅在 VMess/VLESS 且传输层为 http 时设置 Host 为数组 2023-08-28 23:38:03 +08:00
xream
0141e48200 feat: 增加还原备份完成的日志输出 2023-08-28 23:29:53 +08:00
xream
5ae6687b1f chore: changelog 2023-08-28 23:15:48 +08:00
xream
ad6d1ab441 fix: build dist 2023-08-28 20:41:40 +08:00
xream
f5aea14904 fix: 非 tls, 有 ws/http 传输层, 使用域名的节点, 将设置传输层 Host 防止之后域名解析后丢失域名(不覆盖现有的 Host) 2023-08-28 20:34:22 +08:00
Peng-YM
4f2c95f6ab chore: remove unnecessary files 2023-08-28 20:07:32 +08:00
Peng-YM
be1e2c9979 chore: removed tracking dist files from git 2023-08-28 20:06:50 +08:00
Peng-YM
347b19e30d remove: deprecated artifact 2023-08-28 20:01:05 +08:00
xream
f94a12bf6e feat: bundle 2023-08-28 19:01:34 +08:00
xream
bd510a9aa9 fix: sync 2023-08-28 18:48:33 +08:00
xream
f02af9d643 fix: vless servername 2023-08-28 15:32:08 +08:00
xream
af8e965866 feat: new target platform "Clash.Meta" 2023-08-28 13:10:48 +08:00
xream
4bebcff1d3 feat: 非 tls, 有 ws/http 传输层, 使用域名的节点, 将设置传输层 Host 防止之后域名解析后丢失域名 2023-08-28 00:09:24 +08:00
xream
7b8f6f7e52 feat: 域名解析新增 Tencent, Ali; 脚本下载失败, 脚本操作失败, 脚本过滤失败时都会报错了 2023-08-27 23:17:57 +08:00
xream
49c7107d20 fix: transport headers may have no Host 2023-08-27 18:17:30 +08:00
xream
8bfa4dbbf2 feat: VLESS URI 2023-08-27 00:57:21 +08:00
xream
5e14d05c30 feat: 组合订阅错误信息将包含出现错误的子订阅名称; 获取流量失败时, 不影响节点订阅; 订阅上游无有效节点时将报错 2023-08-26 20:27:12 +08:00
xream
8c5dca71fb feat: Loon WireGuard 2023-08-26 15:00:46 +08:00
xream
4973454f58 feat: wireguard 2023-08-25 22:48:03 +08:00
xream
4c6ba2cdc8 feat: hysteria 2023-08-25 16:19:08 +08:00
Hsiaoyi
9cbbd0e86f Merge pull request #233 from eltociear/master-1
Fix typo in README.md
2023-08-24 21:46:03 +08:00
xream
0320a77451 feat: producers adjustments, VMess URI formats 2023-08-24 21:43:58 +08:00
xream
afb9296158 feat: Added support for VMess URI in other formats and VMess without transport settings 2023-08-24 20:23:48 +08:00
xream
9b0c15ebc2 fix: 兼容 value 为空的 Trojan URI 2023-08-24 11:38:27 +08:00
xream
46738d5947 fix: trojan network tcp 2023-08-24 11:08:43 +08:00
xream
1f505752ae fix: trojan uri and tls 2023-08-24 10:02:03 +08:00
Ikko Eltociear Ashimine
0734a3d563 Fix typo in README.md
Speicial -> Special
2023-08-24 00:46:24 +09:00
xream
497bc264e3 fix: servername/sni priority over wss host 2023-08-22 18:21:34 +08:00
xream
feb207b333 fix: servername/sni priority over wss host 2023-08-22 17:28:39 +08:00
xream
9ac1112b37 fix: VMess URI alterId parseInt 2023-08-22 15:29:55 +08:00
xream
96769598ef fix: QX tls 2023-08-22 00:42:53 +08:00
xream
f8ed6a3342 fix: QX tls 2023-08-22 00:08:53 +08:00
xream
99b19c410d fix: vmess/vless http-opts.path/http-opts.headers.Host must be an array in some clients 2023-08-21 22:16:07 +08:00
xream
9e54507bbb fix: double quotes in Surge vmess ws-headers Host 2023-08-21 21:20:31 +08:00
xream
20afa0ad22 Surge 默认模块不带 ability 参数; 分离出固定带参和不带参的模块 2023-08-20 17:22:51 +08:00
walkxspace
c5b6960b35 Update geo.js (#231) 2023-08-19 11:44:55 +08:00
xream
4dd86cb368 feat: Added replaceArtifact API 2023-08-18 13:48:37 +08:00
xream
4a0319e95f fix: flexible cipher for Loon 2023-08-15 21:22:33 +08:00
xream
090d8a978f feat: Added support for scy of VMESS URI 2023-08-15 18:15:04 +08:00
xream
bc9fae6062 feat: Added support for SNI & allowInsecure of Trojan URI 2023-08-15 17:25:25 +08:00
xream
048344268c feat: Added replaceSubscriptions, replaceCollection API 2023-08-15 15:48:57 +08:00
xream
c5746f6a6b Fixed: fast-open tfo 2023-08-15 14:59:27 +08:00
xream
5cb226da62 feat: Added support for SS URI in other formats 2023-08-15 01:48:54 +08:00
xream
d229047744 Fixed: unsupported cipher for Clash/Stash 2023-08-14 10:04:47 +08:00
Hsiaoyi
cb21a8e6ec Merge pull request #229 from xream/feature/tuic
Adjust the logic for determining the tuic version
2023-08-13 17:03:40 +08:00
xream
537a00e8a9 Adjust the logic for determining the tuic version 2023-08-13 17:00:44 +08:00
Hsiaoyi
b770578cba Merge pull request #228 from xream/feature/tuic
feat: Added support for tuic and some compatibility adjustments
2023-08-13 15:56:52 +08:00
xream
47a95e5a3d feat: Added support for tuic and some compatibility adjustments 2023-08-13 15:54:04 +08:00
Hsiaoyi
e99f13d487 Merge pull request #227 from xream/feature/snell
feat: Added support for producing snell nodes with reuse and optional obfs
2023-07-31 18:44:53 +08:00
xream
fcab8401e0 feat: Added support for producing snell nodes with reuse and optional obfs 2023-07-31 18:41:48 +08:00
Hsiaoyi
431b1a3c8e Merge pull request #226 from Keywos/master
fixed deleted gist
2023-07-31 17:42:49 +08:00
Hsiaoyi
36d46003d6 Fixed: empty uploading files 2023-07-31 17:42:31 +08:00
K
ff71f12996 version 2.14.3 2023-07-31 16:41:22 +08:00
K
f7c08e3a56 fixed deleted gist 2023-07-31 16:38:07 +08:00
K
6eea8bb2d0 Merge branch 'sub-store-org:master' into master 2023-07-31 14:58:54 +08:00
Hsiaoyi
fc90e22a48 Added Surge-Noability.sgmodule 2023-07-28 22:38:36 +08:00
Hsiaoyi
26d47b019b Merge pull request #223 from xream/feature/V2Ray
feat: V2Ray Producer
Fixes #180
2023-07-26 09:55:45 +08:00
xream
8e49a78f45 feat: V2Ray Producer 2023-07-26 09:48:14 +08:00
Hsiaoyi
edee10cee3 Update Surge.sgmodule 2023-07-26 09:03:59 +08:00
K
20d958d74f Update Surge.sgmodule 2023-07-26 01:48:47 +08:00
Hsiaoyi
6427f99545 Update Surge.sgmodule
ability=http-client-policy
2023-07-24 14:39:21 +08:00
Hsiaoyi
7d2ea10206 Merge pull request #219 from Keywos/script-Cache
surge
2023-07-23 18:00:42 +08:00
Hsiaoyi
e862235cb8 Merge pull request #220 from xream/fix/FullConfig
fix: Full Config Preprocessor
2023-07-23 17:42:06 +08:00
xream
38f1728e42 fix: Full Config Preprocessor 2023-07-23 17:38:29 +08:00
K
d963be87f8 [!] Surge 2023-07-23 15:11:32 +08:00
K
390e4540d2 Merge branch 'script-Cache' of https://github.com/Keywos/Sub-Store into script-Cache 2023-07-22 15:24:20 +08:00
K
0bd00406f3 [-] log 2023-07-22 15:24:19 +08:00
Hsiaoyi
b9ce4e8f20 Merge pull request #218 from sub-store-org/dependabot/npm_and_yarn/backend/axios-0.21.2
build(deps-dev): bump axios from 0.20.0 to 0.21.2 in /backend
2023-07-22 14:35:52 +08:00
Hsiaoyi
de15bbf3ea using Node.js v16 2023-07-22 14:34:06 +08:00
dependabot[bot]
5d6bd1415b build(deps-dev): bump axios from 0.20.0 to 0.21.2 in /backend
Bumps [axios](https://github.com/axios/axios) from 0.20.0 to 0.21.2.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v0.21.2/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v0.20.0...v0.21.2)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-22 06:17:45 +00:00
Hsiaoyi
6e9c3ead4c Merge pull request #217 from Keywos/script-Cache
[+] version 2.14.0
2023-07-22 14:15:56 +08:00
K
b3ccd5743a Merge branch 'sub-store-org:master' into script-Cache 2023-07-22 14:13:09 +08:00
K
e18c215fe4 [+] version 2023-07-22 14:11:45 +08:00
Hsiaoyi
e4b54b43a1 Merge pull request #216 from Keywos/script-Cache
script-Cache
2023-07-22 13:56:54 +08:00
K
21726bf950 script-Cache 2023-07-22 13:53:47 +08:00
Hsiaoyi
f6ca9af00f fix: tasks cache in Node.js environment (#209) 2023-05-09 17:16:35 +08:00
Hsiaoyi
39b79b6ca4 feat: Added support for producing Surge nodes with test-url (#199) 2023-03-19 18:32:34 +08:00
NobyDa
999271fa9d Improve resource cache key. (#190) 2023-02-08 12:30:26 +08:00
QuentinHsu
5de35c7720 🐞 fix(subscriptions): negative usage flow (#175) 2022-10-25 00:07:23 +08:00
Jasonzza
06d0c14abc fix: sync artifacts issue (#164) 2022-09-11 23:52:51 +08:00
Peng-YM
029900085c fix: cron-sync-artifacts.js path 2022-09-10 11:47:34 +08:00
Peng-YM
cca5c18d9c build: Update config files 2022-09-10 00:48:11 +08:00
Peng-YM
3de8a1d5be build: Bump version 2022-09-09 23:25:25 +08:00
Peng-YM
94fbe535b3 build: Update GitHub action 2022-09-09 23:15:28 +08:00
Peng-YM
6ee6a9b5e2 build: Split sub-store.min.js for better performance on iOS devices 2022-09-09 23:11:13 +08:00
Peng-YM
1c29771de9 build: Build minimized JavaScripts files 2022-09-09 21:07:28 +08:00
Peng-YM
5845ea1a66 fix (ip-flag.js): Use batch processing to reduce memory footprint 2022-09-09 21:05:05 +08:00
Peng-YM
eb32a09def fix (core): Fix QX vmess-http producer
closes #162
2022-09-09 21:04:08 +08:00
Peng-YM
c60aec603f fix (core): Proxy port smaller that 80 is now allowed
close #167
2022-09-09 21:03:01 +08:00
Peng-YM
0072739f01 refactor (core): Reworked Trojan URI parser to support IPV6 nodes 2022-08-13 12:57:49 +08:00
Peng-YM
1bd2f5f643 fix: xchacha20-ietf-poly1305 cipher is now supported
closes #151
2022-08-13 11:22:23 +08:00
Peng-YM
0a31f5d5d7 fix: ip-flag does not work on Loon
The node parameter should not include proxy name
2022-08-12 00:00:11 +08:00
Peng-YM
6484edb5db feat: Add ip-flag script 2022-08-11 22:58:48 +08:00
Peng-YM
c073870f24 perf: Add support for sending http requests using specific nodes
Only supported on Loon & Surge
2022-08-11 01:07:16 +08:00
Peng-YM
e93332048e fix: Occasional crashed when performing migration 2022-08-10 00:28:46 +08:00
Peng-YM
4dcb9ae79e feat: Include cron-sync-artifact in Stash configuration 2022-08-09 22:42:13 +08:00
Peng-YM
6ea3575101 fix: Rename subscription and collection will break artifacts 2022-08-09 22:28:45 +08:00
Peng-YM
26820ea892 fix: proxy duplicate issue 2022-08-04 20:40:40 +08:00
Peng-YM
f64e8ecfe4 fix: Loon shadowsocksr obfs-param incorrect 2022-08-02 09:23:34 +08:00
Peng-YM
77604a3544 perf (core): DomainResolveProcessor now cache results 2022-07-19 21:29:06 +08:00
Peng-YM
8f5d027080 fix (cron-sync-artifact): sync timeout due to missing await 2022-07-19 20:55:18 +08:00
Peng-YM
5244de4dba fix (config): Sub-Store url is incorrect in Surge.sgmodule 2022-07-13 15:14:11 +08:00
Peng-YM
4121ec2970 chore (gh-action): Trigger workflow run only if package.json have been modified 2022-07-13 15:10:30 +08:00
Peng-YM
a949c49192 perf: Use the latest release scripts in configs 2022-07-13 14:53:44 +08:00
Peng-YM
9fba3506f0 chore: Update GitHub action to automatically release new version 2022-07-13 14:41:34 +08:00
Peng-YM
9677c7ebbd fix (product): cron-sync-artifacts not working 2022-07-13 14:03:43 +08:00
github-actions@github.com
03149dcadb Release 2022-07-13 02:32:52 +00:00
Peng-YM
1bfa6ebb2c fix (core): trojan sni is lost when parsing Clash nodes
#build
2022-07-13 10:31:08 +08:00
Peng-YM
4cd525824e fix (restful): Add query field in IP-API 2022-07-12 23:15:29 +08:00
Peng-YM
813f2b839d perf: Add switch for cron-sync-artifacts 2022-07-12 18:56:24 +08:00
Peng-YM
3d58534dfe fix (restful): Intercept IP-API query failed message when querying node info 2022-07-12 18:34:31 +08:00
Peng-YM
f7333c0617 perf: Include cron script for syncing artifacts in configurations 2022-07-12 18:15:05 +08:00
Peng-YM
f7d4b66db6 feat (restful): Add /api/utils/node-info for querying proxy node info 2022-07-12 15:09:44 +08:00
Peng-YM
8c844eb23a chore: Use pnpm in GitHub action 2022-07-11 23:38:57 +08:00
Peng-YM
de892aaa2b fix: Vmess auto/none cipher parsed incorrectly 2022-07-11 23:33:06 +08:00
Peng-YM
b143476e71 fix (core): Clash Vmess servername does parse correctly 2022-07-11 23:20:21 +08:00
Peng-YM
2c4e47166d feat (restful): Add /api/utils/refresh
The API call does the following:
- Fetch GitHub avatar and update artifact store url
- Revoke all cached resources
2022-07-11 23:06:49 +08:00
Peng-YM
6881148021 perf: Use cache for all remote resources 2022-07-11 20:46:16 +08:00
Peng-YM
848491c0f8 feat: Add support for targetPlatform ShadowRocket 2022-07-11 18:23:56 +08:00
Peng-YM
49c8f2e521 perf: Modify revert.js to completely clear sub-store cache 2022-07-11 18:22:42 +08:00
Peng-YM
2aa3cbd9d2 fix: Backend crash when operator argument is undefined 2022-07-08 16:28:47 +08:00
Peng-YM
d7b97f4595 fix: Error codes are not shown in the response 2022-07-08 11:00:26 +08:00
Peng-YM
8aed0665e3 fix: Restrict artifact name in order to fix a Gist API bug 2022-07-08 10:47:38 +08:00
Peng-YM
b1d811e4c5 fix: Sync time is updated even if upload failed 2022-07-08 10:26:05 +08:00
Peng-YM
2ee515dc23 fix: Full config preprocessor bug 2022-07-07 23:24:01 +08:00
Peng-YM
07cae95ff4 feat: Add artifactStore URL in settings 2022-07-07 22:40:46 +08:00
Peng-YM
240156daef refactor: Revise sync artifacts APIs
- /api/sync/artifacts: sync all artifacts
- /api/sync/artifact/:name: sync a specific artifact
2022-07-07 14:47:09 +08:00
Peng-YM
a420c126c2 refactor: Refactor the arguments of the Flag Operator 2022-07-06 18:12:36 +08:00
Peng-YM
acd0a62496 fix: Set default subscription source to remote when migrating data 2022-07-06 18:12:36 +08:00
Peng-YM
ffd219abfe refactor: Add new frontend as submodule 2022-07-06 18:12:36 +08:00
Peng-YM
bc58419bb1 feat: Added Conditional Filter 2022-07-06 18:12:36 +08:00
Peng-YM
a28c001a5a fix: Useless filter bug 2022-07-06 18:12:36 +08:00
Peng-YM
310d797abf fix: Perform migration after restoring data from gist 2022-07-06 18:12:36 +08:00
Peng-YM
41f84ddb85 chore: nodemon now ignore the changes of sub-store.json 2022-07-06 18:12:36 +08:00
Peng-YM
00c28c6cb8 refactor: Standardize error handling for RESTful APIs 2022-07-06 18:12:36 +08:00
Peng-YM
0e089ef8ce feat: Fetch avatar from GitHub automatically 2022-07-06 18:12:36 +08:00
Peng-YM
7468089f04 fix: QuickSettingOperator does not respect default settings 2022-07-06 18:12:36 +08:00
Peng-YM
b2a797cd25 fix: Useless filters are not migrated 2022-07-06 18:12:36 +08:00
Peng-YM
8e2cd5bb28 fix: Database updateByName not working 2022-07-06 18:12:36 +08:00
Peng-YM
9e33160e37 fix: Process ids are now preserved in migration 2022-07-06 18:12:36 +08:00
Peng-YM
ce51674d6b feat: Add sorting API
Added POST /api/sort/subs, /api/sort/collections, /api/sort/artifacts for sorting subs, collections, and artifacts.
2022-07-06 18:12:36 +08:00
Peng-YM
84b4dba425 refactor: Migrate to API v2
- Added auto schema migration
- Refactored /api/subs, /api/collections, /api/artifacts. Now these APIs will return array instead of object. This enables sorting items in the future.
2022-07-06 18:12:36 +08:00
Peng-YM
b1151859b3 chore: Migrate from npm to pnpm for better performance 2022-07-06 18:12:36 +08:00
Peng-YM
fdbcce8932 doc: Change LICENSE to AGPLv3 2022-07-06 18:11:49 +08:00
github-actions@github.com
297fb1b32a Build sub-store.min.js 2022-07-04 03:47:46 +00:00
Virgil Clyne
0f6a3a8f5f fix (geo.js): adjust the China flag order (#138)
#build
2022-07-04 11:45:47 +08:00
Peng-YM
7834fd6056 fix: Failed to parse Surge/QX nodes with tls fingerprint 2022-07-02 22:53:09 +08:00
Peng-YM
606cfed8da feat (backend): Add preview API
- POST /api/preview/sub for previewing subs
- POST /api/preview/collection for previewing collection
2022-07-01 17:36:48 +08:00
Peng-YM
bb87a6c41e refactor: Download API
Now the download APIs are moved into a new file
2022-06-30 12:19:43 +08:00
Peng-YM
9653b09844 fix: Backend crashes when invalid url is used
Improve error handling for flow info API
2022-06-29 14:07:22 +08:00
Peng-YM
ffc7c07469 perf: Improve /utils/env API
- Add version number
- Add support for Stash & ShadowRocket backend
2022-06-29 11:25:57 +08:00
Peng-YM
7e1139528e feat (backend): Add backend API to get flow info for subscriptions 2022-06-29 00:12:31 +08:00
Peng-YM
79a8956f92 docs: Add version number into products 2022-06-28 13:10:52 +08:00
Peng-YM
03d4d6e918 fix(geo.js): ISO Code at Start/End of String (#137) 2022-06-28 12:52:52 +08:00
github-actions@github.com
f1c8d85ddc fix(geo.js): separate ISO Code from Country Name (#133)
#build
Build sub-store.min.js
2022-06-28 12:44:24 +08:00
Jacob Lee
9202437f05 feat: add preview specific platform feature (#131) 2022-06-25 13:17:12 +08:00
Jacob Lee
013b2173fd Fix: fix the issue that speed dial auto-adaptation theme does not work and is overwritten (#130) 2022-06-24 22:15:06 +08:00
Peng-YM
305ae480bc fix (proxy-parser): ws-headers with multiple keys are not correctly handled when parsing Surge proxies
closes #120
2022-06-24 18:01:31 +08:00
Jacob Lee
730986fed4 feat (UI/sub-editor): Add speed dial for quick saving and adding operations (#129) 2022-06-24 17:22:59 +08:00
QuentinHsu
a1df2de7e2 perf (UI): Use display name in collections
closes #127
2022-06-24 14:41:37 +08:00
Peng-YM
64a453c44a fix (proxy-producer): ws-headers keys are lost when producing Surge nodes
closes #119
2022-06-23 17:59:34 +08:00
Peng-YM
4095606bdf perf: Allow using full configuration as subscription source
Supported configuration formats: Loon, QX, and Surge

closes #121
2022-06-23 15:31:54 +08:00
Hsiaoyi Hsu
f93398b701 feat: Added support for display name 2022-06-22 23:08:15 +08:00
github-actions@github.com
ed86a568ec Build sub-store.min.js 2022-06-22 14:31:15 +00:00
Virgil Clyne
237ecd497e feat: Update getFlag() #build
Update geo.js
2022-06-22 22:29:56 +08:00
Peng-YM
6610f835ba chore: Add dev branch to GitHub action 2022-06-22 22:25:15 +08:00
Peng-YM
ae518a9874 docs: replaced the SIP002 link in commet 2022-06-22 19:25:19 +08:00
Peng-YM
7bd63545cc Update README.md 2022-06-21 22:56:38 +08:00
github-actions@github.com
533b477314 Build sub-store.min.js 2022-06-21 09:04:24 +00:00
Peng-YM
50a3eb5592 fix: unable to delete subscription with trailing spaces #build 2022-06-21 17:02:57 +08:00
Peng-YM
89164c3e7a feat: Added mocha test to GitHub action 2022-06-21 17:01:31 +08:00
Peng-YM
8e0a942a6b fix: vmess aead 2022-06-21 17:00:50 +08:00
Peng-YM
49ed9f1ff3 feat: Added cron script for syncing all artifacts to gist 2022-06-21 16:01:02 +08:00
Peng-YM
94262e162a Added github workflow for building dist files 2022-06-21 15:48:55 +08:00
Peng-YM
05b03b5337 Fix QX SSR issue 2022-06-21 09:24:37 +08:00
Peng-YM
bca4f06fcd feat: Reworked Loon producer 2022-06-20 22:58:27 +08:00
Peng-YM
409c4cbdd9 feat: Added support for parsing Loon vless, Surge socks5 and snell proxies 2022-06-20 22:10:29 +08:00
Peng-YM
d602dbeb7c feat: Added dedicated Stash producer 2022-06-20 21:51:13 +08:00
Peng-YM
bea2c64e40 Fixed min.js not found issue 2022-06-20 20:38:54 +08:00
Peng-YM
99946a8795 Fix trojan URI issues 2022-06-20 19:32:57 +08:00
Peng-YM
e401a31b6c Various bug fixes for URI format parsing 2022-06-20 17:01:09 +08:00
QuentinHsu
4dde556daf feat: add version info in console.log (#117) 2022-06-20 14:14:03 +08:00
Peng-YM
69ccc6bd08 Fixed QX trojan wss issue 2022-06-20 11:11:53 +08:00
Peng-YM
4945826f2d Now an error will be thrown if a required field of a proxy is missing 2022-06-20 01:33:24 +08:00
Peng-YM
83504d42c4 Fixed QX tls issue 2022-06-19 01:14:38 +08:00
Hsiaoyi Hsu
340e3746fe Removed Surge vmess encrypt-method (#116) 2022-06-18 10:15:02 +08:00
Peng-YM
467c03c9d3 Minor bug fix 2022-06-17 22:39:41 +08:00
Peng-YM
8fe645ac3f Set vmess alterId to 0 if not specified 2022-06-17 22:19:02 +08:00
Peng-YM
c12ff37f68 Reworked Surge producer 2022-06-17 22:12:01 +08:00
Peng-YM
0da236fbb1 Minor bug fixes 2022-06-17 20:00:26 +08:00
Peng-YM
1b526414cd Fixed QX vmess method auto 2022-06-16 18:47:40 +08:00
Peng-YM
4b73a1494b Reworked QX producer 2022-06-16 18:35:24 +08:00
Peng-YM
1e22243808 Minor bug fix for chacha20-ietf-poly1305 2022-06-16 16:23:54 +08:00
Peng-YM
ea00b2458c Refactored proxy producers structure 2022-06-16 14:37:51 +08:00
Peng-YM
8fe2280232 Use babel relative import path 2022-06-16 14:24:32 +08:00
Peng-YM
6bfe2700cf Refactored proxy-utils structure 2022-06-16 12:58:24 +08:00
Peng-YM
f91f34d644 Reintroduce storage management API, closes #113 2022-06-16 11:28:15 +08:00
Peng-YM
56ada242d2 Minor refactor 2022-06-16 11:19:07 +08:00
Peng-YM
f76096f244 Removed test.js 2022-06-16 00:55:03 +08:00
Peng-YM
275097f58b Sub-Store 2.0 major release
- Used Peggy.js to replace the original parsers for Loon, QX and Surge.
- Added support for vmess + ws, vmess + http, snell, socks 5 parsing.
- Added various test cases for parsing.
2022-06-16 00:15:03 +08:00
Peng-YM
98bb91babd Hot fix for Surge HTTP 2.0 feature 2022-06-15 23:36:23 +08:00
Peng-YM
ec7c3d8c26 Updated revert.js 2022-06-15 16:45:17 +08:00
Peng-YM
051a01efb0 Hot fix for Surge HTTP 2.0 feature 2022-06-14 23:52:08 +08:00
Peng-YM
97de476ae3 Added global variables for Loon to ScriptOperator and ScriptFilter 2022-06-13 14:21:07 +08:00
NobyDa
9e05c8d7f0 Fix Surge TCP connection shortage. (#110) 2022-06-10 19:29:43 +08:00
Peng-YM
1c5903cda1 Fixed cloud artifact encode issue 2022-06-09 15:53:07 +08:00
Peng-YM
9e50f1b75a Fixed a bug when domain resolve failed, proxy server is missing 2022-06-07 16:56:52 +08:00
Peng-YM
c46c6332e0 Added sans-serif fonts 2022-06-07 16:45:23 +08:00
Peng-YM
7aa3518ce5 Fixed emoji handling in fancy-characters.js 2022-06-07 16:37:10 +08:00
Peng-YM
82ad8a5df8 Added ResolveDomainOperator 2022-06-07 15:55:34 +08:00
Peng-YM
71aaa824ec Update geo.js (#106) 2022-06-04 13:40:55 +08:00
Peng-YM
90e611ceef Refactored ProxyUtils and RuleUtils 2022-06-03 22:51:39 +08:00
Peng-YM
99cc8ce295 Added fancy-characters.js 2022-06-03 20:43:31 +08:00
Peng-YM
1678d2cb65 Replaced eval with Function for security 2022-06-03 20:36:06 +08:00
Peng-YM
cc628788fc Now the "Script Operator" and "Script Filter" support async functions 2022-06-02 23:58:52 +08:00
Peng-YM
072398938f Updated QX configuration 2022-06-02 13:01:58 +08:00
Peng-YM
e28e440dc5 Added support for non-ascii characters in subscriptions, collections and artifacts 2022-05-30 13:47:59 +08:00
Peng-YM
4dbafb77c5 Added deprecation notification for Loon resource parser 2022-05-26 13:49:30 +08:00
Peng-YM
8dbeb8eff3 Fixed Node.js cannot start issue 2022-05-26 11:17:36 +08:00
Peng-YM
a9afae92c5 Fixed Surge https proxy issue 2022-05-25 23:02:06 +08:00
Peng-YM
51db70a1c3 Fixed local subscription not working in collections 2022-05-25 22:33:54 +08:00
Peng-YM
1ac077101d Minor fixes 2022-05-25 18:34:02 +08:00
Peng-YM
e5c256803a Refactored Loon resource parser 2022-05-25 18:17:15 +08:00
Peng-YM
7ed08ef451 Added support for local subscription 2022-05-25 17:32:05 +08:00
Peng-YM
5eceb8d72b Fixed express port issue 2022-05-25 14:42:26 +08:00
Peng-YM
6169ff5255 Refine project structure 2022-05-25 14:33:46 +08:00
Peng-YM
bbe29a7fac Refactored OpenAPI 2022-05-25 11:27:53 +08:00
Peng-YM
0e46d8e14d Minor changes 2022-05-25 11:00:00 +08:00
Peng-YM
c389aa19a2 Updated scripts 2022-05-25 10:33:54 +08:00
Peng-YM
b56f17606e Fixed ESLint issues 2022-05-24 22:24:31 +08:00
Peng-YM
3b70cc0bd8 Added ESLint pipeline into Gulp 2022-05-24 22:19:03 +08:00
Peng-YM
6b22ee7c5d Add nodemon for hot-reloading 2022-05-24 21:35:23 +08:00
Peng-YM
e228416718 Bump to ES6 2022-05-24 21:20:26 +08:00
Peng-YM
46e37df110 Auto darkmode 2022-05-24 17:05:56 +08:00
Peng-YM
975b53db41 Add vmess ws obfs host script 2022-05-24 12:25:14 +08:00
Peng-YM
47451c2df7 Fixed collection ordering is not preserved 2022-05-24 11:31:54 +08:00
Peng-YM
bd58aaa2a4 Fixed UA not working 2022-05-24 10:24:54 +08:00
Peng-YM
52fe634b60 Update README.md 2022-05-23 18:47:34 +08:00
Peng-YM
9216f5c256 Modularized Sub-Store 2022-05-23 18:33:48 +08:00
Peng-YM
3caf743b09 Removed airports configs 2022-05-23 12:24:12 +08:00
qwerzl
7dd8c25663 把澳门加回来 (#96) 2022-05-20 15:30:10 +08:00
qwerzl
65bfcc8a69 国旗列表:添加了一些城市及其英文名 (#95) 2022-05-20 12:15:02 +08:00
Peng-YM
2f183b5644 Merge pull request #93 from qwerzl/master 2022-05-20 08:14:25 +08:00
qwerzl
62b12a0ff1 Added “AE”, ”CA” for Canada and UAE flags 2022-05-20 07:36:39 +08:00
qwerzl
44a4d6a415 Added “AE”, ”CA” for Canada and UAE flags 2022-05-19 23:38:44 +08:00
Peng-YM
8ab2dd17b0 Add logging for remote script 2022-05-18 19:20:13 +08:00
Peng-YM
6bb837f74f Added $argument for "ScriptFilter" and "ScriptOperator", closes #90
Example: https://raw.githubusercontent.com/Peng-YM/Sub-Store/master/scripts/tls-fingerprint.js#fingerprint=67:1B:C8:F2:D4:20:EE:A7:EE:60:DA:BB:A3:F9:A4:D7:C8:29:0F:3E:2F:75:B6:A9:46:88:48:7D:D3:97:7E:98
2022-05-18 13:41:12 +08:00
Peng-YM
48d533af83 Fixed cronSyncArtifact failed issue 2022-05-18 11:06:40 +08:00
Peng-YM
5954ff0a58 Reformat code 2022-05-17 10:24:05 +08:00
Peng-YM
261214aa61 Merge pull request #88 from Marsoit/patch-1 2022-05-16 16:27:13 +08:00
Jupiter
52d73eefc5 Update sub-store.js 2022-05-16 16:16:17 +08:00
Peng-YM
2385027624 Fixed cache bug 2022-05-14 14:37:50 +08:00
Peng-YM
9b1d3d63dd Fixed cronSyncArtifacts error 2022-05-09 21:20:23 +08:00
Peng-YM
93a95b8649 Merge pull request #85 from xaver985/master 2022-05-09 15:11:48 +08:00
Peng-YM
1e1ffd1fca Update Loon.plugin 2022-05-09 11:16:55 +08:00
Xaver Wang
7fee2d50c7 add flags 2022-05-09 02:47:23 +00:00
Xaver Wang
9b3e56079b Update sub-store.js 2022-05-09 10:22:27 +08:00
Peng-YM
6910c7e6e4 Update Loon.plugin 2022-05-05 10:57:56 +08:00
Peng-YM
ef5866d93d Merge pull request #83 from JOJOforshaun/patch-1 2022-05-05 08:54:06 +08:00
JOJOforshaun
76e3e77350 Update README.md
添加小火箭配置说明。
2022-05-05 08:34:20 +08:00
Peng-YM
5035712261 Added support for ShadowRocket, closes #82 2022-05-02 11:07:55 +08:00
Peng-YM
a242fc19df Use cache in cronSyncArtifact to avoid downloading subscription multiple times 2022-05-02 11:07:55 +08:00
Peng-YM
7b68f9fa85 Improve the performance of cronSyncArtifact 2022-04-30 11:29:13 +08:00
Peng-YM
4dc40e92ae Forward subscription-userinfo from the first subscription in a collection 2022-04-28 17:03:01 +08:00
Peng-YM
8b1928e2da Forward subscription-user-info header for Stash 2022-04-28 16:19:53 +08:00
Peng-YM
063cbee198 Fixed targetPlatform parameter not working on collections
Bug fixed
2022-04-18 16:13:37 +08:00
Peng-YM
3ce237d722 Updated tls-fingerprint.js using the new targetPlatform parameter 2022-04-17 23:34:26 +08:00
Peng-YM
f7547bf719 Added an additional parameter targetPlatform for Script Operator 2022-04-17 23:34:26 +08:00
Peng-YM
9f2131551f Update README.md 2022-04-01 20:04:33 +08:00
Peng-YM
892df888cf Depreciated: removed cron-sync-artifacts.js
Synchronizing artifacts through cron script  is not longer supported, please use ShortCut app instead, see #46.
2022-04-01 20:02:07 +08:00
Peng-YM
5a8fb4747d Merge pull request #77 from dompling/master 2022-04-01 19:58:11 +08:00
ShellManager
d65f418e5a 1.修复 mian.js App.vue 引入顺序,导致打包样式错乱问题
2.修复在本地运行或打包时出现 sass 警告
3. 注释了 app.scss 435 行的样式导致按钮背景色显示 #999
2022-03-31 16:14:20 +08:00
Peng-YM
2328b5ac31 Added an example of tls fingerprint configuration 2022-03-29 22:29:03 +08:00
Peng-YM
694a932c57 Fixes tfo issues 2022-03-29 15:30:18 +08:00
Peng-YM
f4ff4d5f97 Added UDP relay support for the Trojan protocol on Surge 2022-03-26 21:49:29 +08:00
Peng-YM
0a96cb9df1 Bug fixes
1. 当 VMess 的 alterId 为 0 时,AEAD 会自动开启。
2. 更新了 Clash 的 VMess Websocket 参数写法,旧版本的写法(如 ws-path, ws-headers 等)已不被支持。
2022-03-25 22:54:42 +08:00
Peng-YM
991bedd663 Add UA auto detection for Stash iOS 2022-03-23 17:36:57 +08:00
Peng-YM
638f4ae8d9 Update README.md 2022-03-22 16:00:07 +08:00
Peng-YM
b034508a86 更新配置文档 2022-03-22 15:58:51 +08:00
Peng-YM
094650dddd Merge pull request #76 from StashNetworks/master
add Stash for iOS
2022-03-22 15:57:57 +08:00
dev
9c60e73531 add Stash for iOS 2022-03-21 22:47:42 +08:00
Peng-YM
093102e791 Add support for Loon UDP relay (SS/SSR/Trojan) 2022-03-11 23:05:20 +08:00
Peng-YM
265a88fc5f Added support for Vmess AEAD (including Loon/QX/Surge), closes 70 2022-03-11 22:00:41 +08:00
Peng-YM
a981763982 Added duplicate alert for collection, closes #74 2022-03-11 21:08:43 +08:00
Peng-YM
2b419ee8e4 Update README.md 2022-01-12 10:20:39 +08:00
Peng-YM
f798bd3aa2 Minified 2021-12-22 18:28:54 +08:00
Peng-YM
090b1cd557 使用 js-yaml 解析 Clash 配置以提升兼容性 2021-12-22 18:23:31 +08:00
Peng-YM
4d1c9a49ac Merge pull request #61 from dompling/master
更新 sub-store.js 兼容 node 服务端
2021-10-24 14:26:38 +08:00
Peng-YM
53b8297e24 Merge branch 'master' into master 2021-10-24 14:26:29 +08:00
Peng-YM
697d9ded8e 新增国旗 (#58) 2021-10-24 14:22:13 +08:00
KotaHv
b24db4a907 修复Loon http https生成相反的问题 (#62) 2021-10-23 21:19:27 +08:00
dompling
6140134c03 nginx 2021-10-19 15:23:31 +08:00
dompling
52ae93dea9 sub-store 2021-10-18 14:40:40 +08:00
dompling
116bdb6354 nginx 服务器配置 2021-10-18 09:29:22 +08:00
dompling
dbe107681d 更新 sub-store.js 兼容 node 服务端 2021-10-18 09:17:48 +08:00
Xaver Wang
1942f6bad8 新增奇奇怪怪国家国旗 2021-10-11 21:47:41 +08:00
Xaver Wang
bfce88ea7a Merge ; commit '638b510c7a812c3d8a79d8295a14c706b7d0d3b2' 2021-10-11 21:36:51 +08:00
Xaver Wang
9ded46c655 Merge branch 'master' of disabled:git@github.com:Peng-YM/Sub-Store.git 2021-10-11 21:36:15 +08:00
Xaver Wang
638b510c7a 微调国旗 (#57) 2021-10-07 10:54:51 +08:00
Xaver Wang
4eadff9e14 update 2021-10-07 09:55:33 +08:00
Xaver Wang
fa30c487ab Merge ; commit '5b1e24a4afdc1ca8d06293c172f7130a1c91a1fc'
Conflicts:
	backend/sub-store.min.js
2021-10-07 09:52:22 +08:00
Peng-YM
5b1e24a4af Added Minified File 2021-09-15 22:37:38 +08:00
Skyxim
6cedde4c4e 订阅新增 User-Agent 选项,允许自定义 UA,默认使用 QuantumultX UA 以获取流量信息 2021-09-15 22:35:00 +08:00
Xaver Wang
bff36d6f68 添加几个国旗 (#54)
Many thanks for @xaver985
2021-09-14 16:58:44 +08:00
Xaver Wang
841ec8ae1b fix 2021-09-14 16:53:04 +08:00
Xaver Wang
ad98661de6 update 2021-09-14 00:53:48 +08:00
Xaver Wang
742ddaf0a1 update 2021-09-14 00:51:16 +08:00
Xaver Wang
f65d27fe44 update 2021-09-14 00:46:55 +08:00
Xaver Wang
8fed0d3b1e update 2021-09-14 00:44:58 +08:00
Xaver Wang
e189e796c9 修复Trojan一处解析错误 2021-09-14 00:42:29 +08:00
Xaver Wang
9129c4f267 Loon.plugin 2021-09-14 00:38:53 +08:00
Peng-YM
0fce1a76e5 Add minified file 2021-09-09 18:35:43 +08:00
Skyxim
a9d8572060 添加从Torjan Uri中获取sni值 (#52)
* 添加从Torjan Uri中获取sni值

感谢 Skyxim <skyxim@users.noreply.github.com>
2021-09-09 18:34:12 +08:00
Peng-YM
87deb369fb 添加 Surge Hybrid 参数支持,添加一键上传所有节点配置到 Gist 2021-09-03 18:05:22 +08:00
Matthew Wo
204e5b73a2 preserve ws-headers for vmess in Surge (#49) 2021-09-03 16:41:07 +08:00
Xaver Wang
47b7ac6267 新增部分国旗
感谢 @xaver985
2021-08-18 16:23:28 +08:00
Peng-YM
9e219029f9 新增节点去重操作,可以对重复节点进行删除或者自动重命名 2021-04-15 17:01:36 +08:00
Peng-YM
69e4ddca60 Reformat codes 2021-04-15 17:00:07 +08:00
Peng-YM
e764f33956 Fixed Typo 2021-03-26 20:06:25 +08:00
Peng-YM
c31034ff29 增加 Loon TCP Fast Open (TFO) 选项 (SS/SSR) 的支持 2021-03-26 19:59:55 +08:00
Peng-YM
51c2ea3dde 增加 Loon UDP relay (SS/SSR) 的支持 2021-03-26 19:21:19 +08:00
Peng-YM
c225751b6f 增加 Loon UDP relay 的支持 2021-03-26 19:17:01 +08:00
Peng-YM
e72745fbce 由于QX脚本不走Rewrite,使用Backend方式触发 2021-02-27 14:47:38 +08:00
Peng-YM
a0691bedaf 多项改进
1. 现在可以编辑远程配置了。
2. 远程配置增加自动同步的选项,配合Cron脚本可以定期同步并上传配置到gist。
2021-02-27 13:00:32 +08:00
Peng-YM
85ee743988 Minor tweaks 2021-01-25 14:23:16 +08:00
Peng-YM
20ea35c9fb Sub-Store现在会为单个订阅转发流量信息 2021-01-25 14:21:16 +08:00
Peng-YM
99b3d44c63 Update README.md 2021-01-21 10:53:48 +08:00
Peng-YM
6c552500c6 节点预览可以预览原始订阅的节点了 2021-01-04 00:03:43 +08:00
Peng-YM
b092d3fd6a 修复Trojan一处解析错误 2020-12-31 14:30:01 +08:00
Peng-YM
76cd097a23 修复端口非443的Troajn节点无法解析的问题 2020-12-25 14:46:48 +08:00
Peng-YM
1f66e110ab Update README.md 2020-12-17 14:52:41 +08:00
Peng-YM
7ebef72955 修复Base64预处理器未能正确处理某些订阅的问题 2020-12-16 17:21:57 +08:00
Peng-YM
ff9586f2bd Fixed a bug when script download failed 2020-12-15 16:26:11 +08:00
Peng-YM
a0d799c832 修复上传时间错误的bug 2020-12-12 17:04:36 +08:00
Peng-YM
433fe5446f 修复了Surge VMess解析WS header错误的问题,感谢@Paldies 2020-12-12 16:45:28 +08:00
Peng-YM
bf8be6e0cb Removed unused log 2020-12-12 16:11:28 +08:00
Peng-YM
944609ec26 Update README.md 2020-12-12 11:54:56 +08:00
Peng-YM
defa6c0e1f Update README.md 2020-12-12 11:53:13 +08:00
Peng-YM
0146990ea9 Update README.md 2020-12-12 11:52:36 +08:00
Peng-YM
cda2c48ea8 Merge remote-tracking branch 'origin/master' 2020-12-12 11:29:47 +08:00
Peng-YM
60647fd5ca 大量UI改进 2020-12-12 11:28:45 +08:00
fossabot
739f85250e Add license scan report and status (#26)
Signed off by: fossabot <badges@fossa.com>
2020-12-11 17:54:09 +08:00
Peng-YM
3f002e0c52 夜间模式 2020-12-11 11:59:02 +08:00
Peng-YM
1f998f70b5 修复正则排序不生效的bug 2020-12-11 10:26:57 +08:00
Peng-YM
fbfc1084fa 修复一处typo 2020-12-10 22:16:55 +08:00
Peng-YM
a6bf4e5c76 正则表达式相关的节点操作支持使用(?i)指定忽略大小写匹配 2020-12-10 21:59:16 +08:00
Peng-YM
7eed0192bc 修复QX无法上传下载gist的bug 2020-12-09 14:14:25 +08:00
Peng-YM
6758f5b6e0 修复QX请求头没有Stringify导致请求超时的问题 2020-12-09 13:12:55 +08:00
Peng-YM
3dddc53ed3 修复列表图标闪烁问题 2020-12-09 11:17:42 +08:00
Peng-YM
5f1b389548 UI改进 2020-12-09 10:04:48 +08:00
Peng-YM
64709b6610 修复UI不刷新的bug 2020-12-09 09:50:55 +08:00
Peng-YM
bb8bac760e Sub-Store 1.2 支持生成远程配置
现在允许用户生成配置并上传到Gist。
2020-12-08 20:19:46 +08:00
Peng-YM
29abac4619 引入Artifacts相关API 2020-12-07 22:01:27 +08:00
Peng-YM
8c22f1c16e 修复正则排序的bug 2020-12-05 15:46:44 +08:00
Peng-YM
9333d989bc Merge branch 'dev' 2020-12-05 13:53:08 +08:00
Peng-YM
2766e23aa0 Sub-Store 1.0版本
1. 移除了所有基于关键词的节点操作,统一使用基于正则表达式的节点操作。
2. UI的大量改进。
2020-12-05 13:39:11 +08:00
Peng-YM
4d1b80ff63 Improved notifications 2020-12-03 15:47:32 +08:00
Peng-YM
f540e49bca Improved log 2020-12-02 16:35:54 +08:00
Peng-YM
f54b87dff3 修正了几个订阅解析错误
- 修复了Quantmult格式VMess的obfs-path和obfs-header解析错误的问题。
- 修复了SSR URI格式protoparams和obfsparams解析错误的问题
2020-12-01 14:55:35 +08:00
Peng-YM
8195fb8235 修正规则解析错误,同时修复一处编码问题 2020-11-27 20:38:55 +08:00
Peng-YM
18164a0c7d 修复分流解析错误的问题 2020-11-27 16:26:41 +08:00
Peng-YM
1398782595 Loon Parser 2020-11-27 11:40:47 +08:00
Peng-YM
eef1559706 修复QX IP-CIDR分流no-resolve解析不正确的问题 2020-11-26 19:59:27 +08:00
Peng-YM
99514f521b 添加一些内置分流 2020-11-26 19:50:54 +08:00
Peng-YM
117a920faf 再次修复之前的bug 2020-11-26 15:24:30 +08:00
Peng-YM
fb7956b589 修复无法下载订阅的bug,我真是bug制造大师... 2020-11-26 15:16:26 +08:00
Peng-YM
2b3f2bbf28 修复一处错误的通知提示 2020-11-26 14:05:47 +08:00
Peng-YM
a6374ac9c3 添加Sub-Store分流支持 2020-11-26 13:43:54 +08:00
Peng-YM
e630caf386 修复备份错误的bug,请重新上传 2020-11-25 12:04:28 +08:00
Peng-YM
0fbdbe7b85 修复组合订阅节点处理错误的问题 2020-11-25 10:47:21 +08:00
Peng-YM
710d5b14e5 修复Loon和Surge上无法保存的bug 2020-11-24 22:59:04 +08:00
Peng-YM
f9dd77ed41 修复无法保存创建订阅的bug 2020-11-24 22:29:23 +08:00
Peng-YM
22c8483f17 紧急修复BUG 2020-11-24 22:11:05 +08:00
Peng-YM
ff4790f12e 组合订阅现在允许添加所有节点操作 2020-11-24 21:21:43 +08:00
Peng-YM
f886bc11e9 完全重构Sub-Store后端代码 2020-11-24 21:15:08 +08:00
Peng-YM
650810bcba 修复QX VMess解析的一处错误 2020-11-09 19:50:02 +08:00
Peng-YM
afa88a79a9 Removed redudant comma 2020-11-02 14:27:23 +08:00
Peng-YM
5be7f2e1ea Add timestamp for minified script 2020-10-27 20:26:21 +08:00
Peng-YM
1ae804ce6b Fixed Loon & Surge Bug 2020-10-27 20:09:48 +08:00
Peng-YM
da71611d70 Fixed Clash TLS host bug 2020-10-20 17:45:21 +08:00
Peng-YM
0d1e0588c5 Fixed some default parameter errors 2020-10-20 17:19:54 +08:00
Peng-YM
fe5dcd2a1b Fixed Clash plugin options parse error 2020-10-20 14:58:07 +08:00
omeks
f3b780370c Fixed QX Producer Bug (#13)
Special thanks to @omeks
2020-10-14 10:27:17 +08:00
Peng-YM
1fb453c106 组合订阅现在可以在链接后添加?target=Clash等指定输出的目标格式了 2020-10-10 16:42:33 +08:00
Peng-YM
4cb8ba1af9 Fixed Loon Bug 2020-10-06 11:30:39 +08:00
Peng-YM
966d1e6ab9 Try to fix loon bug 2020-10-06 10:54:02 +08:00
Peng-YM
22914f792c Add status codes for QX 2020-10-05 22:33:16 +08:00
Peng-YM
915c0d20ae Add status codes 2020-10-05 22:32:49 +08:00
Peng-YM
c619e4e6eb 添加跳转 2020-10-05 22:07:14 +08:00
Peng-YM
a9a68be9f6 Delete backend for QX 2020-10-05 12:12:32 +08:00
Peng-YM
9d97c23186 fixed revert 2020-10-04 20:24:30 +08:00
Peng-YM
ab9343b79a Add 2020-10-04 18:53:34 +08:00
Peng-YM
768b56d7fe 添加急救 2020-10-04 16:34:02 +08:00
Peng-YM
ea7f208882 适配QX TF 390+特性 2020-10-04 10:37:04 +08:00
Peng-YM
77ec9c6953 添加导入数据的接口 2020-10-03 21:32:23 +08:00
Peng-YM
fc27450759 add airport configs database 2020-10-03 21:21:38 +08:00
Peng-YM
4448fc74c3 添加导出所有数据的API接口 2020-10-03 21:06:03 +08:00
Peng-YM
317e3fc724 修复国旗优先级问题 2020-10-02 11:21:04 +08:00
Peng-YM
33ae67ab60 Add Clash and Subscription producer 2020-09-29 17:09:29 +08:00
Peng-YM
8b626ffad3 Add some logs 2020-09-24 15:47:00 +08:00
Peng-YM
4b25874dc6 Minor bug fixed 2020-09-24 15:12:45 +08:00
Peng-YM
3b57b895e2 支持配置Gist同步 2020-09-24 14:59:14 +08:00
Peng-YM
d30ece21ae Fixed single proxy display error 2020-09-23 18:00:04 +08:00
Peng-YM
3d208c9e9f Fixed whitespace issue for QX 2020-09-21 13:45:10 +08:00
Peng-YM
535a20bd90 Add script demo 2020-09-21 13:23:05 +08:00
Peng-YM
d8129de848 Fixed V2RayN SNI issue 2020-09-21 10:15:05 +08:00
Peng-YM
0d3e6bf548 Bug fixed 2020-09-20 10:05:30 +08:00
Peng-YM
ab9d7d6a80 Bug fixed 2020-09-20 10:00:22 +08:00
Peng-YM
fac377735d Added two examples for script operators 2020-09-20 09:56:40 +08:00
Peng-YM
32703deb2c Fixed scert for Surge 2020-09-19 16:59:22 +08:00
Peng-YM
05f746571a 添加导入导出配置功能 2020-09-18 12:56:37 +08:00
Peng-YM
af9f96d101 实现关键词排序UI 2020-09-18 11:07:23 +08:00
Peng-YM
910f2c1b67 提供更方便的脚本操作接口 2020-09-15 11:13:56 +08:00
Peng-YM
a0d8e79d3c Fixed Trojan issue 2020-09-14 10:12:53 +08:00
Peng-YM
8504738ee1 Fixed Trojan server name bug 2020-09-14 09:44:00 +08:00
Peng-YM
1cecbe541e Merge remote-tracking branch 'origin/master' 2020-09-12 22:29:46 +08:00
Peng-YM
893a659bb9 添加Loon新UA判断 2020-09-12 22:29:18 +08:00
Peng-YM
fea3dfb7b9 添加Loon新UA判断 2020-09-12 22:28:11 +08:00
Peng-YM
0842b3fcbc Delete sub.json 2020-09-12 11:17:35 +08:00
Peng-YM
dac2ec95ae Delete collection.json 2020-09-12 11:17:26 +08:00
Peng-YM
92562dff6c Minified backend 2020-09-09 20:30:25 +08:00
Peng-YM
34474c193b Fixed Clash config memory issue 2020-09-09 19:51:04 +08:00
Peng-YM
ad660da24b Update README.md 2020-09-08 12:35:00 +08:00
Peng-YM
786da08b1b Update README.md 2020-09-08 12:32:16 +08:00
Peng-YM
d5d77ea1e6 UPDATE README 2020-09-06 20:57:21 +08:00
Peng-YM
77ee48366e Allow share QR Code 2020-09-06 20:53:11 +08:00
Peng-YM
82fd8cd02c Update README.md 2020-09-06 11:54:27 +08:00
Peng-YM
93953b9c46 Merge pull request #2 from zZPiglet/master
尝试增加 SSD 支持。感谢Z神
2020-09-06 11:54:05 +08:00
Peng-YM
1f2757197a Fixed YAML parse 2020-09-06 11:53:07 +08:00
Peng-YM
e259ed2e6e Supported URI Producer 2020-09-06 11:39:48 +08:00
zZPiglet
4a57b30f71 修正 ssd plugin 错误。 2020-09-06 02:13:03 +08:00
zZPiglet
e25c83368e 修正 localhost。 2020-09-06 01:05:48 +08:00
zZPiglet
568b2a1460 尝试增加 SSD 支持。 2020-09-05 20:07:41 +08:00
Peng-YM
9fcea60555 Bug fixed for Loon 2020-09-05 09:48:39 +08:00
Peng-YM
6b97c4c2d7 Bug fixed 2020-09-04 21:15:26 +08:00
Peng-YM
ff89902733 Add IP_API 2020-09-04 20:53:52 +08:00
Peng-YM
0683230303 Add scripts 2020-09-04 18:30:38 +08:00
Peng-YM
3ed39271b1 Bug Fixed for reording multiple processors 2020-09-04 15:05:25 +08:00
Peng-YM
2e758ec7c8 Set UA to QX 2020-09-03 16:54:05 +08:00
Peng-YM
250afb10a2 Added script filter and script opeartor 2020-09-03 16:16:28 +08:00
Peng-YM
82a8c16e51 Bug fixed for keyword replace 2020-09-03 12:54:34 +08:00
Peng-YM
1ea5418871 Fixed Canada flag 2020-09-03 10:30:07 +08:00
Peng-YM
1c06bd8869 UI Improvements 2020-09-03 10:23:50 +08:00
Peng-YM
80294618fb Minor Bug fixed 2020-09-01 20:24:32 +08:00
Peng-YM
2d6aa1ef1a bug fixed 2020-09-01 17:56:24 +08:00
Peng-YM
8fc5e58276 修复缓存 2020-09-01 16:18:59 +08:00
Peng-YM
56b350a649 启用订阅缓存,大幅减少浏览器响应延迟 2020-09-01 12:08:14 +08:00
Peng-YM
b2f9eb9989 添加四个重命名 2020-09-01 10:11:02 +08:00
Peng-YM
4873c6bb3c 修复过滤器切换模式不生效的bug 2020-09-01 08:43:30 +08:00
Peng-YM
1fd3326c5c ... 2020-09-01 03:27:54 +08:00
Peng-YM
d4dcc5a906 Update RegionFilter.vue 2020-09-01 01:59:36 +08:00
Peng-YM
af0baba727 修复过滤无效节点的bug 2020-09-01 00:39:15 +08:00
Peng-YM
089b36c4fe 添加正则过滤器,关键词过滤器 2020-08-31 23:57:34 +08:00
Peng-YM
ea90f16e54 UI添加两个过滤器: 区域过滤器和类型过滤器 2020-08-31 21:10:36 +08:00
Peng-YM
9291c4f628 Update README.md 2020-08-31 19:19:59 +08:00
Peng-YM
78991ddca8 修复SS URI的一处解析错误 2020-08-31 19:10:29 +08:00
Peng-YM
8a85d6dd21 添加Quantumult格式的VMess订阅支持 2020-08-31 17:16:27 +08:00
Peng-YM
23b4532037 修改UA为Quantumult,以获取流量信息等 2020-08-31 15:50:54 +08:00
Peng-YM
d81fd8cb62 修改UA为Quantumult,以获取流量信息等 2020-08-31 15:50:34 +08:00
Peng-YM
00be2678f4 修复SS无混淆插件的情况 2020-08-31 15:09:53 +08:00
Peng-YM
c5b19f5286 Merge remote-tracking branch 'origin/master' 2020-08-31 14:53:34 +08:00
Peng-YM
7495ba6f78 修复obfs-local格式SS订阅 2020-08-31 14:53:13 +08:00
Peng-YM
85e3801a26 Update Surge.sgmodule 2020-08-31 14:05:53 +08:00
Peng-YM
2a04476bca 处理Option请求 2020-08-31 14:02:56 +08:00
Peng-YM
a4f096b471 Surge iOS已修复,感谢@pysta大佬协助 2020-08-31 13:44:00 +08:00
Peng-YM
49349365fa Adapt status code 2020-08-31 13:41:39 +08:00
Peng-YM
a9811c4896 Try to fix QX 2020-08-31 13:09:13 +08:00
Peng-YM
5a2a600c38 Merge remote-tracking branch 'origin/master' 2020-08-31 12:27:05 +08:00
Peng-YM
f007bc7c23 修复过滤器逻辑错误 2020-08-31 12:26:30 +08:00
Peng-YM
c4fd5d363b Update sub-store.js 2020-08-31 03:27:27 +08:00
Peng-YM
231577eebd Update Surge.sgmodule 2020-08-31 02:50:33 +08:00
Peng-YM
88634b146a Merge ; commit '47d06919aa1524905cb68fcab67f5b8968e5d0d1'
Conflicts:
	config/Surge.sgmodule
2020-08-31 02:44:46 +08:00
Peng-YM
fa8b5b50a2 Update Surge.sgmodule 2020-08-31 02:42:15 +08:00
Peng-YM
47d06919aa Update Surge.sgmodule 2020-08-31 02:19:04 +08:00
Peng-YM
bd6d0849e4 Merge remote-tracking branch 'origin/master' 2020-08-31 02:15:43 +08:00
Peng-YM
e36c719ef0 Change Domain 2020-08-31 02:14:45 +08:00
Peng-YM
1b4966620c Update Surge.sgmodule 2020-08-31 02:05:39 +08:00
Peng-YM
c75d318961 修改域名为sub.com 2020-08-31 01:08:49 +08:00
Peng-YM
ae7953a0eb 更换域名 2020-08-31 00:59:47 +08:00
Peng-YM
ad18b11d56 QX header修复 2020-08-31 00:57:06 +08:00
Peng-YM
1a3d1ac1c0 [Bug Fixed] 修复Loon VMess错误 2020-08-31 00:37:11 +08:00
Peng-YM
f9a1da4b27 Update README.md 2020-08-31 00:28:00 +08:00
Peng-YM
b7a140e8fd Update README.md 2020-08-31 00:27:48 +08:00
Peng-YM
bff31187d8 [Bug Fixed] 修复Loon VMess错误 2020-08-31 00:15:48 +08:00
Peng-YM
d14bd41b68 Add more timeout to axios 2020-08-30 21:58:31 +08:00
Peng-YM
3d2cd1569f Add config for Surge and Loon 2020-08-30 21:52:17 +08:00
Peng-YM
03bc695ae3 Bug fixed 2020-08-30 21:45:31 +08:00
Peng-YM
583f94e5b3 Alpha test 2020-08-30 21:25:46 +08:00
Peng-YM
a71914676e Working on sub-editor 2020-08-28 15:00:45 +08:00
Peng-YM
8b4c972f77 适配移动端web app
样式来自Chavyleung
2020-08-26 21:33:00 +08:00
Peng-YM
aee89acfe8 Merge remote-tracking branch 'origin/master' 2020-08-26 21:10:25 +08:00
Peng-YM
1fcc1f77d7 Add cache 2020-08-26 21:09:34 +08:00
Peng-YM
40cdd7be47 Update README.md 2020-08-25 15:15:01 +08:00
Peng-YM
ccafb9c75e Update README.md 2020-08-25 11:25:34 +08:00
Peng-YM
f279c13239 Update README.md 2020-08-25 11:21:52 +08:00
Peng-YM
1b0f8f124e 支持Clash YAML输入 2020-08-25 11:18:35 +08:00
Peng-YM
8cec472812 Add some components 2020-08-23 12:25:02 +08:00
Peng-YM
0a11261eee Added subscription page 2020-08-23 00:56:35 +08:00
Peng-YM
72bb2f4edb Update README.md 2020-08-21 18:12:29 +08:00
Peng-YM
343692db86 Support remote script 2020-08-21 18:06:27 +08:00
Peng-YM
a610346c5d Merge branch 'master' of https://github.com/Peng-YM/Sub-Store into master 2020-08-19 21:34:44 +08:00
Peng-YM
9aec501a48 Web 2020-08-19 21:34:35 +08:00
Peng-YM
83070fc708 Update README.md 2020-08-19 19:31:15 +08:00
Peng-YM
82690b1e5e Update README.md 2020-08-19 19:30:30 +08:00
Peng-YM
997ef25e2e Added vuetify 2020-08-19 16:36:01 +08:00
Peng-YM
64e11e02e7 Re-organized project structure 2020-08-19 16:18:48 +08:00
Peng-YM
7aa0fa6911 Create LICENSE 2020-08-19 16:16:07 +08:00
54 changed files with 539 additions and 1742 deletions

1
.gitignore vendored
View File

@@ -1,7 +1,6 @@
.DS_Store
# json config
sub-store.json
sub-store_*.json
root.json
# Logs

0
.gitmodules vendored Normal file
View File

View File

@@ -26,14 +26,13 @@ Core functionalities:
### Supported Input Formats
> ⚠️ Do not use `Shadowrocket` or `NekoBox` to export URI and then import it as input. The URIs exported in this way may not be standard URIs. However, we have already supported some very common non-standard URIs (such as VMess, VLESS).
> ⚠️ Do not use `Shadowrocket` or `NekoBox` to export URI and then import it as input. The URIs exported in this way may not be standard URIs.
- [x] Proxy URI Scheme(`socks5`, `socks5+tls`, `http`, `https`(it's ok))
example: `socks5+tls://user:pass@ip:port#name`
- [x] URI(AnyTLS, SOCKS, SS, SSR, VMess, VLESS, Trojan, Hysteria, Hysteria 2, TUIC v5, WireGuard)
> Please note, HTTP(s) does not have a standard URI format, so it is not supported. Please use other formats.
- [x] Clash Proxies YAML
- [x] Clash Proxy JSON(single line)
- [x] QX (SS, SSR, VMess, Trojan, HTTP, SOCKS5, VLESS)
@@ -42,9 +41,6 @@ Core functionalities:
- [x] Surfboard (SS, VMess, Trojan, HTTP, SOCKS5, SOCKS5-TLS, WireGuard(Surfboard to Surfboard))
- [x] Clash.Meta (Direct, SS, SSR, VMess, Trojan, HTTP, SOCKS5, Snell, VLESS, WireGuard, Hysteria, Hysteria 2, TUIC, SSH, mieru, AnyTLS)
- [x] Stash (SS, SSR, VMess, Trojan, HTTP, SOCKS5, Snell, VLESS, WireGuard, Hysteria, TUIC, Juicity, SSH)
Deprecated(The frontend doesn't show it, but the backend still supports it, with the query parameter `target=Clash`):
- [x] Clash (SS, SSR, VMess, Trojan, HTTP, SOCKS5, Snell, VLESS, WireGuard)
### Supported Target Platforms
@@ -52,6 +48,7 @@ Deprecated(The frontend doesn't show it, but the backend still supports it, with
- [x] Plain JSON
- [x] Stash
- [x] Clash.Meta(mihomo)
- [x] Clash
- [x] Surfboard
- [x] Surge
- [x] SurgeMac(Use mihomo to support protocols that are not supported by Surge itself)
@@ -63,10 +60,6 @@ Deprecated(The frontend doesn't show it, but the backend still supports it, with
- [x] V2Ray
- [x] V2Ray URI
Deprecated:
- [x] Clash
## 2. Subscription Formatting
### Filtering
@@ -99,16 +92,22 @@ Go to `backend` directories, install node dependencies:
pnpm i
```
1. In `backend`, run the backend server on http://localhost:3000
babel(old school)
```
pnpm start
```
or
esbuild(experimental)
```
SUB_STORE_BACKEND_API_PORT=3000 pnpm run --parallel "/^dev:.*/"
```
### Build
```
pnpm bundle:esbuild
```
## LICENSE
This project is under the GPL V3 LICENSE.
@@ -123,9 +122,3 @@ This project is under the GPL V3 LICENSE.
- Special thanks to @KOP-XIAO for his awesome resource-parser. Please give a [star](https://github.com/KOP-XIAO/QuantumultX) for his great work!
- Special thanks to @Orz-3 and @58xinian for their awesome icons.
## Sponsors
[![image](./support.nodeseek.com_page_promotion_id=8.png)](https://yxvm.com)
[NodeSupport](https://github.com/NodeSeekDev/NodeSupport) sponsored this project.

View File

@@ -1,6 +1,6 @@
{
"name": "sub-store",
"version": "2.20.0",
"version": "2.18.0",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
"main": "src/main.js",
"scripts": {
@@ -30,16 +30,12 @@
"connect-history-api-fallback": "^2.0.0",
"cron": "^3.1.6",
"dns-packet": "^5.6.1",
"dotenv": "^16.4.7",
"express": "^4.17.1",
"fetch-socks": "^1.3.2",
"http-proxy-middleware": "^3.0.3",
"ip-address": "^9.0.5",
"js-base64": "^3.7.2",
"json5": "^2.2.3",
"jsrsasign": "^11.1.0",
"lodash": "^4.17.21",
"mime-types": "^2.1.35",
"ms": "^2.1.3",
"nanoid": "^3.3.3",
"semver": "^7.6.3",

41
backend/pnpm-lock.yaml generated
View File

@@ -34,15 +34,9 @@ importers:
dns-packet:
specifier: ^5.6.1
version: 5.6.1
dotenv:
specifier: ^16.4.7
version: 16.5.0
express:
specifier: ^4.17.1
version: 4.21.2
fetch-socks:
specifier: ^1.3.2
version: 1.3.2
http-proxy-middleware:
specifier: ^3.0.3
version: 3.0.3
@@ -52,18 +46,12 @@ importers:
js-base64:
specifier: ^3.7.2
version: 3.7.7
json5:
specifier: ^2.2.3
version: 2.2.3
jsrsasign:
specifier: ^11.1.0
version: 11.1.0
lodash:
specifier: ^4.17.21
version: 4.17.21
mime-types:
specifier: ^2.1.35
version: 2.1.35
ms:
specifier: ^2.1.3
version: 2.1.3
@@ -1667,10 +1655,6 @@ packages:
resolution: {integrity: sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==}
engines: {node: '>=0.4', npm: '>=1.2'}
dotenv@16.5.0:
resolution: {integrity: sha512-m/C+AwOAr9/W1UOIZUo232ejMNnJAJtYQjUbHoNTBNTJSvqzzDh7vnrei3o3r3m9blf6ZoDkvcw0VmozNRFJxg==}
engines: {node: '>=12'}
dunder-proto@1.0.1:
resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==}
engines: {node: '>= 0.4'}
@@ -1977,9 +1961,6 @@ packages:
fastq@1.18.0:
resolution: {integrity: sha512-QKHXPW0hD8g4UET03SdOdunzSouc9N4AuHdsX8XNcTsuz+yYFILVNIX4l9yHABMhiEI9Db0JTTIpu0wB+Y1QQw==}
fetch-socks@1.3.2:
resolution: {integrity: sha512-vkH5+Zgj2yEbU57Cei0iyLgTZ4OkEKJj56Xu3ViB5dpsl599JgEooQ3x6NVagIFRHWnWJ+7K0MO0aIV1TMgvnw==}
file-entry-cache@6.0.1:
resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==}
engines: {node: ^10.12.0 || >=12.0.0}
@@ -3642,10 +3623,6 @@ packages:
resolution: {integrity: sha512-3TYDR7xWt4dIqV2JauJr+EJeW356RXijHeUlO+8djJ+uBXPn8/2dpzBc8yQhh583sVvc9CvFAeQVgijsH+PNNg==}
engines: {node: '>=0.10.0'}
smart-buffer@4.2.0:
resolution: {integrity: sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==}
engines: {node: '>= 6.0.0', npm: '>= 3.0.0'}
snapdragon-node@2.1.1:
resolution: {integrity: sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==}
engines: {node: '>=0.10.0'}
@@ -3658,10 +3635,6 @@ packages:
resolution: {integrity: sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==}
engines: {node: '>=0.10.0'}
socks@2.8.6:
resolution: {integrity: sha512-pe4Y2yzru68lXCb38aAqRf5gvN8YdjP1lok5o0J7BOHljkyCGKVz7H3vpVIXKD27rj2giOJ7DwVyk/GWrPHDWA==}
engines: {node: '>= 10.0.0', npm: '>= 3.0.0'}
source-map-generator@0.8.0:
resolution: {integrity: sha512-psgxdGMwl5MZM9S3FWee4EgsEaIjahYV5AzGnwUvPhWeITz/j6rKpysQHlQ4USdxvINlb8lKfWGIXwfkrgtqkA==}
engines: {node: '>= 10'}
@@ -6084,8 +6057,6 @@ snapshots:
domain-browser@1.2.0: {}
dotenv@16.5.0: {}
dunder-proto@1.0.1:
dependencies:
call-bind-apply-helpers: 1.0.1
@@ -6567,11 +6538,6 @@ snapshots:
dependencies:
reusify: 1.0.4
fetch-socks@1.3.2:
dependencies:
socks: 2.8.6
undici: 7.4.0
file-entry-cache@6.0.1:
dependencies:
flat-cache: 3.2.0
@@ -8443,8 +8409,6 @@ snapshots:
slash@1.0.0: {}
smart-buffer@4.2.0: {}
snapdragon-node@2.1.1:
dependencies:
define-property: 1.0.0
@@ -8468,11 +8432,6 @@ snapshots:
transitivePeerDependencies:
- supports-color
socks@2.8.6:
dependencies:
ip-address: 9.0.5
smart-buffer: 4.2.0
source-map-generator@0.8.0: {}
source-map-resolve@0.5.3:

View File

@@ -1,8 +1,7 @@
import { Base64 } from 'js-base64';
import { Buffer } from 'buffer';
import rs from '@/utils/rs';
import YAML from '@/utils/yaml';
import download, { downloadFile } from '@/utils/download';
import download from '@/utils/download';
import {
isIPv4,
isIPv6,
@@ -25,7 +24,6 @@ import { getFlag, removeFlag, getISO, MMDB } from '@/utils/geo';
import Gist from '@/utils/gist';
import { isPresent } from './producers/utils';
import { doh } from '@/utils/dns';
import JSON5 from 'json5';
function preprocess(raw) {
for (const processor of PROXY_PREPROCESSORS) {
@@ -116,7 +114,12 @@ async function processFn(
if (item.type.indexOf('Script') !== -1) {
const { mode, content } = item.args;
if (mode === 'link') {
let noCache;
let url = content || '';
if (url.endsWith('#noCache')) {
url = url.replace(/#noCache$/, '');
noCache = true;
}
// extract link arguments
const rawArgs = url.split('#');
if (rawArgs.length > 1) {
@@ -135,17 +138,10 @@ async function processFn(
}
}
}
url = `${url.split('#')[0]}${
rawArgs[2]
? `#${rawArgs[2]}`
: $arguments?.noCache != null ||
$arguments?.insecure != null
? `#${rawArgs[1]}`
: ''
}`;
const downloadUrlMatch = url
.split('#')[0]
.match(/^\/api\/(file|module)\/(.+)/);
url = `${url.split('#')[0]}${noCache ? '#noCache' : ''}`;
const downloadUrlMatch = url.match(
/^\/api\/(file|module)\/(.+)/,
);
if (downloadUrlMatch) {
let type = '';
try {
@@ -175,17 +171,6 @@ async function processFn(
);
throw new Error(`无法加载 ${type}: ${url}`);
}
} else if (url?.startsWith('/')) {
try {
const fs = eval(`require("fs")`);
script = fs.readFileSync(url.split('#')[0], 'utf8');
// $.info(`Script loaded: >>>\n ${script}`);
} catch (err) {
$.error(
`Error when reading local script: ${item.args.content}.\n Reason: ${err}`,
);
throw new Error(`无法从该路径读取脚本文件: ${url}`);
}
} else {
// if this is a remote script, download it
try {
@@ -343,12 +328,8 @@ export const ProxyUtils = {
MMDB,
Gist,
download,
downloadFile,
isValidUUID,
doh,
Buffer,
Base64,
JSON5,
};
function tryParse(parser, line) {
@@ -632,7 +613,7 @@ function lastParse(proxy) {
proxy['tls-fingerprint'] = rs.generateFingerprint(caStr);
}
if (
['ss'].includes(proxy.type) &&
['shadowsocks'].includes(proxy.type) &&
isPresent(proxy, 'shadow-tls-password')
) {
proxy.plugin = 'shadow-tls';

View File

@@ -12,7 +12,6 @@ import getLoonParser from './peggy/loon';
import getQXParser from './peggy/qx';
import getTrojanURIParser from './peggy/trojan-uri';
import $ from '@/core/app';
import JSON5 from 'json5';
import { Base64 } from 'js-base64';
@@ -129,13 +128,13 @@ function URI_SS() {
// parse url
let content = line.split('ss://')[1];
let name = line.split('#')[1];
const proxy = {
name: decodeURIComponent(line.split('#')[1]),
type: 'ss',
};
content = content.split('#')[0]; // strip proxy name
// handle IPV4 and IPV6
let serverAndPortArray = content.match(/@([^/?]*)(\/|\?|$)/);
let serverAndPortArray = content.match(/@([^/]*)(\/|$)/);
let rawUserInfoStr = decodeURIComponent(content.split('@')[0]); // 其实应该分隔之后, 用户名和密码再 decodeURIComponent. 但是问题不大
let userInfoStr;
@@ -261,10 +260,6 @@ function URI_SS() {
if (/(&|\?)tfo=(1|true)/i.test(query)) {
proxy.tfo = true;
}
if (name != null) {
name = decodeURIComponent(name);
}
proxy.name = name ?? `SS ${proxy.server}:${proxy.port}`;
return proxy;
};
return { name, test, parse };
@@ -347,7 +342,7 @@ function URI_VMess() {
};
const parse = (line) => {
line = line.split('vmess://')[1];
let content = Base64.decode(line.replace(/\?.*?$/, ''));
let content = Base64.decode(line);
if (/=\s*vmess/.test(content)) {
// Quantumult VMess URI format
const partitions = content.split(',').map((p) => p.trim());
@@ -440,16 +435,7 @@ function URI_VMess() {
type: 'vmess',
server,
port,
// https://github.com/2dust/v2rayN/wiki/Description-of-VMess-share-link
// https://github.com/XTLS/Xray-core/issues/91
cipher: [
'auto',
'aes-128-gcm',
'chacha20-poly1305',
'none',
].includes(params.scy)
? params.scy
: 'auto',
cipher: getIfPresent(params.scy, 'auto'),
uuid: params.id,
alterId: parseInt(
getIfPresent(params.aid ?? params.alterId, 0),
@@ -466,12 +452,8 @@ function URI_VMess() {
);
}
// https://github.com/2dust/v2rayN/wiki/%E5%88%86%E4%BA%AB%E9%93%BE%E6%8E%A5%E6%A0%BC%E5%BC%8F%E8%AF%B4%E6%98%8E(ver-2)
if (proxy.tls) {
if (params.sni && params.sni !== '') {
proxy.sni = params.sni;
} else if (params.peer && params.peer !== '') {
proxy.sni = params.peer;
}
if (proxy.tls && params.sni && params.sni !== '') {
proxy.sni = params.sni;
}
let httpupgrade = false;
// handle obfs
@@ -483,8 +465,8 @@ function URI_VMess() {
['http'].includes(params.type)
) {
proxy.network = 'http';
} else if (['grpc', 'kcp', 'quic'].includes(params.net)) {
proxy.network = params.net;
} else if (['grpc'].includes(params.net)) {
proxy.network = 'grpc';
} else if (
params.net === 'httpupgrade' ||
proxy.network === 'httpupgrade'
@@ -510,11 +492,6 @@ function URI_VMess() {
} catch (e) {}
let transportPath = params.path;
// 补上默认 path
if (['ws'].includes(proxy.network)) {
transportPath = transportPath || '/';
}
if (proxy.network === 'http') {
if (transportHost) {
// 1)http(tcp)->host中间逗号(,)隔开
@@ -534,28 +511,13 @@ function URI_VMess() {
}
}
// 传输层应该有配置, 暂时不考虑兼容不给配置的节点
if (
transportPath ||
transportHost ||
['kcp', 'quic'].includes(proxy.network)
) {
if (transportPath || transportHost) {
if (['grpc'].includes(proxy.network)) {
proxy[`${proxy.network}-opts`] = {
'grpc-service-name': getIfNotBlank(transportPath),
'_grpc-type': getIfNotBlank(params.type),
'_grpc-authority': getIfNotBlank(params.authority),
};
} else if (['kcp', 'quic'].includes(proxy.network)) {
proxy[`${proxy.network}-opts`] = {
[`_${proxy.network}-type`]: getIfNotBlank(
params.type,
),
[`_${proxy.network}-host`]: getIfNotBlank(
getIfNotBlank(transportHost),
),
[`_${proxy.network}-path`]:
getIfNotBlank(transportPath),
};
} else {
const opts = {
path: getIfNotBlank(transportPath),
@@ -571,12 +533,6 @@ function URI_VMess() {
delete proxy.network;
}
}
proxy['client-fingerprint'] = params.fp;
proxy.alpn = params.alpn ? params.alpn.split(',') : undefined;
// 然而 wiki 和 app 实测中都没有字段表示这个
// proxy['skip-cert-verify'] = /(TRUE)|1/i.test(params.allowInsecure);
return proxy;
}
};
@@ -678,9 +634,6 @@ function URI_VLESS() {
}
if (!proxy.network && isShadowrocket && params.obfs) {
proxy.network = params.obfs;
if (['none'].includes(proxy.network)) {
proxy.network = 'tcp';
}
}
if (['websocket'].includes(proxy.network)) {
proxy.network = 'ws';
@@ -783,8 +736,6 @@ function URI_AnyTLS() {
proxy[key] = value ? value.split(',') : undefined;
} else if (['insecure'].includes(key)) {
proxy['skip-cert-verify'] = /(TRUE)|1/i.test(value);
} else if (['udp'].includes(key)) {
proxy[key] = /(TRUE)|1/i.test(value);
} else {
proxy[key] = value;
}
@@ -1003,9 +954,6 @@ function URI_TUIC() {
proxy.tfo = true;
} else if (['disable-sni', 'reduce-rtt'].includes(key)) {
proxy[key] = /(TRUE)|1/i.test(value);
} else if (key === 'congestion-control') {
proxy['congestion-controller'] = value;
delete proxy[key];
} else {
proxy[key] = value;
}
@@ -1131,14 +1079,14 @@ function Clash_All() {
const name = 'Clash Parser';
const test = (line) => {
try {
JSON5.parse(line);
JSON.parse(line);
} catch (e) {
return false;
}
return true;
};
const parse = (line) => {
const proxy = JSON5.parse(line);
const proxy = JSON.parse(line);
if (
![
'anytls',

View File

@@ -39,12 +39,12 @@ start = (shadowsocksr/shadowsocks/vmess/vless/trojan/https/http/socks5/hysteria2
return proxy;
}
shadowsocksr = tag equals "shadowsocksr"i address method password (ssr_protocol/ssr_protocol_param/obfs_ssr/obfs_ssr_param/obfs_host/obfs_uri/fast_open/udp_relay/udp_port/shadow_tls_version/shadow_tls_sni/shadow_tls_password/ip_mode/block_quic/others)*{
shadowsocksr = tag equals "shadowsocksr"i address method password (ssr_protocol/ssr_protocol_param/obfs_ssr/obfs_ssr_param/obfs_host/obfs_uri/fast_open/udp_relay/udp_port/shadow_tls_version/shadow_tls_sni/shadow_tls_password/ip_mode/others)*{
proxy.type = "ssr";
// handle ssr obfs
proxy.obfs = obfs.type;
}
shadowsocks = tag equals "shadowsocks"i address method password (obfs_typev obfs_hostv)? (obfs_ss/obfs_host/obfs_uri/fast_open/udp_relay/udp_port/shadow_tls_version/shadow_tls_sni/shadow_tls_password/ip_mode/block_quic/others)* {
shadowsocks = tag equals "shadowsocks"i address method password (obfs_typev obfs_hostv)? (obfs_ss/obfs_host/obfs_uri/fast_open/udp_relay/udp_port/shadow_tls_version/shadow_tls_sni/shadow_tls_password/ip_mode/others)* {
proxy.type = "ss";
// handle ss obfs
if (obfs.type == "http" || obfs.type === "tls") {
@@ -54,31 +54,31 @@ shadowsocks = tag equals "shadowsocks"i address method password (obfs_typev obfs
$set(proxy, "plugin-opts.path", obfs.path);
}
}
vmess = tag equals "vmess"i address method uuid (transport/transport_host/transport_path/over_tls/tls_name/sni/tls_verification/tls_cert_sha256/tls_pubkey_sha256/vmess_alterId/fast_open/udp_relay/ip_mode/public_key/short_id/block_quic/others)* {
vmess = tag equals "vmess"i address method uuid (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/tls_cert_sha256/tls_pubkey_sha256/vmess_alterId/fast_open/udp_relay/ip_mode/others)* {
proxy.type = "vmess";
proxy.cipher = proxy.cipher || "none";
proxy.alterId = proxy.alterId || 0;
handleTransport();
}
vless = tag equals "vless"i address uuid (transport/transport_host/transport_path/over_tls/tls_name/sni/tls_verification/tls_cert_sha256/tls_pubkey_sha256/fast_open/udp_relay/ip_mode/flow/public_key/short_id/block_quic/others)* {
vless = tag equals "vless"i address uuid (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/tls_cert_sha256/tls_pubkey_sha256/fast_open/udp_relay/ip_mode/others)* {
proxy.type = "vless";
handleTransport();
}
trojan = tag equals "trojan"i address password (transport/transport_host/transport_path/over_tls/tls_name/sni/tls_verification/tls_cert_sha256/tls_pubkey_sha256/fast_open/udp_relay/ip_mode/block_quic/others)* {
trojan = tag equals "trojan"i address password (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/tls_cert_sha256/tls_pubkey_sha256/fast_open/udp_relay/ip_mode/others)* {
proxy.type = "trojan";
handleTransport();
}
hysteria2 = tag equals "hysteria2"i address password (tls_name/sni/tls_verification/tls_cert_sha256/tls_pubkey_sha256/udp_relay/fast_open/download_bandwidth/salamander_password/ecn/ip_mode/block_quic/others)* {
hysteria2 = tag equals "hysteria2"i address password (tls_host/tls_verification/tls_cert_sha256/tls_pubkey_sha256/udp_relay/fast_open/download_bandwidth/salamander_password/ecn/ip_mode/others)* {
proxy.type = "hysteria2";
}
https = tag equals "https"i address (username password)? (tls_name/sni/tls_verification/tls_cert_sha256/tls_pubkey_sha256/fast_open/udp_relay/ip_mode/block_quic/others)* {
https = tag equals "https"i address (username password)? (tls_host/tls_verification/tls_cert_sha256/tls_pubkey_sha256/fast_open/udp_relay/ip_mode/others)* {
proxy.type = "http";
proxy.tls = true;
}
http = tag equals "http"i address (username password)? (fast_open/udp_relay/ip_mode/block_quic/others)* {
http = tag equals "http"i address (username password)? (fast_open/udp_relay/ip_mode/others)* {
proxy.type = "http";
}
socks5 = tag equals "socks5"i address (username password)? (over_tls/tls_name/sni/tls_verification/tls_cert_sha256/tls_pubkey_sha256/fast_open/udp_relay/ip_mode/block_quic/others)* {
socks5 = tag equals "socks5"i address (username password)? (over_tls/tls_host/tls_verification/tls_cert_sha256/tls_pubkey_sha256/fast_open/udp_relay/ip_mode/others)* {
proxy.type = "socks5";
}
@@ -175,16 +175,11 @@ shadow_tls_sni = comma "shadow-tls-sni" equals match:[^,]+ { proxy["shadow-tls-s
shadow_tls_password = comma "shadow-tls-password" equals match:[^,]+ { proxy["shadow-tls-password"] = match.join(""); }
over_tls = comma "over-tls" equals flag:bool { proxy.tls = flag; }
tls_name = comma sni:("tls-name") equals host:domain { proxy.sni = host; }
sni = comma sni:("sni") equals host:domain { proxy.sni = host; }
tls_host = comma sni:("tls-name"/"sni") equals host:domain { proxy.sni = host; }
tls_verification = comma "skip-cert-verify" equals flag:bool { proxy["skip-cert-verify"] = flag; }
tls_cert_sha256 = comma "tls-cert-sha256" equals match:[^,]+ { proxy["tls-fingerprint"] = match.join("").replace(/^"(.*)"$/, '$1'); }
tls_pubkey_sha256 = comma "tls-pubkey-sha256" equals match:[^,]+ { proxy["tls-pubkey-sha256"] = match.join("").replace(/^"(.*)"$/, '$1'); }
flow = comma "flow" equals match:[^,]+ { proxy["flow"] = match.join("").replace(/^"(.*)"$/, '$1'); }
public_key = comma "public-key" equals match:[^,]+ { proxy["reality-opts"] = proxy["reality-opts"] || {}; proxy["reality-opts"]["public-key"] = match.join("").replace(/^"(.*)"$/, '$1'); }
short_id = comma "short-id" equals match:[^,]+ { proxy["reality-opts"] = proxy["reality-opts"] || {}; proxy["reality-opts"]["short-id"] = match.join("").replace(/^"(.*)"$/, '$1'); }
fast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }
udp_relay = comma "udp" equals flag:bool { proxy.udp = flag; }
ip_mode = comma "ip-mode" equals match:[^,]+ { proxy["ip-version"] = match.join(""); }
@@ -193,8 +188,6 @@ ecn = comma "ecn" equals flag:bool { proxy.ecn = flag; }
download_bandwidth = comma "download-bandwidth" equals match:[^,]+ { proxy.down = match.join(""); }
salamander_password = comma "salamander-password" equals match:[^,]+ { proxy['obfs-password'] = match.join(""); proxy.obfs = 'salamander'; }
block_quic = comma "block-quic" equals flag:bool { if(flag) proxy["block-quic"] = "on"; else proxy["block-quic"] = "off"; }
tag = match:[^=,]* { proxy.name = match.join("").trim(); }
comma = _ "," _
equals = _ "=" _

View File

@@ -37,12 +37,12 @@ start = (shadowsocksr/shadowsocks/vmess/vless/trojan/https/http/socks5/hysteria2
return proxy;
}
shadowsocksr = tag equals "shadowsocksr"i address method password (ssr_protocol/ssr_protocol_param/obfs_ssr/obfs_ssr_param/obfs_host/obfs_uri/fast_open/udp_relay/udp_port/shadow_tls_version/shadow_tls_sni/shadow_tls_password/ip_mode/block_quic/others)*{
shadowsocksr = tag equals "shadowsocksr"i address method password (ssr_protocol/ssr_protocol_param/obfs_ssr/obfs_ssr_param/obfs_host/obfs_uri/fast_open/udp_relay/udp_port/shadow_tls_version/shadow_tls_sni/shadow_tls_password/ip_mode/others)*{
proxy.type = "ssr";
// handle ssr obfs
proxy.obfs = obfs.type;
}
shadowsocks = tag equals "shadowsocks"i address method password (obfs_typev obfs_hostv)? (obfs_ss/obfs_host/obfs_uri/fast_open/udp_relay/udp_port/shadow_tls_version/shadow_tls_sni/shadow_tls_password/ip_mode/block_quic/others)* {
shadowsocks = tag equals "shadowsocks"i address method password (obfs_typev obfs_hostv)? (obfs_ss/obfs_host/obfs_uri/fast_open/udp_relay/udp_port/shadow_tls_version/shadow_tls_sni/shadow_tls_password/ip_mode/others)* {
proxy.type = "ss";
// handle ss obfs
if (obfs.type == "http" || obfs.type === "tls") {
@@ -52,31 +52,31 @@ shadowsocks = tag equals "shadowsocks"i address method password (obfs_typev obfs
$set(proxy, "plugin-opts.path", obfs.path);
}
}
vmess = tag equals "vmess"i address method uuid (transport/transport_host/transport_path/over_tls/tls_name/sni/tls_verification/tls_cert_sha256/tls_pubkey_sha256/vmess_alterId/fast_open/udp_relay/ip_mode/public_key/short_id/block_quic/others)* {
vmess = tag equals "vmess"i address method uuid (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/tls_cert_sha256/tls_pubkey_sha256/vmess_alterId/fast_open/udp_relay/ip_mode/others)* {
proxy.type = "vmess";
proxy.cipher = proxy.cipher || "none";
proxy.alterId = proxy.alterId || 0;
handleTransport();
}
vless = tag equals "vless"i address uuid (transport/transport_host/transport_path/over_tls/tls_name/sni/tls_verification/tls_cert_sha256/tls_pubkey_sha256/fast_open/udp_relay/ip_mode/flow/public_key/short_id/block_quic/others)* {
vless = tag equals "vless"i address uuid (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/tls_cert_sha256/tls_pubkey_sha256/fast_open/udp_relay/ip_mode/others)* {
proxy.type = "vless";
handleTransport();
}
trojan = tag equals "trojan"i address password (transport/transport_host/transport_path/over_tls/tls_name/sni/tls_verification/tls_cert_sha256/tls_pubkey_sha256/fast_open/udp_relay/ip_mode/block_quic/others)* {
trojan = tag equals "trojan"i address password (transport/transport_host/transport_path/over_tls/tls_host/tls_verification/tls_cert_sha256/tls_pubkey_sha256/fast_open/udp_relay/ip_mode/others)* {
proxy.type = "trojan";
handleTransport();
}
hysteria2 = tag equals "hysteria2"i address password (tls_name/sni/tls_verification/tls_cert_sha256/tls_pubkey_sha256/udp_relay/fast_open/download_bandwidth/salamander_password/ecn/ip_mode/block_quic/others)* {
hysteria2 = tag equals "hysteria2"i address password (tls_host/tls_verification/tls_cert_sha256/tls_pubkey_sha256/udp_relay/fast_open/download_bandwidth/salamander_password/ecn/ip_mode/others)* {
proxy.type = "hysteria2";
}
https = tag equals "https"i address (username password)? (tls_name/sni/tls_verification/tls_cert_sha256/tls_pubkey_sha256/fast_open/udp_relay/ip_mode/block_quic/others)* {
https = tag equals "https"i address (username password)? (tls_host/tls_verification/tls_cert_sha256/tls_pubkey_sha256/fast_open/udp_relay/ip_mode/others)* {
proxy.type = "http";
proxy.tls = true;
}
http = tag equals "http"i address (username password)? (fast_open/udp_relay/ip_mode/block_quic/others)* {
http = tag equals "http"i address (username password)? (fast_open/udp_relay/ip_mode/others)* {
proxy.type = "http";
}
socks5 = tag equals "socks5"i address (username password)? (over_tls/tls_name/sni/tls_verification/tls_cert_sha256/tls_pubkey_sha256/fast_open/udp_relay/ip_mode/block_quic/others)* {
socks5 = tag equals "socks5"i address (username password)? (over_tls/tls_host/tls_verification/tls_cert_sha256/tls_pubkey_sha256/fast_open/udp_relay/ip_mode/others)* {
proxy.type = "socks5";
}
@@ -173,16 +173,11 @@ shadow_tls_sni = comma "shadow-tls-sni" equals match:[^,]+ { proxy["shadow-tls-s
shadow_tls_password = comma "shadow-tls-password" equals match:[^,]+ { proxy["shadow-tls-password"] = match.join(""); }
over_tls = comma "over-tls" equals flag:bool { proxy.tls = flag; }
tls_name = comma sni:("tls-name") equals host:domain { proxy.sni = host; }
sni = comma sni:("sni") equals host:domain { proxy.sni = host; }
tls_host = comma sni:("tls-name"/"sni") equals host:domain { proxy.sni = host; }
tls_verification = comma "skip-cert-verify" equals flag:bool { proxy["skip-cert-verify"] = flag; }
tls_cert_sha256 = comma "tls-cert-sha256" equals match:[^,]+ { proxy["tls-fingerprint"] = match.join("").replace(/^"(.*)"$/, '$1'); }
tls_pubkey_sha256 = comma "tls-pubkey-sha256" equals match:[^,]+ { proxy["tls-pubkey-sha256"] = match.join("").replace(/^"(.*)"$/, '$1'); }
flow = comma "flow" equals match:[^,]+ { proxy["flow"] = match.join("").replace(/^"(.*)"$/, '$1'); }
public_key = comma "public-key" equals match:[^,]+ { proxy["reality-opts"] = proxy["reality-opts"] || {}; proxy["reality-opts"]["public-key"] = match.join("").replace(/^"(.*)"$/, '$1'); }
short_id = comma "short-id" equals match:[^,]+ { proxy["reality-opts"] = proxy["reality-opts"] || {}; proxy["reality-opts"]["short-id"] = match.join("").replace(/^"(.*)"$/, '$1'); }
fast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }
udp_relay = comma "udp" equals flag:bool { proxy.udp = flag; }
ip_mode = comma "ip-mode" equals match:[^,]+ { proxy["ip-version"] = match.join(""); }
@@ -191,8 +186,6 @@ ecn = comma "ecn" equals flag:bool { proxy.ecn = flag; }
download_bandwidth = comma "download-bandwidth" equals match:[^,]+ { proxy.down = match.join(""); }
salamander_password = comma "salamander-password" equals match:[^,]+ { proxy['obfs-password'] = match.join(""); proxy.obfs = 'salamander'; }
block_quic = comma "block-quic" equals flag:bool { if(flag) proxy["block-quic"] = "on"; else proxy["block-quic"] = "off"; }
tag = match:[^=,]* { proxy.name = match.join("").trim(); }
comma = _ "," _
equals = _ "=" _

View File

@@ -49,7 +49,7 @@ trojan = "trojan" equals address
}
shadowsocks = "shadowsocks" equals address
(password/method/obfs_ssr/obfs_ss/obfs_host/obfs_uri/ssr_protocol/ssr_protocol_param/tls_pubkey_sha256/tls_alpn/tls_no_session_ticket/tls_no_session_reuse/tls_fingerprint/tls_verification/udp_relay/udp_over_tcp_new/fast_open/tag/server_check_url/others)* {
(password/method/obfs_ssr/obfs_ss/obfs_host/obfs_uri/ssr_protocol/ssr_protocol_param/tls_pubkey_sha256/tls_alpn/tls_no_session_ticket/tls_no_session_reuse/tls_fingerprint/tls_verification/udp_relay/udp_over_tcp/fast_open/tag/server_check_url/others)* {
if (proxy.protocol || proxy.type === "ssr") {
proxy.type = "ssr";
if (!proxy.protocol) {
@@ -86,10 +86,10 @@ vmess = "vmess" equals address
(uuid/method/over_tls/tls_host/tls_pubkey_sha256/tls_alpn/tls_no_session_ticket/tls_no_session_reuse/tls_fingerprint/tls_verification/tag/obfs/obfs_host/obfs_uri/udp_relay/udp_over_tcp/fast_open/aead/server_check_url/others)* {
proxy.type = "vmess";
proxy.cipher = proxy.cipher || "none";
if (proxy.aead === false) {
proxy.alterId = 1;
} else {
if (proxy.aead) {
proxy.alterId = 0;
} else {
proxy.alterId = proxy.alterId || 0;
}
handleObfs();
}
@@ -145,20 +145,18 @@ port = digits:[0-9]+ {
}
}
username = comma "username" equals username:[^,]+ { proxy.username = username.join("").trim(); }
password = comma "password" equals password:[^,]+ { proxy.password = password.join("").trim(); }
uuid = comma "password" equals uuid:[^,]+ { proxy.uuid = uuid.join("").trim(); }
username = comma "username" equals username:[^=,]+ { proxy.username = username.join("").trim(); }
password = comma "password" equals password:[^=,]+ { proxy.password = password.join("").trim(); }
uuid = comma "password" equals uuid:[^=,]+ { proxy.uuid = uuid.join("").trim(); }
method = comma "method" equals cipher:cipher {
proxy.cipher = cipher;
};
cipher = ("aes-128-cfb"/"aes-128-ctr"/"aes-128-gcm"/"aes-192-cfb"/"aes-192-ctr"/"aes-192-gcm"/"aes-256-cfb"/"aes-256-ctr"/"aes-256-gcm"/"bf-cfb"/"cast5-cfb"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"des-cfb"/"none"/"rc2-cfb"/"rc4-md5-6"/"rc4-md5"/"salsa20"/"xchacha20-ietf-poly1305"/"2022-blake3-aes-128-gcm"/"2022-blake3-aes-256-gcm");
cipher = ("aes-128-cfb"/"aes-128-ctr"/"aes-128-gcm"/"aes-192-cfb"/"aes-192-ctr"/"aes-192-gcm"/"aes-256-cfb"/"aes-256-ctr"/"aes-256-gcm"/"bf-cfb"/"cast5-cfb"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"des-cfb"/"none"/"rc2-cfb"/"rc4-md5-6"/"rc4-md5"/"salsa20"/"xchacha20-ietf-poly1305");
aead = comma "aead" equals flag:bool { proxy.aead = flag; }
udp_relay = comma "udp-relay" equals flag:bool { proxy.udp = flag; }
udp_over_tcp = comma "udp-over-tcp" equals flag:bool { throw new Error("UDP over TCP is not supported"); }
udp_over_tcp_new = comma "udp-over-tcp" equals param:$[^=,]+ { if (param === "sp.v1") { proxy["udp-over-tcp"] = true; proxy["udp-over-tcp-version"] = 1; } else if (param === "sp.v2") { proxy["udp-over-tcp"] = true; proxy["udp-over-tcp-version"] = 2; } else if (param === "true") { proxy["_ssr_python_uot"] = true; } else { throw new Error("Invalid value for udp-over-tcp"); } }
fast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }
over_tls = comma "over-tls" equals flag:bool { proxy.tls = flag; }

View File

@@ -47,7 +47,7 @@ trojan = "trojan" equals address
}
shadowsocks = "shadowsocks" equals address
(password/method/obfs_ssr/obfs_ss/obfs_host/obfs_uri/ssr_protocol/ssr_protocol_param/tls_pubkey_sha256/tls_alpn/tls_no_session_ticket/tls_no_session_reuse/tls_fingerprint/tls_verification/udp_relay/udp_over_tcp_new/fast_open/tag/server_check_url/others)* {
(password/method/obfs_ssr/obfs_ss/obfs_host/obfs_uri/ssr_protocol/ssr_protocol_param/tls_pubkey_sha256/tls_alpn/tls_no_session_ticket/tls_no_session_reuse/tls_fingerprint/tls_verification/udp_relay/udp_over_tcp/fast_open/tag/server_check_url/others)* {
if (proxy.protocol || proxy.type === "ssr") {
proxy.type = "ssr";
if (!proxy.protocol) {
@@ -84,10 +84,10 @@ vmess = "vmess" equals address
(uuid/method/over_tls/tls_host/tls_pubkey_sha256/tls_alpn/tls_no_session_ticket/tls_no_session_reuse/tls_fingerprint/tls_verification/tag/obfs/obfs_host/obfs_uri/udp_relay/udp_over_tcp/fast_open/aead/server_check_url/others)* {
proxy.type = "vmess";
proxy.cipher = proxy.cipher || "none";
if (proxy.aead === false) {
proxy.alterId = 1;
} else {
if (proxy.aead) {
proxy.alterId = 0;
} else {
proxy.alterId = proxy.alterId || 0;
}
handleObfs();
}
@@ -143,20 +143,18 @@ port = digits:[0-9]+ {
}
}
username = comma "username" equals username:[^,]+ { proxy.username = username.join("").trim(); }
password = comma "password" equals password:[^,]+ { proxy.password = password.join("").trim(); }
uuid = comma "password" equals uuid:[^,]+ { proxy.uuid = uuid.join("").trim(); }
username = comma "username" equals username:[^=,]+ { proxy.username = username.join("").trim(); }
password = comma "password" equals password:[^=,]+ { proxy.password = password.join("").trim(); }
uuid = comma "password" equals uuid:[^=,]+ { proxy.uuid = uuid.join("").trim(); }
method = comma "method" equals cipher:cipher {
proxy.cipher = cipher;
};
cipher = ("aes-128-cfb"/"aes-128-ctr"/"aes-128-gcm"/"aes-192-cfb"/"aes-192-ctr"/"aes-192-gcm"/"aes-256-cfb"/"aes-256-ctr"/"aes-256-gcm"/"bf-cfb"/"cast5-cfb"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"des-cfb"/"none"/"rc2-cfb"/"rc4-md5-6"/"rc4-md5"/"salsa20"/"xchacha20-ietf-poly1305"/"2022-blake3-aes-128-gcm"/"2022-blake3-aes-256-gcm");
cipher = ("aes-128-cfb"/"aes-128-ctr"/"aes-128-gcm"/"aes-192-cfb"/"aes-192-ctr"/"aes-192-gcm"/"aes-256-cfb"/"aes-256-ctr"/"aes-256-gcm"/"bf-cfb"/"cast5-cfb"/"chacha20-ietf-poly1305"/"chacha20-ietf"/"chacha20-poly1305"/"chacha20"/"des-cfb"/"none"/"rc2-cfb"/"rc4-md5-6"/"rc4-md5"/"salsa20"/"xchacha20-ietf-poly1305");
aead = comma "aead" equals flag:bool { proxy.aead = flag; }
udp_relay = comma "udp-relay" equals flag:bool { proxy.udp = flag; }
udp_over_tcp = comma "udp-over-tcp" equals flag:bool { throw new Error("UDP over TCP is not supported"); }
udp_over_tcp_new = comma "udp-over-tcp" equals param:$[^=,]+ { if (param === "sp.v1") { proxy["udp-over-tcp"] = true; proxy["udp-over-tcp-version"] = 1; } else if (param === "sp.v2") { proxy["udp-over-tcp"] = true; proxy["udp-over-tcp-version"] = 2; } else if (param === "true") { proxy["_ssr_python_uot"] = true; } else { throw new Error("Invalid value for udp-over-tcp"); } }
fast_open = comma "fast-open" equals flag:bool { proxy.tfo = flag; }
over_tls = comma "over-tls" equals flag:bool { proxy.tls = flag; }

View File

@@ -55,11 +55,10 @@ shadowsocks = tag equals "ss" address (method/passwordk/obfs/obfs_host/obfs_uri/
vmess = tag equals "vmess" address (vmess_uuid/vmess_aead/ws/ws_path/ws_headers/method/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/tls/sni/tls_fingerprint/tls_verification/fast_open/tfo/udp_relay/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
proxy.type = "vmess";
proxy.cipher = proxy.cipher || "none";
// Surfboard 与 Surge 默认不一致, 不管 Surfboard https://getsurfboard.com/docs/profile-format/proxy/external-proxy/vmess
if (proxy.aead) {
proxy.alterId = 0;
} else {
proxy.alterId = 1;
proxy.alterId = proxy.alterId || 0;
}
handleWebsocket();
handleShadowTLS();
@@ -105,11 +104,11 @@ wireguard = tag equals "wireguard" (section_name/no_error_alert/ip_version/under
proxy.type = "wireguard-surge";
handleShadowTLS();
}
hysteria2 = tag equals "hysteria2" address (no_error_alert/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/sni/tls_verification/passwordk/tls_fingerprint/download_bandwidth/ecn/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/port_hopping_interval/others)* {
hysteria2 = tag equals "hysteria2" address (no_error_alert/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/sni/fast_open/tfo/tls_verification/passwordk/tls_fingerprint/download_bandwidth/ecn/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/port_hopping_interval/others)* {
proxy.type = "hysteria2";
handleShadowTLS();
}
socks5 = tag equals "socks5" address (username password)? (usernamek passwordk)? (udp_relay/no_error_alert/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/fast_open/tfo/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
socks5 = tag equals "socks5" address (username password)? (usernamek passwordk)? (udp_relay/no_error_alert/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/tfo/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
proxy.type = "socks5";
handleShadowTLS();
}
@@ -121,6 +120,7 @@ socks5_tls = tag equals "socks5-tls" address (username password)? (usernamek pas
direct = tag equals "direct" (udp_relay/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/fast_open/tfo/block_quic/others)* {
proxy.type = "direct";
}
address = comma server:server comma port:port {
proxy.server = server;
proxy.port = port;
@@ -178,8 +178,8 @@ username = & {
peg$currPos = end;
return true;
}
} { proxy.username = $.username.trim().replace(/^"(.*?)"$/, '$1').replace(/^'(.*?)'$/, '$1'); }
password = comma match:[^,]+ { proxy.password = match.join("").replace(/^"(.*)"$/, '$1').replace(/^'(.*?)'$/, '$1'); }
} { proxy.username = $.username; }
password = comma match:[^,]+ { proxy.password = match.join(""); }
tls = comma "tls" equals flag:bool { proxy.tls = flag; }
sni = comma "sni" equals sni:("off"/domain) {
@@ -195,7 +195,7 @@ tls_fingerprint = comma "server-cert-fingerprint-sha256" equals tls_fingerprint:
snell_psk = comma "psk" equals match:[^,]+ { proxy.psk = match.join(""); }
snell_version = comma "version" equals match:$[0-9]+ { proxy.version = parseInt(match.trim()); }
usernamek = comma "username" equals match:[^,]+ { proxy.username = match.join("").replace(/^"(.*?)"$/, '$1').replace(/^'(.*?)'$/, '$1'); }
usernamek = comma "username" equals match:[^,]+ { proxy.username = match.join(""); }
passwordk = comma "password" equals match:[^,]+ { proxy.password = match.join("").replace(/^"(.*?)"$/, '$1').replace(/^'(.*?)'$/, '$1'); }
vmess_uuid = comma "username" equals match:[^,]+ { proxy.uuid = match.join(""); }
vmess_aead = comma "vmess-aead" equals flag:bool { proxy.aead = flag; }
@@ -211,11 +211,11 @@ ws_headers = comma "ws-headers" equals headers:$[^,]+ {
const result = {};
pairs.forEach(pair => {
const [key, value] = pair.trim().split(":");
result[key.trim()] = value.trim().replace(/^"(.*?)"$/, '$1').replace(/^'(.*?)'$/, '$1');
result[key.trim()] = value.trim();
})
obfs["ws-headers"] = result;
}
ws_path = comma "ws-path" equals path:uri { obfs.path = path.trim().replace(/^"(.*?)"$/, '$1').replace(/^'(.*?)'$/, '$1'); }
ws_path = comma "ws-path" equals path:uri { obfs.path = path; }
obfs = comma "obfs" equals type:("http"/"tls") { obfs.type = type; }
obfs_host = comma "obfs-host" equals host:domain { obfs.host = host; };

View File

@@ -53,11 +53,10 @@ shadowsocks = tag equals "ss" address (method/passwordk/obfs/obfs_host/obfs_uri/
vmess = tag equals "vmess" address (vmess_uuid/vmess_aead/ws/ws_path/ws_headers/method/ip_version/underlying_proxy/tos/allow_other_interface/interface/test_url/test_udp/test_timeout/hybrid/no_error_alert/tls/sni/tls_fingerprint/tls_verification/fast_open/tfo/udp_relay/shadow_tls_version/shadow_tls_sni/shadow_tls_password/block_quic/others)* {
proxy.type = "vmess";
proxy.cipher = proxy.cipher || "none";
// Surfboard 与 Surge 默认不一致, 不管 Surfboard https://getsurfboard.com/docs/profile-format/proxy/external-proxy/vmess
if (proxy.aead) {
proxy.alterId = 0;
} else {
proxy.alterId = 1;
proxy.alterId = proxy.alterId || 0;
}
handleWebsocket();
handleShadowTLS();
@@ -176,8 +175,8 @@ username = & {
peg$currPos = end;
return true;
}
} { proxy.username = $.username.trim().replace(/^"(.*?)"$/, '$1').replace(/^'(.*?)'$/, '$1'); }
password = comma match:[^,]+ { proxy.password = match.join("").replace(/^"(.*)"$/, '$1').replace(/^'(.*?)'$/, '$1'); }
} { proxy.username = $.username; }
password = comma match:[^,]+ { proxy.password = match.join(""); }
tls = comma "tls" equals flag:bool { proxy.tls = flag; }
sni = comma "sni" equals sni:("off"/domain) {
@@ -193,7 +192,7 @@ tls_fingerprint = comma "server-cert-fingerprint-sha256" equals tls_fingerprint:
snell_psk = comma "psk" equals match:[^,]+ { proxy.psk = match.join(""); }
snell_version = comma "version" equals match:$[0-9]+ { proxy.version = parseInt(match.trim()); }
usernamek = comma "username" equals match:[^,]+ { proxy.username = match.join("").replace(/^"(.*?)"$/, '$1').replace(/^'(.*?)'$/, '$1'); }
usernamek = comma "username" equals match:[^,]+ { proxy.username = match.join(""); }
passwordk = comma "password" equals match:[^,]+ { proxy.password = match.join("").replace(/^"(.*?)"$/, '$1').replace(/^'(.*?)'$/, '$1'); }
vmess_uuid = comma "username" equals match:[^,]+ { proxy.uuid = match.join(""); }
vmess_aead = comma "vmess-aead" equals flag:bool { proxy.aead = flag; }
@@ -209,11 +208,11 @@ ws_headers = comma "ws-headers" equals headers:$[^,]+ {
const result = {};
pairs.forEach(pair => {
const [key, value] = pair.trim().split(":");
result[key.trim()] = value.trim().replace(/^"(.*?)"$/, '$1').replace(/^'(.*?)'$/, '$1');
result[key.trim()] = value.trim();
})
obfs["ws-headers"] = result;
}
ws_path = comma "ws-path" equals path:uri { obfs.path = path.trim().replace(/^"(.*?)"$/, '$1').replace(/^'(.*?)'$/, '$1'); }
ws_path = comma "ws-path" equals path:uri { obfs.path = path; }
obfs = comma "obfs" equals type:("http"/"tls") { obfs.type = type; }
obfs_host = comma "obfs-host" equals host:domain { obfs.host = host; };

View File

@@ -50,26 +50,6 @@ function Base64Encoded() {
return { name, test, parse };
}
function fallbackBase64Encoded() {
const name = 'Fallback Base64 Pre-processor';
const test = function (raw) {
return true;
};
const parse = function (raw) {
const decoded = Base64.decode(raw);
if (!/^\w+(:\/\/|\s*?=\s*?)\w+/m.test(decoded)) {
$.error(
`Fallback Base64 Pre-processor error: decoded line does not start with protocol`,
);
return raw;
}
return decoded;
};
return { name, test, parse };
}
function Clash() {
const name = 'Clash Pre-processor';
const test = function (raw) {
@@ -95,8 +75,6 @@ function Clash() {
// 是否被引号包裹
if (/^(['"]).*\1$/.test(afterTrim)) {
return `short-id: ${afterTrim}`;
} else if (['null'].includes(afterTrim)) {
return `short-id: ${afterTrim}`;
} else {
return `short-id: "${afterTrim}"`;
}
@@ -183,11 +161,4 @@ function FullConfig() {
return { name, test, parse };
}
export default [
HTML(),
Clash(),
Base64Encoded(),
SSD(),
FullConfig(),
fallbackBase64Encoded(),
];
export default [HTML(), Clash(), Base64Encoded(), SSD(), FullConfig()];

View File

@@ -284,15 +284,7 @@ function SortOperator(order = 'asc') {
}
// sort by regex
function RegexSortOperator(input) {
const order = input.order || 'asc';
let expressions = input.expressions;
if (Array.isArray(input)) {
expressions = input;
}
if (!Array.isArray(expressions)) {
expressions = [];
}
function RegexSortOperator(expressions) {
return {
name: 'Regex Sort Operator',
func: (proxies) => {
@@ -303,13 +295,8 @@ function RegexSortOperator(input) {
if (oA && !oB) return -1;
if (oB && !oA) return 1;
if (oA && oB) return oA < oB ? -1 : 1;
if (order === 'original') {
return 0;
} else if (order === 'desc') {
return a.name < b.name ? 1 : -1;
} else {
return a.name < b.name ? -1 : 1;
}
if ((!oA && !oB) || (oA && oB && oA === oB))
return a.name < b.name ? -1 : 1; // fallback to normal sort
});
},
};
@@ -623,11 +610,9 @@ const DOMAIN_RESOLVERS = {
const cached = resourceCache.get(id);
if (!noCache && cached) return cached;
const resp = await $.http.get({
url: `http://223.6.6.6/resolve?edns_client_subnet=${edns}/${
isIPv4(edns) ? 24 : 56
}&name=${encodeURIComponent(domain)}&type=${
type === 'IPv6' ? 'AAAA' : 'A'
}&short=1`,
url: `http://223.6.6.6/resolve?edns_client_subnet=${edns}/24&name=${encodeURIComponent(
domain,
)}&type=${type === 'IPv6' ? 'AAAA' : 'A'}&short=1`,
headers: {
accept: 'application/dns-json',
},
@@ -1143,10 +1128,6 @@ function createDynamicFunction(name, script, $arguments, $options) {
'$httpClient',
'$notification',
'ProxyUtils',
'yaml',
'Buffer',
'b64d',
'b64e',
'scriptResourceCache',
'flowUtils',
'produceArtifact',
@@ -1164,10 +1145,6 @@ function createDynamicFunction(name, script, $arguments, $options) {
// eslint-disable-next-line no-undef
$notification,
ProxyUtils,
ProxyUtils.yaml,
ProxyUtils.Buffer,
ProxyUtils.Base64.decode,
ProxyUtils.Base64.encode,
scriptResourceCache,
flowUtils,
produceArtifact,
@@ -1180,10 +1157,6 @@ function createDynamicFunction(name, script, $arguments, $options) {
'$substore',
'lodash',
'ProxyUtils',
'yaml',
'Buffer',
'b64d',
'b64e',
'scriptResourceCache',
'flowUtils',
'produceArtifact',
@@ -1195,10 +1168,6 @@ function createDynamicFunction(name, script, $arguments, $options) {
$,
lodash,
ProxyUtils,
ProxyUtils.yaml,
ProxyUtils.Buffer,
ProxyUtils.Base64.decode,
ProxyUtils.Base64.encode,
scriptResourceCache,
flowUtils,
produceArtifact,

View File

@@ -1,5 +1,4 @@
import { isPresent } from '@/core/proxy-utils/producers/utils';
import $ from '@/core/app';
export default function Clash_Producer() {
const type = 'ALL';
@@ -41,17 +40,12 @@ export default function Clash_Producer() {
'chacha20-ietf-poly1305',
'xchacha20-ietf-poly1305',
].includes(proxy.cipher)) ||
(proxy.type === 'snell' && proxy.version >= 4) ||
(proxy.type === 'snell' && String(proxy.version) === '4') ||
(proxy.type === 'vless' &&
(typeof proxy.flow !== 'undefined' ||
proxy['reality-opts']))
) {
return false;
} else if (proxy['underlying-proxy'] || proxy['dialer-proxy']) {
$.error(
`Clash 不支持前置代理字段. 已过滤节点 ${proxy.name}`,
);
return false;
}
return true;
})
@@ -134,18 +128,6 @@ export default function Clash_Producer() {
proxy['h2-opts'].headers.host = [host];
}
}
if (proxy.network === 'ws') {
const wsPath = proxy['ws-opts']?.path;
const reg = /^(.*?)(?:\?ed=(\d+))?$/;
// eslint-disable-next-line no-unused-vars
const [_, path = '', ed = ''] = reg.exec(wsPath);
proxy['ws-opts'].path = path;
if (ed !== '') {
proxy['ws-opts']['early-data-header-name'] =
'Sec-WebSocket-Protocol';
proxy['ws-opts']['max-early-data'] = parseInt(ed, 10);
}
}
if (proxy['plugin-opts']?.tls) {
if (isPresent(proxy, 'skip-cert-verify')) {
proxy['plugin-opts']['skip-cert-verify'] =
@@ -170,6 +152,11 @@ export default function Clash_Producer() {
}
delete proxy['tls-fingerprint'];
if (proxy['underlying-proxy']) {
proxy['dialer-proxy'] = proxy['underlying-proxy'];
}
delete proxy['underlying-proxy'];
if (isPresent(proxy, 'tls') && typeof proxy.tls !== 'boolean') {
delete proxy.tls;
}

View File

@@ -1,20 +1,12 @@
import { isPresent } from '@/core/proxy-utils/producers/utils';
const ipVersions = {
dual: 'dual',
'v4-only': 'ipv4',
'v6-only': 'ipv6',
'prefer-v4': 'ipv4-prefer',
'prefer-v6': 'ipv6-prefer',
};
export default function ClashMeta_Producer() {
const type = 'ALL';
const produce = (proxies, type, opts = {}) => {
const list = proxies
.filter((proxy) => {
if (opts['include-unsupported-proxy']) return true;
if (proxy.type === 'snell' && proxy.version >= 4) {
if (proxy.type === 'snell' && String(proxy.version) === '4') {
return false;
} else if (['juicity'].includes(proxy.type)) {
return false;
@@ -198,18 +190,6 @@ export default function ClashMeta_Producer() {
proxy['h2-opts'].headers.host = [host];
}
}
if (proxy.network === 'ws') {
const wsPath = proxy['ws-opts']?.path;
const reg = /^(.*?)(?:\?ed=(\d+))?$/;
// eslint-disable-next-line no-unused-vars
const [_, path = '', ed = ''] = reg.exec(wsPath);
proxy['ws-opts'].path = path;
if (ed !== '') {
proxy['ws-opts']['early-data-header-name'] =
'Sec-WebSocket-Protocol';
proxy['ws-opts']['max-early-data'] = parseInt(ed, 10);
}
}
if (proxy['plugin-opts']?.tls) {
if (isPresent(proxy, 'skip-cert-verify')) {
@@ -262,11 +242,6 @@ export default function ClashMeta_Producer() {
delete proxy[`${proxy.network}-opts`]['_grpc-type'];
delete proxy[`${proxy.network}-opts`]['_grpc-authority'];
}
if (proxy['ip-version']) {
proxy['ip-version'] =
ipVersions[proxy['ip-version']] || proxy['ip-version'];
}
return proxy;
});

View File

@@ -371,37 +371,12 @@ export default function Egern_Producer() {
};
}
}
if (
['ss'].includes(original.type) &&
proxy.shadow_tls &&
original['udp-port'] > 0 &&
original['udp-port'] <= 65535
) {
proxy['udp_port'] = original['udp-port'];
}
delete proxy.subName;
delete proxy.collectionName;
delete proxy.id;
delete proxy.resolved;
delete proxy['no-resolve'];
if (proxy.transport) {
for (const key in proxy.transport) {
if (
Object.keys(proxy.transport[key]).length === 0 ||
Object.values(proxy.transport[key]).every(
(v) => v == null,
)
) {
delete proxy.transport[key];
}
}
if (Object.keys(proxy.transport).length === 0) {
delete proxy.transport;
}
}
if (type !== 'internal') {
for (const key in proxy) {
if (proxy[key] == null || /^_/i.test(key)) {

View File

@@ -21,9 +21,9 @@ export default function Loon_Producer() {
case 'trojan':
return trojan(proxy);
case 'vmess':
return vmess(proxy, opts['include-unsupported-proxy']);
return vmess(proxy);
case 'vless':
return vless(proxy, opts['include-unsupported-proxy']);
return vless(proxy);
case 'http':
return http(proxy);
case 'socks5':
@@ -133,13 +133,6 @@ function shadowsocks(proxy) {
// tfo
result.appendIfPresent(`,fast-open=${proxy.tfo}`, 'tfo');
// block-quic
if (proxy['block-quic'] === 'on') {
result.append(',block-quic=true');
} else if (proxy['block-quic'] === 'off') {
result.append(',block-quic=false');
}
// udp
if (proxy.udp) {
result.append(`,udp=true`);
@@ -151,7 +144,7 @@ function shadowsocks(proxy) {
return result.toString();
}
function shadowsocksr(proxy) {
function shadowsocksr(proxy, includeUnsupportedProxy) {
const result = new Result(proxy);
result.append(
`${proxy.name}=shadowsocksr,${proxy.server},${proxy.port},${proxy.cipher},"${proxy.password}"`,
@@ -210,13 +203,6 @@ function shadowsocksr(proxy) {
// tfo
result.appendIfPresent(`,fast-open=${proxy.tfo}`, 'tfo');
// block-quic
if (proxy['block-quic'] === 'on') {
result.append(',block-quic=true');
} else if (proxy['block-quic'] === 'off') {
result.append(',block-quic=false');
}
// udp
if (proxy.udp) {
result.append(`,udp=true`);
@@ -273,13 +259,6 @@ function trojan(proxy) {
// tfo
result.appendIfPresent(`,fast-open=${proxy.tfo}`, 'tfo');
// block-quic
if (proxy['block-quic'] === 'on') {
result.append(',block-quic=true');
} else if (proxy['block-quic'] === 'off') {
result.append(',block-quic=false');
}
// udp
if (proxy.udp) {
result.append(`,udp=true`);
@@ -291,8 +270,6 @@ function trojan(proxy) {
}
function vmess(proxy) {
const isReality = !!proxy['reality-opts'];
const result = new Result(proxy);
result.append(
`${proxy.name}=vmess,${proxy.server},${proxy.port},${proxy.cipher},"${proxy.uuid}"`,
@@ -340,32 +317,20 @@ function vmess(proxy) {
'skip-cert-verify',
);
if (isReality) {
result.appendIfPresent(`,sni=${proxy.sni}`, 'sni');
result.appendIfPresent(
`,public-key="${proxy['reality-opts']['public-key']}"`,
'reality-opts.public-key',
);
result.appendIfPresent(
`,short-id=${proxy['reality-opts']['short-id']}`,
'reality-opts.short-id',
);
} else {
// sni
result.appendIfPresent(`,tls-name=${proxy.sni}`, 'sni');
result.appendIfPresent(
`,tls-cert-sha256=${proxy['tls-fingerprint']}`,
'tls-fingerprint',
);
result.appendIfPresent(
`,tls-pubkey-sha256=${proxy['tls-pubkey-sha256']}`,
'tls-pubkey-sha256',
);
}
// sni
result.appendIfPresent(`,tls-name=${proxy.sni}`, 'sni');
result.appendIfPresent(
`,tls-cert-sha256=${proxy['tls-fingerprint']}`,
'tls-fingerprint',
);
result.appendIfPresent(
`,tls-pubkey-sha256=${proxy['tls-pubkey-sha256']}`,
'tls-pubkey-sha256',
);
// AEAD
if (isPresent(proxy, 'aead')) {
result.append(`,alterId=${proxy.aead ? 0 : 1}`);
result.append(`,alterId=0`);
} else {
result.append(`,alterId=${proxy.alterId}`);
}
@@ -373,13 +338,6 @@ function vmess(proxy) {
// tfo
result.appendIfPresent(`,fast-open=${proxy.tfo}`, 'tfo');
// block-quic
if (proxy['block-quic'] === 'on') {
result.append(',block-quic=true');
} else if (proxy['block-quic'] === 'off') {
result.append(',block-quic=false');
}
// udp
if (proxy.udp) {
result.append(`,udp=true`);
@@ -390,17 +348,9 @@ function vmess(proxy) {
}
function vless(proxy) {
let isXtls = false;
const isReality = !!proxy['reality-opts'];
if (typeof proxy.flow !== 'undefined') {
if (['xtls-rprx-vision'].includes(proxy.flow)) {
isXtls = true;
} else {
throw new Error(`VLESS flow(${proxy.flow}) is not supported`);
}
if (typeof proxy.flow !== 'undefined' || proxy['reality-opts']) {
throw new Error(`VLESS XTLS/REALITY is not supported`);
}
const result = new Result(proxy);
result.append(
`${proxy.name}=vless,${proxy.server},${proxy.port},"${proxy.uuid}"`,
@@ -448,42 +398,20 @@ function vless(proxy) {
'skip-cert-verify',
);
if (isXtls) {
result.appendIfPresent(`,flow=${proxy.flow}`, 'flow');
}
if (isReality) {
result.appendIfPresent(`,sni=${proxy.sni}`, 'sni');
result.appendIfPresent(
`,public-key="${proxy['reality-opts']['public-key']}"`,
'reality-opts.public-key',
);
result.appendIfPresent(
`,short-id=${proxy['reality-opts']['short-id']}`,
'reality-opts.short-id',
);
} else {
// sni
result.appendIfPresent(`,tls-name=${proxy.sni}`, 'sni');
result.appendIfPresent(
`,tls-cert-sha256=${proxy['tls-fingerprint']}`,
'tls-fingerprint',
);
result.appendIfPresent(
`,tls-pubkey-sha256=${proxy['tls-pubkey-sha256']}`,
'tls-pubkey-sha256',
);
}
// sni
result.appendIfPresent(`,tls-name=${proxy.sni}`, 'sni');
result.appendIfPresent(
`,tls-cert-sha256=${proxy['tls-fingerprint']}`,
'tls-fingerprint',
);
result.appendIfPresent(
`,tls-pubkey-sha256=${proxy['tls-pubkey-sha256']}`,
'tls-pubkey-sha256',
);
// tfo
result.appendIfPresent(`,fast-open=${proxy.tfo}`, 'tfo');
// block-quic
if (proxy['block-quic'] === 'on') {
result.append(',block-quic=true');
} else if (proxy['block-quic'] === 'off') {
result.append(',block-quic=false');
}
// udp
if (proxy.udp) {
result.append(`,udp=true`);
@@ -511,14 +439,6 @@ function http(proxy) {
// tfo
result.appendIfPresent(`,tfo=${proxy.tfo}`, 'tfo');
// block-quic
if (proxy['block-quic'] === 'on') {
result.append(',block-quic=true');
} else if (proxy['block-quic'] === 'off') {
result.append(',block-quic=false');
}
const ip_version = ipVersions[proxy['ip-version']] || proxy['ip-version'];
result.appendIfPresent(`,ip-mode=${ip_version}`, 'ip-version');
@@ -545,13 +465,6 @@ function socks5(proxy) {
// tfo
result.appendIfPresent(`,tfo=${proxy.tfo}`, 'tfo');
// block-quic
if (proxy['block-quic'] === 'on') {
result.append(',block-quic=true');
} else if (proxy['block-quic'] === 'off') {
result.append(',block-quic=false');
}
// udp
if (proxy.udp) {
result.append(`,udp=true`);
@@ -626,13 +539,6 @@ function wireguard(proxy) {
const ip_version = ipVersions[proxy['ip-version']] || proxy['ip-version'];
result.appendIfPresent(`,ip-mode=${ip_version}`, 'ip-version');
// block-quic
if (proxy['block-quic'] === 'on') {
result.append(',block-quic=true');
} else if (proxy['block-quic'] === 'off') {
result.append(',block-quic=false');
}
return result.toString();
}
@@ -667,13 +573,6 @@ function hysteria2(proxy) {
// tfo
result.appendIfPresent(`,fast-open=${proxy.tfo}`, 'tfo');
// block-quic
if (proxy['block-quic'] === 'on') {
result.append(',block-quic=true');
} else if (proxy['block-quic'] === 'off') {
result.append(',block-quic=false');
}
// udp
if (proxy.udp) {
result.append(`,udp=true`);

View File

@@ -58,8 +58,6 @@ function shadowsocks(proxy) {
'aes-256-gcm',
'chacha20-ietf-poly1305',
'xchacha20-ietf-poly1305',
'2022-blake3-aes-128-gcm',
'2022-blake3-aes-256-gcm',
].includes(proxy.cipher)
) {
throw new Error(`cipher ${proxy.cipher} is not supported`);
@@ -130,20 +128,6 @@ function shadowsocks(proxy) {
// udp
appendIfPresent(`,udp-relay=${proxy.udp}`, 'udp');
// udp over tcp
if (proxy['_ssr_python_uot']) {
append(`,udp-over-tcp=true`);
} else if (proxy['udp-over-tcp']) {
if (
!proxy['udp-over-tcp-version'] ||
proxy['udp-over-tcp-version'] === 1
) {
append(`,udp-over-tcp=sp.v1`);
} else if (proxy['udp-over-tcp-version'] === 2) {
append(`,udp-over-tcp=sp.v2`);
}
}
// server_check_url
result.appendIfPresent(
`,server_check_url=${proxy['test-url']}`,
@@ -405,8 +389,6 @@ function vless(proxy) {
else append(`,obfs=ws`);
} else if (proxy.network === 'http') {
append(`,obfs=http`);
} else if (['tcp'].includes(proxy.network)) {
if (proxy.tls) append(`,obfs=over-tls`);
} else if (!['tcp'].includes(proxy.network)) {
throw new Error(`network ${proxy.network} is unsupported`);
}

View File

@@ -1,5 +1,4 @@
import { isPresent } from '@/core/proxy-utils/producers/utils';
import $ from '@/core/app';
export default function Shadowrocket_Producer() {
const type = 'ALL';
@@ -7,9 +6,9 @@ export default function Shadowrocket_Producer() {
const list = proxies
.filter((proxy) => {
if (opts['include-unsupported-proxy']) return true;
if (proxy.type === 'snell' && proxy.version >= 4) {
if (proxy.type === 'snell' && String(proxy.version) === '4') {
return false;
} else if (['mieru'].includes(proxy.type)) {
} else if (['mieru', 'anytls'].includes(proxy.type)) {
return false;
}
return true;
@@ -166,18 +165,6 @@ export default function Shadowrocket_Producer() {
proxy['h2-opts'].headers.host = [host];
}
}
if (proxy.network === 'ws') {
const wsPath = proxy['ws-opts']?.path;
const reg = /^(.*?)(?:\?ed=(\d+))?$/;
// eslint-disable-next-line no-unused-vars
const [_, path = '', ed = ''] = reg.exec(wsPath);
proxy['ws-opts'].path = path;
if (ed !== '') {
proxy['ws-opts']['early-data-header-name'] =
'Sec-WebSocket-Protocol';
proxy['ws-opts']['max-early-data'] = parseInt(ed, 10);
}
}
if (proxy['plugin-opts']?.tls) {
if (isPresent(proxy, 'skip-cert-verify')) {
proxy['plugin-opts']['skip-cert-verify'] =

View File

@@ -2,26 +2,6 @@ import ClashMeta_Producer from './clashmeta';
import $ from '@/core/app';
import { isIPv4, isIPv6 } from '@/utils';
const ipVersions = {
ipv4: 'ipv4_only',
ipv6: 'ipv6_only',
'v4-only': 'ipv4_only',
'v6-only': 'ipv6_only',
'ipv4-prefer': 'prefer_ipv4',
'ipv6-prefer': 'prefer_ipv6',
'prefer-v4': 'prefer_ipv4',
'prefer-v6': 'prefer_ipv6',
};
const ipVersionParser = (proxy, parsedProxy) => {
const strategy = ipVersions[proxy['ip-version']];
if (proxy._dns_server && strategy) {
parsedProxy.domain_resolver = {
server: proxy._dns_server,
strategy,
};
}
};
const detourParser = (proxy, parsedProxy) => {
parsedProxy.detour = proxy['dialer-proxy'] || proxy.detour;
};
@@ -51,34 +31,12 @@ const smuxParser = (smux, proxy) => {
if (smux['min-streams'])
proxy.multiplex.min_streams = parseInt(`${smux['min-streams']}`, 10);
if (smux.padding) proxy.multiplex.padding = true;
if (smux['brutal-opts']?.up || smux['brutal-opts']?.down) {
proxy.multiplex.brutal = {
enabled: true,
};
if (smux['brutal-opts']?.up)
proxy.multiplex.brutal.up_mbps = parseInt(
`${smux['brutal-opts']?.up}`,
10,
);
if (smux['brutal-opts']?.down)
proxy.multiplex.brutal.down_mbps = parseInt(
`${smux['brutal-opts']?.down}`,
10,
);
}
};
const wsParser = (proxy, parsedProxy) => {
const transport = { type: 'ws', headers: {} };
if (proxy['ws-opts']) {
const {
path: wsPath = '',
headers: wsHeaders = {},
'max-early-data': max_early_data,
'early-data-header-name': early_data_header_name,
} = proxy['ws-opts'];
transport.early_data_header_name = early_data_header_name;
transport.max_early_data = parseInt(max_early_data, 10);
const { path: wsPath = '', headers: wsHeaders = {} } = proxy['ws-opts'];
if (wsPath !== '') transport.path = `${wsPath}`;
if (Object.keys(wsHeaders).length > 0) {
const headers = {};
@@ -181,7 +139,7 @@ const h1Parser = (proxy, parsedProxy) => {
host = `${host}`.split(',').map((i) => i.trim());
if (host.length > 0) transport.host = host;
}
// if (!transport.host) return;
if (!transport.host) return;
if (proxy['http-path'] && proxy['http-path'] !== '') {
const path = proxy['http-path'];
if (Array.isArray(path)) {
@@ -190,7 +148,7 @@ const h1Parser = (proxy, parsedProxy) => {
}
if (parsedProxy.tls.insecure)
parsedProxy.tls.server_name = transport.host[0];
if (transport.host?.length === 1) transport.host = transport.host[0];
if (transport.host.length === 1) transport.host = transport.host[0];
for (const key of Object.keys(transport.headers)) {
const value = transport.headers[key];
if (value.length === 1) transport.headers[key] = value[0];
@@ -305,7 +263,6 @@ const sshParser = (proxy = {}) => {
if (proxy['fast-open']) parsedProxy.udp_fragment = true;
tfoParser(proxy, parsedProxy);
detourParser(proxy, parsedProxy);
ipVersionParser(proxy, parsedProxy);
return parsedProxy;
};
@@ -333,7 +290,6 @@ const httpParser = (proxy = {}) => {
tfoParser(proxy, parsedProxy);
detourParser(proxy, parsedProxy);
tlsParser(proxy, parsedProxy);
ipVersionParser(proxy, parsedProxy);
return parsedProxy;
};
@@ -356,7 +312,6 @@ const socks5Parser = (proxy = {}) => {
networkParser(proxy, parsedProxy);
tfoParser(proxy, parsedProxy);
detourParser(proxy, parsedProxy);
ipVersionParser(proxy, parsedProxy);
return parsedProxy;
};
@@ -368,17 +323,6 @@ const shadowTLSParser = (proxy = {}) => {
password: proxy.password,
detour: `${proxy.name}_shadowtls`,
};
if (proxy.uot) ssPart.udp_over_tcp = true;
if (proxy['udp-over-tcp']) {
ssPart.udp_over_tcp = {
enabled: true,
version:
!proxy['udp-over-tcp-version'] ||
proxy['udp-over-tcp-version'] === 1
? 1
: 2,
};
}
const stPart = {
tag: `${proxy.name}_shadowtls`,
type: 'shadowtls',
@@ -401,7 +345,6 @@ const shadowTLSParser = (proxy = {}) => {
tfoParser(proxy, stPart);
detourParser(proxy, stPart);
smuxParser(proxy.smux, ssPart);
ipVersionParser(proxy, stPart);
return { type: 'ss-with-st', ssPart, stPart };
};
const ssParser = (proxy = {}) => {
@@ -416,22 +359,12 @@ const ssParser = (proxy = {}) => {
if (parsedProxy.server_port < 0 || parsedProxy.server_port > 65535)
throw 'invalid port';
if (proxy.uot) parsedProxy.udp_over_tcp = true;
if (proxy['udp-over-tcp']) {
parsedProxy.udp_over_tcp = {
enabled: true,
version:
!proxy['udp-over-tcp-version'] ||
proxy['udp-over-tcp-version'] === 1
? 1
: 2,
};
}
if (proxy['udp-over-tcp']) parsedProxy.udp_over_tcp = true;
if (proxy['fast-open']) parsedProxy.udp_fragment = true;
networkParser(proxy, parsedProxy);
tfoParser(proxy, parsedProxy);
detourParser(proxy, parsedProxy);
smuxParser(proxy.smux, parsedProxy);
ipVersionParser(proxy, parsedProxy);
if (proxy.plugin) {
const optArr = [];
if (proxy.plugin === 'obfs') {
@@ -510,7 +443,6 @@ const ssrParser = (proxy = {}) => {
tfoParser(proxy, parsedProxy);
detourParser(proxy, parsedProxy);
smuxParser(proxy.smux, parsedProxy);
ipVersionParser(proxy, parsedProxy);
return parsedProxy;
};
@@ -549,7 +481,6 @@ const vmessParser = (proxy = {}) => {
detourParser(proxy, parsedProxy);
tlsParser(proxy, parsedProxy);
smuxParser(proxy.smux, parsedProxy);
ipVersionParser(proxy, parsedProxy);
return parsedProxy;
};
@@ -564,20 +495,15 @@ const vlessParser = (proxy = {}) => {
};
if (parsedProxy.server_port < 0 || parsedProxy.server_port > 65535)
throw 'invalid port';
if (proxy.xudp) parsedProxy.packet_encoding = 'xudp';
if (proxy['fast-open']) parsedProxy.udp_fragment = true;
// if (['xtls-rprx-vision', ''].includes(proxy.flow)) parsedProxy.flow = proxy.flow;
if (proxy.flow != null) parsedProxy.flow = proxy.flow;
if (proxy.flow === 'xtls-rprx-vision') parsedProxy.flow = proxy.flow;
if (proxy.network === 'ws') wsParser(proxy, parsedProxy);
if (proxy.network === 'h2') h2Parser(proxy, parsedProxy);
if (proxy.network === 'http') h1Parser(proxy, parsedProxy);
if (proxy.network === 'grpc') grpcParser(proxy, parsedProxy);
networkParser(proxy, parsedProxy);
tfoParser(proxy, parsedProxy);
detourParser(proxy, parsedProxy);
smuxParser(proxy.smux, parsedProxy);
tlsParser(proxy, parsedProxy);
ipVersionParser(proxy, parsedProxy);
return parsedProxy;
};
const trojanParser = (proxy = {}) => {
@@ -599,7 +525,6 @@ const trojanParser = (proxy = {}) => {
detourParser(proxy, parsedProxy);
tlsParser(proxy, parsedProxy);
smuxParser(proxy.smux, parsedProxy);
ipVersionParser(proxy, parsedProxy);
return parsedProxy;
};
const hysteriaParser = (proxy = {}) => {
@@ -618,13 +543,12 @@ const hysteriaParser = (proxy = {}) => {
if (proxy['fast-open']) parsedProxy.udp_fragment = true;
// eslint-disable-next-line no-control-regex
const reg = new RegExp('^[0-9]+[ \t]*[KMGT]*[Bb]ps$');
// sing-box 跟文档不一致, 但是懒得全转, 只处理最常见的 Mbps
if (reg.test(`${proxy.up}`) && !`${proxy.up}`.endsWith('Mbps')) {
if (reg.test(`${proxy.up}`)) {
parsedProxy.up = `${proxy.up}`;
} else {
parsedProxy.up_mbps = parseInt(`${proxy.up}`, 10);
}
if (reg.test(`${proxy.down}`) && !`${proxy.down}`.endsWith('Mbps')) {
if (reg.test(`${proxy.down}`)) {
parsedProxy.down = `${proxy.down}`;
} else {
parsedProxy.down_mbps = parseInt(`${proxy.down}`, 10);
@@ -649,10 +573,9 @@ const hysteriaParser = (proxy = {}) => {
detourParser(proxy, parsedProxy);
tfoParser(proxy, parsedProxy);
smuxParser(proxy.smux, parsedProxy);
ipVersionParser(proxy, parsedProxy);
return parsedProxy;
};
const hysteria2Parser = (proxy = {}) => {
const hysteria2Parser = (proxy = {}, includeUnsupportedProxy) => {
const parsedProxy = {
tag: proxy.name,
type: 'hysteria2',
@@ -683,7 +606,6 @@ const hysteria2Parser = (proxy = {}) => {
tfoParser(proxy, parsedProxy);
detourParser(proxy, parsedProxy);
smuxParser(proxy.smux, parsedProxy);
ipVersionParser(proxy, parsedProxy);
return parsedProxy;
};
const tuic5Parser = (proxy = {}) => {
@@ -715,7 +637,6 @@ const tuic5Parser = (proxy = {}) => {
detourParser(proxy, parsedProxy);
tlsParser(proxy, parsedProxy);
smuxParser(proxy.smux, parsedProxy);
ipVersionParser(proxy, parsedProxy);
return parsedProxy;
};
const anytlsParser = (proxy = {}) => {
@@ -731,14 +652,8 @@ const anytlsParser = (proxy = {}) => {
parsedProxy.idle_session_check_interval = `${proxy['idle-session-check-interval']}s`;
if (/^\d+$/.test(proxy['idle-session-timeout']))
parsedProxy.idle_session_timeout = `${proxy['idle-session-timeout']}s`;
if (/^\d+$/.test(proxy['min-idle-session']))
parsedProxy.min_idle_session = parseInt(
`${proxy['min-idle-session']}`,
10,
);
detourParser(proxy, parsedProxy);
tlsParser(proxy, parsedProxy);
ipVersionParser(proxy, parsedProxy);
return parsedProxy;
};
@@ -796,7 +711,6 @@ const wireguardParser = (proxy = {}) => {
tfoParser(proxy, parsedProxy);
detourParser(proxy, parsedProxy);
smuxParser(proxy.smux, parsedProxy);
ipVersionParser(proxy, parsedProxy);
return parsedProxy;
};

View File

@@ -1,5 +1,4 @@
import { isPresent } from '@/core/proxy-utils/producers/utils';
import $ from '@/core/app';
export default function Stash_Producer() {
const type = 'ALL';
@@ -40,20 +39,21 @@ export default function Stash_Producer() {
'xchacha20',
'chacha20-ietf-poly1305',
'xchacha20-ietf-poly1305',
'2022-blake3-aes-128-gcm',
'2022-blake3-aes-256-gcm',
...(opts['include-unsupported-proxy']
? [
'2022-blake3-aes-128-gcm',
'2022-blake3-aes-256-gcm',
]
: []),
].includes(proxy.cipher)) ||
(proxy.type === 'snell' && proxy.version >= 4) ||
(proxy.type === 'vless' &&
proxy['reality-opts'] &&
!['xtls-rprx-vision'].includes(proxy.flow))
(proxy.type === 'snell' && String(proxy.version) === '4') ||
(opts['include-unsupported-proxy']
? proxy.type === 'vless' &&
proxy['reality-opts'] &&
!['xtls-rprx-vision'].includes(proxy.flow)
: proxy.type === 'vless' && proxy['reality-opts'])
) {
return false;
} else if (proxy['underlying-proxy'] || proxy['dialer-proxy']) {
$.error(
`Stash 暂不支持前置代理字段. 已过滤节点 ${proxy.name}. 请使用 代理的转发链 https://stash.wiki/proxy-protocols/proxy-groups#relay`,
);
return false;
}
return true;
})
@@ -238,18 +238,6 @@ export default function Stash_Producer() {
proxy['h2-opts'].headers.host = [host];
}
}
if (proxy.network === 'ws') {
const wsPath = proxy['ws-opts']?.path;
const reg = /^(.*?)(?:\?ed=(\d+))?$/;
// eslint-disable-next-line no-unused-vars
const [_, path = '', ed = ''] = reg.exec(wsPath);
proxy['ws-opts'].path = path;
if (ed !== '') {
proxy['ws-opts']['early-data-header-name'] =
'Sec-WebSocket-Protocol';
proxy['ws-opts']['max-early-data'] = parseInt(ed, 10);
}
}
if (proxy['plugin-opts']?.tls) {
if (isPresent(proxy, 'skip-cert-verify')) {
proxy['plugin-opts']['skip-cert-verify'] =
@@ -273,6 +261,11 @@ export default function Stash_Producer() {
}
delete proxy['tls-fingerprint'];
if (proxy['underlying-proxy']) {
proxy['dialer-proxy'] = proxy['underlying-proxy'];
}
delete proxy['underlying-proxy'];
if (isPresent(proxy, 'tls') && typeof proxy.tls !== 'boolean') {
delete proxy.tls;
}

View File

@@ -370,9 +370,9 @@ function vmess(proxy, includeUnsupportedProxy) {
function ssh(proxy) {
const result = new Result(proxy);
result.append(`${proxy.name}=ssh,${proxy.server},${proxy.port}`);
result.appendIfPresent(`,username="${proxy.username}"`, 'username');
result.appendIfPresent(`,${proxy.username}`, 'username');
// 所有的类似的字段都有双引号的问题 暂不处理
result.appendIfPresent(`,password="${proxy.password}"`, 'password');
result.appendIfPresent(`,"${proxy.password}"`, 'password');
// https://manual.nssurge.com/policy/ssh.html
// 需配合 Keystore
@@ -439,8 +439,8 @@ function http(proxy) {
const result = new Result(proxy);
const type = proxy.tls ? 'https' : 'http';
result.append(`${proxy.name}=${type},${proxy.server},${proxy.port}`);
result.appendIfPresent(`,username="${proxy.username}"`, 'username');
result.appendIfPresent(`,password="${proxy.password}"`, 'password');
result.appendIfPresent(`,${proxy.username}`, 'username');
result.appendIfPresent(`,"${proxy.password}"`, 'password');
const ip_version = ipVersions[proxy['ip-version']] || proxy['ip-version'];
result.appendIfPresent(`,ip-version=${ip_version}`, 'ip-version');
@@ -565,8 +565,8 @@ function socks5(proxy) {
const result = new Result(proxy);
const type = proxy.tls ? 'socks5-tls' : 'socks5';
result.append(`${proxy.name}=${type},${proxy.server},${proxy.port}`);
result.appendIfPresent(`,username="${proxy.username}"`, 'username');
result.appendIfPresent(`,password="${proxy.password}"`, 'password');
result.appendIfPresent(`,${proxy.username}`, 'username');
result.appendIfPresent(`,"${proxy.password}"`, 'password');
const ip_version = ipVersions[proxy['ip-version']] || proxy['ip-version'];
result.appendIfPresent(`,ip-version=${ip_version}`, 'ip-version');

View File

@@ -12,7 +12,7 @@ export default function URI_Producer() {
delete proxy.resolved;
delete proxy['no-resolve'];
for (const key in proxy) {
if (proxy[key] == null) {
if (proxy[key] == null || /^_/i.test(key)) {
delete proxy[key];
}
}
@@ -23,19 +23,13 @@ export default function URI_Producer() {
) {
delete proxy.tls;
}
if (
!['vmess'].includes(proxy.type) &&
proxy.server &&
isIPv6(proxy.server)
) {
if (proxy.server && isIPv6(proxy.server)) {
proxy.server = `[${proxy.server}]`;
}
switch (proxy.type) {
case 'socks5':
result = `socks://${encodeURIComponent(
Base64.encode(
`${proxy.username ?? ''}:${proxy.password ?? ''}`,
),
Base64.encode(`${proxy.username}:${proxy.password}`),
)}@${proxy.server}:${proxy.port}#${proxy.name}`;
break;
case 'ss':
@@ -119,17 +113,12 @@ export default function URI_Producer() {
v: '2',
ps: proxy.name,
add: proxy.server,
port: `${proxy.port}`,
port: proxy.port,
id: proxy.uuid,
aid: `${proxy.alterId || 0}`,
scy: proxy.cipher,
net,
type,
aid: proxy.alterId || 0,
net,
tls: proxy.tls ? 'tls' : '',
alpn: Array.isArray(proxy.alpn)
? proxy.alpn.join(',')
: proxy.alpn,
fp: proxy['client-fingerprint'],
};
if (proxy.tls && proxy.sni) {
result.sni = proxy.sni;
@@ -140,7 +129,16 @@ export default function URI_Producer() {
proxy[`${proxy.network}-opts`]?.path;
let vmessTransportHost =
proxy[`${proxy.network}-opts`]?.headers?.Host;
if (vmessTransportPath) {
result.path = Array.isArray(vmessTransportPath)
? vmessTransportPath[0]
: vmessTransportPath;
}
if (vmessTransportHost) {
result.host = Array.isArray(vmessTransportHost)
? vmessTransportHost[0]
: vmessTransportHost;
}
if (['grpc'].includes(proxy.network)) {
result.path =
proxy[`${proxy.network}-opts`]?.[
@@ -152,31 +150,6 @@ export default function URI_Producer() {
'gun';
result.host =
proxy[`${proxy.network}-opts`]?.['_grpc-authority'];
} else if (['kcp', 'quic'].includes(proxy.network)) {
// https://github.com/XTLS/Xray-core/issues/91
result.type =
proxy[`${proxy.network}-opts`]?.[
`_${proxy.network}-type`
] || 'none';
result.host =
proxy[`${proxy.network}-opts`]?.[
`_${proxy.network}-host`
];
result.path =
proxy[`${proxy.network}-opts`]?.[
`_${proxy.network}-path`
];
} else {
if (vmessTransportPath) {
result.path = Array.isArray(vmessTransportPath)
? vmessTransportPath[0]
: vmessTransportPath;
}
if (vmessTransportHost) {
result.host = Array.isArray(vmessTransportHost)
? vmessTransportHost[0]
: vmessTransportHost;
}
}
}
result = 'vmess://' + Base64.encode(JSON.stringify(result));
@@ -501,7 +474,7 @@ export default function URI_Producer() {
hysteriaParams.push(`obfsParam=${proxy[key]}`);
} else if (['sni'].includes(key)) {
hysteriaParams.push(`peer=${proxy[key]}`);
} else if (proxy[key] && !/^_/i.test(key)) {
} else if (proxy[key]) {
hysteriaParams.push(
`${i}=${encodeURIComponent(proxy[key])}`,
);
@@ -558,13 +531,7 @@ export default function URI_Producer() {
proxy[key]
) {
tuicParams.push(`${i.replace(/-/g, '_')}=1`);
} else if (
['congestion-controller'].includes(key)
) {
tuicParams.push(
`congestion_control=${proxy[key]}`,
);
} else if (proxy[key] && !/^_/i.test(key)) {
} else if (proxy[key]) {
tuicParams.push(
`${i.replace(
/-/g,
@@ -612,11 +579,7 @@ export default function URI_Producer() {
if (proxy[key]) {
anytlsParams.push(`insecure=1`);
}
} else if (['udp'].includes(key)) {
if (proxy[key]) {
anytlsParams.push(`udp=1`);
}
} else if (proxy[key] && !/^_/i.test(key)) {
} else if (proxy[key]) {
anytlsParams.push(
`${i.replace(/-/g, '_')}=${encodeURIComponent(
proxy[key],
@@ -653,7 +616,7 @@ export default function URI_Producer() {
if (proxy[key]) {
wireguardParams.push(`${key}=1`);
}
} else if (proxy[key] && !/^_/i.test(key)) {
} else if (proxy[key]) {
wireguardParams.push(
`${key}=${encodeURIComponent(proxy[key])}`,
);

View File

@@ -11,7 +11,6 @@
* @documentation: https://www.notion.so/Sub-Store-6259586994d34c11a4ced5c406264b46
*/
import { version } from '../package.json';
import $ from '@/core/app';
console.log(
`
┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅
@@ -19,6 +18,7 @@ console.log(
┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅
`,
);
import migrate from '@/utils/migration';
import serve from '@/restful';

View File

@@ -89,10 +89,8 @@ async function doSync() {
const allSubs = $.read(SUBS_KEY);
const allCols = $.read(COLLECTIONS_KEY);
const subNames = [];
let enabledCount = 0;
allArtifacts.map((artifact) => {
if (artifact.sync && artifact.source) {
enabledCount++;
if (artifact.type === 'subscription') {
const subName = artifact.source;
const sub = findByName(allSubs, subName);
@@ -113,13 +111,6 @@ async function doSync() {
}
});
if (enabledCount === 0) {
$.info(
`需同步的配置: ${enabledCount}, 总数: ${allArtifacts.length}`,
);
return;
}
if (subNames.length > 0) {
await Promise.all(
subNames.map(async (subName) => {

View File

@@ -14,12 +14,10 @@ let resourceUrl = typeof $resourceUrl !== 'undefined' ? $resourceUrl : '';
`
┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅
Sub-Store -- v${version}
Loon -- ${$loon}
┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅
`,
);
const build = $loon.match(/\((\d+)\)$/)?.[1];
let arg;
if (typeof $argument != 'undefined') {
arg = Object.fromEntries(
@@ -28,28 +26,23 @@ let resourceUrl = typeof $resourceUrl !== 'undefined' ? $resourceUrl : '';
} else {
arg = {};
}
console.log(`arg: ${JSON.stringify(arg)}`);
const RESOURCE_TYPE = {
PROXY: 1,
RULE: 2,
};
if (!arg.resourceUrlOnly) {
result = resource;
}
result = resource;
if (resourceType === RESOURCE_TYPE.PROXY) {
if (!arg.resourceUrlOnly) {
try {
let proxies = ProxyUtils.parse(resource);
result = ProxyUtils.produce(proxies, 'Loon', undefined, {
'include-unsupported-proxy':
arg?.includeUnsupportedProxy || build >= 842,
});
} catch (e) {
console.log('解析器: 使用 resource 出现错误');
console.log(e.message ?? e);
}
try {
let proxies = ProxyUtils.parse(resource);
result = ProxyUtils.produce(proxies, 'Loon', undefined, {
'include-unsupported-proxy': arg?.includeUnsupportedProxy,
});
} catch (e) {
console.log('解析器: 使用 resource 出现错误');
console.log(e.message ?? e);
}
if ((!result || /^\s*$/.test(result)) && resourceUrl) {
console.log(`解析器: 尝试从 ${resourceUrl} 获取订阅`);
@@ -66,21 +59,18 @@ let resourceUrl = typeof $resourceUrl !== 'undefined' ? $resourceUrl : '';
);
let proxies = ProxyUtils.parse(raw);
result = ProxyUtils.produce(proxies, 'Loon', undefined, {
'include-unsupported-proxy':
arg?.includeUnsupportedProxy || build >= 842,
'include-unsupported-proxy': arg?.includeUnsupportedProxy,
});
} catch (e) {
console.log(e.message ?? e);
}
}
} else if (resourceType === RESOURCE_TYPE.RULE) {
if (!arg.resourceUrlOnly) {
try {
const rules = RuleUtils.parse(resource);
result = RuleUtils.produce(rules, 'Loon');
} catch (e) {
console.log(e.message ?? e);
}
try {
const rules = RuleUtils.parse(resource);
result = RuleUtils.produce(rules, 'Loon');
} catch (e) {
console.log(e.message ?? e);
}
if ((!result || /^\s*$/.test(result)) && resourceUrl) {
console.log(`解析器: 尝试从 ${resourceUrl} 获取规则`);

View File

@@ -112,6 +112,7 @@ function replaceArtifact(req, res) {
async function getArtifact(req, res) {
let { name } = req.params;
name = decodeURIComponent(name);
const allArtifacts = $.read(ARTIFACTS_KEY);
const artifact = findByName(allArtifacts, name);
@@ -162,6 +163,7 @@ function createArtifact(req, res) {
function updateArtifact(req, res) {
const allArtifacts = $.read(ARTIFACTS_KEY);
let oldName = req.params.name;
oldName = decodeURIComponent(oldName);
const artifact = findByName(allArtifacts, oldName);
if (artifact) {
$.info(`正在更新远程配置:${artifact.name}`);
@@ -195,6 +197,7 @@ function updateArtifact(req, res) {
async function deleteArtifact(req, res) {
let { name } = req.params;
name = decodeURIComponent(name);
$.info(`正在删除远程配置:${name}`);
const allArtifacts = $.read(ARTIFACTS_KEY);
try {

View File

@@ -1,9 +1,8 @@
import { deleteByName, findByName, updateByName } from '@/utils/database';
import { COLLECTIONS_KEY, ARTIFACTS_KEY, FILES_KEY } from '@/constants';
import { COLLECTIONS_KEY, ARTIFACTS_KEY } from '@/constants';
import { failed, success } from '@/restful/response';
import $ from '@/core/app';
import { RequestInvalidError, ResourceNotFoundError } from '@/restful/errors';
import { formatDateTime } from '@/utils';
export default function register($app) {
if (!$.read(COLLECTIONS_KEY)) $.write({}, COLLECTIONS_KEY);
@@ -52,6 +51,7 @@ function createCollection(req, res) {
function getCollection(req, res) {
let { name } = req.params;
let { raw } = req.query;
name = decodeURIComponent(name);
const allCols = $.read(COLLECTIONS_KEY);
const collection = findByName(allCols, name);
if (collection) {
@@ -60,9 +60,16 @@ function getCollection(req, res) {
.set(
'content-disposition',
`attachment; filename="${encodeURIComponent(
`sub-store_collection_${name}_${formatDateTime(
new Date(),
)}.json`,
`sub-store_collection_${name}_${new Date()
.toLocaleString('zh-CN', {
year: 'numeric',
day: 'numeric',
month: 'numeric',
hour: 'numeric',
minute: 'numeric',
second: 'numeric',
})
.replace(/\D/g, '')}.json`,
)}"`,
)
.send(JSON.stringify(collection));
@@ -83,6 +90,7 @@ function getCollection(req, res) {
function updateCollection(req, res) {
let { name } = req.params;
name = decodeURIComponent(name);
let collection = req.body;
const allCols = $.read(COLLECTIONS_KEY);
const oldCol = findByName(allCols, name);
@@ -104,18 +112,7 @@ function updateCollection(req, res) {
artifact.source = newCol.name;
}
}
// update all files referring this collection
const allFiles = $.read(FILES_KEY) || [];
for (const file of allFiles) {
if (
file.sourceType === 'collection' &&
file.sourceName === oldCol.name
) {
file.sourceName = newCol.name;
}
}
$.write(allArtifacts, ARTIFACTS_KEY);
$.write(allFiles, FILES_KEY);
}
updateByName(allCols, name, newCol);
@@ -135,6 +132,7 @@ function updateCollection(req, res) {
function deleteCollection(req, res) {
let { name } = req.params;
name = decodeURIComponent(name);
$.info(`正在删除组合订阅:${name}`);
let allCols = $.read(COLLECTIONS_KEY);
deleteByName(allCols, name);

View File

@@ -88,6 +88,8 @@ export default function register($app) {
async function downloadSubscription(req, res) {
let { name, nezhaIndex } = req.params;
name = decodeURIComponent(name);
nezhaIndex = decodeURIComponent(nezhaIndex);
const useMihomoExternal = req.query.target === 'SurgeMac';
@@ -109,17 +111,7 @@ async function downloadSubscription(req, res) {
proxy,
noCache,
} = req.query;
let $options = {
_req: {
method: req.method,
url: req.url,
path: req.path,
query: req.query,
params: req.params,
headers: req.headers,
body: req.body,
},
};
let $options = {};
if (req.query.$options) {
try {
// 支持 `#${encodeURIComponent(JSON.stringify({arg1: "1"}))}`
@@ -138,6 +130,7 @@ async function downloadSubscription(req, res) {
$.info(`传入 $options: ${JSON.stringify($options)}`);
}
if (url) {
url = decodeURIComponent(url);
$.info(`指定远程订阅 URL: ${url}`);
if (!/^https?:\/\//.test(url)) {
content = url;
@@ -145,25 +138,32 @@ async function downloadSubscription(req, res) {
}
}
if (content) {
content = decodeURIComponent(content);
$.info(`指定本地订阅: ${content}`);
}
if (proxy) {
proxy = decodeURIComponent(proxy);
$.info(`指定远程订阅使用代理/策略 proxy: ${proxy}`);
}
if (ua) {
ua = decodeURIComponent(ua);
$.info(`指定远程订阅 User-Agent: ${ua}`);
}
if (mergeSources) {
mergeSources = decodeURIComponent(mergeSources);
$.info(`指定合并来源: ${mergeSources}`);
}
if (ignoreFailedRemoteSub != null && ignoreFailedRemoteSub !== '') {
ignoreFailedRemoteSub = decodeURIComponent(ignoreFailedRemoteSub);
$.info(`指定忽略失败的远程订阅: ${ignoreFailedRemoteSub}`);
}
if (produceType) {
produceType = decodeURIComponent(produceType);
$.info(`指定生产类型: ${produceType}`);
}
if (includeUnsupportedProxy) {
includeUnsupportedProxy = decodeURIComponent(includeUnsupportedProxy);
$.info(
`包含官方/商店版/未续费订阅不支持的协议: ${includeUnsupportedProxy}`,
);
@@ -249,7 +249,7 @@ async function downloadSubscription(req, res) {
}
}
}
if (!$arguments.noFlow && /^https?/.test(url)) {
if (!$arguments.noFlow) {
// forward flow headers
flowInfo = await getFlowHeaders(
$arguments?.insecure ? `${url}#insecure` : url,
@@ -352,6 +352,8 @@ async function downloadSubscription(req, res) {
async function downloadCollection(req, res) {
let { name, nezhaIndex } = req.params;
name = decodeURIComponent(name);
nezhaIndex = decodeURIComponent(nezhaIndex);
const useMihomoExternal = req.query.target === 'SurgeMac';
@@ -374,17 +376,7 @@ async function downloadCollection(req, res) {
noCache,
} = req.query;
let $options = {
_req: {
method: req.method,
url: req.url,
path: req.path,
query: req.query,
params: req.params,
headers: req.headers,
body: req.body,
},
};
let $options = {};
if (req.query.$options) {
try {
// 支持 `#${encodeURIComponent(JSON.stringify({arg1: "1"}))}`
@@ -404,17 +396,21 @@ async function downloadCollection(req, res) {
}
if (proxy) {
proxy = decodeURIComponent(proxy);
$.info(`指定远程订阅使用代理/策略 proxy: ${proxy}`);
}
if (ignoreFailedRemoteSub != null && ignoreFailedRemoteSub !== '') {
ignoreFailedRemoteSub = decodeURIComponent(ignoreFailedRemoteSub);
$.info(`指定忽略失败的远程订阅: ${ignoreFailedRemoteSub}`);
}
if (produceType) {
produceType = decodeURIComponent(produceType);
$.info(`指定生产类型: ${produceType}`);
}
if (includeUnsupportedProxy) {
includeUnsupportedProxy = decodeURIComponent(includeUnsupportedProxy);
$.info(
`包含官方/商店版/未续费订阅不支持的协议: ${includeUnsupportedProxy}`,
);
@@ -490,7 +486,7 @@ async function downloadCollection(req, res) {
}
}
}
if (!$arguments.noFlow && /^https?:/.test(url)) {
if (!$arguments.noFlow) {
subUserInfoOfSub = await getFlowHeaders(
$arguments?.insecure ? `${url}#insecure` : url,
$arguments.flowUserAgent,

View File

@@ -1,6 +1,6 @@
import { deleteByName, findByName, updateByName } from '@/utils/database';
import { getFlowHeaders, normalizeFlowHeader } from '@/utils/flow';
import { FILES_KEY, ARTIFACTS_KEY } from '@/constants';
import { FILES_KEY } from '@/constants';
import { failed, success } from '@/restful/response';
import $ from '@/core/app';
import {
@@ -9,7 +9,6 @@ import {
InternalServerError,
} from '@/restful/errors';
import { produceArtifact } from '@/restful/sync';
import { formatDateTime } from '@/utils';
export default function register($app) {
if (!$.read(FILES_KEY)) $.write([], FILES_KEY);
@@ -51,8 +50,9 @@ function createFile(req, res) {
async function getFile(req, res) {
let { name } = req.params;
const reqUA = req.headers['user-agent'] || req.headers['User-Agent'];
$.info(`正在下载文件:${name}\n请求 User-Agent: ${reqUA}`);
name = decodeURIComponent(name);
$.info(`正在下载文件:${name}`);
let {
url,
subInfoUrl,
@@ -63,19 +63,8 @@ async function getFile(req, res) {
ignoreFailedRemoteFile,
proxy,
noCache,
produceType,
} = req.query;
let $options = {
_req: {
method: req.method,
url: req.url,
path: req.path,
query: req.query,
params: req.params,
headers: req.headers,
body: req.body,
},
};
let $options = {};
if (req.query.$options) {
try {
// 支持 `#${encodeURIComponent(JSON.stringify({arg1: "1"}))}`
@@ -94,35 +83,40 @@ async function getFile(req, res) {
$.info(`传入 $options: ${JSON.stringify($options)}`);
}
if (url) {
url = decodeURIComponent(url);
$.info(`指定远程文件 URL: ${url}`);
}
if (proxy) {
proxy = decodeURIComponent(proxy);
$.info(`指定远程订阅使用代理/策略 proxy: ${proxy}`);
}
if (ua) {
ua = decodeURIComponent(ua);
$.info(`指定远程文件 User-Agent: ${ua}`);
}
if (subInfoUrl) {
subInfoUrl = decodeURIComponent(subInfoUrl);
$.info(`指定获取流量的 subInfoUrl: ${subInfoUrl}`);
}
if (subInfoUserAgent) {
subInfoUserAgent = decodeURIComponent(subInfoUserAgent);
$.info(`指定获取流量的 subInfoUserAgent: ${subInfoUserAgent}`);
}
if (content) {
content = decodeURIComponent(content);
$.info(`指定本地文件: ${content}`);
}
if (mergeSources) {
mergeSources = decodeURIComponent(mergeSources);
$.info(`指定合并来源: ${mergeSources}`);
}
if (ignoreFailedRemoteFile != null && ignoreFailedRemoteFile !== '') {
ignoreFailedRemoteFile = decodeURIComponent(ignoreFailedRemoteFile);
$.info(`指定忽略失败的远程文件: ${ignoreFailedRemoteFile}`);
}
if (noCache) {
$.info(`指定不使用缓存: ${noCache}`);
}
if (produceType) {
$.info(`指定生产类型: ${produceType}`);
}
const allFiles = $.read(FILES_KEY);
const file = findByName(allFiles, name);
@@ -139,8 +133,6 @@ async function getFile(req, res) {
$options,
proxy,
noCache,
produceType,
all: true,
});
try {
@@ -175,15 +167,9 @@ async function getFile(req, res) {
)}`,
);
}
res.set('Content-Type', 'text/plain; charset=utf-8');
if (output?.$options?._res?.headers) {
Object.entries(output.$options._res.headers).forEach(
([key, value]) => {
res.set(key, value);
},
);
}
res.send(output?.$content ?? '');
res.set('Content-Type', 'text/plain; charset=utf-8').send(
output ?? '',
);
} catch (err) {
$.notify(
`🌍 Sub-Store 下载文件失败`,
@@ -215,6 +201,7 @@ async function getFile(req, res) {
function getWholeFile(req, res) {
let { name } = req.params;
let { raw } = req.query;
name = decodeURIComponent(name);
const allFiles = $.read(FILES_KEY);
const file = findByName(allFiles, name);
if (file) {
@@ -223,9 +210,16 @@ function getWholeFile(req, res) {
.set(
'content-disposition',
`attachment; filename="${encodeURIComponent(
`sub-store_file_${name}_${formatDateTime(
new Date(),
)}.json`,
`sub-store_file_${name}_${new Date()
.toLocaleString('zh-CN', {
year: 'numeric',
day: 'numeric',
month: 'numeric',
hour: 'numeric',
minute: 'numeric',
second: 'numeric',
})
.replace(/\D/g, '')}.json`,
)}"`,
)
.send(JSON.stringify(file));
@@ -246,6 +240,7 @@ function getWholeFile(req, res) {
function updateFile(req, res) {
let { name } = req.params;
name = decodeURIComponent(name);
let file = req.body;
const allFiles = $.read(FILES_KEY);
const oldFile = findByName(allFiles, name);
@@ -256,20 +251,6 @@ function updateFile(req, res) {
};
$.info(`正在更新文件:${name}...`);
if (name !== newFile.name) {
// update all artifacts referring this collection
const allArtifacts = $.read(ARTIFACTS_KEY) || [];
for (const artifact of allArtifacts) {
if (
artifact.type === 'file' &&
artifact.source === oldFile.name
) {
artifact.source = newFile.name;
}
}
$.write(allArtifacts, ARTIFACTS_KEY);
}
updateByName(allFiles, name, newFile);
$.write(allFiles, FILES_KEY);
success(res, newFile);
@@ -287,6 +268,7 @@ function updateFile(req, res) {
function deleteFile(req, res) {
let { name } = req.params;
name = decodeURIComponent(name);
$.info(`正在删除文件:${name}`);
let allFiles = $.read(FILES_KEY);
deleteByName(allFiles, name);

View File

@@ -1,9 +1,7 @@
import { Base64 } from 'js-base64';
import _ from 'lodash';
import express from '@/vendor/express';
import $ from '@/core/app';
import migrate from '@/utils/migration';
import download, { downloadFile } from '@/utils/download';
import download from '@/utils/download';
import { syncArtifacts, produceArtifact } from '@/restful/sync';
import { gistBackupAction } from '@/restful/miscs';
import { TOKENS_KEY } from '@/constants';
@@ -31,77 +29,6 @@ export default function serve() {
host = eval('process.env.SUB_STORE_BACKEND_API_HOST') || '::';
}
const $app = express({ substore: $, port, host });
if ($.env.isNode) {
const be_merge = eval('process.env.SUB_STORE_BACKEND_MERGE');
const be_prefix = eval('process.env.SUB_STORE_BACKEND_PREFIX');
const fe_be_path = eval('process.env.SUB_STORE_FRONTEND_BACKEND_PATH');
const fe_path = eval('process.env.SUB_STORE_FRONTEND_PATH');
if (be_prefix || be_merge) {
if (!fe_be_path.startsWith('/')) {
throw new Error(
'SUB_STORE_FRONTEND_BACKEND_PATH should start with /',
);
}
if (be_merge) {
$.info(`[BACKEND] MERGE mode is [ON].`);
$.info(`[BACKEND && FRONTEND] ${host}:${port}`);
}
$.info(`[BACKEND PREFIX] ${host}:${port}${fe_be_path}`);
$app.use((req, res, next) => {
if (req.path.startsWith(fe_be_path)) {
req.url = req.url.replace(fe_be_path, '') || '/';
if (be_merge && req.url.startsWith('/api/')) {
req.query['share'] = 'true';
}
next();
return;
}
const pathname =
decodeURIComponent(req._parsedUrl.pathname) || '/';
if (
be_merge &&
req.path.startsWith('/share/') &&
req.query.token
) {
if (req.method.toLowerCase() !== 'get') {
res.status(405).send('Method not allowed');
return;
}
const tokens = $.read(TOKENS_KEY) || [];
const token = tokens.find(
(t) =>
t.token === req.query.token &&
`/share/${t.type}/${t.name}` === pathname &&
(t.exp == null || t.exp > Date.now()),
);
if (token) {
next();
return;
}
}
if (be_merge && fe_path && req.path.indexOf('/', 1) == -1) {
if (req.path.indexOf('.') == -1) {
req.url = '/index.html';
}
const express_ = eval(`require("express")`);
const mime_ = eval(`require("mime-types")`);
const path_ = eval(`require("path")`);
const staticFileMiddleware = express_.static(fe_path, {
setHeaders: (res, path) => {
const type = mime_.contentType(path_.extname(path));
if (type) {
res.set('Content-Type', type);
}
},
});
staticFileMiddleware(req, res, next);
return;
}
res.status(404).end();
return;
});
}
}
// register routes
registerCollectionRoutes($app);
registerSubscriptionRoutes($app);
@@ -121,11 +48,10 @@ export default function serve() {
$app.start();
if ($.env.isNode) {
// Deprecated: SUB_STORE_BACKEND_CRON, SUB_STORE_CRON
const backend_sync_cron = eval(
'process.env.SUB_STORE_BACKEND_SYNC_CRON',
);
// Deprecated: SUB_STORE_BACKEND_CRON
const backend_sync_cron =
eval('process.env.SUB_STORE_BACKEND_SYNC_CRON') ||
eval('process.env.SUB_STORE_BACKEND_CRON');
if (backend_sync_cron) {
$.info(`[SYNC CRON] ${backend_sync_cron} enabled`);
const { CronJob } = eval(`require("cron")`);
@@ -148,17 +74,6 @@ export default function serve() {
true, // start
// 'Asia/Shanghai' // timeZone
);
} else {
if (eval('process.env.SUB_STORE_BACKEND_CRON')) {
$.error(
`[SYNC CRON] SUB_STORE_BACKEND_CRON 已弃用, 请使用 SUB_STORE_BACKEND_SYNC_CRON`,
);
}
if (eval('process.env.SUB_STORE_CRON')) {
$.error(
`[SYNC CRON] SUB_STORE_CRON 已弃用, 请使用 SUB_STORE_BACKEND_SYNC_CRON`,
);
}
}
// 格式: 0 */2 * * *,sub,a;0 */3 * * *,col,b
// 每 2 小时处理一次单条订阅 a, 每 3 小时处理一次组合订阅 b
@@ -249,64 +164,9 @@ export default function serve() {
// 'Asia/Shanghai' // timeZone
);
}
const mmdb_cron = eval('process.env.SUB_STORE_MMDB_CRON');
const countryFile = eval('process.env.SUB_STORE_MMDB_COUNTRY_PATH');
const countryUrl = eval('process.env.SUB_STORE_MMDB_COUNTRY_URL');
const asnFile = eval('process.env.SUB_STORE_MMDB_ASN_PATH');
const asnUrl = eval('process.env.SUB_STORE_MMDB_ASN_URL');
if (mmdb_cron && ((countryFile && countryUrl) || (asnFile && asnUrl))) {
$.info(`[MMDB CRON] ${mmdb_cron} enabled`);
const { CronJob } = eval(`require("cron")`);
new CronJob(
mmdb_cron,
async function () {
try {
$.info(`[MMDB CRON] ${mmdb_cron} started`);
if (countryFile && countryUrl) {
try {
$.info(
`[MMDB CRON] downloading ${countryUrl} to ${countryFile}`,
);
await downloadFile(countryUrl, countryFile);
} catch (e) {
$.error(
`[MMDB CRON] ${countryUrl} download failed: ${
e.message ?? e
}`,
);
}
}
if (asnFile && asnUrl) {
try {
$.info(
`[MMDB CRON] downloading ${asnUrl} to ${asnFile}`,
);
await downloadFile(asnUrl, asnFile);
} catch (e) {
$.error(
`[MMDB CRON] ${asnUrl} download failed: ${
e.message ?? e
}`,
);
}
}
$.info(`[MMDB CRON] ${mmdb_cron} finished`);
} catch (e) {
$.error(
`[MMDB CRON] ${mmdb_cron} error: ${e.message ?? e}`,
);
}
}, // onTick
null, // onComplete
true, // start
// 'Asia/Shanghai' // timeZone
);
}
const path = eval(`require("path")`);
const fs = eval(`require("fs")`);
const data_url = eval('process.env.SUB_STORE_DATA_URL');
const data_url_post = eval('process.env.SUB_STORE_DATA_URL_POST');
const fe_be_path = eval('process.env.SUB_STORE_FRONTEND_BACKEND_PATH');
const fe_port = eval('process.env.SUB_STORE_FRONTEND_PORT') || 3001;
const fe_host =
@@ -315,8 +175,7 @@ export default function serve() {
const fe_abs_path = path.resolve(
fe_path || path.join(__dirname, 'frontend'),
);
const be_merge = eval('process.env.SUB_STORE_BACKEND_MERGE');
if (fe_path && !be_merge) {
if (fe_path) {
try {
fs.accessSync(path.join(fe_abs_path, 'index.html'));
} catch (e) {
@@ -341,9 +200,6 @@ export default function serve() {
let be_download_rewrite = '';
let be_api_rewrite = '';
let be_share_rewrite = `${be_share}:type/:name`;
let prefix = eval('process.env.SUB_STORE_BACKEND_PREFIX')
? fe_be_path
: '';
if (fe_be_path) {
if (!fe_be_path.startsWith('/')) {
throw new Error(
@@ -360,7 +216,7 @@ export default function serve() {
app.use(
be_share_rewrite,
createProxyMiddleware({
target: `http://127.0.0.1:${port}${prefix}`,
target: `http://127.0.0.1:${port}`,
changeOrigin: true,
pathRewrite: async (path, req) => {
if (req.method.toLowerCase() !== 'get')
@@ -381,7 +237,7 @@ export default function serve() {
app.use(
be_api_rewrite,
createProxyMiddleware({
target: `http://127.0.0.1:${port}${prefix}${be_api}`,
target: `http://127.0.0.1:${port}${be_api}`,
pathRewrite: async (path) => {
return path.includes('?')
? `${path}&share=true`
@@ -392,7 +248,7 @@ export default function serve() {
app.use(
be_download_rewrite,
createProxyMiddleware({
target: `http://127.0.0.1:${port}${prefix}${be_download}`,
target: `http://127.0.0.1:${port}${be_download}`,
changeOrigin: true,
}),
);
@@ -413,10 +269,10 @@ export default function serve() {
$.info(`[FRONTEND] ${fe_address}:${fe_port}`);
if (fe_be_path) {
$.info(
`[FRONTEND -> BACKEND] ${fe_address}:${fe_port}${be_api_rewrite} -> ${host}:${port}${prefix}${be_api}`,
`[FRONTEND -> BACKEND] ${fe_address}:${fe_port}${be_api_rewrite} -> http://127.0.0.1:${port}${be_api}`,
);
$.info(
`[FRONTEND -> BACKEND] ${fe_address}:${fe_port}${be_download_rewrite} -> ${host}:${port}${prefix}${be_download}`,
`[FRONTEND -> BACKEND] ${fe_address}:${fe_port}${be_download_rewrite} -> http://127.0.0.1:${port}${be_download}`,
);
$.info(
`[SHARE BACKEND] ${fe_address}:${fe_port}${be_share_rewrite}`,
@@ -427,39 +283,10 @@ export default function serve() {
if (data_url) {
$.info(`[BACKEND] downloading data from ${data_url}`);
download(data_url)
.then(async (content) => {
try {
content = JSON.parse(Base64.decode(content));
if (Object.keys(content.settings).length === 0) {
throw new Error(
'备份文件应该至少包含 settings 字段',
);
}
} catch (err) {
try {
content = JSON.parse(content);
if (Object.keys(content.settings).length === 0) {
throw new Error(
'备份文件应该至少包含 settings 字段',
);
}
} catch (err) {
$.error(
`Gist 备份文件校验失败, 无法还原\nReason: ${
err.message ?? err
}`,
);
throw new Error('Gist 备份文件校验失败, 无法还原');
}
}
if (data_url_post) {
$.info('[BACKEND] executing post-processing script');
eval(data_url_post);
}
.then((content) => {
$.write(content, '#sub-store');
$.write(JSON.stringify(content, null, ` `), '#sub-store');
$.cache = content;
$.cache = JSON.parse(content);
$.persistCache();
migrate();

View File

@@ -1,5 +1,3 @@
import { Base64 } from 'js-base64';
import _ from 'lodash';
import $ from '@/core/app';
import { ENV } from '@/vendor/open-api';
import { failed, success } from '@/restful/response';
@@ -16,7 +14,6 @@ import { InternalServerError, RequestInvalidError } from '@/restful/errors';
import Gist from '@/utils/gist';
import migrate from '@/utils/migration';
import env from '@/utils/env';
import { formatDateTime } from '@/utils';
export default function register($app) {
// utils
@@ -31,7 +28,16 @@ export default function register($app) {
.set(
'content-disposition',
`attachment; filename="${encodeURIComponent(
`sub-store_data_${formatDateTime(new Date())}.json`,
`sub-store_data_${new Date()
.toLocaleString('zh-CN', {
year: 'numeric',
day: 'numeric',
month: 'numeric',
hour: 'numeric',
minute: 'numeric',
second: 'numeric',
})
.replace(/\D/g, '')}.json`,
)}"`,
)
.send(
@@ -41,47 +47,21 @@ export default function register($app) {
);
})
.post((req, res) => {
let { content } = req.body;
try {
content = JSON.parse(Base64.decode(content));
if (Object.keys(content.settings).length === 0) {
throw new Error('备份文件应该至少包含 settings 字段');
}
} catch (err) {
try {
content = JSON.parse(content);
if (Object.keys(content.settings).length === 0) {
throw new Error('备份文件应该至少包含 settings 字段');
}
} catch (err) {
$.error(
`备份文件校验失败, 无法还原\nReason: ${
err.message ?? err
}`,
);
throw new Error('备份文件校验失败, 无法还原');
}
}
$.write(JSON.stringify(content, null, ` `), '#sub-store');
const { content } = req.body;
$.write(content, '#sub-store');
if ($.env.isNode) {
$.cache = content;
$.cache = JSON.parse(content);
$.persistCache();
}
migrate();
success(res);
});
if (ENV().isNode) {
$app.get('/', getEnv);
} else {
// Redirect sub.store to vercel webpage
$app.get('/', async (req, res) => {
// 302 redirect
res.set('location', 'https://sub-store.vercel.app/')
.status(302)
.end();
});
}
// Redirect sub.store to vercel webpage
$app.get('/', async (req, res) => {
// 302 redirect
res.set('location', 'https://sub-store.vercel.app/').status(302).end();
});
// handle preflight request for QX
if (ENV().isQX) {
@@ -99,19 +79,7 @@ function getEnv(req, res) {
if (req.query.share) {
env.feature.share = true;
}
res.set('Content-Type', 'application/json;charset=UTF-8').send(
JSON.stringify(
{
status: 'success',
data: {
guide: '⚠️⚠️⚠️ 您当前看到的是后端的响应. 若想配合前端使用, 可访问官方前端 https://sub-store.vercel.app 后自行配置后端地址, 或一键配置后端 https://sub-store.vercel.app?api=https://a.com/xxx (假设 https://a.com 是你后端的域名, /xxx 是自定义路径). 需注意 HTTPS 前端无法请求非本地的 HTTP 后端(部分浏览器上也无法访问本地 HTTP 后端). 请配置反代或在局域网自建 HTTP 前端. 如果还有问题, 可查看此排查说明: https://t.me/zhetengsha/1068',
...env,
},
},
null,
2,
),
);
success(res, env);
}
async function refresh(_, res) {
@@ -126,7 +94,7 @@ async function refresh(_, res) {
success(res);
}
async function gistBackupAction(action, keep, encode) {
async function gistBackupAction(action) {
// read token
const { gistToken, syncPlatform } = $.read(SETTINGS_KEY);
if (!gistToken) throw new Error('GitHub Token is required for backup!');
@@ -136,9 +104,6 @@ async function gistBackupAction(action, keep, encode) {
key: GIST_BACKUP_KEY,
syncPlatform,
});
let currentContent = $.read('#sub-store');
currentContent = currentContent ? JSON.parse(currentContent) : {};
if ($.env.isNode) currentContent = JSON.parse(JSON.stringify($.cache));
let content;
const settings = $.read(SETTINGS_KEY);
const updated = settings.syncTime;
@@ -146,18 +111,7 @@ async function gistBackupAction(action, keep, encode) {
case 'upload':
try {
content = $.read('#sub-store');
content = content ? JSON.parse(content) : {};
if ($.env.isNode) content = JSON.parse(JSON.stringify($.cache));
if (encode === 'plaintext') {
content.settings.gistToken =
'恢复后请重新设置 GitHub Token';
content = JSON.stringify(content, null, ` `);
} else {
content = Base64.encode(
JSON.stringify(content, null, ` `),
);
}
if ($.env.isNode) content = JSON.stringify($.cache, null, ` `);
$.info(`下载备份, 与本地内容对比...`);
const onlineContent = await gist.download(
GIST_BACKUP_FILE_NAME,
@@ -174,14 +128,7 @@ async function gistBackupAction(action, keep, encode) {
settings.syncTime = new Date().getTime();
$.write(settings, SETTINGS_KEY);
content = $.read('#sub-store');
content = content ? JSON.parse(content) : {};
if ($.env.isNode) content = JSON.parse(JSON.stringify($.cache));
if (encode === 'plaintext') {
content.settings.gistToken = '恢复后请重新设置 GitHub Token';
content = JSON.stringify(content, null, ` `);
} else {
content = Base64.encode(JSON.stringify(content, null, ` `));
}
if ($.env.isNode) content = JSON.stringify($.cache, null, ` `);
$.info(`上传备份中...`);
try {
await gist.upload({
@@ -199,34 +146,21 @@ async function gistBackupAction(action, keep, encode) {
$.info(`还原备份中...`);
content = await gist.download(GIST_BACKUP_FILE_NAME);
try {
content = JSON.parse(Base64.decode(content));
if (Object.keys(content.settings).length === 0) {
if (Object.keys(JSON.parse(content).settings).length === 0) {
throw new Error('备份文件应该至少包含 settings 字段');
}
} catch (err) {
try {
content = JSON.parse(content);
if (Object.keys(content.settings).length === 0) {
throw new Error('备份文件应该至少包含 settings 字段');
}
} catch (err) {
$.error(
`Gist 备份文件校验失败, 无法还原\nReason: ${
err.message ?? err
}`,
);
throw new Error('Gist 备份文件校验失败, 无法还原');
}
}
if (keep) {
$.info(`保留原有设置 ${keep}`);
keep.split(',').forEach((path) => {
_.set(content, path, _.get(currentContent, path));
});
$.error(
`Gist 备份文件校验失败, 无法还原\nReason: ${
err.message ?? err
}`,
);
throw new Error('Gist 备份文件校验失败, 无法还原');
}
// restore settings
$.write(JSON.stringify(content, null, ` `), '#sub-store');
$.write(content, '#sub-store');
if ($.env.isNode) {
content = JSON.parse(content);
$.cache = content;
$.persistCache();
}
@@ -238,7 +172,7 @@ async function gistBackupAction(action, keep, encode) {
}
}
async function gistBackup(req, res) {
const { action, keep, encode } = req.query;
const { action } = req.query;
// read token
const { gistToken } = $.read(SETTINGS_KEY);
if (!gistToken) {
@@ -251,7 +185,7 @@ async function gistBackup(req, res) {
);
} else {
try {
await gistBackupAction(action, keep, encode);
await gistBackupAction(action);
success(res);
} catch (err) {
$.error(

View File

@@ -43,6 +43,7 @@ function createModule(req, res) {
function getModule(req, res) {
let { name } = req.params;
name = decodeURIComponent(name);
const allModules = $.read(MODULES_KEY);
const module = findByName(allModules, name);
if (module) {
@@ -63,6 +64,7 @@ function getModule(req, res) {
function updateModule(req, res) {
let { name } = req.params;
name = decodeURIComponent(name);
let module = req.body;
const allModules = $.read(MODULES_KEY);
const oldModule = findByName(allModules, name);
@@ -90,6 +92,7 @@ function updateModule(req, res) {
function deleteModule(req, res) {
let { name } = req.params;
name = decodeURIComponent(name);
$.info(`正在删除模块:${name}`);
let allModules = $.read(MODULES_KEY);
deleteByName(allModules, name);

View File

@@ -47,22 +47,15 @@ async function previewFile(req, res) {
}),
);
if (Object.keys(errors).length > 0) {
if (!file.ignoreFailedRemoteFile) {
throw new Error(
`文件 ${file.name} 的远程文件 ${Object.keys(
errors,
).join(', ')} 发生错误, 请查看日志`,
);
} else if (file.ignoreFailedRemoteFile === 'enabled') {
$.notify(
`🌍 Sub-Store 预览文件失败`,
`${file.name}`,
`远程文件 ${Object.keys(errors).join(
', ',
)} 发生错误, 请查看日志`,
);
}
if (
!file.ignoreFailedRemoteFile &&
Object.keys(errors).length > 0
) {
throw new Error(
`文件 ${file.name} 的远程文件 ${Object.keys(
errors,
).join(', ')} 发生错误, 请查看日志`,
);
}
if (file.mergeSources === 'localFirst') {
content.unshift(file.content);
@@ -143,22 +136,12 @@ async function compareSub(req, res) {
}),
);
if (Object.keys(errors).length > 0) {
if (!sub.ignoreFailedRemoteSub) {
throw new Error(
`订阅 ${sub.name} 的远程订阅 ${Object.keys(errors).join(
', ',
)} 发生错误, 请查看日志`,
);
} else if (sub.ignoreFailedRemoteSub === 'enabled') {
$.notify(
`🌍 Sub-Store 预览订阅失败`,
`${sub.name}`,
`远程订阅 ${Object.keys(errors).join(
', ',
)} 发生错误, 请查看日志`,
);
}
if (!sub.ignoreFailedRemoteSub && Object.keys(errors).length > 0) {
throw new Error(
`订阅 ${sub.name} 的远程订阅 ${Object.keys(errors).join(
', ',
)} 发生错误, 请查看日志`,
);
}
if (sub.mergeSources === 'localFirst') {
content.unshift(sub.content);
@@ -261,25 +244,15 @@ async function compareCollection(req, res) {
}
}),
);
if (Object.keys(errors).length > 0) {
if (!sub.ignoreFailedRemoteSub) {
throw new Error(
`订阅 ${sub.name} 的远程订阅 ${Object.keys(
errors,
).join(', ')} 发生错误, 请查看日志`,
);
} else if (
sub.ignoreFailedRemoteSub === 'enabled'
) {
$.notify(
`🌍 Sub-Store 预览订阅失败`,
`${sub.name}`,
`远程订阅 ${Object.keys(errors).join(
', ',
)} 发生错误, 请查看日志`,
);
}
if (
!sub.ignoreFailedRemoteSub &&
Object.keys(errors).length > 0
) {
throw new Error(
`订阅 ${sub.name} 的远程订阅 ${Object.keys(
errors,
).join(', ')} 发生错误, 请查看日志`,
);
}
if (sub.mergeSources === 'localFirst') {
raw.unshift(sub.content);
@@ -311,28 +284,20 @@ async function compareCollection(req, res) {
errors[name] = err;
$.error(
`❌ 处理组合订阅 ${collection.name} 中的子订阅: ${sub.name} 时出现错误:${err}`,
`❌ 处理组合订阅 ${collection.name} 中的子订阅: ${sub.name}时出现错误:${err}`,
);
}
}),
);
if (Object.keys(errors).length > 0) {
if (!collection.ignoreFailedRemoteSub) {
throw new Error(
`组合订阅 ${collection.name} 的子订阅 ${Object.keys(
errors,
).join(', ')} 发生错误, 请查看日志`,
);
} else if (collection.ignoreFailedRemoteSub === 'enabled') {
$.notify(
`🌍 Sub-Store 预览组合订阅失败`,
`${collection.name}`,
`子订阅 ${Object.keys(errors).join(
', ',
)} 发生错误, 请查看日志`,
);
}
if (
!collection.ignoreFailedRemoteSub &&
Object.keys(errors).length > 0
) {
throw new Error(
`组合订阅 ${collection.name} 中的子订阅 ${Object.keys(
errors,
).join(', ')} 发生错误, 请查看日志`,
);
}
// merge proxies with the original order
const original = Array.prototype.concat.apply(

View File

@@ -12,9 +12,7 @@ export function failed(resp, error, statusCode) {
code: error.code,
type: error.type,
message: error.message,
details: resp.req?.route?.path?.startsWith('/share/')
? '详情请查看日志'
: error.details,
details: error.details,
},
});
}

View File

@@ -61,7 +61,7 @@ async function updateSettings(req, res) {
export async function updateAvatar() {
const settings = $.read(SETTINGS_KEY);
const { githubUser: username, syncPlatform, githubProxy } = settings;
const { githubUser: username, syncPlatform } = settings;
if (username) {
if (syncPlatform === 'gitlab') {
try {
@@ -92,9 +92,7 @@ export async function updateAvatar() {
try {
const data = await $.http
.get({
url: `${
githubProxy ? `${githubProxy}/` : ''
}https://api.github.com/users/${encodeURIComponent(
url: `https://api.github.com/users/${encodeURIComponent(
username,
)}`,
headers: {
@@ -136,15 +134,11 @@ export async function updateArtifactStore() {
settings.artifactStore = url;
settings.artifactStoreStatus = 'VALID';
} else {
$.error(`找不到 Sub-Store Gist (${ARTIFACT_REPOSITORY_KEY})`);
$.error(`找不到 Sub-Store Gist`);
settings.artifactStoreStatus = 'NOT FOUND';
}
} catch (err) {
$.error(
`查找 Sub-Store Gist (${ARTIFACT_REPOSITORY_KEY}) 时发生错误: ${
err.message ?? err
}`,
);
$.error(`查找 Sub-Store Gist 时发生错误: ${err.message ?? err}`);
settings.artifactStoreStatus = 'ERROR';
}
$.write(settings, SETTINGS_KEY);

View File

@@ -5,12 +5,7 @@ import {
RequestInvalidError,
} from './errors';
import { deleteByName, findByName, updateByName } from '@/utils/database';
import {
SUBS_KEY,
COLLECTIONS_KEY,
ARTIFACTS_KEY,
FILES_KEY,
} from '@/constants';
import { SUBS_KEY, COLLECTIONS_KEY, ARTIFACTS_KEY } from '@/constants';
import {
getFlowHeaders,
parseFlowHeaders,
@@ -18,7 +13,6 @@ import {
} from '@/utils/flow';
import { success, failed } from './response';
import $ from '@/core/app';
import { formatDateTime } from '@/utils';
if (!$.read(SUBS_KEY)) $.write({}, SUBS_KEY);
@@ -39,8 +33,10 @@ export default function register($app) {
// subscriptions API
async function getFlowInfo(req, res) {
let { name } = req.params;
name = decodeURIComponent(name);
let { url } = req.query;
if (url) {
url = decodeURIComponent(url);
$.info(`指定远程订阅 URL: ${url}`);
}
const allSubs = $.read(SUBS_KEY);
@@ -138,7 +134,7 @@ async function getFlowInfo(req, res) {
}
}
}
if ($arguments.noFlow || !/^https?/.test(url)) {
if ($arguments.noFlow) {
failed(
res,
new RequestInvalidError(
@@ -230,7 +226,6 @@ async function getFlowInfo(req, res) {
function createSubscription(req, res) {
const sub = req.body;
delete sub.subscriptions;
$.info(`正在创建订阅: ${sub.name}`);
if (/\//.test(sub.name)) {
failed(
@@ -261,18 +256,25 @@ function createSubscription(req, res) {
function getSubscription(req, res) {
let { name } = req.params;
let { raw } = req.query;
name = decodeURIComponent(name);
const allSubs = $.read(SUBS_KEY);
const sub = findByName(allSubs, name);
delete sub.subscriptions;
if (sub) {
if (raw) {
res.set('content-type', 'application/json')
.set(
'content-disposition',
`attachment; filename="${encodeURIComponent(
`sub-store_subscription_${name}_${formatDateTime(
new Date(),
)}.json`,
`sub-store_subscription_${name}_${new Date()
.toLocaleString('zh-CN', {
year: 'numeric',
day: 'numeric',
month: 'numeric',
hour: 'numeric',
minute: 'numeric',
second: 'numeric',
})
.replace(/\D/g, '')}.json`,
)}"`,
)
.send(JSON.stringify(sub));
@@ -293,8 +295,8 @@ function getSubscription(req, res) {
function updateSubscription(req, res) {
let { name } = req.params;
name = decodeURIComponent(name); // the original name
let sub = req.body;
delete sub.subscriptions;
const allSubs = $.read(SUBS_KEY);
const oldSub = findByName(allSubs, name);
if (oldSub) {
@@ -324,20 +326,9 @@ function updateSubscription(req, res) {
artifact.source = sub.name;
}
}
// update all files referring this subscription
const allFiles = $.read(FILES_KEY) || [];
for (const file of allFiles) {
if (
file.sourceType === 'subscription' &&
file.sourceName == name
) {
file.sourceName = sub.name;
}
}
$.write(allCols, COLLECTIONS_KEY);
$.write(allArtifacts, ARTIFACTS_KEY);
$.write(allFiles, FILES_KEY);
}
updateByName(allSubs, name, newSub);
$.write(allSubs, SUBS_KEY);
@@ -356,6 +347,7 @@ function updateSubscription(req, res) {
function deleteSubscription(req, res) {
let { name } = req.params;
name = decodeURIComponent(name);
$.info(`删除订阅:${name}...`);
// delete from subscriptions
let allSubs = $.read(SUBS_KEY);

View File

@@ -40,7 +40,6 @@ async function produceArtifact({
$options,
proxy,
noCache,
all,
}) {
platform = platform || 'JSON';
@@ -90,23 +89,12 @@ async function produceArtifact({
if (ignoreFailedRemoteSub != null && ignoreFailedRemoteSub !== '') {
subIgnoreFailedRemoteSub = ignoreFailedRemoteSub;
}
if (Object.keys(errors).length > 0) {
if (!subIgnoreFailedRemoteSub) {
throw new Error(
`订阅 ${sub.name} 的远程订阅 ${Object.keys(errors).join(
', ',
)} 发生错误, 请查看日志`,
);
} else if (subIgnoreFailedRemoteSub === 'enabled') {
$.notify(
`🌍 Sub-Store 处理订阅失败`,
`${sub.name}`,
`远程订阅 ${Object.keys(errors).join(
', ',
)} 发生错误, 请查看日志`,
);
}
if (!subIgnoreFailedRemoteSub && Object.keys(errors).length > 0) {
throw new Error(
`订阅 ${sub.name} 的远程订阅 ${Object.keys(errors).join(
', ',
)} 发生错误, 请查看日志`,
);
}
if (mergeSources === 'localFirst') {
raw.unshift(content);
@@ -150,23 +138,12 @@ async function produceArtifact({
if (ignoreFailedRemoteSub != null && ignoreFailedRemoteSub !== '') {
subIgnoreFailedRemoteSub = ignoreFailedRemoteSub;
}
if (Object.keys(errors).length > 0) {
if (!subIgnoreFailedRemoteSub) {
throw new Error(
`订阅 ${sub.name} 的远程订阅 ${Object.keys(errors).join(
', ',
)} 发生错误, 请查看日志`,
);
} else if (subIgnoreFailedRemoteSub === 'enabled') {
$.notify(
`🌍 Sub-Store 处理订阅失败`,
`${sub.name}`,
`远程订阅 ${Object.keys(errors).join(
', ',
)} 发生错误, 请查看日志`,
);
}
if (!subIgnoreFailedRemoteSub && Object.keys(errors).length > 0) {
throw new Error(
`订阅 ${sub.name} 的远程订阅 ${Object.keys(errors).join(
', ',
)} 发生错误, 请查看日志`,
);
}
if (sub.mergeSources === 'localFirst') {
raw.unshift(sub.content);
@@ -174,9 +151,6 @@ async function produceArtifact({
raw.push(sub.content);
}
}
if (produceType === 'raw') {
return JSON.stringify((Array.isArray(raw) ? raw : [raw]).flat());
}
// parse proxies
let proxies = (Array.isArray(raw) ? raw : [raw])
.map((i) => ProxyUtils.parse(i))
@@ -290,25 +264,15 @@ async function produceArtifact({
}
}),
);
if (Object.keys(errors).length > 0) {
if (!sub.ignoreFailedRemoteSub) {
throw new Error(
`订阅 ${sub.name} 的远程订阅 ${Object.keys(
errors,
).join(', ')} 发生错误, 请查看日志`,
);
} else if (
sub.ignoreFailedRemoteSub === 'enabled'
) {
$.notify(
`🌍 Sub-Store 处理订阅失败`,
`${sub.name}`,
`远程订阅 ${Object.keys(errors).join(
', ',
)} 发生错误, 请查看日志`,
);
}
if (
!sub.ignoreFailedRemoteSub &&
Object.keys(errors).length > 0
) {
throw new Error(
`订阅 ${sub.name} 的远程订阅 ${Object.keys(
errors,
).join(', ')} 发生错误, 请查看日志`,
);
}
if (sub.mergeSources === 'localFirst') {
raw.unshift(sub.content);
@@ -363,23 +327,15 @@ async function produceArtifact({
if (ignoreFailedRemoteSub != null && ignoreFailedRemoteSub !== '') {
collectionIgnoreFailedRemoteSub = ignoreFailedRemoteSub;
}
if (Object.keys(errors).length > 0) {
if (!collectionIgnoreFailedRemoteSub) {
throw new Error(
`组合订阅 ${collection.name} 的子订阅 ${Object.keys(
errors,
).join(', ')} 发生错误, 请查看日志`,
);
} else if (collectionIgnoreFailedRemoteSub === 'enabled') {
$.notify(
`🌍 Sub-Store 处理组合订阅失败`,
`${collection.name}`,
`子订阅 ${Object.keys(errors).join(
', ',
)} 发生错误, 请查看日志`,
);
}
if (
!collectionIgnoreFailedRemoteSub &&
Object.keys(errors).length > 0
) {
throw new Error(
`组合订阅 ${name} 中的子订阅 ${Object.keys(errors).join(
', ',
)} 发生错误, 请查看日志`,
);
}
// merge proxies with the original order
@@ -549,23 +505,15 @@ async function produceArtifact({
) {
fileIgnoreFailedRemoteFile = ignoreFailedRemoteFile;
}
if (Object.keys(errors).length > 0) {
if (!fileIgnoreFailedRemoteFile) {
throw new Error(
`文件 ${file.name} 的远程文件 ${Object.keys(
errors,
).join(', ')} 发生错误, 请查看日志`,
);
} else if (fileIgnoreFailedRemoteFile === 'enabled') {
$.notify(
`🌍 Sub-Store 处理文件失败`,
`${file.name}`,
`远程文件 ${Object.keys(errors).join(
', ',
)} 发生错误, 请查看日志`,
);
}
if (
!fileIgnoreFailedRemoteFile &&
Object.keys(errors).length > 0
) {
throw new Error(
`文件 ${file.name} 的远程文件 ${Object.keys(
errors,
).join(', ')} 发生错误, 请查看日志`,
);
}
if (file.mergeSources === 'localFirst') {
raw.unshift(file.content);
@@ -574,9 +522,6 @@ async function produceArtifact({
}
}
}
if (produceType === 'raw') {
return JSON.stringify((Array.isArray(raw) ? raw : [raw]).flat());
}
const files = (Array.isArray(raw) ? raw : [raw]).flat();
let filesContent = files
.filter((i) => i != null && i !== '')
@@ -596,7 +541,7 @@ async function produceArtifact({
)
: { $content: filesContent, $files: files, $options };
return (all ? processed : processed?.$content) ?? '';
return processed?.$content ?? '';
}
}
@@ -611,10 +556,8 @@ async function syncArtifacts() {
const allSubs = $.read(SUBS_KEY);
const allCols = $.read(COLLECTIONS_KEY);
const subNames = [];
let enabledCount = 0;
allArtifacts.map((artifact) => {
if (artifact.sync && artifact.source) {
enabledCount++;
if (artifact.type === 'subscription') {
const subName = artifact.source;
const sub = findByName(allSubs, subName);
@@ -635,13 +578,6 @@ async function syncArtifacts() {
}
});
if (enabledCount === 0) {
$.info(
`需同步的配置: ${enabledCount}, 总数: ${allArtifacts.length}`,
);
return;
}
if (subNames.length > 0) {
await Promise.all(
subNames.map(async (subName) => {
@@ -792,6 +728,7 @@ async function syncAllArtifacts(_, res) {
async function syncArtifact(req, res) {
let { name } = req.params;
name = decodeURIComponent(name);
$.info(`开始同步远程配置 ${name}...`);
const allArtifacts = $.read(ARTIFACTS_KEY);
const artifact = findByName(allArtifacts, name);

View File

@@ -17,6 +17,7 @@ export default function register($app) {
function deleteToken(req, res) {
let { token } = req.params;
token = decodeURIComponent(token);
$.info(`正在删除:${token}`);
let allTokens = $.read(TOKENS_KEY);
deleteByName(allTokens, token, 'token');
@@ -52,16 +53,6 @@ async function signToken(req, res) {
try {
const { payload, options } = req.body;
const ms = eval(`require("ms")`);
const type = payload?.type;
const name = payload?.name;
if (!type || !name)
return failed(
res,
new RequestInvalidError(
'INVALID_PAYLOAD',
`payload type and name are required`,
),
);
let token = payload?.token;
if (token != null) {
if (typeof token !== 'string' || token.length < 1) {
@@ -74,12 +65,7 @@ async function signToken(req, res) {
);
}
const tokens = $.read(TOKENS_KEY) || [];
if (
tokens.find(
(t) =>
t.token === token && t.type === type && t.name === name,
)
) {
if (tokens.find((t) => t.token === token)) {
return failed(
res,
new RequestInvalidError(
@@ -89,7 +75,16 @@ async function signToken(req, res) {
);
}
}
const type = payload?.type;
const name = payload?.name;
if (!type || !name)
return failed(
res,
new RequestInvalidError(
'INVALID_PAYLOAD',
`payload type and name are required`,
),
);
if (type === 'col') {
const collections = $.read(COLLECTIONS_KEY) || [];
const collection = collections.find((c) => c.name === name);
@@ -158,12 +153,7 @@ async function signToken(req, res) {
if (!token) {
do {
token = nanoid.customAlphabet(nanoid.urlAlphabet)();
} while (
tokens.find(
(t) =>
t.token === token && t.type === type && t.name === name,
)
);
} while (tokens.find((t) => t.token === token));
}
tokens.push({
...payload,

View File

@@ -1,4 +1,4 @@
import { SETTINGS_KEY, FILES_KEY, MODULES_KEY } from '@/constants';
import { SETTINGS_KEY } from '@/constants';
import { HTTP, ENV } from '@/vendor/open-api';
import { hex_md5 } from '@/vendor/md5';
import { getPolicyDescriptor } from '@/utils';
@@ -11,11 +11,7 @@ import {
validCheck,
} from '@/utils/flow';
import $ from '@/core/app';
import { findByName } from '@/utils/database';
import { produceArtifact } from '@/restful/sync';
import PROXY_PREPROCESSORS from '@/core/proxy-utils/preprocessors';
import { ProxyUtils } from '@/core/proxy-utils';
const clashPreprocessor = PROXY_PREPROCESSORS.find(
(processor) => processor.name === 'Clash Pre-processor',
);
@@ -134,53 +130,22 @@ export default async function download(
}
}
const downloadUrlMatch = url
.split('#')[0]
.match(/^\/api\/(file|module)\/(.+)/);
if (downloadUrlMatch) {
let type = '';
try {
type = downloadUrlMatch?.[1];
let name = downloadUrlMatch?.[2];
if (name == null) {
throw new Error(`本地 ${type} URL 无效: ${url}`);
}
name = decodeURIComponent(name);
const key = type === 'module' ? MODULES_KEY : FILES_KEY;
const item = findByName($.read(key), name);
if (!item) {
throw new Error(`找不到 ${type}: ${name}`);
}
// const downloadUrlMatch = url.match(/^\/api\/(file|module)\/(.+)/);
// if (downloadUrlMatch) {
// let type = downloadUrlMatch?.[1];
// let name = downloadUrlMatch?.[2];
// if (name == null) {
// throw new Error(`本地 ${type} URL 无效: ${url}`);
// }
// name = decodeURIComponent(name);
// const key = type === 'module' ? MODULES_KEY : FILES_KEY;
// const item = findByName($.read(key), name);
// if (!item) {
// throw new Error(`找不到本地 ${type}: ${name}`);
// }
if (type === 'module') {
return item.content;
} else {
return await produceArtifact({
type: 'file',
name,
});
}
} catch (err) {
$.error(
`Error when loading ${type}: ${
url.split('#')[0]
}.\n Reason: ${err}`,
);
throw new Error(`无法加载 ${type}: ${url}`);
}
} else if (url?.startsWith('/')) {
try {
const fs = eval(`require("fs")`);
return fs.readFileSync(url.split('#')[0], 'utf8');
} catch (err) {
$.error(
`Error when reading local file: ${
url.split('#')[0]
}.\n Reason: ${err}`,
);
throw new Error(`无法从该路径读取文本内容: ${url}`);
}
}
// return item.content;
// }
if (!isNode && tasks.has(id)) {
return tasks.get(id);
@@ -260,20 +225,6 @@ export default async function download(
shouldCache = false;
}
}
if (preprocess) {
try {
const proxies = ProxyUtils.parse(body);
if (!Array.isArray(proxies) || proxies.length === 0) {
$.error(`URL ${url} 不包含有效节点, 不缓存`);
shouldCache = false;
}
} catch (e) {
$.error(
`URL ${url} 尝试解析节点失败 ${e.message ?? e}, 不缓存`,
);
shouldCache = false;
}
}
if (shouldCache) {
resourceCache.set(id, body);
if (customCacheKey) {
@@ -322,25 +273,3 @@ export default async function download(
}
return result;
}
export async function downloadFile(url, file) {
const undici = eval("require('undici')");
const fs = eval("require('fs')");
const { pipeline } = eval("require('stream/promises')");
const { Agent, interceptors, request } = undici;
$.info(`Downloading file...\nURL: ${url}\nFile: ${file}`);
const { body, statusCode } = await request(url, {
dispatcher: new Agent().compose(
interceptors.redirect({
maxRedirections: 3,
throwOnRedirect: true,
}),
),
});
if (statusCode !== 200)
throw new Error(`Failed to download file from ${url}`);
const fileStream = fs.createWriteStream(file);
await pipeline(body, fileStream);
$.info(`File downloaded from ${url} to ${file}`);
return file;
}

View File

@@ -49,7 +49,7 @@ export async function getFlowHeaders(
}
}
}
if ($arguments?.noFlow || !/^https?/.test(url)) {
if ($arguments?.noFlow) {
return;
}
const { isStash, isLoon, isShadowRocket, isQX } = ENV();
@@ -230,7 +230,7 @@ export function flowTransfer(flow, unit = 'B') {
let unitIndex = unitList.indexOf(unit);
return flow < 1024 || unitIndex === unitList.length - 1
? { value: (Math.round(flow * 100) / 100).toString(), unit: unit }
? { value: flow.toFixed(1), unit: unit }
: flowTransfer(flow / 1024, unitList[++unitIndex]);
}
@@ -334,28 +334,7 @@ export function normalizeFlowHeader(flowHeaders) {
if (!kvMap.has(key)) {
try {
// 解码 URI 组件并保留原始值作为 fallback
let decodedValue = decodeURIComponent(encodedValue);
if (
['upload', 'download', 'total', 'expire'].includes(
key,
)
) {
try {
decodedValue = Number(decodedValue).toFixed(0);
if (
['expire'].includes(key) &&
decodedValue <= 0
) {
decodedValue = '';
}
} catch (e) {
$.error(
`Failed to convert value for key "${key}=${encodedValue}": ${
e.message ?? e
}`,
);
}
}
const decodedValue = decodeURIComponent(encodedValue);
kvMap.set(key, decodedValue);
} catch (e) {
kvMap.set(key, encodedValue);

View File

@@ -46,7 +46,6 @@ const ISOFlags = {
'🇭🇰': ['HK', 'HKG', 'HKT', 'HKBN', 'HGC', 'WTT', 'CMI'],
'🇭🇷': ['HR', 'HRV'],
'🇭🇺': ['HU', 'HUN'],
'🇮🇶': ['IQ', 'IRQ'], // 伊拉克
'🇯🇴': ['JO', 'JOR'],
'🇯🇵': ['JP', 'JPN', 'TYO'],
'🇰🇪': ['KE', 'KEN'],
@@ -100,7 +99,6 @@ const ISOFlags = {
'🇸🇬': ['SG', 'SGP'],
'🇸🇮': ['SI', 'SVN'],
'🇸🇰': ['SK', 'SVK'],
'🇹🇬': ['TG', 'TGO'], // 多哥
'🇹🇭': ['TH', 'THA'],
'🇹🇳': ['TN', 'TUN'],
'🇹🇷': ['TR', 'TUR'],
@@ -222,7 +220,6 @@ export function getFlag(name) {
],
'🇭🇷': ['Croatia', '克罗地亚', '克羅地亞'],
'🇭🇺': ['Hungary', '匈牙利'],
'🇮🇶': ['Iraq', '伊拉克', '巴格达', 'Baghdad'], // 伊拉克
'🇯🇴': ['Jordan', '约旦'],
'🇯🇵': [
'Japan',
@@ -341,7 +338,6 @@ export function getFlag(name) {
],
'🇸🇮': ['Slovenia', '斯洛文尼亚'],
'🇸🇰': ['Slovakia', '斯洛伐克'],
'🇹🇬': ['Togo', '多哥', '洛美', 'Lomé', 'Lome'], // 多哥
'🇹🇭': ['Thailand', '泰国', '泰國', '曼谷'],
'🇹🇳': ['Tunisia', '突尼斯'],
'🇹🇷': ['Turkey', '土耳其', '伊斯坦布尔', 'Istanbul'],

View File

@@ -9,11 +9,7 @@ import { SETTINGS_KEY } from '@/constants';
export default class Gist {
constructor({ token, key, syncPlatform }) {
const { isStash, isLoon, isShadowRocket, isQX } = ENV();
const {
defaultProxy,
defaultTimeout: timeout,
githubProxy,
} = $.read(SETTINGS_KEY);
const { defaultProxy, defaultTimeout: timeout } = $.read(SETTINGS_KEY);
let proxy = defaultProxy;
if ($.env.isNode) {
proxy =
@@ -67,9 +63,7 @@ export default class Gist {
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.141 Safari/537.36',
};
this.http = HTTP({
baseURL: `${
githubProxy ? `${githubProxy}/` : ''
}https://api.github.com`,
baseURL: 'https://api.github.com',
headers: {
...this.headers,
...(isStash && proxy
@@ -286,7 +280,7 @@ export default class Gist {
return Promise.reject(err);
}
} else {
return Promise.reject(`找不到 Sub-Store Gist (${this.key})`);
return Promise.reject('找不到 Sub-Store Gist');
}
}
}

View File

@@ -126,32 +126,7 @@ function isValidUUID(uuid) {
);
}
function formatDateTime(date, format = 'YYYY-MM-DD_HH-mm-ss') {
const d = date instanceof Date ? date : new Date(date);
if (isNaN(d.getTime())) {
return '';
}
const pad = (num) => String(num).padStart(2, '0');
const replacements = {
YYYY: d.getFullYear(),
MM: pad(d.getMonth() + 1),
DD: pad(d.getDate()),
HH: pad(d.getHours()),
mm: pad(d.getMinutes()),
ss: pad(d.getSeconds()),
};
return format.replace(
/YYYY|MM|DD|HH|mm|ss/g,
(match) => replacements[match],
);
}
export {
formatDateTime,
isValidUUID,
ipAddress,
isIPv4,

View File

@@ -4,8 +4,6 @@ import {
SCHEMA_VERSION_KEY,
ARTIFACTS_KEY,
RULES_KEY,
FILES_KEY,
TOKENS_KEY,
} from '@/constants';
import $ from '@/core/app';
@@ -57,17 +55,7 @@ function doMigrationV2() {
const newRules = Object.values(rules);
$.write(newRules, RULES_KEY);
// 5. migrate files
const files = $.read(FILES_KEY) || {};
const newFiles = Object.values(files);
$.write(newFiles, FILES_KEY);
// 6. migrate tokens
const tokens = $.read(TOKENS_KEY) || {};
const newTokens = Object.values(tokens);
$.write(newTokens, TOKENS_KEY);
// 7. delete builtin rules
// 5. delete builtin rules
delete $.cache.builtin;
$.info('Migration complete!');

View File

@@ -47,7 +47,7 @@ export function getPlatformFromUserAgent({ ua, UA, accept }) {
return 'Clash';
} else if (ua.indexOf('v2ray') !== -1) {
return 'V2Ray';
} else if (ua.indexOf('sing-box') !== -1 || ua.indexOf('singbox') !== -1) {
} else if (ua.indexOf('sing-box') !== -1) {
return 'sing-box';
} else if (accept.indexOf('application/json') === 0) {
return 'JSON';
@@ -61,41 +61,31 @@ export function getPlatformFromHeaders(headers) {
return getPlatformFromUserAgent({ ua, UA, accept });
}
export function shouldIncludeUnsupportedProxy(platform, ua) {
// try {
// const target = getPlatformFromUserAgent({
// UA: ua,
// ua: ua.toLowerCase(),
// });
// if (!['Stash', 'Egern', 'Loon'].includes(target)) {
// return false;
// }
// const coerceVersion = coerce(ua);
// $.log(JSON.stringify(coerceVersion, null, 2));
// const { version } = coerceVersion;
// if (
// platform === 'Stash' &&
// target === 'Stash' &&
// gte(version, '3.1.0')
// ) {
// return true;
// }
// if (
// platform === 'Egern' &&
// target === 'Egern' &&
// gte(version, '1.29.0')
// ) {
// return true;
// }
// // Loon 的 UA 不规范, version 取出来是 build
// if (
// platform === 'Loon' &&
// target === 'Loon' &&
// gte(version, '842.0.0')
// ) {
// return true;
// }
// } catch (e) {
// $.error(`获取版本号失败: ${e}`);
// }
try {
const target = getPlatformFromUserAgent({
UA: ua,
ua: ua.toLowerCase(),
});
if (!['Stash', 'Egern'].includes(target)) {
return false;
}
const version = coerce(ua).version;
if (
platform === 'Stash' &&
target === 'Stash' &&
gte(version, '2.8.0')
) {
return true;
}
if (
platform === 'Egern' &&
target === 'Egern' &&
gte(version, '1.29.0')
) {
return true;
}
} catch (e) {
$.error(`获取版本号失败: ${e}`);
}
return false;
}

View File

@@ -34,6 +34,4 @@ export default {
load,
safeDump,
dump,
parse: safeLoad,
stringify: safeDump,
};

View File

@@ -17,12 +17,10 @@ export default function express({ substore: $, port, host }) {
const express_ = eval(`require("express")`);
const bodyParser = eval(`require("body-parser")`);
const app = express_();
const limit = eval('process.env.SUB_STORE_BODY_JSON_LIMIT') || '1mb';
$.info(`[BACKEND] body JSON limit: ${limit}`);
app.use(
bodyParser.json({
verify: rawBodySaver,
limit,
limit: eval('process.env.SUB_STORE_BODY_JSON_LIMIT') || '1mb',
}),
);
app.use(
@@ -36,12 +34,9 @@ export default function express({ substore: $, port, host }) {
// adapter
app.start = () => {
app.get('*', function (req, res) {
res.status(404).end();
});
const listener = app.listen(port, host, () => {
const { address, port } = listener.address();
$.info(`[BACKEND] listening on ${address}:${port}`);
$.info(`[BACKEND] ${address}:${port}`);
});
};
return app;
@@ -270,7 +265,7 @@ function extractURL(url) {
let hashes = url.slice(url.indexOf('?') + 1).split('&');
for (let i = 0; i < hashes.length; i++) {
const hash = hashes[i].split('=');
query[hash[0]] = decodeURIComponent(hash[1]);
query[hash[0]] = hash[1];
}
}
return {
@@ -294,7 +289,7 @@ function extractPathParams(pattern, path) {
while (path[j] !== '/' && j < path.length) {
val.push(path[j++]);
}
params[key.join('')] = decodeURIComponent(val.join(''));
params[key.join('')] = val.join('');
} else {
if (pattern[i] !== path[j]) {
return null;

View File

@@ -9,36 +9,7 @@ const isShadowRocket = 'undefined' !== typeof $rocket;
const isEgern = 'object' == typeof egern;
const isLanceX = 'undefined' != typeof $native;
const isGUIforCores = typeof $Plugins !== 'undefined';
import { Base64 } from 'js-base64';
function isPlainObject(obj) {
return (
obj !== null &&
typeof obj === 'object' &&
[null, Object.prototype].includes(Object.getPrototypeOf(obj))
);
}
function parseSocks5Uri(uri) {
// eslint-disable-next-line no-unused-vars
let [__, username, password, server, port, query, name] = uri.match(
/^socks5:\/\/(?:(.*?):(.*?)@)?(.*?)(?::(\d+?))?(\?.*?)?(?:#(.*?))?$/,
);
if (port) {
port = parseInt(port, 10);
} else {
$.error(`port is not present in line: ${uri}`);
throw new Error(`port is not present in line: ${uri}`);
}
return {
type: 5,
host: server,
port,
userId: username != null ? decodeURIComponent(username) : undefined,
password: password != null ? decodeURIComponent(password) : undefined,
};
}
export class OpenAPI {
constructor(name = 'untitled', debug = false) {
this.name = name;
@@ -47,10 +18,6 @@ export class OpenAPI {
this.http = HTTP();
this.env = ENV();
if (isNode) {
const dotenv = eval(`require("dotenv")`);
dotenv.config();
}
this.node = (() => {
if (isNode) {
const fs = eval("require('fs')");
@@ -91,64 +58,29 @@ export class OpenAPI {
const basePath =
eval('process.env.SUB_STORE_DATA_BASE_PATH') || '.';
let rootPath = `${basePath}/root.json`;
const backupRootPath = `${basePath}/root_${Date.now()}.json`;
this.log(`Root path: ${rootPath}`);
if (this.node.fs.existsSync(rootPath)) {
try {
this.root = JSON.parse(
this.node.fs.readFileSync(`${rootPath}`),
);
} catch (e) {
this.node.fs.copyFileSync(rootPath, backupRootPath);
this.error(
`Failed to parse ${rootPath}: ${e.message}. Backup created at ${backupRootPath}`,
);
}
}
if (!isPlainObject(this.root)) {
if (!this.node.fs.existsSync(rootPath)) {
this.node.fs.writeFileSync(rootPath, JSON.stringify({}), {
flag: 'w',
flag: 'wx',
});
this.root = {};
} else {
this.root = JSON.parse(
this.node.fs.readFileSync(`${rootPath}`),
);
}
// create a json file with the given name if not exists
let fpath = `${basePath}/${this.name}.json`;
const backupPath = `${basePath}/${this.name}_${Date.now()}.json`;
this.log(`Data path: ${fpath}`);
if (this.node.fs.existsSync(fpath)) {
try {
this.cache = JSON.parse(
this.node.fs.readFileSync(`${fpath}`, 'utf-8'),
);
if (!isPlainObject(this.cache))
throw new Error('Invalid Data');
} catch (e) {
try {
const str = Base64.decode(
this.node.fs.readFileSync(`${fpath}`, 'utf-8'),
);
this.cache = JSON.parse(str);
this.node.fs.writeFileSync(fpath, str, {
flag: 'w',
});
if (!isPlainObject(this.cache))
throw new Error('Invalid Data');
} catch (e) {
this.node.fs.copyFileSync(fpath, backupPath);
this.error(
`Failed to parse ${fpath}: ${e.message}. Backup created at ${backupPath}`,
);
}
}
}
if (!isPlainObject(this.cache)) {
if (!this.node.fs.existsSync(fpath)) {
this.node.fs.writeFileSync(fpath, JSON.stringify({}), {
flag: 'w',
flag: 'wx',
});
this.cache = {};
} else {
this.cache = JSON.parse(this.node.fs.readFileSync(`${fpath}`));
}
}
}
@@ -428,13 +360,7 @@ export function HTTP(defaultOptions = { baseURL: '' }) {
}
if (isNode) {
const undici = eval("require('undici')");
const { socksDispatcher } = eval("require('fetch-socks')");
const {
ProxyAgent,
EnvHttpProxyAgent,
request,
interceptors,
} = undici;
const { ProxyAgent, EnvHttpProxyAgent, request } = undici;
const agentOpts = {
connect: {
rejectUnauthorized:
@@ -447,50 +373,15 @@ export function HTTP(defaultOptions = { baseURL: '' }) {
headersTimeout: opts.timeout,
};
try {
const url = new URL(opts.url);
if (url.username || url.password) {
opts.headers = {
...(opts.headers || {}),
Authorization: `Basic ${Buffer.from(
`${url.username || ''}:${
url.password || ''
}`,
).toString('base64')}`,
};
}
let dispatcher;
if (!opts.proxy) {
const allProxy =
eval('process.env.all_proxy') ||
eval('process.env.ALL_PROXY');
if (allProxy && /^socks5:\/\//.test(allProxy)) {
opts.proxy = allProxy;
}
}
if (opts.proxy) {
if (/^socks5:\/\//.test(opts.proxy)) {
dispatcher = socksDispatcher(
parseSocks5Uri(opts.proxy),
agentOpts,
);
} else {
dispatcher = new ProxyAgent({
...agentOpts,
uri: opts.proxy,
});
}
} else {
dispatcher = new EnvHttpProxyAgent(agentOpts);
}
const response = await request(opts.url, {
...opts,
method: method.toUpperCase(),
dispatcher: dispatcher.compose(
interceptors.redirect({
maxRedirections: 3,
throwOnMaxRedirects: true,
}),
),
dispatcher: opts.proxy
? new ProxyAgent({
...agentOpts,
uri: opts.proxy,
})
: new EnvHttpProxyAgent(agentOpts),
});
resolve({
statusCode: response.statusCode,
@@ -538,7 +429,6 @@ export function HTTP(defaultOptions = { baseURL: '' }) {
url: options.url,
headers: options.headers,
body: options.body,
autoTransformBody: false,
options: {
Proxy: options.proxy,
Timeout: options.timeout

40
nginx/front.conf Normal file
View File

@@ -0,0 +1,40 @@
upstream api {
server 0.0.0.0:3000;
}
server {
listen 6080;
# allow 127.0.0.1;
# allow 0.0.0.0;
# deny all;
gzip on;
gzip_static on;
gzip_types text/plain application/json application/javascript application/x-javascript text/css application/xml text/javascript;
gzip_proxied any;
gzip_vary on;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.0;
location / {
root /Sub-Store/web/dist;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
location /api {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://api;
}
location /download {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://api;
}
}

View File

@@ -13,22 +13,15 @@ function operator(proxies = [], targetPlatform, context) {
// 5. `_subName` 为单条订阅名, `_subDisplayName` 为单条订阅显示名
// 6. `_collectionName` 为组合订阅名, `_collectionDisplayName` 为组合订阅显示名
// 7. `tls-fingerprint` 为 tls 指纹
// 8. `underlying-proxy` 为前置代理, 不同平台会自动转换
// 例如 $server['underlying-proxy'] = '名称'
// 只给 mihomo 输出的话, `dialer-proxy` 也行
// 只给 sing-box 输出的话, `detour` 也行
// 只给 Egern 输出的话, `prev_hop` 也行
// 只给 Shadowrocket 输出的话, `chain` 也行
// 输出到 Clash/Stash 时, 会过滤掉配置了前置代理的节点, 并提示使用对应的功能.
// 8. `underlying-proxy` 为前置代理
// 9. `trojan`, `tuic`, `hysteria`, `hysteria2`, `juicity` 会在解析时设置 `tls`: true (会使用 tls 类协议的通用逻辑), 输出时删除
// 10. `sni` 在某些协议里会自动与 `servername` 转换
// 11. 读取节点的 ca-str 和 _ca (后端文件路径) 字段, 自动计算 fingerprint (参考 https://t.me/zhetengsha/1512)
// 12. 以 Surge 为例, 最新的参数一般我都会跟进, 以 Surge 文档为例, 一些常用的: TUIC/Hysteria 2 的 `ecn`, Snell 的 `reuse` 连接复用, QUIC 策略 block-quic`, Hysteria 2 下载带宽 `down`
// 13. `test-url` 为测延迟链接, `test-timeout` 为测延迟超时
// 14. `ports` 为端口跳跃, `hop-interval` 变换端口号的时间间隔
// 15. `ip-version` 设置节点使用 IP 版本,兼容各家的值. 会进行内部转换. sing-box 以外: 若无法匹配则使用原始值. sing-box: 需有匹配且节点上设置 `_dns_server` 字段, 将自动设置 `domain_resolver.server`
// 15. `ip-version` 设置节点使用 IP 版本,可选dualipv4ipv6ipv4-preferipv6-prefer. 会进行内部转换, 若无法匹配则使用原始值
// 16. `sing-box` 支持使用 `_network` 来设置 `network`, 例如 `tcp`, `udp`
// 17. `block-quic` 支持 `auto`, `on`, `off`. 不同的平台不一定都支持, 会自动转换
// require 为 Node.js 的 require, 在 Node.js 运行环境下 可以用来引入模块
// 例如在 Node.js 环境下, 将文件内容写入 /tmp/1.txt 文件
@@ -47,27 +40,8 @@ function operator(proxies = [], targetPlatform, context) {
// 先这样处理 encodeURIComponent('arg1=a&arg2=b')
// /api/file/foo?$options=arg1%3Da%26arg2%3Db
// 默认会带上 _req 字段, 结构为
// {
// method,
// url,
// path,
// query,
// params,
// headers,
// body,
// }
// console.log($options)
// 若设置 $options._res.headers
// 则会在输出文件时设置响应头, 例如:
// $options._res = {
// headers: {
// 'X-Custom': '1'
// }
// }
// targetPlatform 为输出的目标平台
// lodash
@@ -105,12 +79,6 @@ function operator(proxies = [], targetPlatform, context) {
// 其他平台同理, 持久化缓存数据在 JSON 里
// 当配合脚本使用时, 可以在脚本的前面添加一个脚本操作, 实现保留 1 小时的缓存. 这样比较灵活
// async function operator() {
// scriptResourceCache._cleanup(undefined, 1 * 3600 * 1000);
// }
// ProxyUtils 为节点处理工具
// 可参考 https://t.me/zhetengsha/1066
// const ProxyUtils = {
@@ -128,14 +96,9 @@ function operator(proxies = [], targetPlatform, context) {
// getISO, // 获取 ISO 3166-1 alpha-2 代码
// Gist, // Gist 类
// download, // 内部的下载方法, 见 backend/src/utils/download.js
// downloadFile, // 下载二进制文件, 见 backend/src/utils/download.js
// MMDB, // Node.js 环境 可用于模拟 Surge/Loon 的 $utils.ipasn, $utils.ipaso, $utils.geoip. 具体见 https://t.me/zhetengsha/1269
// isValidUUID, // 辅助判断是否为有效的 UUID
// Buffer, // https://github.com/feross/buffer
// Base64, // https://github.com/dankogai/js-base64
// JSON5, // https://github.com/json5/json5
// }
// 为兼容 https://github.com/xishang0128/sparkle 的 JavaScript 覆写, 也可以直接使用 `b64d`(Base64 解码), `b64e`(Base64 编码), `Buffer`, `yaml`(简单兼容了下 `yaml.parse` 和 `yaml.stringify`)
// 如果只是为了快速修改或者筛选 可以参考 脚本操作支持节点快捷脚本 https://t.me/zhetengsha/970 和 脚本筛选支持节点快捷脚本 https://t.me/zhetengsha/1009
// ⚠️ 注意: 函数式(即本文件这样的 function operator() {}) 和快捷操作(下面使用 $server) 只能二选一
@@ -151,18 +114,6 @@ function operator(proxies = [], targetPlatform, context) {
// });
// $server.sni = sni
// 示例: 从 config 文件中读取配置项并进行节点操作
// config 的本地内容为
// {
// "reuse": false
// }
// 脚本操作为
// const config = (ProxyUtils.JSON5 || JSON).parse(await produceArtifact({
// type: 'file',
// name: 'config' // 文件名
// }))
// $server.reuse = config.reuse
// 1. Surge 输出 WireGuard 完整配置
// let proxies = await produceArtifact({
@@ -247,14 +198,14 @@ function operator(proxies = [], targetPlatform, context) {
// 这个历史遗留原因, 是有点复杂. 提供一个例子, 用来取当前脚本所在的组合订阅或单条订阅名称
// let name = ''
// for (const [key, value] of Object.entries(context.source)) {
// for (const [key, value] of Object.entries(env.source)) {
// if (!key.startsWith('_')) {
// name = value.displayName || value.name
// break
// }
// }
// if (!name) {
// const collection = context.source._collection
// const collection = env.source._collection
// name = collection.displayName || collection.name
// }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 KiB