cfpilot 0.15.8 → 0.15.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -87,7 +87,7 @@ var VERSION, NAME;
87
87
  var init_version = __esm({
88
88
  "src/shared/version.ts"() {
89
89
  "use strict";
90
- VERSION = "0.15.8";
90
+ VERSION = "0.15.9";
91
91
  NAME = "cfpilot";
92
92
  }
93
93
  });
@@ -7652,10 +7652,20 @@ function poolPath() {
7652
7652
  function poolLockPath() {
7653
7653
  return poolPath() + ".lock";
7654
7654
  }
7655
+ function isDomainHost(host) {
7656
+ if (!host || host.length > 253) return false;
7657
+ if (!/^[A-Za-z0-9.-]+$/.test(host)) return false;
7658
+ const labels = host.split(".");
7659
+ if (labels.length < 2) return false;
7660
+ if (/^[\d.]+$/.test(host)) return false;
7661
+ return labels.every(
7662
+ (label) => label.length > 0 && label.length <= 63 && /^[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?$/.test(label)
7663
+ );
7664
+ }
7655
7665
  function normalizeCandidateKey(ip, port) {
7656
7666
  const clean = ip.trim();
7657
7667
  const family = isIP2(clean);
7658
- if (family !== 4 && family !== 6) return null;
7668
+ if (family !== 4 && family !== 6 && !isDomainHost(clean)) return null;
7659
7669
  if (!Number.isInteger(port) || port < 1 || port > 65535) return null;
7660
7670
  return family === 6 ? `[${clean}]:${port}` : `${clean}:${port}`;
7661
7671
  }
@@ -7687,7 +7697,7 @@ function readPoolRaw() {
7687
7697
  function isValidCandidate(value) {
7688
7698
  if (!value || typeof value !== "object") return false;
7689
7699
  const c2 = value;
7690
- if (typeof c2.key !== "string" || !c2.key || typeof c2.ip !== "string" || !c2.ip || !Number.isInteger(c2.port) || (c2.port ?? 0) < 1 || (c2.port ?? 0) > 65535 || c2.ipVersion !== 4 && c2.ipVersion !== 6 || c2.candidateType !== ENTRY_IP || !Array.isArray(c2.sources) || !c2.sources.every((s) => typeof s === "string") || typeof c2.firstSeen !== "number" || !Number.isFinite(c2.firstSeen) || c2.firstSeen < 0 || typeof c2.lastSeen !== "number" || !Number.isFinite(c2.lastSeen) || c2.lastSeen < 0 || typeof c2.status !== "string" || !c2.status || !isValidOptionalNumber(c2.failCount) || !isValidOptionalNumber(c2.successCount)) return false;
7700
+ if (typeof c2.key !== "string" || !c2.key || typeof c2.ip !== "string" || !c2.ip || !Number.isInteger(c2.port) || (c2.port ?? 0) < 1 || (c2.port ?? 0) > 65535 || c2.ipVersion !== 0 && c2.ipVersion !== 4 && c2.ipVersion !== 6 || c2.candidateType !== ENTRY_IP || !Array.isArray(c2.sources) || !c2.sources.every((s) => typeof s === "string") || typeof c2.firstSeen !== "number" || !Number.isFinite(c2.firstSeen) || c2.firstSeen < 0 || typeof c2.lastSeen !== "number" || !Number.isFinite(c2.lastSeen) || c2.lastSeen < 0 || typeof c2.status !== "string" || !c2.status || !isValidOptionalNumber(c2.failCount) || !isValidOptionalNumber(c2.successCount)) return false;
7691
7701
  if (c2.lightCheck !== null && c2.lightCheck !== void 0 && !isValidLightCheck(c2.lightCheck)) return false;
7692
7702
  if (c2.fullTest !== null && c2.fullTest !== void 0 && !isValidFullTest(c2.fullTest)) return false;
7693
7703
  return true;
@@ -7852,12 +7862,15 @@ function upsertCandidates(pool2, inputs, now = Date.now(), maxCandidates = POOL_
7852
7862
  bumpReason(result.reasons, "invalidIp");
7853
7863
  continue;
7854
7864
  }
7855
- if (!isCloudflareEntryIp(input.ip)) {
7865
+ const clean = input.ip.trim();
7866
+ const family = isIP2(clean);
7867
+ const domain = family === 0 && isDomainHost(clean);
7868
+ if (!domain && !isCloudflareEntryIp(clean)) {
7856
7869
  result.rejected++;
7857
7870
  bumpReason(result.reasons, "notCloudflare");
7858
7871
  continue;
7859
7872
  }
7860
- const family = isIP2(input.ip.trim());
7873
+ const ipVersion = domain ? 0 : family === 6 ? 6 : 4;
7861
7874
  const existing = byKey.get(key);
7862
7875
  if (existing) {
7863
7876
  if (!existing.sources.includes(input.source)) existing.sources.push(input.source);
@@ -7872,9 +7885,9 @@ function upsertCandidates(pool2, inputs, now = Date.now(), maxCandidates = POOL_
7872
7885
  }
7873
7886
  const created = {
7874
7887
  key,
7875
- ip: input.ip.trim(),
7888
+ ip: clean,
7876
7889
  port,
7877
- ipVersion: family,
7890
+ ipVersion,
7878
7891
  candidateType: ENTRY_IP,
7879
7892
  sources: [input.source],
7880
7893
  firstSeen: now,
@@ -10242,6 +10255,15 @@ var init_main = __esm({
10242
10255
  }
10243
10256
  });
10244
10257
 
10258
+ // src/sources/builtin.generated.ts
10259
+ var BUILTIN_SOURCES_JSON;
10260
+ var init_builtin_generated = __esm({
10261
+ "src/sources/builtin.generated.ts"() {
10262
+ "use strict";
10263
+ BUILTIN_SOURCES_JSON = '[{"id":"bestcf-domain-all","name":"\u57DF\u540D\xB7\u7CBE\u9009\u5168\u91CF\u7248","type":"custom-url","url":"https://bestcf.pages.dev/domain/all.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-domain-mini","name":"\u57DF\u540D\xB7\u7CBE\u9009\u8FF7\u4F60\u7248","type":"custom-url","url":"https://bestcf.pages.dev/domain/mini.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-domain-asia","name":"\u57DF\u540D\xB7\u7CBE\u9009\u4E9A\u6D32\u7248","type":"custom-url","url":"https://bestcf.pages.dev/domain/Domain-Asia.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-domain-checked","name":"\u57DF\u540D\xB7\u5DF2\u6821\u9A8C\u793A\u4F8B","type":"custom-url","url":"https://bestcf.pages.dev/domain/Domain-Checked.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-vps789-top10","name":"\u57DF\u540D\xB7VPS789 TOP10","type":"custom-url","url":"https://bestcf.pages.dev/vps789/top10.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-vps789-top20","name":"\u57DF\u540D\xB7VPS789 TOP20","type":"custom-url","url":"https://bestcf.pages.dev/vps789/top20.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-vps789-top50","name":"\u57DF\u540D\xB7VPS789 TOP50","type":"custom-url","url":"https://bestcf.pages.dev/vps789/top50.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-vps789-top100","name":"\u57DF\u540D\xB7VPS789 TOP100","type":"custom-url","url":"https://bestcf.pages.dev/vps789/top100.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-ygkkk-domain","name":"\u57DF\u540D\xB7YGKKK","type":"custom-url","url":"https://bestcf.pages.dev/domain/ygkkk/all.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-qms-domain","name":"\u57DF\u540D\xB7QMS","type":"custom-url","url":"https://bestcf.pages.dev/domain/qms/all.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-senflare-domain","name":"\u57DF\u540D\xB7Senflare","type":"custom-url","url":"https://bestcf.pages.dev/domain/senflare/all.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-ircf-domain","name":"\u57DF\u540D\xB7IRCF","type":"custom-url","url":"https://bestcf.pages.dev/domain/ircf/all.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-wetest-ipv4","name":"IP\xB7WeTest \u4E09\u7F51","type":"custom-url","url":"https://bestcf.pages.dev/wetest/ipv4.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-uouin-all","name":"IP\xB7UOUIN \u4E09\u7F51\u5E26\u6D4B\u901F","type":"custom-url","url":"https://bestcf.pages.dev/uouin/all.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-mia-ipv4","name":"IP\xB7Mia \u534A\u5C0F\u65F6","type":"custom-url","url":"https://bestcf.pages.dev/xinyitang3/ipv4.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-lzj-all","name":"IP\xB7LZJ \u542B IPv6","type":"custom-url","url":"https://bestcf.pages.dev/lzj/all.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-cfyes-ipv4","name":"IP\xB7CFYes IPv4","type":"custom-url","url":"https://bestcf.pages.dev/cfyes/ipv4.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-cfyes-ipv6","name":"IP\xB7CFYes IPv6","type":"custom-url","url":"https://bestcf.pages.dev/cfyes/ipv6.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-cfyes-api","name":"IP\xB7CFYes \u5907\u7528 API","type":"custom-url","url":"https://addressesapi.090227.xyz/CloudFlareYes","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-zhixuan-ipv4","name":"IP\xB7ZhiXuan IPv4","type":"custom-url","url":"https://bestcf.pages.dev/zhixuanwang/ipv4-onlyip.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-zhixuan-api","name":"IP\xB7ZhiXuan \u5907\u7528 API","type":"custom-url","url":"https://addressesapi.090227.xyz/ip.164746.xyz","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-vvhan-ipv4","name":"IP\xB7vvHan IPv4","type":"custom-url","url":"https://bestcf.pages.dev/vvhan/ipv4.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-vvhan-ipv6","name":"IP\xB7vvHan IPv6","type":"custom-url","url":"https://bestcf.pages.dev/vvhan/ipv6.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-mingyu-ipv4","name":"IP\xB7MingYu IPv4","type":"custom-url","url":"https://raw.githubusercontent.com/ymyuuu/IPDB/refs/heads/main/BestCF/bestcfv4.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-mingyu-ipv6","name":"IP\xB7MingYu IPv6","type":"custom-url","url":"https://raw.githubusercontent.com/ymyuuu/IPDB/refs/heads/main/BestCF/bestcfv6.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-yuanxiawan","name":"IP\xB7Yuanxiawan","type":"custom-url","url":"https://raw.githubusercontent.com/yuanxiawan/cfipv4db/refs/heads/main/cfip.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-cmliu-all","name":"IP\xB7CM 1","type":"custom-url","url":"https://bestcf.pages.dev/cmliu/all.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-cmliu2-all","name":"IP\xB7CM 2","type":"custom-url","url":"https://bestcf.pages.dev/cmliu2/all.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-cmliu-worker","name":"IP\xB7CM 3","type":"custom-url","url":"https://raw.githubusercontent.com/cmliu/WorkerVless2sub/refs/heads/main/addressesapi.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-ircf-ipv4","name":"IP\xB7IRCF","type":"custom-url","url":"https://bestcf.pages.dev/ircf/ipv4.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-nirevil-ipv4","name":"IP\xB7NiREvil IPv4","type":"custom-url","url":"https://bestcf.pages.dev/nirevil/ipv4.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-nirevil-ipv6","name":"IP\xB7NiREvil IPv6","type":"custom-url","url":"https://bestcf.pages.dev/nirevil/ipv6.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-tc1-all","name":"IP\xB7\u5929\u8BDA1 \u5168\u91CF","type":"custom-url","url":"https://bestcf.pages.dev/tiancheng/all.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-tc1-mini","name":"IP\xB7\u5929\u8BDA1 \u8FF7\u4F60","type":"custom-url","url":"https://bestcf.pages.dev/tiancheng/mini.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-tc1-hk","name":"IP\xB7\u5929\u8BDA1 \u9999\u6E2F","type":"custom-url","url":"https://bestcf.pages.dev/tiancheng/hk.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-tc1-sg","name":"IP\xB7\u5929\u8BDA1 \u65B0\u52A0\u5761","type":"custom-url","url":"https://bestcf.pages.dev/tiancheng/sg.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-tc1-jp","name":"IP\xB7\u5929\u8BDA1 \u65E5\u672C","type":"custom-url","url":"https://bestcf.pages.dev/tiancheng/jp.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-tc1-kr","name":"IP\xB7\u5929\u8BDA1 \u97E9\u56FD","type":"custom-url","url":"https://bestcf.pages.dev/tiancheng/kr.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-tc1-us","name":"IP\xB7\u5929\u8BDA1 \u7F8E\u56FD","type":"custom-url","url":"https://bestcf.pages.dev/tiancheng/us.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-tc1-tw","name":"IP\xB7\u5929\u8BDA1 \u53F0\u6E7E","type":"custom-url","url":"https://bestcf.pages.dev/tiancheng/tw.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-tc2-all","name":"IP\xB7\u5929\u8BDA2 \u5168\u91CF","type":"custom-url","url":"https://bestcf.pages.dev/tiancheng2/all.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-tc2-mini","name":"IP\xB7\u5929\u8BDA2 \u8FF7\u4F60","type":"custom-url","url":"https://bestcf.pages.dev/tiancheng2/mini.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-tc2-hk","name":"IP\xB7\u5929\u8BDA2 \u9999\u6E2F","type":"custom-url","url":"https://bestcf.pages.dev/tiancheng2/hk.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-tc2-de","name":"IP\xB7\u5929\u8BDA2 \u5FB7\u56FD","type":"custom-url","url":"https://bestcf.pages.dev/tiancheng2/de.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-tc2-jp","name":"IP\xB7\u5929\u8BDA2 \u65E5\u672C","type":"custom-url","url":"https://bestcf.pages.dev/tiancheng2/jp.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-tc2-kr","name":"IP\xB7\u5929\u8BDA2 \u97E9\u56FD","type":"custom-url","url":"https://bestcf.pages.dev/tiancheng2/kr.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-tc2-sg","name":"IP\xB7\u5929\u8BDA2 \u65B0\u52A0\u5761","type":"custom-url","url":"https://bestcf.pages.dev/tiancheng2/sg.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-tc2-us","name":"IP\xB7\u5929\u8BDA2 \u7F8E\u56FD","type":"custom-url","url":"https://bestcf.pages.dev/tiancheng2/us.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-tc2-tw","name":"IP\xB7\u5929\u8BDA2 \u53F0\u6E7E","type":"custom-url","url":"https://bestcf.pages.dev/tiancheng2/tw.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-s5gy-all","name":"IP\xB7S5\u516C\u76CA \u5168\u91CF","type":"custom-url","url":"https://bestcf.pages.dev/s5gy/all.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-s5gy-mini","name":"IP\xB7S5\u516C\u76CA \u8FF7\u4F60","type":"custom-url","url":"https://bestcf.pages.dev/s5gy/mini.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-s5gy-hk","name":"IP\xB7S5\u516C\u76CA \u9999\u6E2F","type":"custom-url","url":"https://bestcf.pages.dev/s5gy/hk.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-s5gy-sg","name":"IP\xB7S5\u516C\u76CA \u65B0\u52A0\u5761","type":"custom-url","url":"https://bestcf.pages.dev/s5gy/sg.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-s5gy-jp","name":"IP\xB7S5\u516C\u76CA \u65E5\u672C","type":"custom-url","url":"https://bestcf.pages.dev/s5gy/jp.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-s5gy-kr","name":"IP\xB7S5\u516C\u76CA \u97E9\u56FD","type":"custom-url","url":"https://bestcf.pages.dev/s5gy/kr.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-s5gy-us","name":"IP\xB7S5\u516C\u76CA \u7F8E\u56FD","type":"custom-url","url":"https://bestcf.pages.dev/s5gy/us.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-s5gy-tw","name":"IP\xB7S5\u516C\u76CA \u53F0\u6E7E","type":"custom-url","url":"https://bestcf.pages.dev/s5gy/tw.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-gslege-all","name":"IP\xB7Gslege \u5E26\u6D4B\u901F","type":"custom-url","url":"https://bestcf.pages.dev/gslege/Cfxyz.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-gslege-sg","name":"IP\xB7Gslege \u65B0\u52A0\u5761","type":"custom-url","url":"https://bestcf.pages.dev/gslege/SG.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-gslege-de","name":"IP\xB7Gslege \u5FB7\u56FD","type":"custom-url","url":"https://bestcf.pages.dev/gslege/DE.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-gslege-us","name":"IP\xB7Gslege \u7F8E\u56FD","type":"custom-url","url":"https://bestcf.pages.dev/gslege/US.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-mjz-cu","name":"IP\xB7MJZ \u8054\u901A","type":"custom-url","url":"https://cf.junzhen.qzz.io/best_ips.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-mjz-ct","name":"IP\xB7MJZ \u7535\u4FE1","type":"custom-url","url":"https://cf.junzhen.qzz.io/best_ips_bj.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-ss-cmcc","name":"IP\xB7SS \u79FB\u52A8","type":"custom-url","url":"https://raw.githubusercontent.com/svip-s/cloudflare_ip/refs/heads/main/best_ips.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-lz-ct","name":"IP\xB7LZ \u7535\u4FE1","type":"custom-url","url":"https://raw.githubusercontent.com/love-ztm/cfip/refs/heads/main/best_ips.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-lz-cu","name":"IP\xB7LZ \u8054\u901A","type":"custom-url","url":"https://raw.githubusercontent.com/love-ztm/cfip/refs/heads/main/ubest_ips.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-lancelot-collected","name":"IP\xB7LancelotRar \u91C7\u96C6\u805A\u5408","type":"custom-url","url":"https://raw.githubusercontent.com/LancelotRar/best-cf-ips/refs/heads/main/best-cf-ip-collected.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-lancelot-top20","name":"IP\xB7LancelotRar TOP20","type":"custom-url","url":"https://raw.githubusercontent.com/LancelotRar/best-cf-ips/refs/heads/main/best-cf-ip-scanned-top20.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-lancelot-top50","name":"IP\xB7LancelotRar TOP50","type":"custom-url","url":"https://raw.githubusercontent.com/LancelotRar/best-cf-ips/refs/heads/main/best-cf-ip-scanned-top50.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-lancelot-top100","name":"IP\xB7LancelotRar TOP100","type":"custom-url","url":"https://raw.githubusercontent.com/LancelotRar/best-cf-ips/refs/heads/main/best-cf-ip-scanned-top100.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-lancelot-top200","name":"IP\xB7LancelotRar TOP200","type":"custom-url","url":"https://raw.githubusercontent.com/LancelotRar/best-cf-ips/refs/heads/main/best-cf-ip-scanned-top200.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-lancelot-top400","name":"IP\xB7LancelotRar TOP400","type":"custom-url","url":"https://raw.githubusercontent.com/LancelotRar/best-cf-ips/refs/heads/main/best-cf-ip-scanned-top400.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-joname-ipv4","name":"IP\xB7Joname IPv4","type":"custom-url","url":"https://raw.githubusercontent.com/joname1/BestCFip/refs/heads/main/ipv4.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-joname-ipv6","name":"IP\xB7Joname IPv6","type":"custom-url","url":"https://raw.githubusercontent.com/joname1/BestCFip/refs/heads/main/ipv6.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-ahang","name":"IP\xB7Ahang","type":"custom-url","url":"https://raw.githubusercontent.com/ahang39/router/refs/heads/main/all.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-einsitang","name":"IP\xB7Einsitang","type":"custom-url","url":"https://raw.githubusercontent.com/einsitang/my-fast-cf-ip/refs/heads/master/fastips.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-hubbylei","name":"IP\xB7Hubbylei","type":"custom-url","url":"https://raw.githubusercontent.com/hubbylei/bestcf/refs/heads/main/bestcf.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-tc4","name":"IP\xB7\u5929\u8BDA4","type":"custom-url","url":"https://raw.githubusercontent.com/gshtwy/CF-DNS-Clone/refs/heads/main/wetest-cloudflare-v4.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-senflare-ip","name":"IP\xB7Senflare \u5355IP","type":"custom-url","url":"https://raw.githubusercontent.com/Senflare/Senflare-IP/refs/heads/main/IPlist-Pro.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-senflare-pro","name":"IP\xB7Senflare \u5E26\u5907\u6CE8","type":"custom-url","url":"https://raw.githubusercontent.com/Senflare/Senflare-IP/refs/heads/main/Senflare-Pro.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-jiechaocc","name":"IP\xB7JieChaoCC","type":"custom-url","url":"https://raw.githubusercontent.com/JieChaoCC/cf-ip-auto/refs/heads/main/data/ipapi.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-api-all","name":"API\xB7\u6309\u8FD0\u8425\u5546\u968F\u673A \u4E09\u7F51","type":"custom-url","url":"https://090227.pages.dev/bestcf?isp=all&ips=20","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-api-ct","name":"API\xB7\u6309\u8FD0\u8425\u5546\u968F\u673A \u7535\u4FE1","type":"custom-url","url":"https://090227.pages.dev/bestcf?isp=ct&ips=50","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-api-cu","name":"API\xB7\u6309\u8FD0\u8425\u5546\u968F\u673A \u8054\u901A","type":"custom-url","url":"https://090227.pages.dev/bestcf?isp=cu&ips=50","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-api-cmcc","name":"API\xB7\u6309\u8FD0\u8425\u5546\u968F\u673A \u79FB\u52A8","type":"custom-url","url":"https://090227.pages.dev/bestcf?isp=cmcc&ips=50","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-warp-mini","name":"IP\xB7WARP \u901A\u7528\u6BB5\u8FF7\u4F60","type":"custom-url","url":"https://bestcf.pages.dev/WARP/WARP-MINI.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-warp-mini-443","name":"IP\xB7WARP \u8FF7\u4F60 443","type":"custom-url","url":"https://bestcf.pages.dev/WARP/WARP-MINI-443.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200},{"id":"bestcf-warp-mini-8443","name":"IP\xB7WARP \u8FF7\u4F60 8443","type":"custom-url","url":"https://bestcf.pages.dev/WARP/WARP-MINI-8443.txt","mirrors":[],"enabled":false,"intervalHours":6,"etag":"","lastModified":"","lastSyncAt":0,"lastError":"","failCount":0,"query":"","maxResults":200}]';
10264
+ }
10265
+ });
10266
+
10245
10267
  // src/sources/config.ts
10246
10268
  import {
10247
10269
  existsSync as existsSync3,
@@ -10257,6 +10279,14 @@ function sourcesPath() {
10257
10279
  return join6(poolDir(), SOURCES_FILENAME);
10258
10280
  }
10259
10281
  function emptySources() {
10282
+ return {
10283
+ schema: SOURCES_SCHEMA,
10284
+ updatedAt: 0,
10285
+ sources: JSON.parse(BUILTIN_SOURCES_JSON),
10286
+ runs: []
10287
+ };
10288
+ }
10289
+ function blankSources() {
10260
10290
  return { schema: SOURCES_SCHEMA, updatedAt: 0, sources: [], runs: [] };
10261
10291
  }
10262
10292
  function readSourcesRaw() {
@@ -10326,7 +10356,7 @@ function parseSources(raw) {
10326
10356
  if (existsSync3(sourcesPath())) renameSync2(sourcesPath(), backup);
10327
10357
  } catch {
10328
10358
  }
10329
- return emptySources();
10359
+ return blankSources();
10330
10360
  }
10331
10361
  }
10332
10362
  function serializeSources(file) {
@@ -10380,6 +10410,7 @@ var SOURCES_SCHEMA, SOURCES_SCHEMA_V1, SOURCES_FILENAME, MAX_SYNC_RUNS, SOURCE_T
10380
10410
  var init_config2 = __esm({
10381
10411
  "src/sources/config.ts"() {
10382
10412
  "use strict";
10413
+ init_builtin_generated();
10383
10414
  init_pool();
10384
10415
  SOURCES_SCHEMA = 2;
10385
10416
  SOURCES_SCHEMA_V1 = 1;
@@ -10732,8 +10763,8 @@ function collectPorts(text2) {
10732
10763
  const line = rawLine.trim();
10733
10764
  if (!line || line.startsWith("#")) continue;
10734
10765
  for (const m of line.matchAll(new RegExp(HOST_PORT, "g"))) {
10735
- const host = m[1] ?? m[2];
10736
- const port = Number(m[3]);
10766
+ const host = m[1] ?? m[2] ?? m[3];
10767
+ const port = Number(m[4]);
10737
10768
  if (host && port >= 1 && port <= 65535 && !ports.has(host)) ports.set(host, port);
10738
10769
  }
10739
10770
  if (line.includes(",")) {
@@ -10801,14 +10832,15 @@ function toCandidateInputs(parsed, sourceId) {
10801
10832
  source: sourceId
10802
10833
  }));
10803
10834
  }
10804
- var IPV4, IPV6, HOST_PORT, IP_KEYS, LIST_KEYS;
10835
+ var IPV4, IPV6, DOMAIN, HOST_PORT, IP_KEYS, LIST_KEYS;
10805
10836
  var init_normalizer = __esm({
10806
10837
  "src/sources/normalizer.ts"() {
10807
10838
  "use strict";
10808
10839
  init_ip_ranges();
10809
10840
  IPV4 = "\\d{1,3}(?:\\.\\d{1,3}){3}";
10810
10841
  IPV6 = "[0-9a-fA-F:.]+";
10811
- HOST_PORT = new RegExp(`(?:\\[(${IPV6})\\]:|(${IPV4}):)(\\d{1,5})`);
10842
+ DOMAIN = "[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?(?:\\.[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?)+";
10843
+ HOST_PORT = new RegExp(`(?:\\[(${IPV6})\\]:|(${IPV4}):|(${DOMAIN}):)(\\d{1,5})`);
10812
10844
  IP_KEYS = ["ip", "address", "addr", "host", "target", "value"];
10813
10845
  LIST_KEYS = ["ips", "data", "list", "candidates", "result", "items", "records"];
10814
10846
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cfpilot",
3
- "version": "0.15.8",
3
+ "version": "0.15.9",
4
4
  "description": "CFPilot —— Cloudflare Pages 代理部署与优选工具(交互菜单 + 子命令)",
5
5
  "type": "module",
6
6
  "license": "AGPL-3.0-only",