diff options
| author | batsumaru <> | 2026-07-01 16:36:55 +0900 |
|---|---|---|
| committer | batsumaru <> | 2026-07-01 16:36:55 +0900 |
| commit | 689ca3bdadc00015d5aedd81f76fd0950777f1ef (patch) | |
| tree | c9673ce29d84289e0d3b799d3f5d8e03bcc4b777 /.githooks/pre-commit | |
| parent | 358106287b28bffa8505b67fe623f77a3fbceae3 (diff) | |
Add ntpd/clock-sync check and a pre-commit hook for exec bits
checks/ntpd.sh reports whether ntpd is running and whether the clock's
offset is within tolerance (ok <50ms, warn <200ms, down beyond that or
if ntpq doesn't respond) - clock drift is a silent failure that
otherwise only surfaces later as TLS handshake failures or misleading
cross-jail log timestamps.
Also add .githooks/pre-commit + core.hooksPath, since this checkout is
on Windows where core.fileMode is false (the filesystem doesn't
reliably preserve the executable bit) - without it, a plain `git add`
on a new check script silently stages it as non-executable, and
render.sh skips non-executable files with no visible error.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Diffstat (limited to '.githooks/pre-commit')
| -rw-r--r-- | .githooks/pre-commit | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/.githooks/pre-commit b/.githooks/pre-commit new file mode 100644 index 0000000..220fc19 --- /dev/null +++ b/.githooks/pre-commit @@ -0,0 +1,13 @@ +#!/bin/sh +# .githooks/pre-commit +# This repo is checked out on Windows, which doesn't reliably preserve +# the executable bit (that's why core.fileMode is false - see +# statuspage/README.md). Without this hook, a newly-added *.sh file +# silently stages as non-executable, and render.sh skips non-executable +# files with no error - a broken check script wouldn't even show up as +# a down/warn row, it'd just vanish. +# +# Force +x on every staged *.sh file so that can't happen. +git diff --cached --name-only --diff-filter=ACM -- '*.sh' | while IFS= read -r f; do + git update-index --chmod=+x "$f" +done |
