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>
29 lines
915 B
Go
29 lines
915 B
Go
package server
|
|
|
|
import (
|
|
"encoding/json"
|
|
|
|
"git.lucasrguerra.dev.br/ciberfauna/urutau/internal/store"
|
|
)
|
|
|
|
// fakeBackend is an in-process node serving a fixed export.
|
|
type fakeBackend struct {
|
|
name string
|
|
exp store.PeerExport
|
|
}
|
|
|
|
func (f fakeBackend) Name() string { return f.name }
|
|
func (f fakeBackend) Export(store.Range) store.PeerExport { return f.exp }
|
|
func (f fakeBackend) Study(q store.PeriodQuery) store.PeerStudy {
|
|
return store.PeerStudy{}
|
|
}
|
|
func (f fakeBackend) Egress(from, to int64) json.RawMessage { return nil }
|
|
func (f fakeBackend) Subscribe() (<-chan store.LiveEvent, func()) {
|
|
return make(chan store.LiveEvent), func() {}
|
|
}
|
|
func (f fakeBackend) SubscribeVisits() (<-chan store.VisitMsg, func()) {
|
|
return make(chan store.VisitMsg), func() {}
|
|
}
|
|
func (f fakeBackend) Online() bool { return true }
|
|
func (f fakeBackend) Location() *store.Location { return nil }
|