mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-12 01:00:34 +08:00
Chore: backward compatible of reject_phishing file
This commit is contained in:
parent
643447ce06
commit
69da11a3b3
@ -29,6 +29,7 @@ export const buildChnCidr = task(import.meta.path, async () => {
|
|||||||
'Data from https://misaka.io (misakaio @ GitHub)'
|
'Data from https://misaka.io (misakaio @ GitHub)'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// Can not use createRuleset here, as Clash support advanced ipset syntax
|
||||||
return Promise.all([
|
return Promise.all([
|
||||||
compareAndWriteFile(
|
compareAndWriteFile(
|
||||||
withBannerArray(
|
withBannerArray(
|
||||||
|
|||||||
@ -207,11 +207,9 @@ export const buildRejectDomainSet = task(import.meta.path, async () => {
|
|||||||
rejectDomainsStats.map(([domain, count]) => `${domain}${' '.repeat(100 - domain.length)}${count}`),
|
rejectDomainsStats.map(([domain, count]) => `${domain}${' '.repeat(100 - domain.length)}${count}`),
|
||||||
path.resolve(import.meta.dir, '../List/internal/reject-stats.txt')
|
path.resolve(import.meta.dir, '../List/internal/reject-stats.txt')
|
||||||
),
|
),
|
||||||
// Copy reject_sukka.conf for backward compatibility
|
Bun.write(
|
||||||
fsp.cp(
|
|
||||||
path.resolve(import.meta.dir, '../Source/domainset/reject_sukka.conf'),
|
|
||||||
path.resolve(import.meta.dir, '../List/domainset/reject_sukka.conf'),
|
path.resolve(import.meta.dir, '../List/domainset/reject_sukka.conf'),
|
||||||
{ force: true, recursive: true }
|
'# The file has been deprecated, its content has been merged into the main `reject` domainset.\n'
|
||||||
)
|
)
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -68,14 +68,14 @@ export async function compareAndWriteFile(linesA: string[], filePath: string) {
|
|||||||
|
|
||||||
export const withBannerArray = (title: string, description: string[], date: Date, content: string[]) => {
|
export const withBannerArray = (title: string, description: string[], date: Date, content: string[]) => {
|
||||||
return [
|
return [
|
||||||
'########################################',
|
'#########################################',
|
||||||
`# ${title}`,
|
`# ${title}`,
|
||||||
`# Last Updated: ${date.toISOString()}`,
|
`# Last Updated: ${date.toISOString()}`,
|
||||||
`# Size: ${content.length}`,
|
`# Size: ${content.length}`,
|
||||||
...description.map(line => (line ? `# ${line}` : '#')),
|
...description.map(line => (line ? `# ${line}` : '#')),
|
||||||
'########################################',
|
'#########################################',
|
||||||
...content,
|
...content,
|
||||||
'################# END ###################'
|
'################## EOF ##################'
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -90,10 +90,7 @@ export const getPhishingDomains = () => traceAsync('get phishing domains', async
|
|||||||
// // 'https://malware-filter.gitlab.io/malware-filter/phishing-filter-agh.txt'
|
// // 'https://malware-filter.gitlab.io/malware-filter/phishing-filter-agh.txt'
|
||||||
// ]
|
// ]
|
||||||
// ),
|
// ),
|
||||||
getGorhillPublicSuffixPromise(),
|
getGorhillPublicSuffixPromise()
|
||||||
// Remove old files
|
|
||||||
fsp.rm(path.resolve(import.meta.dir, '../../List/domainset/reject_phishing.conf'), { force: true }),
|
|
||||||
fsp.rm(path.resolve(import.meta.dir, '../../Clash/domainset/reject_phishing.txt'), { force: true })
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
traceSync.skip('* whitelisting phishing domains', () => {
|
traceSync.skip('* whitelisting phishing domains', () => {
|
||||||
|
|||||||
2
Source/domainset/reject_phishing.conf
Normal file
2
Source/domainset/reject_phishing.conf
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# $ meta_title Sukka's Ruleset - Reject Phishing
|
||||||
|
# $ meta_description The file has been deprecated, its content has been merged into the main `reject` domainset.
|
||||||
Loading…
x
Reference in New Issue
Block a user