Compare commits

...

10 Commits

Author SHA1 Message Date
xream
e61baf69a0 Revert "feat: 脚本操作传入上下文 require (仅对应的环境支持)" 2024-08-31 22:02:42 +08:00
xream
ea7a3d752c doc: demo.js 增加更多字段的说明 2024-08-31 19:31:40 +08:00
xream
eef4fa0751 feat: 脚本操作传入上下文 require (仅对应的环境支持) 2024-08-31 18:48:47 +08:00
xream
84dc0d63f2 Merge pull request #350 from egerndaddy/patch-1
添加 Egern 的模块支持
2024-08-29 13:34:08 +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
7 changed files with 67 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "sub-store",
"version": "2.14.360",
"version": "2.14.367",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
"main": "src/main.js",
"scripts": {

View File

@@ -158,7 +158,7 @@ function URI_SSR() {
for (const item of line) {
let [key, val] = item.split('=');
val = val.trim();
if (val.length > 0) {
if (val.length > 0 && val !== '(null)') {
other_params[key] = val;
}
}
@@ -296,6 +296,11 @@ function URI_VMess() {
? !params.verify_cert
: undefined,
};
if (!proxy['skip-cert-verify'] && isPresent(params.allowInsecure)) {
proxy['skip-cert-verify'] = /(TRUE)|1/i.test(
params.allowInsecure,
);
}
// 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 && proxy.sni) {
proxy.sni = params.sni;

View File

@@ -392,18 +392,23 @@ const DOMAIN_RESOLVERS = {
const id = hex_md5(`CUSTOM:${url}:${domain}:${type}`);
const cached = resourceCache.get(id);
if (!noCache && cached) return cached;
const answerType = type === 'IPv6' ? 'AAAA' : 'A';
const res = await doh({
url,
domain,
type: type === 'IPv6' ? 'AAAA' : 'A',
type: answerType,
timeout,
edns,
});
const { answers } = res;
if (!Array.isArray(answers) || answers.length === 0) {
throw new Error('No answers');
}
const result = answers.map((i) => i?.data).filter((i) => i);
const result = answers
.filter((i) => i?.type === answerType)
.map((i) => i?.data)
.filter((i) => i);
if (result.length === 0) {
throw new Error('No answers');
}

View File

@@ -363,6 +363,11 @@ function socks5(proxy) {
// tfo
result.appendIfPresent(`,tfo=${proxy.tfo}`, 'tfo');
// udp
if (proxy.udp) {
result.append(`,udp=true`);
}
return result.toString();
}

View File

@@ -1,6 +1,6 @@
import { Result } from './utils';
import { Result, isPresent } from './utils';
import Surge_Producer from './surge';
import { isIPv4, isIPv6, isPresent } from '@/utils';
import { isIPv4, isIPv6 } from '@/utils';
import $ from '@/core/app';
const targetPlatform = 'SurgeMac';
@@ -84,6 +84,7 @@ function shadowsocksr(proxy) {
for (const [key, value] of Object.entries({
cipher: '-m',
obfs: '-o',
'obfs-param': '-g',
password: '-k',
port: '-p',
protocol: '-O',
@@ -92,8 +93,10 @@ function shadowsocksr(proxy) {
'local-port': '-l',
'local-address': '-b',
})) {
external_proxy.args.push(value);
external_proxy.args.push(external_proxy[key]);
if (external_proxy[key] != null) {
external_proxy.args.push(value);
external_proxy.args.push(external_proxy[key]);
}
}
return external(external_proxy);

37
config/Egern.yaml Normal file
View File

@@ -0,0 +1,37 @@
name: Sub-Store
description: '支持 Surge 正式版的参数设置功能. 测落地功能 ability: http-client-policy, 同步配置的定时 cronexp: 55 23 * * *'
compat_arguments:
ability: http-client-policy
cronexp: 55 23 * * *
sync: '"Sub-Store Sync"'
timeout: '120'
engine: auto
produce: '"# Sub-Store Produce"'
produce_cronexp: 50 */6 * * *
produce_sub: '"sub1,sub2"'
produce_col: '"col1,col2"'
compat_arguments_desc: '\n1⃣ ability\n\n默认已开启测落地能力\n需要配合脚本操作\n如 https://raw.githubusercontent.com/Keywos/rule/main/cname.js\n填写任意其他值关闭\n\n2⃣ cronexp\n\n同步配置定时任务\n默认为每天 23 点 55 分\n\n定时任务指定时将订阅/文件上传到私有 Gist. 在前端, 叫做 ''同步'' 或 ''同步配置''\n\n3⃣ sync\n\n自定义定时任务名\n便于在脚本编辑器中选择\n若设为 # 可取消定时任务\n\n4⃣ timeout\n\n脚本超时, 单位为秒\n\n5⃣ engine\n\n默认为自动使用 webview 引擎, 可设为指定 jsc, 但 jsc 容易爆内存\n\n6⃣ produce\n\n自定义处理订阅的定时任务名\n一般用于定时处理耗时较长的订阅, 以更新缓存\n这样 Surge 中拉取的时候就能用到缓存, 不至于总是超时\n若设为 # 可取消此定时任务\n默认不开启\n\n7⃣ produce_cronexp\n\n配置处理订阅的定时任务\n\n默认为每 6 小时\n\n9⃣ produce_sub\n\n自定义需定时处理的单条订阅名\n多个用 , 连接\n\n🔟 produce_col\n\n自定义需定时处理的组合订阅名\n多个用 , 连接\n\n⚠ 注意: 是 名称(name) 不是 显示名称(displayName)\n如果名称需要编码, 请编码后再用 , 连接\n顺序: 并发执行单条订阅, 然后并发执行组合订阅'
scriptings:
- http_request:
name: Sub-Store Core
match: ^https?:\/\/sub\.store\/((download)|api\/(preview|sync|(utils\/node-info)))
script_url: https://github.com/sub-store-org/Sub-Store/releases/latest/download/sub-store-1.min.js
body_required: true
- http_request:
name: Sub-Store Simple
match: ^https?:\/\/sub\.store
script_url: https://github.com/sub-store-org/Sub-Store/releases/latest/download/sub-store-0.min.js
body_required: true
- schedule:
name: '{{{sync}}}'
cron: '{{{cronexp}}}'
script_url: https://github.com/sub-store-org/Sub-Store/releases/latest/download/cron-sync-artifacts.min.js
- schedule:
name: '{{{produce}}}'
cron: '{{{produce_cronexp}}}'
script_url: https://github.com/sub-store-org/Sub-Store/releases/latest/download/cron-sync-artifacts.min.js
arguments:
_compat.$argument: '"sub={{{produce_sub}}}&col={{{produce_col}}}"'
mitm:
hostnames:
- sub.store

View File

@@ -45,6 +45,9 @@ Surge Mac 版如何支持 SSR, 如何去除 HTTP 传输层以支持 类似 VMess
### 5. Shadowrocket
安装使用 模块 [`https://raw.githubusercontent.com/sub-store-org/Sub-Store/master/config/Surge-Noability.sgmodule`](https://raw.githubusercontent.com/sub-store-org/Sub-Store/master/config/Surge-Noability.sgmodule) 即可。
### 6. Egern
安装使用 模块 [`https://raw.githubusercontent.com/sub-store-org/Sub-Store/master/config/Egern.yaml`](https://raw.githubusercontent.com/sub-store-org/Sub-Store/master/config/Egern.yaml) 即可。
## 使用 Sub-Store
1. 使用 Safari 打开这个 https://sub.store 如网页正常打开并且未弹出任何错误提示,说明 Sub-Store 已经配置成功。
2. 可以把 Sub-Store 添加到主屏幕,即可获得类似于 APP 的使用体验。
@@ -56,4 +59,4 @@ https://github.com/sub-store-org/Sub-Store/wiki/%E9%93%BE%E6%8E%A5%E5%8F%82%E6%9
## 脚本使用说明
https://github.com/sub-store-org/Sub-Store/wiki/%E8%84%9A%E6%9C%AC%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E
https://github.com/sub-store-org/Sub-Store/wiki/%E8%84%9A%E6%9C%AC%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E