summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitattributes4
-rw-r--r--statuspage/fonts/scientifica.ttfbin0 -> 120736 bytes
-rw-r--r--statuspage/fonts/scientificaBold.ttfbin0 -> 108444 bytes
-rw-r--r--statuspage/fonts/scientificaItalic.ttfbin0 -> 122064 bytes
-rwxr-xr-xstatuspage/render.sh14
5 files changed, 16 insertions, 2 deletions
diff --git a/.gitattributes b/.gitattributes
index dfdb8b7..01e53bc 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1 +1,5 @@
*.sh text eol=lf
+*.ttf binary
+*.woff binary
+*.woff2 binary
+*.otf binary
diff --git a/statuspage/fonts/scientifica.ttf b/statuspage/fonts/scientifica.ttf
new file mode 100644
index 0000000..1753d31
--- /dev/null
+++ b/statuspage/fonts/scientifica.ttf
Binary files differ
diff --git a/statuspage/fonts/scientificaBold.ttf b/statuspage/fonts/scientificaBold.ttf
new file mode 100644
index 0000000..0cd01a7
--- /dev/null
+++ b/statuspage/fonts/scientificaBold.ttf
Binary files differ
diff --git a/statuspage/fonts/scientificaItalic.ttf b/statuspage/fonts/scientificaItalic.ttf
new file mode 100644
index 0000000..ef29a47
--- /dev/null
+++ b/statuspage/fonts/scientificaItalic.ttf
Binary files differ
diff --git a/statuspage/render.sh b/statuspage/render.sh
index 301b85d..aec302c 100755
--- a/statuspage/render.sh
+++ b/statuspage/render.sh
@@ -12,11 +12,17 @@ set -u
SELF_DIR=$(cd "$(dirname "$0")" && pwd)
CHECKS_DIR="$SELF_DIR/checks"
OUT=${STATUSPAGE_OUT:-/usr/local/www/status/index.html}
+OUT_DIR=$(dirname "$OUT")
HOST=$(hostname)
NOW=$(date "+%Y-%m-%d %H:%M:%S %Z")
. "$SELF_DIR/lib/common.sh"
+# Caddy serves $OUT_DIR, not this checkout - symlink the font files in so
+# the @font-face rules below can actually fetch them. Idempotent, cheap
+# enough to just check every run rather than a separate one-time setup step.
+[ -L "$OUT_DIR/fonts" ] || ln -sf "$SELF_DIR/fonts" "$OUT_DIR/fonts" 2>/dev/null || true
+
JSONL=$(mktemp)
AWKFILE=$(mktemp)
trap 'rm -f "$JSONL" "$AWKFILE"' EXIT INT TERM
@@ -120,13 +126,17 @@ END {
print "<title>" htmlesc(host) " status</title>"
print "<meta http-equiv=\"refresh\" content=\"30\">"
print "<style>"
- print "body { background:#15111d; color:#e4dcee; font-family: monospace; padding: 2em; }"
+ print "@font-face { font-family: 'scientifica'; src: url('fonts/scientifica.ttf') format('truetype'); font-weight: normal; font-style: normal; }"
+ print "@font-face { font-family: 'scientifica'; src: url('fonts/scientificaBold.ttf') format('truetype'); font-weight: bold; font-style: normal; }"
+ print "@font-face { font-family: 'scientifica'; src: url('fonts/scientificaItalic.ttf') format('truetype'); font-weight: normal; font-style: italic; }"
+ print "body { background:#15111d; color:#e4dcee; font-family: 'scientifica', monospace; font-size: 16px; line-height: 1.4; padding: 2em; }"
print "h1 { color: #e0c3ff; margin-bottom: 0; display: inline-block; border-bottom: 2px solid #d9a441; padding-bottom: 6px; }"
print "h2 { color: #c084fc; border-bottom: 1px solid #3a2b4a; padding-bottom: 4px; }"
print ".cols { column-width: 380px; column-gap: 2.5em; }"
print ".section { break-inside: avoid; -webkit-column-break-inside: avoid; display: inline-block; width: 100%; vertical-align: top; margin-bottom: 1.5em; }"
print "table { border-collapse: collapse; width: 100%; }"
print "td { padding: 6px 10px; border-bottom: 1px solid #241c30; }"
+ print "td.label { padding-left: 28px; text-indent: -18px; }"
print ".sq { display:inline-block; width:12px; height:12px; border-radius:2px; margin-right:6px; vertical-align:middle; }"
print ".green { background:#3c3; }"
print ".yellow { background:#cc3; }"
@@ -149,7 +159,7 @@ END {
print "<table>"
for (j = 1; j <= count[sect]; j++) {
valcell = (V[sect, j] == "") ? "" : "<td class=\"val\">" htmlesc(V[sect, j]) "</td>"
- print "<tr><td><span class=\"sq " sqclass(S[sect, j]) "\"></span>" htmlesc(L[sect, j]) "</td>" valcell "</tr>"
+ print "<tr><td class=\"label\"><span class=\"sq " sqclass(S[sect, j]) "\"></span>" htmlesc(L[sect, j]) "</td>" valcell "</tr>"
}
print "</table>"
print "</div>"