Update Node.js dependency

main
Elbert Alias 3 years ago
parent 5a38edb3d5
commit e755746978

@ -16,7 +16,7 @@ If you don't have time to configure, host, debug and maintain your own infrastru
## Prerequisites ## Prerequisites
- [Git](https://git-scm.com) - [Git](https://git-scm.com)
- [Node.js](https://nodejs.org) version 12 or higher - [Node.js](https://nodejs.org) version 14 or higher
- [Yarn](https://yarnpkg.com) - [Yarn](https://yarnpkg.com)
## Quick start ## Quick start

@ -64,7 +64,7 @@
7 7
], ],
"name": "Hosting panels", "name": "Hosting panels",
"priority": 1 "priority": 2
}, },
"10": { "10": {
"groups": [ "groups": [
@ -136,7 +136,7 @@
6 6
], ],
"name": "Miscellaneous", "name": "Miscellaneous",
"priority": 9 "priority": 10
}, },
"20": { "20": {
"groups": [ "groups": [

@ -552,7 +552,7 @@ class Site {
if (!this.analyzedXhr[url.hostname].includes(hostname)) { if (!this.analyzedXhr[url.hostname].includes(hostname)) {
this.analyzedXhr[url.hostname].push(hostname) this.analyzedXhr[url.hostname].push(hostname)
await this.onDetect(url, await analyze({ xhr: hostname })) await this.onDetect(url, analyze({ xhr: hostname }))
} }
}, 1000) }, 1000)
} }
@ -590,7 +590,7 @@ class Site {
) { ) {
const scripts = await response.text() const scripts = await response.text()
await this.onDetect(response.url(), await analyze({ scripts })) await this.onDetect(response.url(), analyze({ scripts }))
} }
if (response.url() === url.href) { if (response.url() === url.href) {
@ -634,7 +634,7 @@ class Site {
? response.securityDetails().issuer() ? response.securityDetails().issuer()
: '' : ''
await this.onDetect(url, await analyze({ headers, certIssuer })) await this.onDetect(url, analyze({ headers, certIssuer }))
await this.emit('response', { page, response, headers, certIssuer }) await this.emit('response', { page, response, headers, certIssuer })
} }
@ -1076,10 +1076,7 @@ class Site {
this.log(`Probe ok (${path})`) this.log(`Probe ok (${path})`)
await this.onDetect( await this.onDetect(url, analyze({ [file]: body.slice(0, 100000) }))
url,
await analyze({ [file]: body.slice(0, 100000) })
)
} catch (error) { } catch (error) {
this.error(`Probe failed (${path}): ${error.message || error}`) this.error(`Probe failed (${path}): ${error.message || error}`)
} }
@ -1117,7 +1114,7 @@ class Site {
`Probe DNS ok: (${Object.values(dnsRecords).flat().length} records)` `Probe DNS ok: (${Object.values(dnsRecords).flat().length} records)`
) )
await this.onDetect(url, await analyze({ dns: dnsRecords })) await this.onDetect(url, analyze({ dns: dnsRecords }))
resolve() resolve()
}), }),

@ -42,5 +42,8 @@
}, },
"dependencies": { "dependencies": {
"puppeteer": "^10.4.0" "puppeteer": "^10.4.0"
},
"engines": {
"node": ">=14"
} }
} }

@ -416,9 +416,7 @@ const Driver = {
) )
}) })
Driver.onDetect(request.url, await analyze({ headers })).catch( Driver.onDetect(request.url, analyze({ headers })).catch(Driver.error)
Driver.error
)
} }
} catch (error) { } catch (error) {
Driver.error(error) Driver.error(error)
@ -444,7 +442,7 @@ const Driver = {
const scripts = await response.text() const scripts = await response.text()
Driver.onDetect(request.documentUrl, await analyze({ scripts })).catch( Driver.onDetect(request.documentUrl, analyze({ scripts })).catch(
Driver.error Driver.error
) )
} }
@ -492,7 +490,7 @@ const Driver = {
Driver.onDetect( Driver.onDetect(
request.originUrl || request.initiator, request.originUrl || request.initiator,
await analyze({ xhr: hostname }) analyze({ xhr: hostname })
).catch(Driver.error) ).catch(Driver.error)
} }
}, 1000) }, 1000)
@ -522,7 +520,7 @@ const Driver = {
await Driver.onDetect( await Driver.onDetect(
url, url,
await analyze({ url, ...items }, technologies), analyze({ url, ...items }, technologies),
language, language,
true true
) )

@ -1,9 +1,5 @@
'use strict' 'use strict'
function next() {
return new Promise((resolve) => setTimeout(resolve, 0))
}
function toArray(value) { function toArray(value) {
return Array.isArray(value) ? value : [value] return Array.isArray(value) ? value : [value]
} }
@ -204,7 +200,7 @@ const Wappalyzer = {
* Initialize analyzation. * Initialize analyzation.
* @param {*} param0 * @param {*} param0
*/ */
async analyze( analyze(
{ {
url, url,
xhr, xhr,
@ -231,10 +227,7 @@ const Wappalyzer = {
try { try {
const detections = flatten( const detections = flatten(
await Promise.all( technologies.map((technology) => {
technologies.map(async (technology) => {
await next()
return flatten([ return flatten([
oo(technology, 'url', url), oo(technology, 'url', url),
oo(technology, 'xhr', xhr), oo(technology, 'xhr', xhr),
@ -252,7 +245,6 @@ const Wappalyzer = {
mm(technology, 'dns', dns), mm(technology, 'dns', dns),
]) ])
}) })
)
).filter((technology) => technology) ).filter((technology) => technology)
return detections return detections