-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathurl-metadata.lua
More file actions
37 lines (33 loc) · 999 Bytes
/
url-metadata.lua
File metadata and controls
37 lines (33 loc) · 999 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
-- Description: Search for build-metadata files
-- Version: 0.1.0
-- Source: urls
-- License: MIT
function run(arg)
build_files = {'README',
'README.md',
'.ci.env',
'.travis.yml',
'.gitlab-ci.yml',
'Jenkinsfile',
'bitbucket-pipelines.yml',
'Makefile',
'Dockerfile',
'docker-compose.yml',
'docker-compose.yaml'}
for i=1, #build_files do
url = url_join(arg['value'], build_files[i])
info("Scanning " .. url)
session = http_mksession()
req = http_request(session, 'GET', url, {})
reply = http_send(req)
if last_err() then return end
if reply['status'] == 200 then
db_add('url', {
subdomain_id=arg['subdomain_id'],
value=url,
status=reply['status'],
body=reply['text'],
})
end
end
end