CI / Docker image (build and smoke test) (push) Skipped
CI / Format and vet (push) Successful in 27s
CI / Dependency audit (push) Successful in 18s
CI / Tests (Linux, race detector) (push) Successful in 58s
Release / Plan (reuse the published image?) (push) Successful in 4s
Release / ci (push) Skipped
Release / Build image (amd64) (push) Skipped
Release / Build image (arm64) (push) Skipped
Release / Publish tags (push) Successful in 13s
Release / Gitea release (push) Successful in 5s
Intelligence: attack families mapped to MITRE ATT&CK, network type from
ASN/rDNS without external APIs, request cadence, sessions with
recon/probe/exploit/access/banned stages, campaigns across IPs, verdict
with reasons, recommended actions, exposure detection (2xx with a body
on sensitive paths), STIX 2.1 export, FCrDNS for search engine bots,
optional Tor exit list.
Data: 30-day retention, twelve ranges plus custom from/to, an on-disk
event log (daily files, hourly gzip members, size cap, corruption and
disk-full tolerant), /events, /period, /metrics with stable per-hour
metrics, an extended /ip/{ip}, and peer /period merged on the hub.
Interface: layout system with fixed card sizes, range picker in the
URL, IP analysis page, Replay page, Geography down to state and city
(Natural Earth admin-1), Live page redesigned with stable metrics and a
reusable attack map. Demo data and documentation screenshots.
Security: bounded and deadline-limited period computations, linear
campaign clustering, singleflight caches, sanitized peer studies, event
query budgets, gzip bomb guard.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
90 lines
2.9 KiB
Bash
Executable File
90 lines
2.9 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Local verification: runs the same checks as CI before pushing. Anything the
|
|
# machine lacks (go, node, docker, govulncheck) is skipped with a warning.
|
|
#
|
|
# scripts/check.sh fast: gofmt, go vet, i18n, scripts, workflows, compose
|
|
# scripts/check.sh --full also runs go test -race and govulncheck
|
|
# scripts/check.sh --ui also renders every route and fails on horizontal overflow
|
|
# (needs Chrome and puppeteer-core; skipped when missing)
|
|
#
|
|
# CI takes minutes per run; almost everything that breaks it is caught here
|
|
# in seconds.
|
|
set -uo pipefail
|
|
cd "$(dirname "$0")/.."
|
|
full=0
|
|
ui=0
|
|
for a in "$@"; do
|
|
[ "$a" = "--full" ] && full=1
|
|
[ "$a" = "--ui" ] && ui=1
|
|
done
|
|
failures=()
|
|
step() { # step "name" command...
|
|
local name="$1"; shift
|
|
printf '\n\033[1m== %s\033[0m\n' "$name"
|
|
if "$@"; then printf '\033[32mok\033[0m %s\n' "$name"; else printf '\033[31mFAILED\033[0m %s\n' "$name"; failures+=("$name"); fi
|
|
}
|
|
skip() { printf '\n\033[33mskipped\033[0m %s (%s)\n' "$1" "$2"; }
|
|
|
|
if command -v go >/dev/null; then
|
|
step "formatting (gofmt)" bash -c 'out=$(gofmt -l .); [ -z "$out" ] || { echo "$out"; exit 1; }'
|
|
step "go vet" go vet ./...
|
|
else
|
|
skip "gofmt and go vet" "go not installed"
|
|
fi
|
|
|
|
if command -v node >/dev/null; then
|
|
step "UI translation coverage" node scripts/check-ui-i18n.mjs
|
|
else
|
|
skip "UI translation coverage" "node not installed"
|
|
fi
|
|
|
|
if [ "$ui" = 1 ]; then
|
|
if command -v go >/dev/null && command -v node >/dev/null; then
|
|
bin="$(mktemp -d)/urutau"
|
|
if go build -o "$bin" ./cmd/urutau; then step "UI layout (no horizontal overflow)" node scripts/ui-overflow.mjs "$bin"; else skip "UI layout" "build failed"; fi
|
|
else
|
|
skip "UI layout" "go or node not installed"
|
|
fi
|
|
fi
|
|
|
|
step "bash script syntax" bash -c 'for f in scripts/*.sh .githooks/*; do bash -n "$f" || exit 1; done'
|
|
|
|
if python3 -c 'import yaml' 2>/dev/null; then
|
|
step "workflows and templates (valid YAML)" python3 -c "
|
|
import glob, yaml
|
|
for f in glob.glob('.gitea/**/*.yml', recursive=True):
|
|
yaml.safe_load(open(f))
|
|
"
|
|
else
|
|
skip "workflows and templates (valid YAML)" "PyYAML missing: pip install pyyaml"
|
|
fi
|
|
|
|
step "brand assets" test -s logo.png
|
|
|
|
if command -v docker >/dev/null && docker compose version >/dev/null 2>&1; then
|
|
step "docker compose config" docker compose config --quiet
|
|
else
|
|
skip "docker compose config" "docker compose not available"
|
|
fi
|
|
|
|
if [ "$full" = 1 ]; then
|
|
if command -v go >/dev/null; then
|
|
step "tests (go test -race)" go test -race ./...
|
|
if command -v govulncheck >/dev/null; then
|
|
step "dependency audit (govulncheck)" govulncheck ./...
|
|
else
|
|
skip "govulncheck" "install: go install golang.org/x/vuln/cmd/govulncheck@latest"
|
|
fi
|
|
else
|
|
skip "tests and govulncheck" "go not installed"
|
|
fi
|
|
fi
|
|
|
|
printf '\n'
|
|
if [ ${#failures[@]} -eq 0 ]; then
|
|
printf '\033[32mall checks passed\033[0m: ready to push.\n'
|
|
else
|
|
printf '\033[31mfailed:\033[0m %s\n' "${failures[*]}"
|
|
exit 1
|
|
fi
|