feat!: Urutau 2.0.0, ultralight probes and a single analysis hub
Each server runs an ultralight probe (scratch image, ~7 MiB RSS) that tails the logs, ships raw lines to the hub over HTTPS with an on-disk spool, and applies enforce decisions locally. The hub keeps one node per probe (primary node = the 1.x data dir, unchanged), does all analysis and serves the UI. Peer federation is removed. 'urutau import' brings 1.x data dirs in with hash and count verification. UI: probes page, host qualified incidents, IPs never wrap, egress heatmap labels, live and replay globes no longer auto-rotate, replay repeat, live traffic metrics. BREAKING CHANGE: URUTAU_PEERS, URUTAU_PEER_* and /api/v1/peer/* are gone; log path variables move from the hub to the probe. See docs/migration-2.0.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
23a7a5963a
commit
8546d14cef
130 files changed
+9396
-3311
No files matched your search
@@ -332,33 +332,6 @@ func (s *Server) metricsAPI(w http.ResponseWriter, r *http.Request) {
|
||||
writeJSON(w, 200, out)
|
||||
}
|
||||
|
||||
// peerPeriod: GET /api/v1/peer/period, the study a hub merges; opened only by
|
||||
// the peer token (and --peer-allow). At most two run at once.
|
||||
func (s *Server) peerPeriod(w http.ResponseWriter, r *http.Request) {
|
||||
if !s.peerGate(w, r) {
|
||||
return
|
||||
}
|
||||
select {
|
||||
case s.study <- struct{}{}:
|
||||
defer func() { <-s.study }()
|
||||
default:
|
||||
w.Header().Set("Retry-After", "5")
|
||||
writeJSON(w, http.StatusServiceUnavailable, map[string]string{"error": "busy"})
|
||||
return
|
||||
}
|
||||
eq, ok := s.eventFilter(w, r, 24*time.Hour)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
pq := store.PeriodQuery{From: eq.From, To: eq.To, Host: s.opt.Store.Name(), IP: eq.IP, Cat: eq.Cat, Fam: eq.Fam}
|
||||
if v := r.URL.Query().Get("gap"); v != "" {
|
||||
if n, err := strconv.ParseInt(v, 10, 64); err == nil && n >= 30 && n <= 86400 {
|
||||
pq.Gap = n
|
||||
}
|
||||
}
|
||||
writeJSON(w, 200, s.opt.Store.StudyFor(pq))
|
||||
}
|
||||
|
||||
// listed reproduces the blocklist rule for one row.
|
||||
func (s *Server) listed(x store.IPSummary) bool {
|
||||
if x.Score < 50 || !x.Strong || x.Admin {
|
||||
|
||||
Reference in new issue
Block a user