mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-06-16 02:37:19 +08:00
feat: produceArtifact 方法支持传入自定义 subscription; VLESS 非 reality 删除空 flow
This commit is contained in:
parent
aaef97cf5d
commit
078bf228de
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "sub-store",
|
"name": "sub-store",
|
||||||
"version": "2.14.244",
|
"version": "2.14.245",
|
||||||
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
|
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
|
||||||
"main": "src/main.js",
|
"main": "src/main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -370,6 +370,10 @@ function lastParse(proxy) {
|
|||||||
delete proxy.ports;
|
delete proxy.ports;
|
||||||
}
|
}
|
||||||
if (['vless'].includes(proxy.type)) {
|
if (['vless'].includes(proxy.type)) {
|
||||||
|
// 非 reality, 空 flow 没有意义
|
||||||
|
if (!proxy['reality-opts'] && !proxy.flow) {
|
||||||
|
delete proxy.flow;
|
||||||
|
}
|
||||||
if (['http'].includes(proxy.network)) {
|
if (['http'].includes(proxy.network)) {
|
||||||
let transportPath = proxy[`${proxy.network}-opts`]?.path;
|
let transportPath = proxy[`${proxy.network}-opts`]?.path;
|
||||||
if (!transportPath) {
|
if (!transportPath) {
|
||||||
|
@ -444,6 +444,7 @@ function URI_VLESS() {
|
|||||||
proxy[`${params.security}-opts`] = opts;
|
proxy[`${params.security}-opts`] = opts;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
proxy.network = params.type;
|
proxy.network = params.type;
|
||||||
if (proxy.network === 'tcp' && params.headerType === 'http') {
|
if (proxy.network === 'tcp' && params.headerType === 'http') {
|
||||||
proxy.network = 'http';
|
proxy.network = 'http';
|
||||||
|
@ -35,13 +35,21 @@ async function produceArtifact({
|
|||||||
ignoreFailedRemoteFile,
|
ignoreFailedRemoteFile,
|
||||||
produceType,
|
produceType,
|
||||||
produceOpts = {},
|
produceOpts = {},
|
||||||
|
subscription,
|
||||||
}) {
|
}) {
|
||||||
platform = platform || 'JSON';
|
platform = platform || 'JSON';
|
||||||
|
|
||||||
if (type === 'subscription') {
|
if (type === 'subscription') {
|
||||||
const allSubs = $.read(SUBS_KEY);
|
let sub;
|
||||||
const sub = findByName(allSubs, name);
|
if (name) {
|
||||||
if (!sub) throw new Error(`找不到订阅 ${name}`);
|
const allSubs = $.read(SUBS_KEY);
|
||||||
|
sub = findByName(allSubs, name);
|
||||||
|
if (!sub) throw new Error(`找不到订阅 ${name}`);
|
||||||
|
} else if (subscription) {
|
||||||
|
sub = subscription;
|
||||||
|
} else {
|
||||||
|
throw new Error('未提供订阅名称或订阅数据');
|
||||||
|
}
|
||||||
let raw;
|
let raw;
|
||||||
if (content && !['localFirst', 'remoteFirst'].includes(mergeSources)) {
|
if (content && !['localFirst', 'remoteFirst'].includes(mergeSources)) {
|
||||||
raw = content;
|
raw = content;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user