build: remove oisd
This commit is contained in:
parent
1158cb1f72
commit
c1da46d7da
39
src/build.js
39
src/build.js
|
@ -28,20 +28,6 @@ const projects = [
|
|||
'botnet-filter',
|
||||
// 'pup-filter'
|
||||
]
|
||||
const oisdFilters = {
|
||||
'https://abp.oisd.nl/basic/': 'oisd_abp_light.txt',
|
||||
'https://abp.oisd.nl/': 'oisd_abp.txt',
|
||||
'https://dbl.oisd.nl/basic/': 'oisd_dbl_light.txt',
|
||||
'https://dbl.oisd.nl/': 'oisd_dbl.txt',
|
||||
'https://dblw.oisd.nl/': 'oisd_dblw_light.txt',
|
||||
'https://dblw.oisd.nl/basic/': 'oisd_dblw.txt',
|
||||
'https://hosts.oisd.nl/basic/': 'oisd_hosts_light.txt',
|
||||
'https://hosts.oisd.nl/': 'oisd_hosts.txt',
|
||||
'https://dnsmasq.oisd.nl/basic/': 'oisd_dnsmasq_light.txt',
|
||||
'https://dnsmasq.oisd.nl/': 'oisd_dnsmasq.txt',
|
||||
'https://rpz.oisd.nl/basic/': 'oisd_rpz_light.txt',
|
||||
'https://rpz.oisd.nl/': 'oisd_rpz.txt',
|
||||
}
|
||||
|
||||
const pipelineStatus = async (url) => {
|
||||
console.log(`Checking pipeline from "${url}"`)
|
||||
|
@ -100,23 +86,6 @@ const dl = async (project) => {
|
|||
}
|
||||
}
|
||||
|
||||
const oisdDl = async (link, filename) => {
|
||||
const txtPath = join(publicPath, filename)
|
||||
console.log(`Downloading ${filename} from "${link}"`)
|
||||
try {
|
||||
await pipeline(
|
||||
Readable.fromWeb((await fetch(link)).body),
|
||||
createWriteStream(txtPath)
|
||||
)
|
||||
} catch ({ message }) {
|
||||
console.error(JSON.stringify({
|
||||
error: message,
|
||||
link,
|
||||
filename
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
const f = async () => {
|
||||
await mkdir(tmpPath, { recursive: true })
|
||||
await mkdir(publicPath, { recursive: true })
|
||||
|
@ -132,12 +101,4 @@ const f = async () => {
|
|||
}))
|
||||
}
|
||||
|
||||
const oisd = async () => {
|
||||
await mkdir(publicPath, { recursive: true })
|
||||
if (Object.hasOwn(envVar, 'CI_PROJECT_PATH') && envVar.CI_PROJECT_PATH === 'malware-filter/malware-filter') {
|
||||
await Promise.all(Object.entries(oisdFilters).map(([link, filename]) => { return oisdDl(link, filename) }))
|
||||
}
|
||||
}
|
||||
|
||||
f()
|
||||
oisd()
|
||||
|
|
Loading…
Reference in New Issue