diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-11-21 15:03:07 -0500 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-11-21 15:03:07 -0500 |
commit | 0b05009ec37a798dd3b2e48c1240064669ba8b25 (patch) | |
tree | c0d4e452944b607d18d6872eb12937efc1641e4d | |
parent | 41843133f95e7ca7ec45c40b88c06e35fd7d901e (diff) |
unify html
-rw-r--r-- | .gitignore | 10 | ||||
-rw-r--r-- | Makefile | 15 | ||||
-rw-r--r-- | crtsh-pem2html.go | 56 | ||||
-rw-r--r-- | diff-pem2html.go | 44 | ||||
-rw-r--r-- | index.html | 43 | ||||
-rwxr-xr-x | index.html.gen | 16 | ||||
-rw-r--r-- | style.scss | 57 | ||||
-rw-r--r-- | tls-pem2html.go | 59 |
8 files changed, 94 insertions, 206 deletions
@@ -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 @@ -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(`<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="utf-8"> - <title>CT log</title> - <style> - html { - height: 100%; - } - body { - font-size: 10px; - font-family: monospace; - height: 100%; - margin: 0; - display: flex; - align-items: center; - } - body > * { - margin: auto; - } - table { - border-collapse: collapse; - } - caption p { - margin: 0; - } - td, th { - padding: 0; - border: solid 1px black; - white-space: nowrap; - } - td { - background-color: #F3F3F3; - } - tr:hover td { - background-color: #AAAAF3 !important; - } - td a { - padding: 0.1em 0.25em; - display: block; - width: 100%; - height: 100%; - color: black; - } - time .time { - display: none - } - </style> - <script src="sorttable.js"></script> - <base target="_parent" /> -</head> -<body> -<table class=sortable> + }).Parse(`<table class=sortable> <caption> <p>CT log (Updated {{.now | datetime}})</p> </caption> @@ -105,8 +53,6 @@ var tmpl = template.Must(template.New("pem2html"). </tr> {{end}} </table> -</body> -</html> `)) 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(`<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="utf-8"> - <title>CT log accuracy</title> - <style> - html { - height: 100%; - } - body { - font-size: 10px; - font-family: monospace; - height: 100%; - margin: 0; - display: flex; - align-items: center; - } - body > * { - margin: auto; - } - .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; } - tr:hover a { - background-color: #AAAAF3; - } - td a { - text-decoration: none; - padding: 0.1em 0.25em; - display: block; - width: 100%; - height: 100%; - color: black; - } - </style> - <script src="sorttable.js"></script> - <base target="_parent" /> -</head> -<body> -<table> +var tmpl = template.Must(template.New("2html").Parse(`<table class=diff> <tr class="diff-del"><td colspan=4>--- tls.pem</td></tr> <tr class="diff-add"><td colspan=4>+++ crtsh.pem</td></tr> <tr class="diff-dat"><td colspan=4>@@ -1,{{.nTLS}} +1,{{.nCrtSh}} @@</td></tr> @@ -77,8 +37,6 @@ var tmpl = template.Must(template.New("2html").Parse(`<!DOCTYPE html> </tr> {{end}} </table> -</body> -</html> `)) 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 @@ -<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="utf-8"> - <title>Dashboard</title> - <style> - html { - height: 100%; - } - body { - font-size: 10px; - font-family: monospace; - height: 100%; - margin: 0; - display: flex; - align-items: center; - } - body > * { - width: 100%; - height: 100%; - } - iframe { - width: 100%; - height: 100%; - display: block; - border: 0; - top: 0; - position: absolute; - } - td { - position: relative; - } - </style> - <script src="sorttable.js"></script> -</head> -<body> - <table> - <tr><td><iframe src="tls.html"></iframe></td></tr> - <tr><td><iframe src="crtsh.html"></iframe></td></tr> - <tr><td><iframe src="diff.html"></iframe></td></tr> - </table> -</body> -</html> 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 '<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8"> + <title>Dashboard</title> + <link rel=stylesheet href=style.css> + <script src="sorttable.js"></script> +</head> +<body> +' +cat tls.html.part crtsh.html.part diff.html.part +echo '</body> +</html> +' 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(`<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="utf-8"> - <title>Live Certs</title> - <style> - html { - height: 100%; - } - body { - font-size: 10px; - font-family: monospace; - height: 100%; - margin: 0; - display: flex; - align-items: center; - } - body > * { - margin: auto; - } - table { - border-collapse: collapse; - } - caption p { - margin: 0; - } - td, th { - padding: 0; - border: solid 1px black; - white-space: nowrap; - } - td { - background-color: #F3F3F3; - } - tr.invalid td { - background-color: #F30000 !important; - } - tr:hover td, tr.invalid:hover td { - background-color: #AAAAF3 !important; - } - td a { - padding: 0.1em 0.25em; - display: block; - width: 100%; - height: 100%; - color: black; - } - time .time { - display: none - } - </style> - <script src="sorttable.js"></script> - <base target="_parent" /> -</head> -<body> -<table class=sortable> + }).Parse(`<table class=sortable> <caption> <p>Live Certs (Updated {{.now | datetime}})</p> </caption> @@ -106,8 +51,6 @@ var tmpl = template.Must(template.New("pem2html"). </tr> {{end}} </table> -</body> -</html> `)) func fDate(t time.Time) template.HTML { |