mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-09-17 00:03:14 +08:00
feat: 节点上的额外参数调整为下划线开头, 原参数目前仍保留, 若有脚本需要使用这些参数请尽快修改(_subName, _collectionName, _resolved)
This commit is contained in:
parent
af06086c1b
commit
47849dc6d0
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "sub-store",
|
"name": "sub-store",
|
||||||
"version": "2.14.320",
|
"version": "2.14.321",
|
||||||
"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": {
|
||||||
|
@ -199,6 +199,10 @@ function produce(proxies, targetPlatform, type, opts = {}) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
proxies = proxies.map((proxy) => {
|
proxies = proxies.map((proxy) => {
|
||||||
|
proxy._subName = proxy.subName;
|
||||||
|
proxy._collectionName = proxy.collectionName;
|
||||||
|
proxy._resolved = proxy.resolved;
|
||||||
|
|
||||||
if (!isNotBlank(proxy.name)) {
|
if (!isNotBlank(proxy.name)) {
|
||||||
proxy.name = `${proxy.type} ${proxy.server}:${proxy.port}`;
|
proxy.name = `${proxy.type} ${proxy.server}:${proxy.port}`;
|
||||||
}
|
}
|
||||||
|
@ -438,11 +438,21 @@ export class MMDB {
|
|||||||
const countryFile =
|
const countryFile =
|
||||||
country || eval('process.env.SUB_STORE_MMDB_COUNTRY_PATH');
|
country || eval('process.env.SUB_STORE_MMDB_COUNTRY_PATH');
|
||||||
const asnFile = asn || eval('process.env.SUB_STORE_MMDB_ASN_PATH');
|
const asnFile = asn || eval('process.env.SUB_STORE_MMDB_ASN_PATH');
|
||||||
|
// $.info(
|
||||||
|
// `GeoLite2 Country MMDB: ${countryFile}, exists: ${fs.existsSync(
|
||||||
|
// countryFile,
|
||||||
|
// )}`,
|
||||||
|
// );
|
||||||
if (countryFile) {
|
if (countryFile) {
|
||||||
this.countryReader = Reader.openBuffer(
|
this.countryReader = Reader.openBuffer(
|
||||||
fs.readFileSync(countryFile),
|
fs.readFileSync(countryFile),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
// $.info(
|
||||||
|
// `GeoLite2 ASN MMDB: ${asnFile}, exists: ${fs.existsSync(
|
||||||
|
// asnFile,
|
||||||
|
// )}`,
|
||||||
|
// );
|
||||||
if (asnFile) {
|
if (asnFile) {
|
||||||
if (!fs.existsSync(asnFile))
|
if (!fs.existsSync(asnFile))
|
||||||
throw new Error('GeoLite2 ASN MMDB does not exist');
|
throw new Error('GeoLite2 ASN MMDB does not exist');
|
||||||
|
@ -8,9 +8,11 @@ function operator(proxies = [], targetPlatform, context) {
|
|||||||
// 结构大致参考了 Clash.Meta(mihomo) 有私货
|
// 结构大致参考了 Clash.Meta(mihomo) 有私货
|
||||||
// 可在预览界面点击节点查看 JSON 结构 或查看 `target=JSON` 的通用订阅
|
// 可在预览界面点击节点查看 JSON 结构 或查看 `target=JSON` 的通用订阅
|
||||||
// 1. `no-resolve` 为不解析域名
|
// 1. `no-resolve` 为不解析域名
|
||||||
// 2. 域名解析后 会多一个 `resolved` 字段
|
// 2. 域名解析后 会多一个 `_resolved` 字段
|
||||||
// 3. 域名解析后会有`_IPv4`, `_IPv6`, `_IP`(若有多个步骤, 只取第一次成功的 v4 或 v6 数据), `_domain` 字段
|
// 3. 域名解析后会有`_IPv4`, `_IPv6`, `_IP`(若有多个步骤, 只取第一次成功的 v4 或 v6 数据), `_domain` 字段
|
||||||
// 4. 节点字段 `exec` 为 `ssr-local` 路径, 默认 `/usr/local/bin/ssr-local`; 端口从 10000 开始递增(暂不支持配置)
|
// 4. 节点字段 `exec` 为 `ssr-local` 路径, 默认 `/usr/local/bin/ssr-local`; 端口从 10000 开始递增(暂不支持配置)
|
||||||
|
// 5. `_subName` 为单条订阅名
|
||||||
|
// 6. `_collectionName` 为组合订阅名
|
||||||
|
|
||||||
// $arguments 为传入的脚本参数
|
// $arguments 为传入的脚本参数
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user