From 0b05009ec37a798dd3b2e48c1240064669ba8b25 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 21 Nov 2016 15:03:07 -0500 Subject: unify html --- .gitignore | 10 ++++++++-- Makefile | 15 +++++++++----- crtsh-pem2html.go | 56 +--------------------------------------------------- diff-pem2html.go | 44 +---------------------------------------- index.html | 43 ---------------------------------------- index.html.gen | 16 +++++++++++++++ style.scss | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tls-pem2html.go | 59 +------------------------------------------------------ 8 files changed, 94 insertions(+), 206 deletions(-) delete mode 100644 index.html create mode 100755 index.html.gen create mode 100644 style.scss diff --git a/.gitignore b/.gitignore index 68641cd..2356362 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,18 @@ *.html -!index.html +*.html.part +*.map *.pem *.txt -!config-*.txt NET-* +!config-*.txt +style.css + +# programs crtsh-pem2html tls-getcerts tls-pem2html diff-pem2html diff + +.sass-cache diff --git a/Makefile b/Makefile index e3d6c36..dcf87dd 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,10 @@ -all: index.html -all: crtsh.html -all: tls.html -all: diff.html +all: index.html style.css %: %.go go build $< +index.html: tls.html.part crtsh.html.part diff.html.part + crtsh.pem: crtsh-getcerts config-domains.txt NET-crtsh ./crtsh-getcerts $$(cat config-domains.txt) > $@ @@ -15,9 +14,15 @@ tls.pem: tls-getcerts config-sockets.txt NET-tls diff.pem: diff tls.pem crtsh.pem ./diff tls.pem crtsh.pem > $@ -tls.html crtsh.html diff.html: %.html: %.pem %-pem2html +%.html.part: %.pem %-pem2html ./$*-pem2html < $< > $@ +%: %.gen + ./$< $(filter-out $<,$^) > $@ + +%.css: %.scss + scss $< $@ + NET-%: date > $@ diff --git a/crtsh-pem2html.go b/crtsh-pem2html.go index 34003f5..ebdb6ac 100644 --- a/crtsh-pem2html.go +++ b/crtsh-pem2html.go @@ -32,59 +32,7 @@ var tmpl = template.Must(template.New("pem2html"). "green": green, "date": fDate, "datetime": fDateTime, - }).Parse(` - - - - CT log - - - - - - + }).Parse(`
@@ -105,8 +53,6 @@ var tmpl = template.Must(template.New("pem2html"). {{end}}

CT log (Updated {{.now | datetime}})

- - `)) func fDate(t time.Time) template.HTML { diff --git a/diff-pem2html.go b/diff-pem2html.go index 8f3b1e9..3b7716b 100644 --- a/diff-pem2html.go +++ b/diff-pem2html.go @@ -24,47 +24,7 @@ func handleBool(ok bool, str string, a ...interface{}) { } } -var tmpl = template.Must(template.New("2html").Parse(` - - - - CT log accuracy - - - - - - +var tmpl = template.Must(template.New("2html").Parse(`
@@ -77,8 +37,6 @@ var tmpl = template.Must(template.New("2html").Parse(` {{end}}
--- tls.pem
+++ crtsh.pem
@@ -1,{{.nTLS}} +1,{{.nCrtSh}} @@
- - `)) type Cert struct { diff --git a/index.html b/index.html deleted file mode 100644 index 7bb1c61..0000000 --- a/index.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - Dashboard - - - - - - - - -
- - diff --git a/index.html.gen b/index.html.gen new file mode 100755 index 0000000..326d63c --- /dev/null +++ b/index.html.gen @@ -0,0 +1,16 @@ +#!/bin/sh + +echo ' + + + + Dashboard + + + + +' +cat tls.html.part crtsh.html.part diff.html.part +echo ' + +' diff --git a/style.scss b/style.scss new file mode 100644 index 0000000..88777df --- /dev/null +++ b/style.scss @@ -0,0 +1,57 @@ +/* page layout */ +html { + height: 100%; +} +body { + font-size: 10px; + font-family: monospace; + height: 100%; + margin: 0; + + display: flex; + flex-direction: column; + align-items: center; +} +body > * { + margin: auto; +} +/* diff styling */ +table.diff td, th { white-space: nowrap; } +.diff-del, .diff-del a { color: red; } +.diff-add, .diff-add a { color: green; } +.diff-dat, .diff-dat a { color: blue; } +.diff-ctx, .diff-ctx a { color: black; } +/* sortable styling */ +table.sortable { + border-collapse: collapse; + caption p { + margin: 0; + } + td, th { + padding: 0; + border: solid 1px black; + white-space: nowrap; + } + td { + background-color: #F3F3F3; + } +} +/* generic table interaction */ +tr.invalid td { + background-color: #F30000 !important; +} +tr:hover a, tr.invalid:hover a { + background-color: #AAAAF3 !important; +} +td a { + text-decoration: none; + padding: 0.1em 0.25em; + display: block; + width: 100%; + height: 100%; + color: black; +} +/* generic time formatting */ +time .time { + display: none +} diff --git a/tls-pem2html.go b/tls-pem2html.go index f3581fd..8eb438c 100644 --- a/tls-pem2html.go +++ b/tls-pem2html.go @@ -32,62 +32,7 @@ var tmpl = template.Must(template.New("pem2html"). "green": green, "date": fDate, "datetime": fDateTime, - }).Parse(` - - - - Live Certs - - - - - - + }).Parse(`
@@ -106,8 +51,6 @@ var tmpl = template.Must(template.New("pem2html"). {{end}}

Live Certs (Updated {{.now | datetime}})

- - `)) func fDate(t time.Time) template.HTML { -- cgit v1.2.3-2-g168b