mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-12 09:10:35 +08:00
Add more Reject Upstream Mirror
This commit is contained in:
parent
b4fbcc6e70
commit
43824facb5
@ -106,18 +106,66 @@ const threads = isCI ? cpuCount : cpuCount / 2;
|
|||||||
// AdGuard DNS Filter
|
// AdGuard DNS Filter
|
||||||
'https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt',
|
'https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt',
|
||||||
// uBlock Origin Filter List
|
// uBlock Origin Filter List
|
||||||
'https://ublockorigin.github.io/uAssetsCDN/filters/filters.txt',
|
[
|
||||||
'https://ublockorigin.github.io/uAssetsCDN/filters/filters-2020.txt',
|
'https://ublockorigin.github.io/uAssets/filters/filters.txt',
|
||||||
'https://ublockorigin.github.io/uAssetsCDN/filters/filters-2021.txt',
|
[
|
||||||
'https://ublockorigin.github.io/uAssetsCDN/filters/filters-2022.txt',
|
'https://ublockorigin.github.io/uAssetsCDN/filters/filters.txt',
|
||||||
|
'https://ublockorigin.pages.dev/filters/filters.txt'
|
||||||
|
]
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'https://ublockorigin.github.io/uAssets/filters/filters-2020.txt',
|
||||||
|
[
|
||||||
|
'https://ublockorigin.github.io/uAssetsCDN/filters/filters-2020.txt',
|
||||||
|
'https://ublockorigin.pages.dev/filters/filters-2020.txt'
|
||||||
|
]
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'https://ublockorigin.github.io/uAssets/filters/filters-2021.txt',
|
||||||
|
[
|
||||||
|
'https://ublockorigin.github.io/uAssetsCDN/filters/filters-2021.txt',
|
||||||
|
'https://ublockorigin.pages.dev/filters/filters-2021.txt'
|
||||||
|
]
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'https://ublockorigin.github.io/uAssets/filters/filters-2022.txt',
|
||||||
|
[
|
||||||
|
'https://ublockorigin.github.io/uAssetsCDN/filters/filters-2022.txt',
|
||||||
|
'https://ublockorigin.pages.dev/filters/filters-2022.txt'
|
||||||
|
]
|
||||||
|
],
|
||||||
// uBlock Origin Badware Risk List
|
// uBlock Origin Badware Risk List
|
||||||
'https://ublockorigin.github.io/uAssets/filters/badware.txt',
|
[
|
||||||
|
'https://ublockorigin.github.io/uAssets/filters/badware.txt',
|
||||||
|
[
|
||||||
|
'https://ublockorigin.github.io/uAssetsCDN/filters/badware.txt',
|
||||||
|
'https://ublockorigin.pages.dev/filters/badware.txt'
|
||||||
|
]
|
||||||
|
],
|
||||||
// uBlock Origin Privacy List
|
// uBlock Origin Privacy List
|
||||||
'https://ublockorigin.github.io/uAssets/filters/privacy.txt',
|
[
|
||||||
|
'https://ublockorigin.github.io/uAssets/filters/privacy.txt',
|
||||||
|
[
|
||||||
|
'https://ublockorigin.github.io/uAssetsCDN/filters/privacy.txt',
|
||||||
|
'https://ublockorigin.pages.dev/filters/privacy.txt'
|
||||||
|
]
|
||||||
|
],
|
||||||
// uBlock Origin Resource Abuse
|
// uBlock Origin Resource Abuse
|
||||||
'https://ublockorigin.github.io/uAssets/filters/resource-abuse.txt',
|
[
|
||||||
|
'https://ublockorigin.github.io/uAssets/filters/resource-abuse.txt',
|
||||||
|
[
|
||||||
|
'https://ublockorigin.github.io/uAssetsCDN/filters/resource-abuse.txt',
|
||||||
|
'https://ublockorigin.pages.dev/filters/resource-abuse.txt'
|
||||||
|
]
|
||||||
|
],
|
||||||
// uBlock Origin Unbreak
|
// uBlock Origin Unbreak
|
||||||
'https://ublockorigin.github.io/uAssets/filters/unbreak.txt',
|
[
|
||||||
|
'https://ublockorigin.github.io/uAssets/filters/unbreak.txt',
|
||||||
|
[
|
||||||
|
'https://ublockorigin.github.io/uAssetsCDN/filters/unbreak.txt',
|
||||||
|
'https://ublockorigin.pages.dev/filters/unbreak.txt'
|
||||||
|
]
|
||||||
|
],
|
||||||
// AdGuard Base Filter
|
// AdGuard Base Filter
|
||||||
'https://filters.adtidy.org/extension/ublock/filters/2_without_easylist.txt',
|
'https://filters.adtidy.org/extension/ublock/filters/2_without_easylist.txt',
|
||||||
// AdGuard Mobile AD
|
// AdGuard Mobile AD
|
||||||
@ -138,32 +186,32 @@ const threads = isCI ? cpuCount : cpuCount / 2;
|
|||||||
]
|
]
|
||||||
],
|
],
|
||||||
// Curben's UrlHaus Malicious URL Blocklist
|
// Curben's UrlHaus Malicious URL Blocklist
|
||||||
// Prefer mirror, since malware-filter.gitlab.io has not been updated for a while
|
[
|
||||||
'https://curbengh.github.io/urlhaus-filter/urlhaus-filter-agh-online.txt',
|
'https://curbengh.github.io/urlhaus-filter/urlhaus-filter-agh-online.txt',
|
||||||
// [
|
[
|
||||||
// 'https://malware-filter.pages.dev/urlhaus-filter-agh-online.txt',
|
'https://urlhaus-filter.pages.dev/urlhaus-filter-agh-online.txt',
|
||||||
// [
|
// Prefer mirror, since malware-filter.gitlab.io has not been updated for a while
|
||||||
// 'https://malware-filter.gitlab.io/urlhaus-filter/urlhaus-filter-agh-online.txt'
|
// 'https://malware-filter.gitlab.io/urlhaus-filter/urlhaus-filter-agh-online.txt'
|
||||||
// ]
|
]
|
||||||
// ],
|
],
|
||||||
// Curben's Phishing URL Blocklist
|
// Curben's Phishing URL Blocklist
|
||||||
// Prefer mirror, since malware-filter.gitlab.io has not been updated for a while
|
[
|
||||||
'https://curbengh.github.io/phishing-filter/phishing-filter-agh.txt',
|
'https://curbengh.github.io/phishing-filter/phishing-filter-agh.txt',
|
||||||
// [
|
[
|
||||||
// 'https://phishing-filter.pages.dev/phishing-filter-agh.txt',
|
'https://phishing-filter.pages.dev/phishing-filter-agh.txt',
|
||||||
// [
|
// Prefer mirror, since malware-filter.gitlab.io has not been updated for a while
|
||||||
// 'https://malware-filter.gitlab.io/malware-filter/phishing-filter-agh.txt'
|
// 'https://malware-filter.gitlab.io/malware-filter/phishing-filter-agh.txt'
|
||||||
// ]
|
]
|
||||||
// ],
|
],
|
||||||
// Curben's PUP Domains Blocklist
|
// Curben's PUP Domains Blocklist
|
||||||
'https://curbengh.github.io/pup-filter/pup-filter-agh.txt',
|
[
|
||||||
// Prefer mirror, since malware-filter.gitlab.io has not been updated for a while
|
'https://curbengh.github.io/pup-filter/pup-filter-agh.txt',
|
||||||
// [
|
[
|
||||||
// 'https://pup-filter.pages.dev/pup-filter-agh.txt',
|
'https://pup-filter.pages.dev/pup-filter-agh.txt',
|
||||||
// [
|
// Prefer mirror, since malware-filter.gitlab.io has not been updated for a while
|
||||||
// 'https://malware-filter.gitlab.io/malware-filter/pup-filter-agh.txt'
|
// 'https://malware-filter.gitlab.io/malware-filter/pup-filter-agh.txt'
|
||||||
// ]
|
]
|
||||||
// ],
|
],
|
||||||
// GameConsoleAdblockList
|
// GameConsoleAdblockList
|
||||||
'https://raw.githubusercontent.com/DandelionSprout/adfilt/master/GameConsoleAdblockList.txt',
|
'https://raw.githubusercontent.com/DandelionSprout/adfilt/master/GameConsoleAdblockList.txt',
|
||||||
// PiHoleBlocklist
|
// PiHoleBlocklist
|
||||||
|
|||||||
@ -122,7 +122,9 @@ async function processFilterRules (filterRulesUrl, fallbackUrls) {
|
|||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
|
||||||
filterRules.forEach(line => {
|
for (let i = 0, len = filterRules.length; i < len; i++) {
|
||||||
|
const line = filterRules[i];
|
||||||
|
|
||||||
const lineStartsWithDoubleVerticalBar = line.startsWith('||');
|
const lineStartsWithDoubleVerticalBar = line.startsWith('||');
|
||||||
|
|
||||||
if (
|
if (
|
||||||
@ -136,7 +138,7 @@ async function processFilterRules (filterRulesUrl, fallbackUrls) {
|
|||||||
|| line === ''
|
|| line === ''
|
||||||
|| isIP(line) !== 0
|
|| isIP(line) !== 0
|
||||||
) {
|
) {
|
||||||
return;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const lineEndsWithCaret = line.endsWith('^');
|
const lineEndsWithCaret = line.endsWith('^');
|
||||||
@ -195,7 +197,8 @@ async function processFilterRules (filterRulesUrl, fallbackUrls) {
|
|||||||
|
|
||||||
blacklistDomainSets.add(`.${domain}`);
|
blacklistDomainSets.add(`.${domain}`);
|
||||||
}
|
}
|
||||||
} else if (line.startsWith('://')
|
} else if (
|
||||||
|
line.startsWith('://')
|
||||||
&& (
|
&& (
|
||||||
lineEndsWithCaret
|
lineEndsWithCaret
|
||||||
|| lineEndsWithCaretVerticalBar
|
|| lineEndsWithCaretVerticalBar
|
||||||
@ -211,7 +214,7 @@ async function processFilterRules (filterRulesUrl, fallbackUrls) {
|
|||||||
blacklistDomainSets.add(domain);
|
blacklistDomainSets.add(domain);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
|
||||||
console.timeEnd(` - processFilterRules: ${filterRulesUrl}`);
|
console.timeEnd(` - processFilterRules: ${filterRulesUrl}`);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user