-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
100 lines (72 loc) · 2.04 KB
/
Makefile
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
VERSION= $(shell cat $(VERSION_FILE))
VERSION_FILE= version.txt
SOURCE= data/domains.json
DESTINATION= webusaito.kirei.se:/d/www/www.kirei.se/tls
LIST= domains.txt
SUMMARY= summary.json
DOMAINS= results/$(VERSION)-domains.json
REPORT= results/$(VERSION)-ssllabs.json
LOGFILE= results/$(VERSION)-ssllabs.log
REDIRECT= results/$(VERSION)-redirect.json
DNS= results/$(VERSION)-dns.json
SCRIPT_SUMMARY= scripts/summarize-ssllabs.pl
SCRIPT_WEB= scripts/create-web.pl
TMPFILES= $(LIST) $(SUMMARY)
TEMPLATE_EN= templates/en.html
TEMPLATE_SV= templates/sv.html
I18N= templates/i18n.json
HTML_EN= web/report.en.html
HTML_SV= web/report.sv.html
API= https://api.ssllabs.com/api/v2/
SCANNER= ssllabs-scan --api="$(API)"
all:
refresh:
date +%Y%m%d > $(VERSION_FILE)
check: $(LIST)
scan: $(REPORT)
redirect: $(REDIRECT)
dns: $(DNS)
summary: $(SUMMARY)
web: $(HTML_SV) $(HTML_EN)
save:
git add $(DOMAINS) $(REPORT) $(LOGFILE) $(REDIRECT) $(DNS)
git commit -m "update results" $(DOMAINS) $(REPORT) $(LOGFILE) $(REDIRECT) $(DNS) $(VERSION_FILE)
webdist:
rsync -av --delete --exclude .DS_Store web/ $(DESTINATION)/
$(REDIRECT): $(LIST)
perl scripts/check-redirect.pl $(LIST) > $@
$(DNS): $(LIST)
perl scripts/check-dns.pl $(LIST) > $@
$(REPORT): $(LIST)
$(SCANNER) \
--usecache=true --maxage=24 \
--hostfile=$(LIST) \
--verbosity=debug \
>$@ 2>$(LOGFILE)
$(SUMMARY): $(DOMAINS) $(REDIRECT) $(DNS) $(REPORT) $(SCRIPT_SUMMARY)
perl scripts/summarize-ssllabs.pl \
--domains $(DOMAINS) \
--report $(REPORT) \
--redirect $(REDIRECT) \
--dns $(DNS) \
> $@
$(DOMAINS):
cp $(SOURCE) $@
$(HTML_SV): $(SUMMARY) $(TEMPLATE_SV) $(SCRIPT_WEB) $(I18N)
perl scripts/create-web.pl \
--language sv \
--i18n $(I18N) \
--template $(TEMPLATE_SV) \
--summary $(SUMMARY) \
> $@
$(HTML_EN): $(SUMMARY) $(TEMPLATE_EN) $(SCRIPT_WEB) $(I18N)
perl scripts/create-web.pl \
--language en \
--i18n $(I18N) \
--template $(TEMPLATE_EN) \
--summary $(SUMMARY) \
> $@
$(LIST): $(DOMAINS)
jq -r '.[].domain' $(DOMAINS) > $@
clean:
rm -f $(TMPFILES)