mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-23 02:49:09 +08:00
Compare commits
No commits in common. "master" and "2.19.59" have entirely different histories.
@ -42,7 +42,7 @@ Core functionalities:
|
|||||||
- [x] Clash.Meta (Direct, SS, SSR, VMess, Trojan, HTTP, SOCKS5, Snell, VLESS, WireGuard, Hysteria, Hysteria 2, TUIC, SSH, mieru, AnyTLS)
|
- [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)
|
- [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`):
|
Deprecated:
|
||||||
|
|
||||||
- [x] Clash (SS, SSR, VMess, Trojan, HTTP, SOCKS5, Snell, VLESS, WireGuard)
|
- [x] Clash (SS, SSR, VMess, Trojan, HTTP, SOCKS5, Snell, VLESS, WireGuard)
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "sub-store",
|
"name": "sub-store",
|
||||||
"version": "2.19.60",
|
"version": "2.19.59",
|
||||||
"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": {
|
||||||
|
@ -177,7 +177,7 @@ async function processFn(
|
|||||||
} else if (url?.startsWith('/')) {
|
} else if (url?.startsWith('/')) {
|
||||||
try {
|
try {
|
||||||
const fs = eval(`require("fs")`);
|
const fs = eval(`require("fs")`);
|
||||||
script = fs.readFileSync(url.split('#')[0], 'utf8');
|
script = fs.readFileSync(url, 'utf8');
|
||||||
// $.info(`Script loaded: >>>\n ${script}`);
|
// $.info(`Script loaded: >>>\n ${script}`);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
$.error(
|
$.error(
|
||||||
|
@ -259,7 +259,7 @@ async function downloadSubscription(req, res) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!$arguments.noFlow && /^https?/.test(url)) {
|
if (!$arguments.noFlow) {
|
||||||
// forward flow headers
|
// forward flow headers
|
||||||
flowInfo = await getFlowHeaders(
|
flowInfo = await getFlowHeaders(
|
||||||
$arguments?.insecure ? `${url}#insecure` : url,
|
$arguments?.insecure ? `${url}#insecure` : url,
|
||||||
@ -506,7 +506,7 @@ async function downloadCollection(req, res) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!$arguments.noFlow && /^https?:/.test(url)) {
|
if (!$arguments.noFlow) {
|
||||||
subUserInfoOfSub = await getFlowHeaders(
|
subUserInfoOfSub = await getFlowHeaders(
|
||||||
$arguments?.insecure ? `${url}#insecure` : url,
|
$arguments?.insecure ? `${url}#insecure` : url,
|
||||||
$arguments.flowUserAgent,
|
$arguments.flowUserAgent,
|
||||||
|
@ -140,7 +140,7 @@ async function getFlowInfo(req, res) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($arguments.noFlow || !/^https?/.test(url)) {
|
if ($arguments.noFlow) {
|
||||||
failed(
|
failed(
|
||||||
res,
|
res,
|
||||||
new RequestInvalidError(
|
new RequestInvalidError(
|
||||||
|
@ -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 { HTTP, ENV } from '@/vendor/open-api';
|
||||||
import { hex_md5 } from '@/vendor/md5';
|
import { hex_md5 } from '@/vendor/md5';
|
||||||
import { getPolicyDescriptor } from '@/utils';
|
import { getPolicyDescriptor } from '@/utils';
|
||||||
@ -11,8 +11,6 @@ import {
|
|||||||
validCheck,
|
validCheck,
|
||||||
} from '@/utils/flow';
|
} from '@/utils/flow';
|
||||||
import $ from '@/core/app';
|
import $ from '@/core/app';
|
||||||
import { findByName } from '@/utils/database';
|
|
||||||
import { produceArtifact } from '@/restful/sync';
|
|
||||||
import PROXY_PREPROCESSORS from '@/core/proxy-utils/preprocessors';
|
import PROXY_PREPROCESSORS from '@/core/proxy-utils/preprocessors';
|
||||||
const clashPreprocessor = PROXY_PREPROCESSORS.find(
|
const clashPreprocessor = PROXY_PREPROCESSORS.find(
|
||||||
(processor) => processor.name === 'Clash Pre-processor',
|
(processor) => processor.name === 'Clash Pre-processor',
|
||||||
@ -132,53 +130,22 @@ export default async function download(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const downloadUrlMatch = url
|
// const downloadUrlMatch = url.match(/^\/api\/(file|module)\/(.+)/);
|
||||||
.split('#')[0]
|
// if (downloadUrlMatch) {
|
||||||
.match(/^\/api\/(file|module)\/(.+)/);
|
// let type = downloadUrlMatch?.[1];
|
||||||
if (downloadUrlMatch) {
|
// let name = downloadUrlMatch?.[2];
|
||||||
let type = '';
|
// if (name == null) {
|
||||||
try {
|
// throw new Error(`本地 ${type} URL 无效: ${url}`);
|
||||||
type = downloadUrlMatch?.[1];
|
// }
|
||||||
let name = downloadUrlMatch?.[2];
|
// name = decodeURIComponent(name);
|
||||||
if (name == null) {
|
// const key = type === 'module' ? MODULES_KEY : FILES_KEY;
|
||||||
throw new Error(`本地 ${type} URL 无效: ${url}`);
|
// const item = findByName($.read(key), name);
|
||||||
}
|
// if (!item) {
|
||||||
name = decodeURIComponent(name);
|
// throw new Error(`找不到本地 ${type}: ${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;
|
||||||
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}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isNode && tasks.has(id)) {
|
if (!isNode && tasks.has(id)) {
|
||||||
return tasks.get(id);
|
return tasks.get(id);
|
||||||
|
@ -49,7 +49,7 @@ export async function getFlowHeaders(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($arguments?.noFlow || !/^https?/.test(url)) {
|
if ($arguments?.noFlow) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const { isStash, isLoon, isShadowRocket, isQX } = ENV();
|
const { isStash, isLoon, isShadowRocket, isQX } = ENV();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user